From b3db467178465a8783030589452bf7367a1eea42 Mon Sep 17 00:00:00 2001 From: "msvensson@shellback.(none)" <> Date: Fri, 3 Aug 2007 12:36:32 +0200 Subject: [PATCH 01/90] Send output to var/log/mysql-test-run.log to facilitate easier debugging of mysql-test-run.pl --- mysql-test/lib/mtr_process.pl | 21 ++++++------- mysql-test/lib/mtr_report.pl | 55 ++++++++++++++++++++++++++++------- mysql-test/mysql-test-run.pl | 13 +++++---- 3 files changed, 63 insertions(+), 26 deletions(-) diff --git a/mysql-test/lib/mtr_process.pl b/mysql-test/lib/mtr_process.pl index f5ef028fa24..a60b2822a14 100644 --- a/mysql-test/lib/mtr_process.pl +++ b/mysql-test/lib/mtr_process.pl @@ -99,25 +99,26 @@ sub spawn_impl ($$$$$$$) { if ( $::opt_script_debug ) { - print STDERR "\n"; - print STDERR "#### ", "-" x 78, "\n"; - print STDERR "#### ", "STDIN $input\n" if $input; - print STDERR "#### ", "STDOUT $output\n" if $output; - print STDERR "#### ", "STDERR $error\n" if $error; - print STDERR "#### ", "$mode : $path ", join(" ",@$arg_list_t), "\n"; - print STDERR "#### ", "spawn options:\n"; + mtr_report(""); + mtr_debug("-" x 73); + mtr_debug("STDIN $input") if $input; + mtr_debug("STDOUT $output") if $output; + mtr_debug("STDERR $error") if $error; + mtr_debug("$mode: $path ", join(" ",@$arg_list_t)); + mtr_debug("spawn options:"); if ($spawn_opts) { foreach my $key (sort keys %{$spawn_opts}) { - print STDERR "#### ", " - $key: $spawn_opts->{$key}\n"; + mtr_debug(" - $key: $spawn_opts->{$key}"); } } else { - print STDERR "#### ", " none\n"; + mtr_debug(" none"); } - print STDERR "#### ", "-" x 78, "\n"; + mtr_debug("-" x 73); + mtr_report(""); } mtr_error("Can't spawn with empty \"path\"") unless defined $path; diff --git a/mysql-test/lib/mtr_report.pl b/mysql-test/lib/mtr_report.pl index 1abfc6b6b57..0493ecad329 100644 --- a/mysql-test/lib/mtr_report.pl +++ b/mysql-test/lib/mtr_report.pl @@ -19,6 +19,7 @@ # same name. use strict; +use warnings; sub mtr_report_test_name($); sub mtr_report_test_passed($); @@ -97,6 +98,7 @@ sub mtr_show_failed_diff ($) { sub mtr_report_test_name ($) { my $tinfo= shift; + _mtr_log("$tinfo->{name}"); printf "%-30s ", $tinfo->{'name'}; } @@ -106,15 +108,15 @@ sub mtr_report_test_skipped ($) { $tinfo->{'result'}= 'MTR_RES_SKIPPED'; if ( $tinfo->{'disable'} ) { - print "[ disabled ] $tinfo->{'comment'}\n"; + mtr_report("[ disabled ] $tinfo->{'comment'}"); } elsif ( $tinfo->{'comment'} ) { - print "[ skipped ] $tinfo->{'comment'}\n"; + mtr_report("[ skipped ] $tinfo->{'comment'}"); } else { - print "[ skipped ]\n"; + mtr_report("[ skipped ]"); } } @@ -146,7 +148,7 @@ sub mtr_report_test_passed ($) { $timer= sprintf "%12s", $timer; } $tinfo->{'result'}= 'MTR_RES_PASSED'; - print "[ pass ] $timer\n"; + mtr_report("[ pass ] $timer"); } sub mtr_report_test_failed ($) { @@ -155,17 +157,17 @@ sub mtr_report_test_failed ($) { $tinfo->{'result'}= 'MTR_RES_FAILED'; if ( defined $tinfo->{'timeout'} ) { - print "[ fail ] timeout\n"; + mtr_report("[ fail ] timeout"); return; } else { - print "[ fail ]\n"; + mtr_report("[ fail ]"); } if ( $tinfo->{'comment'} ) { - print "\nERROR: $tinfo->{'comment'}\n"; + mtr_report("\nERROR: $tinfo->{'comment'}"); } elsif ( -f $::path_timefile ) { @@ -175,7 +177,7 @@ sub mtr_report_test_failed ($) { } else { - print "\nUnexpected termination, probably when starting mysqld\n"; + mtr_report("\nUnexpected termination, probably when starting mysqld");; } } @@ -243,8 +245,8 @@ sub mtr_report_stats ($) { if ( $::opt_timer ) { - print - "Spent $::glob_tot_real_time seconds actually executing testcases\n" + printf("Spent %.3f seconds actually executing testcases\n", + $::glob_tot_real_time); } # ---------------------------------------------------------------------- @@ -397,35 +399,66 @@ sub mtr_print_header () { ############################################################################## # -# Misc +# Log and reporting functions # ############################################################################## +use IO::File; + +my $log_file_ref= undef; + +sub mtr_log_init ($) { + my ($filename)= @_; + + mtr_error("Log is already open") if defined $log_file_ref; + + $log_file_ref= IO::File->new($filename, "a") or + mtr_warning("Could not create logfile $filename: $!"); +} + +sub _mtr_log (@) { + print $log_file_ref join(" ", @_),"\n" + if defined $log_file_ref; +} + sub mtr_report (@) { + # Print message to screen and log + _mtr_log(@_); print join(" ", @_),"\n"; } sub mtr_warning (@) { + # Print message to screen and log + _mtr_log("WARNING: ", @_); print STDERR "mysql-test-run: WARNING: ",join(" ", @_),"\n"; } sub mtr_error (@) { + # Print message to screen and log + _mtr_log("ERROR: ", @_); print STDERR "mysql-test-run: *** ERROR: ",join(" ", @_),"\n"; mtr_exit(1); } sub mtr_child_error (@) { + # Print message to screen and log + _mtr_log("ERROR(child): ", @_); print STDERR "mysql-test-run: *** ERROR(child): ",join(" ", @_),"\n"; exit(1); } sub mtr_debug (@) { + # Only print if --script-debug is used if ( $::opt_script_debug ) { + _mtr_log("###: ", @_); print STDERR "####: ",join(" ", @_),"\n"; } } + sub mtr_verbose (@) { + # Always print to log, print to screen only when --verbose is used + _mtr_log("> ",@_); if ( $::opt_verbose ) { print STDERR "> ",join(" ", @_),"\n"; diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index c58ed308bd8..208127358c2 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -2891,6 +2891,9 @@ sub initialize_servers () { } } check_running_as_root(); + + mtr_log_init("$opt_vardir/log/mysql-test-run.log"); + } sub mysql_install_db () { @@ -3612,13 +3615,13 @@ sub report_failure_and_restart ($) { # Restore the snapshot of the installed test db restore_installed_db($tinfo->{'name'}); - print "Resuming Tests\n\n"; + mtr_report("Resuming Tests\n"); return; } my $test_mode= join(" ", @::glob_test_mode) || "default"; - print "Aborting: $tinfo->{'name'} failed in $test_mode mode. "; - print "To continue, re-run with '--force'.\n"; + mtr_report("Aborting: $tinfo->{'name'} failed in $test_mode mode. "); + mtr_report("To continue, re-run with '--force'."); if ( ! $glob_debugger and ! $opt_extern and ! $glob_use_embedded_server ) @@ -4076,11 +4079,11 @@ sub mysqld_start ($$$) { sub stop_all_servers () { - print "Stopping All Servers\n"; + mtr_report("Stopping All Servers"); if ( ! $opt_skip_im ) { - print "Shutting-down Instance Manager\n"; + mtr_report("Shutting-down Instance Manager"); unless (mtr_im_stop($instance_manager, "stop_all_servers")) { mtr_error("Failed to stop Instance Manager.") From ea692e9028bdb3d1fc03b9ae568717d5e48ccbed Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.(none)" <> Date: Fri, 3 Aug 2007 12:50:00 +0200 Subject: [PATCH 02/90] Improve report on test execution time Define tot_real_tim locally in mtr_report.pl --- mysql-test/lib/mtr_report.pl | 11 ++++++++--- mysql-test/mysql-test-run.pl | 1 - 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/mysql-test/lib/mtr_report.pl b/mysql-test/lib/mtr_report.pl index 1abfc6b6b57..69a7abec465 100644 --- a/mysql-test/lib/mtr_report.pl +++ b/mysql-test/lib/mtr_report.pl @@ -38,6 +38,9 @@ sub mtr_child_error (@); sub mtr_debug (@); sub mtr_verbose (@); +my $tot_real_time= 0; + + ############################################################################## # @@ -142,7 +145,7 @@ sub mtr_report_test_passed ($) { if ( $::opt_timer and -f "$::opt_vardir/log/timer" ) { $timer= mtr_fromfile("$::opt_vardir/log/timer"); - $::glob_tot_real_time += ($timer/1000); + $tot_real_time += ($timer/1000); $timer= sprintf "%12s", $timer; } $tinfo->{'result'}= 'MTR_RES_PASSED'; @@ -243,8 +246,10 @@ sub mtr_report_stats ($) { if ( $::opt_timer ) { - print - "Spent $::glob_tot_real_time seconds actually executing testcases\n" + use English; + + mtr_report("Spent", sprintf("%.3f", $tot_real_time),"of", + time - $BASETIME, "seconds executing testcases"); } # ---------------------------------------------------------------------- diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 43b1ef7ac86..b072298756f 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -307,7 +307,6 @@ our @data_dir_lst; our $used_binlog_format; our $used_default_engine; our $debug_compiled_binaries; -our $glob_tot_real_time= 0; our %mysqld_variables; From 7e86c5971ac9db1cd327a7a8d95dc825c01cb69a Mon Sep 17 00:00:00 2001 From: "msvensson@shellback.(none)" <> Date: Fri, 3 Aug 2007 12:54:06 +0200 Subject: [PATCH 03/90] Remove the temporary file created by mysql_upgrade --- client/mysql_upgrade.c | 1 + 1 file changed, 1 insertion(+) diff --git a/client/mysql_upgrade.c b/client/mysql_upgrade.c index 64de3d19882..13f5d2606a9 100644 --- a/client/mysql_upgrade.c +++ b/client/mysql_upgrade.c @@ -457,6 +457,7 @@ static int run_query(const char *query, DYNAMIC_STRING *ds_res, NULL); my_close(fd, MYF(0)); + my_delete(query_file_path, MYF(0)); DBUG_RETURN(ret); } From d6f02500af0290a3f0fa873cafb08fe8d2f24401 Mon Sep 17 00:00:00 2001 From: "msvensson@shellback.(none)" <> Date: Fri, 3 Aug 2007 12:56:45 +0200 Subject: [PATCH 04/90] Cleanup created procedures in sp.test --- mysql-test/r/sp.result | 1 + mysql-test/t/sp.test | 1 + 2 files changed, 2 insertions(+) diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index 7a4deb3ea5f..481ddcd838e 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -5743,6 +5743,7 @@ bug23760_rc_test(ROW_COUNT()) DROP TABLE bug23760, bug23760_log| DROP PROCEDURE bug23760_update_log| DROP PROCEDURE bug23760_test_row_count| +DROP PROCEDURE bug23760_test_row_count2| DROP FUNCTION bug23760_rc_test| DROP PROCEDURE IF EXISTS bug24117| DROP TABLE IF EXISTS t3| diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test index ef66f1c98f0..c98d12a34a6 100644 --- a/mysql-test/t/sp.test +++ b/mysql-test/t/sp.test @@ -6710,6 +6710,7 @@ SELECT bug23760_rc_test(ROW_COUNT())| DROP TABLE bug23760, bug23760_log| DROP PROCEDURE bug23760_update_log| DROP PROCEDURE bug23760_test_row_count| +DROP PROCEDURE bug23760_test_row_count2| DROP FUNCTION bug23760_rc_test| # From cc00660f954891c4b0fb1ec448b744561fd63bd1 Mon Sep 17 00:00:00 2001 From: "msvensson@shellback.(none)" <> Date: Fri, 3 Aug 2007 13:12:53 +0200 Subject: [PATCH 05/90] WL#3935 Improve mysqltest report and exitcode for diff - Move the code to generate test report to the test tool(in this case mysqltest) where the best control of what failed is - Simplify the code in mysql-test-run.pl - mysqltest will now find what diff to use in a best effort attempt using "diff -u", "diff -c" and finally dumping the two files verbatim in the report. --- client/mysqltest.c | 561 +++++++++++++++++++++++++--------- mysql-test/lib/mtr_report.pl | 61 +--- mysql-test/mysql-test-run.pl | 9 +- mysql-test/r/mysqltest.result | 3 +- mysql-test/t/mysqltest.test | 57 +++- 5 files changed, 479 insertions(+), 212 deletions(-) diff --git a/client/mysqltest.c b/client/mysqltest.c index d1ec753b54b..337a31ad7af 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -74,18 +74,12 @@ #define QUERY_SEND_FLAG 1 #define QUERY_REAP_FLAG 2 - enum { - RESULT_OK= 0, - RESULT_CONTENT_MISMATCH= 1, - RESULT_LENGTH_MISMATCH= 2 - }; - enum { OPT_SKIP_SAFEMALLOC=256, OPT_SSL_SSL, OPT_SSL_KEY, OPT_SSL_CERT, OPT_SSL_CA, OPT_SSL_CAPATH, OPT_SSL_CIPHER, OPT_PS_PROTOCOL, OPT_SP_PROTOCOL, OPT_CURSOR_PROTOCOL, OPT_VIEW_PROTOCOL, OPT_SSL_VERIFY_SERVER_CERT, OPT_MAX_CONNECT_RETRIES, - OPT_MARK_PROGRESS, OPT_CHARSETS_DIR, OPT_LOG_DIR + OPT_MARK_PROGRESS, OPT_CHARSETS_DIR, OPT_LOG_DIR, OPT_TAIL_LINES }; static int record= 0, opt_sleep= -1; @@ -117,6 +111,9 @@ static char line_buffer[MAX_DELIMITER_LENGTH], *line_buffer_pos= line_buffer; static uint start_lineno= 0; /* Start line of current command */ +/* Number of lines of the result to include in failure report */ +static uint opt_tail_lines= 0; + static char delimiter[MAX_DELIMITER_LENGTH]= ";"; static uint delimiter_length= 1; @@ -455,7 +452,6 @@ void free_tmp_sh_file(); void free_win_path_patterns(); #endif -static int eval_result = 0; /* For replace_column */ static char *replace_column[MAX_COLUMNS]; @@ -881,6 +877,24 @@ void die(const char *fmt, ...) fprintf(stderr, "\n"); fflush(stderr); + /* Show results from queries just before failure */ + if (ds_res.length && opt_tail_lines) + { + int tail_lines= opt_tail_lines; + char* show_from= ds_res.str + ds_res.length - 1; + while(show_from > ds_res.str && tail_lines > 0 ) + { + show_from--; + if (*show_from == '\n') + tail_lines--; + } + fprintf(stderr, "\nThe result from queries just before the failure was:\n"); + if (show_from > ds_res.str) + fprintf(stderr, "< snip >"); + fprintf(stderr, "%s", show_from); + fflush(stderr); + } + /* Dump the result that has been accumulated so far to .log file */ if (result_file_name && ds_res.length) dump_result_to_log_file(ds_res.str, ds_res.length); @@ -1009,77 +1023,372 @@ void log_msg(const char *fmt, ...) /* - Compare content of the string ds to content of file fname + Read a file and append it to ds + + SYNOPSIS + cat_file + ds - pointer to dynamic string where to add the files content + filename - name of the file to read + +*/ + +void cat_file(DYNAMIC_STRING* ds, const char* filename) +{ + int fd; + uint len; + char buff[512]; + + if ((fd= my_open(filename, O_RDONLY, MYF(0))) < 0) + die("Failed to open file %s", filename); + while((len= my_read(fd, (byte*)&buff, + sizeof(buff), MYF(0))) > 0) + { + char *p= buff, *start= buff; + while (p < buff+len) + { + /* Convert cr/lf to lf */ + if (*p == '\r' && *(p+1) && *(p+1)== '\n') + { + /* Add fake newline instead of cr and output the line */ + *p= '\n'; + p++; /* Step past the "fake" newline */ + dynstr_append_mem(ds, start, p-start); + p++; /* Step past the "fake" newline */ + start= p; + } + else + p++; + } + /* Output any chars that migh be left */ + dynstr_append_mem(ds, start, p-start); + } + my_close(fd, MYF(0)); +} + + +/* + Run the specified command with popen + + SYNOPSIS + run_command + cmd - command to execute(should be properly quoted + ds_res- pointer to dynamic string where to store the result + +*/ + +static int run_command(char* cmd, + DYNAMIC_STRING *ds_res) +{ + char buf[512]= {0}; + FILE *res_file; + int error; + + if (!(res_file= popen(cmd, "r"))) + die("popen(\"%s\", \"r\") failed", cmd); + + while (fgets(buf, sizeof(buf), res_file)) + { + DBUG_PRINT("info", ("buf: %s", buf)); + if(ds_res) + { + /* Save the output of this command in the supplied string */ + dynstr_append(ds_res, buf); + } + else + { + /* Print it directly on screen */ + fprintf(stdout, "%s", buf); + } + } + + error= pclose(res_file); + return WEXITSTATUS(error); +} + + +/* + Run the specified tool with variable number of arguments + + SYNOPSIS + run_tool + tool_path - the name of the tool to run + ds_res - pointer to dynamic string where to store the result + ... - variable number of arguments that will be properly + quoted and appended after the tool's name + +*/ + +static int run_tool(const char *tool_path, DYNAMIC_STRING *ds_res, ...) +{ + int ret; + const char* arg; + va_list args; + DYNAMIC_STRING ds_cmdline; + + DBUG_ENTER("run_tool"); + DBUG_PRINT("enter", ("tool_path: %s", tool_path)); + + if (init_dynamic_string(&ds_cmdline, IF_WIN("\"", ""), FN_REFLEN, FN_REFLEN)) + die("Out of memory"); + + dynstr_append_os_quoted(&ds_cmdline, tool_path, NullS); + dynstr_append(&ds_cmdline, " "); + + va_start(args, ds_res); + + while ((arg= va_arg(args, char *))) + { + /* Options should be os quoted */ + if (strncmp(arg, "--", 2) == 0) + dynstr_append_os_quoted(&ds_cmdline, arg, NullS); + else + dynstr_append(&ds_cmdline, arg); + dynstr_append(&ds_cmdline, " "); + } + + va_end(args); + +#ifdef __WIN__ + dynstr_append(&ds_cmdline, "\""); +#endif + + DBUG_PRINT("info", ("Running: %s", ds_cmdline.str)); + ret= run_command(ds_cmdline.str, ds_res); + DBUG_PRINT("exit", ("ret: %d", ret)); + dynstr_free(&ds_cmdline); + DBUG_RETURN(ret); +} + + +/* + Show the diff of two files using the systems builtin diff + command. If no such diff command exist, just dump the content + of the two files and inform about how to get "diff" + + SYNOPSIS + show_diff + ds - pointer to dynamic string where to add the diff(may be NULL) + filename1 - name of first file + filename2 - name of second file + +*/ + +void show_diff(DYNAMIC_STRING* ds, + const char* filename1, const char* filename2) +{ + + DYNAMIC_STRING ds_tmp; + + if (init_dynamic_string(&ds_tmp, "", 256, 256)) + die("Out of memory"); + + /* First try with unified diff */ + if (run_tool("diff", + &ds_tmp, /* Get output from diff in ds_tmp */ + "-u", + filename1, + filename2, + "2>&1", + NULL) > 1) /* Most "diff" tools return >1 if error */ + { + dynstr_set(&ds_tmp, ""); + + /* Fallback to context diff with "diff -c" */ + if (run_tool("diff", + &ds_tmp, /* Get output from diff in ds_tmp */ + "-c", + filename1, + filename2, + "2>&1", + NULL) > 1) /* Most "diff" tools return >1 if error */ + { + /* + Fallback to dump both files to result file and inform + about installing "diff" + */ + dynstr_set(&ds_tmp, ""); + + dynstr_append(&ds_tmp, +"\n" +"The two files differ but it was not possible to execute 'diff' in\n" +"order to show only the difference, tried both 'diff -u' or 'diff -c'.\n" +"Instead the whole content of the two files was shown for you to diff manually. ;)\n\n" +"To get a better report you should install 'diff' on your system, which you\n" +"for example can get from http://www.gnu.org/software/diffutils/diffutils.html\n" +#ifdef __WIN__ +"or http://gnuwin32.sourceforge.net/packages/diffutils.htm\n" +#endif +"\n"); + + dynstr_append(&ds_tmp, " --- "); + dynstr_append(&ds_tmp, filename1); + dynstr_append(&ds_tmp, " >>>\n"); + cat_file(&ds_tmp, filename1); + dynstr_append(&ds_tmp, "<<<\n --- "); + dynstr_append(&ds_tmp, filename1); + dynstr_append(&ds_tmp, " >>>\n"); + cat_file(&ds_tmp, filename2); + dynstr_append(&ds_tmp, "<<<<\n"); + } + } + + if (ds) + { + /* Add the diff to output */ + dynstr_append_mem(ds, ds_tmp.str, ds_tmp.length); + } + else + { + /* Print diff directly to stdout */ + fprintf(stderr, "%s", ds_tmp.str); + } + + dynstr_free(&ds_tmp); + +} + + +enum compare_files_result_enum { + RESULT_OK= 0, + RESULT_CONTENT_MISMATCH= 1, + RESULT_LENGTH_MISMATCH= 2 +}; + +/* + Compare two files, given a fd to the first file and + name of the second file + + SYNOPSIS + compare_files2 + fd - Open file descriptor of the first file + filename2 - Name of second file + + RETURN VALUES + According to the values in "compare_files_result_enum" + +*/ + +int compare_files2(File fd, const char* filename2) +{ + int error= RESULT_OK; + File fd2; + uint len, len2; + char buff[512], buff2[512]; + + if ((fd2= my_open(filename2, O_RDONLY, MYF(0))) < 0) + { + my_close(fd, MYF(0)); + die("Failed to open second file: %s", filename2); + } + while((len= my_read(fd, (byte*)&buff, + sizeof(buff), MYF(0))) > 0) + { + if ((len2= my_read(fd2, (byte*)&buff2, + sizeof(buff2), MYF(0))) < len) + { + /* File 2 was smaller */ + error= RESULT_LENGTH_MISMATCH; + break; + } + if (len2 > len) + { + /* File 1 was smaller */ + error= RESULT_LENGTH_MISMATCH; + break; + } + if ((memcmp(buff, buff2, len))) + { + /* Content of this part differed */ + error= RESULT_CONTENT_MISMATCH; + break; + } + } + if (!error && my_read(fd2, (byte*)&buff2, + sizeof(buff2), MYF(0)) > 0) + { + /* File 1 was smaller */ + error= RESULT_LENGTH_MISMATCH; + } + + my_close(fd2, MYF(0)); + + return error; +} + + +/* + Compare two files, given their filenames + + SYNOPSIS + compare_files + filename1 - Name of first file + filename2 - Name of second file + + RETURN VALUES + See 'compare_files2' + +*/ + +int compare_files(const char* filename1, const char* filename2) +{ + File fd; + int error; + + if ((fd= my_open(filename1, O_RDONLY, MYF(0))) < 0) + die("Failed to open first file: %s", filename1); + + error= compare_files2(fd, filename2); + + my_close(fd, MYF(0)); + + return error; +} + + +/* + Compare content of the string in ds to content of file fname + + SYNOPSIS + dyn_string_cmp + ds - Dynamic string containing the string o be compared + fname - Name of file to compare with + + RETURN VALUES + See 'compare_files2' */ int dyn_string_cmp(DYNAMIC_STRING* ds, const char *fname) { - MY_STAT stat_info; - char *tmp, *res_ptr; - char eval_file[FN_REFLEN]; - int res; - uint res_len; - int fd; - DYNAMIC_STRING res_ds; + int error; + File fd; + char ds_temp_file_path[FN_REFLEN]; + DBUG_ENTER("dyn_string_cmp"); + DBUG_PRINT("enter", ("fname: %s", fname)); - if (!test_if_hard_path(fname)) - { - strxmov(eval_file, opt_basedir, fname, NullS); - fn_format(eval_file, eval_file, "", "", MY_UNPACK_FILENAME); - } - else - fn_format(eval_file, fname, "", "", MY_UNPACK_FILENAME); + if ((fd= create_temp_file(ds_temp_file_path, NULL, + "tmp", O_CREAT | O_SHARE | O_RDWR, + MYF(MY_WME))) < 0) + die("Failed to create temporary file for ds"); - if (!my_stat(eval_file, &stat_info, MYF(MY_WME))) - die(NullS); - if (!eval_result && (uint) stat_info.st_size != ds->length) + /* Write ds to temporary file and set file pos to beginning*/ + if (my_write(fd, ds->str, ds->length, + MYF(MY_FNABP | MY_WME)) || + my_seek(fd, 0, SEEK_SET, MYF(0)) == MY_FILEPOS_ERROR) { - DBUG_PRINT("info",("Size differs: result size: %u file size: %lu", - ds->length, (ulong) stat_info.st_size)); - DBUG_PRINT("info",("result: '%s'", ds->str)); - DBUG_RETURN(RESULT_LENGTH_MISMATCH); - } - if (!(tmp = (char*) my_malloc(stat_info.st_size + 1, MYF(MY_WME)))) - die("Out of memory"); - - if ((fd = my_open(eval_file, O_RDONLY, MYF(MY_WME))) < 0) - die("Failed to open file %s", eval_file); - if (my_read(fd, (byte*)tmp, stat_info.st_size, MYF(MY_WME|MY_NABP))) - die("Failed to read from file %s, errno: %d", eval_file, errno); - tmp[stat_info.st_size] = 0; - init_dynamic_string(&res_ds, "", stat_info.st_size+256, 256); - if (eval_result) - { - do_eval(&res_ds, tmp, tmp + stat_info.st_size, FALSE); - res_ptr= res_ds.str; - res_len= res_ds.length; - if (res_len != ds->length) - { - res= RESULT_LENGTH_MISMATCH; - goto err; - } - } - else - { - res_ptr = tmp; - res_len = stat_info.st_size; + my_close(fd, MYF(0)); + /* Remove the temporary file */ + my_delete(ds_temp_file_path, MYF(0)); + die("Failed to write to '%s'", ds_temp_file_path); } - res= (memcmp(res_ptr, ds->str, res_len)) ? - RESULT_CONTENT_MISMATCH : RESULT_OK; + error= compare_files2(fd, fname); -err: - if (res && eval_result) - str_to_file(fn_format(eval_file, fname, "", ".eval", - MY_REPLACE_EXT), - res_ptr, res_len); + my_close(fd, MYF(0)); + /* Remove the temporary file */ + my_delete(ds_temp_file_path, MYF(0)); - dynstr_free(&res_ds); - my_free((gptr) tmp, MYF(0)); - my_close(fd, MYF(MY_WME)); - - DBUG_RETURN(res); + DBUG_RETURN(error); } @@ -1097,21 +1406,34 @@ err: void check_result(DYNAMIC_STRING* ds) { + const char* mess= "Result content mismatch\n"; + DBUG_ENTER("check_result"); DBUG_ASSERT(result_file_name); + DBUG_PRINT("enter", ("result_file_name: %s", result_file_name)); switch (dyn_string_cmp(ds, result_file_name)) { case RESULT_OK: break; /* ok */ case RESULT_LENGTH_MISMATCH: - dump_result_to_reject_file(ds->str, ds->length); - die("Result length mismatch"); - break; + mess= "Result length mismatch\n"; + /* Fallthrough */ case RESULT_CONTENT_MISMATCH: - dump_result_to_reject_file(ds->str, ds->length); - die("Result content mismatch"); + { + /* Result mismatched, dump results to .reject file and then show the diff */ + char reject_file[FN_REFLEN]; + fn_format(reject_file, result_file_name, "", ".reject", + MY_REPLACE_EXT); + DBUG_PRINT("enter", ("reject_file_name: %s", reject_file)); + str_to_file(reject_file, ds->str, ds->length); + + dynstr_set(ds, NULL); /* Don't create a .log file */ + + show_diff(NULL, result_file_name, reject_file); + die(mess); break; + } default: /* impossible */ die("Unknown error code from dyn_string_cmp()"); } @@ -1126,7 +1448,7 @@ void check_result(DYNAMIC_STRING* ds) indicating that test is not supported SYNOPSIS - check_result + check_require ds - content to be checked fname - name of file to check against @@ -1530,7 +1852,7 @@ void var_query_set(VAR *var, const char *query, const char** query_end) void var_set_query_get_value(struct st_command *command, VAR *var) { - ulong row_no; + long row_no; int col_no= -1; MYSQL_RES* res; MYSQL* mysql= &cur_con->mysql; @@ -1602,7 +1924,7 @@ void var_set_query_get_value(struct st_command *command, VAR *var) { /* Get the value */ MYSQL_ROW row; - ulong rows= 0; + long rows= 0; const char* value= "No such row"; while ((row= mysql_fetch_row(res))) @@ -2438,9 +2760,6 @@ void do_append_file(struct st_command *command) void do_cat_file(struct st_command *command) { - int fd; - uint len; - char buff[512]; static DYNAMIC_STRING ds_filename; const struct command_arg cat_file_args[] = { "filename", ARG_STRING, TRUE, &ds_filename, "File to read from" @@ -2455,37 +2774,13 @@ void do_cat_file(struct st_command *command) DBUG_PRINT("info", ("Reading from, file: %s", ds_filename.str)); - if ((fd= my_open(ds_filename.str, O_RDONLY, MYF(0))) < 0) - die("Failed to open file %s", ds_filename.str); - while((len= my_read(fd, (byte*)&buff, - sizeof(buff), MYF(0))) > 0) - { - char *p= buff, *start= buff; - while (p < buff+len) - { - /* Convert cr/lf to lf */ - if (*p == '\r' && *(p+1) && *(p+1)== '\n') - { - /* Add fake newline instead of cr and output the line */ - *p= '\n'; - p++; /* Step past the "fake" newline */ - dynstr_append_mem(&ds_res, start, p-start); - p++; /* Step past the "fake" newline */ - start= p; - } - else - p++; - } - /* Output any chars that migh be left */ - dynstr_append_mem(&ds_res, start, p-start); - } - my_close(fd, MYF(0)); + cat_file(&ds_res, ds_filename.str); + dynstr_free(&ds_filename); DBUG_VOID_RETURN; } - /* SYNOPSIS do_diff_files @@ -2501,9 +2796,6 @@ void do_cat_file(struct st_command *command) void do_diff_files(struct st_command *command) { int error= 0; - int fd, fd2; - uint len, len2; - char buff[512], buff2[512]; static DYNAMIC_STRING ds_filename; static DYNAMIC_STRING ds_filename2; const struct command_arg diff_file_args[] = { @@ -2518,39 +2810,14 @@ void do_diff_files(struct st_command *command) sizeof(diff_file_args)/sizeof(struct command_arg), ' '); - if ((fd= my_open(ds_filename.str, O_RDONLY, MYF(0))) < 0) - die("Failed to open first file %s", ds_filename.str); - if ((fd2= my_open(ds_filename2.str, O_RDONLY, MYF(0))) < 0) + if ((error= compare_files(ds_filename.str, ds_filename2.str))) { - my_close(fd, MYF(0)); - die("Failed to open second file %s", ds_filename2.str); - } - while((len= my_read(fd, (byte*)&buff, - sizeof(buff), MYF(0))) > 0) - { - if ((len2= my_read(fd2, (byte*)&buff2, - sizeof(buff2), MYF(0))) != len) - { - /* File 2 was smaller */ - error= 1; - break; - } - if ((memcmp(buff, buff2, len))) - { - /* Content of this part differed */ - error= 1; - break; - } - } - if (my_read(fd2, (byte*)&buff2, - sizeof(buff2), MYF(0)) > 0) - { - /* File 1 was smaller */ - error= 1; + /* Compare of the two files failed, append them to output + so the failure can be analyzed + */ + show_diff(&ds_res, ds_filename.str, ds_filename2.str); } - my_close(fd, MYF(0)); - my_close(fd2, MYF(0)); dynstr_free(&ds_filename); dynstr_free(&ds_filename2); handle_command_error(command, error); @@ -4408,7 +4675,7 @@ void check_eol_junk(const char *eol) terminated by new line '\n' regardless how many "delimiter" it contain. */ -#define MAX_QUERY (256*1024) /* 256K -- a test in sp-big is >128K */ +#define MAX_QUERY (256*1024*2) /* 256K -- a test in sp-big is >128K */ static char read_command_buf[MAX_QUERY]; int read_command(struct st_command** command_ptr) @@ -4542,6 +4809,10 @@ static struct my_option my_long_options[] = {"sp-protocol", OPT_SP_PROTOCOL, "Use stored procedures for select", (gptr*) &sp_protocol, (gptr*) &sp_protocol, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"tail-lines", OPT_TAIL_LINES, + "Number of lines of the resul to include in a failure report", + (gptr*) &opt_tail_lines, (gptr*) &opt_tail_lines, 0, + GET_INT, REQUIRED_ARG, 0, 0, 10000, 0, 0, 0}, #include "sslopt-longopts.h" {"test-file", 'x', "Read test from/in this file (default stdin).", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, @@ -4793,14 +5064,6 @@ void str_to_file(const char *fname, char *str, int size) } -void dump_result_to_reject_file(char *buf, int size) -{ - char reject_file[FN_REFLEN]; - str_to_file(fn_format(reject_file, result_file_name, "", ".reject", - MY_REPLACE_EXT), - buf, size); -} - void dump_result_to_log_file(char *buf, int size) { char log_file[FN_REFLEN]; @@ -4808,6 +5071,8 @@ void dump_result_to_log_file(char *buf, int size) *opt_logdir ? MY_REPLACE_DIR | MY_REPLACE_EXT : MY_REPLACE_EXT), buf, size); + fprintf(stderr, "\nMore results from queries before failure can be found in %s\n", + log_file); } void dump_progress(void) @@ -5792,7 +6057,7 @@ void run_query(struct st_connection *cn, struct st_command *command, int flags) init_dynamic_string(&ds_warnings, NULL, 0, 256); - /* Scan for warning before sendign to server */ + /* Scan for warning before sending to server */ scan_command_for_warnings(command); /* @@ -6424,7 +6689,7 @@ int main(int argc, char **argv) break; case Q_LET: do_let(command); break; case Q_EVAL_RESULT: - eval_result = 1; break; + die("'eval_result' command is deprecated"); case Q_EVAL: case Q_QUERY_VERTICAL: case Q_QUERY_HORIZONTAL: diff --git a/mysql-test/lib/mtr_report.pl b/mysql-test/lib/mtr_report.pl index 1abfc6b6b57..aa83d42acc7 100644 --- a/mysql-test/lib/mtr_report.pl +++ b/mysql-test/lib/mtr_report.pl @@ -26,7 +26,6 @@ sub mtr_report_test_failed($); sub mtr_report_test_skipped($); sub mtr_report_test_not_skipped_though_disabled($); -sub mtr_show_failed_diff ($); sub mtr_report_stats ($); sub mtr_print_line (); sub mtr_print_thick_line (); @@ -45,55 +44,6 @@ sub mtr_verbose (@); # ############################################################################## -# We can't use diff -u or diff -a as these are not portable - -sub mtr_show_failed_diff ($) { - my $result_file_name= shift; - - # The reject and log files have been dumped to - # to filenames based on the result_file's name - my $tname= basename($result_file_name); - $tname=~ s/\..*$//; - - my $reject_file= "r/$tname.reject"; - my $result_file= "r/$tname.result"; - my $log_file= "r/$tname.log"; - my $eval_file= "r/$tname.eval"; - - if ( $::opt_suite ne "main" ) - { - $reject_file= "$::glob_mysql_test_dir/suite/$::opt_suite/$reject_file"; - $result_file= "$::glob_mysql_test_dir/suite/$::opt_suite/$result_file"; - $eval_file= "$::glob_mysql_test_dir/suite/$::opt_suite/$eval_file"; - $log_file= "$::glob_mysql_test_dir/suite/$::opt_suite/$log_file"; - } - - if ( -f $eval_file ) - { - $result_file= $eval_file; - } - - my $diffopts= $::opt_udiff ? "-u" : "-c"; - - if ( -f $reject_file ) - { - print "Below are the diffs between actual and expected results:\n"; - print "-------------------------------------------------------\n"; - # FIXME check result code?! - mtr_run("diff",[$diffopts,$result_file,$reject_file], "", "", "", ""); - print "-------------------------------------------------------\n"; - print "Please follow the instructions outlined at\n"; - print "http://www.mysql.com/doc/en/Reporting_mysqltest_bugs.html\n"; - print "to find the reason to this problem and how to report this.\n\n"; - } - - if ( -f $log_file ) - { - print "Result from queries before failure can be found in $log_file\n"; - # FIXME Maybe a tail -f -n 10 $log_file here - } -} - sub mtr_report_test_name ($) { my $tinfo= shift; @@ -165,16 +115,23 @@ sub mtr_report_test_failed ($) { if ( $tinfo->{'comment'} ) { + # The test failure has been detected by mysql-test-run.pl + # when starting the servers or due to other error, the reason for + # failing the test is saved in "comment" print "\nERROR: $tinfo->{'comment'}\n"; } elsif ( -f $::path_timefile ) { - print "\nErrors are (from $::path_timefile) :\n"; + # Test failure was detected by test tool and it's report + # about what failed has been saved to file. Display the report. + print "\n"; print mtr_fromfile($::path_timefile); # FIXME print_file() instead - print "\n(the last lines may be the most important ones)\n"; + print "\n"; } else { + # Neither this script or the test tool has recorded info + # about why the test has failed. Should be debugged. print "\nUnexpected termination, probably when starting mysqld\n"; } } diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index c58ed308bd8..8422d749c08 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -83,7 +83,6 @@ require "lib/mtr_io.pl"; require "lib/mtr_gcov.pl"; require "lib/mtr_gprof.pl"; require "lib/mtr_report.pl"; -require "lib/mtr_diff.pl"; require "lib/mtr_match.pl"; require "lib/mtr_misc.pl"; require "lib/mtr_stress.pl"; @@ -281,8 +280,6 @@ our $opt_wait_for_slave; our $opt_warnings; -our $opt_udiff; - our $opt_skip_ndbcluster= 0; our $opt_skip_ndbcluster_slave= 0; our $opt_with_ndbcluster= 0; @@ -619,7 +616,6 @@ sub command_line_setup () { 'start-dirty' => \$opt_start_dirty, 'start-and-exit' => \$opt_start_and_exit, 'timer!' => \$opt_timer, - 'unified-diff|udiff' => \$opt_udiff, 'user=s' => \$opt_user, 'testcase-timeout=i' => \$opt_testcase_timeout, 'suite-timeout=i' => \$opt_suite_timeout, @@ -3603,7 +3599,6 @@ sub report_failure_and_restart ($) { my $tinfo= shift; mtr_report_test_failed($tinfo); - mtr_show_failed_diff($tinfo->{'result_file'}); print "\n"; if ( $opt_force ) { @@ -4788,6 +4783,9 @@ sub run_mysqltest ($) { mtr_add_arg($args, "--test-file=%s", $tinfo->{'path'}); + # Number of lines of resut to include in failure report + mtr_add_arg($args, "--tail-lines=20"); + if ( defined $tinfo->{'result_file'} ) { mtr_add_arg($args, "--result-file=%s", $tinfo->{'result_file'}); } @@ -5199,7 +5197,6 @@ Misc options fast Don't try to clean up from earlier runs reorder Reorder tests to get fewer server restarts help Get this help text - unified-diff | udiff When presenting differences, use unified diff testcase-timeout=MINUTES Max test case run time (default $default_testcase_timeout) suite-timeout=MINUTES Max test suite run time (default $default_suite_timeout) diff --git a/mysql-test/r/mysqltest.result b/mysql-test/r/mysqltest.result index 55f78d22272..300ca69f2b4 100644 --- a/mysql-test/r/mysqltest.result +++ b/mysql-test/r/mysqltest.result @@ -461,7 +461,6 @@ root@localhost -------------------------------------------------------------------------------- this will be executed this will be executed -mysqltest: Result length mismatch mysqltest: The test didn't produce any output Failing multi statement query mysqltest: At line 3: query 'create table t1 (a int primary key); @@ -473,6 +472,8 @@ mysqltest: At line 3: query 'create table t1 (a int primary key); insert into t1 values (1); select 'select-me'; insertz 'error query'' failed: 1064: 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 'insertz 'error query'' at line 1 + +More results from queries before failure can be found in MYSQLTEST_VARDIR/tmp/bug11731.log drop table t1; Multi statement using expected error create table t1 (a int primary key); diff --git a/mysql-test/t/mysqltest.test b/mysql-test/t/mysqltest.test index b01579dce53..9c29840ba9b 100644 --- a/mysql-test/t/mysqltest.test +++ b/mysql-test/t/mysqltest.test @@ -436,6 +436,8 @@ EOF --error 1 --exec $MYSQL_TEST < $MYSQLTEST_VARDIR/tmp/mysqltest.sql 2>&1 +remove_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql; + # # Extra delimiter # @@ -786,6 +788,7 @@ echo $var3_var3; --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --error 1 --exec echo "source $MYSQLTEST_VARDIR/tmp/recursive.sql;" | $MYSQL_TEST 2>&1 +remove_file $MYSQLTEST_VARDIR/tmp/recursive.sql; # Source a file with error --exec echo "garbage ;" > $MYSQLTEST_VARDIR/tmp/error.sql @@ -793,6 +796,7 @@ echo $var3_var3; --error 1 --exec echo "source $MYSQLTEST_VARDIR/tmp/error.sql;" | $MYSQL_TEST 2>&1 +remove_file $MYSQLTEST_VARDIR/tmp/error.sql; # Test execution of source in a while loop --write_file $MYSQLTEST_VARDIR/tmp/sourced.inc @@ -1171,6 +1175,8 @@ EOF --error 1 --exec $MYSQL_TEST < $MYSQLTEST_VARDIR/tmp/mysqltest.sql 2>&1 +remove_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql; + # ---------------------------------------------------------------------------- # Test error messages returned from comments starting with a command # ---------------------------------------------------------------------------- @@ -1296,6 +1302,8 @@ EOF --error 1 --exec echo "source $MYSQLTEST_VARDIR/tmp/mysqltest.sql;" | $MYSQL_TEST 2>&1 +remove_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql; + # connect when "disable_abort_on_error" caused "connection not found" --replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT --disable_abort_on_error @@ -1399,7 +1407,11 @@ select "this will be executed"; --exec touch $MYSQLTEST_VARDIR/tmp/zero_length_file.result --exec echo "echo ok;" > $MYSQLTEST_VARDIR/tmp/query.sql --error 1 ---exec $MYSQL_TEST -x $MYSQLTEST_VARDIR/tmp/query.sql -R $MYSQLTEST_VARDIR/tmp/zero_length_file.result 2>&1 +--exec $MYSQL_TEST -x $MYSQLTEST_VARDIR/tmp/query.sql -R $MYSQLTEST_VARDIR/tmp/zero_length_file.result > /dev/null 2>&1 + +remove_file $MYSQLTEST_VARDIR/tmp/zero_length_file.result; +remove_file $MYSQLTEST_VARDIR/tmp/zero_length_file.reject; + # # Test that a test file that does not generate any output fails. # @@ -1407,6 +1419,8 @@ select "this will be executed"; --error 1 --exec $MYSQL_TEST -x $MYSQLTEST_VARDIR/tmp/query.sql 2>&1 +remove_file $MYSQLTEST_VARDIR/tmp/query.sql; + # # Test that mysqltest fails when there are no queries executed # but a result file exists @@ -1436,6 +1450,7 @@ echo Failing multi statement query; --exec $MYSQL_TEST -x $MYSQLTEST_VARDIR/tmp/bug11731.sql 2>&1 drop table t1; +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --error 1 --exec $MYSQL_TEST --record -x $MYSQLTEST_VARDIR/tmp/bug11731.sql -R $MYSQLTEST_VARDIR/tmp/bug11731.out 2>&1 # The .out file should be non existent @@ -1462,6 +1477,9 @@ drop table t1; # The .out file should exist --exec test -s $MYSQLTEST_VARDIR/tmp/bug11731.out drop table t1; +remove_file $MYSQLTEST_VARDIR/tmp/bug11731.out; +remove_file $MYSQLTEST_VARDIR/tmp/bug11731.log; +remove_file $MYSQLTEST_VARDIR/tmp/bug11731.sql; # # Bug#19890 mysqltest: "query" command is broken @@ -1607,19 +1625,48 @@ for diff_file command of mysqltest EOF +--write_file $MYSQLTEST_VARDIR/tmp/diff4.tmp +Some data +for diff_file command +of musqltest +EOF + # Compare equal files --diff_files $MYSQLTEST_VARDIR/tmp/diff1.tmp $MYSQLTEST_VARDIR/tmp/diff2.tmp --diff_files $MYSQLTEST_VARDIR/tmp/diff2.tmp $MYSQLTEST_VARDIR/tmp/diff1.tmp -# Compare files that differ ---error 1 ---diff_files $MYSQLTEST_VARDIR/tmp/diff3.tmp $MYSQLTEST_VARDIR/tmp/diff2.tmp ---error 1 +# Write the below commands to a intermediary file and execute them with +# mysqltest in --exec, since the output will vary depending on what "diff" +# is available it is sent to /dev/null +--write_file $MYSQLTEST_VARDIR/tmp/diff.test +# Compare files that differ in size +--error 2 --diff_files $MYSQLTEST_VARDIR/tmp/diff1.tmp $MYSQLTEST_VARDIR/tmp/diff3.tmp +--error 2 +--diff_files $MYSQLTEST_VARDIR/tmp/diff3.tmp $MYSQLTEST_VARDIR/tmp/diff1.tmp + +# Compare files that differ only in content +--error 1 +--diff_files $MYSQLTEST_VARDIR/tmp/diff1.tmp $MYSQLTEST_VARDIR/tmp/diff4.tmp +--error 1 +--diff_files $MYSQLTEST_VARDIR/tmp/diff4.tmp $MYSQLTEST_VARDIR/tmp/diff1.tmp +EOF + +# Execute the above diffs, and send their output to /dev/null - only +# interesting to see that it returns correct error codes +--exec $MYSQL_TEST < $MYSQLTEST_VARDIR/tmp/diff.test > /dev/null 2>&1 + # Compare equal files, again... --diff_files $MYSQLTEST_VARDIR/tmp/diff1.tmp $MYSQLTEST_VARDIR/tmp/diff2.tmp +--remove_file $MYSQLTEST_VARDIR/tmp/diff1.tmp +--remove_file $MYSQLTEST_VARDIR/tmp/diff2.tmp +--remove_file $MYSQLTEST_VARDIR/tmp/diff3.tmp +--remove_file $MYSQLTEST_VARDIR/tmp/diff4.tmp +--remove_file $MYSQLTEST_VARDIR/tmp/diff.test + + # ---------------------------------------------------------------------------- # test for file_exist # ---------------------------------------------------------------------------- From e4817a384302df738cbd7b98667d97a3b67f6b2d Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.(none)" <> Date: Fri, 3 Aug 2007 13:29:30 +0200 Subject: [PATCH 06/90] Update after merge, change "byte" and "gptr" into "uchar" and "uchar*" --- client/mysqltest.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/client/mysqltest.c b/client/mysqltest.c index 2a127c68a0c..45859dcc863 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -1024,7 +1024,7 @@ void cat_file(DYNAMIC_STRING* ds, const char* filename) if ((fd= my_open(filename, O_RDONLY, MYF(0))) < 0) die("Failed to open file %s", filename); - while((len= my_read(fd, (byte*)&buff, + while((len= my_read(fd, (uchar*)&buff, sizeof(buff), MYF(0))) > 0) { char *p= buff, *start= buff; @@ -1264,10 +1264,10 @@ int compare_files2(File fd, const char* filename2) my_close(fd, MYF(0)); die("Failed to open second file: %s", filename2); } - while((len= my_read(fd, (byte*)&buff, + while((len= my_read(fd, (uchar*)&buff, sizeof(buff), MYF(0))) > 0) { - if ((len2= my_read(fd2, (byte*)&buff2, + if ((len2= my_read(fd2, (uchar*)&buff2, sizeof(buff2), MYF(0))) < len) { /* File 2 was smaller */ @@ -1287,7 +1287,7 @@ int compare_files2(File fd, const char* filename2) break; } } - if (!error && my_read(fd2, (byte*)&buff2, + if (!error && my_read(fd2, (uchar*)&buff2, sizeof(buff2), MYF(0)) > 0) { /* File 1 was smaller */ @@ -4797,7 +4797,7 @@ static struct my_option my_long_options[] = GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"tail-lines", OPT_TAIL_LINES, "Number of lines of the resul to include in a failure report", - (gptr*) &opt_tail_lines, (gptr*) &opt_tail_lines, 0, + (uchar**) &opt_tail_lines, (uchar**) &opt_tail_lines, 0, GET_INT, REQUIRED_ARG, 0, 0, 10000, 0, 0, 0}, #include "sslopt-longopts.h" {"test-file", 'x', "Read test from/in this file (default stdin).", From fecdca6754c5699a48144c69ffeb023ff77ca15d Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.(none)" <> Date: Fri, 3 Aug 2007 13:39:55 +0200 Subject: [PATCH 07/90] Add extra newline between diff and error message --- client/mysqltest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/mysqltest.c b/client/mysqltest.c index 337a31ad7af..183374ea095 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -1240,7 +1240,7 @@ void show_diff(DYNAMIC_STRING* ds, else { /* Print diff directly to stdout */ - fprintf(stderr, "%s", ds_tmp.str); + fprintf(stderr, "%s\n", ds_tmp.str); } dynstr_free(&ds_tmp); From 6e3a7e0bb6bb639e952b1a248a01335d19f5a199 Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.(none)" <> Date: Fri, 3 Aug 2007 13:42:31 +0200 Subject: [PATCH 08/90] Update to reflect new location of where log file end up --- mysql-test/r/mysqltest.result | 2 +- mysql-test/t/mysqltest.test | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/mysqltest.result b/mysql-test/r/mysqltest.result index 300ca69f2b4..7fa23648c0a 100644 --- a/mysql-test/r/mysqltest.result +++ b/mysql-test/r/mysqltest.result @@ -473,7 +473,7 @@ insert into t1 values (1); select 'select-me'; insertz 'error query'' failed: 1064: 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 'insertz 'error query'' at line 1 -More results from queries before failure can be found in MYSQLTEST_VARDIR/tmp/bug11731.log +More results from queries before failure can be found in MYSQLTEST_VARDIR/log/bug11731.log drop table t1; Multi statement using expected error create table t1 (a int primary key); diff --git a/mysql-test/t/mysqltest.test b/mysql-test/t/mysqltest.test index 9c29840ba9b..88de9c5fa18 100644 --- a/mysql-test/t/mysqltest.test +++ b/mysql-test/t/mysqltest.test @@ -1478,7 +1478,7 @@ drop table t1; --exec test -s $MYSQLTEST_VARDIR/tmp/bug11731.out drop table t1; remove_file $MYSQLTEST_VARDIR/tmp/bug11731.out; -remove_file $MYSQLTEST_VARDIR/tmp/bug11731.log; +remove_file $MYSQLTEST_VARDIR/log/bug11731.log; remove_file $MYSQLTEST_VARDIR/tmp/bug11731.sql; # From 42b32d7df30d0412dd911663d251b559e71fa4d8 Mon Sep 17 00:00:00 2001 From: "msvensson@shellback.(none)" <> Date: Mon, 6 Aug 2007 10:39:48 +0200 Subject: [PATCH 09/90] Fix spelling errors --- client/mysqltest.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/mysqltest.c b/client/mysqltest.c index 337a31ad7af..0b1565af16d 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -499,11 +499,11 @@ void handle_no_error(struct st_command*); pthread_attr_t cn_thd_attrib; /* - send_one_query executes query in separate thread what is + send_one_query executes query in separate thread, which is necessary in embedded library to run 'send' in proper way. This implementation doesn't handle errors returned by mysql_send_query. It's technically possible, though - i don't see where it is needed. + I don't see where it is needed. */ pthread_handler_t send_one_query(void *arg) { From b8a2161673120c8190b40c2b2ba119cae35e3025 Mon Sep 17 00:00:00 2001 From: "msvensson@shellback.(none)" <> Date: Mon, 6 Aug 2007 11:20:36 +0200 Subject: [PATCH 10/90] Remove NOT_YET code Update comments Add more tests for "let from query" --- client/mysqltest.c | 30 ++++++------------------------ mysql-test/r/mysqltest.result | 12 ++++++++++++ mysql-test/t/mysqltest.test | 34 ++++++++++++++++++---------------- 3 files changed, 36 insertions(+), 40 deletions(-) diff --git a/client/mysqltest.c b/client/mysqltest.c index 0b1565af16d..7e10c040851 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -1777,40 +1777,22 @@ void var_query_set(VAR *var, const char *query, const char** query_end) die("Query '%s' didn't return a result set", ds_query.str); dynstr_free(&ds_query); - if ((row = mysql_fetch_row(res)) && row[0]) + if ((row= mysql_fetch_row(res)) && row[0]) { /* - Concatenate all row results with tab in between to allow us to work - with results from many columns (for example from SHOW VARIABLES) + Concatenate all fields in the first row with tab in between + and assign that string to the $variable */ DYNAMIC_STRING result; uint i; ulong *lengths; -#ifdef NOT_YET - MYSQL_FIELD *fields= mysql_fetch_fields(res); -#endif - init_dynamic_string(&result, "", 2048, 2048); + init_dynamic_string(&result, "", 512, 512); lengths= mysql_fetch_lengths(res); - for (i=0; i < mysql_num_fields(res); i++) + for (i= 0; i < mysql_num_fields(res); i++) { - if (row[0]) + if (row[i]) { -#ifdef NOT_YET - /* Add to _ */ - uint j; - char var_col_name[MAX_VAR_NAME_LENGTH]; - uint length= snprintf(var_col_name, MAX_VAR_NAME_LENGTH, - "$%s_%s", var->name, fields[i].name); - /* Convert characters not allowed in variable names to '_' */ - for (j= 1; j < length; j++) - { - if (!my_isvar(charset_info,var_col_name[j])) - var_col_name[j]= '_'; - } - var_set(var_col_name, var_col_name + length, - row[i], row[i] + lengths[i]); -#endif /* Add column to tab separated string */ dynstr_append_mem(&result, row[i], lengths[i]); } diff --git a/mysql-test/r/mysqltest.result b/mysql-test/r/mysqltest.result index 300ca69f2b4..513216c062e 100644 --- a/mysql-test/r/mysqltest.result +++ b/mysql-test/r/mysqltest.result @@ -280,6 +280,18 @@ let $B = changed value of B; var2: content of variable 1 var3: content of variable 1 content of variable 1 length of var3 is longer than 0 +var1 +hi 1 hi there +var2 +2 +var2 again +2 +var3 two columns with same name +1 2 3 +var4 from query that returns NULL +var5 from query that returns no row +failing query in let +mysqltest: At line 1: Error running query 'failing query': 1064 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 'failing query' at line 1 mysqltest: At line 1: Missing required argument 'filename' to command 'source' mysqltest: At line 1: Could not open file ./non_existingFile mysqltest: In included file "MYSQLTEST_VARDIR/tmp/recursive.sql": At line 1: Source directives are nesting too deep diff --git a/mysql-test/t/mysqltest.test b/mysql-test/t/mysqltest.test index 9c29840ba9b..20140307e57 100644 --- a/mysql-test/t/mysqltest.test +++ b/mysql-test/t/mysqltest.test @@ -736,38 +736,40 @@ if (`select length("$var3") > 0`) # Test to assign let from query # let $=``; # ---------------------------------------------------------------------------- ---disable_parsing echo var1; let $var1= `select "hi" as "Col", 1 as "Column1", "hi there" as Col3`; echo $var1; -echo $var1_Col; -echo $var1_Column1; -echo $var1_Col3; echo var2; let $var2= `select 2 as "Column num 2"`; echo $var2; -echo $var2_Column num 2; -echo $var2_Column; echo var2 again; let $var2= `select 2 as "Column num 2"`; echo $var2; -echo $var2_Column num 2; -echo $var2_Column_num_2; -echo $var2_Column; echo var3 two columns with same name; let $var3= `select 1 as "Col", 2 as "Col", 3 as "var3"`; echo $var3; -echo $var3_Col; -echo $var3_Col; -echo $var3_var3; -#echo failing query in let; -#--error 1 -#--exec echo "let $var2= `failing query;`" | $MYSQL_TEST 2>&1 ---enable_parsing +echo var4 from query that returns NULL; +let $var4= `select NULL`; + +echo var5 from query that returns no row; +let $var5= `SHOW VARIABLES LIKE "nonexisting_variable"`; + +echo failing query in let; +--write_file $MYSQLTEST_VARDIR/tmp/let.sql +let $var2= `failing query`; +echo $var2; +EOF + +--error 1 +--exec $MYSQL_TEST < $MYSQLTEST_VARDIR/tmp/let.sql 2>&1 + +remove_file $MYSQLTEST_VARDIR/tmp/let.sql; + + # ---------------------------------------------------------------------------- # Test source command # ---------------------------------------------------------------------------- From 260fabd48180b4a2a1135384777042cf023e1d09 Mon Sep 17 00:00:00 2001 From: "msvensson@shellback.(none)" <> Date: Mon, 6 Aug 2007 13:42:00 +0200 Subject: [PATCH 11/90] Add missing ' Extend buffer size to allow for longer log messages --- client/mysqltest.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/mysqltest.c b/client/mysqltest.c index 7e10c040851..1659c7e6ac5 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -1006,7 +1006,7 @@ void warning_msg(const char *fmt, ...) void log_msg(const char *fmt, ...) { va_list args; - char buff[512]; + char buff[1024]; size_t len; DBUG_ENTER("log_msg"); @@ -2269,7 +2269,7 @@ void do_exec(struct st_command *command) if (command->abort_on_error) { - log_msg("exec of '%s failed, error: %d, status: %d, errno: %d", + log_msg("exec of '%s' failed, error: %d, status: %d, errno: %d", ds_cmd.str, error, status, errno); die("command \"%s\" failed", command->first_argument); } From f785bf00de77ba5c562a511b6bcd773eb95f7a85 Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.(none)" <> Date: Tue, 7 Aug 2007 11:40:03 +0200 Subject: [PATCH 12/90] Bug#20037 mysqltest requires cygwin on windows(part 1, new mysqltest commands) - Update comments - Make "write_file" fail if file already exist - Remove temporary files created by test cases --- client/mysqltest.c | 16 +++++++++++----- mysql-test/r/mysqltest.result | 3 ++- mysql-test/t/bootstrap.test | 7 +++++-- mysql-test/t/mysql.test | 3 +++ mysql-test/t/mysqladmin.test | 3 ++- mysql-test/t/mysqltest.test | 20 ++++++++++++++++++++ mysql-test/t/sp-destruct.test | 1 + 7 files changed, 44 insertions(+), 9 deletions(-) diff --git a/client/mysqltest.c b/client/mysqltest.c index 183374ea095..a863284921a 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -2525,8 +2525,8 @@ void do_copy_file(struct st_command *command) command command handle DESCRIPTION - chmod - Change file permission of + chmod_file + Change file permission of */ @@ -2536,8 +2536,8 @@ void do_chmod_file(struct st_command *command) static DYNAMIC_STRING ds_mode; static DYNAMIC_STRING ds_file; const struct command_arg chmod_file_args[] = { - "mode", ARG_STRING, TRUE, &ds_mode, "Mode of file", - "file", ARG_STRING, TRUE, &ds_file, "Filename of file to modify" + "mode", ARG_STRING, TRUE, &ds_mode, "Mode of file(octal) ex. 0660", + "filename", ARG_STRING, TRUE, &ds_file, "Filename of file to modify" }; DBUG_ENTER("do_chmod_file"); @@ -2671,6 +2671,12 @@ void do_write_file_command(struct st_command *command, my_bool append) if (ds_delimiter.length == 0) dynstr_set(&ds_delimiter, "EOF"); + if (!append && access(ds_filename.str, F_OK) == 0) + { + /* The file should not be overwritten */ + die("File already exist: '%s'", ds_filename.str); + } + init_dynamic_string(&ds_content, "", 1024, 1024); read_until_delimiter(&ds_content, &ds_delimiter); DBUG_PRINT("info", ("Writing to file: %s", ds_filename.str)); @@ -2703,7 +2709,7 @@ void do_write_file_command(struct st_command *command, my_bool append) Write everything between the "write_file" command and 'delimiter' to "file_name" - NOTE! Overwrites existing file + NOTE! Will fail if exists Default is EOF diff --git a/mysql-test/r/mysqltest.result b/mysql-test/r/mysqltest.result index 300ca69f2b4..7c63bb78967 100644 --- a/mysql-test/r/mysqltest.result +++ b/mysql-test/r/mysqltest.result @@ -521,6 +521,7 @@ drop table t1; mysqltest: At line 1: Missing required argument 'filename' to command 'remove_file' mysqltest: At line 1: Missing required argument 'filename' to command 'write_file' mysqltest: At line 1: End of file encountered before 'EOF' delimiter was found +mysqltest: At line 1: File already exist: 'MYSQLTEST_VARDIR/tmp/test_file1.tmp' Some data for cat_file command of mysqltest @@ -531,7 +532,7 @@ mysqltest: At line 1: Missing required argument 'to_file' to command 'copy_file' mysqltest: At line 1: Missing required argument 'mode' to command 'chmod' mysqltest: At line 1: You must write a 4 digit octal number for mode mysqltest: At line 1: You must write a 4 digit octal number for mode -mysqltest: At line 1: Missing required argument 'file' to command 'chmod' +mysqltest: At line 1: Missing required argument 'filename' to command 'chmod' mysqltest: At line 1: You must write a 4 digit octal number for mode mysqltest: At line 1: You must write a 4 digit octal number for mode hello diff --git a/mysql-test/t/bootstrap.test b/mysql-test/t/bootstrap.test index 1c2952e93d0..203ba9b2914 100644 --- a/mysql-test/t/bootstrap.test +++ b/mysql-test/t/bootstrap.test @@ -9,12 +9,13 @@ drop table if exists t1; # # Check that --bootstrap reads from stdin # ---write_file $MYSQLTEST_VARDIR/tmp/bootstrap.sql +--write_file $MYSQLTEST_VARDIR/tmp/bootstrap_test.sql use test; CREATE TABLE t1(a int); EOF ---exec $MYSQLD_BOOTSTRAP_CMD < $MYSQLTEST_VARDIR/tmp/bootstrap.sql >> $MYSQLTEST_VARDIR/tmp/bootstrap.log 2>&1 +--exec $MYSQLD_BOOTSTRAP_CMD < $MYSQLTEST_VARDIR/tmp/bootstrap_test.sql >> $MYSQLTEST_VARDIR/tmp/bootstrap.log 2>&1 drop table t1; +remove_file $MYSQLTEST_VARDIR/tmp/bootstrap_test.sql; # # Check that --bootstrap of file with SQL error returns error @@ -28,6 +29,7 @@ EOF # Table t1 should not exists --error 1051 drop table t1; +remove_file $MYSQLTEST_VARDIR/tmp/bootstrap_error.sql; # # Bootstrap with a query larger than 2*thd->net.max_packet @@ -40,6 +42,7 @@ eval select * into outfile '$MYSQLTEST_VARDIR/tmp/long_query.sql' from t1; --enable_query_log --error 1 --exec $MYSQLD_BOOTSTRAP_CMD < $MYSQLTEST_VARDIR/tmp/long_query.sql >> $MYSQLTEST_VARDIR/tmp/bootstrap.log 2>&1 +remove_file $MYSQLTEST_VARDIR/tmp/long_query.sql; set global max_allowed_packet=@my_max_allowed_packet; drop table t1; diff --git a/mysql-test/t/mysql.test b/mysql-test/t/mysql.test index 37bbca77d9f..66bd2f67512 100644 --- a/mysql-test/t/mysql.test +++ b/mysql-test/t/mysql.test @@ -241,18 +241,21 @@ DELIMITER / SELECT 1/ EOF --exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug21412.sql 2>&1 +remove_file $MYSQLTEST_VARDIR/tmp/bug21412.sql; # This should give an error... --write_file $MYSQLTEST_VARDIR/tmp/bug21412.sql DELIMITER \ EOF --exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug21412.sql 2>&1 +remove_file $MYSQLTEST_VARDIR/tmp/bug21412.sql; # As should this... --write_file $MYSQLTEST_VARDIR/tmp/bug21412.sql DELIMITER \\ EOF --exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug21412.sql 2>&1 +remove_file $MYSQLTEST_VARDIR/tmp/bug21412.sql; # # Some coverage of not normally used parts diff --git a/mysql-test/t/mysqladmin.test b/mysql-test/t/mysqladmin.test index 3fa03fa910e..839ecf00b60 100644 --- a/mysql-test/t/mysqladmin.test +++ b/mysql-test/t/mysqladmin.test @@ -20,7 +20,7 @@ EOF --replace_regex /.*mysqladmin.*: unknown/mysqladmin: unknown/ --error 7 --exec $MYSQLADMIN --defaults-file=$MYSQLTEST_VARDIR/tmp/bug10608.cnf -S $MASTER_MYSOCK -P $MASTER_MYPORT -u root --password= ping 2>&1 - +remove_file $MYSQLTEST_VARDIR/tmp/bug10608.cnf; # When mysqladmin finds "loose-database" in .cnf file it shall print # a warning and continue @@ -32,3 +32,4 @@ EOF --replace_regex /Warning: .*mysqladmin.*: unknown/Warning: mysqladmin: unknown/ --exec $MYSQLADMIN --defaults-file=$MYSQLTEST_VARDIR/tmp/bug10608.cnf -S $MASTER_MYSOCK -P $MASTER_MYPORT -u root --password= ping 2>&1 +remove_file $MYSQLTEST_VARDIR/tmp/bug10608.cnf; diff --git a/mysql-test/t/mysqltest.test b/mysql-test/t/mysqltest.test index 9c29840ba9b..b892b433369 100644 --- a/mysql-test/t/mysqltest.test +++ b/mysql-test/t/mysqltest.test @@ -366,6 +366,7 @@ show status; EOF --error 1 --exec $MYSQL_TEST < $MYSQLTEST_VARDIR/tmp/mysqltest.sql 2>&1 +remove_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql; # # Missing delimiter until eof @@ -377,6 +378,7 @@ sleep 7 EOF --error 1 --exec $MYSQL_TEST < $MYSQLTEST_VARDIR/tmp/mysqltest.sql 2>&1 +remove_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql; # # Missing delimiter until "disable_query_log" @@ -391,6 +393,7 @@ disable_query_log; EOF --error 1 --exec $MYSQL_TEST < $MYSQLTEST_VARDIR/tmp/mysqltest.sql 2>&1 +remove_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql; # # Missing delimiter until "disable_query_log" @@ -406,6 +409,7 @@ disable_query_log; EOF --error 1 --exec $MYSQL_TEST < $MYSQLTEST_VARDIR/tmp/mysqltest.sql 2>&1 +remove_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql; # # Missing delimiter until eof @@ -422,6 +426,7 @@ disconnect default EOF --error 1 --exec $MYSQL_TEST < $MYSQLTEST_VARDIR/tmp/mysqltest.sql 2>&1 +remove_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql; # # Missing delimiter until eof @@ -1160,6 +1165,7 @@ echo hej; EOF --error 1 --exec $MYSQL_TEST < $MYSQLTEST_VARDIR/tmp/mysqltest.sql 2>&1 +remove_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql; --write_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql while (0) @@ -1167,6 +1173,7 @@ while (0) EOF --error 1 --exec $MYSQL_TEST < $MYSQLTEST_VARDIR/tmp/mysqltest.sql 2>&1 +remove_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql; --write_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql while (0){ @@ -1268,6 +1275,7 @@ while ($i) } EOF --exec echo "source $MYSQLTEST_VARDIR/tmp/mysqltest.sql; echo OK;" | $MYSQL_TEST 2>&1 +remove_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql; # Repeat connect/disconnect --write_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql @@ -1282,6 +1290,7 @@ EOF --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --error 1 --exec echo "source $MYSQLTEST_VARDIR/tmp/mysqltest.sql;" | $MYSQL_TEST 2>&1 +remove_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql; # Select disconnected connection --write_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql @@ -1292,6 +1301,7 @@ EOF --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --error 1 --exec echo "source $MYSQLTEST_VARDIR/tmp/mysqltest.sql;" | $MYSQL_TEST 2>&1 +remove_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql; # Connection name already used --write_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql @@ -1568,6 +1578,12 @@ write_file $MYSQLTEST_VARDIR/tmp/test_file1.tmp END_DELIMITER; Content for test_file1 contains EOF END_DELIMITER file_exists $MYSQLTEST_VARDIR/tmp/test_file1.tmp; + +# write to already exisiting file +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +--error 1 +--exec echo "write_file $MYSQLTEST_VARDIR/tmp/test_file1.tmp;" | $MYSQL_TEST 2>&1 + remove_file $MYSQLTEST_VARDIR/tmp/test_file1.tmp; # ---------------------------------------------------------------------------- @@ -1589,6 +1605,8 @@ append_file $MYSQLTEST_VARDIR/tmp/test_file1.tmp; Appended text on nonexisting file EOF +remove_file $MYSQLTEST_VARDIR/tmp/test_file1.tmp; + # ---------------------------------------------------------------------------- # test for cat_file # ---------------------------------------------------------------------------- @@ -1599,6 +1617,7 @@ for cat_file command of mysqltest EOF cat_file $MYSQLTEST_VARDIR/tmp/test_file1.tmp; +remove_file $MYSQLTEST_VARDIR/tmp/test_file1.tmp; --error 1 --exec echo "cat_file non_existing_file;" | $MYSQL_TEST 2>&1 @@ -1719,6 +1738,7 @@ chmod 0000 $MYSQLTEST_VARDIR/tmp/file1.tmp; #EOF chmod 0777 $MYSQLTEST_VARDIR/tmp/file1.tmp; +remove_file $MYSQLTEST_VARDIR/tmp/file1.tmp; --write_file $MYSQLTEST_VARDIR/tmp/file1.tmp test2 EOF diff --git a/mysql-test/t/sp-destruct.test b/mysql-test/t/sp-destruct.test index 13ddaa43fad..c568e6bb8f4 100644 --- a/mysql-test/t/sp-destruct.test +++ b/mysql-test/t/sp-destruct.test @@ -42,6 +42,7 @@ insert into t1 values (0); flush table mysql.proc; # Thrashing the .frm file +--remove_file $MYSQLTEST_VARDIR/master-data/mysql/proc.frm --write_file $MYSQLTEST_VARDIR/master-data/mysql/proc.frm saljdfa EOF From 86658784a166e6de383a87fe86532bd9d7ab0971 Mon Sep 17 00:00:00 2001 From: "msvensson@shellback.(none)" <> Date: Tue, 7 Aug 2007 11:56:30 +0200 Subject: [PATCH 13/90] Bug#29547 mysql-test-run to retrieve warnings for failed command - Run "SHOW WARNINGS" when mysqltest fails and display all but the last warning(since it's the same as "last error") on stderr - Fix typo --- client/mysqltest.c | 85 +++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 81 insertions(+), 4 deletions(-) diff --git a/client/mysqltest.c b/client/mysqltest.c index 1659c7e6ac5..1d481f33f47 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -235,7 +235,7 @@ struct st_connection #endif /*EMBEDDED_LIBRARY*/ }; struct st_connection connections[128]; -struct st_connection* cur_con, *next_con, *connections_end; +struct st_connection* cur_con= NULL, *next_con, *connections_end; /* List of commands in mysqltest @@ -604,6 +604,77 @@ void do_eval(DYNAMIC_STRING *query_eval, const char *query, } +/* + Show any warnings just before the error. Since the last error + is added to the warning stack, only print @@warning_count-1 warnings. + + NOTE! This function should be safe to call when an error + has occured and this any further errors will be ignored(although logged) + + SYNOPSIS + show_warnings_before_error + mysql - connection to use + +*/ + +static void show_warnings_before_error(MYSQL* mysql) +{ + MYSQL_RES* res; + const char* query= "SHOW WARNINGS"; + DBUG_ENTER("show_warnings_before_error"); + + if (!mysql) + DBUG_VOID_RETURN; + + if (mysql_query(mysql, query)) + { + log_msg("Error running query '%s': %d %s", + query, mysql_errno(mysql), mysql_error(mysql)); + DBUG_VOID_RETURN; + } + + if ((res= mysql_store_result(mysql)) == NULL) + { + /* No result set returned */ + DBUG_VOID_RETURN; + } + + if (mysql_num_rows(res) <= 1) + { + /* Don't display the last row, it's "last error" */ + } + else + { + MYSQL_ROW row; + unsigned int row_num= 0; + unsigned int num_fields= mysql_num_fields(res); + + fprintf(stderr, "\nWarnings from just before the error:\n"); + while ((row= mysql_fetch_row(res))) + { + unsigned int i; + unsigned long *lengths= mysql_fetch_lengths(res); + + if (++row_num >= mysql_num_rows(res)) + { + /* Don't display the last row, it's "last error" */ + break; + } + + for(i= 0; i < num_fields; i++) + { + fprintf(stderr, "%.*s ", lengths[i], + row[i] ? row[i] : "NULL"); + } + fprintf(stderr, "\n"); + } + } + mysql_free_result(res); + + DBUG_VOID_RETURN; +} + + enum arg_type { ARG_STRING, @@ -903,6 +974,13 @@ void die(const char *fmt, ...) if (result_file_name && ds_warning_messages.length) dump_warning_messages(); + /* + Help debugging by displaying any warnings that might have + been produced prior to the error + */ + if (cur_con) + show_warnings_before_error(&cur_con->mysql); + cleanup_and_exit(1); } @@ -1010,7 +1088,6 @@ void log_msg(const char *fmt, ...) size_t len; DBUG_ENTER("log_msg"); - memset(buff, 0, sizeof(buff)); va_start(args, fmt); len= my_vsnprintf(buff, sizeof(buff)-1, fmt, args); va_end(args); @@ -4044,7 +4121,7 @@ void do_connect(struct st_command *command) mysql_options(&con_slot->mysql, MYSQL_SET_CHARSET_NAME, charset_info->csname); if (opt_charsets_dir) - mysql_options(&cur_con->mysql, MYSQL_SET_CHARSET_DIR, + mysql_options(&con_slot->mysql, MYSQL_SET_CHARSET_DIR, opt_charsets_dir); #ifdef HAVE_OPENSSL @@ -6471,7 +6548,6 @@ int main(int argc, char **argv) connections_end= connections + (sizeof(connections)/sizeof(struct st_connection)) - 1; next_con= connections + 1; - cur_con= connections; #ifdef EMBEDDED_LIBRARY /* set appropriate stack for the 'query' threads */ @@ -6547,6 +6623,7 @@ int main(int argc, char **argv) if (cursor_protocol_enabled) ps_protocol_enabled= 1; + cur_con= connections; if (!( mysql_init(&cur_con->mysql))) die("Failed in mysql_init()"); if (opt_compress) From 8d8123341bba319336e383fe4bfc5b90ed7ca42a Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.(none)" <> Date: Wed, 8 Aug 2007 09:31:45 +0200 Subject: [PATCH 14/90] Fix warning --- client/mysqltest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/mysqltest.c b/client/mysqltest.c index 4951e88849f..e5daae2ffbe 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -663,7 +663,7 @@ static void show_warnings_before_error(MYSQL* mysql) for(i= 0; i < num_fields; i++) { - fprintf(stderr, "%.*s ", lengths[i], + fprintf(stderr, "%.*s ", (int)lengths[i], row[i] ? row[i] : "NULL"); } fprintf(stderr, "\n"); From 912aad3b2eb7f710741ffc65222a3e7e0d7f67a6 Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.(none)" <> Date: Wed, 8 Aug 2007 10:04:26 +0200 Subject: [PATCH 15/90] Improve comments and log messages in lib/mtr_timer.pl --- mysql-test/lib/mtr_timer.pl | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/mysql-test/lib/mtr_timer.pl b/mysql-test/lib/mtr_timer.pl index 86a9f58514f..d8b6953fb46 100644 --- a/mysql-test/lib/mtr_timer.pl +++ b/mysql-test/lib/mtr_timer.pl @@ -52,12 +52,10 @@ sub mtr_init_timers () { sub mtr_timer_start($$$) { my ($timers,$name,$duration)= @_; - mtr_verbose("mtr_timer_start: $name, $duration"); - if ( exists $timers->{'timers'}->{$name} ) { # We have an old running timer, kill it - mtr_verbose("There is an old timer running"); + mtr_warning("There is an old timer running"); mtr_timer_stop($timers,$name); } @@ -75,22 +73,22 @@ sub mtr_timer_start($$$) { } else { - mtr_error("can't fork"); + mtr_error("can't fork timer, error: $!"); } } if ( $tpid ) { # Parent, record the information - mtr_verbose("timer parent, record info($name, $tpid, $duration)"); + mtr_verbose("Starting timer for '$name',", + "duration: $duration, pid: $tpid"); $timers->{'timers'}->{$name}->{'pid'}= $tpid; $timers->{'timers'}->{$name}->{'duration'}= $duration; $timers->{'pids'}->{$tpid}= $name; } else { - # Child, redirect output and exec - # FIXME do we need to redirect streams? + # Child, install signal handlers and sleep for "duration" # Don't do the ^C cleanup in the timeout child processes! # There is actually a race here, if we get ^C after fork(), but before @@ -98,13 +96,13 @@ sub mtr_timer_start($$$) { $SIG{INT}= 'DEFAULT'; $SIG{TERM}= sub { - mtr_verbose("timer woke up, exiting!"); + mtr_verbose("timer $$ woke up, exiting!"); exit(0); }; $0= "mtr_timer(timers,$name,$duration)"; sleep($duration); - mtr_verbose("timer expired after $duration seconds"); + mtr_verbose("timer $$ expired after $duration seconds"); exit(0); } } @@ -114,12 +112,10 @@ sub mtr_timer_start($$$) { sub mtr_timer_stop ($$) { my ($timers,$name)= @_; - mtr_verbose("mtr_timer_stop: $name"); - if ( exists $timers->{'timers'}->{$name} ) { my $tpid= $timers->{'timers'}->{$name}->{'pid'}; - mtr_verbose("Stopping timer with pid $tpid"); + mtr_verbose("Stopping timer for '$name' with pid $tpid"); # FIXME as Cygwin reuses pids fast, maybe check that is # the expected process somehow?! @@ -134,11 +130,8 @@ sub mtr_timer_stop ($$) { return 1; } - else - { - mtr_error("Asked to stop timer \"$name\" not started"); - return 0; - } + + mtr_error("Asked to stop timer '$name' not started"); } @@ -158,7 +151,8 @@ sub mtr_timer_timeout ($$) { return "" unless exists $timers->{'pids'}->{$pid}; - # We got a timeout, return the name ot the timer + # Got a timeout(the process with $pid is recorded as being a timer) + # return the name of the timer return $timers->{'pids'}->{$pid}; } From a5eab2c65f83f8e559024598e462300c1d7819d4 Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.(none)" <> Date: Wed, 8 Aug 2007 16:39:13 +0200 Subject: [PATCH 16/90] Remove file before writing to it. --- mysql-test/t/csv.test | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mysql-test/t/csv.test b/mysql-test/t/csv.test index 4aff4b27976..5c877557dfc 100644 --- a/mysql-test/t/csv.test +++ b/mysql-test/t/csv.test @@ -1424,6 +1424,7 @@ DROP TABLE test_repair_table2; # Corrupt csv file and see if we can repair it CREATE TABLE test_repair_table3 ( val integer ) ENGINE = CSV; +--remove_file $MYSQLTEST_VARDIR/master-data/test/test_repair_table3.CSV --write_file $MYSQLTEST_VARDIR/master-data/test/test_repair_table3.CSV "1" "4" @@ -1476,6 +1477,7 @@ CREATE TABLE test_repair_table5 ( ) ENGINE = CSV; # Corrupt a table -- put a file with wrong # of columns +--remove_file $MYSQLTEST_VARDIR/master-data/test/test_repair_table5.CSV --write_file $MYSQLTEST_VARDIR/master-data/test/test_repair_table5.CSV "1","101","IBM" EOF @@ -1629,6 +1631,7 @@ insert into bug22080_1 values(2,'string'); insert into bug22080_1 values(3,'string'); # Create first corrupt file as described in bug report +--remove_file $MYSQLTEST_VARDIR/master-data/test/bug22080_2.CSV --write_file $MYSQLTEST_VARDIR/master-data/test/bug22080_2.CSV 1,"string" 2","string" @@ -1636,6 +1639,7 @@ insert into bug22080_1 values(3,'string'); EOF # Create second corrupt file as described in bug report +--remove_file $MYSQLTEST_VARDIR/master-data/test/bug22080_3.CSV --write_file $MYSQLTEST_VARDIR/master-data/test/bug22080_3.CSV 1,"string" "2",string" @@ -1696,6 +1700,7 @@ check table t1; drop table t1; create table t1(a int, b int) engine=csv; +--remove_file $MYSQLTEST_VARDIR/master-data/test/t1.CSV --write_file $MYSQLTEST_VARDIR/master-data/test/t1.CSV 1, 1E-2 -2E2, .9 From 87f81bce4e8e25bcc268d288fd7f99ceec515a67 Mon Sep 17 00:00:00 2001 From: "msvensson@shellback.(none)" <> Date: Wed, 8 Aug 2007 16:44:01 +0200 Subject: [PATCH 17/90] Remove extra newline added to files created by write_file and append_file --- client/mysqltest.c | 23 +++++++++++++++++++++++ mysql-test/r/mysqltest.result | 1 + mysql-test/t/mysqltest.test | 1 + 3 files changed, 25 insertions(+) diff --git a/client/mysqltest.c b/client/mysqltest.c index 1d481f33f47..541c0cb4394 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -753,6 +753,15 @@ void check_command_args(struct st_command *command, command->first_word_len, command->query); } + /* Check for too many arguments passed */ + ptr= command->last_argument; + while(ptr <= command->end) + { + if (*ptr && *ptr != ' ') + die("Extra argument '%s' passed to '%.*s'", + ptr, command->first_word_len, command->query); + ptr++; + } DBUG_VOID_RETURN; } @@ -2691,8 +2700,22 @@ void read_until_delimiter(DYNAMIC_STRING *ds, c= my_getc(cur_file->file); if (c == '\n') + { cur_file->lineno++; + /* Skip newline from the same line as the command */ + if (start_lineno == (cur_file->lineno - 1)) + continue; + } + else if (start_lineno == cur_file->lineno) + { + /* + No characters except \n are allowed on + the same line as the command + */ + die("Trailing characters found after command"); + } + if (feof(cur_file->file)) die("End of file encountered before '%s' delimiter was found", ds_delimiter->str); diff --git a/mysql-test/r/mysqltest.result b/mysql-test/r/mysqltest.result index 513216c062e..5ee1bc4dc0d 100644 --- a/mysql-test/r/mysqltest.result +++ b/mysql-test/r/mysqltest.result @@ -533,6 +533,7 @@ drop table t1; mysqltest: At line 1: Missing required argument 'filename' to command 'remove_file' mysqltest: At line 1: Missing required argument 'filename' to command 'write_file' mysqltest: At line 1: End of file encountered before 'EOF' delimiter was found +Content for test_file1 Some data for cat_file command of mysqltest diff --git a/mysql-test/t/mysqltest.test b/mysql-test/t/mysqltest.test index 20140307e57..791bacd636c 100644 --- a/mysql-test/t/mysqltest.test +++ b/mysql-test/t/mysqltest.test @@ -1564,6 +1564,7 @@ write_file $MYSQLTEST_VARDIR/tmp/test_file1.tmp; Content for test_file1 EOF file_exists $MYSQLTEST_VARDIR/tmp/test_file1.tmp; +cat_file $MYSQLTEST_VARDIR/tmp/test_file1.tmp; remove_file $MYSQLTEST_VARDIR/tmp/test_file1.tmp; write_file $MYSQLTEST_VARDIR/tmp/test_file1.tmp END_DELIMITER; From 792ac3fdcdea8dd43bd3e563a101186993edf2e9 Mon Sep 17 00:00:00 2001 From: "msvensson@shellback.(none)" <> Date: Wed, 8 Aug 2007 16:45:18 +0200 Subject: [PATCH 18/90] Use "create_temp_file" to create a temporary file name for the perl script --- client/mysqltest.c | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/client/mysqltest.c b/client/mysqltest.c index 541c0cb4394..543dabf52f0 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -2970,8 +2970,10 @@ void do_send_quit(struct st_command *command) void do_perl(struct st_command *command) { int error; - char buf[FN_REFLEN]; + File fd; FILE *res_file; + char buf[FN_REFLEN]; + char temp_file_path[FN_REFLEN]; static DYNAMIC_STRING ds_script; static DYNAMIC_STRING ds_delimiter; const struct command_arg perl_args[] = { @@ -2994,14 +2996,17 @@ void do_perl(struct st_command *command) DBUG_PRINT("info", ("Executing perl: %s", ds_script.str)); - /* Format a name for a tmp .pl file that is unique for this process */ - my_snprintf(buf, sizeof(buf), "%s/tmp/tmp_%d.pl", - getenv("MYSQLTEST_VARDIR"), getpid()); - str_to_file(buf, ds_script.str, ds_script.length); + /* Create temporary file name */ + if ((fd= create_temp_file(temp_file_path, getenv("MYSQLTEST_VARDIR"), + "tmp", O_CREAT | O_SHARE | O_RDWR, + MYF(MY_WME))) < 0) + die("Failed to create temporary file for perl command"); + my_close(fd, MYF(0)); - /* Format the perl command */ - my_snprintf(buf, sizeof(buf), "perl %s/tmp/tmp_%d.pl", - getenv("MYSQLTEST_VARDIR"), getpid()); + str_to_file(temp_file_path, ds_script.str, ds_script.length); + + /* Format the "perl " command */ + my_snprintf(buf, sizeof(buf), "perl %s", temp_file_path); if (!(res_file= popen(buf, "r")) && command->abort_on_error) die("popen(\"%s\", \"r\") failed", buf); @@ -3019,6 +3024,10 @@ void do_perl(struct st_command *command) } } error= pclose(res_file); + + /* Remove the temporary file */ + my_delete(temp_file_path, MYF(0)); + handle_command_error(command, WEXITSTATUS(error)); dynstr_free(&ds_script); dynstr_free(&ds_delimiter); From 6d2f738ff990a30b583440cf3903285d198188c4 Mon Sep 17 00:00:00 2001 From: "msvensson@shellback.(none)" <> Date: Wed, 8 Aug 2007 18:03:44 +0200 Subject: [PATCH 19/90] Don't require a space between "if" and "(". This should also fix "while" and "connect" It's now possible to write "if(" --- client/mysqltest.c | 8 ++++++-- mysql-test/t/mysqltest.test | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/client/mysqltest.c b/client/mysqltest.c index 543dabf52f0..65e965ef128 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -4814,9 +4814,13 @@ int read_command(struct st_command** command_ptr) if (!(command->query_buf= command->query= my_strdup(p, MYF(MY_WME)))) die("Out of memory"); - /* Calculate first word and first argument */ - for (p= command->query; *p && !my_isspace(charset_info, *p) ; p++) ; + /* Calculate first word length(the command), terminated by space or ( */ + p= command->query; + while (*p && !my_isspace(charset_info, *p) && *p != '(') + p++; command->first_word_len= (uint) (p - command->query); + DBUG_PRINT("info", ("first_word: %.*s", + command->first_word_len, command->query)); /* Skip spaces between command and first argument */ while (*p && my_isspace(charset_info, *p)) diff --git a/mysql-test/t/mysqltest.test b/mysql-test/t/mysqltest.test index 791bacd636c..4f9964552d9 100644 --- a/mysql-test/t/mysqltest.test +++ b/mysql-test/t/mysqltest.test @@ -969,7 +969,7 @@ if (!$counter) echo Counter is not 0, (counter=10); } let $counter=0; -if ($counter) +if($counter) { echo Counter is greater than 0, (counter=0); } From 51580c64058291c5864bee57d4030c63966fabe2 Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.(none)" <> Date: Mon, 13 Aug 2007 15:46:11 +0200 Subject: [PATCH 20/90] Improve error messages Write test results to var/log Add test for "source" and variable expansion --- client/mysqltest.c | 36 ++++++++++++++++++++--------------- mysql-test/mysql-test-run.pl | 1 + mysql-test/r/mysqltest.result | 8 +++++--- mysql-test/t/mysqltest.test | 17 +++++++++++++++-- 4 files changed, 42 insertions(+), 20 deletions(-) diff --git a/client/mysqltest.c b/client/mysqltest.c index 1ce52cd8527..693c6d0fb65 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -1125,7 +1125,7 @@ void cat_file(DYNAMIC_STRING* ds, const char* filename) char buff[512]; if ((fd= my_open(filename, O_RDONLY, MYF(0))) < 0) - die("Failed to open file %s", filename); + die("Failed to open file '%s'", filename); while((len= my_read(fd, (byte*)&buff, sizeof(buff), MYF(0))) > 0) { @@ -1364,7 +1364,7 @@ int compare_files2(File fd, const char* filename2) if ((fd2= my_open(filename2, O_RDONLY, MYF(0))) < 0) { my_close(fd, MYF(0)); - die("Failed to open second file: %s", filename2); + die("Failed to open second file: '%s'", filename2); } while((len= my_read(fd, (byte*)&buff, sizeof(buff), MYF(0))) > 0) @@ -1421,7 +1421,7 @@ int compare_files(const char* filename1, const char* filename2) int error; if ((fd= my_open(filename1, O_RDONLY, MYF(0))) < 0) - die("Failed to open first file: %s", filename1); + die("Failed to open first file: '%s'", filename1); error= compare_files2(fd, filename2); @@ -1447,12 +1447,12 @@ int dyn_string_cmp(DYNAMIC_STRING* ds, const char *fname) { int error; File fd; - char ds_temp_file_path[FN_REFLEN]; + char temp_file_path[FN_REFLEN]; DBUG_ENTER("dyn_string_cmp"); DBUG_PRINT("enter", ("fname: %s", fname)); - if ((fd= create_temp_file(ds_temp_file_path, NULL, + if ((fd= create_temp_file(temp_file_path, NULL, "tmp", O_CREAT | O_SHARE | O_RDWR, MYF(MY_WME))) < 0) die("Failed to create temporary file for ds"); @@ -1464,15 +1464,15 @@ int dyn_string_cmp(DYNAMIC_STRING* ds, const char *fname) { my_close(fd, MYF(0)); /* Remove the temporary file */ - my_delete(ds_temp_file_path, MYF(0)); - die("Failed to write to '%s'", ds_temp_file_path); + my_delete(temp_file_path, MYF(0)); + die("Failed to write file '%s'", temp_file_path); } error= compare_files2(fd, fname); my_close(fd, MYF(0)); /* Remove the temporary file */ - my_delete(ds_temp_file_path, MYF(0)); + my_delete(temp_file_path, MYF(0)); DBUG_RETURN(error); } @@ -1498,6 +1498,9 @@ void check_result(DYNAMIC_STRING* ds) DBUG_ASSERT(result_file_name); DBUG_PRINT("enter", ("result_file_name: %s", result_file_name)); + if (access(result_file_name, F_OK) != 0) + die("The specified result file does not exist: '%s'", result_file_name); + switch (dyn_string_cmp(ds, result_file_name)) { case RESULT_OK: @@ -1507,12 +1510,15 @@ void check_result(DYNAMIC_STRING* ds) /* Fallthrough */ case RESULT_CONTENT_MISMATCH: { - /* Result mismatched, dump results to .reject file and then show the diff */ + /* + Result mismatched, dump results to .reject file + and then show the diff + */ char reject_file[FN_REFLEN]; - fn_format(reject_file, result_file_name, "", ".reject", - MY_REPLACE_EXT); - DBUG_PRINT("enter", ("reject_file_name: %s", reject_file)); - str_to_file(reject_file, ds->str, ds->length); + str_to_file(fn_format(reject_file, result_file_name, opt_logdir, ".reject", + *opt_logdir ? MY_REPLACE_DIR | MY_REPLACE_EXT : + MY_REPLACE_EXT), + ds->str, ds->length); dynstr_set(ds, NULL); /* Don't create a .log file */ @@ -2121,7 +2127,7 @@ int open_file(const char *name) if (!(cur_file->file = my_fopen(buff, O_RDONLY | FILE_BINARY, MYF(0)))) { cur_file--; - die("Could not open file %s", buff); + die("Could not open file '%s'", buff); } cur_file->file_name= my_strdup(buff, MYF(MY_FAE)); cur_file->lineno=1; @@ -4980,7 +4986,7 @@ void read_embedded_server_arguments(const char *name) embedded_server_args[0]= (char*) ""; /* Progname */ } if (!(file=my_fopen(buff, O_RDONLY | FILE_BINARY, MYF(MY_WME)))) - die("Failed to open file %s", buff); + die("Failed to open file '%s'", buff); while (embedded_server_arg_count < MAX_EMBEDDED_SERVER_ARGS && (str=fgets(argument,sizeof(argument), file))) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 8030238b7ec..f0adfe4d468 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -4677,6 +4677,7 @@ sub run_mysqltest ($) { mtr_add_arg($args, "--skip-safemalloc"); mtr_add_arg($args, "--tmpdir=%s", $opt_tmpdir); mtr_add_arg($args, "--character-sets-dir=%s", $path_charsetsdir); + mtr_add_arg($args, "--logdir=%s/log", $opt_vardir); # Log line number and time for each line in .test file mtr_add_arg($args, "--mark-progress") diff --git a/mysql-test/r/mysqltest.result b/mysql-test/r/mysqltest.result index ba62936999e..d03e21b1bb0 100644 --- a/mysql-test/r/mysqltest.result +++ b/mysql-test/r/mysqltest.result @@ -293,7 +293,7 @@ var5 from query that returns no row failing query in let mysqltest: At line 1: Error running query 'failing query': 1064 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 'failing query' at line 1 mysqltest: At line 1: Missing required argument 'filename' to command 'source' -mysqltest: At line 1: Could not open file ./non_existingFile +mysqltest: At line 1: Could not open file './non_existingFile' mysqltest: In included file "MYSQLTEST_VARDIR/tmp/recursive.sql": At line 1: Source directives are nesting too deep mysqltest: In included file "MYSQLTEST_VARDIR/tmp/error.sql": At line 1: query 'garbage ' failed: 1064: 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 1 @@ -352,6 +352,8 @@ here is the sourced script In loop here is the sourced script here is the sourced script +"hello" +"hello" mysqltest: At line 1: Missing argument to sleep mysqltest: At line 1: Missing argument to real_sleep mysqltest: At line 1: Invalid argument to sleep "abc" @@ -485,7 +487,7 @@ insert into t1 values (1); select 'select-me'; insertz 'error query'' failed: 1064: 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 'insertz 'error query'' at line 1 -More results from queries before failure can be found in MYSQLTEST_VARDIR/tmp/bug11731.log +More results from queries before failure can be found in MYSQLTEST_VARDIR/log/bug11731.log drop table t1; Multi statement using expected error create table t1 (a int primary key); @@ -538,7 +540,7 @@ mysqltest: At line 1: File already exist: 'MYSQLTEST_VARDIR/tmp/test_file1.tmp' Some data for cat_file command of mysqltest -mysqltest: At line 1: Failed to open file non_existing_file +mysqltest: At line 1: Failed to open file 'non_existing_file' mysqltest: At line 1: Missing required argument 'filename' to command 'file_exists' mysqltest: At line 1: Missing required argument 'from_file' to command 'copy_file' mysqltest: At line 1: Missing required argument 'to_file' to command 'copy_file' diff --git a/mysql-test/t/mysqltest.test b/mysql-test/t/mysqltest.test index 70d5e2ee1ee..8a38972c00f 100644 --- a/mysql-test/t/mysqltest.test +++ b/mysql-test/t/mysqltest.test @@ -854,6 +854,19 @@ while ($num) --remove_file $MYSQLTEST_VARDIR/tmp/sourced.inc +--write_file $MYSQLTEST_VARDIR/tmp/sourced.inc +echo "hello"; +EOF + +let $x= sourced; +source $MYSQLTEST_VARDIR/tmp/$x.inc; + +let $x= $MYSQLTEST_VARDIR; +source $x/tmp/sourced.inc; + +--remove_file $MYSQLTEST_VARDIR/tmp/sourced.inc + + # ---------------------------------------------------------------------------- # Test sleep command # ---------------------------------------------------------------------------- @@ -1422,7 +1435,7 @@ select "this will be executed"; --exec $MYSQL_TEST -x $MYSQLTEST_VARDIR/tmp/query.sql -R $MYSQLTEST_VARDIR/tmp/zero_length_file.result > /dev/null 2>&1 remove_file $MYSQLTEST_VARDIR/tmp/zero_length_file.result; -remove_file $MYSQLTEST_VARDIR/tmp/zero_length_file.reject; +remove_file $MYSQLTEST_VARDIR/log/zero_length_file.reject; # # Test that a test file that does not generate any output fails. @@ -1490,7 +1503,7 @@ drop table t1; --exec test -s $MYSQLTEST_VARDIR/tmp/bug11731.out drop table t1; remove_file $MYSQLTEST_VARDIR/tmp/bug11731.out; -remove_file $MYSQLTEST_VARDIR/tmp/bug11731.log; +remove_file $MYSQLTEST_VARDIR/log/bug11731.log; remove_file $MYSQLTEST_VARDIR/tmp/bug11731.sql; # From c446c0006eba8efd5fdf029ac267b5d0eca22c91 Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.(none)" <> Date: Tue, 14 Aug 2007 11:05:42 +0200 Subject: [PATCH 21/90] Remove unused variables --- mysql-test/mysql-test-run.pl | 3 --- 1 file changed, 3 deletions(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index f0adfe4d468..656536edcfb 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -276,9 +276,6 @@ our $opt_stress_test_duration= 0; our $opt_stress_init_file= ""; our $opt_stress_test_file= ""; -our $opt_wait_for_master; -our $opt_wait_for_slave; - our $opt_warnings; our $opt_skip_ndbcluster= 0; From 054ab36fcf93953107c1971e399752959c603fa0 Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.(none)" <> Date: Tue, 14 Aug 2007 11:10:23 +0200 Subject: [PATCH 22/90] Remove unused variable --- mysql-test/mysql-test-run.pl | 1 - 1 file changed, 1 deletion(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 656536edcfb..8e7c3e6693f 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -233,7 +233,6 @@ my $opt_report_features; our $opt_check_testcases; our $opt_mark_progress; -our $opt_skip; our $opt_skip_rpl; our $max_slave_num= 0; our $max_master_num= 1; From 0b80907150409b1312c039f13cb4ed0e5e5135e5 Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.(none)" <> Date: Mon, 20 Aug 2007 13:46:42 +0200 Subject: [PATCH 23/90] Only install second master db if using second master --- mysql-test/mysql-test-run.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 5c362cddfa1..ff3f82ed531 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -2911,7 +2911,7 @@ sub mysql_install_db () { install_db('master', $master->[0]->{'path_myddir'}); - if ($max_master_num) + if ($max_master_num > 1) { copy_install_db('master', $master->[1]->{'path_myddir'}); } From cbecd2007e6264fa90f2ba48723120d856674fbb Mon Sep 17 00:00:00 2001 From: "msvensson@shellback.(none)" <> Date: Mon, 20 Aug 2007 15:12:14 +0200 Subject: [PATCH 24/90] Make it possible to pass mysql-test-run.pl test cases to run also on the . format --- mysql-test/lib/mtr_cases.pl | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/mysql-test/lib/mtr_cases.pl b/mysql-test/lib/mtr_cases.pl index 2becb7f9865..ba7fcb8ce10 100644 --- a/mysql-test/lib/mtr_cases.pl +++ b/mysql-test/lib/mtr_cases.pl @@ -53,7 +53,8 @@ sub collect_test_cases ($) { my $found= 0; foreach my $test ( @$cases ) { - if ( mtr_match_extension($test->{'name'}, $tname) ) + if ( $test->{'name'} eq $tname || + mtr_match_extension($test->{'name'}, $tname) ) { $found= 1; } @@ -192,8 +193,9 @@ sub collect_one_suite($$) if ( @::opt_cases ) { # Collect in specified order, no sort - foreach my $tname ( @::opt_cases ) + foreach my $tname2 ( @::opt_cases ) { + my $tname= $tname2; # Don't modify @::opt_cases ! my $elem= undef; my $component_id= undef; @@ -202,6 +204,9 @@ sub collect_one_suite($$) $tname = basename($tname); + # Get rid of suite part + $tname =~ s/^$suite\.//; + # Check if the extenstion has been specified. if ( mtr_match_extension($tname, "test") ) From dcd94251d41cfab156c48f94ee5ee3325c3d166c Mon Sep 17 00:00:00 2001 From: "tsmith@ramayana.hindu.god" <> Date: Mon, 20 Aug 2007 11:00:51 -0600 Subject: [PATCH 25/90] Bug #27694: mysqlhotcopy & p5-DBD-mysql51-4.003 Use "SHOW TABLES FROM `db`" instead of $dbh->tables() in the get_list_of_tables() routine. The symptom is that, when used with recent versions of DBD::mysql, mysqlhotcopy uses a double-qualified table name, for example: Invalid db.table name 'test.test`.`x' at /usr/bin/mysqlhotcopy line 855. This is caused by a change in DBD::mysql. See this diff: http://svn.perl.org/viewcvs/modules/DBD-mysql/trunk/lib/DBD/mysql.pm?r1=9183&r2=9188 Basically, older DBD::mysql implemented a limited ->table_info method; now the full method is implemented, and as a result DBI's ->tables() method has access to the schema value, so it uses it. --- scripts/mysqlhotcopy.sh | 30 +++++++----------------------- 1 file changed, 7 insertions(+), 23 deletions(-) diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh index 61cd59457d1..6ad5c77b954 100644 --- a/scripts/mysqlhotcopy.sh +++ b/scripts/mysqlhotcopy.sh @@ -821,30 +821,14 @@ sub get_raid_dirs { sub get_list_of_tables { my ( $db ) = @_; - # "use database" cannot cope with database names containing spaces - # so create a new connection + my $tables = + eval { + $dbh->selectall_arrayref('SHOW TABLES FROM ' . + $dbh->quote_identifier($db)) + } || []; + warn "Unable to retrieve list of tables in $db: $@" if $@; - my $dbh = DBI->connect("dbi:mysql:${db}${dsn};mysql_read_default_group=mysqlhotcopy", - $opt{user}, $opt{password}, - { - RaiseError => 1, - PrintError => 0, - AutoCommit => 1, - }); - - my @dbh_tables = eval { $dbh->tables() }; - - ## Remove quotes around table names - my $quote = $dbh->get_info(29); # SQL_IDENTIFIER_QUOTE_CHAR - if ($quote) { - foreach (@dbh_tables) { - s/^$quote(.*)$quote$/$1/; - s/$quote$quote/$quote/g; - } - } - - $dbh->disconnect(); - return @dbh_tables; + return (map { $_->[0] } @$tables); } sub quote_names { From 7094223ea28a22f41bafb0c748b0bf7e3cfab256 Mon Sep 17 00:00:00 2001 From: "skozlov/ksm@mysql.com/virtop.localdomain" <> Date: Thu, 23 Aug 2007 17:33:06 +0400 Subject: [PATCH 26/90] Bug#28744, Bug#29363 --- .../suite/rpl/include/rpl_mixed_ddl.inc | 2 +- .../suite/rpl/include/rpl_mixed_dml.inc | 8 ++-- .../suite/rpl/r/rpl_innodb_mixed_dml.result | 46 +++++++++---------- mysql-test/suite/rpl/t/disabled.def | 4 +- 4 files changed, 30 insertions(+), 30 deletions(-) diff --git a/mysql-test/suite/rpl/include/rpl_mixed_ddl.inc b/mysql-test/suite/rpl/include/rpl_mixed_ddl.inc index 0b13116300e..6a00dcc6e50 100644 --- a/mysql-test/suite/rpl/include/rpl_mixed_ddl.inc +++ b/mysql-test/suite/rpl/include/rpl_mixed_ddl.inc @@ -83,4 +83,4 @@ sync_slave_with_master; # will be created. You will need to go to the mysql-test dir and diff # the files your self to see what is not matching ---exec diff $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_master.sql $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_slave.sql; +--exec diff $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_master.sql $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_slave.sql diff --git a/mysql-test/suite/rpl/include/rpl_mixed_dml.inc b/mysql-test/suite/rpl/include/rpl_mixed_dml.inc index cc225d1bb28..96dfdbed541 100644 --- a/mysql-test/suite/rpl/include/rpl_mixed_dml.inc +++ b/mysql-test/suite/rpl/include/rpl_mixed_dml.inc @@ -51,7 +51,9 @@ DELETE FROM t2 WHERE a = 2; --echo --echo ******************** LOAD DATA INFILE ******************** -LOAD DATA INFILE '../../suite/rpl/data/rpl_mixed.dat' INTO TABLE t1 FIELDS TERMINATED BY '|' ; +--exec cp ./suite/rpl/data/rpl_mixed.dat $MYSQLTEST_VARDIR/tmp/ +LOAD DATA INFILE '../tmp/rpl_mixed.dat' INTO TABLE t1 FIELDS TERMINATED BY '|' ; +--exec rm $MYSQLTEST_VARDIR/tmp/rpl_mixed.dat SELECT * FROM t1; --source suite/rpl/include/rpl_mixed_check_select.inc --source suite/rpl/include/rpl_mixed_clear_tables.inc @@ -326,7 +328,7 @@ DROP VIEW v2; --echo --echo ******************** SHOW BINLOG EVENTS ******************** --replace_column 2 # 5 # ---replace_regex /Server ver: .+/Server ver: #/ /table_id: [0-9]+/table_id: #/ /COMMIT.+xid=[0-9]+.+/#/ +--replace_regex /Server ver: .+/Server ver: #/ /table_id: [0-9]+/table_id: #/ /COMMIT.+xid=[0-9]+.+/#/ /file_id=[0-9]+/file_id=#/ /block_len=[0-9]+/block_len=#/ show binlog events from 1; sync_slave_with_master; # as we're using UUID we don't SELECT but use "diff" like in rpl_row_UUID @@ -342,4 +344,4 @@ sync_slave_with_master; # will be created. You will need to go to the mysql-test dir and diff # the files your self to see what is not matching ---exec diff $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_master.sql $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_slave.sql; +--exec diff $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_master.sql $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_slave.sql 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 7100e5cbe9c..19c5299df25 100644 --- a/mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result +++ b/mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result @@ -103,7 +103,7 @@ DELETE FROM t1; DELETE FROM t2; ******************** LOAD DATA INFILE ******************** -LOAD DATA INFILE '../../suite/rpl/data/rpl_mixed.dat' INTO TABLE t1 FIELDS TERMINATED BY '|' ; +LOAD DATA INFILE '../tmp/rpl_mixed.dat' INTO TABLE t1 FIELDS TERMINATED BY '|' ; SELECT * FROM t1; a b 10 line A @@ -683,13 +683,13 @@ INSERT INTO t1 VALUES(1, 'test1'); CREATE EVENT e1 ON SCHEDULE EVERY '1' SECOND COMMENT 'e_second_comment' DO DELETE FROM t1; ==========MASTER========== SHOW EVENTS; -Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator -test_rpl e1 root@localhost SYSTEM RECURRING NULL 1 # # NULL ENABLED 1 +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation +test_rpl e1 root@localhost SYSTEM RECURRING NULL 1 # # NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci ==========SLAVE=========== USE test_rpl; SHOW EVENTS; -Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator -test_rpl e1 @ SYSTEM RECURRING NULL 1 # # NULL SLAVESIDE_DISABLED 1 +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation +test_rpl e1 @ SYSTEM RECURRING NULL 1 # # NULL SLAVESIDE_DISABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci ==========MASTER========== SELECT COUNT(*) FROM t1; COUNT(*) @@ -743,13 +743,13 @@ a b ALTER EVENT e1 RENAME TO e2; ==========MASTER========== SHOW EVENTS; -Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator -test_rpl e2 root@localhost SYSTEM RECURRING NULL 1 # # NULL ENABLED 1 +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation +test_rpl e2 root@localhost SYSTEM RECURRING NULL 1 # # NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci ==========SLAVE=========== USE test_rpl; SHOW EVENTS; -Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator -test_rpl e2 @ SYSTEM RECURRING NULL 1 # # NULL SLAVESIDE_DISABLED 1 +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation +test_rpl e2 @ SYSTEM RECURRING NULL 1 # # NULL SLAVESIDE_DISABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci ==========MASTER========== SELECT COUNT(*) FROM t1; COUNT(*) @@ -778,11 +778,11 @@ a b DROP EVENT e2; ==========MASTER========== SHOW EVENTS; -Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation ==========SLAVE=========== USE test_rpl; SHOW EVENTS; -Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator +Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation DELETE FROM t1; DELETE FROM t2; @@ -793,32 +793,32 @@ CREATE VIEW v1 AS SELECT * FROM t1 WHERE a = 1; CREATE VIEW v2 AS SELECT * FROM t1 WHERE b <> UUID(); ==========MASTER========== SHOW CREATE VIEW v1; -View Create View -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) +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; a b 1 test1 ==========SLAVE=========== USE test_rpl; SHOW CREATE VIEW v1; -View Create View -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) +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; a b 1 test1 ALTER VIEW v1 AS SELECT * FROM t1 WHERE a = 2; ==========MASTER========== SHOW CREATE VIEW v1; -View Create View -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) +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; a b 2 test2 ==========SLAVE=========== USE test_rpl; SHOW CREATE VIEW v1; -View Create View -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) +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; a b 2 test2 @@ -867,8 +867,8 @@ master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t1 master-bin.000001 # Xid 1 # # master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t2 master-bin.000001 # Xid 1 # # -master-bin.000001 # Begin_load_query 1 # ;file_id=1;block_len=30 -master-bin.000001 # Execute_load_query 1 # use `test_rpl`; LOAD DATA INFILE '../../suite/rpl/data/rpl_mixed.dat' INTO TABLE t1 FIELDS TERMINATED BY '|' ;file_id=1 +master-bin.000001 # Begin_load_query 1 # ;file_id=#;block_len=# +master-bin.000001 # Execute_load_query 1 # use `test_rpl`; LOAD DATA INFILE '../tmp/rpl_mixed.dat' INTO TABLE t1 FIELDS TERMINATED BY '|' ;file_id=# master-bin.000001 # Xid 1 # # master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t1 master-bin.000001 # Xid 1 # # @@ -1004,9 +1004,7 @@ master-bin.000001 # Table_map 1 # table_id: # (test_rpl.t2) master-bin.000001 # Write_rows 1 # table_id: # master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F master-bin.000001 # Xid 1 # # -master-bin.000001 # Table_map 1 # table_id: # (test_rpl.t1) -master-bin.000001 # Table_map 1 # table_id: # (test_rpl.t2) -master-bin.000001 # Delete_rows 1 # table_id: # flags: STMT_END_F +master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t1 master-bin.000001 # Xid 1 # # master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t2 master-bin.000001 # Xid 1 # # diff --git a/mysql-test/suite/rpl/t/disabled.def b/mysql-test/suite/rpl/t/disabled.def index 2f4b4a57cf0..34a8d6988a9 100644 --- a/mysql-test/suite/rpl/t/disabled.def +++ b/mysql-test/suite/rpl/t/disabled.def @@ -11,8 +11,8 @@ ############################################################################## rpl_ddl : BUG#26418 2007-03-01 mleich Slave out of sync after CREATE/DROP TEMPORARY TABLE + ROLLBACK on master -rpl_innodb_mixed_ddl : Bug #29363 rpl.rpl_innodb_mixed_* test failures -rpl_innodb_mixed_dml : Bug #29363 rpl.rpl_innodb_mixed_* test failures +#rpl_innodb_mixed_ddl : Bug #29363 rpl.rpl_innodb_mixed_* test failures +#rpl_innodb_mixed_dml : Bug #29363 rpl.rpl_innodb_mixed_* test failures 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_stm_extraColmaster_ndb : WL#3915 : Statement-based replication not supported in ndb. Enable test when supported. From e1b9e55a5aff8df696e7ae07a58308df69711773 Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.(none)" <> Date: Thu, 23 Aug 2007 20:24:48 +0200 Subject: [PATCH 27/90] Bug#30593 No cipher list returned for "SHOW STATUS LIKE 'Ssl_cipher_list'" - Move increment of "i" to "increment section" of for loop - Protect against writing after end of "buff"(backport from 5.1) --- sql/sql_show.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 05a847b3830..1f408bbaf40 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -1739,12 +1739,13 @@ static bool show_status_array(THD *thd, const char *wild, if (thd->net.vio->ssl_arg) { char *to= buff; - for (int i=0 ; i++ ;) + char *buff_end= buff + sizeof(buff); + for (int i= 0; to < buff_end; i++) { const char *p= SSL_get_cipher_list((SSL*) thd->net.vio->ssl_arg,i); if (p == NULL) break; - to= strmov(to, p); + to= strnmov(to, p, buff_end-to-1); *to++= ':'; } if (to != buff) From e543c7436ef7d72111a1457a83e13651a9297f61 Mon Sep 17 00:00:00 2001 From: "gshchepa/uchum@gleb.loc" <> Date: Fri, 24 Aug 2007 01:54:18 +0500 Subject: [PATCH 28/90] Fixed bug #30287. Recommit to 5.1.22. The server created temporary tables for filesort in the working directory instead of the specified tmpdir directory. --- sql/item.cc | 2 ++ sql/sql_select.cc | 18 ++++++++---------- sql/sql_view.cc | 6 ++++++ 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/sql/item.cc b/sql/item.cc index 2e68e96d518..1e08e31f5fd 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -1801,6 +1801,8 @@ void Item_field::set_field(Field *field_par) unsigned_flag=test(field_par->flags & UNSIGNED_FLAG); collation.set(field_par->charset(), field_par->derivation()); fixed= 1; + if (field->table->s->tmp_table == SYSTEM_TMP_TABLE) + any_privileges= 0; } diff --git a/sql/sql_select.cc b/sql/sql_select.cc index e91c1632b17..45727e683d6 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -9417,7 +9417,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List &fields, bool using_unique_constraint= 0; bool use_packed_rows= 0; bool not_all_columns= !(select_options & TMP_TABLE_ALL_COLUMNS); - char *tmpname, *tmppath, path[FN_REFLEN], table_name[NAME_LEN+1]; + char *tmpname,path[FN_REFLEN]; uchar *pos, *group_buff, *bitmaps; uchar *null_flags; Field **reg_field, **from_field, **default_field; @@ -9441,12 +9441,12 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List &fields, temp_pool_slot = bitmap_lock_set_next(&temp_pool); if (temp_pool_slot != MY_BIT_NONE) // we got a slot - sprintf(table_name, "%s_%lx_%i", tmp_file_prefix, + sprintf(path, "%s_%lx_%i", tmp_file_prefix, current_pid, temp_pool_slot); else { /* if we run out of slots or we are not using tempool */ - sprintf(table_name, "%s%lx_%lx_%x", tmp_file_prefix,current_pid, + sprintf(path,"%s%lx_%lx_%x", tmp_file_prefix,current_pid, thd->thread_id, thd->tmp_table++); } @@ -9454,8 +9454,8 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List &fields, No need to change table name to lower case as we are only creating MyISAM or HEAP tables here */ - fn_format(path, table_name, mysql_tmpdir, "", - MY_REPLACE_EXT|MY_UNPACK_FILENAME); + fn_format(path, path, mysql_tmpdir, "", MY_REPLACE_EXT|MY_UNPACK_FILENAME); + if (group) { @@ -9501,8 +9501,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List &fields, sizeof(*key_part_info)*(param->group_parts+1), ¶m->start_recinfo, sizeof(*param->recinfo)*(field_count*2+4), - &tmppath, (uint) strlen(path)+1, - &tmpname, (uint) strlen(table_name)+1, + &tmpname, (uint) strlen(path)+1, &group_buff, (group && ! using_unique_constraint ? param->group_length : 0), &bitmaps, bitmap_buffer_size(field_count)*2, @@ -9521,8 +9520,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List &fields, DBUG_RETURN(NULL); /* purecov: inspected */ } param->items_to_copy= copy_func; - strmov(tmppath, path); - strmov(tmpname, table_name); + strmov(tmpname,path); /* make table according to fields */ bzero((char*) table,sizeof(*table)); @@ -9547,7 +9545,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List &fields, table->keys_in_use_for_query.init(); table->s= share; - init_tmp_table_share(share, "", 0, tmpname, tmppath); + init_tmp_table_share(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_view.cc b/sql/sql_view.cc index 9a46bbc39e4..38d7174b7ca 100644 --- a/sql/sql_view.cc +++ b/sql/sql_view.cc @@ -397,7 +397,13 @@ bool mysql_create_view(THD *thd, TABLE_LIST *views, { Item_field *field; if ((field= item->filed_for_view_update())) + { + /* + any_privileges may be reset later by the Item_field::set_field + method in case of a system temporary table. + */ field->any_privileges= 1; + } } } #endif From 6e76e82e8bb088a4903fe5e5d52dadf075b07cd6 Mon Sep 17 00:00:00 2001 From: "gshchepa/uchum@gleb.loc" <> Date: Fri, 24 Aug 2007 01:59:48 +0500 Subject: [PATCH 29/90] Fixed bug #30201. Recommit to 5.1.22. Killing a SELECT query with KILL QUERY or KILL CONNECTION causes a server crash if the query cache is enabled. Normal evaluation of a query may be interrupted by the KILL QUERY/CONNECTION statement, in this case the mysql_execute_command function returns TRUE, and the thd->killed flag has true value. In this case the result of the query may be cached incompletely (omitting call to query_cache_insert inside the net_real_write function), and next call to query_cache_end_of_result may lead to server crash. Thus, the query_cache_end_of_result function has been modified to abort query cache in the case of killed thread. --- sql/sql_cache.cc | 37 +++++++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc index f6b48afc10b..f031bc57272 100644 --- a/sql/sql_cache.cc +++ b/sql/sql_cache.cc @@ -749,6 +749,12 @@ void query_cache_end_of_result(THD *thd) if (thd->net.query_cache_query == 0) DBUG_VOID_RETURN; + if (thd->killed) + { + query_cache_abort(&thd->net); + DBUG_VOID_RETURN; + } + #ifdef EMBEDDED_LIBRARY query_cache_insert(&thd->net, (char*)thd, emb_count_querycache_size(thd)); @@ -775,28 +781,31 @@ void query_cache_end_of_result(THD *thd) DUMP(&query_cache); BLOCK_LOCK_WR(query_block); Query_cache_query *header= query_block->query(); - Query_cache_block *last_result_block= header->result()->prev; - ulong allign_size= ALIGN_SIZE(last_result_block->used); - ulong len= max(query_cache.min_allocation_unit, allign_size); - if (last_result_block->length >= query_cache.min_allocation_unit + len) - query_cache.split_block(last_result_block,len); + Query_cache_block *last_result_block; + ulong allign_size; + ulong len; -#ifndef DBUG_OFF if (header->result() == 0) { - DBUG_PRINT("error", ("end of data whith no result. query '%s'", - header->query())); - query_cache.wreck(__LINE__, ""); - + DBUG_PRINT("error", ("End of data with no result blocks; " + "Query '%s' removed from cache.", header->query())); /* - We do not need call of BLOCK_UNLOCK_WR(query_block); here because - query_cache.wreck() switched query cache off but left content - untouched for investigation (it is debugging method). + Extra safety: empty result should not happen in the normal call + to this function. In the release version that query should be ignored + and removed from QC. */ + DBUG_ASSERT(0); + query_cache.free_query(query_block); STRUCT_UNLOCK(&query_cache.structure_guard_mutex); DBUG_VOID_RETURN; } -#endif + + last_result_block= header->result()->prev; + allign_size= ALIGN_SIZE(last_result_block->used); + len= max(query_cache.min_allocation_unit, allign_size); + if (last_result_block->length >= query_cache.min_allocation_unit + len) + query_cache.split_block(last_result_block,len); + header->found_rows(current_thd->limit_found_rows); header->result()->type= Query_cache_block::RESULT; From 4a7fdf8611938947a284113096f0cd21e97f2936 Mon Sep 17 00:00:00 2001 From: "gshchepa/uchum@gleb.loc" <> Date: Fri, 24 Aug 2007 02:23:49 +0500 Subject: [PATCH 30/90] Fixed bug #30396. Recommit to 5.1.22. The bug caused memory corruption for some queries with top OR level in the WHERE condition if they contained equality predicates and other sargable predicates in disjunctive parts of the condition. The corruption happened because the upper bound of the memory allocated for KEY_FIELD and SARGABLE_PARAM internal structures containing info about potential lookup keys was calculated incorrectly in some cases. In particular it was calculated incorrectly when the WHERE condition was an OR formula with disjuncts being AND formulas including equalities and other sargable predicates. --- mysql-test/r/select.result | 57 ++++++++++++++++++++++++++++++++++++ mysql-test/t/select.test | 60 ++++++++++++++++++++++++++++++++++++++ sql/item_cmpfunc.h | 1 - sql/sql_base.cc | 1 + sql/sql_lex.cc | 1 + sql/sql_lex.h | 3 +- sql/sql_select.cc | 38 ++++++++---------------- 7 files changed, 133 insertions(+), 28 deletions(-) diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index a148d1029df..f74b6a08509 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -3980,4 +3980,61 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE f1 index inx inx 10 NULL 7 Using where; Using index 1 SIMPLE f2 ref inx inx 5 test.f1.b 1 Using where; Using index DROP TABLE t1; +CREATE TABLE t1 ( +c1 int(11) NOT NULL AUTO_INCREMENT, +c2 varchar(1000) DEFAULT NULL, +c3 bigint(20) DEFAULT NULL, +c4 bigint(20) DEFAULT NULL, +PRIMARY KEY (c1) +); +EXPLAIN EXTENDED +SELECT join_2.c1 +FROM +t1 AS join_0, +t1 AS join_1, +t1 AS join_2, +t1 AS join_3, +t1 AS join_4, +t1 AS join_5, +t1 AS join_6, +t1 AS join_7 +WHERE +join_0.c1=join_1.c1 AND +join_1.c1=join_2.c1 AND +join_2.c1=join_3.c1 AND +join_3.c1=join_4.c1 AND +join_4.c1=join_5.c1 AND +join_5.c1=join_6.c1 AND +join_6.c1=join_7.c1 +OR +join_0.c2 < '?' AND +join_1.c2 < '?' AND +join_2.c2 > '?' AND +join_2.c2 < '!' AND +join_3.c2 > '?' AND +join_4.c2 = '?' AND +join_5.c2 <> '?' AND +join_6.c2 <> '?' AND +join_7.c2 >= '?' AND +join_0.c1=join_1.c1 AND +join_1.c1=join_2.c1 AND +join_2.c1=join_3.c1 AND +join_3.c1=join_4.c1 AND +join_4.c1=join_5.c1 AND +join_5.c1=join_6.c1 AND +join_6.c1=join_7.c1 +GROUP BY +join_3.c1, +join_2.c1, +join_7.c1, +join_1.c1, +join_0.c1; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Note 1003 select '0' AS `c1` from `test`.`t1` `join_0` join `test`.`t1` `join_1` join `test`.`t1` `join_2` join `test`.`t1` `join_3` join `test`.`t1` `join_4` join `test`.`t1` `join_5` join `test`.`t1` `join_6` join `test`.`t1` `join_7` where 0 group by '0','0','0','0','0' +SHOW WARNINGS; +Level Code Message +Note 1003 select '0' AS `c1` from `test`.`t1` `join_0` join `test`.`t1` `join_1` join `test`.`t1` `join_2` join `test`.`t1` `join_3` join `test`.`t1` `join_4` join `test`.`t1` `join_5` join `test`.`t1` `join_6` join `test`.`t1` `join_7` where 0 group by '0','0','0','0','0' +DROP TABLE t1; End of 5.0 tests diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test index 1f8a00409e6..1055240bb5e 100644 --- a/mysql-test/t/select.test +++ b/mysql-test/t/select.test @@ -3359,4 +3359,64 @@ EXPLAIN SELECT COUNT(*) FROM t1 f1 INNER JOIN t1 f2 WHERE 1 AND f1.b NOT IN (100,2232,3343,51111); DROP TABLE t1; +# +# Bug #30396: crash for a join with equalities and sargable predicates +# in disjunctive parts of the WHERE condition +# + +CREATE TABLE t1 ( + c1 int(11) NOT NULL AUTO_INCREMENT, + c2 varchar(1000) DEFAULT NULL, + c3 bigint(20) DEFAULT NULL, + c4 bigint(20) DEFAULT NULL, + PRIMARY KEY (c1) +); + +EXPLAIN EXTENDED +SELECT join_2.c1 +FROM + t1 AS join_0, + t1 AS join_1, + t1 AS join_2, + t1 AS join_3, + t1 AS join_4, + t1 AS join_5, + t1 AS join_6, + t1 AS join_7 +WHERE + join_0.c1=join_1.c1 AND + join_1.c1=join_2.c1 AND + join_2.c1=join_3.c1 AND + join_3.c1=join_4.c1 AND + join_4.c1=join_5.c1 AND + join_5.c1=join_6.c1 AND + join_6.c1=join_7.c1 + OR + join_0.c2 < '?' AND + join_1.c2 < '?' AND + join_2.c2 > '?' AND + join_2.c2 < '!' AND + join_3.c2 > '?' AND + join_4.c2 = '?' AND + join_5.c2 <> '?' AND + join_6.c2 <> '?' AND + join_7.c2 >= '?' AND + join_0.c1=join_1.c1 AND + join_1.c1=join_2.c1 AND + join_2.c1=join_3.c1 AND + join_3.c1=join_4.c1 AND + join_4.c1=join_5.c1 AND + join_5.c1=join_6.c1 AND + join_6.c1=join_7.c1 +GROUP BY + join_3.c1, + join_2.c1, + join_7.c1, + join_1.c1, + join_0.c1; + +SHOW WARNINGS; + +DROP TABLE t1; + --echo End of 5.0 tests diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h index 35ecfdb0f2c..4015e5618e8 100644 --- a/sql/item_cmpfunc.h +++ b/sql/item_cmpfunc.h @@ -1569,7 +1569,6 @@ public: the current and level */ COND_EQUAL() { - max_members= 0; upper_levels= 0; } }; diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 24c6979c0f6..737ad39745a 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -6738,6 +6738,7 @@ int setup_conds(THD *thd, TABLE_LIST *tables, TABLE_LIST *leaves, DBUG_PRINT("info", ("thd->mark_used_columns: %d", thd->mark_used_columns)); select_lex->cond_count= 0; select_lex->between_count= 0; + select_lex->max_equal_elems= 0; for (table= tables; table; table= table->next_local) { diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index 19264a17d2f..d9e8f13a7ae 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -1517,6 +1517,7 @@ void st_select_lex::init_query() */ parent_lex->push_context(&context); cond_count= between_count= with_wild= 0; + max_equal_elems= 0; conds_processed_with_permanent_arena= 0; ref_pointer_array= 0; select_n_where_fields= 0; diff --git a/sql/sql_lex.h b/sql/sql_lex.h index 11273bba314..3969d75f64d 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -606,7 +606,8 @@ public: */ uint select_n_having_items; uint cond_count; /* number of arguments of and/or/xor in where/having/on */ - uint between_count; /* number of between predicates in where/having/on */ + uint between_count; /* number of between predicates in where/having/on */ + uint max_equal_elems; /* maximal number of elements in multiple equalities */ /* Number of fields used in select list or where clause of current select and all inner subselects. diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 45727e683d6..52a26df1088 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -3562,10 +3562,7 @@ update_ref_and_keys(THD *thd, DYNAMIC_ARRAY *keyuse,JOIN_TAB *join_tab, uint and_level,i,found_eq_constant; KEY_FIELD *key_fields, *end, *field; uint sz; - uint m= 1; - - if (cond_equal && cond_equal->max_members) - m= cond_equal->max_members; + uint m= max(select_lex->max_equal_elems,1); /* We use the same piece of memory to store both KEY_FIELD @@ -3585,7 +3582,8 @@ update_ref_and_keys(THD *thd, DYNAMIC_ARRAY *keyuse,JOIN_TAB *join_tab, it is considered as sargable only for its first argument. Multiple equality can add elements that are filled after substitution of field arguments by equal fields. There - can be not more than cond_equal->max_members such substitutions. + can be not more than select_lex->max_equal_elems such + substitutions. */ sz= max(sizeof(KEY_FIELD),sizeof(SARGABLE_PARAM))* (((thd->lex->current_select->cond_count+1)*2 + @@ -7387,8 +7385,7 @@ static bool check_equality(THD *thd, Item *item, COND_EQUAL *cond_equal, just an argument of a comparison predicate. The function also determines the maximum number of members in equality lists of each Item_cond_and object assigning it to - cond_equal->max_members of this object and updating accordingly - the upper levels COND_EQUAL structures. + thd->lex->current_select->max_equal_elems. NOTES Multiple equality predicate =(f1,..fn) is equivalent to the conjuction of @@ -7433,7 +7430,6 @@ static COND *build_equal_items_for_cond(THD *thd, COND *cond, COND_EQUAL *inherited) { Item_equal *item_equal; - uint members; COND_EQUAL cond_equal; cond_equal.upper_levels= inherited; @@ -7471,19 +7467,8 @@ static COND *build_equal_items_for_cond(THD *thd, COND *cond, { item_equal->fix_length_and_dec(); item_equal->update_used_tables(); - members= item_equal->members(); - if (cond_equal.max_members < members) - cond_equal.max_members= members; - } - members= cond_equal.max_members; - if (inherited && inherited->max_members < members) - { - do - { - inherited->max_members= members; - inherited= inherited->upper_levels; - } - while (inherited); + set_if_bigger(thd->lex->current_select->max_equal_elems, + item_equal->members()); } ((Item_cond_and*)cond)->cond_equal= cond_equal; @@ -7538,10 +7523,12 @@ static COND *build_equal_items_for_cond(THD *thd, COND *cond, { item_equal->fix_length_and_dec(); item_equal->update_used_tables(); - return item_equal; } else - return eq_list.pop(); + item_equal= (Item_equal *) eq_list.pop(); + set_if_bigger(thd->lex->current_select->max_equal_elems, + item_equal->members()); + return item_equal; } else { @@ -7557,9 +7544,8 @@ static COND *build_equal_items_for_cond(THD *thd, COND *cond, { item_equal->fix_length_and_dec(); item_equal->update_used_tables(); - members= item_equal->members(); - if (cond_equal.max_members < members) - cond_equal.max_members= members; + set_if_bigger(thd->lex->current_select->max_equal_elems, + item_equal->members()); } and_cond->cond_equal= cond_equal; args->concat((List *)&cond_equal.current_level); From af5a367311a582a8c93fd31b9a76fb1bae098a45 Mon Sep 17 00:00:00 2001 From: "tomas@whalegate.ndb.mysql.com" <> Date: Fri, 24 Aug 2007 09:50:54 +0200 Subject: [PATCH 31/90] unable to reproduce bug, perhaps pushbuild can give more info --- mysql-test/suite/ndb/t/disabled.def | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/suite/ndb/t/disabled.def b/mysql-test/suite/ndb/t/disabled.def index 023c9c47210..b97cb9cecc9 100644 --- a/mysql-test/suite/ndb/t/disabled.def +++ b/mysql-test/suite/ndb/t/disabled.def @@ -22,4 +22,4 @@ ndb_partition_error2 : HF is not sure if the test can work as internded on all #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_autodiscover3 : bug#21806 -ndb_autodiscover3 : Bug#20872 2007-07-15 ingo master*.err: miscellaneous error messages +#ndb_autodiscover3 : Bug#20872 2007-07-15 ingo master*.err: miscellaneous error messages From 4fcea0fc5c600ec4082007f1f375df9a4658c205 Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.(none)" <> Date: Fri, 24 Aug 2007 13:10:34 +0200 Subject: [PATCH 32/90] Remove unecessary use of "Socket" --- mysql-test/lib/mtr_timer.pl | 1 - 1 file changed, 1 deletion(-) diff --git a/mysql-test/lib/mtr_timer.pl b/mysql-test/lib/mtr_timer.pl index d8b6953fb46..326fbea74ec 100644 --- a/mysql-test/lib/mtr_timer.pl +++ b/mysql-test/lib/mtr_timer.pl @@ -18,7 +18,6 @@ # and is part of the translation of the Bourne shell script with the # same name. -use Socket; use Errno; use strict; From 89780a84c8b77b2232e0593fbb6680101fcf5101 Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.(none)" <> Date: Fri, 24 Aug 2007 15:43:45 +0200 Subject: [PATCH 33/90] Remove unsued variable $glob_hostname, unused functions 'mtr_short_hostname' and 'mtr_full_hostname' --- mysql-test/lib/mtr_misc.pl | 26 -------------------------- mysql-test/mysql-test-run.pl | 8 ++++---- 2 files changed, 4 insertions(+), 30 deletions(-) diff --git a/mysql-test/lib/mtr_misc.pl b/mysql-test/lib/mtr_misc.pl index dc22f88bd7f..e54cb326ade 100644 --- a/mysql-test/lib/mtr_misc.pl +++ b/mysql-test/lib/mtr_misc.pl @@ -20,8 +20,6 @@ use strict; -sub mtr_full_hostname (); -sub mtr_short_hostname (); sub mtr_native_path($); sub mtr_init_args ($); sub mtr_add_arg ($$@); @@ -40,30 +38,6 @@ sub mtr_cmp_opts($$); # ############################################################################## -# We want the fully qualified host name and hostname() may have returned -# only the short name. So we use the resolver to find out. -# Note that this might fail on some platforms - -sub mtr_full_hostname () { - - my $hostname= hostname(); - if ( $hostname !~ /\./ ) - { - my $address= gethostbyname($hostname) - or mtr_error("Couldn't resolve $hostname : $!"); - my $fullname= gethostbyaddr($address, AF_INET); - $hostname= $fullname if $fullname; - } - return $hostname; -} - -sub mtr_short_hostname () { - - my $hostname= hostname(); - $hostname =~ s/\..+$//; - return $hostname; -} - # Convert path to OS native format sub mtr_native_path($) { diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 364a304a15b..269bfbcb40f 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -61,7 +61,6 @@ use File::Copy; use File::Temp qw / tempdir /; use Cwd; use Getopt::Long; -use Sys::Hostname; use IO::Socket; use IO::Socket::INET; use strict; @@ -100,7 +99,6 @@ $Devel::Trace::TRACE= 1; our $mysql_version_id; our $glob_mysql_test_dir= undef; our $glob_mysql_bench_dir= undef; -our $glob_hostname= undef; our $glob_scriptname= undef; our $glob_timers= undef; our $glob_use_running_ndbcluster= 0; @@ -647,8 +645,6 @@ sub command_line_setup () { $source_dist= 1; } - $glob_hostname= mtr_short_hostname(); - # Find the absolute path to the test directory $glob_mysql_test_dir= cwd(); if ( $glob_cygwin_perl ) @@ -3063,11 +3059,15 @@ sub install_db ($$) { mtr_appendfile_to_file("$path_sql_dir/fill_help_tables.sql", $bootstrap_sql_file); + mtr_tofile($bootstrap_sql_file, + "DELETE FROM mysql.user where user= '';"); + # Log bootstrap command my $path_bootstrap_log= "$opt_vardir/log/bootstrap.log"; mtr_tofile($path_bootstrap_log, "$exe_mysqld_bootstrap " . join(" ", @$args) . "\n"); + if ( mtr_run($exe_mysqld_bootstrap, $args, $bootstrap_sql_file, $path_bootstrap_log, $path_bootstrap_log, "", { append_log_file => 1 }) != 0 ) From eb6651b017b711316d1dd47a0175560bb0841cbf Mon Sep 17 00:00:00 2001 From: "holyfoot/hf@mysql.com/hfmain.(none)" <> Date: Fri, 24 Aug 2007 21:36:51 +0500 Subject: [PATCH 34/90] ha_partition.cc, ha_partition.h: bug fixed partition_pruning.result: test fixed --- mysql-test/r/partition_pruning.result | 4 ++-- sql/ha_partition.cc | 15 ++++++++++++++- sql/ha_partition.h | 1 + 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/mysql-test/r/partition_pruning.result b/mysql-test/r/partition_pruning.result index 9595676016c..776e6f3a15a 100644 --- a/mysql-test/r/partition_pruning.result +++ b/mysql-test/r/partition_pruning.result @@ -631,7 +631,7 @@ flush status; delete from t2 where b > 5; show status like 'Handler_read_rnd_next'; Variable_name Value -Handler_read_rnd_next 1215 +Handler_read_rnd_next 1115 show status like 'Handler_read_key'; Variable_name Value Handler_read_key 0 @@ -645,7 +645,7 @@ flush status; delete from t2 where b < 5 or b > 3; show status like 'Handler_read_rnd_next'; Variable_name Value -Handler_read_rnd_next 1215 +Handler_read_rnd_next 1115 show status like 'Handler_read_key'; Variable_name Value Handler_read_key 0 diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index 6521be1cb9a..326b8b2d43b 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -3216,9 +3216,14 @@ end_dont_reset_start_part: void ha_partition::position(const uchar *record) { - handler *file= m_file[m_last_part]; + handler *file; DBUG_ENTER("ha_partition::position"); + if (unlikely(get_part_for_delete(record, m_rec0, m_part_info, &m_last_part))) + m_last_part= 0; + + file= m_file[m_last_part]; + file->position(record); int2store(ref, m_last_part); memcpy((ref + PARTITION_BYTES_IN_POS), file->ref, @@ -3233,6 +3238,14 @@ void ha_partition::position(const uchar *record) DBUG_VOID_RETURN; } + +void ha_partition::column_bitmaps_signal() +{ + handler::column_bitmaps_signal(); + bitmap_union(table->read_set, &m_part_info->full_part_field_set); +} + + /* Read row using position diff --git a/sql/ha_partition.h b/sql/ha_partition.h index 555f7a72740..434d90a4487 100644 --- a/sql/ha_partition.h +++ b/sql/ha_partition.h @@ -449,6 +449,7 @@ private: int handle_ordered_next(uchar * buf, bool next_same); int handle_ordered_prev(uchar * buf); void return_top_record(uchar * buf); + void column_bitmaps_signal(); public: /* ------------------------------------------------------------------------- From 159d5b71b13ffddca796bac1e1f3c86a16a70b15 Mon Sep 17 00:00:00 2001 From: "tsmith@ramayana.hindu.god" <> Date: Fri, 24 Aug 2007 19:14:52 -0600 Subject: [PATCH 35/90] Apply InnoDB snapshot innodb-5.1-ss1726. Bug #16979: AUTO_INC lock in InnoDB works a table level lock - this is a major change in InnoDB auto-inc handling. Bug #27950: Duplicate entry error in auto-inc after mysqld restart - Init AUTOINC from delete_row(). Bug #28781: InnoDB increments auto-increment value incorrectly with ON DUPLICATE KEY UPDATE - Use value specified by MySQL, in update_row(). --- mysql-test/r/innodb.result | 2 +- storage/innobase/dict/dict0dict.c | 163 +++--- storage/innobase/dict/dict0mem.c | 76 +-- storage/innobase/handler/ha_innodb.cc | 720 ++++++++++++++++---------- storage/innobase/handler/ha_innodb.h | 8 + storage/innobase/ibuf/ibuf0ibuf.c | 20 +- storage/innobase/include/dict0dict.h | 50 +- storage/innobase/include/dict0mem.h | 8 +- storage/innobase/include/lock0lock.h | 2 +- storage/innobase/include/row0mysql.h | 1 + storage/innobase/include/row0sel.h | 10 + storage/innobase/include/trx0trx.h | 3 + storage/innobase/include/ut0mem.h | 2 +- storage/innobase/log/log0recv.c | 7 +- storage/innobase/row/row0mysql.c | 4 + storage/innobase/row/row0sel.c | 166 ++++++ storage/innobase/trx/trx0trx.c | 2 + 17 files changed, 788 insertions(+), 456 deletions(-) diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result index 804c4b81c17..a883b434c0b 100644 --- a/mysql-test/r/innodb.result +++ b/mysql-test/r/innodb.result @@ -501,7 +501,7 @@ ERROR 23000: Duplicate entry 'test2' for key 'ggid' select * from t1; id ggid email passwd 1 this will work -3 test2 this will work +4 test2 this will work select * from t1 where id=1; id ggid email passwd 1 this will work diff --git a/storage/innobase/dict/dict0dict.c b/storage/innobase/dict/dict0dict.c index e2a9535dc8b..595dfb06ee5 100644 --- a/storage/innobase/dict/dict0dict.c +++ b/storage/innobase/dict/dict0dict.c @@ -410,14 +410,27 @@ dict_table_get_col_name( ut_ad(table->magic_n == DICT_TABLE_MAGIC_N); s = table->col_names; - - for (i = 0; i < col_nr; i++) { - s += strlen(s) + 1; + if (s) { + for (i = 0; i < col_nr; i++) { + s += strlen(s) + 1; + } } return(s); } + +/************************************************************************ +Acquire the autoinc lock.*/ + +void +dict_table_autoinc_lock( +/*====================*/ + dict_table_t* table) +{ + mutex_enter(&table->autoinc_mutex); +} + /************************************************************************ Initializes the autoinc counter. It is not an error to initialize an already initialized counter. */ @@ -428,54 +441,8 @@ dict_table_autoinc_initialize( dict_table_t* table, /* in: table */ ib_longlong value) /* in: next value to assign to a row */ { - mutex_enter(&(table->autoinc_mutex)); - table->autoinc_inited = TRUE; table->autoinc = value; - - mutex_exit(&(table->autoinc_mutex)); -} - -/************************************************************************ -Gets the next autoinc value (== autoinc counter value), 0 if not yet -initialized. If initialized, increments the counter by 1. */ - -ib_longlong -dict_table_autoinc_get( -/*===================*/ - /* out: value for a new row, or 0 */ - dict_table_t* table) /* in: table */ -{ - ib_longlong value; - - mutex_enter(&(table->autoinc_mutex)); - - if (!table->autoinc_inited) { - - value = 0; - } else { - value = table->autoinc; - table->autoinc = table->autoinc + 1; - } - - mutex_exit(&(table->autoinc_mutex)); - - return(value); -} - -/************************************************************************ -Decrements the autoinc counter value by 1. */ - -void -dict_table_autoinc_decrement( -/*=========================*/ - dict_table_t* table) /* in: table */ -{ - mutex_enter(&(table->autoinc_mutex)); - - table->autoinc = table->autoinc - 1; - - mutex_exit(&(table->autoinc_mutex)); } /************************************************************************ @@ -490,32 +457,6 @@ dict_table_autoinc_read( { ib_longlong value; - mutex_enter(&(table->autoinc_mutex)); - - if (!table->autoinc_inited) { - - value = 0; - } else { - value = table->autoinc; - } - - mutex_exit(&(table->autoinc_mutex)); - - return(value); -} - -/************************************************************************ -Peeks the autoinc counter value, 0 if not yet initialized. Does not -increment the counter. The read not protected by any mutex! */ - -ib_longlong -dict_table_autoinc_peek( -/*====================*/ - /* out: value of the counter */ - dict_table_t* table) /* in: table */ -{ - ib_longlong value; - if (!table->autoinc_inited) { value = 0; @@ -527,7 +468,7 @@ dict_table_autoinc_peek( } /************************************************************************ -Updates the autoinc counter if the value supplied is equal or bigger than the +Updates the autoinc counter if the value supplied is greater than the current value. If not inited, does nothing. */ void @@ -537,15 +478,21 @@ dict_table_autoinc_update( dict_table_t* table, /* in: table */ ib_longlong value) /* in: value which was assigned to a row */ { - mutex_enter(&(table->autoinc_mutex)); + if (table->autoinc_inited && value > table->autoinc) { - if (table->autoinc_inited) { - if (value >= table->autoinc) { - table->autoinc = value + 1; - } + table->autoinc = value; } +} - mutex_exit(&(table->autoinc_mutex)); +/************************************************************************ +Release the autoinc lock.*/ + +void +dict_table_autoinc_unlock( +/*======================*/ + dict_table_t* table) /* in: release autoinc lock for this table */ +{ + mutex_exit(&table->autoinc_mutex); } /************************************************************************ @@ -842,28 +789,18 @@ dict_table_get( } /************************************************************************** -Adds a table object to the dictionary cache. */ +Adds system columns to a table object. */ void -dict_table_add_to_cache( -/*====================*/ - dict_table_t* table) /* in: table */ +dict_table_add_system_columns( +/*==========================*/ + dict_table_t* table, /* in/out: table */ + mem_heap_t* heap) /* in: temporary heap */ { - ulint fold; - ulint id_fold; - ulint i; - ulint row_len; - ut_ad(table); - ut_ad(mutex_own(&(dict_sys->mutex))); ut_ad(table->n_def == table->n_cols - DATA_N_SYS_COLS); ut_ad(table->magic_n == DICT_TABLE_MAGIC_N); - ut_ad(table->cached == FALSE); - - fold = ut_fold_string(table->name); - id_fold = ut_fold_dulint(table->id); - - table->cached = TRUE; + ut_ad(!table->cached); /* NOTE: the system columns MUST be added in the following order (so that they can be indexed by the numerical value of DATA_ROW_ID, @@ -871,19 +808,19 @@ dict_table_add_to_cache( The clustered index will not always physically contain all system columns. */ - dict_mem_table_add_col(table, "DB_ROW_ID", DATA_SYS, + dict_mem_table_add_col(table, heap, "DB_ROW_ID", DATA_SYS, DATA_ROW_ID | DATA_NOT_NULL, DATA_ROW_ID_LEN); #if DATA_ROW_ID != 0 #error "DATA_ROW_ID != 0" #endif - dict_mem_table_add_col(table, "DB_TRX_ID", DATA_SYS, + dict_mem_table_add_col(table, heap, "DB_TRX_ID", DATA_SYS, DATA_TRX_ID | DATA_NOT_NULL, DATA_TRX_ID_LEN); #if DATA_TRX_ID != 1 #error "DATA_TRX_ID != 1" #endif - dict_mem_table_add_col(table, "DB_ROLL_PTR", DATA_SYS, + dict_mem_table_add_col(table, heap, "DB_ROLL_PTR", DATA_SYS, DATA_ROLL_PTR | DATA_NOT_NULL, DATA_ROLL_PTR_LEN); #if DATA_ROLL_PTR != 2 @@ -895,10 +832,34 @@ dict_table_add_to_cache( #if DATA_N_SYS_COLS != 3 #error "DATA_N_SYS_COLS != 3" #endif +} + +/************************************************************************** +Adds a table object to the dictionary cache. */ + +void +dict_table_add_to_cache( +/*====================*/ + dict_table_t* table, /* in: table */ + mem_heap_t* heap) /* in: temporary heap */ +{ + ulint fold; + ulint id_fold; + ulint i; + ulint row_len; /* The lower limit for what we consider a "big" row */ #define BIG_ROW_SIZE 1024 + ut_ad(mutex_own(&(dict_sys->mutex))); + + dict_table_add_system_columns(table, heap); + + table->cached = TRUE; + + fold = ut_fold_string(table->name); + id_fold = ut_fold_dulint(table->id); + row_len = 0; for (i = 0; i < table->n_def; i++) { ulint col_len = dict_col_get_max_size( diff --git a/storage/innobase/dict/dict0mem.c b/storage/innobase/dict/dict0mem.c index 9aa49dee745..e0b8bf15dd7 100644 --- a/storage/innobase/dict/dict0mem.c +++ b/storage/innobase/dict/dict0mem.c @@ -90,6 +90,11 @@ dict_mem_table_create( mutex_create(&table->autoinc_mutex, SYNC_DICT_AUTOINC_MUTEX); table->autoinc_inited = FALSE; + + /* The actual increment value will be set by MySQL, we simply + default to 1 here.*/ + table->autoinc_increment = 1; + #ifdef UNIV_DEBUG table->magic_n = DICT_TABLE_MAGIC_N; #endif /* UNIV_DEBUG */ @@ -108,18 +113,11 @@ dict_mem_table_free( ut_ad(table->magic_n == DICT_TABLE_MAGIC_N); mutex_free(&(table->autoinc_mutex)); - - if (table->col_names && (table->n_def < table->n_cols)) { - ut_free((void*)table->col_names); - } - mem_heap_free(table->heap); } /******************************************************************** -Add 'name' to end of the col_names array (see dict_table_t::col_names). Call -ut_free on col_names (if not NULL), allocate new array (if heap, from it, -otherwise with ut_malloc), and copy col_names + name to it. */ +Append 'name' to 'col_names' (@see dict_table_t::col_names). */ static const char* dict_add_col_name( @@ -129,21 +127,19 @@ dict_add_col_name( NULL */ ulint cols, /* in: number of existing columns */ const char* name, /* in: new column name */ - mem_heap_t* heap) /* in: heap, or NULL */ + mem_heap_t* heap) /* in: heap */ { - ulint i; - ulint old_len; - ulint new_len; - ulint total_len; - const char* s; - char* res; + ulint old_len; + ulint new_len; + ulint total_len; + char* res; - ut_a(((cols == 0) && !col_names) || ((cols > 0) && col_names)); - ut_a(*name); + ut_ad(!cols == !col_names); /* Find out length of existing array. */ if (col_names) { - s = col_names; + const char* s = col_names; + ulint i; for (i = 0; i < cols; i++) { s += strlen(s) + 1; @@ -157,11 +153,7 @@ dict_add_col_name( new_len = strlen(name) + 1; total_len = old_len + new_len; - if (heap) { - res = mem_heap_alloc(heap, total_len); - } else { - res = ut_malloc(total_len); - } + res = mem_heap_alloc(heap, total_len); if (old_len > 0) { memcpy(res, col_names, old_len); @@ -169,10 +161,6 @@ dict_add_col_name( memcpy(res + old_len, name, new_len); - if (col_names) { - ut_free((char*)col_names); - } - return(res); } @@ -183,7 +171,8 @@ void dict_mem_table_add_col( /*===================*/ dict_table_t* table, /* in: table */ - const char* name, /* in: column name */ + mem_heap_t* heap, /* in: temporary memory heap, or NULL */ + const char* name, /* in: column name, or NULL */ ulint mtype, /* in: main datatype */ ulint prtype, /* in: precise type */ ulint len) /* in: precision */ @@ -191,21 +180,32 @@ dict_mem_table_add_col( dict_col_t* col; ulint mbminlen; ulint mbmaxlen; - mem_heap_t* heap; + ulint i; - ut_ad(table && name); + ut_ad(table); ut_ad(table->magic_n == DICT_TABLE_MAGIC_N); + ut_ad(!heap == !name); - table->n_def++; + i = table->n_def++; - heap = table->n_def < table->n_cols ? NULL : table->heap; - table->col_names = dict_add_col_name(table->col_names, - table->n_def - 1, - name, heap); + if (name) { + if (UNIV_UNLIKELY(table->n_def == table->n_cols)) { + heap = table->heap; + } + if (UNIV_LIKELY(i) && UNIV_UNLIKELY(!table->col_names)) { + /* All preceding column names are empty. */ + char* s = mem_heap_alloc(heap, table->n_def); + memset(s, 0, table->n_def); + table->col_names = s; + } - col = (dict_col_t*) dict_table_get_nth_col(table, table->n_def - 1); + table->col_names = dict_add_col_name(table->col_names, + i, name, heap); + } - col->ind = table->n_def - 1; + col = (dict_col_t*) dict_table_get_nth_col(table, i); + + col->ind = i; col->ord_part = 0; col->mtype = (unsigned int) mtype; @@ -318,7 +318,7 @@ dict_mem_index_add_field( { dict_field_t* field; - ut_ad(index && name); + ut_ad(index); ut_ad(index->magic_n == DICT_INDEX_MAGIC_N); index->n_def++; diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index f606134578a..339a417a696 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -62,12 +62,6 @@ static bool innodb_inited = 0; */ static handlerton *innodb_hton_ptr; -/* Store MySQL definition of 'byte': in Linux it is char while InnoDB -uses unsigned char; the header univ.i which we include next defines -'byte' as a macro which expands to 'unsigned char' */ - -typedef uchar mysql_byte; - #define INSIDE_HA_INNOBASE_CC /* Include necessary InnoDB headers */ @@ -148,7 +142,7 @@ static HASH innobase_open_tables; bool nw_panic = FALSE; #endif -static mysql_byte* innobase_get_key(INNOBASE_SHARE *share, size_t *length, +static uchar* innobase_get_key(INNOBASE_SHARE *share, size_t *length, my_bool not_used __attribute__((unused))); static INNOBASE_SHARE *get_share(const char *table_name); static void free_share(INNOBASE_SHARE *share); @@ -1919,6 +1913,8 @@ retry: trx_mark_sql_stat_end(trx); } + trx->n_autoinc_rows = 0; /* Reset the number AUTO-INC rows required */ + if (trx->declared_to_be_inside_innodb) { /* Release our possible ticket in the FIFO */ @@ -2415,7 +2411,7 @@ ha_innobase::open( upd_and_key_val_buff_len = table->s->reclength + table->s->max_key_length + MAX_REF_PARTS * 3; - if (!(mysql_byte*) my_multi_malloc(MYF(MY_WME), + if (!(uchar*) my_multi_malloc(MYF(MY_WME), &upd_buff, upd_and_key_val_buff_len, &key_val_buff, upd_and_key_val_buff_len, NullS)) { @@ -2849,8 +2845,8 @@ inline uint innobase_read_from_2_little_endian( /*===============================*/ - /* out: value */ - const mysql_byte* buf) /* in: from where to read */ + /* out: value */ + const uchar* buf) /* in: from where to read */ { return (uint) ((ulint)(buf[0]) + 256 * ((ulint)(buf[1]))); } @@ -2866,7 +2862,7 @@ ha_innobase::store_key_val_for_row( char* buff, /* in/out: buffer for the key value (in MySQL format) */ uint buff_len,/* in: buffer length */ - const mysql_byte* record)/* in: row in MySQL format */ + const uchar* record)/* in: row in MySQL format */ { KEY* key_info = table->key_info + keynr; KEY_PART_INFO* key_part = key_info->key_part; @@ -3063,7 +3059,7 @@ ha_innobase::store_key_val_for_row( CHARSET_INFO* cs; ulint true_len; ulint key_len; - const mysql_byte* src_start; + const uchar* src_start; int error=0; enum_field_types real_type; @@ -3342,6 +3338,93 @@ skip_field: } } +/************************************************************************ +This special handling is really to overcome the limitations of MySQL's +binlogging. We need to eliminate the non-determinism that will arise in +INSERT ... SELECT type of statements, since MySQL binlog only stores the +min value of the autoinc interval. Once that is fixed we can get rid of +the special lock handling.*/ + +ulong +ha_innobase::innobase_autoinc_lock(void) +/*====================================*/ + /* out: DB_SUCCESS if all OK else + error code */ +{ + ulint error = DB_SUCCESS; + + if (thd_sql_command(user_thd) == SQLCOM_INSERT) { + dict_table_autoinc_lock(prebuilt->table); + + /* We peek at the dict_table_t::auto_inc_lock to check if + another statement has locked it */ + if (prebuilt->trx->auto_inc_lock != NULL) { + /* Release the mutex to avoid deadlocks */ + dict_table_autoinc_unlock(prebuilt->table); + + goto acquire_auto_inc_lock; + } + } else { +acquire_auto_inc_lock: + error = row_lock_table_autoinc_for_mysql(prebuilt); + + if (error == DB_SUCCESS) { + dict_table_autoinc_lock(prebuilt->table); + } + } + + return(ulong(error)); +} + +/************************************************************************ +Reset the autoinc value in the table.*/ + +ulong +ha_innobase::innobase_reset_autoinc( +/*================================*/ + /* out: DB_SUCCESS if all went well + else error code */ + ulonglong autoinc) /* in: value to store */ +{ + ulint error; + + error = innobase_autoinc_lock(); + + if (error == DB_SUCCESS) { + + dict_table_autoinc_initialize(prebuilt->table, autoinc); + + dict_table_autoinc_unlock(prebuilt->table); + } + + return(ulong(error)); +} + +/************************************************************************ +Store the autoinc value in the table. The autoinc value is only set if +it's greater than the existing autoinc value in the table.*/ + +ulong +ha_innobase::innobase_set_max_autoinc( +/*==================================*/ + /* out: DB_SUCCES if all went well + else error code */ + ulonglong auto_inc) /* in: value to store */ +{ + ulint error; + + error = innobase_autoinc_lock(); + + if (error == DB_SUCCESS) { + + dict_table_autoinc_update(prebuilt->table, auto_inc); + + dict_table_autoinc_unlock(prebuilt->table); + } + + return(ulong(error)); +} + /************************************************************************ Stores a row in an InnoDB database, to the table specified in this handle. */ @@ -3349,12 +3432,10 @@ handle. */ int ha_innobase::write_row( /*===================*/ - /* out: error code */ - mysql_byte* record) /* in: a row in MySQL format */ + /* out: error code */ + uchar* record) /* in: a row in MySQL format */ { - int error; - longlong auto_inc; - longlong dummy; + int error = 0; ibool auto_inc_used= FALSE; ulint sql_command; trx_t* trx = thd_to_trx(user_thd); @@ -3453,62 +3534,20 @@ no_commit: num_write_row++; + /* This is the case where the table has an auto-increment column */ if (table->next_number_field && record == table->record[0]) { - /* This is the case where the table has an - auto-increment column */ - /* Initialize the auto-inc counter if it has not been - initialized yet */ - - if (0 == dict_table_autoinc_peek(prebuilt->table)) { - - /* This call initializes the counter */ - error = innobase_read_and_init_auto_inc(&dummy); - - if (error) { - /* Deadlock or lock wait timeout */ - - goto func_exit; - } - - /* We have to set sql_stat_start to TRUE because - the above call probably has called a select, and - has reset that flag; row_insert_for_mysql has to - know to set the IX intention lock on the table, - something it only does at the start of each - statement */ - - prebuilt->sql_stat_start = TRUE; - } - - /* We have to use the transactional lock mechanism on the - auto-inc counter of the table to ensure that replication and - roll-forward of the binlog exactly imitates also the given - auto-inc values. The lock is released at each SQL statement's - end. This lock also prevents a race where two threads would - call ::get_auto_increment() simultaneously. */ - - error = row_lock_table_autoinc_for_mysql(prebuilt); - - if (error != DB_SUCCESS) { - /* Deadlock or lock wait timeout */ - - error = convert_error_code_to_mysql(error, user_thd); + if ((error = update_auto_increment())) { goto func_exit; } - /* We must use the handler code to update the auto-increment - value to be sure that we increment it correctly. */ - - if ((error= update_auto_increment())) - goto func_exit; - auto_inc_used = 1; - + auto_inc_used = TRUE; } if (prebuilt->mysql_template == NULL - || prebuilt->template_type != ROW_MYSQL_WHOLE_ROW) { + || prebuilt->template_type != ROW_MYSQL_WHOLE_ROW) { + /* Build the template used in converting quickly between the two database formats */ @@ -3519,40 +3558,63 @@ no_commit: error = row_insert_for_mysql((byte*) record, prebuilt); - if (error == DB_SUCCESS && auto_inc_used) { + /* Handle duplicate key errors */ + if (auto_inc_used) { + ulonglong auto_inc; - /* Fetch the value that was set in the autoincrement field */ - - auto_inc = table->next_number_field->val_int(); - - if (auto_inc != 0) { - /* This call will update the counter according to the - value that was inserted in the table */ - - dict_table_autoinc_update(prebuilt->table, auto_inc); + /* Note the number of rows processed for this statement, used + by get_auto_increment() to determine the number of AUTO-INC + values to reserve. This is only useful for a mult-value INSERT + and is a statement level counter.*/ + if (trx->n_autoinc_rows > 0) { + --trx->n_autoinc_rows; } - } - - /* A REPLACE command and LOAD DATA INFILE REPLACE handle a duplicate - key error themselves, and we must update the autoinc counter if we are - performing those statements. */ - - if (error == DB_DUPLICATE_KEY && auto_inc_used - && (sql_command == SQLCOM_REPLACE - || sql_command == SQLCOM_REPLACE_SELECT - || (sql_command == SQLCOM_INSERT - && ((trx->duplicates - & (TRX_DUP_IGNORE | TRX_DUP_REPLACE)) - == TRX_DUP_IGNORE)) - || (sql_command == SQLCOM_LOAD - && ((trx->duplicates - & (TRX_DUP_IGNORE | TRX_DUP_REPLACE)) - == (TRX_DUP_IGNORE | TRX_DUP_REPLACE))))) { + /* Get the value that MySQL attempted to store in the table.*/ auto_inc = table->next_number_field->val_int(); - if (auto_inc != 0) { - dict_table_autoinc_update(prebuilt->table, auto_inc); + switch (error) { + case DB_DUPLICATE_KEY: + + /* A REPLACE command and LOAD DATA INFILE REPLACE + handle a duplicate key error themselves, but we + must update the autoinc counter if we are performing + those statements. */ + + switch (sql_command) { + case SQLCOM_LOAD: + if ((trx->duplicates + & (TRX_DUP_IGNORE | TRX_DUP_REPLACE))) { + + goto set_max_autoinc; + } + break; + + case SQLCOM_REPLACE: + case SQLCOM_INSERT_SELECT: + case SQLCOM_REPLACE_SELECT: + goto set_max_autoinc; + break; + + default: + break; + } + + break; + + case DB_SUCCESS: + /* If the actual value inserted is greater than + the upper limit of the interval, then we try and + update the table upper limit. Note: last_value + will be 0 if get_auto_increment() was not called.*/ + + if (auto_inc > prebuilt->last_value) { +set_max_autoinc: + auto_inc += prebuilt->table->autoinc_increment; + + innobase_set_max_autoinc(auto_inc); + } + break; } } @@ -3560,8 +3622,6 @@ no_commit: error = convert_error_code_to_mysql(error, user_thd); - /* Tell InnoDB server that there might be work for - utility threads: */ func_exit: innobase_active_small(); @@ -3577,16 +3637,16 @@ calc_row_difference( /*================*/ /* out: error number or 0 */ upd_t* uvect, /* in/out: update vector */ - mysql_byte* old_row, /* in: old row in MySQL format */ - mysql_byte* new_row, /* in: new row in MySQL format */ + uchar* old_row, /* in: old row in MySQL format */ + uchar* new_row, /* in: new row in MySQL format */ struct st_table* table, /* in: table in MySQL data dictionary */ - mysql_byte* upd_buff, /* in: buffer to use */ + uchar* upd_buff, /* in: buffer to use */ ulint buff_len, /* in: buffer length */ row_prebuilt_t* prebuilt, /* in: InnoDB prebuilt struct */ THD* thd) /* in: user thread */ { - mysql_byte* original_upd_buff = upd_buff; + uchar* original_upd_buff = upd_buff; Field* field; enum_field_types field_mysql_type; uint n_fields; @@ -3730,8 +3790,8 @@ int ha_innobase::update_row( /*====================*/ /* out: error number or 0 */ - const mysql_byte* old_row,/* in: old row in MySQL format */ - mysql_byte* new_row)/* in: new row in MySQL format */ + const uchar* old_row, /* in: old row in MySQL format */ + uchar* new_row) /* in: new row in MySQL format */ { upd_t* uvect; int error = 0; @@ -3753,7 +3813,7 @@ ha_innobase::update_row( /* Build an update vector from the modified fields in the rows (uses upd_buff of the handle) */ - calc_row_difference(uvect, (mysql_byte*) old_row, new_row, table, + calc_row_difference(uvect, (uchar*) old_row, new_row, table, upd_buff, (ulint)upd_and_key_val_buff_len, prebuilt, user_thd); @@ -3766,6 +3826,32 @@ ha_innobase::update_row( error = row_update_for_mysql((byte*) old_row, prebuilt); + /* We need to do some special AUTOINC handling for the following case: + + INSERT INTO t (c1,c2) VALUES(x,y) ON DUPLICATE KEY UPDATE ... + + We need to use the AUTOINC counter that was actually used by + MySQL in the UPDATE statement, which can be different from the + value used in the INSERT statement.*/ + + if (error == DB_SUCCESS + && table->next_number_field + && new_row == table->record[0] + && thd_sql_command(user_thd) == SQLCOM_INSERT + && (trx->duplicates & (TRX_DUP_IGNORE | TRX_DUP_REPLACE)) + == TRX_DUP_IGNORE) { + + longlong auto_inc; + + auto_inc = table->next_number_field->val_int(); + + if (auto_inc != 0) { + auto_inc += prebuilt->table->autoinc_increment; + + innobase_set_max_autoinc(auto_inc); + } + } + innodb_srv_conc_exit_innodb(trx); error = convert_error_code_to_mysql(error, user_thd); @@ -3784,8 +3870,8 @@ Deletes a row given as the parameter. */ int ha_innobase::delete_row( /*====================*/ - /* out: error number or 0 */ - const mysql_byte* record) /* in: a row in MySQL format */ + /* out: error number or 0 */ + const uchar* record) /* in: a row in MySQL format */ { int error = 0; trx_t* trx = thd_to_trx(user_thd); @@ -3794,6 +3880,19 @@ ha_innobase::delete_row( ut_a(prebuilt->trx == trx); + /* Only if the table has an AUTOINC column */ + if (table->found_next_number_field && record == table->record[0]) { + ulonglong dummy = 0; + + error = innobase_get_auto_increment(&dummy); + + if (error == DB_SUCCESS) { + dict_table_autoinc_unlock(prebuilt->table); + } else { + goto error_exit; + } + } + if (!prebuilt->upd_node) { row_get_prebuilt_update_vector(prebuilt); } @@ -3808,6 +3907,7 @@ ha_innobase::delete_row( innodb_srv_conc_exit_innodb(trx); +error_exit: error = convert_error_code_to_mysql(error, user_thd); /* Tell the InnoDB server that there might be work for @@ -4011,9 +4111,9 @@ ha_innobase::index_read( /*====================*/ /* out: 0, HA_ERR_KEY_NOT_FOUND, or error number */ - mysql_byte* buf, /* in/out: buffer for the returned + uchar* buf, /* in/out: buffer for the returned row */ - const mysql_byte* key_ptr,/* in: key value; if this is NULL + const uchar* key_ptr, /* in: key value; if this is NULL we position the cursor at the start or end of index; this can also contain an InnoDB row id, in @@ -4110,17 +4210,57 @@ row with the current key value or prefix. */ int ha_innobase::index_read_last( /*=========================*/ - /* out: 0, HA_ERR_KEY_NOT_FOUND, or an - error code */ - mysql_byte* buf, /* out: fetched row */ - const mysql_byte* key_ptr, /* in: key value, or a prefix of a full - key value */ - uint key_len) /* in: length of the key val or prefix - in bytes */ + /* out: 0, HA_ERR_KEY_NOT_FOUND, or an + error code */ + uchar* buf, /* out: fetched row */ + const uchar* key_ptr,/* in: key value, or a prefix of a full + key value */ + uint key_len)/* in: length of the key val or prefix + in bytes */ { return(index_read(buf, key_ptr, key_len, HA_READ_PREFIX_LAST)); } +/************************************************************************ +Get the index for a handle. Does not change active index.*/ + +dict_index_t* +ha_innobase::innobase_get_index( +/*============================*/ + /* out: NULL or index instance. */ + uint keynr) /* in: use this index; MAX_KEY means always + clustered index, even if it was internally + generated by InnoDB */ +{ + KEY* key = 0; + dict_index_t* index = 0; + + DBUG_ENTER("innobase_get_index"); + ha_statistic_increment(&SSV::ha_read_key_count); + + ut_ad(user_thd == ha_thd()); + ut_a(prebuilt->trx == thd_to_trx(user_thd)); + + if (keynr != MAX_KEY && table->s->keys > 0) { + key = table->key_info + keynr; + + index = dict_table_get_index_noninline( + prebuilt->table, key->name); + } else { + index = dict_table_get_first_index_noninline(prebuilt->table); + } + + if (!index) { + sql_print_error( + "Innodb could not find key n:o %u with name %s " + "from dict cache for table %s", + keynr, key ? key->name : "NULL", + prebuilt->table->name); + } + + DBUG_RETURN(index); +} + /************************************************************************ Changes the active index of a handle. */ @@ -4132,32 +4272,16 @@ ha_innobase::change_active_index( index, even if it was internally generated by InnoDB */ { - KEY* key=0; DBUG_ENTER("change_active_index"); - ha_statistic_increment(&SSV::ha_read_key_count); ut_ad(user_thd == ha_thd()); ut_a(prebuilt->trx == thd_to_trx(user_thd)); active_index = keynr; - if (keynr != MAX_KEY && table->s->keys > 0) { - key = table->key_info + active_index; - - prebuilt->index = dict_table_get_index_noninline( - prebuilt->table, key->name); - } else { - prebuilt->index = dict_table_get_first_index_noninline( - prebuilt->table); - } + prebuilt->index = innobase_get_index(keynr); if (!prebuilt->index) { - sql_print_error( - "Innodb could not find key n:o %u with name %s " - "from dict cache for table %s", - keynr, key ? key->name : "NULL", - prebuilt->table->name); - DBUG_RETURN(1); } @@ -4188,10 +4312,10 @@ int ha_innobase::index_read_idx( /*========================*/ /* out: error number or 0 */ - mysql_byte* buf, /* in/out: buffer for the returned + uchar* buf, /* in/out: buffer for the returned row */ uint keynr, /* in: use this index */ - const mysql_byte* key, /* in: key value; if this is NULL + const uchar* key, /* in: key value; if this is NULL we position the cursor at the start or end of index */ uint key_len, /* in: key value length */ @@ -4214,7 +4338,7 @@ ha_innobase::general_fetch( /*=======================*/ /* out: 0, HA_ERR_END_OF_FILE, or error number */ - mysql_byte* buf, /* in/out: buffer for next row in MySQL + uchar* buf, /* in/out: buffer for next row in MySQL format */ uint direction, /* in: ROW_SEL_NEXT or ROW_SEL_PREV */ uint match_mode) /* in: 0, ROW_SEL_EXACT, or @@ -4261,7 +4385,7 @@ ha_innobase::index_next( /*====================*/ /* out: 0, HA_ERR_END_OF_FILE, or error number */ - mysql_byte* buf) /* in/out: buffer for next row in MySQL + uchar* buf) /* in/out: buffer for next row in MySQL format */ { ha_statistic_increment(&SSV::ha_read_next_count); @@ -4277,8 +4401,8 @@ ha_innobase::index_next_same( /*=========================*/ /* out: 0, HA_ERR_END_OF_FILE, or error number */ - mysql_byte* buf, /* in/out: buffer for the row */ - const mysql_byte* key, /* in: key value */ + uchar* buf, /* in/out: buffer for the row */ + const uchar* key, /* in: key value */ uint keylen) /* in: key value length */ { ha_statistic_increment(&SSV::ha_read_next_count); @@ -4293,10 +4417,8 @@ positioned using index_read. */ int ha_innobase::index_prev( /*====================*/ - /* out: 0, HA_ERR_END_OF_FILE, or error - number */ - mysql_byte* buf) /* in/out: buffer for previous row in MySQL - format */ + /* out: 0, HA_ERR_END_OF_FILE, or error number */ + uchar* buf) /* in/out: buffer for previous row in MySQL format */ { ha_statistic_increment(&SSV::ha_read_prev_count); @@ -4310,9 +4432,8 @@ corresponding row to buf. */ int ha_innobase::index_first( /*=====================*/ - /* out: 0, HA_ERR_END_OF_FILE, - or error code */ - mysql_byte* buf) /* in/out: buffer for the row */ + /* out: 0, HA_ERR_END_OF_FILE, or error code */ + uchar* buf) /* in/out: buffer for the row */ { int error; @@ -4337,8 +4458,8 @@ corresponding row to buf. */ int ha_innobase::index_last( /*====================*/ - /* out: 0, HA_ERR_END_OF_FILE, or error code */ - mysql_byte* buf) /* in/out: buffer for the row */ + /* out: 0, HA_ERR_END_OF_FILE, or error code */ + uchar* buf) /* in/out: buffer for the row */ { int error; @@ -4407,7 +4528,7 @@ int ha_innobase::rnd_next( /*==================*/ /* out: 0, HA_ERR_END_OF_FILE, or error number */ - mysql_byte* buf)/* in/out: returns the row in this buffer, + uchar* buf) /* in/out: returns the row in this buffer, in MySQL format */ { int error; @@ -4434,14 +4555,12 @@ Fetches a row from the table based on a row reference. */ int ha_innobase::rnd_pos( /*=================*/ - /* out: 0, HA_ERR_KEY_NOT_FOUND, - or error code */ - mysql_byte* buf, /* in/out: buffer for the row */ - mysql_byte* pos) /* in: primary key value of the row in the - MySQL format, or the row id if the clustered - index was internally generated by InnoDB; - the length of data in pos has to be - ref_length */ + /* out: 0, HA_ERR_KEY_NOT_FOUND, or error code */ + uchar* buf, /* in/out: buffer for the row */ + uchar* pos) /* in: primary key value of the row in the + MySQL format, or the row id if the clustered + index was internally generated by InnoDB; the + length of data in pos has to be ref_length */ { int error; uint keynr = active_index; @@ -4494,7 +4613,7 @@ was positioned the last time. */ void ha_innobase::position( /*==================*/ - const mysql_byte* record) /* in: row in MySQL format */ + const uchar* record) /* in: row in MySQL format */ { uint len; @@ -4636,7 +4755,7 @@ create_table_def( } } - dict_mem_table_add_col(table, + dict_mem_table_add_col(table, table->heap, (char*) field->field_name, col_type, dtype_form_prtype( @@ -5000,7 +5119,10 @@ ha_innobase::create( maximum value in the column. */ auto_inc_value = create_info->auto_increment_value; + + dict_table_autoinc_lock(innobase_table); dict_table_autoinc_initialize(innobase_table, auto_inc_value); + dict_table_autoinc_unlock(innobase_table); } /* Tell the InnoDB server that there might be work for @@ -5351,7 +5473,7 @@ ha_innobase::records_in_range( { KEY* key; dict_index_t* index; - mysql_byte* key_val_buff2 = (mysql_byte*) my_malloc( + uchar* key_val_buff2 = (uchar*) my_malloc( table->s->reclength + table->s->max_key_length + 100, MYF(MY_FAE)); @@ -5393,7 +5515,7 @@ ha_innobase::records_in_range( (ulint)upd_and_key_val_buff_len, index, (byte*) (min_key ? min_key->key : - (const mysql_byte*) 0), + (const uchar*) 0), (ulint) (min_key ? min_key->length : 0), prebuilt->trx); @@ -5401,7 +5523,7 @@ ha_innobase::records_in_range( range_end, (byte*) key_val_buff2, buff2_len, index, (byte*) (max_key ? max_key->key : - (const mysql_byte*) 0), + (const uchar*) 0), (ulint) (max_key ? max_key->length : 0), prebuilt->trx); @@ -6801,12 +6923,12 @@ bool innobase_show_status(handlerton *hton, THD* thd, locking. ****************************************************************************/ -static mysql_byte* innobase_get_key(INNOBASE_SHARE* share, size_t *length, +static uchar* innobase_get_key(INNOBASE_SHARE* share, size_t *length, my_bool not_used __attribute__((unused))) { *length=share->table_name_length; - return (mysql_byte*) share->table_name; + return (uchar*) share->table_name; } static INNOBASE_SHARE* get_share(const char* table_name) @@ -6816,7 +6938,7 @@ static INNOBASE_SHARE* get_share(const char* table_name) uint length=(uint) strlen(table_name); if (!(share=(INNOBASE_SHARE*) hash_search(&innobase_open_tables, - (mysql_byte*) table_name, + (uchar*) table_name, length))) { share = (INNOBASE_SHARE *) my_malloc(sizeof(*share)+length+1, @@ -6827,7 +6949,7 @@ static INNOBASE_SHARE* get_share(const char* table_name) strmov(share->table_name,table_name); if (my_hash_insert(&innobase_open_tables, - (mysql_byte*) share)) { + (uchar*) share)) { pthread_mutex_unlock(&innobase_share_mutex); my_free(share,0); @@ -6849,7 +6971,7 @@ static void free_share(INNOBASE_SHARE* share) pthread_mutex_lock(&innobase_share_mutex); if (!--share->use_count) { - hash_delete(&innobase_open_tables, (mysql_byte*) share); + hash_delete(&innobase_open_tables, (uchar*) share); thr_lock_delete(&share->lock); pthread_mutex_destroy(&share->mutex); my_free(share, MYF(0)); @@ -7070,15 +7192,15 @@ 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 */ - longlong* ret) /* out: auto-inc value */ + /* out: 0 or error code: + deadlock or lock wait timeout */ + longlong* value) /* out: the autoinc value */ { longlong auto_inc; - ulint old_select_lock_type; - ibool trx_was_not_started = FALSE; ibool stmt_start; - int error; + int mysql_error = 0; + dict_table_t* innodb_table = prebuilt->table; + ibool trx_was_not_started = FALSE; ut_a(prebuilt); ut_a(prebuilt->table); @@ -7099,103 +7221,47 @@ ha_innobase::innobase_read_and_init_auto_inc( trx_search_latch_release_if_reserved(prebuilt->trx); + dict_table_autoinc_lock(prebuilt->table); + auto_inc = dict_table_autoinc_read(prebuilt->table); - if (auto_inc != 0) { - /* Already initialized */ - *ret = auto_inc; - - error = 0; - - goto func_exit_early; + /* Was the AUTOINC counter reset during normal processing, if + so then we simply start count from 1. No need to go to the index.*/ + if (auto_inc == 0 && innodb_table->autoinc_inited) { + ++auto_inc; + dict_table_autoinc_initialize(innodb_table, auto_inc); } - error = row_lock_table_autoinc_for_mysql(prebuilt); + if (auto_inc == 0) { + dict_index_t* index; + ulint error = DB_SUCCESS; + const char* autoinc_col_name; - if (error != DB_SUCCESS) { - error = convert_error_code_to_mysql(error, user_thd); + ut_a(!innodb_table->autoinc_inited); - goto func_exit_early; - } + index = innobase_get_index(table->s->next_number_index); - /* Check again if someone has initialized the counter meanwhile */ - auto_inc = dict_table_autoinc_read(prebuilt->table); + autoinc_col_name = table->found_next_number_field->field_name; - if (auto_inc != 0) { - *ret = auto_inc; + error = row_search_max_autoinc( + index, autoinc_col_name, &auto_inc); - error = 0; - - goto func_exit_early; - } - - (void) extra(HA_EXTRA_KEYREAD); - index_init(table->s->next_number_index, 1); - - /* Starting from 5.0.9, we use a consistent read to read the auto-inc - column maximum value. This eliminates the spurious deadlocks caused - by the row X-lock that we previously used. Note the following flaw - in our algorithm: if some other user meanwhile UPDATEs the auto-inc - column, our consistent read will not return the largest value. We - accept this flaw, since the deadlocks were a bigger trouble. */ - - /* Fetch all the columns in the key */ - - prebuilt->hint_need_to_fetch_extra_cols = ROW_RETRIEVE_ALL_COLS; - - old_select_lock_type = prebuilt->select_lock_type; - prebuilt->select_lock_type = LOCK_NONE; - - /* Eliminate an InnoDB error print that happens when we try to SELECT - from a table when no table has been locked in ::external_lock(). */ - prebuilt->trx->n_mysql_tables_in_use++; - - error = index_last(table->record[1]); - - prebuilt->trx->n_mysql_tables_in_use--; - prebuilt->select_lock_type = old_select_lock_type; - - if (error) { - if (error == HA_ERR_END_OF_FILE) { - /* The table was empty, initialize to 1 */ - auto_inc = 1; - - error = 0; + if (error == DB_SUCCESS) { + ++auto_inc; + dict_table_autoinc_initialize(innodb_table, auto_inc); } else { - /* This should not happen in a consistent read */ - sql_print_error("Consistent read of auto-inc column " - "returned %lu", (ulong) error); - auto_inc = -1; + fprintf(stderr, " InnoDB error: Couldn't read the " + "max AUTOINC value from index (%s).\n", + index->name); - goto func_exit; + mysql_error = 1; } - } else { - /* Initialize to max(col) + 1; we use - 'found_next_number_field' below because MySQL in SHOW TABLE - STATUS does not seem to set 'next_number_field'. The comment - in table.h says that 'next_number_field' is set when it is - 'active'. - Since 5.1 MySQL enforces that we announce fields which we will - read; as we only do a val_*() call, dbug_tmp_use_all_columns() - with read_set is sufficient. */ - - my_bitmap_map *old_map; - old_map= dbug_tmp_use_all_columns(table, table->read_set); - auto_inc = (longlong) table->found_next_number_field-> - val_int_offset(table->s->rec_buff_length) + 1; - dbug_tmp_restore_column_map(table->read_set, old_map); } - dict_table_autoinc_initialize(prebuilt->table, auto_inc); + *value = auto_inc; -func_exit: - (void) extra(HA_EXTRA_NO_KEYREAD); + dict_table_autoinc_unlock(prebuilt->table); - index_end(); - - *ret = auto_inc; - -func_exit_early: /* Since MySQL does not seem to call autocommit after SHOW TABLE STATUS (even if we would register the trx here), we commit our transaction here if it was started here. This is to eliminate a @@ -7210,6 +7276,63 @@ func_exit_early: prebuilt->sql_stat_start = stmt_start; + return(mysql_error); +} + +/******************************************************************************* +Read the next autoinc value, initialize the table if it's not initialized. +On return if there is no error then the tables AUTOINC lock is locked.*/ + +ulong +ha_innobase::innobase_get_auto_increment( + ulonglong* value) /* out: autoinc value */ +{ + ulint error; + + do { + error = innobase_autoinc_lock(); + + if (error == DB_SUCCESS) { + ib_longlong autoinc; + + /* Determine the first value of the interval */ + autoinc = dict_table_autoinc_read(prebuilt->table); + + /* We need to initialize the AUTO-INC value, for + that we release all locks.*/ + if (autoinc <= 0) { + trx_t* trx; + + trx = prebuilt->trx; + dict_table_autoinc_unlock(prebuilt->table); + + if (trx->auto_inc_lock) { + /* If we had reserved the AUTO-INC + lock in this SQL statement we release + it before retrying.*/ + row_unlock_table_autoinc_for_mysql(trx); + } + + /* Just to make sure */ + ut_a(!trx->auto_inc_lock); + + int mysql_error; + + mysql_error = innobase_read_and_init_auto_inc( + &autoinc); + + if (!mysql_error) { + /* Should have read the proper value */ + ut_a(autoinc > 0); + } else { + error = DB_ERROR; + } + } else { + *value = (ulonglong) autoinc; + } + } + } while (*value == 0 && error == DB_SUCCESS); + return(error); } @@ -7221,37 +7344,87 @@ auto-inc counter in *first_value, and ULONGLONG_MAX in *nb_reserved_values (as we have a table-level lock). offset, increment, nb_desired_values are ignored. *first_value is set to -1 if error (deadlock or lock wait timeout) */ -void ha_innobase::get_auto_increment( +void +ha_innobase::get_auto_increment( /*=================================*/ - ulonglong offset, /* in */ - ulonglong increment, /* in */ - ulonglong nb_desired_values, /* in */ - ulonglong *first_value, /* out */ - ulonglong *nb_reserved_values) /* out */ + ulonglong offset, /* in: */ + ulonglong increment, /* in: table autoinc increment */ + ulonglong nb_desired_values, /* in: number of values reqd */ + ulonglong *first_value, /* out: the autoinc value */ + ulonglong *nb_reserved_values) /* out: count of reserved values */ { - longlong nr; - int error; + ulint error; + ulonglong autoinc = 0; /* Prepare prebuilt->trx in the table handle */ update_thd(ha_thd()); - error = innobase_read_and_init_auto_inc(&nr); + error = innobase_get_auto_increment(&autoinc); - if (error) { - /* This should never happen in the current (5.0.6) code, since - we call this function only after the counter has been - initialized. */ + 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()", - (ulong) error); - *first_value= (~(ulonglong) 0); + sql_print_error("Error %lu in ::get_auto_increment()", error); + + *first_value = (~(ulonglong) 0); return; } - *first_value= (ulonglong) nr; - /* table-level autoinc lock reserves up to +inf */ - *nb_reserved_values= ULONGLONG_MAX; + /* This is a hack, since nb_desired_values seems to be accurate only + for the first call to get_auto_increment() for multi-row INSERT and + meaningless for other statements e.g, LOAD etc. Subsequent calls to + this method for the same statement results in different values which + don't make sense. Therefore we store the value the first time we are + called and count down from that as rows are written (see write_row()). + + We make one exception, if the *first_value is precomputed by MySQL + we use that value. And set the number of reserved values to 1 if + this is the first time we were called for the SQL statement, this + will force MySQL to call us for the next value. If we are in the + middle of a multi-row insert we preserve the existing counter.*/ + if (*first_value == 0) { + + /* Called for the first time ? */ + if (prebuilt->trx->n_autoinc_rows == 0) { + + prebuilt->trx->n_autoinc_rows = nb_desired_values; + + /* 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) { + + ++prebuilt->trx->n_autoinc_rows; + } + } + + *first_value = autoinc; + + } else if (prebuilt->trx->n_autoinc_rows == 0) { + + prebuilt->trx->n_autoinc_rows = 1; + } + + ut_a(prebuilt->trx->n_autoinc_rows > 0); + + *nb_reserved_values = prebuilt->trx->n_autoinc_rows; + + /* Compute the last value in the interval */ + prebuilt->last_value = *first_value + (*nb_reserved_values * increment); + + ut_a(prebuilt->last_value >= *first_value); + + /* Update the table autoinc variable */ + dict_table_autoinc_update(prebuilt->table, prebuilt->last_value); + + /* The increment to be used to increase the AUTOINC value, we use + this in write_row() and update_row() to increase the autoinc counter + for columns that are filled by the user.*/ + prebuilt->table->autoinc_increment = increment; + + dict_table_autoinc_unlock(prebuilt->table); } /* See comment in handler.h */ @@ -7272,7 +7445,7 @@ ha_innobase::reset_auto_increment(ulonglong value) DBUG_RETURN(error); } - dict_table_autoinc_initialize(prebuilt->table, value); + innobase_reset_autoinc(value); DBUG_RETURN(0); } @@ -7299,9 +7472,9 @@ ha_innobase::cmp_ref( /*=================*/ /* out: < 0 if ref1 < ref2, 0 if equal, else > 0 */ - const mysql_byte* ref1, /* in: an (internal) primary key value in the + const uchar* ref1, /* in: an (internal) primary key value in the MySQL key value format */ - const mysql_byte* ref2) /* in: an (internal) primary key value in the + const uchar* ref2) /* in: an (internal) primary key value in the MySQL key value format */ { enum_field_types mysql_type; @@ -7558,6 +7731,7 @@ innobase_xa_prepare( row_unlock_table_autoinc_for_mysql(trx); } + /* Store the current undo_no of the transaction so that we know where to roll back if we have to roll back the next SQL statement */ diff --git a/storage/innobase/handler/ha_innodb.h b/storage/innobase/handler/ha_innodb.h index 270b000dfc4..fe5ebd57990 100644 --- a/storage/innobase/handler/ha_innodb.h +++ b/storage/innobase/handler/ha_innodb.h @@ -32,7 +32,10 @@ typedef struct st_innobase_share { } INNOBASE_SHARE; +struct dict_index_struct; struct row_prebuilt_struct; + +typedef struct dict_index_struct dict_index_t; typedef struct row_prebuilt_struct row_prebuilt_t; /* The class defining a handle to an Innodb table */ @@ -70,6 +73,11 @@ class ha_innobase: public handler int change_active_index(uint keynr); int general_fetch(uchar* buf, uint direction, uint match_mode); int innobase_read_and_init_auto_inc(longlong* ret); + ulong innobase_autoinc_lock(); + ulong innobase_set_max_autoinc(ulonglong auto_inc); + ulong innobase_reset_autoinc(ulonglong auto_inc); + ulong innobase_get_auto_increment(ulonglong* value); + dict_index_t* innobase_get_index(uint keynr); /* Init values for the class: */ public: diff --git a/storage/innobase/ibuf/ibuf0ibuf.c b/storage/innobase/ibuf/ibuf0ibuf.c index 4e291924e0e..44972356304 100644 --- a/storage/innobase/ibuf/ibuf0ibuf.c +++ b/storage/innobase/ibuf/ibuf0ibuf.c @@ -462,7 +462,8 @@ ibuf_data_init_for_space( page_t* root; page_t* header_page; mtr_t mtr; - char buf[50]; + char* buf; + mem_heap_t* heap; dict_table_t* table; dict_index_t* index; ulint n_used; @@ -516,16 +517,20 @@ ibuf_data_init_for_space( ibuf_exit(); + heap = mem_heap_create(450); + buf = mem_heap_alloc(heap, 50); + sprintf(buf, "SYS_IBUF_TABLE_%lu", (ulong) space); /* use old-style record format for the insert buffer */ table = dict_mem_table_create(buf, space, 2, 0); - dict_mem_table_add_col(table, "PAGE_NO", DATA_BINARY, 0, 0); - dict_mem_table_add_col(table, "TYPES", DATA_BINARY, 0, 0); + dict_mem_table_add_col(table, heap, "PAGE_NO", DATA_BINARY, 0, 0); + dict_mem_table_add_col(table, heap, "TYPES", DATA_BINARY, 0, 0); table->id = ut_dulint_add(DICT_IBUF_ID_MIN, space); - dict_table_add_to_cache(table); + dict_table_add_to_cache(table, heap); + mem_heap_free(heap); index = dict_mem_index_create( buf, "CLUST_IND", space, @@ -1139,7 +1144,7 @@ ibuf_dummy_index_add_col( ulint len) /* in: length of the column */ { ulint i = index->table->n_def; - dict_mem_table_add_col(index->table, "DUMMY", + dict_mem_table_add_col(index->table, NULL, NULL, dtype_get_mtype(type), dtype_get_prtype(type), dtype_get_len(type)); @@ -1161,11 +1166,6 @@ ibuf_dummy_index_free( dict_mem_table_free(table); } -void -dict_index_print_low( -/*=================*/ - dict_index_t* index); /* in: index */ - /************************************************************************* Builds the entry to insert into a non-clustered index when we have the corresponding record in an ibuf index. */ diff --git a/storage/innobase/include/dict0dict.h b/storage/innobase/include/dict0dict.h index eb31043ecc3..2f038b21e8e 100644 --- a/storage/innobase/include/dict0dict.h +++ b/storage/innobase/include/dict0dict.h @@ -171,6 +171,13 @@ dict_col_name_is_reserved( /* out: TRUE if name is reserved */ const char* name); /* in: column name */ /************************************************************************ +Acquire the autoinc lock.*/ + +void +dict_table_autoinc_lock( +/*====================*/ + dict_table_t* table); /* in: table */ +/************************************************************************ Initializes the autoinc counter. It is not an error to initialize an already initialized counter. */ @@ -180,22 +187,6 @@ dict_table_autoinc_initialize( dict_table_t* table, /* in: table */ ib_longlong value); /* in: next value to assign to a row */ /************************************************************************ -Gets the next autoinc value (== autoinc counter value), 0 if not yet -initialized. If initialized, increments the counter by 1. */ - -ib_longlong -dict_table_autoinc_get( -/*===================*/ - /* out: value for a new row, or 0 */ - dict_table_t* table); /* in: table */ -/************************************************************************ -Decrements the autoinc counter value by 1. */ - -void -dict_table_autoinc_decrement( -/*=========================*/ - dict_table_t* table); /* in: table */ -/************************************************************************ Reads the next autoinc value (== autoinc counter value), 0 if not yet initialized. */ @@ -205,15 +196,6 @@ dict_table_autoinc_read( /* out: value for a new row, or 0 */ dict_table_t* table); /* in: table */ /************************************************************************ -Peeks the autoinc counter value, 0 if not yet initialized. Does not -increment the counter. The read not protected by any mutex! */ - -ib_longlong -dict_table_autoinc_peek( -/*====================*/ - /* out: value of the counter */ - dict_table_t* table); /* in: table */ -/************************************************************************ Updates the autoinc counter if the value supplied is equal or bigger than the current value. If not inited, does nothing. */ @@ -223,13 +205,29 @@ dict_table_autoinc_update( dict_table_t* table, /* in: table */ ib_longlong value); /* in: value which was assigned to a row */ +/************************************************************************ +Release the autoinc lock.*/ + +void +dict_table_autoinc_unlock( +/*======================*/ + dict_table_t* table); /* in: table */ +/************************************************************************** +Adds system columns to a table object. */ + +void +dict_table_add_system_columns( +/*==========================*/ + dict_table_t* table, /* in/out: table */ + mem_heap_t* heap); /* in: temporary heap */ /************************************************************************** Adds a table object to the dictionary cache. */ void dict_table_add_to_cache( /*====================*/ - dict_table_t* table); /* in: table */ + dict_table_t* table, /* in: table */ + mem_heap_t* heap); /* in: temporary heap */ /************************************************************************** Removes a table object from the dictionary cache. */ diff --git a/storage/innobase/include/dict0mem.h b/storage/innobase/include/dict0mem.h index 647035c2fff..de6ee1227bf 100644 --- a/storage/innobase/include/dict0mem.h +++ b/storage/innobase/include/dict0mem.h @@ -72,7 +72,8 @@ void dict_mem_table_add_col( /*===================*/ dict_table_t* table, /* in: table */ - const char* name, /* in: column name */ + mem_heap_t* heap, /* in: temporary memory heap, or NULL */ + const char* name, /* in: column name, or NULL */ ulint mtype, /* in: main datatype */ ulint prtype, /* in: precise type */ ulint len); /* in: precision */ @@ -410,6 +411,11 @@ struct dict_table_struct{ SELECT MAX(auto inc column) */ ib_longlong autoinc;/* autoinc counter value to give to the next inserted row */ + + ib_longlong autoinc_increment; + /* The increment step of the auto increment + column. Value must be greater than or equal + to 1 */ #ifdef UNIV_DEBUG ulint magic_n;/* magic number */ # define DICT_TABLE_MAGIC_N 76333786 diff --git a/storage/innobase/include/lock0lock.h b/storage/innobase/include/lock0lock.h index 059c459c374..8b08b6284f6 100644 --- a/storage/innobase/include/lock0lock.h +++ b/storage/innobase/include/lock0lock.h @@ -609,7 +609,7 @@ lock_validate(void); /* out: TRUE if ok */ /************************************************************************* Return approximate number or record locks (bits set in the bitmap) for -this transaction. Since delete-marked records maybe removed, the +this transaction. Since delete-marked records may be removed, the record count will not be precise. */ ulint diff --git a/storage/innobase/include/row0mysql.h b/storage/innobase/include/row0mysql.h index 1448efe94fe..aabb7f5f047 100644 --- a/storage/innobase/include/row0mysql.h +++ b/storage/innobase/include/row0mysql.h @@ -670,6 +670,7 @@ struct row_prebuilt_struct { to this heap */ mem_heap_t* old_vers_heap; /* memory heap where a previous version is built in consistent read */ + ulonglong last_value; /* last value of AUTO-INC interval */ ulint magic_n2; /* this should be the same as magic_n */ }; diff --git a/storage/innobase/include/row0sel.h b/storage/innobase/include/row0sel.h index 96273a18cd5..4bde648f18e 100644 --- a/storage/innobase/include/row0sel.h +++ b/storage/innobase/include/row0sel.h @@ -171,7 +171,17 @@ row_search_check_if_query_cache_permitted( trx_t* trx, /* in: transaction object */ const char* norm_name); /* in: concatenation of database name, '/' char, table name */ +/*********************************************************************** +Read the max AUTOINC value from an index. */ +ulint +row_search_max_autoinc( +/*===================*/ + /* out: DB_SUCCESS if all OK else + error code */ + dict_index_t* index, /* in: index to search */ + const char* col_name, /* in: autoinc column name */ + ib_longlong* value); /* out: AUTOINC value read */ /* A structure for caching column values for prefetched rows */ struct sel_buf_struct{ diff --git a/storage/innobase/include/trx0trx.h b/storage/innobase/include/trx0trx.h index 2459e76c4c1..0455e9ea17a 100644 --- a/storage/innobase/include/trx0trx.h +++ b/storage/innobase/include/trx0trx.h @@ -681,6 +681,9 @@ struct trx_struct{ trx_undo_arr_t* undo_no_arr; /* array of undo numbers of undo log records which are currently processed by a rollback operation */ + ulint n_autoinc_rows; /* no. of AUTO-INC rows required for + an SQL statement. This is useful for + multi-row INSERTs */ /*------------------------------*/ char detailed_error[256]; /* detailed error message for last error, or empty. */ diff --git a/storage/innobase/include/ut0mem.h b/storage/innobase/include/ut0mem.h index 90c16f4fad5..e56895bc142 100644 --- a/storage/innobase/include/ut0mem.h +++ b/storage/innobase/include/ut0mem.h @@ -63,7 +63,7 @@ ut_test_malloc( /* out: TRUE if succeeded */ ulint n); /* in: try to allocate this many bytes */ /************************************************************************** -Frees a memory bloock allocated with ut_malloc. */ +Frees a memory block allocated with ut_malloc. */ void ut_free( diff --git a/storage/innobase/log/log0recv.c b/storage/innobase/log/log0recv.c index ce2fc3ed535..aef58b7b576 100644 --- a/storage/innobase/log/log0recv.c +++ b/storage/innobase/log/log0recv.c @@ -115,7 +115,7 @@ dulint recv_max_page_lsn; Initialize crash recovery environment. Can be called iff recv_needed_recovery == FALSE. */ static -void +void recv_init_crash_recovery(void); /*===========================*/ @@ -2450,7 +2450,7 @@ void recv_init_crash_recovery(void) /*==========================*/ { - ut_a(!recv_needed_recovery); + ut_a(!recv_needed_recovery); recv_needed_recovery = TRUE; @@ -2481,7 +2481,6 @@ recv_init_crash_recovery(void) "InnoDB: buffer...\n"); trx_sys_doublewrite_init_or_restore_pages(TRUE); } - } /************************************************************ @@ -2805,7 +2804,7 @@ recv_recovery_from_checkpoint_start( recv_synchronize_groups(up_to_date_group); if (!recv_needed_recovery) { - ut_a(ut_dulint_cmp(checkpoint_lsn, + ut_a(ut_dulint_cmp(checkpoint_lsn, recv_sys->recovered_lsn) == 0); } else { diff --git a/storage/innobase/row/row0mysql.c b/storage/innobase/row/row0mysql.c index d51b7e1e0b5..b8d201e3da2 100644 --- a/storage/innobase/row/row0mysql.c +++ b/storage/innobase/row/row0mysql.c @@ -655,6 +655,8 @@ row_create_prebuilt( prebuilt->old_vers_heap = NULL; + prebuilt->last_value = 0; + return(prebuilt); } @@ -2894,6 +2896,8 @@ next_rec: dict_table_change_id_in_cache(table, new_id); } + /* MySQL calls ha_innobase::reset_auto_increment() which does + the same thing. */ dict_table_autoinc_initialize(table, 0); dict_update_statistics(table); diff --git a/storage/innobase/row/row0sel.c b/storage/innobase/row/row0sel.c index e70b3b8671f..ee79bc94906 100644 --- a/storage/innobase/row/row0sel.c +++ b/storage/innobase/row/row0sel.c @@ -4519,3 +4519,169 @@ row_search_check_if_query_cache_permitted( return(ret); } + +/*********************************************************************** +Read the AUTOINC column from the current row. */ +static +ib_longlong +row_search_autoinc_read_column( +/*===========================*/ + /* out: value read from the column */ + dict_index_t* index, /* in: index to read from */ + const rec_t* rec, /* in: current rec */ + ulint col_no, /* in: column number */ + ibool unsigned_type) /* in: signed or unsigned flag */ +{ + ulint len; + byte* ptr; + const byte* data; + ib_longlong value; + mem_heap_t* heap = NULL; + byte dest[sizeof(value)]; + ulint offsets_[REC_OFFS_NORMAL_SIZE]; + ulint* offsets = offsets_; + + *offsets_ = sizeof offsets_ / sizeof *offsets_; + + /* TODO: We have to cast away the const of rec for now. This needs + to be fixed later.*/ + offsets = rec_get_offsets( + (rec_t*) rec, index, offsets, ULINT_UNDEFINED, &heap); + + /* TODO: We have to cast away the const of rec for now. This needs + to be fixed later.*/ + data = rec_get_nth_field((rec_t*)rec, offsets, col_no, &len); + + ut_a(len != UNIV_SQL_NULL); + ut_a(len <= sizeof value); + + /* Convert integer data from Innobase to a little-endian format, + sign bit restored to normal */ + + for (ptr = dest + len; ptr != dest; ++data) { + --ptr; + *ptr = *data; + } + + if (!unsigned_type) { + dest[len - 1] ^= 128; + } + + /* The assumption here is that the AUTOINC value can't be negative.*/ + switch (len) { + case 8: + value = *(ib_longlong*) ptr; + break; + + case 4: + value = *(ib_uint32_t*) ptr; + break; + + case 2: + value = *(uint16 *) ptr; + break; + + case 1: + value = *ptr; + break; + + default: + ut_error; + } + + if (UNIV_LIKELY_NULL(heap)) { + mem_heap_free(heap); + } + + ut_a(value >= 0); + + return(value); +} + +/*********************************************************************** +Get the last row. */ +static +const rec_t* +row_search_autoinc_get_rec( +/*=======================*/ + /* out: current rec or NULL */ + btr_pcur_t* pcur, /* in: the current cursor */ + mtr_t* mtr) /* in: mini transaction */ +{ + do { + const rec_t* rec = btr_pcur_get_rec(pcur); + + if (page_rec_is_user_rec(rec)) { + return(rec); + } + } while (btr_pcur_move_to_prev(pcur, mtr)); + + return(NULL); +} + +/*********************************************************************** +Read the max AUTOINC value from an index. */ + +ulint +row_search_max_autoinc( +/*===================*/ + /* out: DB_SUCCESS if all OK else + error code, DB_RECORD_NOT_FOUND if + column name can't be found in index */ + dict_index_t* index, /* in: index to search */ + const char* col_name, /* in: name of autoinc column */ + ib_longlong* value) /* out: AUTOINC value read */ +{ + ulint i; + ulint n_cols; + dict_field_t* dfield = NULL; + ulint error = DB_SUCCESS; + + n_cols = dict_index_get_n_ordering_defined_by_user(index); + + /* Search the index for the AUTOINC column name */ + for (i = 0; i < n_cols; ++i) { + dfield = dict_index_get_nth_field(index, i); + + if (strcmp(col_name, dfield->name) == 0) { + break; + } + } + + *value = 0; + + /* Must find the AUTOINC column name */ + if (i < n_cols && dfield) { + mtr_t mtr; + btr_pcur_t pcur; + + mtr_start(&mtr); + + /* Open at the high/right end (FALSE), and INIT + cursor (TRUE) */ + btr_pcur_open_at_index_side( + FALSE, index, BTR_SEARCH_LEAF, &pcur, TRUE, &mtr); + + if (page_get_n_recs(btr_pcur_get_page(&pcur)) > 0) { + const rec_t* rec; + + rec = row_search_autoinc_get_rec(&pcur, &mtr); + + if (rec != NULL) { + ibool unsigned_type = ( + dfield->col->prtype & DATA_UNSIGNED); + + *value = row_search_autoinc_read_column( + index, rec, i, unsigned_type); + } + } + + btr_pcur_close(&pcur); + + mtr_commit(&mtr); + } else { + error = DB_RECORD_NOT_FOUND; + } + + return(error); +} diff --git a/storage/innobase/trx/trx0trx.c b/storage/innobase/trx/trx0trx.c index b312e008cd2..ca9195599d9 100644 --- a/storage/innobase/trx/trx0trx.c +++ b/storage/innobase/trx/trx0trx.c @@ -195,6 +195,8 @@ trx_create( memset(&trx->xid, 0, sizeof(trx->xid)); trx->xid.formatID = -1; + trx->n_autoinc_rows = 0; + trx_reset_new_rec_lock_info(trx); return(trx); From f01f1993ddf30bb1cfce8eb71b7d20a6124207ea Mon Sep 17 00:00:00 2001 From: "tsmith@ramayana.hindu.god" <> Date: Sat, 25 Aug 2007 03:55:38 -0600 Subject: [PATCH 36/90] Apply InnoDB snapshot innodb-5.1-ss1751. Bug #16979: AUTO_INC lock in InnoDB works a table level lock Add a table level counter that tracks the number of AUTOINC locks that are pending and/or granted on a table. We peek at this value to determine whether a transaction doing a simple INSERT in innodb_autoinc_lock_mode = 1, needs to acquire the AUTOINC lock or not. This change is related to Bug# 16979. Bug #27950: Duplicate entry error in auto-inc after mysqld restart We check whether the AUTOINC sub-system has been initialized (first) by holding the AUTOINC mutex and if initialization is required then we initialize using our normal procedure. --- storage/innobase/dict/dict0boot.c | 65 +++++---- storage/innobase/dict/dict0crea.c | 2 +- storage/innobase/dict/dict0load.c | 9 +- storage/innobase/dict/dict0mem.c | 4 + storage/innobase/handler/ha_innodb.cc | 203 ++++++++++---------------- storage/innobase/include/dict0mem.h | 20 ++- storage/innobase/include/mem0mem.ic | 12 +- storage/innobase/include/sync0rw.ic | 2 +- storage/innobase/include/trx0trx.h | 25 ---- storage/innobase/lock/lock0lock.c | 7 + storage/innobase/mtr/mtr0log.c | 28 +++- storage/innobase/pars/pars0pars.c | 3 +- storage/innobase/srv/srv0srv.c | 4 +- storage/innobase/trx/trx0sys.c | 2 + storage/innobase/trx/trx0trx.c | 18 --- 15 files changed, 186 insertions(+), 218 deletions(-) diff --git a/storage/innobase/dict/dict0boot.c b/storage/innobase/dict/dict0boot.c index f8849008854..5f9aaf71e18 100644 --- a/storage/innobase/dict/dict0boot.c +++ b/storage/innobase/dict/dict0boot.c @@ -211,6 +211,7 @@ dict_boot(void) dict_table_t* table; dict_index_t* index; dict_hdr_t* dict_hdr; + mem_heap_t* heap; mtr_t mtr; mtr_start(&mtr); @@ -218,6 +219,8 @@ dict_boot(void) /* Create the hash tables etc. */ dict_init(); + heap = mem_heap_create(450); + mutex_enter(&(dict_sys->mutex)); /* Get the dictionary header */ @@ -244,19 +247,20 @@ dict_boot(void) /*-------------------------*/ table = dict_mem_table_create("SYS_TABLES", DICT_HDR_SPACE, 8, 0); - dict_mem_table_add_col(table, "NAME", DATA_BINARY, 0, 0); - dict_mem_table_add_col(table, "ID", DATA_BINARY, 0, 0); - dict_mem_table_add_col(table, "N_COLS", DATA_INT, 0, 4); - dict_mem_table_add_col(table, "TYPE", DATA_INT, 0, 4); - dict_mem_table_add_col(table, "MIX_ID", DATA_BINARY, 0, 0); - dict_mem_table_add_col(table, "MIX_LEN", DATA_INT, 0, 4); - dict_mem_table_add_col(table, "CLUSTER_NAME", DATA_BINARY, 0, 0); - dict_mem_table_add_col(table, "SPACE", DATA_INT, 0, 4); + dict_mem_table_add_col(table, heap, "NAME", DATA_BINARY, 0, 0); + dict_mem_table_add_col(table, heap, "ID", DATA_BINARY, 0, 0); + dict_mem_table_add_col(table, heap, "N_COLS", DATA_INT, 0, 4); + dict_mem_table_add_col(table, heap, "TYPE", DATA_INT, 0, 4); + dict_mem_table_add_col(table, heap, "MIX_ID", DATA_BINARY, 0, 0); + dict_mem_table_add_col(table, heap, "MIX_LEN", DATA_INT, 0, 4); + dict_mem_table_add_col(table, heap, "CLUSTER_NAME", DATA_BINARY, 0, 0); + dict_mem_table_add_col(table, heap, "SPACE", DATA_INT, 0, 4); table->id = DICT_TABLES_ID; - dict_table_add_to_cache(table); + dict_table_add_to_cache(table, heap); dict_sys->sys_tables = table; + mem_heap_empty(heap); index = dict_mem_index_create("SYS_TABLES", "CLUST_IND", DICT_HDR_SPACE, @@ -283,18 +287,19 @@ dict_boot(void) /*-------------------------*/ table = dict_mem_table_create("SYS_COLUMNS", DICT_HDR_SPACE, 7, 0); - dict_mem_table_add_col(table, "TABLE_ID", DATA_BINARY, 0, 0); - dict_mem_table_add_col(table, "POS", DATA_INT, 0, 4); - dict_mem_table_add_col(table, "NAME", DATA_BINARY, 0, 0); - dict_mem_table_add_col(table, "MTYPE", DATA_INT, 0, 4); - dict_mem_table_add_col(table, "PRTYPE", DATA_INT, 0, 4); - dict_mem_table_add_col(table, "LEN", DATA_INT, 0, 4); - dict_mem_table_add_col(table, "PREC", DATA_INT, 0, 4); + dict_mem_table_add_col(table, heap, "TABLE_ID", DATA_BINARY, 0, 0); + dict_mem_table_add_col(table, heap, "POS", DATA_INT, 0, 4); + dict_mem_table_add_col(table, heap, "NAME", DATA_BINARY, 0, 0); + dict_mem_table_add_col(table, heap, "MTYPE", DATA_INT, 0, 4); + dict_mem_table_add_col(table, heap, "PRTYPE", DATA_INT, 0, 4); + dict_mem_table_add_col(table, heap, "LEN", DATA_INT, 0, 4); + dict_mem_table_add_col(table, heap, "PREC", DATA_INT, 0, 4); table->id = DICT_COLUMNS_ID; - dict_table_add_to_cache(table); + dict_table_add_to_cache(table, heap); dict_sys->sys_columns = table; + mem_heap_empty(heap); index = dict_mem_index_create("SYS_COLUMNS", "CLUST_IND", DICT_HDR_SPACE, @@ -311,13 +316,13 @@ dict_boot(void) /*-------------------------*/ table = dict_mem_table_create("SYS_INDEXES", DICT_HDR_SPACE, 7, 0); - dict_mem_table_add_col(table, "TABLE_ID", DATA_BINARY, 0, 0); - dict_mem_table_add_col(table, "ID", DATA_BINARY, 0, 0); - dict_mem_table_add_col(table, "NAME", DATA_BINARY, 0, 0); - dict_mem_table_add_col(table, "N_FIELDS", DATA_INT, 0, 4); - dict_mem_table_add_col(table, "TYPE", DATA_INT, 0, 4); - dict_mem_table_add_col(table, "SPACE", DATA_INT, 0, 4); - dict_mem_table_add_col(table, "PAGE_NO", DATA_INT, 0, 4); + dict_mem_table_add_col(table, heap, "TABLE_ID", DATA_BINARY, 0, 0); + dict_mem_table_add_col(table, heap, "ID", DATA_BINARY, 0, 0); + dict_mem_table_add_col(table, heap, "NAME", DATA_BINARY, 0, 0); + dict_mem_table_add_col(table, heap, "N_FIELDS", DATA_INT, 0, 4); + dict_mem_table_add_col(table, heap, "TYPE", DATA_INT, 0, 4); + dict_mem_table_add_col(table, heap, "SPACE", DATA_INT, 0, 4); + dict_mem_table_add_col(table, heap, "PAGE_NO", DATA_INT, 0, 4); /* The '+ 2' below comes from the 2 system fields */ #if DICT_SYS_INDEXES_PAGE_NO_FIELD != 6 + 2 @@ -331,8 +336,9 @@ dict_boot(void) #endif table->id = DICT_INDEXES_ID; - dict_table_add_to_cache(table); + dict_table_add_to_cache(table, heap); dict_sys->sys_indexes = table; + mem_heap_empty(heap); index = dict_mem_index_create("SYS_INDEXES", "CLUST_IND", DICT_HDR_SPACE, @@ -349,13 +355,14 @@ dict_boot(void) /*-------------------------*/ table = dict_mem_table_create("SYS_FIELDS", DICT_HDR_SPACE, 3, 0); - dict_mem_table_add_col(table, "INDEX_ID", DATA_BINARY, 0, 0); - dict_mem_table_add_col(table, "POS", DATA_INT, 0, 4); - dict_mem_table_add_col(table, "COL_NAME", DATA_BINARY, 0, 0); + dict_mem_table_add_col(table, heap, "INDEX_ID", DATA_BINARY, 0, 0); + dict_mem_table_add_col(table, heap, "POS", DATA_INT, 0, 4); + dict_mem_table_add_col(table, heap, "COL_NAME", DATA_BINARY, 0, 0); table->id = DICT_FIELDS_ID; - dict_table_add_to_cache(table); + dict_table_add_to_cache(table, heap); dict_sys->sys_fields = table; + mem_heap_free(heap); index = dict_mem_index_create("SYS_FIELDS", "CLUST_IND", DICT_HDR_SPACE, diff --git a/storage/innobase/dict/dict0crea.c b/storage/innobase/dict/dict0crea.c index 51146c3c24c..4116230347d 100644 --- a/storage/innobase/dict/dict0crea.c +++ b/storage/innobase/dict/dict0crea.c @@ -960,7 +960,7 @@ dict_create_table_step( if (node->state == TABLE_ADD_TO_CACHE) { - dict_table_add_to_cache(node->table); + dict_table_add_to_cache(node->table, node->heap); err = DB_SUCCESS; } diff --git a/storage/innobase/dict/dict0load.c b/storage/innobase/dict/dict0load.c index ba2e25cf031..1ff1fd54cec 100644 --- a/storage/innobase/dict/dict0load.c +++ b/storage/innobase/dict/dict0load.c @@ -423,7 +423,8 @@ dict_load_columns( ut_a(name_of_col_is(sys_columns, sys_index, 8, "PREC")); - dict_mem_table_add_col(table, name, mtype, prtype, col_len); + dict_mem_table_add_col(table, heap, name, + mtype, prtype, col_len); btr_pcur_move_to_next_user_rec(&pcur, &mtr); } @@ -746,7 +747,7 @@ dict_load_table( ut_ad(mutex_own(&(dict_sys->mutex))); - heap = mem_heap_create(1000); + heap = mem_heap_create(32000); mtr_start(&mtr); @@ -852,7 +853,9 @@ err_exit: dict_load_columns(table, heap); - dict_table_add_to_cache(table); + dict_table_add_to_cache(table, heap); + + mem_heap_empty(heap); dict_load_indexes(table, heap); diff --git a/storage/innobase/dict/dict0mem.c b/storage/innobase/dict/dict0mem.c index e0b8bf15dd7..f4012c11973 100644 --- a/storage/innobase/dict/dict0mem.c +++ b/storage/innobase/dict/dict0mem.c @@ -95,6 +95,10 @@ dict_mem_table_create( default to 1 here.*/ table->autoinc_increment = 1; + /* The number of transactions that are either waiting on the + AUTOINC lock or have been granted the lock. */ + table->n_waiting_or_granted_auto_inc_locks = 0; + #ifdef UNIV_DEBUG table->magic_n = DICT_TABLE_MAGIC_N; #endif /* UNIV_DEBUG */ diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 339a417a696..909b19e6ae7 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -92,11 +92,15 @@ extern "C" { #include "../storage/innobase/include/ha_prototypes.h" } +static const long AUTOINC_OLD_STYLE_LOCKING = 0; +static const long AUTOINC_NEW_STYLE_LOCKING = 1; +static const long AUTOINC_NO_LOCKING = 2; + static long innobase_mirrored_log_groups, innobase_log_files_in_group, innobase_log_buffer_size, innobase_buffer_pool_awe_mem_mb, innobase_additional_mem_pool_size, innobase_file_io_threads, innobase_lock_wait_timeout, innobase_force_recovery, - innobase_open_files; + innobase_open_files, innobase_autoinc_lock_mode; static long long innobase_buffer_pool_size, innobase_log_file_size; @@ -1928,110 +1932,6 @@ retry: DBUG_RETURN(0); } -#if 0 -/* TODO: put the -MySQL-4.1 functionality back to 5.0. This is needed to get InnoDB Hot Backup -to work. */ - -/********************************************************************* -This is called when MySQL writes the binlog entry for the current -transaction. Writes to the InnoDB tablespace info which tells where the -MySQL binlog entry for the current transaction ended. Also commits the -transaction inside InnoDB but does NOT flush InnoDB log files to disk. -To flush you have to call innobase_commit_complete(). We have separated -flushing to eliminate the bottleneck of LOCK_log in log.cc which disabled -InnoDB's group commit capability. */ -static -int -innobase_report_binlog_offset_and_commit( -/*=====================================*/ - /* out: 0 */ - handlerton *hton, /* in: Innodb handlerton */ - THD* thd, /* in: user thread */ - void* trx_handle, /* in: InnoDB trx handle */ - char* log_file_name, /* in: latest binlog file name */ - my_off_t end_offset) /* in: the offset in the binlog file - up to which we wrote */ -{ - trx_t* trx; - - trx = (trx_t*)trx_handle; - - ut_a(trx != NULL); - - trx->mysql_log_file_name = log_file_name; - trx->mysql_log_offset = (ib_longlong)end_offset; - - trx->flush_log_later = TRUE; - - innobase_commit(hton, thd, TRUE); - - trx->flush_log_later = FALSE; - - return(0); -} - -/*********************************************************************** -This function stores the binlog offset and flushes logs. */ -static -void -innobase_store_binlog_offset_and_flush_log( -/*=======================================*/ - char* binlog_name, /* in: binlog name */ - longlong offset) /* in: binlog offset */ -{ - mtr_t mtr; - - assert(binlog_name != NULL); - - /* Start a mini-transaction */ - mtr_start_noninline(&mtr); - - /* Update the latest MySQL binlog name and offset info - in trx sys header */ - - trx_sys_update_mysql_binlog_offset( - binlog_name, - offset, - TRX_SYS_MYSQL_LOG_INFO, &mtr); - - /* Commits the mini-transaction */ - mtr_commit(&mtr); - - /* Synchronous flush of the log buffer to disk */ - log_buffer_flush_to_disk(); -} - -/********************************************************************* -This is called after MySQL has written the binlog entry for the current -transaction. Flushes the InnoDB log files to disk if required. */ -static -int -innobase_commit_complete( -/*=====================*/ - /* out: 0 */ - THD* thd) /* in: user thread */ -{ - trx_t* trx; - - trx = thd_to_trx(thd); - - if (trx && trx->active_trans) { - - trx->active_trans = 0; - - if (UNIV_UNLIKELY(srv_flush_log_at_trx_commit == 0)) { - - return(0); - } - - trx_commit_complete_for_mysql(trx); - } - - return(0); -} -#endif - /********************************************************************* Rolls back a transaction or the latest SQL statement. */ static @@ -3353,24 +3253,46 @@ ha_innobase::innobase_autoinc_lock(void) { ulint error = DB_SUCCESS; - if (thd_sql_command(user_thd) == SQLCOM_INSERT) { + switch (innobase_autoinc_lock_mode) { + case AUTOINC_NO_LOCKING: + /* Acquire only the AUTOINC mutex. */ dict_table_autoinc_lock(prebuilt->table); + break; - /* We peek at the dict_table_t::auto_inc_lock to check if - another statement has locked it */ - if (prebuilt->trx->auto_inc_lock != NULL) { - /* Release the mutex to avoid deadlocks */ - dict_table_autoinc_unlock(prebuilt->table); + case AUTOINC_NEW_STYLE_LOCKING: + /* For simple (single/multi) row INSERTs, we fallback to the + old style only if another transaction has already acquired + the AUTOINC lock on behalf of a LOAD FILE or INSERT ... SELECT + etc. type of statement. */ + if (thd_sql_command(user_thd) == SQLCOM_INSERT) { + dict_table_t* table = prebuilt->table; - goto acquire_auto_inc_lock; + /* Acquire the AUTOINC mutex. */ + dict_table_autoinc_lock(table); + + /* We need to check that another transaction isn't + already holding the AUTOINC lock on the table. */ + if (table->n_waiting_or_granted_auto_inc_locks) { + /* Release the mutex to avoid deadlocks. */ + dict_table_autoinc_unlock(table); + } else { + break; + } } - } else { -acquire_auto_inc_lock: + /* Fall through to old style locking. */ + + case AUTOINC_OLD_STYLE_LOCKING: error = row_lock_table_autoinc_for_mysql(prebuilt); if (error == DB_SUCCESS) { + + /* Acquire the AUTOINC mutex. */ dict_table_autoinc_lock(prebuilt->table); } + break; + + default: + ut_error; } return(ulong(error)); @@ -3610,6 +3532,7 @@ no_commit: if (auto_inc > prebuilt->last_value) { set_max_autoinc: + ut_a(prebuilt->table->autoinc_increment > 0); auto_inc += prebuilt->table->autoinc_increment; innobase_set_max_autoinc(auto_inc); @@ -3884,12 +3807,23 @@ ha_innobase::delete_row( if (table->found_next_number_field && record == table->record[0]) { ulonglong dummy = 0; - error = innobase_get_auto_increment(&dummy); + /* First check whether the AUTOINC sub-system has been + initialized using the AUTOINC mutex. If not then we + do it the "proper" way, by acquiring the heavier locks. */ + dict_table_autoinc_lock(prebuilt->table); - if (error == DB_SUCCESS) { + if (!prebuilt->table->autoinc_inited) { + dict_table_autoinc_unlock(prebuilt->table); + + error = innobase_get_auto_increment(&dummy); + + if (error == DB_SUCCESS) { + dict_table_autoinc_unlock(prebuilt->table); + } else { + goto error_exit; + } + } else { dict_table_autoinc_unlock(prebuilt->table); - } else { - goto error_exit; } } @@ -7411,13 +7345,24 @@ ha_innobase::get_auto_increment( *nb_reserved_values = prebuilt->trx->n_autoinc_rows; - /* Compute the last value in the interval */ - prebuilt->last_value = *first_value + (*nb_reserved_values * increment); + /* With old style AUTOINC locking we only update the table's + AUTOINC counter after attempting to insert the row. */ + if (innobase_autoinc_lock_mode != AUTOINC_OLD_STYLE_LOCKING) { - ut_a(prebuilt->last_value >= *first_value); + /* Compute the last value in the interval */ + prebuilt->last_value = *first_value + + (*nb_reserved_values * increment); - /* Update the table autoinc variable */ - dict_table_autoinc_update(prebuilt->table, prebuilt->last_value); + ut_a(prebuilt->last_value >= *first_value); + + /* Update the table autoinc variable */ + dict_table_autoinc_update( + prebuilt->table, prebuilt->last_value); + } else { + /* This will force write_row() into attempting an update + of the table's AUTOINC counter. */ + prebuilt->last_value = 0; + } /* The increment to be used to increase the AUTOINC value, we use this in write_row() and update_row() to increase the autoinc counter @@ -8080,6 +8025,17 @@ static MYSQL_SYSVAR_STR(data_file_path, innobase_data_file_path, "Path to individual files and their sizes.", NULL, NULL, NULL); +static MYSQL_SYSVAR_LONG(autoinc_lock_mode, innobase_autoinc_lock_mode, + PLUGIN_VAR_RQCMDARG, + "The AUTOINC lock modes supported by InnoDB:\n" + " 0 => Old style AUTOINC locking (for backward compatibility)\n" + " 1 => New style AUTOINC locking\n" + " 2 => No AUTOINC locking (unsafe for SBR)", + NULL, NULL, + AUTOINC_NEW_STYLE_LOCKING, /* Default setting */ + AUTOINC_OLD_STYLE_LOCKING, /* Minimum value */ + AUTOINC_NO_LOCKING, 0); /* Maximum value */ + static struct st_mysql_sys_var* innobase_system_variables[]= { MYSQL_SYSVAR(additional_mem_pool_size), MYSQL_SYSVAR(autoextend_increment), @@ -8118,6 +8074,7 @@ static struct st_mysql_sys_var* innobase_system_variables[]= { MYSQL_SYSVAR(table_locks), MYSQL_SYSVAR(thread_concurrency), MYSQL_SYSVAR(thread_sleep_delay), + MYSQL_SYSVAR(autoinc_lock_mode), NULL }; diff --git a/storage/innobase/include/dict0mem.h b/storage/innobase/include/dict0mem.h index de6ee1227bf..a05bc513efd 100644 --- a/storage/innobase/include/dict0mem.h +++ b/storage/innobase/include/dict0mem.h @@ -315,11 +315,11 @@ struct dict_table_struct{ unsigned n_cols:10;/* number of columns */ dict_col_t* cols; /* array of column descriptions */ const char* col_names; - /* n_def column names packed in an - "name1\0name2\0...nameN\0" array. until - n_def reaches n_cols, this is allocated with - ut_malloc, and the final size array is - allocated through the table's heap. */ + /* Column names packed in a character string + "name1\0name2\0...nameN\0". Until + the string contains n_cols, it will be + allocated from a temporary heap. The final + string will be allocated from table->heap. */ hash_node_t name_hash; /* hash chain node */ hash_node_t id_hash; /* hash chain node */ UT_LIST_BASE_NODE_T(dict_index_t) @@ -416,6 +416,16 @@ struct dict_table_struct{ /* The increment step of the auto increment column. Value must be greater than or equal to 1 */ + ulong n_waiting_or_granted_auto_inc_locks; + /* This counter is used to track the number + of granted and pending autoinc locks on this + table. This value is set after acquiring the + kernel mutex but we peek the contents to + determine whether other transactions have + acquired the AUTOINC lock or not. Of course + only one transaction can be granted the + lock but there can be multiple waiters. */ + #ifdef UNIV_DEBUG ulint magic_n;/* magic number */ # define DICT_TABLE_MAGIC_N 76333786 diff --git a/storage/innobase/include/mem0mem.ic b/storage/innobase/include/mem0mem.ic index e59443da73d..adae9ad8a33 100644 --- a/storage/innobase/include/mem0mem.ic +++ b/storage/innobase/include/mem0mem.ic @@ -271,15 +271,19 @@ 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 */ - - mem_erase_buf(old_top, (byte*)block + block->len - old_top); + { + ulint len = (byte*)block + block->len - old_top; + mem_erase_buf(old_top, len); + UNIV_MEM_FREE(old_top, len); + } /* Update allocated memory count */ mutex_enter(&mem_hash_mutex); mem_current_allocated_memory -= (total_size - size); mutex_exit(&mem_hash_mutex); - -#endif +#else /* UNIV_MEM_DEBUG */ + UNIV_MEM_FREE(old_top, (byte*)block + block->len - old_top); +#endif /* UNIV_MEM_DEBUG */ /* If free == start, we may free the block if it is not the first one */ diff --git a/storage/innobase/include/sync0rw.ic b/storage/innobase/include/sync0rw.ic index f8b5367739a..b41593d0a96 100644 --- a/storage/innobase/include/sync0rw.ic +++ b/storage/innobase/include/sync0rw.ic @@ -231,7 +231,7 @@ rw_lock_s_lock_func( owns an s-lock here, it may end up in a deadlock with another thread which requests an x-lock here. Therefore, we will forbid recursive s-locking of a latch: the following assert will warn the programmer - of the possibility of a tjis kind of deadlock. If we want to implement + of the possibility of this kind of a deadlock. If we want to implement safe recursive s-locking, we should keep in a list the thread ids of the threads which have s-locked a latch. This would use some CPU time. */ diff --git a/storage/innobase/include/trx0trx.h b/storage/innobase/include/trx0trx.h index 0455e9ea17a..5017c15aaf0 100644 --- a/storage/innobase/include/trx0trx.h +++ b/storage/innobase/include/trx0trx.h @@ -482,31 +482,6 @@ struct trx_struct{ ib_longlong mysql_log_offset;/* if MySQL binlog is used, this field contains the end offset of the binlog entry */ - const char* mysql_master_log_file_name; - /* if the database server is a MySQL - replication slave, we have here the - master binlog name up to which - replication has processed; otherwise - this is a pointer to a null - character */ - ib_longlong mysql_master_log_pos; - /* if the database server is a MySQL - replication slave, this is the - position in the log file up to which - replication has processed */ - /* A MySQL variable mysql_thd->synchronous_repl tells if we have - to use synchronous replication. See ha_innodb.cc. */ - char* repl_wait_binlog_name;/* NULL, or if synchronous MySQL - replication is used, the binlog name - up to which we must communicate the - binlog to the slave, before returning - from a commit; this is the same as - mysql_log_file_name, but we allocate - and copy the name to a separate buffer - here */ - ib_longlong repl_wait_binlog_pos;/* see above at - repl_wait_binlog_name */ - os_thread_id_t mysql_thread_id;/* id of the MySQL thread associated with this transaction object */ ulint mysql_process_no;/* since in Linux, 'top' reports diff --git a/storage/innobase/lock/lock0lock.c b/storage/innobase/lock/lock0lock.c index f43752fb5fc..39cbf83e58e 100644 --- a/storage/innobase/lock/lock0lock.c +++ b/storage/innobase/lock/lock0lock.c @@ -3386,6 +3386,10 @@ lock_table_create( ut_ad(table && trx); ut_ad(mutex_own(&kernel_mutex)); + if ((type_mode & LOCK_MODE_MASK) == LOCK_AUTO_INC) { + ++table->n_waiting_or_granted_auto_inc_locks; + } + if (type_mode == LOCK_AUTO_INC) { /* Only one trx can have the lock on the table at a time: we may use the memory preallocated @@ -3436,6 +3440,9 @@ lock_table_remove_low( if (lock == trx->auto_inc_lock) { trx->auto_inc_lock = NULL; + + ut_a(table->n_waiting_or_granted_auto_inc_locks > 0); + --table->n_waiting_or_granted_auto_inc_locks; } UT_LIST_REMOVE(trx_locks, trx->trx_locks, lock); diff --git a/storage/innobase/mtr/mtr0log.c b/storage/innobase/mtr/mtr0log.c index f9704dc2d20..e5d572bbfa7 100644 --- a/storage/innobase/mtr/mtr0log.c +++ b/storage/innobase/mtr/mtr0log.c @@ -517,8 +517,9 @@ mlog_parse_index( n = mach_read_from_2(ptr); ptr += 2; n_uniq = mach_read_from_2(ptr); + ptr += 2; ut_ad(n_uniq <= n); - if (end_ptr < ptr + (n + 1) * 2) { + if (end_ptr < ptr + n * 2) { return(NULL); } } else { @@ -531,18 +532,18 @@ mlog_parse_index( ind->table = table; ind->n_uniq = (unsigned int) n_uniq; if (n_uniq != n) { + ut_a(n_uniq + DATA_ROLL_PTR <= n); ind->type = DICT_CLUSTERED; } - /* avoid ut_ad(index->cached) in dict_index_get_n_unique_in_tree */ - ind->cached = TRUE; if (comp) { for (i = 0; i < n; i++) { - ulint len = mach_read_from_2(ptr += 2); + ulint len = mach_read_from_2(ptr); + ptr += 2; /* The high-order bit of len is the NOT NULL flag; the rest is 0 or 0x7fff for variable-length fields, and 1..0x7ffe for fixed-length fields. */ dict_mem_table_add_col( - table, "DUMMY", + table, NULL, NULL, ((len + 1) & 0x7fff) <= 1 ? DATA_BINARY : DATA_FIXBINARY, len & 0x8000 ? DATA_NOT_NULL : 0, @@ -552,8 +553,23 @@ mlog_parse_index( dict_table_get_nth_col(table, i), 0); } - ptr += 2; + dict_table_add_system_columns(table, table->heap); + if (n_uniq != n) { + /* Identify DB_TRX_ID and DB_ROLL_PTR in the index. */ + ut_a(DATA_TRX_ID_LEN + == dict_index_get_nth_col(ind, DATA_TRX_ID - 1 + + n_uniq)->len); + ut_a(DATA_ROLL_PTR_LEN + == dict_index_get_nth_col(ind, DATA_ROLL_PTR - 1 + + n_uniq)->len); + ind->fields[DATA_TRX_ID - 1 + n_uniq].col + = &table->cols[n + DATA_TRX_ID]; + ind->fields[DATA_ROLL_PTR - 1 + n_uniq].col + = &table->cols[n + DATA_ROLL_PTR]; + } } + /* avoid ut_ad(index->cached) in dict_index_get_n_unique_in_tree */ + ind->cached = TRUE; *index = ind; return(ptr); } diff --git a/storage/innobase/pars/pars0pars.c b/storage/innobase/pars/pars0pars.c index 16530494a96..89f6f862995 100644 --- a/storage/innobase/pars/pars0pars.c +++ b/storage/innobase/pars/pars0pars.c @@ -1640,7 +1640,8 @@ pars_create_table( while (column) { dtype = dfield_get_type(que_node_get_val(column)); - dict_mem_table_add_col(table, column->name, dtype->mtype, + dict_mem_table_add_col(table, table->heap, + column->name, dtype->mtype, dtype->prtype, dtype->len); column->resolved = TRUE; column->token_type = SYM_COLUMN; diff --git a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c index 8f8c9386f41..82b55789be2 100644 --- a/storage/innobase/srv/srv0srv.c +++ b/storage/innobase/srv/srv0srv.c @@ -907,7 +907,7 @@ srv_init(void) /* create dummy table and index for old-style infimum and supremum */ table = dict_mem_table_create("SYS_DUMMY1", DICT_HDR_SPACE, 1, 0); - dict_mem_table_add_col(table, "DUMMY", DATA_CHAR, + dict_mem_table_add_col(table, NULL, NULL, DATA_CHAR, DATA_ENGLISH | DATA_NOT_NULL, 8); srv_sys->dummy_ind1 = dict_mem_index_create( @@ -918,7 +918,7 @@ srv_init(void) /* create dummy table and index for new-style infimum and supremum */ table = dict_mem_table_create("SYS_DUMMY2", DICT_HDR_SPACE, 1, DICT_TF_COMPACT); - dict_mem_table_add_col(table, "DUMMY", DATA_CHAR, + dict_mem_table_add_col(table, NULL, NULL, DATA_CHAR, DATA_ENGLISH | DATA_NOT_NULL, 8); srv_sys->dummy_ind2 = dict_mem_index_create( "SYS_DUMMY2", "SYS_DUMMY2", DICT_HDR_SPACE, 0, 1); diff --git a/storage/innobase/trx/trx0sys.c b/storage/innobase/trx/trx0sys.c index 144721150b6..40348dd4199 100644 --- a/storage/innobase/trx/trx0sys.c +++ b/storage/innobase/trx/trx0sys.c @@ -646,6 +646,7 @@ trx_sys_update_mysql_binlog_offset( MLOG_4BYTES, mtr); } +#ifdef UNIV_HOTBACKUP /********************************************************************* Prints to stderr the MySQL binlog info in the system header if the magic number shows it valid. */ @@ -677,6 +678,7 @@ trx_sys_print_mysql_binlog_offset_from_page( + TRX_SYS_MYSQL_LOG_NAME); } } +#endif /* UNIV_HOTBACKUP */ /********************************************************************* Stores the MySQL binlog offset info in the trx system header if diff --git a/storage/innobase/trx/trx0trx.c b/storage/innobase/trx/trx0trx.c index ca9195599d9..a278ad51984 100644 --- a/storage/innobase/trx/trx0trx.c +++ b/storage/innobase/trx/trx0trx.c @@ -139,11 +139,6 @@ trx_create( trx->mysql_log_file_name = NULL; trx->mysql_log_offset = 0; - trx->mysql_master_log_file_name = ""; - trx->mysql_master_log_pos = 0; - - trx->repl_wait_binlog_name = NULL; - trx->repl_wait_binlog_pos = 0; mutex_create(&trx->undo_mutex, SYNC_TRX_UNDO); @@ -325,11 +320,6 @@ trx_free( trx_undo_arr_free(trx->undo_no_arr); } - if (trx->repl_wait_binlog_name != NULL) { - - mem_free(trx->repl_wait_binlog_name); - } - ut_a(UT_LIST_GET_LEN(trx->signals) == 0); ut_a(UT_LIST_GET_LEN(trx->reply_signals) == 0); @@ -809,14 +799,6 @@ trx_commit_off_kernel( trx->mysql_log_file_name = NULL; } - if (trx->mysql_master_log_file_name[0] != '\0') { - /* This database server is a MySQL replication slave */ - trx_sys_update_mysql_binlog_offset( - trx->mysql_master_log_file_name, - trx->mysql_master_log_pos, - TRX_SYS_MYSQL_MASTER_LOG_INFO, &mtr); - } - /* The following call commits the mini-transaction, making the whole transaction committed in the file-based world, at this log sequence number. The transaction becomes 'durable' when From f8b64e17f94923ef421469d648c31c0f06d2cf96 Mon Sep 17 00:00:00 2001 From: "rafal@quant.(none)" <> Date: Sun, 26 Aug 2007 14:31:10 +0200 Subject: [PATCH 37/90] BUG#21842 (Cluster fails to replicate to innodb or myisam with err 134 using TPC-B): Problem: A RBR event can contain incomplete row data (only key value and fields which have been changed). In that case, when the row is unpacked into record and written to a table, the missing fields get incorrect NULL values leading to master-slave inconsistency. Solution: Use values found in slave's table for columns which are not given in the rows event. The code for writing a single row uses the following algorithm: 1. unpack row_data into table->record[0], 2. try to insert record, 3. if duplicate record found, fetch it into table->record[0], 4. unpack row_data into table->record[0], 5. write table->record[0] into the table. Where row_data is the row as stored in the data area of a rows event. Thus: a) unpacking of row_data happens at the time when row is written into a table, b) when unpacking (in step 4), only columns present in row_data are overwritten - all other columns remain as they were found in the table. Since all data needed for the above algorithm is stored inside Rows_log_event class, functions which locate and write rows are turned into methods of that class. replace_record() -> Rows_log_event::write_row() find_and_fetch_row() -> Rows_log_event::find_row() Both methods take row data from event's data buffer - the row being processed is pointed by m_curr_row. They unpack the data as needed into table's record buffers record[0] or record[1]. When row is unpacked, m_curr_row_end is set to point at next row in the data buffer. Other changes introduced in this changeset: - Change signature of unpack_row(): don't report errors and don't setup table's rw_set here. Errors can happen only when setting default values in prepare_record() function and are detected there. - In Rows_log_event and derived classes, don't pass arguments to the execution primitives (do_...() member functions) but use class members instead. - Move old row handling code into log_event_old.cc to be used by *_rows_log_event_old classes. Also, a new test rpl_ndb_2other is added which tests basic replication from master using ndb tables to slave storing the same tables using (possibly) different engine (myisam,innodb). Test is based on existing tests rpl_ndb_2myisam and rpl_ndb_2innodb. However, these tests doesn't work for various reasons and currently are disabled (see BUG#19227). The new test differs from the ones it is based on as follows: 1. Single test tests replication with different storage engines on slave (myisam, innodb, ndb). 2. Include file extra/rpl_tests/rpl_ndb_2multi_eng.test containing original tests is replaced by extra/rpl_tests/rpl_ndb_2multi_basic.test which doesn't contain tests using partitioned tables as these don't work currently. Instead, it tests replication to a slave which has more or less columns than master. 3. Include file include/rpl_multi_engine3.inc is replaced with include/rpl_multi_engine2.inc. The later differs by performing slightly different operations (updating more than one row in the table) and clearing table with "TRUNCATE TABLE" statement instead of "DELETE FROM" as replication of "DELETE" doesn't work well in this setting. 4. Slave must use option --log-slave-updates=0 as otherwise execution of replication events generated by ndb fails if table uses a different storage engine on slave (see BUG#29569). --- .../extra/rpl_tests/rpl_ndb_2multi_basic.test | 119 ++ mysql-test/include/rpl_multi_engine2.inc | 91 ++ .../suite/rpl_ndb/r/rpl_ndb_2other.result | 1189 +++++++++++++++++ .../suite/rpl_ndb/t/rpl_ndb_2other-slave.opt | 1 + .../suite/rpl_ndb/t/rpl_ndb_2other.test | 35 + sql/log_event.cc | 841 +++++------- sql/log_event.h | 107 +- sql/log_event_old.cc | 1115 ++++++++++++++++ sql/log_event_old.h | 132 +- sql/rpl_record.cc | 76 +- sql/rpl_record.h | 10 +- sql/rpl_utility.cc | 2 +- sql/rpl_utility.h | 42 +- 13 files changed, 3191 insertions(+), 569 deletions(-) create mode 100644 mysql-test/extra/rpl_tests/rpl_ndb_2multi_basic.test create mode 100644 mysql-test/include/rpl_multi_engine2.inc create mode 100644 mysql-test/suite/rpl_ndb/r/rpl_ndb_2other.result create mode 100644 mysql-test/suite/rpl_ndb/t/rpl_ndb_2other-slave.opt create mode 100644 mysql-test/suite/rpl_ndb/t/rpl_ndb_2other.test diff --git a/mysql-test/extra/rpl_tests/rpl_ndb_2multi_basic.test b/mysql-test/extra/rpl_tests/rpl_ndb_2multi_basic.test new file mode 100644 index 00000000000..16f8116d92e --- /dev/null +++ b/mysql-test/extra/rpl_tests/rpl_ndb_2multi_basic.test @@ -0,0 +1,119 @@ +####################################### +# Author: Rafal Somla # +# Date: 2006-08-20 # +# Purpose: Test replication of basic # +# table operations in various setups # +# # +# Based on rpl_ndb_2multi_eng.test by # +# JBM # +####################################### + +--echo --- Doing pre test cleanup --- + +connection master; +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_query_log + +################################################# +--echo --- Create Table Section --- + +CREATE TABLE t1 (id MEDIUMINT NOT NULL, + b1 INT, + vc VARCHAR(255), + bc CHAR(255), + d DECIMAL(10,4) DEFAULT 0, + f FLOAT DEFAULT 0, + total BIGINT UNSIGNED, + y YEAR, + t DATE, + PRIMARY KEY(id)); + +--echo --- Show table on master --- + +SHOW CREATE TABLE t1; + +--echo --- Show table on slave --- + +sync_slave_with_master; +SHOW CREATE TABLE t1; + +--source include/rpl_multi_engine2.inc + +################################################# +# Okay lets see how it holds up to table changes +--echo --- Check that simple Alter statements are replicated correctly -- + +ALTER TABLE t1 DROP PRIMARY KEY; +# note: table with no PK can't contain blobs if it is to be replicated. +ALTER TABLE t1 MODIFY vc char(32); + +--echo --- Show the new improved table on the master --- + +SHOW CREATE TABLE t1; + +--echo --- Make sure that our tables on slave are still same engine --- +--echo --- and that the alter statements replicated correctly --- + +sync_slave_with_master; +SHOW CREATE TABLE t1; + +--source include/rpl_multi_engine2.inc + +################################################# +--echo --- Check that replication works when slave has more columns than master +connection master; +ALTER TABLE t1 ADD PRIMARY KEY(id,total); +ALTER TABLE t1 MODIFY vc TEXT; + +INSERT INTO t1 VALUES(3,1,'Testing MySQL databases is a cool ', + 'Must make it bug free for the customer', + 654321.4321,15.21,0,1965,"1905-11-14"); +INSERT INTO t1 VALUES(20,1,'Testing MySQL databases is a cool ', + 'Must make it bug free for the customer', + 654321.4321,15.21,0,1965,"1965-11-14"); +INSERT INTO t1 VALUES(50,1,'Testing MySQL databases is a cool ', + 'Must make it bug free for the customer', + 654321.4321,15.21,0,1965,"1985-11-14"); + +--echo --- Add columns on slave --- +--sync_slave_with_master +ALTER TABLE t1 ADD (u int, v char(16) default 'default'); +UPDATE t1 SET u=7 WHERE id < 50; +UPDATE t1 SET v='explicit' WHERE id >10; + +--echo --- Show changed table on slave --- + +SHOW CREATE TABLE t1; +SELECT * +FROM t1 +ORDER BY id; + +--source include/rpl_multi_engine2.inc +TRUNCATE TABLE t1; + +################################################# +--echo --- Check that replication works when master has more columns than slave +connection master; + +--echo --- Remove columns on slave --- +--sync_slave_with_master +ALTER TABLE t1 DROP COLUMN v; +ALTER TABLE t1 DROP COLUMN u; +ALTER TABLE t1 DROP COLUMN t; +ALTER TABLE t1 DROP COLUMN y; + +--echo --- Show changed table on slave --- + +SHOW CREATE TABLE t1; + +--source include/rpl_multi_engine2.inc +TRUNCATE TABLE t1; + +################################################# +--echo --- Do Cleanup -- +connection master; +DROP TABLE IF EXISTS t1; + +sync_slave_with_master; +connection master; diff --git a/mysql-test/include/rpl_multi_engine2.inc b/mysql-test/include/rpl_multi_engine2.inc new file mode 100644 index 00000000000..e683a1d5838 --- /dev/null +++ b/mysql-test/include/rpl_multi_engine2.inc @@ -0,0 +1,91 @@ +############################################################# +# Author: Rafal +# Date: 2007-08-20 +# based on rpl_multi_engine3.inc +############################################################# + +connection slave; +STOP SLAVE; +RESET SLAVE; + +connection master; +RESET MASTER; + +connection slave; +START SLAVE; + +--echo --- Populate t1 with data --- +connection master; +--disable_query_log +INSERT INTO t1 VALUES(42,1,'Testing MySQL databases is a cool ', + 'Must make it bug free for the customer', + 654321.4321,15.21,0,1965,"1905-11-14"); +INSERT INTO t1 VALUES(2,1,'Testing MySQL databases is a cool ', + 'Must make it bug free for the customer', + 654321.4321,15.21,0,1965,"1965-11-14"); +INSERT INTO t1 VALUES(4,1,'Testing MySQL databases is a cool ', + 'Must make it bug free for the customer', + 654321.4321,15.21,0,1965,"1985-11-14"); +INSERT INTO t1 VALUES(142,1,'Testing MySQL databases is a cool ', + 'Must make it bug free for the customer', + 654321.4321,15.21,0,1965,"1995-11-14"); +INSERT INTO t1 VALUES(412,1,'Testing MySQL databases is a cool ', + 'Must make it bug free for the customer', + 654321.4321,15.21,0,1965,"2005-11-14"); +--enable_query_log + +--echo --- Select from t1 on master --- +select * +from t1 +order by id; + +sync_slave_with_master; +--echo --- Select from t1 on slave --- +select * +from t1 +order by id; + +--echo --- Perform basic operation on master --- +--echo --- and ensure replicated correctly --- +connection master; + +--echo --- Update t1 on master -- +UPDATE t1 SET b1 = 0, bc='updated', t="2006-02-22" +WHERE id < 100 +ORDER BY id; + +--echo --- Check the update on master --- +SELECT * +FROM t1 +WHERE id < 100 +ORDER BY id; + +# Must give injector thread a little time to get update +# into the binlog other wise we will miss the update. + +sync_slave_with_master; +--echo --- Check Update on slave --- +SELECT * +FROM t1 +WHERE id < 100 +ORDER BY id; + +connection master; +--echo --- Remove a record from t1 on master --- +# Note: there is an error in replication of Delete_row +# from NDB to MyISAM (BUG#28538). However, if there is +# only one row in Delete_row event then it works fine, +# as this test demonstrates. +DELETE FROM t1 WHERE id = 412; + +--echo --- Show current count on master for t1 --- +SELECT COUNT(*) FROM t1; + +sync_slave_with_master; +--echo --- Show current count on slave for t1 --- +SELECT COUNT(*) FROM t1; + +connection master; +TRUNCATE TABLE t1; +sync_slave_with_master; +connection master; diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_2other.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_2other.result new file mode 100644 index 00000000000..56b997028e9 --- /dev/null +++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_2other.result @@ -0,0 +1,1189 @@ +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; +SET storage_engine=ndb; + +=== NDB -> MYISAM === + +SET storage_engine=myisam; +--- Doing pre test cleanup --- +DROP TABLE IF EXISTS t1; +--- Create Table Section --- +CREATE TABLE t1 (id MEDIUMINT NOT NULL, +b1 INT, +vc VARCHAR(255), +bc CHAR(255), +d DECIMAL(10,4) DEFAULT 0, +f FLOAT DEFAULT 0, +total BIGINT UNSIGNED, +y YEAR, +t DATE, +PRIMARY KEY(id)); +--- Show table on master --- +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` mediumint(9) NOT NULL, + `b1` int(11) DEFAULT NULL, + `vc` varchar(255) DEFAULT NULL, + `bc` char(255) DEFAULT NULL, + `d` decimal(10,4) DEFAULT '0.0000', + `f` float DEFAULT '0', + `total` bigint(20) unsigned DEFAULT NULL, + `y` year(4) DEFAULT NULL, + `t` date DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 +--- Show table on slave --- +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` mediumint(9) NOT NULL, + `b1` int(11) DEFAULT NULL, + `vc` varchar(255) DEFAULT NULL, + `bc` char(255) DEFAULT NULL, + `d` decimal(10,4) DEFAULT '0.0000', + `f` float DEFAULT '0', + `total` bigint(20) unsigned DEFAULT NULL, + `y` year(4) DEFAULT NULL, + `t` date DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +STOP SLAVE; +RESET SLAVE; +RESET MASTER; +START SLAVE; +--- Populate t1 with data --- +--- Select from t1 on master --- +select * +from t1 +order by id; +id b1 vc bc d f total y t +2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 +4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 +42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 +142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 +412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 +--- Select from t1 on slave --- +select * +from t1 +order by id; +id b1 vc bc d f total y t +2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 +4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 +42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 +142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 +412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 +--- Perform basic operation on master --- +--- and ensure replicated correctly --- +--- Update t1 on master -- +UPDATE t1 SET b1 = 0, bc='updated', t="2006-02-22" +WHERE id < 100 +ORDER BY id; +--- Check the update on master --- +SELECT * +FROM t1 +WHERE id < 100 +ORDER BY id; +id b1 vc bc d f total y t +2 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 +4 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 +42 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 +--- Check Update on slave --- +SELECT * +FROM t1 +WHERE id < 100 +ORDER BY id; +id b1 vc bc d f total y t +2 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 +4 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 +42 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 +--- Remove a record from t1 on master --- +DELETE FROM t1 WHERE id = 412; +--- Show current count on master for t1 --- +SELECT COUNT(*) FROM t1; +COUNT(*) +4 +--- Show current count on slave for t1 --- +SELECT COUNT(*) FROM t1; +COUNT(*) +4 +TRUNCATE TABLE t1; +--- Check that simple Alter statements are replicated correctly -- +ALTER TABLE t1 DROP PRIMARY KEY; +ALTER TABLE t1 MODIFY vc char(32); +--- Show the new improved table on the master --- +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` mediumint(9) NOT NULL, + `b1` int(11) DEFAULT NULL, + `vc` char(32) DEFAULT NULL, + `bc` char(255) DEFAULT NULL, + `d` decimal(10,4) DEFAULT '0.0000', + `f` float DEFAULT '0', + `total` bigint(20) unsigned DEFAULT NULL, + `y` year(4) DEFAULT NULL, + `t` date DEFAULT NULL +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 +--- Make sure that our tables on slave are still same engine --- +--- and that the alter statements replicated correctly --- +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` mediumint(9) NOT NULL, + `b1` int(11) DEFAULT NULL, + `vc` char(32) DEFAULT NULL, + `bc` char(255) DEFAULT NULL, + `d` decimal(10,4) DEFAULT '0.0000', + `f` float DEFAULT '0', + `total` bigint(20) unsigned DEFAULT NULL, + `y` year(4) DEFAULT NULL, + `t` date DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +STOP SLAVE; +RESET SLAVE; +RESET MASTER; +START SLAVE; +--- Populate t1 with data --- +--- Select from t1 on master --- +select * +from t1 +order by id; +id b1 vc bc d f total y t +2 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 +4 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 +42 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 +142 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 +412 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 +--- Select from t1 on slave --- +select * +from t1 +order by id; +id b1 vc bc d f total y t +2 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 +4 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 +42 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 +142 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 +412 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 +--- Perform basic operation on master --- +--- and ensure replicated correctly --- +--- Update t1 on master -- +UPDATE t1 SET b1 = 0, bc='updated', t="2006-02-22" +WHERE id < 100 +ORDER BY id; +--- Check the update on master --- +SELECT * +FROM t1 +WHERE id < 100 +ORDER BY id; +id b1 vc bc d f total y t +2 0 Testing MySQL databases is a coo updated 654321.4321 15.21 0 1965 2006-02-22 +4 0 Testing MySQL databases is a coo updated 654321.4321 15.21 0 1965 2006-02-22 +42 0 Testing MySQL databases is a coo updated 654321.4321 15.21 0 1965 2006-02-22 +--- Check Update on slave --- +SELECT * +FROM t1 +WHERE id < 100 +ORDER BY id; +id b1 vc bc d f total y t +2 0 Testing MySQL databases is a coo updated 654321.4321 15.21 0 1965 2006-02-22 +4 0 Testing MySQL databases is a coo updated 654321.4321 15.21 0 1965 2006-02-22 +42 0 Testing MySQL databases is a coo updated 654321.4321 15.21 0 1965 2006-02-22 +--- Remove a record from t1 on master --- +DELETE FROM t1 WHERE id = 412; +--- Show current count on master for t1 --- +SELECT COUNT(*) FROM t1; +COUNT(*) +4 +--- Show current count on slave for t1 --- +SELECT COUNT(*) FROM t1; +COUNT(*) +4 +TRUNCATE TABLE t1; +--- Check that replication works when slave has more columns than master +ALTER TABLE t1 ADD PRIMARY KEY(id,total); +ALTER TABLE t1 MODIFY vc TEXT; +INSERT INTO t1 VALUES(3,1,'Testing MySQL databases is a cool ', +'Must make it bug free for the customer', +654321.4321,15.21,0,1965,"1905-11-14"); +INSERT INTO t1 VALUES(20,1,'Testing MySQL databases is a cool ', +'Must make it bug free for the customer', +654321.4321,15.21,0,1965,"1965-11-14"); +INSERT INTO t1 VALUES(50,1,'Testing MySQL databases is a cool ', +'Must make it bug free for the customer', +654321.4321,15.21,0,1965,"1985-11-14"); +--- Add columns on slave --- +ALTER TABLE t1 ADD (u int, v char(16) default 'default'); +UPDATE t1 SET u=7 WHERE id < 50; +UPDATE t1 SET v='explicit' WHERE id >10; +--- Show changed table on slave --- +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` mediumint(9) NOT NULL, + `b1` int(11) DEFAULT NULL, + `vc` text, + `bc` char(255) DEFAULT NULL, + `d` decimal(10,4) DEFAULT '0.0000', + `f` float DEFAULT '0', + `total` bigint(20) unsigned NOT NULL DEFAULT '0', + `y` year(4) DEFAULT NULL, + `t` date DEFAULT NULL, + `u` int(11) DEFAULT NULL, + `v` char(16) DEFAULT 'default', + PRIMARY KEY (`id`,`total`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SELECT * +FROM t1 +ORDER BY id; +id b1 vc bc d f total y t u v +3 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 7 default +20 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 7 explicit +50 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 NULL explicit +STOP SLAVE; +RESET SLAVE; +RESET MASTER; +START SLAVE; +--- Populate t1 with data --- +--- Select from t1 on master --- +select * +from t1 +order by id; +id b1 vc bc d f total y t +2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 +3 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 +4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 +20 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 +42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 +50 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 +142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 +412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 +--- Select from t1 on slave --- +select * +from t1 +order by id; +id b1 vc bc d f total y t u v +2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 NULL default +3 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 7 default +4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 NULL default +20 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 7 explicit +42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 NULL default +50 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 NULL explicit +142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 NULL default +412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 NULL default +--- Perform basic operation on master --- +--- and ensure replicated correctly --- +--- Update t1 on master -- +UPDATE t1 SET b1 = 0, bc='updated', t="2006-02-22" +WHERE id < 100 +ORDER BY id; +--- Check the update on master --- +SELECT * +FROM t1 +WHERE id < 100 +ORDER BY id; +id b1 vc bc d f total y t +2 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 +3 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 +4 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 +20 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 +42 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 +50 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 +--- Check Update on slave --- +SELECT * +FROM t1 +WHERE id < 100 +ORDER BY id; +id b1 vc bc d f total y t u v +2 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 NULL default +3 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 7 default +4 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 NULL default +20 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 7 explicit +42 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 NULL default +50 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 NULL explicit +--- Remove a record from t1 on master --- +DELETE FROM t1 WHERE id = 412; +--- Show current count on master for t1 --- +SELECT COUNT(*) FROM t1; +COUNT(*) +7 +--- Show current count on slave for t1 --- +SELECT COUNT(*) FROM t1; +COUNT(*) +7 +TRUNCATE TABLE t1; +TRUNCATE TABLE t1; +--- Check that replication works when master has more columns than slave +--- Remove columns on slave --- +ALTER TABLE t1 DROP COLUMN v; +ALTER TABLE t1 DROP COLUMN u; +ALTER TABLE t1 DROP COLUMN t; +ALTER TABLE t1 DROP COLUMN y; +--- Show changed table on slave --- +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` mediumint(9) NOT NULL, + `b1` int(11) DEFAULT NULL, + `vc` text, + `bc` char(255) DEFAULT NULL, + `d` decimal(10,4) DEFAULT '0.0000', + `f` float DEFAULT '0', + `total` bigint(20) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`id`,`total`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +STOP SLAVE; +RESET SLAVE; +RESET MASTER; +START SLAVE; +--- Populate t1 with data --- +--- Select from t1 on master --- +select * +from t1 +order by id; +id b1 vc bc d f total y t +2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 +4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 +42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 +142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 +412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 +--- Select from t1 on slave --- +select * +from t1 +order by id; +id b1 vc bc d f total +2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 +4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 +42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 +142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 +412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 +--- Perform basic operation on master --- +--- and ensure replicated correctly --- +--- Update t1 on master -- +UPDATE t1 SET b1 = 0, bc='updated', t="2006-02-22" +WHERE id < 100 +ORDER BY id; +--- Check the update on master --- +SELECT * +FROM t1 +WHERE id < 100 +ORDER BY id; +id b1 vc bc d f total y t +2 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 +4 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 +42 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 +--- Check Update on slave --- +SELECT * +FROM t1 +WHERE id < 100 +ORDER BY id; +id b1 vc bc d f total +2 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 +4 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 +42 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 +--- Remove a record from t1 on master --- +DELETE FROM t1 WHERE id = 412; +--- Show current count on master for t1 --- +SELECT COUNT(*) FROM t1; +COUNT(*) +4 +--- Show current count on slave for t1 --- +SELECT COUNT(*) FROM t1; +COUNT(*) +4 +TRUNCATE TABLE t1; +TRUNCATE TABLE t1; +--- Do Cleanup -- +DROP TABLE IF EXISTS t1; + +=== NDB -> INNODB === + +SET storage_engine=innodb; +--- Doing pre test cleanup --- +DROP TABLE IF EXISTS t1; +--- Create Table Section --- +CREATE TABLE t1 (id MEDIUMINT NOT NULL, +b1 INT, +vc VARCHAR(255), +bc CHAR(255), +d DECIMAL(10,4) DEFAULT 0, +f FLOAT DEFAULT 0, +total BIGINT UNSIGNED, +y YEAR, +t DATE, +PRIMARY KEY(id)); +--- Show table on master --- +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` mediumint(9) NOT NULL, + `b1` int(11) DEFAULT NULL, + `vc` varchar(255) DEFAULT NULL, + `bc` char(255) DEFAULT NULL, + `d` decimal(10,4) DEFAULT '0.0000', + `f` float DEFAULT '0', + `total` bigint(20) unsigned DEFAULT NULL, + `y` year(4) DEFAULT NULL, + `t` date DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 +--- Show table on slave --- +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` mediumint(9) NOT NULL, + `b1` int(11) DEFAULT NULL, + `vc` varchar(255) DEFAULT NULL, + `bc` char(255) DEFAULT NULL, + `d` decimal(10,4) DEFAULT '0.0000', + `f` float DEFAULT '0', + `total` bigint(20) unsigned DEFAULT NULL, + `y` year(4) DEFAULT NULL, + `t` date DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +STOP SLAVE; +RESET SLAVE; +RESET MASTER; +START SLAVE; +--- Populate t1 with data --- +--- Select from t1 on master --- +select * +from t1 +order by id; +id b1 vc bc d f total y t +2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 +4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 +42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 +142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 +412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 +--- Select from t1 on slave --- +select * +from t1 +order by id; +id b1 vc bc d f total y t +2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 +4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 +42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 +142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 +412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 +--- Perform basic operation on master --- +--- and ensure replicated correctly --- +--- Update t1 on master -- +UPDATE t1 SET b1 = 0, bc='updated', t="2006-02-22" +WHERE id < 100 +ORDER BY id; +--- Check the update on master --- +SELECT * +FROM t1 +WHERE id < 100 +ORDER BY id; +id b1 vc bc d f total y t +2 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 +4 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 +42 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 +--- Check Update on slave --- +SELECT * +FROM t1 +WHERE id < 100 +ORDER BY id; +id b1 vc bc d f total y t +2 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 +4 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 +42 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 +--- Remove a record from t1 on master --- +DELETE FROM t1 WHERE id = 412; +--- Show current count on master for t1 --- +SELECT COUNT(*) FROM t1; +COUNT(*) +4 +--- Show current count on slave for t1 --- +SELECT COUNT(*) FROM t1; +COUNT(*) +4 +TRUNCATE TABLE t1; +--- Check that simple Alter statements are replicated correctly -- +ALTER TABLE t1 DROP PRIMARY KEY; +ALTER TABLE t1 MODIFY vc char(32); +--- Show the new improved table on the master --- +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` mediumint(9) NOT NULL, + `b1` int(11) DEFAULT NULL, + `vc` char(32) DEFAULT NULL, + `bc` char(255) DEFAULT NULL, + `d` decimal(10,4) DEFAULT '0.0000', + `f` float DEFAULT '0', + `total` bigint(20) unsigned DEFAULT NULL, + `y` year(4) DEFAULT NULL, + `t` date DEFAULT NULL +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 +--- Make sure that our tables on slave are still same engine --- +--- and that the alter statements replicated correctly --- +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` mediumint(9) NOT NULL, + `b1` int(11) DEFAULT NULL, + `vc` char(32) DEFAULT NULL, + `bc` char(255) DEFAULT NULL, + `d` decimal(10,4) DEFAULT '0.0000', + `f` float DEFAULT '0', + `total` bigint(20) unsigned DEFAULT NULL, + `y` year(4) DEFAULT NULL, + `t` date DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +STOP SLAVE; +RESET SLAVE; +RESET MASTER; +START SLAVE; +--- Populate t1 with data --- +--- Select from t1 on master --- +select * +from t1 +order by id; +id b1 vc bc d f total y t +2 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 +4 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 +42 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 +142 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 +412 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 +--- Select from t1 on slave --- +select * +from t1 +order by id; +id b1 vc bc d f total y t +2 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 +4 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 +42 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 +142 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 +412 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 +--- Perform basic operation on master --- +--- and ensure replicated correctly --- +--- Update t1 on master -- +UPDATE t1 SET b1 = 0, bc='updated', t="2006-02-22" +WHERE id < 100 +ORDER BY id; +--- Check the update on master --- +SELECT * +FROM t1 +WHERE id < 100 +ORDER BY id; +id b1 vc bc d f total y t +2 0 Testing MySQL databases is a coo updated 654321.4321 15.21 0 1965 2006-02-22 +4 0 Testing MySQL databases is a coo updated 654321.4321 15.21 0 1965 2006-02-22 +42 0 Testing MySQL databases is a coo updated 654321.4321 15.21 0 1965 2006-02-22 +--- Check Update on slave --- +SELECT * +FROM t1 +WHERE id < 100 +ORDER BY id; +id b1 vc bc d f total y t +2 0 Testing MySQL databases is a coo updated 654321.4321 15.21 0 1965 2006-02-22 +4 0 Testing MySQL databases is a coo updated 654321.4321 15.21 0 1965 2006-02-22 +42 0 Testing MySQL databases is a coo updated 654321.4321 15.21 0 1965 2006-02-22 +--- Remove a record from t1 on master --- +DELETE FROM t1 WHERE id = 412; +--- Show current count on master for t1 --- +SELECT COUNT(*) FROM t1; +COUNT(*) +4 +--- Show current count on slave for t1 --- +SELECT COUNT(*) FROM t1; +COUNT(*) +4 +TRUNCATE TABLE t1; +--- Check that replication works when slave has more columns than master +ALTER TABLE t1 ADD PRIMARY KEY(id,total); +ALTER TABLE t1 MODIFY vc TEXT; +INSERT INTO t1 VALUES(3,1,'Testing MySQL databases is a cool ', +'Must make it bug free for the customer', +654321.4321,15.21,0,1965,"1905-11-14"); +INSERT INTO t1 VALUES(20,1,'Testing MySQL databases is a cool ', +'Must make it bug free for the customer', +654321.4321,15.21,0,1965,"1965-11-14"); +INSERT INTO t1 VALUES(50,1,'Testing MySQL databases is a cool ', +'Must make it bug free for the customer', +654321.4321,15.21,0,1965,"1985-11-14"); +--- Add columns on slave --- +ALTER TABLE t1 ADD (u int, v char(16) default 'default'); +UPDATE t1 SET u=7 WHERE id < 50; +UPDATE t1 SET v='explicit' WHERE id >10; +--- Show changed table on slave --- +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` mediumint(9) NOT NULL, + `b1` int(11) DEFAULT NULL, + `vc` text, + `bc` char(255) DEFAULT NULL, + `d` decimal(10,4) DEFAULT '0.0000', + `f` float DEFAULT '0', + `total` bigint(20) unsigned NOT NULL DEFAULT '0', + `y` year(4) DEFAULT NULL, + `t` date DEFAULT NULL, + `u` int(11) DEFAULT NULL, + `v` char(16) DEFAULT 'default', + PRIMARY KEY (`id`,`total`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SELECT * +FROM t1 +ORDER BY id; +id b1 vc bc d f total y t u v +3 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 7 default +20 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 7 explicit +50 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 NULL explicit +STOP SLAVE; +RESET SLAVE; +RESET MASTER; +START SLAVE; +--- Populate t1 with data --- +--- Select from t1 on master --- +select * +from t1 +order by id; +id b1 vc bc d f total y t +2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 +3 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 +4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 +20 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 +42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 +50 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 +142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 +412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 +--- Select from t1 on slave --- +select * +from t1 +order by id; +id b1 vc bc d f total y t u v +2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 NULL default +3 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 7 default +4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 NULL default +20 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 7 explicit +42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 NULL default +50 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 NULL explicit +142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 NULL default +412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 NULL default +--- Perform basic operation on master --- +--- and ensure replicated correctly --- +--- Update t1 on master -- +UPDATE t1 SET b1 = 0, bc='updated', t="2006-02-22" +WHERE id < 100 +ORDER BY id; +--- Check the update on master --- +SELECT * +FROM t1 +WHERE id < 100 +ORDER BY id; +id b1 vc bc d f total y t +2 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 +3 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 +4 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 +20 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 +42 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 +50 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 +--- Check Update on slave --- +SELECT * +FROM t1 +WHERE id < 100 +ORDER BY id; +id b1 vc bc d f total y t u v +2 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 NULL default +3 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 7 default +4 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 NULL default +20 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 7 explicit +42 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 NULL default +50 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 NULL explicit +--- Remove a record from t1 on master --- +DELETE FROM t1 WHERE id = 412; +--- Show current count on master for t1 --- +SELECT COUNT(*) FROM t1; +COUNT(*) +7 +--- Show current count on slave for t1 --- +SELECT COUNT(*) FROM t1; +COUNT(*) +7 +TRUNCATE TABLE t1; +TRUNCATE TABLE t1; +--- Check that replication works when master has more columns than slave +--- Remove columns on slave --- +ALTER TABLE t1 DROP COLUMN v; +ALTER TABLE t1 DROP COLUMN u; +ALTER TABLE t1 DROP COLUMN t; +ALTER TABLE t1 DROP COLUMN y; +--- Show changed table on slave --- +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` mediumint(9) NOT NULL, + `b1` int(11) DEFAULT NULL, + `vc` text, + `bc` char(255) DEFAULT NULL, + `d` decimal(10,4) DEFAULT '0.0000', + `f` float DEFAULT '0', + `total` bigint(20) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`id`,`total`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +STOP SLAVE; +RESET SLAVE; +RESET MASTER; +START SLAVE; +--- Populate t1 with data --- +--- Select from t1 on master --- +select * +from t1 +order by id; +id b1 vc bc d f total y t +2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 +4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 +42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 +142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 +412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 +--- Select from t1 on slave --- +select * +from t1 +order by id; +id b1 vc bc d f total +2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 +4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 +42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 +142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 +412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 +--- Perform basic operation on master --- +--- and ensure replicated correctly --- +--- Update t1 on master -- +UPDATE t1 SET b1 = 0, bc='updated', t="2006-02-22" +WHERE id < 100 +ORDER BY id; +--- Check the update on master --- +SELECT * +FROM t1 +WHERE id < 100 +ORDER BY id; +id b1 vc bc d f total y t +2 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 +4 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 +42 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 +--- Check Update on slave --- +SELECT * +FROM t1 +WHERE id < 100 +ORDER BY id; +id b1 vc bc d f total +2 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 +4 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 +42 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 +--- Remove a record from t1 on master --- +DELETE FROM t1 WHERE id = 412; +--- Show current count on master for t1 --- +SELECT COUNT(*) FROM t1; +COUNT(*) +4 +--- Show current count on slave for t1 --- +SELECT COUNT(*) FROM t1; +COUNT(*) +4 +TRUNCATE TABLE t1; +TRUNCATE TABLE t1; +--- Do Cleanup -- +DROP TABLE IF EXISTS t1; + +=== NDB -> NDB === + +SET storage_engine=ndb; +--- Doing pre test cleanup --- +DROP TABLE IF EXISTS t1; +--- Create Table Section --- +CREATE TABLE t1 (id MEDIUMINT NOT NULL, +b1 INT, +vc VARCHAR(255), +bc CHAR(255), +d DECIMAL(10,4) DEFAULT 0, +f FLOAT DEFAULT 0, +total BIGINT UNSIGNED, +y YEAR, +t DATE, +PRIMARY KEY(id)); +--- Show table on master --- +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` mediumint(9) NOT NULL, + `b1` int(11) DEFAULT NULL, + `vc` varchar(255) DEFAULT NULL, + `bc` char(255) DEFAULT NULL, + `d` decimal(10,4) DEFAULT '0.0000', + `f` float DEFAULT '0', + `total` bigint(20) unsigned DEFAULT NULL, + `y` year(4) DEFAULT NULL, + `t` date DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 +--- Show table on slave --- +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` mediumint(9) NOT NULL, + `b1` int(11) DEFAULT NULL, + `vc` varchar(255) DEFAULT NULL, + `bc` char(255) DEFAULT NULL, + `d` decimal(10,4) DEFAULT '0.0000', + `f` float DEFAULT '0', + `total` bigint(20) unsigned DEFAULT NULL, + `y` year(4) DEFAULT NULL, + `t` date DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +STOP SLAVE; +RESET SLAVE; +RESET MASTER; +START SLAVE; +--- Populate t1 with data --- +--- Select from t1 on master --- +select * +from t1 +order by id; +id b1 vc bc d f total y t +2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 +4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 +42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 +142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 +412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 +--- Select from t1 on slave --- +select * +from t1 +order by id; +id b1 vc bc d f total y t +2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 +4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 +42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 +142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 +412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 +--- Perform basic operation on master --- +--- and ensure replicated correctly --- +--- Update t1 on master -- +UPDATE t1 SET b1 = 0, bc='updated', t="2006-02-22" +WHERE id < 100 +ORDER BY id; +--- Check the update on master --- +SELECT * +FROM t1 +WHERE id < 100 +ORDER BY id; +id b1 vc bc d f total y t +2 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 +4 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 +42 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 +--- Check Update on slave --- +SELECT * +FROM t1 +WHERE id < 100 +ORDER BY id; +id b1 vc bc d f total y t +2 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 +4 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 +42 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 +--- Remove a record from t1 on master --- +DELETE FROM t1 WHERE id = 412; +--- Show current count on master for t1 --- +SELECT COUNT(*) FROM t1; +COUNT(*) +4 +--- Show current count on slave for t1 --- +SELECT COUNT(*) FROM t1; +COUNT(*) +4 +TRUNCATE TABLE t1; +--- Check that simple Alter statements are replicated correctly -- +ALTER TABLE t1 DROP PRIMARY KEY; +ALTER TABLE t1 MODIFY vc char(32); +--- Show the new improved table on the master --- +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` mediumint(9) NOT NULL, + `b1` int(11) DEFAULT NULL, + `vc` char(32) DEFAULT NULL, + `bc` char(255) DEFAULT NULL, + `d` decimal(10,4) DEFAULT '0.0000', + `f` float DEFAULT '0', + `total` bigint(20) unsigned DEFAULT NULL, + `y` year(4) DEFAULT NULL, + `t` date DEFAULT NULL +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 +--- Make sure that our tables on slave are still same engine --- +--- and that the alter statements replicated correctly --- +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` mediumint(9) NOT NULL, + `b1` int(11) DEFAULT NULL, + `vc` char(32) DEFAULT NULL, + `bc` char(255) DEFAULT NULL, + `d` decimal(10,4) DEFAULT '0.0000', + `f` float DEFAULT '0', + `total` bigint(20) unsigned DEFAULT NULL, + `y` year(4) DEFAULT NULL, + `t` date DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +STOP SLAVE; +RESET SLAVE; +RESET MASTER; +START SLAVE; +--- Populate t1 with data --- +--- Select from t1 on master --- +select * +from t1 +order by id; +id b1 vc bc d f total y t +2 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 +4 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 +42 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 +142 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 +412 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 +--- Select from t1 on slave --- +select * +from t1 +order by id; +id b1 vc bc d f total y t +2 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 +4 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 +42 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 +142 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 +412 1 Testing MySQL databases is a coo Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 +--- Perform basic operation on master --- +--- and ensure replicated correctly --- +--- Update t1 on master -- +UPDATE t1 SET b1 = 0, bc='updated', t="2006-02-22" +WHERE id < 100 +ORDER BY id; +--- Check the update on master --- +SELECT * +FROM t1 +WHERE id < 100 +ORDER BY id; +id b1 vc bc d f total y t +2 0 Testing MySQL databases is a coo updated 654321.4321 15.21 0 1965 2006-02-22 +4 0 Testing MySQL databases is a coo updated 654321.4321 15.21 0 1965 2006-02-22 +42 0 Testing MySQL databases is a coo updated 654321.4321 15.21 0 1965 2006-02-22 +--- Check Update on slave --- +SELECT * +FROM t1 +WHERE id < 100 +ORDER BY id; +id b1 vc bc d f total y t +2 0 Testing MySQL databases is a coo updated 654321.4321 15.21 0 1965 2006-02-22 +4 0 Testing MySQL databases is a coo updated 654321.4321 15.21 0 1965 2006-02-22 +42 0 Testing MySQL databases is a coo updated 654321.4321 15.21 0 1965 2006-02-22 +--- Remove a record from t1 on master --- +DELETE FROM t1 WHERE id = 412; +--- Show current count on master for t1 --- +SELECT COUNT(*) FROM t1; +COUNT(*) +4 +--- Show current count on slave for t1 --- +SELECT COUNT(*) FROM t1; +COUNT(*) +4 +TRUNCATE TABLE t1; +--- Check that replication works when slave has more columns than master +ALTER TABLE t1 ADD PRIMARY KEY(id,total); +ALTER TABLE t1 MODIFY vc TEXT; +INSERT INTO t1 VALUES(3,1,'Testing MySQL databases is a cool ', +'Must make it bug free for the customer', +654321.4321,15.21,0,1965,"1905-11-14"); +INSERT INTO t1 VALUES(20,1,'Testing MySQL databases is a cool ', +'Must make it bug free for the customer', +654321.4321,15.21,0,1965,"1965-11-14"); +INSERT INTO t1 VALUES(50,1,'Testing MySQL databases is a cool ', +'Must make it bug free for the customer', +654321.4321,15.21,0,1965,"1985-11-14"); +--- Add columns on slave --- +ALTER TABLE t1 ADD (u int, v char(16) default 'default'); +UPDATE t1 SET u=7 WHERE id < 50; +UPDATE t1 SET v='explicit' WHERE id >10; +--- Show changed table on slave --- +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` mediumint(9) NOT NULL, + `b1` int(11) DEFAULT NULL, + `vc` text, + `bc` char(255) DEFAULT NULL, + `d` decimal(10,4) DEFAULT '0.0000', + `f` float DEFAULT '0', + `total` bigint(20) unsigned NOT NULL DEFAULT '0', + `y` year(4) DEFAULT NULL, + `t` date DEFAULT NULL, + `u` int(11) DEFAULT NULL, + `v` char(16) DEFAULT 'default', + PRIMARY KEY (`id`,`total`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SELECT * +FROM t1 +ORDER BY id; +id b1 vc bc d f total y t u v +3 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 7 default +20 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 7 explicit +50 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 NULL explicit +STOP SLAVE; +RESET SLAVE; +RESET MASTER; +START SLAVE; +--- Populate t1 with data --- +--- Select from t1 on master --- +select * +from t1 +order by id; +id b1 vc bc d f total y t +2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 +3 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 +4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 +20 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 +42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 +50 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 +142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 +412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 +--- Select from t1 on slave --- +select * +from t1 +order by id; +id b1 vc bc d f total y t u v +2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 NULL default +3 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 7 default +4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 NULL default +20 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 7 explicit +42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 NULL default +50 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 NULL explicit +142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 NULL default +412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 NULL default +--- Perform basic operation on master --- +--- and ensure replicated correctly --- +--- Update t1 on master -- +UPDATE t1 SET b1 = 0, bc='updated', t="2006-02-22" +WHERE id < 100 +ORDER BY id; +--- Check the update on master --- +SELECT * +FROM t1 +WHERE id < 100 +ORDER BY id; +id b1 vc bc d f total y t +2 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 +3 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 +4 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 +20 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 +42 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 +50 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 +--- Check Update on slave --- +SELECT * +FROM t1 +WHERE id < 100 +ORDER BY id; +id b1 vc bc d f total y t u v +2 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 NULL default +3 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 7 default +4 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 NULL default +20 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 7 explicit +42 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 NULL default +50 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 NULL explicit +--- Remove a record from t1 on master --- +DELETE FROM t1 WHERE id = 412; +--- Show current count on master for t1 --- +SELECT COUNT(*) FROM t1; +COUNT(*) +7 +--- Show current count on slave for t1 --- +SELECT COUNT(*) FROM t1; +COUNT(*) +7 +TRUNCATE TABLE t1; +TRUNCATE TABLE t1; +--- Check that replication works when master has more columns than slave +--- Remove columns on slave --- +ALTER TABLE t1 DROP COLUMN v; +ALTER TABLE t1 DROP COLUMN u; +ALTER TABLE t1 DROP COLUMN t; +ALTER TABLE t1 DROP COLUMN y; +--- Show changed table on slave --- +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` mediumint(9) NOT NULL, + `b1` int(11) DEFAULT NULL, + `vc` text, + `bc` char(255) DEFAULT NULL, + `d` decimal(10,4) DEFAULT '0.0000', + `f` float DEFAULT '0', + `total` bigint(20) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`id`,`total`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +STOP SLAVE; +RESET SLAVE; +RESET MASTER; +START SLAVE; +--- Populate t1 with data --- +--- Select from t1 on master --- +select * +from t1 +order by id; +id b1 vc bc d f total y t +2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 +4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 +42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 +142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 +412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 +--- Select from t1 on slave --- +select * +from t1 +order by id; +id b1 vc bc d f total +2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 +4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 +42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 +142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 +412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 +--- Perform basic operation on master --- +--- and ensure replicated correctly --- +--- Update t1 on master -- +UPDATE t1 SET b1 = 0, bc='updated', t="2006-02-22" +WHERE id < 100 +ORDER BY id; +--- Check the update on master --- +SELECT * +FROM t1 +WHERE id < 100 +ORDER BY id; +id b1 vc bc d f total y t +2 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 +4 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 +42 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 1965 2006-02-22 +--- Check Update on slave --- +SELECT * +FROM t1 +WHERE id < 100 +ORDER BY id; +id b1 vc bc d f total +2 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 +4 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 +42 0 Testing MySQL databases is a cool updated 654321.4321 15.21 0 +--- Remove a record from t1 on master --- +DELETE FROM t1 WHERE id = 412; +--- Show current count on master for t1 --- +SELECT COUNT(*) FROM t1; +COUNT(*) +4 +--- Show current count on slave for t1 --- +SELECT COUNT(*) FROM t1; +COUNT(*) +4 +TRUNCATE TABLE t1; +TRUNCATE TABLE t1; +--- Do Cleanup -- +DROP TABLE IF EXISTS t1; diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_2other-slave.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_2other-slave.opt new file mode 100644 index 00000000000..a6c65034e68 --- /dev/null +++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_2other-slave.opt @@ -0,0 +1 @@ +--innodb --log-slave-updates=0 diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_2other.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_2other.test new file mode 100644 index 00000000000..736e2cadf78 --- /dev/null +++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_2other.test @@ -0,0 +1,35 @@ +############################################################# +# Author: Rafal Somla +# Date: 2006-08-20 +# Purpose: Trying to test ability to replicate from cluster +# to other engines (innodb, myisam). +############################################################## +--source include/have_ndb.inc +--source include/have_innodb.inc +--source include/have_binlog_format_mixed_or_row.inc +--source include/master-slave.inc + +# On master use NDB as storage engine. +connection master; +SET storage_engine=ndb; + +--echo +--echo === NDB -> MYISAM === +--echo +connection slave; +SET storage_engine=myisam; +--source extra/rpl_tests/rpl_ndb_2multi_basic.test + +--echo +--echo === NDB -> INNODB === +--echo +connection slave; +SET storage_engine=innodb; +--source extra/rpl_tests/rpl_ndb_2multi_basic.test + +--echo +--echo === NDB -> NDB === +--echo +connection slave; +SET storage_engine=ndb; +--source extra/rpl_tests/rpl_ndb_2multi_basic.test diff --git a/sql/log_event.cc b/sql/log_event.cc index f71d1bb3622..9f3b4c4e487 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -5654,13 +5654,14 @@ Rows_log_event::Rows_log_event(THD *thd_arg, TABLE *tbl_arg, ulong tid, m_table_id(tid), m_width(tbl_arg ? tbl_arg->s->fields : 1), m_rows_buf(0), m_rows_cur(0), m_rows_end(0), - m_flags(0) + m_curr_row(NULL), m_curr_row_end(NULL), + m_flags(0), m_key(NULL) { /* We allow a special form of dummy event when the table, and cols are null and the table id is ~0UL. This is a temporary solution, to be able to terminate a started statement in the - binary log: the extreneous events will be removed in the future. + binary log: the extraneous events will be removed in the future. */ DBUG_ASSERT(tbl_arg && tbl_arg->s && tid != ~0UL || !tbl_arg && !cols && tid == ~0UL); @@ -5669,7 +5670,7 @@ Rows_log_event::Rows_log_event(THD *thd_arg, TABLE *tbl_arg, ulong tid, set_flags(NO_FOREIGN_KEY_CHECKS_F); if (thd_arg->options & OPTION_RELAXED_UNIQUE_CHECKS) set_flags(RELAXED_UNIQUE_CHECKS_F); - /* if bitmap_init fails, catched in is_valid() */ + /* if bitmap_init fails, caught in is_valid() */ if (likely(!bitmap_init(&m_cols, m_width <= sizeof(m_bitbuf)*8 ? m_bitbuf : NULL, m_width, @@ -5696,7 +5697,10 @@ Rows_log_event::Rows_log_event(const char *buf, uint event_len, *description_event) : Log_event(buf, description_event), m_row_count(0), - m_rows_buf(0), m_rows_cur(0), m_rows_end(0) + m_table(NULL), + m_rows_buf(0), m_rows_cur(0), m_rows_end(0), + m_curr_row(NULL), m_curr_row_end(NULL), + m_key(NULL) { DBUG_ENTER("Rows_log_event::Rows_log_event(const char*,...)"); uint8 const common_header_len= description_event->common_header_len; @@ -5755,7 +5759,7 @@ Rows_log_event::Rows_log_event(const char *buf, uint event_len, { DBUG_PRINT("debug", ("Reading from %p", ptr_after_width)); - /* if bitmap_init fails, catched in is_valid() */ + /* if bitmap_init fails, caught in is_valid() */ if (likely(!bitmap_init(&m_cols_ai, m_width <= sizeof(m_bitbuf_ai)*8 ? m_bitbuf_ai : NULL, m_width, @@ -5785,6 +5789,7 @@ Rows_log_event::Rows_log_event(const char *buf, uint event_len, m_rows_buf= (uchar*) my_malloc(data_size, MYF(MY_WME)); if (likely((bool)m_rows_buf)) { + m_curr_row= m_rows_buf; m_rows_end= m_rows_buf + data_size; m_rows_cur= m_rows_end; memcpy(m_rows_buf, ptr_rows_data, data_size); @@ -5889,7 +5894,6 @@ int Rows_log_event::do_apply_event(RELAY_LOG_INFO const *rli) { DBUG_ENTER("Rows_log_event::do_apply_event(st_relay_log_info*)"); int error= 0; - uchar const *row_start= m_rows_buf; /* If m_table_id == ~0UL, then we have a dummy event that does not @@ -6049,7 +6053,9 @@ int Rows_log_event::do_apply_event(RELAY_LOG_INFO const *rli) #endif } - TABLE* table= const_cast(rli)->m_table_map.get_table(m_table_id); + TABLE* + table= + m_table= const_cast(rli)->m_table_map.get_table(m_table_id); if (table) { @@ -6096,22 +6102,41 @@ int Rows_log_event::do_apply_event(RELAY_LOG_INFO const *rli) */ const_cast(rli)->set_flag(RELAY_LOG_INFO::IN_STMT); - error= do_before_row_operations(table); - while (error == 0 && row_start < m_rows_end) + if ( m_width == table->s->fields && bitmap_is_set_all(&m_cols)) + set_flags(COMPLETE_ROWS_F); + + /* + Set tables write and read sets. + + Read_set contains all slave columns (in case we are going to fetch + a complete record from slave) + + Write_set equals the m_cols bitmap sent from master but it can be + longer if slave has extra columns. + */ + + DBUG_PRINT_BITSET("debug", "Setting table's write_set from: %s", &m_cols); + + bitmap_set_all(table->read_set); + bitmap_set_all(table->write_set); + if (!get_flags(COMPLETE_ROWS_F)) + bitmap_intersect(table->write_set,&m_cols); + + // Do event specific preparations + + error= do_before_row_operations(rli); + + // row processing loop + + while (error == 0 && m_curr_row < m_rows_end) { - uchar const *row_end= NULL; - if ((error= do_prepare_row(thd, rli, table, row_start, &row_end))) - break; // We should perform the after-row operation even in - // the case of error - - DBUG_ASSERT(row_end != NULL); // cannot happen - DBUG_ASSERT(row_end <= m_rows_end); - /* in_use can have been set to NULL in close_tables_for_reopen */ THD* old_thd= table->in_use; if (!table->in_use) table->in_use= thd; - error= do_exec_row(table); + + error= do_exec_row(rli); + table->in_use = old_thd; switch (error) { @@ -6132,21 +6157,38 @@ int Rows_log_event::do_apply_event(RELAY_LOG_INFO const *rli) break; } - row_start= row_end; - } + /* + If m_curr_row_end was not set during event execution (e.g., because + of errors) we can't proceed to the next row. If the error is transient + (i.e., error==0 at this point) we must call unpack_current_row() to set + m_curr_row_end. + */ + + if (!m_curr_row_end && !error) + unpack_current_row(rli); + + // at this moment m_curr_row_end should be set + DBUG_ASSERT(error || m_curr_row_end != NULL); + DBUG_ASSERT(error || m_curr_row < m_curr_row_end); + DBUG_ASSERT(error || m_curr_row_end <= m_rows_end); + + m_curr_row= m_curr_row_end; + + } // row processing loop + DBUG_EXECUTE_IF("STOP_SLAVE_after_first_Rows_event", const_cast(rli)->abort_slave= 1;); - error= do_after_row_operations(table, error); + error= do_after_row_operations(rli, error); if (!cache_stmt) { DBUG_PRINT("info", ("Marked that we need to keep log")); thd->options|= OPTION_KEEP_LOG; } - } + } // if (table) /* - We need to delay this clear until the table def is no longer needed. - The table def is needed in unpack_row(). + We need to delay this clear until the table def stored in m_table_def is no + longer needed. It is used in unpack_current_row(). */ if (rli->tables_to_lock && get_flags(STMT_END_F)) const_cast(rli)->clear_tables_to_lock(); @@ -6199,7 +6241,7 @@ int Rows_log_event::do_apply_event(RELAY_LOG_INFO const *rli) wait (reached end of last relay log and nothing gets appended there), we timeout after one minute, and notify DBA about the problem. When WL#2975 is implemented, just remove the member - st_relay_log_info::last_event_start_time and all its occurences. + st_relay_log_info::last_event_start_time and all its occurrences. */ const_cast(rli)->last_event_start_time= my_time(0); } @@ -6603,7 +6645,7 @@ Table_map_log_event::Table_map_log_event(THD *thd, TABLE *tbl, ulong tid, else m_data_size+= m_field_metadata_size + 1; - /* If malloc fails, catched in is_valid() */ + /* If malloc fails, caught in is_valid() */ if ((m_memory= (uchar*) my_malloc(m_colcnt, MYF(MY_WME)))) { m_coltype= reinterpret_cast(m_memory); @@ -6708,7 +6750,7 @@ Table_map_log_event::Table_map_log_event(const char *buf, uint event_len, (ulong) m_tbllen, (long) (ptr_tbllen-(const uchar*)vpart), m_colcnt, (long) (ptr_colcnt-(const uchar*)vpart))); - /* Allocate mem for all fields in one go. If fails, catched in is_valid() */ + /* Allocate mem for all fields in one go. If fails, caught in is_valid() */ m_memory= (uchar*) my_multi_malloc(MYF(MY_WME), &m_dbnam, (uint) m_dblen + 1, &m_tblnam, (uint) m_tbllen + 1, @@ -7034,7 +7076,8 @@ Write_rows_log_event::Write_rows_log_event(const char *buf, uint event_len, #endif #if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) -int Write_rows_log_event::do_before_row_operations(TABLE *table) +int +Write_rows_log_event::do_before_row_operations(const Slave_reporting_capability *const) { int error= 0; @@ -7056,26 +7099,26 @@ int Write_rows_log_event::do_before_row_operations(TABLE *table) /* Do not raise the error flag in case of hitting to an unique attribute */ - table->file->extra(HA_EXTRA_IGNORE_DUP_KEY); + m_table->file->extra(HA_EXTRA_IGNORE_DUP_KEY); /* NDB specific: update from ndb master wrapped as Write_rows */ /* so that the event should be applied to replace slave's row */ - table->file->extra(HA_EXTRA_WRITE_CAN_REPLACE); + m_table->file->extra(HA_EXTRA_WRITE_CAN_REPLACE); /* NDB specific: if update from ndb master wrapped as Write_rows does not find the row it's assumed idempotent binlog applying is taking place; don't raise the error. */ - table->file->extra(HA_EXTRA_IGNORE_NO_KEY); + m_table->file->extra(HA_EXTRA_IGNORE_NO_KEY); /* TODO: the cluster team (Tomas?) says that it's better if the engine knows how many rows are going to be inserted, then it can allocate needed memory from the start. */ - table->file->ha_start_bulk_insert(0); + m_table->file->ha_start_bulk_insert(0); /* We need TIMESTAMP_NO_AUTO_SET otherwise ha_write_row() will not use fill any TIMESTAMP column with data from the row but instead will use @@ -7091,47 +7134,31 @@ int Write_rows_log_event::do_before_row_operations(TABLE *table) some cases we won't want TIMESTAMP_NO_AUTO_SET (will require some code to analyze if explicit data is provided for slave's TIMESTAMP columns). */ - table->timestamp_field_type= TIMESTAMP_NO_AUTO_SET; + m_table->timestamp_field_type= TIMESTAMP_NO_AUTO_SET; return error; } -int Write_rows_log_event::do_after_row_operations(TABLE *table, int error) +int +Write_rows_log_event::do_after_row_operations(const Slave_reporting_capability *const, + int error) { int local_error= 0; - table->file->extra(HA_EXTRA_NO_IGNORE_DUP_KEY); - table->file->extra(HA_EXTRA_WRITE_CANNOT_REPLACE); + m_table->file->extra(HA_EXTRA_NO_IGNORE_DUP_KEY); + m_table->file->extra(HA_EXTRA_WRITE_CANNOT_REPLACE); /* reseting the extra with table->file->extra(HA_EXTRA_NO_IGNORE_NO_KEY); fires bug#27077 todo: explain or fix */ - if ((local_error= table->file->ha_end_bulk_insert())) + if ((local_error= m_table->file->ha_end_bulk_insert())) { - table->file->print_error(local_error, MYF(0)); + m_table->file->print_error(local_error, MYF(0)); } return error? error : local_error; } - -int Write_rows_log_event::do_prepare_row(THD *thd_arg, - RELAY_LOG_INFO const *rli, - TABLE *table, - uchar const *const row_start, - uchar const **const row_end) -{ - DBUG_ASSERT(table != NULL); - DBUG_ASSERT(row_start && row_end); - - if (int error= unpack_row(rli, table, m_width, row_start, &m_cols, row_end, - &m_master_reclength, table->write_set, WRITE_ROWS_EVENT)) - { - thd_arg->net.last_errno= error; - return error; - } - bitmap_copy(table->read_set, table->write_set); - return 0; -} +#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) /* Check if there are more UNIQUE keys after the given key. @@ -7145,135 +7172,6 @@ last_uniq_key(TABLE *table, uint keyno) return 1; } -/* Anonymous namespace for template functions/classes */ -namespace { - - /* - Smart pointer that will automatically call my_afree (a macro) when - the pointer goes out of scope. This is used so that I do not have - to remember to call my_afree() before each return. There is no - overhead associated with this, since all functions are inline. - - I (Matz) would prefer to use the free function as a template - parameter, but that is not possible when the "function" is a - macro. - */ - template - class auto_afree_ptr - { - Obj* m_ptr; - public: - auto_afree_ptr(Obj* ptr) : m_ptr(ptr) { } - ~auto_afree_ptr() { if (m_ptr) my_afree(m_ptr); } - void assign(Obj* ptr) { - /* Only to be called if it hasn't been given a value before. */ - DBUG_ASSERT(m_ptr == NULL); - m_ptr= ptr; - } - Obj* get() { return m_ptr; } - }; - -} - - -/* - Copy "extra" columns from record[1] to record[0]. - - Copy the extra fields that are not present on the master but are - present on the slave from record[1] to record[0]. This is used - after fetching a record that are to be updated, either inside - replace_record() or as part of executing an update_row(). - */ -static int -copy_extra_record_fields(TABLE *table, - size_t master_reclength, - my_ptrdiff_t master_fields) -{ - DBUG_ENTER("copy_extra_record_fields(table, master_reclen, master_fields)"); - DBUG_PRINT("info", ("Copying to 0x%lx " - "from field %lu at offset %lu " - "to field %d at offset %lu", - (long) table->record[0], - (ulong) master_fields, (ulong) master_reclength, - table->s->fields, table->s->reclength)); - /* - Copying the extra fields of the slave that does not exist on - master into record[0] (which are basically the default values). - */ - - if (table->s->fields < (uint) master_fields) - DBUG_RETURN(0); - - DBUG_ASSERT(master_reclength <= table->s->reclength); - if (master_reclength < table->s->reclength) - bmove_align(table->record[0] + master_reclength, - table->record[1] + master_reclength, - table->s->reclength - master_reclength); - - /* - Bit columns are special. We iterate over all the remaining - columns and copy the "extra" bits to the new record. This is - not a very good solution: it should be refactored on - opportunity. - - REFACTORING SUGGESTION (Matz). Introduce a member function - similar to move_field_offset() called copy_field_offset() to - copy field values and implement it for all Field subclasses. Use - this function to copy data from the found record to the record - that are going to be inserted. - - The copy_field_offset() function need to be a virtual function, - which in this case will prevent copying an entire range of - fields efficiently. - */ - { - Field **field_ptr= table->field + master_fields; - for ( ; *field_ptr ; ++field_ptr) - { - /* - Set the null bit according to the values in record[1] - */ - if ((*field_ptr)->maybe_null() && - (*field_ptr)->is_null_in_record(reinterpret_cast(table->record[1]))) - (*field_ptr)->set_null(); - else - (*field_ptr)->set_notnull(); - - /* - Do the extra work for special columns. - */ - switch ((*field_ptr)->real_type()) - { - default: - /* Nothing to do */ - break; - - case MYSQL_TYPE_BIT: - Field_bit *f= static_cast(*field_ptr); - if (f->bit_len > 0) - { - my_ptrdiff_t const offset= table->record[1] - table->record[0]; - uchar const bits= - get_rec_bits(f->bit_ptr + offset, f->bit_ofs, f->bit_len); - set_rec_bits(bits, f->bit_ptr, f->bit_ofs, f->bit_len); - } - break; - } - } - } - DBUG_RETURN(0); // All OK -} - -#define DBUG_PRINT_BITSET(N,FRM,BS) \ - do { \ - char buf[256]; \ - for (uint i = 0 ; i < (BS)->n_bits ; ++i) \ - buf[i] = bitmap_is_set((BS), i) ? '1' : '0'; \ - buf[(BS)->n_bits] = '\0'; \ - DBUG_PRINT((N), ((FRM), buf)); \ - } while (0) - - /** Check if an error is a duplicate key error. @@ -7299,45 +7197,76 @@ is_duplicate_key_error(int errcode) return false; } +/** + Write the current row into event's table. -/* - Replace the provided record in the database. + The row is located in the row buffer, pointed by @c m_curr_row member. + Number of columns of the row is stored in @c m_width member (it can be + different from the number of columns in the table to which we insert). + Bitmap @c m_cols indicates which columns are present in the row. It is assumed + that event's table is already open and pointed by @c m_table. - SYNOPSIS - replace_record() - thd Thread context for writing the record. - table Table to which record should be written. - master_reclength - Offset to first column that is not present on the master, - alternatively the length of the record on the master - side. + If the same record already exists in the table it can be either overwritten + or an error is reported depending on the value of @c overwrite flag + (error reporting not yet implemented). Note that the matching record can be + different from the row we insert if we use primary keys to identify records in + the table. - RETURN VALUE - Error code on failure, 0 on success. + The row to be inserted can contain values only for selected columns. The + missing columns are filled with default values using @c prepare_record() + function. If a matching record is found in the table and @c overwritte is + true, the missing columns are taken from it. - DESCRIPTION - Similar to how it is done in mysql_insert(), we first try to do - a ha_write_row() and of that fails due to duplicated keys (or - indices), we do an ha_update_row() or a ha_delete_row() instead. - */ -static int -replace_record(THD *thd, TABLE *table, - ulong const master_reclength, - uint const master_fields) + @param rli Relay log info (needed for row unpacking). + @param overwrite + Shall we overwrite if the row already exists or signal + error (currently ignored). + + @returns Error code on failure, 0 on success. + + This method, if successful, sets @c m_curr_row_end pointer to point at the + next row in the rows buffer. This is done when unpacking the row to be + inserted. + + @note If a matching record is found, it is either updated using + @c ha_update_row() or first deleted and then new record written. +*/ + +int +Rows_log_event::write_row(const RELAY_LOG_INFO *const rli, + const bool overwrite) { - DBUG_ENTER("replace_record"); - DBUG_ASSERT(table != NULL && thd != NULL); + DBUG_ENTER("write_row"); + DBUG_ASSERT(m_table != NULL && thd != NULL); + TABLE *table= m_table; // pointer to event's table int error; int keynum; auto_afree_ptr key(NULL); + /* fill table->record[0] with default values */ + + if ((error= prepare_record(rli, table, m_width, + TRUE /* check if columns have def. values */))) + DBUG_RETURN(error); + + /* unpack row into table->record[0] */ + error= unpack_current_row(rli); // TODO: how to handle errors? + #ifndef DBUG_OFF DBUG_DUMP("record[0]", table->record[0], table->s->reclength); DBUG_PRINT_BITSET("debug", "write_set = %s", table->write_set); DBUG_PRINT_BITSET("debug", "read_set = %s", table->read_set); #endif + /* + Try to write record. If a corresponding record already exists in the table, + we try to change it using ha_update_row() if possible. Otherwise we delete + it and repeat the whole process again. + + TODO: Add safety measures against infinite looping. + */ + while ((error= table->file->ha_write_row(table->record[0]))) { if (error == HA_ERR_LOCK_DEADLOCK || error == HA_ERR_LOCK_WAIT_TIMEOUT) @@ -7347,6 +7276,7 @@ replace_record(THD *thd, TABLE *table, } if ((keynum= table->file->get_dup_key(error)) < 0) { + DBUG_PRINT("info",("Can't locate duplicate key (get_dup_key returns %d)",keynum)); table->file->print_error(error, MYF(0)); /* We failed to retrieve the duplicate key @@ -7368,17 +7298,22 @@ replace_record(THD *thd, TABLE *table, */ if (table->file->ha_table_flags() & HA_DUPLICATE_POS) { + DBUG_PRINT("info",("Locating offending record using rnd_pos()")); error= table->file->rnd_pos(table->record[1], table->file->dup_ref); if (error) { + DBUG_PRINT("info",("rnd_pos() returns error %d",error)); table->file->print_error(error, MYF(0)); DBUG_RETURN(error); } } else { + DBUG_PRINT("info",("Locating offending record using index_read_idx()")); + if (table->file->extra(HA_EXTRA_FLUSH_CACHE)) { + DBUG_PRINT("info",("Error when setting HA_EXTRA_FLUSH_CACHE")); DBUG_RETURN(my_errno); } @@ -7386,7 +7321,10 @@ replace_record(THD *thd, TABLE *table, { key.assign(static_cast(my_alloca(table->s->max_unique_length))); if (key.get() == NULL) + { + DBUG_PRINT("info",("Can't allocate key buffer")); DBUG_RETURN(ENOMEM); + } } key_copy((uchar*)key.get(), table->record[0], table->key_info + keynum, @@ -7397,20 +7335,33 @@ replace_record(THD *thd, TABLE *table, HA_READ_KEY_EXACT); if (error) { + DBUG_PRINT("info",("index_read_idx() returns error %d",error)); table->file->print_error(error, MYF(0)); DBUG_RETURN(error); } } /* - Now, table->record[1] should contain the offending row. That + Now, record[1] should contain the offending row. That will enable us to update it or, alternatively, delete it (so that we can insert the new row afterwards). + */ - First we copy the columns into table->record[0] that are not - present on the master from table->record[1], if there are any. + /* + If row is incomplete we will use the record found to fill + missing columns. */ - copy_extra_record_fields(table, master_reclength, master_fields); + if (!get_flags(COMPLETE_ROWS_F)) + { + restore_record(table,record[1]); + error= unpack_current_row(rli); + } + +#ifndef DBUG_OFF + DBUG_PRINT("debug",("preparing for update: before and after image")); + DBUG_DUMP("record[1] (before)", table->record[1], table->s->reclength); + DBUG_DUMP("record[0] (after)", table->record[0], table->s->reclength); +#endif /* REPLACE is defined as either INSERT or DELETE + INSERT. If @@ -7430,18 +7381,32 @@ replace_record(THD *thd, TABLE *table, if (last_uniq_key(table, keynum) && !table->file->referenced_by_foreign_key()) { + DBUG_PRINT("info",("Updating row using ha_update_row()")); error=table->file->ha_update_row(table->record[1], table->record[0]); - if (error && error != HA_ERR_RECORD_IS_THE_SAME) - table->file->print_error(error, MYF(0)); - else + switch (error) { + + case HA_ERR_RECORD_IS_THE_SAME: + DBUG_PRINT("info",("ignoring HA_ERR_RECORD_IS_THE_SAME error from" + " ha_update_row()")); error= 0; + + case 0: + break; + + default: + DBUG_PRINT("info",("ha_update_row() returns error %d",error)); + table->file->print_error(error, MYF(0)); + } + DBUG_RETURN(error); } else { + DBUG_PRINT("info",("Deleting offending row and trying to write new one again")); if ((error= table->file->ha_delete_row(table->record[1]))) { + DBUG_PRINT("info",("ha_delete_row() returns error %d",error)); table->file->print_error(error, MYF(0)); DBUG_RETURN(error); } @@ -7452,12 +7417,20 @@ replace_record(THD *thd, TABLE *table, DBUG_RETURN(error); } -int Write_rows_log_event::do_exec_row(TABLE *table) +#endif + +int +Write_rows_log_event::do_exec_row(const RELAY_LOG_INFO *const rli) { - DBUG_ASSERT(table != NULL); - int error= replace_record(thd, table, m_master_reclength, m_width); - return error; + DBUG_ASSERT(m_table != NULL); + int error= write_row(rli, TRUE /* overwrite */); + + if (error && !thd->net.last_errno) + thd->net.last_errno= error; + + return error; } + #endif /* !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) */ #ifdef MYSQL_CLIENT @@ -7550,40 +7523,52 @@ record_compare_exit: return result; } +/** + Locate the current row in event's table. -/* - Find the row given by 'key', if the table has keys, or else use a table scan - to find (and fetch) the row. + The current row is pointed by @c m_curr_row. Member @c m_width tells how many + columns are there in the row (this can be differnet from the number of columns + in the table). It is assumed that event's table is already open and pointed + by @c m_table. - If the engine allows random access of the records, a combination of - position() and rnd_pos() will be used. + If a corresponding record is found in the table it is stored in + @c m_table->record[0]. Note that when record is located based on a primary + key, it is possible that the record found differs from the row being located. - @param table Pointer to table to search - @param key Pointer to key to use for search, if table has key + If no key is specified or table does not have keys, a table scan is used to + find the row. In that case the row should be complete and contain values for + all columns. However, it can still be shorter than the table, i.e. the table + can contain extra columns not present in the row. It is also possible that + the table has fewer columns than the row being located. - @pre table->record[0] shall contain the row to locate - and key shall contain a key to use for searching, if - the engine has a key. + @returns Error code on failure, 0 on success. + + @post In case of success @c m_table->record[0] contains the record found. + Also, the internal "cursor" of the table is positioned at the record found. - @post If the return value is zero, table->record[1] - will contain the fetched row and the internal "cursor" will refer to - the row. If the return value is non-zero, - table->record[1] is undefined. In either case, - table->record[0] is undefined. - - @return Zero if the row was successfully fetched into - table->record[1], error code otherwise. + @note If the engine allows random access of the records, a combination of + @c position() and @c rnd_pos() will be used. */ -static int find_and_fetch_row(TABLE *table, uchar *key) +int Rows_log_event::find_row(const RELAY_LOG_INFO *rli) { - DBUG_ENTER("find_and_fetch_row(TABLE *table, uchar *key, uchar *record)"); - DBUG_PRINT("enter", ("table: 0x%lx, key: 0x%lx record: 0x%lx", - (long) table, (long) key, (long) table->record[1])); + DBUG_ENTER("find_row"); - DBUG_ASSERT(table->in_use != NULL); + DBUG_ASSERT(m_table && m_table->in_use != NULL); + TABLE *table= m_table; + int error; + + /* unpack row - missing fields get default values */ + + // TODO: shall we check and report errors here? + prepare_record(NULL,table,m_width,FALSE /* don't check errors */); + error= unpack_current_row(rli); + +#ifndef DBUG_OFF + DBUG_PRINT("info",("looking for the following record")); DBUG_DUMP("record[0]", table->record[0], table->s->reclength); +#endif if ((table->file->ha_table_flags() & HA_PRIMARY_KEY_REQUIRED_FOR_POSITION) && table->s->primary_key < MAX_KEY) @@ -7606,34 +7591,48 @@ static int find_and_fetch_row(TABLE *table, uchar *key) table->s->reclength) == 0); */ + DBUG_PRINT("info",("locating record using primary key (position)")); table->file->position(table->record[0]); - int error= table->file->rnd_pos(table->record[0], table->file->ref); - /* - rnd_pos() returns the record in table->record[0], so we have to - move it to table->record[1]. - */ - bmove_align(table->record[1], table->record[0], table->s->reclength); + error= table->file->rnd_pos(table->record[0], table->file->ref); + if (error) + { + DBUG_PRINT("info",("rnd_pos returns error %d",error)); + table->file->print_error(error, MYF(0)); + } DBUG_RETURN(error); } - /* We need to retrieve all fields */ - /* TODO: Move this out from this function to main loop */ + // We can't use pisition() - try other methods. + + /* + We need to retrieve all fields + TODO: Move this out from this function to main loop + */ table->use_all_columns(); if (table->s->keys > 0) { - int error; + DBUG_PRINT("info",("locating record using primary key (index_read)")); + /* We have a key: search the table using the index */ if (!table->file->inited && (error= table->file->ha_index_init(0, FALSE))) + { + DBUG_PRINT("info",("ha_index_init returns error %d",error)); + table->file->print_error(error, MYF(0)); DBUG_RETURN(error); + } - /* - Don't print debug messages when running valgrind since they can - trigger false warnings. - */ + /* Fill key data for the row */ + + DBUG_ASSERT(m_key); + key_copy(m_key, table->record[0], table->key_info, 0); + + /* + Don't print debug messages when running valgrind since they can + trigger false warnings. + */ #ifndef HAVE_purify - DBUG_DUMP("table->record[0]", table->record[0], table->s->reclength); - DBUG_DUMP("table->record[1]", table->record[1], table->s->reclength); + DBUG_DUMP("key data", m_key, table->key_info->key_length); #endif /* @@ -7645,9 +7644,11 @@ static int find_and_fetch_row(TABLE *table, uchar *key) my_ptrdiff_t const pos= table->s->null_bytes > 0 ? table->s->null_bytes - 1 : 0; table->record[1][pos]= 0xFF; - if ((error= table->file->index_read_map(table->record[1], key, HA_WHOLE_KEY, + if ((error= table->file->index_read_map(table->record[1], m_key, + HA_WHOLE_KEY, HA_READ_KEY_EXACT))) { + DBUG_PRINT("info",("no record matching the key found in the table")); table->file->print_error(error, MYF(0)); table->file->ha_index_end(); DBUG_RETURN(error); @@ -7658,8 +7659,8 @@ static int find_and_fetch_row(TABLE *table, uchar *key) trigger false warnings. */ #ifndef HAVE_purify - DBUG_DUMP("table->record[0]", table->record[0], table->s->reclength); - DBUG_DUMP("table->record[1]", table->record[1], table->s->reclength); + DBUG_PRINT("info",("found first matching record")); + DBUG_DUMP("record[0]", table->record[0], table->s->reclength); #endif /* Below is a minor "optimization". If the key (i.e., key number @@ -7681,10 +7682,15 @@ static int find_and_fetch_row(TABLE *table, uchar *key) DBUG_RETURN(0); } + /* + In case key is not unique, we still have to iterate over records found + and find the one which is identical to the row given. The row is unpacked + in record[1] where missing columns are filled with default values. + */ + DBUG_PRINT("info",("non-unique index, scanning it to find matching record")); + while (record_compare(table)) { - int error; - /* We need to set the null bytes to ensure that the filler bit are all set when returning. There are storage engines that @@ -7702,9 +7708,10 @@ static int find_and_fetch_row(TABLE *table, uchar *key) if ((error= table->file->index_next(table->record[1]))) { - table->file->print_error(error, MYF(0)); + DBUG_PRINT("info",("no record matching the given row found")); + table->file->print_error(error, MYF(0)); table->file->ha_index_end(); - DBUG_RETURN(error); + DBUG_RETURN(error); } } @@ -7715,44 +7722,57 @@ static int find_and_fetch_row(TABLE *table, uchar *key) } else { + DBUG_PRINT("info",("locating record using table scan (rnd_next)")); + int restart_count= 0; // Number of times scanning has restarted from top - int error; /* We don't have a key: search the table using rnd_next() */ if ((error= table->file->ha_rnd_init(1))) - return error; + { + DBUG_PRINT("info",("error initializing table scan" + " (ha_rnd_init returns %d)",error)); + table->file->print_error(error, MYF(0)); + DBUG_RETURN(error); + } /* Continue until we find the right record or have made a full loop */ do { error= table->file->rnd_next(table->record[1]); - DBUG_DUMP("record[0]", table->record[0], table->s->reclength); - DBUG_DUMP("record[1]", table->record[1], table->s->reclength); - switch (error) { + case 0: + DBUG_DUMP("record found", table->record[0], table->s->reclength); + case HA_ERR_RECORD_DELETED: - break; + break; case HA_ERR_END_OF_FILE: - if (++restart_count < 2) - table->file->ha_rnd_init(1); - break; + if (++restart_count < 2) + table->file->ha_rnd_init(1); + break; default: - table->file->print_error(error, MYF(0)); - DBUG_PRINT("info", ("Record not found")); + DBUG_PRINT("info", ("Failed to get next record" + " (rnd_next returns %d)",error)); + table->file->print_error(error, MYF(0)); table->file->ha_rnd_end(); - DBUG_RETURN(error); + DBUG_RETURN(error); } } while (restart_count < 2 && record_compare(table)); + + /* + Note: above record_compare will take into accout all record fields + which might be incorrect in case a partial row was given in the event + */ /* Have to restart the scan to be able to fetch the next row. */ - DBUG_PRINT("info", ("Record %sfound", restart_count == 2 ? "not " : "")); + if (restart_count == 2) + DBUG_PRINT("info", ("Record not found")); table->file->ha_rnd_end(); DBUG_ASSERT(error == HA_ERR_END_OF_FILE || error == 0); @@ -7761,6 +7781,7 @@ static int find_and_fetch_row(TABLE *table, uchar *key) DBUG_RETURN(0); } + #endif /* @@ -7772,9 +7793,6 @@ Delete_rows_log_event::Delete_rows_log_event(THD *thd_arg, TABLE *tbl_arg, ulong tid, MY_BITMAP const *cols, bool is_transactional) : Rows_log_event(thd_arg, tbl_arg, tid, cols, is_transactional) -#ifdef HAVE_REPLICATION - ,m_memory(NULL), m_key(NULL), m_after_image(NULL) -#endif { } #endif /* #if !defined(MYSQL_CLIENT) */ @@ -7786,23 +7804,18 @@ Delete_rows_log_event::Delete_rows_log_event(THD *thd_arg, TABLE *tbl_arg, Delete_rows_log_event::Delete_rows_log_event(const char *buf, uint event_len, const Format_description_log_event *description_event) -#if defined(MYSQL_CLIENT) : Rows_log_event(buf, event_len, DELETE_ROWS_EVENT, description_event) -#else - : Rows_log_event(buf, event_len, DELETE_ROWS_EVENT, description_event), - m_memory(NULL), m_key(NULL), m_after_image(NULL) -#endif { } #endif #if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) -int Delete_rows_log_event::do_before_row_operations(TABLE *table) -{ - DBUG_ASSERT(m_memory == NULL); - if ((table->file->ha_table_flags() & HA_PRIMARY_KEY_REQUIRED_FOR_POSITION) && - table->s->primary_key < MAX_KEY) +int +Delete_rows_log_event::do_before_row_operations(const Slave_reporting_capability *const) +{ + if ((m_table->file->ha_table_flags() & HA_PRIMARY_KEY_REQUIRED_FOR_POSITION) && + m_table->s->primary_key < MAX_KEY) { /* We don't need to allocate any memory for m_after_image and @@ -7811,82 +7824,39 @@ int Delete_rows_log_event::do_before_row_operations(TABLE *table) return 0; } - int error= 0; - - if (table->s->keys > 0) + if (m_table->s->keys > 0) { - m_memory= (uchar*) my_multi_malloc(MYF(MY_WME), - &m_after_image, - (uint) table->s->reclength, - &m_key, - (uint) table->key_info->key_length, - NullS); + // Allocate buffer for key searches + m_key= (uchar*)my_malloc(m_table->key_info->key_length, MYF(MY_WME)); + if (!m_key) + return HA_ERR_OUT_OF_MEM; } - else - { - m_after_image= (uchar*) my_malloc(table->s->reclength, MYF(MY_WME)); - m_memory= (uchar*)m_after_image; - m_key= NULL; - } - if (!m_memory) - return HA_ERR_OUT_OF_MEM; - - return error; + return 0; } -int Delete_rows_log_event::do_after_row_operations(TABLE *table, int error) +int +Delete_rows_log_event::do_after_row_operations(const Slave_reporting_capability *const, + int error) { /*error= ToDo:find out what this should really be, this triggers close_scan in nbd, returning error?*/ - table->file->ha_index_or_rnd_end(); - my_free(m_memory, MYF(MY_ALLOW_ZERO_PTR)); // Free for multi_malloc - m_memory= NULL; - m_after_image= NULL; + m_table->file->ha_index_or_rnd_end(); + my_free(m_key, MYF(MY_ALLOW_ZERO_PTR)); m_key= NULL; return error; } -int Delete_rows_log_event::do_prepare_row(THD *thd_arg, - RELAY_LOG_INFO const *rli, - TABLE *table, - uchar const *const row_start, - uchar const **const row_end) -{ - DBUG_ASSERT(row_start && row_end); - if (int error= unpack_row(rli, table, m_width, row_start, &m_cols, row_end, - &m_master_reclength, table->read_set, DELETE_ROWS_EVENT)) - { - thd_arg->net.last_errno= error; - return error; - } - - /* - If we will access rows using the random access method, m_key will - be set to NULL, so we do not need to make a key copy in that case. - */ - if (m_key) - { - KEY *const key_info= table->key_info; - - key_copy(m_key, table->record[0], key_info, 0); - } - - return 0; -} - -int Delete_rows_log_event::do_exec_row(TABLE *table) +int Delete_rows_log_event::do_exec_row(const RELAY_LOG_INFO *const rli) { int error; - DBUG_ASSERT(table != NULL); + DBUG_ASSERT(m_table != NULL); - if (!(error= find_and_fetch_row(table, m_key))) + if (!(error= find_row(rli))) { /* - Now we should have the right row to delete. We are using - record[0] since it is guaranteed to point to a record with the - correct value. + Delete the record found, located in record[0] */ - error= table->file->ha_delete_row(table->record[0]); + error= m_table->file->ha_delete_row(m_table->record[0]); } return error; } @@ -7916,10 +7886,6 @@ Update_rows_log_event::Update_rows_log_event(THD *thd_arg, TABLE *tbl_arg, MY_BITMAP const *cols_ai, bool is_transactional) : Rows_log_event(thd_arg, tbl_arg, tid, cols_bi, is_transactional) -#ifdef HAVE_REPLICATION - , m_memory(NULL), m_key(NULL) - -#endif { init(cols_ai); } @@ -7929,16 +7895,13 @@ Update_rows_log_event::Update_rows_log_event(THD *thd_arg, TABLE *tbl_arg, MY_BITMAP const *cols, bool is_transactional) : Rows_log_event(thd_arg, tbl_arg, tid, cols, is_transactional) -#ifdef HAVE_REPLICATION - , m_memory(NULL), m_key(NULL) -#endif { init(cols); } void Update_rows_log_event::init(MY_BITMAP const *cols) { - /* if bitmap_init fails, catched in is_valid() */ + /* if bitmap_init fails, caught in is_valid() */ if (likely(!bitmap_init(&m_cols_ai, m_width <= sizeof(m_bitbuf_ai)*8 ? m_bitbuf_ai : NULL, m_width, @@ -7971,157 +7934,87 @@ Update_rows_log_event::Update_rows_log_event(const char *buf, uint event_len, const Format_description_log_event *description_event) -#if defined(MYSQL_CLIENT) : Rows_log_event(buf, event_len, UPDATE_ROWS_EVENT, description_event) -#else - : Rows_log_event(buf, event_len, UPDATE_ROWS_EVENT, description_event), - m_memory(NULL), m_key(NULL) -#endif { } #endif #if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) -int Update_rows_log_event::do_before_row_operations(TABLE *table) + +int +Update_rows_log_event::do_before_row_operations(const Slave_reporting_capability *const) { - DBUG_ASSERT(m_memory == NULL); - - int error= 0; - - if (table->s->keys > 0) + if (m_table->s->keys > 0) { - m_memory= (uchar*) my_multi_malloc(MYF(MY_WME), - &m_after_image, - (uint) table->s->reclength, - &m_key, - (uint) table->key_info->key_length, - NullS); + // Allocate buffer for key searches + m_key= (uchar*)my_malloc(m_table->key_info->key_length, MYF(MY_WME)); + if (!m_key) + return HA_ERR_OUT_OF_MEM; } - else - { - m_after_image= (uchar*) my_malloc(table->s->reclength, MYF(MY_WME)); - m_memory= m_after_image; - m_key= NULL; - } - if (!m_memory) - return HA_ERR_OUT_OF_MEM; - table->timestamp_field_type= TIMESTAMP_NO_AUTO_SET; + m_table->timestamp_field_type= TIMESTAMP_NO_AUTO_SET; - return error; + return 0; } -int Update_rows_log_event::do_after_row_operations(TABLE *table, int error) +int +Update_rows_log_event::do_after_row_operations(const Slave_reporting_capability *const, + int error) { - /* - error= ToDo:find out what this should really be, this triggers - close_scan in nbd, returning error? - */ - table->file->ha_index_or_rnd_end(); - my_free(m_memory, MYF(MY_ALLOW_ZERO_PTR)); - m_memory= NULL; - m_after_image= NULL; + /*error= ToDo:find out what this should really be, this triggers close_scan in nbd, returning error?*/ + m_table->file->ha_index_or_rnd_end(); + my_free(m_key, MYF(MY_ALLOW_ZERO_PTR)); // Free for multi_malloc m_key= NULL; return error; } -int Update_rows_log_event::do_prepare_row(THD *thd_arg, - RELAY_LOG_INFO const *rli, - TABLE *table, - uchar const *const row_start, - uchar const **const row_end) +int +Update_rows_log_event::do_exec_row(const RELAY_LOG_INFO *const rli) { - int error; - DBUG_ASSERT(row_start && row_end); - /* - We need to perform some juggling below since unpack_row() always - unpacks into table->record[0]. For more information, see the - comments for unpack_row(). - */ + DBUG_ASSERT(m_table != NULL); - /* record[0] is the before image for the update */ - if ((error= unpack_row(rli, table, m_width, row_start, &m_cols, row_end, - &m_master_reclength, table->read_set, - UPDATE_ROWS_EVENT))) - { - thd_arg->net.last_errno= error; - return error; - } - - store_record(table, record[1]); - uchar const *next_start = *row_end; - /* m_after_image is the after image for the update */ - if ((error= unpack_row(rli, table, m_width, next_start, &m_cols_ai, row_end, - &m_master_reclength, table->write_set, - UPDATE_ROWS_EVENT))) - { - thd_arg->net.last_errno= error; - return error; - } - - bmove_align(m_after_image, table->record[0], table->s->reclength); - restore_record(table, record[1]); - - /* - Don't print debug messages when running valgrind since they can - trigger false warnings. - */ -#ifndef HAVE_purify - DBUG_DUMP("record[0]", table->record[0], table->s->reclength); - DBUG_DUMP("m_after_image", m_after_image, table->s->reclength); -#endif - - /* - If we will access rows using the random access method, m_key will - be set to NULL, so we do not need to make a key copy in that case. - */ - if (m_key) - { - KEY *const key_info= table->key_info; - - key_copy(m_key, table->record[0], key_info, 0); - } - - return error; -} - -int Update_rows_log_event::do_exec_row(TABLE *table) -{ - DBUG_ASSERT(table != NULL); - - int error= find_and_fetch_row(table, m_key); + int error= find_row(rli); if (error) return error; /* - We have to ensure that the new record (i.e., the after image) is - in record[0] and the old record (i.e., the before image) is in - record[1]. This since some storage engines require this (for - example, the partition engine). + This is the situation after locating BI: - Since find_and_fetch_row() puts the fetched record (i.e., the old - record) in record[1], we can keep it there. We put the new record - (i.e., the after image) into record[0], and copy the fields that - are on the slave (i.e., in record[1]) into record[0], effectively - overwriting the default values that where put there by the - unpack_row() function. - */ - bmove_align(table->record[0], m_after_image, table->s->reclength); - copy_extra_record_fields(table, m_master_reclength, m_width); + ===|=== before image ====|=== after image ===|=== + ^ ^ + m_curr_row m_curr_row_end + + BI found in the table is stored in record[0]. We copy it to record[1] + and unpack AI to record[0]. + */ + + store_record(m_table,record[1]); + + m_curr_row= m_curr_row_end; + error= unpack_current_row(rli); // this also updates m_curr_row_end /* Now we have the right row to update. The old row (the one we're - looking for) is in record[1] and the new row has is in record[0]. - We also have copied the original values already in the slave's - database into the after image delivered from the master. + looking for) is in record[1] and the new row is in record[0]. */ - error= table->file->ha_update_row(table->record[1], table->record[0]); +#ifndef HAVE_purify + /* + Don't print debug messages when running valgrind since they can + trigger false warnings. + */ + DBUG_PRINT("info",("Updating row in table")); + DBUG_DUMP("old record", m_table->record[1], m_table->s->reclength); + DBUG_DUMP("new values", m_table->record[0], m_table->s->reclength); +#endif + + error= m_table->file->ha_update_row(m_table->record[1], m_table->record[0]); if (error == HA_ERR_RECORD_IS_THE_SAME) error= 0; return error; } + #endif /* !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) */ #ifdef MYSQL_CLIENT diff --git a/sql/log_event.h b/sql/log_event.h index 05854c2195c..064d13b3e62 100644 --- a/sql/log_event.h +++ b/sql/log_event.h @@ -23,6 +23,10 @@ #include #include "rpl_constants.h" +#ifndef MYSQL_CLIENT +#include "rpl_record.h" +#include "rpl_reporting.h" +#endif #define LOG_READ_EOF -1 #define LOG_READ_BOGUS -2 @@ -2180,7 +2184,13 @@ public: NO_FOREIGN_KEY_CHECKS_F = (1U << 1), /* Value of the OPTION_RELAXED_UNIQUE_CHECKS flag in thd->options */ - RELAXED_UNIQUE_CHECKS_F = (1U << 2) + RELAXED_UNIQUE_CHECKS_F = (1U << 2), + + /** + Indicates that rows in this event are complete, that is contain + values for all columns of the table. + */ + COMPLETE_ROWS_F = (1U << 3) }; typedef uint16 flag_set; @@ -2284,7 +2294,26 @@ protected: uchar *m_rows_cur; /* One-after the end of the data */ uchar *m_rows_end; /* One-after the end of the allocated space */ + const uchar *m_curr_row; /* Start of the row being processed */ + const uchar *m_curr_row_end; /* One-after the end of the current row */ + flag_set m_flags; /* Flags for row-level events */ + uchar *m_key; /* Buffer to keep key value during searches */ + + /* helper functions */ + +#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) + int find_row(const RELAY_LOG_INFO *const); + int write_row(const RELAY_LOG_INFO *const, const bool); + + // Unpack the current row into m_table->record[0] + 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); + } +#endif private: @@ -2309,7 +2338,8 @@ private: The member function will return 0 if all went OK, or a non-zero error code otherwise. */ - virtual int do_before_row_operations(TABLE *table) = 0; + virtual + int do_before_row_operations(const Slave_reporting_capability *const log) = 0; /* Primitive to clean up after a sequence of row executions. @@ -2319,45 +2349,33 @@ private: After doing a sequence of do_prepare_row() and do_exec_row(), this member function should be called to clean up and release any allocated buffers. + + The error argument, if non-zero, indicates an error which happened during + row processing before this function was called. In this case, even if + function is successful, it should return the error code given in the argument. */ - virtual int do_after_row_operations(TABLE *table, int error) = 0; - - /* - Primitive to prepare for handling one row in a row-level event. - - DESCRIPTION - - The member function prepares for execution of operations needed for one - row in a row-level event by reading up data from the buffer containing - the row. No specific interpretation of the data is normally done here, - since SQL thread specific data is not available: that data is made - available for the do_exec function. - - A pointer to the start of the next row, or NULL if the preparation - failed. Currently, preparation cannot fail, but don't rely on this - behavior. - - RETURN VALUE - Error code, if something went wrong, 0 otherwise. - */ - virtual int do_prepare_row(THD*, RELAY_LOG_INFO const*, TABLE*, - uchar const *row_start, - uchar const **row_end) = 0; + virtual + int do_after_row_operations(const Slave_reporting_capability *const log, + int error) = 0; /* Primitive to do the actual execution necessary for a row. DESCRIPTION The member function will do the actual execution needed to handle a row. + The row is located at m_curr_row. When the function returns, + m_curr_row_end should point at the next row (one byte after the end + of the current row). RETURN VALUE 0 if execution succeeded, 1 if execution failed. */ - virtual int do_exec_row(TABLE *table) = 0; + virtual int do_exec_row(const RELAY_LOG_INFO *const rli) = 0; #endif /* !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) */ -}; + friend class Old_rows_log_event; +}; /***************************************************************************** @@ -2407,14 +2425,9 @@ private: #endif #if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) - uchar *m_memory; - uchar *m_after_image; - - virtual int do_before_row_operations(TABLE *table); - virtual int do_after_row_operations(TABLE *table, int error); - virtual int do_prepare_row(THD*, RELAY_LOG_INFO const*, TABLE*, - uchar const *row_start, uchar const **row_end); - virtual int do_exec_row(TABLE *table); + virtual int do_before_row_operations(const Slave_reporting_capability *const); + virtual int do_after_row_operations(const Slave_reporting_capability *const,int); + virtual int do_exec_row(const RELAY_LOG_INFO *const); #endif }; @@ -2486,15 +2499,9 @@ protected: #endif #if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) - uchar *m_memory; - uchar *m_key; - uchar *m_after_image; - - virtual int do_before_row_operations(TABLE *table); - virtual int do_after_row_operations(TABLE *table, int error); - virtual int do_prepare_row(THD*, RELAY_LOG_INFO const*, TABLE*, - uchar const *row_start, uchar const **row_end); - virtual int do_exec_row(TABLE *table); + virtual int do_before_row_operations(const Slave_reporting_capability *const); + virtual int do_after_row_operations(const Slave_reporting_capability *const,int); + virtual int do_exec_row(const RELAY_LOG_INFO *const); #endif /* !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) */ }; @@ -2557,15 +2564,9 @@ protected: #endif #if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) - uchar *m_memory; - uchar *m_key; - uchar *m_after_image; - - virtual int do_before_row_operations(TABLE *table); - virtual int do_after_row_operations(TABLE *table, int error); - virtual int do_prepare_row(THD*, RELAY_LOG_INFO const*, TABLE*, - uchar const *row_start, uchar const **row_end); - virtual int do_exec_row(TABLE *table); + virtual int do_before_row_operations(const Slave_reporting_capability *const); + virtual int do_after_row_operations(const Slave_reporting_capability *const,int); + virtual int do_exec_row(const RELAY_LOG_INFO *const); #endif }; diff --git a/sql/log_event_old.cc b/sql/log_event_old.cc index d44f9621a42..69769fa03e6 100644 --- a/sql/log_event_old.cc +++ b/sql/log_event_old.cc @@ -1,9 +1,967 @@ #include "mysql_priv.h" +#ifndef MYSQL_CLIENT +#include "rpl_rli.h" +#include "rpl_utility.h" +#endif #include "log_event_old.h" #include "rpl_record_old.h" #if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) + +// Old implementation of do_apply_event() +int +Old_rows_log_event::do_apply_event(Rows_log_event *ev, const RELAY_LOG_INFO *rli) +{ + DBUG_ENTER("Rows_log_event::do_apply_event(st_relay_log_info*)"); + int error= 0; + THD *thd= ev->thd; + uchar const *row_start= ev->m_rows_buf; + + /* + If m_table_id == ~0UL, then we have a dummy event that does not + contain any data. In that case, we just remove all tables in the + tables_to_lock list, close the thread tables, and return with + success. + */ + if (ev->m_table_id == ~0UL) + { + /* + This one is supposed to be set: just an extra check so that + nothing strange has happened. + */ + DBUG_ASSERT(ev->get_flags(Rows_log_event::STMT_END_F)); + + const_cast(rli)->clear_tables_to_lock(); + close_thread_tables(thd); + thd->clear_error(); + DBUG_RETURN(0); + } + + /* + 'thd' has been set by exec_relay_log_event(), just before calling + do_apply_event(). We still check here to prevent future coding + errors. + */ + DBUG_ASSERT(rli->sql_thd == thd); + + /* + If there is no locks taken, this is the first binrow event seen + after the table map events. We should then lock all the tables + used in the transaction and proceed with execution of the actual + event. + */ + if (!thd->lock) + { + bool need_reopen= 1; /* To execute the first lap of the loop below */ + + /* + lock_tables() reads the contents of thd->lex, so they must be + initialized. Contrary to in + Table_map_log_event::do_apply_event() we don't call + mysql_init_query() as that may reset the binlog format. + */ + lex_start(thd); + + while ((error= lock_tables(thd, rli->tables_to_lock, + rli->tables_to_lock_count, &need_reopen))) + { + if (!need_reopen) + { + if (thd->query_error || thd->is_fatal_error) + { + /* + Error reporting borrowed from Query_log_event with many excessive + simplifications (we don't honour --slave-skip-errors) + */ + uint actual_error= thd->net.last_errno; + rli->report(ERROR_LEVEL, actual_error, + "Error '%s' in %s event: when locking tables", + (actual_error ? thd->net.last_error : + "unexpected success or fatal error"), + ev->get_type_str()); + thd->is_fatal_error= 1; + } + else + { + rli->report(ERROR_LEVEL, error, + "Error in %s event: when locking tables", + ev->get_type_str()); + } + const_cast(rli)->clear_tables_to_lock(); + DBUG_RETURN(error); + } + + /* + So we need to reopen the tables. + + We need to flush the pending RBR event, since it keeps a + pointer to an open table. + + ALTERNATIVE SOLUTION (not implemented): Extract a pointer to + the pending RBR event and reset the table pointer after the + tables has been reopened. + + NOTE: For this new scheme there should be no pending event: + need to add code to assert that is the case. + */ + thd->binlog_flush_pending_rows_event(false); + TABLE_LIST *tables= rli->tables_to_lock; + close_tables_for_reopen(thd, &tables); + + uint tables_count= rli->tables_to_lock_count; + if ((error= open_tables(thd, &tables, &tables_count, 0))) + { + if (thd->query_error || thd->is_fatal_error) + { + /* + Error reporting borrowed from Query_log_event with many excessive + simplifications (we don't honour --slave-skip-errors) + */ + uint actual_error= thd->net.last_errno; + rli->report(ERROR_LEVEL, actual_error, + "Error '%s' on reopening tables", + (actual_error ? thd->net.last_error : + "unexpected success or fatal error")); + thd->query_error= 1; + } + const_cast(rli)->clear_tables_to_lock(); + DBUG_RETURN(error); + } + } + + /* + When the open and locking succeeded, we check all tables to + ensure that they still have the correct type. + + We can use a down cast here since we know that every table added + to the tables_to_lock is a RPL_TABLE_LIST. + */ + + { + RPL_TABLE_LIST *ptr= rli->tables_to_lock; + for ( ; ptr ; ptr= static_cast(ptr->next_global)) + { + if (ptr->m_tabledef.compatible_with(rli, ptr->table)) + { + mysql_unlock_tables(thd, thd->lock); + thd->lock= 0; + thd->query_error= 1; + const_cast(rli)->clear_tables_to_lock(); + DBUG_RETURN(Rows_log_event::ERR_BAD_TABLE_DEF); + } + } + } + + /* + ... and then we add all the tables to the table map and remove + them from tables to lock. + + We also invalidate the query cache for all the tables, since + they will now be changed. + + TODO [/Matz]: Maybe the query cache should not be invalidated + here? It might be that a table is not changed, even though it + was locked for the statement. We do know that each + Rows_log_event contain at least one row, so after processing one + Rows_log_event, we can invalidate the query cache for the + associated table. + */ + for (TABLE_LIST *ptr= rli->tables_to_lock ; ptr ; ptr= ptr->next_global) + { + const_cast(rli)->m_table_map.set_table(ptr->table_id, ptr->table); + } +#ifdef HAVE_QUERY_CACHE + query_cache.invalidate_locked_for_write(rli->tables_to_lock); +#endif + } + + TABLE* table= const_cast(rli)->m_table_map.get_table(ev->m_table_id); + + if (table) + { + /* + table == NULL means that this table should not be replicated + (this was set up by Table_map_log_event::do_apply_event() + which tested replicate-* rules). + */ + + /* + It's not needed to set_time() but + 1) it continues the property that "Time" in SHOW PROCESSLIST shows how + much slave is behind + 2) it will be needed when we allow replication from a table with no + TIMESTAMP column to a table with one. + So we call set_time(), like in SBR. Presently it changes nothing. + */ + thd->set_time((time_t)ev->when); + /* + There are a few flags that are replicated with each row event. + Make sure to set/clear them before executing the main body of + the event. + */ + if (ev->get_flags(Rows_log_event::NO_FOREIGN_KEY_CHECKS_F)) + thd->options|= OPTION_NO_FOREIGN_KEY_CHECKS; + else + thd->options&= ~OPTION_NO_FOREIGN_KEY_CHECKS; + + if (ev->get_flags(Rows_log_event::RELAXED_UNIQUE_CHECKS_F)) + thd->options|= OPTION_RELAXED_UNIQUE_CHECKS; + else + thd->options&= ~OPTION_RELAXED_UNIQUE_CHECKS; + /* A small test to verify that objects have consistent types */ + DBUG_ASSERT(sizeof(thd->options) == sizeof(OPTION_RELAXED_UNIQUE_CHECKS)); + + /* + Now we are in a statement and will stay in a statement until we + see a STMT_END_F. + + We set this flag here, before actually applying any rows, in + case the SQL thread is stopped and we need to detect that we're + inside a statement and halting abruptly might cause problems + when restarting. + */ + const_cast(rli)->set_flag(RELAY_LOG_INFO::IN_STMT); + + error= do_before_row_operations(table); + while (error == 0 && row_start < ev->m_rows_end) + { + uchar const *row_end= NULL; + if ((error= do_prepare_row(thd, rli, table, row_start, &row_end))) + break; // We should perform the after-row operation even in + // the case of error + + DBUG_ASSERT(row_end != NULL); // cannot happen + DBUG_ASSERT(row_end <= ev->m_rows_end); + + /* in_use can have been set to NULL in close_tables_for_reopen */ + THD* old_thd= table->in_use; + if (!table->in_use) + table->in_use= thd; + error= do_exec_row(table); + 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; + + default: + rli->report(ERROR_LEVEL, thd->net.last_errno, + "Error in %s event: row application failed. %s", + ev->get_type_str(), + thd->net.last_error ? thd->net.last_error : ""); + thd->query_error= 1; + break; + } + + row_start= row_end; + } + DBUG_EXECUTE_IF("STOP_SLAVE_after_first_Rows_event", + const_cast(rli)->abort_slave= 1;); + error= do_after_row_operations(table, error); + if (!ev->cache_stmt) + { + DBUG_PRINT("info", ("Marked that we need to keep log")); + thd->options|= OPTION_KEEP_LOG; + } + } + + /* + We need to delay this clear until the table def is no longer needed. + The table def is needed in unpack_row(). + */ + if (rli->tables_to_lock && ev->get_flags(Rows_log_event::STMT_END_F)) + const_cast(rli)->clear_tables_to_lock(); + + if (error) + { /* error has occured during the transaction */ + rli->report(ERROR_LEVEL, thd->net.last_errno, + "Error in %s event: error during transaction execution " + "on table %s.%s. %s", + ev->get_type_str(), table->s->db.str, + table->s->table_name.str, + thd->net.last_error ? thd->net.last_error : ""); + + /* + If one day we honour --skip-slave-errors in row-based replication, and + the error should be skipped, then we would clear mappings, rollback, + close tables, but the slave SQL thread would not stop and then may + assume the mapping is still available, the tables are still open... + So then we should clear mappings/rollback/close here only if this is a + STMT_END_F. + For now we code, knowing that error is not skippable and so slave SQL + thread is certainly going to stop. + rollback at the caller along with sbr. + */ + thd->reset_current_stmt_binlog_row_based(); + const_cast(rli)->cleanup_context(thd, error); + thd->query_error= 1; + DBUG_RETURN(error); + } + + /* + This code would ideally be placed in do_update_pos() instead, but + since we have no access to table there, we do the setting of + last_event_start_time here instead. + */ + if (table && (table->s->primary_key == MAX_KEY) && + !ev->cache_stmt && + ev->get_flags(Rows_log_event::STMT_END_F) == Rows_log_event::RLE_NO_FLAGS) + { + /* + ------------ Temporary fix until WL#2975 is implemented --------- + + This event is not the last one (no STMT_END_F). If we stop now + (in case of terminate_slave_thread()), how will we restart? We + have to restart from Table_map_log_event, but as this table is + not transactional, the rows already inserted will still be + present, and idempotency is not guaranteed (no PK) so we risk + that repeating leads to double insert. So we desperately try to + continue, hope we'll eventually leave this buggy situation (by + executing the final Rows_log_event). If we are in a hopeless + wait (reached end of last relay log and nothing gets appended + there), we timeout after one minute, and notify DBA about the + problem. When WL#2975 is implemented, just remove the member + st_relay_log_info::last_event_start_time and all its occurences. + */ + const_cast(rli)->last_event_start_time= my_time(0); + } + + DBUG_RETURN(0); +} +#endif + +#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) + +/* + Check if there are more UNIQUE keys after the given key. +*/ +static int +last_uniq_key(TABLE *table, uint keyno) +{ + while (++keyno < table->s->keys) + if (table->key_info[keyno].flags & HA_NOSAME) + return 0; + return 1; +} + +/* + Compares table->record[0] and table->record[1] + + Returns TRUE if different. +*/ +static bool record_compare(TABLE *table) +{ + /* + Need to set the X bit and the filler bits in both records since + there are engines that do not set it correctly. + + In addition, since MyISAM checks that one hasn't tampered with the + record, it is necessary to restore the old bytes into the record + after doing the comparison. + + TODO[record format ndb]: Remove it once NDB returns correct + records. Check that the other engines also return correct records. + */ + + bool result= FALSE; + uchar saved_x[2], saved_filler[2]; + + if (table->s->null_bytes > 0) + { + for (int i = 0 ; i < 2 ; ++i) + { + saved_x[i]= table->record[i][0]; + saved_filler[i]= table->record[i][table->s->null_bytes - 1]; + table->record[i][0]|= 1U; + table->record[i][table->s->null_bytes - 1]|= + 256U - (1U << table->s->last_null_bit_pos); + } + } + + if (table->s->blob_fields + table->s->varchar_fields == 0) + { + result= cmp_record(table,record[1]); + goto record_compare_exit; + } + + /* Compare null bits */ + if (memcmp(table->null_flags, + table->null_flags+table->s->rec_buff_length, + table->s->null_bytes)) + { + result= TRUE; // Diff in NULL value + goto record_compare_exit; + } + + /* Compare updated fields */ + for (Field **ptr=table->field ; *ptr ; ptr++) + { + if ((*ptr)->cmp_binary_offset(table->s->rec_buff_length)) + { + result= TRUE; + goto record_compare_exit; + } + } + +record_compare_exit: + /* + Restore the saved bytes. + + TODO[record format ndb]: Remove this code once NDB returns the + correct record format. + */ + if (table->s->null_bytes > 0) + { + for (int i = 0 ; i < 2 ; ++i) + { + table->record[i][0]= saved_x[i]; + table->record[i][table->s->null_bytes - 1]= saved_filler[i]; + } + } + + return result; +} + +/* + Copy "extra" columns from record[1] to record[0]. + + Copy the extra fields that are not present on the master but are + present on the slave from record[1] to record[0]. This is used + after fetching a record that are to be updated, either inside + replace_record() or as part of executing an update_row(). + */ +static int +copy_extra_record_fields(TABLE *table, + size_t master_reclength, + my_ptrdiff_t master_fields) +{ + DBUG_ENTER("copy_extra_record_fields(table, master_reclen, master_fields)"); + DBUG_PRINT("info", ("Copying to 0x%lx " + "from field %lu at offset %lu " + "to field %d at offset %lu", + (long) table->record[0], + (ulong) master_fields, (ulong) master_reclength, + table->s->fields, table->s->reclength)); + /* + Copying the extra fields of the slave that does not exist on + master into record[0] (which are basically the default values). + */ + + if (table->s->fields < (uint) master_fields) + DBUG_RETURN(0); + + DBUG_ASSERT(master_reclength <= table->s->reclength); + if (master_reclength < table->s->reclength) + bmove_align(table->record[0] + master_reclength, + table->record[1] + master_reclength, + table->s->reclength - master_reclength); + + /* + Bit columns are special. We iterate over all the remaining + columns and copy the "extra" bits to the new record. This is + not a very good solution: it should be refactored on + opportunity. + + REFACTORING SUGGESTION (Matz). Introduce a member function + similar to move_field_offset() called copy_field_offset() to + copy field values and implement it for all Field subclasses. Use + this function to copy data from the found record to the record + that are going to be inserted. + + The copy_field_offset() function need to be a virtual function, + which in this case will prevent copying an entire range of + fields efficiently. + */ + { + Field **field_ptr= table->field + master_fields; + for ( ; *field_ptr ; ++field_ptr) + { + /* + Set the null bit according to the values in record[1] + */ + if ((*field_ptr)->maybe_null() && + (*field_ptr)->is_null_in_record(reinterpret_cast(table->record[1]))) + (*field_ptr)->set_null(); + else + (*field_ptr)->set_notnull(); + + /* + Do the extra work for special columns. + */ + switch ((*field_ptr)->real_type()) + { + default: + /* Nothing to do */ + break; + + case MYSQL_TYPE_BIT: + Field_bit *f= static_cast(*field_ptr); + if (f->bit_len > 0) + { + my_ptrdiff_t const offset= table->record[1] - table->record[0]; + uchar const bits= + get_rec_bits(f->bit_ptr + offset, f->bit_ofs, f->bit_len); + set_rec_bits(bits, f->bit_ptr, f->bit_ofs, f->bit_len); + } + break; + } + } + } + DBUG_RETURN(0); // All OK +} + +/* + Replace the provided record in the database. + + SYNOPSIS + replace_record() + thd Thread context for writing the record. + table Table to which record should be written. + master_reclength + Offset to first column that is not present on the master, + alternatively the length of the record on the master + side. + + RETURN VALUE + Error code on failure, 0 on success. + + DESCRIPTION + Similar to how it is done in mysql_insert(), we first try to do + a ha_write_row() and of that fails due to duplicated keys (or + indices), we do an ha_update_row() or a ha_delete_row() instead. + */ +static int +replace_record(THD *thd, TABLE *table, + ulong const master_reclength, + uint const master_fields) +{ + DBUG_ENTER("replace_record"); + DBUG_ASSERT(table != NULL && thd != NULL); + + int error; + int keynum; + auto_afree_ptr key(NULL); + +#ifndef DBUG_OFF + DBUG_DUMP("record[0]", table->record[0], table->s->reclength); + DBUG_PRINT_BITSET("debug", "write_set = %s", table->write_set); + DBUG_PRINT_BITSET("debug", "read_set = %s", table->read_set); +#endif + + while ((error= table->file->ha_write_row(table->record[0]))) + { + if (error == HA_ERR_LOCK_DEADLOCK || error == HA_ERR_LOCK_WAIT_TIMEOUT) + { + table->file->print_error(error, MYF(0)); /* to check at exec_relay_log_event */ + DBUG_RETURN(error); + } + if ((keynum= table->file->get_dup_key(error)) < 0) + { + table->file->print_error(error, MYF(0)); + /* + We failed to retrieve the duplicate key + - either because the error was not "duplicate key" error + - or because the information which key is not available + */ + DBUG_RETURN(error); + } + + /* + We need to retrieve the old row into record[1] to be able to + either update or delete the offending record. We either: + + - use rnd_pos() with a row-id (available as dupp_row) to the + offending row, if that is possible (MyISAM and Blackhole), or else + + - use index_read_idx() with the key that is duplicated, to + retrieve the offending row. + */ + if (table->file->ha_table_flags() & HA_DUPLICATE_POS) + { + error= table->file->rnd_pos(table->record[1], table->file->dup_ref); + if (error) + { + table->file->print_error(error, MYF(0)); + DBUG_RETURN(error); + } + } + else + { + if (table->file->extra(HA_EXTRA_FLUSH_CACHE)) + { + DBUG_RETURN(my_errno); + } + + if (key.get() == NULL) + { + key.assign(static_cast(my_alloca(table->s->max_unique_length))); + if (key.get() == NULL) + DBUG_RETURN(ENOMEM); + } + + key_copy((uchar*)key.get(), table->record[0], table->key_info + keynum, + 0); + error= table->file->index_read_idx_map(table->record[1], keynum, + (const uchar*)key.get(), + HA_WHOLE_KEY, + HA_READ_KEY_EXACT); + if (error) + { + table->file->print_error(error, MYF(0)); + DBUG_RETURN(error); + } + } + + /* + Now, table->record[1] should contain the offending row. That + will enable us to update it or, alternatively, delete it (so + that we can insert the new row afterwards). + + First we copy the columns into table->record[0] that are not + present on the master from table->record[1], if there are any. + */ + copy_extra_record_fields(table, master_reclength, master_fields); + + /* + REPLACE is defined as either INSERT or DELETE + INSERT. If + possible, we can replace it with an UPDATE, but that will not + work on InnoDB if FOREIGN KEY checks are necessary. + + I (Matz) am not sure of the reason for the last_uniq_key() + check as, but I'm guessing that it's something along the + following lines. + + Suppose that we got the duplicate key to be a key that is not + the last unique key for the table and we perform an update: + then there might be another key for which the unique check will + fail, so we're better off just deleting the row and inserting + the correct row. + */ + if (last_uniq_key(table, keynum) && + !table->file->referenced_by_foreign_key()) + { + error=table->file->ha_update_row(table->record[1], + table->record[0]); + if (error && error != HA_ERR_RECORD_IS_THE_SAME) + table->file->print_error(error, MYF(0)); + else + error= 0; + DBUG_RETURN(error); + } + else + { + if ((error= table->file->ha_delete_row(table->record[1]))) + { + table->file->print_error(error, MYF(0)); + DBUG_RETURN(error); + } + /* Will retry ha_write_row() with the offending row removed. */ + } + } + + DBUG_RETURN(error); +} + +/** + Find the row given by 'key', if the table has keys, or else use a table scan + to find (and fetch) the row. + + If the engine allows random access of the records, a combination of + position() and rnd_pos() will be used. + + @param table Pointer to table to search + @param key Pointer to key to use for search, if table has key + + @pre table->record[0] shall contain the row to locate + and key shall contain a key to use for searching, if + the engine has a key. + + @post If the return value is zero, table->record[1] + will contain the fetched row and the internal "cursor" will refer to + the row. If the return value is non-zero, + table->record[1] is undefined. In either case, + table->record[0] is undefined. + + @return Zero if the row was successfully fetched into + table->record[1], error code otherwise. + */ + +static int find_and_fetch_row(TABLE *table, uchar *key) +{ + DBUG_ENTER("find_and_fetch_row(TABLE *table, uchar *key, uchar *record)"); + DBUG_PRINT("enter", ("table: 0x%lx, key: 0x%lx record: 0x%lx", + (long) table, (long) key, (long) table->record[1])); + + DBUG_ASSERT(table->in_use != NULL); + + DBUG_DUMP("record[0]", table->record[0], table->s->reclength); + + if ((table->file->ha_table_flags() & HA_PRIMARY_KEY_REQUIRED_FOR_POSITION) && + table->s->primary_key < MAX_KEY) + { + /* + Use a more efficient method to fetch the record given by + table->record[0] if the engine allows it. We first compute a + row reference using the position() member function (it will be + stored in table->file->ref) and the use rnd_pos() to position + the "cursor" (i.e., record[0] in this case) at the correct row. + + TODO: Add a check that the correct record has been fetched by + comparing with the original record. Take into account that the + record on the master and slave can be of different + length. Something along these lines should work: + + ADD>>> store_record(table,record[1]); + int error= table->file->rnd_pos(table->record[0], table->file->ref); + ADD>>> DBUG_ASSERT(memcmp(table->record[1], table->record[0], + table->s->reclength) == 0); + + */ + table->file->position(table->record[0]); + int error= table->file->rnd_pos(table->record[0], table->file->ref); + /* + rnd_pos() returns the record in table->record[0], so we have to + move it to table->record[1]. + */ + bmove_align(table->record[1], table->record[0], table->s->reclength); + DBUG_RETURN(error); + } + + /* We need to retrieve all fields */ + /* TODO: Move this out from this function to main loop */ + table->use_all_columns(); + + if (table->s->keys > 0) + { + int error; + /* We have a key: search the table using the index */ + if (!table->file->inited && (error= table->file->ha_index_init(0, FALSE))) + DBUG_RETURN(error); + + /* + Don't print debug messages when running valgrind since they can + trigger false warnings. + */ +#ifndef HAVE_purify + DBUG_DUMP("table->record[0]", table->record[0], table->s->reclength); + DBUG_DUMP("table->record[1]", table->record[1], table->s->reclength); +#endif + + /* + We need to set the null bytes to ensure that the filler bit are + all set when returning. There are storage engines that just set + the necessary bits on the bytes and don't set the filler bits + correctly. + */ + my_ptrdiff_t const pos= + table->s->null_bytes > 0 ? table->s->null_bytes - 1 : 0; + table->record[1][pos]= 0xFF; + if ((error= table->file->index_read_map(table->record[1], key, HA_WHOLE_KEY, + HA_READ_KEY_EXACT))) + { + table->file->print_error(error, MYF(0)); + table->file->ha_index_end(); + DBUG_RETURN(error); + } + + /* + Don't print debug messages when running valgrind since they can + trigger false warnings. + */ +#ifndef HAVE_purify + DBUG_DUMP("table->record[0]", table->record[0], table->s->reclength); + DBUG_DUMP("table->record[1]", table->record[1], table->s->reclength); +#endif + /* + Below is a minor "optimization". If the key (i.e., key number + 0) has the HA_NOSAME flag set, we know that we have found the + correct record (since there can be no duplicates); otherwise, we + have to compare the record with the one found to see if it is + the correct one. + + CAVEAT! This behaviour is essential for the replication of, + e.g., the mysql.proc table since the correct record *shall* be + found using the primary key *only*. There shall be no + comparison of non-PK columns to decide if the correct record is + found. I can see no scenario where it would be incorrect to + chose the row to change only using a PK or an UNNI. + */ + if (table->key_info->flags & HA_NOSAME) + { + table->file->ha_index_end(); + DBUG_RETURN(0); + } + + while (record_compare(table)) + { + int error; + + /* + We need to set the null bytes to ensure that the filler bit + are all set when returning. There are storage engines that + just set the necessary bits on the bytes and don't set the + filler bits correctly. + + TODO[record format ndb]: Remove this code once NDB returns the + correct record format. + */ + if (table->s->null_bytes > 0) + { + table->record[1][table->s->null_bytes - 1]|= + 256U - (1U << table->s->last_null_bit_pos); + } + + if ((error= table->file->index_next(table->record[1]))) + { + table->file->print_error(error, MYF(0)); + table->file->ha_index_end(); + DBUG_RETURN(error); + } + } + + /* + Have to restart the scan to be able to fetch the next row. + */ + table->file->ha_index_end(); + } + else + { + int restart_count= 0; // Number of times scanning has restarted from top + int error; + + /* We don't have a key: search the table using rnd_next() */ + if ((error= table->file->ha_rnd_init(1))) + return error; + + /* Continue until we find the right record or have made a full loop */ + do + { + error= table->file->rnd_next(table->record[1]); + + DBUG_DUMP("record[0]", table->record[0], table->s->reclength); + DBUG_DUMP("record[1]", table->record[1], table->s->reclength); + + switch (error) { + case 0: + case HA_ERR_RECORD_DELETED: + break; + + case HA_ERR_END_OF_FILE: + if (++restart_count < 2) + table->file->ha_rnd_init(1); + break; + + default: + table->file->print_error(error, MYF(0)); + DBUG_PRINT("info", ("Record not found")); + table->file->ha_rnd_end(); + DBUG_RETURN(error); + } + } + while (restart_count < 2 && record_compare(table)); + + /* + Have to restart the scan to be able to fetch the next row. + */ + DBUG_PRINT("info", ("Record %sfound", restart_count == 2 ? "not " : "")); + table->file->ha_rnd_end(); + + DBUG_ASSERT(error == HA_ERR_END_OF_FILE || error == 0); + DBUG_RETURN(error); + } + + DBUG_RETURN(0); +} + +/********************************************************** + Row handling primitives for Write_rows_log_event_old + **********************************************************/ + +int Write_rows_log_event_old::do_before_row_operations(TABLE *table) +{ + int error= 0; + + /* + We are using REPLACE semantics and not INSERT IGNORE semantics + when writing rows, that is: new rows replace old rows. We need to + inform the storage engine that it should use this behaviour. + */ + + /* Tell the storage engine that we are using REPLACE semantics. */ + thd->lex->duplicates= DUP_REPLACE; + + /* + Pretend we're executing a REPLACE command: this is needed for + InnoDB and NDB Cluster since they are not (properly) checking the + lex->duplicates flag. + */ + thd->lex->sql_command= SQLCOM_REPLACE; + /* + Do not raise the error flag in case of hitting to an unique attribute + */ + table->file->extra(HA_EXTRA_IGNORE_DUP_KEY); + /* + NDB specific: update from ndb master wrapped as Write_rows + */ + /* + so that the event should be applied to replace slave's row + */ + table->file->extra(HA_EXTRA_WRITE_CAN_REPLACE); + /* + NDB specific: if update from ndb master wrapped as Write_rows + does not find the row it's assumed idempotent binlog applying + is taking place; don't raise the error. + */ + table->file->extra(HA_EXTRA_IGNORE_NO_KEY); + /* + TODO: the cluster team (Tomas?) says that it's better if the engine knows + how many rows are going to be inserted, then it can allocate needed memory + from the start. + */ + table->file->ha_start_bulk_insert(0); + /* + We need TIMESTAMP_NO_AUTO_SET otherwise ha_write_row() will not use fill + any TIMESTAMP column with data from the row but instead will use + the event's current time. + As we replicate from TIMESTAMP to TIMESTAMP and slave has no extra + columns, we know that all TIMESTAMP columns on slave will receive explicit + data from the row, so TIMESTAMP_NO_AUTO_SET is ok. + When we allow a table without TIMESTAMP to be replicated to a table having + more columns including a TIMESTAMP column, or when we allow a TIMESTAMP + column to be replicated into a BIGINT column and the slave's table has a + TIMESTAMP column, then the slave's TIMESTAMP column will take its value + from set_time() which we called earlier (consistent with SBR). And then in + some cases we won't want TIMESTAMP_NO_AUTO_SET (will require some code to + analyze if explicit data is provided for slave's TIMESTAMP columns). + */ + table->timestamp_field_type= TIMESTAMP_NO_AUTO_SET; + return error; +} + +int Write_rows_log_event_old::do_after_row_operations(TABLE *table, int error) +{ + int local_error= 0; + table->file->extra(HA_EXTRA_NO_IGNORE_DUP_KEY); + table->file->extra(HA_EXTRA_WRITE_CANNOT_REPLACE); + /* + reseting the extra with + table->file->extra(HA_EXTRA_NO_IGNORE_NO_KEY); + fires bug#27077 + todo: explain or fix + */ + if ((local_error= table->file->ha_end_bulk_insert())) + { + table->file->print_error(local_error, MYF(0)); + } + return error? error : local_error; +} + int Write_rows_log_event_old::do_prepare_row(THD *thd_arg, RELAY_LOG_INFO const *rli, @@ -23,6 +981,65 @@ Write_rows_log_event_old::do_prepare_row(THD *thd_arg, return error; } +int Write_rows_log_event_old::do_exec_row(TABLE *table) +{ + DBUG_ASSERT(table != NULL); + int error= replace_record(thd, table, m_master_reclength, m_width); + return error; +} + +/********************************************************** + Row handling primitives for Delete_rows_log_event_old + **********************************************************/ + +int Delete_rows_log_event_old::do_before_row_operations(TABLE *table) +{ + DBUG_ASSERT(m_memory == NULL); + + if ((table->file->ha_table_flags() & HA_PRIMARY_KEY_REQUIRED_FOR_POSITION) && + table->s->primary_key < MAX_KEY) + { + /* + We don't need to allocate any memory for m_after_image and + m_key since they are not used. + */ + return 0; + } + + int error= 0; + + if (table->s->keys > 0) + { + m_memory= (uchar*) my_multi_malloc(MYF(MY_WME), + &m_after_image, + (uint) table->s->reclength, + &m_key, + (uint) table->key_info->key_length, + NullS); + } + else + { + m_after_image= (uchar*) my_malloc(table->s->reclength, MYF(MY_WME)); + m_memory= (uchar*)m_after_image; + m_key= NULL; + } + if (!m_memory) + return HA_ERR_OUT_OF_MEM; + + return error; +} + +int Delete_rows_log_event_old::do_after_row_operations(TABLE *table, int error) +{ + /*error= ToDo:find out what this should really be, this triggers close_scan in nbd, returning error?*/ + table->file->ha_index_or_rnd_end(); + my_free(m_memory, MYF(MY_ALLOW_ZERO_PTR)); // Free for multi_malloc + m_memory= NULL; + m_after_image= NULL; + m_key= NULL; + + return error; +} int Delete_rows_log_event_old::do_prepare_row(THD *thd_arg, @@ -57,6 +1074,67 @@ Delete_rows_log_event_old::do_prepare_row(THD *thd_arg, return error; } +int Delete_rows_log_event_old::do_exec_row(TABLE *table) +{ + int error; + DBUG_ASSERT(table != NULL); + + if (!(error= ::find_and_fetch_row(table, m_key))) + { + /* + Now we should have the right row to delete. We are using + record[0] since it is guaranteed to point to a record with the + correct value. + */ + error= table->file->ha_delete_row(table->record[0]); + } + return error; +} + +/********************************************************** + Row handling primitives for Update_rows_log_event_old + **********************************************************/ + +int Update_rows_log_event_old::do_before_row_operations(TABLE *table) +{ + DBUG_ASSERT(m_memory == NULL); + + int error= 0; + + if (table->s->keys > 0) + { + m_memory= (uchar*) my_multi_malloc(MYF(MY_WME), + &m_after_image, + (uint) table->s->reclength, + &m_key, + (uint) table->key_info->key_length, + NullS); + } + else + { + m_after_image= (uchar*) my_malloc(table->s->reclength, MYF(MY_WME)); + m_memory= m_after_image; + m_key= NULL; + } + if (!m_memory) + return HA_ERR_OUT_OF_MEM; + + table->timestamp_field_type= TIMESTAMP_NO_AUTO_SET; + + return error; +} + +int Update_rows_log_event_old::do_after_row_operations(TABLE *table, int error) +{ + /*error= ToDo:find out what this should really be, this triggers close_scan in nbd, returning error?*/ + table->file->ha_index_or_rnd_end(); + my_free(m_memory, MYF(MY_ALLOW_ZERO_PTR)); + m_memory= NULL; + m_after_image= NULL; + m_key= NULL; + + return error; +} int Update_rows_log_event_old::do_prepare_row(THD *thd_arg, RELAY_LOG_INFO const *rli, @@ -101,4 +1179,41 @@ int Update_rows_log_event_old::do_prepare_row(THD *thd_arg, return error; } +int Update_rows_log_event_old::do_exec_row(TABLE *table) +{ + DBUG_ASSERT(table != NULL); + + int error= ::find_and_fetch_row(table, m_key); + if (error) + return error; + + /* + We have to ensure that the new record (i.e., the after image) is + in record[0] and the old record (i.e., the before image) is in + record[1]. This since some storage engines require this (for + example, the partition engine). + + Since find_and_fetch_row() puts the fetched record (i.e., the old + record) in record[1], we can keep it there. We put the new record + (i.e., the after image) into record[0], and copy the fields that + are on the slave (i.e., in record[1]) into record[0], effectively + overwriting the default values that where put there by the + unpack_row() function. + */ + bmove_align(table->record[0], m_after_image, table->s->reclength); + copy_extra_record_fields(table, m_master_reclength, m_width); + + /* + Now we have the right row to update. The old row (the one we're + looking for) is in record[1] and the new row has is in record[0]. + We also have copied the original values already in the slave's + database into the after image delivered from the master. + */ + error= table->file->ha_update_row(table->record[1], table->record[0]); + if (error == HA_ERR_RECORD_IS_THE_SAME) + error= 0; + + return error; +} + #endif diff --git a/sql/log_event_old.h b/sql/log_event_old.h index 7c2932360f5..ffe87a045cc 100644 --- a/sql/log_event_old.h +++ b/sql/log_event_old.h @@ -20,9 +20,90 @@ Need to include this file at the proper position of log_event.h */ - -class Write_rows_log_event_old : public Write_rows_log_event + +class Old_rows_log_event { + public: + + virtual ~Old_rows_log_event() {} + + protected: + +#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) + + int do_apply_event(Rows_log_event*,const RELAY_LOG_INFO*); + + /* + Primitive to prepare for a sequence of row executions. + + DESCRIPTION + + Before doing a sequence of do_prepare_row() and do_exec_row() + calls, this member function should be called to prepare for the + entire sequence. Typically, this member function will allocate + space for any buffers that are needed for the two member + functions mentioned above. + + RETURN VALUE + + The member function will return 0 if all went OK, or a non-zero + error code otherwise. + */ + virtual int do_before_row_operations(TABLE *table) = 0; + + /* + Primitive to clean up after a sequence of row executions. + + DESCRIPTION + + After doing a sequence of do_prepare_row() and do_exec_row(), + this member function should be called to clean up and release + any allocated buffers. + */ + virtual int do_after_row_operations(TABLE *table, int error) = 0; + + /* + Primitive to prepare for handling one row in a row-level event. + + DESCRIPTION + + The member function prepares for execution of operations needed for one + row in a row-level event by reading up data from the buffer containing + the row. No specific interpretation of the data is normally done here, + since SQL thread specific data is not available: that data is made + available for the do_exec function. + + A pointer to the start of the next row, or NULL if the preparation + failed. Currently, preparation cannot fail, but don't rely on this + behavior. + + RETURN VALUE + Error code, if something went wrong, 0 otherwise. + */ + virtual int do_prepare_row(THD*, RELAY_LOG_INFO const*, TABLE*, + uchar const *row_start, + uchar const **row_end) = 0; + + /* + Primitive to do the actual execution necessary for a row. + + DESCRIPTION + The member function will do the actual execution needed to handle a row. + + RETURN VALUE + 0 if execution succeeded, 1 if execution failed. + + */ + virtual int do_exec_row(TABLE *table) = 0; + +#endif /* !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) */ +}; + + +class Write_rows_log_event_old + : public Write_rows_log_event, public Old_rows_log_event +{ + public: enum { @@ -49,14 +130,26 @@ private: virtual Log_event_type get_type_code() { return (Log_event_type)TYPE_CODE; } #if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) + // use old definition of do_apply_event() + virtual int do_apply_event(const RELAY_LOG_INFO *rli) + { return Old_rows_log_event::do_apply_event(this,rli); } + + // primitives for old version of do_apply_event() + virtual int do_before_row_operations(TABLE *table); + virtual int do_after_row_operations(TABLE *table, int error); virtual int do_prepare_row(THD*, RELAY_LOG_INFO const*, TABLE*, uchar const *row_start, uchar const **row_end); + virtual int do_exec_row(TABLE *table); + #endif }; -class Update_rows_log_event_old : public Update_rows_log_event +class Update_rows_log_event_old + : public Update_rows_log_event, public Old_rows_log_event { + uchar *m_after_image, *m_memory; + public: enum { @@ -67,14 +160,16 @@ public: #if !defined(MYSQL_CLIENT) Update_rows_log_event_old(THD *thd, TABLE *table, ulong table_id, MY_BITMAP const *cols, bool is_transactional) - : Update_rows_log_event(thd, table, table_id, cols, is_transactional) + : Update_rows_log_event(thd, table, table_id, cols, is_transactional), + m_after_image(NULL), m_memory(NULL) { } #endif #if defined(HAVE_REPLICATION) Update_rows_log_event_old(const char *buf, uint event_len, const Format_description_log_event *descr) - : Update_rows_log_event(buf, event_len, descr) + : Update_rows_log_event(buf, event_len, descr), + m_after_image(NULL), m_memory(NULL) { } #endif @@ -83,14 +178,25 @@ private: virtual Log_event_type get_type_code() { return (Log_event_type)TYPE_CODE; } #if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) + // use old definition of do_apply_event() + virtual int do_apply_event(const RELAY_LOG_INFO *rli) + { return Old_rows_log_event::do_apply_event(this,rli); } + + // primitives for old version of do_apply_event() + virtual int do_before_row_operations(TABLE *table); + virtual int do_after_row_operations(TABLE *table, int error); virtual int do_prepare_row(THD*, RELAY_LOG_INFO const*, TABLE*, uchar const *row_start, uchar const **row_end); + virtual int do_exec_row(TABLE *table); #endif /* !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) */ }; -class Delete_rows_log_event_old : public Delete_rows_log_event +class Delete_rows_log_event_old + : public Delete_rows_log_event, public Old_rows_log_event { + uchar *m_after_image, *m_memory; + public: enum { @@ -101,14 +207,16 @@ public: #if !defined(MYSQL_CLIENT) Delete_rows_log_event_old(THD *thd, TABLE *table, ulong table_id, MY_BITMAP const *cols, bool is_transactional) - : Delete_rows_log_event(thd, table, table_id, cols, is_transactional) + : Delete_rows_log_event(thd, table, table_id, cols, is_transactional), + m_after_image(NULL), m_memory(NULL) { } #endif #if defined(HAVE_REPLICATION) Delete_rows_log_event_old(const char *buf, uint event_len, const Format_description_log_event *descr) - : Delete_rows_log_event(buf, event_len, descr) + : Delete_rows_log_event(buf, event_len, descr), + m_after_image(NULL), m_memory(NULL) { } #endif @@ -117,8 +225,16 @@ private: virtual Log_event_type get_type_code() { return (Log_event_type)TYPE_CODE; } #if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) + // use old definition of do_apply_event() + virtual int do_apply_event(const RELAY_LOG_INFO *rli) + { return Old_rows_log_event::do_apply_event(this,rli); } + + // primitives for old version of do_apply_event() + virtual int do_before_row_operations(TABLE *table); + virtual int do_after_row_operations(TABLE *table, int error); virtual int do_prepare_row(THD*, RELAY_LOG_INFO const*, TABLE*, uchar const *row_start, uchar const **row_end); + virtual int do_exec_row(TABLE *table); #endif }; diff --git a/sql/rpl_record.cc b/sql/rpl_record.cc index 36dcedb3b88..de4f6e0c337 100644 --- a/sql/rpl_record.cc +++ b/sql/rpl_record.cc @@ -157,9 +157,8 @@ pack_row(TABLE *table, MY_BITMAP const* cols, the various member functions of Field and subclasses expect to write. - The row is assumed to only consist of the fields for which the - bitset represented by @c arr and @c bits; the other parts of the - record are left alone. + The row is assumed to only consist of the fields for which the corresponding + bit in bitset @c cols is set; the other parts of the record are left alone. At most @c colcnt columns are read: if the table is larger than that, the remaining fields are not filled in. @@ -169,15 +168,12 @@ pack_row(TABLE *table, MY_BITMAP const* cols, @param colcnt Number of columns to read from record @param row_data Packed row data - @param cols Pointer to columns data to fill in + @param cols Pointer to bitset describing columns to fill in @param row_end Pointer to variable that will hold the value of the one-after-end position for the row @param master_reclength Pointer to variable that will be set to the length of the record on the master side - @param rw_set Pointer to bitmap that holds either the read_set or the - write_set of the table - @retval 0 No error @@ -191,8 +187,7 @@ int unpack_row(RELAY_LOG_INFO const *rli, TABLE *table, uint const colcnt, uchar const *const row_data, MY_BITMAP const *cols, - uchar const **const row_end, ulong *const master_reclength, - MY_BITMAP* const rw_set, Log_event_type const event_type) + uchar const **const row_end, ulong *const master_reclength) { DBUG_ENTER("unpack_row"); DBUG_ASSERT(row_data); @@ -202,10 +197,6 @@ unpack_row(RELAY_LOG_INFO const *rli, uchar const *null_ptr= row_data; uchar const *pack_ptr= row_data + master_null_byte_count; - bitmap_clear_all(rw_set); - - empty_record(table); - Field **const begin_ptr = table->field; Field **field_ptr; Field **const end_ptr= begin_ptr + colcnt; @@ -265,7 +256,6 @@ unpack_row(RELAY_LOG_INFO const *rli, #endif } - bitmap_set_bit(rw_set, f->field_index); null_mask <<= 1; } i++; @@ -307,30 +297,58 @@ unpack_row(RELAY_LOG_INFO const *rli, else *master_reclength = table->s->reclength; } + + DBUG_RETURN(error); +} - /* - Set properties for remaining columns, if there are any. We let the - corresponding bit in the write_set be set, to write the value if - it was not there already. We iterate over all remaining columns, - even if there were an error, to get as many error messages as - possible. We are still able to return a pointer to the next row, - so redo that. +/** + Fills @c table->record[0] with default values. - This generation of error messages is only relevant when inserting - new rows. - */ - for ( ; *field_ptr ; ++field_ptr) + First @c empty_record() is called and then, additionally, fields are + initialized explicitly with a call to @c set_default(). + + For optimization reasons, the explicit initialization can be skipped for + first @c skip fields. This is useful if later we are going to fill these + fields from other source (e.g. from a Rows replication event). + + If @c check is true, fields are explicitly initialized only if they have + default value or can be NULL. Otherwise error is reported. + + @param log Used to report errors. + @param table Table whose record[0] buffer is prepared. + @param skip Number of columns for which default value initialization + should be skipped. + @param check Indicates if errors should be checked when setting default + values. + + @returns 0 on success. + */ +int prepare_record(const Slave_reporting_capability *const log, + TABLE *const table, + const uint skip, const bool check) +{ + DBUG_ENTER("prepare_record"); + + int error= 0; + empty_record(table); + + if (skip >= table->s->fields) // nothing to do + DBUG_RETURN(0); + + /* Explicit initialization of fields */ + + for (Field **field_ptr= table->field+skip ; *field_ptr ; ++field_ptr) { uint32 const mask= NOT_NULL_FLAG | NO_DEFAULT_VALUE_FLAG; Field *const f= *field_ptr; - if (event_type == WRITE_ROWS_EVENT && - ((*field_ptr)->flags & mask) == mask) + if (check && ((f->flags & mask) == mask)) { - rli->report(ERROR_LEVEL, ER_NO_DEFAULT_FOR_FIELD, + DBUG_ASSERT(log); + log->report(ERROR_LEVEL, ER_NO_DEFAULT_FOR_FIELD, "Field `%s` of table `%s`.`%s` " "has no default value and cannot be NULL", - (*field_ptr)->field_name, table->s->db.str, + f->field_name, table->s->db.str, table->s->table_name.str); error = ER_NO_DEFAULT_FOR_FIELD; } diff --git a/sql/rpl_record.h b/sql/rpl_record.h index 12c2f1fc713..e8fb11bc5de 100644 --- a/sql/rpl_record.h +++ b/sql/rpl_record.h @@ -16,6 +16,8 @@ #ifndef RPL_RECORD_H #define RPL_RECORD_H +#include + #if !defined(MYSQL_CLIENT) size_t pack_row(TABLE* table, MY_BITMAP const* cols, uchar *row_data, const uchar *data); @@ -25,9 +27,11 @@ size_t pack_row(TABLE* table, MY_BITMAP const* cols, int unpack_row(RELAY_LOG_INFO const *rli, TABLE *table, uint const colcnt, uchar const *const row_data, MY_BITMAP const *cols, - uchar const **const row_end, ulong *const master_reclength, - MY_BITMAP* const rw_set, - Log_event_type const event_type); + uchar const **const row_end, ulong *const master_reclength); + +// Fill table's record[0] with default values. +int prepare_record(const Slave_reporting_capability *const, TABLE *const, + const uint =0, const bool =FALSE); #endif #endif diff --git a/sql/rpl_utility.cc b/sql/rpl_utility.cc index 85ed6089f56..bdcd1cee72a 100644 --- a/sql/rpl_utility.cc +++ b/sql/rpl_utility.cc @@ -24,7 +24,7 @@ This function returns the field size in raw bytes based on the type and the encoded field data from the master's raw data. */ -uint32 table_def::calc_field_size(uint col, uchar *master_data) +uint32 table_def::calc_field_size(uint col, uchar *master_data) const { uint32 length; diff --git a/sql/rpl_utility.h b/sql/rpl_utility.h index d08f62363af..96be108de1a 100644 --- a/sql/rpl_utility.h +++ b/sql/rpl_utility.h @@ -218,7 +218,7 @@ public: WL#3915) or needs to advance the pointer for the fields in the raw data from the master to a specific column. */ - uint32 calc_field_size(uint col, uchar *master_data); + uint32 calc_field_size(uint col, uchar *master_data) const; /** Decide if the table definition is compatible with a table. @@ -258,4 +258,44 @@ struct RPL_TABLE_LIST table_def m_tabledef; }; + +/* Anonymous namespace for template functions/classes */ +namespace { + + /* + Smart pointer that will automatically call my_afree (a macro) when + the pointer goes out of scope. This is used so that I do not have + to remember to call my_afree() before each return. There is no + overhead associated with this, since all functions are inline. + + I (Matz) would prefer to use the free function as a template + parameter, but that is not possible when the "function" is a + macro. + */ + template + class auto_afree_ptr + { + Obj* m_ptr; + public: + auto_afree_ptr(Obj* ptr) : m_ptr(ptr) { } + ~auto_afree_ptr() { if (m_ptr) my_afree(m_ptr); } + void assign(Obj* ptr) { + /* Only to be called if it hasn't been given a value before. */ + DBUG_ASSERT(m_ptr == NULL); + m_ptr= ptr; + } + Obj* get() { return m_ptr; } + }; + +} + +#define DBUG_PRINT_BITSET(N,FRM,BS) \ + do { \ + char buf[256]; \ + for (uint i = 0 ; i < (BS)->n_bits ; ++i) \ + buf[i] = bitmap_is_set((BS), i) ? '1' : '0'; \ + buf[(BS)->n_bits] = '\0'; \ + DBUG_PRINT((N), ((FRM), buf)); \ + } while (0) + #endif /* RPL_UTILITY_H */ From a91bd852154e370c37a11a083722287d8c6eea56 Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.(none)" <> Date: Mon, 27 Aug 2007 10:25:34 +0200 Subject: [PATCH 38/90] Bug#28560 mysql_upgrade test links /usr/local/mysql/lib libraries - Chop off .libs/ part of path if running in non installed builddir using libtool --- client/mysql_upgrade.c | 75 +++++++++++++++++++++++------------------- 1 file changed, 42 insertions(+), 33 deletions(-) diff --git a/client/mysql_upgrade.c b/client/mysql_upgrade.c index 13f5d2606a9..630267f1a5e 100644 --- a/client/mysql_upgrade.c +++ b/client/mysql_upgrade.c @@ -342,12 +342,6 @@ static my_bool get_full_path_to_executable(char* path) /* Look for the tool in the same directory as mysql_upgrade. - - When running in a not yet installed build the the program - will exist but it need to be invoked via it's libtool wrapper. - Check if the found tool can executed and if not look in the - directory one step higher up where the libtool wrapper normally - is found */ static void find_tool(char *tool_path, const char *tool_name) @@ -385,37 +379,52 @@ static void find_tool(char *tool_path, const char *tool_name) path[0]= 0; } } - do + + DBUG_PRINT("info", ("path: '%s'", path)); + + /* Chop off binary name (i.e mysql-upgrade) from path */ + dirname_part(path, path); + + /* + When running in a not yet installed build and using libtool, + the program(mysql_upgrade) will be in .libs/ and executed + through a libtool wrapper in order to use the dynamic libraries + from this build. The same must be done for the tools(mysql and + mysqlcheck). Thus if path ends in .libs/, step up one directory + and execute the tools from there + */ + path[max((strlen(path)-1), 0)]= 0; /* Chop off last / */ + if (strncmp(path + dirname_length(path), ".libs", 5) == 0) { - DBUG_PRINT("enter", ("path: %s", path)); + DBUG_PRINT("info", ("Chopping off .libs from '%s'", path)); - /* Chop off last char(since it might be a /) */ - path[max((strlen(path)-1), 0)]= 0; - - /* Chop off last dir part */ + /* Chop off .libs */ dirname_part(path, path); - - /* Format name of the tool to search for */ - fn_format(tool_path, tool_name, - path, "", MYF(MY_REPLACE_DIR)); - - verbose("Looking for '%s' in: %s", tool_name, tool_path); - - /* Make sure the tool exists */ - if (my_access(tool_path, F_OK) != 0) - die("Can't find '%s'", tool_path); - - /* - Make sure it can be executed, otherwise try again - in higher level directory - */ } - while(run_tool(tool_path, - &ds_tmp, /* Get output from command, discard*/ - "--help", - "2>&1", - IF_WIN("> NUL", "> /dev/null"), - NULL)); + + + DBUG_PRINT("info", ("path: '%s'", path)); + + /* Format name of the tool to search for */ + fn_format(tool_path, tool_name, + path, "", MYF(MY_REPLACE_DIR)); + + verbose("Looking for '%s' in: %s", tool_name, tool_path); + + /* Make sure the tool exists */ + if (my_access(tool_path, F_OK) != 0) + die("Can't find '%s'", tool_path); + + /* + Make sure it can be executed + */ + if (run_tool(tool_path, + &ds_tmp, /* Get output from command, discard*/ + "--help", + "2>&1", + IF_WIN("> NUL", "> /dev/null"), + NULL)) + die("Can't execute '%s'", tool_path); dynstr_free(&ds_tmp); From 682258a699d5906c2372df93da646672ef303e54 Mon Sep 17 00:00:00 2001 From: "gkodinov/kgeorge@magare.gmz" <> Date: Mon, 27 Aug 2007 12:15:01 +0300 Subject: [PATCH 39/90] recommit of Addendum to bug #29325 to 5.1.22 tree keep_files_on_create made a startup option --- sql/mysqld.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index e2d05238ee9..69db04ff210 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -5081,7 +5081,8 @@ enum options_mysqld OPT_SECURE_FILE_PRIV, OPT_MIN_EXAMINED_ROW_LIMIT, OPT_LOG_SLOW_SLAVE_STATEMENTS, - OPT_OLD_MODE + OPT_OLD_MODE, + OPT_KEEP_FILES_ON_CREATE }; @@ -5951,6 +5952,11 @@ log and this option does nothing anymore.", (uchar**) &max_system_variables.join_buff_size, 0, GET_ULONG, REQUIRED_ARG, 128*1024L, IO_SIZE*2+MALLOC_OVERHEAD, ~0L, MALLOC_OVERHEAD, IO_SIZE, 0}, + {"keep_files_on_create", OPT_KEEP_FILES_ON_CREATE, + "Don't overwrite stale .MYD and .MYI even if no directory is specified.", + (gptr*) &global_system_variables.keep_files_on_create, + (gptr*) &max_system_variables.keep_files_on_create, + 0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0}, {"key_buffer_size", OPT_KEY_BUFFER_SIZE, "The size of the buffer used for index blocks for MyISAM tables. Increase this to get better index handling (for all reads and multiple writes) to as much as you can afford; 64M on a 256M machine that mainly runs MySQL is quite common.", (uchar**) &dflt_key_cache_var.param_buff_size, From def81f98e74030eae371c3b4bee7591be088861e Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.(none)" <> Date: Mon, 27 Aug 2007 11:20:31 +0200 Subject: [PATCH 40/90] Bug#28560 mysql_upgrade test links /usr/local/mysql/lib libraries - Remove disabling of mysql_upgrade --- mysql-test/t/disabled.def | 1 - 1 file changed, 1 deletion(-) diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def index c5aaa1ee0f5..0ba56a74f57 100644 --- a/mysql-test/t/disabled.def +++ b/mysql-test/t/disabled.def @@ -23,5 +23,4 @@ im_utils : BUG#28743 Instance manager generates warnings in test concurrent_innodb : BUG#21579 2006-08-11 mleich innodb_concurrent random failures with varying differences ctype_big5 : BUG#26711 2007-06-21 Lars Test has never worked on Double Whopper -mysql_upgrade : Bug#28560 test links to /usr/local/mysql/lib libraries, causes non-determinism and failures on ABI breakage federated_transactions : Bug#29523 Transactions do not work From 56a880179fdfae4a7e46ad332cee1d7dfec99d7c Mon Sep 17 00:00:00 2001 From: "gkodinov/kgeorge@magare.gmz" <> Date: Mon, 27 Aug 2007 12:21:47 +0300 Subject: [PATCH 41/90] recommit of Bug 25228 for 5.1.22: rpl_relayspace.test fails on powermacg5, vm-win2003-32-a A test case was waiting for a fixed number of seconds for a specific state of the slave IO thread to take place. Fixed by waiting in a loop for that specific thread state instead (or timeout). --- mysql-test/suite/rpl/t/rpl_relayspace.test | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/mysql-test/suite/rpl/t/rpl_relayspace.test b/mysql-test/suite/rpl/t/rpl_relayspace.test index 70315c14f34..d4ef2fe59bd 100644 --- a/mysql-test/suite/rpl/t/rpl_relayspace.test +++ b/mysql-test/suite/rpl/t/rpl_relayspace.test @@ -14,6 +14,22 @@ connection slave; reset slave; start slave io_thread; # Give the I/O thread time to block. +let $run= 1; +let $counter= 300; +while ($run) +{ + let $io_state= query_get_value("SHOW SLAVE STATUS", Slave_IO_State, 1); + if (`SELECT '$io_state' = 'Waiting for the slave SQL thread to free enough relay log space'`){ + let $run= 0; + } + sleep 0.1; + if (!$counter){ + --echo "Failed while waiting for slave IO thread block" + SHOW SLAVE STATUS; + exit; + } + dec $counter; +} sleep 2; # A bug caused the I/O thread to refuse stopping. stop slave io_thread; From f5489f67e9dcd7010959a49ebe0ef1c72a099ab1 Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.(none)" <> Date: Mon, 27 Aug 2007 11:23:10 +0200 Subject: [PATCH 42/90] Bug#30029 mysql_upgrade fails for 5.0 -> 5.1.21, 5.1.20 -> 5.1.21 upgrades - Change to use '' to quote a string inside another string --- scripts/mysql_system_tables.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/mysql_system_tables.sql b/scripts/mysql_system_tables.sql index cd0882e3af4..81eb3340d32 100644 --- a/scripts/mysql_system_tables.sql +++ b/scripts/mysql_system_tables.sql @@ -65,7 +65,7 @@ CREATE TABLE IF NOT EXISTS procs_priv ( Host char(60) binary DEFAULT '' NOT NULL -- Create general_log if CSV is enabled. -SET @str = IF (@@have_csv = 'YES', 'CREATE TABLE IF NOT EXISTS general_log (event_time TIMESTAMP NOT NULL, user_host MEDIUMTEXT, thread_id INTEGER, server_id INTEGER, command_type VARCHAR(64), argument MEDIUMTEXT) engine=CSV CHARACTER SET utf8 comment="General log"', 'SET @dummy = 0'); +SET @str = IF (@@have_csv = 'YES', 'CREATE TABLE IF NOT EXISTS general_log (event_time TIMESTAMP NOT NULL, user_host MEDIUMTEXT, thread_id INTEGER, server_id INTEGER, command_type VARCHAR(64), argument MEDIUMTEXT) engine=CSV CHARACTER SET utf8 comment=''General log''', 'SET @dummy = 0'); PREPARE stmt FROM @str; EXECUTE stmt; @@ -73,7 +73,7 @@ DROP PREPARE stmt; -- Create slow_log if CSV is enabled. -SET @str = IF (@@have_csv = 'YES', 'CREATE TABLE IF NOT EXISTS slow_log (start_time TIMESTAMP NOT NULL, user_host MEDIUMTEXT NOT NULL, query_time TIME NOT NULL, lock_time TIME NOT NULL, rows_sent INTEGER NOT NULL, rows_examined INTEGER NOT NULL, db VARCHAR(512), last_insert_id INTEGER, insert_id INTEGER, server_id INTEGER, sql_text MEDIUMTEXT NOT NULL) engine=CSV CHARACTER SET utf8 comment="Slow log"', 'SET @dummy = 0'); +SET @str = IF (@@have_csv = 'YES', 'CREATE TABLE IF NOT EXISTS slow_log (start_time TIMESTAMP NOT NULL, user_host MEDIUMTEXT NOT NULL, query_time TIME NOT NULL, lock_time TIME NOT NULL, rows_sent INTEGER NOT NULL, rows_examined INTEGER NOT NULL, db VARCHAR(512), last_insert_id INTEGER, insert_id INTEGER, server_id INTEGER, sql_text MEDIUMTEXT NOT NULL) engine=CSV CHARACTER SET utf8 comment=''Slow log''', 'SET @dummy = 0'); PREPARE stmt FROM @str; EXECUTE stmt; From e6b50eb51b62de11d00208548ed1d2c245040ed9 Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.(none)" <> Date: Mon, 27 Aug 2007 11:27:03 +0200 Subject: [PATCH 43/90] Bug#30487 mysql_upgrade reports misleading errors - Update result file to include these "misleading errors", better to run mysql_upgrade with them than not at all. --- mysql-test/r/mysql_upgrade.result | 32 +++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/mysql-test/r/mysql_upgrade.result b/mysql-test/r/mysql_upgrade.result index 30ece1b121a..31846f68b7b 100644 --- a/mysql-test/r/mysql_upgrade.result +++ b/mysql-test/r/mysql_upgrade.result @@ -3,7 +3,9 @@ mysql.columns_priv OK mysql.db OK mysql.event OK mysql.func OK -mysql.general_log OK +mysql.general_log +Error : You can't use locks with log tables. +status : OK mysql.help_category OK mysql.help_keyword OK mysql.help_relation OK @@ -14,7 +16,9 @@ mysql.plugin OK mysql.proc OK mysql.procs_priv OK mysql.servers OK -mysql.slow_log OK +mysql.slow_log +Error : You can't use locks with log tables. +status : OK mysql.tables_priv OK mysql.time_zone OK mysql.time_zone_leap_second OK @@ -29,7 +33,9 @@ mysql.columns_priv OK mysql.db OK mysql.event OK mysql.func OK -mysql.general_log OK +mysql.general_log +Error : You can't use locks with log tables. +status : OK mysql.help_category OK mysql.help_keyword OK mysql.help_relation OK @@ -40,7 +46,9 @@ mysql.plugin OK mysql.proc OK mysql.procs_priv OK mysql.servers OK -mysql.slow_log OK +mysql.slow_log +Error : You can't use locks with log tables. +status : OK mysql.tables_priv OK mysql.time_zone OK mysql.time_zone_leap_second OK @@ -55,7 +63,9 @@ mysql.columns_priv OK mysql.db OK mysql.event OK mysql.func OK -mysql.general_log OK +mysql.general_log +Error : You can't use locks with log tables. +status : OK mysql.help_category OK mysql.help_keyword OK mysql.help_relation OK @@ -66,7 +76,9 @@ mysql.plugin OK mysql.proc OK mysql.procs_priv OK mysql.servers OK -mysql.slow_log OK +mysql.slow_log +Error : You can't use locks with log tables. +status : OK mysql.tables_priv OK mysql.time_zone OK mysql.time_zone_leap_second OK @@ -83,7 +95,9 @@ mysql.columns_priv OK mysql.db OK mysql.event OK mysql.func OK -mysql.general_log OK +mysql.general_log +Error : You can't use locks with log tables. +status : OK mysql.help_category OK mysql.help_keyword OK mysql.help_relation OK @@ -94,7 +108,9 @@ mysql.plugin OK mysql.proc OK mysql.procs_priv OK mysql.servers OK -mysql.slow_log OK +mysql.slow_log +Error : You can't use locks with log tables. +status : OK mysql.tables_priv OK mysql.time_zone OK mysql.time_zone_leap_second OK From f9c245611ecedcaa320442ccb306400653f15e9d Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.(none)" <> Date: Mon, 27 Aug 2007 11:31:49 +0200 Subject: [PATCH 44/90] Bug#29805 mysql_upgrade test fail if ~/.my.cnf contain a password - "mysql" and "mysqlcheck" should not read defaults file --- client/mysql_upgrade.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/client/mysql_upgrade.c b/client/mysql_upgrade.c index 630267f1a5e..fb30c6f2613 100644 --- a/client/mysql_upgrade.c +++ b/client/mysql_upgrade.c @@ -455,6 +455,7 @@ static int run_query(const char *query, DYNAMIC_STRING *ds_res, ret= run_tool(mysql_path, ds_res, + "--no-defaults", ds_args.str, "--database=mysql", "--batch", /* Turns off pager etc. */ @@ -617,6 +618,7 @@ static int run_mysqlcheck_upgrade(void) verbose("Running 'mysqlcheck'..."); return run_tool(mysqlcheck_path, NULL, /* Send output from mysqlcheck directly to screen */ + "--no-defaults", ds_args.str, "--check-upgrade", "--all-databases", From 424e70353f53300eb2365560fddc9fc37de35fa2 Mon Sep 17 00:00:00 2001 From: "gkodinov/kgeorge@magare.gmz" <> Date: Mon, 27 Aug 2007 12:33:57 +0300 Subject: [PATCH 45/90] re-push of Bug 29536 for 5.1.22: timestamp inconsistent in replication around 1970 MySQL replicates the time zone only when operations that involve it are performed. This is controlled by a flag. But this flag is set only on successful operation. The flag must be set also when there is an error that involves a timezone (so the master would replicate the error to the slaves). --- mysql-test/suite/rpl/r/rpl_timezone.result | 18 ++++++++++++++ mysql-test/suite/rpl/t/rpl_timezone.test | 29 +++++++++++++++++++++- sql/field.cc | 6 ++--- sql/time.cc | 2 +- 4 files changed, 50 insertions(+), 5 deletions(-) diff --git a/mysql-test/suite/rpl/r/rpl_timezone.result b/mysql-test/suite/rpl/r/rpl_timezone.result index 47ef16b9d49..cd71dbe628e 100644 --- a/mysql-test/suite/rpl/r/rpl_timezone.result +++ b/mysql-test/suite/rpl/r/rpl_timezone.result @@ -105,3 +105,21 @@ t n 2005-01-01 08:00:00 17 drop table t1, t2; set global time_zone= @my_time_zone; +End of 4.1 tests +CREATE TABLE t1 (a INT, b TIMESTAMP); +INSERT INTO t1 VALUES (1, NOW()); +SET @@session.time_zone='Japan'; +UPDATE t1 SET b= '1970-01-01 08:59:59' WHERE a= 1; +Warnings: +Warning 1264 Out of range value for column 'b' at row 1 +SELECT * FROM t1 ORDER BY a; +a b +1 0000-00-00 00:00:00 +SET @@session.time_zone='Japan'; +SELECT * FROM t1 ORDER BY a; +a b +1 0000-00-00 00:00:00 +SET @@session.time_zone = default; +DROP TABLE t1; +SET @@session.time_zone = default; +End of 5.0 tests diff --git a/mysql-test/suite/rpl/t/rpl_timezone.test b/mysql-test/suite/rpl/t/rpl_timezone.test index 4b8c8152c82..c6ad7af7846 100644 --- a/mysql-test/suite/rpl/t/rpl_timezone.test +++ b/mysql-test/suite/rpl/t/rpl_timezone.test @@ -139,4 +139,31 @@ sync_slave_with_master; # Restore original timezone connection master; -set global time_zone= @my_time_zone; +set global time_zone= @my_te_zone; + +--echo End of 4.1 tests + +# +# Bug #29536: timestamp inconsistent in replication around 1970 +# +connection master; + +CREATE TABLE t1 (a INT, b TIMESTAMP); +INSERT INTO t1 VALUES (1, NOW()); + +SET @@session.time_zone='Japan'; +UPDATE t1 SET b= '1970-01-01 08:59:59' WHERE a= 1; +SELECT * FROM t1 ORDER BY a; + +sync_slave_with_master; +SET @@session.time_zone='Japan'; +# must procdure the same result as the SELECT on the master +SELECT * FROM t1 ORDER BY a; + +SET @@session.time_zone = default; +connection master; +DROP TABLE t1; +SET @@session.time_zone = default; + + +--echo End of 5.0 tests diff --git a/sql/field.cc b/sql/field.cc index 49ffc6a252e..23dca96164e 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -4655,6 +4655,7 @@ longlong Field_timestamp::val_int(void) MYSQL_TIME time_tmp; THD *thd= table ? table->in_use : current_thd; + thd->time_zone_used= 1; #ifdef WORDS_BIGENDIAN if (table && table->s->db_low_byte_first) temp=uint4korr(ptr); @@ -4666,7 +4667,6 @@ longlong Field_timestamp::val_int(void) return(0); /* purecov: inspected */ thd->variables.time_zone->gmt_sec_to_TIME(&time_tmp, (my_time_t)temp); - thd->time_zone_used= 1; return time_tmp.year * LL(10000000000) + time_tmp.month * LL(100000000) + time_tmp.day * 1000000L + time_tmp.hour * 10000L + @@ -4686,6 +4686,7 @@ String *Field_timestamp::val_str(String *val_buffer, String *val_ptr) to= (char*) val_buffer->ptr(); val_buffer->length(field_length); + thd->time_zone_used= 1; #ifdef WORDS_BIGENDIAN if (table && table->s->db_low_byte_first) temp=uint4korr(ptr); @@ -4701,7 +4702,6 @@ String *Field_timestamp::val_str(String *val_buffer, String *val_ptr) val_buffer->set_charset(&my_charset_bin); // Safety thd->variables.time_zone->gmt_sec_to_TIME(&time_tmp,(my_time_t)temp); - thd->time_zone_used= 1; temp= time_tmp.year % 100; if (temp < YY_PART_YEAR - 1) @@ -4751,6 +4751,7 @@ bool Field_timestamp::get_date(MYSQL_TIME *ltime, uint fuzzydate) { long temp; THD *thd= table ? table->in_use : current_thd; + thd->time_zone_used= 1; #ifdef WORDS_BIGENDIAN if (table && table->s->db_low_byte_first) temp=uint4korr(ptr); @@ -4766,7 +4767,6 @@ bool Field_timestamp::get_date(MYSQL_TIME *ltime, uint fuzzydate) else { thd->variables.time_zone->gmt_sec_to_TIME(ltime, (my_time_t)temp); - thd->time_zone_used= 1; } return 0; } diff --git a/sql/time.cc b/sql/time.cc index c552d085f5e..a6619cf4cee 100644 --- a/sql/time.cc +++ b/sql/time.cc @@ -263,11 +263,11 @@ my_time_t TIME_to_timestamp(THD *thd, const MYSQL_TIME *t, my_bool *in_dst_time_ my_time_t timestamp; *in_dst_time_gap= 0; + thd->time_zone_used= 1; timestamp= thd->variables.time_zone->TIME_to_gmt_sec(t, in_dst_time_gap); if (timestamp) { - thd->time_zone_used= 1; return timestamp; } From c45f5bc6917ef0db90e2e72a571a6976d43f0056 Mon Sep 17 00:00:00 2001 From: "tomas@whalegate.ndb.mysql.com" <> Date: Mon, 27 Aug 2007 13:13:00 +0200 Subject: [PATCH 46/90] repair some rpl_ndb test cases --- .../suite/rpl_ndb/r/rpl_ndb_innodb2ndb.result | 855 ++++++++++++++++++ .../suite/rpl_ndb/r/rpl_ndb_myisam2ndb.result | 855 ++++++++++++++++++ .../rpl_ndb/t/rpl_ndb_innodb2ndb-slave.opt | 2 +- .../suite/rpl_ndb/t/rpl_ndb_innodb2ndb.test | 3 +- .../rpl_ndb/t/rpl_ndb_myisam2ndb-master.opt | 1 - .../rpl_ndb/t/rpl_ndb_myisam2ndb-slave.opt | 2 +- .../suite/rpl_ndb/t/rpl_ndb_myisam2ndb.test | 2 + 7 files changed, 1716 insertions(+), 4 deletions(-) create mode 100644 mysql-test/suite/rpl_ndb/r/rpl_ndb_innodb2ndb.result create mode 100644 mysql-test/suite/rpl_ndb/r/rpl_ndb_myisam2ndb.result delete mode 100644 mysql-test/suite/rpl_ndb/t/rpl_ndb_myisam2ndb-master.opt diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_innodb2ndb.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_innodb2ndb.result new file mode 100644 index 00000000000..cf4c67f063b --- /dev/null +++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_innodb2ndb.result @@ -0,0 +1,855 @@ +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; +SET storage_engine=innodb; +--- Doing pre test cleanup --- +DROP TABLE IF EXISTS t1; +--- Start test 1 Basic testing --- +--- Create Table Section --- +CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(255), +bc CHAR(255), d DECIMAL(10,4) DEFAULT 0, +f FLOAT DEFAULT 0, total BIGINT UNSIGNED, +y YEAR, t DATE,PRIMARY KEY(id)); +--- Show table on master --- +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` mediumint(9) NOT NULL, + `b1` bit(8) DEFAULT NULL, + `vc` varchar(255) DEFAULT NULL, + `bc` char(255) DEFAULT NULL, + `d` decimal(10,4) DEFAULT '0.0000', + `f` float DEFAULT '0', + `total` bigint(20) unsigned DEFAULT NULL, + `y` year(4) DEFAULT NULL, + `t` date DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +--- Show table on slave --- +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` mediumint(9) NOT NULL, + `b1` bit(8) DEFAULT NULL, + `vc` varchar(255) DEFAULT NULL, + `bc` char(255) DEFAULT NULL, + `d` decimal(10,4) DEFAULT '0.0000', + `f` float DEFAULT '0', + `total` bigint(20) unsigned DEFAULT NULL, + `y` year(4) DEFAULT NULL, + `t` date DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 +--- Perform basic operation on master --- +--- and ensure replicated correctly --- +"--- Insert into t1 --" as ""; +--- Select from t1 on master --- +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; +id hex(b1) vc bc d f total y t +2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 +4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 +42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 +142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 +412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 +--- Select from t1 on slave --- +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; +id hex(b1) vc bc d f total y t +2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 +4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 +42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 +142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 +412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 +--- Update t1 on master -- +UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412; +--- Check the update on master --- +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; +id hex(b1) vc bc d f total y t +412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 +--- Check Update on slave --- +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; +id hex(b1) vc bc d f total y t +412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 +--- Remove a record from t1 on master --- +DELETE FROM t1 WHERE id = 42; +--- Show current count on master for t1 --- +SELECT COUNT(*) FROM t1; +COUNT(*) +4 +--- Show current count on slave for t1 --- +SELECT COUNT(*) FROM t1; +COUNT(*) +4 +DELETE FROM t1; +--- Check that simple Alter statements are replicated correctly -- +ALTER TABLE t1 DROP PRIMARY KEY, ADD PRIMARY KEY(id, total); +ALTER TABLE t1 MODIFY vc TEXT; +--- Show the new improved table on the master --- +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` mediumint(9) NOT NULL, + `b1` bit(8) DEFAULT NULL, + `vc` text, + `bc` char(255) DEFAULT NULL, + `d` decimal(10,4) DEFAULT '0.0000', + `f` float DEFAULT '0', + `total` bigint(20) unsigned NOT NULL DEFAULT '0', + `y` year(4) DEFAULT NULL, + `t` date DEFAULT NULL, + PRIMARY KEY (`id`,`total`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +--- Make sure that our tables on slave are still same engine --- +--- and that the alter statements replicated correctly --- +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` mediumint(9) NOT NULL, + `b1` bit(8) DEFAULT NULL, + `vc` text, + `bc` char(255) DEFAULT NULL, + `d` decimal(10,4) DEFAULT '0.0000', + `f` float DEFAULT '0', + `total` bigint(20) unsigned NOT NULL DEFAULT '0', + `y` year(4) DEFAULT NULL, + `t` date DEFAULT NULL, + PRIMARY KEY (`id`,`total`) +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 +--- Perform basic operation on master --- +--- and ensure replicated correctly --- +"--- Insert into t1 --" as ""; +--- Select from t1 on master --- +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; +id hex(b1) vc bc d f total y t +2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 +4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 +42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 +142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 +412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 +--- Select from t1 on slave --- +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; +id hex(b1) vc bc d f total y t +2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 +4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 +42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 +142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 +412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 +--- Update t1 on master -- +UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412; +--- Check the update on master --- +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; +id hex(b1) vc bc d f total y t +412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 +--- Check Update on slave --- +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; +id hex(b1) vc bc d f total y t +412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 +--- Remove a record from t1 on master --- +DELETE FROM t1 WHERE id = 42; +--- Show current count on master for t1 --- +SELECT COUNT(*) FROM t1; +COUNT(*) +4 +--- Show current count on slave for t1 --- +SELECT COUNT(*) FROM t1; +COUNT(*) +4 +DELETE FROM t1; +--- End test 1 Basic testing --- +--- Do Cleanup -- +DROP TABLE IF EXISTS t1; +--- Start test 2 partition RANGE testing -- +--- Do setup -- +CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(255), +bc CHAR(255), d DECIMAL(10,4) DEFAULT 0, +f FLOAT DEFAULT 0, total BIGINT UNSIGNED, +y YEAR, t DATE) +PARTITION BY RANGE (YEAR(t)) +(PARTITION p0 VALUES LESS THAN (1901), +PARTITION p1 VALUES LESS THAN (1946), +PARTITION p2 VALUES LESS THAN (1966), +PARTITION p3 VALUES LESS THAN (1986), +PARTITION p4 VALUES LESS THAN (2005), +PARTITION p5 VALUES LESS THAN MAXVALUE); +--- Show table on master --- +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` mediumint(9) NOT NULL, + `b1` bit(8) DEFAULT NULL, + `vc` varchar(255) DEFAULT NULL, + `bc` char(255) DEFAULT NULL, + `d` decimal(10,4) DEFAULT '0.0000', + `f` float DEFAULT '0', + `total` bigint(20) unsigned DEFAULT NULL, + `y` year(4) DEFAULT NULL, + `t` date DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = InnoDB, PARTITION p1 VALUES LESS THAN (1946) ENGINE = InnoDB, PARTITION p2 VALUES LESS THAN (1966) ENGINE = InnoDB, PARTITION p3 VALUES LESS THAN (1986) ENGINE = InnoDB, PARTITION p4 VALUES LESS THAN (2005) ENGINE = InnoDB, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ +--- Show table on slave -- +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` mediumint(9) NOT NULL, + `b1` bit(8) DEFAULT NULL, + `vc` varchar(255) DEFAULT NULL, + `bc` char(255) DEFAULT NULL, + `d` decimal(10,4) DEFAULT '0.0000', + `f` float DEFAULT '0', + `total` bigint(20) unsigned DEFAULT NULL, + `y` year(4) DEFAULT NULL, + `t` date DEFAULT NULL +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = ndbcluster, PARTITION p1 VALUES LESS THAN (1946) ENGINE = ndbcluster, PARTITION p2 VALUES LESS THAN (1966) ENGINE = ndbcluster, PARTITION p3 VALUES LESS THAN (1986) ENGINE = ndbcluster, PARTITION p4 VALUES LESS THAN (2005) ENGINE = ndbcluster, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ndbcluster) */ +--- Perform basic operation on master --- +--- and ensure replicated correctly --- +"--- Insert into t1 --" as ""; +--- Select from t1 on master --- +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; +id hex(b1) vc bc d f total y t +2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 +4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 +42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 +142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 +412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 +--- Select from t1 on slave --- +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; +id hex(b1) vc bc d f total y t +2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 +4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 +42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 +142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 +412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 +--- Update t1 on master -- +UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412; +--- Check the update on master --- +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; +id hex(b1) vc bc d f total y t +412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 +--- Check Update on slave --- +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; +id hex(b1) vc bc d f total y t +412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 +--- Remove a record from t1 on master --- +DELETE FROM t1 WHERE id = 42; +--- Show current count on master for t1 --- +SELECT COUNT(*) FROM t1; +COUNT(*) +4 +--- Show current count on slave for t1 --- +SELECT COUNT(*) FROM t1; +COUNT(*) +4 +DELETE FROM t1; +--- Check that simple Alter statements are replicated correctly --- +ALTER TABLE t1 ADD PRIMARY KEY(t,id); +ALTER TABLE t1 MODIFY vc TEXT; +--- Show the new improved table on the master --- +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` mediumint(9) NOT NULL, + `b1` bit(8) DEFAULT NULL, + `vc` text, + `bc` char(255) DEFAULT NULL, + `d` decimal(10,4) DEFAULT '0.0000', + `f` float DEFAULT '0', + `total` bigint(20) unsigned DEFAULT NULL, + `y` year(4) DEFAULT NULL, + `t` date NOT NULL DEFAULT '0000-00-00', + PRIMARY KEY (`t`,`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = InnoDB, PARTITION p1 VALUES LESS THAN (1946) ENGINE = InnoDB, PARTITION p2 VALUES LESS THAN (1966) ENGINE = InnoDB, PARTITION p3 VALUES LESS THAN (1986) ENGINE = InnoDB, PARTITION p4 VALUES LESS THAN (2005) ENGINE = InnoDB, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ +--- Make sure that our tables on slave are still same engine --- +--- and that the alter statements replicated correctly --- +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` mediumint(9) NOT NULL, + `b1` bit(8) DEFAULT NULL, + `vc` text, + `bc` char(255) DEFAULT NULL, + `d` decimal(10,4) DEFAULT '0.0000', + `f` float DEFAULT '0', + `total` bigint(20) unsigned DEFAULT NULL, + `y` year(4) DEFAULT NULL, + `t` date NOT NULL DEFAULT '0000-00-00', + PRIMARY KEY (`t`,`id`) +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = ndbcluster, PARTITION p1 VALUES LESS THAN (1946) ENGINE = ndbcluster, PARTITION p2 VALUES LESS THAN (1966) ENGINE = ndbcluster, PARTITION p3 VALUES LESS THAN (1986) ENGINE = ndbcluster, PARTITION p4 VALUES LESS THAN (2005) ENGINE = ndbcluster, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ndbcluster) */ +--- Perform basic operation on master --- +--- and ensure replicated correctly --- +"--- Insert into t1 --" as ""; +--- Select from t1 on master --- +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; +id hex(b1) vc bc d f total y t +2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 +4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 +42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 +142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 +412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 +--- Select from t1 on slave --- +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; +id hex(b1) vc bc d f total y t +2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 +4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 +42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 +142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 +412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 +--- Update t1 on master -- +UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412; +--- Check the update on master --- +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; +id hex(b1) vc bc d f total y t +412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 +--- Check Update on slave --- +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; +id hex(b1) vc bc d f total y t +412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 +--- Remove a record from t1 on master --- +DELETE FROM t1 WHERE id = 42; +--- Show current count on master for t1 --- +SELECT COUNT(*) FROM t1; +COUNT(*) +4 +--- Show current count on slave for t1 --- +SELECT COUNT(*) FROM t1; +COUNT(*) +4 +DELETE FROM t1; +--- End test 2 partition RANGE testing --- +--- Do Cleanup --- +DROP TABLE IF EXISTS t1; +--- Start test 3 partition LIST testing --- +--- Do setup --- +CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(255), +bc CHAR(255), d DECIMAL(10,4) DEFAULT 0, +f FLOAT DEFAULT 0, total BIGINT UNSIGNED, +y YEAR, t DATE) +PARTITION BY LIST(id) +(PARTITION p0 VALUES IN (2, 4), +PARTITION p1 VALUES IN (42, 142)); +--- Test 3 Alter to add partition --- +ALTER TABLE t1 ADD PARTITION (PARTITION p2 VALUES IN (412)); +--- Show table on master --- +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` mediumint(9) NOT NULL, + `b1` bit(8) DEFAULT NULL, + `vc` varchar(255) DEFAULT NULL, + `bc` char(255) DEFAULT NULL, + `d` decimal(10,4) DEFAULT '0.0000', + `f` float DEFAULT '0', + `total` bigint(20) unsigned DEFAULT NULL, + `y` year(4) DEFAULT NULL, + `t` date DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = InnoDB, PARTITION p1 VALUES IN (42,142) ENGINE = InnoDB, PARTITION p2 VALUES IN (412) ENGINE = InnoDB) */ +--- Show table on slave --- +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` mediumint(9) NOT NULL, + `b1` bit(8) DEFAULT NULL, + `vc` varchar(255) DEFAULT NULL, + `bc` char(255) DEFAULT NULL, + `d` decimal(10,4) DEFAULT '0.0000', + `f` float DEFAULT '0', + `total` bigint(20) unsigned DEFAULT NULL, + `y` year(4) DEFAULT NULL, + `t` date DEFAULT NULL +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = ndbcluster, PARTITION p1 VALUES IN (42,142) ENGINE = ndbcluster, PARTITION p2 VALUES IN (412) ENGINE = ndbcluster) */ +--- Perform basic operation on master --- +--- and ensure replicated correctly --- +"--- Insert into t1 --" as ""; +--- Select from t1 on master --- +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; +id hex(b1) vc bc d f total y t +2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 +4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 +42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 +142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 +412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 +--- Select from t1 on slave --- +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; +id hex(b1) vc bc d f total y t +2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 +4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 +42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 +142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 +412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 +--- Update t1 on master -- +UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412; +--- Check the update on master --- +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; +id hex(b1) vc bc d f total y t +412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 +--- Check Update on slave --- +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; +id hex(b1) vc bc d f total y t +412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 +--- Remove a record from t1 on master --- +DELETE FROM t1 WHERE id = 42; +--- Show current count on master for t1 --- +SELECT COUNT(*) FROM t1; +COUNT(*) +4 +--- Show current count on slave for t1 --- +SELECT COUNT(*) FROM t1; +COUNT(*) +4 +DELETE FROM t1; +--- Check that simple Alter statements are replicated correctly --- +ALTER TABLE t1 ADD PRIMARY KEY(id); +ALTER TABLE t1 MODIFY vc TEXT; +--- Show the new improved table on the master --- +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` mediumint(9) NOT NULL, + `b1` bit(8) DEFAULT NULL, + `vc` text, + `bc` char(255) DEFAULT NULL, + `d` decimal(10,4) DEFAULT '0.0000', + `f` float DEFAULT '0', + `total` bigint(20) unsigned DEFAULT NULL, + `y` year(4) DEFAULT NULL, + `t` date DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = InnoDB, PARTITION p1 VALUES IN (42,142) ENGINE = InnoDB, PARTITION p2 VALUES IN (412) ENGINE = InnoDB) */ +--- Make sure that our tables on slave are still same engine --- +--- and that the alter statements replicated correctly --- +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` mediumint(9) NOT NULL, + `b1` bit(8) DEFAULT NULL, + `vc` text, + `bc` char(255) DEFAULT NULL, + `d` decimal(10,4) DEFAULT '0.0000', + `f` float DEFAULT '0', + `total` bigint(20) unsigned DEFAULT NULL, + `y` year(4) DEFAULT NULL, + `t` date DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = ndbcluster, PARTITION p1 VALUES IN (42,142) ENGINE = ndbcluster, PARTITION p2 VALUES IN (412) ENGINE = ndbcluster) */ +--- Perform basic operation on master --- +--- and ensure replicated correctly --- +"--- Insert into t1 --" as ""; +--- Select from t1 on master --- +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; +id hex(b1) vc bc d f total y t +2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 +4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 +42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 +142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 +412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 +--- Select from t1 on slave --- +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; +id hex(b1) vc bc d f total y t +2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 +4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 +42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 +142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 +412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 +--- Update t1 on master -- +UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412; +--- Check the update on master --- +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; +id hex(b1) vc bc d f total y t +412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 +--- Check Update on slave --- +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; +id hex(b1) vc bc d f total y t +412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 +--- Remove a record from t1 on master --- +DELETE FROM t1 WHERE id = 42; +--- Show current count on master for t1 --- +SELECT COUNT(*) FROM t1; +COUNT(*) +4 +--- Show current count on slave for t1 --- +SELECT COUNT(*) FROM t1; +COUNT(*) +4 +DELETE FROM t1; +--- End test 3 partition LIST testing --- +--- Do Cleanup -- +DROP TABLE IF EXISTS t1; +--- Start test 4 partition HASH testing --- +--- Do setup --- +CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(255), +bc CHAR(255), d DECIMAL(10,4) DEFAULT 0, +f FLOAT DEFAULT 0, total BIGINT UNSIGNED, +y YEAR, t DATE) +PARTITION BY HASH( YEAR(t) ) +PARTITIONS 4; +--- show that tables have been created correctly --- +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` mediumint(9) NOT NULL, + `b1` bit(8) DEFAULT NULL, + `vc` varchar(255) DEFAULT NULL, + `bc` char(255) DEFAULT NULL, + `d` decimal(10,4) DEFAULT '0.0000', + `f` float DEFAULT '0', + `total` bigint(20) unsigned DEFAULT NULL, + `y` year(4) DEFAULT NULL, + `t` date DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4 */ +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` mediumint(9) NOT NULL, + `b1` bit(8) DEFAULT NULL, + `vc` varchar(255) DEFAULT NULL, + `bc` char(255) DEFAULT NULL, + `d` decimal(10,4) DEFAULT '0.0000', + `f` float DEFAULT '0', + `total` bigint(20) unsigned DEFAULT NULL, + `y` year(4) DEFAULT NULL, + `t` date DEFAULT NULL +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4 */ +--- Perform basic operation on master --- +--- and ensure replicated correctly --- +"--- Insert into t1 --" as ""; +--- Select from t1 on master --- +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; +id hex(b1) vc bc d f total y t +2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 +4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 +42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 +142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 +412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 +--- Select from t1 on slave --- +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; +id hex(b1) vc bc d f total y t +2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 +4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 +42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 +142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 +412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 +--- Update t1 on master -- +UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412; +--- Check the update on master --- +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; +id hex(b1) vc bc d f total y t +412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 +--- Check Update on slave --- +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; +id hex(b1) vc bc d f total y t +412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 +--- Remove a record from t1 on master --- +DELETE FROM t1 WHERE id = 42; +--- Show current count on master for t1 --- +SELECT COUNT(*) FROM t1; +COUNT(*) +4 +--- Show current count on slave for t1 --- +SELECT COUNT(*) FROM t1; +COUNT(*) +4 +DELETE FROM t1; +--- Check that simple Alter statements are replicated correctly --- +ALTER TABLE t1 ADD PRIMARY KEY(t,id); +ALTER TABLE t1 MODIFY vc TEXT; +--- Show the new improved table on the master --- +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` mediumint(9) NOT NULL, + `b1` bit(8) DEFAULT NULL, + `vc` text, + `bc` char(255) DEFAULT NULL, + `d` decimal(10,4) DEFAULT '0.0000', + `f` float DEFAULT '0', + `total` bigint(20) unsigned DEFAULT NULL, + `y` year(4) DEFAULT NULL, + `t` date NOT NULL DEFAULT '0000-00-00', + PRIMARY KEY (`t`,`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4 */ +--- Make sure that our tables on slave are still same engine --- +--- and that the alter statements replicated correctly --- +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` mediumint(9) NOT NULL, + `b1` bit(8) DEFAULT NULL, + `vc` text, + `bc` char(255) DEFAULT NULL, + `d` decimal(10,4) DEFAULT '0.0000', + `f` float DEFAULT '0', + `total` bigint(20) unsigned DEFAULT NULL, + `y` year(4) DEFAULT NULL, + `t` date NOT NULL DEFAULT '0000-00-00', + PRIMARY KEY (`t`,`id`) +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4 */ +--- Perform basic operation on master --- +--- and ensure replicated correctly --- +"--- Insert into t1 --" as ""; +--- Select from t1 on master --- +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; +id hex(b1) vc bc d f total y t +2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 +4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 +42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 +142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 +412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 +--- Select from t1 on slave --- +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; +id hex(b1) vc bc d f total y t +2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 +4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 +42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 +142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 +412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 +--- Update t1 on master -- +UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412; +--- Check the update on master --- +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; +id hex(b1) vc bc d f total y t +412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 +--- Check Update on slave --- +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; +id hex(b1) vc bc d f total y t +412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 +--- Remove a record from t1 on master --- +DELETE FROM t1 WHERE id = 42; +--- Show current count on master for t1 --- +SELECT COUNT(*) FROM t1; +COUNT(*) +4 +--- Show current count on slave for t1 --- +SELECT COUNT(*) FROM t1; +COUNT(*) +4 +DELETE FROM t1; +--- End test 4 partition HASH testing --- +--- Do Cleanup -- +DROP TABLE IF EXISTS t1; +--- Start test 5 partition by key testing --- +--- Create Table Section --- +CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(255), +bc CHAR(255), d DECIMAL(10,4) DEFAULT 0, +f FLOAT DEFAULT 0, total BIGINT UNSIGNED, +y YEAR, t DATE,PRIMARY KEY(id)) +PARTITION BY KEY() +PARTITIONS 4; +--- Show that tables on master are ndbcluster tables --- +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` mediumint(9) NOT NULL, + `b1` bit(8) DEFAULT NULL, + `vc` varchar(255) DEFAULT NULL, + `bc` char(255) DEFAULT NULL, + `d` decimal(10,4) DEFAULT '0.0000', + `f` float DEFAULT '0', + `total` bigint(20) unsigned DEFAULT NULL, + `y` year(4) DEFAULT NULL, + `t` date DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */ +--- Show that tables on slave --- +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` mediumint(9) NOT NULL, + `b1` bit(8) DEFAULT NULL, + `vc` varchar(255) DEFAULT NULL, + `bc` char(255) DEFAULT NULL, + `d` decimal(10,4) DEFAULT '0.0000', + `f` float DEFAULT '0', + `total` bigint(20) unsigned DEFAULT NULL, + `y` year(4) DEFAULT NULL, + `t` date DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */ +--- Perform basic operation on master --- +--- and ensure replicated correctly --- +"--- Insert into t1 --" as ""; +--- Select from t1 on master --- +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; +id hex(b1) vc bc d f total y t +2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 +4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 +42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 +142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 +412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 +--- Select from t1 on slave --- +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; +id hex(b1) vc bc d f total y t +2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 +4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 +42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 +142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 +412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 +--- Update t1 on master -- +UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412; +--- Check the update on master --- +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; +id hex(b1) vc bc d f total y t +412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 +--- Check Update on slave --- +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; +id hex(b1) vc bc d f total y t +412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 +--- Remove a record from t1 on master --- +DELETE FROM t1 WHERE id = 42; +--- Show current count on master for t1 --- +SELECT COUNT(*) FROM t1; +COUNT(*) +4 +--- Show current count on slave for t1 --- +SELECT COUNT(*) FROM t1; +COUNT(*) +4 +DELETE FROM t1; +--- Check that simple Alter statements are replicated correctly --- +ALTER TABLE t1 DROP PRIMARY KEY, ADD PRIMARY KEY(id, total); +--- Show the new improved table on the master --- +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` mediumint(9) NOT NULL, + `b1` bit(8) DEFAULT NULL, + `vc` varchar(255) DEFAULT NULL, + `bc` char(255) DEFAULT NULL, + `d` decimal(10,4) DEFAULT '0.0000', + `f` float DEFAULT '0', + `total` bigint(20) unsigned NOT NULL DEFAULT '0', + `y` year(4) DEFAULT NULL, + `t` date DEFAULT NULL, + PRIMARY KEY (`id`,`total`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */ +--- Make sure that our tables on slave are still right type --- +--- and that the alter statements replicated correctly --- +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` mediumint(9) NOT NULL, + `b1` bit(8) DEFAULT NULL, + `vc` varchar(255) DEFAULT NULL, + `bc` char(255) DEFAULT NULL, + `d` decimal(10,4) DEFAULT '0.0000', + `f` float DEFAULT '0', + `total` bigint(20) unsigned NOT NULL DEFAULT '0', + `y` year(4) DEFAULT NULL, + `t` date DEFAULT NULL, + PRIMARY KEY (`id`,`total`) +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */ +--- Perform basic operation on master --- +--- and ensure replicated correctly --- +"--- Insert into t1 --" as ""; +--- Select from t1 on master --- +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; +id hex(b1) vc bc d f total y t +2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 +4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 +42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 +142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 +412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 +--- Select from t1 on slave --- +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; +id hex(b1) vc bc d f total y t +2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 +4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 +42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 +142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 +412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 +--- Update t1 on master -- +UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412; +--- Check the update on master --- +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; +id hex(b1) vc bc d f total y t +412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 +--- Check Update on slave --- +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; +id hex(b1) vc bc d f total y t +412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 +--- Remove a record from t1 on master --- +DELETE FROM t1 WHERE id = 42; +--- Show current count on master for t1 --- +SELECT COUNT(*) FROM t1; +COUNT(*) +4 +--- Show current count on slave for t1 --- +SELECT COUNT(*) FROM t1; +COUNT(*) +4 +DELETE FROM t1; +--- Check that simple Alter statements are replicated correctly --- +ALTER TABLE t1 MODIFY vc TEXT; +--- Show the new improved table on the master --- +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` mediumint(9) NOT NULL, + `b1` bit(8) DEFAULT NULL, + `vc` text, + `bc` char(255) DEFAULT NULL, + `d` decimal(10,4) DEFAULT '0.0000', + `f` float DEFAULT '0', + `total` bigint(20) unsigned NOT NULL DEFAULT '0', + `y` year(4) DEFAULT NULL, + `t` date DEFAULT NULL, + PRIMARY KEY (`id`,`total`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */ +--- Make sure that our tables on slave are still same engine --- +--- and that the alter statements replicated correctly --- +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` mediumint(9) NOT NULL, + `b1` bit(8) DEFAULT NULL, + `vc` text, + `bc` char(255) DEFAULT NULL, + `d` decimal(10,4) DEFAULT '0.0000', + `f` float DEFAULT '0', + `total` bigint(20) unsigned NOT NULL DEFAULT '0', + `y` year(4) DEFAULT NULL, + `t` date DEFAULT NULL, + PRIMARY KEY (`id`,`total`) +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */ +--- Perform basic operation on master --- +--- and ensure replicated correctly --- +"--- Insert into t1 --" as ""; +--- Select from t1 on master --- +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; +id hex(b1) vc bc d f total y t +2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 +4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 +42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 +142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 +412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 +--- Select from t1 on slave --- +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; +id hex(b1) vc bc d f total y t +2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 +4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 +42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 +142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 +412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 +--- Update t1 on master -- +UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412; +--- Check the update on master --- +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; +id hex(b1) vc bc d f total y t +412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 +--- Check Update on slave --- +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; +id hex(b1) vc bc d f total y t +412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 +--- Remove a record from t1 on master --- +DELETE FROM t1 WHERE id = 42; +--- Show current count on master for t1 --- +SELECT COUNT(*) FROM t1; +COUNT(*) +4 +--- Show current count on slave for t1 --- +SELECT COUNT(*) FROM t1; +COUNT(*) +4 +DELETE FROM t1; +--- End test 5 key partition testing --- +--- Do Cleanup --- +DROP TABLE IF EXISTS t1; diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_myisam2ndb.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_myisam2ndb.result new file mode 100644 index 00000000000..35fc778a693 --- /dev/null +++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_myisam2ndb.result @@ -0,0 +1,855 @@ +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; +SET storage_engine=myisam; +--- Doing pre test cleanup --- +DROP TABLE IF EXISTS t1; +--- Start test 1 Basic testing --- +--- Create Table Section --- +CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(255), +bc CHAR(255), d DECIMAL(10,4) DEFAULT 0, +f FLOAT DEFAULT 0, total BIGINT UNSIGNED, +y YEAR, t DATE,PRIMARY KEY(id)); +--- Show table on master --- +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` mediumint(9) NOT NULL, + `b1` bit(8) DEFAULT NULL, + `vc` varchar(255) DEFAULT NULL, + `bc` char(255) DEFAULT NULL, + `d` decimal(10,4) DEFAULT '0.0000', + `f` float DEFAULT '0', + `total` bigint(20) unsigned DEFAULT NULL, + `y` year(4) DEFAULT NULL, + `t` date DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +--- Show table on slave --- +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` mediumint(9) NOT NULL, + `b1` bit(8) DEFAULT NULL, + `vc` varchar(255) DEFAULT NULL, + `bc` char(255) DEFAULT NULL, + `d` decimal(10,4) DEFAULT '0.0000', + `f` float DEFAULT '0', + `total` bigint(20) unsigned DEFAULT NULL, + `y` year(4) DEFAULT NULL, + `t` date DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 +--- Perform basic operation on master --- +--- and ensure replicated correctly --- +"--- Insert into t1 --" as ""; +--- Select from t1 on master --- +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; +id hex(b1) vc bc d f total y t +2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 +4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 +42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 +142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 +412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 +--- Select from t1 on slave --- +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; +id hex(b1) vc bc d f total y t +2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 +4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 +42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 +142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 +412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 +--- Update t1 on master -- +UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412; +--- Check the update on master --- +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; +id hex(b1) vc bc d f total y t +412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 +--- Check Update on slave --- +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; +id hex(b1) vc bc d f total y t +412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 +--- Remove a record from t1 on master --- +DELETE FROM t1 WHERE id = 42; +--- Show current count on master for t1 --- +SELECT COUNT(*) FROM t1; +COUNT(*) +4 +--- Show current count on slave for t1 --- +SELECT COUNT(*) FROM t1; +COUNT(*) +4 +DELETE FROM t1; +--- Check that simple Alter statements are replicated correctly -- +ALTER TABLE t1 DROP PRIMARY KEY, ADD PRIMARY KEY(id, total); +ALTER TABLE t1 MODIFY vc TEXT; +--- Show the new improved table on the master --- +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` mediumint(9) NOT NULL, + `b1` bit(8) DEFAULT NULL, + `vc` text, + `bc` char(255) DEFAULT NULL, + `d` decimal(10,4) DEFAULT '0.0000', + `f` float DEFAULT '0', + `total` bigint(20) unsigned NOT NULL DEFAULT '0', + `y` year(4) DEFAULT NULL, + `t` date DEFAULT NULL, + PRIMARY KEY (`id`,`total`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +--- Make sure that our tables on slave are still same engine --- +--- and that the alter statements replicated correctly --- +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` mediumint(9) NOT NULL, + `b1` bit(8) DEFAULT NULL, + `vc` text, + `bc` char(255) DEFAULT NULL, + `d` decimal(10,4) DEFAULT '0.0000', + `f` float DEFAULT '0', + `total` bigint(20) unsigned NOT NULL DEFAULT '0', + `y` year(4) DEFAULT NULL, + `t` date DEFAULT NULL, + PRIMARY KEY (`id`,`total`) +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 +--- Perform basic operation on master --- +--- and ensure replicated correctly --- +"--- Insert into t1 --" as ""; +--- Select from t1 on master --- +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; +id hex(b1) vc bc d f total y t +2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 +4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 +42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 +142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 +412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 +--- Select from t1 on slave --- +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; +id hex(b1) vc bc d f total y t +2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 +4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 +42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 +142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 +412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 +--- Update t1 on master -- +UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412; +--- Check the update on master --- +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; +id hex(b1) vc bc d f total y t +412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 +--- Check Update on slave --- +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; +id hex(b1) vc bc d f total y t +412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 +--- Remove a record from t1 on master --- +DELETE FROM t1 WHERE id = 42; +--- Show current count on master for t1 --- +SELECT COUNT(*) FROM t1; +COUNT(*) +4 +--- Show current count on slave for t1 --- +SELECT COUNT(*) FROM t1; +COUNT(*) +4 +DELETE FROM t1; +--- End test 1 Basic testing --- +--- Do Cleanup -- +DROP TABLE IF EXISTS t1; +--- Start test 2 partition RANGE testing -- +--- Do setup -- +CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(255), +bc CHAR(255), d DECIMAL(10,4) DEFAULT 0, +f FLOAT DEFAULT 0, total BIGINT UNSIGNED, +y YEAR, t DATE) +PARTITION BY RANGE (YEAR(t)) +(PARTITION p0 VALUES LESS THAN (1901), +PARTITION p1 VALUES LESS THAN (1946), +PARTITION p2 VALUES LESS THAN (1966), +PARTITION p3 VALUES LESS THAN (1986), +PARTITION p4 VALUES LESS THAN (2005), +PARTITION p5 VALUES LESS THAN MAXVALUE); +--- Show table on master --- +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` mediumint(9) NOT NULL, + `b1` bit(8) DEFAULT NULL, + `vc` varchar(255) DEFAULT NULL, + `bc` char(255) DEFAULT NULL, + `d` decimal(10,4) DEFAULT '0.0000', + `f` float DEFAULT '0', + `total` bigint(20) unsigned DEFAULT NULL, + `y` year(4) DEFAULT NULL, + `t` date DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = MyISAM, PARTITION p1 VALUES LESS THAN (1946) ENGINE = MyISAM, PARTITION p2 VALUES LESS THAN (1966) ENGINE = MyISAM, PARTITION p3 VALUES LESS THAN (1986) ENGINE = MyISAM, PARTITION p4 VALUES LESS THAN (2005) ENGINE = MyISAM, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ +--- Show table on slave -- +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` mediumint(9) NOT NULL, + `b1` bit(8) DEFAULT NULL, + `vc` varchar(255) DEFAULT NULL, + `bc` char(255) DEFAULT NULL, + `d` decimal(10,4) DEFAULT '0.0000', + `f` float DEFAULT '0', + `total` bigint(20) unsigned DEFAULT NULL, + `y` year(4) DEFAULT NULL, + `t` date DEFAULT NULL +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = ndbcluster, PARTITION p1 VALUES LESS THAN (1946) ENGINE = ndbcluster, PARTITION p2 VALUES LESS THAN (1966) ENGINE = ndbcluster, PARTITION p3 VALUES LESS THAN (1986) ENGINE = ndbcluster, PARTITION p4 VALUES LESS THAN (2005) ENGINE = ndbcluster, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ndbcluster) */ +--- Perform basic operation on master --- +--- and ensure replicated correctly --- +"--- Insert into t1 --" as ""; +--- Select from t1 on master --- +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; +id hex(b1) vc bc d f total y t +2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 +4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 +42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 +142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 +412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 +--- Select from t1 on slave --- +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; +id hex(b1) vc bc d f total y t +2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 +4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 +42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 +142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 +412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 +--- Update t1 on master -- +UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412; +--- Check the update on master --- +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; +id hex(b1) vc bc d f total y t +412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 +--- Check Update on slave --- +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; +id hex(b1) vc bc d f total y t +412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 +--- Remove a record from t1 on master --- +DELETE FROM t1 WHERE id = 42; +--- Show current count on master for t1 --- +SELECT COUNT(*) FROM t1; +COUNT(*) +4 +--- Show current count on slave for t1 --- +SELECT COUNT(*) FROM t1; +COUNT(*) +4 +DELETE FROM t1; +--- Check that simple Alter statements are replicated correctly --- +ALTER TABLE t1 ADD PRIMARY KEY(t,id); +ALTER TABLE t1 MODIFY vc TEXT; +--- Show the new improved table on the master --- +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` mediumint(9) NOT NULL, + `b1` bit(8) DEFAULT NULL, + `vc` text, + `bc` char(255) DEFAULT NULL, + `d` decimal(10,4) DEFAULT '0.0000', + `f` float DEFAULT '0', + `total` bigint(20) unsigned DEFAULT NULL, + `y` year(4) DEFAULT NULL, + `t` date NOT NULL DEFAULT '0000-00-00', + PRIMARY KEY (`t`,`id`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = MyISAM, PARTITION p1 VALUES LESS THAN (1946) ENGINE = MyISAM, PARTITION p2 VALUES LESS THAN (1966) ENGINE = MyISAM, PARTITION p3 VALUES LESS THAN (1986) ENGINE = MyISAM, PARTITION p4 VALUES LESS THAN (2005) ENGINE = MyISAM, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ +--- Make sure that our tables on slave are still same engine --- +--- and that the alter statements replicated correctly --- +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` mediumint(9) NOT NULL, + `b1` bit(8) DEFAULT NULL, + `vc` text, + `bc` char(255) DEFAULT NULL, + `d` decimal(10,4) DEFAULT '0.0000', + `f` float DEFAULT '0', + `total` bigint(20) unsigned DEFAULT NULL, + `y` year(4) DEFAULT NULL, + `t` date NOT NULL DEFAULT '0000-00-00', + PRIMARY KEY (`t`,`id`) +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = ndbcluster, PARTITION p1 VALUES LESS THAN (1946) ENGINE = ndbcluster, PARTITION p2 VALUES LESS THAN (1966) ENGINE = ndbcluster, PARTITION p3 VALUES LESS THAN (1986) ENGINE = ndbcluster, PARTITION p4 VALUES LESS THAN (2005) ENGINE = ndbcluster, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ndbcluster) */ +--- Perform basic operation on master --- +--- and ensure replicated correctly --- +"--- Insert into t1 --" as ""; +--- Select from t1 on master --- +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; +id hex(b1) vc bc d f total y t +2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 +4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 +42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 +142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 +412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 +--- Select from t1 on slave --- +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; +id hex(b1) vc bc d f total y t +2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 +4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 +42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 +142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 +412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 +--- Update t1 on master -- +UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412; +--- Check the update on master --- +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; +id hex(b1) vc bc d f total y t +412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 +--- Check Update on slave --- +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; +id hex(b1) vc bc d f total y t +412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 +--- Remove a record from t1 on master --- +DELETE FROM t1 WHERE id = 42; +--- Show current count on master for t1 --- +SELECT COUNT(*) FROM t1; +COUNT(*) +4 +--- Show current count on slave for t1 --- +SELECT COUNT(*) FROM t1; +COUNT(*) +4 +DELETE FROM t1; +--- End test 2 partition RANGE testing --- +--- Do Cleanup --- +DROP TABLE IF EXISTS t1; +--- Start test 3 partition LIST testing --- +--- Do setup --- +CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(255), +bc CHAR(255), d DECIMAL(10,4) DEFAULT 0, +f FLOAT DEFAULT 0, total BIGINT UNSIGNED, +y YEAR, t DATE) +PARTITION BY LIST(id) +(PARTITION p0 VALUES IN (2, 4), +PARTITION p1 VALUES IN (42, 142)); +--- Test 3 Alter to add partition --- +ALTER TABLE t1 ADD PARTITION (PARTITION p2 VALUES IN (412)); +--- Show table on master --- +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` mediumint(9) NOT NULL, + `b1` bit(8) DEFAULT NULL, + `vc` varchar(255) DEFAULT NULL, + `bc` char(255) DEFAULT NULL, + `d` decimal(10,4) DEFAULT '0.0000', + `f` float DEFAULT '0', + `total` bigint(20) unsigned DEFAULT NULL, + `y` year(4) DEFAULT NULL, + `t` date DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = MyISAM, PARTITION p1 VALUES IN (42,142) ENGINE = MyISAM, PARTITION p2 VALUES IN (412) ENGINE = MyISAM) */ +--- Show table on slave --- +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` mediumint(9) NOT NULL, + `b1` bit(8) DEFAULT NULL, + `vc` varchar(255) DEFAULT NULL, + `bc` char(255) DEFAULT NULL, + `d` decimal(10,4) DEFAULT '0.0000', + `f` float DEFAULT '0', + `total` bigint(20) unsigned DEFAULT NULL, + `y` year(4) DEFAULT NULL, + `t` date DEFAULT NULL +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = ndbcluster, PARTITION p1 VALUES IN (42,142) ENGINE = ndbcluster, PARTITION p2 VALUES IN (412) ENGINE = ndbcluster) */ +--- Perform basic operation on master --- +--- and ensure replicated correctly --- +"--- Insert into t1 --" as ""; +--- Select from t1 on master --- +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; +id hex(b1) vc bc d f total y t +2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 +4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 +42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 +142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 +412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 +--- Select from t1 on slave --- +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; +id hex(b1) vc bc d f total y t +2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 +4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 +42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 +142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 +412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 +--- Update t1 on master -- +UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412; +--- Check the update on master --- +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; +id hex(b1) vc bc d f total y t +412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 +--- Check Update on slave --- +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; +id hex(b1) vc bc d f total y t +412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 +--- Remove a record from t1 on master --- +DELETE FROM t1 WHERE id = 42; +--- Show current count on master for t1 --- +SELECT COUNT(*) FROM t1; +COUNT(*) +4 +--- Show current count on slave for t1 --- +SELECT COUNT(*) FROM t1; +COUNT(*) +4 +DELETE FROM t1; +--- Check that simple Alter statements are replicated correctly --- +ALTER TABLE t1 ADD PRIMARY KEY(id); +ALTER TABLE t1 MODIFY vc TEXT; +--- Show the new improved table on the master --- +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` mediumint(9) NOT NULL, + `b1` bit(8) DEFAULT NULL, + `vc` text, + `bc` char(255) DEFAULT NULL, + `d` decimal(10,4) DEFAULT '0.0000', + `f` float DEFAULT '0', + `total` bigint(20) unsigned DEFAULT NULL, + `y` year(4) DEFAULT NULL, + `t` date DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = MyISAM, PARTITION p1 VALUES IN (42,142) ENGINE = MyISAM, PARTITION p2 VALUES IN (412) ENGINE = MyISAM) */ +--- Make sure that our tables on slave are still same engine --- +--- and that the alter statements replicated correctly --- +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` mediumint(9) NOT NULL, + `b1` bit(8) DEFAULT NULL, + `vc` text, + `bc` char(255) DEFAULT NULL, + `d` decimal(10,4) DEFAULT '0.0000', + `f` float DEFAULT '0', + `total` bigint(20) unsigned DEFAULT NULL, + `y` year(4) DEFAULT NULL, + `t` date DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = ndbcluster, PARTITION p1 VALUES IN (42,142) ENGINE = ndbcluster, PARTITION p2 VALUES IN (412) ENGINE = ndbcluster) */ +--- Perform basic operation on master --- +--- and ensure replicated correctly --- +"--- Insert into t1 --" as ""; +--- Select from t1 on master --- +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; +id hex(b1) vc bc d f total y t +2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 +4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 +42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 +142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 +412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 +--- Select from t1 on slave --- +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; +id hex(b1) vc bc d f total y t +2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 +4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 +42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 +142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 +412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 +--- Update t1 on master -- +UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412; +--- Check the update on master --- +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; +id hex(b1) vc bc d f total y t +412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 +--- Check Update on slave --- +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; +id hex(b1) vc bc d f total y t +412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 +--- Remove a record from t1 on master --- +DELETE FROM t1 WHERE id = 42; +--- Show current count on master for t1 --- +SELECT COUNT(*) FROM t1; +COUNT(*) +4 +--- Show current count on slave for t1 --- +SELECT COUNT(*) FROM t1; +COUNT(*) +4 +DELETE FROM t1; +--- End test 3 partition LIST testing --- +--- Do Cleanup -- +DROP TABLE IF EXISTS t1; +--- Start test 4 partition HASH testing --- +--- Do setup --- +CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(255), +bc CHAR(255), d DECIMAL(10,4) DEFAULT 0, +f FLOAT DEFAULT 0, total BIGINT UNSIGNED, +y YEAR, t DATE) +PARTITION BY HASH( YEAR(t) ) +PARTITIONS 4; +--- show that tables have been created correctly --- +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` mediumint(9) NOT NULL, + `b1` bit(8) DEFAULT NULL, + `vc` varchar(255) DEFAULT NULL, + `bc` char(255) DEFAULT NULL, + `d` decimal(10,4) DEFAULT '0.0000', + `f` float DEFAULT '0', + `total` bigint(20) unsigned DEFAULT NULL, + `y` year(4) DEFAULT NULL, + `t` date DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4 */ +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` mediumint(9) NOT NULL, + `b1` bit(8) DEFAULT NULL, + `vc` varchar(255) DEFAULT NULL, + `bc` char(255) DEFAULT NULL, + `d` decimal(10,4) DEFAULT '0.0000', + `f` float DEFAULT '0', + `total` bigint(20) unsigned DEFAULT NULL, + `y` year(4) DEFAULT NULL, + `t` date DEFAULT NULL +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4 */ +--- Perform basic operation on master --- +--- and ensure replicated correctly --- +"--- Insert into t1 --" as ""; +--- Select from t1 on master --- +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; +id hex(b1) vc bc d f total y t +2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 +4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 +42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 +142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 +412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 +--- Select from t1 on slave --- +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; +id hex(b1) vc bc d f total y t +2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 +4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 +42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 +142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 +412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 +--- Update t1 on master -- +UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412; +--- Check the update on master --- +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; +id hex(b1) vc bc d f total y t +412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 +--- Check Update on slave --- +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; +id hex(b1) vc bc d f total y t +412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 +--- Remove a record from t1 on master --- +DELETE FROM t1 WHERE id = 42; +--- Show current count on master for t1 --- +SELECT COUNT(*) FROM t1; +COUNT(*) +4 +--- Show current count on slave for t1 --- +SELECT COUNT(*) FROM t1; +COUNT(*) +4 +DELETE FROM t1; +--- Check that simple Alter statements are replicated correctly --- +ALTER TABLE t1 ADD PRIMARY KEY(t,id); +ALTER TABLE t1 MODIFY vc TEXT; +--- Show the new improved table on the master --- +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` mediumint(9) NOT NULL, + `b1` bit(8) DEFAULT NULL, + `vc` text, + `bc` char(255) DEFAULT NULL, + `d` decimal(10,4) DEFAULT '0.0000', + `f` float DEFAULT '0', + `total` bigint(20) unsigned DEFAULT NULL, + `y` year(4) DEFAULT NULL, + `t` date NOT NULL DEFAULT '0000-00-00', + PRIMARY KEY (`t`,`id`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4 */ +--- Make sure that our tables on slave are still same engine --- +--- and that the alter statements replicated correctly --- +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` mediumint(9) NOT NULL, + `b1` bit(8) DEFAULT NULL, + `vc` text, + `bc` char(255) DEFAULT NULL, + `d` decimal(10,4) DEFAULT '0.0000', + `f` float DEFAULT '0', + `total` bigint(20) unsigned DEFAULT NULL, + `y` year(4) DEFAULT NULL, + `t` date NOT NULL DEFAULT '0000-00-00', + PRIMARY KEY (`t`,`id`) +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4 */ +--- Perform basic operation on master --- +--- and ensure replicated correctly --- +"--- Insert into t1 --" as ""; +--- Select from t1 on master --- +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; +id hex(b1) vc bc d f total y t +2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 +4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 +42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 +142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 +412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 +--- Select from t1 on slave --- +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; +id hex(b1) vc bc d f total y t +2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 +4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 +42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 +142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 +412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 +--- Update t1 on master -- +UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412; +--- Check the update on master --- +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; +id hex(b1) vc bc d f total y t +412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 +--- Check Update on slave --- +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; +id hex(b1) vc bc d f total y t +412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 +--- Remove a record from t1 on master --- +DELETE FROM t1 WHERE id = 42; +--- Show current count on master for t1 --- +SELECT COUNT(*) FROM t1; +COUNT(*) +4 +--- Show current count on slave for t1 --- +SELECT COUNT(*) FROM t1; +COUNT(*) +4 +DELETE FROM t1; +--- End test 4 partition HASH testing --- +--- Do Cleanup -- +DROP TABLE IF EXISTS t1; +--- Start test 5 partition by key testing --- +--- Create Table Section --- +CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(255), +bc CHAR(255), d DECIMAL(10,4) DEFAULT 0, +f FLOAT DEFAULT 0, total BIGINT UNSIGNED, +y YEAR, t DATE,PRIMARY KEY(id)) +PARTITION BY KEY() +PARTITIONS 4; +--- Show that tables on master are ndbcluster tables --- +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` mediumint(9) NOT NULL, + `b1` bit(8) DEFAULT NULL, + `vc` varchar(255) DEFAULT NULL, + `bc` char(255) DEFAULT NULL, + `d` decimal(10,4) DEFAULT '0.0000', + `f` float DEFAULT '0', + `total` bigint(20) unsigned DEFAULT NULL, + `y` year(4) DEFAULT NULL, + `t` date DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */ +--- Show that tables on slave --- +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` mediumint(9) NOT NULL, + `b1` bit(8) DEFAULT NULL, + `vc` varchar(255) DEFAULT NULL, + `bc` char(255) DEFAULT NULL, + `d` decimal(10,4) DEFAULT '0.0000', + `f` float DEFAULT '0', + `total` bigint(20) unsigned DEFAULT NULL, + `y` year(4) DEFAULT NULL, + `t` date DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */ +--- Perform basic operation on master --- +--- and ensure replicated correctly --- +"--- Insert into t1 --" as ""; +--- Select from t1 on master --- +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; +id hex(b1) vc bc d f total y t +2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 +4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 +42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 +142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 +412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 +--- Select from t1 on slave --- +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; +id hex(b1) vc bc d f total y t +2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 +4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 +42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 +142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 +412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 +--- Update t1 on master -- +UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412; +--- Check the update on master --- +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; +id hex(b1) vc bc d f total y t +412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 +--- Check Update on slave --- +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; +id hex(b1) vc bc d f total y t +412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 +--- Remove a record from t1 on master --- +DELETE FROM t1 WHERE id = 42; +--- Show current count on master for t1 --- +SELECT COUNT(*) FROM t1; +COUNT(*) +4 +--- Show current count on slave for t1 --- +SELECT COUNT(*) FROM t1; +COUNT(*) +4 +DELETE FROM t1; +--- Check that simple Alter statements are replicated correctly --- +ALTER TABLE t1 DROP PRIMARY KEY, ADD PRIMARY KEY(id, total); +--- Show the new improved table on the master --- +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` mediumint(9) NOT NULL, + `b1` bit(8) DEFAULT NULL, + `vc` varchar(255) DEFAULT NULL, + `bc` char(255) DEFAULT NULL, + `d` decimal(10,4) DEFAULT '0.0000', + `f` float DEFAULT '0', + `total` bigint(20) unsigned NOT NULL DEFAULT '0', + `y` year(4) DEFAULT NULL, + `t` date DEFAULT NULL, + PRIMARY KEY (`id`,`total`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */ +--- Make sure that our tables on slave are still right type --- +--- and that the alter statements replicated correctly --- +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` mediumint(9) NOT NULL, + `b1` bit(8) DEFAULT NULL, + `vc` varchar(255) DEFAULT NULL, + `bc` char(255) DEFAULT NULL, + `d` decimal(10,4) DEFAULT '0.0000', + `f` float DEFAULT '0', + `total` bigint(20) unsigned NOT NULL DEFAULT '0', + `y` year(4) DEFAULT NULL, + `t` date DEFAULT NULL, + PRIMARY KEY (`id`,`total`) +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */ +--- Perform basic operation on master --- +--- and ensure replicated correctly --- +"--- Insert into t1 --" as ""; +--- Select from t1 on master --- +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; +id hex(b1) vc bc d f total y t +2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 +4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 +42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 +142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 +412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 +--- Select from t1 on slave --- +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; +id hex(b1) vc bc d f total y t +2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 +4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 +42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 +142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 +412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 +--- Update t1 on master -- +UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412; +--- Check the update on master --- +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; +id hex(b1) vc bc d f total y t +412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 +--- Check Update on slave --- +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; +id hex(b1) vc bc d f total y t +412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 +--- Remove a record from t1 on master --- +DELETE FROM t1 WHERE id = 42; +--- Show current count on master for t1 --- +SELECT COUNT(*) FROM t1; +COUNT(*) +4 +--- Show current count on slave for t1 --- +SELECT COUNT(*) FROM t1; +COUNT(*) +4 +DELETE FROM t1; +--- Check that simple Alter statements are replicated correctly --- +ALTER TABLE t1 MODIFY vc TEXT; +--- Show the new improved table on the master --- +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` mediumint(9) NOT NULL, + `b1` bit(8) DEFAULT NULL, + `vc` text, + `bc` char(255) DEFAULT NULL, + `d` decimal(10,4) DEFAULT '0.0000', + `f` float DEFAULT '0', + `total` bigint(20) unsigned NOT NULL DEFAULT '0', + `y` year(4) DEFAULT NULL, + `t` date DEFAULT NULL, + PRIMARY KEY (`id`,`total`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */ +--- Make sure that our tables on slave are still same engine --- +--- and that the alter statements replicated correctly --- +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` mediumint(9) NOT NULL, + `b1` bit(8) DEFAULT NULL, + `vc` text, + `bc` char(255) DEFAULT NULL, + `d` decimal(10,4) DEFAULT '0.0000', + `f` float DEFAULT '0', + `total` bigint(20) unsigned NOT NULL DEFAULT '0', + `y` year(4) DEFAULT NULL, + `t` date DEFAULT NULL, + PRIMARY KEY (`id`,`total`) +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4 */ +--- Perform basic operation on master --- +--- and ensure replicated correctly --- +"--- Insert into t1 --" as ""; +--- Select from t1 on master --- +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; +id hex(b1) vc bc d f total y t +2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 +4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 +42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 +142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 +412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 +--- Select from t1 on slave --- +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; +id hex(b1) vc bc d f total y t +2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 +4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 +42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 +142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 +412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 +--- Update t1 on master -- +UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412; +--- Check the update on master --- +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; +id hex(b1) vc bc d f total y t +412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 +--- Check Update on slave --- +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; +id hex(b1) vc bc d f total y t +412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 +--- Remove a record from t1 on master --- +DELETE FROM t1 WHERE id = 42; +--- Show current count on master for t1 --- +SELECT COUNT(*) FROM t1; +COUNT(*) +4 +--- Show current count on slave for t1 --- +SELECT COUNT(*) FROM t1; +COUNT(*) +4 +DELETE FROM t1; +--- End test 5 key partition testing --- +--- Do Cleanup --- +DROP TABLE IF EXISTS t1; diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb2ndb-slave.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb2ndb-slave.opt index 7f9eb96dff1..b63ef44e8fc 100644 --- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb2ndb-slave.opt +++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb2ndb-slave.opt @@ -1 +1 @@ ---default-storage-engine=ndbcluster +--new --default-storage-engine=ndbcluster diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb2ndb.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb2ndb.test index 8f67802c055..92374c26742 100644 --- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb2ndb.test +++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb2ndb.test @@ -7,8 +7,9 @@ # to be able to use the same code for all these different # test and to have control over the tests. ############################################################## --- source include/have_ndb.inc -- source include/have_innodb.inc +-- source include/have_ndb.inc +-- source include/have_binlog_format_mixed_or_row.inc -- source include/ndb_master-slave.inc SET storage_engine=innodb; --source extra/rpl_tests/rpl_ndb_2multi_eng.test diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_myisam2ndb-master.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_myisam2ndb-master.opt deleted file mode 100644 index 83ed8522e72..00000000000 --- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_myisam2ndb-master.opt +++ /dev/null @@ -1 +0,0 @@ ---binlog-format=row diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_myisam2ndb-slave.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_myisam2ndb-slave.opt index 7f9eb96dff1..b63ef44e8fc 100644 --- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_myisam2ndb-slave.opt +++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_myisam2ndb-slave.opt @@ -1 +1 @@ ---default-storage-engine=ndbcluster +--new --default-storage-engine=ndbcluster diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_myisam2ndb.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_myisam2ndb.test index 2ed151b7a87..a9e56d17139 100644 --- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_myisam2ndb.test +++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_myisam2ndb.test @@ -7,6 +7,8 @@ # to be able to use the same code for all these different # test and to have control over the tests. ############################################################## +-- source include/have_ndb.inc +-- source include/have_binlog_format_mixed_or_row.inc -- source include/ndb_master-slave.inc SET storage_engine=myisam; --source extra/rpl_tests/rpl_ndb_2multi_eng.test From 9d1570302b7dcd8fbcd223ff1af346f9b6692cf6 Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.(none)" <> Date: Mon, 27 Aug 2007 13:16:39 +0200 Subject: [PATCH 47/90] Cset exclude: msvensson@pilot.(none)|ChangeSet|20070827092310|49459 --- scripts/mysql_system_tables.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/mysql_system_tables.sql b/scripts/mysql_system_tables.sql index 81eb3340d32..cd0882e3af4 100644 --- a/scripts/mysql_system_tables.sql +++ b/scripts/mysql_system_tables.sql @@ -65,7 +65,7 @@ CREATE TABLE IF NOT EXISTS procs_priv ( Host char(60) binary DEFAULT '' NOT NULL -- Create general_log if CSV is enabled. -SET @str = IF (@@have_csv = 'YES', 'CREATE TABLE IF NOT EXISTS general_log (event_time TIMESTAMP NOT NULL, user_host MEDIUMTEXT, thread_id INTEGER, server_id INTEGER, command_type VARCHAR(64), argument MEDIUMTEXT) engine=CSV CHARACTER SET utf8 comment=''General log''', 'SET @dummy = 0'); +SET @str = IF (@@have_csv = 'YES', 'CREATE TABLE IF NOT EXISTS general_log (event_time TIMESTAMP NOT NULL, user_host MEDIUMTEXT, thread_id INTEGER, server_id INTEGER, command_type VARCHAR(64), argument MEDIUMTEXT) engine=CSV CHARACTER SET utf8 comment="General log"', 'SET @dummy = 0'); PREPARE stmt FROM @str; EXECUTE stmt; @@ -73,7 +73,7 @@ DROP PREPARE stmt; -- Create slow_log if CSV is enabled. -SET @str = IF (@@have_csv = 'YES', 'CREATE TABLE IF NOT EXISTS slow_log (start_time TIMESTAMP NOT NULL, user_host MEDIUMTEXT NOT NULL, query_time TIME NOT NULL, lock_time TIME NOT NULL, rows_sent INTEGER NOT NULL, rows_examined INTEGER NOT NULL, db VARCHAR(512), last_insert_id INTEGER, insert_id INTEGER, server_id INTEGER, sql_text MEDIUMTEXT NOT NULL) engine=CSV CHARACTER SET utf8 comment=''Slow log''', 'SET @dummy = 0'); +SET @str = IF (@@have_csv = 'YES', 'CREATE TABLE IF NOT EXISTS slow_log (start_time TIMESTAMP NOT NULL, user_host MEDIUMTEXT NOT NULL, query_time TIME NOT NULL, lock_time TIME NOT NULL, rows_sent INTEGER NOT NULL, rows_examined INTEGER NOT NULL, db VARCHAR(512), last_insert_id INTEGER, insert_id INTEGER, server_id INTEGER, sql_text MEDIUMTEXT NOT NULL) engine=CSV CHARACTER SET utf8 comment="Slow log"', 'SET @dummy = 0'); PREPARE stmt FROM @str; EXECUTE stmt; From ffc67d70ce6f7b8a197db5fcd51ca551cf1b52db Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.(none)" <> Date: Mon, 27 Aug 2007 13:39:34 +0200 Subject: [PATCH 48/90] Bug#28401 mysql_upgrade Failed with STRICT_ALL_TABLES, ANSI_QUOTES and NO_ZERO_DATE - Set sql_mode to default when creating system tables --- scripts/mysql_system_tables.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/mysql_system_tables.sql b/scripts/mysql_system_tables.sql index cd0882e3af4..f7b23e4e7ae 100644 --- a/scripts/mysql_system_tables.sql +++ b/scripts/mysql_system_tables.sql @@ -2,6 +2,7 @@ -- The system tables of MySQL Server -- +set sql_mode=''; set storage_engine=myisam; CREATE TABLE IF NOT EXISTS db ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Event_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db,User), KEY User (User) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Database privileges'; From 76de827058e3df37e879b52e6893610f7ac7c235 Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.(none)" <> Date: Mon, 27 Aug 2007 13:55:45 +0200 Subject: [PATCH 49/90] Enable abi_check for 5.1 - Run icheck on all files in HEADERS_ABI list - Update reference --- include/Makefile.am | 12 +- include/mysql_h.ic | 1073 +++++++++++++++++++++++++------------------ 2 files changed, 643 insertions(+), 442 deletions(-) diff --git a/include/Makefile.am b/include/Makefile.am index fe54a7e35e0..2775932f46d 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -15,18 +15,17 @@ # Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, # MA 02111-1307, USA -# FIXME 'abi_check' should be in BUILT_SOURCES, disabled for now -BUILT_SOURCES = $(HEADERS_GEN) link_sources +BUILT_SOURCES = $(HEADERS_GEN) link_sources abi_check HEADERS_GEN = mysql_version.h my_config.h HEADERS_ABI = mysql.h mysql_com.h mysql_time.h \ - my_list.h my_alloc.h typelib.h + my_list.h my_alloc.h typelib.h mysql/plugin.h pkginclude_HEADERS = $(HEADERS_ABI) my_dbug.h m_string.h my_sys.h \ my_xml.h mysql_embed.h \ my_pthread.h my_no_pthread.h \ decimal.h errmsg.h my_global.h my_net.h \ my_getopt.h sslopt-longopts.h my_dir.h \ sslopt-vars.h sslopt-case.h sql_common.h keycache.h \ - m_ctype.h mysql/plugin.h my_attribute.h $(HEADERS_GEN) + m_ctype.h my_attribute.h $(HEADERS_GEN) noinst_HEADERS = config-win.h config-netware.h \ heap.h my_bitmap.h my_uctype.h \ myisam.h myisampack.h myisammrg.h ft_global.h\ @@ -72,9 +71,8 @@ dist-hook: abi_check: $(HEADERS_ABI) mysql_version.h mysql_h.ic @set -ex; \ if [ @ICHECK@ != no ] ; then \ - @ICHECK@ --canonify --skip-from-re /usr/ -o $@.ic mysql.h; \ - @ICHECK@ --compare mysql_h.ic $@.ic; \ - $(RM) -f $@.ic; \ + @ICHECK@ --canonify --skip-from-re /usr/ -o $@ $(HEADERS_ABI); \ + @ICHECK@ --compare mysql_h.ic $@; \ fi; \ touch abi_check; diff --git a/include/mysql_h.ic b/include/mysql_h.ic index 7d16a886fd8..8b1c36fdaab 100644 --- a/include/mysql_h.ic +++ b/include/mysql_h.ic @@ -4,16 +4,27 @@ struct st_list; struct st_mem_root; struct st_mysql; struct st_mysql_bind; +struct st_mysql_daemon; struct st_mysql_data; struct st_mysql_field; +struct st_mysql_ftparser; +struct st_mysql_ftparser_boolean_info; +struct st_mysql_ftparser_param; +struct st_mysql_information_schema; +struct st_mysql_lex_string; struct st_mysql_manager; struct st_mysql_methods; struct st_mysql_options; struct st_mysql_parameters; +struct st_mysql_plugin; struct st_mysql_res; struct st_mysql_rows; +struct st_mysql_show_var; struct st_mysql_stmt; +struct st_mysql_storage_engine; struct st_mysql_time; +struct st_mysql_value; +struct st_mysql_xid; struct st_net; struct st_typelib; struct st_udf_args; @@ -22,7 +33,10 @@ struct st_used_mem; enum Item_result; enum enum_cursor_type; enum enum_field_types; +enum enum_ft_token_type; +enum enum_ftparser_mode; enum enum_mysql_set_option; +enum enum_mysql_show_type; enum enum_mysql_stmt_state; enum enum_mysql_timestamp_type; enum enum_server_command; @@ -32,65 +46,79 @@ enum mysql_option; enum mysql_protocol_type; enum mysql_rpl_type; enum mysql_status; -# 134 "mysql.h" +# 139 "mysql.h" typedef struct st_mysql_rows MYSQL_ROWS; -# 24 "my_list.h" +# 23 "my_list.h" typedef struct st_list LIST; -# 35 "my_alloc.h" +# 34 "my_alloc.h" typedef struct st_mem_root MEM_ROOT; -# 251 "mysql.h" +# 258 "mysql.h" typedef struct st_mysql MYSQL; -# 653 "mysql.h" +# 664 "mysql.h" typedef struct st_mysql_bind MYSQL_BIND; -# 93 "mysql.h" +# 95 "mysql.h" typedef struct st_mysql_field MYSQL_FIELD; -# 117 "mysql.h" +# 120 "mysql.h" typedef unsigned int MYSQL_FIELD_OFFSET; -# 340 "mysql.h" +# 35 "mysql/plugin.h" +typedef struct st_mysql_lex_string MYSQL_LEX_STRING; +# 348 "mysql.h" typedef struct st_mysql_manager MYSQL_MANAGER; -# 354 "mysql.h" +# 363 "mysql.h" typedef struct st_mysql_parameters MYSQL_PARAMETERS; -# 309 "mysql.h" +# 316 "mysql.h" typedef struct st_mysql_res MYSQL_RES; -# 116 "mysql.h" +# 119 "mysql.h" typedef char * * MYSQL_ROW; -# 140 "mysql.h" -typedef MYSQL_ROWS * MYSQL_ROW_OFFSET; -# 681 "mysql.h" -typedef struct st_mysql_stmt MYSQL_STMT; -# 236 "mysql.h" -typedef struct character_set MY_CHARSET_INFO; -# 184 "mysql_com.h" -typedef struct st_net NET; -# 23 "typelib.h" -typedef struct st_typelib TYPELIB; -# 174 "mysql_com.h" -typedef struct st_vio Vio; -# 57 "mysql.h" -typedef char * gptr; -# 29 "my_list.h" -typedef int (* list_walk_action)(void *, void *); -# 48 "mysql.h" -typedef char my_bool; -# 63 "mysql.h" -typedef int my_socket; -# 125 "mysql.h" -typedef unsigned long long int my_ulonglong; -# 144 "mysql.h" -typedef struct embedded_query_result EMBEDDED_QUERY_RESULT; # 145 "mysql.h" +typedef MYSQL_ROWS * MYSQL_ROW_OFFSET; +# 693 "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" +typedef struct st_net NET; +# 22 "typelib.h" +typedef struct st_typelib TYPELIB; +# 177 "mysql_com.h" +typedef struct st_vio Vio; +# 28 "my_list.h" +typedef int (* list_walk_action)(void *, void *); +# 51 "mysql.h" +typedef char my_bool; +# 65 "mysql.h" +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" +typedef unsigned int size_t; +# 149 "mysql.h" +typedef struct embedded_query_result EMBEDDED_QUERY_RESULT; +# 150 "mysql.h" typedef struct st_mysql_data MYSQL_DATA; -# 750 "mysql.h" +# 495 "mysql/plugin.h" +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" typedef struct st_mysql_methods MYSQL_METHODS; -# 48 "mysql_time.h" +# 47 "mysql_time.h" typedef struct st_mysql_time MYSQL_TIME; -# 375 "mysql_com.h" +# 383 "mysql_com.h" typedef struct st_udf_args UDF_ARGS; -# 388 "mysql_com.h" +# 397 "mysql_com.h" typedef struct st_udf_init UDF_INIT; -# 27 "my_alloc.h" +# 26 "my_alloc.h" typedef struct st_used_mem USED_MEM; -# 236 "mysql.h" +# 123 "mysql/plugin.h" +typedef int (* mysql_show_var_func)(void *, struct st_mysql_show_var *, char *); +# 170 "mysql/plugin.h" +typedef int (* mysql_var_check_func)(void * thd, struct st_mysql_sys_var * var, void * save, struct st_mysql_value * value); +# 188 "mysql/plugin.h" +typedef void (* mysql_var_update_func)(void * thd, struct st_mysql_sys_var * var, void * var_ptr, void * save); +# 243 "mysql.h" struct __attribute__((aligned(__alignof__(unsigned int)), aligned(__alignof__(void *)))) character_set { unsigned int number; @@ -102,7 +130,7 @@ struct __attribute__((aligned(__alignof__(unsigned int)), aligned(__alignof__(vo unsigned int mbminlen; unsigned int mbmaxlen; }; -# 361 "mysql_com.h" +# 369 "mysql_com.h" struct __attribute__((aligned(__alignof__(unsigned long int)), aligned(__alignof__(double)))) rand_struct { unsigned long int seed1; @@ -110,30 +138,30 @@ struct __attribute__((aligned(__alignof__(unsigned long int)), aligned(__alignof unsigned long int max_value; double max_value_dbl; }; -# 24 "my_list.h" +# 23 "my_list.h" struct __attribute__((aligned(__alignof__(void *)))) st_list { struct st_list * prev; struct st_list * next; void * data; }; -# 35 "my_alloc.h" +# 34 "my_alloc.h" struct __attribute__((aligned(__alignof__(void *)), aligned(__alignof__(unsigned int)))) st_mem_root { USED_MEM * free; USED_MEM * used; USED_MEM * pre_alloc; - unsigned int min_malloc; - unsigned int block_size; + size_t min_malloc; + size_t block_size; unsigned int block_num; unsigned int first_block_usage; void (* error_handler)(void); }; -# 251 "mysql.h" +# 258 "mysql.h" struct __attribute__((aligned(__alignof__(void *)), aligned(__alignof__(unsigned long long int)))) st_mysql { NET net; - gptr connector_fd; + unsigned char * connector_fd; char * host; char * user; char * passwd; @@ -173,39 +201,47 @@ struct __attribute__((aligned(__alignof__(void *)), aligned(__alignof__(unsigned void * thd; my_bool * unbuffered_fetch_owner; char * info_buffer; + void * extension; }; -# 653 "mysql.h" +# 664 "mysql.h" struct __attribute__((aligned(__alignof__(void *)), aligned(__alignof__(unsigned long int)))) st_mysql_bind { unsigned long int * length; my_bool * is_null; void * buffer; my_bool * error; - enum enum_field_types buffer_type; - unsigned long int buffer_length; unsigned char * row_ptr; + void (* store_param_func)(NET * net, struct st_mysql_bind * param); + void (* fetch_result)(struct st_mysql_bind *, MYSQL_FIELD *, unsigned char * * row); + void (* skip_result)(struct st_mysql_bind *, MYSQL_FIELD *, unsigned char * * row); + unsigned long int buffer_length; unsigned long int offset; unsigned long int length_value; unsigned int param_number; unsigned int pack_length; + enum enum_field_types buffer_type; my_bool error_value; my_bool is_unsigned; my_bool long_data_used; my_bool is_null_value; - void (* store_param_func)(NET * net, struct st_mysql_bind * param); - void (* fetch_result)(struct st_mysql_bind *, MYSQL_FIELD *, unsigned char * * row); - void (* skip_result)(struct st_mysql_bind *, MYSQL_FIELD *, unsigned char * * row); + void * extension; }; -# 145 "mysql.h" -struct __attribute__((aligned(__alignof__(unsigned long long int)), aligned(__alignof__(void *)))) st_mysql_data +# 628 "mysql/plugin.h" +struct __attribute__((aligned(__alignof__(int)))) st_mysql_daemon { + int interface_version; + }; +# 150 "mysql.h" +struct __attribute__((aligned(__alignof__(void *)), aligned(__alignof__(unsigned long long int)))) st_mysql_data + { + MYSQL_ROWS * data; + struct embedded_query_result * embedded_info; + MEM_ROOT alloc; my_ulonglong rows; unsigned int fields; - MYSQL_ROWS * data; - MEM_ROOT alloc; - struct embedded_query_result * embedded_info; + void * extension; }; -# 93 "mysql.h" +# 95 "mysql.h" struct __attribute__((aligned(__alignof__(void *)), aligned(__alignof__(unsigned long int)))) st_mysql_field { char * name; @@ -228,30 +264,75 @@ struct __attribute__((aligned(__alignof__(void *)), aligned(__alignof__(unsigned unsigned int decimals; unsigned int charsetnr; enum enum_field_types type; + void * extension; }; -# 340 "mysql.h" +# 581 "mysql/plugin.h" +struct __attribute__((aligned(__alignof__(int)), aligned(__alignof__(void *)))) st_mysql_ftparser + { + int interface_version; + int (* parse)(MYSQL_FTPARSER_PARAM * param); + int (* init)(MYSQL_FTPARSER_PARAM * param); + int (* deinit)(MYSQL_FTPARSER_PARAM * param); + }; +# 495 "mysql/plugin.h" +struct __attribute__((aligned(__alignof__(int)), aligned(__alignof__(void *)))) st_mysql_ftparser_boolean_info + { + enum enum_ft_token_type type; + int yesno; + int weight_adjust; + char wasign; + char trunc; + char prev; + char * quot; + }; +# 557 "mysql/plugin.h" +struct __attribute__((aligned(__alignof__(void *)), aligned(__alignof__(int)))) st_mysql_ftparser_param + { + int (* mysql_parse)(struct st_mysql_ftparser_param *, char * doc, int); + int (* mysql_add_word)(struct st_mysql_ftparser_param *, char * word, int, MYSQL_FTPARSER_BOOLEAN_INFO * boolean_info); + void * ftparser_state; + void * mysql_ftparam; + struct charset_info_st * cs; + char * doc; + int length; + int flags; + enum enum_ftparser_mode mode; + }; +# 638 "mysql/plugin.h" +struct __attribute__((aligned(__alignof__(int)))) st_mysql_information_schema + { + int interface_version; + }; +# 29 "mysql/plugin.h" +struct __attribute__((aligned(__alignof__(void *)), aligned(__alignof__(unsigned int)))) st_mysql_lex_string + { + char * str; + unsigned int length; + }; +# 348 "mysql.h" struct __attribute__((aligned(__alignof__(void *)), aligned(__alignof__(unsigned long int)))) st_mysql_manager { NET net; char * host; char * user; char * passwd; - unsigned int port; - my_bool free_me; - my_bool eof; - int cmd_status; - int last_errno; char * net_buf; char * net_buf_pos; char * net_data_end; + unsigned int port; + int cmd_status; + int last_errno; int net_buf_size; + my_bool free_me; + my_bool eof; char last_error[256]; + void * extension; }; -# 750 "mysql.h" +# 763 "mysql.h" struct __attribute__((aligned(__alignof__(void *)))) st_mysql_methods { my_bool (* read_query_result)(MYSQL * mysql); - my_bool (* advanced_command)(MYSQL * mysql, enum enum_server_command, char const * header, unsigned long int, char const * arg, unsigned long int, my_bool, MYSQL_STMT * stmt); + my_bool (* advanced_command)(MYSQL * mysql, enum enum_server_command, unsigned char const * header, unsigned long int, unsigned char const * arg, unsigned long int, my_bool, MYSQL_STMT * stmt); MYSQL_DATA * (* read_rows)(MYSQL * mysql, MYSQL_FIELD * mysql_fields, unsigned int); MYSQL_RES * (* use_result)(MYSQL * mysql); void (* fetch_lengths)(unsigned long int * to, MYSQL_ROW, unsigned int); @@ -267,7 +348,7 @@ struct __attribute__((aligned(__alignof__(void *)))) st_mysql_methods int (* read_change_user_result)(MYSQL * mysql, char * buff, char const * passwd); int (* read_rows_from_cursor)(MYSQL_STMT * stmt); }; -# 167 "mysql.h" +# 173 "mysql.h" struct __attribute__((aligned(__alignof__(unsigned long int)), aligned(__alignof__(void *)))) st_mysql_options { unsigned int connect_timeout; @@ -309,14 +390,32 @@ struct __attribute__((aligned(__alignof__(unsigned long int)), aligned(__alignof void (* local_infile_end)(void); int (* local_infile_error)(void *, char *, unsigned int); void * local_infile_userdata; + void * extension; }; -# 354 "mysql.h" +# 363 "mysql.h" struct __attribute__((aligned(__alignof__(void *)))) st_mysql_parameters { unsigned long int * p_max_allowed_packet; unsigned long int * p_net_buffer_length; + void * extension; }; -# 309 "mysql.h" +# 384 "mysql/plugin.h" +struct __attribute__((aligned(__alignof__(int)), aligned(__alignof__(void *)))) st_mysql_plugin + { + int type; + void * info; + char const * name; + char const * author; + char const * descr; + int license; + int (* init)(void); + int (* deinit)(void); + unsigned int version; + struct st_mysql_show_var * status_vars; + struct st_mysql_sys_var * * system_vars; + void * __reserved1; + }; +# 316 "mysql.h" struct __attribute__((aligned(__alignof__(unsigned long long int)), aligned(__alignof__(void *)))) st_mysql_res { my_ulonglong row_count; @@ -325,23 +424,31 @@ struct __attribute__((aligned(__alignof__(unsigned long long int)), aligned(__al MYSQL_ROWS * data_cursor; unsigned long int * lengths; MYSQL * handle; + struct st_mysql_methods const * methods; + MYSQL_ROW row; + MYSQL_ROW current_row; MEM_ROOT field_alloc; unsigned int field_count; unsigned int current_field; - MYSQL_ROW row; - MYSQL_ROW current_row; my_bool eof; my_bool unbuffered_fetch_cancelled; - struct st_mysql_methods const * methods; + void * extension; }; -# 134 "mysql.h" +# 139 "mysql.h" struct __attribute__((aligned(__alignof__(void *)), aligned(__alignof__(unsigned long int)))) st_mysql_rows { struct st_mysql_rows * next; MYSQL_ROW data; unsigned long int length; }; -# 681 "mysql.h" +# 116 "mysql/plugin.h" +struct __attribute__((aligned(__alignof__(void *)))) st_mysql_show_var + { + char const * name; + char * value; + enum enum_mysql_show_type type; + }; +# 693 "mysql.h" struct __attribute__((aligned(__alignof__(void *)), aligned(__alignof__(unsigned long long int)))) st_mysql_stmt { MEM_ROOT mem_root; @@ -352,9 +459,9 @@ struct __attribute__((aligned(__alignof__(void *)), aligned(__alignof__(unsigned MYSQL_FIELD * fields; MYSQL_DATA result; MYSQL_ROWS * data_cursor; + int (* read_row_func)(struct st_mysql_stmt * stmt, unsigned char * * row); my_ulonglong affected_rows; my_ulonglong insert_id; - int (* read_row_func)(struct st_mysql_stmt * stmt, unsigned char * * row); unsigned long int stmt_id; unsigned long int flags; unsigned long int prefetch_rows; @@ -370,8 +477,14 @@ struct __attribute__((aligned(__alignof__(void *)), aligned(__alignof__(unsigned unsigned char bind_result_done; my_bool unbuffered_fetch_cancelled; my_bool update_max_length; + void * extension; }; -# 48 "mysql_time.h" +# 616 "mysql/plugin.h" +struct __attribute__((aligned(__alignof__(int)))) st_mysql_storage_engine + { + int interface_version; + }; +# 47 "mysql_time.h" struct __attribute__((aligned(__alignof__(unsigned long int)))) st_mysql_time { unsigned int year; @@ -384,7 +497,23 @@ struct __attribute__((aligned(__alignof__(unsigned long int)))) st_mysql_time my_bool neg; enum enum_mysql_timestamp_type time_type; }; -# 184 "mysql_com.h" +# 658 "mysql/plugin.h" +struct __attribute__((aligned(__alignof__(void *)))) st_mysql_value + { + int (* value_type)(struct st_mysql_value *); + char const * (* val_str)(struct st_mysql_value *, char * buffer, int * length); + int (* val_real)(struct st_mysql_value *, double * realbuf); + int (* val_int)(struct st_mysql_value *, long long int * intbuf); + }; +# 46 "mysql/plugin.h" +struct __attribute__((aligned(__alignof__(long int)))) st_mysql_xid + { + long int formatID; + long int gtrid_length; + long int bqual_length; + char data[128]; + }; +# 187 "mysql_com.h" struct __attribute__((aligned(__alignof__(void *)), aligned(__alignof__(unsigned long int)))) st_net { Vio * vio; @@ -393,6 +522,10 @@ struct __attribute__((aligned(__alignof__(void *)), aligned(__alignof__(unsigned unsigned char * write_pos; unsigned char * read_pos; my_socket fd; + unsigned long int remain_in_buf; + unsigned long int length; + unsigned long int buf_length; + unsigned long int where_b; unsigned long int max_packet; unsigned long int max_packet_size; unsigned int pkt_nr; @@ -401,26 +534,23 @@ struct __attribute__((aligned(__alignof__(void *)), aligned(__alignof__(unsigned unsigned int read_timeout; unsigned int retry_count; int fcntl; - my_bool compress; - unsigned long int remain_in_buf; - unsigned long int length; - unsigned long int buf_length; - unsigned long int where_b; unsigned int * return_status; unsigned char reading_or_writing; char save_char; my_bool no_send_ok; my_bool no_send_eof; + my_bool compress; my_bool no_send_error; - char last_error[512]; - char sqlstate[(5 + 1)]; + unsigned char * query_cache_query; unsigned int last_errno; unsigned char error; - gptr query_cache_query; my_bool report_error; my_bool return_errno; + char last_error[512]; + char sqlstate[(5 + 1)]; + void * extension; }; -# 23 "typelib.h" +# 22 "typelib.h" struct __attribute__((aligned(__alignof__(unsigned int)), aligned(__alignof__(void *)))) st_typelib { unsigned int count; @@ -428,7 +558,7 @@ struct __attribute__((aligned(__alignof__(unsigned int)), aligned(__alignof__(vo char const * * type_names; unsigned int * type_lengths; }; -# 375 "mysql_com.h" +# 383 "mysql_com.h" struct __attribute__((aligned(__alignof__(unsigned int)), aligned(__alignof__(void *)))) st_udf_args { unsigned int arg_count; @@ -438,8 +568,9 @@ struct __attribute__((aligned(__alignof__(unsigned int)), aligned(__alignof__(vo char * maybe_null; char * * attributes; unsigned long int * attribute_lengths; + void * extension; }; -# 388 "mysql_com.h" +# 397 "mysql_com.h" struct __attribute__((aligned(__alignof__(unsigned long int)), aligned(__alignof__(void *)))) st_udf_init { my_bool maybe_null; @@ -447,15 +578,16 @@ struct __attribute__((aligned(__alignof__(unsigned long int)), aligned(__alignof unsigned long int max_length; char * ptr; my_bool const_item; + void * extension; }; -# 27 "my_alloc.h" +# 26 "my_alloc.h" struct __attribute__((aligned(__alignof__(void *)), aligned(__alignof__(unsigned int)))) st_used_mem { struct st_used_mem * next; unsigned int left; unsigned int size; }; -# 372 "mysql_com.h" +# 380 "mysql_com.h" enum Item_result { STRING_RESULT = 0, @@ -464,7 +596,7 @@ enum Item_result ROW_RESULT = 3, DECIMAL_RESULT = 4, }; -# 318 "mysql_com.h" +# 321 "mysql_com.h" enum enum_cursor_type { CURSOR_TYPE_NO_CURSOR = 0, @@ -472,7 +604,7 @@ enum enum_cursor_type CURSOR_TYPE_FOR_UPDATE = 2, CURSOR_TYPE_SCROLLABLE = 4, }; -# 231 "mysql_com.h" +# 234 "mysql_com.h" enum enum_field_types { MYSQL_TYPE_DECIMAL = 0, @@ -503,13 +635,43 @@ enum enum_field_types MYSQL_TYPE_STRING = 254, MYSQL_TYPE_GEOMETRY = 255, }; -# 328 "mysql_com.h" +# 455 "mysql/plugin.h" +enum enum_ft_token_type + { + FT_TOKEN_EOF = 0, + FT_TOKEN_WORD = 1, + FT_TOKEN_LEFT_PAREN = 2, + FT_TOKEN_RIGHT_PAREN = 3, + FT_TOKEN_STOPWORD = 4, + }; +# 407 "mysql/plugin.h" +enum enum_ftparser_mode + { + MYSQL_FTPARSER_SIMPLE_MODE = 0, + MYSQL_FTPARSER_WITH_STOPWORDS = 1, + MYSQL_FTPARSER_FULL_BOOLEAN_INFO = 2, + }; +# 331 "mysql_com.h" enum enum_mysql_set_option { MYSQL_OPTION_MULTI_STATEMENTS_ON = 0, MYSQL_OPTION_MULTI_STATEMENTS_OFF = 1, }; -# 583 "mysql.h" +# 109 "mysql/plugin.h" +enum enum_mysql_show_type + { + SHOW_UNDEF = 0, + SHOW_BOOL = 1, + SHOW_INT = 2, + SHOW_LONG = 3, + SHOW_LONGLONG = 4, + SHOW_CHAR = 5, + SHOW_CHAR_PTR = 6, + SHOW_ARRAY = 7, + SHOW_FUNC = 8, + SHOW_DOUBLE = 9, + }; +# 594 "mysql.h" enum enum_mysql_stmt_state { MYSQL_STMT_INIT_DONE = 1, @@ -517,7 +679,7 @@ enum enum_mysql_stmt_state MYSQL_STMT_EXECUTE_DONE = 3, MYSQL_STMT_FETCH_DONE = 4, }; -# 29 "mysql_time.h" +# 28 "mysql_time.h" enum enum_mysql_timestamp_type { MYSQL_TIMESTAMP_NONE = -(2), @@ -526,7 +688,7 @@ enum enum_mysql_timestamp_type MYSQL_TIMESTAMP_DATETIME = 1, MYSQL_TIMESTAMP_TIME = 2, }; -# 52 "mysql_com.h" +# 55 "mysql_com.h" enum enum_server_command { COM_SLEEP = 0, @@ -561,14 +723,14 @@ enum enum_server_command COM_DAEMON = 29, COM_END = 30, }; -# 727 "mysql.h" +# 740 "mysql.h" enum enum_stmt_attr_type { STMT_ATTR_UPDATE_MAX_LENGTH = 0, STMT_ATTR_CURSOR_TYPE = 1, STMT_ATTR_PREFETCH_ROWS = 2, }; -# 293 "mysql_com.h" +# 296 "mysql_com.h" enum mysql_enum_shutdown_level { SHUTDOWN_DEFAULT = 0, @@ -577,10 +739,9 @@ enum mysql_enum_shutdown_level SHUTDOWN_WAIT_UPDATES = (unsigned char)((1 << 3)), SHUTDOWN_WAIT_ALL_BUFFERS = ((unsigned char)((1 << 3)) << 1), SHUTDOWN_WAIT_CRITICAL_BUFFERS = (((unsigned char)((1 << 3)) << 1) + 1), - KILL_QUERY = 254, KILL_CONNECTION = 255, }; -# 154 "mysql.h" +# 160 "mysql.h" enum mysql_option { MYSQL_OPT_CONNECT_TIMEOUT = 0, @@ -606,7 +767,7 @@ enum mysql_option MYSQL_OPT_RECONNECT = 20, MYSQL_OPT_SSL_VERIFY_SERVER_CERT = 21, }; -# 221 "mysql.h" +# 228 "mysql.h" enum mysql_protocol_type { MYSQL_PROTOCOL_DEFAULT = 0, @@ -615,351 +776,393 @@ enum mysql_protocol_type MYSQL_PROTOCOL_PIPE = 3, MYSQL_PROTOCOL_MEMORY = 4, }; -# 231 "mysql.h" +# 238 "mysql.h" enum mysql_rpl_type { MYSQL_RPL_MASTER = 0, MYSQL_RPL_SLAVE = 1, MYSQL_RPL_ADMIN = 2, }; -# 216 "mysql.h" +# 223 "mysql.h" enum mysql_status { MYSQL_STATUS_READY = 0, MYSQL_STATUS_GET_RESULT = 1, MYSQL_STATUS_USE_RESULT = 2, }; -# 427 "mysql_com.h" +# 438 "mysql_com.h" extern my_bool check_scramble(char const * reply, char const * message, unsigned char const * hash_stage2); -# 420 "mysql_com.h" -extern my_bool check_scramble_323(char const *, char const * message, unsigned long int * salt); -# 33 "typelib.h" -extern TYPELIB * copy_typelib(MEM_ROOT * root, TYPELIB * from); -# 415 "mysql_com.h" -extern void create_random_string(char * to, unsigned int, struct rand_struct * rand_st); -# 30 "typelib.h" -extern int find_type(char * x, const TYPELIB * typelib, unsigned int); -# 429 "mysql_com.h" -extern void get_salt_from_password(unsigned char * res, char const * password); -# 422 "mysql_com.h" -extern void get_salt_from_password_323(unsigned long int * res, char const * password); -# 435 "mysql_com.h" -extern char * get_tty_password(char const * opt_message); -# 32 "typelib.h" -extern char const * get_type(TYPELIB * typelib, unsigned int); -# 417 "mysql_com.h" -extern void hash_password(unsigned long int * to, char const * password, unsigned int); -# 31 "my_list.h" -extern LIST * list_add(LIST * root, LIST * element); -# 33 "my_list.h" -extern LIST * list_cons(void * data, LIST * root); -# 32 "my_list.h" -extern LIST * list_delete(LIST * root, LIST * element); -# 35 "my_list.h" -extern void list_free(LIST * root, unsigned int); -# 36 "my_list.h" -extern unsigned int list_length(LIST *); -# 34 "my_list.h" -extern LIST * list_reverse(LIST * root); -# 37 "my_list.h" -extern int list_walk(LIST *, list_walk_action, gptr); -# 430 "mysql_com.h" -extern void make_password_from_salt(char * to, unsigned char const * hash_stage2); -# 423 "mysql_com.h" -extern void make_password_from_salt_323(char * to, unsigned long int const * salt); -# 425 "mysql_com.h" -extern void make_scrambled_password(char * to, char const * password); -# 418 "mysql_com.h" -extern void make_scrambled_password_323(char * to, char const * password); -# 31 "typelib.h" -extern void make_type(char * to, unsigned int, TYPELIB * typelib); -# 358 "mysql_com.h" -extern int my_connect(my_socket, struct sockaddr const * name, unsigned int, unsigned int); -# 340 "mysql_com.h" -extern my_bool my_net_init(NET * net, Vio * vio); -# 341 "mysql_com.h" -extern void my_net_local_init(NET * net); -# 351 "mysql_com.h" -extern unsigned long int my_net_read(NET * net); -# 346 "mysql_com.h" -extern my_bool my_net_write(NET * net, char const * packet, unsigned long int); -# 414 "mysql_com.h" -extern double my_rnd(struct rand_struct *); -# 441 "mysql_com.h" -extern void my_thread_end(void); -# 440 "mysql_com.h" -extern my_bool my_thread_init(void); -# 559 "mysql.h" -extern void myodbc_remove_escape(MYSQL * mysql, char * name); -# 501 "mysql.h" -extern int mysql_add_slave(MYSQL * mysql, char const * host, unsigned int, char const * user, char const * passwd); -# 410 "mysql.h" -extern my_ulonglong mysql_affected_rows(MYSQL * mysql); -# 823 "mysql.h" -extern my_bool mysql_autocommit(MYSQL * mysql, my_bool); -# 426 "mysql.h" -extern my_bool mysql_change_user(MYSQL * mysql, char const * user, char const * passwd, char const * db); -# 418 "mysql.h" -extern char const * mysql_character_set_name(MYSQL * mysql); -# 826 "mysql.h" -extern void mysql_close(MYSQL * sock); -# 821 "mysql.h" -extern my_bool mysql_commit(MYSQL * mysql); -# 530 "mysql.h" -extern void mysql_data_seek(MYSQL_RES * result, my_ulonglong); -# 548 "mysql.h" -extern void mysql_debug(char const * debug); -# 487 "mysql.h" -extern void mysql_disable_reads_from_master(MYSQL * mysql); -# 481 "mysql.h" -extern void mysql_disable_rpl_parse(MYSQL * mysql); -# 509 "mysql.h" -extern int mysql_dump_debug_info(MYSQL * mysql); -# 561 "mysql.h" -extern my_bool mysql_embedded(void); -# 486 "mysql.h" -extern void mysql_enable_reads_from_master(MYSQL * mysql); -# 480 "mysql.h" -extern void mysql_enable_rpl_parse(MYSQL * mysql); -# 402 "mysql.h" -extern my_bool mysql_eof(MYSQL_RES * res); -# 412 "mysql.h" -extern unsigned int mysql_errno(MYSQL * mysql); -# 436 "mysql_com.h" -extern char const * mysql_errno_to_sqlstate(unsigned int); -# 413 "mysql.h" -extern char const * mysql_error(MYSQL * mysql); -# 541 "mysql.h" -extern unsigned long int mysql_escape_string(char * to, char const * from, unsigned long int); -# 538 "mysql.h" -extern MYSQL_FIELD * mysql_fetch_field(MYSQL_RES * result); -# 403 "mysql.h" -extern MYSQL_FIELD * mysql_fetch_field_direct(MYSQL_RES * res, unsigned int); -# 405 "mysql.h" -extern MYSQL_FIELD * mysql_fetch_fields(MYSQL_RES * res); -# 537 "mysql.h" -extern unsigned long int * mysql_fetch_lengths(MYSQL_RES * result); -# 536 "mysql.h" -extern MYSQL_ROW mysql_fetch_row(MYSQL_RES * result); -# 409 "mysql.h" -extern unsigned int mysql_field_count(MYSQL * mysql); -# 534 "mysql.h" -extern MYSQL_FIELD_OFFSET mysql_field_seek(MYSQL_RES * result, MYSQL_FIELD_OFFSET); -# 407 "mysql.h" -extern MYSQL_FIELD_OFFSET mysql_field_tell(MYSQL_RES * res); -# 529 "mysql.h" -extern void mysql_free_result(MYSQL_RES * result); -# 454 "mysql.h" -extern void mysql_get_character_set_info(MYSQL * mysql, MY_CHARSET_INFO * charset); -# 519 "mysql.h" -extern char const * mysql_get_client_info(void); -# 520 "mysql.h" -extern unsigned long int mysql_get_client_version(void); -# 521 "mysql.h" -extern char const * mysql_get_host_info(MYSQL * mysql); -# 384 "mysql.h" -extern MYSQL_PARAMETERS * mysql_get_parameters(void); -# 523 "mysql.h" -extern unsigned int mysql_get_proto_info(MYSQL * mysql); -# 518 "mysql.h" -extern char const * mysql_get_server_info(MYSQL * mysql); -# 522 "mysql.h" -extern unsigned long int mysql_get_server_version(MYSQL * mysql); -# 425 "mysql.h" -extern char const * mysql_get_ssl_cipher(MYSQL * mysql); -# 543 "mysql.h" -extern unsigned long int mysql_hex_string(char * to, char const * from, unsigned long int); -# 416 "mysql.h" -extern char const * mysql_info(MYSQL * mysql); -# 421 "mysql.h" -extern MYSQL * mysql_init(MYSQL * mysql); -# 411 "mysql.h" -extern my_ulonglong mysql_insert_id(MYSQL * mysql); -# 512 "mysql.h" -extern int mysql_kill(MYSQL * mysql, unsigned long int); -# 524 "mysql.h" -extern MYSQL_RES * mysql_list_dbs(MYSQL * mysql, char const * wild); -# 539 "mysql.h" -extern MYSQL_RES * mysql_list_fields(MYSQL * mysql, char const * table, char const * wild); -# 526 "mysql.h" -extern MYSQL_RES * mysql_list_processes(MYSQL * mysql); -# 525 "mysql.h" -extern MYSQL_RES * mysql_list_tables(MYSQL * mysql, char const * wild); -# 568 "mysql.h" -extern void mysql_manager_close(MYSQL_MANAGER * con); -# 569 "mysql.h" -extern int mysql_manager_command(MYSQL_MANAGER * con, char const * cmd, int); -# 563 "mysql.h" -extern MYSQL_MANAGER * mysql_manager_connect(MYSQL_MANAGER * con, char const * host, char const * user, char const * passwd, unsigned int); -# 571 "mysql.h" -extern int mysql_manager_fetch_line(MYSQL_MANAGER * con, char * res_buf, int); -# 562 "mysql.h" -extern MYSQL_MANAGER * mysql_manager_init(MYSQL_MANAGER * con); -# 445 "mysql.h" -extern my_bool mysql_master_query(MYSQL * mysql, char const * q, unsigned long int); -# 447 "mysql.h" -extern my_bool mysql_master_send_query(MYSQL * mysql, char const * q, unsigned long int); -# 824 "mysql.h" -extern my_bool mysql_more_results(MYSQL * mysql); -# 825 "mysql.h" -extern int mysql_next_result(MYSQL * mysql); -# 401 "mysql.h" -extern unsigned int mysql_num_fields(MYSQL_RES * res); -# 400 "mysql.h" -extern my_ulonglong mysql_num_rows(MYSQL_RES * res); -# 549 "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)); -# 527 "mysql.h" -extern int mysql_options(MYSQL * mysql, enum mysql_option, char const * arg); -# 516 "mysql.h" -extern int mysql_ping(MYSQL * mysql); -# 75 "mysql.h" -extern unsigned int mysql_port; -# 436 "mysql.h" -extern int mysql_query(MYSQL * mysql, char const * q); -# 574 "mysql.h" -extern my_bool mysql_read_query_result(MYSQL * mysql); -# 489 "mysql.h" -extern my_bool mysql_reads_from_master_enabled(MYSQL * mysql); -# 428 "mysql.h" -extern MYSQL * mysql_real_connect(MYSQL * mysql, char const * host, char const * user, char const * passwd, char const * db, unsigned int, char const * unix_socket, unsigned long int); -# 545 "mysql.h" -extern unsigned long int mysql_real_escape_string(MYSQL * mysql, char * to, char const * from, unsigned long int); -# 439 "mysql.h" -extern int mysql_real_query(MYSQL * mysql, char const * q, unsigned long int); -# 510 "mysql.h" -extern int mysql_refresh(MYSQL * mysql, unsigned int); -# 822 "mysql.h" -extern my_bool mysql_rollback(MYSQL * mysql); -# 532 "mysql.h" -extern MYSQL_ROW_OFFSET mysql_row_seek(MYSQL_RES * result, MYSQL_ROW_OFFSET); -# 406 "mysql.h" -extern MYSQL_ROW_OFFSET mysql_row_tell(MYSQL_RES * res); -# 483 "mysql.h" -extern int mysql_rpl_parse_enabled(MYSQL * mysql); -# 494 "mysql.h" -extern my_bool mysql_rpl_probe(MYSQL * mysql); -# 491 "mysql.h" -extern enum mysql_rpl_type mysql_rpl_query_type(char const * q, int); -# 435 "mysql.h" -extern int mysql_select_db(MYSQL * mysql, char const * db); -# 437 "mysql.h" -extern int mysql_send_query(MYSQL * mysql, char const * q, unsigned long int); -# 371 "mysql.h" -extern void mysql_server_end(void); -# 370 "mysql.h" -extern int mysql_server_init(int, char * * argv, char * * groups); -# 419 "mysql.h" -extern int mysql_set_character_set(MYSQL * mysql, char const * csname); -# 472 "mysql.h" -extern void mysql_set_local_infile_default(MYSQL * mysql); -# 461 "mysql.h" -extern void mysql_set_local_infile_handler(MYSQL * mysql, int (* local_infile_init)(void * *, char const *, void *), int (* local_infile_read)(void *, char *, unsigned int), void (* local_infile_end)(void), int (* local_infile_error)(void *, char *, unsigned int), void *); -# 497 "mysql.h" -extern int mysql_set_master(MYSQL * mysql, char const * host, unsigned int, char const * user, char const * passwd); -# 513 "mysql.h" -extern int mysql_set_server_option(MYSQL * mysql, enum enum_mysql_set_option); -# 506 "mysql.h" -extern int mysql_shutdown(MYSQL * mysql, enum mysql_enum_shutdown_level); -# 450 "mysql.h" -extern my_bool mysql_slave_query(MYSQL * mysql, char const * q, unsigned long int); -# 452 "mysql.h" -extern my_bool mysql_slave_send_query(MYSQL * mysql, char const * q, unsigned long int); -# 414 "mysql.h" -extern char const * mysql_sqlstate(MYSQL * mysql); -# 422 "mysql.h" -extern my_bool mysql_ssl_set(MYSQL * mysql, char const * key, char const * cert, char const * ca, char const * capath, char const * cipher); -# 517 "mysql.h" -extern char const * mysql_stat(MYSQL * mysql); -# 817 "mysql.h" -extern my_ulonglong mysql_stmt_affected_rows(MYSQL_STMT * stmt); -# 795 "mysql.h" -extern my_bool mysql_stmt_attr_get(MYSQL_STMT * stmt, enum enum_stmt_attr_type, void * attr); -# 792 "mysql.h" -extern my_bool mysql_stmt_attr_set(MYSQL_STMT * stmt, enum enum_stmt_attr_type, void const * attr); -# 798 "mysql.h" -extern my_bool mysql_stmt_bind_param(MYSQL_STMT * stmt, MYSQL_BIND * bnd); -# 799 "mysql.h" -extern my_bool mysql_stmt_bind_result(MYSQL_STMT * stmt, MYSQL_BIND * bnd); -# 800 "mysql.h" -extern my_bool mysql_stmt_close(MYSQL_STMT * stmt); -# 815 "mysql.h" -extern void mysql_stmt_data_seek(MYSQL_STMT * stmt, my_ulonglong); -# 809 "mysql.h" -extern unsigned int mysql_stmt_errno(MYSQL_STMT * stmt); -# 810 "mysql.h" -extern char const * mysql_stmt_error(MYSQL_STMT * stmt); -# 785 "mysql.h" -extern int mysql_stmt_execute(MYSQL_STMT * stmt); -# 786 "mysql.h" -extern int mysql_stmt_fetch(MYSQL_STMT * stmt); -# 787 "mysql.h" -extern int mysql_stmt_fetch_column(MYSQL_STMT * stmt, MYSQL_BIND * bind, unsigned int, unsigned long int); -# 819 "mysql.h" -extern unsigned int mysql_stmt_field_count(MYSQL_STMT * stmt); -# 802 "mysql.h" -extern my_bool mysql_stmt_free_result(MYSQL_STMT * stmt); -# 782 "mysql.h" -extern MYSQL_STMT * mysql_stmt_init(MYSQL * mysql); -# 818 "mysql.h" -extern my_ulonglong mysql_stmt_insert_id(MYSQL_STMT * stmt); -# 816 "mysql.h" -extern my_ulonglong mysql_stmt_num_rows(MYSQL_STMT * stmt); -# 791 "mysql.h" -extern unsigned long int mysql_stmt_param_count(MYSQL_STMT * stmt); -# 808 "mysql.h" -extern MYSQL_RES * mysql_stmt_param_metadata(MYSQL_STMT * stmt); -# 783 "mysql.h" -extern int mysql_stmt_prepare(MYSQL_STMT * stmt, char const * query, unsigned long int); -# 801 "mysql.h" -extern my_bool mysql_stmt_reset(MYSQL_STMT * stmt); -# 807 "mysql.h" -extern MYSQL_RES * mysql_stmt_result_metadata(MYSQL_STMT * stmt); -# 812 "mysql.h" -extern MYSQL_ROW_OFFSET mysql_stmt_row_seek(MYSQL_STMT * stmt, MYSQL_ROW_OFFSET); -# 814 "mysql.h" -extern MYSQL_ROW_OFFSET mysql_stmt_row_tell(MYSQL_STMT * stmt); -# 803 "mysql.h" -extern my_bool mysql_stmt_send_long_data(MYSQL_STMT * stmt, unsigned int, char const * data, unsigned long int); -# 811 "mysql.h" -extern char const * mysql_stmt_sqlstate(MYSQL_STMT * stmt); -# 790 "mysql.h" -extern int mysql_stmt_store_result(MYSQL_STMT * stmt); -# 441 "mysql.h" -extern MYSQL_RES * mysql_store_result(MYSQL * mysql); -# 393 "mysql.h" -extern void mysql_thread_end(void); -# 417 "mysql.h" -extern unsigned long int mysql_thread_id(MYSQL * mysql); -# 392 "mysql.h" -extern my_bool mysql_thread_init(void); -# 560 "mysql.h" -extern unsigned int mysql_thread_safe(void); -# 76 "mysql.h" -extern char * mysql_unix_port; -# 442 "mysql.h" -extern MYSQL_RES * mysql_use_result(MYSQL * mysql); -# 415 "mysql.h" -extern unsigned int mysql_warning_count(MYSQL * mysql); -# 343 "mysql_com.h" -extern void net_clear(NET * net); -# 342 "mysql_com.h" -extern void net_end(NET * net); -# 345 "mysql_com.h" -extern my_bool net_flush(NET * net); -# 350 "mysql_com.h" -extern int net_real_write(NET * net, char const * packet, unsigned long int); -# 344 "mysql_com.h" -extern my_bool net_realloc(NET * net, unsigned long int); -# 347 "mysql_com.h" -extern my_bool net_write_command(NET * net, unsigned char, char const * header, unsigned long int, char const * packet, unsigned long int); # 431 "mysql_com.h" -extern char * octet2hex(char * to, char const * str, unsigned int); -# 412 "mysql_com.h" -extern void randominit(struct rand_struct *, unsigned long int, unsigned long int); -# 426 "mysql_com.h" -extern void scramble(char * to, char const * message, char const * password); -# 419 "mysql_com.h" -extern void scramble_323(char * to, char const * message, char const * password); +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" +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); +# 30 "typelib.h" +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" +extern void get_salt_from_password(unsigned char * res, char const * password); +# 433 "mysql_com.h" +extern void get_salt_from_password_323(unsigned long int * res, char const * password); +# 446 "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" +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); +# 32 "my_list.h" +extern LIST * list_cons(void * data, LIST * root); +# 31 "my_list.h" +extern LIST * list_delete(LIST * root, LIST * element); +# 34 "my_list.h" +extern void list_free(LIST * root, unsigned int); +# 35 "my_list.h" +extern unsigned int list_length(LIST *); +# 33 "my_list.h" +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" +extern void make_password_from_salt(char * to, unsigned char const * hash_stage2); +# 434 "mysql_com.h" +extern void make_password_from_salt_323(char * to, unsigned long int const * salt); +# 436 "mysql_com.h" +extern void make_scrambled_password(char * to, char const * password); +# 429 "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" +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 void my_net_local_init(NET * net); +# 354 "mysql_com.h" +extern unsigned long int my_net_read(NET * net); +# 349 "mysql_com.h" +extern my_bool my_net_write(NET * net, unsigned char const * packet, size_t); +# 425 "mysql_com.h" +extern double my_rnd(struct rand_struct *); +# 452 "mysql_com.h" +extern void my_thread_end(void); +# 451 "mysql_com.h" +extern my_bool my_thread_init(void); +# 570 "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" +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" +extern void mysql_close(MYSQL * sock); +# 834 "mysql.h" +extern my_bool mysql_commit(MYSQL * mysql); +# 541 "mysql.h" +extern void mysql_data_seek(MYSQL_RES * result, my_ulonglong); +# 559 "mysql.h" +extern void mysql_debug(char const * debug); +# 498 "mysql.h" +extern void mysql_disable_reads_from_master(MYSQL * mysql); +# 492 "mysql.h" +extern void mysql_disable_rpl_parse(MYSQL * mysql); +# 520 "mysql.h" +extern int mysql_dump_debug_info(MYSQL * mysql); +# 572 "mysql.h" +extern my_bool mysql_embedded(void); +# 497 "mysql.h" +extern void mysql_enable_reads_from_master(MYSQL * mysql); +# 491 "mysql.h" +extern void mysql_enable_rpl_parse(MYSQL * mysql); +# 413 "mysql.h" +extern my_bool mysql_eof(MYSQL_RES * res); +# 423 "mysql.h" +extern unsigned int mysql_errno(MYSQL * mysql); +# 447 "mysql_com.h" +extern char const * mysql_errno_to_sqlstate(unsigned int); +# 424 "mysql.h" +extern char const * mysql_error(MYSQL * mysql); +# 552 "mysql.h" +extern unsigned long int mysql_escape_string(char * to, char const * from, unsigned long int); +# 549 "mysql.h" +extern MYSQL_FIELD * mysql_fetch_field(MYSQL_RES * result); +# 414 "mysql.h" +extern MYSQL_FIELD * mysql_fetch_field_direct(MYSQL_RES * res, unsigned int); +# 416 "mysql.h" +extern MYSQL_FIELD * mysql_fetch_fields(MYSQL_RES * res); +# 548 "mysql.h" +extern unsigned long int * mysql_fetch_lengths(MYSQL_RES * result); +# 547 "mysql.h" +extern MYSQL_ROW mysql_fetch_row(MYSQL_RES * result); +# 420 "mysql.h" +extern unsigned int mysql_field_count(MYSQL * mysql); +# 545 "mysql.h" +extern MYSQL_FIELD_OFFSET mysql_field_seek(MYSQL_RES * result, MYSQL_FIELD_OFFSET); +# 418 "mysql.h" +extern MYSQL_FIELD_OFFSET mysql_field_tell(MYSQL_RES * res); +# 540 "mysql.h" +extern void mysql_free_result(MYSQL_RES * result); +# 465 "mysql.h" +extern void mysql_get_character_set_info(MYSQL * mysql, MY_CHARSET_INFO * charset); +# 530 "mysql.h" +extern char const * mysql_get_client_info(void); +# 531 "mysql.h" +extern unsigned long int mysql_get_client_version(void); +# 532 "mysql.h" +extern char const * mysql_get_host_info(MYSQL * mysql); +# 395 "mysql.h" +extern MYSQL_PARAMETERS * mysql_get_parameters(void); +# 534 "mysql.h" +extern unsigned int mysql_get_proto_info(MYSQL * mysql); +# 529 "mysql.h" +extern char const * mysql_get_server_info(MYSQL * mysql); +# 533 "mysql.h" +extern unsigned long int mysql_get_server_version(MYSQL * mysql); +# 436 "mysql.h" +extern char const * mysql_get_ssl_cipher(MYSQL * mysql); +# 554 "mysql.h" +extern unsigned long int mysql_hex_string(char * to, char const * from, unsigned long int); +# 427 "mysql.h" +extern char const * mysql_info(MYSQL * mysql); +# 432 "mysql.h" +extern MYSQL * mysql_init(MYSQL * mysql); +# 422 "mysql.h" +extern my_ulonglong mysql_insert_id(MYSQL * mysql); +# 523 "mysql.h" +extern int mysql_kill(MYSQL * mysql, unsigned long int); +# 535 "mysql.h" +extern MYSQL_RES * mysql_list_dbs(MYSQL * mysql, char const * wild); +# 550 "mysql.h" +extern MYSQL_RES * mysql_list_fields(MYSQL * mysql, char const * table, char const * wild); +# 537 "mysql.h" +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" +extern void mysql_manager_close(MYSQL_MANAGER * con); +# 580 "mysql.h" +extern int mysql_manager_command(MYSQL_MANAGER * con, char const * cmd, int); +# 574 "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" +extern int mysql_manager_fetch_line(MYSQL_MANAGER * con, char * res_buf, int); +# 573 "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" +extern my_bool mysql_more_results(MYSQL * mysql); +# 838 "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" +extern int mysql_ping(MYSQL * mysql); +# 76 "mysql.h" +extern unsigned int mysql_port; +# 447 "mysql.h" +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" +extern my_bool mysql_read_query_result(MYSQL * mysql); +# 500 "mysql.h" +extern my_bool mysql_reads_from_master_enabled(MYSQL * mysql); +# 439 "mysql.h" +extern MYSQL * mysql_real_connect(MYSQL * mysql, char const * host, char const * user, char const * passwd, char const * db, unsigned int, char const * unix_socket, unsigned long int); +# 556 "mysql.h" +extern unsigned long int mysql_real_escape_string(MYSQL * mysql, char * to, char const * from, unsigned long int); +# 450 "mysql.h" +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" +extern my_bool mysql_rollback(MYSQL * mysql); +# 543 "mysql.h" +extern MYSQL_ROW_OFFSET mysql_row_seek(MYSQL_RES * result, MYSQL_ROW_OFFSET); +# 417 "mysql.h" +extern MYSQL_ROW_OFFSET mysql_row_tell(MYSQL_RES * res); +# 494 "mysql.h" +extern int mysql_rpl_parse_enabled(MYSQL * mysql); +# 505 "mysql.h" +extern my_bool mysql_rpl_probe(MYSQL * mysql); +# 502 "mysql.h" +extern enum mysql_rpl_type mysql_rpl_query_type(char const * q, int); +# 446 "mysql.h" +extern int mysql_select_db(MYSQL * mysql, char const * db); +# 448 "mysql.h" +extern int mysql_send_query(MYSQL * mysql, char const * q, unsigned long int); +# 381 "mysql.h" +extern void mysql_server_end(void); +# 380 "mysql.h" +extern int mysql_server_init(int, char * * argv, char * * groups); +# 430 "mysql.h" +extern int mysql_set_character_set(MYSQL * mysql, char const * csname); +# 483 "mysql.h" +extern void mysql_set_local_infile_default(MYSQL * mysql); +# 472 "mysql.h" +extern void mysql_set_local_infile_handler(MYSQL * mysql, int (* local_infile_init)(void * *, char const *, void *), int (* local_infile_read)(void *, char *, unsigned int), void (* local_infile_end)(void), int (* local_infile_error)(void *, char *, unsigned int), void *); +# 508 "mysql.h" +extern int mysql_set_master(MYSQL * mysql, char const * host, unsigned int, char const * user, char const * passwd); +# 524 "mysql.h" +extern int mysql_set_server_option(MYSQL * mysql, enum enum_mysql_set_option); +# 517 "mysql.h" +extern int mysql_shutdown(MYSQL * mysql, enum mysql_enum_shutdown_level); +# 461 "mysql.h" +extern my_bool mysql_slave_query(MYSQL * mysql, char const * q, unsigned long int); +# 463 "mysql.h" +extern my_bool mysql_slave_send_query(MYSQL * mysql, char const * q, unsigned long int); +# 425 "mysql.h" +extern char const * mysql_sqlstate(MYSQL * mysql); +# 433 "mysql.h" +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" +extern my_ulonglong mysql_stmt_affected_rows(MYSQL_STMT * stmt); +# 808 "mysql.h" +extern my_bool mysql_stmt_attr_get(MYSQL_STMT * stmt, enum enum_stmt_attr_type, void * attr); +# 805 "mysql.h" +extern my_bool mysql_stmt_attr_set(MYSQL_STMT * stmt, enum enum_stmt_attr_type, void const * attr); +# 811 "mysql.h" +extern my_bool mysql_stmt_bind_param(MYSQL_STMT * stmt, MYSQL_BIND * bnd); +# 812 "mysql.h" +extern my_bool mysql_stmt_bind_result(MYSQL_STMT * stmt, MYSQL_BIND * bnd); +# 813 "mysql.h" +extern my_bool mysql_stmt_close(MYSQL_STMT * stmt); +# 828 "mysql.h" +extern void mysql_stmt_data_seek(MYSQL_STMT * stmt, my_ulonglong); +# 822 "mysql.h" +extern unsigned int mysql_stmt_errno(MYSQL_STMT * stmt); +# 823 "mysql.h" +extern char const * mysql_stmt_error(MYSQL_STMT * stmt); +# 798 "mysql.h" +extern int mysql_stmt_execute(MYSQL_STMT * stmt); +# 799 "mysql.h" +extern int mysql_stmt_fetch(MYSQL_STMT * stmt); +# 800 "mysql.h" +extern int mysql_stmt_fetch_column(MYSQL_STMT * stmt, MYSQL_BIND * bind_arg, unsigned int, unsigned long int); +# 832 "mysql.h" +extern unsigned int mysql_stmt_field_count(MYSQL_STMT * stmt); +# 815 "mysql.h" +extern my_bool mysql_stmt_free_result(MYSQL_STMT * stmt); +# 795 "mysql.h" +extern MYSQL_STMT * mysql_stmt_init(MYSQL * mysql); +# 831 "mysql.h" +extern my_ulonglong mysql_stmt_insert_id(MYSQL_STMT * stmt); +# 829 "mysql.h" +extern my_ulonglong mysql_stmt_num_rows(MYSQL_STMT * stmt); +# 804 "mysql.h" +extern unsigned long int mysql_stmt_param_count(MYSQL_STMT * stmt); +# 821 "mysql.h" +extern MYSQL_RES * mysql_stmt_param_metadata(MYSQL_STMT * stmt); +# 796 "mysql.h" +extern int mysql_stmt_prepare(MYSQL_STMT * stmt, char const * query, unsigned long int); +# 814 "mysql.h" +extern my_bool mysql_stmt_reset(MYSQL_STMT * stmt); +# 820 "mysql.h" +extern MYSQL_RES * mysql_stmt_result_metadata(MYSQL_STMT * stmt); +# 825 "mysql.h" +extern MYSQL_ROW_OFFSET mysql_stmt_row_seek(MYSQL_STMT * stmt, MYSQL_ROW_OFFSET); +# 827 "mysql.h" +extern MYSQL_ROW_OFFSET mysql_stmt_row_tell(MYSQL_STMT * stmt); +# 816 "mysql.h" +extern my_bool mysql_stmt_send_long_data(MYSQL_STMT * stmt, unsigned int, char const * data, unsigned long int); +# 824 "mysql.h" +extern char const * mysql_stmt_sqlstate(MYSQL_STMT * stmt); +# 803 "mysql.h" +extern int mysql_stmt_store_result(MYSQL_STMT * stmt); +# 452 "mysql.h" +extern MYSQL_RES * mysql_store_result(MYSQL * mysql); +# 404 "mysql.h" +extern void mysql_thread_end(void); +# 428 "mysql.h" +extern unsigned long int mysql_thread_id(MYSQL * mysql); +# 403 "mysql.h" +extern my_bool mysql_thread_init(void); +# 571 "mysql.h" +extern unsigned int mysql_thread_safe(void); +# 699 "mysql/plugin.h" +extern int mysql_tmpfile(char const * prefix); +# 77 "mysql.h" +extern char * mysql_unix_port; +# 453 "mysql.h" +extern MYSQL_RES * mysql_use_result(MYSQL * mysql); +# 426 "mysql.h" +extern unsigned int mysql_warning_count(MYSQL * mysql); +# 346 "mysql_com.h" +extern void net_clear(NET * net, my_bool); +# 345 "mysql_com.h" +extern void net_end(NET * net); +# 348 "mysql_com.h" +extern my_bool net_flush(NET * net); +# 353 "mysql_com.h" +extern int net_real_write(NET * net, unsigned char const * packet, size_t); +# 347 "mysql_com.h" +extern my_bool net_realloc(NET * net, size_t); +# 350 "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" +extern char * octet2hex(char * to, char const * str, unsigned int); +# 423 "mysql_com.h" +extern void randominit(struct rand_struct *, unsigned long int, unsigned long int); +# 437 "mysql_com.h" +extern void scramble(char * to, char const * message, char const * password); +# 430 "mysql_com.h" +extern void scramble_323(char * to, char const * message, char const * password); +# 37 "typelib.h" extern TYPELIB sql_protocol_typelib; +# 729 "mysql/plugin.h" +extern void * thd_alloc(void * thd, unsigned int); +# 733 "mysql/plugin.h" +extern void * thd_calloc(void * thd, unsigned int); +# 770 "mysql/plugin.h" +extern void thd_get_xid(void const * thd, MYSQL_XID * xid); +# 680 "mysql/plugin.h" +extern void * * thd_ha_data(void const * thd, struct handlerton const * hton); +# 675 "mysql/plugin.h" +extern int thd_in_lock_tables(void const * thd); +# 685 "mysql/plugin.h" +extern void thd_inc_row_count(void); +# 715 "mysql/plugin.h" +extern int thd_killed(void const * thd); +# 760 "mysql/plugin.h" +extern MYSQL_LEX_STRING * thd_make_lex_string(void * thd, MYSQL_LEX_STRING * lex_str, char const * str, unsigned int, int); +# 745 "mysql/plugin.h" +extern void * thd_memdup(void * thd, void const * str, unsigned int); +# 679 "mysql/plugin.h" +extern char const * thd_proc_info(void * thd, char const * info); +# 682 "mysql/plugin.h" +extern char * thd_security_context(void * thd, char * buffer, unsigned int, unsigned int); +# 678 "mysql/plugin.h" +extern int thd_sql_command(void const * thd); +# 737 "mysql/plugin.h" +extern char * thd_strdup(void * thd, char const * str); +# 741 "mysql/plugin.h" +extern char * thd_strmake(void * thd, char const * str, unsigned int); +# 676 "mysql/plugin.h" +extern int thd_tablespace_op(void const * thd); +# 677 "mysql/plugin.h" +extern long long int thd_test_options(void const * thd, long long int); +# 681 "mysql/plugin.h" +extern int thd_tx_isolation(void const * thd); From 240e9329e79c18d059094fbca1605536762dbbd7 Mon Sep 17 00:00:00 2001 From: "gkodinov/kgeorge@magare.gmz" <> Date: Mon, 27 Aug 2007 15:01:29 +0300 Subject: [PATCH 50/90] portation fixes for bug 29536 and 29325 in re-pushing for 5.1.22. --- mysql-test/suite/rpl/t/rpl_timezone.test | 2 +- sql/mysqld.cc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mysql-test/suite/rpl/t/rpl_timezone.test b/mysql-test/suite/rpl/t/rpl_timezone.test index c6ad7af7846..dac21000a62 100644 --- a/mysql-test/suite/rpl/t/rpl_timezone.test +++ b/mysql-test/suite/rpl/t/rpl_timezone.test @@ -139,7 +139,7 @@ sync_slave_with_master; # Restore original timezone connection master; -set global time_zone= @my_te_zone; +set global time_zone= @my_time_zone; --echo End of 4.1 tests diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 69db04ff210..d5336f5dd9c 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -5954,8 +5954,8 @@ log and this option does nothing anymore.", IO_SIZE, 0}, {"keep_files_on_create", OPT_KEEP_FILES_ON_CREATE, "Don't overwrite stale .MYD and .MYI even if no directory is specified.", - (gptr*) &global_system_variables.keep_files_on_create, - (gptr*) &max_system_variables.keep_files_on_create, + (uchar**) &global_system_variables.keep_files_on_create, + (uchar**) &max_system_variables.keep_files_on_create, 0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0}, {"key_buffer_size", OPT_KEY_BUFFER_SIZE, "The size of the buffer used for index blocks for MyISAM tables. Increase this to get better index handling (for all reads and multiple writes) to as much as you can afford; 64M on a 256M machine that mainly runs MySQL is quite common.", From e1f827da84e7d024ce33bf8c0899f92183fae7fc Mon Sep 17 00:00:00 2001 From: "tomas@whalegate.ndb.mysql.com" <> Date: Mon, 27 Aug 2007 15:40:49 +0200 Subject: [PATCH 51/90] Bug#29549 rpl_ndb_myisam2ndb,rpl_ndb_innodb2ndb failed on Solaris for pack_length issue --- mysql-test/suite/rpl_ndb/t/disabled.def | 4 ++-- sql/field.cc | 18 +++++++++++++++++- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/mysql-test/suite/rpl_ndb/t/disabled.def b/mysql-test/suite/rpl_ndb/t/disabled.def index 90286ecc421..f4cbd3e9d0c 100644 --- a/mysql-test/suite/rpl_ndb/t/disabled.def +++ b/mysql-test/suite/rpl_ndb/t/disabled.def @@ -14,8 +14,8 @@ rpl_ndb_2innodb : BUG#19227 2006-04-20 pekka pk delete apparently not replicated rpl_ndb_2myisam : BUG#19227 Seems to pass currently 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_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_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 diff --git a/sql/field.cc b/sql/field.cc index 49ffc6a252e..3a90d605b86 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -7622,6 +7622,13 @@ uchar *Field_blob::pack(uchar *to, const uchar *from, uint max_length) ptr= (uchar*) from; } else +#ifdef WORDS_BIGENDIAN + if (table->s->db_low_byte_first) + { + store_length(to,packlength,length,0); + } + else +#endif memcpy(to,from,packlength); // Copy length if (length) { @@ -7658,8 +7665,17 @@ const uchar *Field_blob::unpack(uchar *to, const uchar *Field_blob::unpack(uchar *to, const uchar *from) { - memcpy(to,from,packlength); uint32 length=get_length(from); +#ifdef WORDS_BIGENDIAN + if (table->s->db_low_byte_first) + { + store_length(to,packlength,length,1); + } + else +#endif + { + memcpy(to,from,packlength); + } from+=packlength; if (length) memcpy_fixed(to+packlength, &from, sizeof(from)); From 549ed88635c4282acb563708395e83177a1514d4 Mon Sep 17 00:00:00 2001 From: "tsmith@ramayana.hindu.god" <> Date: Mon, 27 Aug 2007 11:46:34 -0600 Subject: [PATCH 52/90] Bug #30648: Partition handler may not initialize variable used w/ autoincrement A local variable may be used uninitialized in ha_partition::get_auto_increment(). Initialize it properly. --- sql/ha_partition.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index 6521be1cb9a..ff28b6bfd77 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -5445,6 +5445,7 @@ void ha_partition::get_auto_increment(ulonglong offset, ulonglong increment, for (pos=m_file, end= m_file+ m_tot_parts; pos != end ; pos++) { + first_value_part= *first_value; (*pos)->get_auto_increment(offset, increment, nb_desired_values, &first_value_part, &nb_reserved_values_part); if (first_value_part == ~(ulonglong)(0)) // error in one partition From 3584a4d400d6643fc0576030edfdb8dc322d72cb Mon Sep 17 00:00:00 2001 From: "rafal@quant.(none)" <> Date: Mon, 27 Aug 2007 20:22:04 +0200 Subject: [PATCH 53/90] BUG#21842: There was an inconsistency in the use of table->record[0] and table->record[1] buffers inside Rows_log_event::find_row() function. The patch fixes this. --- sql/log_event.cc | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/sql/log_event.cc b/sql/log_event.cc index 9f3b4c4e487..cfac7df21a8 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -7602,7 +7602,7 @@ int Rows_log_event::find_row(const RELAY_LOG_INFO *rli) DBUG_RETURN(error); } - // We can't use pisition() - try other methods. + // We can't use position() - try other methods. /* We need to retrieve all fields @@ -7610,6 +7610,12 @@ int Rows_log_event::find_row(const RELAY_LOG_INFO *rli) */ table->use_all_columns(); + /* + Save copy of the record in table->record[1]. It might be needed + later if linear search is used to find exact match. + */ + store_record(table,record[1]); + if (table->s->keys > 0) { DBUG_PRINT("info",("locating record using primary key (index_read)")); @@ -7643,8 +7649,9 @@ int Rows_log_event::find_row(const RELAY_LOG_INFO *rli) */ my_ptrdiff_t const pos= table->s->null_bytes > 0 ? table->s->null_bytes - 1 : 0; - table->record[1][pos]= 0xFF; - if ((error= table->file->index_read_map(table->record[1], m_key, + table->record[0][pos]= 0xFF; + + if ((error= table->file->index_read_map(table->record[0], m_key, HA_WHOLE_KEY, HA_READ_KEY_EXACT))) { @@ -7684,8 +7691,8 @@ int Rows_log_event::find_row(const RELAY_LOG_INFO *rli) /* In case key is not unique, we still have to iterate over records found - and find the one which is identical to the row given. The row is unpacked - in record[1] where missing columns are filled with default values. + and find the one which is identical to the row given. A copy of the + record we are looking for is stored in record[1]. */ DBUG_PRINT("info",("non-unique index, scanning it to find matching record")); @@ -7702,11 +7709,11 @@ int Rows_log_event::find_row(const RELAY_LOG_INFO *rli) */ if (table->s->null_bytes > 0) { - table->record[1][table->s->null_bytes - 1]|= + table->record[0][table->s->null_bytes - 1]|= 256U - (1U << table->s->last_null_bit_pos); } - if ((error= table->file->index_next(table->record[1]))) + if ((error= table->file->index_next(table->record[0]))) { DBUG_PRINT("info",("no record matching the given row found")); table->file->print_error(error, MYF(0)); @@ -7738,13 +7745,11 @@ int Rows_log_event::find_row(const RELAY_LOG_INFO *rli) /* Continue until we find the right record or have made a full loop */ do { - error= table->file->rnd_next(table->record[1]); + error= table->file->rnd_next(table->record[0]); switch (error) { case 0: - DBUG_DUMP("record found", table->record[0], table->s->reclength); - case HA_ERR_RECORD_DELETED: break; @@ -7773,6 +7778,8 @@ int Rows_log_event::find_row(const RELAY_LOG_INFO *rli) */ if (restart_count == 2) DBUG_PRINT("info", ("Record not found")); + else + 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); From 220cd12f0b3c095a572e541c9fbaffb21cf310bf Mon Sep 17 00:00:00 2001 From: "tsmith@ramayana.hindu.god" <> Date: Mon, 27 Aug 2007 14:08:32 -0600 Subject: [PATCH 54/90] Fixes for the following bugs: Bug #30316: Some "parts" tests fail because the server uses "--secure-file-priv" Bug #30341: Test suite "parts" needs to be adapted to the new rules disallowing many functio Bug #30408: Suite "parts" needs bug numbers updated Bug #30411: Suite "parts" needs bug numbers updated: ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF Bug #30576: part_supported_sql_func_innodb.test tries to LOAD DATA outside of var dir Bug #30581: partition_value tests use disallowed CAST() function Included are some general fixes to allow the "parts" test suite to be run successfully. This includes disabling a few tests or parts of tests, cleaning up the test cases and their results, etc. Basically, these tests have not been run for some time, and had suffered some bit rot. The bugs were fixed as a single changeset, because in some ways they depend on each other. I couldn't be sure I'd updated all the error codes (for bugs 30408 and 30411) without also adapting to the new allowed functions rules (bug 30341), and vice versa. --- mysql-test/include/partition_layout.inc | 1 + .../part_supported_sql_funcs_int_ch1.inc | 0 .../part_supported_sql_funcs_int_date.inc | 0 .../part_supported_sql_funcs_int_float.inc | 0 .../part_supported_sql_funcs_int_int.inc | 0 .../part_supported_sql_funcs_int_time.inc | 0 .../parts/inc/part_blocked_sql_funcs_main.inc | 24 +- .../inc/part_supported_sql_funcs_main.inc | 68 +- .../suite/parts/inc/partition_alter3.inc | 6 +- .../suite/parts/inc/partition_alter_1.inc | 9 +- .../parts/inc/partition_blocked_sql_funcs.inc | 34 +- .../suite/parts/inc/partition_check.inc | 18 +- mysql-test/suite/parts/inc/partition_date.inc | 4 +- .../suite/parts/inc/partition_datetime.inc | 4 +- .../suite/parts/inc/partition_decimal.inc | 14 +- .../suite/parts/inc/partition_directory.inc | 27 +- .../suite/parts/inc/partition_double.inc | 14 +- mysql-test/suite/parts/inc/partition_enum.inc | 27 +- .../suite/parts/inc/partition_float.inc | 14 +- .../parts/inc/partition_layout_check1.inc | 1 + .../parts/inc/partition_layout_check2.inc | 1 + .../suite/parts/inc/partition_methods1.inc | 32 +- mysql-test/suite/parts/inc/partition_set.inc | 38 - .../inc/partition_supported_sql_funcs.inc | 11 +- .../suite/parts/inc/partition_syntax.inc | 10 +- .../suite/parts/inc/partition_syntax_1.inc | 24 +- mysql-test/suite/parts/inc/partition_time.inc | 4 +- .../suite/parts/inc/partition_timestamp.inc | 4 +- .../suite/parts/inc/partition_value.inc | 12 + .../r/part_blocked_sql_func_innodb.result | 996 +++- .../r/part_blocked_sql_func_myisam.result | 996 +++- .../r/part_supported_sql_func_innodb.result | 4736 +++++++---------- .../r/part_supported_sql_func_myisam.result | 4736 +++++++---------- .../parts/r/partition_alter3_innodb.result | 157 +- .../parts/r/partition_alter3_myisam.result | 533 +- .../parts/r/partition_basic_innodb.result | 1343 +---- .../parts/r/partition_basic_myisam.result | 1049 +--- .../parts/r/partition_datetime_innodb.result | 32 +- .../parts/r/partition_datetime_myisam.result | 32 +- .../parts/r/partition_decimal_innodb.result | 92 - .../parts/r/partition_decimal_myisam.result | 92 - .../parts/r/partition_float_myisam.result | 292 - .../parts/r/partition_syntax_innodb.result | 10 +- .../parts/r/partition_syntax_myisam.result | 10 +- mysql-test/suite/parts/t/disabled.def | 5 + 45 files changed, 6349 insertions(+), 9163 deletions(-) rename mysql-test/{suite/parts/inc => std_data/parts}/part_supported_sql_funcs_int_ch1.inc (100%) rename mysql-test/{suite/parts/inc => std_data/parts}/part_supported_sql_funcs_int_date.inc (100%) rename mysql-test/{suite/parts/inc => std_data/parts}/part_supported_sql_funcs_int_float.inc (100%) rename mysql-test/{suite/parts/inc => std_data/parts}/part_supported_sql_funcs_int_int.inc (100%) rename mysql-test/{suite/parts/inc => std_data/parts}/part_supported_sql_funcs_int_time.inc (100%) diff --git a/mysql-test/include/partition_layout.inc b/mysql-test/include/partition_layout.inc index 95f6cac37d7..e8d2b0f9123 100644 --- a/mysql-test/include/partition_layout.inc +++ b/mysql-test/include/partition_layout.inc @@ -9,5 +9,6 @@ eval SHOW CREATE TABLE t1; # listing of files belonging to the table t1 if ($ls) { + --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --exec ls $MYSQLTEST_VARDIR/master-data/test/t1* } diff --git a/mysql-test/suite/parts/inc/part_supported_sql_funcs_int_ch1.inc b/mysql-test/std_data/parts/part_supported_sql_funcs_int_ch1.inc similarity index 100% rename from mysql-test/suite/parts/inc/part_supported_sql_funcs_int_ch1.inc rename to mysql-test/std_data/parts/part_supported_sql_funcs_int_ch1.inc diff --git a/mysql-test/suite/parts/inc/part_supported_sql_funcs_int_date.inc b/mysql-test/std_data/parts/part_supported_sql_funcs_int_date.inc similarity index 100% rename from mysql-test/suite/parts/inc/part_supported_sql_funcs_int_date.inc rename to mysql-test/std_data/parts/part_supported_sql_funcs_int_date.inc diff --git a/mysql-test/suite/parts/inc/part_supported_sql_funcs_int_float.inc b/mysql-test/std_data/parts/part_supported_sql_funcs_int_float.inc similarity index 100% rename from mysql-test/suite/parts/inc/part_supported_sql_funcs_int_float.inc rename to mysql-test/std_data/parts/part_supported_sql_funcs_int_float.inc diff --git a/mysql-test/suite/parts/inc/part_supported_sql_funcs_int_int.inc b/mysql-test/std_data/parts/part_supported_sql_funcs_int_int.inc similarity index 100% rename from mysql-test/suite/parts/inc/part_supported_sql_funcs_int_int.inc rename to mysql-test/std_data/parts/part_supported_sql_funcs_int_int.inc diff --git a/mysql-test/suite/parts/inc/part_supported_sql_funcs_int_time.inc b/mysql-test/std_data/parts/part_supported_sql_funcs_int_time.inc similarity index 100% rename from mysql-test/suite/parts/inc/part_supported_sql_funcs_int_time.inc rename to mysql-test/std_data/parts/part_supported_sql_funcs_int_time.inc 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 ec258b5387b..cba5c47f01b 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 @@ -17,6 +17,18 @@ --echo --- All SQL functions should be rejected, otherwise BUG (see 18198) --echo ------------------------------------------------------------------------- +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; @@ -151,12 +163,6 @@ let $coltype = int; --source suite/parts/inc/partition_blocked_sql_funcs.inc # --source include/partition_blocked_sql_funcs.inc -let $sqlfunc = datediff(col1,col1); -let $valsqlfunc = datediff('1997-11-30 23:59:59','1997-12-31'); -let $coltype = datetime; ---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; @@ -190,6 +196,12 @@ 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); 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 4dc0e7bdad3..4761d15c6d3 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 @@ -40,61 +40,42 @@ let $val4 = 15 ; --source suite/parts/inc/partition_supported_sql_funcs.inc # --source include/partition_supported_sql_funcs.inc -let $sqlfunc = ascii(col1); -let $valsqlfunc = ascii('5'); -let $coltype = char(1); -let $infile = part_supported_sql_funcs_int_ch1.inc; -let $val1 = '1'; -let $val2 = '9'; -let $val3 = '3'; -let $val4 = '8'; ---source suite/parts/inc/partition_supported_sql_funcs.inc -# --source include/partition_supported_sql_funcs.inc -let $sqlfunc = cast(ceiling(col1) as signed integer); -let $valsqlfunc = cast(ceiling(15) as signed integer); +let $sqlfunc = ceiling(col1); +let $valsqlfunc = ceiling(15); let $coltype = float(7,4); let $infile = part_supported_sql_funcs_int_float.inc; let $val1 = 5.1230; let $val2 = 13.345; let $val3 = 17.987; let $val4 = 15.654 ; ---source suite/parts/inc/partition_supported_sql_funcs.inc +# DISABLED due to bug 30577 +#--source suite/parts/inc/partition_supported_sql_funcs.inc # --source include/partition_supported_sql_funcs.inc -let $sqlfunc = cast(floor(col1) as signed); -let $valsqlfunc = cast(floor(15.123) as signed); +let $sqlfunc = floor(col1); +let $valsqlfunc = floor(15.123); let $coltype = float(7,4); let $infile = part_supported_sql_funcs_int_float.inc; let $val1 = 5.1230; let $val2 = 13.345; let $val3 = 17.987; let $val4 = 15.654 ; ---source suite/parts/inc/partition_supported_sql_funcs.inc +# DISABLED due to bug 30577 +#--source suite/parts/inc/partition_supported_sql_funcs.inc # --source include/partition_supported_sql_funcs.inc -let $sqlfunc = cast(mod(col1,10) as signed); -let $valsqlfunc = cast(mod(15,10) as signed); -let $coltype = float(7,4); -let $infile = part_supported_sql_funcs_int_float.inc; -let $val1 = 5.0000; +let $sqlfunc = mod(col1,10); +let $valsqlfunc = mod(15,10); +let $coltype = int; +let $infile = part_supported_sql_funcs_int_int.inc; +let $val1 = 5; 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 = ord(col1); -let $valsqlfunc = ord('a'); -let $coltype = char(3); -let $infile = part_supported_sql_funcs_int_ch1.inc; -let $val1 = '1'; -let $val2 = '9'; -let $val3 = '3'; -let $val4 = '8'; ---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'); let $coltype = date; @@ -243,6 +224,18 @@ 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'); +let $valsqlfunc = datediff('2006-02-02', '2006-01-01'); +let $coltype = date; +let $infile = part_supported_sql_funcs_int_date.inc; +let $val1 = '2006-02-03'; +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'); let $coltype = date; @@ -254,17 +247,6 @@ let $val4 = '2006-02-06'; --source suite/parts/inc/partition_supported_sql_funcs.inc # --source include/partition_supported_sql_funcs.inc -let $sqlfunc = weekofyear(col1); -let $valsqlfunc = weekofyear('2006-02-14'); -let $coltype = date; -let $infile = part_supported_sql_funcs_int_date.inc; -let $val1 = '2006-01-03'; -let $val2 = '2006-03-17'; -let $val3 = '2006-05-25'; -let $val4 = '2006-09-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; let $coltype = date; diff --git a/mysql-test/suite/parts/inc/partition_alter3.inc b/mysql-test/suite/parts/inc/partition_alter3.inc index 48ad61ebe08..4b1539f4260 100644 --- a/mysql-test/suite/parts/inc/partition_alter3.inc +++ b/mysql-test/suite/parts/inc/partition_alter3.inc @@ -43,16 +43,16 @@ SELECT IF(9999 - 1000 + 1 > @max_row, @max_row , 9999 - 1000 + 1) ALTER TABLE t1 ADD PARTITION (PARTITION part2); # --echo # 1.1.2 Assign HASH partitioning -ALTER TABLE t1 PARTITION BY HASH(CAST(YEAR(f_date) AS SIGNED INTEGER)); +ALTER TABLE t1 PARTITION BY HASH(YEAR(f_date)); --source include/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(CAST(f_varchar AS SIGNED INTEGER)); +ALTER TABLE t1 PARTITION BY HASH(DAYOFYEAR(f_date)); --source include/partition_layout.inc --source suite/parts/inc/partition_check_read1.inc -ALTER TABLE t1 PARTITION BY HASH(CAST(YEAR(f_date) AS SIGNED INTEGER)); +ALTER TABLE t1 PARTITION BY HASH(YEAR(f_date)); --source include/partition_layout.inc --source suite/parts/inc/partition_check_read1.inc # diff --git a/mysql-test/suite/parts/inc/partition_alter_1.inc b/mysql-test/suite/parts/inc/partition_alter_1.inc index 542a67ccbef..1498970547a 100644 --- a/mysql-test/suite/parts/inc/partition_alter_1.inc +++ b/mysql-test/suite/parts/inc/partition_alter_1.inc @@ -36,8 +36,9 @@ eval $insert_first_half; # Possible/Expected return codes for ALTER TABLE ... # 0 -# 1491: A PRIMARY KEY need to include all fields in the partition function -# A UNIQUE INDEX need to include all fields in the partition function +# 1030: ER_GET_ERRNO +# 1500: ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF +# 1504: ER_DROP_PARTITION_NON_EXISTENT --disable_abort_on_error eval $alter; --enable_abort_on_error @@ -47,11 +48,11 @@ 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,1491,1495)`; +let $unexpected_error= `SELECT @my_errno NOT IN (0,1030,1500,1504)`; if ($unexpected_error) { --echo # The last command got an unexepected error response. - --echo # Expected/handled SQL codes are 0,1030,1491,1495 + --echo # Expected/handled SQL codes are 0,1030,1500,1504 SELECT '# SQL code we got was: ' AS "", @my_errno AS ""; --echo # Sorry, have to abort. exit; diff --git a/mysql-test/suite/parts/inc/partition_blocked_sql_funcs.inc b/mysql-test/suite/parts/inc/partition_blocked_sql_funcs.inc index 7843a44134c..3e6876662fe 100644 --- a/mysql-test/suite/parts/inc/partition_blocked_sql_funcs.inc +++ b/mysql-test/suite/parts/inc/partition_blocked_sql_funcs.inc @@ -15,8 +15,7 @@ --echo ------------------------------------------------------------------------- --echo --- $sqlfunc in partition with coltype $coltype --echo ------------------------------------------------------------------------- ---echo must all fail! (delete 0 and comment char, if bug fixed) ---disable_abort_on_error +--echo must all fail! --disable_warnings drop table if exists t1 ; drop table if exists t2 ; @@ -26,32 +25,31 @@ drop table if exists t5 ; drop table if exists t6 ; --enable_warnings -#--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR +--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR eval create table t1 (col1 $coltype) engine=$engine partition by range($sqlfunc) (partition p0 values less than (15), partition p1 values less than (31)); -#--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR +--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR eval create table t2 (col1 $coltype) engine=$engine partition by list($sqlfunc) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); -#--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR +--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR eval create table t3 (col1 $coltype) engine=$engine partition by hash($sqlfunc); ---enable_abort_on_error ---error 0,ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR +--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR eval create table t4 (colint int, col1 $coltype) engine=$engine partition by range(colint) subpartition by hash($sqlfunc) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); ---error 0,ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR +--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR eval create table t5 (colint int, col1 $coltype) engine=$engine partition by list(colint) subpartition by hash($sqlfunc) subpartitions 2 @@ -59,7 +57,7 @@ subpartition by hash($sqlfunc) subpartitions 2 partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); ---error 0,ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR +--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR eval create table t6 (colint int, col1 $coltype) engine=$engine partition by range(colint) (partition p0 values less than ($valsqlfunc), @@ -75,50 +73,44 @@ drop table if exists t55 ; drop table if exists t66 ; --enable_warnings -#--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR eval create table t11 (col1 $coltype) engine=$engine ; -#--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR eval create table t22 (col1 $coltype) engine=$engine ; -#--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR eval create table t33 (col1 $coltype) engine=$engine ; ---error 0,ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR eval create table t44 (colint int, col1 $coltype) engine=$engine ; ---error 0,ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR eval create table t55 (colint int, col1 $coltype) engine=$engine ; ---error 0,ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR eval create table t66 (colint int, col1 $coltype) engine=$engine ; -#--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR +--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR eval alter table t11 partition by range($sqlfunc) (partition p0 values less than (15), partition p1 values less than (31)); -#--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR +--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR eval alter table t22 partition by list($sqlfunc) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); -#--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR +--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR eval alter table t33 partition by hash($sqlfunc); --enable_abort_on_error ---error 0,ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR +--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR eval alter table t44 partition by range(colint) subpartition by hash($sqlfunc) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); ---error 0,ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR +--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR eval alter table t55 partition by list(colint) subpartition by hash($sqlfunc) subpartitions 2 @@ -126,7 +118,7 @@ subpartition by hash($sqlfunc) subpartitions 2 partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); ---error 0,ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR +--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED,ER_PARSE_ERROR eval alter table t66 partition by range(colint) (partition p0 values less than ($valsqlfunc), diff --git a/mysql-test/suite/parts/inc/partition_check.inc b/mysql-test/suite/parts/inc/partition_check.inc index 698e9611af1..6f03ed58241 100644 --- a/mysql-test/suite/parts/inc/partition_check.inc +++ b/mysql-test/suite/parts/inc/partition_check.inc @@ -156,8 +156,8 @@ if ($run) # partitioning mechanism. # Sideeffect: Attempt to INSERT one record # DUPLICATE KEY will appear if we have UNIQUE columns -# 1022: Can't write; duplicate key in table 't1' UIDX/PK(f_int1) -# 1062: Duplicate entry '2' for key 1 UIDX/PK(f_int2) +# 1022: ER_DUP_KEY +# 1062: 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), @@ -200,7 +200,8 @@ 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: Can't write; duplicate key in table 't1' UIDX/PK + # 1022: ER_DUP_KEY + # 1062: 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), @@ -494,8 +495,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 (1514) +# we get error ER_NO_PARTITION_FOR_GIVEN_VALUE (1523) # "Table has no partition for value ...." +# or ER_SAME_NAME_PARTITION (1514) --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 @@ -504,11 +506,11 @@ if ($no_debug) --disable_query_log } eval SET @my_errno = $mysql_errno; -let $unexpected_error= `SELECT @my_errno NOT IN (0,1505,1514)`; +let $unexpected_error= `SELECT @my_errno NOT IN (0,1514,1523)`; if ($unexpected_error) { --echo # The last command got an unexepected error response. - --echo # Expected/handled SQL codes are 0,1514 + --echo # Expected/handled SQL codes are 0,1514,1523 SELECT '# SQL code we got was: ' AS "", @my_errno AS ""; --echo # Sorry, have to abort. exit; @@ -555,8 +557,8 @@ INSERT t1 SET f_int1 = 0 , f_int2 = 0, # f1 "=" NULL is a delicate value which might stress the partitioning # mechanism if the result of the expression in the partitioning algorithm # becomes NULL. -# Not: This INSERT will fail, if f_int1 is PRIMARY KEY or UNIQUE INDEX -# 1048: Column 'f_int1' cannot be null +# This INSERT will fail, if f_int1 is PRIMARY KEY or UNIQUE INDEX +# 1048: ER_BAD_NULL_ERROR --disable_abort_on_error INSERT INTO t1 diff --git a/mysql-test/suite/parts/inc/partition_date.inc b/mysql-test/suite/parts/inc/partition_date.inc index b58a7598236..45f9012604c 100644 --- a/mysql-test/suite/parts/inc/partition_date.inc +++ b/mysql-test/suite/parts/inc/partition_date.inc @@ -49,7 +49,7 @@ select * from t2; drop table t2; eval create table t3 (a date not null, primary key(a)) engine=$engine -partition by range (cast(month(a) as unsigned)) subpartition by key (a) +partition by range (month(a)) subpartition by key (a) subpartitions 3 ( partition quarter1 values less than (4), partition quarter2 values less than (7), @@ -69,7 +69,7 @@ select * from t3; drop table t3; eval create table t4 (a date not null, primary key(a)) engine=$engine -partition by list (cast(month(a) as unsigned)) subpartition by key (a) +partition by list (month(a)) subpartition by key (a) subpartitions 3 ( partition quarter1 values in (1,2,3), partition quarter2 values in (4,5,6), diff --git a/mysql-test/suite/parts/inc/partition_datetime.inc b/mysql-test/suite/parts/inc/partition_datetime.inc index 94c9d3d75da..e948e827b4e 100644 --- a/mysql-test/suite/parts/inc/partition_datetime.inc +++ b/mysql-test/suite/parts/inc/partition_datetime.inc @@ -46,7 +46,7 @@ select * from t2; drop table t2; eval create table t3 (a datetime not null, primary key(a)) engine=$engine -partition by range (cast(month(a) as unsigned)) subpartition by key (a) +partition by range (month(a)) subpartition by key (a) subpartitions 3 ( partition quarter1 values less than (4), partition quarter2 values less than (7), @@ -66,7 +66,7 @@ select * from t3; drop table t3; eval create table t4 (a datetime not null, primary key(a)) engine=$engine -partition by list (cast(month(a) as unsigned)) subpartition by key (a) +partition by list (month(a)) subpartition by key (a) subpartitions 3 ( partition quarter1 values in (1,2,3), partition quarter2 values in (4,5,6), diff --git a/mysql-test/suite/parts/inc/partition_decimal.inc b/mysql-test/suite/parts/inc/partition_decimal.inc index eb35416f395..09eb9b10831 100644 --- a/mysql-test/suite/parts/inc/partition_decimal.inc +++ b/mysql-test/suite/parts/inc/partition_decimal.inc @@ -47,8 +47,15 @@ dec $count; select count(*) from t2; drop table t2; +# Bug 30577: FLOOR() and CEILING() not usable as partition functions +# Partition functions are required to return INT_RESULT; FLOOR() and +# CEILING() do not, unless they have an INT argument. Disable this +# portion of the test until bug 30577 is fixed. + +--disable_parsing + eval create table t3 (a decimal(18,9) not null, primary key(a)) engine=$engine -partition by range (cast(floor(a) as signed)) subpartition by key (a) subpartitions 2 ( +partition by range (floor(a)) subpartition by key (a) subpartitions 2 ( partition pa2 values less than (2), partition pa4 values less than (4), partition pa6 values less than (6), @@ -70,7 +77,7 @@ select count(*) from t3; drop table t3; eval create table t4 (a decimal(18,9) not null, primary key(a)) engine=$engine -partition by list (cast(floor(a) as signed)) subpartition by key (a) subpartitions 2 ( +partition by list (floor(a)) subpartition by key (a) subpartitions 2 ( partition pa2 values in (1,2), partition pa4 values in (3,4), partition pa6 values in (5,6), @@ -90,3 +97,6 @@ dec $count; --enable_query_log select count(*) from t4; drop table t4; + +# Disabled due to Bug 30577 +--enable_parsing diff --git a/mysql-test/suite/parts/inc/partition_directory.inc b/mysql-test/suite/parts/inc/partition_directory.inc index 2c765e1f5ab..17748df4f4d 100644 --- a/mysql-test/suite/parts/inc/partition_directory.inc +++ b/mysql-test/suite/parts/inc/partition_directory.inc @@ -29,9 +29,9 @@ let $partitioning= ; if ($with_partitioning) { let $partitioning= PARTITION BY HASH(f_int1) PARTITIONS 2; +--disable_query_log if ($with_directories) { ---disable_query_log eval SET @aux = 'PARTITION BY HASH(f_int1) PARTITIONS 2 (PARTITION p1 @@ -39,7 +39,6 @@ $index_directory, PARTITION p2 $index_directory)'; let $partitioning= `SELECT @aux`; ---enable_query_log } } eval CREATE TABLE t1 ( @@ -47,6 +46,7 @@ $column_list $unique ) $partitioning; +--enable_query_log eval $insert_all; --source suite/parts/inc/partition_check.inc # --source include/partition_check.inc @@ -54,9 +54,9 @@ DROP TABLE t1; --source suite/parts/inc/partition_check_drop.inc #----------- PARTITION BY KEY +--disable_query_log if ($with_partitioning) { ---disable_query_log eval SET @aux = 'PARTITION BY KEY(f_int1) PARTITIONS 5'; let $partitioning= `SELECT @aux`; @@ -76,7 +76,6 @@ PARTITION p4, PARTITION p5 $index_directory)'; let $partitioning= `SELECT @aux`; ---enable_query_log } } eval CREATE TABLE t1 ( @@ -84,6 +83,7 @@ $column_list $unique ) $partitioning; +--enable_query_log eval $insert_all; --source suite/parts/inc/partition_check.inc # --source include/partition_check.inc @@ -91,9 +91,9 @@ DROP TABLE t1; --source suite/parts/inc/partition_check_drop.inc #----------- PARTITION BY LIST +--disable_query_log if ($with_partitioning) { ---disable_query_log eval SET @aux = 'PARTITION BY LIST(MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) @@ -119,6 +119,7 @@ $column_list $unique ) $partitioning; +--enable_query_log eval $insert_all; --source suite/parts/inc/partition_check.inc # --source include/partition_check.inc @@ -126,9 +127,9 @@ DROP TABLE t1; --source suite/parts/inc/partition_check_drop.inc #----------- PARTITION BY RANGE +--disable_query_log if ($with_partitioning) { -#--disable_query_log eval SET @aux = 'PARTITION BY RANGE(f_int1) (PARTITION parta VALUES LESS THAN (0) $index_directory, @@ -143,13 +144,13 @@ $data_directory, PARTITION partf VALUES LESS THAN $MAX_VALUE $index_directory)'; let $partitioning= `SELECT @aux`; -#--enable_query_log } eval CREATE TABLE t1 ( $column_list $unique ) $partitioning; +--enable_query_log eval $insert_all; --source suite/parts/inc/partition_check.inc # --source include/partition_check.inc @@ -157,9 +158,9 @@ DROP TABLE t1; --source suite/parts/inc/partition_check_drop.inc #----------- PARTITION BY RANGE -- SUBPARTITION BY HASH +--disable_query_log if ($with_partitioning) { ---disable_query_log eval SET @aux = 'PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) @@ -171,13 +172,13 @@ PARTITION partd VALUES LESS THAN $MAX_VALUE $data_directory $index_directory)'; let $partitioning= `SELECT @aux`; ---enable_query_log } eval CREATE TABLE t1 ( $column_list $unique ) $partitioning; +--enable_query_log eval $insert_all; --source suite/parts/inc/partition_check.inc # --source include/partition_check.inc @@ -185,9 +186,9 @@ DROP TABLE t1; --source suite/parts/inc/partition_check_drop.inc #----------- PARTITION BY RANGE -- SUBPARTITION BY KEY +--disable_query_log if ($with_partitioning) { ---disable_query_log eval SET @aux = 'PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1) (PARTITION part1 VALUES LESS THAN (0) $data_directory @@ -202,13 +203,13 @@ $index_directory PARTITION part4 VALUES LESS THAN $MAX_VALUE (SUBPARTITION subpart41, SUBPARTITION subpart42))'; let $partitioning= `SELECT @aux`; ---enable_query_log } eval CREATE TABLE t1 ( $column_list $unique ) $partitioning; +--enable_query_log eval $insert_all; --source suite/parts/inc/partition_check.inc # --source include/partition_check.inc @@ -216,9 +217,9 @@ DROP TABLE t1; --source suite/parts/inc/partition_check_drop.inc #----------- PARTITION BY LIST -- SUBPARTITION BY HASH +--disable_query_log if ($with_partitioning) { ---disable_query_log eval SET @aux = 'PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 1) (PARTITION part1 VALUES IN (0) @@ -246,13 +247,13 @@ eval SET @aux = $data_directory $index_directory))'; let $partitioning= `SELECT @aux`; ---enable_query_log } eval CREATE TABLE t1 ( $column_list $unique ) $partitioning; +--enable_query_log eval $insert_all; --source suite/parts/inc/partition_check.inc # --source include/partition_check.inc diff --git a/mysql-test/suite/parts/inc/partition_double.inc b/mysql-test/suite/parts/inc/partition_double.inc index 96cf7fd4871..57be826bac7 100644 --- a/mysql-test/suite/parts/inc/partition_double.inc +++ b/mysql-test/suite/parts/inc/partition_double.inc @@ -48,8 +48,15 @@ select count(*) from t2; drop table t2; +# Bug 30577: FLOOR() and CEILING() not usable as partition functions +# Partition functions are required to return INT_RESULT; FLOOR() and +# CEILING() do not, unless they have an INT argument. Disable this +# portion of the test until bug 30577 is fixed. + +--disable_parsing + eval create table t3 (a double not null, primary key(a)) engine=$engine -partition by range (cast(floor(a) as signed)) subpartition by key (a) subpartitions 3 ( +partition by range (floor(a)) subpartition by key (a) subpartitions 3 ( partition pa1 values less than (3), partition pa3 values less than (6), partition pa10 values less than (10) @@ -69,7 +76,7 @@ select * from t3; drop table t3; eval create table t4 (a double not null, primary key(a)) engine=$engine -partition by list (cast(floor(a) as signed)) subpartition by key (a) subpartitions 3 ( +partition by list (floor(a)) 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) @@ -87,3 +94,6 @@ dec $count; select count(*) from t4; select * from t4; drop table t4; + +# Disabled due to Bug 30577 +--enable_parsing diff --git a/mysql-test/suite/parts/inc/partition_enum.inc b/mysql-test/suite/parts/inc/partition_enum.inc index f8fcb1110ae..67e790743f0 100644 --- a/mysql-test/suite/parts/inc/partition_enum.inc +++ b/mysql-test/suite/parts/inc/partition_enum.inc @@ -53,7 +53,7 @@ eval create table t3 (a enum ( 'M','N','O','P','Q','R','S','T','U','V','W','X', 'Y','Z' ) not null, primary key(a)) engine=$engine -partition by range (cast(a as unsigned)) subpartition by key (a) subpartitions 3 ( +partition by range (a) subpartition by key (a) subpartitions 3 ( partition pa9 values less than (10), partition pa18 values less than (19), partition pa27 values less than (28), @@ -72,28 +72,3 @@ select count(*) from t3; select * from t3; drop table t3; -eval 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=$engine -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) -); -show create table t4; -let $letter=36; ---echo $count inserts; -#--disable_query_log -while ($letter) -{ -#eval insert into t4 values ($letter); -dec $letter; -} -select count(*) from t4; -select * from t4; -drop table t4; - diff --git a/mysql-test/suite/parts/inc/partition_float.inc b/mysql-test/suite/parts/inc/partition_float.inc index 25c59a10153..45c2f16ac98 100644 --- a/mysql-test/suite/parts/inc/partition_float.inc +++ b/mysql-test/suite/parts/inc/partition_float.inc @@ -51,8 +51,15 @@ dec $count; select count(*) from t2; drop table t2; +# Bug 30577: FLOOR() and CEILING() not usable as partition functions +# Partition functions are required to return INT_RESULT; FLOOR() and +# CEILING() do not, unless they have an INT argument. Disable this +# portion of the test until bug 30577 is fixed. + +--disable_parsing + eval create table t3 (a float not null, primary key(a)) engine=$engine -partition by range (cast(floor(a) as signed)) subpartition by key (a) subpartitions 3 ( +partition by range (floor(a)) subpartition by key (a) subpartitions 3 ( partition pa1 values less than (3), partition pa3 values less than (6), partition pa10 values less than (10) @@ -72,7 +79,7 @@ select * from t3; drop table t3; eval create table t4 (a float not null, primary key(a)) engine=$engine -partition by list (cast(floor(a) as signed)) subpartition by key (a) subpartitions 3 ( +partition by list (floor(a)) 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) @@ -90,3 +97,6 @@ dec $count; select count(*) from t4; select * from t4; drop table t4; + +# Disabled due to Bug 30577 +--enable_parsing diff --git a/mysql-test/suite/parts/inc/partition_layout_check1.inc b/mysql-test/suite/parts/inc/partition_layout_check1.inc index fe0d9d138a0..d3441b3d886 100644 --- a/mysql-test/suite/parts/inc/partition_layout_check1.inc +++ b/mysql-test/suite/parts/inc/partition_layout_check1.inc @@ -56,6 +56,7 @@ eval INSERT INTO t0_definition SET state = 'old', file_list = $file_list; # Print the create table statement into the protocol +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR SELECT create_command FROM t0_definition WHERE state = 'old'; if ($do_file_tests) { diff --git a/mysql-test/suite/parts/inc/partition_layout_check2.inc b/mysql-test/suite/parts/inc/partition_layout_check2.inc index c28387cccd0..8a45613559d 100644 --- a/mysql-test/suite/parts/inc/partition_layout_check2.inc +++ b/mysql-test/suite/parts/inc/partition_layout_check2.inc @@ -55,6 +55,7 @@ let $run= `SELECT @aux`; if ($run) { --vertical_results + --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR SELECT state, REPLACE(create_command,'\n',' ') AS "Table definition", REPLACE(file_list ,'\n',' ') AS "File list" diff --git a/mysql-test/suite/parts/inc/partition_methods1.inc b/mysql-test/suite/parts/inc/partition_methods1.inc index bec0c747f28..6e49c51cc3d 100644 --- a/mysql-test/suite/parts/inc/partition_methods1.inc +++ b/mysql-test/suite/parts/inc/partition_methods1.inc @@ -44,9 +44,9 @@ let $partitioning= ; if ($with_partitioning) { let $partitioning= PARTITION BY HASH(f_int1) PARTITIONS 2; +--disable_query_log if ($with_directories) { ---disable_query_log eval SET @aux = 'PARTITION BY HASH(f_int1) PARTITIONS 2 (PARTITION p1 @@ -56,7 +56,6 @@ PARTITION p2 $data_directory $index_directory)'; let $partitioning= `SELECT @aux`; ---enable_query_log } } eval CREATE TABLE t1 ( @@ -64,6 +63,7 @@ $column_list $unique ) $partitioning; +--enable_query_log eval $insert_all; --source suite/parts/inc/partition_check.inc # --source include/partition_check.inc @@ -71,15 +71,14 @@ DROP TABLE t1; --source suite/parts/inc/partition_check_drop.inc #----------- PARTITION BY KEY +--disable_query_log if ($with_partitioning) { ---disable_query_log eval SET @aux = 'PARTITION BY KEY(f_int1) PARTITIONS 5'; let $partitioning= `SELECT @aux`; if ($with_directories) { ---disable_query_log eval SET @aux = 'PARTITION BY HASH(f_int1) PARTITIONS 5 (PARTITION p1 @@ -98,7 +97,6 @@ PARTITION p5 $data_directory $index_directory)'; let $partitioning= `SELECT @aux`; ---enable_query_log } } eval CREATE TABLE t1 ( @@ -106,6 +104,7 @@ $column_list $unique ) $partitioning; +--enable_query_log eval $insert_all; --source suite/parts/inc/partition_check.inc # --source include/partition_check.inc @@ -113,9 +112,9 @@ DROP TABLE t1; --source suite/parts/inc/partition_check_drop.inc #----------- PARTITION BY LIST +--disable_query_log if ($with_partitioning) { ---disable_query_log eval SET @aux = 'PARTITION BY LIST(MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) @@ -141,6 +140,7 @@ $column_list $unique ) $partitioning; +--enable_query_log eval $insert_all; --source suite/parts/inc/partition_check.inc # --source include/partition_check.inc @@ -148,9 +148,9 @@ DROP TABLE t1; --source suite/parts/inc/partition_check_drop.inc #----------- PARTITION BY RANGE +--disable_query_log if ($with_partitioning) { -#--disable_query_log eval SET @aux = 'PARTITION BY RANGE(f_int1) (PARTITION parta VALUES LESS THAN (0) $data_directory @@ -171,13 +171,13 @@ PARTITION partf VALUES LESS THAN $MAX_VALUE $data_directory $index_directory)'; let $partitioning= `SELECT @aux`; -#--enable_query_log } eval CREATE TABLE t1 ( $column_list $unique ) $partitioning; +--enable_query_log eval $insert_all; --source suite/parts/inc/partition_check.inc # --source include/partition_check.inc @@ -185,9 +185,9 @@ DROP TABLE t1; --source suite/parts/inc/partition_check_drop.inc #----------- PARTITION BY RANGE -- SUBPARTITION BY HASH +--disable_query_log if ($with_partitioning) { ---disable_query_log eval SET @aux = 'PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) @@ -203,13 +203,13 @@ PARTITION partd VALUES LESS THAN $MAX_VALUE $data_directory $index_directory)'; let $partitioning= `SELECT @aux`; ---enable_query_log } eval CREATE TABLE t1 ( $column_list $unique ) $partitioning; +--enable_query_log eval $insert_all; --source suite/parts/inc/partition_check.inc # --source include/partition_check.inc @@ -217,9 +217,9 @@ DROP TABLE t1; --source suite/parts/inc/partition_check_drop.inc #----------- PARTITION BY RANGE -- SUBPARTITION BY KEY +--disable_query_log if ($with_partitioning) { ---disable_query_log eval SET @aux = 'PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1) (PARTITION part1 VALUES LESS THAN (0) $data_directory @@ -238,13 +238,13 @@ $data_directory $index_directory (SUBPARTITION subpart41, SUBPARTITION subpart42))'; let $partitioning= `SELECT @aux`; ---enable_query_log } eval CREATE TABLE t1 ( $column_list $unique ) $partitioning; +--enable_query_log eval $insert_all; --source suite/parts/inc/partition_check.inc # --source include/partition_check.inc @@ -252,9 +252,9 @@ DROP TABLE t1; --source suite/parts/inc/partition_check_drop.inc #----------- PARTITION BY LIST -- SUBPARTITION BY HASH +--disable_query_log if ($with_partitioning) { ---disable_query_log eval SET @aux = 'PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 1) (PARTITION part1 VALUES IN (0) @@ -290,13 +290,13 @@ eval SET @aux = $data_directory $index_directory))'; let $partitioning= `SELECT @aux`; ---enable_query_log } eval CREATE TABLE t1 ( $column_list $unique ) $partitioning; +--enable_query_log eval $insert_all; --source suite/parts/inc/partition_check.inc # --source include/partition_check.inc @@ -304,9 +304,9 @@ DROP TABLE t1; --source suite/parts/inc/partition_check_drop.inc #----------- PARTITION BY LIST -- SUBPARTITION BY KEY +--disable_query_log if ($with_partitioning) { ---disable_query_log eval SET @aux = 'PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS $sub_part_no @@ -320,13 +320,13 @@ SUBPARTITION BY KEY(f_int1) SUBPARTITIONS $sub_part_no $data_directory $index_directory)'; let $partitioning= `SELECT @aux`; ---enable_query_log } eval CREATE TABLE t1 ( $column_list $unique ) $partitioning; +--enable_query_log eval $insert_all; --source suite/parts/inc/partition_check.inc # --source include/partition_check.inc diff --git a/mysql-test/suite/parts/inc/partition_set.inc b/mysql-test/suite/parts/inc/partition_set.inc index 76fc1aea4ba..292a28e7e1a 100644 --- a/mysql-test/suite/parts/inc/partition_set.inc +++ b/mysql-test/suite/parts/inc/partition_set.inc @@ -43,41 +43,3 @@ insert into t2 values ('1,2,3'),('2,3,4'),('3,4,5'),('4,5,6'),('5,6,7'),('6,7,8' select count(*) from t2; select * from t2 order by a; drop table t2; - -eval create table t3 (a set ( -'1','2','3','4','5','6','7','8','9','0' -) not null, primary key(a)) engine=$engine -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) -); -show create table t3; -#insert into t3 values ('1'),('2'),('3'),('4'),('5'),('6'),('7'),('8'),('9'),('0'); -#insert into t3 values ('1,2'),('2,3'),('3,4'),('4,5'),('5,6'),('6,7'),('7,8'),('8,9'),('9,0'),('0,1'); -#insert into t3 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 t3; -select * from t3 order by a; -drop table t3; - -eval create table t4 (a set ( -'1','2','3') not null, primary key(a)) engine=$engine -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) -); -show create table t4; -#insert into t4 values ('1'),('2'),('3'); -#insert into t4 values ('1,2'),('2,3'),('3,1'); -#insert into t4 values ('1,2,3'); -select count(*) from t4; -select * from t4 order by a; -drop table t4; 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 a26e6650893..0f30fd199f8 100644 --- a/mysql-test/suite/parts/inc/partition_supported_sql_funcs.inc +++ b/mysql-test/suite/parts/inc/partition_supported_sql_funcs.inc @@ -83,14 +83,9 @@ eval insert into t3 values ($val1); eval insert into t3 values ($val2); eval insert into t3 values ($val3); ---replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR -eval load data infile '$MYSQL_TEST_DIR/suite/parts/inc/$infile' into table t4; - ---replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR -eval load data infile '$MYSQL_TEST_DIR/suite/parts/inc/$infile' into table t5; - ---replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR -eval load data infile '$MYSQL_TEST_DIR/suite/parts/inc/$infile' into table t6; +eval load data infile '../std_data_ln/parts/$infile' into table t4; +eval load data infile '../std_data_ln/parts/$infile' into table t5; +eval load data infile '../std_data_ln/parts/$infile' into table t6; eval select $sqlfunc from t1 order by col1; diff --git a/mysql-test/suite/parts/inc/partition_syntax.inc b/mysql-test/suite/parts/inc/partition_syntax.inc index 3c53861b95b..a2a29d25e48 100644 --- a/mysql-test/suite/parts/inc/partition_syntax.inc +++ b/mysql-test/suite/parts/inc/partition_syntax.inc @@ -331,13 +331,13 @@ $column_list PARTITION BY RANGE(f_int1) ( PARTITION part1 VALUES LESS THAN (NULL), PARTITION part2 VALUES LESS THAN (1000)); ---echo # 3.5.1.2 VALUE LESS THAN (CAST(NULL AS SIGNED INTEGER)) is not allowed +--echo # 3.5.1.2 VALUE LESS THAN (NULL) is not allowed --error 1064 eval CREATE TABLE t1 ( $column_list ) PARTITION BY RANGE(f_int1) -( PARTITION part1 VALUES LESS THAN (CAST(NULL AS SIGNED INTEGER)), +( PARTITION part1 VALUES LESS THAN (NULL), PARTITION part2 VALUES LESS THAN (1000)); --echo # 3.5.2 NULL in LIST partitioning clause --echo # 3.5.2.1 VALUE IN (NULL) @@ -349,14 +349,14 @@ PARTITION BY LIST(MOD(f_int1,2)) PARTITION part2 VALUES IN (0), PARTITION part3 VALUES IN (1)); DROP TABLE t1; ---echo # 3.5.2.2 VALUE IN (CAST(NULL AS SIGNED INTEGER)) +--echo # 3.5.2.2 VALUE IN (NULL) # Attention: It is intended that there is no partition with # VALUES IN (0), because there was a time where NULL was treated as zero eval CREATE TABLE t1 ( $column_list ) PARTITION BY LIST(MOD(f_int1,2)) -( PARTITION part1 VALUES IN (CAST(NULL AS SIGNED INTEGER)), +( PARTITION part1 VALUES IN (NULL), PARTITION part3 VALUES IN (1)); --source suite/parts/inc/partition_layout_check1.inc # --source include/partition_layout_check1.inc @@ -368,7 +368,7 @@ eval CREATE TABLE t1 ( $column_list ) PARTITION BY LIST(MOD(f_int1,2)) -( PARTITION part1 VALUES IN (CAST(NULL AS SIGNED INTEGER)), +( PARTITION part1 VALUES IN (NULL), PARTITION part2 VALUES IN (0), PARTITION part3 VALUES IN (1)); --source suite/parts/inc/partition_layout_check1.inc diff --git a/mysql-test/suite/parts/inc/partition_syntax_1.inc b/mysql-test/suite/parts/inc/partition_syntax_1.inc index ac88b5ee668..e3e1b3ccbb7 100644 --- a/mysql-test/suite/parts/inc/partition_syntax_1.inc +++ b/mysql-test/suite/parts/inc/partition_syntax_1.inc @@ -28,15 +28,15 @@ eval SET @my_errno= $mysql_errno ; let $run= `SELECT @my_errno = 0`; # Expected error codes are # 0 -# 1064 ERROR 42000: You have an error in your SQL syntax -# Reason: assign -1 partitions -# 1486 ERROR HY000: Too many partitions (including subpartitions) were defined -# 1491 ERROR HY000: Number of partitions = 0 is not an allowed value -let $unexpected_error= `SELECT @my_errno NOT IN (0,1064,1487,1492)`; +# 1064 ER_PARSE_ERROR +# Reason: assign -1 partitions +# 1496 ER_TOO_MANY_PARTITIONS_ERROR +# 1501 ER_NO_PARTS_ERROR +let $unexpected_error= `SELECT @my_errno NOT IN (0,1064,1496,1501)`; if ($unexpected_error) { --echo # The last command got an unexepected error response. - --echo # Expected/handled SQL codes are 0,1064,1487,1492 + --echo # Expected/handled SQL codes are 0,1064,1496,1501 SELECT '# SQL code we got was: ' AS "", @my_errno AS ""; --echo # Sorry, have to abort. exit; @@ -66,15 +66,15 @@ eval SET @my_errno= $mysql_errno ; let $run= `SELECT @my_errno = 0`; # Expected error codes are # 0 -# 1064 ERROR 42000: You have an error in your SQL syntax -# Reason: assign -1 subpartitions -# 1487 ERROR HY000: Too many partitions (including subpartitions) were defined -# 1492 ERROR HY000: Number of partitions = 0 is not an allowed value -let $unexpected_error= `SELECT @my_errno NOT IN (0,1064,1487,1492)`; +# 1064 ER_PARSE_ERROR +# Reason: assign -1 partitions +# 1496 ER_TOO_MANY_PARTITIONS_ERROR +# 1501 ER_NO_PARTS_ERROR +let $unexpected_error= `SELECT @my_errno NOT IN (0,1064,1496,1501)`; if ($unexpected_error) { --echo # The last command got an unexepected error response. - --echo # Expected/handled SQL codes are 0,1064,1487,1492 + --echo # Expected/handled SQL codes are 0,1064,1496,1501 SELECT '# SQL code we got was: ' AS "", @my_errno AS ""; --echo # Sorry, have to abort. exit; diff --git a/mysql-test/suite/parts/inc/partition_time.inc b/mysql-test/suite/parts/inc/partition_time.inc index a3388bdc902..a3f49a156fe 100644 --- a/mysql-test/suite/parts/inc/partition_time.inc +++ b/mysql-test/suite/parts/inc/partition_time.inc @@ -46,7 +46,7 @@ select * from t2; drop table t2; eval create table t3 (a time not null, primary key(a)) engine=$engine -partition by range (cast(second(a) as unsigned)) subpartition by key (a) +partition by range (second(a)) subpartition by key (a) subpartitions 3 ( partition quarter1 values less than (16), partition quarter2 values less than (31), @@ -66,7 +66,7 @@ select * from t3; drop table t3; eval create table t4 (a time not null, primary key(a)) engine=$engine -partition by list (cast(second(a) as unsigned)) subpartition by key (a) +partition by list (second(a)) subpartition by key (a) subpartitions 3 ( partition quarter1 values in (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), partition quarter2 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), diff --git a/mysql-test/suite/parts/inc/partition_timestamp.inc b/mysql-test/suite/parts/inc/partition_timestamp.inc index 44eb3b5bd55..d4b1699d6c5 100644 --- a/mysql-test/suite/parts/inc/partition_timestamp.inc +++ b/mysql-test/suite/parts/inc/partition_timestamp.inc @@ -46,7 +46,7 @@ select * from t2; drop table t2; eval create table t3 (a timestamp not null, primary key(a)) engine=$engine -partition by range (cast(month(a) as unsigned)) subpartition by key (a) +partition by range (month(a)) subpartition by key (a) subpartitions 3 ( partition quarter1 values less than (4), partition quarter2 values less than (7), @@ -66,7 +66,7 @@ select * from t3; drop table t3; eval create table t4 (a timestamp not null, primary key(a)) engine=$engine -partition by list (cast(month(a) as unsigned)) subpartition by key (a) +partition by list (month(a)) subpartition by key (a) subpartitions 3 ( partition quarter1 values in (0,1,2,3), partition quarter2 values in (4,5,6), diff --git a/mysql-test/suite/parts/inc/partition_value.inc b/mysql-test/suite/parts/inc/partition_value.inc index 75e9afd53d3..58691752bdf 100644 --- a/mysql-test/suite/parts/inc/partition_value.inc +++ b/mysql-test/suite/parts/inc/partition_value.inc @@ -12,6 +12,16 @@ # Change: # ################################################################################ + +--echo +--echo This test relies on the CAST() function for partitioning, which +--echo is not allowed. Not deleting it yet, as it may have some useful +--echo bits in it. See Bug #30581, "partition_value tests use disallowed +--echo CAST() function" +--echo + +--disable_parsing + --echo --echo #======================================================================== --echo # Calculation of "exotic" results within the partition function @@ -155,3 +165,5 @@ VALUES(NULL,NULL,NULL,NULL,NULL); eval SELECT COUNT(*) = 1 FROM t1 WHERE f_char2 IS NULL; DROP TABLE t1; # + +--enable_parsing diff --git a/mysql-test/suite/parts/r/part_blocked_sql_func_innodb.result b/mysql-test/suite/parts/r/part_blocked_sql_func_innodb.result index 675cebaa7e3..57a7b2189ba 100644 --- a/mysql-test/suite/parts/r/part_blocked_sql_func_innodb.result +++ b/mysql-test/suite/parts/r/part_blocked_sql_func_innodb.result @@ -2,9 +2,205 @@ --- All SQL functions should be rejected, otherwise BUG (see 18198) ------------------------------------------------------------------------- ------------------------------------------------------------------------- +--- ascii(col1) in partition with coltype char(30) +------------------------------------------------------------------------- +must all fail! +drop table if exists t1 ; +drop table if exists t2 ; +drop table if exists t3 ; +drop table if exists t4 ; +drop table if exists t5 ; +drop table if exists t6 ; +create table t1 (col1 char(30)) engine='INNODB' +partition by range(ascii(col1)) +(partition p0 values less than (15), +partition p1 values less than (31)); +Got one of the listed errors +create table t2 (col1 char(30)) engine='INNODB' +partition by list(ascii(col1)) +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors +create table t3 (col1 char(30)) engine='INNODB' +partition by hash(ascii(col1)); +Got one of the listed errors +create table t4 (colint int, col1 char(30)) engine='INNODB' +partition by range(colint) +subpartition by hash(ascii(col1)) subpartitions 2 +(partition p0 values less than (15), +partition p1 values less than (31)); +Got one of the listed errors +create table t5 (colint int, col1 char(30)) engine='INNODB' +partition by list(colint) +subpartition by hash(ascii(col1)) subpartitions 2 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors +create table t6 (colint int, col1 char(30)) engine='INNODB' +partition by range(colint) +(partition p0 values less than (ascii('a')), +partition p1 values less than maxvalue); +Got one of the listed errors +drop table if exists t11 ; +drop table if exists t22 ; +drop table if exists t33 ; +drop table if exists t44 ; +drop table if exists t55 ; +drop table if exists t66 ; +create table t11 (col1 char(30)) engine='INNODB' ; +create table t22 (col1 char(30)) engine='INNODB' ; +create table t33 (col1 char(30)) engine='INNODB' ; +create table t44 (colint int, col1 char(30)) engine='INNODB' ; +create table t55 (colint int, col1 char(30)) engine='INNODB' ; +create table t66 (colint int, col1 char(30)) engine='INNODB' ; +alter table t11 +partition by range(ascii(col1)) +(partition p0 values less than (15), +partition p1 values less than (31)); +Got one of the listed errors +alter table t22 +partition by list(ascii(col1)) +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors +alter table t33 +partition by hash(ascii(col1)); +Got one of the listed errors +alter table t44 +partition by range(colint) +subpartition by hash(ascii(col1)) subpartitions 2 +(partition p0 values less than (15), +partition p1 values less than (31)); +Got one of the listed errors +alter table t55 +partition by list(colint) +subpartition by hash(ascii(col1)) subpartitions 2 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors +alter table t66 +partition by range(colint) +(partition p0 values less than (ascii('a')), +partition p1 values less than maxvalue); +Got one of the listed errors +drop table if exists t1 ; +drop table if exists t2 ; +drop table if exists t3 ; +drop table if exists t4 ; +drop table if exists t5 ; +drop table if exists t6 ; +drop table if exists t11 ; +drop table if exists t22 ; +drop table if exists t33 ; +drop table if exists t44 ; +drop table if exists t55 ; +drop table if exists t66 ; +------------------------------------------------------------------------- +--- ord(col1) in partition with coltype char(30) +------------------------------------------------------------------------- +must all fail! +drop table if exists t1 ; +drop table if exists t2 ; +drop table if exists t3 ; +drop table if exists t4 ; +drop table if exists t5 ; +drop table if exists t6 ; +create table t1 (col1 char(30)) engine='INNODB' +partition by range(ord(col1)) +(partition p0 values less than (15), +partition p1 values less than (31)); +Got one of the listed errors +create table t2 (col1 char(30)) engine='INNODB' +partition by list(ord(col1)) +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors +create table t3 (col1 char(30)) engine='INNODB' +partition by hash(ord(col1)); +Got one of the listed errors +create table t4 (colint int, col1 char(30)) engine='INNODB' +partition by range(colint) +subpartition by hash(ord(col1)) subpartitions 2 +(partition p0 values less than (15), +partition p1 values less than (31)); +Got one of the listed errors +create table t5 (colint int, col1 char(30)) engine='INNODB' +partition by list(colint) +subpartition by hash(ord(col1)) subpartitions 2 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors +create table t6 (colint int, col1 char(30)) engine='INNODB' +partition by range(colint) +(partition p0 values less than (ord('a')), +partition p1 values less than maxvalue); +Got one of the listed errors +drop table if exists t11 ; +drop table if exists t22 ; +drop table if exists t33 ; +drop table if exists t44 ; +drop table if exists t55 ; +drop table if exists t66 ; +create table t11 (col1 char(30)) engine='INNODB' ; +create table t22 (col1 char(30)) engine='INNODB' ; +create table t33 (col1 char(30)) engine='INNODB' ; +create table t44 (colint int, col1 char(30)) engine='INNODB' ; +create table t55 (colint int, col1 char(30)) engine='INNODB' ; +create table t66 (colint int, col1 char(30)) engine='INNODB' ; +alter table t11 +partition by range(ord(col1)) +(partition p0 values less than (15), +partition p1 values less than (31)); +Got one of the listed errors +alter table t22 +partition by list(ord(col1)) +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors +alter table t33 +partition by hash(ord(col1)); +Got one of the listed errors +alter table t44 +partition by range(colint) +subpartition by hash(ord(col1)) subpartitions 2 +(partition p0 values less than (15), +partition p1 values less than (31)); +Got one of the listed errors +alter table t55 +partition by list(colint) +subpartition by hash(ord(col1)) subpartitions 2 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors +alter table t66 +partition by range(colint) +(partition p0 values less than (ord('a')), +partition p1 values less than maxvalue); +Got one of the listed errors +drop table if exists t1 ; +drop table if exists t2 ; +drop table if exists t3 ; +drop table if exists t4 ; +drop table if exists t5 ; +drop table if exists t6 ; +drop table if exists t11 ; +drop table if exists t22 ; +drop table if exists t33 ; +drop table if exists t44 ; +drop table if exists t55 ; +drop table if exists t66 ; +------------------------------------------------------------------------- --- greatest(col1,15) in partition with coltype int ------------------------------------------------------------------------- -must all fail! (delete 0 and comment char, if bug fixed) +must all fail! drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -15,28 +211,34 @@ create table t1 (col1 int) engine='INNODB' partition by range(greatest(col1,15)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t2 (col1 int) engine='INNODB' partition by list(greatest(col1,15)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t3 (col1 int) engine='INNODB' partition by hash(greatest(col1,15)); +Got one of the listed errors create table t4 (colint int, col1 int) engine='INNODB' partition by range(colint) subpartition by hash(greatest(col1,15)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t5 (colint int, col1 int) engine='INNODB' partition by list(colint) subpartition by hash(greatest(col1,15)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t6 (colint int, col1 int) engine='INNODB' partition by range(colint) (partition p0 values less than (greatest(1,15)), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t11 ; drop table if exists t22 ; drop table if exists t33 ; @@ -53,28 +255,34 @@ alter table t11 partition by range(greatest(col1,15)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t22 partition by list(greatest(col1,15)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t33 partition by hash(greatest(col1,15)); +Got one of the listed errors alter table t44 partition by range(colint) subpartition by hash(greatest(col1,15)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t55 partition by list(colint) subpartition by hash(greatest(col1,15)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t66 partition by range(colint) (partition p0 values less than (greatest(1,15)), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -90,7 +298,7 @@ drop table if exists t66 ; ------------------------------------------------------------------------- --- isnull(col1) in partition with coltype int ------------------------------------------------------------------------- -must all fail! (delete 0 and comment char, if bug fixed) +must all fail! drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -101,28 +309,34 @@ create table t1 (col1 int) engine='INNODB' partition by range(isnull(col1)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t2 (col1 int) engine='INNODB' partition by list(isnull(col1)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t3 (col1 int) engine='INNODB' partition by hash(isnull(col1)); +Got one of the listed errors create table t4 (colint int, col1 int) engine='INNODB' partition by range(colint) subpartition by hash(isnull(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t5 (colint int, col1 int) engine='INNODB' partition by list(colint) subpartition by hash(isnull(col1)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t6 (colint int, col1 int) engine='INNODB' partition by range(colint) (partition p0 values less than (isnull(15)), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t11 ; drop table if exists t22 ; drop table if exists t33 ; @@ -139,28 +353,34 @@ alter table t11 partition by range(isnull(col1)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t22 partition by list(isnull(col1)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t33 partition by hash(isnull(col1)); +Got one of the listed errors alter table t44 partition by range(colint) subpartition by hash(isnull(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t55 partition by list(colint) subpartition by hash(isnull(col1)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t66 partition by range(colint) (partition p0 values less than (isnull(15)), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -176,7 +396,7 @@ drop table if exists t66 ; ------------------------------------------------------------------------- --- least(col1,15) in partition with coltype int ------------------------------------------------------------------------- -must all fail! (delete 0 and comment char, if bug fixed) +must all fail! drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -187,28 +407,34 @@ create table t1 (col1 int) engine='INNODB' partition by range(least(col1,15)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t2 (col1 int) engine='INNODB' partition by list(least(col1,15)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t3 (col1 int) engine='INNODB' partition by hash(least(col1,15)); +Got one of the listed errors create table t4 (colint int, col1 int) engine='INNODB' partition by range(colint) subpartition by hash(least(col1,15)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t5 (colint int, col1 int) engine='INNODB' partition by list(colint) subpartition by hash(least(col1,15)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t6 (colint int, col1 int) engine='INNODB' partition by range(colint) (partition p0 values less than (least(15,30)), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t11 ; drop table if exists t22 ; drop table if exists t33 ; @@ -225,28 +451,34 @@ alter table t11 partition by range(least(col1,15)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t22 partition by list(least(col1,15)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t33 partition by hash(least(col1,15)); +Got one of the listed errors alter table t44 partition by range(colint) subpartition by hash(least(col1,15)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t55 partition by list(colint) subpartition by hash(least(col1,15)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t66 partition by range(colint) (partition p0 values less than (least(15,30)), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -262,7 +494,7 @@ drop table if exists t66 ; ------------------------------------------------------------------------- --- case when col1>15 then 20 else 10 end in partition with coltype int ------------------------------------------------------------------------- -must all fail! (delete 0 and comment char, if bug fixed) +must all fail! drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -273,28 +505,34 @@ create table t1 (col1 int) engine='INNODB' partition by range(case when col1>15 then 20 else 10 end) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t2 (col1 int) engine='INNODB' partition by list(case when col1>15 then 20 else 10 end) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t3 (col1 int) engine='INNODB' partition by hash(case when col1>15 then 20 else 10 end); +Got one of the listed errors create table t4 (colint int, col1 int) engine='INNODB' partition by range(colint) subpartition by hash(case when col1>15 then 20 else 10 end) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t5 (colint int, col1 int) engine='INNODB' partition by list(colint) subpartition by hash(case when col1>15 then 20 else 10 end) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t6 (colint int, col1 int) engine='INNODB' partition by range(colint) (partition p0 values less than (case when 1>30 then 20 else 15 end), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t11 ; drop table if exists t22 ; drop table if exists t33 ; @@ -311,28 +549,34 @@ alter table t11 partition by range(case when col1>15 then 20 else 10 end) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t22 partition by list(case when col1>15 then 20 else 10 end) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t33 partition by hash(case when col1>15 then 20 else 10 end); +Got one of the listed errors alter table t44 partition by range(colint) subpartition by hash(case when col1>15 then 20 else 10 end) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t55 partition by list(colint) subpartition by hash(case when col1>15 then 20 else 10 end) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t66 partition by range(colint) (partition p0 values less than (case when 1>30 then 20 else 15 end), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -348,7 +592,7 @@ drop table if exists t66 ; ------------------------------------------------------------------------- --- ifnull(col1,30) in partition with coltype int ------------------------------------------------------------------------- -must all fail! (delete 0 and comment char, if bug fixed) +must all fail! drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -359,28 +603,34 @@ create table t1 (col1 int) engine='INNODB' partition by range(ifnull(col1,30)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t2 (col1 int) engine='INNODB' partition by list(ifnull(col1,30)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t3 (col1 int) engine='INNODB' partition by hash(ifnull(col1,30)); +Got one of the listed errors create table t4 (colint int, col1 int) engine='INNODB' partition by range(colint) subpartition by hash(ifnull(col1,30)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t5 (colint int, col1 int) engine='INNODB' partition by list(colint) subpartition by hash(ifnull(col1,30)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t6 (colint int, col1 int) engine='INNODB' partition by range(colint) (partition p0 values less than (ifnull(1,30)), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t11 ; drop table if exists t22 ; drop table if exists t33 ; @@ -397,28 +647,34 @@ alter table t11 partition by range(ifnull(col1,30)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t22 partition by list(ifnull(col1,30)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t33 partition by hash(ifnull(col1,30)); +Got one of the listed errors alter table t44 partition by range(colint) subpartition by hash(ifnull(col1,30)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t55 partition by list(colint) subpartition by hash(ifnull(col1,30)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t66 partition by range(colint) (partition p0 values less than (ifnull(1,30)), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -434,7 +690,7 @@ drop table if exists t66 ; ------------------------------------------------------------------------- --- nullif(col1,30) in partition with coltype int ------------------------------------------------------------------------- -must all fail! (delete 0 and comment char, if bug fixed) +must all fail! drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -445,28 +701,34 @@ create table t1 (col1 int) engine='INNODB' partition by range(nullif(col1,30)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t2 (col1 int) engine='INNODB' partition by list(nullif(col1,30)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t3 (col1 int) engine='INNODB' partition by hash(nullif(col1,30)); +Got one of the listed errors create table t4 (colint int, col1 int) engine='INNODB' partition by range(colint) subpartition by hash(nullif(col1,30)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t5 (colint int, col1 int) engine='INNODB' partition by list(colint) subpartition by hash(nullif(col1,30)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t6 (colint int, col1 int) engine='INNODB' partition by range(colint) (partition p0 values less than (nullif(1,30)), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t11 ; drop table if exists t22 ; drop table if exists t33 ; @@ -483,28 +745,34 @@ alter table t11 partition by range(nullif(col1,30)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t22 partition by list(nullif(col1,30)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t33 partition by hash(nullif(col1,30)); +Got one of the listed errors alter table t44 partition by range(colint) subpartition by hash(nullif(col1,30)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t55 partition by list(colint) subpartition by hash(nullif(col1,30)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t66 partition by range(colint) (partition p0 values less than (nullif(1,30)), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -520,7 +788,7 @@ drop table if exists t66 ; ------------------------------------------------------------------------- --- bit_length(col1) in partition with coltype int ------------------------------------------------------------------------- -must all fail! (delete 0 and comment char, if bug fixed) +must all fail! drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -531,28 +799,34 @@ create table t1 (col1 int) engine='INNODB' partition by range(bit_length(col1)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t2 (col1 int) engine='INNODB' partition by list(bit_length(col1)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t3 (col1 int) engine='INNODB' partition by hash(bit_length(col1)); +Got one of the listed errors create table t4 (colint int, col1 int) engine='INNODB' partition by range(colint) subpartition by hash(bit_length(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t5 (colint int, col1 int) engine='INNODB' partition by list(colint) subpartition by hash(bit_length(col1)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t6 (colint int, col1 int) engine='INNODB' partition by range(colint) (partition p0 values less than (bit_length(255)), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t11 ; drop table if exists t22 ; drop table if exists t33 ; @@ -569,28 +843,34 @@ alter table t11 partition by range(bit_length(col1)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t22 partition by list(bit_length(col1)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t33 partition by hash(bit_length(col1)); +Got one of the listed errors alter table t44 partition by range(colint) subpartition by hash(bit_length(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t55 partition by list(colint) subpartition by hash(bit_length(col1)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t66 partition by range(colint) (partition p0 values less than (bit_length(255)), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -606,7 +886,7 @@ drop table if exists t66 ; ------------------------------------------------------------------------- --- bit_length(col1) in partition with coltype char(30) ------------------------------------------------------------------------- -must all fail! (delete 0 and comment char, if bug fixed) +must all fail! drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -617,28 +897,34 @@ create table t1 (col1 char(30)) engine='INNODB' partition by range(bit_length(col1)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t2 (col1 char(30)) engine='INNODB' partition by list(bit_length(col1)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t3 (col1 char(30)) engine='INNODB' partition by hash(bit_length(col1)); +Got one of the listed errors create table t4 (colint int, col1 char(30)) engine='INNODB' partition by range(colint) subpartition by hash(bit_length(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t5 (colint int, col1 char(30)) engine='INNODB' partition by list(colint) subpartition by hash(bit_length(col1)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t6 (colint int, col1 char(30)) engine='INNODB' partition by range(colint) (partition p0 values less than (bit_length(255)), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t11 ; drop table if exists t22 ; drop table if exists t33 ; @@ -655,28 +941,34 @@ alter table t11 partition by range(bit_length(col1)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t22 partition by list(bit_length(col1)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t33 partition by hash(bit_length(col1)); +Got one of the listed errors alter table t44 partition by range(colint) subpartition by hash(bit_length(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t55 partition by list(colint) subpartition by hash(bit_length(col1)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t66 partition by range(colint) (partition p0 values less than (bit_length(255)), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -692,7 +984,7 @@ drop table if exists t66 ; ------------------------------------------------------------------------- --- char_length(col1) in partition with coltype char(30) ------------------------------------------------------------------------- -must all fail! (delete 0 and comment char, if bug fixed) +must all fail! drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -703,28 +995,34 @@ create table t1 (col1 char(30)) engine='INNODB' partition by range(char_length(col1)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t2 (col1 char(30)) engine='INNODB' partition by list(char_length(col1)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t3 (col1 char(30)) engine='INNODB' partition by hash(char_length(col1)); +Got one of the listed errors create table t4 (colint int, col1 char(30)) engine='INNODB' partition by range(colint) subpartition by hash(char_length(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t5 (colint int, col1 char(30)) engine='INNODB' partition by list(colint) subpartition by hash(char_length(col1)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t6 (colint int, col1 char(30)) engine='INNODB' partition by range(colint) (partition p0 values less than (char_length('a')), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t11 ; drop table if exists t22 ; drop table if exists t33 ; @@ -741,28 +1039,34 @@ alter table t11 partition by range(char_length(col1)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t22 partition by list(char_length(col1)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t33 partition by hash(char_length(col1)); +Got one of the listed errors alter table t44 partition by range(colint) subpartition by hash(char_length(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t55 partition by list(colint) subpartition by hash(char_length(col1)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t66 partition by range(colint) (partition p0 values less than (char_length('a')), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -778,7 +1082,7 @@ drop table if exists t66 ; ------------------------------------------------------------------------- --- character_length(col1) in partition with coltype int ------------------------------------------------------------------------- -must all fail! (delete 0 and comment char, if bug fixed) +must all fail! drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -789,28 +1093,34 @@ create table t1 (col1 int) engine='INNODB' partition by range(character_length(col1)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t2 (col1 int) engine='INNODB' partition by list(character_length(col1)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t3 (col1 int) engine='INNODB' partition by hash(character_length(col1)); +Got one of the listed errors create table t4 (colint int, col1 int) engine='INNODB' partition by range(colint) subpartition by hash(character_length(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t5 (colint int, col1 int) engine='INNODB' partition by list(colint) subpartition by hash(character_length(col1)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t6 (colint int, col1 int) engine='INNODB' partition by range(colint) (partition p0 values less than (find_in_set('i','a,b,c,d,e,f,g,h,i')), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t11 ; drop table if exists t22 ; drop table if exists t33 ; @@ -827,28 +1137,34 @@ alter table t11 partition by range(character_length(col1)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t22 partition by list(character_length(col1)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t33 partition by hash(character_length(col1)); +Got one of the listed errors alter table t44 partition by range(colint) subpartition by hash(character_length(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t55 partition by list(colint) subpartition by hash(character_length(col1)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t66 partition by range(colint) (partition p0 values less than (find_in_set('i','a,b,c,d,e,f,g,h,i')), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -864,7 +1180,7 @@ drop table if exists t66 ; ------------------------------------------------------------------------- --- character_length(col1) in partition with coltype char(30) ------------------------------------------------------------------------- -must all fail! (delete 0 and comment char, if bug fixed) +must all fail! drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -875,28 +1191,34 @@ create table t1 (col1 char(30)) engine='INNODB' partition by range(character_length(col1)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t2 (col1 char(30)) engine='INNODB' partition by list(character_length(col1)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t3 (col1 char(30)) engine='INNODB' partition by hash(character_length(col1)); +Got one of the listed errors create table t4 (colint int, col1 char(30)) engine='INNODB' partition by range(colint) subpartition by hash(character_length(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t5 (colint int, col1 char(30)) engine='INNODB' partition by list(colint) subpartition by hash(character_length(col1)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t6 (colint int, col1 char(30)) engine='INNODB' partition by range(colint) (partition p0 values less than (find_in_set('i','a,b,c,d,e,f,g,h,i')), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t11 ; drop table if exists t22 ; drop table if exists t33 ; @@ -913,28 +1235,34 @@ alter table t11 partition by range(character_length(col1)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t22 partition by list(character_length(col1)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t33 partition by hash(character_length(col1)); +Got one of the listed errors alter table t44 partition by range(colint) subpartition by hash(character_length(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t55 partition by list(colint) subpartition by hash(character_length(col1)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t66 partition by range(colint) (partition p0 values less than (find_in_set('i','a,b,c,d,e,f,g,h,i')), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -950,7 +1278,7 @@ drop table if exists t66 ; ------------------------------------------------------------------------- --- instr(col1,'acb') in partition with coltype int ------------------------------------------------------------------------- -must all fail! (delete 0 and comment char, if bug fixed) +must all fail! drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -961,28 +1289,34 @@ create table t1 (col1 int) engine='INNODB' partition by range(instr(col1,'acb')) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t2 (col1 int) engine='INNODB' partition by list(instr(col1,'acb')) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t3 (col1 int) engine='INNODB' partition by hash(instr(col1,'acb')); +Got one of the listed errors create table t4 (colint int, col1 int) engine='INNODB' partition by range(colint) subpartition by hash(instr(col1,'acb')) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t5 (colint int, col1 int) engine='INNODB' partition by list(colint) subpartition by hash(instr(col1,'acb')) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t6 (colint int, col1 int) engine='INNODB' partition by range(colint) (partition p0 values less than (instr('i','a,b,c,d,e,f,g,h,i')), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t11 ; drop table if exists t22 ; drop table if exists t33 ; @@ -999,28 +1333,34 @@ alter table t11 partition by range(instr(col1,'acb')) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t22 partition by list(instr(col1,'acb')) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t33 partition by hash(instr(col1,'acb')); +Got one of the listed errors alter table t44 partition by range(colint) subpartition by hash(instr(col1,'acb')) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t55 partition by list(colint) subpartition by hash(instr(col1,'acb')) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t66 partition by range(colint) (partition p0 values less than (instr('i','a,b,c,d,e,f,g,h,i')), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -1036,7 +1376,7 @@ drop table if exists t66 ; ------------------------------------------------------------------------- --- instr(col1,'acb') in partition with coltype char(30) ------------------------------------------------------------------------- -must all fail! (delete 0 and comment char, if bug fixed) +must all fail! drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -1047,28 +1387,34 @@ create table t1 (col1 char(30)) engine='INNODB' partition by range(instr(col1,'acb')) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t2 (col1 char(30)) engine='INNODB' partition by list(instr(col1,'acb')) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t3 (col1 char(30)) engine='INNODB' partition by hash(instr(col1,'acb')); +Got one of the listed errors create table t4 (colint int, col1 char(30)) engine='INNODB' partition by range(colint) subpartition by hash(instr(col1,'acb')) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t5 (colint int, col1 char(30)) engine='INNODB' partition by list(colint) subpartition by hash(instr(col1,'acb')) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t6 (colint int, col1 char(30)) engine='INNODB' partition by range(colint) (partition p0 values less than (instr('i','a,b,c,d,e,f,g,h,i')), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t11 ; drop table if exists t22 ; drop table if exists t33 ; @@ -1085,28 +1431,34 @@ alter table t11 partition by range(instr(col1,'acb')) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t22 partition by list(instr(col1,'acb')) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t33 partition by hash(instr(col1,'acb')); +Got one of the listed errors alter table t44 partition by range(colint) subpartition by hash(instr(col1,'acb')) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t55 partition by list(colint) subpartition by hash(instr(col1,'acb')) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t66 partition by range(colint) (partition p0 values less than (instr('i','a,b,c,d,e,f,g,h,i')), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -1122,7 +1474,7 @@ drop table if exists t66 ; ------------------------------------------------------------------------- --- length(col1) in partition with coltype int ------------------------------------------------------------------------- -must all fail! (delete 0 and comment char, if bug fixed) +must all fail! drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -1133,28 +1485,34 @@ create table t1 (col1 int) engine='INNODB' partition by range(length(col1)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t2 (col1 int) engine='INNODB' partition by list(length(col1)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t3 (col1 int) engine='INNODB' partition by hash(length(col1)); +Got one of the listed errors create table t4 (colint int, col1 int) engine='INNODB' partition by range(colint) subpartition by hash(length(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t5 (colint int, col1 int) engine='INNODB' partition by list(colint) subpartition by hash(length(col1)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t6 (colint int, col1 int) engine='INNODB' partition by range(colint) (partition p0 values less than (length('a,b,c,d,e,f,g,h,i')), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t11 ; drop table if exists t22 ; drop table if exists t33 ; @@ -1171,28 +1529,34 @@ alter table t11 partition by range(length(col1)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t22 partition by list(length(col1)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t33 partition by hash(length(col1)); +Got one of the listed errors alter table t44 partition by range(colint) subpartition by hash(length(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t55 partition by list(colint) subpartition by hash(length(col1)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t66 partition by range(colint) (partition p0 values less than (length('a,b,c,d,e,f,g,h,i')), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -1208,7 +1572,7 @@ drop table if exists t66 ; ------------------------------------------------------------------------- --- locate('a',col1) in partition with coltype int ------------------------------------------------------------------------- -must all fail! (delete 0 and comment char, if bug fixed) +must all fail! drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -1219,28 +1583,34 @@ create table t1 (col1 int) engine='INNODB' partition by range(locate('a',col1)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t2 (col1 int) engine='INNODB' partition by list(locate('a',col1)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t3 (col1 int) engine='INNODB' partition by hash(locate('a',col1)); +Got one of the listed errors create table t4 (colint int, col1 int) engine='INNODB' partition by range(colint) subpartition by hash(locate('a',col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t5 (colint int, col1 int) engine='INNODB' partition by list(colint) subpartition by hash(locate('a',col1)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t6 (colint int, col1 int) engine='INNODB' partition by range(colint) (partition p0 values less than (locate('i','a,b,c,d,e,f,g,h,i')), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t11 ; drop table if exists t22 ; drop table if exists t33 ; @@ -1257,28 +1627,34 @@ alter table t11 partition by range(locate('a',col1)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t22 partition by list(locate('a',col1)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t33 partition by hash(locate('a',col1)); +Got one of the listed errors alter table t44 partition by range(colint) subpartition by hash(locate('a',col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t55 partition by list(colint) subpartition by hash(locate('a',col1)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t66 partition by range(colint) (partition p0 values less than (locate('i','a,b,c,d,e,f,g,h,i')), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -1294,7 +1670,7 @@ drop table if exists t66 ; ------------------------------------------------------------------------- --- locate('a',col1) in partition with coltype char(30) ------------------------------------------------------------------------- -must all fail! (delete 0 and comment char, if bug fixed) +must all fail! drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -1305,28 +1681,34 @@ create table t1 (col1 char(30)) engine='INNODB' partition by range(locate('a',col1)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t2 (col1 char(30)) engine='INNODB' partition by list(locate('a',col1)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t3 (col1 char(30)) engine='INNODB' partition by hash(locate('a',col1)); +Got one of the listed errors create table t4 (colint int, col1 char(30)) engine='INNODB' partition by range(colint) subpartition by hash(locate('a',col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t5 (colint int, col1 char(30)) engine='INNODB' partition by list(colint) subpartition by hash(locate('a',col1)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t6 (colint int, col1 char(30)) engine='INNODB' partition by range(colint) (partition p0 values less than (locate('i','a,b,c,d,e,f,g,h,i')), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t11 ; drop table if exists t22 ; drop table if exists t33 ; @@ -1343,28 +1725,34 @@ alter table t11 partition by range(locate('a',col1)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t22 partition by list(locate('a',col1)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t33 partition by hash(locate('a',col1)); +Got one of the listed errors alter table t44 partition by range(colint) subpartition by hash(locate('a',col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t55 partition by list(colint) subpartition by hash(locate('a',col1)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t66 partition by range(colint) (partition p0 values less than (locate('i','a,b,c,d,e,f,g,h,i')), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -1380,7 +1768,7 @@ drop table if exists t66 ; ------------------------------------------------------------------------- --- octet_length(col1) in partition with coltype char(30) ------------------------------------------------------------------------- -must all fail! (delete 0 and comment char, if bug fixed) +must all fail! drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -1391,28 +1779,34 @@ create table t1 (col1 char(30)) engine='INNODB' partition by range(octet_length(col1)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t2 (col1 char(30)) engine='INNODB' partition by list(octet_length(col1)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t3 (col1 char(30)) engine='INNODB' partition by hash(octet_length(col1)); +Got one of the listed errors create table t4 (colint int, col1 char(30)) engine='INNODB' partition by range(colint) subpartition by hash(octet_length(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t5 (colint int, col1 char(30)) engine='INNODB' partition by list(colint) subpartition by hash(octet_length(col1)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t6 (colint int, col1 char(30)) engine='INNODB' partition by range(colint) (partition p0 values less than (octet_length('a,b,c,d,e,f,g,h,i')), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t11 ; drop table if exists t22 ; drop table if exists t33 ; @@ -1429,28 +1823,34 @@ alter table t11 partition by range(octet_length(col1)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t22 partition by list(octet_length(col1)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t33 partition by hash(octet_length(col1)); +Got one of the listed errors alter table t44 partition by range(colint) subpartition by hash(octet_length(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t55 partition by list(colint) subpartition by hash(octet_length(col1)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t66 partition by range(colint) (partition p0 values less than (octet_length('a,b,c,d,e,f,g,h,i')), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -1466,7 +1866,7 @@ drop table if exists t66 ; ------------------------------------------------------------------------- --- position('a' in col1) in partition with coltype int ------------------------------------------------------------------------- -must all fail! (delete 0 and comment char, if bug fixed) +must all fail! drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -1477,28 +1877,34 @@ create table t1 (col1 int) engine='INNODB' partition by range(position('a' in col1)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t2 (col1 int) engine='INNODB' partition by list(position('a' in col1)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t3 (col1 int) engine='INNODB' partition by hash(position('a' in col1)); +Got one of the listed errors create table t4 (colint int, col1 int) engine='INNODB' partition by range(colint) subpartition by hash(position('a' in col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t5 (colint int, col1 int) engine='INNODB' partition by list(colint) subpartition by hash(position('a' in col1)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t6 (colint int, col1 int) engine='INNODB' partition by range(colint) (partition p0 values less than (position('i' in 'a,b,c,d,e,f,g,h,i')), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t11 ; drop table if exists t22 ; drop table if exists t33 ; @@ -1515,28 +1921,34 @@ alter table t11 partition by range(position('a' in col1)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t22 partition by list(position('a' in col1)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t33 partition by hash(position('a' in col1)); +Got one of the listed errors alter table t44 partition by range(colint) subpartition by hash(position('a' in col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t55 partition by list(colint) subpartition by hash(position('a' in col1)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t66 partition by range(colint) (partition p0 values less than (position('i' in 'a,b,c,d,e,f,g,h,i')), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -1552,7 +1964,7 @@ drop table if exists t66 ; ------------------------------------------------------------------------- --- position('a' in col1) in partition with coltype char(30) ------------------------------------------------------------------------- -must all fail! (delete 0 and comment char, if bug fixed) +must all fail! drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -1563,28 +1975,34 @@ create table t1 (col1 char(30)) engine='INNODB' partition by range(position('a' in col1)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t2 (col1 char(30)) engine='INNODB' partition by list(position('a' in col1)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t3 (col1 char(30)) engine='INNODB' partition by hash(position('a' in col1)); +Got one of the listed errors create table t4 (colint int, col1 char(30)) engine='INNODB' partition by range(colint) subpartition by hash(position('a' in col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t5 (colint int, col1 char(30)) engine='INNODB' partition by list(colint) subpartition by hash(position('a' in col1)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t6 (colint int, col1 char(30)) engine='INNODB' partition by range(colint) (partition p0 values less than (position('i' in 'a,b,c,d,e,f,g,h,i')), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t11 ; drop table if exists t22 ; drop table if exists t33 ; @@ -1601,28 +2019,34 @@ alter table t11 partition by range(position('a' in col1)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t22 partition by list(position('a' in col1)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t33 partition by hash(position('a' in col1)); +Got one of the listed errors alter table t44 partition by range(colint) subpartition by hash(position('a' in col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t55 partition by list(colint) subpartition by hash(position('a' in col1)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t66 partition by range(colint) (partition p0 values less than (position('i' in 'a,b,c,d,e,f,g,h,i')), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -1638,7 +2062,7 @@ drop table if exists t66 ; ------------------------------------------------------------------------- --- strcmp(col1,'acb') in partition with coltype int ------------------------------------------------------------------------- -must all fail! (delete 0 and comment char, if bug fixed) +must all fail! drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -1649,28 +2073,34 @@ create table t1 (col1 int) engine='INNODB' partition by range(strcmp(col1,'acb')) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t2 (col1 int) engine='INNODB' partition by list(strcmp(col1,'acb')) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t3 (col1 int) engine='INNODB' partition by hash(strcmp(col1,'acb')); +Got one of the listed errors create table t4 (colint int, col1 int) engine='INNODB' partition by range(colint) subpartition by hash(strcmp(col1,'acb')) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t5 (colint int, col1 int) engine='INNODB' partition by list(colint) subpartition by hash(strcmp(col1,'acb')) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t6 (colint int, col1 int) engine='INNODB' partition by range(colint) (partition p0 values less than (strcmp('i','a,b,c,d,e,f,g,h,i')), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t11 ; drop table if exists t22 ; drop table if exists t33 ; @@ -1687,28 +2117,34 @@ alter table t11 partition by range(strcmp(col1,'acb')) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t22 partition by list(strcmp(col1,'acb')) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t33 partition by hash(strcmp(col1,'acb')); +Got one of the listed errors alter table t44 partition by range(colint) subpartition by hash(strcmp(col1,'acb')) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t55 partition by list(colint) subpartition by hash(strcmp(col1,'acb')) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t66 partition by range(colint) (partition p0 values less than (strcmp('i','a,b,c,d,e,f,g,h,i')), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -1724,7 +2160,7 @@ drop table if exists t66 ; ------------------------------------------------------------------------- --- strcmp(col1,'acb') in partition with coltype char(30) ------------------------------------------------------------------------- -must all fail! (delete 0 and comment char, if bug fixed) +must all fail! drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -1735,28 +2171,34 @@ create table t1 (col1 char(30)) engine='INNODB' partition by range(strcmp(col1,'acb')) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t2 (col1 char(30)) engine='INNODB' partition by list(strcmp(col1,'acb')) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t3 (col1 char(30)) engine='INNODB' partition by hash(strcmp(col1,'acb')); +Got one of the listed errors create table t4 (colint int, col1 char(30)) engine='INNODB' partition by range(colint) subpartition by hash(strcmp(col1,'acb')) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t5 (colint int, col1 char(30)) engine='INNODB' partition by list(colint) subpartition by hash(strcmp(col1,'acb')) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t6 (colint int, col1 char(30)) engine='INNODB' partition by range(colint) (partition p0 values less than (strcmp('i','a,b,c,d,e,f,g,h,i')), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t11 ; drop table if exists t22 ; drop table if exists t33 ; @@ -1773,28 +2215,34 @@ alter table t11 partition by range(strcmp(col1,'acb')) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t22 partition by list(strcmp(col1,'acb')) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t33 partition by hash(strcmp(col1,'acb')); +Got one of the listed errors alter table t44 partition by range(colint) subpartition by hash(strcmp(col1,'acb')) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t55 partition by list(colint) subpartition by hash(strcmp(col1,'acb')) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t66 partition by range(colint) (partition p0 values less than (strcmp('i','a,b,c,d,e,f,g,h,i')), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -1810,7 +2258,7 @@ drop table if exists t66 ; ------------------------------------------------------------------------- --- crc32(col1) in partition with coltype char(30) ------------------------------------------------------------------------- -must all fail! (delete 0 and comment char, if bug fixed) +must all fail! drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -1821,28 +2269,34 @@ create table t1 (col1 char(30)) engine='INNODB' partition by range(crc32(col1)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t2 (col1 char(30)) engine='INNODB' partition by list(crc32(col1)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t3 (col1 char(30)) engine='INNODB' partition by hash(crc32(col1)); +Got one of the listed errors create table t4 (colint int, col1 char(30)) engine='INNODB' partition by range(colint) subpartition by hash(crc32(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t5 (colint int, col1 char(30)) engine='INNODB' partition by list(colint) subpartition by hash(crc32(col1)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t6 (colint int, col1 char(30)) engine='INNODB' partition by range(colint) (partition p0 values less than (crc32('a,b,c,d,e,f,g,h,i')), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t11 ; drop table if exists t22 ; drop table if exists t33 ; @@ -1859,28 +2313,34 @@ alter table t11 partition by range(crc32(col1)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t22 partition by list(crc32(col1)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t33 partition by hash(crc32(col1)); +Got one of the listed errors alter table t44 partition by range(colint) subpartition by hash(crc32(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t55 partition by list(colint) subpartition by hash(crc32(col1)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t66 partition by range(colint) (partition p0 values less than (crc32('a,b,c,d,e,f,g,h,i')), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -1896,7 +2356,7 @@ drop table if exists t66 ; ------------------------------------------------------------------------- --- round(col1) in partition with coltype int ------------------------------------------------------------------------- -must all fail! (delete 0 and comment char, if bug fixed) +must all fail! drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -1907,28 +2367,34 @@ create table t1 (col1 int) engine='INNODB' partition by range(round(col1)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t2 (col1 int) engine='INNODB' partition by list(round(col1)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t3 (col1 int) engine='INNODB' partition by hash(round(col1)); +Got one of the listed errors create table t4 (colint int, col1 int) engine='INNODB' partition by range(colint) subpartition by hash(round(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t5 (colint int, col1 int) engine='INNODB' partition by list(colint) subpartition by hash(round(col1)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t6 (colint int, col1 int) engine='INNODB' partition by range(colint) (partition p0 values less than (round(15)), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t11 ; drop table if exists t22 ; drop table if exists t33 ; @@ -1945,28 +2411,34 @@ alter table t11 partition by range(round(col1)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t22 partition by list(round(col1)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t33 partition by hash(round(col1)); +Got one of the listed errors alter table t44 partition by range(colint) subpartition by hash(round(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t55 partition by list(colint) subpartition by hash(round(col1)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t66 partition by range(colint) (partition p0 values less than (round(15)), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -1982,7 +2454,7 @@ drop table if exists t66 ; ------------------------------------------------------------------------- --- sign(col1) in partition with coltype int ------------------------------------------------------------------------- -must all fail! (delete 0 and comment char, if bug fixed) +must all fail! drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -1993,28 +2465,34 @@ create table t1 (col1 int) engine='INNODB' partition by range(sign(col1)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t2 (col1 int) engine='INNODB' partition by list(sign(col1)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t3 (col1 int) engine='INNODB' partition by hash(sign(col1)); +Got one of the listed errors create table t4 (colint int, col1 int) engine='INNODB' partition by range(colint) subpartition by hash(sign(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t5 (colint int, col1 int) engine='INNODB' partition by list(colint) subpartition by hash(sign(col1)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t6 (colint int, col1 int) engine='INNODB' partition by range(colint) (partition p0 values less than (sign(123)), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t11 ; drop table if exists t22 ; drop table if exists t33 ; @@ -2031,114 +2509,34 @@ alter table t11 partition by range(sign(col1)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t22 partition by list(sign(col1)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t33 partition by hash(sign(col1)); +Got one of the listed errors alter table t44 partition by range(colint) subpartition by hash(sign(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t55 partition by list(colint) subpartition by hash(sign(col1)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t66 partition by range(colint) (partition p0 values less than (sign(123)), partition p1 values less than maxvalue); -drop table if exists t1 ; -drop table if exists t2 ; -drop table if exists t3 ; -drop table if exists t4 ; -drop table if exists t5 ; -drop table if exists t6 ; -drop table if exists t11 ; -drop table if exists t22 ; -drop table if exists t33 ; -drop table if exists t44 ; -drop table if exists t55 ; -drop table if exists t66 ; -------------------------------------------------------------------------- ---- datediff(col1,col1) in partition with coltype datetime -------------------------------------------------------------------------- -must all fail! (delete 0 and comment char, if bug fixed) -drop table if exists t1 ; -drop table if exists t2 ; -drop table if exists t3 ; -drop table if exists t4 ; -drop table if exists t5 ; -drop table if exists t6 ; -create table t1 (col1 datetime) engine='INNODB' -partition by range(datediff(col1,col1)) -(partition p0 values less than (15), -partition p1 values less than (31)); -create table t2 (col1 datetime) engine='INNODB' -partition by list(datediff(col1,col1)) -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30)); -create table t3 (col1 datetime) engine='INNODB' -partition by hash(datediff(col1,col1)); -create table t4 (colint int, col1 datetime) engine='INNODB' -partition by range(colint) -subpartition by hash(datediff(col1,col1)) subpartitions 2 -(partition p0 values less than (15), -partition p1 values less than (31)); -create table t5 (colint int, col1 datetime) engine='INNODB' -partition by list(colint) -subpartition by hash(datediff(col1,col1)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30)); -create table t6 (colint int, col1 datetime) engine='INNODB' -partition by range(colint) -(partition p0 values less than (datediff('1997-11-30 23:59:59','1997-12-31')), -partition p1 values less than maxvalue); -drop table if exists t11 ; -drop table if exists t22 ; -drop table if exists t33 ; -drop table if exists t44 ; -drop table if exists t55 ; -drop table if exists t66 ; -create table t11 (col1 datetime) engine='INNODB' ; -create table t22 (col1 datetime) engine='INNODB' ; -create table t33 (col1 datetime) engine='INNODB' ; -create table t44 (colint int, col1 datetime) engine='INNODB' ; -create table t55 (colint int, col1 datetime) engine='INNODB' ; -create table t66 (colint int, col1 datetime) engine='INNODB' ; -alter table t11 -partition by range(datediff(col1,col1)) -(partition p0 values less than (15), -partition p1 values less than (31)); -alter table t22 -partition by list(datediff(col1,col1)) -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30)); -alter table t33 -partition by hash(datediff(col1,col1)); -alter table t44 -partition by range(colint) -subpartition by hash(datediff(col1,col1)) subpartitions 2 -(partition p0 values less than (15), -partition p1 values less than (31)); -alter table t55 -partition by list(colint) -subpartition by hash(datediff(col1,col1)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30)); -alter table t66 -partition by range(colint) -(partition p0 values less than (datediff('1997-11-30 23:59:59','1997-12-31')), -partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -2154,7 +2552,7 @@ drop table if exists t66 ; ------------------------------------------------------------------------- --- period_add(col1,5) in partition with coltype datetime ------------------------------------------------------------------------- -must all fail! (delete 0 and comment char, if bug fixed) +must all fail! drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -2165,28 +2563,34 @@ create table t1 (col1 datetime) engine='INNODB' partition by range(period_add(col1,5)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t2 (col1 datetime) engine='INNODB' partition by list(period_add(col1,5)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t3 (col1 datetime) engine='INNODB' partition by hash(period_add(col1,5)); +Got one of the listed errors create table t4 (colint int, col1 datetime) engine='INNODB' partition by range(colint) subpartition by hash(period_add(col1,5)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t5 (colint int, col1 datetime) engine='INNODB' partition by list(colint) subpartition by hash(period_add(col1,5)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t6 (colint int, col1 datetime) engine='INNODB' partition by range(colint) (partition p0 values less than (period_add(9804,5)), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t11 ; drop table if exists t22 ; drop table if exists t33 ; @@ -2203,28 +2607,34 @@ alter table t11 partition by range(period_add(col1,5)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t22 partition by list(period_add(col1,5)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t33 partition by hash(period_add(col1,5)); +Got one of the listed errors alter table t44 partition by range(colint) subpartition by hash(period_add(col1,5)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t55 partition by list(colint) subpartition by hash(period_add(col1,5)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t66 partition by range(colint) (partition p0 values less than (period_add(9804,5)), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -2240,7 +2650,7 @@ drop table if exists t66 ; ------------------------------------------------------------------------- --- period_diff(col1,col2) in partition with coltype datetime,col2 datetime ------------------------------------------------------------------------- -must all fail! (delete 0 and comment char, if bug fixed) +must all fail! drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -2251,28 +2661,34 @@ create table t1 (col1 datetime,col2 datetime) engine='INNODB' partition by range(period_diff(col1,col2)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t2 (col1 datetime,col2 datetime) engine='INNODB' partition by list(period_diff(col1,col2)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t3 (col1 datetime,col2 datetime) engine='INNODB' partition by hash(period_diff(col1,col2)); +Got one of the listed errors create table t4 (colint int, col1 datetime,col2 datetime) engine='INNODB' partition by range(colint) subpartition by hash(period_diff(col1,col2)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t5 (colint int, col1 datetime,col2 datetime) engine='INNODB' partition by list(colint) subpartition by hash(period_diff(col1,col2)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t6 (colint int, col1 datetime,col2 datetime) engine='INNODB' partition by range(colint) (partition p0 values less than (period_diff(9809,199907)), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t11 ; drop table if exists t22 ; drop table if exists t33 ; @@ -2289,28 +2705,34 @@ alter table t11 partition by range(period_diff(col1,col2)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t22 partition by list(period_diff(col1,col2)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t33 partition by hash(period_diff(col1,col2)); +Got one of the listed errors alter table t44 partition by range(colint) subpartition by hash(period_diff(col1,col2)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t55 partition by list(colint) subpartition by hash(period_diff(col1,col2)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t66 partition by range(colint) (partition p0 values less than (period_diff(9809,199907)), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -2326,7 +2748,7 @@ drop table if exists t66 ; ------------------------------------------------------------------------- --- period_diff(col1,col2) in partition with coltype int,col2 int ------------------------------------------------------------------------- -must all fail! (delete 0 and comment char, if bug fixed) +must all fail! drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -2337,28 +2759,34 @@ create table t1 (col1 int,col2 int) engine='INNODB' partition by range(period_diff(col1,col2)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t2 (col1 int,col2 int) engine='INNODB' partition by list(period_diff(col1,col2)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t3 (col1 int,col2 int) engine='INNODB' partition by hash(period_diff(col1,col2)); +Got one of the listed errors create table t4 (colint int, col1 int,col2 int) engine='INNODB' partition by range(colint) subpartition by hash(period_diff(col1,col2)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t5 (colint int, col1 int,col2 int) engine='INNODB' partition by list(colint) subpartition by hash(period_diff(col1,col2)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t6 (colint int, col1 int,col2 int) engine='INNODB' partition by range(colint) (partition p0 values less than (period_diff(9809,199907)), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t11 ; drop table if exists t22 ; drop table if exists t33 ; @@ -2375,28 +2803,34 @@ alter table t11 partition by range(period_diff(col1,col2)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t22 partition by list(period_diff(col1,col2)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t33 partition by hash(period_diff(col1,col2)); +Got one of the listed errors alter table t44 partition by range(colint) subpartition by hash(period_diff(col1,col2)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t55 partition by list(colint) subpartition by hash(period_diff(col1,col2)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t66 partition by range(colint) (partition p0 values less than (period_diff(9809,199907)), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -2412,7 +2846,7 @@ drop table if exists t66 ; ------------------------------------------------------------------------- --- timestampdiff(day,5,col1) in partition with coltype datetime ------------------------------------------------------------------------- -must all fail! (delete 0 and comment char, if bug fixed) +must all fail! drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -2423,28 +2857,34 @@ create table t1 (col1 datetime) engine='INNODB' partition by range(timestampdiff(day,5,col1)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t2 (col1 datetime) engine='INNODB' partition by list(timestampdiff(day,5,col1)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t3 (col1 datetime) engine='INNODB' partition by hash(timestampdiff(day,5,col1)); +Got one of the listed errors create table t4 (colint int, col1 datetime) engine='INNODB' partition by range(colint) subpartition by hash(timestampdiff(day,5,col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t5 (colint int, col1 datetime) engine='INNODB' partition by list(colint) subpartition by hash(timestampdiff(day,5,col1)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t6 (colint int, col1 datetime) engine='INNODB' partition by range(colint) (partition p0 values less than (timestampdiff(YEAR,'2002-05-01','2001-01-01')), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t11 ; drop table if exists t22 ; drop table if exists t33 ; @@ -2461,28 +2901,34 @@ alter table t11 partition by range(timestampdiff(day,5,col1)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t22 partition by list(timestampdiff(day,5,col1)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t33 partition by hash(timestampdiff(day,5,col1)); +Got one of the listed errors alter table t44 partition by range(colint) subpartition by hash(timestampdiff(day,5,col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t55 partition by list(colint) subpartition by hash(timestampdiff(day,5,col1)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t66 partition by range(colint) (partition p0 values less than (timestampdiff(YEAR,'2002-05-01','2001-01-01')), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -2498,7 +2944,7 @@ drop table if exists t66 ; ------------------------------------------------------------------------- --- unix_timestamp(col1) in partition with coltype date ------------------------------------------------------------------------- -must all fail! (delete 0 and comment char, if bug fixed) +must all fail! drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -2509,28 +2955,34 @@ create table t1 (col1 date) engine='INNODB' partition by range(unix_timestamp(col1)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t2 (col1 date) engine='INNODB' partition by list(unix_timestamp(col1)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t3 (col1 date) engine='INNODB' partition by hash(unix_timestamp(col1)); +Got one of the listed errors create table t4 (colint int, col1 date) engine='INNODB' partition by range(colint) subpartition by hash(unix_timestamp(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t5 (colint int, col1 date) engine='INNODB' partition by list(colint) subpartition by hash(unix_timestamp(col1)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t6 (colint int, col1 date) engine='INNODB' partition by range(colint) (partition p0 values less than (unix_timestamp ('2002-05-01')), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t11 ; drop table if exists t22 ; drop table if exists t33 ; @@ -2547,28 +2999,34 @@ alter table t11 partition by range(unix_timestamp(col1)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t22 partition by list(unix_timestamp(col1)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t33 partition by hash(unix_timestamp(col1)); +Got one of the listed errors alter table t44 partition by range(colint) subpartition by hash(unix_timestamp(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t55 partition by list(colint) subpartition by hash(unix_timestamp(col1)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t66 partition by range(colint) (partition p0 values less than (unix_timestamp ('2002-05-01')), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -2584,7 +3042,7 @@ drop table if exists t66 ; ------------------------------------------------------------------------- --- week(col1) in partition with coltype datetime ------------------------------------------------------------------------- -must all fail! (delete 0 and comment char, if bug fixed) +must all fail! drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -2595,28 +3053,34 @@ create table t1 (col1 datetime) engine='INNODB' partition by range(week(col1)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t2 (col1 datetime) engine='INNODB' partition by list(week(col1)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t3 (col1 datetime) engine='INNODB' partition by hash(week(col1)); +Got one of the listed errors create table t4 (colint int, col1 datetime) engine='INNODB' partition by range(colint) subpartition by hash(week(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t5 (colint int, col1 datetime) engine='INNODB' partition by list(colint) subpartition by hash(week(col1)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t6 (colint int, col1 datetime) engine='INNODB' partition by range(colint) (partition p0 values less than (week('2002-05-01')), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t11 ; drop table if exists t22 ; drop table if exists t33 ; @@ -2633,28 +3097,132 @@ alter table t11 partition by range(week(col1)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t22 partition by list(week(col1)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t33 partition by hash(week(col1)); +Got one of the listed errors alter table t44 partition by range(colint) subpartition by hash(week(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t55 partition by list(colint) subpartition by hash(week(col1)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t66 partition by range(colint) (partition p0 values less than (week('2002-05-01')), partition p1 values less than maxvalue); +Got one of the listed errors +drop table if exists t1 ; +drop table if exists t2 ; +drop table if exists t3 ; +drop table if exists t4 ; +drop table if exists t5 ; +drop table if exists t6 ; +drop table if exists t11 ; +drop table if exists t22 ; +drop table if exists t33 ; +drop table if exists t44 ; +drop table if exists t55 ; +drop table if exists t66 ; +------------------------------------------------------------------------- +--- weekofyear(col1) in partition with coltype datetime +------------------------------------------------------------------------- +must all fail! +drop table if exists t1 ; +drop table if exists t2 ; +drop table if exists t3 ; +drop table if exists t4 ; +drop table if exists t5 ; +drop table if exists t6 ; +create table t1 (col1 datetime) engine='INNODB' +partition by range(weekofyear(col1)) +(partition p0 values less than (15), +partition p1 values less than (31)); +Got one of the listed errors +create table t2 (col1 datetime) engine='INNODB' +partition by list(weekofyear(col1)) +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors +create table t3 (col1 datetime) engine='INNODB' +partition by hash(weekofyear(col1)); +Got one of the listed errors +create table t4 (colint int, col1 datetime) engine='INNODB' +partition by range(colint) +subpartition by hash(weekofyear(col1)) subpartitions 2 +(partition p0 values less than (15), +partition p1 values less than (31)); +Got one of the listed errors +create table t5 (colint int, col1 datetime) engine='INNODB' +partition by list(colint) +subpartition by hash(weekofyear(col1)) subpartitions 2 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors +create table t6 (colint int, col1 datetime) engine='INNODB' +partition by range(colint) +(partition p0 values less than (weekofyear('2002-05-01')), +partition p1 values less than maxvalue); +Got one of the listed errors +drop table if exists t11 ; +drop table if exists t22 ; +drop table if exists t33 ; +drop table if exists t44 ; +drop table if exists t55 ; +drop table if exists t66 ; +create table t11 (col1 datetime) engine='INNODB' ; +create table t22 (col1 datetime) engine='INNODB' ; +create table t33 (col1 datetime) engine='INNODB' ; +create table t44 (colint int, col1 datetime) engine='INNODB' ; +create table t55 (colint int, col1 datetime) engine='INNODB' ; +create table t66 (colint int, col1 datetime) engine='INNODB' ; +alter table t11 +partition by range(weekofyear(col1)) +(partition p0 values less than (15), +partition p1 values less than (31)); +Got one of the listed errors +alter table t22 +partition by list(weekofyear(col1)) +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors +alter table t33 +partition by hash(weekofyear(col1)); +Got one of the listed errors +alter table t44 +partition by range(colint) +subpartition by hash(weekofyear(col1)) subpartitions 2 +(partition p0 values less than (15), +partition p1 values less than (31)); +Got one of the listed errors +alter table t55 +partition by list(colint) +subpartition by hash(weekofyear(col1)) subpartitions 2 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors +alter table t66 +partition by range(colint) +(partition p0 values less than (weekofyear('2002-05-01')), +partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -2670,7 +3238,7 @@ drop table if exists t66 ; ------------------------------------------------------------------------- --- cast(col1 as signed) in partition with coltype varchar(30) ------------------------------------------------------------------------- -must all fail! (delete 0 and comment char, if bug fixed) +must all fail! drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -2681,28 +3249,34 @@ create table t1 (col1 varchar(30)) engine='INNODB' partition by range(cast(col1 as signed)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t2 (col1 varchar(30)) engine='INNODB' partition by list(cast(col1 as signed)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t3 (col1 varchar(30)) engine='INNODB' partition by hash(cast(col1 as signed)); +Got one of the listed errors create table t4 (colint int, col1 varchar(30)) engine='INNODB' partition by range(colint) subpartition by hash(cast(col1 as signed)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t5 (colint int, col1 varchar(30)) engine='INNODB' partition by list(colint) subpartition by hash(cast(col1 as signed)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t6 (colint int, col1 varchar(30)) engine='INNODB' partition by range(colint) (partition p0 values less than (cast(123 as signed)), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t11 ; drop table if exists t22 ; drop table if exists t33 ; @@ -2719,28 +3293,34 @@ alter table t11 partition by range(cast(col1 as signed)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t22 partition by list(cast(col1 as signed)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t33 partition by hash(cast(col1 as signed)); +Got one of the listed errors alter table t44 partition by range(colint) subpartition by hash(cast(col1 as signed)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t55 partition by list(colint) subpartition by hash(cast(col1 as signed)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t66 partition by range(colint) (partition p0 values less than (cast(123 as signed)), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -2756,7 +3336,7 @@ drop table if exists t66 ; ------------------------------------------------------------------------- --- convert(col1,unsigned) in partition with coltype varchar(30) ------------------------------------------------------------------------- -must all fail! (delete 0 and comment char, if bug fixed) +must all fail! drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -2767,28 +3347,34 @@ create table t1 (col1 varchar(30)) engine='INNODB' partition by range(convert(col1,unsigned)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t2 (col1 varchar(30)) engine='INNODB' partition by list(convert(col1,unsigned)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t3 (col1 varchar(30)) engine='INNODB' partition by hash(convert(col1,unsigned)); +Got one of the listed errors create table t4 (colint int, col1 varchar(30)) engine='INNODB' partition by range(colint) subpartition by hash(convert(col1,unsigned)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t5 (colint int, col1 varchar(30)) engine='INNODB' partition by list(colint) subpartition by hash(convert(col1,unsigned)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t6 (colint int, col1 varchar(30)) engine='INNODB' partition by range(colint) (partition p0 values less than (convert(123,unsigned)), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t11 ; drop table if exists t22 ; drop table if exists t33 ; @@ -2805,28 +3391,34 @@ alter table t11 partition by range(convert(col1,unsigned)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t22 partition by list(convert(col1,unsigned)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t33 partition by hash(convert(col1,unsigned)); +Got one of the listed errors alter table t44 partition by range(colint) subpartition by hash(convert(col1,unsigned)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t55 partition by list(colint) subpartition by hash(convert(col1,unsigned)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t66 partition by range(colint) (partition p0 values less than (convert(123,unsigned)), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -2842,7 +3434,7 @@ drop table if exists t66 ; ------------------------------------------------------------------------- --- col1 | 20 in partition with coltype int ------------------------------------------------------------------------- -must all fail! (delete 0 and comment char, if bug fixed) +must all fail! drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -2853,28 +3445,34 @@ create table t1 (col1 int) engine='INNODB' partition by range(col1 | 20) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t2 (col1 int) engine='INNODB' partition by list(col1 | 20) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t3 (col1 int) engine='INNODB' partition by hash(col1 | 20); +Got one of the listed errors create table t4 (colint int, col1 int) engine='INNODB' partition by range(colint) subpartition by hash(col1 | 20) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t5 (colint int, col1 int) engine='INNODB' partition by list(colint) subpartition by hash(col1 | 20) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t6 (colint int, col1 int) engine='INNODB' partition by range(colint) (partition p0 values less than (10 | 20), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t11 ; drop table if exists t22 ; drop table if exists t33 ; @@ -2891,28 +3489,34 @@ alter table t11 partition by range(col1 | 20) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t22 partition by list(col1 | 20) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t33 partition by hash(col1 | 20); +Got one of the listed errors alter table t44 partition by range(colint) subpartition by hash(col1 | 20) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t55 partition by list(colint) subpartition by hash(col1 | 20) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t66 partition by range(colint) (partition p0 values less than (10 | 20), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -2928,7 +3532,7 @@ drop table if exists t66 ; ------------------------------------------------------------------------- --- col1 & 20 in partition with coltype int ------------------------------------------------------------------------- -must all fail! (delete 0 and comment char, if bug fixed) +must all fail! drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -2939,28 +3543,34 @@ create table t1 (col1 int) engine='INNODB' partition by range(col1 & 20) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t2 (col1 int) engine='INNODB' partition by list(col1 & 20) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t3 (col1 int) engine='INNODB' partition by hash(col1 & 20); +Got one of the listed errors create table t4 (colint int, col1 int) engine='INNODB' partition by range(colint) subpartition by hash(col1 & 20) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t5 (colint int, col1 int) engine='INNODB' partition by list(colint) subpartition by hash(col1 & 20) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t6 (colint int, col1 int) engine='INNODB' partition by range(colint) (partition p0 values less than (10 & 20), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t11 ; drop table if exists t22 ; drop table if exists t33 ; @@ -2977,28 +3587,34 @@ alter table t11 partition by range(col1 & 20) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t22 partition by list(col1 & 20) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t33 partition by hash(col1 & 20); +Got one of the listed errors alter table t44 partition by range(colint) subpartition by hash(col1 & 20) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t55 partition by list(colint) subpartition by hash(col1 & 20) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t66 partition by range(colint) (partition p0 values less than (10 & 20), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -3014,7 +3630,7 @@ drop table if exists t66 ; ------------------------------------------------------------------------- --- col1 ^ 20 in partition with coltype int ------------------------------------------------------------------------- -must all fail! (delete 0 and comment char, if bug fixed) +must all fail! drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -3025,28 +3641,34 @@ create table t1 (col1 int) engine='INNODB' partition by range(col1 ^ 20) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t2 (col1 int) engine='INNODB' partition by list(col1 ^ 20) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t3 (col1 int) engine='INNODB' partition by hash(col1 ^ 20); +Got one of the listed errors create table t4 (colint int, col1 int) engine='INNODB' partition by range(colint) subpartition by hash(col1 ^ 20) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t5 (colint int, col1 int) engine='INNODB' partition by list(colint) subpartition by hash(col1 ^ 20) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t6 (colint int, col1 int) engine='INNODB' partition by range(colint) (partition p0 values less than (10 ^ 20), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t11 ; drop table if exists t22 ; drop table if exists t33 ; @@ -3063,28 +3685,34 @@ alter table t11 partition by range(col1 ^ 20) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t22 partition by list(col1 ^ 20) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t33 partition by hash(col1 ^ 20); +Got one of the listed errors alter table t44 partition by range(colint) subpartition by hash(col1 ^ 20) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t55 partition by list(colint) subpartition by hash(col1 ^ 20) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t66 partition by range(colint) (partition p0 values less than (10 ^ 20), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -3100,7 +3728,7 @@ drop table if exists t66 ; ------------------------------------------------------------------------- --- col1 << 20 in partition with coltype int ------------------------------------------------------------------------- -must all fail! (delete 0 and comment char, if bug fixed) +must all fail! drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -3111,28 +3739,34 @@ create table t1 (col1 int) engine='INNODB' partition by range(col1 << 20) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t2 (col1 int) engine='INNODB' partition by list(col1 << 20) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t3 (col1 int) engine='INNODB' partition by hash(col1 << 20); +Got one of the listed errors create table t4 (colint int, col1 int) engine='INNODB' partition by range(colint) subpartition by hash(col1 << 20) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t5 (colint int, col1 int) engine='INNODB' partition by list(colint) subpartition by hash(col1 << 20) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t6 (colint int, col1 int) engine='INNODB' partition by range(colint) (partition p0 values less than (10 << 20), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t11 ; drop table if exists t22 ; drop table if exists t33 ; @@ -3149,28 +3783,34 @@ alter table t11 partition by range(col1 << 20) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t22 partition by list(col1 << 20) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t33 partition by hash(col1 << 20); +Got one of the listed errors alter table t44 partition by range(colint) subpartition by hash(col1 << 20) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t55 partition by list(colint) subpartition by hash(col1 << 20) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t66 partition by range(colint) (partition p0 values less than (10 << 20), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -3186,7 +3826,7 @@ drop table if exists t66 ; ------------------------------------------------------------------------- --- col1 >> 20 in partition with coltype int ------------------------------------------------------------------------- -must all fail! (delete 0 and comment char, if bug fixed) +must all fail! drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -3197,28 +3837,34 @@ create table t1 (col1 int) engine='INNODB' partition by range(col1 >> 20) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t2 (col1 int) engine='INNODB' partition by list(col1 >> 20) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t3 (col1 int) engine='INNODB' partition by hash(col1 >> 20); +Got one of the listed errors create table t4 (colint int, col1 int) engine='INNODB' partition by range(colint) subpartition by hash(col1 >> 20) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t5 (colint int, col1 int) engine='INNODB' partition by list(colint) subpartition by hash(col1 >> 20) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t6 (colint int, col1 int) engine='INNODB' partition by range(colint) (partition p0 values less than (10 >> 20), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t11 ; drop table if exists t22 ; drop table if exists t33 ; @@ -3235,28 +3881,34 @@ alter table t11 partition by range(col1 >> 20) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t22 partition by list(col1 >> 20) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t33 partition by hash(col1 >> 20); +Got one of the listed errors alter table t44 partition by range(colint) subpartition by hash(col1 >> 20) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t55 partition by list(colint) subpartition by hash(col1 >> 20) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t66 partition by range(colint) (partition p0 values less than (10 >> 20), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -3272,7 +3924,7 @@ drop table if exists t66 ; ------------------------------------------------------------------------- --- ~col1 in partition with coltype int ------------------------------------------------------------------------- -must all fail! (delete 0 and comment char, if bug fixed) +must all fail! drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -3283,28 +3935,34 @@ create table t1 (col1 int) engine='INNODB' partition by range(~col1) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t2 (col1 int) engine='INNODB' partition by list(~col1) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t3 (col1 int) engine='INNODB' partition by hash(~col1); +Got one of the listed errors create table t4 (colint int, col1 int) engine='INNODB' partition by range(colint) subpartition by hash(~col1) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t5 (colint int, col1 int) engine='INNODB' partition by list(colint) subpartition by hash(~col1) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t6 (colint int, col1 int) engine='INNODB' partition by range(colint) (partition p0 values less than (~20), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t11 ; drop table if exists t22 ; drop table if exists t33 ; @@ -3321,28 +3979,34 @@ alter table t11 partition by range(~col1) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t22 partition by list(~col1) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t33 partition by hash(~col1); +Got one of the listed errors alter table t44 partition by range(colint) subpartition by hash(~col1) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t55 partition by list(colint) subpartition by hash(~col1) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t66 partition by range(colint) (partition p0 values less than (~20), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -3358,7 +4022,7 @@ drop table if exists t66 ; ------------------------------------------------------------------------- --- bit_count(col1) in partition with coltype int ------------------------------------------------------------------------- -must all fail! (delete 0 and comment char, if bug fixed) +must all fail! drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -3369,28 +4033,34 @@ create table t1 (col1 int) engine='INNODB' partition by range(bit_count(col1)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t2 (col1 int) engine='INNODB' partition by list(bit_count(col1)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t3 (col1 int) engine='INNODB' partition by hash(bit_count(col1)); +Got one of the listed errors create table t4 (colint int, col1 int) engine='INNODB' partition by range(colint) subpartition by hash(bit_count(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t5 (colint int, col1 int) engine='INNODB' partition by list(colint) subpartition by hash(bit_count(col1)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t6 (colint int, col1 int) engine='INNODB' partition by range(colint) (partition p0 values less than (bit_count(20)), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t11 ; drop table if exists t22 ; drop table if exists t33 ; @@ -3407,28 +4077,34 @@ alter table t11 partition by range(bit_count(col1)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t22 partition by list(bit_count(col1)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t33 partition by hash(bit_count(col1)); +Got one of the listed errors alter table t44 partition by range(colint) subpartition by hash(bit_count(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t55 partition by list(colint) subpartition by hash(bit_count(col1)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t66 partition by range(colint) (partition p0 values less than (bit_count(20)), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -3444,7 +4120,7 @@ drop table if exists t66 ; ------------------------------------------------------------------------- --- inet_aton(col1) in partition with coltype int ------------------------------------------------------------------------- -must all fail! (delete 0 and comment char, if bug fixed) +must all fail! drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -3455,28 +4131,34 @@ create table t1 (col1 int) engine='INNODB' partition by range(inet_aton(col1)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t2 (col1 int) engine='INNODB' partition by list(inet_aton(col1)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t3 (col1 int) engine='INNODB' partition by hash(inet_aton(col1)); +Got one of the listed errors create table t4 (colint int, col1 int) engine='INNODB' partition by range(colint) subpartition by hash(inet_aton(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t5 (colint int, col1 int) engine='INNODB' partition by list(colint) subpartition by hash(inet_aton(col1)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t6 (colint int, col1 int) engine='INNODB' partition by range(colint) (partition p0 values less than (inet_aton('192.168.1.1')), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t11 ; drop table if exists t22 ; drop table if exists t33 ; @@ -3493,28 +4175,34 @@ alter table t11 partition by range(inet_aton(col1)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t22 partition by list(inet_aton(col1)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t33 partition by hash(inet_aton(col1)); +Got one of the listed errors alter table t44 partition by range(colint) subpartition by hash(inet_aton(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t55 partition by list(colint) subpartition by hash(inet_aton(col1)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t66 partition by range(colint) (partition p0 values less than (inet_aton('192.168.1.1')), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -3531,7 +4219,7 @@ set @var =20; ------------------------------------------------------------------------- --- bit_length(col1)+@var-@var in partition with coltype int ------------------------------------------------------------------------- -must all fail! (delete 0 and comment char, if bug fixed) +must all fail! drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -3542,35 +4230,34 @@ create table t1 (col1 int) engine='INNODB' partition by range(bit_length(col1)+@var-@var) (partition p0 values less than (15), partition p1 values less than (31)); -ERROR 42000: Constant/Random expression in (sub)partitioning function is not allowed near ') -(partition p0 values less than (15), -partition p1 values less than (31))' at line 2 +Got one of the listed errors create table t2 (col1 int) engine='INNODB' partition by list(bit_length(col1)+@var-@var) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); -ERROR 42000: Constant/Random expression in (sub)partitioning function is not allowed near ') -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12' at line 2 +Got one of the listed errors create table t3 (col1 int) engine='INNODB' partition by hash(bit_length(col1)+@var-@var); -ERROR 42000: Constant/Random expression in (sub)partitioning function is not allowed near ')' at line 2 +Got one of the listed errors create table t4 (colint int, col1 int) engine='INNODB' partition by range(colint) subpartition by hash(bit_length(col1)+@var-@var) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t5 (colint int, col1 int) engine='INNODB' partition by list(colint) subpartition by hash(bit_length(col1)+@var-@var) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t6 (colint int, col1 int) engine='INNODB' partition by range(colint) (partition p0 values less than (bit_length(20)+@var-@var), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t11 ; drop table if exists t22 ; drop table if exists t33 ; @@ -3587,35 +4274,34 @@ alter table t11 partition by range(bit_length(col1)+@var-@var) (partition p0 values less than (15), partition p1 values less than (31)); -ERROR 42000: Constant/Random expression in (sub)partitioning function is not allowed near ') -(partition p0 values less than (15), -partition p1 values less than (31))' at line 2 +Got one of the listed errors alter table t22 partition by list(bit_length(col1)+@var-@var) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); -ERROR 42000: Constant/Random expression in (sub)partitioning function is not allowed near ') -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12' at line 2 +Got one of the listed errors alter table t33 partition by hash(bit_length(col1)+@var-@var); -ERROR 42000: Constant/Random expression in (sub)partitioning function is not allowed near ')' at line 2 +Got one of the listed errors alter table t44 partition by range(colint) subpartition by hash(bit_length(col1)+@var-@var) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t55 partition by list(colint) subpartition by hash(bit_length(col1)+@var-@var) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t66 partition by range(colint) (partition p0 values less than (bit_length(20)+@var-@var), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -3652,7 +4338,7 @@ end// ------------------------------------------------------------------------- --- getmaxsigned_t1(col1) in partition with coltype int ------------------------------------------------------------------------- -must all fail! (delete 0 and comment char, if bug fixed) +must all fail! drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -3663,35 +4349,34 @@ create table t1 (col1 int) engine='INNODB' partition by range(getmaxsigned_t1(col1)) (partition p0 values less than (15), partition p1 values less than (31)); -ERROR 42000: Constant/Random expression in (sub)partitioning function is not allowed near ') -(partition p0 values less than (15), -partition p1 values less than (31))' at line 2 +Got one of the listed errors create table t2 (col1 int) engine='INNODB' partition by list(getmaxsigned_t1(col1)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); -ERROR 42000: Constant/Random expression in (sub)partitioning function is not allowed near ') -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12' at line 2 +Got one of the listed errors create table t3 (col1 int) engine='INNODB' partition by hash(getmaxsigned_t1(col1)); -ERROR 42000: Constant/Random expression in (sub)partitioning function is not allowed near ')' at line 2 +Got one of the listed errors create table t4 (colint int, col1 int) engine='INNODB' partition by range(colint) subpartition by hash(getmaxsigned_t1(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t5 (colint int, col1 int) engine='INNODB' partition by list(colint) subpartition by hash(getmaxsigned_t1(col1)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t6 (colint int, col1 int) engine='INNODB' partition by range(colint) (partition p0 values less than (getmaxsigned(10)), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t11 ; drop table if exists t22 ; drop table if exists t33 ; @@ -3708,35 +4393,34 @@ alter table t11 partition by range(getmaxsigned_t1(col1)) (partition p0 values less than (15), partition p1 values less than (31)); -ERROR 42000: Constant/Random expression in (sub)partitioning function is not allowed near ') -(partition p0 values less than (15), -partition p1 values less than (31))' at line 2 +Got one of the listed errors alter table t22 partition by list(getmaxsigned_t1(col1)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); -ERROR 42000: Constant/Random expression in (sub)partitioning function is not allowed near ') -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12' at line 2 +Got one of the listed errors alter table t33 partition by hash(getmaxsigned_t1(col1)); -ERROR 42000: Constant/Random expression in (sub)partitioning function is not allowed near ')' at line 2 +Got one of the listed errors alter table t44 partition by range(colint) subpartition by hash(getmaxsigned_t1(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t55 partition by list(colint) subpartition by hash(getmaxsigned_t1(col1)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t66 partition by range(colint) (partition p0 values less than (getmaxsigned(10)), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; diff --git a/mysql-test/suite/parts/r/part_blocked_sql_func_myisam.result b/mysql-test/suite/parts/r/part_blocked_sql_func_myisam.result index 8b0ea1d3d49..4a67054e82a 100644 --- a/mysql-test/suite/parts/r/part_blocked_sql_func_myisam.result +++ b/mysql-test/suite/parts/r/part_blocked_sql_func_myisam.result @@ -2,9 +2,205 @@ --- All SQL functions should be rejected, otherwise BUG (see 18198) ------------------------------------------------------------------------- ------------------------------------------------------------------------- +--- ascii(col1) in partition with coltype char(30) +------------------------------------------------------------------------- +must all fail! +drop table if exists t1 ; +drop table if exists t2 ; +drop table if exists t3 ; +drop table if exists t4 ; +drop table if exists t5 ; +drop table if exists t6 ; +create table t1 (col1 char(30)) engine='MYISAM' +partition by range(ascii(col1)) +(partition p0 values less than (15), +partition p1 values less than (31)); +Got one of the listed errors +create table t2 (col1 char(30)) engine='MYISAM' +partition by list(ascii(col1)) +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors +create table t3 (col1 char(30)) engine='MYISAM' +partition by hash(ascii(col1)); +Got one of the listed errors +create table t4 (colint int, col1 char(30)) engine='MYISAM' +partition by range(colint) +subpartition by hash(ascii(col1)) subpartitions 2 +(partition p0 values less than (15), +partition p1 values less than (31)); +Got one of the listed errors +create table t5 (colint int, col1 char(30)) engine='MYISAM' +partition by list(colint) +subpartition by hash(ascii(col1)) subpartitions 2 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors +create table t6 (colint int, col1 char(30)) engine='MYISAM' +partition by range(colint) +(partition p0 values less than (ascii('a')), +partition p1 values less than maxvalue); +Got one of the listed errors +drop table if exists t11 ; +drop table if exists t22 ; +drop table if exists t33 ; +drop table if exists t44 ; +drop table if exists t55 ; +drop table if exists t66 ; +create table t11 (col1 char(30)) engine='MYISAM' ; +create table t22 (col1 char(30)) engine='MYISAM' ; +create table t33 (col1 char(30)) engine='MYISAM' ; +create table t44 (colint int, col1 char(30)) engine='MYISAM' ; +create table t55 (colint int, col1 char(30)) engine='MYISAM' ; +create table t66 (colint int, col1 char(30)) engine='MYISAM' ; +alter table t11 +partition by range(ascii(col1)) +(partition p0 values less than (15), +partition p1 values less than (31)); +Got one of the listed errors +alter table t22 +partition by list(ascii(col1)) +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors +alter table t33 +partition by hash(ascii(col1)); +Got one of the listed errors +alter table t44 +partition by range(colint) +subpartition by hash(ascii(col1)) subpartitions 2 +(partition p0 values less than (15), +partition p1 values less than (31)); +Got one of the listed errors +alter table t55 +partition by list(colint) +subpartition by hash(ascii(col1)) subpartitions 2 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors +alter table t66 +partition by range(colint) +(partition p0 values less than (ascii('a')), +partition p1 values less than maxvalue); +Got one of the listed errors +drop table if exists t1 ; +drop table if exists t2 ; +drop table if exists t3 ; +drop table if exists t4 ; +drop table if exists t5 ; +drop table if exists t6 ; +drop table if exists t11 ; +drop table if exists t22 ; +drop table if exists t33 ; +drop table if exists t44 ; +drop table if exists t55 ; +drop table if exists t66 ; +------------------------------------------------------------------------- +--- ord(col1) in partition with coltype char(30) +------------------------------------------------------------------------- +must all fail! +drop table if exists t1 ; +drop table if exists t2 ; +drop table if exists t3 ; +drop table if exists t4 ; +drop table if exists t5 ; +drop table if exists t6 ; +create table t1 (col1 char(30)) engine='MYISAM' +partition by range(ord(col1)) +(partition p0 values less than (15), +partition p1 values less than (31)); +Got one of the listed errors +create table t2 (col1 char(30)) engine='MYISAM' +partition by list(ord(col1)) +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors +create table t3 (col1 char(30)) engine='MYISAM' +partition by hash(ord(col1)); +Got one of the listed errors +create table t4 (colint int, col1 char(30)) engine='MYISAM' +partition by range(colint) +subpartition by hash(ord(col1)) subpartitions 2 +(partition p0 values less than (15), +partition p1 values less than (31)); +Got one of the listed errors +create table t5 (colint int, col1 char(30)) engine='MYISAM' +partition by list(colint) +subpartition by hash(ord(col1)) subpartitions 2 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors +create table t6 (colint int, col1 char(30)) engine='MYISAM' +partition by range(colint) +(partition p0 values less than (ord('a')), +partition p1 values less than maxvalue); +Got one of the listed errors +drop table if exists t11 ; +drop table if exists t22 ; +drop table if exists t33 ; +drop table if exists t44 ; +drop table if exists t55 ; +drop table if exists t66 ; +create table t11 (col1 char(30)) engine='MYISAM' ; +create table t22 (col1 char(30)) engine='MYISAM' ; +create table t33 (col1 char(30)) engine='MYISAM' ; +create table t44 (colint int, col1 char(30)) engine='MYISAM' ; +create table t55 (colint int, col1 char(30)) engine='MYISAM' ; +create table t66 (colint int, col1 char(30)) engine='MYISAM' ; +alter table t11 +partition by range(ord(col1)) +(partition p0 values less than (15), +partition p1 values less than (31)); +Got one of the listed errors +alter table t22 +partition by list(ord(col1)) +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors +alter table t33 +partition by hash(ord(col1)); +Got one of the listed errors +alter table t44 +partition by range(colint) +subpartition by hash(ord(col1)) subpartitions 2 +(partition p0 values less than (15), +partition p1 values less than (31)); +Got one of the listed errors +alter table t55 +partition by list(colint) +subpartition by hash(ord(col1)) subpartitions 2 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors +alter table t66 +partition by range(colint) +(partition p0 values less than (ord('a')), +partition p1 values less than maxvalue); +Got one of the listed errors +drop table if exists t1 ; +drop table if exists t2 ; +drop table if exists t3 ; +drop table if exists t4 ; +drop table if exists t5 ; +drop table if exists t6 ; +drop table if exists t11 ; +drop table if exists t22 ; +drop table if exists t33 ; +drop table if exists t44 ; +drop table if exists t55 ; +drop table if exists t66 ; +------------------------------------------------------------------------- --- greatest(col1,15) in partition with coltype int ------------------------------------------------------------------------- -must all fail! (delete 0 and comment char, if bug fixed) +must all fail! drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -15,28 +211,34 @@ create table t1 (col1 int) engine='MYISAM' partition by range(greatest(col1,15)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t2 (col1 int) engine='MYISAM' partition by list(greatest(col1,15)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t3 (col1 int) engine='MYISAM' partition by hash(greatest(col1,15)); +Got one of the listed errors create table t4 (colint int, col1 int) engine='MYISAM' partition by range(colint) subpartition by hash(greatest(col1,15)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t5 (colint int, col1 int) engine='MYISAM' partition by list(colint) subpartition by hash(greatest(col1,15)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t6 (colint int, col1 int) engine='MYISAM' partition by range(colint) (partition p0 values less than (greatest(1,15)), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t11 ; drop table if exists t22 ; drop table if exists t33 ; @@ -53,28 +255,34 @@ alter table t11 partition by range(greatest(col1,15)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t22 partition by list(greatest(col1,15)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t33 partition by hash(greatest(col1,15)); +Got one of the listed errors alter table t44 partition by range(colint) subpartition by hash(greatest(col1,15)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t55 partition by list(colint) subpartition by hash(greatest(col1,15)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t66 partition by range(colint) (partition p0 values less than (greatest(1,15)), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -90,7 +298,7 @@ drop table if exists t66 ; ------------------------------------------------------------------------- --- isnull(col1) in partition with coltype int ------------------------------------------------------------------------- -must all fail! (delete 0 and comment char, if bug fixed) +must all fail! drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -101,28 +309,34 @@ create table t1 (col1 int) engine='MYISAM' partition by range(isnull(col1)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t2 (col1 int) engine='MYISAM' partition by list(isnull(col1)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t3 (col1 int) engine='MYISAM' partition by hash(isnull(col1)); +Got one of the listed errors create table t4 (colint int, col1 int) engine='MYISAM' partition by range(colint) subpartition by hash(isnull(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t5 (colint int, col1 int) engine='MYISAM' partition by list(colint) subpartition by hash(isnull(col1)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t6 (colint int, col1 int) engine='MYISAM' partition by range(colint) (partition p0 values less than (isnull(15)), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t11 ; drop table if exists t22 ; drop table if exists t33 ; @@ -139,28 +353,34 @@ alter table t11 partition by range(isnull(col1)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t22 partition by list(isnull(col1)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t33 partition by hash(isnull(col1)); +Got one of the listed errors alter table t44 partition by range(colint) subpartition by hash(isnull(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t55 partition by list(colint) subpartition by hash(isnull(col1)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t66 partition by range(colint) (partition p0 values less than (isnull(15)), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -176,7 +396,7 @@ drop table if exists t66 ; ------------------------------------------------------------------------- --- least(col1,15) in partition with coltype int ------------------------------------------------------------------------- -must all fail! (delete 0 and comment char, if bug fixed) +must all fail! drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -187,28 +407,34 @@ create table t1 (col1 int) engine='MYISAM' partition by range(least(col1,15)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t2 (col1 int) engine='MYISAM' partition by list(least(col1,15)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t3 (col1 int) engine='MYISAM' partition by hash(least(col1,15)); +Got one of the listed errors create table t4 (colint int, col1 int) engine='MYISAM' partition by range(colint) subpartition by hash(least(col1,15)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t5 (colint int, col1 int) engine='MYISAM' partition by list(colint) subpartition by hash(least(col1,15)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t6 (colint int, col1 int) engine='MYISAM' partition by range(colint) (partition p0 values less than (least(15,30)), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t11 ; drop table if exists t22 ; drop table if exists t33 ; @@ -225,28 +451,34 @@ alter table t11 partition by range(least(col1,15)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t22 partition by list(least(col1,15)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t33 partition by hash(least(col1,15)); +Got one of the listed errors alter table t44 partition by range(colint) subpartition by hash(least(col1,15)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t55 partition by list(colint) subpartition by hash(least(col1,15)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t66 partition by range(colint) (partition p0 values less than (least(15,30)), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -262,7 +494,7 @@ drop table if exists t66 ; ------------------------------------------------------------------------- --- case when col1>15 then 20 else 10 end in partition with coltype int ------------------------------------------------------------------------- -must all fail! (delete 0 and comment char, if bug fixed) +must all fail! drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -273,28 +505,34 @@ create table t1 (col1 int) engine='MYISAM' partition by range(case when col1>15 then 20 else 10 end) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t2 (col1 int) engine='MYISAM' partition by list(case when col1>15 then 20 else 10 end) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t3 (col1 int) engine='MYISAM' partition by hash(case when col1>15 then 20 else 10 end); +Got one of the listed errors create table t4 (colint int, col1 int) engine='MYISAM' partition by range(colint) subpartition by hash(case when col1>15 then 20 else 10 end) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t5 (colint int, col1 int) engine='MYISAM' partition by list(colint) subpartition by hash(case when col1>15 then 20 else 10 end) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t6 (colint int, col1 int) engine='MYISAM' partition by range(colint) (partition p0 values less than (case when 1>30 then 20 else 15 end), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t11 ; drop table if exists t22 ; drop table if exists t33 ; @@ -311,28 +549,34 @@ alter table t11 partition by range(case when col1>15 then 20 else 10 end) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t22 partition by list(case when col1>15 then 20 else 10 end) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t33 partition by hash(case when col1>15 then 20 else 10 end); +Got one of the listed errors alter table t44 partition by range(colint) subpartition by hash(case when col1>15 then 20 else 10 end) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t55 partition by list(colint) subpartition by hash(case when col1>15 then 20 else 10 end) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t66 partition by range(colint) (partition p0 values less than (case when 1>30 then 20 else 15 end), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -348,7 +592,7 @@ drop table if exists t66 ; ------------------------------------------------------------------------- --- ifnull(col1,30) in partition with coltype int ------------------------------------------------------------------------- -must all fail! (delete 0 and comment char, if bug fixed) +must all fail! drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -359,28 +603,34 @@ create table t1 (col1 int) engine='MYISAM' partition by range(ifnull(col1,30)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t2 (col1 int) engine='MYISAM' partition by list(ifnull(col1,30)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t3 (col1 int) engine='MYISAM' partition by hash(ifnull(col1,30)); +Got one of the listed errors create table t4 (colint int, col1 int) engine='MYISAM' partition by range(colint) subpartition by hash(ifnull(col1,30)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t5 (colint int, col1 int) engine='MYISAM' partition by list(colint) subpartition by hash(ifnull(col1,30)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t6 (colint int, col1 int) engine='MYISAM' partition by range(colint) (partition p0 values less than (ifnull(1,30)), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t11 ; drop table if exists t22 ; drop table if exists t33 ; @@ -397,28 +647,34 @@ alter table t11 partition by range(ifnull(col1,30)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t22 partition by list(ifnull(col1,30)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t33 partition by hash(ifnull(col1,30)); +Got one of the listed errors alter table t44 partition by range(colint) subpartition by hash(ifnull(col1,30)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t55 partition by list(colint) subpartition by hash(ifnull(col1,30)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t66 partition by range(colint) (partition p0 values less than (ifnull(1,30)), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -434,7 +690,7 @@ drop table if exists t66 ; ------------------------------------------------------------------------- --- nullif(col1,30) in partition with coltype int ------------------------------------------------------------------------- -must all fail! (delete 0 and comment char, if bug fixed) +must all fail! drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -445,28 +701,34 @@ create table t1 (col1 int) engine='MYISAM' partition by range(nullif(col1,30)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t2 (col1 int) engine='MYISAM' partition by list(nullif(col1,30)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t3 (col1 int) engine='MYISAM' partition by hash(nullif(col1,30)); +Got one of the listed errors create table t4 (colint int, col1 int) engine='MYISAM' partition by range(colint) subpartition by hash(nullif(col1,30)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t5 (colint int, col1 int) engine='MYISAM' partition by list(colint) subpartition by hash(nullif(col1,30)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t6 (colint int, col1 int) engine='MYISAM' partition by range(colint) (partition p0 values less than (nullif(1,30)), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t11 ; drop table if exists t22 ; drop table if exists t33 ; @@ -483,28 +745,34 @@ alter table t11 partition by range(nullif(col1,30)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t22 partition by list(nullif(col1,30)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t33 partition by hash(nullif(col1,30)); +Got one of the listed errors alter table t44 partition by range(colint) subpartition by hash(nullif(col1,30)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t55 partition by list(colint) subpartition by hash(nullif(col1,30)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t66 partition by range(colint) (partition p0 values less than (nullif(1,30)), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -520,7 +788,7 @@ drop table if exists t66 ; ------------------------------------------------------------------------- --- bit_length(col1) in partition with coltype int ------------------------------------------------------------------------- -must all fail! (delete 0 and comment char, if bug fixed) +must all fail! drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -531,28 +799,34 @@ create table t1 (col1 int) engine='MYISAM' partition by range(bit_length(col1)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t2 (col1 int) engine='MYISAM' partition by list(bit_length(col1)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t3 (col1 int) engine='MYISAM' partition by hash(bit_length(col1)); +Got one of the listed errors create table t4 (colint int, col1 int) engine='MYISAM' partition by range(colint) subpartition by hash(bit_length(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t5 (colint int, col1 int) engine='MYISAM' partition by list(colint) subpartition by hash(bit_length(col1)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t6 (colint int, col1 int) engine='MYISAM' partition by range(colint) (partition p0 values less than (bit_length(255)), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t11 ; drop table if exists t22 ; drop table if exists t33 ; @@ -569,28 +843,34 @@ alter table t11 partition by range(bit_length(col1)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t22 partition by list(bit_length(col1)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t33 partition by hash(bit_length(col1)); +Got one of the listed errors alter table t44 partition by range(colint) subpartition by hash(bit_length(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t55 partition by list(colint) subpartition by hash(bit_length(col1)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t66 partition by range(colint) (partition p0 values less than (bit_length(255)), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -606,7 +886,7 @@ drop table if exists t66 ; ------------------------------------------------------------------------- --- bit_length(col1) in partition with coltype char(30) ------------------------------------------------------------------------- -must all fail! (delete 0 and comment char, if bug fixed) +must all fail! drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -617,28 +897,34 @@ create table t1 (col1 char(30)) engine='MYISAM' partition by range(bit_length(col1)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t2 (col1 char(30)) engine='MYISAM' partition by list(bit_length(col1)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t3 (col1 char(30)) engine='MYISAM' partition by hash(bit_length(col1)); +Got one of the listed errors create table t4 (colint int, col1 char(30)) engine='MYISAM' partition by range(colint) subpartition by hash(bit_length(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t5 (colint int, col1 char(30)) engine='MYISAM' partition by list(colint) subpartition by hash(bit_length(col1)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t6 (colint int, col1 char(30)) engine='MYISAM' partition by range(colint) (partition p0 values less than (bit_length(255)), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t11 ; drop table if exists t22 ; drop table if exists t33 ; @@ -655,28 +941,34 @@ alter table t11 partition by range(bit_length(col1)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t22 partition by list(bit_length(col1)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t33 partition by hash(bit_length(col1)); +Got one of the listed errors alter table t44 partition by range(colint) subpartition by hash(bit_length(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t55 partition by list(colint) subpartition by hash(bit_length(col1)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t66 partition by range(colint) (partition p0 values less than (bit_length(255)), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -692,7 +984,7 @@ drop table if exists t66 ; ------------------------------------------------------------------------- --- char_length(col1) in partition with coltype char(30) ------------------------------------------------------------------------- -must all fail! (delete 0 and comment char, if bug fixed) +must all fail! drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -703,28 +995,34 @@ create table t1 (col1 char(30)) engine='MYISAM' partition by range(char_length(col1)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t2 (col1 char(30)) engine='MYISAM' partition by list(char_length(col1)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t3 (col1 char(30)) engine='MYISAM' partition by hash(char_length(col1)); +Got one of the listed errors create table t4 (colint int, col1 char(30)) engine='MYISAM' partition by range(colint) subpartition by hash(char_length(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t5 (colint int, col1 char(30)) engine='MYISAM' partition by list(colint) subpartition by hash(char_length(col1)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t6 (colint int, col1 char(30)) engine='MYISAM' partition by range(colint) (partition p0 values less than (char_length('a')), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t11 ; drop table if exists t22 ; drop table if exists t33 ; @@ -741,28 +1039,34 @@ alter table t11 partition by range(char_length(col1)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t22 partition by list(char_length(col1)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t33 partition by hash(char_length(col1)); +Got one of the listed errors alter table t44 partition by range(colint) subpartition by hash(char_length(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t55 partition by list(colint) subpartition by hash(char_length(col1)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t66 partition by range(colint) (partition p0 values less than (char_length('a')), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -778,7 +1082,7 @@ drop table if exists t66 ; ------------------------------------------------------------------------- --- character_length(col1) in partition with coltype int ------------------------------------------------------------------------- -must all fail! (delete 0 and comment char, if bug fixed) +must all fail! drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -789,28 +1093,34 @@ create table t1 (col1 int) engine='MYISAM' partition by range(character_length(col1)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t2 (col1 int) engine='MYISAM' partition by list(character_length(col1)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t3 (col1 int) engine='MYISAM' partition by hash(character_length(col1)); +Got one of the listed errors create table t4 (colint int, col1 int) engine='MYISAM' partition by range(colint) subpartition by hash(character_length(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t5 (colint int, col1 int) engine='MYISAM' partition by list(colint) subpartition by hash(character_length(col1)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t6 (colint int, col1 int) engine='MYISAM' partition by range(colint) (partition p0 values less than (find_in_set('i','a,b,c,d,e,f,g,h,i')), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t11 ; drop table if exists t22 ; drop table if exists t33 ; @@ -827,28 +1137,34 @@ alter table t11 partition by range(character_length(col1)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t22 partition by list(character_length(col1)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t33 partition by hash(character_length(col1)); +Got one of the listed errors alter table t44 partition by range(colint) subpartition by hash(character_length(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t55 partition by list(colint) subpartition by hash(character_length(col1)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t66 partition by range(colint) (partition p0 values less than (find_in_set('i','a,b,c,d,e,f,g,h,i')), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -864,7 +1180,7 @@ drop table if exists t66 ; ------------------------------------------------------------------------- --- character_length(col1) in partition with coltype char(30) ------------------------------------------------------------------------- -must all fail! (delete 0 and comment char, if bug fixed) +must all fail! drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -875,28 +1191,34 @@ create table t1 (col1 char(30)) engine='MYISAM' partition by range(character_length(col1)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t2 (col1 char(30)) engine='MYISAM' partition by list(character_length(col1)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t3 (col1 char(30)) engine='MYISAM' partition by hash(character_length(col1)); +Got one of the listed errors create table t4 (colint int, col1 char(30)) engine='MYISAM' partition by range(colint) subpartition by hash(character_length(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t5 (colint int, col1 char(30)) engine='MYISAM' partition by list(colint) subpartition by hash(character_length(col1)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t6 (colint int, col1 char(30)) engine='MYISAM' partition by range(colint) (partition p0 values less than (find_in_set('i','a,b,c,d,e,f,g,h,i')), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t11 ; drop table if exists t22 ; drop table if exists t33 ; @@ -913,28 +1235,34 @@ alter table t11 partition by range(character_length(col1)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t22 partition by list(character_length(col1)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t33 partition by hash(character_length(col1)); +Got one of the listed errors alter table t44 partition by range(colint) subpartition by hash(character_length(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t55 partition by list(colint) subpartition by hash(character_length(col1)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t66 partition by range(colint) (partition p0 values less than (find_in_set('i','a,b,c,d,e,f,g,h,i')), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -950,7 +1278,7 @@ drop table if exists t66 ; ------------------------------------------------------------------------- --- instr(col1,'acb') in partition with coltype int ------------------------------------------------------------------------- -must all fail! (delete 0 and comment char, if bug fixed) +must all fail! drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -961,28 +1289,34 @@ create table t1 (col1 int) engine='MYISAM' partition by range(instr(col1,'acb')) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t2 (col1 int) engine='MYISAM' partition by list(instr(col1,'acb')) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t3 (col1 int) engine='MYISAM' partition by hash(instr(col1,'acb')); +Got one of the listed errors create table t4 (colint int, col1 int) engine='MYISAM' partition by range(colint) subpartition by hash(instr(col1,'acb')) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t5 (colint int, col1 int) engine='MYISAM' partition by list(colint) subpartition by hash(instr(col1,'acb')) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t6 (colint int, col1 int) engine='MYISAM' partition by range(colint) (partition p0 values less than (instr('i','a,b,c,d,e,f,g,h,i')), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t11 ; drop table if exists t22 ; drop table if exists t33 ; @@ -999,28 +1333,34 @@ alter table t11 partition by range(instr(col1,'acb')) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t22 partition by list(instr(col1,'acb')) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t33 partition by hash(instr(col1,'acb')); +Got one of the listed errors alter table t44 partition by range(colint) subpartition by hash(instr(col1,'acb')) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t55 partition by list(colint) subpartition by hash(instr(col1,'acb')) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t66 partition by range(colint) (partition p0 values less than (instr('i','a,b,c,d,e,f,g,h,i')), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -1036,7 +1376,7 @@ drop table if exists t66 ; ------------------------------------------------------------------------- --- instr(col1,'acb') in partition with coltype char(30) ------------------------------------------------------------------------- -must all fail! (delete 0 and comment char, if bug fixed) +must all fail! drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -1047,28 +1387,34 @@ create table t1 (col1 char(30)) engine='MYISAM' partition by range(instr(col1,'acb')) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t2 (col1 char(30)) engine='MYISAM' partition by list(instr(col1,'acb')) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t3 (col1 char(30)) engine='MYISAM' partition by hash(instr(col1,'acb')); +Got one of the listed errors create table t4 (colint int, col1 char(30)) engine='MYISAM' partition by range(colint) subpartition by hash(instr(col1,'acb')) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t5 (colint int, col1 char(30)) engine='MYISAM' partition by list(colint) subpartition by hash(instr(col1,'acb')) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t6 (colint int, col1 char(30)) engine='MYISAM' partition by range(colint) (partition p0 values less than (instr('i','a,b,c,d,e,f,g,h,i')), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t11 ; drop table if exists t22 ; drop table if exists t33 ; @@ -1085,28 +1431,34 @@ alter table t11 partition by range(instr(col1,'acb')) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t22 partition by list(instr(col1,'acb')) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t33 partition by hash(instr(col1,'acb')); +Got one of the listed errors alter table t44 partition by range(colint) subpartition by hash(instr(col1,'acb')) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t55 partition by list(colint) subpartition by hash(instr(col1,'acb')) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t66 partition by range(colint) (partition p0 values less than (instr('i','a,b,c,d,e,f,g,h,i')), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -1122,7 +1474,7 @@ drop table if exists t66 ; ------------------------------------------------------------------------- --- length(col1) in partition with coltype int ------------------------------------------------------------------------- -must all fail! (delete 0 and comment char, if bug fixed) +must all fail! drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -1133,28 +1485,34 @@ create table t1 (col1 int) engine='MYISAM' partition by range(length(col1)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t2 (col1 int) engine='MYISAM' partition by list(length(col1)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t3 (col1 int) engine='MYISAM' partition by hash(length(col1)); +Got one of the listed errors create table t4 (colint int, col1 int) engine='MYISAM' partition by range(colint) subpartition by hash(length(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t5 (colint int, col1 int) engine='MYISAM' partition by list(colint) subpartition by hash(length(col1)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t6 (colint int, col1 int) engine='MYISAM' partition by range(colint) (partition p0 values less than (length('a,b,c,d,e,f,g,h,i')), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t11 ; drop table if exists t22 ; drop table if exists t33 ; @@ -1171,28 +1529,34 @@ alter table t11 partition by range(length(col1)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t22 partition by list(length(col1)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t33 partition by hash(length(col1)); +Got one of the listed errors alter table t44 partition by range(colint) subpartition by hash(length(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t55 partition by list(colint) subpartition by hash(length(col1)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t66 partition by range(colint) (partition p0 values less than (length('a,b,c,d,e,f,g,h,i')), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -1208,7 +1572,7 @@ drop table if exists t66 ; ------------------------------------------------------------------------- --- locate('a',col1) in partition with coltype int ------------------------------------------------------------------------- -must all fail! (delete 0 and comment char, if bug fixed) +must all fail! drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -1219,28 +1583,34 @@ create table t1 (col1 int) engine='MYISAM' partition by range(locate('a',col1)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t2 (col1 int) engine='MYISAM' partition by list(locate('a',col1)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t3 (col1 int) engine='MYISAM' partition by hash(locate('a',col1)); +Got one of the listed errors create table t4 (colint int, col1 int) engine='MYISAM' partition by range(colint) subpartition by hash(locate('a',col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t5 (colint int, col1 int) engine='MYISAM' partition by list(colint) subpartition by hash(locate('a',col1)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t6 (colint int, col1 int) engine='MYISAM' partition by range(colint) (partition p0 values less than (locate('i','a,b,c,d,e,f,g,h,i')), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t11 ; drop table if exists t22 ; drop table if exists t33 ; @@ -1257,28 +1627,34 @@ alter table t11 partition by range(locate('a',col1)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t22 partition by list(locate('a',col1)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t33 partition by hash(locate('a',col1)); +Got one of the listed errors alter table t44 partition by range(colint) subpartition by hash(locate('a',col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t55 partition by list(colint) subpartition by hash(locate('a',col1)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t66 partition by range(colint) (partition p0 values less than (locate('i','a,b,c,d,e,f,g,h,i')), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -1294,7 +1670,7 @@ drop table if exists t66 ; ------------------------------------------------------------------------- --- locate('a',col1) in partition with coltype char(30) ------------------------------------------------------------------------- -must all fail! (delete 0 and comment char, if bug fixed) +must all fail! drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -1305,28 +1681,34 @@ create table t1 (col1 char(30)) engine='MYISAM' partition by range(locate('a',col1)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t2 (col1 char(30)) engine='MYISAM' partition by list(locate('a',col1)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t3 (col1 char(30)) engine='MYISAM' partition by hash(locate('a',col1)); +Got one of the listed errors create table t4 (colint int, col1 char(30)) engine='MYISAM' partition by range(colint) subpartition by hash(locate('a',col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t5 (colint int, col1 char(30)) engine='MYISAM' partition by list(colint) subpartition by hash(locate('a',col1)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t6 (colint int, col1 char(30)) engine='MYISAM' partition by range(colint) (partition p0 values less than (locate('i','a,b,c,d,e,f,g,h,i')), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t11 ; drop table if exists t22 ; drop table if exists t33 ; @@ -1343,28 +1725,34 @@ alter table t11 partition by range(locate('a',col1)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t22 partition by list(locate('a',col1)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t33 partition by hash(locate('a',col1)); +Got one of the listed errors alter table t44 partition by range(colint) subpartition by hash(locate('a',col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t55 partition by list(colint) subpartition by hash(locate('a',col1)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t66 partition by range(colint) (partition p0 values less than (locate('i','a,b,c,d,e,f,g,h,i')), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -1380,7 +1768,7 @@ drop table if exists t66 ; ------------------------------------------------------------------------- --- octet_length(col1) in partition with coltype char(30) ------------------------------------------------------------------------- -must all fail! (delete 0 and comment char, if bug fixed) +must all fail! drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -1391,28 +1779,34 @@ create table t1 (col1 char(30)) engine='MYISAM' partition by range(octet_length(col1)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t2 (col1 char(30)) engine='MYISAM' partition by list(octet_length(col1)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t3 (col1 char(30)) engine='MYISAM' partition by hash(octet_length(col1)); +Got one of the listed errors create table t4 (colint int, col1 char(30)) engine='MYISAM' partition by range(colint) subpartition by hash(octet_length(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t5 (colint int, col1 char(30)) engine='MYISAM' partition by list(colint) subpartition by hash(octet_length(col1)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t6 (colint int, col1 char(30)) engine='MYISAM' partition by range(colint) (partition p0 values less than (octet_length('a,b,c,d,e,f,g,h,i')), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t11 ; drop table if exists t22 ; drop table if exists t33 ; @@ -1429,28 +1823,34 @@ alter table t11 partition by range(octet_length(col1)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t22 partition by list(octet_length(col1)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t33 partition by hash(octet_length(col1)); +Got one of the listed errors alter table t44 partition by range(colint) subpartition by hash(octet_length(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t55 partition by list(colint) subpartition by hash(octet_length(col1)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t66 partition by range(colint) (partition p0 values less than (octet_length('a,b,c,d,e,f,g,h,i')), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -1466,7 +1866,7 @@ drop table if exists t66 ; ------------------------------------------------------------------------- --- position('a' in col1) in partition with coltype int ------------------------------------------------------------------------- -must all fail! (delete 0 and comment char, if bug fixed) +must all fail! drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -1477,28 +1877,34 @@ create table t1 (col1 int) engine='MYISAM' partition by range(position('a' in col1)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t2 (col1 int) engine='MYISAM' partition by list(position('a' in col1)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t3 (col1 int) engine='MYISAM' partition by hash(position('a' in col1)); +Got one of the listed errors create table t4 (colint int, col1 int) engine='MYISAM' partition by range(colint) subpartition by hash(position('a' in col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t5 (colint int, col1 int) engine='MYISAM' partition by list(colint) subpartition by hash(position('a' in col1)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t6 (colint int, col1 int) engine='MYISAM' partition by range(colint) (partition p0 values less than (position('i' in 'a,b,c,d,e,f,g,h,i')), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t11 ; drop table if exists t22 ; drop table if exists t33 ; @@ -1515,28 +1921,34 @@ alter table t11 partition by range(position('a' in col1)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t22 partition by list(position('a' in col1)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t33 partition by hash(position('a' in col1)); +Got one of the listed errors alter table t44 partition by range(colint) subpartition by hash(position('a' in col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t55 partition by list(colint) subpartition by hash(position('a' in col1)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t66 partition by range(colint) (partition p0 values less than (position('i' in 'a,b,c,d,e,f,g,h,i')), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -1552,7 +1964,7 @@ drop table if exists t66 ; ------------------------------------------------------------------------- --- position('a' in col1) in partition with coltype char(30) ------------------------------------------------------------------------- -must all fail! (delete 0 and comment char, if bug fixed) +must all fail! drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -1563,28 +1975,34 @@ create table t1 (col1 char(30)) engine='MYISAM' partition by range(position('a' in col1)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t2 (col1 char(30)) engine='MYISAM' partition by list(position('a' in col1)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t3 (col1 char(30)) engine='MYISAM' partition by hash(position('a' in col1)); +Got one of the listed errors create table t4 (colint int, col1 char(30)) engine='MYISAM' partition by range(colint) subpartition by hash(position('a' in col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t5 (colint int, col1 char(30)) engine='MYISAM' partition by list(colint) subpartition by hash(position('a' in col1)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t6 (colint int, col1 char(30)) engine='MYISAM' partition by range(colint) (partition p0 values less than (position('i' in 'a,b,c,d,e,f,g,h,i')), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t11 ; drop table if exists t22 ; drop table if exists t33 ; @@ -1601,28 +2019,34 @@ alter table t11 partition by range(position('a' in col1)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t22 partition by list(position('a' in col1)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t33 partition by hash(position('a' in col1)); +Got one of the listed errors alter table t44 partition by range(colint) subpartition by hash(position('a' in col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t55 partition by list(colint) subpartition by hash(position('a' in col1)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t66 partition by range(colint) (partition p0 values less than (position('i' in 'a,b,c,d,e,f,g,h,i')), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -1638,7 +2062,7 @@ drop table if exists t66 ; ------------------------------------------------------------------------- --- strcmp(col1,'acb') in partition with coltype int ------------------------------------------------------------------------- -must all fail! (delete 0 and comment char, if bug fixed) +must all fail! drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -1649,28 +2073,34 @@ create table t1 (col1 int) engine='MYISAM' partition by range(strcmp(col1,'acb')) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t2 (col1 int) engine='MYISAM' partition by list(strcmp(col1,'acb')) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t3 (col1 int) engine='MYISAM' partition by hash(strcmp(col1,'acb')); +Got one of the listed errors create table t4 (colint int, col1 int) engine='MYISAM' partition by range(colint) subpartition by hash(strcmp(col1,'acb')) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t5 (colint int, col1 int) engine='MYISAM' partition by list(colint) subpartition by hash(strcmp(col1,'acb')) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t6 (colint int, col1 int) engine='MYISAM' partition by range(colint) (partition p0 values less than (strcmp('i','a,b,c,d,e,f,g,h,i')), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t11 ; drop table if exists t22 ; drop table if exists t33 ; @@ -1687,28 +2117,34 @@ alter table t11 partition by range(strcmp(col1,'acb')) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t22 partition by list(strcmp(col1,'acb')) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t33 partition by hash(strcmp(col1,'acb')); +Got one of the listed errors alter table t44 partition by range(colint) subpartition by hash(strcmp(col1,'acb')) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t55 partition by list(colint) subpartition by hash(strcmp(col1,'acb')) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t66 partition by range(colint) (partition p0 values less than (strcmp('i','a,b,c,d,e,f,g,h,i')), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -1724,7 +2160,7 @@ drop table if exists t66 ; ------------------------------------------------------------------------- --- strcmp(col1,'acb') in partition with coltype char(30) ------------------------------------------------------------------------- -must all fail! (delete 0 and comment char, if bug fixed) +must all fail! drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -1735,28 +2171,34 @@ create table t1 (col1 char(30)) engine='MYISAM' partition by range(strcmp(col1,'acb')) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t2 (col1 char(30)) engine='MYISAM' partition by list(strcmp(col1,'acb')) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t3 (col1 char(30)) engine='MYISAM' partition by hash(strcmp(col1,'acb')); +Got one of the listed errors create table t4 (colint int, col1 char(30)) engine='MYISAM' partition by range(colint) subpartition by hash(strcmp(col1,'acb')) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t5 (colint int, col1 char(30)) engine='MYISAM' partition by list(colint) subpartition by hash(strcmp(col1,'acb')) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t6 (colint int, col1 char(30)) engine='MYISAM' partition by range(colint) (partition p0 values less than (strcmp('i','a,b,c,d,e,f,g,h,i')), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t11 ; drop table if exists t22 ; drop table if exists t33 ; @@ -1773,28 +2215,34 @@ alter table t11 partition by range(strcmp(col1,'acb')) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t22 partition by list(strcmp(col1,'acb')) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t33 partition by hash(strcmp(col1,'acb')); +Got one of the listed errors alter table t44 partition by range(colint) subpartition by hash(strcmp(col1,'acb')) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t55 partition by list(colint) subpartition by hash(strcmp(col1,'acb')) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t66 partition by range(colint) (partition p0 values less than (strcmp('i','a,b,c,d,e,f,g,h,i')), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -1810,7 +2258,7 @@ drop table if exists t66 ; ------------------------------------------------------------------------- --- crc32(col1) in partition with coltype char(30) ------------------------------------------------------------------------- -must all fail! (delete 0 and comment char, if bug fixed) +must all fail! drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -1821,28 +2269,34 @@ create table t1 (col1 char(30)) engine='MYISAM' partition by range(crc32(col1)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t2 (col1 char(30)) engine='MYISAM' partition by list(crc32(col1)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t3 (col1 char(30)) engine='MYISAM' partition by hash(crc32(col1)); +Got one of the listed errors create table t4 (colint int, col1 char(30)) engine='MYISAM' partition by range(colint) subpartition by hash(crc32(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t5 (colint int, col1 char(30)) engine='MYISAM' partition by list(colint) subpartition by hash(crc32(col1)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t6 (colint int, col1 char(30)) engine='MYISAM' partition by range(colint) (partition p0 values less than (crc32('a,b,c,d,e,f,g,h,i')), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t11 ; drop table if exists t22 ; drop table if exists t33 ; @@ -1859,28 +2313,34 @@ alter table t11 partition by range(crc32(col1)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t22 partition by list(crc32(col1)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t33 partition by hash(crc32(col1)); +Got one of the listed errors alter table t44 partition by range(colint) subpartition by hash(crc32(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t55 partition by list(colint) subpartition by hash(crc32(col1)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t66 partition by range(colint) (partition p0 values less than (crc32('a,b,c,d,e,f,g,h,i')), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -1896,7 +2356,7 @@ drop table if exists t66 ; ------------------------------------------------------------------------- --- round(col1) in partition with coltype int ------------------------------------------------------------------------- -must all fail! (delete 0 and comment char, if bug fixed) +must all fail! drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -1907,28 +2367,34 @@ create table t1 (col1 int) engine='MYISAM' partition by range(round(col1)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t2 (col1 int) engine='MYISAM' partition by list(round(col1)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t3 (col1 int) engine='MYISAM' partition by hash(round(col1)); +Got one of the listed errors create table t4 (colint int, col1 int) engine='MYISAM' partition by range(colint) subpartition by hash(round(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t5 (colint int, col1 int) engine='MYISAM' partition by list(colint) subpartition by hash(round(col1)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t6 (colint int, col1 int) engine='MYISAM' partition by range(colint) (partition p0 values less than (round(15)), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t11 ; drop table if exists t22 ; drop table if exists t33 ; @@ -1945,28 +2411,34 @@ alter table t11 partition by range(round(col1)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t22 partition by list(round(col1)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t33 partition by hash(round(col1)); +Got one of the listed errors alter table t44 partition by range(colint) subpartition by hash(round(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t55 partition by list(colint) subpartition by hash(round(col1)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t66 partition by range(colint) (partition p0 values less than (round(15)), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -1982,7 +2454,7 @@ drop table if exists t66 ; ------------------------------------------------------------------------- --- sign(col1) in partition with coltype int ------------------------------------------------------------------------- -must all fail! (delete 0 and comment char, if bug fixed) +must all fail! drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -1993,28 +2465,34 @@ create table t1 (col1 int) engine='MYISAM' partition by range(sign(col1)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t2 (col1 int) engine='MYISAM' partition by list(sign(col1)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t3 (col1 int) engine='MYISAM' partition by hash(sign(col1)); +Got one of the listed errors create table t4 (colint int, col1 int) engine='MYISAM' partition by range(colint) subpartition by hash(sign(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t5 (colint int, col1 int) engine='MYISAM' partition by list(colint) subpartition by hash(sign(col1)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t6 (colint int, col1 int) engine='MYISAM' partition by range(colint) (partition p0 values less than (sign(123)), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t11 ; drop table if exists t22 ; drop table if exists t33 ; @@ -2031,114 +2509,34 @@ alter table t11 partition by range(sign(col1)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t22 partition by list(sign(col1)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t33 partition by hash(sign(col1)); +Got one of the listed errors alter table t44 partition by range(colint) subpartition by hash(sign(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t55 partition by list(colint) subpartition by hash(sign(col1)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t66 partition by range(colint) (partition p0 values less than (sign(123)), partition p1 values less than maxvalue); -drop table if exists t1 ; -drop table if exists t2 ; -drop table if exists t3 ; -drop table if exists t4 ; -drop table if exists t5 ; -drop table if exists t6 ; -drop table if exists t11 ; -drop table if exists t22 ; -drop table if exists t33 ; -drop table if exists t44 ; -drop table if exists t55 ; -drop table if exists t66 ; -------------------------------------------------------------------------- ---- datediff(col1,col1) in partition with coltype datetime -------------------------------------------------------------------------- -must all fail! (delete 0 and comment char, if bug fixed) -drop table if exists t1 ; -drop table if exists t2 ; -drop table if exists t3 ; -drop table if exists t4 ; -drop table if exists t5 ; -drop table if exists t6 ; -create table t1 (col1 datetime) engine='MYISAM' -partition by range(datediff(col1,col1)) -(partition p0 values less than (15), -partition p1 values less than (31)); -create table t2 (col1 datetime) engine='MYISAM' -partition by list(datediff(col1,col1)) -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30)); -create table t3 (col1 datetime) engine='MYISAM' -partition by hash(datediff(col1,col1)); -create table t4 (colint int, col1 datetime) engine='MYISAM' -partition by range(colint) -subpartition by hash(datediff(col1,col1)) subpartitions 2 -(partition p0 values less than (15), -partition p1 values less than (31)); -create table t5 (colint int, col1 datetime) engine='MYISAM' -partition by list(colint) -subpartition by hash(datediff(col1,col1)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30)); -create table t6 (colint int, col1 datetime) engine='MYISAM' -partition by range(colint) -(partition p0 values less than (datediff('1997-11-30 23:59:59','1997-12-31')), -partition p1 values less than maxvalue); -drop table if exists t11 ; -drop table if exists t22 ; -drop table if exists t33 ; -drop table if exists t44 ; -drop table if exists t55 ; -drop table if exists t66 ; -create table t11 (col1 datetime) engine='MYISAM' ; -create table t22 (col1 datetime) engine='MYISAM' ; -create table t33 (col1 datetime) engine='MYISAM' ; -create table t44 (colint int, col1 datetime) engine='MYISAM' ; -create table t55 (colint int, col1 datetime) engine='MYISAM' ; -create table t66 (colint int, col1 datetime) engine='MYISAM' ; -alter table t11 -partition by range(datediff(col1,col1)) -(partition p0 values less than (15), -partition p1 values less than (31)); -alter table t22 -partition by list(datediff(col1,col1)) -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30)); -alter table t33 -partition by hash(datediff(col1,col1)); -alter table t44 -partition by range(colint) -subpartition by hash(datediff(col1,col1)) subpartitions 2 -(partition p0 values less than (15), -partition p1 values less than (31)); -alter table t55 -partition by list(colint) -subpartition by hash(datediff(col1,col1)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30)); -alter table t66 -partition by range(colint) -(partition p0 values less than (datediff('1997-11-30 23:59:59','1997-12-31')), -partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -2154,7 +2552,7 @@ drop table if exists t66 ; ------------------------------------------------------------------------- --- period_add(col1,5) in partition with coltype datetime ------------------------------------------------------------------------- -must all fail! (delete 0 and comment char, if bug fixed) +must all fail! drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -2165,28 +2563,34 @@ create table t1 (col1 datetime) engine='MYISAM' partition by range(period_add(col1,5)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t2 (col1 datetime) engine='MYISAM' partition by list(period_add(col1,5)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t3 (col1 datetime) engine='MYISAM' partition by hash(period_add(col1,5)); +Got one of the listed errors create table t4 (colint int, col1 datetime) engine='MYISAM' partition by range(colint) subpartition by hash(period_add(col1,5)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t5 (colint int, col1 datetime) engine='MYISAM' partition by list(colint) subpartition by hash(period_add(col1,5)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t6 (colint int, col1 datetime) engine='MYISAM' partition by range(colint) (partition p0 values less than (period_add(9804,5)), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t11 ; drop table if exists t22 ; drop table if exists t33 ; @@ -2203,28 +2607,34 @@ alter table t11 partition by range(period_add(col1,5)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t22 partition by list(period_add(col1,5)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t33 partition by hash(period_add(col1,5)); +Got one of the listed errors alter table t44 partition by range(colint) subpartition by hash(period_add(col1,5)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t55 partition by list(colint) subpartition by hash(period_add(col1,5)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t66 partition by range(colint) (partition p0 values less than (period_add(9804,5)), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -2240,7 +2650,7 @@ drop table if exists t66 ; ------------------------------------------------------------------------- --- period_diff(col1,col2) in partition with coltype datetime,col2 datetime ------------------------------------------------------------------------- -must all fail! (delete 0 and comment char, if bug fixed) +must all fail! drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -2251,28 +2661,34 @@ create table t1 (col1 datetime,col2 datetime) engine='MYISAM' partition by range(period_diff(col1,col2)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t2 (col1 datetime,col2 datetime) engine='MYISAM' partition by list(period_diff(col1,col2)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t3 (col1 datetime,col2 datetime) engine='MYISAM' partition by hash(period_diff(col1,col2)); +Got one of the listed errors create table t4 (colint int, col1 datetime,col2 datetime) engine='MYISAM' partition by range(colint) subpartition by hash(period_diff(col1,col2)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t5 (colint int, col1 datetime,col2 datetime) engine='MYISAM' partition by list(colint) subpartition by hash(period_diff(col1,col2)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t6 (colint int, col1 datetime,col2 datetime) engine='MYISAM' partition by range(colint) (partition p0 values less than (period_diff(9809,199907)), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t11 ; drop table if exists t22 ; drop table if exists t33 ; @@ -2289,28 +2705,34 @@ alter table t11 partition by range(period_diff(col1,col2)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t22 partition by list(period_diff(col1,col2)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t33 partition by hash(period_diff(col1,col2)); +Got one of the listed errors alter table t44 partition by range(colint) subpartition by hash(period_diff(col1,col2)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t55 partition by list(colint) subpartition by hash(period_diff(col1,col2)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t66 partition by range(colint) (partition p0 values less than (period_diff(9809,199907)), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -2326,7 +2748,7 @@ drop table if exists t66 ; ------------------------------------------------------------------------- --- period_diff(col1,col2) in partition with coltype int,col2 int ------------------------------------------------------------------------- -must all fail! (delete 0 and comment char, if bug fixed) +must all fail! drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -2337,28 +2759,34 @@ create table t1 (col1 int,col2 int) engine='MYISAM' partition by range(period_diff(col1,col2)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t2 (col1 int,col2 int) engine='MYISAM' partition by list(period_diff(col1,col2)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t3 (col1 int,col2 int) engine='MYISAM' partition by hash(period_diff(col1,col2)); +Got one of the listed errors create table t4 (colint int, col1 int,col2 int) engine='MYISAM' partition by range(colint) subpartition by hash(period_diff(col1,col2)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t5 (colint int, col1 int,col2 int) engine='MYISAM' partition by list(colint) subpartition by hash(period_diff(col1,col2)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t6 (colint int, col1 int,col2 int) engine='MYISAM' partition by range(colint) (partition p0 values less than (period_diff(9809,199907)), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t11 ; drop table if exists t22 ; drop table if exists t33 ; @@ -2375,28 +2803,34 @@ alter table t11 partition by range(period_diff(col1,col2)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t22 partition by list(period_diff(col1,col2)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t33 partition by hash(period_diff(col1,col2)); +Got one of the listed errors alter table t44 partition by range(colint) subpartition by hash(period_diff(col1,col2)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t55 partition by list(colint) subpartition by hash(period_diff(col1,col2)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t66 partition by range(colint) (partition p0 values less than (period_diff(9809,199907)), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -2412,7 +2846,7 @@ drop table if exists t66 ; ------------------------------------------------------------------------- --- timestampdiff(day,5,col1) in partition with coltype datetime ------------------------------------------------------------------------- -must all fail! (delete 0 and comment char, if bug fixed) +must all fail! drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -2423,28 +2857,34 @@ create table t1 (col1 datetime) engine='MYISAM' partition by range(timestampdiff(day,5,col1)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t2 (col1 datetime) engine='MYISAM' partition by list(timestampdiff(day,5,col1)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t3 (col1 datetime) engine='MYISAM' partition by hash(timestampdiff(day,5,col1)); +Got one of the listed errors create table t4 (colint int, col1 datetime) engine='MYISAM' partition by range(colint) subpartition by hash(timestampdiff(day,5,col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t5 (colint int, col1 datetime) engine='MYISAM' partition by list(colint) subpartition by hash(timestampdiff(day,5,col1)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t6 (colint int, col1 datetime) engine='MYISAM' partition by range(colint) (partition p0 values less than (timestampdiff(YEAR,'2002-05-01','2001-01-01')), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t11 ; drop table if exists t22 ; drop table if exists t33 ; @@ -2461,28 +2901,34 @@ alter table t11 partition by range(timestampdiff(day,5,col1)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t22 partition by list(timestampdiff(day,5,col1)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t33 partition by hash(timestampdiff(day,5,col1)); +Got one of the listed errors alter table t44 partition by range(colint) subpartition by hash(timestampdiff(day,5,col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t55 partition by list(colint) subpartition by hash(timestampdiff(day,5,col1)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t66 partition by range(colint) (partition p0 values less than (timestampdiff(YEAR,'2002-05-01','2001-01-01')), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -2498,7 +2944,7 @@ drop table if exists t66 ; ------------------------------------------------------------------------- --- unix_timestamp(col1) in partition with coltype date ------------------------------------------------------------------------- -must all fail! (delete 0 and comment char, if bug fixed) +must all fail! drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -2509,28 +2955,34 @@ create table t1 (col1 date) engine='MYISAM' partition by range(unix_timestamp(col1)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t2 (col1 date) engine='MYISAM' partition by list(unix_timestamp(col1)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t3 (col1 date) engine='MYISAM' partition by hash(unix_timestamp(col1)); +Got one of the listed errors create table t4 (colint int, col1 date) engine='MYISAM' partition by range(colint) subpartition by hash(unix_timestamp(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t5 (colint int, col1 date) engine='MYISAM' partition by list(colint) subpartition by hash(unix_timestamp(col1)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t6 (colint int, col1 date) engine='MYISAM' partition by range(colint) (partition p0 values less than (unix_timestamp ('2002-05-01')), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t11 ; drop table if exists t22 ; drop table if exists t33 ; @@ -2547,28 +2999,34 @@ alter table t11 partition by range(unix_timestamp(col1)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t22 partition by list(unix_timestamp(col1)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t33 partition by hash(unix_timestamp(col1)); +Got one of the listed errors alter table t44 partition by range(colint) subpartition by hash(unix_timestamp(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t55 partition by list(colint) subpartition by hash(unix_timestamp(col1)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t66 partition by range(colint) (partition p0 values less than (unix_timestamp ('2002-05-01')), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -2584,7 +3042,7 @@ drop table if exists t66 ; ------------------------------------------------------------------------- --- week(col1) in partition with coltype datetime ------------------------------------------------------------------------- -must all fail! (delete 0 and comment char, if bug fixed) +must all fail! drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -2595,28 +3053,34 @@ create table t1 (col1 datetime) engine='MYISAM' partition by range(week(col1)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t2 (col1 datetime) engine='MYISAM' partition by list(week(col1)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t3 (col1 datetime) engine='MYISAM' partition by hash(week(col1)); +Got one of the listed errors create table t4 (colint int, col1 datetime) engine='MYISAM' partition by range(colint) subpartition by hash(week(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t5 (colint int, col1 datetime) engine='MYISAM' partition by list(colint) subpartition by hash(week(col1)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t6 (colint int, col1 datetime) engine='MYISAM' partition by range(colint) (partition p0 values less than (week('2002-05-01')), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t11 ; drop table if exists t22 ; drop table if exists t33 ; @@ -2633,28 +3097,132 @@ alter table t11 partition by range(week(col1)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t22 partition by list(week(col1)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t33 partition by hash(week(col1)); +Got one of the listed errors alter table t44 partition by range(colint) subpartition by hash(week(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t55 partition by list(colint) subpartition by hash(week(col1)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t66 partition by range(colint) (partition p0 values less than (week('2002-05-01')), partition p1 values less than maxvalue); +Got one of the listed errors +drop table if exists t1 ; +drop table if exists t2 ; +drop table if exists t3 ; +drop table if exists t4 ; +drop table if exists t5 ; +drop table if exists t6 ; +drop table if exists t11 ; +drop table if exists t22 ; +drop table if exists t33 ; +drop table if exists t44 ; +drop table if exists t55 ; +drop table if exists t66 ; +------------------------------------------------------------------------- +--- weekofyear(col1) in partition with coltype datetime +------------------------------------------------------------------------- +must all fail! +drop table if exists t1 ; +drop table if exists t2 ; +drop table if exists t3 ; +drop table if exists t4 ; +drop table if exists t5 ; +drop table if exists t6 ; +create table t1 (col1 datetime) engine='MYISAM' +partition by range(weekofyear(col1)) +(partition p0 values less than (15), +partition p1 values less than (31)); +Got one of the listed errors +create table t2 (col1 datetime) engine='MYISAM' +partition by list(weekofyear(col1)) +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors +create table t3 (col1 datetime) engine='MYISAM' +partition by hash(weekofyear(col1)); +Got one of the listed errors +create table t4 (colint int, col1 datetime) engine='MYISAM' +partition by range(colint) +subpartition by hash(weekofyear(col1)) subpartitions 2 +(partition p0 values less than (15), +partition p1 values less than (31)); +Got one of the listed errors +create table t5 (colint int, col1 datetime) engine='MYISAM' +partition by list(colint) +subpartition by hash(weekofyear(col1)) subpartitions 2 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors +create table t6 (colint int, col1 datetime) engine='MYISAM' +partition by range(colint) +(partition p0 values less than (weekofyear('2002-05-01')), +partition p1 values less than maxvalue); +Got one of the listed errors +drop table if exists t11 ; +drop table if exists t22 ; +drop table if exists t33 ; +drop table if exists t44 ; +drop table if exists t55 ; +drop table if exists t66 ; +create table t11 (col1 datetime) engine='MYISAM' ; +create table t22 (col1 datetime) engine='MYISAM' ; +create table t33 (col1 datetime) engine='MYISAM' ; +create table t44 (colint int, col1 datetime) engine='MYISAM' ; +create table t55 (colint int, col1 datetime) engine='MYISAM' ; +create table t66 (colint int, col1 datetime) engine='MYISAM' ; +alter table t11 +partition by range(weekofyear(col1)) +(partition p0 values less than (15), +partition p1 values less than (31)); +Got one of the listed errors +alter table t22 +partition by list(weekofyear(col1)) +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors +alter table t33 +partition by hash(weekofyear(col1)); +Got one of the listed errors +alter table t44 +partition by range(colint) +subpartition by hash(weekofyear(col1)) subpartitions 2 +(partition p0 values less than (15), +partition p1 values less than (31)); +Got one of the listed errors +alter table t55 +partition by list(colint) +subpartition by hash(weekofyear(col1)) subpartitions 2 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors +alter table t66 +partition by range(colint) +(partition p0 values less than (weekofyear('2002-05-01')), +partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -2670,7 +3238,7 @@ drop table if exists t66 ; ------------------------------------------------------------------------- --- cast(col1 as signed) in partition with coltype varchar(30) ------------------------------------------------------------------------- -must all fail! (delete 0 and comment char, if bug fixed) +must all fail! drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -2681,28 +3249,34 @@ create table t1 (col1 varchar(30)) engine='MYISAM' partition by range(cast(col1 as signed)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t2 (col1 varchar(30)) engine='MYISAM' partition by list(cast(col1 as signed)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t3 (col1 varchar(30)) engine='MYISAM' partition by hash(cast(col1 as signed)); +Got one of the listed errors create table t4 (colint int, col1 varchar(30)) engine='MYISAM' partition by range(colint) subpartition by hash(cast(col1 as signed)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t5 (colint int, col1 varchar(30)) engine='MYISAM' partition by list(colint) subpartition by hash(cast(col1 as signed)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t6 (colint int, col1 varchar(30)) engine='MYISAM' partition by range(colint) (partition p0 values less than (cast(123 as signed)), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t11 ; drop table if exists t22 ; drop table if exists t33 ; @@ -2719,28 +3293,34 @@ alter table t11 partition by range(cast(col1 as signed)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t22 partition by list(cast(col1 as signed)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t33 partition by hash(cast(col1 as signed)); +Got one of the listed errors alter table t44 partition by range(colint) subpartition by hash(cast(col1 as signed)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t55 partition by list(colint) subpartition by hash(cast(col1 as signed)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t66 partition by range(colint) (partition p0 values less than (cast(123 as signed)), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -2756,7 +3336,7 @@ drop table if exists t66 ; ------------------------------------------------------------------------- --- convert(col1,unsigned) in partition with coltype varchar(30) ------------------------------------------------------------------------- -must all fail! (delete 0 and comment char, if bug fixed) +must all fail! drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -2767,28 +3347,34 @@ create table t1 (col1 varchar(30)) engine='MYISAM' partition by range(convert(col1,unsigned)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t2 (col1 varchar(30)) engine='MYISAM' partition by list(convert(col1,unsigned)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t3 (col1 varchar(30)) engine='MYISAM' partition by hash(convert(col1,unsigned)); +Got one of the listed errors create table t4 (colint int, col1 varchar(30)) engine='MYISAM' partition by range(colint) subpartition by hash(convert(col1,unsigned)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t5 (colint int, col1 varchar(30)) engine='MYISAM' partition by list(colint) subpartition by hash(convert(col1,unsigned)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t6 (colint int, col1 varchar(30)) engine='MYISAM' partition by range(colint) (partition p0 values less than (convert(123,unsigned)), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t11 ; drop table if exists t22 ; drop table if exists t33 ; @@ -2805,28 +3391,34 @@ alter table t11 partition by range(convert(col1,unsigned)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t22 partition by list(convert(col1,unsigned)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t33 partition by hash(convert(col1,unsigned)); +Got one of the listed errors alter table t44 partition by range(colint) subpartition by hash(convert(col1,unsigned)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t55 partition by list(colint) subpartition by hash(convert(col1,unsigned)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t66 partition by range(colint) (partition p0 values less than (convert(123,unsigned)), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -2842,7 +3434,7 @@ drop table if exists t66 ; ------------------------------------------------------------------------- --- col1 | 20 in partition with coltype int ------------------------------------------------------------------------- -must all fail! (delete 0 and comment char, if bug fixed) +must all fail! drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -2853,28 +3445,34 @@ create table t1 (col1 int) engine='MYISAM' partition by range(col1 | 20) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t2 (col1 int) engine='MYISAM' partition by list(col1 | 20) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t3 (col1 int) engine='MYISAM' partition by hash(col1 | 20); +Got one of the listed errors create table t4 (colint int, col1 int) engine='MYISAM' partition by range(colint) subpartition by hash(col1 | 20) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t5 (colint int, col1 int) engine='MYISAM' partition by list(colint) subpartition by hash(col1 | 20) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t6 (colint int, col1 int) engine='MYISAM' partition by range(colint) (partition p0 values less than (10 | 20), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t11 ; drop table if exists t22 ; drop table if exists t33 ; @@ -2891,28 +3489,34 @@ alter table t11 partition by range(col1 | 20) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t22 partition by list(col1 | 20) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t33 partition by hash(col1 | 20); +Got one of the listed errors alter table t44 partition by range(colint) subpartition by hash(col1 | 20) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t55 partition by list(colint) subpartition by hash(col1 | 20) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t66 partition by range(colint) (partition p0 values less than (10 | 20), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -2928,7 +3532,7 @@ drop table if exists t66 ; ------------------------------------------------------------------------- --- col1 & 20 in partition with coltype int ------------------------------------------------------------------------- -must all fail! (delete 0 and comment char, if bug fixed) +must all fail! drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -2939,28 +3543,34 @@ create table t1 (col1 int) engine='MYISAM' partition by range(col1 & 20) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t2 (col1 int) engine='MYISAM' partition by list(col1 & 20) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t3 (col1 int) engine='MYISAM' partition by hash(col1 & 20); +Got one of the listed errors create table t4 (colint int, col1 int) engine='MYISAM' partition by range(colint) subpartition by hash(col1 & 20) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t5 (colint int, col1 int) engine='MYISAM' partition by list(colint) subpartition by hash(col1 & 20) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t6 (colint int, col1 int) engine='MYISAM' partition by range(colint) (partition p0 values less than (10 & 20), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t11 ; drop table if exists t22 ; drop table if exists t33 ; @@ -2977,28 +3587,34 @@ alter table t11 partition by range(col1 & 20) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t22 partition by list(col1 & 20) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t33 partition by hash(col1 & 20); +Got one of the listed errors alter table t44 partition by range(colint) subpartition by hash(col1 & 20) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t55 partition by list(colint) subpartition by hash(col1 & 20) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t66 partition by range(colint) (partition p0 values less than (10 & 20), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -3014,7 +3630,7 @@ drop table if exists t66 ; ------------------------------------------------------------------------- --- col1 ^ 20 in partition with coltype int ------------------------------------------------------------------------- -must all fail! (delete 0 and comment char, if bug fixed) +must all fail! drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -3025,28 +3641,34 @@ create table t1 (col1 int) engine='MYISAM' partition by range(col1 ^ 20) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t2 (col1 int) engine='MYISAM' partition by list(col1 ^ 20) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t3 (col1 int) engine='MYISAM' partition by hash(col1 ^ 20); +Got one of the listed errors create table t4 (colint int, col1 int) engine='MYISAM' partition by range(colint) subpartition by hash(col1 ^ 20) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t5 (colint int, col1 int) engine='MYISAM' partition by list(colint) subpartition by hash(col1 ^ 20) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t6 (colint int, col1 int) engine='MYISAM' partition by range(colint) (partition p0 values less than (10 ^ 20), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t11 ; drop table if exists t22 ; drop table if exists t33 ; @@ -3063,28 +3685,34 @@ alter table t11 partition by range(col1 ^ 20) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t22 partition by list(col1 ^ 20) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t33 partition by hash(col1 ^ 20); +Got one of the listed errors alter table t44 partition by range(colint) subpartition by hash(col1 ^ 20) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t55 partition by list(colint) subpartition by hash(col1 ^ 20) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t66 partition by range(colint) (partition p0 values less than (10 ^ 20), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -3100,7 +3728,7 @@ drop table if exists t66 ; ------------------------------------------------------------------------- --- col1 << 20 in partition with coltype int ------------------------------------------------------------------------- -must all fail! (delete 0 and comment char, if bug fixed) +must all fail! drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -3111,28 +3739,34 @@ create table t1 (col1 int) engine='MYISAM' partition by range(col1 << 20) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t2 (col1 int) engine='MYISAM' partition by list(col1 << 20) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t3 (col1 int) engine='MYISAM' partition by hash(col1 << 20); +Got one of the listed errors create table t4 (colint int, col1 int) engine='MYISAM' partition by range(colint) subpartition by hash(col1 << 20) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t5 (colint int, col1 int) engine='MYISAM' partition by list(colint) subpartition by hash(col1 << 20) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t6 (colint int, col1 int) engine='MYISAM' partition by range(colint) (partition p0 values less than (10 << 20), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t11 ; drop table if exists t22 ; drop table if exists t33 ; @@ -3149,28 +3783,34 @@ alter table t11 partition by range(col1 << 20) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t22 partition by list(col1 << 20) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t33 partition by hash(col1 << 20); +Got one of the listed errors alter table t44 partition by range(colint) subpartition by hash(col1 << 20) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t55 partition by list(colint) subpartition by hash(col1 << 20) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t66 partition by range(colint) (partition p0 values less than (10 << 20), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -3186,7 +3826,7 @@ drop table if exists t66 ; ------------------------------------------------------------------------- --- col1 >> 20 in partition with coltype int ------------------------------------------------------------------------- -must all fail! (delete 0 and comment char, if bug fixed) +must all fail! drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -3197,28 +3837,34 @@ create table t1 (col1 int) engine='MYISAM' partition by range(col1 >> 20) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t2 (col1 int) engine='MYISAM' partition by list(col1 >> 20) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t3 (col1 int) engine='MYISAM' partition by hash(col1 >> 20); +Got one of the listed errors create table t4 (colint int, col1 int) engine='MYISAM' partition by range(colint) subpartition by hash(col1 >> 20) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t5 (colint int, col1 int) engine='MYISAM' partition by list(colint) subpartition by hash(col1 >> 20) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t6 (colint int, col1 int) engine='MYISAM' partition by range(colint) (partition p0 values less than (10 >> 20), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t11 ; drop table if exists t22 ; drop table if exists t33 ; @@ -3235,28 +3881,34 @@ alter table t11 partition by range(col1 >> 20) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t22 partition by list(col1 >> 20) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t33 partition by hash(col1 >> 20); +Got one of the listed errors alter table t44 partition by range(colint) subpartition by hash(col1 >> 20) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t55 partition by list(colint) subpartition by hash(col1 >> 20) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t66 partition by range(colint) (partition p0 values less than (10 >> 20), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -3272,7 +3924,7 @@ drop table if exists t66 ; ------------------------------------------------------------------------- --- ~col1 in partition with coltype int ------------------------------------------------------------------------- -must all fail! (delete 0 and comment char, if bug fixed) +must all fail! drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -3283,28 +3935,34 @@ create table t1 (col1 int) engine='MYISAM' partition by range(~col1) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t2 (col1 int) engine='MYISAM' partition by list(~col1) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t3 (col1 int) engine='MYISAM' partition by hash(~col1); +Got one of the listed errors create table t4 (colint int, col1 int) engine='MYISAM' partition by range(colint) subpartition by hash(~col1) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t5 (colint int, col1 int) engine='MYISAM' partition by list(colint) subpartition by hash(~col1) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t6 (colint int, col1 int) engine='MYISAM' partition by range(colint) (partition p0 values less than (~20), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t11 ; drop table if exists t22 ; drop table if exists t33 ; @@ -3321,28 +3979,34 @@ alter table t11 partition by range(~col1) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t22 partition by list(~col1) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t33 partition by hash(~col1); +Got one of the listed errors alter table t44 partition by range(colint) subpartition by hash(~col1) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t55 partition by list(colint) subpartition by hash(~col1) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t66 partition by range(colint) (partition p0 values less than (~20), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -3358,7 +4022,7 @@ drop table if exists t66 ; ------------------------------------------------------------------------- --- bit_count(col1) in partition with coltype int ------------------------------------------------------------------------- -must all fail! (delete 0 and comment char, if bug fixed) +must all fail! drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -3369,28 +4033,34 @@ create table t1 (col1 int) engine='MYISAM' partition by range(bit_count(col1)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t2 (col1 int) engine='MYISAM' partition by list(bit_count(col1)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t3 (col1 int) engine='MYISAM' partition by hash(bit_count(col1)); +Got one of the listed errors create table t4 (colint int, col1 int) engine='MYISAM' partition by range(colint) subpartition by hash(bit_count(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t5 (colint int, col1 int) engine='MYISAM' partition by list(colint) subpartition by hash(bit_count(col1)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t6 (colint int, col1 int) engine='MYISAM' partition by range(colint) (partition p0 values less than (bit_count(20)), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t11 ; drop table if exists t22 ; drop table if exists t33 ; @@ -3407,28 +4077,34 @@ alter table t11 partition by range(bit_count(col1)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t22 partition by list(bit_count(col1)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t33 partition by hash(bit_count(col1)); +Got one of the listed errors alter table t44 partition by range(colint) subpartition by hash(bit_count(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t55 partition by list(colint) subpartition by hash(bit_count(col1)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t66 partition by range(colint) (partition p0 values less than (bit_count(20)), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -3444,7 +4120,7 @@ drop table if exists t66 ; ------------------------------------------------------------------------- --- inet_aton(col1) in partition with coltype int ------------------------------------------------------------------------- -must all fail! (delete 0 and comment char, if bug fixed) +must all fail! drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -3455,28 +4131,34 @@ create table t1 (col1 int) engine='MYISAM' partition by range(inet_aton(col1)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t2 (col1 int) engine='MYISAM' partition by list(inet_aton(col1)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t3 (col1 int) engine='MYISAM' partition by hash(inet_aton(col1)); +Got one of the listed errors create table t4 (colint int, col1 int) engine='MYISAM' partition by range(colint) subpartition by hash(inet_aton(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t5 (colint int, col1 int) engine='MYISAM' partition by list(colint) subpartition by hash(inet_aton(col1)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t6 (colint int, col1 int) engine='MYISAM' partition by range(colint) (partition p0 values less than (inet_aton('192.168.1.1')), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t11 ; drop table if exists t22 ; drop table if exists t33 ; @@ -3493,28 +4175,34 @@ alter table t11 partition by range(inet_aton(col1)) (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t22 partition by list(inet_aton(col1)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t33 partition by hash(inet_aton(col1)); +Got one of the listed errors alter table t44 partition by range(colint) subpartition by hash(inet_aton(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t55 partition by list(colint) subpartition by hash(inet_aton(col1)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t66 partition by range(colint) (partition p0 values less than (inet_aton('192.168.1.1')), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -3531,7 +4219,7 @@ set @var =20; ------------------------------------------------------------------------- --- bit_length(col1)+@var-@var in partition with coltype int ------------------------------------------------------------------------- -must all fail! (delete 0 and comment char, if bug fixed) +must all fail! drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -3542,35 +4230,34 @@ create table t1 (col1 int) engine='MYISAM' partition by range(bit_length(col1)+@var-@var) (partition p0 values less than (15), partition p1 values less than (31)); -ERROR 42000: Constant/Random expression in (sub)partitioning function is not allowed near ') -(partition p0 values less than (15), -partition p1 values less than (31))' at line 2 +Got one of the listed errors create table t2 (col1 int) engine='MYISAM' partition by list(bit_length(col1)+@var-@var) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); -ERROR 42000: Constant/Random expression in (sub)partitioning function is not allowed near ') -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12' at line 2 +Got one of the listed errors create table t3 (col1 int) engine='MYISAM' partition by hash(bit_length(col1)+@var-@var); -ERROR 42000: Constant/Random expression in (sub)partitioning function is not allowed near ')' at line 2 +Got one of the listed errors create table t4 (colint int, col1 int) engine='MYISAM' partition by range(colint) subpartition by hash(bit_length(col1)+@var-@var) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t5 (colint int, col1 int) engine='MYISAM' partition by list(colint) subpartition by hash(bit_length(col1)+@var-@var) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t6 (colint int, col1 int) engine='MYISAM' partition by range(colint) (partition p0 values less than (bit_length(20)+@var-@var), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t11 ; drop table if exists t22 ; drop table if exists t33 ; @@ -3587,35 +4274,34 @@ alter table t11 partition by range(bit_length(col1)+@var-@var) (partition p0 values less than (15), partition p1 values less than (31)); -ERROR 42000: Constant/Random expression in (sub)partitioning function is not allowed near ') -(partition p0 values less than (15), -partition p1 values less than (31))' at line 2 +Got one of the listed errors alter table t22 partition by list(bit_length(col1)+@var-@var) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); -ERROR 42000: Constant/Random expression in (sub)partitioning function is not allowed near ') -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12' at line 2 +Got one of the listed errors alter table t33 partition by hash(bit_length(col1)+@var-@var); -ERROR 42000: Constant/Random expression in (sub)partitioning function is not allowed near ')' at line 2 +Got one of the listed errors alter table t44 partition by range(colint) subpartition by hash(bit_length(col1)+@var-@var) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t55 partition by list(colint) subpartition by hash(bit_length(col1)+@var-@var) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t66 partition by range(colint) (partition p0 values less than (bit_length(20)+@var-@var), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -3652,7 +4338,7 @@ end// ------------------------------------------------------------------------- --- getmaxsigned_t1(col1) in partition with coltype int ------------------------------------------------------------------------- -must all fail! (delete 0 and comment char, if bug fixed) +must all fail! drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; @@ -3663,35 +4349,34 @@ create table t1 (col1 int) engine='MYISAM' partition by range(getmaxsigned_t1(col1)) (partition p0 values less than (15), partition p1 values less than (31)); -ERROR 42000: Constant/Random expression in (sub)partitioning function is not allowed near ') -(partition p0 values less than (15), -partition p1 values less than (31))' at line 2 +Got one of the listed errors create table t2 (col1 int) engine='MYISAM' partition by list(getmaxsigned_t1(col1)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); -ERROR 42000: Constant/Random expression in (sub)partitioning function is not allowed near ') -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12' at line 2 +Got one of the listed errors create table t3 (col1 int) engine='MYISAM' partition by hash(getmaxsigned_t1(col1)); -ERROR 42000: Constant/Random expression in (sub)partitioning function is not allowed near ')' at line 2 +Got one of the listed errors create table t4 (colint int, col1 int) engine='MYISAM' partition by range(colint) subpartition by hash(getmaxsigned_t1(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors create table t5 (colint int, col1 int) engine='MYISAM' partition by list(colint) subpartition by hash(getmaxsigned_t1(col1)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors create table t6 (colint int, col1 int) engine='MYISAM' partition by range(colint) (partition p0 values less than (getmaxsigned(10)), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t11 ; drop table if exists t22 ; drop table if exists t33 ; @@ -3708,35 +4393,34 @@ alter table t11 partition by range(getmaxsigned_t1(col1)) (partition p0 values less than (15), partition p1 values less than (31)); -ERROR 42000: Constant/Random expression in (sub)partitioning function is not allowed near ') -(partition p0 values less than (15), -partition p1 values less than (31))' at line 2 +Got one of the listed errors alter table t22 partition by list(getmaxsigned_t1(col1)) (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); -ERROR 42000: Constant/Random expression in (sub)partitioning function is not allowed near ') -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12' at line 2 +Got one of the listed errors alter table t33 partition by hash(getmaxsigned_t1(col1)); -ERROR 42000: Constant/Random expression in (sub)partitioning function is not allowed near ')' at line 2 +Got one of the listed errors alter table t44 partition by range(colint) subpartition by hash(getmaxsigned_t1(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than (31)); +Got one of the listed errors alter table t55 partition by list(colint) subpartition by hash(getmaxsigned_t1(col1)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30)); +Got one of the listed errors alter table t66 partition by range(colint) (partition p0 values less than (getmaxsigned(10)), partition p1 values less than maxvalue); +Got one of the listed errors drop table if exists t1 ; drop table if exists t2 ; drop table if exists t3 ; diff --git a/mysql-test/suite/parts/r/part_supported_sql_func_innodb.result b/mysql-test/suite/parts/r/part_supported_sql_func_innodb.result index 1e158e0a787..c47c22ed363 100644 --- a/mysql-test/suite/parts/r/part_supported_sql_func_innodb.result +++ b/mysql-test/suite/parts/r/part_supported_sql_func_innodb.result @@ -55,9 +55,9 @@ insert into t2 values (17 ); insert into t3 values (5 ); insert into t3 values (13 ); insert into t3 values (17 ); -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_int.inc' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_int.inc' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_int.inc' into table t6; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_int.inc' into table t4; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_int.inc' into table t5; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_int.inc' into table t6; select abs(col1) from t1 order by col1; abs(col1) 5 @@ -1675,7 +1675,7 @@ drop table if exists t44 ; drop table if exists t55 ; drop table if exists t66 ; ------------------------------------------------------------------------- ---- ascii(col1) in partition with coltype char(1) +--- mod(col1,10) in partition with coltype int ------------------------------------------------------------------------- drop table if exists t1 ; drop table if exists t2 ; @@ -1684,14 +1684,14 @@ drop table if exists t4 ; drop table if exists t5 ; drop table if exists t6 ; ------------------------------------------------------------------------- ---- Create tables with ascii(col1) +--- Create tables with mod(col1,10) ------------------------------------------------------------------------- -create table t1 (col1 char(1)) engine='INNODB' -partition by range(ascii(col1)) +create table t1 (col1 int) engine='INNODB' +partition by range(mod(col1,10)) (partition p0 values less than (15), partition p1 values less than maxvalue); -create table t2 (col1 char(1)) engine='INNODB' -partition by list(ascii(col1)) +create table t2 (col1 int) engine='INNODB' +partition by list(mod(col1,10)) (partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30), @@ -1699,16 +1699,16 @@ partition p3 values in (31,32,33,34,35,36,37,38,39,40), partition p4 values in (41,42,43,44,45,46,47,48,49,50), partition p5 values in (51,52,53,54,55,56,57,58,59,60) ); -create table t3 (col1 char(1)) engine='INNODB' -partition by hash(ascii(col1)); -create table t4 (colint int, col1 char(1)) engine='INNODB' +create table t3 (col1 int) engine='INNODB' +partition by hash(mod(col1,10)); +create table t4 (colint int, col1 int) engine='INNODB' partition by range(colint) -subpartition by hash(ascii(col1)) subpartitions 2 +subpartition by hash(mod(col1,10)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than maxvalue); -create table t5 (colint int, col1 char(1)) engine='INNODB' +create table t5 (colint int, col1 int) engine='INNODB' partition by list(colint) -subpartition by hash(ascii(col1)) subpartitions 2 +subpartition by hash(mod(col1,10)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30), @@ -1716,1596 +1716,346 @@ partition p3 values in (31,32,33,34,35,36,37,38,39,40), partition p4 values in (41,42,43,44,45,46,47,48,49,50), partition p5 values in (51,52,53,54,55,56,57,58,59,60) ); -create table t6 (colint int, col1 char(1)) engine='INNODB' +create table t6 (colint int, col1 int) engine='INNODB' partition by range(colint) -(partition p0 values less than (ascii('5')), +(partition p0 values less than (mod(15,10)), partition p1 values less than maxvalue); ------------------------------------------------------------------------- ---- Access tables with ascii(col1) +--- Access tables with mod(col1,10) ------------------------------------------------------------------------- -insert into t1 values ('1'); -insert into t1 values ('9'); -insert into t2 values ('1'); -insert into t2 values ('9'); -insert into t2 values ('3'); -insert into t3 values ('1'); -insert into t3 values ('9'); -insert into t3 values ('3'); -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_ch1.inc' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_ch1.inc' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_ch1.inc' into table t6; -select ascii(col1) from t1 order by col1; -ascii(col1) -49 -57 -select * from t1 order by col1; -col1 -1 -9 -select * from t2 order by col1; -col1 -1 -3 -9 -select * from t3 order by col1; -col1 -1 -3 -9 -select * from t4 order by colint; -colint col1 -1 1 -2 9 -3 3 -4 8 -select * from t5 order by colint; -colint col1 -1 1 -2 9 -3 3 -4 8 -select * from t6 order by colint; -colint col1 -1 1 -2 9 -3 3 -4 8 -update t1 set col1='8' where col1='1'; -update t2 set col1='8' where col1='1'; -update t3 set col1='8' where col1='1'; -update t4 set col1='8' where col1='1'; -update t5 set col1='8' where col1='1'; -update t6 set col1='8' where col1='1'; -select * from t1 order by col1; -col1 -8 -9 -select * from t2 order by col1; -col1 -3 -8 -9 -select * from t3 order by col1; -col1 -3 -8 -9 -select * from t4 order by colint; -colint col1 -1 8 -2 9 -3 3 -4 8 -select * from t5 order by colint; -colint col1 -1 8 -2 9 -3 3 -4 8 -select * from t6 order by colint; -colint col1 -1 8 -2 9 -3 3 -4 8 -------------------------------------------------------------------------- ---- Alter tables with ascii(col1) -------------------------------------------------------------------------- -drop table if exists t11 ; -drop table if exists t22 ; -drop table if exists t33 ; -drop table if exists t44 ; -drop table if exists t55 ; -drop table if exists t66 ; -create table t11 engine='INNODB' as select * from t1; -create table t22 engine='INNODB' as select * from t2; -create table t33 engine='INNODB' as select * from t3; -create table t44 engine='INNODB' as select * from t4; -create table t55 engine='INNODB' as select * from t5; -create table t66 engine='INNODB' as select * from t6; -alter table t11 -partition by range(ascii(col1)) -(partition p0 values less than (15), -partition p1 values less than maxvalue); -alter table t22 -partition by list(ascii(col1)) -(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -alter table t33 -partition by hash(ascii(col1)); -alter table t44 -partition by range(colint) -subpartition by hash(ascii(col1)) subpartitions 2 -(partition p0 values less than (15), -partition p1 values less than maxvalue); -alter table t55 -partition by list(colint) -subpartition by hash(ascii(col1)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -alter table t66 -partition by range(colint) -(partition p0 values less than (ascii('5')), -partition p1 values less than maxvalue); -select * from t11 order by col1; -col1 -8 -9 -select * from t22 order by col1; -col1 -3 -8 -9 -select * from t33 order by col1; -col1 -3 -8 -9 -select * from t44 order by colint; -colint col1 -1 8 -2 9 -3 3 -4 8 -select * from t55 order by colint; -colint col1 -1 8 -2 9 -3 3 -4 8 -select * from t66 order by colint; -colint col1 -1 8 -2 9 -3 3 -4 8 ---------------------------- ----- some alter table begin ---------------------------- -alter table t11 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t11 order by col1; -col1 -8 -9 -alter table t11 -reorganize partition s1 into -(partition p0 values less than (15), -partition p1 values less than maxvalue); -select * from t11 order by col1; -col1 -8 -9 -alter table t55 -partition by list(colint) -subpartition by hash(ascii(col1)) subpartitions 5 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -show create table t55; -Table Create Table -t55 CREATE TABLE `t55` ( - `colint` int(11) DEFAULT NULL, - `col1` char(1) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (ascii(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = InnoDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */ -select * from t55 order by colint; -colint col1 -1 8 -2 9 -3 3 -4 8 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 8 -2 9 -3 3 -4 8 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (ascii('5')), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 8 -2 9 -3 3 -4 8 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 8 -2 9 -3 3 -4 8 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (ascii('5')), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 8 -2 9 -3 3 -4 8 -------------------------------------------------------------------------- ---- Delete rows and partitions of tables with ascii(col1) -------------------------------------------------------------------------- -delete from t1 where col1='9'; -delete from t2 where col1='9'; -delete from t3 where col1='9'; -delete from t4 where col1='9'; -delete from t5 where col1='9'; -delete from t6 where col1='9'; -select * from t1 order by col1; -col1 -8 -select * from t2 order by col1; -col1 -3 -8 -select * from t3 order by col1; -col1 -3 -8 -select * from t4 order by colint; -colint col1 -1 8 -3 3 -4 8 -select * from t5 order by colint; -colint col1 -1 8 -3 3 -4 8 -insert into t1 values ('9'); -insert into t2 values ('9'); -insert into t3 values ('9'); -insert into t4 values (60,'9'); -insert into t5 values (60,'9'); -insert into t6 values (60,'9'); -select * from t1 order by col1; -col1 -8 -9 -select * from t2 order by col1; -col1 -3 -8 -9 -select * from t3 order by col1; -col1 -3 -8 -9 -select * from t4 order by colint; -colint col1 -1 8 -3 3 -4 8 -60 9 -select * from t5 order by colint; -colint col1 -1 8 -3 3 -4 8 -60 9 -select * from t6 order by colint; -colint col1 -1 8 -3 3 -4 8 -60 9 -alter table t1 drop partition p0; -alter table t2 drop partition p0; -alter table t4 drop partition p0; -alter table t5 drop partition p0; -alter table t6 drop partition p0; -select * from t1 order by col1; -col1 -8 -9 -select * from t2 order by col1; -col1 -3 -8 -9 -select * from t3 order by col1; -col1 -3 -8 -9 -select * from t4 order by colint; -colint col1 -60 9 -select * from t5 order by colint; -colint col1 -60 9 -select * from t6 order by colint; -colint col1 -60 9 -------------------------------------------------------------------------- ---- Delete rows and partitions of tables with ascii(col1) -------------------------------------------------------------------------- -delete from t11 where col1='9'; -delete from t22 where col1='9'; -delete from t33 where col1='9'; -delete from t44 where col1='9'; -delete from t55 where col1='9'; -delete from t66 where col1='9'; -select * from t11 order by col1; -col1 -8 -select * from t22 order by col1; -col1 -3 -8 -select * from t33 order by col1; -col1 -3 -8 -select * from t44 order by colint; -colint col1 -1 8 -3 3 -4 8 -select * from t55 order by colint; -colint col1 -1 8 -3 3 -4 8 -insert into t11 values ('9'); -insert into t22 values ('9'); -insert into t33 values ('9'); -insert into t44 values (60,'9'); -insert into t55 values (60,'9'); -insert into t66 values (60,'9'); -select * from t11 order by col1; -col1 -8 -9 -select * from t22 order by col1; -col1 -3 -8 -9 -select * from t33 order by col1; -col1 -3 -8 -9 -select * from t44 order by colint; -colint col1 -1 8 -3 3 -4 8 -60 9 -select * from t55 order by colint; -colint col1 -1 8 -3 3 -4 8 -60 9 -select * from t66 order by colint; -colint col1 -1 8 -3 3 -4 8 -60 9 -alter table t11 drop partition p0; -alter table t22 drop partition p0; -alter table t44 drop partition p0; -alter table t55 drop partition p0; -alter table t66 drop partition p0; -select * from t11 order by col1; -col1 -8 -9 -select * from t22 order by col1; -col1 -3 -8 -9 -select * from t33 order by col1; -col1 -3 -8 -9 -select * from t44 order by colint; -colint col1 -60 9 -select * from t55 order by colint; -colint col1 -60 9 -select * from t66 order by colint; -colint col1 -60 9 -------------------------- ----- some alter table end -------------------------- -drop table if exists t1 ; -drop table if exists t2 ; -drop table if exists t3 ; -drop table if exists t4 ; -drop table if exists t5 ; -drop table if exists t6 ; -drop table if exists t11 ; -drop table if exists t22 ; -drop table if exists t33 ; -drop table if exists t44 ; -drop table if exists t55 ; -drop table if exists t66 ; -------------------------------------------------------------------------- ---- cast(ceiling(col1) as signed integer) in partition with coltype float(7,4) -------------------------------------------------------------------------- -drop table if exists t1 ; -drop table if exists t2 ; -drop table if exists t3 ; -drop table if exists t4 ; -drop table if exists t5 ; -drop table if exists t6 ; -------------------------------------------------------------------------- ---- Create tables with cast(ceiling(col1) as signed integer) -------------------------------------------------------------------------- -create table t1 (col1 float(7,4)) engine='INNODB' -partition by range(cast(ceiling(col1) as signed integer)) -(partition p0 values less than (15), -partition p1 values less than maxvalue); -create table t2 (col1 float(7,4)) engine='INNODB' -partition by list(cast(ceiling(col1) as signed integer)) -(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -create table t3 (col1 float(7,4)) engine='INNODB' -partition by hash(cast(ceiling(col1) as signed integer)); -create table t4 (colint int, col1 float(7,4)) engine='INNODB' -partition by range(colint) -subpartition by hash(cast(ceiling(col1) as signed integer)) subpartitions 2 -(partition p0 values less than (15), -partition p1 values less than maxvalue); -create table t5 (colint int, col1 float(7,4)) engine='INNODB' -partition by list(colint) -subpartition by hash(cast(ceiling(col1) as signed integer)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -create table t6 (colint int, col1 float(7,4)) engine='INNODB' -partition by range(colint) -(partition p0 values less than (cast(ceiling(15) as signed integer)), -partition p1 values less than maxvalue); -------------------------------------------------------------------------- ---- Access tables with cast(ceiling(col1) as signed integer) -------------------------------------------------------------------------- -insert into t1 values (5.1230); -insert into t1 values (13.345); -insert into t2 values (5.1230); -insert into t2 values (13.345); -insert into t2 values (17.987); -insert into t3 values (5.1230); -insert into t3 values (13.345); -insert into t3 values (17.987); -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_float.inc' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_float.inc' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_float.inc' into table t6; -select cast(ceiling(col1) as signed integer) from t1 order by col1; -cast(ceiling(col1) as signed integer) -6 -14 -select * from t1 order by col1; -col1 -5.1230 -13.3450 -select * from t2 order by col1; -col1 -5.1230 -13.3450 -17.9870 -select * from t3 order by col1; -col1 -5.1230 -13.3450 -17.9870 -select * from t4 order by colint; -colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 -select * from t5 order by colint; -colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 -select * from t6 order by colint; -colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 -update t1 set col1=15.654 where col1=5.1230; -update t2 set col1=15.654 where col1=5.1230; -update t3 set col1=15.654 where col1=5.1230; -update t4 set col1=15.654 where col1=5.1230; -update t5 set col1=15.654 where col1=5.1230; -update t6 set col1=15.654 where col1=5.1230; -select * from t1 order by col1; -col1 -13.3450 -15.6540 -select * from t2 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t3 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t4 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 -select * from t5 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 -select * from t6 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 -------------------------------------------------------------------------- ---- Alter tables with cast(ceiling(col1) as signed integer) -------------------------------------------------------------------------- -drop table if exists t11 ; -drop table if exists t22 ; -drop table if exists t33 ; -drop table if exists t44 ; -drop table if exists t55 ; -drop table if exists t66 ; -create table t11 engine='INNODB' as select * from t1; -create table t22 engine='INNODB' as select * from t2; -create table t33 engine='INNODB' as select * from t3; -create table t44 engine='INNODB' as select * from t4; -create table t55 engine='INNODB' as select * from t5; -create table t66 engine='INNODB' as select * from t6; -alter table t11 -partition by range(cast(ceiling(col1) as signed integer)) -(partition p0 values less than (15), -partition p1 values less than maxvalue); -alter table t22 -partition by list(cast(ceiling(col1) as signed integer)) -(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -alter table t33 -partition by hash(cast(ceiling(col1) as signed integer)); -alter table t44 -partition by range(colint) -subpartition by hash(cast(ceiling(col1) as signed integer)) subpartitions 2 -(partition p0 values less than (15), -partition p1 values less than maxvalue); -alter table t55 -partition by list(colint) -subpartition by hash(cast(ceiling(col1) as signed integer)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -alter table t66 -partition by range(colint) -(partition p0 values less than (cast(ceiling(15) as signed integer)), -partition p1 values less than maxvalue); -select * from t11 order by col1; -col1 -13.3450 -15.6540 -select * from t22 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t33 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t44 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 -select * from t55 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 -select * from t66 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 ---------------------------- ----- some alter table begin ---------------------------- -alter table t11 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t11 order by col1; -col1 -13.3450 -15.6540 -alter table t11 -reorganize partition s1 into -(partition p0 values less than (15), -partition p1 values less than maxvalue); -select * from t11 order by col1; -col1 -13.3450 -15.6540 -alter table t55 -partition by list(colint) -subpartition by hash(cast(ceiling(col1) as signed integer)) subpartitions 5 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -show create table t55; -Table Create Table -t55 CREATE TABLE `t55` ( - `colint` int(11) DEFAULT NULL, - `col1` float(7,4) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (cast(ceiling(col1) as signed integer)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = InnoDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */ -select * from t55 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (cast(ceiling(15) as signed integer)), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (cast(ceiling(15) as signed integer)), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 -------------------------------------------------------------------------- ---- Delete rows and partitions of tables with cast(ceiling(col1) as signed integer) -------------------------------------------------------------------------- -delete from t1 where col1=13.345; -delete from t2 where col1=13.345; -delete from t3 where col1=13.345; -delete from t4 where col1=13.345; -delete from t5 where col1=13.345; -delete from t6 where col1=13.345; -select * from t1 order by col1; -col1 -15.6540 -select * from t2 order by col1; -col1 -15.6540 -17.9870 -select * from t3 order by col1; -col1 -15.6540 -17.9870 -select * from t4 order by colint; -colint col1 -1 15.6540 -3 17.9870 -4 15.6540 -select * from t5 order by colint; -colint col1 -1 15.6540 -3 17.9870 -4 15.6540 -insert into t1 values (13.345); -insert into t2 values (13.345); -insert into t3 values (13.345); -insert into t4 values (60,13.345); -insert into t5 values (60,13.345); -insert into t6 values (60,13.345); -select * from t1 order by col1; -col1 -13.3450 -15.6540 -select * from t2 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t3 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t4 order by colint; -colint col1 -1 15.6540 -3 17.9870 -4 15.6540 -60 13.3450 -select * from t5 order by colint; -colint col1 -1 15.6540 -3 17.9870 -4 15.6540 -60 13.3450 -select * from t6 order by colint; -colint col1 -1 15.6540 -3 17.9870 -4 15.6540 -60 13.3450 -alter table t1 drop partition p0; -alter table t2 drop partition p0; -alter table t4 drop partition p0; -alter table t5 drop partition p0; -alter table t6 drop partition p0; -select * from t1 order by col1; -col1 -15.6540 -select * from t2 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t3 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t4 order by colint; -colint col1 -60 13.3450 -select * from t5 order by colint; -colint col1 -60 13.3450 -select * from t6 order by colint; -colint col1 -60 13.3450 -------------------------------------------------------------------------- ---- Delete rows and partitions of tables with cast(ceiling(col1) as signed integer) -------------------------------------------------------------------------- -delete from t11 where col1=13.345; -delete from t22 where col1=13.345; -delete from t33 where col1=13.345; -delete from t44 where col1=13.345; -delete from t55 where col1=13.345; -delete from t66 where col1=13.345; -select * from t11 order by col1; -col1 -15.6540 -select * from t22 order by col1; -col1 -15.6540 -17.9870 -select * from t33 order by col1; -col1 -15.6540 -17.9870 -select * from t44 order by colint; -colint col1 -1 15.6540 -3 17.9870 -4 15.6540 -select * from t55 order by colint; -colint col1 -1 15.6540 -3 17.9870 -4 15.6540 -insert into t11 values (13.345); -insert into t22 values (13.345); -insert into t33 values (13.345); -insert into t44 values (60,13.345); -insert into t55 values (60,13.345); -insert into t66 values (60,13.345); -select * from t11 order by col1; -col1 -13.3450 -15.6540 -select * from t22 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t33 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t44 order by colint; -colint col1 -1 15.6540 -3 17.9870 -4 15.6540 -60 13.3450 -select * from t55 order by colint; -colint col1 -1 15.6540 -3 17.9870 -4 15.6540 -60 13.3450 -select * from t66 order by colint; -colint col1 -1 15.6540 -3 17.9870 -4 15.6540 -60 13.3450 -alter table t11 drop partition p0; -alter table t22 drop partition p0; -alter table t44 drop partition p0; -alter table t55 drop partition p0; -alter table t66 drop partition p0; -select * from t11 order by col1; -col1 -15.6540 -select * from t22 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t33 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t44 order by colint; -colint col1 -60 13.3450 -select * from t55 order by colint; -colint col1 -60 13.3450 -select * from t66 order by colint; -colint col1 -60 13.3450 -------------------------- ----- some alter table end -------------------------- -drop table if exists t1 ; -drop table if exists t2 ; -drop table if exists t3 ; -drop table if exists t4 ; -drop table if exists t5 ; -drop table if exists t6 ; -drop table if exists t11 ; -drop table if exists t22 ; -drop table if exists t33 ; -drop table if exists t44 ; -drop table if exists t55 ; -drop table if exists t66 ; -------------------------------------------------------------------------- ---- cast(floor(col1) as signed) in partition with coltype float(7,4) -------------------------------------------------------------------------- -drop table if exists t1 ; -drop table if exists t2 ; -drop table if exists t3 ; -drop table if exists t4 ; -drop table if exists t5 ; -drop table if exists t6 ; -------------------------------------------------------------------------- ---- Create tables with cast(floor(col1) as signed) -------------------------------------------------------------------------- -create table t1 (col1 float(7,4)) engine='INNODB' -partition by range(cast(floor(col1) as signed)) -(partition p0 values less than (15), -partition p1 values less than maxvalue); -create table t2 (col1 float(7,4)) engine='INNODB' -partition by list(cast(floor(col1) as signed)) -(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -create table t3 (col1 float(7,4)) engine='INNODB' -partition by hash(cast(floor(col1) as signed)); -create table t4 (colint int, col1 float(7,4)) engine='INNODB' -partition by range(colint) -subpartition by hash(cast(floor(col1) as signed)) subpartitions 2 -(partition p0 values less than (15), -partition p1 values less than maxvalue); -create table t5 (colint int, col1 float(7,4)) engine='INNODB' -partition by list(colint) -subpartition by hash(cast(floor(col1) as signed)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -create table t6 (colint int, col1 float(7,4)) engine='INNODB' -partition by range(colint) -(partition p0 values less than (cast(floor(15.123) as signed)), -partition p1 values less than maxvalue); -------------------------------------------------------------------------- ---- Access tables with cast(floor(col1) as signed) -------------------------------------------------------------------------- -insert into t1 values (5.1230); -insert into t1 values (13.345); -insert into t2 values (5.1230); -insert into t2 values (13.345); -insert into t2 values (17.987); -insert into t3 values (5.1230); -insert into t3 values (13.345); -insert into t3 values (17.987); -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_float.inc' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_float.inc' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_float.inc' into table t6; -select cast(floor(col1) as signed) from t1 order by col1; -cast(floor(col1) as signed) -5 -13 -select * from t1 order by col1; -col1 -5.1230 -13.3450 -select * from t2 order by col1; -col1 -5.1230 -13.3450 -17.9870 -select * from t3 order by col1; -col1 -5.1230 -13.3450 -17.9870 -select * from t4 order by colint; -colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 -select * from t5 order by colint; -colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 -select * from t6 order by colint; -colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 -update t1 set col1=15.654 where col1=5.1230; -update t2 set col1=15.654 where col1=5.1230; -update t3 set col1=15.654 where col1=5.1230; -update t4 set col1=15.654 where col1=5.1230; -update t5 set col1=15.654 where col1=5.1230; -update t6 set col1=15.654 where col1=5.1230; -select * from t1 order by col1; -col1 -13.3450 -15.6540 -select * from t2 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t3 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t4 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 -select * from t5 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 -select * from t6 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 -------------------------------------------------------------------------- ---- Alter tables with cast(floor(col1) as signed) -------------------------------------------------------------------------- -drop table if exists t11 ; -drop table if exists t22 ; -drop table if exists t33 ; -drop table if exists t44 ; -drop table if exists t55 ; -drop table if exists t66 ; -create table t11 engine='INNODB' as select * from t1; -create table t22 engine='INNODB' as select * from t2; -create table t33 engine='INNODB' as select * from t3; -create table t44 engine='INNODB' as select * from t4; -create table t55 engine='INNODB' as select * from t5; -create table t66 engine='INNODB' as select * from t6; -alter table t11 -partition by range(cast(floor(col1) as signed)) -(partition p0 values less than (15), -partition p1 values less than maxvalue); -alter table t22 -partition by list(cast(floor(col1) as signed)) -(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -alter table t33 -partition by hash(cast(floor(col1) as signed)); -alter table t44 -partition by range(colint) -subpartition by hash(cast(floor(col1) as signed)) subpartitions 2 -(partition p0 values less than (15), -partition p1 values less than maxvalue); -alter table t55 -partition by list(colint) -subpartition by hash(cast(floor(col1) as signed)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -alter table t66 -partition by range(colint) -(partition p0 values less than (cast(floor(15.123) as signed)), -partition p1 values less than maxvalue); -select * from t11 order by col1; -col1 -13.3450 -15.6540 -select * from t22 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t33 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t44 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 -select * from t55 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 -select * from t66 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 ---------------------------- ----- some alter table begin ---------------------------- -alter table t11 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t11 order by col1; -col1 -13.3450 -15.6540 -alter table t11 -reorganize partition s1 into -(partition p0 values less than (15), -partition p1 values less than maxvalue); -select * from t11 order by col1; -col1 -13.3450 -15.6540 -alter table t55 -partition by list(colint) -subpartition by hash(cast(floor(col1) as signed)) subpartitions 5 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -show create table t55; -Table Create Table -t55 CREATE TABLE `t55` ( - `colint` int(11) DEFAULT NULL, - `col1` float(7,4) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (cast(floor(col1) as signed)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = InnoDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */ -select * from t55 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (cast(floor(15.123) as signed)), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (cast(floor(15.123) as signed)), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 -------------------------------------------------------------------------- ---- Delete rows and partitions of tables with cast(floor(col1) as signed) -------------------------------------------------------------------------- -delete from t1 where col1=13.345; -delete from t2 where col1=13.345; -delete from t3 where col1=13.345; -delete from t4 where col1=13.345; -delete from t5 where col1=13.345; -delete from t6 where col1=13.345; -select * from t1 order by col1; -col1 -15.6540 -select * from t2 order by col1; -col1 -15.6540 -17.9870 -select * from t3 order by col1; -col1 -15.6540 -17.9870 -select * from t4 order by colint; -colint col1 -1 15.6540 -3 17.9870 -4 15.6540 -select * from t5 order by colint; -colint col1 -1 15.6540 -3 17.9870 -4 15.6540 -insert into t1 values (13.345); -insert into t2 values (13.345); -insert into t3 values (13.345); -insert into t4 values (60,13.345); -insert into t5 values (60,13.345); -insert into t6 values (60,13.345); -select * from t1 order by col1; -col1 -13.3450 -15.6540 -select * from t2 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t3 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t4 order by colint; -colint col1 -1 15.6540 -3 17.9870 -4 15.6540 -60 13.3450 -select * from t5 order by colint; -colint col1 -1 15.6540 -3 17.9870 -4 15.6540 -60 13.3450 -select * from t6 order by colint; -colint col1 -1 15.6540 -3 17.9870 -4 15.6540 -60 13.3450 -alter table t1 drop partition p0; -alter table t2 drop partition p0; -alter table t4 drop partition p0; -alter table t5 drop partition p0; -alter table t6 drop partition p0; -select * from t1 order by col1; -col1 -15.6540 -select * from t2 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t3 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t4 order by colint; -colint col1 -60 13.3450 -select * from t5 order by colint; -colint col1 -60 13.3450 -select * from t6 order by colint; -colint col1 -60 13.3450 -------------------------------------------------------------------------- ---- Delete rows and partitions of tables with cast(floor(col1) as signed) -------------------------------------------------------------------------- -delete from t11 where col1=13.345; -delete from t22 where col1=13.345; -delete from t33 where col1=13.345; -delete from t44 where col1=13.345; -delete from t55 where col1=13.345; -delete from t66 where col1=13.345; -select * from t11 order by col1; -col1 -15.6540 -select * from t22 order by col1; -col1 -15.6540 -17.9870 -select * from t33 order by col1; -col1 -15.6540 -17.9870 -select * from t44 order by colint; -colint col1 -1 15.6540 -3 17.9870 -4 15.6540 -select * from t55 order by colint; -colint col1 -1 15.6540 -3 17.9870 -4 15.6540 -insert into t11 values (13.345); -insert into t22 values (13.345); -insert into t33 values (13.345); -insert into t44 values (60,13.345); -insert into t55 values (60,13.345); -insert into t66 values (60,13.345); -select * from t11 order by col1; -col1 -13.3450 -15.6540 -select * from t22 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t33 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t44 order by colint; -colint col1 -1 15.6540 -3 17.9870 -4 15.6540 -60 13.3450 -select * from t55 order by colint; -colint col1 -1 15.6540 -3 17.9870 -4 15.6540 -60 13.3450 -select * from t66 order by colint; -colint col1 -1 15.6540 -3 17.9870 -4 15.6540 -60 13.3450 -alter table t11 drop partition p0; -alter table t22 drop partition p0; -alter table t44 drop partition p0; -alter table t55 drop partition p0; -alter table t66 drop partition p0; -select * from t11 order by col1; -col1 -15.6540 -select * from t22 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t33 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t44 order by colint; -colint col1 -60 13.3450 -select * from t55 order by colint; -colint col1 -60 13.3450 -select * from t66 order by colint; -colint col1 -60 13.3450 -------------------------- ----- some alter table end -------------------------- -drop table if exists t1 ; -drop table if exists t2 ; -drop table if exists t3 ; -drop table if exists t4 ; -drop table if exists t5 ; -drop table if exists t6 ; -drop table if exists t11 ; -drop table if exists t22 ; -drop table if exists t33 ; -drop table if exists t44 ; -drop table if exists t55 ; -drop table if exists t66 ; -------------------------------------------------------------------------- ---- cast(mod(col1,10) as signed) in partition with coltype float(7,4) -------------------------------------------------------------------------- -drop table if exists t1 ; -drop table if exists t2 ; -drop table if exists t3 ; -drop table if exists t4 ; -drop table if exists t5 ; -drop table if exists t6 ; -------------------------------------------------------------------------- ---- Create tables with cast(mod(col1,10) as signed) -------------------------------------------------------------------------- -create table t1 (col1 float(7,4)) engine='INNODB' -partition by range(cast(mod(col1,10) as signed)) -(partition p0 values less than (15), -partition p1 values less than maxvalue); -create table t2 (col1 float(7,4)) engine='INNODB' -partition by list(cast(mod(col1,10) as signed)) -(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -create table t3 (col1 float(7,4)) engine='INNODB' -partition by hash(cast(mod(col1,10) as signed)); -create table t4 (colint int, col1 float(7,4)) engine='INNODB' -partition by range(colint) -subpartition by hash(cast(mod(col1,10) as signed)) subpartitions 2 -(partition p0 values less than (15), -partition p1 values less than maxvalue); -create table t5 (colint int, col1 float(7,4)) engine='INNODB' -partition by list(colint) -subpartition by hash(cast(mod(col1,10) as signed)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -create table t6 (colint int, col1 float(7,4)) engine='INNODB' -partition by range(colint) -(partition p0 values less than (cast(mod(15,10) as signed)), -partition p1 values less than maxvalue); -------------------------------------------------------------------------- ---- Access tables with cast(mod(col1,10) as signed) -------------------------------------------------------------------------- -insert into t1 values (5.0000); +insert into t1 values (5); insert into t1 values (19); -insert into t2 values (5.0000); +insert into t2 values (5); insert into t2 values (19); insert into t2 values (17); -insert into t3 values (5.0000); +insert into t3 values (5); insert into t3 values (19); insert into t3 values (17); -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_float.inc' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_float.inc' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_float.inc' into table t6; -select cast(mod(col1,10) as signed) from t1 order by col1; -cast(mod(col1,10) as signed) +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_int.inc' into table t4; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_int.inc' into table t5; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_int.inc' into table t6; +select mod(col1,10) from t1 order by col1; +mod(col1,10) 5 9 select * from t1 order by col1; col1 -5.0000 -19.0000 +5 +19 select * from t2 order by col1; col1 -5.0000 -17.0000 -19.0000 +5 +17 +19 select * from t3 order by col1; col1 -5.0000 -17.0000 -19.0000 +5 +17 +19 select * from t4 order by colint; colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 +1 5 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 5 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 select * from t5 order by colint; colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 +1 5 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 5 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 select * from t6 order by colint; colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 -update t1 set col1=15 where col1=5.0000; -update t2 set col1=15 where col1=5.0000; -update t3 set col1=15 where col1=5.0000; -update t4 set col1=15 where col1=5.0000; -update t5 set col1=15 where col1=5.0000; -update t6 set col1=15 where col1=5.0000; +1 5 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 5 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +update t1 set col1=15 where col1=5; +update t2 set col1=15 where col1=5; +update t3 set col1=15 where col1=5; +update t4 set col1=15 where col1=5; +update t5 set col1=15 where col1=5; +update t6 set col1=15 where col1=5; select * from t1 order by col1; col1 -15.0000 -19.0000 +15 +19 select * from t2 order by col1; col1 -15.0000 -17.0000 -19.0000 +15 +17 +19 select * from t3 order by col1; col1 -15.0000 -17.0000 -19.0000 +15 +17 +19 select * from t4 order by colint; colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 select * from t5 order by colint; colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 select * from t6 order by colint; colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 ------------------------------------------------------------------------- ---- Alter tables with cast(mod(col1,10) as signed) +--- Alter tables with mod(col1,10) ------------------------------------------------------------------------- drop table if exists t11 ; drop table if exists t22 ; @@ -3320,11 +2070,11 @@ create table t44 engine='INNODB' as select * from t4; create table t55 engine='INNODB' as select * from t5; create table t66 engine='INNODB' as select * from t6; alter table t11 -partition by range(cast(mod(col1,10) as signed)) +partition by range(mod(col1,10)) (partition p0 values less than (15), partition p1 values less than maxvalue); alter table t22 -partition by list(cast(mod(col1,10) as signed)) +partition by list(mod(col1,10)) (partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30), @@ -3333,15 +2083,15 @@ partition p4 values in (41,42,43,44,45,46,47,48,49,50), partition p5 values in (51,52,53,54,55,56,57,58,59,60) ); alter table t33 -partition by hash(cast(mod(col1,10) as signed)); +partition by hash(mod(col1,10)); alter table t44 partition by range(colint) -subpartition by hash(cast(mod(col1,10) as signed)) subpartitions 2 +subpartition by hash(mod(col1,10)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than maxvalue); alter table t55 partition by list(colint) -subpartition by hash(cast(mod(col1,10) as signed)) subpartitions 2 +subpartition by hash(mod(col1,10)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30), @@ -3351,40 +2101,163 @@ partition p5 values in (51,52,53,54,55,56,57,58,59,60) ); alter table t66 partition by range(colint) -(partition p0 values less than (cast(mod(15,10) as signed)), +(partition p0 values less than (mod(15,10)), partition p1 values less than maxvalue); select * from t11 order by col1; col1 -15.0000 -19.0000 +15 +19 select * from t22 order by col1; col1 -15.0000 -17.0000 -19.0000 +15 +17 +19 select * from t33 order by col1; col1 -15.0000 -17.0000 -19.0000 +15 +17 +19 select * from t44 order by colint; colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 select * from t55 order by colint; colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 select * from t66 order by colint; colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 --------------------------- ---- some alter table begin --------------------------- @@ -3393,19 +2266,19 @@ reorganize partition p0,p1 into (partition s1 values less than maxvalue); select * from t11 order by col1; col1 -15.0000 -19.0000 +15 +19 alter table t11 reorganize partition s1 into (partition p0 values less than (15), partition p1 values less than maxvalue); select * from t11 order by col1; col1 -15.0000 -19.0000 +15 +19 alter table t55 partition by list(colint) -subpartition by hash(cast(mod(col1,10) as signed)) subpartitions 5 +subpartition by hash(mod(col1,10)) subpartitions 5 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30), @@ -3417,54 +2290,259 @@ show create table t55; Table Create Table t55 CREATE TABLE `t55` ( `colint` int(11) DEFAULT NULL, - `col1` float(7,4) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (cast(mod(col1,10) as signed)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = InnoDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */ + `col1` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (mod(col1,10)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = InnoDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */ select * from t55 order by colint; colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 alter table t66 reorganize partition p0,p1 into (partition s1 values less than maxvalue); select * from t66 order by colint; colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 alter table t66 reorganize partition s1 into -(partition p0 values less than (cast(mod(15,10) as signed)), +(partition p0 values less than (mod(15,10)), partition p1 values less than maxvalue); select * from t66 order by colint; colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 alter table t66 reorganize partition p0,p1 into (partition s1 values less than maxvalue); select * from t66 order by colint; colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 alter table t66 reorganize partition s1 into -(partition p0 values less than (cast(mod(15,10) as signed)), +(partition p0 values less than (mod(15,10)), partition p1 values less than maxvalue); select * from t66 order by colint; colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 ------------------------------------------------------------------------- ---- Delete rows and partitions of tables with cast(mod(col1,10) as signed) +--- Delete rows and partitions of tables with mod(col1,10) ------------------------------------------------------------------------- delete from t1 where col1=19; delete from t2 where col1=19; @@ -3474,27 +2552,109 @@ delete from t5 where col1=19; delete from t6 where col1=19; select * from t1 order by col1; col1 -15.0000 +15 select * from t2 order by col1; col1 -15.0000 -17.0000 +15 +17 select * from t3 order by col1; col1 -15.0000 -17.0000 +15 +17 select * from t4 order by colint; colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 select * from t5 order by colint; colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 insert into t1 values (19); insert into t2 values (19); insert into t3 values (19); @@ -3503,39 +2663,162 @@ insert into t5 values (60,19); insert into t6 values (60,19); select * from t1 order by col1; col1 -15.0000 -19.0000 +15 +19 select * from t2 order by col1; col1 -15.0000 -17.0000 -19.0000 +15 +17 +19 select * from t3 order by col1; col1 -15.0000 -17.0000 -19.0000 +15 +17 +19 select * from t4 order by colint; colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 -60 19.0000 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +60 19 select * from t5 order by colint; colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 -60 19.0000 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +60 19 select * from t6 order by colint; colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 -60 19.0000 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +60 19 alter table t1 drop partition p0; alter table t2 drop partition p0; alter table t4 drop partition p0; @@ -3547,20 +2830,127 @@ select * from t2 order by col1; col1 select * from t3 order by col1; col1 -15.0000 -17.0000 -19.0000 +15 +17 +19 select * from t4 order by colint; colint col1 -60 19.0000 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +60 19 select * from t5 order by colint; colint col1 -60 19.0000 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +60 19 select * from t6 order by colint; colint col1 -60 19.0000 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +60 19 ------------------------------------------------------------------------- ---- Delete rows and partitions of tables with cast(mod(col1,10) as signed) +--- Delete rows and partitions of tables with mod(col1,10) ------------------------------------------------------------------------- delete from t11 where col1=19; delete from t22 where col1=19; @@ -3570,27 +2960,109 @@ delete from t55 where col1=19; delete from t66 where col1=19; select * from t11 order by col1; col1 -15.0000 +15 select * from t22 order by col1; col1 -15.0000 -17.0000 +15 +17 select * from t33 order by col1; col1 -15.0000 -17.0000 +15 +17 select * from t44 order by colint; colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 select * from t55 order by colint; colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 insert into t11 values (19); insert into t22 values (19); insert into t33 values (19); @@ -3599,39 +3071,162 @@ insert into t55 values (60,19); insert into t66 values (60,19); select * from t11 order by col1; col1 -15.0000 -19.0000 +15 +19 select * from t22 order by col1; col1 -15.0000 -17.0000 -19.0000 +15 +17 +19 select * from t33 order by col1; col1 -15.0000 -17.0000 -19.0000 +15 +17 +19 select * from t44 order by colint; colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 -60 19.0000 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +60 19 select * from t55 order by colint; colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 -60 19.0000 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +60 19 select * from t66 order by colint; colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 -60 19.0000 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +60 19 alter table t11 drop partition p0; alter table t22 drop partition p0; alter table t44 drop partition p0; @@ -3643,516 +3238,125 @@ select * from t22 order by col1; col1 select * from t33 order by col1; col1 -15.0000 -17.0000 -19.0000 +15 +17 +19 select * from t44 order by colint; colint col1 -60 19.0000 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +60 19 select * from t55 order by colint; colint col1 -60 19.0000 -select * from t66 order by colint; -colint col1 -60 19.0000 -------------------------- ----- some alter table end -------------------------- -drop table if exists t1 ; -drop table if exists t2 ; -drop table if exists t3 ; -drop table if exists t4 ; -drop table if exists t5 ; -drop table if exists t6 ; -drop table if exists t11 ; -drop table if exists t22 ; -drop table if exists t33 ; -drop table if exists t44 ; -drop table if exists t55 ; -drop table if exists t66 ; -------------------------------------------------------------------------- ---- ord(col1) in partition with coltype char(3) -------------------------------------------------------------------------- -drop table if exists t1 ; -drop table if exists t2 ; -drop table if exists t3 ; -drop table if exists t4 ; -drop table if exists t5 ; -drop table if exists t6 ; -------------------------------------------------------------------------- ---- Create tables with ord(col1) -------------------------------------------------------------------------- -create table t1 (col1 char(3)) engine='INNODB' -partition by range(ord(col1)) -(partition p0 values less than (15), -partition p1 values less than maxvalue); -create table t2 (col1 char(3)) engine='INNODB' -partition by list(ord(col1)) -(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -create table t3 (col1 char(3)) engine='INNODB' -partition by hash(ord(col1)); -create table t4 (colint int, col1 char(3)) engine='INNODB' -partition by range(colint) -subpartition by hash(ord(col1)) subpartitions 2 -(partition p0 values less than (15), -partition p1 values less than maxvalue); -create table t5 (colint int, col1 char(3)) engine='INNODB' -partition by list(colint) -subpartition by hash(ord(col1)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -create table t6 (colint int, col1 char(3)) engine='INNODB' -partition by range(colint) -(partition p0 values less than (ord('a')), -partition p1 values less than maxvalue); -------------------------------------------------------------------------- ---- Access tables with ord(col1) -------------------------------------------------------------------------- -insert into t1 values ('1'); -insert into t1 values ('9'); -insert into t2 values ('1'); -insert into t2 values ('9'); -insert into t2 values ('3'); -insert into t3 values ('1'); -insert into t3 values ('9'); -insert into t3 values ('3'); -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_ch1.inc' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_ch1.inc' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_ch1.inc' into table t6; -select ord(col1) from t1 order by col1; -ord(col1) -49 -57 -select * from t1 order by col1; -col1 -1 -9 -select * from t2 order by col1; -col1 -1 -3 -9 -select * from t3 order by col1; -col1 -1 -3 -9 -select * from t4 order by colint; -colint col1 -1 1 -2 9 -3 3 -4 8 -select * from t5 order by colint; -colint col1 -1 1 -2 9 -3 3 -4 8 -select * from t6 order by colint; -colint col1 -1 1 -2 9 -3 3 -4 8 -update t1 set col1='8' where col1='1'; -update t2 set col1='8' where col1='1'; -update t3 set col1='8' where col1='1'; -update t4 set col1='8' where col1='1'; -update t5 set col1='8' where col1='1'; -update t6 set col1='8' where col1='1'; -select * from t1 order by col1; -col1 -8 -9 -select * from t2 order by col1; -col1 -3 -8 -9 -select * from t3 order by col1; -col1 -3 -8 -9 -select * from t4 order by colint; -colint col1 -1 8 -2 9 -3 3 -4 8 -select * from t5 order by colint; -colint col1 -1 8 -2 9 -3 3 -4 8 -select * from t6 order by colint; -colint col1 -1 8 -2 9 -3 3 -4 8 -------------------------------------------------------------------------- ---- Alter tables with ord(col1) -------------------------------------------------------------------------- -drop table if exists t11 ; -drop table if exists t22 ; -drop table if exists t33 ; -drop table if exists t44 ; -drop table if exists t55 ; -drop table if exists t66 ; -create table t11 engine='INNODB' as select * from t1; -create table t22 engine='INNODB' as select * from t2; -create table t33 engine='INNODB' as select * from t3; -create table t44 engine='INNODB' as select * from t4; -create table t55 engine='INNODB' as select * from t5; -create table t66 engine='INNODB' as select * from t6; -alter table t11 -partition by range(ord(col1)) -(partition p0 values less than (15), -partition p1 values less than maxvalue); -alter table t22 -partition by list(ord(col1)) -(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -alter table t33 -partition by hash(ord(col1)); -alter table t44 -partition by range(colint) -subpartition by hash(ord(col1)) subpartitions 2 -(partition p0 values less than (15), -partition p1 values less than maxvalue); -alter table t55 -partition by list(colint) -subpartition by hash(ord(col1)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -alter table t66 -partition by range(colint) -(partition p0 values less than (ord('a')), -partition p1 values less than maxvalue); -select * from t11 order by col1; -col1 -8 -9 -select * from t22 order by col1; -col1 -3 -8 -9 -select * from t33 order by col1; -col1 -3 -8 -9 -select * from t44 order by colint; -colint col1 -1 8 -2 9 -3 3 -4 8 -select * from t55 order by colint; -colint col1 -1 8 -2 9 -3 3 -4 8 -select * from t66 order by colint; -colint col1 -1 8 -2 9 -3 3 -4 8 ---------------------------- ----- some alter table begin ---------------------------- -alter table t11 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t11 order by col1; -col1 -8 -9 -alter table t11 -reorganize partition s1 into -(partition p0 values less than (15), -partition p1 values less than maxvalue); -select * from t11 order by col1; -col1 -8 -9 -alter table t55 -partition by list(colint) -subpartition by hash(ord(col1)) subpartitions 5 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -show create table t55; -Table Create Table -t55 CREATE TABLE `t55` ( - `colint` int(11) DEFAULT NULL, - `col1` char(3) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (ord(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = InnoDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */ -select * from t55 order by colint; -colint col1 -1 8 -2 9 -3 3 -4 8 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 8 -2 9 -3 3 -4 8 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (ord('a')), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 8 -2 9 -3 3 -4 8 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 8 -2 9 -3 3 -4 8 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (ord('a')), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 8 -2 9 -3 3 -4 8 -------------------------------------------------------------------------- ---- Delete rows and partitions of tables with ord(col1) -------------------------------------------------------------------------- -delete from t1 where col1='9'; -delete from t2 where col1='9'; -delete from t3 where col1='9'; -delete from t4 where col1='9'; -delete from t5 where col1='9'; -delete from t6 where col1='9'; -select * from t1 order by col1; -col1 -8 -select * from t2 order by col1; -col1 -3 -8 -select * from t3 order by col1; -col1 -3 -8 -select * from t4 order by colint; -colint col1 -1 8 -3 3 -4 8 -select * from t5 order by colint; -colint col1 -1 8 -3 3 -4 8 -insert into t1 values ('9'); -insert into t2 values ('9'); -insert into t3 values ('9'); -insert into t4 values (60,'9'); -insert into t5 values (60,'9'); -insert into t6 values (60,'9'); -select * from t1 order by col1; -col1 -8 -9 -select * from t2 order by col1; -col1 -3 -8 -9 -select * from t3 order by col1; -col1 -3 -8 -9 -select * from t4 order by colint; -colint col1 -1 8 -3 3 -4 8 -60 9 -select * from t5 order by colint; -colint col1 -1 8 -3 3 -4 8 -60 9 -select * from t6 order by colint; -colint col1 -1 8 -3 3 -4 8 -60 9 -alter table t1 drop partition p0; -alter table t2 drop partition p0; -alter table t4 drop partition p0; -alter table t5 drop partition p0; -alter table t6 drop partition p0; -select * from t1 order by col1; -col1 -8 -9 -select * from t2 order by col1; -col1 -3 -8 -9 -select * from t3 order by col1; -col1 -3 -8 -9 -select * from t4 order by colint; -colint col1 -60 9 -select * from t5 order by colint; -colint col1 -60 9 -select * from t6 order by colint; -colint col1 -------------------------------------------------------------------------- ---- Delete rows and partitions of tables with ord(col1) -------------------------------------------------------------------------- -delete from t11 where col1='9'; -delete from t22 where col1='9'; -delete from t33 where col1='9'; -delete from t44 where col1='9'; -delete from t55 where col1='9'; -delete from t66 where col1='9'; -select * from t11 order by col1; -col1 -8 -select * from t22 order by col1; -col1 -3 -8 -select * from t33 order by col1; -col1 -3 -8 -select * from t44 order by colint; -colint col1 -1 8 -3 3 -4 8 -select * from t55 order by colint; -colint col1 -1 8 -3 3 -4 8 -insert into t11 values ('9'); -insert into t22 values ('9'); -insert into t33 values ('9'); -insert into t44 values (60,'9'); -insert into t55 values (60,'9'); -insert into t66 values (60,'9'); -select * from t11 order by col1; -col1 -8 -9 -select * from t22 order by col1; -col1 -3 -8 -9 -select * from t33 order by col1; -col1 -3 -8 -9 -select * from t44 order by colint; -colint col1 -1 8 -3 3 -4 8 -60 9 -select * from t55 order by colint; -colint col1 -1 8 -3 3 -4 8 -60 9 -select * from t66 order by colint; -colint col1 -1 8 -3 3 -4 8 -60 9 -alter table t11 drop partition p0; -alter table t22 drop partition p0; -alter table t44 drop partition p0; -alter table t55 drop partition p0; -alter table t66 drop partition p0; -select * from t11 order by col1; -col1 -8 -9 -select * from t22 order by col1; -col1 -3 -8 -9 -select * from t33 order by col1; -col1 -3 -8 -9 -select * from t44 order by colint; -colint col1 -60 9 -select * from t55 order by colint; -colint col1 -60 9 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +60 19 select * from t66 order by colint; colint col1 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +60 19 ------------------------- ---- some alter table end ------------------------- @@ -4225,9 +3429,9 @@ insert into t2 values ('2006-01-25'); insert into t3 values ('2006-02-03'); insert into t3 values ('2006-01-17'); insert into t3 values ('2006-01-25'); -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t6; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6; select day(col1) from t1 order by col1; day(col1) 17 @@ -4721,9 +3925,9 @@ insert into t2 values ('2006-01-25'); insert into t3 values ('2006-02-03'); insert into t3 values ('2006-01-17'); insert into t3 values ('2006-01-25'); -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t6; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6; select dayofmonth(col1) from t1 order by col1; dayofmonth(col1) 17 @@ -5217,9 +4421,9 @@ insert into t2 values ('2006-01-25'); insert into t3 values ('2006-01-03'); insert into t3 values ('2006-02-17'); insert into t3 values ('2006-01-25'); -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t6; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6; select dayofweek(col1) from t1 order by col1; dayofweek(col1) 3 @@ -5725,9 +4929,9 @@ insert into t2 values ('2006-02-25'); insert into t3 values ('2006-01-03'); insert into t3 values ('2006-01-17'); insert into t3 values ('2006-02-25'); -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t6; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6; select dayofyear(col1) from t1 order by col1; dayofyear(col1) 3 @@ -6223,9 +5427,9 @@ insert into t2 values ('2006-02-25'); insert into t3 values ('2006-01-03'); insert into t3 values ('2006-01-17'); insert into t3 values ('2006-02-25'); -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t6; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6; select dayofyear(col1) from t1 order by col1; dayofyear(col1) 3 @@ -6721,9 +5925,9 @@ insert into t2 values ('2006-01-25'); insert into t3 values ('2006-01-03'); insert into t3 values ('2006-02-17'); insert into t3 values ('2006-01-25'); -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t6; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6; select extract(month from col1) from t1 order by col1; extract(month from col1) 1 @@ -7219,9 +6423,9 @@ insert into t2 values ('21:59'); insert into t3 values ('09:09'); insert into t3 values ('14:30'); insert into t3 values ('21:59'); -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_time.inc' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_time.inc' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_time.inc' into table t6; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t4; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t5; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t6; select hour(col1) from t1 order by col1; hour(col1) 9 @@ -7723,9 +6927,9 @@ insert into t2 values ('00:59:22.000024'); insert into t3 values ('09:09:15.000002'); insert into t3 values ('04:30:01.000018'); insert into t3 values ('00:59:22.000024'); -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_time.inc' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_time.inc' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_time.inc' into table t6; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t4; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t5; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t6; select microsecond(col1) from t1 order by col1; microsecond(col1) 0 @@ -8213,9 +7417,9 @@ insert into t2 values ('21:59:22'); insert into t3 values ('09:09:15'); insert into t3 values ('14:30:45'); insert into t3 values ('21:59:22'); -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_time.inc' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_time.inc' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_time.inc' into table t6; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t4; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t5; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t6; select minute(col1) from t1 order by col1; minute(col1) 9 @@ -8723,9 +7927,9 @@ insert into t2 values ('21:59:22'); insert into t3 values ('09:09:09'); insert into t3 values ('14:30:20'); insert into t3 values ('21:59:22'); -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_time.inc' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_time.inc' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_time.inc' into table t6; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t4; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t5; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t6; select second(col1) from t1 order by col1; second(col1) 9 @@ -9233,9 +8437,9 @@ insert into t2 values ('21:59:22'); insert into t3 values ('09:09:09'); insert into t3 values ('14:30:20'); insert into t3 values ('21:59:22'); -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_time.inc' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_time.inc' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_time.inc' into table t6; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t4; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t5; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t6; select second(col1) from t1 order by col1; second(col1) 9 @@ -9743,9 +8947,9 @@ insert into t2 values ('2006-05-25'); insert into t3 values ('2006-01-03'); insert into t3 values ('2006-12-17'); insert into t3 values ('2006-05-25'); -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t6; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6; select month(col1) from t1 order by col1; month(col1) 1 @@ -10247,9 +9451,9 @@ insert into t2 values ('2006-09-25'); insert into t3 values ('2006-01-03'); insert into t3 values ('2006-12-17'); insert into t3 values ('2006-09-25'); -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t6; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6; select quarter(col1) from t1 order by col1; quarter(col1) 1 @@ -10749,9 +9953,9 @@ insert into t2 values ('21:59:22'); insert into t3 values ('09:09:15'); insert into t3 values ('14:30:45'); insert into t3 values ('21:59:22'); -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_time.inc' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_time.inc' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_time.inc' into table t6; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t4; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t5; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t6; select time_to_sec(col1)-(time_to_sec(col1)-20) from t1 order by col1; time_to_sec(col1)-(time_to_sec(col1)-20) 20 @@ -11257,9 +10461,9 @@ insert into t2 values ('2006-01-25'); insert into t3 values ('2006-02-03'); insert into t3 values ('2006-01-17'); insert into t3 values ('2006-01-25'); -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t6; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6; select to_days(col1)-to_days('2006-01-01') from t1 order by col1; to_days(col1)-to_days('2006-01-01') 16 @@ -11701,6 +10905,506 @@ drop table if exists t44 ; drop table if exists t55 ; drop table if exists t66 ; ------------------------------------------------------------------------- +--- datediff(col1, '2006-01-01') in partition with coltype date +------------------------------------------------------------------------- +drop table if exists t1 ; +drop table if exists t2 ; +drop table if exists t3 ; +drop table if exists t4 ; +drop table if exists t5 ; +drop table if exists t6 ; +------------------------------------------------------------------------- +--- Create tables with datediff(col1, '2006-01-01') +------------------------------------------------------------------------- +create table t1 (col1 date) engine='INNODB' +partition by range(datediff(col1, '2006-01-01')) +(partition p0 values less than (15), +partition p1 values less than maxvalue); +create table t2 (col1 date) engine='INNODB' +partition by list(datediff(col1, '2006-01-01')) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +create table t3 (col1 date) engine='INNODB' +partition by hash(datediff(col1, '2006-01-01')); +create table t4 (colint int, col1 date) engine='INNODB' +partition by range(colint) +subpartition by hash(datediff(col1, '2006-01-01')) subpartitions 2 +(partition p0 values less than (15), +partition p1 values less than maxvalue); +create table t5 (colint int, col1 date) engine='INNODB' +partition by list(colint) +subpartition by hash(datediff(col1, '2006-01-01')) subpartitions 2 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +create table t6 (colint int, col1 date) engine='INNODB' +partition by range(colint) +(partition p0 values less than (datediff('2006-02-02', '2006-01-01')), +partition p1 values less than maxvalue); +------------------------------------------------------------------------- +--- Access tables with datediff(col1, '2006-01-01') +------------------------------------------------------------------------- +insert into t1 values ('2006-02-03'); +insert into t1 values ('2006-01-17'); +insert into t2 values ('2006-02-03'); +insert into t2 values ('2006-01-17'); +insert into t2 values ('2006-01-25'); +insert into t3 values ('2006-02-03'); +insert into t3 values ('2006-01-17'); +insert into t3 values ('2006-01-25'); +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6; +select datediff(col1, '2006-01-01') from t1 order by col1; +datediff(col1, '2006-01-01') +16 +33 +select * from t1 order by col1; +col1 +2006-01-17 +2006-02-03 +select * from t2 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-03 +select * from t3 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-03 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +update t1 set col1='2006-02-06' where col1='2006-02-03'; +update t2 set col1='2006-02-06' where col1='2006-02-03'; +update t3 set col1='2006-02-06' where col1='2006-02-03'; +update t4 set col1='2006-02-06' where col1='2006-02-03'; +update t5 set col1='2006-02-06' where col1='2006-02-03'; +update t6 set col1='2006-02-06' where col1='2006-02-03'; +select * from t1 order by col1; +col1 +2006-01-17 +2006-02-06 +select * from t2 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-06 +select * from t3 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-06 +select * from t4 order by colint; +colint col1 +1 2006-02-06 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-06 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t6 order by colint; +colint col1 +1 2006-02-06 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +------------------------------------------------------------------------- +--- Alter tables with datediff(col1, '2006-01-01') +------------------------------------------------------------------------- +drop table if exists t11 ; +drop table if exists t22 ; +drop table if exists t33 ; +drop table if exists t44 ; +drop table if exists t55 ; +drop table if exists t66 ; +create table t11 engine='INNODB' as select * from t1; +create table t22 engine='INNODB' as select * from t2; +create table t33 engine='INNODB' as select * from t3; +create table t44 engine='INNODB' as select * from t4; +create table t55 engine='INNODB' as select * from t5; +create table t66 engine='INNODB' as select * from t6; +alter table t11 +partition by range(datediff(col1, '2006-01-01')) +(partition p0 values less than (15), +partition p1 values less than maxvalue); +alter table t22 +partition by list(datediff(col1, '2006-01-01')) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +alter table t33 +partition by hash(datediff(col1, '2006-01-01')); +alter table t44 +partition by range(colint) +subpartition by hash(datediff(col1, '2006-01-01')) subpartitions 2 +(partition p0 values less than (15), +partition p1 values less than maxvalue); +alter table t55 +partition by list(colint) +subpartition by hash(datediff(col1, '2006-01-01')) subpartitions 2 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +alter table t66 +partition by range(colint) +(partition p0 values less than (datediff('2006-02-02', '2006-01-01')), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-01-17 +2006-02-06 +select * from t22 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-06 +select * from t33 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-06 +select * from t44 order by colint; +colint col1 +1 2006-02-06 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t55 order by colint; +colint col1 +1 2006-02-06 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t66 order by colint; +colint col1 +1 2006-02-06 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +--------------------------- +---- some alter table begin +--------------------------- +alter table t11 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-01-17 +2006-02-06 +alter table t11 +reorganize partition s1 into +(partition p0 values less than (15), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-01-17 +2006-02-06 +alter table t55 +partition by list(colint) +subpartition by hash(datediff(col1, '2006-01-01')) subpartitions 5 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +show create table t55; +Table Create Table +t55 CREATE TABLE `t55` ( + `colint` int(11) DEFAULT NULL, + `col1` date DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (datediff(col1, '2006-01-01')) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = InnoDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */ +select * from t55 order by colint; +colint col1 +1 2006-02-06 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-06 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (datediff('2006-02-02', '2006-01-01')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-06 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-06 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (datediff('2006-02-02', '2006-01-01')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-06 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with datediff(col1, '2006-01-01') +------------------------------------------------------------------------- +delete from t1 where col1='2006-01-17'; +delete from t2 where col1='2006-01-17'; +delete from t3 where col1='2006-01-17'; +delete from t4 where col1='2006-01-17'; +delete from t5 where col1='2006-01-17'; +delete from t6 where col1='2006-01-17'; +select * from t1 order by col1; +col1 +2006-02-06 +select * from t2 order by col1; +col1 +2006-01-25 +2006-02-06 +select * from t3 order by col1; +col1 +2006-01-25 +2006-02-06 +select * from t4 order by colint; +colint col1 +1 2006-02-06 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-06 +3 2006-01-25 +4 2006-02-05 +insert into t1 values ('2006-01-17'); +insert into t2 values ('2006-01-17'); +insert into t3 values ('2006-01-17'); +insert into t4 values (60,'2006-01-17'); +insert into t5 values (60,'2006-01-17'); +insert into t6 values (60,'2006-01-17'); +select * from t1 order by col1; +col1 +2006-01-17 +2006-02-06 +select * from t2 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-06 +select * from t3 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-06 +select * from t4 order by colint; +colint col1 +1 2006-02-06 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +select * from t5 order by colint; +colint col1 +1 2006-02-06 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +select * from t6 order by colint; +colint col1 +1 2006-02-06 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +alter table t1 drop partition p0; +alter table t2 drop partition p0; +alter table t4 drop partition p0; +alter table t5 drop partition p0; +alter table t6 drop partition p0; +select * from t1 order by col1; +col1 +2006-01-17 +2006-02-06 +select * from t2 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-06 +select * from t3 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-06 +select * from t4 order by colint; +colint col1 +60 2006-01-17 +select * from t5 order by colint; +colint col1 +60 2006-01-17 +select * from t6 order by colint; +colint col1 +60 2006-01-17 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with datediff(col1, '2006-01-01') +------------------------------------------------------------------------- +delete from t11 where col1='2006-01-17'; +delete from t22 where col1='2006-01-17'; +delete from t33 where col1='2006-01-17'; +delete from t44 where col1='2006-01-17'; +delete from t55 where col1='2006-01-17'; +delete from t66 where col1='2006-01-17'; +select * from t11 order by col1; +col1 +2006-02-06 +select * from t22 order by col1; +col1 +2006-01-25 +2006-02-06 +select * from t33 order by col1; +col1 +2006-01-25 +2006-02-06 +select * from t44 order by colint; +colint col1 +1 2006-02-06 +3 2006-01-25 +4 2006-02-05 +select * from t55 order by colint; +colint col1 +1 2006-02-06 +3 2006-01-25 +4 2006-02-05 +insert into t11 values ('2006-01-17'); +insert into t22 values ('2006-01-17'); +insert into t33 values ('2006-01-17'); +insert into t44 values (60,'2006-01-17'); +insert into t55 values (60,'2006-01-17'); +insert into t66 values (60,'2006-01-17'); +select * from t11 order by col1; +col1 +2006-01-17 +2006-02-06 +select * from t22 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-06 +select * from t33 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-06 +select * from t44 order by colint; +colint col1 +1 2006-02-06 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +select * from t55 order by colint; +colint col1 +1 2006-02-06 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +select * from t66 order by colint; +colint col1 +1 2006-02-06 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +alter table t11 drop partition p0; +alter table t22 drop partition p0; +alter table t44 drop partition p0; +alter table t55 drop partition p0; +alter table t66 drop partition p0; +select * from t11 order by col1; +col1 +2006-01-17 +2006-02-06 +select * from t22 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-06 +select * from t33 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-06 +select * from t44 order by colint; +colint col1 +60 2006-01-17 +select * from t55 order by colint; +colint col1 +60 2006-01-17 +select * from t66 order by colint; +colint col1 +60 2006-01-17 +------------------------- +---- some alter table end +------------------------- +drop table if exists t1 ; +drop table if exists t2 ; +drop table if exists t3 ; +drop table if exists t4 ; +drop table if exists t5 ; +drop table if exists t6 ; +drop table if exists t11 ; +drop table if exists t22 ; +drop table if exists t33 ; +drop table if exists t44 ; +drop table if exists t55 ; +drop table if exists t66 ; +------------------------------------------------------------------------- --- weekday(col1) in partition with coltype date ------------------------------------------------------------------------- drop table if exists t1 ; @@ -11757,9 +11461,9 @@ insert into t2 values ('2006-05-25'); insert into t3 values ('2006-12-03'); insert into t3 values ('2006-11-17'); insert into t3 values ('2006-05-25'); -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t6; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6; select weekday(col1) from t1 order by col1; weekday(col1) 4 @@ -12201,514 +11905,6 @@ drop table if exists t44 ; drop table if exists t55 ; drop table if exists t66 ; ------------------------------------------------------------------------- ---- weekofyear(col1) in partition with coltype date -------------------------------------------------------------------------- -drop table if exists t1 ; -drop table if exists t2 ; -drop table if exists t3 ; -drop table if exists t4 ; -drop table if exists t5 ; -drop table if exists t6 ; -------------------------------------------------------------------------- ---- Create tables with weekofyear(col1) -------------------------------------------------------------------------- -create table t1 (col1 date) engine='INNODB' -partition by range(weekofyear(col1)) -(partition p0 values less than (15), -partition p1 values less than maxvalue); -create table t2 (col1 date) engine='INNODB' -partition by list(weekofyear(col1)) -(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -create table t3 (col1 date) engine='INNODB' -partition by hash(weekofyear(col1)); -create table t4 (colint int, col1 date) engine='INNODB' -partition by range(colint) -subpartition by hash(weekofyear(col1)) subpartitions 2 -(partition p0 values less than (15), -partition p1 values less than maxvalue); -create table t5 (colint int, col1 date) engine='INNODB' -partition by list(colint) -subpartition by hash(weekofyear(col1)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -create table t6 (colint int, col1 date) engine='INNODB' -partition by range(colint) -(partition p0 values less than (weekofyear('2006-02-14')), -partition p1 values less than maxvalue); -------------------------------------------------------------------------- ---- Access tables with weekofyear(col1) -------------------------------------------------------------------------- -insert into t1 values ('2006-01-03'); -insert into t1 values ('2006-03-17'); -insert into t2 values ('2006-01-03'); -insert into t2 values ('2006-03-17'); -insert into t2 values ('2006-05-25'); -insert into t3 values ('2006-01-03'); -insert into t3 values ('2006-03-17'); -insert into t3 values ('2006-05-25'); -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t6; -select weekofyear(col1) from t1 order by col1; -weekofyear(col1) -1 -11 -select * from t1 order by col1; -col1 -2006-01-03 -2006-03-17 -select * from t2 order by col1; -col1 -2006-01-03 -2006-03-17 -2006-05-25 -select * from t3 order by col1; -col1 -2006-01-03 -2006-03-17 -2006-05-25 -select * from t4 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -select * from t5 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -select * from t6 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -update t1 set col1='2006-09-06' where col1='2006-01-03'; -update t2 set col1='2006-09-06' where col1='2006-01-03'; -update t3 set col1='2006-09-06' where col1='2006-01-03'; -update t4 set col1='2006-09-06' where col1='2006-01-03'; -update t5 set col1='2006-09-06' where col1='2006-01-03'; -update t6 set col1='2006-09-06' where col1='2006-01-03'; -select * from t1 order by col1; -col1 -2006-03-17 -2006-09-06 -select * from t2 order by col1; -col1 -2006-03-17 -2006-05-25 -2006-09-06 -select * from t3 order by col1; -col1 -2006-03-17 -2006-05-25 -2006-09-06 -select * from t4 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -select * from t5 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -select * from t6 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -------------------------------------------------------------------------- ---- Alter tables with weekofyear(col1) -------------------------------------------------------------------------- -drop table if exists t11 ; -drop table if exists t22 ; -drop table if exists t33 ; -drop table if exists t44 ; -drop table if exists t55 ; -drop table if exists t66 ; -create table t11 engine='INNODB' as select * from t1; -create table t22 engine='INNODB' as select * from t2; -create table t33 engine='INNODB' as select * from t3; -create table t44 engine='INNODB' as select * from t4; -create table t55 engine='INNODB' as select * from t5; -create table t66 engine='INNODB' as select * from t6; -alter table t11 -partition by range(weekofyear(col1)) -(partition p0 values less than (15), -partition p1 values less than maxvalue); -alter table t22 -partition by list(weekofyear(col1)) -(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -alter table t33 -partition by hash(weekofyear(col1)); -alter table t44 -partition by range(colint) -subpartition by hash(weekofyear(col1)) subpartitions 2 -(partition p0 values less than (15), -partition p1 values less than maxvalue); -alter table t55 -partition by list(colint) -subpartition by hash(weekofyear(col1)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -alter table t66 -partition by range(colint) -(partition p0 values less than (weekofyear('2006-02-14')), -partition p1 values less than maxvalue); -select * from t11 order by col1; -col1 -2006-03-17 -2006-09-06 -select * from t22 order by col1; -col1 -2006-03-17 -2006-05-25 -2006-09-06 -select * from t33 order by col1; -col1 -2006-03-17 -2006-05-25 -2006-09-06 -select * from t44 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -select * from t55 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 ---------------------------- ----- some alter table begin ---------------------------- -alter table t11 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t11 order by col1; -col1 -2006-03-17 -2006-09-06 -alter table t11 -reorganize partition s1 into -(partition p0 values less than (15), -partition p1 values less than maxvalue); -select * from t11 order by col1; -col1 -2006-03-17 -2006-09-06 -alter table t55 -partition by list(colint) -subpartition by hash(weekofyear(col1)) subpartitions 5 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -show create table t55; -Table Create Table -t55 CREATE TABLE `t55` ( - `colint` int(11) DEFAULT NULL, - `col1` date DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (weekofyear(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = InnoDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = InnoDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = InnoDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = InnoDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */ -select * from t55 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (weekofyear('2006-02-14')), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (weekofyear('2006-02-14')), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -------------------------------------------------------------------------- ---- Delete rows and partitions of tables with weekofyear(col1) -------------------------------------------------------------------------- -delete from t1 where col1='2006-03-17'; -delete from t2 where col1='2006-03-17'; -delete from t3 where col1='2006-03-17'; -delete from t4 where col1='2006-03-17'; -delete from t5 where col1='2006-03-17'; -delete from t6 where col1='2006-03-17'; -select * from t1 order by col1; -col1 -2006-09-06 -select * from t2 order by col1; -col1 -2006-05-25 -2006-09-06 -select * from t3 order by col1; -col1 -2006-05-25 -2006-09-06 -select * from t4 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -select * from t5 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -insert into t1 values ('2006-03-17'); -insert into t2 values ('2006-03-17'); -insert into t3 values ('2006-03-17'); -insert into t4 values (60,'2006-03-17'); -insert into t5 values (60,'2006-03-17'); -insert into t6 values (60,'2006-03-17'); -select * from t1 order by col1; -col1 -2006-03-17 -2006-09-06 -select * from t2 order by col1; -col1 -2006-03-17 -2006-05-25 -2006-09-06 -select * from t3 order by col1; -col1 -2006-03-17 -2006-05-25 -2006-09-06 -select * from t4 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -60 2006-03-17 -select * from t5 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -60 2006-03-17 -select * from t6 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -60 2006-03-17 -alter table t1 drop partition p0; -alter table t2 drop partition p0; -alter table t4 drop partition p0; -alter table t5 drop partition p0; -alter table t6 drop partition p0; -select * from t1 order by col1; -col1 -2006-09-06 -select * from t2 order by col1; -col1 -2006-03-17 -2006-05-25 -2006-09-06 -select * from t3 order by col1; -col1 -2006-03-17 -2006-05-25 -2006-09-06 -select * from t4 order by colint; -colint col1 -60 2006-03-17 -select * from t5 order by colint; -colint col1 -60 2006-03-17 -select * from t6 order by colint; -colint col1 -60 2006-03-17 -------------------------------------------------------------------------- ---- Delete rows and partitions of tables with weekofyear(col1) -------------------------------------------------------------------------- -delete from t11 where col1='2006-03-17'; -delete from t22 where col1='2006-03-17'; -delete from t33 where col1='2006-03-17'; -delete from t44 where col1='2006-03-17'; -delete from t55 where col1='2006-03-17'; -delete from t66 where col1='2006-03-17'; -select * from t11 order by col1; -col1 -2006-09-06 -select * from t22 order by col1; -col1 -2006-05-25 -2006-09-06 -select * from t33 order by col1; -col1 -2006-05-25 -2006-09-06 -select * from t44 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -select * from t55 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -insert into t11 values ('2006-03-17'); -insert into t22 values ('2006-03-17'); -insert into t33 values ('2006-03-17'); -insert into t44 values (60,'2006-03-17'); -insert into t55 values (60,'2006-03-17'); -insert into t66 values (60,'2006-03-17'); -select * from t11 order by col1; -col1 -2006-03-17 -2006-09-06 -select * from t22 order by col1; -col1 -2006-03-17 -2006-05-25 -2006-09-06 -select * from t33 order by col1; -col1 -2006-03-17 -2006-05-25 -2006-09-06 -select * from t44 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -60 2006-03-17 -select * from t55 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -60 2006-03-17 -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -60 2006-03-17 -alter table t11 drop partition p0; -alter table t22 drop partition p0; -alter table t44 drop partition p0; -alter table t55 drop partition p0; -alter table t66 drop partition p0; -select * from t11 order by col1; -col1 -2006-09-06 -select * from t22 order by col1; -col1 -2006-03-17 -2006-05-25 -2006-09-06 -select * from t33 order by col1; -col1 -2006-03-17 -2006-05-25 -2006-09-06 -select * from t44 order by colint; -colint col1 -60 2006-03-17 -select * from t55 order by colint; -colint col1 -60 2006-03-17 -select * from t66 order by colint; -colint col1 -60 2006-03-17 -------------------------- ----- some alter table end -------------------------- -drop table if exists t1 ; -drop table if exists t2 ; -drop table if exists t3 ; -drop table if exists t4 ; -drop table if exists t5 ; -drop table if exists t6 ; -drop table if exists t11 ; -drop table if exists t22 ; -drop table if exists t33 ; -drop table if exists t44 ; -drop table if exists t55 ; -drop table if exists t66 ; -------------------------------------------------------------------------- --- year(col1)-1990 in partition with coltype date ------------------------------------------------------------------------- drop table if exists t1 ; @@ -12765,9 +11961,9 @@ insert into t2 values ('2004-05-25'); insert into t3 values ('1996-01-03'); insert into t3 values ('2000-02-17'); insert into t3 values ('2004-05-25'); -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t6; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6; select year(col1)-1990 from t1 order by col1; year(col1)-1990 6 @@ -13269,9 +12465,9 @@ insert into t2 values ('2006-03-25'); insert into t3 values ('2006-01-03'); insert into t3 values ('2006-08-17'); insert into t3 values ('2006-03-25'); -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t6; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6; select yearweek(col1)-200600 from t1 order by col1; yearweek(col1)-200600 1 diff --git a/mysql-test/suite/parts/r/part_supported_sql_func_myisam.result b/mysql-test/suite/parts/r/part_supported_sql_func_myisam.result index 3e668139c7d..f14f9517646 100644 --- a/mysql-test/suite/parts/r/part_supported_sql_func_myisam.result +++ b/mysql-test/suite/parts/r/part_supported_sql_func_myisam.result @@ -55,9 +55,9 @@ insert into t2 values (17 ); insert into t3 values (5 ); insert into t3 values (13 ); insert into t3 values (17 ); -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_int.inc' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_int.inc' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_int.inc' into table t6; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_int.inc' into table t4; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_int.inc' into table t5; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_int.inc' into table t6; select abs(col1) from t1 order by col1; abs(col1) 5 @@ -1675,7 +1675,7 @@ drop table if exists t44 ; drop table if exists t55 ; drop table if exists t66 ; ------------------------------------------------------------------------- ---- ascii(col1) in partition with coltype char(1) +--- mod(col1,10) in partition with coltype int ------------------------------------------------------------------------- drop table if exists t1 ; drop table if exists t2 ; @@ -1684,14 +1684,14 @@ drop table if exists t4 ; drop table if exists t5 ; drop table if exists t6 ; ------------------------------------------------------------------------- ---- Create tables with ascii(col1) +--- Create tables with mod(col1,10) ------------------------------------------------------------------------- -create table t1 (col1 char(1)) engine='MYISAM' -partition by range(ascii(col1)) +create table t1 (col1 int) engine='MYISAM' +partition by range(mod(col1,10)) (partition p0 values less than (15), partition p1 values less than maxvalue); -create table t2 (col1 char(1)) engine='MYISAM' -partition by list(ascii(col1)) +create table t2 (col1 int) engine='MYISAM' +partition by list(mod(col1,10)) (partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30), @@ -1699,16 +1699,16 @@ partition p3 values in (31,32,33,34,35,36,37,38,39,40), partition p4 values in (41,42,43,44,45,46,47,48,49,50), partition p5 values in (51,52,53,54,55,56,57,58,59,60) ); -create table t3 (col1 char(1)) engine='MYISAM' -partition by hash(ascii(col1)); -create table t4 (colint int, col1 char(1)) engine='MYISAM' +create table t3 (col1 int) engine='MYISAM' +partition by hash(mod(col1,10)); +create table t4 (colint int, col1 int) engine='MYISAM' partition by range(colint) -subpartition by hash(ascii(col1)) subpartitions 2 +subpartition by hash(mod(col1,10)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than maxvalue); -create table t5 (colint int, col1 char(1)) engine='MYISAM' +create table t5 (colint int, col1 int) engine='MYISAM' partition by list(colint) -subpartition by hash(ascii(col1)) subpartitions 2 +subpartition by hash(mod(col1,10)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30), @@ -1716,1596 +1716,346 @@ partition p3 values in (31,32,33,34,35,36,37,38,39,40), partition p4 values in (41,42,43,44,45,46,47,48,49,50), partition p5 values in (51,52,53,54,55,56,57,58,59,60) ); -create table t6 (colint int, col1 char(1)) engine='MYISAM' +create table t6 (colint int, col1 int) engine='MYISAM' partition by range(colint) -(partition p0 values less than (ascii('5')), +(partition p0 values less than (mod(15,10)), partition p1 values less than maxvalue); ------------------------------------------------------------------------- ---- Access tables with ascii(col1) +--- Access tables with mod(col1,10) ------------------------------------------------------------------------- -insert into t1 values ('1'); -insert into t1 values ('9'); -insert into t2 values ('1'); -insert into t2 values ('9'); -insert into t2 values ('3'); -insert into t3 values ('1'); -insert into t3 values ('9'); -insert into t3 values ('3'); -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_ch1.inc' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_ch1.inc' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_ch1.inc' into table t6; -select ascii(col1) from t1 order by col1; -ascii(col1) -49 -57 -select * from t1 order by col1; -col1 -1 -9 -select * from t2 order by col1; -col1 -1 -3 -9 -select * from t3 order by col1; -col1 -1 -3 -9 -select * from t4 order by colint; -colint col1 -1 1 -2 9 -3 3 -4 8 -select * from t5 order by colint; -colint col1 -1 1 -2 9 -3 3 -4 8 -select * from t6 order by colint; -colint col1 -1 1 -2 9 -3 3 -4 8 -update t1 set col1='8' where col1='1'; -update t2 set col1='8' where col1='1'; -update t3 set col1='8' where col1='1'; -update t4 set col1='8' where col1='1'; -update t5 set col1='8' where col1='1'; -update t6 set col1='8' where col1='1'; -select * from t1 order by col1; -col1 -8 -9 -select * from t2 order by col1; -col1 -3 -8 -9 -select * from t3 order by col1; -col1 -3 -8 -9 -select * from t4 order by colint; -colint col1 -1 8 -2 9 -3 3 -4 8 -select * from t5 order by colint; -colint col1 -1 8 -2 9 -3 3 -4 8 -select * from t6 order by colint; -colint col1 -1 8 -2 9 -3 3 -4 8 -------------------------------------------------------------------------- ---- Alter tables with ascii(col1) -------------------------------------------------------------------------- -drop table if exists t11 ; -drop table if exists t22 ; -drop table if exists t33 ; -drop table if exists t44 ; -drop table if exists t55 ; -drop table if exists t66 ; -create table t11 engine='MYISAM' as select * from t1; -create table t22 engine='MYISAM' as select * from t2; -create table t33 engine='MYISAM' as select * from t3; -create table t44 engine='MYISAM' as select * from t4; -create table t55 engine='MYISAM' as select * from t5; -create table t66 engine='MYISAM' as select * from t6; -alter table t11 -partition by range(ascii(col1)) -(partition p0 values less than (15), -partition p1 values less than maxvalue); -alter table t22 -partition by list(ascii(col1)) -(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -alter table t33 -partition by hash(ascii(col1)); -alter table t44 -partition by range(colint) -subpartition by hash(ascii(col1)) subpartitions 2 -(partition p0 values less than (15), -partition p1 values less than maxvalue); -alter table t55 -partition by list(colint) -subpartition by hash(ascii(col1)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -alter table t66 -partition by range(colint) -(partition p0 values less than (ascii('5')), -partition p1 values less than maxvalue); -select * from t11 order by col1; -col1 -8 -9 -select * from t22 order by col1; -col1 -3 -8 -9 -select * from t33 order by col1; -col1 -3 -8 -9 -select * from t44 order by colint; -colint col1 -1 8 -2 9 -3 3 -4 8 -select * from t55 order by colint; -colint col1 -1 8 -2 9 -3 3 -4 8 -select * from t66 order by colint; -colint col1 -1 8 -2 9 -3 3 -4 8 ---------------------------- ----- some alter table begin ---------------------------- -alter table t11 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t11 order by col1; -col1 -8 -9 -alter table t11 -reorganize partition s1 into -(partition p0 values less than (15), -partition p1 values less than maxvalue); -select * from t11 order by col1; -col1 -8 -9 -alter table t55 -partition by list(colint) -subpartition by hash(ascii(col1)) subpartitions 5 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -show create table t55; -Table Create Table -t55 CREATE TABLE `t55` ( - `colint` int(11) DEFAULT NULL, - `col1` char(1) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (ascii(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */ -select * from t55 order by colint; -colint col1 -1 8 -2 9 -3 3 -4 8 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 8 -2 9 -3 3 -4 8 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (ascii('5')), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 8 -2 9 -3 3 -4 8 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 8 -2 9 -3 3 -4 8 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (ascii('5')), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 8 -2 9 -3 3 -4 8 -------------------------------------------------------------------------- ---- Delete rows and partitions of tables with ascii(col1) -------------------------------------------------------------------------- -delete from t1 where col1='9'; -delete from t2 where col1='9'; -delete from t3 where col1='9'; -delete from t4 where col1='9'; -delete from t5 where col1='9'; -delete from t6 where col1='9'; -select * from t1 order by col1; -col1 -8 -select * from t2 order by col1; -col1 -3 -8 -select * from t3 order by col1; -col1 -3 -8 -select * from t4 order by colint; -colint col1 -1 8 -3 3 -4 8 -select * from t5 order by colint; -colint col1 -1 8 -3 3 -4 8 -insert into t1 values ('9'); -insert into t2 values ('9'); -insert into t3 values ('9'); -insert into t4 values (60,'9'); -insert into t5 values (60,'9'); -insert into t6 values (60,'9'); -select * from t1 order by col1; -col1 -8 -9 -select * from t2 order by col1; -col1 -3 -8 -9 -select * from t3 order by col1; -col1 -3 -8 -9 -select * from t4 order by colint; -colint col1 -1 8 -3 3 -4 8 -60 9 -select * from t5 order by colint; -colint col1 -1 8 -3 3 -4 8 -60 9 -select * from t6 order by colint; -colint col1 -1 8 -3 3 -4 8 -60 9 -alter table t1 drop partition p0; -alter table t2 drop partition p0; -alter table t4 drop partition p0; -alter table t5 drop partition p0; -alter table t6 drop partition p0; -select * from t1 order by col1; -col1 -8 -9 -select * from t2 order by col1; -col1 -3 -8 -9 -select * from t3 order by col1; -col1 -3 -8 -9 -select * from t4 order by colint; -colint col1 -60 9 -select * from t5 order by colint; -colint col1 -60 9 -select * from t6 order by colint; -colint col1 -60 9 -------------------------------------------------------------------------- ---- Delete rows and partitions of tables with ascii(col1) -------------------------------------------------------------------------- -delete from t11 where col1='9'; -delete from t22 where col1='9'; -delete from t33 where col1='9'; -delete from t44 where col1='9'; -delete from t55 where col1='9'; -delete from t66 where col1='9'; -select * from t11 order by col1; -col1 -8 -select * from t22 order by col1; -col1 -3 -8 -select * from t33 order by col1; -col1 -3 -8 -select * from t44 order by colint; -colint col1 -1 8 -3 3 -4 8 -select * from t55 order by colint; -colint col1 -1 8 -3 3 -4 8 -insert into t11 values ('9'); -insert into t22 values ('9'); -insert into t33 values ('9'); -insert into t44 values (60,'9'); -insert into t55 values (60,'9'); -insert into t66 values (60,'9'); -select * from t11 order by col1; -col1 -8 -9 -select * from t22 order by col1; -col1 -3 -8 -9 -select * from t33 order by col1; -col1 -3 -8 -9 -select * from t44 order by colint; -colint col1 -1 8 -3 3 -4 8 -60 9 -select * from t55 order by colint; -colint col1 -1 8 -3 3 -4 8 -60 9 -select * from t66 order by colint; -colint col1 -1 8 -3 3 -4 8 -60 9 -alter table t11 drop partition p0; -alter table t22 drop partition p0; -alter table t44 drop partition p0; -alter table t55 drop partition p0; -alter table t66 drop partition p0; -select * from t11 order by col1; -col1 -8 -9 -select * from t22 order by col1; -col1 -3 -8 -9 -select * from t33 order by col1; -col1 -3 -8 -9 -select * from t44 order by colint; -colint col1 -60 9 -select * from t55 order by colint; -colint col1 -60 9 -select * from t66 order by colint; -colint col1 -60 9 -------------------------- ----- some alter table end -------------------------- -drop table if exists t1 ; -drop table if exists t2 ; -drop table if exists t3 ; -drop table if exists t4 ; -drop table if exists t5 ; -drop table if exists t6 ; -drop table if exists t11 ; -drop table if exists t22 ; -drop table if exists t33 ; -drop table if exists t44 ; -drop table if exists t55 ; -drop table if exists t66 ; -------------------------------------------------------------------------- ---- cast(ceiling(col1) as signed integer) in partition with coltype float(7,4) -------------------------------------------------------------------------- -drop table if exists t1 ; -drop table if exists t2 ; -drop table if exists t3 ; -drop table if exists t4 ; -drop table if exists t5 ; -drop table if exists t6 ; -------------------------------------------------------------------------- ---- Create tables with cast(ceiling(col1) as signed integer) -------------------------------------------------------------------------- -create table t1 (col1 float(7,4)) engine='MYISAM' -partition by range(cast(ceiling(col1) as signed integer)) -(partition p0 values less than (15), -partition p1 values less than maxvalue); -create table t2 (col1 float(7,4)) engine='MYISAM' -partition by list(cast(ceiling(col1) as signed integer)) -(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -create table t3 (col1 float(7,4)) engine='MYISAM' -partition by hash(cast(ceiling(col1) as signed integer)); -create table t4 (colint int, col1 float(7,4)) engine='MYISAM' -partition by range(colint) -subpartition by hash(cast(ceiling(col1) as signed integer)) subpartitions 2 -(partition p0 values less than (15), -partition p1 values less than maxvalue); -create table t5 (colint int, col1 float(7,4)) engine='MYISAM' -partition by list(colint) -subpartition by hash(cast(ceiling(col1) as signed integer)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -create table t6 (colint int, col1 float(7,4)) engine='MYISAM' -partition by range(colint) -(partition p0 values less than (cast(ceiling(15) as signed integer)), -partition p1 values less than maxvalue); -------------------------------------------------------------------------- ---- Access tables with cast(ceiling(col1) as signed integer) -------------------------------------------------------------------------- -insert into t1 values (5.1230); -insert into t1 values (13.345); -insert into t2 values (5.1230); -insert into t2 values (13.345); -insert into t2 values (17.987); -insert into t3 values (5.1230); -insert into t3 values (13.345); -insert into t3 values (17.987); -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_float.inc' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_float.inc' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_float.inc' into table t6; -select cast(ceiling(col1) as signed integer) from t1 order by col1; -cast(ceiling(col1) as signed integer) -6 -14 -select * from t1 order by col1; -col1 -5.1230 -13.3450 -select * from t2 order by col1; -col1 -5.1230 -13.3450 -17.9870 -select * from t3 order by col1; -col1 -5.1230 -13.3450 -17.9870 -select * from t4 order by colint; -colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 -select * from t5 order by colint; -colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 -select * from t6 order by colint; -colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 -update t1 set col1=15.654 where col1=5.1230; -update t2 set col1=15.654 where col1=5.1230; -update t3 set col1=15.654 where col1=5.1230; -update t4 set col1=15.654 where col1=5.1230; -update t5 set col1=15.654 where col1=5.1230; -update t6 set col1=15.654 where col1=5.1230; -select * from t1 order by col1; -col1 -13.3450 -15.6540 -select * from t2 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t3 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t4 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 -select * from t5 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 -select * from t6 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 -------------------------------------------------------------------------- ---- Alter tables with cast(ceiling(col1) as signed integer) -------------------------------------------------------------------------- -drop table if exists t11 ; -drop table if exists t22 ; -drop table if exists t33 ; -drop table if exists t44 ; -drop table if exists t55 ; -drop table if exists t66 ; -create table t11 engine='MYISAM' as select * from t1; -create table t22 engine='MYISAM' as select * from t2; -create table t33 engine='MYISAM' as select * from t3; -create table t44 engine='MYISAM' as select * from t4; -create table t55 engine='MYISAM' as select * from t5; -create table t66 engine='MYISAM' as select * from t6; -alter table t11 -partition by range(cast(ceiling(col1) as signed integer)) -(partition p0 values less than (15), -partition p1 values less than maxvalue); -alter table t22 -partition by list(cast(ceiling(col1) as signed integer)) -(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -alter table t33 -partition by hash(cast(ceiling(col1) as signed integer)); -alter table t44 -partition by range(colint) -subpartition by hash(cast(ceiling(col1) as signed integer)) subpartitions 2 -(partition p0 values less than (15), -partition p1 values less than maxvalue); -alter table t55 -partition by list(colint) -subpartition by hash(cast(ceiling(col1) as signed integer)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -alter table t66 -partition by range(colint) -(partition p0 values less than (cast(ceiling(15) as signed integer)), -partition p1 values less than maxvalue); -select * from t11 order by col1; -col1 -13.3450 -15.6540 -select * from t22 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t33 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t44 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 -select * from t55 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 -select * from t66 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 ---------------------------- ----- some alter table begin ---------------------------- -alter table t11 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t11 order by col1; -col1 -13.3450 -15.6540 -alter table t11 -reorganize partition s1 into -(partition p0 values less than (15), -partition p1 values less than maxvalue); -select * from t11 order by col1; -col1 -13.3450 -15.6540 -alter table t55 -partition by list(colint) -subpartition by hash(cast(ceiling(col1) as signed integer)) subpartitions 5 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -show create table t55; -Table Create Table -t55 CREATE TABLE `t55` ( - `colint` int(11) DEFAULT NULL, - `col1` float(7,4) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (cast(ceiling(col1) as signed integer)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */ -select * from t55 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (cast(ceiling(15) as signed integer)), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (cast(ceiling(15) as signed integer)), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 -------------------------------------------------------------------------- ---- Delete rows and partitions of tables with cast(ceiling(col1) as signed integer) -------------------------------------------------------------------------- -delete from t1 where col1=13.345; -delete from t2 where col1=13.345; -delete from t3 where col1=13.345; -delete from t4 where col1=13.345; -delete from t5 where col1=13.345; -delete from t6 where col1=13.345; -select * from t1 order by col1; -col1 -15.6540 -select * from t2 order by col1; -col1 -15.6540 -17.9870 -select * from t3 order by col1; -col1 -15.6540 -17.9870 -select * from t4 order by colint; -colint col1 -1 15.6540 -3 17.9870 -4 15.6540 -select * from t5 order by colint; -colint col1 -1 15.6540 -3 17.9870 -4 15.6540 -insert into t1 values (13.345); -insert into t2 values (13.345); -insert into t3 values (13.345); -insert into t4 values (60,13.345); -insert into t5 values (60,13.345); -insert into t6 values (60,13.345); -select * from t1 order by col1; -col1 -13.3450 -15.6540 -select * from t2 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t3 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t4 order by colint; -colint col1 -1 15.6540 -3 17.9870 -4 15.6540 -60 13.3450 -select * from t5 order by colint; -colint col1 -1 15.6540 -3 17.9870 -4 15.6540 -60 13.3450 -select * from t6 order by colint; -colint col1 -1 15.6540 -3 17.9870 -4 15.6540 -60 13.3450 -alter table t1 drop partition p0; -alter table t2 drop partition p0; -alter table t4 drop partition p0; -alter table t5 drop partition p0; -alter table t6 drop partition p0; -select * from t1 order by col1; -col1 -15.6540 -select * from t2 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t3 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t4 order by colint; -colint col1 -60 13.3450 -select * from t5 order by colint; -colint col1 -60 13.3450 -select * from t6 order by colint; -colint col1 -60 13.3450 -------------------------------------------------------------------------- ---- Delete rows and partitions of tables with cast(ceiling(col1) as signed integer) -------------------------------------------------------------------------- -delete from t11 where col1=13.345; -delete from t22 where col1=13.345; -delete from t33 where col1=13.345; -delete from t44 where col1=13.345; -delete from t55 where col1=13.345; -delete from t66 where col1=13.345; -select * from t11 order by col1; -col1 -15.6540 -select * from t22 order by col1; -col1 -15.6540 -17.9870 -select * from t33 order by col1; -col1 -15.6540 -17.9870 -select * from t44 order by colint; -colint col1 -1 15.6540 -3 17.9870 -4 15.6540 -select * from t55 order by colint; -colint col1 -1 15.6540 -3 17.9870 -4 15.6540 -insert into t11 values (13.345); -insert into t22 values (13.345); -insert into t33 values (13.345); -insert into t44 values (60,13.345); -insert into t55 values (60,13.345); -insert into t66 values (60,13.345); -select * from t11 order by col1; -col1 -13.3450 -15.6540 -select * from t22 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t33 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t44 order by colint; -colint col1 -1 15.6540 -3 17.9870 -4 15.6540 -60 13.3450 -select * from t55 order by colint; -colint col1 -1 15.6540 -3 17.9870 -4 15.6540 -60 13.3450 -select * from t66 order by colint; -colint col1 -1 15.6540 -3 17.9870 -4 15.6540 -60 13.3450 -alter table t11 drop partition p0; -alter table t22 drop partition p0; -alter table t44 drop partition p0; -alter table t55 drop partition p0; -alter table t66 drop partition p0; -select * from t11 order by col1; -col1 -15.6540 -select * from t22 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t33 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t44 order by colint; -colint col1 -60 13.3450 -select * from t55 order by colint; -colint col1 -60 13.3450 -select * from t66 order by colint; -colint col1 -60 13.3450 -------------------------- ----- some alter table end -------------------------- -drop table if exists t1 ; -drop table if exists t2 ; -drop table if exists t3 ; -drop table if exists t4 ; -drop table if exists t5 ; -drop table if exists t6 ; -drop table if exists t11 ; -drop table if exists t22 ; -drop table if exists t33 ; -drop table if exists t44 ; -drop table if exists t55 ; -drop table if exists t66 ; -------------------------------------------------------------------------- ---- cast(floor(col1) as signed) in partition with coltype float(7,4) -------------------------------------------------------------------------- -drop table if exists t1 ; -drop table if exists t2 ; -drop table if exists t3 ; -drop table if exists t4 ; -drop table if exists t5 ; -drop table if exists t6 ; -------------------------------------------------------------------------- ---- Create tables with cast(floor(col1) as signed) -------------------------------------------------------------------------- -create table t1 (col1 float(7,4)) engine='MYISAM' -partition by range(cast(floor(col1) as signed)) -(partition p0 values less than (15), -partition p1 values less than maxvalue); -create table t2 (col1 float(7,4)) engine='MYISAM' -partition by list(cast(floor(col1) as signed)) -(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -create table t3 (col1 float(7,4)) engine='MYISAM' -partition by hash(cast(floor(col1) as signed)); -create table t4 (colint int, col1 float(7,4)) engine='MYISAM' -partition by range(colint) -subpartition by hash(cast(floor(col1) as signed)) subpartitions 2 -(partition p0 values less than (15), -partition p1 values less than maxvalue); -create table t5 (colint int, col1 float(7,4)) engine='MYISAM' -partition by list(colint) -subpartition by hash(cast(floor(col1) as signed)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -create table t6 (colint int, col1 float(7,4)) engine='MYISAM' -partition by range(colint) -(partition p0 values less than (cast(floor(15.123) as signed)), -partition p1 values less than maxvalue); -------------------------------------------------------------------------- ---- Access tables with cast(floor(col1) as signed) -------------------------------------------------------------------------- -insert into t1 values (5.1230); -insert into t1 values (13.345); -insert into t2 values (5.1230); -insert into t2 values (13.345); -insert into t2 values (17.987); -insert into t3 values (5.1230); -insert into t3 values (13.345); -insert into t3 values (17.987); -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_float.inc' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_float.inc' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_float.inc' into table t6; -select cast(floor(col1) as signed) from t1 order by col1; -cast(floor(col1) as signed) -5 -13 -select * from t1 order by col1; -col1 -5.1230 -13.3450 -select * from t2 order by col1; -col1 -5.1230 -13.3450 -17.9870 -select * from t3 order by col1; -col1 -5.1230 -13.3450 -17.9870 -select * from t4 order by colint; -colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 -select * from t5 order by colint; -colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 -select * from t6 order by colint; -colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 -update t1 set col1=15.654 where col1=5.1230; -update t2 set col1=15.654 where col1=5.1230; -update t3 set col1=15.654 where col1=5.1230; -update t4 set col1=15.654 where col1=5.1230; -update t5 set col1=15.654 where col1=5.1230; -update t6 set col1=15.654 where col1=5.1230; -select * from t1 order by col1; -col1 -13.3450 -15.6540 -select * from t2 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t3 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t4 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 -select * from t5 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 -select * from t6 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 -------------------------------------------------------------------------- ---- Alter tables with cast(floor(col1) as signed) -------------------------------------------------------------------------- -drop table if exists t11 ; -drop table if exists t22 ; -drop table if exists t33 ; -drop table if exists t44 ; -drop table if exists t55 ; -drop table if exists t66 ; -create table t11 engine='MYISAM' as select * from t1; -create table t22 engine='MYISAM' as select * from t2; -create table t33 engine='MYISAM' as select * from t3; -create table t44 engine='MYISAM' as select * from t4; -create table t55 engine='MYISAM' as select * from t5; -create table t66 engine='MYISAM' as select * from t6; -alter table t11 -partition by range(cast(floor(col1) as signed)) -(partition p0 values less than (15), -partition p1 values less than maxvalue); -alter table t22 -partition by list(cast(floor(col1) as signed)) -(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -alter table t33 -partition by hash(cast(floor(col1) as signed)); -alter table t44 -partition by range(colint) -subpartition by hash(cast(floor(col1) as signed)) subpartitions 2 -(partition p0 values less than (15), -partition p1 values less than maxvalue); -alter table t55 -partition by list(colint) -subpartition by hash(cast(floor(col1) as signed)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -alter table t66 -partition by range(colint) -(partition p0 values less than (cast(floor(15.123) as signed)), -partition p1 values less than maxvalue); -select * from t11 order by col1; -col1 -13.3450 -15.6540 -select * from t22 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t33 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t44 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 -select * from t55 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 -select * from t66 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 ---------------------------- ----- some alter table begin ---------------------------- -alter table t11 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t11 order by col1; -col1 -13.3450 -15.6540 -alter table t11 -reorganize partition s1 into -(partition p0 values less than (15), -partition p1 values less than maxvalue); -select * from t11 order by col1; -col1 -13.3450 -15.6540 -alter table t55 -partition by list(colint) -subpartition by hash(cast(floor(col1) as signed)) subpartitions 5 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -show create table t55; -Table Create Table -t55 CREATE TABLE `t55` ( - `colint` int(11) DEFAULT NULL, - `col1` float(7,4) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (cast(floor(col1) as signed)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */ -select * from t55 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (cast(floor(15.123) as signed)), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (cast(floor(15.123) as signed)), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 -------------------------------------------------------------------------- ---- Delete rows and partitions of tables with cast(floor(col1) as signed) -------------------------------------------------------------------------- -delete from t1 where col1=13.345; -delete from t2 where col1=13.345; -delete from t3 where col1=13.345; -delete from t4 where col1=13.345; -delete from t5 where col1=13.345; -delete from t6 where col1=13.345; -select * from t1 order by col1; -col1 -15.6540 -select * from t2 order by col1; -col1 -15.6540 -17.9870 -select * from t3 order by col1; -col1 -15.6540 -17.9870 -select * from t4 order by colint; -colint col1 -1 15.6540 -3 17.9870 -4 15.6540 -select * from t5 order by colint; -colint col1 -1 15.6540 -3 17.9870 -4 15.6540 -insert into t1 values (13.345); -insert into t2 values (13.345); -insert into t3 values (13.345); -insert into t4 values (60,13.345); -insert into t5 values (60,13.345); -insert into t6 values (60,13.345); -select * from t1 order by col1; -col1 -13.3450 -15.6540 -select * from t2 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t3 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t4 order by colint; -colint col1 -1 15.6540 -3 17.9870 -4 15.6540 -60 13.3450 -select * from t5 order by colint; -colint col1 -1 15.6540 -3 17.9870 -4 15.6540 -60 13.3450 -select * from t6 order by colint; -colint col1 -1 15.6540 -3 17.9870 -4 15.6540 -60 13.3450 -alter table t1 drop partition p0; -alter table t2 drop partition p0; -alter table t4 drop partition p0; -alter table t5 drop partition p0; -alter table t6 drop partition p0; -select * from t1 order by col1; -col1 -15.6540 -select * from t2 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t3 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t4 order by colint; -colint col1 -60 13.3450 -select * from t5 order by colint; -colint col1 -60 13.3450 -select * from t6 order by colint; -colint col1 -60 13.3450 -------------------------------------------------------------------------- ---- Delete rows and partitions of tables with cast(floor(col1) as signed) -------------------------------------------------------------------------- -delete from t11 where col1=13.345; -delete from t22 where col1=13.345; -delete from t33 where col1=13.345; -delete from t44 where col1=13.345; -delete from t55 where col1=13.345; -delete from t66 where col1=13.345; -select * from t11 order by col1; -col1 -15.6540 -select * from t22 order by col1; -col1 -15.6540 -17.9870 -select * from t33 order by col1; -col1 -15.6540 -17.9870 -select * from t44 order by colint; -colint col1 -1 15.6540 -3 17.9870 -4 15.6540 -select * from t55 order by colint; -colint col1 -1 15.6540 -3 17.9870 -4 15.6540 -insert into t11 values (13.345); -insert into t22 values (13.345); -insert into t33 values (13.345); -insert into t44 values (60,13.345); -insert into t55 values (60,13.345); -insert into t66 values (60,13.345); -select * from t11 order by col1; -col1 -13.3450 -15.6540 -select * from t22 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t33 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t44 order by colint; -colint col1 -1 15.6540 -3 17.9870 -4 15.6540 -60 13.3450 -select * from t55 order by colint; -colint col1 -1 15.6540 -3 17.9870 -4 15.6540 -60 13.3450 -select * from t66 order by colint; -colint col1 -1 15.6540 -3 17.9870 -4 15.6540 -60 13.3450 -alter table t11 drop partition p0; -alter table t22 drop partition p0; -alter table t44 drop partition p0; -alter table t55 drop partition p0; -alter table t66 drop partition p0; -select * from t11 order by col1; -col1 -15.6540 -select * from t22 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t33 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t44 order by colint; -colint col1 -60 13.3450 -select * from t55 order by colint; -colint col1 -60 13.3450 -select * from t66 order by colint; -colint col1 -60 13.3450 -------------------------- ----- some alter table end -------------------------- -drop table if exists t1 ; -drop table if exists t2 ; -drop table if exists t3 ; -drop table if exists t4 ; -drop table if exists t5 ; -drop table if exists t6 ; -drop table if exists t11 ; -drop table if exists t22 ; -drop table if exists t33 ; -drop table if exists t44 ; -drop table if exists t55 ; -drop table if exists t66 ; -------------------------------------------------------------------------- ---- cast(mod(col1,10) as signed) in partition with coltype float(7,4) -------------------------------------------------------------------------- -drop table if exists t1 ; -drop table if exists t2 ; -drop table if exists t3 ; -drop table if exists t4 ; -drop table if exists t5 ; -drop table if exists t6 ; -------------------------------------------------------------------------- ---- Create tables with cast(mod(col1,10) as signed) -------------------------------------------------------------------------- -create table t1 (col1 float(7,4)) engine='MYISAM' -partition by range(cast(mod(col1,10) as signed)) -(partition p0 values less than (15), -partition p1 values less than maxvalue); -create table t2 (col1 float(7,4)) engine='MYISAM' -partition by list(cast(mod(col1,10) as signed)) -(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -create table t3 (col1 float(7,4)) engine='MYISAM' -partition by hash(cast(mod(col1,10) as signed)); -create table t4 (colint int, col1 float(7,4)) engine='MYISAM' -partition by range(colint) -subpartition by hash(cast(mod(col1,10) as signed)) subpartitions 2 -(partition p0 values less than (15), -partition p1 values less than maxvalue); -create table t5 (colint int, col1 float(7,4)) engine='MYISAM' -partition by list(colint) -subpartition by hash(cast(mod(col1,10) as signed)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -create table t6 (colint int, col1 float(7,4)) engine='MYISAM' -partition by range(colint) -(partition p0 values less than (cast(mod(15,10) as signed)), -partition p1 values less than maxvalue); -------------------------------------------------------------------------- ---- Access tables with cast(mod(col1,10) as signed) -------------------------------------------------------------------------- -insert into t1 values (5.0000); +insert into t1 values (5); insert into t1 values (19); -insert into t2 values (5.0000); +insert into t2 values (5); insert into t2 values (19); insert into t2 values (17); -insert into t3 values (5.0000); +insert into t3 values (5); insert into t3 values (19); insert into t3 values (17); -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_float.inc' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_float.inc' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_float.inc' into table t6; -select cast(mod(col1,10) as signed) from t1 order by col1; -cast(mod(col1,10) as signed) +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_int.inc' into table t4; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_int.inc' into table t5; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_int.inc' into table t6; +select mod(col1,10) from t1 order by col1; +mod(col1,10) 5 9 select * from t1 order by col1; col1 -5.0000 -19.0000 +5 +19 select * from t2 order by col1; col1 -5.0000 -17.0000 -19.0000 +5 +17 +19 select * from t3 order by col1; col1 -5.0000 -17.0000 -19.0000 +5 +17 +19 select * from t4 order by colint; colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 +1 5 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 5 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 select * from t5 order by colint; colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 +1 5 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 5 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 select * from t6 order by colint; colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 -update t1 set col1=15 where col1=5.0000; -update t2 set col1=15 where col1=5.0000; -update t3 set col1=15 where col1=5.0000; -update t4 set col1=15 where col1=5.0000; -update t5 set col1=15 where col1=5.0000; -update t6 set col1=15 where col1=5.0000; +1 5 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 5 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +update t1 set col1=15 where col1=5; +update t2 set col1=15 where col1=5; +update t3 set col1=15 where col1=5; +update t4 set col1=15 where col1=5; +update t5 set col1=15 where col1=5; +update t6 set col1=15 where col1=5; select * from t1 order by col1; col1 -15.0000 -19.0000 +15 +19 select * from t2 order by col1; col1 -15.0000 -17.0000 -19.0000 +15 +17 +19 select * from t3 order by col1; col1 -15.0000 -17.0000 -19.0000 +15 +17 +19 select * from t4 order by colint; colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 select * from t5 order by colint; colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 select * from t6 order by colint; colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 ------------------------------------------------------------------------- ---- Alter tables with cast(mod(col1,10) as signed) +--- Alter tables with mod(col1,10) ------------------------------------------------------------------------- drop table if exists t11 ; drop table if exists t22 ; @@ -3320,11 +2070,11 @@ create table t44 engine='MYISAM' as select * from t4; create table t55 engine='MYISAM' as select * from t5; create table t66 engine='MYISAM' as select * from t6; alter table t11 -partition by range(cast(mod(col1,10) as signed)) +partition by range(mod(col1,10)) (partition p0 values less than (15), partition p1 values less than maxvalue); alter table t22 -partition by list(cast(mod(col1,10) as signed)) +partition by list(mod(col1,10)) (partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30), @@ -3333,15 +2083,15 @@ partition p4 values in (41,42,43,44,45,46,47,48,49,50), partition p5 values in (51,52,53,54,55,56,57,58,59,60) ); alter table t33 -partition by hash(cast(mod(col1,10) as signed)); +partition by hash(mod(col1,10)); alter table t44 partition by range(colint) -subpartition by hash(cast(mod(col1,10) as signed)) subpartitions 2 +subpartition by hash(mod(col1,10)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than maxvalue); alter table t55 partition by list(colint) -subpartition by hash(cast(mod(col1,10) as signed)) subpartitions 2 +subpartition by hash(mod(col1,10)) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30), @@ -3351,40 +2101,163 @@ partition p5 values in (51,52,53,54,55,56,57,58,59,60) ); alter table t66 partition by range(colint) -(partition p0 values less than (cast(mod(15,10) as signed)), +(partition p0 values less than (mod(15,10)), partition p1 values less than maxvalue); select * from t11 order by col1; col1 -15.0000 -19.0000 +15 +19 select * from t22 order by col1; col1 -15.0000 -17.0000 -19.0000 +15 +17 +19 select * from t33 order by col1; col1 -15.0000 -17.0000 -19.0000 +15 +17 +19 select * from t44 order by colint; colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 select * from t55 order by colint; colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 select * from t66 order by colint; colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 --------------------------- ---- some alter table begin --------------------------- @@ -3393,19 +2266,19 @@ reorganize partition p0,p1 into (partition s1 values less than maxvalue); select * from t11 order by col1; col1 -15.0000 -19.0000 +15 +19 alter table t11 reorganize partition s1 into (partition p0 values less than (15), partition p1 values less than maxvalue); select * from t11 order by col1; col1 -15.0000 -19.0000 +15 +19 alter table t55 partition by list(colint) -subpartition by hash(cast(mod(col1,10) as signed)) subpartitions 5 +subpartition by hash(mod(col1,10)) subpartitions 5 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30), @@ -3417,54 +2290,259 @@ show create table t55; Table Create Table t55 CREATE TABLE `t55` ( `colint` int(11) DEFAULT NULL, - `col1` float(7,4) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (cast(mod(col1,10) as signed)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */ + `col1` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (mod(col1,10)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */ select * from t55 order by colint; colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 alter table t66 reorganize partition p0,p1 into (partition s1 values less than maxvalue); select * from t66 order by colint; colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 alter table t66 reorganize partition s1 into -(partition p0 values less than (cast(mod(15,10) as signed)), +(partition p0 values less than (mod(15,10)), partition p1 values less than maxvalue); select * from t66 order by colint; colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 alter table t66 reorganize partition p0,p1 into (partition s1 values less than maxvalue); select * from t66 order by colint; colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 alter table t66 reorganize partition s1 into -(partition p0 values less than (cast(mod(15,10) as signed)), +(partition p0 values less than (mod(15,10)), partition p1 values less than maxvalue); select * from t66 order by colint; colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 ------------------------------------------------------------------------- ---- Delete rows and partitions of tables with cast(mod(col1,10) as signed) +--- Delete rows and partitions of tables with mod(col1,10) ------------------------------------------------------------------------- delete from t1 where col1=19; delete from t2 where col1=19; @@ -3474,27 +2552,109 @@ delete from t5 where col1=19; delete from t6 where col1=19; select * from t1 order by col1; col1 -15.0000 +15 select * from t2 order by col1; col1 -15.0000 -17.0000 +15 +17 select * from t3 order by col1; col1 -15.0000 -17.0000 +15 +17 select * from t4 order by colint; colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 select * from t5 order by colint; colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 insert into t1 values (19); insert into t2 values (19); insert into t3 values (19); @@ -3503,39 +2663,162 @@ insert into t5 values (60,19); insert into t6 values (60,19); select * from t1 order by col1; col1 -15.0000 -19.0000 +15 +19 select * from t2 order by col1; col1 -15.0000 -17.0000 -19.0000 +15 +17 +19 select * from t3 order by col1; col1 -15.0000 -17.0000 -19.0000 +15 +17 +19 select * from t4 order by colint; colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 -60 19.0000 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +60 19 select * from t5 order by colint; colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 -60 19.0000 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +60 19 select * from t6 order by colint; colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 -60 19.0000 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +60 19 alter table t1 drop partition p0; alter table t2 drop partition p0; alter table t4 drop partition p0; @@ -3547,20 +2830,127 @@ select * from t2 order by col1; col1 select * from t3 order by col1; col1 -15.0000 -17.0000 -19.0000 +15 +17 +19 select * from t4 order by colint; colint col1 -60 19.0000 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +60 19 select * from t5 order by colint; colint col1 -60 19.0000 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +60 19 select * from t6 order by colint; colint col1 -60 19.0000 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +60 19 ------------------------------------------------------------------------- ---- Delete rows and partitions of tables with cast(mod(col1,10) as signed) +--- Delete rows and partitions of tables with mod(col1,10) ------------------------------------------------------------------------- delete from t11 where col1=19; delete from t22 where col1=19; @@ -3570,27 +2960,109 @@ delete from t55 where col1=19; delete from t66 where col1=19; select * from t11 order by col1; col1 -15.0000 +15 select * from t22 order by col1; col1 -15.0000 -17.0000 +15 +17 select * from t33 order by col1; col1 -15.0000 -17.0000 +15 +17 select * from t44 order by colint; colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 select * from t55 order by colint; colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 insert into t11 values (19); insert into t22 values (19); insert into t33 values (19); @@ -3599,39 +3071,162 @@ insert into t55 values (60,19); insert into t66 values (60,19); select * from t11 order by col1; col1 -15.0000 -19.0000 +15 +19 select * from t22 order by col1; col1 -15.0000 -17.0000 -19.0000 +15 +17 +19 select * from t33 order by col1; col1 -15.0000 -17.0000 -19.0000 +15 +17 +19 select * from t44 order by colint; colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 -60 19.0000 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +60 19 select * from t55 order by colint; colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 -60 19.0000 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +60 19 select * from t66 order by colint; colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 -60 19.0000 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +60 19 alter table t11 drop partition p0; alter table t22 drop partition p0; alter table t44 drop partition p0; @@ -3643,516 +3238,125 @@ select * from t22 order by col1; col1 select * from t33 order by col1; col1 -15.0000 -17.0000 -19.0000 +15 +17 +19 select * from t44 order by colint; colint col1 -60 19.0000 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +60 19 select * from t55 order by colint; colint col1 -60 19.0000 -select * from t66 order by colint; -colint col1 -60 19.0000 -------------------------- ----- some alter table end -------------------------- -drop table if exists t1 ; -drop table if exists t2 ; -drop table if exists t3 ; -drop table if exists t4 ; -drop table if exists t5 ; -drop table if exists t6 ; -drop table if exists t11 ; -drop table if exists t22 ; -drop table if exists t33 ; -drop table if exists t44 ; -drop table if exists t55 ; -drop table if exists t66 ; -------------------------------------------------------------------------- ---- ord(col1) in partition with coltype char(3) -------------------------------------------------------------------------- -drop table if exists t1 ; -drop table if exists t2 ; -drop table if exists t3 ; -drop table if exists t4 ; -drop table if exists t5 ; -drop table if exists t6 ; -------------------------------------------------------------------------- ---- Create tables with ord(col1) -------------------------------------------------------------------------- -create table t1 (col1 char(3)) engine='MYISAM' -partition by range(ord(col1)) -(partition p0 values less than (15), -partition p1 values less than maxvalue); -create table t2 (col1 char(3)) engine='MYISAM' -partition by list(ord(col1)) -(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -create table t3 (col1 char(3)) engine='MYISAM' -partition by hash(ord(col1)); -create table t4 (colint int, col1 char(3)) engine='MYISAM' -partition by range(colint) -subpartition by hash(ord(col1)) subpartitions 2 -(partition p0 values less than (15), -partition p1 values less than maxvalue); -create table t5 (colint int, col1 char(3)) engine='MYISAM' -partition by list(colint) -subpartition by hash(ord(col1)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -create table t6 (colint int, col1 char(3)) engine='MYISAM' -partition by range(colint) -(partition p0 values less than (ord('a')), -partition p1 values less than maxvalue); -------------------------------------------------------------------------- ---- Access tables with ord(col1) -------------------------------------------------------------------------- -insert into t1 values ('1'); -insert into t1 values ('9'); -insert into t2 values ('1'); -insert into t2 values ('9'); -insert into t2 values ('3'); -insert into t3 values ('1'); -insert into t3 values ('9'); -insert into t3 values ('3'); -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_ch1.inc' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_ch1.inc' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_ch1.inc' into table t6; -select ord(col1) from t1 order by col1; -ord(col1) -49 -57 -select * from t1 order by col1; -col1 -1 -9 -select * from t2 order by col1; -col1 -1 -3 -9 -select * from t3 order by col1; -col1 -1 -3 -9 -select * from t4 order by colint; -colint col1 -1 1 -2 9 -3 3 -4 8 -select * from t5 order by colint; -colint col1 -1 1 -2 9 -3 3 -4 8 -select * from t6 order by colint; -colint col1 -1 1 -2 9 -3 3 -4 8 -update t1 set col1='8' where col1='1'; -update t2 set col1='8' where col1='1'; -update t3 set col1='8' where col1='1'; -update t4 set col1='8' where col1='1'; -update t5 set col1='8' where col1='1'; -update t6 set col1='8' where col1='1'; -select * from t1 order by col1; -col1 -8 -9 -select * from t2 order by col1; -col1 -3 -8 -9 -select * from t3 order by col1; -col1 -3 -8 -9 -select * from t4 order by colint; -colint col1 -1 8 -2 9 -3 3 -4 8 -select * from t5 order by colint; -colint col1 -1 8 -2 9 -3 3 -4 8 -select * from t6 order by colint; -colint col1 -1 8 -2 9 -3 3 -4 8 -------------------------------------------------------------------------- ---- Alter tables with ord(col1) -------------------------------------------------------------------------- -drop table if exists t11 ; -drop table if exists t22 ; -drop table if exists t33 ; -drop table if exists t44 ; -drop table if exists t55 ; -drop table if exists t66 ; -create table t11 engine='MYISAM' as select * from t1; -create table t22 engine='MYISAM' as select * from t2; -create table t33 engine='MYISAM' as select * from t3; -create table t44 engine='MYISAM' as select * from t4; -create table t55 engine='MYISAM' as select * from t5; -create table t66 engine='MYISAM' as select * from t6; -alter table t11 -partition by range(ord(col1)) -(partition p0 values less than (15), -partition p1 values less than maxvalue); -alter table t22 -partition by list(ord(col1)) -(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -alter table t33 -partition by hash(ord(col1)); -alter table t44 -partition by range(colint) -subpartition by hash(ord(col1)) subpartitions 2 -(partition p0 values less than (15), -partition p1 values less than maxvalue); -alter table t55 -partition by list(colint) -subpartition by hash(ord(col1)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -alter table t66 -partition by range(colint) -(partition p0 values less than (ord('a')), -partition p1 values less than maxvalue); -select * from t11 order by col1; -col1 -8 -9 -select * from t22 order by col1; -col1 -3 -8 -9 -select * from t33 order by col1; -col1 -3 -8 -9 -select * from t44 order by colint; -colint col1 -1 8 -2 9 -3 3 -4 8 -select * from t55 order by colint; -colint col1 -1 8 -2 9 -3 3 -4 8 -select * from t66 order by colint; -colint col1 -1 8 -2 9 -3 3 -4 8 ---------------------------- ----- some alter table begin ---------------------------- -alter table t11 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t11 order by col1; -col1 -8 -9 -alter table t11 -reorganize partition s1 into -(partition p0 values less than (15), -partition p1 values less than maxvalue); -select * from t11 order by col1; -col1 -8 -9 -alter table t55 -partition by list(colint) -subpartition by hash(ord(col1)) subpartitions 5 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -show create table t55; -Table Create Table -t55 CREATE TABLE `t55` ( - `colint` int(11) DEFAULT NULL, - `col1` char(3) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (ord(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */ -select * from t55 order by colint; -colint col1 -1 8 -2 9 -3 3 -4 8 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 8 -2 9 -3 3 -4 8 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (ord('a')), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 8 -2 9 -3 3 -4 8 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 8 -2 9 -3 3 -4 8 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (ord('a')), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 8 -2 9 -3 3 -4 8 -------------------------------------------------------------------------- ---- Delete rows and partitions of tables with ord(col1) -------------------------------------------------------------------------- -delete from t1 where col1='9'; -delete from t2 where col1='9'; -delete from t3 where col1='9'; -delete from t4 where col1='9'; -delete from t5 where col1='9'; -delete from t6 where col1='9'; -select * from t1 order by col1; -col1 -8 -select * from t2 order by col1; -col1 -3 -8 -select * from t3 order by col1; -col1 -3 -8 -select * from t4 order by colint; -colint col1 -1 8 -3 3 -4 8 -select * from t5 order by colint; -colint col1 -1 8 -3 3 -4 8 -insert into t1 values ('9'); -insert into t2 values ('9'); -insert into t3 values ('9'); -insert into t4 values (60,'9'); -insert into t5 values (60,'9'); -insert into t6 values (60,'9'); -select * from t1 order by col1; -col1 -8 -9 -select * from t2 order by col1; -col1 -3 -8 -9 -select * from t3 order by col1; -col1 -3 -8 -9 -select * from t4 order by colint; -colint col1 -1 8 -3 3 -4 8 -60 9 -select * from t5 order by colint; -colint col1 -1 8 -3 3 -4 8 -60 9 -select * from t6 order by colint; -colint col1 -1 8 -3 3 -4 8 -60 9 -alter table t1 drop partition p0; -alter table t2 drop partition p0; -alter table t4 drop partition p0; -alter table t5 drop partition p0; -alter table t6 drop partition p0; -select * from t1 order by col1; -col1 -8 -9 -select * from t2 order by col1; -col1 -3 -8 -9 -select * from t3 order by col1; -col1 -3 -8 -9 -select * from t4 order by colint; -colint col1 -60 9 -select * from t5 order by colint; -colint col1 -60 9 -select * from t6 order by colint; -colint col1 -------------------------------------------------------------------------- ---- Delete rows and partitions of tables with ord(col1) -------------------------------------------------------------------------- -delete from t11 where col1='9'; -delete from t22 where col1='9'; -delete from t33 where col1='9'; -delete from t44 where col1='9'; -delete from t55 where col1='9'; -delete from t66 where col1='9'; -select * from t11 order by col1; -col1 -8 -select * from t22 order by col1; -col1 -3 -8 -select * from t33 order by col1; -col1 -3 -8 -select * from t44 order by colint; -colint col1 -1 8 -3 3 -4 8 -select * from t55 order by colint; -colint col1 -1 8 -3 3 -4 8 -insert into t11 values ('9'); -insert into t22 values ('9'); -insert into t33 values ('9'); -insert into t44 values (60,'9'); -insert into t55 values (60,'9'); -insert into t66 values (60,'9'); -select * from t11 order by col1; -col1 -8 -9 -select * from t22 order by col1; -col1 -3 -8 -9 -select * from t33 order by col1; -col1 -3 -8 -9 -select * from t44 order by colint; -colint col1 -1 8 -3 3 -4 8 -60 9 -select * from t55 order by colint; -colint col1 -1 8 -3 3 -4 8 -60 9 -select * from t66 order by colint; -colint col1 -1 8 -3 3 -4 8 -60 9 -alter table t11 drop partition p0; -alter table t22 drop partition p0; -alter table t44 drop partition p0; -alter table t55 drop partition p0; -alter table t66 drop partition p0; -select * from t11 order by col1; -col1 -8 -9 -select * from t22 order by col1; -col1 -3 -8 -9 -select * from t33 order by col1; -col1 -3 -8 -9 -select * from t44 order by colint; -colint col1 -60 9 -select * from t55 order by colint; -colint col1 -60 9 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +60 19 select * from t66 order by colint; colint col1 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +60 19 ------------------------- ---- some alter table end ------------------------- @@ -4225,9 +3429,9 @@ insert into t2 values ('2006-01-25'); insert into t3 values ('2006-02-03'); insert into t3 values ('2006-01-17'); insert into t3 values ('2006-01-25'); -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t6; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6; select day(col1) from t1 order by col1; day(col1) 17 @@ -4721,9 +3925,9 @@ insert into t2 values ('2006-01-25'); insert into t3 values ('2006-02-03'); insert into t3 values ('2006-01-17'); insert into t3 values ('2006-01-25'); -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t6; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6; select dayofmonth(col1) from t1 order by col1; dayofmonth(col1) 17 @@ -5217,9 +4421,9 @@ insert into t2 values ('2006-01-25'); insert into t3 values ('2006-01-03'); insert into t3 values ('2006-02-17'); insert into t3 values ('2006-01-25'); -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t6; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6; select dayofweek(col1) from t1 order by col1; dayofweek(col1) 3 @@ -5725,9 +4929,9 @@ insert into t2 values ('2006-02-25'); insert into t3 values ('2006-01-03'); insert into t3 values ('2006-01-17'); insert into t3 values ('2006-02-25'); -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t6; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6; select dayofyear(col1) from t1 order by col1; dayofyear(col1) 3 @@ -6223,9 +5427,9 @@ insert into t2 values ('2006-02-25'); insert into t3 values ('2006-01-03'); insert into t3 values ('2006-01-17'); insert into t3 values ('2006-02-25'); -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t6; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6; select dayofyear(col1) from t1 order by col1; dayofyear(col1) 3 @@ -6721,9 +5925,9 @@ insert into t2 values ('2006-01-25'); insert into t3 values ('2006-01-03'); insert into t3 values ('2006-02-17'); insert into t3 values ('2006-01-25'); -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t6; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6; select extract(month from col1) from t1 order by col1; extract(month from col1) 1 @@ -7219,9 +6423,9 @@ insert into t2 values ('21:59'); insert into t3 values ('09:09'); insert into t3 values ('14:30'); insert into t3 values ('21:59'); -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_time.inc' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_time.inc' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_time.inc' into table t6; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t4; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t5; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t6; select hour(col1) from t1 order by col1; hour(col1) 9 @@ -7723,9 +6927,9 @@ insert into t2 values ('00:59:22.000024'); insert into t3 values ('09:09:15.000002'); insert into t3 values ('04:30:01.000018'); insert into t3 values ('00:59:22.000024'); -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_time.inc' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_time.inc' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_time.inc' into table t6; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t4; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t5; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t6; select microsecond(col1) from t1 order by col1; microsecond(col1) 0 @@ -8213,9 +7417,9 @@ insert into t2 values ('21:59:22'); insert into t3 values ('09:09:15'); insert into t3 values ('14:30:45'); insert into t3 values ('21:59:22'); -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_time.inc' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_time.inc' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_time.inc' into table t6; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t4; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t5; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t6; select minute(col1) from t1 order by col1; minute(col1) 9 @@ -8723,9 +7927,9 @@ insert into t2 values ('21:59:22'); insert into t3 values ('09:09:09'); insert into t3 values ('14:30:20'); insert into t3 values ('21:59:22'); -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_time.inc' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_time.inc' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_time.inc' into table t6; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t4; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t5; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t6; select second(col1) from t1 order by col1; second(col1) 9 @@ -9233,9 +8437,9 @@ insert into t2 values ('21:59:22'); insert into t3 values ('09:09:09'); insert into t3 values ('14:30:20'); insert into t3 values ('21:59:22'); -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_time.inc' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_time.inc' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_time.inc' into table t6; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t4; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t5; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t6; select second(col1) from t1 order by col1; second(col1) 9 @@ -9743,9 +8947,9 @@ insert into t2 values ('2006-05-25'); insert into t3 values ('2006-01-03'); insert into t3 values ('2006-12-17'); insert into t3 values ('2006-05-25'); -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t6; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6; select month(col1) from t1 order by col1; month(col1) 1 @@ -10247,9 +9451,9 @@ insert into t2 values ('2006-09-25'); insert into t3 values ('2006-01-03'); insert into t3 values ('2006-12-17'); insert into t3 values ('2006-09-25'); -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t6; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6; select quarter(col1) from t1 order by col1; quarter(col1) 1 @@ -10749,9 +9953,9 @@ insert into t2 values ('21:59:22'); insert into t3 values ('09:09:15'); insert into t3 values ('14:30:45'); insert into t3 values ('21:59:22'); -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_time.inc' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_time.inc' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_time.inc' into table t6; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t4; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t5; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t6; select time_to_sec(col1)-(time_to_sec(col1)-20) from t1 order by col1; time_to_sec(col1)-(time_to_sec(col1)-20) 20 @@ -11257,9 +10461,9 @@ insert into t2 values ('2006-01-25'); insert into t3 values ('2006-02-03'); insert into t3 values ('2006-01-17'); insert into t3 values ('2006-01-25'); -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t6; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6; select to_days(col1)-to_days('2006-01-01') from t1 order by col1; to_days(col1)-to_days('2006-01-01') 16 @@ -11701,6 +10905,506 @@ drop table if exists t44 ; drop table if exists t55 ; drop table if exists t66 ; ------------------------------------------------------------------------- +--- datediff(col1, '2006-01-01') in partition with coltype date +------------------------------------------------------------------------- +drop table if exists t1 ; +drop table if exists t2 ; +drop table if exists t3 ; +drop table if exists t4 ; +drop table if exists t5 ; +drop table if exists t6 ; +------------------------------------------------------------------------- +--- Create tables with datediff(col1, '2006-01-01') +------------------------------------------------------------------------- +create table t1 (col1 date) engine='MYISAM' +partition by range(datediff(col1, '2006-01-01')) +(partition p0 values less than (15), +partition p1 values less than maxvalue); +create table t2 (col1 date) engine='MYISAM' +partition by list(datediff(col1, '2006-01-01')) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +create table t3 (col1 date) engine='MYISAM' +partition by hash(datediff(col1, '2006-01-01')); +create table t4 (colint int, col1 date) engine='MYISAM' +partition by range(colint) +subpartition by hash(datediff(col1, '2006-01-01')) subpartitions 2 +(partition p0 values less than (15), +partition p1 values less than maxvalue); +create table t5 (colint int, col1 date) engine='MYISAM' +partition by list(colint) +subpartition by hash(datediff(col1, '2006-01-01')) subpartitions 2 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +create table t6 (colint int, col1 date) engine='MYISAM' +partition by range(colint) +(partition p0 values less than (datediff('2006-02-02', '2006-01-01')), +partition p1 values less than maxvalue); +------------------------------------------------------------------------- +--- Access tables with datediff(col1, '2006-01-01') +------------------------------------------------------------------------- +insert into t1 values ('2006-02-03'); +insert into t1 values ('2006-01-17'); +insert into t2 values ('2006-02-03'); +insert into t2 values ('2006-01-17'); +insert into t2 values ('2006-01-25'); +insert into t3 values ('2006-02-03'); +insert into t3 values ('2006-01-17'); +insert into t3 values ('2006-01-25'); +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6; +select datediff(col1, '2006-01-01') from t1 order by col1; +datediff(col1, '2006-01-01') +16 +33 +select * from t1 order by col1; +col1 +2006-01-17 +2006-02-03 +select * from t2 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-03 +select * from t3 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-03 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +update t1 set col1='2006-02-06' where col1='2006-02-03'; +update t2 set col1='2006-02-06' where col1='2006-02-03'; +update t3 set col1='2006-02-06' where col1='2006-02-03'; +update t4 set col1='2006-02-06' where col1='2006-02-03'; +update t5 set col1='2006-02-06' where col1='2006-02-03'; +update t6 set col1='2006-02-06' where col1='2006-02-03'; +select * from t1 order by col1; +col1 +2006-01-17 +2006-02-06 +select * from t2 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-06 +select * from t3 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-06 +select * from t4 order by colint; +colint col1 +1 2006-02-06 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-06 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t6 order by colint; +colint col1 +1 2006-02-06 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +------------------------------------------------------------------------- +--- Alter tables with datediff(col1, '2006-01-01') +------------------------------------------------------------------------- +drop table if exists t11 ; +drop table if exists t22 ; +drop table if exists t33 ; +drop table if exists t44 ; +drop table if exists t55 ; +drop table if exists t66 ; +create table t11 engine='MYISAM' as select * from t1; +create table t22 engine='MYISAM' as select * from t2; +create table t33 engine='MYISAM' as select * from t3; +create table t44 engine='MYISAM' as select * from t4; +create table t55 engine='MYISAM' as select * from t5; +create table t66 engine='MYISAM' as select * from t6; +alter table t11 +partition by range(datediff(col1, '2006-01-01')) +(partition p0 values less than (15), +partition p1 values less than maxvalue); +alter table t22 +partition by list(datediff(col1, '2006-01-01')) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +alter table t33 +partition by hash(datediff(col1, '2006-01-01')); +alter table t44 +partition by range(colint) +subpartition by hash(datediff(col1, '2006-01-01')) subpartitions 2 +(partition p0 values less than (15), +partition p1 values less than maxvalue); +alter table t55 +partition by list(colint) +subpartition by hash(datediff(col1, '2006-01-01')) subpartitions 2 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +alter table t66 +partition by range(colint) +(partition p0 values less than (datediff('2006-02-02', '2006-01-01')), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-01-17 +2006-02-06 +select * from t22 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-06 +select * from t33 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-06 +select * from t44 order by colint; +colint col1 +1 2006-02-06 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t55 order by colint; +colint col1 +1 2006-02-06 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t66 order by colint; +colint col1 +1 2006-02-06 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +--------------------------- +---- some alter table begin +--------------------------- +alter table t11 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-01-17 +2006-02-06 +alter table t11 +reorganize partition s1 into +(partition p0 values less than (15), +partition p1 values less than maxvalue); +select * from t11 order by col1; +col1 +2006-01-17 +2006-02-06 +alter table t55 +partition by list(colint) +subpartition by hash(datediff(col1, '2006-01-01')) subpartitions 5 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +show create table t55; +Table Create Table +t55 CREATE TABLE `t55` ( + `colint` int(11) DEFAULT NULL, + `col1` date DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (datediff(col1, '2006-01-01')) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */ +select * from t55 order by colint; +colint col1 +1 2006-02-06 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-06 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (datediff('2006-02-02', '2006-01-01')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-06 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition p0,p1 into +(partition s1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-06 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +alter table t66 +reorganize partition s1 into +(partition p0 values less than (datediff('2006-02-02', '2006-01-01')), +partition p1 values less than maxvalue); +select * from t66 order by colint; +colint col1 +1 2006-02-06 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with datediff(col1, '2006-01-01') +------------------------------------------------------------------------- +delete from t1 where col1='2006-01-17'; +delete from t2 where col1='2006-01-17'; +delete from t3 where col1='2006-01-17'; +delete from t4 where col1='2006-01-17'; +delete from t5 where col1='2006-01-17'; +delete from t6 where col1='2006-01-17'; +select * from t1 order by col1; +col1 +2006-02-06 +select * from t2 order by col1; +col1 +2006-01-25 +2006-02-06 +select * from t3 order by col1; +col1 +2006-01-25 +2006-02-06 +select * from t4 order by colint; +colint col1 +1 2006-02-06 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-06 +3 2006-01-25 +4 2006-02-05 +insert into t1 values ('2006-01-17'); +insert into t2 values ('2006-01-17'); +insert into t3 values ('2006-01-17'); +insert into t4 values (60,'2006-01-17'); +insert into t5 values (60,'2006-01-17'); +insert into t6 values (60,'2006-01-17'); +select * from t1 order by col1; +col1 +2006-01-17 +2006-02-06 +select * from t2 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-06 +select * from t3 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-06 +select * from t4 order by colint; +colint col1 +1 2006-02-06 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +select * from t5 order by colint; +colint col1 +1 2006-02-06 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +select * from t6 order by colint; +colint col1 +1 2006-02-06 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +alter table t1 drop partition p0; +alter table t2 drop partition p0; +alter table t4 drop partition p0; +alter table t5 drop partition p0; +alter table t6 drop partition p0; +select * from t1 order by col1; +col1 +2006-01-17 +2006-02-06 +select * from t2 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-06 +select * from t3 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-06 +select * from t4 order by colint; +colint col1 +60 2006-01-17 +select * from t5 order by colint; +colint col1 +60 2006-01-17 +select * from t6 order by colint; +colint col1 +60 2006-01-17 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with datediff(col1, '2006-01-01') +------------------------------------------------------------------------- +delete from t11 where col1='2006-01-17'; +delete from t22 where col1='2006-01-17'; +delete from t33 where col1='2006-01-17'; +delete from t44 where col1='2006-01-17'; +delete from t55 where col1='2006-01-17'; +delete from t66 where col1='2006-01-17'; +select * from t11 order by col1; +col1 +2006-02-06 +select * from t22 order by col1; +col1 +2006-01-25 +2006-02-06 +select * from t33 order by col1; +col1 +2006-01-25 +2006-02-06 +select * from t44 order by colint; +colint col1 +1 2006-02-06 +3 2006-01-25 +4 2006-02-05 +select * from t55 order by colint; +colint col1 +1 2006-02-06 +3 2006-01-25 +4 2006-02-05 +insert into t11 values ('2006-01-17'); +insert into t22 values ('2006-01-17'); +insert into t33 values ('2006-01-17'); +insert into t44 values (60,'2006-01-17'); +insert into t55 values (60,'2006-01-17'); +insert into t66 values (60,'2006-01-17'); +select * from t11 order by col1; +col1 +2006-01-17 +2006-02-06 +select * from t22 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-06 +select * from t33 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-06 +select * from t44 order by colint; +colint col1 +1 2006-02-06 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +select * from t55 order by colint; +colint col1 +1 2006-02-06 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +select * from t66 order by colint; +colint col1 +1 2006-02-06 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +alter table t11 drop partition p0; +alter table t22 drop partition p0; +alter table t44 drop partition p0; +alter table t55 drop partition p0; +alter table t66 drop partition p0; +select * from t11 order by col1; +col1 +2006-01-17 +2006-02-06 +select * from t22 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-06 +select * from t33 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-06 +select * from t44 order by colint; +colint col1 +60 2006-01-17 +select * from t55 order by colint; +colint col1 +60 2006-01-17 +select * from t66 order by colint; +colint col1 +60 2006-01-17 +------------------------- +---- some alter table end +------------------------- +drop table if exists t1 ; +drop table if exists t2 ; +drop table if exists t3 ; +drop table if exists t4 ; +drop table if exists t5 ; +drop table if exists t6 ; +drop table if exists t11 ; +drop table if exists t22 ; +drop table if exists t33 ; +drop table if exists t44 ; +drop table if exists t55 ; +drop table if exists t66 ; +------------------------------------------------------------------------- --- weekday(col1) in partition with coltype date ------------------------------------------------------------------------- drop table if exists t1 ; @@ -11757,9 +11461,9 @@ insert into t2 values ('2006-05-25'); insert into t3 values ('2006-12-03'); insert into t3 values ('2006-11-17'); insert into t3 values ('2006-05-25'); -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t6; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6; select weekday(col1) from t1 order by col1; weekday(col1) 4 @@ -12201,514 +11905,6 @@ drop table if exists t44 ; drop table if exists t55 ; drop table if exists t66 ; ------------------------------------------------------------------------- ---- weekofyear(col1) in partition with coltype date -------------------------------------------------------------------------- -drop table if exists t1 ; -drop table if exists t2 ; -drop table if exists t3 ; -drop table if exists t4 ; -drop table if exists t5 ; -drop table if exists t6 ; -------------------------------------------------------------------------- ---- Create tables with weekofyear(col1) -------------------------------------------------------------------------- -create table t1 (col1 date) engine='MYISAM' -partition by range(weekofyear(col1)) -(partition p0 values less than (15), -partition p1 values less than maxvalue); -create table t2 (col1 date) engine='MYISAM' -partition by list(weekofyear(col1)) -(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -create table t3 (col1 date) engine='MYISAM' -partition by hash(weekofyear(col1)); -create table t4 (colint int, col1 date) engine='MYISAM' -partition by range(colint) -subpartition by hash(weekofyear(col1)) subpartitions 2 -(partition p0 values less than (15), -partition p1 values less than maxvalue); -create table t5 (colint int, col1 date) engine='MYISAM' -partition by list(colint) -subpartition by hash(weekofyear(col1)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -create table t6 (colint int, col1 date) engine='MYISAM' -partition by range(colint) -(partition p0 values less than (weekofyear('2006-02-14')), -partition p1 values less than maxvalue); -------------------------------------------------------------------------- ---- Access tables with weekofyear(col1) -------------------------------------------------------------------------- -insert into t1 values ('2006-01-03'); -insert into t1 values ('2006-03-17'); -insert into t2 values ('2006-01-03'); -insert into t2 values ('2006-03-17'); -insert into t2 values ('2006-05-25'); -insert into t3 values ('2006-01-03'); -insert into t3 values ('2006-03-17'); -insert into t3 values ('2006-05-25'); -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t6; -select weekofyear(col1) from t1 order by col1; -weekofyear(col1) -1 -11 -select * from t1 order by col1; -col1 -2006-01-03 -2006-03-17 -select * from t2 order by col1; -col1 -2006-01-03 -2006-03-17 -2006-05-25 -select * from t3 order by col1; -col1 -2006-01-03 -2006-03-17 -2006-05-25 -select * from t4 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -select * from t5 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -select * from t6 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -update t1 set col1='2006-09-06' where col1='2006-01-03'; -update t2 set col1='2006-09-06' where col1='2006-01-03'; -update t3 set col1='2006-09-06' where col1='2006-01-03'; -update t4 set col1='2006-09-06' where col1='2006-01-03'; -update t5 set col1='2006-09-06' where col1='2006-01-03'; -update t6 set col1='2006-09-06' where col1='2006-01-03'; -select * from t1 order by col1; -col1 -2006-03-17 -2006-09-06 -select * from t2 order by col1; -col1 -2006-03-17 -2006-05-25 -2006-09-06 -select * from t3 order by col1; -col1 -2006-03-17 -2006-05-25 -2006-09-06 -select * from t4 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -select * from t5 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -select * from t6 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -------------------------------------------------------------------------- ---- Alter tables with weekofyear(col1) -------------------------------------------------------------------------- -drop table if exists t11 ; -drop table if exists t22 ; -drop table if exists t33 ; -drop table if exists t44 ; -drop table if exists t55 ; -drop table if exists t66 ; -create table t11 engine='MYISAM' as select * from t1; -create table t22 engine='MYISAM' as select * from t2; -create table t33 engine='MYISAM' as select * from t3; -create table t44 engine='MYISAM' as select * from t4; -create table t55 engine='MYISAM' as select * from t5; -create table t66 engine='MYISAM' as select * from t6; -alter table t11 -partition by range(weekofyear(col1)) -(partition p0 values less than (15), -partition p1 values less than maxvalue); -alter table t22 -partition by list(weekofyear(col1)) -(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -alter table t33 -partition by hash(weekofyear(col1)); -alter table t44 -partition by range(colint) -subpartition by hash(weekofyear(col1)) subpartitions 2 -(partition p0 values less than (15), -partition p1 values less than maxvalue); -alter table t55 -partition by list(colint) -subpartition by hash(weekofyear(col1)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -alter table t66 -partition by range(colint) -(partition p0 values less than (weekofyear('2006-02-14')), -partition p1 values less than maxvalue); -select * from t11 order by col1; -col1 -2006-03-17 -2006-09-06 -select * from t22 order by col1; -col1 -2006-03-17 -2006-05-25 -2006-09-06 -select * from t33 order by col1; -col1 -2006-03-17 -2006-05-25 -2006-09-06 -select * from t44 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -select * from t55 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 ---------------------------- ----- some alter table begin ---------------------------- -alter table t11 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t11 order by col1; -col1 -2006-03-17 -2006-09-06 -alter table t11 -reorganize partition s1 into -(partition p0 values less than (15), -partition p1 values less than maxvalue); -select * from t11 order by col1; -col1 -2006-03-17 -2006-09-06 -alter table t55 -partition by list(colint) -subpartition by hash(weekofyear(col1)) subpartitions 5 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -show create table t55; -Table Create Table -t55 CREATE TABLE `t55` ( - `colint` int(11) DEFAULT NULL, - `col1` date DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (weekofyear(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = MyISAM, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = MyISAM, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = MyISAM, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = MyISAM, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */ -select * from t55 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (weekofyear('2006-02-14')), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (weekofyear('2006-02-14')), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -------------------------------------------------------------------------- ---- Delete rows and partitions of tables with weekofyear(col1) -------------------------------------------------------------------------- -delete from t1 where col1='2006-03-17'; -delete from t2 where col1='2006-03-17'; -delete from t3 where col1='2006-03-17'; -delete from t4 where col1='2006-03-17'; -delete from t5 where col1='2006-03-17'; -delete from t6 where col1='2006-03-17'; -select * from t1 order by col1; -col1 -2006-09-06 -select * from t2 order by col1; -col1 -2006-05-25 -2006-09-06 -select * from t3 order by col1; -col1 -2006-05-25 -2006-09-06 -select * from t4 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -select * from t5 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -insert into t1 values ('2006-03-17'); -insert into t2 values ('2006-03-17'); -insert into t3 values ('2006-03-17'); -insert into t4 values (60,'2006-03-17'); -insert into t5 values (60,'2006-03-17'); -insert into t6 values (60,'2006-03-17'); -select * from t1 order by col1; -col1 -2006-03-17 -2006-09-06 -select * from t2 order by col1; -col1 -2006-03-17 -2006-05-25 -2006-09-06 -select * from t3 order by col1; -col1 -2006-03-17 -2006-05-25 -2006-09-06 -select * from t4 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -60 2006-03-17 -select * from t5 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -60 2006-03-17 -select * from t6 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -60 2006-03-17 -alter table t1 drop partition p0; -alter table t2 drop partition p0; -alter table t4 drop partition p0; -alter table t5 drop partition p0; -alter table t6 drop partition p0; -select * from t1 order by col1; -col1 -2006-09-06 -select * from t2 order by col1; -col1 -2006-03-17 -2006-05-25 -2006-09-06 -select * from t3 order by col1; -col1 -2006-03-17 -2006-05-25 -2006-09-06 -select * from t4 order by colint; -colint col1 -60 2006-03-17 -select * from t5 order by colint; -colint col1 -60 2006-03-17 -select * from t6 order by colint; -colint col1 -60 2006-03-17 -------------------------------------------------------------------------- ---- Delete rows and partitions of tables with weekofyear(col1) -------------------------------------------------------------------------- -delete from t11 where col1='2006-03-17'; -delete from t22 where col1='2006-03-17'; -delete from t33 where col1='2006-03-17'; -delete from t44 where col1='2006-03-17'; -delete from t55 where col1='2006-03-17'; -delete from t66 where col1='2006-03-17'; -select * from t11 order by col1; -col1 -2006-09-06 -select * from t22 order by col1; -col1 -2006-05-25 -2006-09-06 -select * from t33 order by col1; -col1 -2006-05-25 -2006-09-06 -select * from t44 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -select * from t55 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -insert into t11 values ('2006-03-17'); -insert into t22 values ('2006-03-17'); -insert into t33 values ('2006-03-17'); -insert into t44 values (60,'2006-03-17'); -insert into t55 values (60,'2006-03-17'); -insert into t66 values (60,'2006-03-17'); -select * from t11 order by col1; -col1 -2006-03-17 -2006-09-06 -select * from t22 order by col1; -col1 -2006-03-17 -2006-05-25 -2006-09-06 -select * from t33 order by col1; -col1 -2006-03-17 -2006-05-25 -2006-09-06 -select * from t44 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -60 2006-03-17 -select * from t55 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -60 2006-03-17 -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -60 2006-03-17 -alter table t11 drop partition p0; -alter table t22 drop partition p0; -alter table t44 drop partition p0; -alter table t55 drop partition p0; -alter table t66 drop partition p0; -select * from t11 order by col1; -col1 -2006-09-06 -select * from t22 order by col1; -col1 -2006-03-17 -2006-05-25 -2006-09-06 -select * from t33 order by col1; -col1 -2006-03-17 -2006-05-25 -2006-09-06 -select * from t44 order by colint; -colint col1 -60 2006-03-17 -select * from t55 order by colint; -colint col1 -60 2006-03-17 -select * from t66 order by colint; -colint col1 -60 2006-03-17 -------------------------- ----- some alter table end -------------------------- -drop table if exists t1 ; -drop table if exists t2 ; -drop table if exists t3 ; -drop table if exists t4 ; -drop table if exists t5 ; -drop table if exists t6 ; -drop table if exists t11 ; -drop table if exists t22 ; -drop table if exists t33 ; -drop table if exists t44 ; -drop table if exists t55 ; -drop table if exists t66 ; -------------------------------------------------------------------------- --- year(col1)-1990 in partition with coltype date ------------------------------------------------------------------------- drop table if exists t1 ; @@ -12765,9 +11961,9 @@ insert into t2 values ('2004-05-25'); insert into t3 values ('1996-01-03'); insert into t3 values ('2000-02-17'); insert into t3 values ('2004-05-25'); -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t6; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6; select year(col1)-1990 from t1 order by col1; year(col1)-1990 6 @@ -13269,9 +12465,9 @@ insert into t2 values ('2006-03-25'); insert into t3 values ('2006-01-03'); insert into t3 values ('2006-08-17'); insert into t3 values ('2006-03-25'); -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/parts/inc/part_supported_sql_funcs_int_date.inc' into table t6; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6; select yearweek(col1)-200600 from t1 order by col1; yearweek(col1)-200600 1 diff --git a/mysql-test/suite/parts/r/partition_alter3_innodb.result b/mysql-test/suite/parts/r/partition_alter3_innodb.result index 25387301cdb..7228462c61d 100644 --- a/mysql-test/suite/parts/r/partition_alter3_innodb.result +++ b/mysql-test/suite/parts/r/partition_alter3_innodb.result @@ -64,7 +64,7 @@ t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm +MYSQLTEST_VARDIR/master-data/test/t1.frm EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 20 Using where @@ -78,15 +78,15 @@ id select_type table partitions type possible_keys key key_len ref rows Extra ALTER TABLE t1 ADD PARTITION (PARTITION part2); ERROR HY000: Partition management on a not partitioned table is not possible # 1.1.2 Assign HASH partitioning -ALTER TABLE t1 PARTITION BY HASH(CAST(YEAR(f_date) AS SIGNED INTEGER)); +ALTER TABLE t1 PARTITION BY HASH(YEAR(f_date)); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(YEAR(f_date) AS SIGNED INTEGER)) */ -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) */ +MYSQLTEST_VARDIR/master-data/test/t1.frm +MYSQLTEST_VARDIR/master-data/test/t1.par EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 20 Using where @@ -95,51 +95,30 @@ id select_type table partitions type possible_keys key key_len ref rows Extra # check read row by row success: 1 # 1.1.3 Assign other HASH partitioning to already partitioned table # + test and switch back + test -ALTER TABLE t1 PARTITION BY HASH(CAST(f_varchar AS SIGNED INTEGER)); -Warnings: -Warning 1292 Truncated incorrect INTEGER value: '20 ' -Warning 1292 Truncated incorrect INTEGER value: '19 ' -Warning 1292 Truncated incorrect INTEGER value: '18 ' -Warning 1292 Truncated incorrect INTEGER value: '17 ' -Warning 1292 Truncated incorrect INTEGER value: '16 ' -Warning 1292 Truncated incorrect INTEGER value: '15 ' -Warning 1292 Truncated incorrect INTEGER value: '14 ' -Warning 1292 Truncated incorrect INTEGER value: '13 ' -Warning 1292 Truncated incorrect INTEGER value: '12 ' -Warning 1292 Truncated incorrect INTEGER value: '11 ' -Warning 1292 Truncated incorrect INTEGER value: '10 ' -Warning 1292 Truncated incorrect INTEGER value: '9 ' -Warning 1292 Truncated incorrect INTEGER value: '8 ' -Warning 1292 Truncated incorrect INTEGER value: '7 ' -Warning 1292 Truncated incorrect INTEGER value: '6 ' -Warning 1292 Truncated incorrect INTEGER value: '5 ' -Warning 1292 Truncated incorrect INTEGER value: '4 ' -Warning 1292 Truncated incorrect INTEGER value: '3 ' -Warning 1292 Truncated incorrect INTEGER value: '2 ' -Warning 1292 Truncated incorrect INTEGER value: '1 ' +ALTER TABLE t1 PARTITION BY HASH(DAYOFYEAR(f_date)); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(f_varchar AS SIGNED INTEGER)) */ -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (DAYOFYEAR(f_date)) */ +MYSQLTEST_VARDIR/master-data/test/t1.frm +MYSQLTEST_VARDIR/master-data/test/t1.par EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 20 Using where # check read single success: 1 # check read all success: 1 # check read row by row success: 1 -ALTER TABLE t1 PARTITION BY HASH(CAST(YEAR(f_date) AS SIGNED INTEGER)); +ALTER TABLE t1 PARTITION BY HASH(YEAR(f_date)); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(YEAR(f_date) AS SIGNED INTEGER)) */ -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) */ +MYSQLTEST_VARDIR/master-data/test/t1.frm +MYSQLTEST_VARDIR/master-data/test/t1.par EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 20 Using where @@ -158,9 +137,9 @@ Table Create Table t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(YEAR(f_date) AS SIGNED INTEGER)) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB) */ -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB) */ +MYSQLTEST_VARDIR/master-data/test/t1.frm +MYSQLTEST_VARDIR/master-data/test/t1.par EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 part1 ALL NULL NULL NULL NULL 7 Using where @@ -177,9 +156,9 @@ Table Create Table t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(YEAR(f_date) AS SIGNED INTEGER)) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB) */ -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB) */ +MYSQLTEST_VARDIR/master-data/test/t1.frm +MYSQLTEST_VARDIR/master-data/test/t1.par EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 5 Using where @@ -193,9 +172,9 @@ Table Create Table t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(YEAR(f_date) AS SIGNED INTEGER)) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB, PARTITION p4 ENGINE = InnoDB, PARTITION p5 ENGINE = InnoDB, PARTITION p6 ENGINE = InnoDB, PARTITION p7 ENGINE = InnoDB) */ -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB, PARTITION p4 ENGINE = InnoDB, PARTITION p5 ENGINE = InnoDB, PARTITION p6 ENGINE = InnoDB, PARTITION p7 ENGINE = InnoDB) */ +MYSQLTEST_VARDIR/master-data/test/t1.frm +MYSQLTEST_VARDIR/master-data/test/t1.par EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 3 Using where @@ -221,9 +200,9 @@ Table Create Table t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(YEAR(f_date) AS SIGNED INTEGER)) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB, PARTITION p4 ENGINE = InnoDB, PARTITION p5 ENGINE = InnoDB, PARTITION p6 ENGINE = InnoDB) */ -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB, PARTITION p4 ENGINE = InnoDB, PARTITION p5 ENGINE = InnoDB, PARTITION p6 ENGINE = InnoDB) */ +MYSQLTEST_VARDIR/master-data/test/t1.frm +MYSQLTEST_VARDIR/master-data/test/t1.par EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p6 ALL NULL NULL NULL NULL 3 Using where @@ -236,9 +215,9 @@ Table Create Table t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(YEAR(f_date) AS SIGNED INTEGER)) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB, PARTITION p4 ENGINE = InnoDB, PARTITION p5 ENGINE = InnoDB) */ -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB, PARTITION p4 ENGINE = InnoDB, PARTITION p5 ENGINE = InnoDB) */ +MYSQLTEST_VARDIR/master-data/test/t1.frm +MYSQLTEST_VARDIR/master-data/test/t1.par EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p4 ALL NULL NULL NULL NULL 4 Using where @@ -251,9 +230,9 @@ Table Create Table t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(YEAR(f_date) AS SIGNED INTEGER)) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB, PARTITION p4 ENGINE = InnoDB) */ -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB, PARTITION p4 ENGINE = InnoDB) */ +MYSQLTEST_VARDIR/master-data/test/t1.frm +MYSQLTEST_VARDIR/master-data/test/t1.par EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 4 Using where @@ -266,9 +245,9 @@ Table Create Table t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(YEAR(f_date) AS SIGNED INTEGER)) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB) */ -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB) */ +MYSQLTEST_VARDIR/master-data/test/t1.frm +MYSQLTEST_VARDIR/master-data/test/t1.par EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 5 Using where @@ -281,9 +260,9 @@ Table Create Table t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(YEAR(f_date) AS SIGNED INTEGER)) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB) */ -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB) */ +MYSQLTEST_VARDIR/master-data/test/t1.frm +MYSQLTEST_VARDIR/master-data/test/t1.par EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 part1 ALL NULL NULL NULL NULL 7 Using where @@ -296,9 +275,9 @@ Table Create Table t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(YEAR(f_date) AS SIGNED INTEGER)) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB) */ -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB) */ +MYSQLTEST_VARDIR/master-data/test/t1.frm +MYSQLTEST_VARDIR/master-data/test/t1.par EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 10 Using where @@ -311,9 +290,9 @@ Table Create Table t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(YEAR(f_date) AS SIGNED INTEGER)) (PARTITION p0 ENGINE = InnoDB) */ -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = InnoDB) */ +MYSQLTEST_VARDIR/master-data/test/t1.frm +MYSQLTEST_VARDIR/master-data/test/t1.par EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 20 Using where @@ -331,7 +310,7 @@ t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm +MYSQLTEST_VARDIR/master-data/test/t1.frm EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 20 Using where @@ -370,7 +349,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm +MYSQLTEST_VARDIR/master-data/test/t1.frm EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 20 Using where @@ -392,8 +371,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) */ -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par +MYSQLTEST_VARDIR/master-data/test/t1.frm +MYSQLTEST_VARDIR/master-data/test/t1.par EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 20 Using where @@ -416,8 +395,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB) */ -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par +MYSQLTEST_VARDIR/master-data/test/t1.frm +MYSQLTEST_VARDIR/master-data/test/t1.par EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 part7 ALL NULL NULL NULL NULL 7 Using where @@ -435,8 +414,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB) */ -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par +MYSQLTEST_VARDIR/master-data/test/t1.frm +MYSQLTEST_VARDIR/master-data/test/t1.par EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 part7 ALL NULL NULL NULL NULL 5 Using where @@ -454,8 +433,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB, PARTITION p4 ENGINE = InnoDB, PARTITION p5 ENGINE = InnoDB, PARTITION p6 ENGINE = InnoDB, PARTITION p7 ENGINE = InnoDB) */ -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par +MYSQLTEST_VARDIR/master-data/test/t1.frm +MYSQLTEST_VARDIR/master-data/test/t1.par EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p6 ALL NULL NULL NULL NULL 3 Using where @@ -480,8 +459,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB, PARTITION p4 ENGINE = InnoDB, PARTITION p5 ENGINE = InnoDB, PARTITION p6 ENGINE = InnoDB) */ -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par +MYSQLTEST_VARDIR/master-data/test/t1.frm +MYSQLTEST_VARDIR/master-data/test/t1.par EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 4 Using where @@ -498,8 +477,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB, PARTITION p4 ENGINE = InnoDB, PARTITION p5 ENGINE = InnoDB) */ -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par +MYSQLTEST_VARDIR/master-data/test/t1.frm +MYSQLTEST_VARDIR/master-data/test/t1.par EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 part7 ALL NULL NULL NULL NULL 3 Using where @@ -516,8 +495,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB, PARTITION p4 ENGINE = InnoDB) */ -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par +MYSQLTEST_VARDIR/master-data/test/t1.frm +MYSQLTEST_VARDIR/master-data/test/t1.par EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p4 ALL NULL NULL NULL NULL 10 Using where @@ -534,8 +513,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB) */ -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par +MYSQLTEST_VARDIR/master-data/test/t1.frm +MYSQLTEST_VARDIR/master-data/test/t1.par EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 part7 ALL NULL NULL NULL NULL 5 Using where @@ -552,8 +531,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB) */ -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par +MYSQLTEST_VARDIR/master-data/test/t1.frm +MYSQLTEST_VARDIR/master-data/test/t1.par EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 part7 ALL NULL NULL NULL NULL 7 Using where @@ -570,8 +549,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB) */ -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par +MYSQLTEST_VARDIR/master-data/test/t1.frm +MYSQLTEST_VARDIR/master-data/test/t1.par EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 10 Using where @@ -588,8 +567,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = InnoDB) */ -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par +MYSQLTEST_VARDIR/master-data/test/t1.frm +MYSQLTEST_VARDIR/master-data/test/t1.par EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 20 Using where @@ -610,7 +589,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm +MYSQLTEST_VARDIR/master-data/test/t1.frm EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 20 Using where diff --git a/mysql-test/suite/parts/r/partition_alter3_myisam.result b/mysql-test/suite/parts/r/partition_alter3_myisam.result index f320dd69dd7..c24858aa2ca 100644 --- a/mysql-test/suite/parts/r/partition_alter3_myisam.result +++ b/mysql-test/suite/parts/r/partition_alter3_myisam.result @@ -64,9 +64,9 @@ t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm +MYSQLTEST_VARDIR/master-data/test/t1.MYD +MYSQLTEST_VARDIR/master-data/test/t1.MYI +MYSQLTEST_VARDIR/master-data/test/t1.frm EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 20 Using where @@ -80,17 +80,17 @@ id select_type table partitions type possible_keys key key_len ref rows Extra ALTER TABLE t1 ADD PARTITION (PARTITION part2); ERROR HY000: Partition management on a not partitioned table is not possible # 1.1.2 Assign HASH partitioning -ALTER TABLE t1 PARTITION BY HASH(CAST(YEAR(f_date) AS SIGNED INTEGER)); +ALTER TABLE t1 PARTITION BY HASH(YEAR(f_date)); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(YEAR(f_date) AS SIGNED INTEGER)) */ -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) */ +MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD +MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI +MYSQLTEST_VARDIR/master-data/test/t1.frm +MYSQLTEST_VARDIR/master-data/test/t1.par EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 20 Using where @@ -99,55 +99,34 @@ id select_type table partitions type possible_keys key key_len ref rows Extra # check read row by row success: 1 # 1.1.3 Assign other HASH partitioning to already partitioned table # + test and switch back + test -ALTER TABLE t1 PARTITION BY HASH(CAST(f_varchar AS SIGNED INTEGER)); -Warnings: -Warning 1292 Truncated incorrect INTEGER value: '20' -Warning 1292 Truncated incorrect INTEGER value: '19' -Warning 1292 Truncated incorrect INTEGER value: '18' -Warning 1292 Truncated incorrect INTEGER value: '17' -Warning 1292 Truncated incorrect INTEGER value: '16' -Warning 1292 Truncated incorrect INTEGER value: '15' -Warning 1292 Truncated incorrect INTEGER value: '14' -Warning 1292 Truncated incorrect INTEGER value: '13' -Warning 1292 Truncated incorrect INTEGER value: '12' -Warning 1292 Truncated incorrect INTEGER value: '11' -Warning 1292 Truncated incorrect INTEGER value: '10' -Warning 1292 Truncated incorrect INTEGER value: '90' -Warning 1292 Truncated incorrect INTEGER value: '80' -Warning 1292 Truncated incorrect INTEGER value: '70' -Warning 1292 Truncated incorrect INTEGER value: '60' -Warning 1292 Truncated incorrect INTEGER value: '50' -Warning 1292 Truncated incorrect INTEGER value: '40' -Warning 1292 Truncated incorrect INTEGER value: '30' -Warning 1292 Truncated incorrect INTEGER value: '20' -Warning 1292 Truncated incorrect INTEGER value: '10' +ALTER TABLE t1 PARTITION BY HASH(DAYOFYEAR(f_date)); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(f_varchar AS SIGNED INTEGER)) */ -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (DAYOFYEAR(f_date)) */ +MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD +MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI +MYSQLTEST_VARDIR/master-data/test/t1.frm +MYSQLTEST_VARDIR/master-data/test/t1.par EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 20 Using where # check read single success: 1 # check read all success: 1 # check read row by row success: 1 -ALTER TABLE t1 PARTITION BY HASH(CAST(YEAR(f_date) AS SIGNED INTEGER)); +ALTER TABLE t1 PARTITION BY HASH(YEAR(f_date)); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(YEAR(f_date) AS SIGNED INTEGER)) */ -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) */ +MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD +MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI +MYSQLTEST_VARDIR/master-data/test/t1.frm +MYSQLTEST_VARDIR/master-data/test/t1.par EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 20 Using where @@ -166,15 +145,15 @@ Table Create Table t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(YEAR(f_date) AS SIGNED INTEGER)) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM) */ -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM) */ +MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD +MYSQLTEST_VARDIR/master-data/test/t1#P#p0.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#part7.MYD +MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYI +MYSQLTEST_VARDIR/master-data/test/t1.frm +MYSQLTEST_VARDIR/master-data/test/t1.par EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 part1 ALL NULL NULL NULL NULL 7 Using where @@ -191,17 +170,17 @@ Table Create Table t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(YEAR(f_date) AS SIGNED INTEGER)) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM) */ -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM) */ +MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD +MYSQLTEST_VARDIR/master-data/test/t1#P#p0.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#part7.MYD +MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYI +MYSQLTEST_VARDIR/master-data/test/t1.frm +MYSQLTEST_VARDIR/master-data/test/t1.par EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 5 Using where @@ -215,25 +194,25 @@ Table Create Table t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(YEAR(f_date) AS SIGNED INTEGER)) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM, PARTITION p4 ENGINE = MyISAM, PARTITION p5 ENGINE = MyISAM, PARTITION p6 ENGINE = MyISAM, PARTITION p7 ENGINE = MyISAM) */ -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p4.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p4.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p5.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p5.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p6.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p6.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p7.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p7.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM, PARTITION p4 ENGINE = MyISAM, PARTITION p5 ENGINE = MyISAM, PARTITION p6 ENGINE = MyISAM, PARTITION p7 ENGINE = MyISAM) */ +MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD +MYSQLTEST_VARDIR/master-data/test/t1#P#p0.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#P#p6.MYD +MYSQLTEST_VARDIR/master-data/test/t1#P#p6.MYI +MYSQLTEST_VARDIR/master-data/test/t1#P#p7.MYD +MYSQLTEST_VARDIR/master-data/test/t1#P#p7.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#part7.MYD +MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYI +MYSQLTEST_VARDIR/master-data/test/t1.frm +MYSQLTEST_VARDIR/master-data/test/t1.par EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 3 Using where @@ -259,23 +238,23 @@ Table Create Table t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(YEAR(f_date) AS SIGNED INTEGER)) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM, PARTITION p4 ENGINE = MyISAM, PARTITION p5 ENGINE = MyISAM, PARTITION p6 ENGINE = MyISAM) */ -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p4.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p4.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p5.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p5.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p6.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p6.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM, PARTITION p4 ENGINE = MyISAM, PARTITION p5 ENGINE = MyISAM, PARTITION p6 ENGINE = MyISAM) */ +MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD +MYSQLTEST_VARDIR/master-data/test/t1#P#p0.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#P#p6.MYD +MYSQLTEST_VARDIR/master-data/test/t1#P#p6.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#part7.MYD +MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYI +MYSQLTEST_VARDIR/master-data/test/t1.frm +MYSQLTEST_VARDIR/master-data/test/t1.par EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p6 ALL NULL NULL NULL NULL 3 Using where @@ -288,21 +267,21 @@ Table Create Table t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(YEAR(f_date) AS SIGNED INTEGER)) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM, PARTITION p4 ENGINE = MyISAM, PARTITION p5 ENGINE = MyISAM) */ -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p4.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p4.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p5.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p5.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM, PARTITION p4 ENGINE = MyISAM, PARTITION p5 ENGINE = MyISAM) */ +MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD +MYSQLTEST_VARDIR/master-data/test/t1#P#p0.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#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#part7.MYD +MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYI +MYSQLTEST_VARDIR/master-data/test/t1.frm +MYSQLTEST_VARDIR/master-data/test/t1.par EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p4 ALL NULL NULL NULL NULL 4 Using where @@ -315,19 +294,19 @@ Table Create Table t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(YEAR(f_date) AS SIGNED INTEGER)) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM, PARTITION p4 ENGINE = MyISAM) */ -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p4.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p4.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM, PARTITION p4 ENGINE = MyISAM) */ +MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD +MYSQLTEST_VARDIR/master-data/test/t1#P#p0.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#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#part7.MYD +MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYI +MYSQLTEST_VARDIR/master-data/test/t1.frm +MYSQLTEST_VARDIR/master-data/test/t1.par EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 4 Using where @@ -340,17 +319,17 @@ Table Create Table t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(YEAR(f_date) AS SIGNED INTEGER)) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM) */ -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM) */ +MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD +MYSQLTEST_VARDIR/master-data/test/t1#P#p0.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#part7.MYD +MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYI +MYSQLTEST_VARDIR/master-data/test/t1.frm +MYSQLTEST_VARDIR/master-data/test/t1.par EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 5 Using where @@ -363,15 +342,15 @@ Table Create Table t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(YEAR(f_date) AS SIGNED INTEGER)) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM) */ -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM) */ +MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD +MYSQLTEST_VARDIR/master-data/test/t1#P#p0.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#part7.MYD +MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYI +MYSQLTEST_VARDIR/master-data/test/t1.frm +MYSQLTEST_VARDIR/master-data/test/t1.par EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 part1 ALL NULL NULL NULL NULL 7 Using where @@ -384,13 +363,13 @@ Table Create Table t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(YEAR(f_date) AS SIGNED INTEGER)) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM) */ -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM) */ +MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD +MYSQLTEST_VARDIR/master-data/test/t1#P#p0.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.frm +MYSQLTEST_VARDIR/master-data/test/t1.par EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 10 Using where @@ -403,11 +382,11 @@ Table Create Table t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(YEAR(f_date) AS SIGNED INTEGER)) (PARTITION p0 ENGINE = MyISAM) */ -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = MyISAM) */ +MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD +MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI +MYSQLTEST_VARDIR/master-data/test/t1.frm +MYSQLTEST_VARDIR/master-data/test/t1.par EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 20 Using where @@ -425,9 +404,9 @@ t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm +MYSQLTEST_VARDIR/master-data/test/t1.MYD +MYSQLTEST_VARDIR/master-data/test/t1.MYI +MYSQLTEST_VARDIR/master-data/test/t1.frm EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 20 Using where @@ -460,9 +439,9 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm +MYSQLTEST_VARDIR/master-data/test/t1.MYD +MYSQLTEST_VARDIR/master-data/test/t1.MYI +MYSQLTEST_VARDIR/master-data/test/t1.frm EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 20 Using where @@ -484,10 +463,10 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) */ -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par +MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD +MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI +MYSQLTEST_VARDIR/master-data/test/t1.frm +MYSQLTEST_VARDIR/master-data/test/t1.par EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 20 Using where @@ -510,14 +489,14 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM) */ -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par +MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD +MYSQLTEST_VARDIR/master-data/test/t1#P#p0.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#part7.MYD +MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYI +MYSQLTEST_VARDIR/master-data/test/t1.frm +MYSQLTEST_VARDIR/master-data/test/t1.par EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 part7 ALL NULL NULL NULL NULL 7 Using where @@ -535,16 +514,16 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM) */ -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par +MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD +MYSQLTEST_VARDIR/master-data/test/t1#P#p0.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#part7.MYD +MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYI +MYSQLTEST_VARDIR/master-data/test/t1.frm +MYSQLTEST_VARDIR/master-data/test/t1.par EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 part7 ALL NULL NULL NULL NULL 5 Using where @@ -562,24 +541,24 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM, PARTITION p4 ENGINE = MyISAM, PARTITION p5 ENGINE = MyISAM, PARTITION p6 ENGINE = MyISAM, PARTITION p7 ENGINE = MyISAM) */ -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p4.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p4.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p5.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p5.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p6.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p6.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p7.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p7.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par +MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD +MYSQLTEST_VARDIR/master-data/test/t1#P#p0.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#P#p6.MYD +MYSQLTEST_VARDIR/master-data/test/t1#P#p6.MYI +MYSQLTEST_VARDIR/master-data/test/t1#P#p7.MYD +MYSQLTEST_VARDIR/master-data/test/t1#P#p7.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#part7.MYD +MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYI +MYSQLTEST_VARDIR/master-data/test/t1.frm +MYSQLTEST_VARDIR/master-data/test/t1.par EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p6 ALL NULL NULL NULL NULL 3 Using where @@ -604,22 +583,22 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM, PARTITION p4 ENGINE = MyISAM, PARTITION p5 ENGINE = MyISAM, PARTITION p6 ENGINE = MyISAM) */ -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p4.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p4.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p5.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p5.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p6.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p6.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par +MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD +MYSQLTEST_VARDIR/master-data/test/t1#P#p0.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#P#p6.MYD +MYSQLTEST_VARDIR/master-data/test/t1#P#p6.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#part7.MYD +MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYI +MYSQLTEST_VARDIR/master-data/test/t1.frm +MYSQLTEST_VARDIR/master-data/test/t1.par EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 4 Using where @@ -636,20 +615,20 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM, PARTITION p4 ENGINE = MyISAM, PARTITION p5 ENGINE = MyISAM) */ -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p4.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p4.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p5.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p5.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par +MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD +MYSQLTEST_VARDIR/master-data/test/t1#P#p0.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#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#part7.MYD +MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYI +MYSQLTEST_VARDIR/master-data/test/t1.frm +MYSQLTEST_VARDIR/master-data/test/t1.par EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 part7 ALL NULL NULL NULL NULL 3 Using where @@ -666,18 +645,18 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM, PARTITION p4 ENGINE = MyISAM) */ -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p4.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p4.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par +MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD +MYSQLTEST_VARDIR/master-data/test/t1#P#p0.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#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#part7.MYD +MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYI +MYSQLTEST_VARDIR/master-data/test/t1.frm +MYSQLTEST_VARDIR/master-data/test/t1.par EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p4 ALL NULL NULL NULL NULL 10 Using where @@ -694,16 +673,16 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM) */ -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par +MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD +MYSQLTEST_VARDIR/master-data/test/t1#P#p0.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#part7.MYD +MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYI +MYSQLTEST_VARDIR/master-data/test/t1.frm +MYSQLTEST_VARDIR/master-data/test/t1.par EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 part7 ALL NULL NULL NULL NULL 5 Using where @@ -720,14 +699,14 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM) */ -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part7.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par +MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD +MYSQLTEST_VARDIR/master-data/test/t1#P#p0.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#part7.MYD +MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYI +MYSQLTEST_VARDIR/master-data/test/t1.frm +MYSQLTEST_VARDIR/master-data/test/t1.par EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 part7 ALL NULL NULL NULL NULL 7 Using where @@ -744,12 +723,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM) */ -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par +MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD +MYSQLTEST_VARDIR/master-data/test/t1#P#p0.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.frm +MYSQLTEST_VARDIR/master-data/test/t1.par EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 10 Using where @@ -766,10 +745,10 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = MyISAM) */ -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p0.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par +MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD +MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI +MYSQLTEST_VARDIR/master-data/test/t1.frm +MYSQLTEST_VARDIR/master-data/test/t1.par EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 20 Using where @@ -790,9 +769,9 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.MYD -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.MYI -/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm +MYSQLTEST_VARDIR/master-data/test/t1.MYD +MYSQLTEST_VARDIR/master-data/test/t1.MYI +MYSQLTEST_VARDIR/master-data/test/t1.frm EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 20 Using where diff --git a/mysql-test/suite/parts/r/partition_basic_innodb.result b/mysql-test/suite/parts/r/partition_basic_innodb.result index f9ae10caf18..dc875980678 100644 --- a/mysql-test/suite/parts/r/partition_basic_innodb.result +++ b/mysql-test/suite/parts/r/partition_basic_innodb.result @@ -59,15 +59,6 @@ SET @@session.sql_mode= ''; #------------------------------------------------------------------------ # 1.1 The partitioning function contains one column. DROP TABLE IF EXISTS t1; -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; INSERT INTO t1(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) @@ -513,6 +504,8 @@ DROP TABLE t1; # 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) create_command SHOW CREATE TABLE t1; @@ -956,6 +949,8 @@ DROP TABLE t1; # 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) create_command SHOW CREATE TABLE t1; @@ -1399,52 +1394,6 @@ DROP TABLE t1; # We found: unified filelist --- not determined --- -SET @aux = 'PARTITION BY RANGE(f_int1) -(PARTITION parta VALUES LESS THAN (0) - -, -PARTITION partb VALUES LESS THAN (5) - -, -PARTITION partc VALUES LESS THAN (10) - -, -PARTITION partd VALUES LESS THAN (10 + 5) - -, -PARTITION parte VALUES LESS THAN (20) - -, -PARTITION partf VALUES LESS THAN (2147483646) - -)'; -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) -(PARTITION parta VALUES LESS THAN (0) - -, -PARTITION partb VALUES LESS THAN (5) - -, -PARTITION partc VALUES LESS THAN (10) - -, -PARTITION partd VALUES LESS THAN (10 + 5) - -, -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) @@ -1888,27 +1837,6 @@ DROP TABLE t1; # We found: unified filelist --- not determined --- -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 DIV 2) SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 2 -(PARTITION parta VALUES LESS THAN (0) - -, -PARTITION partb VALUES LESS THAN (5) - -, -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) @@ -2354,31 +2282,6 @@ DROP TABLE t1; # We found: unified filelist --- not determined --- -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 KEY(f_int1) -(PARTITION part1 VALUES LESS THAN (0) - - -(SUBPARTITION subpart11, SUBPARTITION subpart12), -PARTITION part2 VALUES LESS THAN (5) - - -(SUBPARTITION subpart21, SUBPARTITION subpart22), -PARTITION part3 VALUES LESS THAN (10) - - -(SUBPARTITION subpart31, SUBPARTITION subpart32), -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) @@ -2822,47 +2725,6 @@ DROP TABLE t1; # We found: unified filelist --- not determined --- -CREATE TABLE t1 ( -f_int1 INTEGER, -f_int2 INTEGER, -f_char1 CHAR(20), -f_char2 CHAR(20), -f_charbig VARCHAR(1000) - -) -PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 1) -(PARTITION part1 VALUES IN (0) - - - (SUBPARTITION sp11 - - , - SUBPARTITION sp12 - - ), - PARTITION part2 VALUES IN (1) - - - (SUBPARTITION sp21 - - , - SUBPARTITION sp22 - - ), - PARTITION part3 VALUES IN (2) - - - (SUBPARTITION sp31, - SUBPARTITION sp32), - 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) @@ -3308,25 +3170,6 @@ DROP TABLE t1; # We found: unified filelist --- not determined --- -CREATE TABLE t1 ( -f_int1 INTEGER, -f_int2 INTEGER, -f_char1 CHAR(20), -f_char2 CHAR(20), -f_charbig VARCHAR(1000) - -) -PARTITION BY LIST(ABS(MOD(f_int1,2))) -SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 -(PARTITION part1 VALUES IN (0) - - , - PARTITION part2 VALUES IN (1) - - , - 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) @@ -3773,25 +3616,6 @@ DROP TABLE t1; unified filelist --- not determined --- # 1.1.1 with DATA DIECTORY/INDEX DIRECTORY -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 -(PARTITION p1 -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', -PARTITION p2 -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'); INSERT INTO t1(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) @@ -3804,7 +3628,7 @@ t1 CREATE TABLE `t1` ( `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION p1 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION p2 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB) */ +) ENGINE=InnoDB 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 = InnoDB, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB) */ # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -4237,40 +4061,6 @@ DROP TABLE t1; # We found: unified filelist --- not determined --- -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 5 -(PARTITION p1 -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', -PARTITION p2 -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', -PARTITION p3 -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', -PARTITION p4 -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', -PARTITION p5 -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'); INSERT INTO t1(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) @@ -4283,7 +4073,7 @@ t1 CREATE TABLE `t1` ( `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION p1 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION p2 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION p3 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION p4 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION p5 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB) */ +) ENGINE=InnoDB 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 = InnoDB, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION p3 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION p4 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION p5 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB) */ # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -4716,6 +4506,8 @@ DROP TABLE t1; # 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) create_command SHOW CREATE TABLE t1; @@ -4726,7 +4518,7 @@ t1 CREATE TABLE `t1` ( `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION part0 VALUES IN (0) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION part1 VALUES IN (1) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION part2 VALUES IN (2) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION part3 VALUES IN (3) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB) */ +) ENGINE=InnoDB 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 = InnoDB, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part0 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part1 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB) */ # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -5159,76 +4951,6 @@ DROP TABLE t1; # We found: unified filelist --- not determined --- -SET @aux = 'PARTITION BY RANGE(f_int1) -(PARTITION parta VALUES LESS THAN (0) -DATA DIRECTORY = - ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'' -INDEX DIRECTORY = - ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'', -PARTITION partb VALUES LESS THAN (5) -DATA DIRECTORY = - ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'' -INDEX DIRECTORY = - ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'', -PARTITION partc VALUES LESS THAN (10) -DATA DIRECTORY = - ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'' -INDEX DIRECTORY = - ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'', -PARTITION partd VALUES LESS THAN (10 + 5) -DATA DIRECTORY = - ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'' -INDEX DIRECTORY = - ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'', -PARTITION parte VALUES LESS THAN (20) -DATA DIRECTORY = - ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'' -INDEX DIRECTORY = - ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'', -PARTITION partf VALUES LESS THAN (2147483646) -DATA DIRECTORY = - ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'' -INDEX DIRECTORY = - ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'')'; -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) -(PARTITION parta VALUES LESS THAN (0) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', -PARTITION partb VALUES LESS THAN (5) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', -PARTITION partc VALUES LESS THAN (10) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', -PARTITION partd VALUES LESS THAN (10 + 5) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', -PARTITION parte VALUES LESS THAN (20) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', -PARTITION partf VALUES LESS THAN (2147483646) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'); INSERT INTO t1(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) @@ -5241,7 +4963,7 @@ t1 CREATE TABLE `t1` ( `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB) */ +) ENGINE=InnoDB 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 = InnoDB, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB) */ # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -5672,35 +5394,6 @@ DROP TABLE t1; # We found: unified filelist --- not determined --- -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 DIV 2) SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 2 -(PARTITION parta VALUES LESS THAN (0) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', -PARTITION partb VALUES LESS THAN (5) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', -PARTITION partc VALUES LESS THAN (10) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', -PARTITION partd VALUES LESS THAN (2147483646) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'); INSERT INTO t1(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) @@ -5713,7 +5406,7 @@ t1 CREATE TABLE `t1` ( `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL -) ENGINE=InnoDB 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 = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB) */ +) ENGINE=InnoDB 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 = InnoDB, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB) */ # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -6146,39 +5839,6 @@ DROP TABLE t1; # We found: unified filelist --- not determined --- -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 KEY(f_int1) -(PARTITION part1 VALUES LESS THAN (0) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' -(SUBPARTITION subpart11, SUBPARTITION subpart12), -PARTITION part2 VALUES LESS THAN (5) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' -(SUBPARTITION subpart21, SUBPARTITION subpart22), -PARTITION part3 VALUES LESS THAN (10) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' -(SUBPARTITION subpart31, SUBPARTITION subpart32), -PARTITION part4 VALUES LESS THAN (2147483646) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' -(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) @@ -6191,7 +5851,7 @@ t1 CREATE TABLE `t1` ( `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart12 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart22 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart32 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart42 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB)) */ +) ENGINE=InnoDB 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 = InnoDB, SUBPARTITION subpart12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), 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 = InnoDB, SUBPARTITION subpart22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), 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 = InnoDB, SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), 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 = InnoDB, SUBPARTITION subpart42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB)) */ # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -6622,67 +6282,6 @@ DROP TABLE t1; # We found: unified filelist --- not determined --- -CREATE TABLE t1 ( -f_int1 INTEGER, -f_int2 INTEGER, -f_char1 CHAR(20), -f_char2 CHAR(20), -f_charbig VARCHAR(1000) - -) -PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 1) -(PARTITION part1 VALUES IN (0) - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' - (SUBPARTITION sp11 - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', - SUBPARTITION sp12 - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'), - PARTITION part2 VALUES IN (1) - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' - (SUBPARTITION sp21 - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', - SUBPARTITION sp22 - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'), - PARTITION part3 VALUES IN (2) - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' - (SUBPARTITION sp31, - SUBPARTITION sp32), - PARTITION part4 VALUES IN (NULL) - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' - (SUBPARTITION sp41 - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', - SUBPARTITION sp42 - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index')); INSERT INTO t1(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) @@ -6695,7 +6294,7 @@ t1 CREATE TABLE `t1` ( `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL -) ENGINE=InnoDB 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 = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp12 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp22 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp32 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp42 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB)) */ +) ENGINE=InnoDB 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 = InnoDB, SUBPARTITION sp12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB)) */ # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -7128,31 +6727,6 @@ DROP TABLE t1; # We found: unified filelist --- not determined --- -CREATE TABLE t1 ( -f_int1 INTEGER, -f_int2 INTEGER, -f_char1 CHAR(20), -f_char2 CHAR(20), -f_charbig VARCHAR(1000) - -) -PARTITION BY LIST(ABS(MOD(f_int1,2))) -SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 -(PARTITION part1 VALUES IN (0) - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', - PARTITION part2 VALUES IN (1) - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', - PARTITION part3 VALUES IN (NULL) - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'); INSERT INTO t1(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) @@ -7165,7 +6739,7 @@ t1 CREATE TABLE `t1` ( `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL -) ENGINE=InnoDB 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 = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION part2 VALUES IN (1) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB) */ +) ENGINE=InnoDB 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 = InnoDB, PARTITION part2 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB) */ # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -7599,15 +7173,6 @@ DROP TABLE t1; unified filelist --- not determined --- DROP TABLE IF EXISTS t1; -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; INSERT INTO t1(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) @@ -8053,6 +7618,8 @@ DROP TABLE t1; # 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) create_command SHOW CREATE TABLE t1; @@ -8496,6 +8063,8 @@ DROP TABLE t1; # 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) create_command SHOW CREATE TABLE t1; @@ -8506,7 +8075,7 @@ t1 CREATE TABLE `t1` ( `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' ENGINE = InnoDB, PARTITION part0 VALUES IN (0) INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' ENGINE = InnoDB, PARTITION part3 VALUES IN (3) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB) */ +) ENGINE=InnoDB 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 = InnoDB, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' ENGINE = InnoDB, PARTITION part0 VALUES IN (0) INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' ENGINE = InnoDB, PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB) */ # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -8939,52 +8508,6 @@ DROP TABLE t1; # We found: unified filelist --- not determined --- -SET @aux = 'PARTITION BY RANGE(f_int1) -(PARTITION parta VALUES LESS THAN (0) -INDEX DIRECTORY = - ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'', -PARTITION partb VALUES LESS THAN (5) -DATA DIRECTORY = - ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'', -PARTITION partc VALUES LESS THAN (10) -DATA DIRECTORY = - ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'' -INDEX DIRECTORY = - ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'', -PARTITION partd VALUES LESS THAN (10 + 5), -PARTITION parte VALUES LESS THAN (20) -DATA DIRECTORY = - ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'', -PARTITION partf VALUES LESS THAN (2147483646) -INDEX DIRECTORY = - ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'')'; -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) -(PARTITION parta VALUES LESS THAN (0) -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', -PARTITION partb VALUES LESS THAN (5) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data', -PARTITION partc VALUES LESS THAN (10) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', -PARTITION partd VALUES LESS THAN (10 + 5), -PARTITION parte VALUES LESS THAN (20) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data', -PARTITION partf VALUES LESS THAN (2147483646) -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'); INSERT INTO t1(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) @@ -8997,7 +8520,7 @@ t1 CREATE TABLE `t1` ( `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB) */ +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB) */ # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -9428,27 +8951,6 @@ DROP TABLE t1; # We found: unified filelist --- not determined --- -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 DIV 2) SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 2 -(PARTITION parta VALUES LESS THAN (0) -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', -PARTITION partb VALUES LESS THAN (5) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data', -PARTITION partc VALUES LESS THAN (10), -PARTITION partd VALUES LESS THAN (2147483646) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'); INSERT INTO t1(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) @@ -9461,7 +8963,7 @@ t1 CREATE TABLE `t1` ( `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL -) ENGINE=InnoDB 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 = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB) */ +) ENGINE=InnoDB 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 = InnoDB, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB) */ # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -9894,31 +9396,6 @@ DROP TABLE t1; # We found: unified filelist --- not determined --- -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 KEY(f_int1) -(PARTITION part1 VALUES LESS THAN (0) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -(SUBPARTITION subpart11, SUBPARTITION subpart12), -PARTITION part2 VALUES LESS THAN (5) -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' -(SUBPARTITION subpart21, SUBPARTITION subpart22), -PARTITION part3 VALUES LESS THAN (10) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' -(SUBPARTITION subpart31, SUBPARTITION subpart32), -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) @@ -9931,7 +9408,7 @@ t1 CREATE TABLE `t1` ( `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' ENGINE = InnoDB, SUBPARTITION subpart12 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart22 INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart32 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */ +) ENGINE=InnoDB 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 = InnoDB, SUBPARTITION subpart12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart22 INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), 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 = InnoDB, SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */ # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -10362,51 +9839,6 @@ DROP TABLE t1; # We found: unified filelist --- not determined --- -CREATE TABLE t1 ( -f_int1 INTEGER, -f_int2 INTEGER, -f_char1 CHAR(20), -f_char2 CHAR(20), -f_charbig VARCHAR(1000) - -) -PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 1) -(PARTITION part1 VALUES IN (0) - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' - (SUBPARTITION sp11 - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data', - SUBPARTITION sp12 - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'), - PARTITION part2 VALUES IN (1) - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' - (SUBPARTITION sp21 - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data', - SUBPARTITION sp22 - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'), - PARTITION part3 VALUES IN (2) - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' - (SUBPARTITION sp31, - SUBPARTITION sp32), - PARTITION part4 VALUES IN (NULL) - (SUBPARTITION sp41 - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', - SUBPARTITION sp42 - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index')); INSERT INTO t1(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) @@ -10419,7 +9851,7 @@ t1 CREATE TABLE `t1` ( `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL -) ENGINE=InnoDB 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 = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp12 INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' ENGINE = InnoDB, SUBPARTITION sp22 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp32 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp42 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB)) */ +) ENGINE=InnoDB 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 = InnoDB, SUBPARTITION sp12 INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' ENGINE = InnoDB, SUBPARTITION sp22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB)) */ # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -14476,15 +13908,6 @@ DROP TABLE t1; #------------------------------------------------------------------------ # 2.5 PRIMARY KEY + UNIQUE INDEX consisting of two columns DROP TABLE IF EXISTS t1; -CREATE TABLE t1 ( -f_int1 INTEGER, -f_int2 INTEGER, -f_char1 CHAR(20), -f_char2 CHAR(20), -f_charbig VARCHAR(1000) -, UNIQUE INDEX uidx1 (f_int1,f_int2), PRIMARY KEY(f_int2,f_int1) -) -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) @@ -14967,6 +14390,8 @@ DROP TABLE t1; # 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) create_command SHOW CREATE TABLE t1; @@ -15447,6 +14872,8 @@ DROP TABLE t1; # 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) create_command SHOW CREATE TABLE t1; @@ -15459,7 +14886,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int2`,`f_int1`), UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION part0 VALUES IN (0) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION part1 VALUES IN (1) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION part2 VALUES IN (2) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION part3 VALUES IN (3) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB) */ +) ENGINE=InnoDB 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 = InnoDB, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part0 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part1 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB) */ # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -15927,76 +15354,6 @@ DROP TABLE t1; # We found: unified filelist --- not determined --- -SET @aux = 'PARTITION BY RANGE(f_int1) -(PARTITION parta VALUES LESS THAN (0) -DATA DIRECTORY = - ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'' -INDEX DIRECTORY = - ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'', -PARTITION partb VALUES LESS THAN (5) -DATA DIRECTORY = - ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'' -INDEX DIRECTORY = - ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'', -PARTITION partc VALUES LESS THAN (10) -DATA DIRECTORY = - ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'' -INDEX DIRECTORY = - ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'', -PARTITION partd VALUES LESS THAN (10 + 5) -DATA DIRECTORY = - ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'' -INDEX DIRECTORY = - ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'', -PARTITION parte VALUES LESS THAN (20) -DATA DIRECTORY = - ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'' -INDEX DIRECTORY = - ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'', -PARTITION partf VALUES LESS THAN (2147483646) -DATA DIRECTORY = - ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'' -INDEX DIRECTORY = - ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'')'; -CREATE TABLE t1 ( -f_int1 INTEGER, -f_int2 INTEGER, -f_char1 CHAR(20), -f_char2 CHAR(20), -f_charbig VARCHAR(1000) -, UNIQUE INDEX uidx1 (f_int1,f_int2), PRIMARY KEY(f_int2,f_int1) -) -PARTITION BY RANGE(f_int1) -(PARTITION parta VALUES LESS THAN (0) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', -PARTITION partb VALUES LESS THAN (5) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', -PARTITION partc VALUES LESS THAN (10) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', -PARTITION partd VALUES LESS THAN (10 + 5) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', -PARTITION parte VALUES LESS THAN (20) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', -PARTITION partf VALUES LESS THAN (2147483646) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'); INSERT INTO t1(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) @@ -16011,7 +15368,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int2`,`f_int1`), UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB) */ +) ENGINE=InnoDB 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 = InnoDB, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB) */ # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -16477,35 +15834,6 @@ DROP TABLE t1; # We found: unified filelist --- not determined --- -CREATE TABLE t1 ( -f_int1 INTEGER, -f_int2 INTEGER, -f_char1 CHAR(20), -f_char2 CHAR(20), -f_charbig VARCHAR(1000) -, UNIQUE INDEX uidx1 (f_int1,f_int2), PRIMARY KEY(f_int2,f_int1) -) -PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 2 -(PARTITION parta VALUES LESS THAN (0) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', -PARTITION partb VALUES LESS THAN (5) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', -PARTITION partc VALUES LESS THAN (10) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', -PARTITION partd VALUES LESS THAN (2147483646) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'); INSERT INTO t1(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) @@ -16520,7 +15848,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int2`,`f_int1`), UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) -) ENGINE=InnoDB 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 = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB) */ +) ENGINE=InnoDB 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 = InnoDB, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB) */ # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -16988,39 +16316,6 @@ DROP TABLE t1; # We found: unified filelist --- not determined --- -CREATE TABLE t1 ( -f_int1 INTEGER, -f_int2 INTEGER, -f_char1 CHAR(20), -f_char2 CHAR(20), -f_charbig VARCHAR(1000) -, UNIQUE INDEX uidx1 (f_int1,f_int2), PRIMARY KEY(f_int2,f_int1) -) -PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1) -(PARTITION part1 VALUES LESS THAN (0) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' -(SUBPARTITION subpart11, SUBPARTITION subpart12), -PARTITION part2 VALUES LESS THAN (5) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' -(SUBPARTITION subpart21, SUBPARTITION subpart22), -PARTITION part3 VALUES LESS THAN (10) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' -(SUBPARTITION subpart31, SUBPARTITION subpart32), -PARTITION part4 VALUES LESS THAN (2147483646) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' -(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) @@ -17035,7 +16330,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int2`,`f_int1`), UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart12 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart22 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart32 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart42 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB)) */ +) ENGINE=InnoDB 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 = InnoDB, SUBPARTITION subpart12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), 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 = InnoDB, SUBPARTITION subpart22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), 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 = InnoDB, SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), 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 = InnoDB, SUBPARTITION subpart42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB)) */ # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -17501,67 +16796,6 @@ DROP TABLE t1; # We found: unified filelist --- not determined --- -CREATE TABLE t1 ( -f_int1 INTEGER, -f_int2 INTEGER, -f_char1 CHAR(20), -f_char2 CHAR(20), -f_charbig VARCHAR(1000) -, UNIQUE INDEX uidx1 (f_int1,f_int2), PRIMARY KEY(f_int2,f_int1) -) -PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 1) -(PARTITION part1 VALUES IN (0) - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' - (SUBPARTITION sp11 - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', - SUBPARTITION sp12 - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'), - PARTITION part2 VALUES IN (1) - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' - (SUBPARTITION sp21 - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', - SUBPARTITION sp22 - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'), - PARTITION part3 VALUES IN (2) - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' - (SUBPARTITION sp31, - SUBPARTITION sp32), - PARTITION part4 VALUES IN (NULL) - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' - (SUBPARTITION sp41 - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', - SUBPARTITION sp42 - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index')); INSERT INTO t1(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) @@ -17576,7 +16810,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int2`,`f_int1`), UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) -) ENGINE=InnoDB 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 = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp12 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp22 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp32 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp42 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB)) */ +) ENGINE=InnoDB 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 = InnoDB, SUBPARTITION sp12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB)) */ # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -18044,31 +17278,6 @@ DROP TABLE t1; # We found: unified filelist --- not determined --- -CREATE TABLE t1 ( -f_int1 INTEGER, -f_int2 INTEGER, -f_char1 CHAR(20), -f_char2 CHAR(20), -f_charbig VARCHAR(1000) -, UNIQUE INDEX uidx1 (f_int1,f_int2), PRIMARY KEY(f_int2,f_int1) -) -PARTITION BY LIST(ABS(MOD(f_int1,2))) -SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 -(PARTITION part1 VALUES IN (0) - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', - PARTITION part2 VALUES IN (1) - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', - PARTITION part3 VALUES IN (NULL) - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'); INSERT INTO t1(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) @@ -18083,7 +17292,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int2`,`f_int1`), UNIQUE KEY `uidx1` (`f_int1`,`f_int2`) -) ENGINE=InnoDB 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 = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION part2 VALUES IN (1) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB) */ +) ENGINE=InnoDB 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 = InnoDB, PARTITION part2 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB) */ # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -18552,15 +17761,6 @@ DROP TABLE t1; unified filelist --- not determined --- DROP TABLE IF EXISTS t1; -CREATE TABLE t1 ( -f_int1 INTEGER, -f_int2 INTEGER, -f_char1 CHAR(20), -f_char2 CHAR(20), -f_charbig VARCHAR(1000) -, UNIQUE INDEX uidx1 (f_int2,f_int1), PRIMARY KEY(f_int1,f_int2) -) -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) @@ -19043,6 +18243,8 @@ DROP TABLE t1; # 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) create_command SHOW CREATE TABLE t1; @@ -19523,6 +18725,8 @@ DROP TABLE t1; # 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) create_command SHOW CREATE TABLE t1; @@ -19535,7 +18739,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int1`,`f_int2`), UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION part0 VALUES IN (0) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION part1 VALUES IN (1) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION part2 VALUES IN (2) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION part3 VALUES IN (3) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB) */ +) ENGINE=InnoDB 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 = InnoDB, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part0 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part1 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB) */ # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -20003,76 +19207,6 @@ DROP TABLE t1; # We found: unified filelist --- not determined --- -SET @aux = 'PARTITION BY RANGE(f_int1) -(PARTITION parta VALUES LESS THAN (0) -DATA DIRECTORY = - ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'' -INDEX DIRECTORY = - ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'', -PARTITION partb VALUES LESS THAN (5) -DATA DIRECTORY = - ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'' -INDEX DIRECTORY = - ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'', -PARTITION partc VALUES LESS THAN (10) -DATA DIRECTORY = - ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'' -INDEX DIRECTORY = - ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'', -PARTITION partd VALUES LESS THAN (10 + 5) -DATA DIRECTORY = - ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'' -INDEX DIRECTORY = - ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'', -PARTITION parte VALUES LESS THAN (20) -DATA DIRECTORY = - ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'' -INDEX DIRECTORY = - ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'', -PARTITION partf VALUES LESS THAN (2147483646) -DATA DIRECTORY = - ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'' -INDEX DIRECTORY = - ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'')'; -CREATE TABLE t1 ( -f_int1 INTEGER, -f_int2 INTEGER, -f_char1 CHAR(20), -f_char2 CHAR(20), -f_charbig VARCHAR(1000) -, UNIQUE INDEX uidx1 (f_int2,f_int1), PRIMARY KEY(f_int1,f_int2) -) -PARTITION BY RANGE(f_int1) -(PARTITION parta VALUES LESS THAN (0) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', -PARTITION partb VALUES LESS THAN (5) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', -PARTITION partc VALUES LESS THAN (10) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', -PARTITION partd VALUES LESS THAN (10 + 5) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', -PARTITION parte VALUES LESS THAN (20) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', -PARTITION partf VALUES LESS THAN (2147483646) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'); INSERT INTO t1(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) @@ -20087,7 +19221,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int1`,`f_int2`), UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB) */ +) ENGINE=InnoDB 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 = InnoDB, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB) */ # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -20553,35 +19687,6 @@ DROP TABLE t1; # We found: unified filelist --- not determined --- -CREATE TABLE t1 ( -f_int1 INTEGER, -f_int2 INTEGER, -f_char1 CHAR(20), -f_char2 CHAR(20), -f_charbig VARCHAR(1000) -, UNIQUE INDEX uidx1 (f_int2,f_int1), PRIMARY KEY(f_int1,f_int2) -) -PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 2 -(PARTITION parta VALUES LESS THAN (0) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', -PARTITION partb VALUES LESS THAN (5) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', -PARTITION partc VALUES LESS THAN (10) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', -PARTITION partd VALUES LESS THAN (2147483646) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'); INSERT INTO t1(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) @@ -20596,7 +19701,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int1`,`f_int2`), UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) -) ENGINE=InnoDB 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 = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB) */ +) ENGINE=InnoDB 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 = InnoDB, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB) */ # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -21064,39 +20169,6 @@ DROP TABLE t1; # We found: unified filelist --- not determined --- -CREATE TABLE t1 ( -f_int1 INTEGER, -f_int2 INTEGER, -f_char1 CHAR(20), -f_char2 CHAR(20), -f_charbig VARCHAR(1000) -, UNIQUE INDEX uidx1 (f_int2,f_int1), PRIMARY KEY(f_int1,f_int2) -) -PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1) -(PARTITION part1 VALUES LESS THAN (0) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' -(SUBPARTITION subpart11, SUBPARTITION subpart12), -PARTITION part2 VALUES LESS THAN (5) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' -(SUBPARTITION subpart21, SUBPARTITION subpart22), -PARTITION part3 VALUES LESS THAN (10) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' -(SUBPARTITION subpart31, SUBPARTITION subpart32), -PARTITION part4 VALUES LESS THAN (2147483646) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' -(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) @@ -21111,7 +20183,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int1`,`f_int2`), UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart12 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart22 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart32 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart42 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB)) */ +) ENGINE=InnoDB 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 = InnoDB, SUBPARTITION subpart12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), 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 = InnoDB, SUBPARTITION subpart22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), 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 = InnoDB, SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), 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 = InnoDB, SUBPARTITION subpart42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB)) */ # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -21577,67 +20649,6 @@ DROP TABLE t1; # We found: unified filelist --- not determined --- -CREATE TABLE t1 ( -f_int1 INTEGER, -f_int2 INTEGER, -f_char1 CHAR(20), -f_char2 CHAR(20), -f_charbig VARCHAR(1000) -, UNIQUE INDEX uidx1 (f_int2,f_int1), PRIMARY KEY(f_int1,f_int2) -) -PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 1) -(PARTITION part1 VALUES IN (0) - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' - (SUBPARTITION sp11 - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', - SUBPARTITION sp12 - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'), - PARTITION part2 VALUES IN (1) - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' - (SUBPARTITION sp21 - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', - SUBPARTITION sp22 - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'), - PARTITION part3 VALUES IN (2) - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' - (SUBPARTITION sp31, - SUBPARTITION sp32), - PARTITION part4 VALUES IN (NULL) - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' - (SUBPARTITION sp41 - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', - SUBPARTITION sp42 - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index')); INSERT INTO t1(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) @@ -21652,7 +20663,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int1`,`f_int2`), UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) -) ENGINE=InnoDB 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 = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp12 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp22 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp32 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp42 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB)) */ +) ENGINE=InnoDB 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 = InnoDB, SUBPARTITION sp12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB)) */ # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -22120,31 +21131,6 @@ DROP TABLE t1; # We found: unified filelist --- not determined --- -CREATE TABLE t1 ( -f_int1 INTEGER, -f_int2 INTEGER, -f_char1 CHAR(20), -f_char2 CHAR(20), -f_charbig VARCHAR(1000) -, UNIQUE INDEX uidx1 (f_int2,f_int1), PRIMARY KEY(f_int1,f_int2) -) -PARTITION BY LIST(ABS(MOD(f_int1,2))) -SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 -(PARTITION part1 VALUES IN (0) - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', - PARTITION part2 VALUES IN (1) - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', - PARTITION part3 VALUES IN (NULL) - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'); INSERT INTO t1(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) @@ -22159,7 +21145,7 @@ t1 CREATE TABLE `t1` ( `f_charbig` varchar(1000) DEFAULT NULL, PRIMARY KEY (`f_int1`,`f_int2`), UNIQUE KEY `uidx1` (`f_int2`,`f_int1`) -) ENGINE=InnoDB 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 = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION part2 VALUES IN (1) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB) */ +) ENGINE=InnoDB 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 = InnoDB, PARTITION part2 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB) */ # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -22628,15 +21614,6 @@ DROP TABLE t1; unified filelist --- not determined --- DROP TABLE IF EXISTS t1; -CREATE TABLE t1 ( -f_int1 INTEGER, -f_int2 INTEGER, -f_char1 CHAR(20), -f_char2 CHAR(20), -f_charbig VARCHAR(1000) -, UNIQUE INDEX uidx1 (f_int1,f_int2), UNIQUE INDEX uidx2 (f_int2,f_int1) -) -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) @@ -23135,6 +22112,8 @@ DROP TABLE t1; # 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) create_command SHOW CREATE TABLE t1; @@ -23631,6 +22610,8 @@ DROP TABLE t1; # 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) create_command SHOW CREATE TABLE t1; @@ -23643,7 +22624,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=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION part0 VALUES IN (0) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION part1 VALUES IN (1) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION part2 VALUES IN (2) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION part3 VALUES IN (3) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB) */ +) ENGINE=InnoDB 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 = InnoDB, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part0 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part1 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB) */ # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -24127,76 +23108,6 @@ DROP TABLE t1; # We found: unified filelist --- not determined --- -SET @aux = 'PARTITION BY RANGE(f_int1) -(PARTITION parta VALUES LESS THAN (0) -DATA DIRECTORY = - ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'' -INDEX DIRECTORY = - ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'', -PARTITION partb VALUES LESS THAN (5) -DATA DIRECTORY = - ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'' -INDEX DIRECTORY = - ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'', -PARTITION partc VALUES LESS THAN (10) -DATA DIRECTORY = - ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'' -INDEX DIRECTORY = - ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'', -PARTITION partd VALUES LESS THAN (10 + 5) -DATA DIRECTORY = - ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'' -INDEX DIRECTORY = - ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'', -PARTITION parte VALUES LESS THAN (20) -DATA DIRECTORY = - ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'' -INDEX DIRECTORY = - ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'', -PARTITION partf VALUES LESS THAN (2147483646) -DATA DIRECTORY = - ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'' -INDEX DIRECTORY = - ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'')'; -CREATE TABLE t1 ( -f_int1 INTEGER, -f_int2 INTEGER, -f_char1 CHAR(20), -f_char2 CHAR(20), -f_charbig VARCHAR(1000) -, UNIQUE INDEX uidx1 (f_int1,f_int2), UNIQUE INDEX uidx2 (f_int2,f_int1) -) -PARTITION BY RANGE(f_int1) -(PARTITION parta VALUES LESS THAN (0) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', -PARTITION partb VALUES LESS THAN (5) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', -PARTITION partc VALUES LESS THAN (10) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', -PARTITION partd VALUES LESS THAN (10 + 5) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', -PARTITION parte VALUES LESS THAN (20) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', -PARTITION partf VALUES LESS THAN (2147483646) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'); INSERT INTO t1(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) @@ -24211,7 +23122,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=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB) */ +) ENGINE=InnoDB 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 = InnoDB, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB) */ # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -24693,35 +23604,6 @@ DROP TABLE t1; # We found: unified filelist --- not determined --- -CREATE TABLE t1 ( -f_int1 INTEGER, -f_int2 INTEGER, -f_char1 CHAR(20), -f_char2 CHAR(20), -f_charbig VARCHAR(1000) -, UNIQUE INDEX uidx1 (f_int1,f_int2), UNIQUE INDEX uidx2 (f_int2,f_int1) -) -PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 2 -(PARTITION parta VALUES LESS THAN (0) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', -PARTITION partb VALUES LESS THAN (5) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', -PARTITION partc VALUES LESS THAN (10) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', -PARTITION partd VALUES LESS THAN (2147483646) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'); INSERT INTO t1(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) @@ -24736,7 +23618,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=InnoDB 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 = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB) */ +) ENGINE=InnoDB 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 = InnoDB, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB) */ # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -25220,39 +24102,6 @@ DROP TABLE t1; # We found: unified filelist --- not determined --- -CREATE TABLE t1 ( -f_int1 INTEGER, -f_int2 INTEGER, -f_char1 CHAR(20), -f_char2 CHAR(20), -f_charbig VARCHAR(1000) -, UNIQUE INDEX uidx1 (f_int1,f_int2), UNIQUE INDEX uidx2 (f_int2,f_int1) -) -PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1) -(PARTITION part1 VALUES LESS THAN (0) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' -(SUBPARTITION subpart11, SUBPARTITION subpart12), -PARTITION part2 VALUES LESS THAN (5) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' -(SUBPARTITION subpart21, SUBPARTITION subpart22), -PARTITION part3 VALUES LESS THAN (10) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' -(SUBPARTITION subpart31, SUBPARTITION subpart32), -PARTITION part4 VALUES LESS THAN (2147483646) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' -(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) @@ -25267,7 +24116,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=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart12 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart22 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart32 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, SUBPARTITION subpart42 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB)) */ +) ENGINE=InnoDB 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 = InnoDB, SUBPARTITION subpart12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), 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 = InnoDB, SUBPARTITION subpart22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), 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 = InnoDB, SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), 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 = InnoDB, SUBPARTITION subpart42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB)) */ # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -25749,67 +24598,6 @@ DROP TABLE t1; # We found: unified filelist --- not determined --- -CREATE TABLE t1 ( -f_int1 INTEGER, -f_int2 INTEGER, -f_char1 CHAR(20), -f_char2 CHAR(20), -f_charbig VARCHAR(1000) -, UNIQUE INDEX uidx1 (f_int1,f_int2), UNIQUE INDEX uidx2 (f_int2,f_int1) -) -PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 1) -(PARTITION part1 VALUES IN (0) - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' - (SUBPARTITION sp11 - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', - SUBPARTITION sp12 - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'), - PARTITION part2 VALUES IN (1) - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' - (SUBPARTITION sp21 - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', - SUBPARTITION sp22 - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'), - PARTITION part3 VALUES IN (2) - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' - (SUBPARTITION sp31, - SUBPARTITION sp32), - PARTITION part4 VALUES IN (NULL) - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' - (SUBPARTITION sp41 - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', - SUBPARTITION sp42 - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index')); INSERT INTO t1(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) @@ -25824,7 +24612,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=InnoDB 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 = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp12 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp22 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp32 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp42 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB)) */ +) ENGINE=InnoDB 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 = InnoDB, SUBPARTITION sp12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB)) */ # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -26308,31 +25096,6 @@ DROP TABLE t1; # We found: unified filelist --- not determined --- -CREATE TABLE t1 ( -f_int1 INTEGER, -f_int2 INTEGER, -f_char1 CHAR(20), -f_char2 CHAR(20), -f_charbig VARCHAR(1000) -, UNIQUE INDEX uidx1 (f_int1,f_int2), UNIQUE INDEX uidx2 (f_int2,f_int1) -) -PARTITION BY LIST(ABS(MOD(f_int1,2))) -SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 -(PARTITION part1 VALUES IN (0) - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', - PARTITION part2 VALUES IN (1) - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', - PARTITION part3 VALUES IN (NULL) - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'); INSERT INTO t1(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) @@ -26347,7 +25110,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=InnoDB 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 = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION part2 VALUES IN (1) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = InnoDB) */ +) ENGINE=InnoDB 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 = InnoDB, PARTITION part2 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/master-data/test/index' ENGINE = InnoDB) */ # check prerequisites-1 success: 1 # check COUNT(*) success: 1 diff --git a/mysql-test/suite/parts/r/partition_basic_myisam.result b/mysql-test/suite/parts/r/partition_basic_myisam.result index 3a4a1c0d571..471eb4973f6 100644 --- a/mysql-test/suite/parts/r/partition_basic_myisam.result +++ b/mysql-test/suite/parts/r/partition_basic_myisam.result @@ -59,15 +59,6 @@ SET @@session.sql_mode= ''; #------------------------------------------------------------------------ # 1.1 The partitioning function contains one column. DROP TABLE IF EXISTS t1; -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; INSERT INTO t1(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) @@ -517,6 +508,8 @@ TRUNCATE t1; # check layout success: 1 # End usability test (include/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) create_command SHOW CREATE TABLE t1; @@ -970,6 +963,8 @@ TRUNCATE t1; # check layout success: 1 # End usability test (include/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) create_command SHOW CREATE TABLE t1; @@ -1429,52 +1424,6 @@ TRUNCATE t1; # check layout success: 1 # End usability test (include/partition_check.inc) DROP TABLE t1; -SET @aux = 'PARTITION BY RANGE(f_int1) -(PARTITION parta VALUES LESS THAN (0) - -, -PARTITION partb VALUES LESS THAN (5) - -, -PARTITION partc VALUES LESS THAN (10) - -, -PARTITION partd VALUES LESS THAN (10 + 5) - -, -PARTITION parte VALUES LESS THAN (20) - -, -PARTITION partf VALUES LESS THAN (2147483646) - -)'; -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) -(PARTITION parta VALUES LESS THAN (0) - -, -PARTITION partb VALUES LESS THAN (5) - -, -PARTITION partc VALUES LESS THAN (10) - -, -PARTITION partd VALUES LESS THAN (10 + 5) - -, -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) @@ -1930,27 +1879,6 @@ TRUNCATE t1; # check layout success: 1 # End usability test (include/partition_check.inc) DROP TABLE t1; -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 DIV 2) SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 2 -(PARTITION parta VALUES LESS THAN (0) - -, -PARTITION partb VALUES LESS THAN (5) - -, -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) @@ -2412,31 +2340,6 @@ TRUNCATE t1; # check layout success: 1 # End usability test (include/partition_check.inc) DROP TABLE t1; -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 KEY(f_int1) -(PARTITION part1 VALUES LESS THAN (0) - - -(SUBPARTITION subpart11, SUBPARTITION subpart12), -PARTITION part2 VALUES LESS THAN (5) - - -(SUBPARTITION subpart21, SUBPARTITION subpart22), -PARTITION part3 VALUES LESS THAN (10) - - -(SUBPARTITION subpart31, SUBPARTITION subpart32), -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) @@ -2896,47 +2799,6 @@ TRUNCATE t1; # check layout success: 1 # End usability test (include/partition_check.inc) DROP TABLE t1; -CREATE TABLE t1 ( -f_int1 INTEGER, -f_int2 INTEGER, -f_char1 CHAR(20), -f_char2 CHAR(20), -f_charbig VARCHAR(1000) - -) -PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 1) -(PARTITION part1 VALUES IN (0) - - - (SUBPARTITION sp11 - - , - SUBPARTITION sp12 - - ), - PARTITION part2 VALUES IN (1) - - - (SUBPARTITION sp21 - - , - SUBPARTITION sp22 - - ), - PARTITION part3 VALUES IN (2) - - - (SUBPARTITION sp31, - SUBPARTITION sp32), - 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) @@ -3398,25 +3260,6 @@ TRUNCATE t1; # check layout success: 1 # End usability test (include/partition_check.inc) DROP TABLE t1; -CREATE TABLE t1 ( -f_int1 INTEGER, -f_int2 INTEGER, -f_char1 CHAR(20), -f_char2 CHAR(20), -f_charbig VARCHAR(1000) - -) -PARTITION BY LIST(ABS(MOD(f_int1,2))) -SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 -(PARTITION part1 VALUES IN (0) - - , - PARTITION part2 VALUES IN (1) - - , - 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) @@ -3881,25 +3724,6 @@ TRUNCATE t1; # End usability test (include/partition_check.inc) DROP TABLE t1; # 1.1.1 with DATA DIECTORY/INDEX DIRECTORY -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 -(PARTITION p1 -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', -PARTITION p2 -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'); INSERT INTO t1(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) @@ -3912,7 +3736,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='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY HASH (f_int1) (PARTITION p1 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */ +) 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) */ unified filelist $MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD @@ -4343,68 +4167,34 @@ 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='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY HASH (f_int1) (PARTITION p1 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */ -File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par +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) */ +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='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY HASH (f_int1) (PARTITION p1 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */ -File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#p1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#p2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#p1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#p2.MYI +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) */ +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='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY HASH (f_int1) (PARTITION p1 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */ -File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par +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) */ +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='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY HASH (f_int1) (PARTITION p1 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */ -File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#p1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#p2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#p1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#p2.MYI +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) */ +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='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY HASH (f_int1) (PARTITION p1 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */ -File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par +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) */ +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='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY HASH (f_int1) (PARTITION p1 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */ -File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#p1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#p2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#p1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#p2.MYI +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) */ +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) DROP TABLE t1; -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 5 -(PARTITION p1 -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', -PARTITION p2 -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', -PARTITION p3 -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', -PARTITION p4 -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', -PARTITION p5 -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'); INSERT INTO t1(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) @@ -4417,7 +4207,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='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY HASH (f_int1) (PARTITION p1 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION p3 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION p4 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION p5 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */ +) 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) */ unified filelist $MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD @@ -4860,34 +4650,36 @@ 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='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY HASH (f_int1) (PARTITION p1 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION p3 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION p4 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION p5 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */ -File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p3.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p3.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p4.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p4.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p5.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p5.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par +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) */ +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='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY HASH (f_int1) (PARTITION p1 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION p3 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION p4 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION p5 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */ -File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p3.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p3.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p4.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p4.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p5.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p5.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#p1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#p2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#p3.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#p4.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#p5.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#p1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#p2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#p3.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#p4.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#p5.MYI +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) */ +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='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY HASH (f_int1) (PARTITION p1 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION p3 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION p4 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION p5 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */ -File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p3.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p3.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p4.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p4.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p5.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p5.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par +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) */ +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='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY HASH (f_int1) (PARTITION p1 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION p3 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION p4 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION p5 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */ -File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p3.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p3.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p4.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p4.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p5.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p5.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#p1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#p2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#p3.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#p4.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#p5.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#p1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#p2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#p3.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#p4.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#p5.MYI +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) */ +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='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY HASH (f_int1) (PARTITION p1 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION p3 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION p4 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION p5 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */ -File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p3.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p3.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p4.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p4.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p5.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p5.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par +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) */ +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='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY HASH (f_int1) (PARTITION p1 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION p3 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION p4 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION p5 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */ -File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p3.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p3.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p4.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p4.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p5.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#p5.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#p1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#p2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#p3.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#p4.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#p5.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#p1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#p2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#p3.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#p4.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#p5.MYI +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) */ +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) 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) create_command SHOW CREATE TABLE t1; @@ -4898,7 +4690,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='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part0 VALUES IN (0) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part1 VALUES IN (1) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (2) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (3) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */ +) 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) */ unified filelist $MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD @@ -5353,104 +5145,34 @@ 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='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part0 VALUES IN (0) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part1 VALUES IN (1) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (2) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (3) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */ -File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_3.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_3.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_N.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_N.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par +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) */ +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='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part0 VALUES IN (0) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part1 VALUES IN (1) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (2) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (3) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */ -File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_3.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_3.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_N.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_N.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part3.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part_1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part_2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part_3.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part_N.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part3.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part_1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part_2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part_3.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part_N.MYI +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) */ +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='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part0 VALUES IN (0) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part1 VALUES IN (1) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (2) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (3) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */ -File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_3.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_3.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_N.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_N.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par +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) */ +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='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part0 VALUES IN (0) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part1 VALUES IN (1) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (2) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (3) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */ -File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_3.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_3.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_N.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_N.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part3.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part_1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part_2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part_3.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part_N.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part3.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part_1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part_2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part_3.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part_N.MYI +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) */ +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='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part0 VALUES IN (0) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part1 VALUES IN (1) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (2) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (3) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */ -File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_3.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_3.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_N.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_N.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par +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) */ +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='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part0 VALUES IN (0) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part1 VALUES IN (1) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (2) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (3) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */ -File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_3.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_3.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_N.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part_N.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part3.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part_1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part_2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part_3.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part_N.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part3.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part_1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part_2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part_3.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part_N.MYI +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) */ +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) DROP TABLE t1; -SET @aux = 'PARTITION BY RANGE(f_int1) -(PARTITION parta VALUES LESS THAN (0) -DATA DIRECTORY = - ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'' -INDEX DIRECTORY = - ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'', -PARTITION partb VALUES LESS THAN (5) -DATA DIRECTORY = - ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'' -INDEX DIRECTORY = - ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'', -PARTITION partc VALUES LESS THAN (10) -DATA DIRECTORY = - ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'' -INDEX DIRECTORY = - ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'', -PARTITION partd VALUES LESS THAN (10 + 5) -DATA DIRECTORY = - ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'' -INDEX DIRECTORY = - ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'', -PARTITION parte VALUES LESS THAN (20) -DATA DIRECTORY = - ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'' -INDEX DIRECTORY = - ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'', -PARTITION partf VALUES LESS THAN (2147483646) -DATA DIRECTORY = - ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'' -INDEX DIRECTORY = - ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'')'; -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) -(PARTITION parta VALUES LESS THAN (0) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', -PARTITION partb VALUES LESS THAN (5) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', -PARTITION partc VALUES LESS THAN (10) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', -PARTITION partd VALUES LESS THAN (10 + 5) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', -PARTITION parte VALUES LESS THAN (20) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', -PARTITION partf VALUES LESS THAN (2147483646) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'); INSERT INTO t1(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) @@ -5463,7 +5185,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='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */ +) 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) */ unified filelist $MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD @@ -5908,63 +5630,34 @@ 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='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */ -File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parta.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parta.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partb.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partb.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partc.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partc.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partd.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partd.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parte.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parte.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partf.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partf.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par +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) */ +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='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */ -File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parta.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parta.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partb.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partb.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partc.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partc.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partd.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partd.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parte.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parte.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partf.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partf.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#parta.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#partb.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#partc.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#partd.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#parte.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#partf.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#parta.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#partb.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#partc.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#partd.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#parte.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#partf.MYI +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) */ +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='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */ -File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parta.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parta.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partb.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partb.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partc.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partc.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partd.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partd.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parte.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parte.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partf.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partf.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par +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) */ +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='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */ -File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parta.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parta.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partb.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partb.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partc.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partc.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partd.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partd.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parte.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parte.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partf.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partf.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#parta.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#partb.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#partc.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#partd.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#parte.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#partf.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#parta.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#partb.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#partc.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#partd.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#parte.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#partf.MYI +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) */ +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='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */ -File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parta.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parta.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partb.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partb.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partc.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partc.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partd.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partd.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parte.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parte.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partf.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partf.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par +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) */ +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='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */ -File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parta.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parta.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partb.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partb.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partc.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partc.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partd.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partd.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parte.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parte.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partf.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partf.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#parta.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#partb.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#partc.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#partd.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#parte.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#partf.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#parta.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#partb.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#partc.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#partd.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#parte.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#partf.MYI +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) */ +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) DROP TABLE t1; -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 DIV 2) SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 2 -(PARTITION parta VALUES LESS THAN (0) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', -PARTITION partb VALUES LESS THAN (5) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', -PARTITION partc VALUES LESS THAN (10) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', -PARTITION partd VALUES LESS THAN (2147483646) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'); INSERT INTO t1(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) @@ -5977,7 +5670,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='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/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 = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */ +) 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) */ unified filelist $MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYD @@ -6432,67 +6125,34 @@ 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='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/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 = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */ -File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parta#SP#partasp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parta#SP#partasp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parta#SP#partasp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parta#SP#partasp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partb#SP#partbsp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partb#SP#partbsp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partb#SP#partbsp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partb#SP#partbsp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partc#SP#partcsp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partc#SP#partcsp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partc#SP#partcsp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partc#SP#partcsp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partd#SP#partdsp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partd#SP#partdsp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partd#SP#partdsp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partd#SP#partdsp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par +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) */ +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='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/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 = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */ -File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parta#SP#partasp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parta#SP#partasp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parta#SP#partasp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parta#SP#partasp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partb#SP#partbsp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partb#SP#partbsp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partb#SP#partbsp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partb#SP#partbsp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partc#SP#partcsp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partc#SP#partcsp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partc#SP#partcsp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partc#SP#partcsp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partd#SP#partdsp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partd#SP#partdsp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partd#SP#partdsp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partd#SP#partdsp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#parta#SP#partasp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#parta#SP#partasp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#partb#SP#partbsp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#partb#SP#partbsp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#partc#SP#partcsp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#partc#SP#partcsp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#partd#SP#partdsp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#partd#SP#partdsp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#parta#SP#partasp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#parta#SP#partasp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#partb#SP#partbsp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#partb#SP#partbsp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#partc#SP#partcsp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#partc#SP#partcsp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#partd#SP#partdsp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#partd#SP#partdsp1.MYI +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) */ +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='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/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 = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */ -File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parta#SP#partasp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parta#SP#partasp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parta#SP#partasp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parta#SP#partasp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partb#SP#partbsp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partb#SP#partbsp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partb#SP#partbsp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partb#SP#partbsp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partc#SP#partcsp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partc#SP#partcsp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partc#SP#partcsp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partc#SP#partcsp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partd#SP#partdsp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partd#SP#partdsp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partd#SP#partdsp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partd#SP#partdsp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par +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) */ +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='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/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 = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */ -File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parta#SP#partasp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parta#SP#partasp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parta#SP#partasp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parta#SP#partasp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partb#SP#partbsp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partb#SP#partbsp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partb#SP#partbsp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partb#SP#partbsp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partc#SP#partcsp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partc#SP#partcsp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partc#SP#partcsp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partc#SP#partcsp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partd#SP#partdsp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partd#SP#partdsp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partd#SP#partdsp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partd#SP#partdsp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#parta#SP#partasp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#parta#SP#partasp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#partb#SP#partbsp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#partb#SP#partbsp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#partc#SP#partcsp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#partc#SP#partcsp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#partd#SP#partdsp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#partd#SP#partdsp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#parta#SP#partasp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#parta#SP#partasp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#partb#SP#partbsp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#partb#SP#partbsp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#partc#SP#partcsp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#partc#SP#partcsp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#partd#SP#partdsp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#partd#SP#partdsp1.MYI +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) */ +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='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/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 = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */ -File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parta#SP#partasp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parta#SP#partasp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parta#SP#partasp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parta#SP#partasp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partb#SP#partbsp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partb#SP#partbsp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partb#SP#partbsp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partb#SP#partbsp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partc#SP#partcsp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partc#SP#partcsp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partc#SP#partcsp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partc#SP#partcsp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partd#SP#partdsp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partd#SP#partdsp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partd#SP#partdsp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partd#SP#partdsp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par +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) */ +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='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/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 = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */ -File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parta#SP#partasp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parta#SP#partasp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parta#SP#partasp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#parta#SP#partasp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partb#SP#partbsp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partb#SP#partbsp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partb#SP#partbsp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partb#SP#partbsp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partc#SP#partcsp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partc#SP#partcsp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partc#SP#partcsp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partc#SP#partcsp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partd#SP#partdsp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partd#SP#partdsp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partd#SP#partdsp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#partd#SP#partdsp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#parta#SP#partasp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#parta#SP#partasp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#partb#SP#partbsp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#partb#SP#partbsp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#partc#SP#partcsp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#partc#SP#partcsp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#partd#SP#partdsp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#partd#SP#partdsp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#parta#SP#partasp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#parta#SP#partasp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#partb#SP#partbsp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#partb#SP#partbsp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#partc#SP#partcsp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#partc#SP#partcsp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#partd#SP#partdsp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#partd#SP#partdsp1.MYI +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) */ +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) DROP TABLE t1; -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 KEY(f_int1) -(PARTITION part1 VALUES LESS THAN (0) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' -(SUBPARTITION subpart11, SUBPARTITION subpart12), -PARTITION part2 VALUES LESS THAN (5) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' -(SUBPARTITION subpart21, SUBPARTITION subpart22), -PARTITION part3 VALUES LESS THAN (10) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' -(SUBPARTITION subpart31, SUBPARTITION subpart32), -PARTITION part4 VALUES LESS THAN (2147483646) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' -(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) @@ -6505,7 +6165,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='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/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 = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart12 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart22 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart32 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart42 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM)) */ +) 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)) */ unified filelist $MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYD @@ -6958,95 +6618,34 @@ 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='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/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 = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart12 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart22 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart32 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart42 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM)) */ -File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#subpart11.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#subpart11.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#subpart12.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#subpart12.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#subpart21.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#subpart21.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#subpart22.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#subpart22.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#subpart31.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#subpart31.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#subpart32.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#subpart32.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#subpart41.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#subpart41.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#subpart42.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#subpart42.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par +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)) */ +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='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/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 = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart12 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart22 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart32 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart42 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM)) */ -File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#subpart11.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#subpart11.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#subpart12.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#subpart12.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#subpart21.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#subpart21.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#subpart22.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#subpart22.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#subpart31.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#subpart31.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#subpart32.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#subpart32.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#subpart41.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#subpart41.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#subpart42.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#subpart42.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part1#SP#subpart11.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part1#SP#subpart12.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part2#SP#subpart21.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part2#SP#subpart22.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part3#SP#subpart31.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part3#SP#subpart32.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part4#SP#subpart41.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part4#SP#subpart42.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part1#SP#subpart11.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part1#SP#subpart12.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part2#SP#subpart21.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part2#SP#subpart22.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part3#SP#subpart31.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part3#SP#subpart32.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part4#SP#subpart41.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part4#SP#subpart42.MYI +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)) */ +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='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/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 = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart12 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart22 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart32 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart42 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM)) */ -File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#subpart11.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#subpart11.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#subpart12.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#subpart12.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#subpart21.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#subpart21.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#subpart22.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#subpart22.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#subpart31.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#subpart31.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#subpart32.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#subpart32.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#subpart41.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#subpart41.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#subpart42.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#subpart42.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par +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)) */ +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='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/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 = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart12 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart22 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart32 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart42 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM)) */ -File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#subpart11.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#subpart11.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#subpart12.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#subpart12.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#subpart21.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#subpart21.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#subpart22.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#subpart22.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#subpart31.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#subpart31.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#subpart32.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#subpart32.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#subpart41.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#subpart41.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#subpart42.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#subpart42.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part1#SP#subpart11.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part1#SP#subpart12.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part2#SP#subpart21.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part2#SP#subpart22.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part3#SP#subpart31.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part3#SP#subpart32.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part4#SP#subpart41.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part4#SP#subpart42.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part1#SP#subpart11.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part1#SP#subpart12.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part2#SP#subpart21.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part2#SP#subpart22.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part3#SP#subpart31.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part3#SP#subpart32.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part4#SP#subpart41.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part4#SP#subpart42.MYI +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)) */ +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='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/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 = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart12 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart22 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart32 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart42 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM)) */ -File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#subpart11.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#subpart11.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#subpart12.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#subpart12.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#subpart21.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#subpart21.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#subpart22.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#subpart22.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#subpart31.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#subpart31.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#subpart32.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#subpart32.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#subpart41.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#subpart41.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#subpart42.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#subpart42.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par +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)) */ +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='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/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 = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart12 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart22 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart32 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart42 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM)) */ -File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#subpart11.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#subpart11.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#subpart12.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#subpart12.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#subpart21.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#subpart21.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#subpart22.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#subpart22.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#subpart31.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#subpart31.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#subpart32.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#subpart32.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#subpart41.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#subpart41.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#subpart42.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#subpart42.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part1#SP#subpart11.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part1#SP#subpart12.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part2#SP#subpart21.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part2#SP#subpart22.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part3#SP#subpart31.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part3#SP#subpart32.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part4#SP#subpart41.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part4#SP#subpart42.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part1#SP#subpart11.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part1#SP#subpart12.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part2#SP#subpart21.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part2#SP#subpart22.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part3#SP#subpart31.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part3#SP#subpart32.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part4#SP#subpart41.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part4#SP#subpart42.MYI +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)) */ +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) DROP TABLE t1; -CREATE TABLE t1 ( -f_int1 INTEGER, -f_int2 INTEGER, -f_char1 CHAR(20), -f_char2 CHAR(20), -f_charbig VARCHAR(1000) - -) -PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 1) -(PARTITION part1 VALUES IN (0) - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' - (SUBPARTITION sp11 - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', - SUBPARTITION sp12 - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'), - PARTITION part2 VALUES IN (1) - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' - (SUBPARTITION sp21 - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', - SUBPARTITION sp22 - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'), - PARTITION part3 VALUES IN (2) - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' - (SUBPARTITION sp31, - SUBPARTITION sp32), - PARTITION part4 VALUES IN (NULL) - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' - (SUBPARTITION sp41 - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', - SUBPARTITION sp42 - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index')); INSERT INTO t1(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) @@ -7059,7 +6658,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='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/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 = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp12 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp22 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp32 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp42 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM)) */ +) 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)) */ unified filelist $MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYD @@ -7514,59 +7113,34 @@ 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='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/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 = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp12 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp22 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp32 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp42 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM)) */ -File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#sp11.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#sp11.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#sp12.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#sp12.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#sp21.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#sp21.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#sp22.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#sp22.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#sp31.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#sp31.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#sp32.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#sp32.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#sp41.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#sp41.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#sp42.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#sp42.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par +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)) */ +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='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/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 = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp12 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp22 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp32 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp42 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM)) */ -File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#sp11.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#sp11.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#sp12.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#sp12.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#sp21.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#sp21.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#sp22.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#sp22.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#sp31.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#sp31.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#sp32.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#sp32.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#sp41.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#sp41.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#sp42.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#sp42.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part1#SP#sp11.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part1#SP#sp12.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part2#SP#sp21.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part2#SP#sp22.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part3#SP#sp31.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part3#SP#sp32.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part4#SP#sp41.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part4#SP#sp42.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part1#SP#sp11.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part1#SP#sp12.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part2#SP#sp21.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part2#SP#sp22.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part3#SP#sp31.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part3#SP#sp32.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part4#SP#sp41.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part4#SP#sp42.MYI +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)) */ +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='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/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 = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp12 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp22 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp32 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp42 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM)) */ -File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#sp11.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#sp11.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#sp12.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#sp12.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#sp21.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#sp21.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#sp22.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#sp22.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#sp31.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#sp31.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#sp32.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#sp32.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#sp41.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#sp41.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#sp42.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#sp42.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par +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)) */ +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='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/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 = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp12 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp22 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp32 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp42 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM)) */ -File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#sp11.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#sp11.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#sp12.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#sp12.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#sp21.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#sp21.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#sp22.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#sp22.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#sp31.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#sp31.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#sp32.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#sp32.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#sp41.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#sp41.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#sp42.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#sp42.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part1#SP#sp11.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part1#SP#sp12.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part2#SP#sp21.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part2#SP#sp22.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part3#SP#sp31.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part3#SP#sp32.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part4#SP#sp41.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part4#SP#sp42.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part1#SP#sp11.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part1#SP#sp12.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part2#SP#sp21.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part2#SP#sp22.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part3#SP#sp31.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part3#SP#sp32.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part4#SP#sp41.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part4#SP#sp42.MYI +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)) */ +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='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/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 = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp12 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp22 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp32 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp42 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM)) */ -File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#sp11.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#sp11.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#sp12.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#sp12.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#sp21.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#sp21.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#sp22.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#sp22.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#sp31.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#sp31.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#sp32.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#sp32.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#sp41.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#sp41.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#sp42.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#sp42.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par +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)) */ +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='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/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 = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp12 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp22 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp32 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp42 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM)) */ -File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#sp11.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#sp11.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#sp12.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#sp12.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#sp21.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#sp21.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#sp22.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#sp22.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#sp31.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#sp31.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#sp32.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#sp32.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#sp41.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#sp41.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#sp42.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part4#SP#sp42.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part1#SP#sp11.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part1#SP#sp12.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part2#SP#sp21.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part2#SP#sp22.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part3#SP#sp31.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part3#SP#sp32.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part4#SP#sp41.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part4#SP#sp42.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part1#SP#sp11.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part1#SP#sp12.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part2#SP#sp21.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part2#SP#sp22.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part3#SP#sp31.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part3#SP#sp32.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part4#SP#sp41.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part4#SP#sp42.MYI +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)) */ +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) DROP TABLE t1; -CREATE TABLE t1 ( -f_int1 INTEGER, -f_int2 INTEGER, -f_char1 CHAR(20), -f_char2 CHAR(20), -f_charbig VARCHAR(1000) - -) -PARTITION BY LIST(ABS(MOD(f_int1,2))) -SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 -(PARTITION part1 VALUES IN (0) - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', - PARTITION part2 VALUES IN (1) - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', - PARTITION part3 VALUES IN (NULL) - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'); INSERT INTO t1(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) @@ -7579,7 +7153,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='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/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 = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (1) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */ +) 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) */ unified filelist $MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYD @@ -8038,44 +7612,35 @@ 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='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/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 = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (1) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */ -File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#part1sp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#part1sp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#part1sp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#part1sp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#part1sp2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#part1sp2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#part2sp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#part2sp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#part2sp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#part2sp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#part2sp2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#part2sp2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#part3sp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#part3sp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#part3sp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#part3sp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#part3sp2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#part3sp2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par +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) */ +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='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/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 = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (1) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */ -File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#part1sp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#part1sp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#part1sp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#part1sp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#part1sp2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#part1sp2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#part2sp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#part2sp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#part2sp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#part2sp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#part2sp2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#part2sp2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#part3sp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#part3sp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#part3sp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#part3sp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#part3sp2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#part3sp2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part1#SP#part1sp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part1#SP#part1sp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part1#SP#part1sp2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part2#SP#part2sp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part2#SP#part2sp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part2#SP#part2sp2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part3#SP#part3sp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part3#SP#part3sp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part3#SP#part3sp2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part1#SP#part1sp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part1#SP#part1sp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part1#SP#part1sp2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part2#SP#part2sp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part2#SP#part2sp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part2#SP#part2sp2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part3#SP#part3sp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part3#SP#part3sp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part3#SP#part3sp2.MYI +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) */ +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='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/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 = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (1) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */ -File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#part1sp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#part1sp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#part1sp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#part1sp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#part1sp2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#part1sp2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#part2sp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#part2sp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#part2sp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#part2sp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#part2sp2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#part2sp2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#part3sp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#part3sp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#part3sp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#part3sp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#part3sp2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#part3sp2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par +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) */ +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='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/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 = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (1) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */ -File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#part1sp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#part1sp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#part1sp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#part1sp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#part1sp2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#part1sp2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#part2sp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#part2sp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#part2sp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#part2sp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#part2sp2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#part2sp2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#part3sp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#part3sp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#part3sp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#part3sp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#part3sp2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#part3sp2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part1#SP#part1sp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part1#SP#part1sp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part1#SP#part1sp2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part2#SP#part2sp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part2#SP#part2sp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part2#SP#part2sp2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part3#SP#part3sp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part3#SP#part3sp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part3#SP#part3sp2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part1#SP#part1sp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part1#SP#part1sp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part1#SP#part1sp2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part2#SP#part2sp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part2#SP#part2sp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part2#SP#part2sp2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part3#SP#part3sp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part3#SP#part3sp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part3#SP#part3sp2.MYI +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) */ +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='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/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 = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (1) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */ -File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#part1sp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#part1sp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#part1sp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#part1sp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#part1sp2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#part1sp2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#part2sp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#part2sp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#part2sp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#part2sp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#part2sp2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#part2sp2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#part3sp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#part3sp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#part3sp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#part3sp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#part3sp2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#part3sp2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par +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) */ +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='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/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 = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (1) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */ -File list /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#part1sp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#part1sp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#part1sp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#part1sp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#part1sp2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part1#SP#part1sp2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#part2sp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#part2sp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#part2sp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#part2sp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#part2sp2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part2#SP#part2sp2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#part3sp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#part3sp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#part3sp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#part3sp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#part3sp2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1#P#part3#SP#part3sp2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.frm /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/t1.par /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part1#SP#part1sp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part1#SP#part1sp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part1#SP#part1sp2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part2#SP#part2sp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part2#SP#part2sp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part2#SP#part2sp2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part3#SP#part3sp0.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part3#SP#part3sp1.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/t1#P#part3#SP#part3sp2.MYD /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part1#SP#part1sp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part1#SP#part1sp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part1#SP#part1sp2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part2#SP#part2sp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part2#SP#part2sp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part2#SP#part2sp2.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part3#SP#part3sp0.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part3#SP#part3sp1.MYI /data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/t1#P#part3#SP#part3sp2.MYI +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) */ +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) DROP TABLE t1; DROP TABLE IF EXISTS t1; -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; INSERT INTO t1(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) @@ -8525,6 +8090,8 @@ TRUNCATE t1; # check layout success: 1 # End usability test (include/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) create_command SHOW CREATE TABLE t1; @@ -8978,6 +8545,8 @@ TRUNCATE t1; # check layout success: 1 # End usability test (include/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) create_command SHOW CREATE TABLE t1; @@ -8988,7 +8557,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='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' ENGINE = MyISAM, PARTITION part0 VALUES IN (0) INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' ENGINE = MyISAM, PARTITION part3 VALUES IN (3) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */ +) 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) */ unified filelist $MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD @@ -9437,52 +9006,6 @@ TRUNCATE t1; # check layout success: 1 # End usability test (include/partition_check.inc) DROP TABLE t1; -SET @aux = 'PARTITION BY RANGE(f_int1) -(PARTITION parta VALUES LESS THAN (0) -INDEX DIRECTORY = - ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'', -PARTITION partb VALUES LESS THAN (5) -DATA DIRECTORY = - ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'', -PARTITION partc VALUES LESS THAN (10) -DATA DIRECTORY = - ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'' -INDEX DIRECTORY = - ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'', -PARTITION partd VALUES LESS THAN (10 + 5), -PARTITION parte VALUES LESS THAN (20) -DATA DIRECTORY = - ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'', -PARTITION partf VALUES LESS THAN (2147483646) -INDEX DIRECTORY = - ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'')'; -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) -(PARTITION parta VALUES LESS THAN (0) -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', -PARTITION partb VALUES LESS THAN (5) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data', -PARTITION partc VALUES LESS THAN (10) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', -PARTITION partd VALUES LESS THAN (10 + 5), -PARTITION parte VALUES LESS THAN (20) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data', -PARTITION partf VALUES LESS THAN (2147483646) -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'); INSERT INTO t1(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) @@ -9495,7 +9018,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='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */ +) 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) */ unified filelist $MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD @@ -9938,27 +9461,6 @@ TRUNCATE t1; # check layout success: 1 # End usability test (include/partition_check.inc) DROP TABLE t1; -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 DIV 2) SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 2 -(PARTITION parta VALUES LESS THAN (0) -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', -PARTITION partb VALUES LESS THAN (5) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data', -PARTITION partc VALUES LESS THAN (10), -PARTITION partd VALUES LESS THAN (2147483646) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'); INSERT INTO t1(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) @@ -9971,7 +9473,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='/data0/mysql/mysql-5.1-build/mysql-test/var/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 = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */ +) 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) */ unified filelist $MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYD @@ -10420,31 +9922,6 @@ TRUNCATE t1; # check layout success: 1 # End usability test (include/partition_check.inc) DROP TABLE t1; -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 KEY(f_int1) -(PARTITION part1 VALUES LESS THAN (0) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -(SUBPARTITION subpart11, SUBPARTITION subpart12), -PARTITION part2 VALUES LESS THAN (5) -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' -(SUBPARTITION subpart21, SUBPARTITION subpart22), -PARTITION part3 VALUES LESS THAN (10) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' -(SUBPARTITION subpart31, SUBPARTITION subpart32), -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) @@ -10457,7 +9934,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='/data0/mysql/mysql-5.1-build/mysql-test/var/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 = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' ENGINE = MyISAM, SUBPARTITION subpart12 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart22 INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart32 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/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 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)) */ unified filelist $MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYD @@ -10904,51 +10381,6 @@ TRUNCATE t1; # check layout success: 1 # End usability test (include/partition_check.inc) DROP TABLE t1; -CREATE TABLE t1 ( -f_int1 INTEGER, -f_int2 INTEGER, -f_char1 CHAR(20), -f_char2 CHAR(20), -f_charbig VARCHAR(1000) - -) -PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 1) -(PARTITION part1 VALUES IN (0) - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' - (SUBPARTITION sp11 - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data', - SUBPARTITION sp12 - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'), - PARTITION part2 VALUES IN (1) - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' - (SUBPARTITION sp21 - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data', - SUBPARTITION sp22 - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'), - PARTITION part3 VALUES IN (2) - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' - (SUBPARTITION sp31, - SUBPARTITION sp32), - PARTITION part4 VALUES IN (NULL) - (SUBPARTITION sp41 - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', - SUBPARTITION sp42 - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index')); INSERT INTO t1(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) @@ -10961,7 +10393,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='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/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 = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp12 INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' ENGINE = MyISAM, SUBPARTITION sp22 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp32 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp42 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM)) */ +) 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)) */ unified filelist $MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYD @@ -15190,15 +14622,6 @@ DROP TABLE t1; #------------------------------------------------------------------------ # 2.5 PRIMARY KEY + UNIQUE INDEX consisting of two columns DROP TABLE IF EXISTS t1; -CREATE TABLE t1 ( -f_int1 INTEGER, -f_int2 INTEGER, -f_char1 CHAR(20), -f_char2 CHAR(20), -f_charbig VARCHAR(1000) -, UNIQUE INDEX uidx1 (f_int1,f_int2), UNIQUE INDEX uidx2 (f_int2,f_int1) -) -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) @@ -15701,6 +15124,8 @@ TRUNCATE t1; # check layout success: 1 # End usability test (include/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) create_command SHOW CREATE TABLE t1; @@ -16207,6 +15632,8 @@ TRUNCATE t1; # check layout success: 1 # End usability test (include/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) create_command SHOW CREATE TABLE t1; @@ -16219,7 +15646,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='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part0 VALUES IN (0) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part1 VALUES IN (1) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (2) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (3) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */ +) 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) */ unified filelist $MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD @@ -16719,76 +16146,6 @@ TRUNCATE t1; # check layout success: 1 # End usability test (include/partition_check.inc) DROP TABLE t1; -SET @aux = 'PARTITION BY RANGE(f_int1) -(PARTITION parta VALUES LESS THAN (0) -DATA DIRECTORY = - ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'' -INDEX DIRECTORY = - ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'', -PARTITION partb VALUES LESS THAN (5) -DATA DIRECTORY = - ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'' -INDEX DIRECTORY = - ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'', -PARTITION partc VALUES LESS THAN (10) -DATA DIRECTORY = - ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'' -INDEX DIRECTORY = - ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'', -PARTITION partd VALUES LESS THAN (10 + 5) -DATA DIRECTORY = - ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'' -INDEX DIRECTORY = - ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'', -PARTITION parte VALUES LESS THAN (20) -DATA DIRECTORY = - ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'' -INDEX DIRECTORY = - ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'', -PARTITION partf VALUES LESS THAN (2147483646) -DATA DIRECTORY = - ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data'' -INDEX DIRECTORY = - ''/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'')'; -CREATE TABLE t1 ( -f_int1 INTEGER, -f_int2 INTEGER, -f_char1 CHAR(20), -f_char2 CHAR(20), -f_charbig VARCHAR(1000) -, UNIQUE INDEX uidx1 (f_int1,f_int2), UNIQUE INDEX uidx2 (f_int2,f_int1) -) -PARTITION BY RANGE(f_int1) -(PARTITION parta VALUES LESS THAN (0) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', -PARTITION partb VALUES LESS THAN (5) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', -PARTITION partc VALUES LESS THAN (10) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', -PARTITION partd VALUES LESS THAN (10 + 5) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', -PARTITION parte VALUES LESS THAN (20) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', -PARTITION partf VALUES LESS THAN (2147483646) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'); INSERT INTO t1(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) @@ -16803,7 +16160,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='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index/' /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */ +) 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) */ unified filelist $MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD @@ -17297,35 +16654,6 @@ TRUNCATE t1; # check layout success: 1 # End usability test (include/partition_check.inc) DROP TABLE t1; -CREATE TABLE t1 ( -f_int1 INTEGER, -f_int2 INTEGER, -f_char1 CHAR(20), -f_char2 CHAR(20), -f_charbig VARCHAR(1000) -, UNIQUE INDEX uidx1 (f_int1,f_int2), UNIQUE INDEX uidx2 (f_int2,f_int1) -) -PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 2 -(PARTITION parta VALUES LESS THAN (0) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', -PARTITION partb VALUES LESS THAN (5) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', -PARTITION partc VALUES LESS THAN (10) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', -PARTITION partd VALUES LESS THAN (2147483646) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'); INSERT INTO t1(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) @@ -17340,7 +16668,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='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/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 = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */ +) 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) */ unified filelist $MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYD @@ -17840,39 +17168,6 @@ TRUNCATE t1; # check layout success: 1 # End usability test (include/partition_check.inc) DROP TABLE t1; -CREATE TABLE t1 ( -f_int1 INTEGER, -f_int2 INTEGER, -f_char1 CHAR(20), -f_char2 CHAR(20), -f_charbig VARCHAR(1000) -, UNIQUE INDEX uidx1 (f_int1,f_int2), UNIQUE INDEX uidx2 (f_int2,f_int1) -) -PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1) -(PARTITION part1 VALUES LESS THAN (0) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' -(SUBPARTITION subpart11, SUBPARTITION subpart12), -PARTITION part2 VALUES LESS THAN (5) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' -(SUBPARTITION subpart21, SUBPARTITION subpart22), -PARTITION part3 VALUES LESS THAN (10) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' -(SUBPARTITION subpart31, SUBPARTITION subpart32), -PARTITION part4 VALUES LESS THAN (2147483646) -DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' -INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' -(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) @@ -17887,7 +17182,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='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/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 = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart12 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart22 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart32 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION subpart42 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM)) */ +) 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)) */ unified filelist $MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYD @@ -18385,67 +17680,6 @@ TRUNCATE t1; # check layout success: 1 # End usability test (include/partition_check.inc) DROP TABLE t1; -CREATE TABLE t1 ( -f_int1 INTEGER, -f_int2 INTEGER, -f_char1 CHAR(20), -f_char2 CHAR(20), -f_charbig VARCHAR(1000) -, UNIQUE INDEX uidx1 (f_int1,f_int2), UNIQUE INDEX uidx2 (f_int2,f_int1) -) -PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 1) -(PARTITION part1 VALUES IN (0) - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' - (SUBPARTITION sp11 - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', - SUBPARTITION sp12 - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'), - PARTITION part2 VALUES IN (1) - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' - (SUBPARTITION sp21 - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', - SUBPARTITION sp22 - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'), - PARTITION part3 VALUES IN (2) - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' - (SUBPARTITION sp31, - SUBPARTITION sp32), - PARTITION part4 VALUES IN (NULL) - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' - (SUBPARTITION sp41 - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', - SUBPARTITION sp42 - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index')); INSERT INTO t1(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) @@ -18460,7 +17694,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='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/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 = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp12 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp22 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp32 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, SUBPARTITION sp42 DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM)) */ +) 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)) */ unified filelist $MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYD @@ -18960,31 +18194,6 @@ TRUNCATE t1; # check layout success: 1 # End usability test (include/partition_check.inc) DROP TABLE t1; -CREATE TABLE t1 ( -f_int1 INTEGER, -f_int2 INTEGER, -f_char1 CHAR(20), -f_char2 CHAR(20), -f_charbig VARCHAR(1000) -, UNIQUE INDEX uidx1 (f_int1,f_int2), UNIQUE INDEX uidx2 (f_int2,f_int1) -) -PARTITION BY LIST(ABS(MOD(f_int1,2))) -SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 -(PARTITION part1 VALUES IN (0) - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', - PARTITION part2 VALUES IN (1) - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index', - PARTITION part3 VALUES IN (NULL) - DATA DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' - INDEX DIRECTORY = - '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index'); INSERT INTO t1(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) @@ -18999,7 +18208,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='/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data/' INDEX DIRECTORY='/data0/mysql/mysql-5.1-build/mysql-test/var/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 = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part2 VALUES IN (1) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/data' INDEX DIRECTORY = '/data0/mysql/mysql-5.1-build/mysql-test/var/master-data/test/index' ENGINE = MyISAM) */ +) 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) */ unified filelist $MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYD diff --git a/mysql-test/suite/parts/r/partition_datetime_innodb.result b/mysql-test/suite/parts/r/partition_datetime_innodb.result index f8cf390ebbb..4ced059ba9e 100644 --- a/mysql-test/suite/parts/r/partition_datetime_innodb.result +++ b/mysql-test/suite/parts/r/partition_datetime_innodb.result @@ -186,7 +186,7 @@ a 1971-01-01 00:00:59 drop table t2; create table t3 (a timestamp not null, primary key(a)) engine='InnoDB' -partition by range (cast(month(a) as unsigned)) subpartition by key (a) +partition by range (month(a)) subpartition by key (a) subpartitions 3 ( partition quarter1 values less than (4), partition quarter2 values less than (7), @@ -198,7 +198,7 @@ Table Create Table t3 CREATE TABLE `t3` ( `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`a`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (cast(month(a) as unsigned)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES LESS THAN (4) ENGINE = InnoDB, PARTITION quarter2 VALUES LESS THAN (7) ENGINE = InnoDB, PARTITION quarter3 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION quarter4 VALUES LESS THAN (13) ENGINE = InnoDB) */ +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (month(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES LESS THAN (4) ENGINE = InnoDB, PARTITION quarter2 VALUES LESS THAN (7) ENGINE = InnoDB, PARTITION quarter3 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION quarter4 VALUES LESS THAN (13) ENGINE = InnoDB) */ 12 inserts; insert into t3 values (date_add('1970-01-01 00:00:00',interval 12-1 month)); insert into t3 values (date_add('1970-01-01 00:00:00',interval 11-1 month)); @@ -233,7 +233,7 @@ a 1970-12-01 00:00:00 drop table t3; create table t4 (a timestamp not null, primary key(a)) engine='InnoDB' -partition by list (cast(month(a) as unsigned)) subpartition by key (a) +partition by list (month(a)) subpartition by key (a) subpartitions 3 ( partition quarter1 values in (0,1,2,3), partition quarter2 values in (4,5,6), @@ -245,7 +245,7 @@ Table Create Table t4 CREATE TABLE `t4` ( `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`a`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (cast(month(a) as unsigned)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES IN (0,1,2,3) ENGINE = InnoDB, PARTITION quarter2 VALUES IN (4,5,6) ENGINE = InnoDB, PARTITION quarter3 VALUES IN (7,8,9) ENGINE = InnoDB, PARTITION quarter4 VALUES IN (10,11,12) ENGINE = InnoDB) */ +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (month(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES IN (0,1,2,3) ENGINE = InnoDB, PARTITION quarter2 VALUES IN (4,5,6) ENGINE = InnoDB, PARTITION quarter3 VALUES IN (7,8,9) ENGINE = InnoDB, PARTITION quarter4 VALUES IN (10,11,12) ENGINE = InnoDB) */ 12 inserts; insert into t4 values (date_add('1970-01-01 00:00:00',interval 12-1 month)); insert into t4 values (date_add('1970-01-01 00:00:00',interval 11-1 month)); @@ -517,7 +517,7 @@ a 1970-03-28 drop table t2; create table t3 (a date not null, primary key(a)) engine='InnoDB' -partition by range (cast(month(a) as unsigned)) subpartition by key (a) +partition by range (month(a)) subpartition by key (a) subpartitions 3 ( partition quarter1 values less than (4), partition quarter2 values less than (7), @@ -529,7 +529,7 @@ Table Create Table t3 CREATE TABLE `t3` ( `a` date NOT NULL, PRIMARY KEY (`a`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (cast(month(a) as unsigned)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES LESS THAN (4) ENGINE = InnoDB, PARTITION quarter2 VALUES LESS THAN (7) ENGINE = InnoDB, PARTITION quarter3 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION quarter4 VALUES LESS THAN (13) ENGINE = InnoDB) */ +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (month(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES LESS THAN (4) ENGINE = InnoDB, PARTITION quarter2 VALUES LESS THAN (7) ENGINE = InnoDB, PARTITION quarter3 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION quarter4 VALUES LESS THAN (13) ENGINE = InnoDB) */ 12 inserts; insert into t3 values (adddate(19700101,interval 12-1 month)); insert into t3 values (adddate(19700101,interval 11-1 month)); @@ -562,7 +562,7 @@ a 1970-12-01 drop table t3; create table t4 (a date not null, primary key(a)) engine='InnoDB' -partition by list (cast(month(a) as unsigned)) subpartition by key (a) +partition by list (month(a)) subpartition by key (a) subpartitions 3 ( partition quarter1 values in (1,2,3), partition quarter2 values in (4,5,6), @@ -574,7 +574,7 @@ Table Create Table t4 CREATE TABLE `t4` ( `a` date NOT NULL, PRIMARY KEY (`a`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (cast(month(a) as unsigned)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES IN (1,2,3) ENGINE = InnoDB, PARTITION quarter2 VALUES IN (4,5,6) ENGINE = InnoDB, PARTITION quarter3 VALUES IN (7,8,9) ENGINE = InnoDB, PARTITION quarter4 VALUES IN (10,11,12) ENGINE = InnoDB) */ +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (month(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES IN (1,2,3) ENGINE = InnoDB, PARTITION quarter2 VALUES IN (4,5,6) ENGINE = InnoDB, PARTITION quarter3 VALUES IN (7,8,9) ENGINE = InnoDB, PARTITION quarter4 VALUES IN (10,11,12) ENGINE = InnoDB) */ 12 inserts; insert into t4 values (adddate(19700101,interval 12-1 month)); insert into t4 values (adddate(19700101,interval 11-1 month)); @@ -794,7 +794,7 @@ a 00:01:59 drop table t2; create table t3 (a time not null, primary key(a)) engine='InnoDB' -partition by range (cast(second(a) as unsigned)) subpartition by key (a) +partition by range (second(a)) subpartition by key (a) subpartitions 3 ( partition quarter1 values less than (16), partition quarter2 values less than (31), @@ -806,7 +806,7 @@ Table Create Table t3 CREATE TABLE `t3` ( `a` time NOT NULL, PRIMARY KEY (`a`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (cast(second(a) as unsigned)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES LESS THAN (16) ENGINE = InnoDB, PARTITION quarter2 VALUES LESS THAN (31) ENGINE = InnoDB, PARTITION quarter3 VALUES LESS THAN (46) ENGINE = InnoDB, PARTITION quarter4 VALUES LESS THAN (61) ENGINE = InnoDB) */ +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (second(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES LESS THAN (16) ENGINE = InnoDB, PARTITION quarter2 VALUES LESS THAN (31) ENGINE = InnoDB, PARTITION quarter3 VALUES LESS THAN (46) ENGINE = InnoDB, PARTITION quarter4 VALUES LESS THAN (61) ENGINE = InnoDB) */ 59 inserts; insert into t3 values (100000+59); insert into t3 values (100000+58); @@ -933,7 +933,7 @@ a 10:00:59 drop table t3; create table t4 (a time not null, primary key(a)) engine='InnoDB' -partition by list (cast(second(a) as unsigned)) subpartition by key (a) +partition by list (second(a)) subpartition by key (a) subpartitions 3 ( partition quarter1 values in (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), partition quarter2 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), @@ -945,7 +945,7 @@ Table Create Table t4 CREATE TABLE `t4` ( `a` time NOT NULL, PRIMARY KEY (`a`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (cast(second(a) as unsigned)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES IN (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15) ENGINE = InnoDB, PARTITION quarter2 VALUES IN (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION quarter3 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45) ENGINE = InnoDB, PARTITION quarter4 VALUES IN (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */ +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (second(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES IN (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15) ENGINE = InnoDB, PARTITION quarter2 VALUES IN (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = InnoDB, PARTITION quarter3 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45) ENGINE = InnoDB, PARTITION quarter4 VALUES IN (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = InnoDB) */ 59 inserts; insert into t4 values (100000+59); insert into t4 values (100000+58); @@ -1259,7 +1259,7 @@ a 1970-01-01 00:00:59 drop table t2; create table t3 (a datetime not null, primary key(a)) engine='InnoDB' -partition by range (cast(month(a) as unsigned)) subpartition by key (a) +partition by range (month(a)) subpartition by key (a) subpartitions 3 ( partition quarter1 values less than (4), partition quarter2 values less than (7), @@ -1271,7 +1271,7 @@ Table Create Table t3 CREATE TABLE `t3` ( `a` datetime NOT NULL, PRIMARY KEY (`a`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (cast(month(a) as unsigned)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES LESS THAN (4) ENGINE = InnoDB, PARTITION quarter2 VALUES LESS THAN (7) ENGINE = InnoDB, PARTITION quarter3 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION quarter4 VALUES LESS THAN (13) ENGINE = InnoDB) */ +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (month(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES LESS THAN (4) ENGINE = InnoDB, PARTITION quarter2 VALUES LESS THAN (7) ENGINE = InnoDB, PARTITION quarter3 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION quarter4 VALUES LESS THAN (13) ENGINE = InnoDB) */ 12 inserts; insert into t3 values (adddate(19700101000000,interval 12-1 month)); insert into t3 values (adddate(19700101000000,interval 11-1 month)); @@ -1304,7 +1304,7 @@ a 1970-12-01 00:00:00 drop table t3; create table t4 (a datetime not null, primary key(a)) engine='InnoDB' -partition by list (cast(month(a) as unsigned)) subpartition by key (a) +partition by list (month(a)) subpartition by key (a) subpartitions 3 ( partition quarter1 values in (1,2,3), partition quarter2 values in (4,5,6), @@ -1316,7 +1316,7 @@ Table Create Table t4 CREATE TABLE `t4` ( `a` datetime NOT NULL, PRIMARY KEY (`a`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (cast(month(a) as unsigned)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES IN (1,2,3) ENGINE = InnoDB, PARTITION quarter2 VALUES IN (4,5,6) ENGINE = InnoDB, PARTITION quarter3 VALUES IN (7,8,9) ENGINE = InnoDB, PARTITION quarter4 VALUES IN (10,11,12) ENGINE = InnoDB) */ +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (month(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES IN (1,2,3) ENGINE = InnoDB, PARTITION quarter2 VALUES IN (4,5,6) ENGINE = InnoDB, PARTITION quarter3 VALUES IN (7,8,9) ENGINE = InnoDB, PARTITION quarter4 VALUES IN (10,11,12) ENGINE = InnoDB) */ 12 inserts; insert into t4 values (adddate(19700101000000,interval 12-1 month)); insert into t4 values (adddate(19700101000000,interval 11-1 month)); diff --git a/mysql-test/suite/parts/r/partition_datetime_myisam.result b/mysql-test/suite/parts/r/partition_datetime_myisam.result index 2c0091322e1..1ef281f2766 100644 --- a/mysql-test/suite/parts/r/partition_datetime_myisam.result +++ b/mysql-test/suite/parts/r/partition_datetime_myisam.result @@ -186,7 +186,7 @@ a 1971-01-01 00:00:59 drop table t2; create table t3 (a timestamp not null, primary key(a)) engine='MyISAM' -partition by range (cast(month(a) as unsigned)) subpartition by key (a) +partition by range (month(a)) subpartition by key (a) subpartitions 3 ( partition quarter1 values less than (4), partition quarter2 values less than (7), @@ -198,7 +198,7 @@ Table Create Table t3 CREATE TABLE `t3` ( `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (cast(month(a) as unsigned)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES LESS THAN (4) ENGINE = MyISAM, PARTITION quarter2 VALUES LESS THAN (7) ENGINE = MyISAM, PARTITION quarter3 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION quarter4 VALUES LESS THAN (13) ENGINE = MyISAM) */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (month(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES LESS THAN (4) ENGINE = MyISAM, PARTITION quarter2 VALUES LESS THAN (7) ENGINE = MyISAM, PARTITION quarter3 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION quarter4 VALUES LESS THAN (13) ENGINE = MyISAM) */ 12 inserts; insert into t3 values (date_add('1970-01-01 00:00:00',interval 12-1 month)); insert into t3 values (date_add('1970-01-01 00:00:00',interval 11-1 month)); @@ -233,7 +233,7 @@ a 1970-12-01 00:00:00 drop table t3; create table t4 (a timestamp not null, primary key(a)) engine='MyISAM' -partition by list (cast(month(a) as unsigned)) subpartition by key (a) +partition by list (month(a)) subpartition by key (a) subpartitions 3 ( partition quarter1 values in (0,1,2,3), partition quarter2 values in (4,5,6), @@ -245,7 +245,7 @@ Table Create Table t4 CREATE TABLE `t4` ( `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (cast(month(a) as unsigned)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES IN (0,1,2,3) ENGINE = MyISAM, PARTITION quarter2 VALUES IN (4,5,6) ENGINE = MyISAM, PARTITION quarter3 VALUES IN (7,8,9) ENGINE = MyISAM, PARTITION quarter4 VALUES IN (10,11,12) ENGINE = MyISAM) */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (month(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES IN (0,1,2,3) ENGINE = MyISAM, PARTITION quarter2 VALUES IN (4,5,6) ENGINE = MyISAM, PARTITION quarter3 VALUES IN (7,8,9) ENGINE = MyISAM, PARTITION quarter4 VALUES IN (10,11,12) ENGINE = MyISAM) */ 12 inserts; insert into t4 values (date_add('1970-01-01 00:00:00',interval 12-1 month)); insert into t4 values (date_add('1970-01-01 00:00:00',interval 11-1 month)); @@ -517,7 +517,7 @@ a 1970-03-28 drop table t2; create table t3 (a date not null, primary key(a)) engine='MyISAM' -partition by range (cast(month(a) as unsigned)) subpartition by key (a) +partition by range (month(a)) subpartition by key (a) subpartitions 3 ( partition quarter1 values less than (4), partition quarter2 values less than (7), @@ -529,7 +529,7 @@ Table Create Table t3 CREATE TABLE `t3` ( `a` date NOT NULL, PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (cast(month(a) as unsigned)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES LESS THAN (4) ENGINE = MyISAM, PARTITION quarter2 VALUES LESS THAN (7) ENGINE = MyISAM, PARTITION quarter3 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION quarter4 VALUES LESS THAN (13) ENGINE = MyISAM) */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (month(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES LESS THAN (4) ENGINE = MyISAM, PARTITION quarter2 VALUES LESS THAN (7) ENGINE = MyISAM, PARTITION quarter3 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION quarter4 VALUES LESS THAN (13) ENGINE = MyISAM) */ 12 inserts; insert into t3 values (adddate(19700101,interval 12-1 month)); insert into t3 values (adddate(19700101,interval 11-1 month)); @@ -562,7 +562,7 @@ a 1970-12-01 drop table t3; create table t4 (a date not null, primary key(a)) engine='MyISAM' -partition by list (cast(month(a) as unsigned)) subpartition by key (a) +partition by list (month(a)) subpartition by key (a) subpartitions 3 ( partition quarter1 values in (1,2,3), partition quarter2 values in (4,5,6), @@ -574,7 +574,7 @@ Table Create Table t4 CREATE TABLE `t4` ( `a` date NOT NULL, PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (cast(month(a) as unsigned)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES IN (1,2,3) ENGINE = MyISAM, PARTITION quarter2 VALUES IN (4,5,6) ENGINE = MyISAM, PARTITION quarter3 VALUES IN (7,8,9) ENGINE = MyISAM, PARTITION quarter4 VALUES IN (10,11,12) ENGINE = MyISAM) */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (month(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES IN (1,2,3) ENGINE = MyISAM, PARTITION quarter2 VALUES IN (4,5,6) ENGINE = MyISAM, PARTITION quarter3 VALUES IN (7,8,9) ENGINE = MyISAM, PARTITION quarter4 VALUES IN (10,11,12) ENGINE = MyISAM) */ 12 inserts; insert into t4 values (adddate(19700101,interval 12-1 month)); insert into t4 values (adddate(19700101,interval 11-1 month)); @@ -794,7 +794,7 @@ a 00:01:59 drop table t2; create table t3 (a time not null, primary key(a)) engine='MyISAM' -partition by range (cast(second(a) as unsigned)) subpartition by key (a) +partition by range (second(a)) subpartition by key (a) subpartitions 3 ( partition quarter1 values less than (16), partition quarter2 values less than (31), @@ -806,7 +806,7 @@ Table Create Table t3 CREATE TABLE `t3` ( `a` time NOT NULL, PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (cast(second(a) as unsigned)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES LESS THAN (16) ENGINE = MyISAM, PARTITION quarter2 VALUES LESS THAN (31) ENGINE = MyISAM, PARTITION quarter3 VALUES LESS THAN (46) ENGINE = MyISAM, PARTITION quarter4 VALUES LESS THAN (61) ENGINE = MyISAM) */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (second(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES LESS THAN (16) ENGINE = MyISAM, PARTITION quarter2 VALUES LESS THAN (31) ENGINE = MyISAM, PARTITION quarter3 VALUES LESS THAN (46) ENGINE = MyISAM, PARTITION quarter4 VALUES LESS THAN (61) ENGINE = MyISAM) */ 59 inserts; insert into t3 values (100000+59); insert into t3 values (100000+58); @@ -933,7 +933,7 @@ a 10:00:59 drop table t3; create table t4 (a time not null, primary key(a)) engine='MyISAM' -partition by list (cast(second(a) as unsigned)) subpartition by key (a) +partition by list (second(a)) subpartition by key (a) subpartitions 3 ( partition quarter1 values in (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), partition quarter2 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), @@ -945,7 +945,7 @@ Table Create Table t4 CREATE TABLE `t4` ( `a` time NOT NULL, PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (cast(second(a) as unsigned)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES IN (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15) ENGINE = MyISAM, PARTITION quarter2 VALUES IN (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION quarter3 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45) ENGINE = MyISAM, PARTITION quarter4 VALUES IN (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (second(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES IN (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15) ENGINE = MyISAM, PARTITION quarter2 VALUES IN (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = MyISAM, PARTITION quarter3 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45) ENGINE = MyISAM, PARTITION quarter4 VALUES IN (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = MyISAM) */ 59 inserts; insert into t4 values (100000+59); insert into t4 values (100000+58); @@ -1259,7 +1259,7 @@ a 1970-01-01 00:00:59 drop table t2; create table t3 (a datetime not null, primary key(a)) engine='MyISAM' -partition by range (cast(month(a) as unsigned)) subpartition by key (a) +partition by range (month(a)) subpartition by key (a) subpartitions 3 ( partition quarter1 values less than (4), partition quarter2 values less than (7), @@ -1271,7 +1271,7 @@ Table Create Table t3 CREATE TABLE `t3` ( `a` datetime NOT NULL, PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (cast(month(a) as unsigned)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES LESS THAN (4) ENGINE = MyISAM, PARTITION quarter2 VALUES LESS THAN (7) ENGINE = MyISAM, PARTITION quarter3 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION quarter4 VALUES LESS THAN (13) ENGINE = MyISAM) */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (month(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES LESS THAN (4) ENGINE = MyISAM, PARTITION quarter2 VALUES LESS THAN (7) ENGINE = MyISAM, PARTITION quarter3 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION quarter4 VALUES LESS THAN (13) ENGINE = MyISAM) */ 12 inserts; insert into t3 values (adddate(19700101000000,interval 12-1 month)); insert into t3 values (adddate(19700101000000,interval 11-1 month)); @@ -1304,7 +1304,7 @@ a 1970-12-01 00:00:00 drop table t3; create table t4 (a datetime not null, primary key(a)) engine='MyISAM' -partition by list (cast(month(a) as unsigned)) subpartition by key (a) +partition by list (month(a)) subpartition by key (a) subpartitions 3 ( partition quarter1 values in (1,2,3), partition quarter2 values in (4,5,6), @@ -1316,7 +1316,7 @@ Table Create Table t4 CREATE TABLE `t4` ( `a` datetime NOT NULL, PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (cast(month(a) as unsigned)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES IN (1,2,3) ENGINE = MyISAM, PARTITION quarter2 VALUES IN (4,5,6) ENGINE = MyISAM, PARTITION quarter3 VALUES IN (7,8,9) ENGINE = MyISAM, PARTITION quarter4 VALUES IN (10,11,12) ENGINE = MyISAM) */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (month(a)) SUBPARTITION BY KEY (a) SUBPARTITIONS 3 (PARTITION quarter1 VALUES IN (1,2,3) ENGINE = MyISAM, PARTITION quarter2 VALUES IN (4,5,6) ENGINE = MyISAM, PARTITION quarter3 VALUES IN (7,8,9) ENGINE = MyISAM, PARTITION quarter4 VALUES IN (10,11,12) ENGINE = MyISAM) */ 12 inserts; insert into t4 values (adddate(19700101000000,interval 12-1 month)); insert into t4 values (adddate(19700101000000,interval 11-1 month)); diff --git a/mysql-test/suite/parts/r/partition_decimal_innodb.result b/mysql-test/suite/parts/r/partition_decimal_innodb.result index 584ce91724e..c0a165cf189 100644 --- a/mysql-test/suite/parts/r/partition_decimal_innodb.result +++ b/mysql-test/suite/parts/r/partition_decimal_innodb.result @@ -87,95 +87,3 @@ select count(*) from t2; count(*) 3072 drop table t2; -create table t3 (a decimal(18,9) not null, primary key(a)) engine='InnoDB' -partition by range (cast(floor(a) as signed)) subpartition by key (a) subpartitions 2 ( -partition pa2 values less than (2), -partition pa4 values less than (4), -partition pa6 values less than (6), -partition pa8 values less than (8), -partition pa10 values less than (10) -); -show create table t3; -Table Create Table -t3 CREATE TABLE `t3` ( - `a` decimal(18,9) NOT NULL, - PRIMARY KEY (`a`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (cast(floor(a) as signed)) SUBPARTITION BY KEY (a) SUBPARTITIONS 2 (PARTITION pa2 VALUES LESS THAN (2) ENGINE = InnoDB, PARTITION pa4 VALUES LESS THAN (4) ENGINE = InnoDB, PARTITION pa6 VALUES LESS THAN (6) ENGINE = InnoDB, PARTITION pa8 VALUES LESS THAN (8) ENGINE = InnoDB, PARTITION pa10 VALUES LESS THAN (10) ENGINE = InnoDB) */ -9*3 inserts; -insert into t3 values (9); -insert into t3 values (9+0.333333333); -insert into t3 values (9+0.755555555); -insert into t3 values (8); -insert into t3 values (8+0.333333333); -insert into t3 values (8+0.755555555); -insert into t3 values (7); -insert into t3 values (7+0.333333333); -insert into t3 values (7+0.755555555); -insert into t3 values (6); -insert into t3 values (6+0.333333333); -insert into t3 values (6+0.755555555); -insert into t3 values (5); -insert into t3 values (5+0.333333333); -insert into t3 values (5+0.755555555); -insert into t3 values (4); -insert into t3 values (4+0.333333333); -insert into t3 values (4+0.755555555); -insert into t3 values (3); -insert into t3 values (3+0.333333333); -insert into t3 values (3+0.755555555); -insert into t3 values (2); -insert into t3 values (2+0.333333333); -insert into t3 values (2+0.755555555); -insert into t3 values (1); -insert into t3 values (1+0.333333333); -insert into t3 values (1+0.755555555); -select count(*) from t3; -count(*) -27 -drop table t3; -create table t4 (a decimal(18,9) not null, primary key(a)) engine='InnoDB' -partition by list (cast(floor(a) as signed)) subpartition by key (a) subpartitions 2 ( -partition pa2 values in (1,2), -partition pa4 values in (3,4), -partition pa6 values in (5,6), -partition pa8 values in (7,8), -partition pa10 values in (9,10) -); -show create table t4; -Table Create Table -t4 CREATE TABLE `t4` ( - `a` decimal(18,9) NOT NULL, - PRIMARY KEY (`a`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (cast(floor(a) as signed)) SUBPARTITION BY KEY (a) SUBPARTITIONS 2 (PARTITION pa2 VALUES IN (1,2) ENGINE = InnoDB, PARTITION pa4 VALUES IN (3,4) ENGINE = InnoDB, PARTITION pa6 VALUES IN (5,6) ENGINE = InnoDB, PARTITION pa8 VALUES IN (7,8) ENGINE = InnoDB, PARTITION pa10 VALUES IN (9,10) ENGINE = InnoDB) */ -9*3 inserts; -insert into t4 values (9); -insert into t4 values (9+0.333333333); -insert into t4 values (9+0.755555555); -insert into t4 values (8); -insert into t4 values (8+0.333333333); -insert into t4 values (8+0.755555555); -insert into t4 values (7); -insert into t4 values (7+0.333333333); -insert into t4 values (7+0.755555555); -insert into t4 values (6); -insert into t4 values (6+0.333333333); -insert into t4 values (6+0.755555555); -insert into t4 values (5); -insert into t4 values (5+0.333333333); -insert into t4 values (5+0.755555555); -insert into t4 values (4); -insert into t4 values (4+0.333333333); -insert into t4 values (4+0.755555555); -insert into t4 values (3); -insert into t4 values (3+0.333333333); -insert into t4 values (3+0.755555555); -insert into t4 values (2); -insert into t4 values (2+0.333333333); -insert into t4 values (2+0.755555555); -insert into t4 values (1); -insert into t4 values (1+0.333333333); -insert into t4 values (1+0.755555555); -select count(*) from t4; -count(*) -27 -drop table t4; diff --git a/mysql-test/suite/parts/r/partition_decimal_myisam.result b/mysql-test/suite/parts/r/partition_decimal_myisam.result index 008c249165d..464ac4ddaf5 100644 --- a/mysql-test/suite/parts/r/partition_decimal_myisam.result +++ b/mysql-test/suite/parts/r/partition_decimal_myisam.result @@ -87,95 +87,3 @@ select count(*) from t2; count(*) 196605 drop table t2; -create table t3 (a decimal(18,9) not null, primary key(a)) engine='MYISAM' -partition by range (cast(floor(a) as signed)) subpartition by key (a) subpartitions 2 ( -partition pa2 values less than (2), -partition pa4 values less than (4), -partition pa6 values less than (6), -partition pa8 values less than (8), -partition pa10 values less than (10) -); -show create table t3; -Table Create Table -t3 CREATE TABLE `t3` ( - `a` decimal(18,9) NOT NULL, - PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (cast(floor(a) as signed)) SUBPARTITION BY KEY (a) SUBPARTITIONS 2 (PARTITION pa2 VALUES LESS THAN (2) ENGINE = MyISAM, PARTITION pa4 VALUES LESS THAN (4) ENGINE = MyISAM, PARTITION pa6 VALUES LESS THAN (6) ENGINE = MyISAM, PARTITION pa8 VALUES LESS THAN (8) ENGINE = MyISAM, PARTITION pa10 VALUES LESS THAN (10) ENGINE = MyISAM) */ -9*3 inserts; -insert into t3 values (9); -insert into t3 values (9+0.333333333); -insert into t3 values (9+0.755555555); -insert into t3 values (8); -insert into t3 values (8+0.333333333); -insert into t3 values (8+0.755555555); -insert into t3 values (7); -insert into t3 values (7+0.333333333); -insert into t3 values (7+0.755555555); -insert into t3 values (6); -insert into t3 values (6+0.333333333); -insert into t3 values (6+0.755555555); -insert into t3 values (5); -insert into t3 values (5+0.333333333); -insert into t3 values (5+0.755555555); -insert into t3 values (4); -insert into t3 values (4+0.333333333); -insert into t3 values (4+0.755555555); -insert into t3 values (3); -insert into t3 values (3+0.333333333); -insert into t3 values (3+0.755555555); -insert into t3 values (2); -insert into t3 values (2+0.333333333); -insert into t3 values (2+0.755555555); -insert into t3 values (1); -insert into t3 values (1+0.333333333); -insert into t3 values (1+0.755555555); -select count(*) from t3; -count(*) -27 -drop table t3; -create table t4 (a decimal(18,9) not null, primary key(a)) engine='MYISAM' -partition by list (cast(floor(a) as signed)) subpartition by key (a) subpartitions 2 ( -partition pa2 values in (1,2), -partition pa4 values in (3,4), -partition pa6 values in (5,6), -partition pa8 values in (7,8), -partition pa10 values in (9,10) -); -show create table t4; -Table Create Table -t4 CREATE TABLE `t4` ( - `a` decimal(18,9) NOT NULL, - PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (cast(floor(a) as signed)) SUBPARTITION BY KEY (a) SUBPARTITIONS 2 (PARTITION pa2 VALUES IN (1,2) ENGINE = MyISAM, PARTITION pa4 VALUES IN (3,4) ENGINE = MyISAM, PARTITION pa6 VALUES IN (5,6) ENGINE = MyISAM, PARTITION pa8 VALUES IN (7,8) ENGINE = MyISAM, PARTITION pa10 VALUES IN (9,10) ENGINE = MyISAM) */ -9*3 inserts; -insert into t4 values (9); -insert into t4 values (9+0.333333333); -insert into t4 values (9+0.755555555); -insert into t4 values (8); -insert into t4 values (8+0.333333333); -insert into t4 values (8+0.755555555); -insert into t4 values (7); -insert into t4 values (7+0.333333333); -insert into t4 values (7+0.755555555); -insert into t4 values (6); -insert into t4 values (6+0.333333333); -insert into t4 values (6+0.755555555); -insert into t4 values (5); -insert into t4 values (5+0.333333333); -insert into t4 values (5+0.755555555); -insert into t4 values (4); -insert into t4 values (4+0.333333333); -insert into t4 values (4+0.755555555); -insert into t4 values (3); -insert into t4 values (3+0.333333333); -insert into t4 values (3+0.755555555); -insert into t4 values (2); -insert into t4 values (2+0.333333333); -insert into t4 values (2+0.755555555); -insert into t4 values (1); -insert into t4 values (1+0.333333333); -insert into t4 values (1+0.755555555); -select count(*) from t4; -count(*) -27 -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 08a1c20d224..aba62b8ba70 100644 --- a/mysql-test/suite/parts/r/partition_float_myisam.result +++ b/mysql-test/suite/parts/r/partition_float_myisam.result @@ -89,152 +89,6 @@ select count(*) from t2; count(*) 49152 drop table t2; -create table t3 (a float not null, primary key(a)) engine='MYISAM' -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=MyISAM 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 = MyISAM, PARTITION pa3 VALUES LESS THAN (6) ENGINE = MyISAM, PARTITION pa10 VALUES LESS THAN (10) ENGINE = MyISAM) */ -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='MYISAM' -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=MyISAM 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 = MyISAM, PARTITION pa3 VALUES IN (4,5,6) ENGINE = MyISAM, PARTITION pa10 VALUES IN (7,8,9,10) ENGINE = MyISAM) */ -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='MYISAM' partition by key (a) ( partition pa1 DATA DIRECTORY = @@ -318,149 +172,3 @@ select count(*) from t2; count(*) 49152 drop table t2; -create table t3 (a double not null, primary key(a)) engine='MYISAM' -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=MyISAM 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 = MyISAM, PARTITION pa3 VALUES LESS THAN (6) ENGINE = MyISAM, PARTITION pa10 VALUES LESS THAN (10) ENGINE = MyISAM) */ -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='MYISAM' -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=MyISAM 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 = MyISAM, PARTITION pa3 VALUES IN (4,5,6) ENGINE = MyISAM, PARTITION pa10 VALUES IN (7,8,9,10) ENGINE = MyISAM) */ -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_syntax_innodb.result b/mysql-test/suite/parts/r/partition_syntax_innodb.result index d64bfdde239..c6fb2d38e4c 100644 --- a/mysql-test/suite/parts/r/partition_syntax_innodb.result +++ b/mysql-test/suite/parts/r/partition_syntax_innodb.result @@ -620,7 +620,7 @@ PARTITION BY RANGE(f_int1) PARTITION part2 VALUES LESS THAN (1000)); ERROR 42000: Not allowed to use NULL value in VALUES LESS THAN near '), PARTITION part2 VALUES LESS THAN (1000))' at line 9 -# 3.5.1.2 VALUE LESS THAN (CAST(NULL AS SIGNED INTEGER)) is not allowed +# 3.5.1.2 VALUE LESS THAN (NULL) is not allowed CREATE TABLE t1 ( f_int1 INTEGER, f_int2 INTEGER, @@ -629,7 +629,7 @@ f_char2 CHAR(20), f_charbig VARCHAR(1000) ) PARTITION BY RANGE(f_int1) -( PARTITION part1 VALUES LESS THAN (CAST(NULL AS SIGNED INTEGER)), +( PARTITION part1 VALUES LESS THAN (NULL), PARTITION part2 VALUES LESS THAN (1000)); ERROR 42000: Not allowed to use NULL value in VALUES LESS THAN near '), PARTITION part2 VALUES LESS THAN (1000))' at line 9 @@ -647,7 +647,7 @@ PARTITION BY LIST(MOD(f_int1,2)) PARTITION part2 VALUES IN (0), PARTITION part3 VALUES IN (1)); DROP TABLE t1; -# 3.5.2.2 VALUE IN (CAST(NULL AS SIGNED INTEGER)) +# 3.5.2.2 VALUE IN (NULL) CREATE TABLE t1 ( f_int1 INTEGER, f_int2 INTEGER, @@ -656,7 +656,7 @@ f_char2 CHAR(20), f_charbig VARCHAR(1000) ) PARTITION BY LIST(MOD(f_int1,2)) -( PARTITION part1 VALUES IN (CAST(NULL AS SIGNED INTEGER)), +( PARTITION part1 VALUES IN (NULL), PARTITION part3 VALUES IN (1)); create_command SHOW CREATE TABLE t1; @@ -679,7 +679,7 @@ f_char2 CHAR(20), f_charbig VARCHAR(1000) ) PARTITION BY LIST(MOD(f_int1,2)) -( PARTITION part1 VALUES IN (CAST(NULL AS SIGNED INTEGER)), +( PARTITION part1 VALUES IN (NULL), PARTITION part2 VALUES IN (0), PARTITION part3 VALUES IN (1)); create_command diff --git a/mysql-test/suite/parts/r/partition_syntax_myisam.result b/mysql-test/suite/parts/r/partition_syntax_myisam.result index 34f771ba51d..49a7b155a58 100644 --- a/mysql-test/suite/parts/r/partition_syntax_myisam.result +++ b/mysql-test/suite/parts/r/partition_syntax_myisam.result @@ -620,7 +620,7 @@ PARTITION BY RANGE(f_int1) PARTITION part2 VALUES LESS THAN (1000)); ERROR 42000: Not allowed to use NULL value in VALUES LESS THAN near '), PARTITION part2 VALUES LESS THAN (1000))' at line 9 -# 3.5.1.2 VALUE LESS THAN (CAST(NULL AS SIGNED INTEGER)) is not allowed +# 3.5.1.2 VALUE LESS THAN (NULL) is not allowed CREATE TABLE t1 ( f_int1 INTEGER, f_int2 INTEGER, @@ -629,7 +629,7 @@ f_char2 CHAR(20), f_charbig VARCHAR(1000) ) PARTITION BY RANGE(f_int1) -( PARTITION part1 VALUES LESS THAN (CAST(NULL AS SIGNED INTEGER)), +( PARTITION part1 VALUES LESS THAN (NULL), PARTITION part2 VALUES LESS THAN (1000)); ERROR 42000: Not allowed to use NULL value in VALUES LESS THAN near '), PARTITION part2 VALUES LESS THAN (1000))' at line 9 @@ -647,7 +647,7 @@ PARTITION BY LIST(MOD(f_int1,2)) PARTITION part2 VALUES IN (0), PARTITION part3 VALUES IN (1)); DROP TABLE t1; -# 3.5.2.2 VALUE IN (CAST(NULL AS SIGNED INTEGER)) +# 3.5.2.2 VALUE IN (NULL) CREATE TABLE t1 ( f_int1 INTEGER, f_int2 INTEGER, @@ -656,7 +656,7 @@ f_char2 CHAR(20), f_charbig VARCHAR(1000) ) PARTITION BY LIST(MOD(f_int1,2)) -( PARTITION part1 VALUES IN (CAST(NULL AS SIGNED INTEGER)), +( PARTITION part1 VALUES IN (NULL), PARTITION part3 VALUES IN (1)); create_command SHOW CREATE TABLE t1; @@ -687,7 +687,7 @@ f_char2 CHAR(20), f_charbig VARCHAR(1000) ) PARTITION BY LIST(MOD(f_int1,2)) -( PARTITION part1 VALUES IN (CAST(NULL AS SIGNED INTEGER)), +( PARTITION part1 VALUES IN (NULL), PARTITION part2 VALUES IN (0), PARTITION part3 VALUES IN (1)); create_command diff --git a/mysql-test/suite/parts/t/disabled.def b/mysql-test/suite/parts/t/disabled.def index 36bf08e9851..1b70519b72c 100644 --- a/mysql-test/suite/parts/t/disabled.def +++ b/mysql-test/suite/parts/t/disabled.def @@ -6,6 +6,8 @@ ndb_partition_range : cannot create t1 partition_bit_ndb : cannot create t1 partition_int_ndb : cannot create t1 partition_syntax_ndb : cannot create t1 +partition_value_myisam : Bug#30581 partition_value tests use disallowed CAST() function +partition_value_innodb : Bug#30581 partition_value tests use disallowed CAST() function partition_value_ndb : cannot create t1 partition_basic_ndb : cannot create t1 partition_alter1_ndb : timeout. Needs too much time. @@ -13,3 +15,6 @@ 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 From 7dbef328bef2436c553387814e4207bc56643c34 Mon Sep 17 00:00:00 2001 From: "tsmith@ramayana.hindu.god" <> Date: Mon, 27 Aug 2007 14:12:12 -0600 Subject: [PATCH 55/90] Bug #30412 and Bug #30413 Update some tests in the "parts" suite, so they're skipped if the requisite plugins are not present in the mysqld. --- mysql-test/suite/parts/t/partition_char_innodb.test | 1 + mysql-test/suite/parts/t/partition_datetime_innodb.test | 1 + mysql-test/suite/parts/t/partition_decimal_innodb.test | 2 ++ mysql-test/suite/parts/t/partition_float_innodb.test | 2 ++ mysql-test/suite/parts/t/partition_int_innodb.test | 1 + mysql-test/suite/parts/t/partition_special_innodb.test | 1 + mysql-test/suite/parts/t/rpl_partition.test | 1 + 7 files changed, 9 insertions(+) diff --git a/mysql-test/suite/parts/t/partition_char_innodb.test b/mysql-test/suite/parts/t/partition_char_innodb.test index d0389517927..27295084de4 100644 --- a/mysql-test/suite/parts/t/partition_char_innodb.test +++ b/mysql-test/suite/parts/t/partition_char_innodb.test @@ -36,6 +36,7 @@ let $debug= 0; ##### Storage engine to be tested let $engine= 'InnoDB'; +--source include/have_innodb.inc ##### max rows to be inserted let $maxrows=65535; diff --git a/mysql-test/suite/parts/t/partition_datetime_innodb.test b/mysql-test/suite/parts/t/partition_datetime_innodb.test index fe19e2803c5..eba0bc3e10b 100644 --- a/mysql-test/suite/parts/t/partition_datetime_innodb.test +++ b/mysql-test/suite/parts/t/partition_datetime_innodb.test @@ -36,6 +36,7 @@ let $debug= 0; ##### Storage engine to be tested let $engine= 'InnoDB'; +--source include/have_innodb.inc ##### max rows to be inserted let $maxrows=1024; diff --git a/mysql-test/suite/parts/t/partition_decimal_innodb.test b/mysql-test/suite/parts/t/partition_decimal_innodb.test index ec5948097c8..22e759ec5d9 100644 --- a/mysql-test/suite/parts/t/partition_decimal_innodb.test +++ b/mysql-test/suite/parts/t/partition_decimal_innodb.test @@ -36,6 +36,8 @@ let $debug= 0; ##### Storage engine to be tested let $engine= 'InnoDB'; +--source include/have_innodb.inc + ##### number of rows to be inserted let $maxrows=1024; diff --git a/mysql-test/suite/parts/t/partition_float_innodb.test b/mysql-test/suite/parts/t/partition_float_innodb.test index b36dc0668a6..3395d1812d2 100644 --- a/mysql-test/suite/parts/t/partition_float_innodb.test +++ b/mysql-test/suite/parts/t/partition_float_innodb.test @@ -36,6 +36,8 @@ let $debug= 0; ##### Storage engine to be tested let $engine= 'InnoDB'; +--source include/have_innodb.inc + ##### Number of row to be inserted. let $maxrows=1024; diff --git a/mysql-test/suite/parts/t/partition_int_innodb.test b/mysql-test/suite/parts/t/partition_int_innodb.test index fda7398565c..dc14b369654 100644 --- a/mysql-test/suite/parts/t/partition_int_innodb.test +++ b/mysql-test/suite/parts/t/partition_int_innodb.test @@ -36,6 +36,7 @@ let $debug= 0; ##### Storage engine to be tested let $engine= 'InnoDB'; +--source include/have_innodb.inc ##### max rows to be inserted let $maxrows=1024; diff --git a/mysql-test/suite/parts/t/partition_special_innodb.test b/mysql-test/suite/parts/t/partition_special_innodb.test index 5df518a3952..f552d64f4e4 100644 --- a/mysql-test/suite/parts/t/partition_special_innodb.test +++ b/mysql-test/suite/parts/t/partition_special_innodb.test @@ -36,6 +36,7 @@ let $debug= 0; ##### Storage engine to be tested let $engine= 'InnoDB'; +--source include/have_innodb.inc #------------------------------------------------------------------------------# # Execute the tests to be applied to all storage engines diff --git a/mysql-test/suite/parts/t/rpl_partition.test b/mysql-test/suite/parts/t/rpl_partition.test index ffd6d17ec6f..f1002ded81f 100644 --- a/mysql-test/suite/parts/t/rpl_partition.test +++ b/mysql-test/suite/parts/t/rpl_partition.test @@ -1,3 +1,4 @@ +--source include/have_partition.inc --source include/have_innodb.inc --source include/master-slave.inc From 2c44def1eeaaebf365626619a9733a4e90faa801 Mon Sep 17 00:00:00 2001 From: "tsmith@ramayana.hindu.god" <> Date: Mon, 27 Aug 2007 14:31:27 -0600 Subject: [PATCH 56/90] Bug #30389: connection_id() always return 0 in embedded server Initialize thd->variables.pseudo_thread_id when a new embedded thd is created. --- libmysqld/lib_sql.cc | 11 +++++++++++ mysql-test/r/func_misc.result | 4 ++++ mysql-test/t/func_misc.test | 8 ++++++++ sql/mysqld.cc | 5 +++++ sql/sql_connect.cc | 5 +++++ 5 files changed, 33 insertions(+) diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc index 42d2752f6e1..9c26febe627 100644 --- a/libmysqld/lib_sql.cc +++ b/libmysqld/lib_sql.cc @@ -564,6 +564,17 @@ void init_embedded_mysql(MYSQL *mysql, int client_flag) init_alloc_root(&mysql->field_alloc, 8192, 0); } +/** + @brief Initialize a new THD for a connection in the embedded server + + @param client_flag Client capabilities which this thread supports + @return pointer to the created THD object + + @todo + This function copies code from several places in the server, including + create_new_thread(), and prepare_new_connection_state(). This should + be refactored to avoid code duplication. +*/ void *create_embedded_thd(int client_flag) { THD * thd= new THD; diff --git a/mysql-test/r/func_misc.result b/mysql-test/r/func_misc.result index 447d5620a4d..39bf1470afe 100644 --- a/mysql-test/r/func_misc.result +++ b/mysql-test/r/func_misc.result @@ -191,3 +191,7 @@ drop table table_26093; drop function func_26093_a; drop function func_26093_b; End of 5.0 tests +select connection_id() > 0; +connection_id() > 0 +1 +End of tests diff --git a/mysql-test/t/func_misc.test b/mysql-test/t/func_misc.test index a48f619dc34..01eff55d1f6 100644 --- a/mysql-test/t/func_misc.test +++ b/mysql-test/t/func_misc.test @@ -199,3 +199,11 @@ drop function func_26093_a; drop function func_26093_b; --echo End of 5.0 tests + +# +# Bug #30389: connection_id() always return 0 in embedded server +# + +select connection_id() > 0; + +--echo End of tests diff --git a/sql/mysqld.cc b/sql/mysqld.cc index d5336f5dd9c..b4ea09597a8 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -4355,6 +4355,11 @@ static void create_new_thread(THD *thd) DBUG_VOID_RETURN; } pthread_mutex_lock(&LOCK_thread_count); + /* + The initialization of thread_id is done in create_embedded_thd() for + the embedded library. + TODO: refactor this to avoid code duplication there + */ thd->thread_id= thd->variables.pseudo_thread_id= thread_id++; /* Start a new thread to handle connection */ diff --git a/sql/sql_connect.cc b/sql/sql_connect.cc index 03b9908c1ad..6bb0f62d843 100644 --- a/sql/sql_connect.cc +++ b/sql/sql_connect.cc @@ -1008,6 +1008,11 @@ void prepare_new_connection_state(THD* thd) if (thd->client_capabilities & CLIENT_COMPRESS) thd->net.compress=1; // Use compression + /* + Much of this is duplicated in create_embedded_thd() for the + embedded server library. + TODO: refactor this to avoid code duplication there + */ thd->version= refresh_version; thd->proc_info= 0; thd->command= COM_SLEEP; From 82a3e8cfaf22956150e2ea4a3aefa54348f7f7e9 Mon Sep 17 00:00:00 2001 From: "tsmith@ramayana.hindu.god" <> Date: Mon, 27 Aug 2007 18:18:14 -0600 Subject: [PATCH 57/90] Fix some Windows compiler warnings. --- storage/innobase/dict/dict0mem.c | 2 +- storage/innobase/handler/ha_innodb.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/storage/innobase/dict/dict0mem.c b/storage/innobase/dict/dict0mem.c index f4012c11973..47cf7a0bc9c 100644 --- a/storage/innobase/dict/dict0mem.c +++ b/storage/innobase/dict/dict0mem.c @@ -209,7 +209,7 @@ dict_mem_table_add_col( col = (dict_col_t*) dict_table_get_nth_col(table, i); - col->ind = i; + col->ind = (unsigned int) i; col->ord_part = 0; col->mtype = (unsigned int) mtype; diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 909b19e6ae7..40aab263981 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -7221,7 +7221,7 @@ ulong ha_innobase::innobase_get_auto_increment( ulonglong* value) /* out: autoinc value */ { - ulint error; + ulong error; do { error = innobase_autoinc_lock(); From 037f79a43ce35966d39e20eeede7c0aabfcb5e40 Mon Sep 17 00:00:00 2001 From: "tomas@whalegate.ndb.mysql.com" <> Date: Tue, 28 Aug 2007 07:42:43 +0200 Subject: [PATCH 58/90] Bug#29549 rpl_ndb_myisam2ndb,rpl_ndb_innodb2ndb failed on Solaris for pack_length issue --- mysql-test/suite/rpl_ndb/t/disabled.def | 2 +- sql/field.cc | 15 ++++++--------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/mysql-test/suite/rpl_ndb/t/disabled.def b/mysql-test/suite/rpl_ndb/t/disabled.def index f4cbd3e9d0c..4c800a2f30a 100644 --- a/mysql-test/suite/rpl_ndb/t/disabled.def +++ b/mysql-test/suite/rpl_ndb/t/disabled.def @@ -17,7 +17,7 @@ rpl_ndb_dd_partitions : BUG#19259 2006-04-21 rpl_ndb_dd_partitions fails on s #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_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_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 diff --git a/sql/field.cc b/sql/field.cc index c8e1572d60f..ed1877fca78 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -7616,19 +7616,16 @@ uchar *Field_blob::pack(uchar *to, const uchar *from, uint max_length) uint32 length=get_length(); // Length of from string if (length > max_length) { - ptr=to; length=max_length; - store_length(length); // Store max length - ptr= (uchar*) from; + store_length(to,packlength,length,TRUE); } - else #ifdef WORDS_BIGENDIAN - if (table->s->db_low_byte_first) + else if (!table->s->db_low_byte_first) { - store_length(to,packlength,length,0); + store_length(to,packlength,length,TRUE); } - else #endif + else memcpy(to,from,packlength); // Copy length if (length) { @@ -7667,9 +7664,9 @@ const uchar *Field_blob::unpack(uchar *to, const uchar *from) { uint32 length=get_length(from); #ifdef WORDS_BIGENDIAN - if (table->s->db_low_byte_first) + if (!table->s->db_low_byte_first) { - store_length(to,packlength,length,1); + store_length(to,packlength,length,FALSE); } else #endif From 17f751ed05eefc0ab07bcccf314f492de314918a Mon Sep 17 00:00:00 2001 From: "tomas@whalegate.ndb.mysql.com" <> Date: Tue, 28 Aug 2007 07:55:07 +0200 Subject: [PATCH 59/90] correct compile error --- sql/log_event.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/log_event.cc b/sql/log_event.cc index cfac7df21a8..640499ffd16 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -5697,7 +5697,7 @@ Rows_log_event::Rows_log_event(const char *buf, uint event_len, *description_event) : Log_event(buf, description_event), m_row_count(0), - m_table(NULL), + m_table_id(0), m_rows_buf(0), m_rows_cur(0), m_rows_end(0), m_curr_row(NULL), m_curr_row_end(NULL), m_key(NULL) From b42e80e351abda6d0b8b01ffb6a1b8b99c7100f6 Mon Sep 17 00:00:00 2001 From: "tsmith@sita.local" <> Date: Tue, 28 Aug 2007 01:02:57 -0600 Subject: [PATCH 60/90] Post-merge fixes --- sql/ha_partition.cc | 7 ------- sql/mysqld.cc | 9 +++++---- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index 26f1419fa07..42cbaa1cdb0 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -5601,13 +5601,6 @@ int ha_partition::indexes_are_disabled(void) } -void ha_partition::column_bitmaps_signal() -{ - handler::column_bitmaps_signal(); - bitmap_union(table->read_set, &m_part_info->full_part_field_set); -} - - /**************************************************************************** MODULE Partition Share ****************************************************************************/ diff --git a/sql/mysqld.cc b/sql/mysqld.cc index b59e9225ef7..6ea1cf111bb 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -746,14 +746,16 @@ static void close_connections(void) (void) pthread_mutex_lock(&LOCK_manager); if (manager_thread_in_use) { - DBUG_PRINT("quit",("killing manager thread: 0x%lx",manager_thread)); + DBUG_PRINT("quit", ("killing manager thread: 0x%lx", + (ulong)manager_thread)); (void) pthread_cond_signal(&COND_manager); } (void) pthread_mutex_unlock(&LOCK_manager); /* kill connection thread */ #if !defined(__WIN__) && !defined(__NETWARE__) - DBUG_PRINT("quit",("waiting for select thread: 0x%lx",select_thread)); + DBUG_PRINT("quit", ("waiting for select thread: 0x%lx", + (ulong) select_thread)); (void) pthread_mutex_lock(&LOCK_thread_count); while (select_thread_in_use) @@ -5087,8 +5089,7 @@ enum options_mysqld OPT_SECURE_FILE_PRIV, OPT_MIN_EXAMINED_ROW_LIMIT, OPT_LOG_SLOW_SLAVE_STATEMENTS, - OPT_OLD_MODE, - OPT_KEEP_FILES_ON_CREATE + OPT_OLD_MODE }; From c55627e9e2d046bf2dac02d72fdc42f31e6153b5 Mon Sep 17 00:00:00 2001 From: "rafal@quant.(none)" <> Date: Tue, 28 Aug 2007 10:14:45 +0200 Subject: [PATCH 61/90] BUG#21842: Exclude Rows_log_event members used in event application if not compiled as a replication server - a fix from rpl clone now applied to 5.1.22 tree. --- sql/log_event.cc | 25 +++++++++++++++---------- sql/log_event.h | 10 +++++----- 2 files changed, 20 insertions(+), 15 deletions(-) diff --git a/sql/log_event.cc b/sql/log_event.cc index cfac7df21a8..deaa9ef6b30 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -5653,9 +5653,10 @@ Rows_log_event::Rows_log_event(THD *thd_arg, TABLE *tbl_arg, ulong tid, m_table(tbl_arg), m_table_id(tid), m_width(tbl_arg ? tbl_arg->s->fields : 1), - m_rows_buf(0), m_rows_cur(0), m_rows_end(0), - m_curr_row(NULL), m_curr_row_end(NULL), - m_flags(0), m_key(NULL) + m_rows_buf(0), m_rows_cur(0), m_rows_end(0), m_flags(0) +#ifdef HAVE_REPLICATION + ,m_key(NULL), m_curr_row(NULL), m_curr_row_end(NULL) +#endif { /* We allow a special form of dummy event when the table, and cols @@ -5697,10 +5698,13 @@ Rows_log_event::Rows_log_event(const char *buf, uint event_len, *description_event) : Log_event(buf, description_event), m_row_count(0), +#ifndef MYSQL_CLIENT m_table(NULL), - m_rows_buf(0), m_rows_cur(0), m_rows_end(0), - m_curr_row(NULL), m_curr_row_end(NULL), - m_key(NULL) +#endif + m_table_id(0), m_rows_buf(0), m_rows_cur(0), m_rows_end(0) +#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) + ,m_key(NULL), m_curr_row(NULL), m_curr_row_end(NULL) +#endif { DBUG_ENTER("Rows_log_event::Rows_log_event(const char*,...)"); uint8 const common_header_len= description_event->common_header_len; @@ -5789,7 +5793,9 @@ Rows_log_event::Rows_log_event(const char *buf, uint event_len, m_rows_buf= (uchar*) my_malloc(data_size, MYF(MY_WME)); if (likely((bool)m_rows_buf)) { +#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) m_curr_row= m_rows_buf; +#endif m_rows_end= m_rows_buf + data_size; m_rows_cur= m_rows_end; memcpy(m_rows_buf, ptr_rows_data, data_size); @@ -6187,8 +6193,8 @@ int Rows_log_event::do_apply_event(RELAY_LOG_INFO const *rli) } // if (table) /* - We need to delay this clear until the table def stored in m_table_def is no - longer needed. It is used in unpack_current_row(). + We need to delay this clear until here bacause unpack_current_row() uses + master-side table definitions stored in rli. */ if (rli->tables_to_lock && get_flags(STMT_END_F)) const_cast(rli)->clear_tables_to_lock(); @@ -7825,8 +7831,7 @@ Delete_rows_log_event::do_before_row_operations(const Slave_reporting_capability m_table->s->primary_key < MAX_KEY) { /* - We don't need to allocate any memory for m_after_image and - m_key since they are not used. + We don't need to allocate any memory for m_key since it is not used. */ return 0; } diff --git a/sql/log_event.h b/sql/log_event.h index 064d13b3e62..5450048bee2 100644 --- a/sql/log_event.h +++ b/sql/log_event.h @@ -2294,15 +2294,15 @@ protected: uchar *m_rows_cur; /* One-after the end of the data */ uchar *m_rows_end; /* One-after the end of the allocated space */ - const uchar *m_curr_row; /* Start of the row being processed */ - const uchar *m_curr_row_end; /* One-after the end of the current row */ - - flag_set m_flags; /* Flags for row-level events */ - uchar *m_key; /* Buffer to keep key value during searches */ + flag_set m_flags; /* Flags for row-level events */ /* helper functions */ #if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) + const uchar *m_curr_row; /* Start of the row being processed */ + const uchar *m_curr_row_end; /* One-after the end of the current row */ + uchar *m_key; /* Buffer to keep key value during searches */ + int find_row(const RELAY_LOG_INFO *const); int write_row(const RELAY_LOG_INFO *const, const bool); From 394d9a0e55d25e521b79099dc9679b6a515902f4 Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.(none)" <> Date: Tue, 28 Aug 2007 10:35:55 +0200 Subject: [PATCH 62/90] Import yaSSL version 1.7.2 - Fix bug#27265 - Support for fixing bug#18441 --- extra/yassl/include/openssl/crypto.h | 1 + extra/yassl/include/openssl/des_old.h | 1 + extra/yassl/include/openssl/evp.h | 10 ++++++++++ extra/yassl/include/openssl/hmac.h | 1 + extra/yassl/include/openssl/objects.h | 1 + extra/yassl/include/openssl/prefix_ssl.h | 3 +++ extra/yassl/include/openssl/sha.h | 1 + extra/yassl/include/openssl/ssl.h | 3 ++- extra/yassl/include/yassl_int.hpp | 2 +- extra/yassl/src/handshake.cpp | 4 ++++ extra/yassl/src/socket_wrapper.cpp | 4 ---- extra/yassl/src/ssl.cpp | 6 ++++++ extra/yassl/src/yassl_int.cpp | 1 + extra/yassl/taocrypt/src/coding.cpp | 5 +++-- extra/yassl/taocrypt/src/crypto.cpp | 5 +++++ 15 files changed, 40 insertions(+), 8 deletions(-) create mode 100644 extra/yassl/include/openssl/des_old.h create mode 100644 extra/yassl/include/openssl/evp.h create mode 100644 extra/yassl/include/openssl/hmac.h create mode 100644 extra/yassl/include/openssl/objects.h create mode 100644 extra/yassl/include/openssl/sha.h diff --git a/extra/yassl/include/openssl/crypto.h b/extra/yassl/include/openssl/crypto.h index 288990e1318..f53e5231027 100644 --- a/extra/yassl/include/openssl/crypto.h +++ b/extra/yassl/include/openssl/crypto.h @@ -9,6 +9,7 @@ const char* SSLeay_version(int type); +#define SSLEAY_NUMBER_DEFINED #define SSLEAY_VERSION 0x0900L #define SSLEAY_VERSION_NUMBER SSLEAY_VERSION diff --git a/extra/yassl/include/openssl/des_old.h b/extra/yassl/include/openssl/des_old.h new file mode 100644 index 00000000000..40e8fbc02af --- /dev/null +++ b/extra/yassl/include/openssl/des_old.h @@ -0,0 +1 @@ +/* des_old.h for openvn */ diff --git a/extra/yassl/include/openssl/evp.h b/extra/yassl/include/openssl/evp.h new file mode 100644 index 00000000000..1d66b08df46 --- /dev/null +++ b/extra/yassl/include/openssl/evp.h @@ -0,0 +1,10 @@ +/* evp.h for openSSL */ + +#ifndef SSLEAY_NUMBER_DEFINED +#define SSLEAY_NUMBER_DEFINED + +/* for OpenVPN */ +#define SSLEAY_VERSION_NUMBER 0x0090700f + + +#endif /* SSLEAY_NUMBER_DEFINED */ diff --git a/extra/yassl/include/openssl/hmac.h b/extra/yassl/include/openssl/hmac.h new file mode 100644 index 00000000000..a2eae4c08c1 --- /dev/null +++ b/extra/yassl/include/openssl/hmac.h @@ -0,0 +1 @@ +/* hmac.h for openvpn */ diff --git a/extra/yassl/include/openssl/objects.h b/extra/yassl/include/openssl/objects.h new file mode 100644 index 00000000000..99f2326e51b --- /dev/null +++ b/extra/yassl/include/openssl/objects.h @@ -0,0 +1 @@ +/* objects.h for openvpn */ diff --git a/extra/yassl/include/openssl/prefix_ssl.h b/extra/yassl/include/openssl/prefix_ssl.h index dc6e3ef81f0..3a3a8c26c9c 100644 --- a/extra/yassl/include/openssl/prefix_ssl.h +++ b/extra/yassl/include/openssl/prefix_ssl.h @@ -30,6 +30,7 @@ #define SSL_CTX_new yaSSL_CTX_new #define SSL_new yaSSL_new #define SSL_set_fd yaSSL_set_fd +#define SSL_get_fd yaSSL_get_fd #define SSL_connect yaSSL_connect #define SSL_write yaSSL_write #define SSL_read yaSSL_read @@ -91,6 +92,8 @@ #define SSL_set_rfd yaSSL_set_rfd #define SSL_set_wfd yaSSL_set_wfd #define SSL_set_shutdown yaSSL_set_shutdown +#define SSL_set_quiet_shutdown yaSSL_set_quiet_shutdown +#define SSL_get_quiet_shutdown yaSSL_get_quiet_shutdown #define SSL_want_read yaSSL_want_read #define SSL_want_write yaSSL_want_write #define SSL_pending yaSSL_pending diff --git a/extra/yassl/include/openssl/sha.h b/extra/yassl/include/openssl/sha.h new file mode 100644 index 00000000000..bb487c05c2e --- /dev/null +++ b/extra/yassl/include/openssl/sha.h @@ -0,0 +1 @@ +/* sha.h for openvpn */ diff --git a/extra/yassl/include/openssl/ssl.h b/extra/yassl/include/openssl/ssl.h index efd0dec75b6..c0b87f804ad 100644 --- a/extra/yassl/include/openssl/ssl.h +++ b/extra/yassl/include/openssl/ssl.h @@ -34,7 +34,7 @@ #include "rsa.h" -#define YASSL_VERSION "1.6.5" +#define YASSL_VERSION "1.7.2" #if defined(__cplusplus) @@ -201,6 +201,7 @@ typedef int YASSL_SOCKET_T; SSL_CTX* SSL_CTX_new(SSL_METHOD*); SSL* SSL_new(SSL_CTX*); int SSL_set_fd (SSL*, YASSL_SOCKET_T); +YASSL_SOCKET_T SSL_get_fd(const SSL*); int SSL_connect(SSL*); int SSL_write(SSL*, const void*, int); int SSL_read(SSL*, void*, int); diff --git a/extra/yassl/include/yassl_int.hpp b/extra/yassl/include/yassl_int.hpp index b7bd35f5fa2..b207f0bffbd 100644 --- a/extra/yassl/include/yassl_int.hpp +++ b/extra/yassl/include/yassl_int.hpp @@ -584,7 +584,7 @@ class SSL { Socket socket_; // socket wrapper Buffers buffers_; // buffered handshakes and data Log log_; // logger - bool quietShutdown_; // shutdown without handshakes + bool quietShutdown_; // optimization variables bool has_data_; // buffered data ready? diff --git a/extra/yassl/src/handshake.cpp b/extra/yassl/src/handshake.cpp index 0cd0dfe9c7c..1d5a95820bb 100644 --- a/extra/yassl/src/handshake.cpp +++ b/extra/yassl/src/handshake.cpp @@ -719,6 +719,10 @@ int DoProcessReply(SSL& ssl) // add new data uint read = ssl.useSocket().receive(buffer.get_buffer() + buffSz, ready); + if (read == static_cast(-1)) { + ssl.SetError(receive_error); + return 0; + } buffer.add_size(read); uint offset = 0; const MessageFactory& mf = ssl.getFactory().getMessage(); diff --git a/extra/yassl/src/socket_wrapper.cpp b/extra/yassl/src/socket_wrapper.cpp index d53a109d70e..eee5d47377f 100644 --- a/extra/yassl/src/socket_wrapper.cpp +++ b/extra/yassl/src/socket_wrapper.cpp @@ -114,8 +114,6 @@ uint Socket::send(const byte* buf, unsigned int sz, int flags) const const byte* pos = buf; const byte* end = pos + sz; - assert(socket_ != INVALID_SOCKET); - while (pos != end) { int sent = ::send(socket_, reinterpret_cast(pos), static_cast(end - pos), flags); @@ -132,7 +130,6 @@ uint Socket::send(const byte* buf, unsigned int sz, int flags) const uint Socket::receive(byte* buf, unsigned int sz, int flags) { - assert(socket_ != INVALID_SOCKET); wouldBlock_ = false; int recvd = ::recv(socket_, reinterpret_cast(buf), sz, flags); @@ -163,7 +160,6 @@ bool Socket::wait() void Socket::shutDown(int how) { - assert(socket_ != INVALID_SOCKET); shutdown(socket_, how); } diff --git a/extra/yassl/src/ssl.cpp b/extra/yassl/src/ssl.cpp index c3d580a93ab..f09a43be56e 100644 --- a/extra/yassl/src/ssl.cpp +++ b/extra/yassl/src/ssl.cpp @@ -239,6 +239,12 @@ int SSL_set_fd(SSL* ssl, YASSL_SOCKET_T fd) } +YASSL_SOCKET_T SSL_get_fd(const SSL* ssl) +{ + return ssl->getSocket().get_fd(); +} + + int SSL_connect(SSL* ssl) { if (ssl->GetError() == YasslError(SSL_ERROR_WANT_READ)) diff --git a/extra/yassl/src/yassl_int.cpp b/extra/yassl/src/yassl_int.cpp index f5ab2f200a5..0b6cb89e77e 100644 --- a/extra/yassl/src/yassl_int.cpp +++ b/extra/yassl/src/yassl_int.cpp @@ -773,6 +773,7 @@ void SSL::SetError(YasslError ye) // TODO: add string here } + // set the quiet shutdown mode (close_nofiy not sent or received on shutdown) void SSL::SetQuietShutdown(bool mode) { diff --git a/extra/yassl/taocrypt/src/coding.cpp b/extra/yassl/taocrypt/src/coding.cpp index 55fe31831e3..7a9d50aaac9 100644 --- a/extra/yassl/taocrypt/src/coding.cpp +++ b/extra/yassl/taocrypt/src/coding.cpp @@ -107,11 +107,12 @@ void HexDecoder::Decode() // sanity checks assert( b < sizeof(hexDecode)/sizeof(hexDecode[0]) ); assert( b2 < sizeof(hexDecode)/sizeof(hexDecode[0]) ); - assert( b != bad && b2 != bad ); b = hexDecode[b]; b2 = hexDecode[b2]; + assert( b != bad && b2 != bad ); + decoded_[i++] = (b << 4) | b2; bytes -= 2; } @@ -184,7 +185,7 @@ void Base64Decoder::Decode() { word32 bytes = coded_.size(); word32 plainSz = bytes - ((bytes + (pemLineSz - 1)) / pemLineSz); - plainSz = ((plainSz * 3) / 4) + 3; + plainSz = (plainSz * 3 + 3) / 4; decoded_.New(plainSz); word32 i = 0; diff --git a/extra/yassl/taocrypt/src/crypto.cpp b/extra/yassl/taocrypt/src/crypto.cpp index 82d3b853084..90d406bf0c2 100644 --- a/extra/yassl/taocrypt/src/crypto.cpp +++ b/extra/yassl/taocrypt/src/crypto.cpp @@ -26,6 +26,11 @@ extern "C" { // locking handled internally by library char CRYPTO_lock() { return 0;} char CRYPTO_add_lock() { return 0;} + + + // for openvpn, test are the signatures they use + char EVP_CIPHER_CTX_init() { return 0; } + char CRYPTO_mem_ctrl() { return 0; } } // extern "C" From 88b8ad10c591ef7c628aeef84d78f847204737c3 Mon Sep 17 00:00:00 2001 From: "rafal@quant.(none)" <> Date: Tue, 28 Aug 2007 10:37:29 +0200 Subject: [PATCH 63/90] A fix for handling endianess in Field_blob::unpack(). --- sql/field.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/field.cc b/sql/field.cc index ed1877fca78..816f4e68957 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -7662,7 +7662,7 @@ const uchar *Field_blob::unpack(uchar *to, const uchar *Field_blob::unpack(uchar *to, const uchar *from) { - uint32 length=get_length(from); + uint32 length=get_length(from,TRUE); #ifdef WORDS_BIGENDIAN if (!table->s->db_low_byte_first) { From ec421a02a9415cb074cf9817257193608969b20b Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.(none)" <> Date: Tue, 28 Aug 2007 11:34:43 +0200 Subject: [PATCH 64/90] Bug#28812 rpl_ssl fails due to assert in extra/yassl/src/socket_wrapper.cpp:117 - Merge sslaccept and sslconnect. - Atomically "reset" vio to VIO_TYPE_SSL when the SSL connection has succeeded, this avoids having to revert anything and thus protects against "close_active_vio" in the middle. - Add some variance to the testcase --- mysql-test/t/rpl_ssl.test | 15 ++++ vio/viossl.c | 142 ++++++++++++-------------------------- 2 files changed, 61 insertions(+), 96 deletions(-) diff --git a/mysql-test/t/rpl_ssl.test b/mysql-test/t/rpl_ssl.test index d08004cb00b..bf4dcbf8af0 100644 --- a/mysql-test/t/rpl_ssl.test +++ b/mysql-test/t/rpl_ssl.test @@ -41,24 +41,39 @@ select * from t1; # Do the same thing a number of times disable_query_log; +disable_result_log; let $i= 100; while ($i) { start slave; connection master; insert into t1 values (NULL); + select * from t1; # Some variance connection slave; + select * from t1; # Some variance stop slave; dec $i; } start slave; enable_query_log; +enable_result_log; connection master; insert into t1 values (NULL); +let $master_count= `select count(*) from t1`; + sync_slave_with_master; --source include/wait_for_slave_to_start.inc --replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR $MASTER_MYPORT MASTER_MYPORT --replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 # query_vertical show slave status; +let $slave_count= `select count(*) from t1`; + +if (`select $slave_count != $master_count`) +{ + echo master and slave differed in number of rows; + echo master: $master_count; + echo slave: $slave_count; +} + --echo End of 5.0 tests diff --git a/vio/viossl.c b/vio/viossl.c index 861989136d3..c178d9e9d1b 100644 --- a/vio/viossl.c +++ b/vio/viossl.c @@ -172,78 +172,10 @@ void vio_ssl_delete(Vio *vio) vio_delete(vio); } - int sslaccept(struct st_VioSSLFd *ptr, Vio *vio, long timeout) { - SSL *ssl; - my_bool unused; - my_bool net_blocking; - enum enum_vio_type old_type; DBUG_ENTER("sslaccept"); - DBUG_PRINT("enter", ("sd: %d ptr: 0x%lx, timeout: %ld", - vio->sd, (long) ptr, timeout)); - - old_type= vio->type; - net_blocking= vio_is_blocking(vio); - vio_blocking(vio, 1, &unused); /* Must be called before reset */ - vio_reset(vio, VIO_TYPE_SSL, vio->sd, 0, FALSE); - - if (!(ssl= SSL_new(ptr->ssl_context))) - { - DBUG_PRINT("error", ("SSL_new failure")); - report_errors(ssl); - vio_reset(vio, old_type,vio->sd,0,FALSE); - vio_blocking(vio, net_blocking, &unused); - DBUG_RETURN(1); - } - vio->ssl_arg= (void*)ssl; - DBUG_PRINT("info", ("ssl: 0x%lx timeout: %ld", (long) ssl, timeout)); - SSL_clear(ssl); - SSL_SESSION_set_timeout(SSL_get_session(ssl), timeout); - SSL_set_fd(ssl, vio->sd); - if (SSL_accept(ssl) < 1) - { - DBUG_PRINT("error", ("SSL_accept failure")); - report_errors(ssl); - SSL_free(ssl); - vio->ssl_arg= 0; - vio_reset(vio, old_type,vio->sd,0,FALSE); - vio_blocking(vio, net_blocking, &unused); - DBUG_RETURN(1); - } - -#ifndef DBUG_OFF - { - char buf[1024]; - X509 *client_cert; - DBUG_PRINT("info",("cipher_name= '%s'", SSL_get_cipher_name(ssl))); - - if ((client_cert= SSL_get_peer_certificate (ssl))) - { - DBUG_PRINT("info",("Client certificate:")); - X509_NAME_oneline (X509_get_subject_name (client_cert), - buf, sizeof(buf)); - DBUG_PRINT("info",("\t subject: %s", buf)); - - X509_NAME_oneline (X509_get_issuer_name (client_cert), - buf, sizeof(buf)); - DBUG_PRINT("info",("\t issuer: %s", buf)); - - X509_free (client_cert); - } - else - DBUG_PRINT("info",("Client does not have certificate.")); - - if (SSL_get_shared_ciphers(ssl, buf, sizeof(buf))) - { - DBUG_PRINT("info",("shared_ciphers: '%s'", buf)); - } - else - DBUG_PRINT("info",("no shared ciphers!")); - } -#endif - - DBUG_RETURN(0); + DBUG_RETURN(sslconnect(ptr, vio, timeout)); } @@ -251,57 +183,75 @@ int sslconnect(struct st_VioSSLFd *ptr, Vio *vio, long timeout) { SSL *ssl; my_bool unused; - my_bool net_blocking; - enum enum_vio_type old_type; + my_bool was_blocking; DBUG_ENTER("sslconnect"); - DBUG_PRINT("enter", ("sd: %d ptr: 0x%lx ctx: 0x%lx", - vio->sd, (long) ptr, (long) ptr->ssl_context)); + DBUG_PRINT("enter", ("ptr: 0x%lx, sd: %d ctx: 0x%lx", + (long) ptr, vio->sd, (long) ptr->ssl_context)); + + /* Set socket to blocking if not already set */ + vio_blocking(vio, 1, &was_blocking); - old_type= vio->type; - net_blocking= vio_is_blocking(vio); - vio_blocking(vio, 1, &unused); /* Must be called before reset */ - vio_reset(vio, VIO_TYPE_SSL, vio->sd, 0, FALSE); if (!(ssl= SSL_new(ptr->ssl_context))) { DBUG_PRINT("error", ("SSL_new failure")); report_errors(ssl); - vio_reset(vio, old_type, vio->sd, 0, FALSE); - vio_blocking(vio, net_blocking, &unused); + vio_blocking(vio, was_blocking, &unused); DBUG_RETURN(1); } - vio->ssl_arg= (void*)ssl; DBUG_PRINT("info", ("ssl: 0x%lx timeout: %ld", (long) ssl, timeout)); SSL_clear(ssl); SSL_SESSION_set_timeout(SSL_get_session(ssl), timeout); SSL_set_fd(ssl, vio->sd); - if (SSL_connect(ssl) < 1) + + /* + SSL_do_handshake will select between SSL_connect + or SSL_accept depending on server or client side + */ + if (SSL_do_handshake(ssl) < 1) { - DBUG_PRINT("error", ("SSL_connect failure")); + DBUG_PRINT("error", ("SSL_do_handshake failure")); report_errors(ssl); SSL_free(ssl); - vio->ssl_arg= 0; - vio_reset(vio, old_type, vio->sd, 0, FALSE); - vio_blocking(vio, net_blocking, &unused); + vio_blocking(vio, was_blocking, &unused); DBUG_RETURN(1); } + + /* + Connection succeeded. Install new function handlers, + change type, set sd to the fd used when connecting + and set pointer to the SSL structure + */ + vio_reset(vio, VIO_TYPE_SSL, SSL_get_fd(ssl), 0, 0); + vio->ssl_arg= (void*)ssl; + #ifndef DBUG_OFF { - X509 *server_cert; - DBUG_PRINT("info",("cipher_name: '%s'" , SSL_get_cipher_name(ssl))); + /* Print some info about the peer */ + X509 *cert; + char buf[512]; - if ((server_cert= SSL_get_peer_certificate (ssl))) + DBUG_PRINT("info",("SSL connection succeeded")); + DBUG_PRINT("info",("Using cipher: '%s'" , SSL_get_cipher_name(ssl))); + + if ((cert= SSL_get_peer_certificate (ssl))) { - char buf[256]; - DBUG_PRINT("info",("Server certificate:")); - X509_NAME_oneline(X509_get_subject_name(server_cert), buf, sizeof(buf)); - DBUG_PRINT("info",("\t subject: %s", buf)); - X509_NAME_oneline (X509_get_issuer_name(server_cert), buf, sizeof(buf)); - DBUG_PRINT("info",("\t issuer: %s", buf)); - X509_free (server_cert); + DBUG_PRINT("info",("Peer certificate:")); + X509_NAME_oneline(X509_get_subject_name(cert), buf, sizeof(buf)); + DBUG_PRINT("info",("\t subject: '%s'", buf)); + X509_NAME_oneline(X509_get_issuer_name(cert), buf, sizeof(buf)); + DBUG_PRINT("info",("\t issuer: '%s'", buf)); + X509_free(cert); } else - DBUG_PRINT("info",("Server does not have certificate.")); + DBUG_PRINT("info",("Peer does not have certificate.")); + + if (SSL_get_shared_ciphers(ssl, buf, sizeof(buf))) + { + DBUG_PRINT("info",("shared_ciphers: '%s'", buf)); + } + else + DBUG_PRINT("info",("no shared ciphers!")); } #endif From ccfbae831ffac628b2e844ae4eeaff724aa958e5 Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.(none)" <> Date: Tue, 28 Aug 2007 11:39:29 +0200 Subject: [PATCH 65/90] Fix warning --- client/mysqltest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/mysqltest.c b/client/mysqltest.c index 3b83fdb56fc..e851c9dac89 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -1987,7 +1987,7 @@ void var_set_query_get_value(struct st_command *command, VAR *var) while ((row= mysql_fetch_row(res))) { - if (++rows == (ulong) row_no) + if (++rows == row_no) { DBUG_PRINT("info", ("At row %ld, column %d is '%s'", From 26afeffa748765283392c65e85732f95555b0048 Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.(none)" <> Date: Tue, 28 Aug 2007 12:41:25 +0200 Subject: [PATCH 66/90] Temp disable of icheck --- include/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/Makefile.am b/include/Makefile.am index 2775932f46d..8335da36e93 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -15,7 +15,7 @@ # Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, # MA 02111-1307, USA -BUILT_SOURCES = $(HEADERS_GEN) link_sources abi_check +BUILT_SOURCES = $(HEADERS_GEN) link_sources HEADERS_GEN = mysql_version.h my_config.h HEADERS_ABI = mysql.h mysql_com.h mysql_time.h \ my_list.h my_alloc.h typelib.h mysql/plugin.h From 4a013e295d5fffcee7af6b6e33c2bb87c1de9a27 Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.(none)" <> Date: Tue, 28 Aug 2007 15:32:13 +0200 Subject: [PATCH 67/90] Move "analyze_testcase_failure" to mysqltest(since it knows best when to perform this analyzis) --- client/mysqltest.c | 69 ++++++++++++++++++++++++++++++++++++ mysql-test/mysql-test-run.pl | 54 ---------------------------- 2 files changed, 69 insertions(+), 54 deletions(-) diff --git a/client/mysqltest.c b/client/mysqltest.c index 693c6d0fb65..23a23dc5719 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -604,6 +604,71 @@ void do_eval(DYNAMIC_STRING *query_eval, const char *query, } +/* + Run query and dump the result to stdout in vertical format + + NOTE! This function should be safe to call when an error + has occured and thus any further errors will be ignored(although logged) + + SYNOPSIS + show_query + mysql - connection to use + query - query to run + +*/ + +static void show_query(MYSQL* mysql, const char* query) +{ + MYSQL_RES* res; + DBUG_ENTER("show_query"); + + if (!mysql) + DBUG_VOID_RETURN; + + if (mysql_query(mysql, query)) + { + log_msg("Error running query '%s': %d %s", + query, mysql_errno(mysql), mysql_error(mysql)); + DBUG_VOID_RETURN; + } + + if ((res= mysql_store_result(mysql)) == NULL) + { + /* No result set returned */ + DBUG_VOID_RETURN; + } + + { + MYSQL_ROW row; + unsigned int i; + unsigned int row_num= 0; + unsigned int num_fields= mysql_num_fields(res); + MYSQL_FIELD *fields= mysql_fetch_fields(res); + + fprintf(stderr, "=== %s ===\n", query); + while ((row= mysql_fetch_row(res))) + { + unsigned long *lengths= mysql_fetch_lengths(res); + row_num++; + + fprintf(stderr, "---- %d. ----\n", row_num); + for(i= 0; i < num_fields; i++) + { + fprintf(stderr, "%s\t%.*s\n", + fields[i].name, + (int)lengths[i], row[i] ? row[i] : "NULL"); + } + } + for (i= 0; i < strlen(query)+8; i++) + fprintf(stderr, "="); + fprintf(stderr, "\n\n"); + } + mysql_free_result(res); + + DBUG_VOID_RETURN; +} + + /* Show any warnings just before the error. Since the last error is added to the warning stack, only print @@warning_count-1 warnings. @@ -3150,7 +3215,11 @@ wait_for_position: SLAVE has been issued ? */ if (tries++ == 30) + { + show_query(mysql, "SHOW MASTER STATUS"); + show_query(mysql, "SHOW SLAVE STATUS"); die("could not sync with master ('%s' returned NULL)", query_buf); + } sleep(1); /* So at most we will wait 30 seconds and make 31 tries */ mysql_free_result(res); goto wait_for_position; diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 269bfbcb40f..48a85f020ae 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -3361,56 +3361,6 @@ sub find_testcase_skipped_reason($) } -sub analyze_testcase_failure_sync_with_master($) -{ - my ($tinfo)= @_; - - my $args; - mtr_init_args(\$args); - - mtr_add_arg($args, "--no-defaults"); - mtr_add_arg($args, "--silent"); - mtr_add_arg($args, "--skip-safemalloc"); - mtr_add_arg($args, "--tmpdir=%s", $opt_tmpdir); - mtr_add_arg($args, "--character-sets-dir=%s", $path_charsetsdir); - - mtr_add_arg($args, "--socket=%s", $master->[0]->{'path_sock'}); - mtr_add_arg($args, "--port=%d", $master->[0]->{'port'}); - mtr_add_arg($args, "--database=test"); - mtr_add_arg($args, "--user=%s", $opt_user); - mtr_add_arg($args, "--password="); - - # Run the test file and append output to log file - mtr_run_test($exe_mysqltest,$args, - "include/analyze_failure_sync_with_master.test", - "$path_timefile", "$path_timefile","", - { append_log_file => 1 }); - -} - -sub analyze_testcase_failure($) -{ - my ($tinfo)= @_; - - # Open mysqltest.log - my $F= IO::File->new($path_timefile) - or return; - - while ( my $line= <$F> ) - { - # Look for "mysqltest: At line nnn: - if ( $line =~ /mysqltest: At line [0-9]*: (.*)/ ) - { - my $error= $1; - # Look for "could not sync with master" - if ( $error =~ /could not sync with master/ ) - { - analyze_testcase_failure_sync_with_master($tinfo); - } - } - } -} - ############################################################################## # # Run a single test case @@ -3503,10 +3453,6 @@ sub run_testcase ($) { } elsif ( $res == 1 ) { - if ( $opt_force ) - { - analyze_testcase_failure($tinfo); - } # Test case failure reported by mysqltest report_failure_and_restart($tinfo); } From 440caf3e10c6564c9d24d879f4508b5da4233520 Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.(none)" <> Date: Tue, 28 Aug 2007 15:32:44 +0200 Subject: [PATCH 68/90] Remove unportable constructs in loaddata.test --- mysql-test/r/bdb_notembedded.result | 35 -------------------------- mysql-test/t/bdb_notembedded.test | 38 ----------------------------- mysql-test/t/loaddata.test | 22 ++++++++--------- 3 files changed, 10 insertions(+), 85 deletions(-) delete mode 100644 mysql-test/r/bdb_notembedded.result delete mode 100644 mysql-test/t/bdb_notembedded.test diff --git a/mysql-test/r/bdb_notembedded.result b/mysql-test/r/bdb_notembedded.result deleted file mode 100644 index 14cb5fad915..00000000000 --- a/mysql-test/r/bdb_notembedded.result +++ /dev/null @@ -1,35 +0,0 @@ -set autocommit=1; -reset master; -create table bug16206 (a int); -insert into bug16206 values(1); -start transaction; -insert into bug16206 values(2); -commit; -show binlog events; -Log_name Pos Event_type Server_id End_log_pos Info -f n Format_desc 1 n Server ver: VERSION, Binlog ver: 4 -f n Query 1 n use `test`; create table bug16206 (a int) -f n Query 1 n use `test`; insert into bug16206 values(1) -f n Query 1 n use `test`; insert into bug16206 values(2) -drop table bug16206; -reset master; -create table bug16206 (a int) engine= bdb; -insert into bug16206 values(0); -insert into bug16206 values(1); -start transaction; -insert into bug16206 values(2); -commit; -insert into bug16206 values(3); -show binlog events; -Log_name Pos Event_type Server_id End_log_pos Info -f n Format_desc 1 n Server ver: VERSION, Binlog ver: 4 -f n Query 1 n use `test`; create table bug16206 (a int) engine= bdb -f n Query 1 n use `test`; insert into bug16206 values(0) -f n Query 1 n use `test`; insert into bug16206 values(1) -f n Query 1 n use `test`; BEGIN -f n Query 1 n use `test`; insert into bug16206 values(2) -f n Query 1 n use `test`; COMMIT -f n Query 1 n use `test`; insert into bug16206 values(3) -drop table bug16206; -set autocommit=0; -End of 5.0 tests diff --git a/mysql-test/t/bdb_notembedded.test b/mysql-test/t/bdb_notembedded.test deleted file mode 100644 index 24e64ebbfb2..00000000000 --- a/mysql-test/t/bdb_notembedded.test +++ /dev/null @@ -1,38 +0,0 @@ --- source include/not_embedded.inc --- source include/have_bdb.inc - -# -# Bug #16206: Superfluous COMMIT event in binlog when updating BDB in autocommit mode -# -set autocommit=1; - -let $VERSION=`select version()`; - -reset master; -create table bug16206 (a int); -insert into bug16206 values(1); -start transaction; -insert into bug16206 values(2); -commit; ---replace_result $VERSION VERSION ---replace_column 1 f 2 n 5 n -show binlog events; -drop table bug16206; - -reset master; -create table bug16206 (a int) engine= bdb; -insert into bug16206 values(0); -insert into bug16206 values(1); -start transaction; -insert into bug16206 values(2); -commit; -insert into bug16206 values(3); ---replace_result $VERSION VERSION ---replace_column 1 f 2 n 5 n -show binlog events; -drop table bug16206; - -set autocommit=0; - - ---echo End of 5.0 tests diff --git a/mysql-test/t/loaddata.test b/mysql-test/t/loaddata.test index 260e760e7b3..9eb92015399 100644 --- a/mysql-test/t/loaddata.test +++ b/mysql-test/t/loaddata.test @@ -43,7 +43,7 @@ delete from t1; eval load data infile '$MYSQLTEST_VARDIR/tmp/t1' into table t1; enable_query_log; select * from t1; ---exec rm $MYSQLTEST_VARDIR/tmp/t1 +remove_file $MYSQLTEST_VARDIR/tmp/t1; disable_query_log; eval SELECT * INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/t1' @@ -54,7 +54,7 @@ eval load data infile '$MYSQLTEST_VARDIR/tmp/t1' into table t1 FIELDS TERMINATED BY '' OPTIONALLY ENCLOSED BY '' LINES TERMINATED BY '\r\n'; enable_query_log; select * from t1; ---exec rm $MYSQLTEST_VARDIR/tmp/t1 +remove_file $MYSQLTEST_VARDIR/tmp/t1; SET @@SQL_MODE=@OLD_SQL_MODE; drop table t1; @@ -89,17 +89,16 @@ INSERT INTO t1 (c1) VALUES ('.r.'), ('.rr.'), ('.rrr.'), ('.rrrr.'); SELECT * FROM t1; ---exec rm -f $MYSQLTEST_VARDIR/tmp/t1 --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR eval SELECT * INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/t1' FIELDS ENCLOSED BY 'r' FROM t1; ---exec cat $MYSQLTEST_VARDIR/tmp/t1 +cat_file $MYSQLTEST_VARDIR/tmp/t1; --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/tmp/t1' INTO TABLE t2 FIELDS ENCLOSED BY 'r'; SELECT t1.id, c1, c2 FROM t1 LEFT JOIN t2 ON t1.id=t2.id WHERE c1 != c2; SELECT t1.id, c1, c2 FROM t1 RIGHT JOIN t2 ON t1.id=t2.id WHERE c1 != c2; ---exec rm $MYSQLTEST_VARDIR/tmp/t1 +remove_file $MYSQLTEST_VARDIR/tmp/t1; DROP TABLE t1,t2; # End of 4.1 tests @@ -184,7 +183,7 @@ SET @OLD_SQL_MODE=@@SQL_MODE, @@SQL_MODE=NO_AUTO_VALUE_ON_ZERO; eval load data infile '$MYSQLTEST_VARDIR/tmp/t1' into table t2; enable_query_log; select * from t2; ---exec rm $MYSQLTEST_VARDIR/tmp/t1 +remove_file $MYSQLTEST_VARDIR/tmp/t1; SET @@SQL_MODE=@OLD_SQL_MODE; drop table t1,t2; @@ -200,7 +199,7 @@ eval select * into outfile '$MYSQLTEST_VARDIR/tmp/t2' from t2; eval load data infile '$MYSQLTEST_VARDIR/tmp/t2' into table t1; enable_query_log; select f1 from t1 where f2 <> '0000-00-00 00:00:00' order by f1; ---exec rm $MYSQLTEST_VARDIR/tmp/t2 +remove_file $MYSQLTEST_VARDIR/tmp/t2; delete from t1; disable_query_log; eval SELECT * INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/t2' @@ -210,7 +209,7 @@ eval load data infile '$MYSQLTEST_VARDIR/tmp/t2' into table t1 FIELDS TERMINATED BY '' OPTIONALLY ENCLOSED BY '' LINES TERMINATED BY '\r\n'; enable_query_log; select f1 from t1 where f2 <> '0000-00-00 00:00:00' order by f1; ---exec rm $MYSQLTEST_VARDIR/tmp/t2 +remove_file $MYSQLTEST_VARDIR/tmp/t2; drop table t1,t2; # @@ -223,11 +222,10 @@ CREATE TABLE t1 (c1 INT, c2 TIMESTAMP, c3 REAL, c4 DOUBLE); INSERT INTO t1 (c1, c2, c3, c4) VALUES (10, '1970-02-01 01:02:03', 1.1E-100, 1.1E+100); SELECT * FROM t1; ---exec rm -f $MYSQLTEST_VARDIR/tmp/t1 --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR eval SELECT * INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/t1' FIELDS ENCLOSED BY '-' FROM t1; ---exec cat $MYSQLTEST_VARDIR/tmp/t1 ---exec echo EOF +cat_file $MYSQLTEST_VARDIR/tmp/t1; +echo EOF; TRUNCATE t1; @@ -235,7 +233,7 @@ TRUNCATE t1; eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/tmp/t1' INTO TABLE t1 FIELDS ENCLOSED BY '-'; SELECT * FROM t1; ---exec rm $MYSQLTEST_VARDIR/tmp/t1 +remove_file $MYSQLTEST_VARDIR/tmp/t1; DROP TABLE t1; # End of 5.0 tests From dc4d29bf2341456ea12b8f679b2810ff0754adba Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.(none)" <> Date: Tue, 28 Aug 2007 15:35:42 +0200 Subject: [PATCH 69/90] Remove unportable construct in loaddata.test --- mysql-test/t/loaddata.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/t/loaddata.test b/mysql-test/t/loaddata.test index 58d5ee7bb31..5433d787c14 100644 --- a/mysql-test/t/loaddata.test +++ b/mysql-test/t/loaddata.test @@ -262,6 +262,6 @@ select @@character_set_filesystem; LOAD DATA INFILE 't@002d1' INTO TABLE t1; SELECT * FROM t1; DROP TABLE t1; ---exec rm $MYSQLTEST_VARDIR/master-data/test/t@002d1 +remove_file $MYSQLTEST_VARDIR/master-data/test/t@002d1; SET character_set_filesystem=default; select @@character_set_filesystem; From 397fbd02894cae44dcdee9a1b1bb4b387e2cd09e Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.(none)" <> Date: Tue, 28 Aug 2007 16:44:31 +0200 Subject: [PATCH 70/90] Remove unportable constructs in loaddata.test --- mysql-test/t/loaddata.test | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/mysql-test/t/loaddata.test b/mysql-test/t/loaddata.test index 260e760e7b3..9eb92015399 100644 --- a/mysql-test/t/loaddata.test +++ b/mysql-test/t/loaddata.test @@ -43,7 +43,7 @@ delete from t1; eval load data infile '$MYSQLTEST_VARDIR/tmp/t1' into table t1; enable_query_log; select * from t1; ---exec rm $MYSQLTEST_VARDIR/tmp/t1 +remove_file $MYSQLTEST_VARDIR/tmp/t1; disable_query_log; eval SELECT * INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/t1' @@ -54,7 +54,7 @@ eval load data infile '$MYSQLTEST_VARDIR/tmp/t1' into table t1 FIELDS TERMINATED BY '' OPTIONALLY ENCLOSED BY '' LINES TERMINATED BY '\r\n'; enable_query_log; select * from t1; ---exec rm $MYSQLTEST_VARDIR/tmp/t1 +remove_file $MYSQLTEST_VARDIR/tmp/t1; SET @@SQL_MODE=@OLD_SQL_MODE; drop table t1; @@ -89,17 +89,16 @@ INSERT INTO t1 (c1) VALUES ('.r.'), ('.rr.'), ('.rrr.'), ('.rrrr.'); SELECT * FROM t1; ---exec rm -f $MYSQLTEST_VARDIR/tmp/t1 --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR eval SELECT * INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/t1' FIELDS ENCLOSED BY 'r' FROM t1; ---exec cat $MYSQLTEST_VARDIR/tmp/t1 +cat_file $MYSQLTEST_VARDIR/tmp/t1; --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/tmp/t1' INTO TABLE t2 FIELDS ENCLOSED BY 'r'; SELECT t1.id, c1, c2 FROM t1 LEFT JOIN t2 ON t1.id=t2.id WHERE c1 != c2; SELECT t1.id, c1, c2 FROM t1 RIGHT JOIN t2 ON t1.id=t2.id WHERE c1 != c2; ---exec rm $MYSQLTEST_VARDIR/tmp/t1 +remove_file $MYSQLTEST_VARDIR/tmp/t1; DROP TABLE t1,t2; # End of 4.1 tests @@ -184,7 +183,7 @@ SET @OLD_SQL_MODE=@@SQL_MODE, @@SQL_MODE=NO_AUTO_VALUE_ON_ZERO; eval load data infile '$MYSQLTEST_VARDIR/tmp/t1' into table t2; enable_query_log; select * from t2; ---exec rm $MYSQLTEST_VARDIR/tmp/t1 +remove_file $MYSQLTEST_VARDIR/tmp/t1; SET @@SQL_MODE=@OLD_SQL_MODE; drop table t1,t2; @@ -200,7 +199,7 @@ eval select * into outfile '$MYSQLTEST_VARDIR/tmp/t2' from t2; eval load data infile '$MYSQLTEST_VARDIR/tmp/t2' into table t1; enable_query_log; select f1 from t1 where f2 <> '0000-00-00 00:00:00' order by f1; ---exec rm $MYSQLTEST_VARDIR/tmp/t2 +remove_file $MYSQLTEST_VARDIR/tmp/t2; delete from t1; disable_query_log; eval SELECT * INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/t2' @@ -210,7 +209,7 @@ eval load data infile '$MYSQLTEST_VARDIR/tmp/t2' into table t1 FIELDS TERMINATED BY '' OPTIONALLY ENCLOSED BY '' LINES TERMINATED BY '\r\n'; enable_query_log; select f1 from t1 where f2 <> '0000-00-00 00:00:00' order by f1; ---exec rm $MYSQLTEST_VARDIR/tmp/t2 +remove_file $MYSQLTEST_VARDIR/tmp/t2; drop table t1,t2; # @@ -223,11 +222,10 @@ CREATE TABLE t1 (c1 INT, c2 TIMESTAMP, c3 REAL, c4 DOUBLE); INSERT INTO t1 (c1, c2, c3, c4) VALUES (10, '1970-02-01 01:02:03', 1.1E-100, 1.1E+100); SELECT * FROM t1; ---exec rm -f $MYSQLTEST_VARDIR/tmp/t1 --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR eval SELECT * INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/t1' FIELDS ENCLOSED BY '-' FROM t1; ---exec cat $MYSQLTEST_VARDIR/tmp/t1 ---exec echo EOF +cat_file $MYSQLTEST_VARDIR/tmp/t1; +echo EOF; TRUNCATE t1; @@ -235,7 +233,7 @@ TRUNCATE t1; eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/tmp/t1' INTO TABLE t1 FIELDS ENCLOSED BY '-'; SELECT * FROM t1; ---exec rm $MYSQLTEST_VARDIR/tmp/t1 +remove_file $MYSQLTEST_VARDIR/tmp/t1; DROP TABLE t1; # End of 5.0 tests From 4a7087526f99bf275905cc3085f2fe84deddc0d2 Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.(none)" <> Date: Tue, 28 Aug 2007 16:47:05 +0200 Subject: [PATCH 71/90] Streamline "do_close_connection" and "do_send_quit" Fix typo, "next_con" -> "con" --- client/mysqltest.c | 128 +++++++++++++++++++++------------------------ 1 file changed, 60 insertions(+), 68 deletions(-) diff --git a/client/mysqltest.c b/client/mysqltest.c index 23a23dc5719..b2b579528ae 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -2983,15 +2983,30 @@ void do_diff_files(struct st_command *command) DBUG_VOID_RETURN; } - /* - SYNOPSIS - do_send_quit - command called command - DESCRIPTION - Sends a simple quit command to the server for the named connection. +struct st_connection * find_connection_by_name(const char *name) +{ + struct st_connection *con; + for (con= connections; con < next_con; con++) + { + if (!strcmp(con->name, name)) + { + return con; + } + } + return 0; /* Connection not found */ +} - */ + +/* + SYNOPSIS + do_send_quit + command called command + + DESCRIPTION + Sends a simple quit command to the server for the named connection. + +*/ void do_send_quit(struct st_command *command) { @@ -3002,7 +3017,7 @@ void do_send_quit(struct st_command *command) DBUG_PRINT("enter",("name: '%s'",p)); if (!*p) - die("Missing connection name in do_send_quit"); + die("Missing connection name in send_quit"); name= p; while (*p && !my_isspace(charset_info,*p)) p++; @@ -3011,17 +3026,12 @@ void do_send_quit(struct st_command *command) *p++= 0; command->last_argument= p; - /* Loop through connection pool for connection to close */ - for (con= connections; con < next_con; con++) - { - DBUG_PRINT("info", ("con->name: %s", con->name)); - if (!strcmp(con->name, name)) - { - simple_command(&con->mysql,COM_QUIT,NullS,0,1); - DBUG_VOID_RETURN; - } - } - die("connection '%s' not found in connection pool", name); + if (!(con= find_connection_by_name(name))) + die("connection '%s' not found in connection pool", name); + + simple_command(&con->mysql,COM_QUIT,NullS,0,1); + + DBUG_VOID_RETURN; } @@ -3858,20 +3868,6 @@ void set_reconnect(MYSQL* mysql, int val) } -struct st_connection * find_connection_by_name(const char *name) -{ - struct st_connection *con; - for (con= connections; con < next_con; con++) - { - if (!strcmp(con->name, name)) - { - return con; - } - } - return 0; /* Connection not found */ -} - - int select_connection_name(const char *name) { DBUG_ENTER("select_connection2"); @@ -3919,44 +3915,40 @@ void do_close_connection(struct st_command *command) *p++= 0; command->last_argument= p; - /* Loop through connection pool for connection to close */ - for (con= connections; con < next_con; con++) - { - DBUG_PRINT("info", ("con->name: %s", con->name)); - if (!strcmp(con->name, name)) - { - DBUG_PRINT("info", ("Closing connection %s", con->name)); + if (!(con= find_connection_by_name(name))) + die("connection '%s' not found in connection pool", name); + + DBUG_PRINT("info", ("Closing connection %s", con->name)); #ifndef EMBEDDED_LIBRARY - if (command->type == Q_DIRTY_CLOSE) - { - if (con->mysql.net.vio) - { - vio_delete(con->mysql.net.vio); - con->mysql.net.vio = 0; - } - } -#endif - if (next_con->stmt) - mysql_stmt_close(next_con->stmt); - next_con->stmt= 0; - - mysql_close(&con->mysql); - if (con->util_mysql) - mysql_close(con->util_mysql); - con->util_mysql= 0; - my_free(con->name, MYF(0)); - - /* - When the connection is closed set name to "-closed_connection-" - to make it possible to reuse the connection name. - */ - if (!(con->name = my_strdup("-closed_connection-", MYF(MY_WME)))) - die("Out of memory"); - - DBUG_VOID_RETURN; + if (command->type == Q_DIRTY_CLOSE) + { + if (con->mysql.net.vio) + { + vio_delete(con->mysql.net.vio); + con->mysql.net.vio = 0; } } - die("connection '%s' not found in connection pool", name); +#endif + if (con->stmt) + mysql_stmt_close(con->stmt); + con->stmt= 0; + + mysql_close(&con->mysql); + + if (con->util_mysql) + mysql_close(con->util_mysql); + con->util_mysql= 0; + + my_free(con->name, MYF(0)); + + /* + When the connection is closed set name to "-closed_connection-" + to make it possible to reuse the connection name. + */ + if (!(con->name = my_strdup("-closed_connection-", MYF(MY_WME)))) + die("Out of memory"); + + DBUG_VOID_RETURN; } From 0af6a5fa9e949f8200b21be8eac35fcff85b307b Mon Sep 17 00:00:00 2001 From: "tsmith@ramayana.hindu.god" <> Date: Tue, 28 Aug 2007 10:17:15 -0600 Subject: [PATCH 72/90] Fix another compiler warning on Windows in InnoDB. --- storage/innobase/handler/ha_innodb.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 40aab263981..f4f24b33f53 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -7324,7 +7324,7 @@ ha_innobase::get_auto_increment( /* Called for the first time ? */ if (prebuilt->trx->n_autoinc_rows == 0) { - prebuilt->trx->n_autoinc_rows = nb_desired_values; + prebuilt->trx->n_autoinc_rows = (ulint) nb_desired_values; /* It's possible for nb_desired_values to be 0: e.g., INSERT INTO T1(C) SELECT C FROM T2; */ From 53eaf05bb2f8f099050b57c9ea987cf74e6406e1 Mon Sep 17 00:00:00 2001 From: "tomas@whalegate.ndb.mysql.com" <> Date: Wed, 29 Aug 2007 09:44:37 +0200 Subject: [PATCH 73/90] Bug#29549 rpl_ndb_myisam2ndb,rpl_ndb_innodb2ndb failed on Solaris for pack_length issue - reverting patch as there where unknows sideeffects that we do not have time to follow up on just now --- mysql-test/suite/rpl_ndb/t/disabled.def | 6 +++--- sql/field.cc | 19 ++----------------- 2 files changed, 5 insertions(+), 20 deletions(-) diff --git a/mysql-test/suite/rpl_ndb/t/disabled.def b/mysql-test/suite/rpl_ndb/t/disabled.def index 4c800a2f30a..90286ecc421 100644 --- a/mysql-test/suite/rpl_ndb/t/disabled.def +++ b/mysql-test/suite/rpl_ndb/t/disabled.def @@ -14,10 +14,10 @@ rpl_ndb_2innodb : BUG#19227 2006-04-20 pekka pk delete apparently not replicated rpl_ndb_2myisam : BUG#19227 Seems to pass currently 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_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_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_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 diff --git a/sql/field.cc b/sql/field.cc index 816f4e68957..651bada28f6 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -7619,12 +7619,6 @@ uchar *Field_blob::pack(uchar *to, const uchar *from, uint max_length) length=max_length; store_length(to,packlength,length,TRUE); } -#ifdef WORDS_BIGENDIAN - else if (!table->s->db_low_byte_first) - { - store_length(to,packlength,length,TRUE); - } -#endif else memcpy(to,from,packlength); // Copy length if (length) @@ -7662,17 +7656,8 @@ const uchar *Field_blob::unpack(uchar *to, const uchar *Field_blob::unpack(uchar *to, const uchar *from) { - uint32 length=get_length(from,TRUE); -#ifdef WORDS_BIGENDIAN - if (!table->s->db_low_byte_first) - { - store_length(to,packlength,length,FALSE); - } - else -#endif - { - memcpy(to,from,packlength); - } + uint32 length=get_length(from); + memcpy(to,from,packlength); from+=packlength; if (length) memcpy_fixed(to+packlength, &from, sizeof(from)); From 387990f78d31e2fccc58867f07084e35a8afd038 Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.(none)" <> Date: Wed, 29 Aug 2007 11:51:34 +0200 Subject: [PATCH 74/90] Add 'mtr_rmtree' --- mysql-test/lib/mtr_misc.pl | 60 ++++++++++++++++++++++++++++++++++++ mysql-test/mysql-test-run.pl | 20 ++++++------ 2 files changed, 70 insertions(+), 10 deletions(-) diff --git a/mysql-test/lib/mtr_misc.pl b/mysql-test/lib/mtr_misc.pl index ef7dda358f2..3da598faebc 100644 --- a/mysql-test/lib/mtr_misc.pl +++ b/mysql-test/lib/mtr_misc.pl @@ -5,6 +5,7 @@ # same name. use strict; +use File::Find; sub mtr_full_hostname (); sub mtr_short_hostname (); @@ -17,6 +18,7 @@ sub mtr_file_exists(@); sub mtr_exe_exists(@); sub mtr_exe_maybe_exists(@); sub mtr_copy_dir($$); +sub mtr_rmtree($$); sub mtr_same_opts($$); sub mtr_cmp_opts($$); @@ -202,6 +204,64 @@ sub mtr_copy_dir($$) { } +sub mtr_rmtree($) { + my ($dir)= @_; + my $need_file_find= 0; + mtr_verbose("mtr_rmtree: $dir"); + + { + # Try to use File::Path::rmtree. Recent versions + # handles removal of directories and files that don't + # have full permissions, while older versions + # may have a problem with that and we use our own version + + local $SIG{__WARN__}= sub { + $need_file_find= 1; + mtr_warning($_[0]); + }; + rmtree($dir); + } + if ( $need_file_find ) { + mtr_warning("rmtree($dir) failed, trying with File::Find..."); + + my $errors= 0; + + # chmod + find( { + no_chdir => 1, + wanted => sub { + chmod(0777, $_) + or mtr_warning("couldn't chmod(0777, $_): $!") and $errors++; + } + }, + $dir + ); + + # rm + finddepth( { + no_chdir => 1, + wanted => sub { + my $file= $_; + # Use special underscore (_) filehandle, caches stat info + if (!-l $file and -d _ ) { + rmdir($file) or + mtr_warning("couldn't rmdir($file): $!") and $errors++; + } else { + unlink($file) + or mtr_warning("couldn't unlink($file): $!") and $errors++; + } + } + }, + $dir + ); + + mtr_error("Failed to remove '$dir'") if $errors; + + mtr_report("OK, that worked!"); + } +} + + sub mtr_same_opts ($$) { my $l1= shift; my $l2= shift; diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 783d48b9f48..96c422d4d85 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -1988,7 +1988,7 @@ sub remove_stale_vardir () { { # Remove the directory which the link points at mtr_verbose("Removing " . readlink($opt_vardir)); - rmtree(readlink($opt_vardir)); + mtr_rmtree(readlink($opt_vardir)); # Remove the "var" symlink mtr_verbose("unlink($opt_vardir)"); @@ -2016,7 +2016,7 @@ sub remove_stale_vardir () { foreach my $bin ( glob("$opt_vardir/*") ) { mtr_verbose("Removing bin $bin"); - rmtree($bin); + mtr_rmtree($bin); } } } @@ -2024,7 +2024,7 @@ sub remove_stale_vardir () { { # Remove the entire "var" dir mtr_verbose("Removing $opt_vardir/"); - rmtree("$opt_vardir/"); + mtr_rmtree("$opt_vardir/"); } if ( $opt_mem ) @@ -2033,7 +2033,7 @@ sub remove_stale_vardir () { # remove the $opt_mem dir to assure the symlink # won't point at an old directory mtr_verbose("Removing $opt_mem"); - rmtree($opt_mem); + mtr_rmtree($opt_mem); } } @@ -2046,11 +2046,11 @@ sub remove_stale_vardir () { # Remove the var/ dir in mysql-test dir if any # this could be an old symlink that shouldn't be there mtr_verbose("Removing $default_vardir"); - rmtree($default_vardir); + mtr_rmtree($default_vardir); # Remove the "var" dir mtr_verbose("Removing $opt_vardir/"); - rmtree("$opt_vardir/"); + mtr_rmtree("$opt_vardir/"); } } @@ -2963,7 +2963,7 @@ sub restore_slave_databases ($) { { my $data_dir= $slave->[$idx]->{'path_myddir'}; my $name= basename($data_dir); - rmtree($data_dir); + mtr_rmtree($data_dir); mtr_copy_dir("$path_snapshot/$name", $data_dir); } } @@ -3310,7 +3310,7 @@ sub run_testcase ($) { sub save_installed_db () { mtr_report("Saving snapshot of installed databases"); - rmtree($path_snapshot); + mtr_rmtree($path_snapshot); foreach my $data_dir (@data_dir_lst) { @@ -3357,7 +3357,7 @@ sub restore_installed_db ($) { { my $name= basename($data_dir); save_files_before_restore($test_name, $data_dir); - rmtree("$data_dir"); + mtr_rmtree("$data_dir"); mtr_copy_dir("$path_snapshot/$name", "$data_dir"); } @@ -3367,7 +3367,7 @@ sub restore_installed_db ($) { { foreach my $ndbd (@{$cluster->{'ndbds'}}) { - rmtree("$ndbd->{'path_fs'}" ); + mtr_rmtree("$ndbd->{'path_fs'}" ); } } } From b68689172f19f91681f77cfe51fb6c192507628d Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.(none)" <> Date: Wed, 29 Aug 2007 11:53:15 +0200 Subject: [PATCH 75/90] Remove unportable use of "exec chmod" --- mysql-test/t/information_schema_chmod.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/t/information_schema_chmod.test b/mysql-test/t/information_schema_chmod.test index 38586ab8b67..51e67a0c956 100644 --- a/mysql-test/t/information_schema_chmod.test +++ b/mysql-test/t/information_schema_chmod.test @@ -19,5 +19,5 @@ create database mysqltest; create table mysqltest.t1(a int); chmod 0000 $MYSQLTEST_VARDIR/master-data/mysqltest; select table_schema from information_schema.tables where table_schema='mysqltest'; -exec chmod 0777 $MYSQLTEST_VARDIR/master-data/mysqltest; +chmod 0777 $MYSQLTEST_VARDIR/master-data/mysqltest; drop database mysqltest; From 9ffb05dbbfda71c45a32875226c7fbebebe6f85a Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.(none)" <> Date: Wed, 29 Aug 2007 12:44:43 +0200 Subject: [PATCH 76/90] Remove unportable "system rm" --- mysql-test/t/backup.test | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/mysql-test/t/backup.test b/mysql-test/t/backup.test index 6ff4144aaf2..b05eef6a3ad 100644 --- a/mysql-test/t/backup.test +++ b/mysql-test/t/backup.test @@ -57,6 +57,15 @@ unlock tables; connection con1; reap; drop table t5; ---system rm $MYSQLTEST_VARDIR/tmp/t?.* +remove_file $MYSQLTEST_VARDIR/tmp/t1.MYD; +remove_file $MYSQLTEST_VARDIR/tmp/t2.MYD; +remove_file $MYSQLTEST_VARDIR/tmp/t3.MYD; +remove_file $MYSQLTEST_VARDIR/tmp/t4.MYD; +remove_file $MYSQLTEST_VARDIR/tmp/t5.MYD; +remove_file $MYSQLTEST_VARDIR/tmp/t1.frm; +remove_file $MYSQLTEST_VARDIR/tmp/t2.frm; +remove_file $MYSQLTEST_VARDIR/tmp/t3.frm; +remove_file $MYSQLTEST_VARDIR/tmp/t4.frm; +remove_file $MYSQLTEST_VARDIR/tmp/t5.frm; # End of 4.1 tests From aa57f6106cfd9915b0f627904a123cfa5f419db6 Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.(none)" <> Date: Wed, 29 Aug 2007 12:47:00 +0200 Subject: [PATCH 77/90] Remove unportable use of "system rm" --- mysql-test/t/ps.test | 3 --- 1 file changed, 3 deletions(-) diff --git a/mysql-test/t/ps.test b/mysql-test/t/ps.test index 93a89c2b275..cd2fc44e3ce 100644 --- a/mysql-test/t/ps.test +++ b/mysql-test/t/ps.test @@ -1168,9 +1168,6 @@ deallocate prepare stmt2; # # CREATE TABLE with DATA DIRECTORY option # -# Protect ourselves from data left in tmp/ by a previos possibly failed -# test ---system rm -f $MYSQLTEST_VARDIR/tmp/t1.* --disable_warnings --disable_query_log eval prepare stmt from "create table t1 (c char(10)) data directory='$MYSQLTEST_VARDIR/tmp'"; From f164a136e14d021dd72a1851061cec2d9fd80e5e Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.(none)" <> Date: Wed, 29 Aug 2007 14:39:40 +0200 Subject: [PATCH 78/90] Fix typo: '$$' => '$' --- mysql-test/lib/mtr_misc.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/lib/mtr_misc.pl b/mysql-test/lib/mtr_misc.pl index 3da598faebc..931c93f52a1 100644 --- a/mysql-test/lib/mtr_misc.pl +++ b/mysql-test/lib/mtr_misc.pl @@ -18,7 +18,7 @@ sub mtr_file_exists(@); sub mtr_exe_exists(@); sub mtr_exe_maybe_exists(@); sub mtr_copy_dir($$); -sub mtr_rmtree($$); +sub mtr_rmtree($); sub mtr_same_opts($$); sub mtr_cmp_opts($$); From 1a1bbf2da05ebe8923a40ae08ef2215e3b0c923a Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.(none)" <> Date: Wed, 29 Aug 2007 14:44:23 +0200 Subject: [PATCH 79/90] Remove unportable use of "system rm" --- mysql-test/t/myisam.test | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mysql-test/t/myisam.test b/mysql-test/t/myisam.test index 12b9423be21..d5f403616c8 100644 --- a/mysql-test/t/myisam.test +++ b/mysql-test/t/myisam.test @@ -1051,14 +1051,14 @@ eval set storage_engine=$default; # Test how DROP TABLE works if the index or data file doesn't exists create table t1 (a int) engine=myisam; -system rm $MYSQLTEST_VARDIR/master-data/test/t1.MYI ; +remove_file $MYSQLTEST_VARDIR/master-data/test/t1.MYI ; drop table if exists t1; create table t1 (a int) engine=myisam; -system rm $MYSQLTEST_VARDIR/master-data/test/t1.MYI ; +remove_file $MYSQLTEST_VARDIR/master-data/test/t1.MYI ; --error 1051,6 drop table t1; create table t1 (a int) engine=myisam; -system rm $MYSQLTEST_VARDIR/master-data/test/t1.MYD ; +remove_file $MYSQLTEST_VARDIR/master-data/test/t1.MYD ; --error 1105,6,29 drop table t1; --error 1051 From 65399a4bb5d360a9a2988957cfab0ea2a35a63fa Mon Sep 17 00:00:00 2001 From: "mats@kindahl-laptop.dnsalias.net" <> Date: Wed, 29 Aug 2007 16:06:59 +0200 Subject: [PATCH 80/90] BUG#29968 (rpl_ndb_circular.test and rpl_ndb_log.test fail): Removing unguarded read of slave_running field from inside terminate_slave_threads(). This could cause premature exit in the event that the slave thread already were shutting down, but isn't finished yet. The fields slave_running, io_thd, and sql_thread are guarded by an associated run_lock. A read of these fields were not guarded inside terminate_slave_threads(), which caused an assertion to fire. The assertion was removed, and the code reorganized slightly. --- sql/slave.cc | 91 ++++++++++++++++++++++++++++++++++++---------------- sql/slave.h | 4 --- 2 files changed, 64 insertions(+), 31 deletions(-) diff --git a/sql/slave.cc b/sql/slave.cc index 0854bc123f9..8c769770818 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -132,6 +132,11 @@ static int create_table_from_dump(THD* thd, MYSQL *mysql, const char* db, const char* table_name, bool overwrite); static int get_master_version_and_clock(MYSQL* mysql, MASTER_INFO* mi); static Log_event* next_event(RELAY_LOG_INFO* rli); +static int terminate_slave_thread(THD *thd, + pthread_mutex_t* term_lock, + pthread_cond_t* term_cond, + volatile uint *slave_running, + bool skip_lock); /* Find out which replications threads are running @@ -312,35 +317,26 @@ int terminate_slave_threads(MASTER_INFO* mi,int thread_mask,bool skip_lock) DBUG_RETURN(0); /* successfully do nothing */ int error,force_all = (thread_mask & SLAVE_FORCE_ALL); pthread_mutex_t *sql_lock = &mi->rli.run_lock, *io_lock = &mi->run_lock; - pthread_mutex_t *sql_cond_lock,*io_cond_lock; - sql_cond_lock=sql_lock; - io_cond_lock=io_lock; - - if (skip_lock) - { - sql_lock = io_lock = 0; - } - if ((thread_mask & (SLAVE_IO|SLAVE_FORCE_ALL)) && mi->slave_running) + if ((thread_mask & (SLAVE_IO|SLAVE_FORCE_ALL))) { DBUG_PRINT("info",("Terminating IO thread")); mi->abort_slave=1; if ((error=terminate_slave_thread(mi->io_thd,io_lock, - io_cond_lock, &mi->stop_cond, - &mi->slave_running)) && + &mi->slave_running, + skip_lock)) && !force_all) DBUG_RETURN(error); } - if ((thread_mask & (SLAVE_SQL|SLAVE_FORCE_ALL)) && mi->rli.slave_running) + if ((thread_mask & (SLAVE_SQL|SLAVE_FORCE_ALL))) { DBUG_PRINT("info",("Terminating SQL thread")); - DBUG_ASSERT(mi->rli.sql_thd != 0) ; mi->rli.abort_slave=1; if ((error=terminate_slave_thread(mi->rli.sql_thd,sql_lock, - sql_cond_lock, &mi->rli.stop_cond, - &mi->rli.slave_running)) && + &mi->rli.slave_running, + skip_lock)) && !force_all) DBUG_RETURN(error); } @@ -348,23 +344,60 @@ int terminate_slave_threads(MASTER_INFO* mi,int thread_mask,bool skip_lock) } -int terminate_slave_thread(THD* thd, pthread_mutex_t* term_lock, - pthread_mutex_t *cond_lock, - pthread_cond_t* term_cond, - volatile uint *slave_running) +/** + Wait for a slave thread to terminate. + + This function is called after requesting the thread to terminate + (by setting @c abort_slave member of @c Relay_log_info or @c + Master_info structure to 1). Termination of the thread is + controlled with the the predicate *slave_running. + + Function will acquire @c term_lock before waiting on the condition + unless @c skip_lock is true in which case the mutex should be owned + by the caller of this function and will remain acquired after + return from the function. + + @param term_lock + Associated lock to use when waiting for @c term_cond + + @param term_cond + Condition that is signalled when the thread has terminated + + @param slave_running + Pointer to predicate to check for slave thread termination + + @param skip_lock + If @c true the lock will not be acquired before waiting on + the condition. In this case, it is assumed that the calling + function acquires the lock before calling this function. + + @retval 0 All OK + */ +static int +terminate_slave_thread(THD *thd, + pthread_mutex_t* term_lock, + pthread_cond_t* term_cond, + volatile uint *slave_running, + bool skip_lock) { + int error; + DBUG_ENTER("terminate_slave_thread"); - if (term_lock) - { + + if (!skip_lock) pthread_mutex_lock(term_lock); - if (!*slave_running) - { + + safe_mutex_assert_owner(term_lock); + + if (!*slave_running) + { + if (!skip_lock) pthread_mutex_unlock(term_lock); - DBUG_RETURN(ER_SLAVE_NOT_RUNNING); - } + DBUG_RETURN(ER_SLAVE_NOT_RUNNING); } DBUG_ASSERT(thd != 0); THD_CHECK_SENTRY(thd); + /* Is is critical to test if the slave is running. Otherwise, we might be referening freed memory trying to kick it @@ -380,9 +413,13 @@ int terminate_slave_thread(THD* thd, pthread_mutex_t* term_lock, */ struct timespec abstime; set_timespec(abstime,2); - pthread_cond_timedwait(term_cond, cond_lock, &abstime); + error= pthread_cond_timedwait(term_cond, term_lock, &abstime); + DBUG_ASSERT(error == ETIMEDOUT || error == 0); } - if (term_lock) + + DBUG_ASSERT(*slave_running == 0); + + if (!skip_lock) pthread_mutex_unlock(term_lock); DBUG_RETURN(0); } diff --git a/sql/slave.h b/sql/slave.h index 731728bde4f..c7385934460 100644 --- a/sql/slave.h +++ b/sql/slave.h @@ -133,10 +133,6 @@ bool flush_relay_log_info(RELAY_LOG_INFO* rli); int register_slave_on_master(MYSQL* mysql); int terminate_slave_threads(MASTER_INFO* mi, int thread_mask, bool skip_lock = 0); -int terminate_slave_thread(THD* thd, pthread_mutex_t* term_mutex, - pthread_mutex_t* cond_lock, - pthread_cond_t* term_cond, - volatile uint* slave_running); int start_slave_threads(bool need_slave_mutex, bool wait_for_start, MASTER_INFO* mi, const char* master_info_fname, const char* slave_info_fname, int thread_mask); From ac5309cb0489348b9371e4c35afe751c1138c40a Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.(none)" <> Date: Wed, 29 Aug 2007 17:54:02 +0200 Subject: [PATCH 81/90] Remove any old pidfile before starting mysqld to make sure that 'mysqld_wait_started' don't return prematurely because of an old pidfile --- mysql-test/mysql-test-run.pl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 96c422d4d85..6df64ced2f9 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -3825,6 +3825,9 @@ sub mysqld_start ($$$) { $wait_for_pid_file= 0; } + # Remove the pidfile + unlink($mysqld->{'path_pid'}); + if ( defined $exe ) { $pid= mtr_spawn($exe, $args, "", From 61dbfb3a016fa07ea1d0eece86b7af9414a79c9c Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.(none)" <> Date: Wed, 29 Aug 2007 19:02:33 +0200 Subject: [PATCH 82/90] Move instance manager tests to it's own suite --- .../{ => suite/im}/r/im_cmd_line.result | 0 .../im}/r/im_daemon_life_cycle.result | 0 .../{ => suite/im}/r/im_instance_conf.result | 0 .../{ => suite/im}/r/im_life_cycle.result | 0 mysql-test/{ => suite/im}/r/im_options.result | 0 mysql-test/{ => suite/im}/r/im_utils.result | 0 mysql-test/suite/im/t/disabled.def | 20 ++++++++ .../{include => suite/im/t}/im_check_env.inc | 0 .../{ => suite/im}/t/im_cmd_line.imtest | 2 +- .../im}/t/im_daemon_life_cycle-im.opt | 0 .../im}/t/im_daemon_life_cycle.imtest | 48 ++++++++++--------- .../{ => suite/im}/t/im_instance_conf-im.opt | 0 .../{ => suite/im}/t/im_instance_conf.imtest | 2 +- .../{ => suite/im}/t/im_life_cycle-im.opt | 0 .../{ => suite/im}/t/im_life_cycle.imtest | 14 +++--- mysql-test/{ => suite/im}/t/im_options-im.opt | 0 mysql-test/{ => suite/im}/t/im_options.imtest | 2 +- mysql-test/{ => suite/im}/t/im_utils-im.opt | 0 mysql-test/{ => suite/im}/t/im_utils.imtest | 8 ++-- mysql-test/{ => suite/im}/t/kill_n_check.sh | 0 mysql-test/{ => suite/im}/t/log.sh | 0 mysql-test/{ => suite/im}/t/utils.sh | 0 .../{ => suite/im}/t/wait_for_process.sh | 0 .../{ => suite/im}/t/wait_for_socket.sh | 0 mysql-test/t/disabled.def | 9 ---- 25 files changed, 61 insertions(+), 44 deletions(-) rename mysql-test/{ => suite/im}/r/im_cmd_line.result (100%) rename mysql-test/{ => suite/im}/r/im_daemon_life_cycle.result (100%) rename mysql-test/{ => suite/im}/r/im_instance_conf.result (100%) rename mysql-test/{ => suite/im}/r/im_life_cycle.result (100%) rename mysql-test/{ => suite/im}/r/im_options.result (100%) rename mysql-test/{ => suite/im}/r/im_utils.result (100%) create mode 100644 mysql-test/suite/im/t/disabled.def rename mysql-test/{include => suite/im/t}/im_check_env.inc (100%) rename mysql-test/{ => suite/im}/t/im_cmd_line.imtest (98%) rename mysql-test/{ => suite/im}/t/im_daemon_life_cycle-im.opt (100%) rename mysql-test/{ => suite/im}/t/im_daemon_life_cycle.imtest (52%) rename mysql-test/{ => suite/im}/t/im_instance_conf-im.opt (100%) rename mysql-test/{ => suite/im}/t/im_instance_conf.imtest (99%) rename mysql-test/{ => suite/im}/t/im_life_cycle-im.opt (100%) rename mysql-test/{ => suite/im}/t/im_life_cycle.imtest (92%) rename mysql-test/{ => suite/im}/t/im_options-im.opt (100%) rename mysql-test/{ => suite/im}/t/im_options.imtest (99%) rename mysql-test/{ => suite/im}/t/im_utils-im.opt (100%) rename mysql-test/{ => suite/im}/t/im_utils.imtest (91%) rename mysql-test/{ => suite/im}/t/kill_n_check.sh (100%) rename mysql-test/{ => suite/im}/t/log.sh (100%) rename mysql-test/{ => suite/im}/t/utils.sh (100%) rename mysql-test/{ => suite/im}/t/wait_for_process.sh (100%) rename mysql-test/{ => suite/im}/t/wait_for_socket.sh (100%) diff --git a/mysql-test/r/im_cmd_line.result b/mysql-test/suite/im/r/im_cmd_line.result similarity index 100% rename from mysql-test/r/im_cmd_line.result rename to mysql-test/suite/im/r/im_cmd_line.result diff --git a/mysql-test/r/im_daemon_life_cycle.result b/mysql-test/suite/im/r/im_daemon_life_cycle.result similarity index 100% rename from mysql-test/r/im_daemon_life_cycle.result rename to mysql-test/suite/im/r/im_daemon_life_cycle.result diff --git a/mysql-test/r/im_instance_conf.result b/mysql-test/suite/im/r/im_instance_conf.result similarity index 100% rename from mysql-test/r/im_instance_conf.result rename to mysql-test/suite/im/r/im_instance_conf.result diff --git a/mysql-test/r/im_life_cycle.result b/mysql-test/suite/im/r/im_life_cycle.result similarity index 100% rename from mysql-test/r/im_life_cycle.result rename to mysql-test/suite/im/r/im_life_cycle.result diff --git a/mysql-test/r/im_options.result b/mysql-test/suite/im/r/im_options.result similarity index 100% rename from mysql-test/r/im_options.result rename to mysql-test/suite/im/r/im_options.result diff --git a/mysql-test/r/im_utils.result b/mysql-test/suite/im/r/im_utils.result similarity index 100% rename from mysql-test/r/im_utils.result rename to mysql-test/suite/im/r/im_utils.result diff --git a/mysql-test/suite/im/t/disabled.def b/mysql-test/suite/im/t/disabled.def new file mode 100644 index 00000000000..56828810bf1 --- /dev/null +++ b/mysql-test/suite/im/t/disabled.def @@ -0,0 +1,20 @@ +############################################################################## +# +# List the test cases that are to be disabled temporarily. +# +# Separate the test case name and the comment with ':'. +# +# : BUG# +# +# Do not use any TAB characters for whitespace. +# +############################################################################## +im_options : Bug#20294 2006-07-24 stewart Instance manager test im_options fails randomly +im_daemon_life_cycle : Bug#20294 2007-05-14 alik Instance manager tests fail randomly +im_cmd_line : Bug#20294 2007-05-14 alik Instance manager tests fail randomly +im_utils : Bug#20294 2007-05-30 alik Instance manager tests fail randomly +im_instance_conf : Bug#20294 2007-05-30 alik Instance manager tests fail randomly +im_life_cycle : BUG#27851 Instance manager dies on ASSERT in ~Thread_registry() or from not being able to close a mysqld instance. +im_instance_conf : BUG#28743 Instance manager generates warnings in test suite +im_utils : BUG#28743 Instance manager generates warnings in test suite + diff --git a/mysql-test/include/im_check_env.inc b/mysql-test/suite/im/t/im_check_env.inc similarity index 100% rename from mysql-test/include/im_check_env.inc rename to mysql-test/suite/im/t/im_check_env.inc diff --git a/mysql-test/t/im_cmd_line.imtest b/mysql-test/suite/im/t/im_cmd_line.imtest similarity index 98% rename from mysql-test/t/im_cmd_line.imtest rename to mysql-test/suite/im/t/im_cmd_line.imtest index 1de43efe92b..e8264b5bb8a 100644 --- a/mysql-test/t/im_cmd_line.imtest +++ b/mysql-test/suite/im/t/im_cmd_line.imtest @@ -4,7 +4,7 @@ # ########################################################################### ---source include/im_check_env.inc +--source suite/im/t/im_check_env.inc ########################################################################### diff --git a/mysql-test/t/im_daemon_life_cycle-im.opt b/mysql-test/suite/im/t/im_daemon_life_cycle-im.opt similarity index 100% rename from mysql-test/t/im_daemon_life_cycle-im.opt rename to mysql-test/suite/im/t/im_daemon_life_cycle-im.opt diff --git a/mysql-test/t/im_daemon_life_cycle.imtest b/mysql-test/suite/im/t/im_daemon_life_cycle.imtest similarity index 52% rename from mysql-test/t/im_daemon_life_cycle.imtest rename to mysql-test/suite/im/t/im_daemon_life_cycle.imtest index c2eac46c1e4..c42ab89cc49 100644 --- a/mysql-test/t/im_daemon_life_cycle.imtest +++ b/mysql-test/suite/im/t/im_daemon_life_cycle.imtest @@ -1,3 +1,5 @@ +let $UTIL=$MYSQL_TEST_DIR/suite/im/t; + ########################################################################### # # This file contains test for (1.2) test suite. @@ -6,11 +8,11 @@ # ########################################################################### ---exec $MYSQL_TEST_DIR/t/log.sh im_daemon_life_cycle im_daemon_life_cycle.imtest started. +--exec $UTIL/log.sh im_daemon_life_cycle im_daemon_life_cycle.imtest started. ########################################################################### ---source include/im_check_env.inc +--source suite/im/t/im_check_env.inc # Turn on reconnect, not on by default anymore. --enable_reconnect @@ -30,15 +32,15 @@ # ########################################################################### ---exec $MYSQL_TEST_DIR/t/log.sh im_daemon_life_cycle Main-test: starting... +--exec $UTIL/log.sh im_daemon_life_cycle Main-test: starting... ---exec $MYSQL_TEST_DIR/t/log.sh im_daemon_life_cycle Killing IM-main... ---exec $MYSQL_TEST_DIR/t/kill_n_check.sh $IM_PATH_PID restarted 55 im_daemon_life_cycle +--exec $UTIL/log.sh im_daemon_life_cycle Killing IM-main... +--exec $UTIL/kill_n_check.sh $IM_PATH_PID restarted 55 im_daemon_life_cycle ---exec $MYSQL_TEST_DIR/t/log.sh im_daemon_life_cycle Waiting for IM-main to start accepting connections... ---exec $MYSQL_TEST_DIR/t/wait_for_socket.sh $EXE_MYSQL $IM_PATH_SOCK $IM_USERNAME $IM_PASSWORD '' 55 im_daemon_life_cycle +--exec $UTIL/log.sh im_daemon_life_cycle Waiting for IM-main to start accepting connections... +--exec $UTIL/wait_for_socket.sh $EXE_MYSQL $IM_PATH_SOCK $IM_USERNAME $IM_PASSWORD '' 55 im_daemon_life_cycle ---exec $MYSQL_TEST_DIR/t/log.sh im_daemon_life_cycle Main-test: done. +--exec $UTIL/log.sh im_daemon_life_cycle Main-test: done. ########################################################################### # @@ -55,29 +57,29 @@ --echo -- Test for BUG#12751 --echo -------------------------------------------------------------------- ---exec $MYSQL_TEST_DIR/t/log.sh im_daemon_life_cycle BUG12751: starting... +--exec $UTIL/log.sh im_daemon_life_cycle BUG12751: starting... # 1. Start mysqld; ---exec $MYSQL_TEST_DIR/t/log.sh im_daemon_life_cycle mysqld2: starting... +--exec $UTIL/log.sh im_daemon_life_cycle mysqld2: starting... START INSTANCE mysqld2; ---exec $MYSQL_TEST_DIR/t/log.sh im_daemon_life_cycle mysqld2: waiting to start... ---exec $MYSQL_TEST_DIR/t/wait_for_process.sh $IM_MYSQLD2_PATH_PID 55 started im_daemon_life_cycle +--exec $UTIL/log.sh im_daemon_life_cycle mysqld2: waiting to start... +--exec $UTIL/wait_for_process.sh $IM_MYSQLD2_PATH_PID 55 started im_daemon_life_cycle ---exec $MYSQL_TEST_DIR/t/log.sh im_daemon_life_cycle mysqld2: started. +--exec $UTIL/log.sh im_daemon_life_cycle mysqld2: started. # 2. Restart IM-main; ---exec $MYSQL_TEST_DIR/t/log.sh im_daemon_life_cycle Killing IM-main... ---exec $MYSQL_TEST_DIR/t/kill_n_check.sh $IM_PATH_PID restarted 55 im_daemon_life_cycle +--exec $UTIL/log.sh im_daemon_life_cycle Killing IM-main... +--exec $UTIL/kill_n_check.sh $IM_PATH_PID restarted 55 im_daemon_life_cycle ---exec $MYSQL_TEST_DIR/t/log.sh im_daemon_life_cycle Waiting for IM-main to start accepting connections... ---exec $MYSQL_TEST_DIR/t/wait_for_socket.sh $EXE_MYSQL $IM_PATH_SOCK $IM_USERNAME $IM_PASSWORD '' 55 im_daemon_life_cycle +--exec $UTIL/log.sh im_daemon_life_cycle Waiting for IM-main to start accepting connections... +--exec $UTIL/wait_for_socket.sh $EXE_MYSQL $IM_PATH_SOCK $IM_USERNAME $IM_PASSWORD '' 55 im_daemon_life_cycle # 3. Issue some statement -- connection should be re-established. ---exec $MYSQL_TEST_DIR/t/log.sh im_daemon_life_cycle Checking that IM-main processing commands... +--exec $UTIL/log.sh im_daemon_life_cycle Checking that IM-main processing commands... --replace_column 2 STATE 3 VERSION_NUMBER 4 VERSION SHOW INSTANCE STATUS mysqld1; @@ -86,13 +88,13 @@ SHOW INSTANCE STATUS mysqld1; # So, if it we do not stop it, it will be stopped by mysql-test-run.pl with # warning. ---exec $MYSQL_TEST_DIR/t/log.sh im_daemon_life_cycle mysqld2: stopping... +--exec $UTIL/log.sh im_daemon_life_cycle mysqld2: stopping... STOP INSTANCE mysqld2; ---exec $MYSQL_TEST_DIR/t/log.sh im_daemon_life_cycle mysqld2: waiting to stop... ---exec $MYSQL_TEST_DIR/t/wait_for_process.sh $IM_MYSQLD2_PATH_PID 55 stopped im_daemon_life_cycle ---exec $MYSQL_TEST_DIR/t/log.sh im_daemon_life_cycle mysqld2: stopped. +--exec $UTIL/log.sh im_daemon_life_cycle mysqld2: waiting to stop... +--exec $UTIL/wait_for_process.sh $IM_MYSQLD2_PATH_PID 55 stopped im_daemon_life_cycle +--exec $UTIL/log.sh im_daemon_life_cycle mysqld2: stopped. ########################################################################### ---exec $MYSQL_TEST_DIR/t/log.sh im_daemon_life_cycle BUG12751: done. +--exec $UTIL/log.sh im_daemon_life_cycle BUG12751: done. diff --git a/mysql-test/t/im_instance_conf-im.opt b/mysql-test/suite/im/t/im_instance_conf-im.opt similarity index 100% rename from mysql-test/t/im_instance_conf-im.opt rename to mysql-test/suite/im/t/im_instance_conf-im.opt diff --git a/mysql-test/t/im_instance_conf.imtest b/mysql-test/suite/im/t/im_instance_conf.imtest similarity index 99% rename from mysql-test/t/im_instance_conf.imtest rename to mysql-test/suite/im/t/im_instance_conf.imtest index e7f1e511113..b667df41f98 100644 --- a/mysql-test/t/im_instance_conf.imtest +++ b/mysql-test/suite/im/t/im_instance_conf.imtest @@ -26,7 +26,7 @@ # ########################################################################### ---source include/im_check_env.inc +--source suite/im/t/im_check_env.inc ########################################################################### # diff --git a/mysql-test/t/im_life_cycle-im.opt b/mysql-test/suite/im/t/im_life_cycle-im.opt similarity index 100% rename from mysql-test/t/im_life_cycle-im.opt rename to mysql-test/suite/im/t/im_life_cycle-im.opt diff --git a/mysql-test/t/im_life_cycle.imtest b/mysql-test/suite/im/t/im_life_cycle.imtest similarity index 92% rename from mysql-test/t/im_life_cycle.imtest rename to mysql-test/suite/im/t/im_life_cycle.imtest index 3721b92e2b7..31f63d82505 100644 --- a/mysql-test/t/im_life_cycle.imtest +++ b/mysql-test/suite/im/t/im_life_cycle.imtest @@ -1,3 +1,5 @@ +let $UTIL=$MYSQL_TEST_DIR/suite/im/t; + ########################################################################### # # This file contains test for (1.1) test suite. @@ -6,7 +8,7 @@ # ########################################################################### ---source include/im_check_env.inc +--source suite/im/t/im_check_env.inc ########################################################################### # @@ -25,7 +27,7 @@ START INSTANCE mysqld2; # FIXME: START INSTANCE should be synchronous. ---exec $MYSQL_TEST_DIR/t/wait_for_process.sh $IM_MYSQLD2_PATH_PID 30 started im_life_cycle +--exec $UTIL/wait_for_process.sh $IM_MYSQLD2_PATH_PID 30 started im_life_cycle # FIXME: Result of SHOW INSTANCES here is not deterministic unless START # INSTANCE is synchronous. Even waiting for mysqld to start by looking at @@ -58,7 +60,7 @@ SHOW VARIABLES LIKE 'port'; STOP INSTANCE mysqld2; # FIXME: STOP INSTANCE should be synchronous. ---exec $MYSQL_TEST_DIR/t/wait_for_process.sh $IM_MYSQLD2_PATH_PID 30 stopped im_life_cycle +--exec $UTIL/wait_for_process.sh $IM_MYSQLD2_PATH_PID 30 stopped im_life_cycle # FIXME: Result of SHOW INSTANCES here is not deterministic unless START # INSTANCE is synchronous. Even waiting for mysqld to start by looking at @@ -121,7 +123,7 @@ STOP INSTANCE mysqld3; --echo -- 1.1.6. --echo -------------------------------------------------------------------- ---exec $MYSQL_TEST_DIR/t/kill_n_check.sh $IM_MYSQLD1_PATH_PID restarted 30 im_life_cycle +--exec $UTIL/kill_n_check.sh $IM_MYSQLD1_PATH_PID restarted 30 im_life_cycle # Give some time to IM to detect that mysqld was restarted. It should be # longer than monitoring interval. @@ -143,7 +145,7 @@ SHOW INSTANCES; START INSTANCE mysqld2; # FIXME: START INSTANCE should be synchronous. ---exec $MYSQL_TEST_DIR/t/wait_for_process.sh $IM_MYSQLD2_PATH_PID 30 started im_life_cycle +--exec $UTIL/wait_for_process.sh $IM_MYSQLD2_PATH_PID 30 started im_life_cycle # FIXME: Result of SHOW INSTANCES here is not deterministic unless START # INSTANCE is synchronous. Even waiting for mysqld to start by looking at @@ -151,7 +153,7 @@ START INSTANCE mysqld2; # mysqld has started. # SHOW INSTANCES; ---exec $MYSQL_TEST_DIR/t/kill_n_check.sh $IM_MYSQLD2_PATH_PID killed 10 im_life_cycle +--exec $UTIL/kill_n_check.sh $IM_MYSQLD2_PATH_PID killed 10 im_life_cycle # FIXME: Result of SHOW INSTANCES here is not deterministic unless START # INSTANCE is synchronous. Even waiting for mysqld to start by looking at diff --git a/mysql-test/t/im_options-im.opt b/mysql-test/suite/im/t/im_options-im.opt similarity index 100% rename from mysql-test/t/im_options-im.opt rename to mysql-test/suite/im/t/im_options-im.opt diff --git a/mysql-test/t/im_options.imtest b/mysql-test/suite/im/t/im_options.imtest similarity index 99% rename from mysql-test/t/im_options.imtest rename to mysql-test/suite/im/t/im_options.imtest index 8f9bed16473..d251b97d8e7 100644 --- a/mysql-test/t/im_options.imtest +++ b/mysql-test/suite/im/t/im_options.imtest @@ -32,7 +32,7 @@ # ########################################################################### ---source include/im_check_env.inc +--source suite/im/t/im_check_env.inc ########################################################################### # diff --git a/mysql-test/t/im_utils-im.opt b/mysql-test/suite/im/t/im_utils-im.opt similarity index 100% rename from mysql-test/t/im_utils-im.opt rename to mysql-test/suite/im/t/im_utils-im.opt diff --git a/mysql-test/t/im_utils.imtest b/mysql-test/suite/im/t/im_utils.imtest similarity index 91% rename from mysql-test/t/im_utils.imtest rename to mysql-test/suite/im/t/im_utils.imtest index 0866b87204a..b935634e96c 100644 --- a/mysql-test/t/im_utils.imtest +++ b/mysql-test/suite/im/t/im_utils.imtest @@ -6,7 +6,9 @@ # ########################################################################### ---source include/im_check_env.inc +--source suite/im/t/im_check_env.inc + +let $UTIL=$MYSQL_TEST_DIR/suite/im/t; ########################################################################### @@ -31,10 +33,10 @@ SHOW INSTANCE OPTIONS mysqld2; # START INSTANCE mysqld2; ---exec $MYSQL_TEST_DIR/t/wait_for_process.sh $IM_MYSQLD2_PATH_PID 30 started im_utils +--exec $UTIL/wait_for_process.sh $IM_MYSQLD2_PATH_PID 30 started im_utils STOP INSTANCE mysqld2; ---exec $MYSQL_TEST_DIR/t/wait_for_process.sh $IM_MYSQLD2_PATH_PID 30 stopped im_utils +--exec $UTIL/wait_for_process.sh $IM_MYSQLD2_PATH_PID 30 stopped im_utils # # Check 'SHOW LOG FILES' command: diff --git a/mysql-test/t/kill_n_check.sh b/mysql-test/suite/im/t/kill_n_check.sh similarity index 100% rename from mysql-test/t/kill_n_check.sh rename to mysql-test/suite/im/t/kill_n_check.sh diff --git a/mysql-test/t/log.sh b/mysql-test/suite/im/t/log.sh similarity index 100% rename from mysql-test/t/log.sh rename to mysql-test/suite/im/t/log.sh diff --git a/mysql-test/t/utils.sh b/mysql-test/suite/im/t/utils.sh similarity index 100% rename from mysql-test/t/utils.sh rename to mysql-test/suite/im/t/utils.sh diff --git a/mysql-test/t/wait_for_process.sh b/mysql-test/suite/im/t/wait_for_process.sh similarity index 100% rename from mysql-test/t/wait_for_process.sh rename to mysql-test/suite/im/t/wait_for_process.sh diff --git a/mysql-test/t/wait_for_socket.sh b/mysql-test/suite/im/t/wait_for_socket.sh similarity index 100% rename from mysql-test/t/wait_for_socket.sh rename to mysql-test/suite/im/t/wait_for_socket.sh diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def index 0ba56a74f57..a39de913659 100644 --- a/mysql-test/t/disabled.def +++ b/mysql-test/t/disabled.def @@ -11,15 +11,6 @@ ############################################################################## user_limits : Bug#23921 random failure of user_limits.test -im_options : Bug#20294 2006-07-24 stewart Instance manager test im_options fails randomly -im_daemon_life_cycle : Bug#20294 2007-05-14 alik Instance manager tests fail randomly -im_cmd_line : Bug#20294 2007-05-14 alik Instance manager tests fail randomly -im_utils : Bug#20294 2007-05-30 alik Instance manager tests fail randomly -im_instance_conf : Bug#20294 2007-05-30 alik Instance manager tests fail randomly -im_life_cycle : BUG#27851 Instance manager dies on ASSERT in ~Thread_registry() or from not being able to close a mysqld instance. -im_instance_conf : BUG#28743 Instance manager generates warnings in test suite -im_utils : BUG#28743 Instance manager generates warnings in test suite - concurrent_innodb : BUG#21579 2006-08-11 mleich innodb_concurrent random failures with varying differences ctype_big5 : BUG#26711 2007-06-21 Lars Test has never worked on Double Whopper From 6969ff248113205818eb03f2913074f8ae52613e Mon Sep 17 00:00:00 2001 From: "antony@pcg5ppc.xiphis.org" <> Date: Wed, 29 Aug 2007 13:02:02 -0700 Subject: [PATCH 83/90] Fix pushbuild test failures which occur on big-endian systems. Do not convert innodb autoincrement value to little endian when on big endian systems. --- storage/innobase/row/row0sel.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/storage/innobase/row/row0sel.c b/storage/innobase/row/row0sel.c index ee79bc94906..9cb4e0f6f20 100644 --- a/storage/innobase/row/row0sel.c +++ b/storage/innobase/row/row0sel.c @@ -4555,6 +4555,15 @@ row_search_autoinc_read_column( ut_a(len != UNIV_SQL_NULL); ut_a(len <= sizeof value); +#ifdef WORDS_BIGENDIAN + /* Copy integer data and restore sign bit */ + + memcpy((ptr = dest), data, len); + + if (!unsigned_type) { + dest[0] ^= 128; + } +#else /* Convert integer data from Innobase to a little-endian format, sign bit restored to normal */ @@ -4566,6 +4575,7 @@ row_search_autoinc_read_column( if (!unsigned_type) { dest[len - 1] ^= 128; } +#endif /* The assumption here is that the AUTOINC value can't be negative.*/ switch (len) { From 653f7341bb32c73a1389f4d1fc7667a66523444d Mon Sep 17 00:00:00 2001 From: "tsmith@sita.local" <> Date: Wed, 29 Aug 2007 16:58:00 -0600 Subject: [PATCH 84/90] Post-merge fixes, and disable buggy test case on embedded --- mysql-test/t/query_cache.test | 5 +++++ sql/log_event_old.cc | 24 ++++++++++++------------ 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/mysql-test/t/query_cache.test b/mysql-test/t/query_cache.test index e10428bdbb5..d06698cdb17 100644 --- a/mysql-test/t/query_cache.test +++ b/mysql-test/t/query_cache.test @@ -1,5 +1,10 @@ -- source include/have_query_cache.inc +# Disabled on embedded due to bug #30710, "query_cache.test fails on +# embedded w/ per-column privs test". Please re-enable when that bug +# is resolved. +-- source include/not_embedded.inc + # # Tests with query cache # diff --git a/sql/log_event_old.cc b/sql/log_event_old.cc index 420df67dc54..949179386ea 100644 --- a/sql/log_event_old.cc +++ b/sql/log_event_old.cc @@ -11,7 +11,7 @@ // Old implementation of do_apply_event() int -Old_rows_log_event::do_apply_event(Rows_log_event *ev, const RELAY_LOG_INFO *rli) +Old_rows_log_event::do_apply_event(Rows_log_event *ev, const Relay_log_info *rli) { DBUG_ENTER("Rows_log_event::do_apply_event(st_relay_log_info*)"); int error= 0; @@ -32,7 +32,7 @@ Old_rows_log_event::do_apply_event(Rows_log_event *ev, const RELAY_LOG_INFO *rli */ DBUG_ASSERT(ev->get_flags(Rows_log_event::STMT_END_F)); - const_cast(rli)->clear_tables_to_lock(); + const_cast(rli)->clear_tables_to_lock(); close_thread_tables(thd); thd->clear_error(); DBUG_RETURN(0); @@ -88,7 +88,7 @@ Old_rows_log_event::do_apply_event(Rows_log_event *ev, const RELAY_LOG_INFO *rli "Error in %s event: when locking tables", ev->get_type_str()); } - const_cast(rli)->clear_tables_to_lock(); + const_cast(rli)->clear_tables_to_lock(); DBUG_RETURN(error); } @@ -125,7 +125,7 @@ Old_rows_log_event::do_apply_event(Rows_log_event *ev, const RELAY_LOG_INFO *rli "unexpected success or fatal error")); thd->query_error= 1; } - const_cast(rli)->clear_tables_to_lock(); + const_cast(rli)->clear_tables_to_lock(); DBUG_RETURN(error); } } @@ -147,7 +147,7 @@ Old_rows_log_event::do_apply_event(Rows_log_event *ev, const RELAY_LOG_INFO *rli mysql_unlock_tables(thd, thd->lock); thd->lock= 0; thd->query_error= 1; - const_cast(rli)->clear_tables_to_lock(); + const_cast(rli)->clear_tables_to_lock(); DBUG_RETURN(Rows_log_event::ERR_BAD_TABLE_DEF); } } @@ -169,14 +169,14 @@ Old_rows_log_event::do_apply_event(Rows_log_event *ev, const RELAY_LOG_INFO *rli */ for (TABLE_LIST *ptr= rli->tables_to_lock ; ptr ; ptr= ptr->next_global) { - const_cast(rli)->m_table_map.set_table(ptr->table_id, ptr->table); + const_cast(rli)->m_table_map.set_table(ptr->table_id, ptr->table); } #ifdef HAVE_QUERY_CACHE query_cache.invalidate_locked_for_write(rli->tables_to_lock); #endif } - TABLE* table= const_cast(rli)->m_table_map.get_table(ev->m_table_id); + TABLE* table= const_cast(rli)->m_table_map.get_table(ev->m_table_id); if (table) { @@ -221,7 +221,7 @@ Old_rows_log_event::do_apply_event(Rows_log_event *ev, const RELAY_LOG_INFO *rli inside a statement and halting abruptly might cause problems when restarting. */ - const_cast(rli)->set_flag(RELAY_LOG_INFO::IN_STMT); + const_cast(rli)->set_flag(Relay_log_info::IN_STMT); error= do_before_row_operations(table); while (error == 0 && row_start < ev->m_rows_end) @@ -262,7 +262,7 @@ Old_rows_log_event::do_apply_event(Rows_log_event *ev, const RELAY_LOG_INFO *rli row_start= row_end; } DBUG_EXECUTE_IF("STOP_SLAVE_after_first_Rows_event", - const_cast(rli)->abort_slave= 1;); + const_cast(rli)->abort_slave= 1;); error= do_after_row_operations(table, error); if (!ev->cache_stmt) { @@ -276,7 +276,7 @@ Old_rows_log_event::do_apply_event(Rows_log_event *ev, const RELAY_LOG_INFO *rli The table def is needed in unpack_row(). */ if (rli->tables_to_lock && ev->get_flags(Rows_log_event::STMT_END_F)) - const_cast(rli)->clear_tables_to_lock(); + const_cast(rli)->clear_tables_to_lock(); if (error) { /* error has occured during the transaction */ @@ -299,7 +299,7 @@ Old_rows_log_event::do_apply_event(Rows_log_event *ev, const RELAY_LOG_INFO *rli rollback at the caller along with sbr. */ thd->reset_current_stmt_binlog_row_based(); - const_cast(rli)->cleanup_context(thd, error); + const_cast(rli)->cleanup_context(thd, error); thd->query_error= 1; DBUG_RETURN(error); } @@ -329,7 +329,7 @@ Old_rows_log_event::do_apply_event(Rows_log_event *ev, const RELAY_LOG_INFO *rli problem. When WL#2975 is implemented, just remove the member st_relay_log_info::last_event_start_time and all its occurences. */ - const_cast(rli)->last_event_start_time= my_time(0); + const_cast(rli)->last_event_start_time= my_time(0); } DBUG_RETURN(0); From 58ecaaa8599502d10087ed2f95646f4ffe192a88 Mon Sep 17 00:00:00 2001 From: "tsmith@ramayana.hindu.god" <> Date: Thu, 30 Aug 2007 14:13:05 -0600 Subject: [PATCH 85/90] Disable rpl_ndb_2other, which has never worked on bigendian machines. --- mysql-test/suite/rpl_ndb/t/disabled.def | 1 + 1 file changed, 1 insertion(+) diff --git a/mysql-test/suite/rpl_ndb/t/disabled.def b/mysql-test/suite/rpl_ndb/t/disabled.def index 90286ecc421..f372d44cb90 100644 --- a/mysql-test/suite/rpl_ndb/t/disabled.def +++ b/mysql-test/suite/rpl_ndb/t/disabled.def @@ -13,6 +13,7 @@ rpl_ndb_2innodb : BUG#19227 2006-04-20 pekka pk delete apparently not replicated rpl_ndb_2myisam : BUG#19227 Seems to pass currently +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 From f5fdb53a350cae14b09771b0edcd3f34d0848136 Mon Sep 17 00:00:00 2001 From: "tsmith@ramayana.hindu.god" <> Date: Thu, 30 Aug 2007 23:57:39 -0600 Subject: [PATCH 86/90] Bug #27014: Imperfect error/warning message for STR_TO_DATE for invalid datetime value Fix name of function in warning message. --- sql/item_timefunc.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index 0af98b5d987..2fedb4b72b6 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -597,7 +597,7 @@ err: strmake(buff, val_begin, min(length, sizeof(buff)-1)); push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR, ER_WRONG_VALUE_FOR_TYPE, ER(ER_WRONG_VALUE_FOR_TYPE), - date_time_type, buff, "str_to_time"); + date_time_type, buff, "str_to_date"); } DBUG_RETURN(1); } From 47dc161f5b6f31027a5a91d214a4396be74554b9 Mon Sep 17 00:00:00 2001 From: "tsmith@ramayana.hindu.god" <> Date: Fri, 31 Aug 2007 01:28:42 -0600 Subject: [PATCH 87/90] Fix test results for bug #27014 --- mysql-test/r/date_formats.result | 64 ++++++++++++++++---------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/mysql-test/r/date_formats.result b/mysql-test/r/date_formats.result index 11717679b42..c1c8b7b060e 100644 --- a/mysql-test/r/date_formats.result +++ b/mysql-test/r/date_formats.result @@ -80,7 +80,7 @@ select STR_TO_DATE('2004.12.12 22.30.61','%Y.%m.%d %T'); STR_TO_DATE('2004.12.12 22.30.61','%Y.%m.%d %T') NULL Warnings: -Error 1411 Incorrect time value: '22.30.61' for function str_to_time +Error 1411 Incorrect time value: '22.30.61' for function str_to_date create table t1 (date char(30), format char(30) not null); insert into t1 values ('2003-01-02 10:11:12', '%Y-%m-%d %H:%i:%S'), @@ -352,21 +352,21 @@ Tuesday 52 2001 %W %u %x NULL 7 53 1998 %w %u %Y NULL NULL %m.%d.%Y NULL Warnings: -Error 1411 Incorrect datetime value: '2003-01-02 10:11:12 PM' for function str_to_time -Error 1411 Incorrect datetime value: '2003-01-02 10:11:12.123456' for function str_to_time -Error 1411 Incorrect datetime value: '2003-01-02 10:11:12AM' for function str_to_time -Error 1411 Incorrect datetime value: '2003-01-02 10:11:12AN' for function str_to_time -Error 1411 Incorrect datetime value: '2003-01-02 10:11:12 PM' for function str_to_time -Error 1411 Incorrect datetime value: '10:20:10AM' for function str_to_time -Error 1411 Incorrect datetime value: '15 Septembei 2001' for function str_to_time -Error 1411 Incorrect datetime value: '15 Ju 2001' for function str_to_time -Error 1411 Incorrect datetime value: 'Sund 15 MA' for function str_to_time -Error 1411 Incorrect datetime value: 'Thursdai 12 1998' for function str_to_time -Error 1411 Incorrect datetime value: 'Sunday 01 2001' for function str_to_time -Error 1411 Incorrect datetime value: 'Tuesday 52 2001' for function str_to_time -Error 1411 Incorrect datetime value: 'Tuesday 52 2001' for function str_to_time -Error 1411 Incorrect datetime value: 'Tuesday 52 2001' for function str_to_time -Error 1411 Incorrect datetime value: '7 53 1998' for function str_to_time +Error 1411 Incorrect datetime value: '2003-01-02 10:11:12 PM' for function str_to_date +Error 1411 Incorrect datetime value: '2003-01-02 10:11:12.123456' for function str_to_date +Error 1411 Incorrect datetime value: '2003-01-02 10:11:12AM' for function str_to_date +Error 1411 Incorrect datetime value: '2003-01-02 10:11:12AN' for function str_to_date +Error 1411 Incorrect datetime value: '2003-01-02 10:11:12 PM' for function str_to_date +Error 1411 Incorrect datetime value: '10:20:10AM' for function str_to_date +Error 1411 Incorrect datetime value: '15 Septembei 2001' for function str_to_date +Error 1411 Incorrect datetime value: '15 Ju 2001' for function str_to_date +Error 1411 Incorrect datetime value: 'Sund 15 MA' for function str_to_date +Error 1411 Incorrect datetime value: 'Thursdai 12 1998' for function str_to_date +Error 1411 Incorrect datetime value: 'Sunday 01 2001' for function str_to_date +Error 1411 Incorrect datetime value: 'Tuesday 52 2001' for function str_to_date +Error 1411 Incorrect datetime value: 'Tuesday 52 2001' for function str_to_date +Error 1411 Incorrect datetime value: 'Tuesday 52 2001' for function str_to_date +Error 1411 Incorrect datetime value: '7 53 1998' for function str_to_date select date,format,concat(str_to_date(date, format),'') as con from t1; date format con 2003-01-02 10:11:12 PM %Y-%m-%d %H:%i:%S %p NULL @@ -386,21 +386,21 @@ Tuesday 52 2001 %W %u %x NULL 7 53 1998 %w %u %Y NULL NULL %m.%d.%Y NULL Warnings: -Error 1411 Incorrect datetime value: '2003-01-02 10:11:12 PM' for function str_to_time -Error 1411 Incorrect datetime value: '2003-01-02 10:11:12.123456' for function str_to_time -Error 1411 Incorrect datetime value: '2003-01-02 10:11:12AM' for function str_to_time -Error 1411 Incorrect datetime value: '2003-01-02 10:11:12AN' for function str_to_time -Error 1411 Incorrect datetime value: '2003-01-02 10:11:12 PM' for function str_to_time -Error 1411 Incorrect datetime value: '10:20:10AM' for function str_to_time -Error 1411 Incorrect datetime value: '15 Septembei 2001' for function str_to_time -Error 1411 Incorrect datetime value: '15 Ju 2001' for function str_to_time -Error 1411 Incorrect datetime value: 'Sund 15 MA' for function str_to_time -Error 1411 Incorrect datetime value: 'Thursdai 12 1998' for function str_to_time -Error 1411 Incorrect datetime value: 'Sunday 01 2001' for function str_to_time -Error 1411 Incorrect datetime value: 'Tuesday 52 2001' for function str_to_time -Error 1411 Incorrect datetime value: 'Tuesday 52 2001' for function str_to_time -Error 1411 Incorrect datetime value: 'Tuesday 52 2001' for function str_to_time -Error 1411 Incorrect datetime value: '7 53 1998' for function str_to_time +Error 1411 Incorrect datetime value: '2003-01-02 10:11:12 PM' for function str_to_date +Error 1411 Incorrect datetime value: '2003-01-02 10:11:12.123456' for function str_to_date +Error 1411 Incorrect datetime value: '2003-01-02 10:11:12AM' for function str_to_date +Error 1411 Incorrect datetime value: '2003-01-02 10:11:12AN' for function str_to_date +Error 1411 Incorrect datetime value: '2003-01-02 10:11:12 PM' for function str_to_date +Error 1411 Incorrect datetime value: '10:20:10AM' for function str_to_date +Error 1411 Incorrect datetime value: '15 Septembei 2001' for function str_to_date +Error 1411 Incorrect datetime value: '15 Ju 2001' for function str_to_date +Error 1411 Incorrect datetime value: 'Sund 15 MA' for function str_to_date +Error 1411 Incorrect datetime value: 'Thursdai 12 1998' for function str_to_date +Error 1411 Incorrect datetime value: 'Sunday 01 2001' for function str_to_date +Error 1411 Incorrect datetime value: 'Tuesday 52 2001' for function str_to_date +Error 1411 Incorrect datetime value: 'Tuesday 52 2001' for function str_to_date +Error 1411 Incorrect datetime value: 'Tuesday 52 2001' for function str_to_date +Error 1411 Incorrect datetime value: '7 53 1998' for function str_to_date truncate table t1; insert into t1 values ('10:20:10AM', '%h:%i:%s'), @@ -440,7 +440,7 @@ select str_to_date('15-01-2001 12:59:59', GET_FORMAT(DATE,'USA')); str_to_date('15-01-2001 12:59:59', GET_FORMAT(DATE,'USA')) NULL Warnings: -Error 1411 Incorrect datetime value: '15-01-2001 12:59:59' for function str_to_time +Error 1411 Incorrect datetime value: '15-01-2001 12:59:59' for function str_to_date explain extended select makedate(1997,1), addtime("31.12.97 11.59.59.999999 PM", "1 1.1.1.000002"),subtime("31.12.97 11.59.59.999999 PM", "1 1.1.1.000002"),timediff("01.01.97 11:59:59.000001 PM","31.12.95 11:59:59.000002 PM"),cast(str_to_date("15-01-2001 12:59:59", "%d-%m-%Y %H:%i:%S") as TIME), maketime(23,11,12),microsecond("1997-12-31 23:59:59.000001"); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used From d70e4b0c92365b24477572ccb71eafb55b1e93a1 Mon Sep 17 00:00:00 2001 From: "tsmith@ramayana.hindu.god" <> Date: Fri, 31 Aug 2007 05:21:12 -0600 Subject: [PATCH 88/90] Correct test result file for bug #27014 --- mysql-test/r/strict.result | 67 +++++++++----------------------------- 1 file changed, 15 insertions(+), 52 deletions(-) diff --git a/mysql-test/r/strict.result b/mysql-test/r/strict.result index c1dccd53035..fc7170bfc2b 100644 --- a/mysql-test/r/strict.result +++ b/mysql-test/r/strict.result @@ -215,11 +215,11 @@ ERROR 22007: Incorrect date value: '2004-10-00 15:30:00' for column 'col1' at ro INSERT INTO t1 (col1) VALUES(STR_TO_DATE('31.9.2004 15.30','%d.%m.%Y %H.%i')); ERROR 22007: Incorrect date value: '2004-09-31 15:30:00' for column 'col1' at row 1 INSERT INTO t1 (col1) VALUES(STR_TO_DATE('32.10.2004 15.30','%d.%m.%Y %H.%i')); -ERROR HY000: Incorrect datetime value: '32.10.2004 15.30' for function str_to_time +ERROR HY000: Incorrect datetime value: '32.10.2004 15.30' for function str_to_date INSERT INTO t1 (col1) VALUES(STR_TO_DATE('29.02.2003 15.30','%d.%m.%Y %H.%i')); ERROR 22007: Incorrect date value: '2003-02-29 15:30:00' for column 'col1' at row 1 INSERT INTO t1 (col1) VALUES(STR_TO_DATE('15.13.2004 15.30','%d.%m.%Y %H.%i')); -ERROR HY000: Incorrect datetime value: '15.13.2004 15.30' for function str_to_time +ERROR HY000: Incorrect datetime value: '15.13.2004 15.30' for function str_to_date INSERT INTO t1 (col1) VALUES(STR_TO_DATE('00.00.0000','%d.%m.%Y')); ERROR 22007: Incorrect date value: '0000-00-00' for column 'col1' at row 1 INSERT INTO t1 (col2) VALUES(STR_TO_DATE('31.10.0000 15.30','%d.%m.%Y %H.%i')); @@ -230,11 +230,11 @@ ERROR 22007: Incorrect datetime value: '2004-10-00 15:30:00' for column 'col2' a INSERT INTO t1 (col2) VALUES(STR_TO_DATE('31.9.2004 15.30','%d.%m.%Y %H.%i')); ERROR 22007: Incorrect datetime value: '2004-09-31 15:30:00' for column 'col2' at row 1 INSERT INTO t1 (col2) VALUES(STR_TO_DATE('32.10.2004 15.30','%d.%m.%Y %H.%i')); -ERROR HY000: Incorrect datetime value: '32.10.2004 15.30' for function str_to_time +ERROR HY000: Incorrect datetime value: '32.10.2004 15.30' for function str_to_date INSERT INTO t1 (col2) VALUES(STR_TO_DATE('29.02.2003 15.30','%d.%m.%Y %H.%i')); ERROR 22007: Incorrect datetime value: '2003-02-29 15:30:00' for column 'col2' at row 1 INSERT INTO t1 (col2) VALUES(STR_TO_DATE('15.13.2004 15.30','%d.%m.%Y %H.%i')); -ERROR HY000: Incorrect datetime value: '15.13.2004 15.30' for function str_to_time +ERROR HY000: Incorrect datetime value: '15.13.2004 15.30' for function str_to_date INSERT INTO t1 (col2) VALUES(STR_TO_DATE('00.00.0000','%d.%m.%Y')); ERROR 22007: Incorrect datetime value: '0000-00-00' for column 'col2' at row 1 INSERT INTO t1 (col3) VALUES(STR_TO_DATE('31.10.0000 15.30','%d.%m.%Y %H.%i')); @@ -246,11 +246,11 @@ ERROR 22007: Incorrect datetime value: '2004-10-00 15:30:00' for column 'col3' a INSERT INTO t1 (col3) VALUES(STR_TO_DATE('31.9.2004 15.30','%d.%m.%Y %H.%i')); ERROR 22007: Incorrect datetime value: '2004-09-31 15:30:00' for column 'col3' at row 1 INSERT INTO t1 (col3) VALUES(STR_TO_DATE('32.10.2004 15.30','%d.%m.%Y %H.%i')); -ERROR HY000: Incorrect datetime value: '32.10.2004 15.30' for function str_to_time +ERROR HY000: Incorrect datetime value: '32.10.2004 15.30' for function str_to_date INSERT INTO t1 (col3) VALUES(STR_TO_DATE('29.02.2003 15.30','%d.%m.%Y %H.%i')); ERROR 22007: Incorrect datetime value: '2003-02-29 15:30:00' for column 'col3' at row 1 INSERT INTO t1 (col3) VALUES(STR_TO_DATE('15.13.2004 15.30','%d.%m.%Y %H.%i')); -ERROR HY000: Incorrect datetime value: '15.13.2004 15.30' for function str_to_time +ERROR HY000: Incorrect datetime value: '15.13.2004 15.30' for function str_to_date INSERT INTO t1 (col3) VALUES(STR_TO_DATE('00.00.0000','%d.%m.%Y')); ERROR 22007: Incorrect datetime value: '0000-00-00' for column 'col3' at row 1 drop table t1; @@ -1070,24 +1070,24 @@ create table t1 (col1 datetime); insert into t1 values(STR_TO_DATE('31.10.2004 15.30 abc','%d.%m.%Y %H.%i')); ERROR 22007: Truncated incorrect datetime value: '31.10.2004 15.30 abc' insert into t1 values(STR_TO_DATE('32.10.2004 15.30','%d.%m.%Y %H.%i')); -ERROR HY000: Incorrect datetime value: '32.10.2004 15.30' for function str_to_time +ERROR HY000: Incorrect datetime value: '32.10.2004 15.30' for function str_to_date insert into t1 values(STR_TO_DATE('2004.12.12 22:22:33 AM','%Y.%m.%d %r')); -ERROR HY000: Incorrect time value: '22:22:33 AM' for function str_to_time +ERROR HY000: Incorrect time value: '22:22:33 AM' for function str_to_date insert into t1 values(STR_TO_DATE('2004.12.12 abc','%Y.%m.%d %T')); -ERROR HY000: Incorrect time value: 'abc' for function str_to_time +ERROR HY000: Incorrect time value: 'abc' for function str_to_date set sql_mode=''; insert into t1 values(STR_TO_DATE('31.10.2004 15.30 abc','%d.%m.%Y %H.%i')); Warnings: Warning 1292 Truncated incorrect datetime value: '31.10.2004 15.30 abc' insert into t1 values(STR_TO_DATE('32.10.2004 15.30','%d.%m.%Y %H.%i')); Warnings: -Error 1411 Incorrect datetime value: '32.10.2004 15.30' for function str_to_time +Error 1411 Incorrect datetime value: '32.10.2004 15.30' for function str_to_date insert into t1 values(STR_TO_DATE('2004.12.12 22:22:33 AM','%Y.%m.%d %r')); Warnings: -Error 1411 Incorrect time value: '22:22:33 AM' for function str_to_time +Error 1411 Incorrect time value: '22:22:33 AM' for function str_to_date insert into t1 values(STR_TO_DATE('2004.12.12 abc','%Y.%m.%d %T')); Warnings: -Error 1411 Incorrect time value: 'abc' for function str_to_time +Error 1411 Incorrect time value: 'abc' for function str_to_date insert into t1 values(STR_TO_DATE('31.10.2004 15.30','%d.%m.%Y %H.%i')); insert into t1 values(STR_TO_DATE('2004.12.12 11:22:33 AM','%Y.%m.%d %r')); insert into t1 values(STR_TO_DATE('2004.12.12 10:22:59','%Y.%m.%d %T')); @@ -1105,9 +1105,9 @@ select count(*) from t1 where STR_TO_DATE('2004.12.12 10:22:61','%Y.%m.%d %T') I count(*) 7 Warnings: -Error 1411 Incorrect datetime value: '2004.12.12 10:22:61' for function str_to_time -Error 1411 Incorrect datetime value: '2004.12.12 10:22:61' for function str_to_time -Error 1411 Incorrect datetime value: '2004.12.12 10:22:61' for function str_to_time +Error 1411 Incorrect datetime value: '2004.12.12 10:22:61' for function str_to_date +Error 1411 Incorrect datetime value: '2004.12.12 10:22:61' for function str_to_date +Error 1411 Incorrect datetime value: '2004.12.12 10:22:61' for function str_to_date drop table t1; create table t1 (col1 char(3), col2 integer); insert into t1 (col1) values (cast(1000 as char(3))); @@ -1302,43 +1302,6 @@ t2 CREATE TABLE `t2` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t2,t1; set @@sql_mode= @org_mode; -set @@sql_mode='traditional'; -create table t1 (i int) -comment '123456789*123456789*123456789*123456789*123456789* - 123456789*123456789*123456789*123456789*123456789*'; -ERROR HY000: Too long comment for table 't1' -create table t1 ( -i int comment -'123456789*123456789*123456789*123456789* - 123456789*123456789*123456789*123456789* - 123456789*123456789*123456789*123456789* - 123456789*123456789*123456789*123456789* - 123456789*123456789*123456789*123456789* - 123456789*123456789*123456789*123456789* - 123456789*123456789*123456789*123456789*'); -ERROR HY000: Too long comment for field 'i' -set @@sql_mode= @org_mode; -create table t1 -(i int comment -'123456789*123456789*123456789*123456789* - 123456789*123456789*123456789*123456789* - 123456789*123456789*123456789*123456789* - 123456789*123456789*123456789*123456789* - 123456789*123456789*123456789*123456789* - 123456789*123456789*123456789*123456789* - 123456789*123456789*123456789*123456789*'); -Warnings: -Warning 1105 Unknown error -select column_name, column_comment from information_schema.columns where -table_schema = 'test' and table_name = 't1'; -column_name column_comment -i 123456789*123456789*123456789*123456789* - 123456789*123456789*123456789*123456789* - 123456789*123456789*123456789*123456789* - 123456789*123456789*123456789*123456789* - 123456789*123456789*123456789*123456789* - 123456789*123456789*123456789*123456789* -drop table t1; set names utf8; create table t1 (i int) comment '123456789*123456789*123456789*123456789*123456789*123456789*'; From b5c13a0f46d50d5cc6818fd66d95de8d212b0407 Mon Sep 17 00:00:00 2001 From: "tsmith@ramayana.hindu.god" <> Date: Fri, 31 Aug 2007 10:53:51 -0600 Subject: [PATCH 89/90] Correct fix for test result. --- mysql-test/r/strict.result | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/mysql-test/r/strict.result b/mysql-test/r/strict.result index fc7170bfc2b..cc1a2535896 100644 --- a/mysql-test/r/strict.result +++ b/mysql-test/r/strict.result @@ -1302,6 +1302,43 @@ t2 CREATE TABLE `t2` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t2,t1; set @@sql_mode= @org_mode; +set @@sql_mode='traditional'; +create table t1 (i int) +comment '123456789*123456789*123456789*123456789*123456789* + 123456789*123456789*123456789*123456789*123456789*'; +ERROR HY000: Too long comment for table 't1' +create table t1 ( +i int comment +'123456789*123456789*123456789*123456789* + 123456789*123456789*123456789*123456789* + 123456789*123456789*123456789*123456789* + 123456789*123456789*123456789*123456789* + 123456789*123456789*123456789*123456789* + 123456789*123456789*123456789*123456789* + 123456789*123456789*123456789*123456789*'); +ERROR HY000: Too long comment for field 'i' +set @@sql_mode= @org_mode; +create table t1 +(i int comment +'123456789*123456789*123456789*123456789* + 123456789*123456789*123456789*123456789* + 123456789*123456789*123456789*123456789* + 123456789*123456789*123456789*123456789* + 123456789*123456789*123456789*123456789* + 123456789*123456789*123456789*123456789* + 123456789*123456789*123456789*123456789*'); +Warnings: +Warning 1105 Unknown error +select column_name, column_comment from information_schema.columns where +table_schema = 'test' and table_name = 't1'; +column_name column_comment +i 123456789*123456789*123456789*123456789* + 123456789*123456789*123456789*123456789* + 123456789*123456789*123456789*123456789* + 123456789*123456789*123456789*123456789* + 123456789*123456789*123456789*123456789* + 123456789*123456789*123456789*123456789* +drop table t1; set names utf8; create table t1 (i int) comment '123456789*123456789*123456789*123456789*123456789*123456789*'; From c5ea7b06413173206a4918574bb0393fcc1fb891 Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.(none)" <> Date: Sat, 1 Sep 2007 11:41:38 +0200 Subject: [PATCH 90/90] Use eval around "rmtree" and use our own version of rmtree if it fails --- mysql-test/lib/mtr_misc.pl | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/mysql-test/lib/mtr_misc.pl b/mysql-test/lib/mtr_misc.pl index 931c93f52a1..0fa332e30fd 100644 --- a/mysql-test/lib/mtr_misc.pl +++ b/mysql-test/lib/mtr_misc.pl @@ -206,22 +206,15 @@ sub mtr_copy_dir($$) { sub mtr_rmtree($) { my ($dir)= @_; - my $need_file_find= 0; mtr_verbose("mtr_rmtree: $dir"); - { - # Try to use File::Path::rmtree. Recent versions - # handles removal of directories and files that don't - # have full permissions, while older versions - # may have a problem with that and we use our own version + # Try to use File::Path::rmtree. Recent versions + # handles removal of directories and files that don't + # have full permissions, while older versions + # may have a problem with that and we use our own version - local $SIG{__WARN__}= sub { - $need_file_find= 1; - mtr_warning($_[0]); - }; - rmtree($dir); - } - if ( $need_file_find ) { + eval { rmtree($dir); }; + if ( $@ ) { mtr_warning("rmtree($dir) failed, trying with File::Find..."); my $errors= 0;