diff options
760 files changed, 47832 insertions, 5271 deletions
diff --git a/.bzrignore b/.bzrignore index 409b6148125..74c81c48e05 100644 --- a/.bzrignore +++ b/.bzrignore @@ -1097,7 +1097,6 @@ CPackSourceConfig.cmake Docs/INFO_BIN Docs/INFO_SRC tags -sql/.empty Testing info_macros.cmake VERSION.dep diff --git a/CMakeLists.txt b/CMakeLists.txt index 74697ce232d..9ec4ef14ec5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -300,14 +300,16 @@ ADD_SUBDIRECTORY(vio) ADD_SUBDIRECTORY(regex) ADD_SUBDIRECTORY(mysys) ADD_SUBDIRECTORY(libmysql) - +ADD_SUBDIRECTORY(client) ADD_SUBDIRECTORY(extra) +ADD_SUBDIRECTORY(libservices) +ADD_SUBDIRECTORY(scripts) +ADD_SUBDIRECTORY(sql/share) +ADD_SUBDIRECTORY(support-files) + IF(NOT WITHOUT_SERVER) ADD_SUBDIRECTORY(tests) - ADD_SUBDIRECTORY(client) ADD_SUBDIRECTORY(sql) - ADD_SUBDIRECTORY(sql/share) - ADD_SUBDIRECTORY(libservices) OPTION (WITH_EMBEDDED_SERVER "Compile MySQL with embedded server" OFF) IF(WITH_EMBEDDED_SERVER) ADD_SUBDIRECTORY(libmysqld) @@ -316,12 +318,11 @@ IF(NOT WITHOUT_SERVER) ADD_SUBDIRECTORY(mysql-test) ADD_SUBDIRECTORY(mysql-test/lib/My/SafeProcess) - ADD_SUBDIRECTORY(support-files) - ADD_SUBDIRECTORY(scripts) ADD_SUBDIRECTORY(sql-bench) - IF(UNIX) - ADD_SUBDIRECTORY(man) - ENDIF() +ENDIF() + +IF(UNIX) + ADD_SUBDIRECTORY(man) ENDIF() INCLUDE(cmake/abi_check.cmake) diff --git a/client/get_password.c b/client/get_password.c index c6653183f48..09d307b5553 100644 --- a/client/get_password.c +++ b/client/get_password.c @@ -23,10 +23,6 @@ #include <m_string.h> #include <m_ctype.h> -#if defined(HAVE_BROKEN_GETPASS) && !defined(HAVE_GETPASSPHRASE) -#undef HAVE_GETPASS -#endif - #ifdef HAVE_GETPASS #ifdef HAVE_PWD_H #include <pwd.h> diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index 91a2bd2aef3..d10504425f5 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -1,6 +1,6 @@ /* - Copyright (c) 2000, 2011, Oracle and/or its affiliates. - Copyright (c) 2012, Monty Program Ab + Copyright (c) 2000, 2012, Oracle and/or its affiliates. + Copyright (c) 2009, 2012, Monty Program Ab This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -743,7 +743,7 @@ print_use_stmt(PRINT_EVENT_INFO* pinfo, const Query_log_event *ev) return; // In case of rewrite rule print USE statement for db_to - fprintf(result_file, "use %s%s\n", db_to, pinfo->delimiter); + my_fprintf(result_file, "use %`s%s\n", db_to, pinfo->delimiter); // Copy the *original* db to pinfo to suppress emiting // of USE stmts by log_event print-functions. @@ -844,6 +844,7 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev, DBUG_ENTER("process_event"); print_event_info->short_form= short_form; Exit_status retval= OK_CONTINUE; + IO_CACHE *const head= &print_event_info->head_cache; /* Format events are not concerned by --offset and such, we always need to @@ -923,6 +924,8 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev, print_skip_replication_statement(print_event_info, ev); ev->print(result_file, print_event_info); } + if (head->error == -1) + goto err; break; } @@ -955,8 +958,9 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev, { print_skip_replication_statement(print_event_info, ev); ce->print(result_file, print_event_info, TRUE); + if (head->error == -1) + goto err; } - // If this binlog is not 3.23 ; why this test?? if (glob_description_event->binlog_version >= 3) { @@ -978,6 +982,8 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev, output of Append_block_log_event::print is only a comment. */ ev->print(result_file, print_event_info); + if (head->error == -1) + goto err; if ((retval= load_processor.process((Append_block_log_event*) ev)) != OK_CONTINUE) goto end; @@ -986,6 +992,8 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev, case EXEC_LOAD_EVENT: { ev->print(result_file, print_event_info); + if (head->error == -1) + goto err; Execute_load_log_event *exv= (Execute_load_log_event*)ev; Create_file_log_event *ce= load_processor.grab_event(exv->file_id); /* @@ -1003,6 +1011,8 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev, ce->print(result_file, print_event_info, TRUE); my_free((void*)ce->fname); delete ce; + if (head->error == -1) + goto err; } else warning("Ignoring Execute_load_log_event as there is no " @@ -1015,6 +1025,8 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev, print_event_info->common_header_len= glob_description_event->common_header_len; ev->print(result_file, print_event_info); + if (head->error == -1) + goto err; if (!remote_opt) { ev->free_temp_buf(); // free memory allocated in dump_local_log_entries @@ -1044,6 +1056,8 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev, break; case BEGIN_LOAD_QUERY_EVENT: ev->print(result_file, print_event_info); + if (head->error == -1) + goto err; if ((retval= load_processor.process((Begin_load_query_log_event*) ev)) != OK_CONTINUE) goto end; @@ -1061,6 +1075,12 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev, convert_path_to_forward_slashes(fname); print_skip_replication_statement(print_event_info, ev); exlq->print(result_file, print_event_info, fname); + if (head->error == -1) + { + if (fname) + my_free(fname); + goto err; + } } else warning("Ignoring Execute_load_query since there is no " @@ -1191,6 +1211,8 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev, default: print_skip_replication_statement(print_event_info, ev); ev->print(result_file, print_event_info); + if (head->error == -1) + goto err; } } @@ -1354,7 +1376,7 @@ static struct my_option my_options[] = "Stop reading the binlog at position N. Applies to the last binlog " "passed on the command line.", &stop_position, &stop_position, 0, GET_ULL, - REQUIRED_ARG, (ulonglong)(~(my_off_t)0), BIN_LOG_HEADER_SIZE, + REQUIRED_ARG, (longlong)(~(my_off_t)0), BIN_LOG_HEADER_SIZE, (ulonglong)(~(my_off_t)0), 0, 0, 0}, {"to-last-log", 't', "Requires -R. Will not stop at the end of the \ requested binlog but rather continue printing until the end of the last \ @@ -2324,7 +2346,13 @@ err: end: if (fd >= 0) my_close(fd, MYF(MY_WME)); - end_io_cache(file); + /* + Since the end_io_cache() writes to the + file errors may happen. + */ + if (end_io_cache(file)) + retval= ERROR_STOP; + return retval; } diff --git a/client/mysqldump.c b/client/mysqldump.c index f91c480bc80..e3572efa9ba 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -2610,6 +2610,7 @@ static uint get_table_structure(char *table, char *db, char *table_type, if (strcmp(field->name, "View") == 0) { char *scv_buff= NULL; + my_ulonglong n_cols; verbose_msg("-- It's a view, create dummy table for view\n"); @@ -2624,8 +2625,8 @@ static uint get_table_structure(char *table, char *db, char *table_type, the same name in order to satisfy views that depend on this view. The table will be removed when the actual view is created. - The properties of each column, aside from the data type, are not - preserved in this temporary table, because they are not necessary. + The properties of each column, are not preserved in this temporary + table, because they are not necessary. This will not be necessary once we can determine dependencies between views and can simply dump them in the appropriate order. @@ -2652,8 +2653,23 @@ static uint get_table_structure(char *table, char *db, char *table_type, else my_free(scv_buff); - if (mysql_num_rows(result)) + n_cols= mysql_num_rows(result); + if (0 != n_cols) { + + /* + The actual formula is based on the column names and how the .FRM + files are stored and is too volatile to be repeated here. + Thus we simply warn the user if the columns exceed a limit we + know works most of the time. + */ + if (n_cols >= 1000) + fprintf(stderr, + "-- Warning: Creating a stand-in table for view %s may" + " fail when replaying the dump file produced because " + "of the number of columns exceeding 1000. Exercise " + "caution when replaying the produced dump file.\n", + table); if (opt_drop) { /* @@ -2680,14 +2696,19 @@ static uint get_table_structure(char *table, char *db, char *table_type, row= mysql_fetch_row(result); - fprintf(sql_file, " %s %s", quote_name(row[0], name_buff, 0), - row[1]); + /* + The actual column type doesn't matter anyway, since the table will + be dropped at run time. + We do tinyint to avoid hitting the row size limit. + */ + fprintf(sql_file, " %s tinyint NOT NULL", + quote_name(row[0], name_buff, 0)); while((row= mysql_fetch_row(result))) { /* col name, col type */ - fprintf(sql_file, ",\n %s %s", - quote_name(row[0], name_buff, 0), row[1]); + fprintf(sql_file, ",\n %s tinyint NOT NULL", + quote_name(row[0], name_buff, 0)); } /* @@ -4159,6 +4180,7 @@ static int dump_all_databases() if (dump_all_tables_in_db(row[0])) result=1; } + mysql_free_result(tableres); if (seen_views) { if (mysql_query(mysql, "SHOW DATABASES") || @@ -4181,6 +4203,7 @@ static int dump_all_databases() if (dump_all_views_in_db(row[0])) result=1; } + mysql_free_result(tableres); } return result; } @@ -4309,8 +4332,6 @@ static int init_dumping(char *database, int init_func(char*)) check_io(md_result_file); } } - if (extended_insert) - init_dynamic_string_checked(&extended_row, "", 1024, 1024); return 0; } /* init_dumping */ @@ -4784,7 +4805,7 @@ static int add_slave_statements(void) static int do_show_slave_status(MYSQL *mysql_con) { - MYSQL_RES *slave; + MYSQL_RES *slave= 0; const char *comment_prefix= (opt_slave_data == MYSQL_OPT_SLAVE_DATA_COMMENTED_SQL) ? "-- " : ""; LINT_INIT(slave); @@ -5589,6 +5610,9 @@ int main(int argc, char **argv) if (opt_alltspcs) dump_all_tablespaces(); + if (extended_insert) + init_dynamic_string_checked(&extended_row, "", 1024, 1024); + if (opt_alldbs) { if (!opt_alltspcs && !opt_notspcs) diff --git a/client/mysqltest.cc b/client/mysqltest.cc index 3bae2bfbc9d..bb89db4b231 100644 --- a/client/mysqltest.cc +++ b/client/mysqltest.cc @@ -1,5 +1,5 @@ -/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. - Copyright (c) 2009-2012 Monty Program Ab. +/* Copyright (c) 2000, 2012, Oracle and/or its affiliates. + Copyright (c) 2009, 2012, Monty Program Ab. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -621,6 +621,8 @@ void free_all_replace(){ free_replace_column(); } +void var_set_int(const char* name, int value); + class LogFile { FILE* m_file; @@ -1275,6 +1277,8 @@ void handle_command_error(struct st_command *command, uint error, { DBUG_ENTER("handle_command_error"); DBUG_PRINT("enter", ("error: %d", error)); + var_set_int("$sys_errno",sys_errno); + var_set_int("$errno",error); if (error != 0) { int i; @@ -1285,7 +1289,7 @@ void handle_command_error(struct st_command *command, uint error, "errno: %d", command->first_word_len, command->query, error, my_errno, sys_errno); - return; + DBUG_VOID_RETURN; } i= match_expected_error(command, error, NULL); @@ -5144,7 +5148,7 @@ typedef struct static st_error global_error_names[] = { - { "<No error>", (uint) -1, "" }, + { "<No error>", -1U, "" }, #include <mysqld_ername.h> { 0, 0, 0 } }; @@ -5201,15 +5205,32 @@ const char *get_errname_from_code (uint error_code) void do_get_errcodes(struct st_command *command) { struct st_match_err *to= saved_expected_errors.err; - char *p= command->first_argument; - uint count= 0; - char *next; - DBUG_ENTER("do_get_errcodes"); - if (!*p) + if (!*command->first_argument) die("Missing argument(s) to 'error'"); + /* TODO: Potentially, there is a possibility of variables + being expanded twice, e.g. + + let $errcodes = 1,\$a; + let $a = 1051; + error $errcodes; + DROP TABLE unknown_table; + ... + Got one of the listed errors + + But since it requires manual escaping, it does not seem + particularly dangerous or error-prone. + */ + DYNAMIC_STRING ds; + init_dynamic_string(&ds, 0, command->query_len + 64, 256); + do_eval(&ds, command->first_argument, command->end, !is_windows); + char *p= ds.str; + + uint count= 0; + char *next; + do { char *end; @@ -5319,11 +5340,15 @@ void do_get_errcodes(struct st_command *command) } while (*p); - command->last_argument= p; + command->last_argument= command->first_argument; + while (*command->last_argument) + command->last_argument++; + to->type= ERR_EMPTY; /* End of data */ DBUG_PRINT("info", ("Expected errors: %d", count)); saved_expected_errors.count= count; + dynstr_free(&ds); DBUG_VOID_RETURN; } @@ -7685,6 +7710,8 @@ void run_query_normal(struct st_connection *cn, struct st_command *command, */ if ((counter==0) && do_read_query_result(cn)) { + /* we've failed to collect the result set */ + cn->pending= TRUE; handle_error(command, mysql_errno(mysql), mysql_error(mysql), mysql_sqlstate(mysql), ds); goto end; diff --git a/cmake/cpack_rpm.cmake b/cmake/cpack_rpm.cmake index 8e70af6c5a9..e915e732612 100644 --- a/cmake/cpack_rpm.cmake +++ b/cmake/cpack_rpm.cmake @@ -65,6 +65,7 @@ SET(CPACK_RPM_SPEC_MORE_DEFINE "${CPACK_RPM_SPEC_MORE_DEFINE} SET(CPACK_RPM_PACKAGE_REQUIRES "MariaDB-common") SET(CPACK_RPM_server_USER_FILELIST "%ignore /etc" "%ignore /etc/init.d") +SET(CPACK_RPM_common_USER_FILELIST "%config(noreplace) /etc/my.cnf") SET(CPACK_RPM_client_PACKAGE_OBSOLETES "mysql-client MySQL-client MySQL-OurDelta-client") SET(CPACK_RPM_client_PACKAGE_PROVIDES "MariaDB-client MySQL-client mysql-client") diff --git a/cmake/os/WindowsCache.cmake b/cmake/os/WindowsCache.cmake index 8456cd69b0b..b93a1c12a2e 100644 --- a/cmake/os/WindowsCache.cmake +++ b/cmake/os/WindowsCache.cmake @@ -364,4 +364,7 @@ SET(HAVE_SOCKADDR_IN_SIN_LEN CACHE INTERNAL "") SET(HAVE_SOCKADDR_IN6_SIN6_LEN CACHE INTERNAL "") SET(HAVE_VALGRIND CACHE INTERNAL "") SET(HAVE_EVENT_H CACHE INTERNAL "") +SET(HAVE_LINUX_UNISTD_H CACHE INTERNAL "") +SET(HAVE_SYS_UTSNAME_H CACHE INTERNAL "") +SET(HAVE_PTHREAD_ATTR_GETGUARDSIZE CACHE INTERNAL "") ENDIF() diff --git a/cmake/readline.cmake b/cmake/readline.cmake index fd2e690fab9..285b436921e 100644 --- a/cmake/readline.cmake +++ b/cmake/readline.cmake @@ -109,6 +109,8 @@ MACRO (FIND_CURSES) ENDIF() ENDIF() ENDIF() + CHECK_LIBRARY_EXISTS(${CURSES_LIBRARY} setupterm "" HAVE_SETUPTERM) + CHECK_LIBRARY_EXISTS(${CURSES_LIBRARY} vidattr "" HAVE_VIDATTR) ENDMACRO() MACRO (MYSQL_USE_BUNDLED_READLINE) diff --git a/config.h.cmake b/config.h.cmake index 5f1614993c3..e6ec8b23b58 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -46,6 +46,7 @@ #cmakedefine HAVE_IEEEFP_H 1 #cmakedefine HAVE_INTTYPES_H 1 #cmakedefine HAVE_LIMITS_H 1 +#cmakedefine HAVE_LINUX_UNISTD_H 1 #cmakedefine HAVE_LOCALE_H 1 #cmakedefine HAVE_MALLOC_H 1 #cmakedefine HAVE_MEMORY_H 1 @@ -83,6 +84,7 @@ #cmakedefine HAVE_SYS_SHM_H 1 #cmakedefine HAVE_SYS_SOCKET_H 1 #cmakedefine HAVE_SYS_SOCKIO_H 1 +#cmakedefine HAVE_SYS_UTSNAME_H 1 #cmakedefine HAVE_SYS_STAT_H 1 #cmakedefine HAVE_SYS_STREAM_H 1 #cmakedefine HAVE_SYS_TERMCAP_H 1 @@ -130,6 +132,7 @@ #cmakedefine FIONREAD_IN_SYS_FILIO 1 /* Functions we may want to use. */ +#cmakedefine HAVE_ACCESS 1 #cmakedefine HAVE_AIOWAIT 1 #cmakedefine HAVE_ALARM 1 #cmakedefine HAVE_ALLOCA 1 @@ -151,6 +154,7 @@ #cmakedefine HAVE_FCONVERT 1 #cmakedefine HAVE_FDATASYNC 1 #cmakedefine HAVE_DECL_FDATASYNC 1 +#cmakedefine HAVE_FEDISABLEEXCEPT 1 #cmakedefine HAVE_FESETROUND 1 #cmakedefine HAVE_FINITE 1 #cmakedefine HAVE_FP_EXCEPT 1 @@ -175,6 +179,7 @@ #cmakedefine HAVE_GETWD 1 #cmakedefine HAVE_GMTIME_R 1 #cmakedefine gmtime_r @gmtime_r@ +#cmakedefine HAVE_IN_ADDR_T 1 #cmakedefine HAVE_INITGROUPS 1 #cmakedefine HAVE_ISSETUGID 1 #cmakedefine HAVE_GETUID 1 @@ -215,6 +220,7 @@ #cmakedefine HAVE_RDTSCLL 1 #cmakedefine HAVE_READ_REAL_TIME 1 #cmakedefine HAVE_PTHREAD_ATTR_CREATE 1 +#cmakedefine HAVE_PTHREAD_ATTR_GETGUARDSIZE 1 #cmakedefine HAVE_PTHREAD_ATTR_GETSTACKSIZE 1 #cmakedefine HAVE_PTHREAD_ATTR_SETPRIO 1 #cmakedefine HAVE_PTHREAD_ATTR_SETSCHEDPARAM 1 @@ -247,6 +253,7 @@ #cmakedefine HAVE_SETFD 1 #cmakedefine HAVE_SETENV 1 #cmakedefine HAVE_SETLOCALE 1 +#cmakedefine HAVE_SETUPTERM 1 #cmakedefine HAVE_SIGADDSET 1 #cmakedefine HAVE_SIGEMPTYSET 1 #cmakedefine HAVE_SIGHOLD 1 @@ -284,6 +291,7 @@ #cmakedefine HAVE_TIME 1 #cmakedefine HAVE_TIMES 1 #cmakedefine HAVE_VALLOC 1 +#cmakedefine HAVE_VIDATTR 1 #define HAVE_VIO_READ_BUFF 1 #cmakedefine HAVE_VASPRINTF 1 #cmakedefine HAVE_VPRINTF 1 diff --git a/configure.cmake b/configure.cmake index ff87d632055..5d44e0677d2 100644 --- a/configure.cmake +++ b/configure.cmake @@ -56,10 +56,10 @@ ENDIF() # Always enable -Wall for gnu C/C++ IF(CMAKE_COMPILER_IS_GNUCXX AND NOT CMAKE_CXX_FLAGS MATCHES ".*-Wall.*") - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-unused-parameter") + SET(CMAKE_CXX_FLAGS "-Wall ${CMAKE_CXX_FLAGS} -Wall -Wno-unused-parameter") ENDIF() IF(CMAKE_COMPILER_IS_GNUCC AND NOT CMAKE_C_FLAGS MATCHES ".*-Wall.*") - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall") + SET(CMAKE_C_FLAGS "-Wall ${CMAKE_C_FLAGS} -Wall") ENDIF() @@ -202,6 +202,7 @@ CHECK_INCLUDE_FILES (grp.h HAVE_GRP_H) CHECK_INCLUDE_FILES (ieeefp.h HAVE_IEEEFP_H) CHECK_INCLUDE_FILES (inttypes.h HAVE_INTTYPES_H) CHECK_INCLUDE_FILES (langinfo.h HAVE_LANGINFO_H) +CHECK_INCLUDE_FILES (linux/unistd.h HAVE_LINUX_UNISTD_H) CHECK_INCLUDE_FILES (limits.h HAVE_LIMITS_H) CHECK_INCLUDE_FILES (locale.h HAVE_LOCALE_H) CHECK_INCLUDE_FILES (malloc.h HAVE_MALLOC_H) @@ -261,6 +262,7 @@ CHECK_INCLUDE_FILES (vis.h HAVE_VIS_H) CHECK_INCLUDE_FILES (wchar.h HAVE_WCHAR_H) CHECK_INCLUDE_FILES (wctype.h HAVE_WCTYPE_H) CHECK_INCLUDE_FILES (sys/sockio.h HAVE_SYS_SOCKIO_H) +CHECK_INCLUDE_FILES (sys/utsname.h HAVE_SYS_UTSNAME_H) IF(BFD_H_EXISTS) IF(NOT_FOR_DISTRIBUTION) @@ -326,6 +328,7 @@ ENDIF() # # Tests for functions # +CHECK_FUNCTION_EXISTS (access HAVE_ACCESS) #CHECK_FUNCTION_EXISTS (aiowait HAVE_AIOWAIT) CHECK_FUNCTION_EXISTS (aio_read HAVE_AIO_READ) CHECK_FUNCTION_EXISTS (alarm HAVE_ALARM) @@ -554,6 +557,10 @@ IF(NOT SIZEOF_MODE_T) SET(mode_t int) ENDIF() +IF(HAVE_NETINET_IN_H) + SET(CMAKE_EXTRA_INCLUDE_FILES netinet/in.h) + MY_CHECK_TYPE_SIZE(in_addr_t IN_ADDR_T) +ENDIF(HAVE_NETINET_IN_H) IF(HAVE_STDINT_H) SET(CMAKE_EXTRA_INCLUDE_FILES stdint.h) diff --git a/dbug/dbug.c b/dbug/dbug.c index af0a937ff07..b285b32fa17 100644 --- a/dbug/dbug.c +++ b/dbug/dbug.c @@ -284,9 +284,6 @@ static int DoTrace(CODE_STATE *cs); /* Test to see if file is writable */ #if defined(HAVE_ACCESS) static BOOLEAN Writable(const char *pathname); - /* Change file owner and group */ -static void ChangeOwner(CODE_STATE *cs, char *pathname); - /* Allocate memory for runtime support */ #endif static void DoPrefix(CODE_STATE *cs, uint line); diff --git a/dbug/factorial.c b/dbug/factorial.c index 7b190ea8d8e..e1cb77f0e30 100644 --- a/dbug/factorial.c +++ b/dbug/factorial.c @@ -1,14 +1,3 @@ -#ifdef DBUG_OFF /* We are testing dbug */ - -int factorial(register int value) { - if(value > 1) { - value *= factorial(value-1); - } - return value; -} - -#else - #include <my_global.h> int factorial ( @@ -22,6 +11,3 @@ register int value) DBUG_PRINT ("result", ("result is %d", value)); DBUG_RETURN (value); } - -#endif - diff --git a/debian/additions/my.cnf b/debian/additions/my.cnf index fd9bcf19977..a27f8543f0b 100644 --- a/debian/additions/my.cnf +++ b/debian/additions/my.cnf @@ -65,7 +65,7 @@ max_heap_table_size = 32M myisam_recover = BACKUP key_buffer_size = 128M #open-files-limit = 2000 -table_cache = 400 +table_open_cache = 400 myisam_sort_buffer_size = 512M concurrent_insert = 2 read_buffer_size = 2M diff --git a/debian/autobake-deb.sh b/debian/autobake-deb.sh index d2288ee8b42..d4a1fa70d8c 100755 --- a/debian/autobake-deb.sh +++ b/debian/autobake-deb.sh @@ -37,6 +37,11 @@ case "${CODENAME}" in *) LIBREADLINE_DEV=libreadline-gplv2-dev ;; esac +case "${CODENAME}" in + etch|lenny|hardy|intrepid|jaunty|karmic) CMAKE_DEP='' ;; + *) CMAKE_DEP='cmake (>= 2.7), ' ;; +esac + # Clean up build file symlinks that are distro-specific. First remove all, then set # new links. DISTRODIRS="$(ls ./debian/dist)" @@ -53,7 +58,9 @@ echo "Copying distribution specific build files for ${DISTRO}" DISTROFILES="$(ls ./debian/dist/${DISTRO})" for distrofile in ${DISTROFILES}; do rm -f "./debian/${distrofile}" - sed -e "s/\\\${LIBREADLINE_DEV}/${LIBREADLINE_DEV}/g" < "./debian/dist/${DISTRO}/${distrofile}" > "./debian/${distrofile}" + sed -e "s/\\\${LIBREADLINE_DEV}/${LIBREADLINE_DEV}/g" \ + -e "s/\\\${CMAKE_DEP}/${CMAKE_DEP}/g" \ + < "./debian/dist/${DISTRO}/${distrofile}" > "./debian/${distrofile}" chmod --reference="./debian/dist/${DISTRO}/${distrofile}" "./debian/${distrofile}" done; diff --git a/debian/dist/Debian/control b/debian/dist/Debian/control index 7a324c93895..95bde727093 100644 --- a/debian/dist/Debian/control +++ b/debian/dist/Debian/control @@ -4,7 +4,7 @@ Priority: optional Maintainer: MariaDB Developers <maria-developers@lists.launchpad.net> XSBC-Original-Maintainer: Maria Developers <maria-developers@lists.launchpad.net> Uploaders: MariaDB Developers <maria-developers@lists.launchpad.net> -Build-Depends: libtool (>= 1.4.2-7), procps | hurd, debhelper, file (>= 3.28), libncurses5-dev (>= 5.0-6), perl (>= 5.6.0), libwrap0-dev (>= 7.6-8.3), zlib1g-dev (>= 1:1.1.3-5), ${LIBREADLINE_DEV}, libevent-dev, libssl-dev, libpam0g-dev, psmisc, po-debconf, chrpath, automake1.9, doxygen, texlive-latex-base, ghostscript | gs-gpl, dpatch, gawk, bison, lsb-release, hardening-wrapper +Build-Depends: libtool (>= 1.4.2-7), procps | hurd, debhelper, file (>= 3.28), libncurses5-dev (>= 5.0-6), perl (>= 5.6.0), libwrap0-dev (>= 7.6-8.3), zlib1g-dev (>= 1:1.1.3-5), ${LIBREADLINE_DEV}, libevent-dev, libssl-dev, libpam0g-dev, psmisc, po-debconf, chrpath, automake1.9, doxygen, texlive-latex-base, ghostscript | gs-gpl, dpatch, gawk, bison, lsb-release, hardening-wrapper, ${CMAKE_DEP}libaio-dev Standards-Version: 3.8.3 Homepage: http://mariadb.org/ Vcs-Browser: http://bazaar.launchpad.net/~maria-captains/maria/5.5/files diff --git a/debian/dist/Debian/mariadb-server-5.5.postinst b/debian/dist/Debian/mariadb-server-5.5.postinst index e3f2df13b4b..2e15b121db9 100644 --- a/debian/dist/Debian/mariadb-server-5.5.postinst +++ b/debian/dist/Debian/mariadb-server-5.5.postinst @@ -21,7 +21,7 @@ invoke() { fi } -MYSQL_BOOTSTRAP="/usr/sbin/mysqld --bootstrap --user=mysql --skip-grant-tables --loose-innodb=OFF --loose-pbxt=OFF --default-storage-engine=myisam" +MYSQL_BOOTSTRAP="/usr/sbin/mysqld --bootstrap --user=mysql --skip-grant-tables --loose-innodb=OFF --default-storage-engine=myisam" test_mysql_access() { mysql --no-defaults -u root -h localhost </dev/null >/dev/null 2>&1 diff --git a/debian/dist/Ubuntu/control b/debian/dist/Ubuntu/control index 8a8a93c37aa..70ef5fd2ecf 100644 --- a/debian/dist/Ubuntu/control +++ b/debian/dist/Ubuntu/control @@ -4,7 +4,7 @@ Priority: optional Maintainer: MariaDB Developers <maria-developers@lists.launchpad.net> XSBC-Original-Maintainer: Maria Developers <maria-developers@lists.launchpad.net> Uploaders: MariaDB Developers <maria-developers@lists.launchpad.net> -Build-Depends: libtool (>= 1.4.2-7), procps | hurd, debhelper, file (>= 3.28), libncurses5-dev (>= 5.0-6), perl (>= 5.6.0), libwrap0-dev (>= 7.6-8.3), zlib1g-dev (>= 1:1.1.3-5), ${LIBREADLINE_DEV}, libevent-dev, libssl-dev, libpam0g-dev, psmisc, po-debconf, chrpath, automake1.9, doxygen, texlive-latex-base, ghostscript | gs-gpl, dpatch, gawk, bison, lsb-release, hardening-wrapper +Build-Depends: libtool (>= 1.4.2-7), procps | hurd, debhelper, file (>= 3.28), libncurses5-dev (>= 5.0-6), perl (>= 5.6.0), libwrap0-dev (>= 7.6-8.3), zlib1g-dev (>= 1:1.1.3-5), ${LIBREADLINE_DEV}, libevent-dev, libssl-dev, libpam0g-dev, psmisc, po-debconf, chrpath, automake1.9, doxygen, texlive-latex-base, ghostscript | gs-gpl, dpatch, gawk, bison, lsb-release, hardening-wrapper, ${CMAKE_DEP}libaio-dev Standards-Version: 3.8.2 Homepage: http://mariadb.org/ Vcs-Browser: http://bazaar.launchpad.net/~maria-captains/maria/5.5/files diff --git a/debian/dist/Ubuntu/mariadb-server-5.5.postinst b/debian/dist/Ubuntu/mariadb-server-5.5.postinst index a0c351194bb..1c7aa37f69f 100644 --- a/debian/dist/Ubuntu/mariadb-server-5.5.postinst +++ b/debian/dist/Ubuntu/mariadb-server-5.5.postinst @@ -21,7 +21,7 @@ invoke() { fi } -MYSQL_BOOTSTRAP="/usr/sbin/mysqld --bootstrap --user=mysql --skip-grant-tables --loose-innodb=OFF --loose-pbxt=OFF --default-storage-engine=myisam" +MYSQL_BOOTSTRAP="/usr/sbin/mysqld --bootstrap --user=mysql --skip-grant-tables --loose-innodb=OFF --default-storage-engine=myisam" test_mysql_access() { mysql --no-defaults -u root -h localhost </dev/null >/dev/null 2>&1 diff --git a/debian/mariadb-client-5.5.files b/debian/mariadb-client-5.5.files index 9cb949ea53e..335f736d680 100644 --- a/debian/mariadb-client-5.5.files +++ b/debian/mariadb-client-5.5.files @@ -11,6 +11,7 @@ usr/bin/mysqlimport usr/bin/mysqlreport usr/bin/mysqlshow usr/bin/mysqlslap +usr/bin/mytop usr/bin/mysql_waitpid usr/share/lintian/overrides/mariadb-client-5.5 usr/share/man/man1/innotop.1 diff --git a/extra/resolveip.c b/extra/resolveip.c index 871fd31482e..b6840d9d463 100644 --- a/extra/resolveip.c +++ b/extra/resolveip.c @@ -25,9 +25,7 @@ #ifndef WIN32 # include <sys/types.h> # include <sys/socket.h> -# ifndef HAVE_BROKEN_NETINET_INCLUDES -# include <netinet/in.h> -# endif +# include <netinet/in.h> # include <arpa/inet.h> # include <netdb.h> #endif diff --git a/extra/yassl/taocrypt/src/asn.cpp b/extra/yassl/taocrypt/src/asn.cpp index a502666d15b..5ec4cac1c44 100644 --- a/extra/yassl/taocrypt/src/asn.cpp +++ b/extra/yassl/taocrypt/src/asn.cpp @@ -758,6 +758,10 @@ void CertDecoder::GetName(NameType nt) while (source_.get_index() < length) { GetSet(); + if (source_.GetError().What() == SET_E) { + source_.SetError(NO_ERROR_E); // extensions may only have sequence + source_.prev(); + } GetSequence(); byte b = source_.next(); diff --git a/extra/yassl/taocrypt/src/dsa.cpp b/extra/yassl/taocrypt/src/dsa.cpp index a4e9c9503e7..7b882b10cd1 100644 --- a/extra/yassl/taocrypt/src/dsa.cpp +++ b/extra/yassl/taocrypt/src/dsa.cpp @@ -184,7 +184,7 @@ word32 DSA_Signer::Sign(const byte* sha_digest, byte* sig, s_ = (kInv * (H + x*r_)) % q; if (!(!!r_ && !!s_)) - return -1; + return (word32) -1; int rSz = r_.ByteCount(); diff --git a/include/atomic/nolock.h b/include/atomic/nolock.h index 1da184158ab..56f37644f96 100644 --- a/include/atomic/nolock.h +++ b/include/atomic/nolock.h @@ -36,7 +36,7 @@ choose the Solaris implementation on Solaris (mainly for SunStudio compilers). */ -# if defined(_MSV_VER) +# if defined(_MSC_VER) # include "generic-msvc.h" # elif __GNUC__ # if defined(HAVE_SOLARIS_ATOMIC) diff --git a/include/m_string.h b/include/m_string.h index 9fc6cda4764..9efa0376942 100644 --- a/include/m_string.h +++ b/include/m_string.h @@ -62,13 +62,9 @@ # define bmove_align(A,B,C) memcpy((A),(B),(C)) -#if !defined(HAVE_BCMP) # define bcmp(A,B,C) memcmp((A),(B),(C)) -#endif -#if !defined(bzero) && (!defined(HAVE_BZERO) || !HAVE_DECL_BZERO || defined(_AIX)) -/* See autoconf doku: "HAVE_DECL_symbol" will be defined after configure, to 0 or 1 */ -/* AIX has bzero() as a function, but the declaration prototype is strangely hidden */ +#if !defined(bzero) # define bzero(A,B) memset((A),0,(B)) #endif diff --git a/include/my_getopt.h b/include/my_getopt.h index 61c4b054615..a56be90f455 100644 --- a/include/my_getopt.h +++ b/include/my_getopt.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2002, 2011, Oracle and/or its affiliates. + Copyright (c) 2002, 2012, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -79,7 +79,7 @@ struct my_option enum get_opt_arg_type arg_type; /**< e.g. REQUIRED_ARG or OPT_ARG */ longlong def_value; /**< Default value */ longlong min_value; /**< Min allowed value (for numbers) */ - longlong max_value; /**< Max allowed value (for numbers) */ + ulonglong max_value; /**< Max allowed value (for numbers) */ longlong sub_size; /**< Unused */ long block_size; /**< Value should be a mult. of this (for numbers) */ void *app_type; /**< To be used by an application */ diff --git a/include/my_global.h b/include/my_global.h index a5fa57dbfe3..09a3a0a6efd 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -229,11 +229,6 @@ #include <sys/types.h> #endif -#ifdef HAVE_THREADS_WITHOUT_SOCKETS -/* MIT pthreads does not work with unix sockets */ -#undef HAVE_SYS_UN_H -#endif - #define __EXTENSIONS__ 1 /* We want some extension */ #ifndef __STDC_EXT__ #define __STDC_EXT__ 1 /* To get large file support on hpux */ @@ -306,18 +301,6 @@ inline double my_ulonglong2double(unsigned long long A) { return (double A); } C_MODE_END #endif /* _AIX */ -#ifdef HAVE_BROKEN_SNPRINTF /* HPUX 10.20 don't have this defined */ -#undef HAVE_SNPRINTF -#endif -#ifdef HAVE_BROKEN_PREAD -/* - pread()/pwrite() are not 64 bit safe on HP-UX 11.0 without - installing the kernel patch PHKL_20349 or greater -*/ -#undef HAVE_PREAD -#undef HAVE_PWRITE -#endif - #ifdef UNDEF_HAVE_INITGROUPS /* For AIX 4.3 */ #undef HAVE_INITGROUPS #endif @@ -823,18 +806,7 @@ inline unsigned long long my_double2ulonglong(double d) #endif #ifdef HAVE_ISINF -/* Check if C compiler is affected by GCC bug #39228 */ -#if !defined(__cplusplus) && defined(HAVE_BROKEN_ISINF) -/* Force store/reload of the argument to/from a 64-bit double */ -static inline double my_isinf(double x) -{ - volatile double t= x; - return isinf(t); -} -#else -/* System-provided isinf() is available and safe to use */ #define my_isinf(X) isinf(X) -#endif #else /* !HAVE_ISINF */ #define my_isinf(X) (!finite(X) && !isnan(X)) #endif diff --git a/include/my_net.h b/include/my_net.h index ce2ee6ce8ca..0ad3ebf0f30 100644 --- a/include/my_net.h +++ b/include/my_net.h @@ -43,7 +43,7 @@ C_MODE_START #include <sys/ioctl.h> #endif -#if !defined(__WIN__) && !defined(HAVE_BROKEN_NETINET_INCLUDES) +#if !defined(__WIN__) #include <netinet/in_systm.h> #include <netinet/in.h> #include <netinet/ip.h> diff --git a/include/my_pthread.h b/include/my_pthread.h index 21c85c633d6..404d5fb5258 100644 --- a/include/my_pthread.h +++ b/include/my_pthread.h @@ -200,28 +200,13 @@ extern int my_pthread_create_detached; int sigwait(sigset_t *set, int *sig); #endif -#ifndef HAVE_NONPOSIX_SIGWAIT #define my_sigwait(A,B) sigwait((A),(B)) -#else -int my_sigwait(const sigset_t *set,int *sig); -#endif - -#ifdef HAVE_NONPOSIX_PTHREAD_MUTEX_INIT -#ifndef SAFE_MUTEX -#define pthread_mutex_init(a,b) my_pthread_mutex_noposix_init((a),(b)) -extern int my_pthread_mutex_noposix_init(pthread_mutex_t *mp, - const pthread_mutexattr_t *attr); -#endif /* SAFE_MUTEX */ -#define pthread_cond_init(a,b) my_pthread_cond_noposix_init((a),(b)) -extern int my_pthread_cond_noposix_init(pthread_cond_t *mp, - const pthread_condattr_t *attr); -#endif /* HAVE_NONPOSIX_PTHREAD_MUTEX_INIT */ #if defined(HAVE_SIGTHREADMASK) && !defined(HAVE_PTHREAD_SIGMASK) #define pthread_sigmask(A,B,C) sigthreadmask((A),(B),(C)) #endif -#if !defined(HAVE_SIGWAIT) && !defined(HAVE_rts_threads) && !defined(sigwait) && !defined(alpha_linux_port) && !defined(HAVE_NONPOSIX_SIGWAIT) && !defined(HAVE_DEC_3_2_THREADS) && !defined(_AIX) +#if !defined(HAVE_SIGWAIT) && !defined(HAVE_rts_threads) && !defined(sigwait) && !defined(alpha_linux_port) && !defined(_AIX) int sigwait(sigset_t *setp, int *sigp); /* Use our implemention */ #endif @@ -247,24 +232,12 @@ int sigwait(sigset_t *setp, int *sigp); /* Use our implemention */ #define my_sigset(A,B) signal((A),(B)) #endif -#if !defined(HAVE_PTHREAD_ATTR_SETSCOPE) || defined(HAVE_DEC_3_2_THREADS) +#if !defined(HAVE_PTHREAD_ATTR_SETSCOPE) #define pthread_attr_setscope(A,B) #undef HAVE_GETHOSTBYADDR_R /* No definition */ #endif -#if defined(HAVE_BROKEN_PTHREAD_COND_TIMEDWAIT) && !defined(SAFE_MUTEX) -extern int my_pthread_cond_timedwait(pthread_cond_t *cond, - pthread_mutex_t *mutex, - struct timespec *abstime); -#define pthread_cond_timedwait(A,B,C) my_pthread_cond_timedwait((A),(B),(C)) -#endif - -#if !defined( HAVE_NONPOSIX_PTHREAD_GETSPECIFIC) #define my_pthread_getspecific(A,B) ((A) pthread_getspecific(B)) -#else -#define my_pthread_getspecific(A,B) ((A) my_pthread_getspecific_imp(B)) -void *my_pthread_getspecific_imp(pthread_key_t key); -#endif #ifndef HAVE_LOCALTIME_R struct tm *localtime_r(const time_t *clock, struct tm *res); @@ -285,34 +258,7 @@ struct tm *gmtime_r(const time_t *clock, struct tm *res); #define pthread_key_delete(A) pthread_dummy(0) #endif -#ifdef HAVE_CTHREADS_WRAPPER /* For MacOSX */ -#define pthread_cond_destroy(A) pthread_dummy(0) -#define pthread_mutex_destroy(A) pthread_dummy(0) -#define pthread_attr_delete(A) pthread_dummy(0) -#define pthread_condattr_delete(A) pthread_dummy(0) -#define pthread_attr_setstacksize(A,B) pthread_dummy(0) -#define pthread_equal(A,B) ((A) == (B)) -#define pthread_cond_timedwait(a,b,c) pthread_cond_wait((a),(b)) -#define pthread_attr_init(A) pthread_attr_create(A) -#define pthread_attr_destroy(A) pthread_attr_delete(A) -#define pthread_attr_setdetachstate(A,B) pthread_dummy(0) -#define pthread_create(A,B,C,D) pthread_create((A),*(B),(C),(D)) -#define pthread_sigmask(A,B,C) sigprocmask((A),(B),(C)) -#define pthread_kill(A,B) pthread_dummy((A) ? 0 : ESRCH) -#undef pthread_detach_this_thread -#define pthread_detach_this_thread() { pthread_t tmp=pthread_self() ; pthread_detach(&tmp); } -#endif - -#ifdef HAVE_DARWIN5_THREADS -#define pthread_sigmask(A,B,C) sigprocmask((A),(B),(C)) -#define pthread_kill(A,B) pthread_dummy((A) ? 0 : ESRCH) -#define pthread_condattr_init(A) pthread_dummy(0) -#define pthread_condattr_destroy(A) pthread_dummy(0) -#undef pthread_detach_this_thread -#define pthread_detach_this_thread() { pthread_t tmp=pthread_self() ; pthread_detach(tmp); } -#endif - -#if ((defined(HAVE_PTHREAD_ATTR_CREATE) && !defined(HAVE_SIGWAIT)) || defined(HAVE_DEC_3_2_THREADS)) && !defined(HAVE_CTHREADS_WRAPPER) +#if defined(HAVE_PTHREAD_ATTR_CREATE) && !defined(HAVE_SIGWAIT) /* This is set on AIX_3_2 and Siemens unix (and DEC OSF/1 3.2 too) */ #define pthread_key_create(A,B) \ pthread_keycreate(A,(B) ?\ @@ -352,7 +298,7 @@ void my_pthread_attr_getstacksize(pthread_attr_t *attrib, size_t *size); int my_pthread_mutex_trylock(pthread_mutex_t *mutex); #endif -#if !defined(HAVE_PTHREAD_YIELD_ONE_ARG) && !defined(HAVE_PTHREAD_YIELD_ZERO_ARG) +#if !defined(HAVE_PTHREAD_YIELD_ZERO_ARG) /* no pthread_yield() available */ #ifdef HAVE_SCHED_YIELD #define pthread_yield() sched_yield() @@ -541,12 +487,6 @@ int my_pthread_fastmutex_lock(my_pthread_fastmutex_t *mp); /* READ-WRITE thread locking */ -#ifdef HAVE_BROKEN_RWLOCK /* For OpenUnix */ -#undef HAVE_PTHREAD_RWLOCK_RDLOCK -#undef HAVE_RWLOCK_INIT -#undef HAVE_RWLOCK_T -#endif - #if defined(USE_MUTEX_INSTEAD_OF_RW_LOCKS) /* use these defs for simple mutex locking */ #define rw_lock_t pthread_mutex_t diff --git a/include/my_sys.h b/include/my_sys.h index e10cedfb654..3d600de66fd 100644 --- a/include/my_sys.h +++ b/include/my_sys.h @@ -629,6 +629,7 @@ extern FILE *my_freopen(const char *path, const char *mode, FILE *stream); extern int my_fclose(FILE *fd,myf MyFlags); extern int my_vfprintf(FILE *stream, const char* format, va_list args); extern void my_strerror(char *buf, size_t len, int nr); +extern int my_fprintf(FILE *stream, const char* format, ...); extern File my_fileno(FILE *fd); extern int my_chsize(File fd,my_off_t newlength, int filler, myf MyFlags); extern int my_chmod(const char *name, mode_t mode, myf my_flags); @@ -753,6 +754,8 @@ extern size_t my_b_fill(IO_CACHE *info); extern void my_b_seek(IO_CACHE *info,my_off_t pos); extern size_t my_b_gets(IO_CACHE *info, char *to, size_t max_length); extern my_off_t my_b_filelength(IO_CACHE *info); +extern size_t my_b_write_backtick_quote(IO_CACHE *info, const char *str, + size_t len); extern size_t my_b_printf(IO_CACHE *info, const char* fmt, ...); extern size_t my_b_vprintf(IO_CACHE *info, const char* fmt, va_list ap); extern my_bool open_cached_file(IO_CACHE *cache,const char *dir, diff --git a/include/sql_common.h b/include/sql_common.h index cd32a77f86e..a1c9faac82d 100644 --- a/include/sql_common.h +++ b/include/sql_common.h @@ -1,7 +1,7 @@ #ifndef SQL_COMMON_INCLUDED #define SQL_COMMON_INCLUDED -/* Copyright (c) 2003, 2010, Oracle and/or its affiliates. - Copyright (c) 2010, 2011, Monty Program Ab +/* Copyright (c) 2003, 2012, Oracle and/or its affiliates. + Copyright (c) 2010, 2012, Monty Program Ab This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -80,8 +80,9 @@ typedef struct st_mysql_methods 0, arg, length, 1, stmt) extern CHARSET_INFO *default_client_charset_info; -MYSQL_FIELD *unpack_fields(MYSQL_DATA *data,MEM_ROOT *alloc,uint fields, - my_bool default_value, uint server_capabilities); +MYSQL_FIELD *unpack_fields(MYSQL *mysql, MYSQL_DATA *data,MEM_ROOT *alloc, + uint fields, my_bool default_value, + uint server_capabilities); void free_rows(MYSQL_DATA *cur); void free_old_query(MYSQL *mysql); void end_server(MYSQL *mysql); diff --git a/libmysql/get_password.c b/libmysql/get_password.c index a10d112ccd0..16f6b25822d 100644 --- a/libmysql/get_password.c +++ b/libmysql/get_password.c @@ -26,10 +26,6 @@ #include <m_string.h> #include <m_ctype.h> -#if defined(HAVE_BROKEN_GETPASS) && !defined(HAVE_GETPASSPHRASE) -#undef HAVE_GETPASS -#endif - #ifdef HAVE_GETPASS #ifdef HAVE_PWD_H #include <pwd.h> diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index 230376bc3b0..f90cc96a90f 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -1,4 +1,5 @@ -/* Copyright (c) 2000, 2011, Oracle and/or its affiliates +/* Copyright (c) 2000, 2012, Oracle and/or its affiliates + Copyright (c) 2009, 2012, Monty Program Ab This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -811,7 +812,7 @@ MYSQL_FIELD *cli_list_fields(MYSQL *mysql) return NULL; mysql->field_count= (uint) query->rows; - return unpack_fields(query,&mysql->field_alloc, + return unpack_fields(mysql, query,&mysql->field_alloc, mysql->field_count, 1, mysql->server_capabilities); } @@ -871,7 +872,7 @@ mysql_list_processes(MYSQL *mysql) if (!(fields = (*mysql->methods->read_rows)(mysql,(MYSQL_FIELD*) 0, protocol_41(mysql) ? 7 : 5))) DBUG_RETURN(NULL); - if (!(mysql->fields=unpack_fields(fields,&mysql->field_alloc,field_count,0, + if (!(mysql->fields=unpack_fields(mysql, fields,&mysql->field_alloc,field_count,0, mysql->server_capabilities))) DBUG_RETURN(0); mysql->status=MYSQL_STATUS_GET_RESULT; @@ -1456,7 +1457,7 @@ my_bool cli_read_prepare_result(MYSQL *mysql, MYSQL_STMT *stmt) if (!(fields_data= (*mysql->methods->read_rows)(mysql,(MYSQL_FIELD*)0,7))) DBUG_RETURN(1); - if (!(stmt->fields= unpack_fields(fields_data,&stmt->mem_root, + if (!(stmt->fields= unpack_fields(mysql, fields_data,&stmt->mem_root, field_count,0, mysql->server_capabilities))) DBUG_RETURN(1); diff --git a/libmysqld/examples/CMakeLists.txt b/libmysqld/examples/CMakeLists.txt index 146e51d79c7..559b1d9ae32 100644 --- a/libmysqld/examples/CMakeLists.txt +++ b/libmysqld/examples/CMakeLists.txt @@ -15,9 +15,9 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/libmysqld/include - ${CMAKE_SOURCE_DIR}/regex + ${CMAKE_SOURCE_DIR}/regex ${CMAKE_SOURCE_DIR}/sql - ${MY_READLINE_INCLUDE_DIR} + ${MY_READLINE_INCLUDE_DIR} ) diff --git a/man/CMakeLists.txt b/man/CMakeLists.txt index d7ef1fae0bf..37f454c6d34 100644 --- a/man/CMakeLists.txt +++ b/man/CMakeLists.txt @@ -21,7 +21,7 @@ SET(MAN1_SERVER innochecksum.1 my_print_defaults.1 myisam_ftdump.1 myisamchk.1 mysql_tzinfo_to_sql.1 mysql_upgrade.1 mysql_zap.1 mysqld_multi.1 mysqld_safe.1 mysqldumpslow.1 mysqlhotcopy.1 mysqlman.1 mysqltest.1 perror.1 replace.1 resolve_stack_dump.1 - resolveip.1) + resolveip.1 mysqlbug.1) SET(MAN8_SERVER mysqld.8 mysqlmanager.8) SET(MAN1_CLIENT msql2mysql.1 mysql.1 mysql_find_rows.1 mysql_waitpid.1 mysqlaccess.1 mysqladmin.1 mysqlbinlog.1 mysqlcheck.1 diff --git a/mysql-test/include/mysqlbinlog_have_debug.inc b/mysql-test/include/mysqlbinlog_have_debug.inc new file mode 100644 index 00000000000..14da1379ecd --- /dev/null +++ b/mysql-test/include/mysqlbinlog_have_debug.inc @@ -0,0 +1,34 @@ +############################################# +# checks if mysqlbinlog is debug compiled +# this "cannot" be done simply by using +# have_debug.inc +############################################# + +--disable_query_log +--let $temp_out_help_file=$MYSQL_TMP_DIR/mysqlbinlog_help.tmp +--exec $MYSQL_BINLOG --help>$temp_out_help_file +let log_tmp=$temp_out_help_file; +--let $temp_inc=$MYSQL_TMP_DIR/temp.inc +let inc_tmp=$temp_inc; + +--perl +use strict; +my $tmp_file= $ENV{'log_tmp'} or die "log_tmp not set"; +open(FILE, "$tmp_file") or die("Unable to open $tmp_file: $!\n"); +my $count = () = grep(/Output debug log/g,<FILE>); +close FILE; + +my $temp_inc= $ENV{'inc_tmp'} or die "temp_inc not set"; +open(FILE_INC,">", "$temp_inc") or die("can't open file \"$temp_inc\": $!"); +print FILE_INC '--let $is_debug= '.$count; +close FILE_INC; +EOF +--source $temp_inc + +if (!$is_debug) +{ + --skip mysqlbinlog needs to be debug compiled +} +--remove_file $temp_out_help_file +--remove_file $temp_inc +--enable_query_log diff --git a/mysql-test/include/query_cache_partitions.inc b/mysql-test/include/query_cache_partitions.inc new file mode 100644 index 00000000000..e5bb7406c10 --- /dev/null +++ b/mysql-test/include/query_cache_partitions.inc @@ -0,0 +1,126 @@ +# include/query_cache_partitions.inc +# +# The variables +# $engine_type -- storage engine to be tested +# have to be set before sourcing this script. + +eval SET SESSION STORAGE_ENGINE = $engine_type; + +# Initialise +--disable_warnings +drop table if exists t1; +--enable_warnings + +set @save_query_cache_size = @@global.query_cache_size; + +--echo # Test that partitions works with query cache + +flush query cache; + +SET GLOBAL query_cache_size=1024*1024*512; + CREATE TABLE `t1` ( + `id` int(11) NOT NULL , + `created_at` datetime NOT NULL, + `cool` tinyint default 0 + ); + + ALTER TABLE t1 PARTITION BY RANGE (TO_DAYS(created_at)) ( + PARTITION month_2010_4 VALUES LESS THAN (734258), + PARTITION month_2010_5 VALUES LESS THAN (734289), + PARTITION month_max VALUES LESS THAN MAXVALUE + ); + +show create table t1; + +INSERT INTO t1 VALUES (1, now(), 0); + +flush status; +show status like "Qcache_queries_in_cache"; +show status like "Qcache_hits"; + + +SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1; +SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1; +SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1; + +show status like "Qcache_queries_in_cache"; +show status like "Qcache_hits"; + +drop table t1; + +--echo # Test that sub-partitions works with query cache + +flush query cache; + +SET GLOBAL query_cache_size=1024*1024*512; + CREATE TABLE `t1` ( + `id` int(11) NOT NULL , + `created_at` datetime NOT NULL, + `cool` tinyint default 0 + ) + PARTITION BY RANGE (TO_DAYS(created_at)) + subpartition by hash(cool) subpartitions 3 ( + PARTITION month_2010_4 VALUES LESS THAN (734258), + PARTITION month_2010_5 VALUES LESS THAN (734289), + PARTITION month_max VALUES LESS THAN MAXVALUE + ); + +show create table t1; + +INSERT INTO t1 VALUES (1, now(), 0); + +flush status; +show status like "Qcache_queries_in_cache"; +show status like "Qcache_hits"; + +SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1; +SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1; +SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1; + +show status like "Qcache_queries_in_cache"; +show status like "Qcache_hits"; + +drop table t1; + +--echo # +--echo # MySQL bug#53775 Query on partitioned table returns cached result +--echo # from previous transaction +--echo # + +flush query cache; +flush status; + +SET GLOBAL query_cache_size=1024*1024*512; + CREATE TABLE `t1` ( + `id` int(11) NOT NULL , + `created_at` datetime NOT NULL, + `cool` tinyint default 0 + ); + + ALTER TABLE t1 PARTITION BY RANGE (TO_DAYS(created_at)) ( + PARTITION month_2010_4 VALUES LESS THAN (734258), + PARTITION month_2010_5 VALUES LESS THAN (734289), + PARTITION month_max VALUES LESS THAN MAXVALUE + ); + +INSERT INTO t1 VALUES (1, now(), 0); + +show status like "Qcache_queries_in_cache"; +show status like "Qcache_hits"; + +BEGIN; +UPDATE `t1` SET `cool` = 1 WHERE `id` = 1; +SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1; +ROLLBACK; +SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1; +BEGIN; +SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1; +ROLLBACK; +SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1; + +show status like "Qcache_queries_in_cache"; +show status like "Qcache_hits"; + +drop table t1; + +set @@global.query_cache_size = @save_query_cache_size; diff --git a/mysql-test/lib/mtr_cases.pm b/mysql-test/lib/mtr_cases.pm index 160fdcd935b..a8db67f1e67 100644 --- a/mysql-test/lib/mtr_cases.pm +++ b/mysql-test/lib/mtr_cases.pm @@ -472,11 +472,13 @@ sub process_suite { else { my @combs; - @combs = combinations_from_file($parent, "$suitedir/combinations") - unless $suite->{skip}; + my $from = "$suitedir/combinations"; + @combs = combinations_from_file($parent, $from) unless $suite->{skip}; $suite->{combinations} = [ @combs ]; # in overlays it's a union of parent's and overlay's files. - unshift @{$suite->{combinations}}, @{$parent->{combinations}} if $parent; + unshift @{$suite->{combinations}}, + grep { not $skip_combinations{"$from => $_->{name}"} } + @{$parent->{combinations}} if $parent; } # suite.opt @@ -1039,8 +1041,11 @@ sub get_tags_from_file($$) { $suite = load_suite_for_file($comb_file) if $prefix[0] eq ''; my @comb; unless ($suite->{skip}) { - @comb = combinations_from_file($over, "$prefix[0]$comb_file"); - push @comb, combinations_from_file(undef, "$prefix[1]$comb_file") if $over; + my $from = "$prefix[0]$comb_file"; + @comb = combinations_from_file($over, $from); + push @comb, + grep { not $skip_combinations{"$from => $_->{name}"} } + combinations_from_file(undef, "$prefix[1]$comb_file") if $over; } push @combinations, [ @comb ]; diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 35d428a9681..8c4013e1c24 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -1147,7 +1147,6 @@ sub command_line_setup { 'start-from=s' => \&collect_option, 'big-test+' => \$opt_big_test, 'combination=s' => \@opt_combinations, - 'skip-combinations' => \&collect_option, 'experimental=s' => \@opt_experimentals, # skip-im is deprecated and silently ignored 'skip-im' => \&ignore_option, @@ -6262,7 +6261,6 @@ Options to control what engine/variation to run all generated configs combination=<opt> Use at least twice to run tests with specified options to mysqld - skip-combinations Ignore combination file (or options) Options to control directories to use tmpdir=DIR The directory where temporary files are stored diff --git a/mysql-test/r/case.result b/mysql-test/r/case.result index a95975f1097..3852da5d4b0 100644 --- a/mysql-test/r/case.result +++ b/mysql-test/r/case.result @@ -220,6 +220,10 @@ a d 3 11120436154190595086 drop table t1, t2; End of 5.0 tests +CREATE TABLE t1(a YEAR); +SELECT 1 FROM t1 WHERE a=1 AND CASE 1 WHEN a THEN 1 ELSE 1 END; +1 +DROP TABLE t1; create table t1 (f1 time); insert t1 values ('00:00:00'),('00:01:00'); select case t1.f1 when '00:00:00' then 1 end from t1; diff --git a/mysql-test/r/compare.result b/mysql-test/r/compare.result index 6ee01349022..cdd234f1478 100644 --- a/mysql-test/r/compare.result +++ b/mysql-test/r/compare.result @@ -96,3 +96,7 @@ SELECT * FROM t1 WHERE a > '2008-01-01' AND a = '0000-00-00'; a DROP TABLE t1; End of 5.0 tests +CREATE TABLE t1(a INT ZEROFILL); +SELECT 1 FROM t1 WHERE t1.a IN (1, t1.a) AND t1.a=2; +1 +DROP TABLE t1; diff --git a/mysql-test/r/create-big.result b/mysql-test/r/create-big.result index 34293d7e5cd..4cce5d8618c 100644 --- a/mysql-test/r/create-big.result +++ b/mysql-test/r/create-big.result @@ -53,8 +53,8 @@ set debug_sync='create_table_select_before_create SIGNAL parked WAIT_FOR go'; create table t1 select 1 as i;; set debug_sync='now WAIT_FOR parked'; alter table t3 rename to t1; -ERROR 42S01: Table 't1' already exists set debug_sync='now SIGNAL go'; +ERROR 42S01: Table 't1' already exists show create table t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -65,8 +65,8 @@ set debug_sync='create_table_select_before_create SIGNAL parked WAIT_FOR go'; create table t1 select 1 as i;; set debug_sync='now WAIT_FOR parked'; alter table t3 rename to t1, add k int; -ERROR 42S01: Table 't1' already exists set debug_sync='now SIGNAL go'; +ERROR 42S01: Table 't1' already exists show create table t1; Table Create Table t1 CREATE TABLE `t1` ( diff --git a/mysql-test/r/ctype_binary.result b/mysql-test/r/ctype_binary.result index 1cb4b48ed69..c897108f793 100644 --- a/mysql-test/r/ctype_binary.result +++ b/mysql-test/r/ctype_binary.result @@ -2039,6 +2039,8 @@ hex(concat(a)) a 30303030303030303030303030303031303030302E31 00000000000000010000.1 drop table t1; create table t1 (a year(2)); +Warnings: +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead insert into t1 values (1); select hex(concat(a)) from t1; hex(concat(a)) @@ -2352,6 +2354,8 @@ hex(a) drop table t1; drop view v1; create table t1 (a year(2)); +Warnings: +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead insert into t1 values (1); create view v1(a) as select concat(a) from t1; show columns from v1; diff --git a/mysql-test/r/ctype_cp1251.result b/mysql-test/r/ctype_cp1251.result index 3d695a87701..5323469dff3 100644 --- a/mysql-test/r/ctype_cp1251.result +++ b/mysql-test/r/ctype_cp1251.result @@ -2431,6 +2431,8 @@ hex(concat(a)) a 30303030303030303030303030303031303030302E31 00000000000000010000.1 drop table t1; create table t1 (a year(2)); +Warnings: +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead insert into t1 values (1); select hex(concat(a)) from t1; hex(concat(a)) @@ -2744,6 +2746,8 @@ hex(a) drop table t1; drop view v1; create table t1 (a year(2)); +Warnings: +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead insert into t1 values (1); create view v1(a) as select concat(a) from t1; show columns from v1; diff --git a/mysql-test/r/ctype_latin1.result b/mysql-test/r/ctype_latin1.result index e2169e4e4e2..ae459fce8eb 100644 --- a/mysql-test/r/ctype_latin1.result +++ b/mysql-test/r/ctype_latin1.result @@ -2458,6 +2458,8 @@ hex(concat(a)) a 30303030303030303030303030303031303030302E31 00000000000000010000.1 drop table t1; create table t1 (a year(2)); +Warnings: +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead insert into t1 values (1); select hex(concat(a)) from t1; hex(concat(a)) @@ -2771,6 +2773,8 @@ hex(a) drop table t1; drop view v1; create table t1 (a year(2)); +Warnings: +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead insert into t1 values (1); create view v1(a) as select concat(a) from t1; show columns from v1; diff --git a/mysql-test/r/ctype_ucs.result b/mysql-test/r/ctype_ucs.result index 501b9cb611b..d463ce87c92 100644 --- a/mysql-test/r/ctype_ucs.result +++ b/mysql-test/r/ctype_ucs.result @@ -3341,6 +3341,8 @@ hex(concat(a)) a 00300030003000300030003000300030003000300030003000300030003000310030003000300030002E0031 00000000000000010000.1 drop table t1; create table t1 (a year(2)); +Warnings: +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead insert into t1 values (1); select hex(concat(a)) from t1; hex(concat(a)) @@ -3654,6 +3656,8 @@ hex(a) drop table t1; drop view v1; create table t1 (a year(2)); +Warnings: +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead insert into t1 values (1); create view v1(a) as select concat(a) from t1; show columns from v1; diff --git a/mysql-test/r/ctype_utf32.result b/mysql-test/r/ctype_utf32.result index 03f60261450..6cf24d768f7 100644 --- a/mysql-test/r/ctype_utf32.result +++ b/mysql-test/r/ctype_utf32.result @@ -1182,5 +1182,11 @@ a 256 Warnings: Warning 1260 Row 1 was cut by GROUP_CONCAT() # +# incorrect charset for val_str_ascii +# +SELECT '2010-10-10 10:10:10' + INTERVAL GeometryType(GeomFromText('POINT(1 1)')) hour_second; +'2010-10-10 10:10:10' + INTERVAL GeometryType(GeomFromText('POINT(1 1)')) hour_second +2010-10-10 10:10:10 +# # End of 5.5 tests # diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result index 4dd9d787528..69e32977103 100644 --- a/mysql-test/r/ctype_utf8.result +++ b/mysql-test/r/ctype_utf8.result @@ -4197,6 +4197,8 @@ hex(concat(a)) a 30303030303030303030303030303031303030302E31 00000000000000010000.1 drop table t1; create table t1 (a year(2)); +Warnings: +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead insert into t1 values (1); select hex(concat(a)) from t1; hex(concat(a)) @@ -4510,6 +4512,8 @@ hex(a) drop table t1; drop view v1; create table t1 (a year(2)); +Warnings: +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead insert into t1 values (1); create view v1(a) as select concat(a) from t1; show columns from v1; diff --git a/mysql-test/r/explain.result b/mysql-test/r/explain.result index e081b56e6ce..919e29f185e 100644 --- a/mysql-test/r/explain.result +++ b/mysql-test/r/explain.result @@ -287,7 +287,7 @@ WHERE t1.f1 GROUP BY t1.f1)); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 system NULL NULL NULL NULL 1 2 SUBQUERY a system NULL NULL NULL NULL 1 -2 SUBQUERY t1 fulltext f1_2,f1 f1 0 1 +2 SUBQUERY t1 fulltext f1_2,f1 f1 0 1 Using where PREPARE stmt FROM 'EXPLAIN SELECT 1 FROM t1 WHERE 1 > ALL((SELECT t1.f1 FROM t1 RIGHT OUTER JOIN t1 a @@ -297,12 +297,12 @@ EXECUTE stmt; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 system NULL NULL NULL NULL 1 2 SUBQUERY a system NULL NULL NULL NULL 1 -2 SUBQUERY t1 fulltext f1_2,f1 f1 0 1 +2 SUBQUERY t1 fulltext f1_2,f1 f1 0 1 Using where EXECUTE stmt; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 system NULL NULL NULL NULL 1 2 SUBQUERY a system NULL NULL NULL NULL 1 -2 SUBQUERY t1 fulltext f1_2,f1 f1 0 1 +2 SUBQUERY t1 fulltext f1_2,f1 f1 0 1 Using where DEALLOCATE PREPARE stmt; PREPARE stmt FROM 'EXPLAIN SELECT 1 FROM t1 @@ -313,12 +313,12 @@ EXECUTE stmt; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 system NULL NULL NULL NULL 1 2 SUBQUERY a system NULL NULL NULL NULL 1 -2 SUBQUERY t1 fulltext f1_2,f1 f1 0 1 +2 SUBQUERY t1 fulltext f1_2,f1 f1 0 1 Using where EXECUTE stmt; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 system NULL NULL NULL NULL 1 2 SUBQUERY a system NULL NULL NULL NULL 1 -2 SUBQUERY t1 fulltext f1_2,f1 f1 0 1 +2 SUBQUERY t1 fulltext f1_2,f1 f1 0 1 Using where DEALLOCATE PREPARE stmt; DROP TABLE t1; End of 5.1 tests. diff --git a/mysql-test/r/func_group.result b/mysql-test/r/func_group.result index c38201f6d9f..65323257300 100644 --- a/mysql-test/r/func_group.result +++ b/mysql-test/r/func_group.result @@ -1527,6 +1527,8 @@ DROP TABLE t1; # Bug#43668: Wrong comparison and MIN/MAX for YEAR(2) # create table t1 (f1 year(2), f2 year(4), f3 date, f4 datetime); +Warnings: +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead insert into t1 values (98,1998,19980101,"1998-01-01 00:00:00"), (00,2000,20000101,"2000-01-01 00:00:01"), @@ -1838,7 +1840,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 range a a 4 NULL 4 100.00 Using where; Using index 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select max(`test`.`t1`.`a`) AS `MAX(a)` from `test`.`t1` where (<expr_cache><<cache>(1),<cache>(2)>(<in_optimizer>(<cache>((1,2)),<exists>(select 3,4 having (((1 = 3) or isnull(3)) and ((2 = 4) or isnull(4)) and <is_not_null_test>(3) and <is_not_null_test>(4))))) and (`test`.`t1`.`a` < 10)) +Note 1003 select max(`test`.`t1`.`a`) AS `MAX(a)` from `test`.`t1` where (<cache>(<in_optimizer>((1,2),<exists>(select 3,4 having (((1 = 3) or isnull(3)) and ((2 = 4) or isnull(4)) and <is_not_null_test>(3) and <is_not_null_test>(4))))) and (`test`.`t1`.`a` < 10)) SELECT MAX(a) FROM t1 WHERE (1,2) IN (SELECT 3,4) AND a<10; MAX(a) NULL diff --git a/mysql-test/r/func_group_innodb.result b/mysql-test/r/func_group_innodb.result index 6485793d0e1..67ea44f187a 100644 --- a/mysql-test/r/func_group_innodb.result +++ b/mysql-test/r/func_group_innodb.result @@ -146,19 +146,6 @@ count(*) min(7) max(7) 0 NULL NULL drop table t1m, t1i, t2m, t2i; # -# Bug#13723054 CRASH WITH MIN/MAX AFTER QUICK_GROUP_MIN_MAX_SELECT::NEXT_MIN -# -CREATE TABLE t1(a BLOB, b VARCHAR(255) CHARSET LATIN1, c INT, -KEY(b, c, a(765))) ENGINE=INNODB; -INSERT INTO t1(a, b, c) VALUES ('', 'a', 0), ('', 'a', null), ('', 'a', 0); -SELECT MIN(c) FROM t1 GROUP BY b; -MIN(c) -0 -EXPLAIN SELECT MIN(c) FROM t1 GROUP BY b; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range NULL b 263 NULL 4 Using index for group-by -DROP TABLE t1; -# # Bug #57954: BIT_AND function returns incorrect results when # semijoin=on CREATE TABLE c ( @@ -230,4 +217,18 @@ SELECT member_id_to, COUNT(*) FROM t1 WHERE r_date = member_id_to COUNT(*) 518491 2 DROP TABLE t1; +# End of test BUG#12713907 +# +# Bug#13723054 CRASH WITH MIN/MAX AFTER QUICK_GROUP_MIN_MAX_SELECT::NEXT_MIN +# +CREATE TABLE t1(a BLOB, b VARCHAR(255) CHARSET LATIN1, c INT, +KEY(b, c, a(765))) ENGINE=INNODB; +INSERT INTO t1(a, b, c) VALUES ('', 'a', 0), ('', 'a', null), ('', 'a', 0); +SELECT MIN(c) FROM t1 GROUP BY b; +MIN(c) +0 +EXPLAIN SELECT MIN(c) FROM t1 GROUP BY b; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range NULL b 263 NULL 4 Using index for group-by +DROP TABLE t1; End of 5.5 tests diff --git a/mysql-test/r/group_min_max.result b/mysql-test/r/group_min_max.result index 95caa6853b8..ce0793b70a6 100644 --- a/mysql-test/r/group_min_max.result +++ b/mysql-test/r/group_min_max.result @@ -2403,7 +2403,7 @@ EXPLAIN SELECT 1 FROM t1 AS t1_outer WHERE (SELECT max(b) FROM t1 GROUP BY a HAVING a < 2) > 12; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE -2 SUBQUERY t1 index NULL a 10 NULL 15 Using index +2 SUBQUERY t1 range NULL a 5 NULL 8 Using index for group-by EXPLAIN SELECT 1 FROM t1 AS t1_outer WHERE a IN (SELECT max(b) FROM t1 GROUP BY a HAVING a < 2); id select_type table type possible_keys key key_len ref rows Extra @@ -2421,7 +2421,7 @@ AND t1_outer1.b = t1_outer2.b; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1_outer1 ref a a 5 const 1 Using where; Using index 1 PRIMARY t1_outer2 index NULL a 10 NULL 15 Using where; Using index; Using join buffer (flat, BNL join) -2 SUBQUERY t1 index NULL a 10 NULL 15 Using index +2 SUBQUERY t1 range NULL a 5 NULL 8 Using index for group-by EXPLAIN SELECT (SELECT (SELECT max(b) FROM t1 GROUP BY a HAVING a < 2) x FROM t1 AS t1_outer) x2 FROM t1 AS t1_outer2; id select_type table type possible_keys key key_len ref rows Extra @@ -2757,7 +2757,7 @@ EXPLAIN SELECT MIN( a ) FROM t1 WHERE a = (SELECT a FROM t1 WHERE a < 0); id select_type table type possible_keys key key_len ref rows Extra x x x x x x x x x Impossible WHERE noticed after reading const tables -x x x x x x x x x Using index +x x x x x x x x x Using where; Using index SELECT MIN( a ) FROM t1 WHERE a = (SELECT a FROM t1 WHERE a < 0); MIN( a ) NULL @@ -2829,7 +2829,7 @@ EXPLAIN SELECT MIN( a ) FROM t1 WHERE a = (SELECT a FROM t1 WHERE a < 0); id select_type table type possible_keys key key_len ref rows Extra x x x x x x x x x Impossible WHERE noticed after reading const tables -x x x x x x x x x Using index +x x x x x x x x x Using where; Using index SELECT MIN( a ) FROM t1 WHERE a = (SELECT a FROM t1 WHERE a < 0); MIN( a ) NULL @@ -2908,7 +2908,7 @@ EXPLAIN SELECT MIN( a ) FROM t1 WHERE a = (SELECT a FROM t1 WHERE a < 0); id select_type table type possible_keys key key_len ref rows Extra x x x x x x x x x Impossible WHERE noticed after reading const tables -x x x x x x x x x Using index +x x x x x x x x x Using where; Using index SELECT MIN( a ) FROM t1 WHERE a = (SELECT a FROM t1 WHERE a < 0); MIN( a ) NULL diff --git a/mysql-test/r/index_merge_innodb.result b/mysql-test/r/index_merge_innodb.result index b8eda092291..92bcb2e88f0 100644 --- a/mysql-test/r/index_merge_innodb.result +++ b/mysql-test/r/index_merge_innodb.result @@ -777,4 +777,19 @@ commit; select * from t1 where t1.zone_id=830 AND modified=9; pk zone_id modified drop table t0, t1; +# +# MDEV-376: Wrong result (missing rows) with index_merge+index_merge_intersection, join +# +CREATE TABLE t1 ( +a INT, b CHAR(1), c CHAR(1), KEY(a), KEY(b) +) ENGINE=InnoDB; +INSERT INTO t1 VALUES (8,'v','v'),(8,'m','m'),(9,'d','d'); +SELECT ta.* FROM t1 AS ta, t1 AS tb +WHERE ( tb.b != ta.b OR tb.a = ta.a ) +AND ( tb.b = ta.c OR tb.b = ta.b ); +a b c +8 v v +8 m m +9 d d +DROP TABLE t1; set optimizer_switch= @optimizer_switch_save; diff --git a/mysql-test/r/key.result b/mysql-test/r/key.result index e215caadb1c..e63afeab126 100644 --- a/mysql-test/r/key.result +++ b/mysql-test/r/key.result @@ -599,7 +599,7 @@ EXPLAIN SELECT 1 FROM t1 AS t1_outer WHERE (SELECT max(b) FROM t1 GROUP BY a HAVING a < 2) > 12; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE -2 SUBQUERY t1 index NULL a 10 NULL 15 Using index +2 SUBQUERY t1 range NULL a 5 NULL 8 Using index for group-by SELECT 1 as RES FROM t1 AS t1_outer WHERE (SELECT max(b) FROM t1 GROUP BY a HAVING a < 2) > 12; RES diff --git a/mysql-test/r/limit_rows_examined.result b/mysql-test/r/limit_rows_examined.result index 3a5212818ef..f4242f17a14 100644 --- a/mysql-test/r/limit_rows_examined.result +++ b/mysql-test/r/limit_rows_examined.result @@ -679,7 +679,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 system NULL NULL NULL NULL 1 Using temporary 1 PRIMARY t2 ALL NULL NULL NULL NULL 3 Distinct 2 SUBQUERY t3 ALL NULL NULL NULL NULL 3 -2 SUBQUERY t2 ALL NULL NULL NULL NULL 3 +2 SUBQUERY t2 ALL NULL NULL NULL NULL 3 Using where; Using join buffer (flat, BNL join) SELECT DISTINCT a AS field1 FROM t1, t2 WHERE EXISTS (SELECT c FROM t3 LEFT JOIN t2 ON b = d) HAVING field1 > 'aaa' LIMIT ROWS EXAMINED 20; diff --git a/mysql-test/r/mdev375.result b/mysql-test/r/mdev375.result new file mode 100644 index 00000000000..32580804686 --- /dev/null +++ b/mysql-test/r/mdev375.result @@ -0,0 +1,14 @@ +SET GLOBAL log_warnings=4; +SET GLOBAL max_connections=2; +SELECT 1; +1 +1 +SELECT 2; +2 +2 +ERROR HY000: Too many connections +SELECT 0; +0 +0 +SET GLOBAL log_warnings=default; +SET GLOBAL max_connections=default; diff --git a/mysql-test/r/mysqlbinlog-innodb.result b/mysql-test/r/mysqlbinlog-innodb.result index fed2c8a8651..41d15bc32d3 100644 --- a/mysql-test/r/mysqlbinlog-innodb.result +++ b/mysql-test/r/mysqlbinlog-innodb.result @@ -34,7 +34,7 @@ SET @@session.lc_time_names=0/*!*/; SET @@session.collation_database=DEFAULT/*!*/; BEGIN /*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1000000000/*!*/; INSERT INTO t1 VALUES (1) /*!*/; @@ -65,7 +65,7 @@ SET @@session.lc_time_names=0/*!*/; SET @@session.collation_database=DEFAULT/*!*/; BEGIN /*!*/; -use foo/*!*/; +use `foo`/*!*/; SET TIMESTAMP=1000000000/*!*/; INSERT INTO t1 VALUES (1) /*!*/; diff --git a/mysql-test/r/mysqlbinlog.result b/mysql-test/r/mysqlbinlog.result index 774761a0229..33904dfd9bd 100644 --- a/mysql-test/r/mysqlbinlog.result +++ b/mysql-test/r/mysqlbinlog.result @@ -18,7 +18,7 @@ flush logs; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; ROLLBACK/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; @@ -111,7 +111,7 @@ SET @@session.lc_time_names=0/*!*/; SET @@session.collation_database=DEFAULT/*!*/; BEGIN /*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1000000000/*!*/; LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`word`) /*!*/; @@ -202,7 +202,7 @@ SET @@session.lc_time_names=0/*!*/; SET @@session.collation_database=DEFAULT/*!*/; BEGIN /*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1000000000/*!*/; insert into t1 values ("Alas") /*!*/; @@ -219,7 +219,7 @@ ROLLBACK /* added by mysqlbinlog */; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; ROLLBACK/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; @@ -312,7 +312,7 @@ SET @@session.lc_time_names=0/*!*/; SET @@session.collation_database=DEFAULT/*!*/; BEGIN /*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1000000000/*!*/; LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`word`) /*!*/; @@ -403,7 +403,7 @@ SET @@session.lc_time_names=0/*!*/; SET @@session.collation_database=DEFAULT/*!*/; BEGIN /*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1000000000/*!*/; insert into t1 values ("Alas") /*!*/; @@ -427,7 +427,7 @@ SET @@session.lc_time_names=0/*!*/; SET @@session.collation_database=DEFAULT/*!*/; BEGIN /*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1108844555/*!*/; insert t1 values (1) /*!*/; @@ -445,7 +445,7 @@ SET @@session.lc_time_names=0/*!*/; SET @@session.collation_database=DEFAULT/*!*/; BEGIN /*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1108844555/*!*/; insert t1 values (1) /*!*/; @@ -498,7 +498,7 @@ ERROR 42000: PROCEDURE test.p1 does not exist /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; @@ -548,7 +548,7 @@ flush logs; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; @@ -725,7 +725,7 @@ FLUSH LOGS; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; ROLLBACK/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1253783037/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/; @@ -825,7 +825,7 @@ BEGIN SET TIMESTAMP=1266652094/*!*/; SavePoint mixed_cases /*!*/; -use db1/*!*/; +use `db1`/*!*/; SET TIMESTAMP=1266652094/*!*/; INSERT INTO db1.t2 VALUES("in savepoint mixed_cases") /*!*/; diff --git a/mysql-test/r/mysqlbinlog2.result b/mysql-test/r/mysqlbinlog2.result index 52a589ca7c1..806cf74479e 100644 --- a/mysql-test/r/mysqlbinlog2.result +++ b/mysql-test/r/mysqlbinlog2.result @@ -19,7 +19,7 @@ insert into t1 values(null, "f"); /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; ROLLBACK/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1579609942/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; @@ -103,7 +103,7 @@ SET @@session.collation_database=DEFAULT/*!*/; BEGIN /*!*/; SET INSERT_ID=1/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1579609942/*!*/; insert into t1 values(null, "a") /*!*/; @@ -172,7 +172,7 @@ SET @@session.collation_database=DEFAULT/*!*/; BEGIN /*!*/; SET INSERT_ID=3/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1579609944/*!*/; insert into t1 values(null, "c") /*!*/; @@ -209,7 +209,7 @@ ROLLBACK /* added by mysqlbinlog */; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; ROLLBACK/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1579609942/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; @@ -263,7 +263,7 @@ SET @@session.collation_database=DEFAULT/*!*/; BEGIN /*!*/; SET INSERT_ID=3/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1579609944/*!*/; insert into t1 values(null, "c") /*!*/; @@ -289,7 +289,7 @@ SET @@session.collation_database=DEFAULT/*!*/; BEGIN /*!*/; SET INSERT_ID=3/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1579609944/*!*/; insert into t1 values(null, "c") /*!*/; @@ -326,7 +326,7 @@ ROLLBACK /* added by mysqlbinlog */; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; ROLLBACK/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1579609942/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; @@ -369,7 +369,7 @@ flush logs; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; ROLLBACK/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1579609942/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; @@ -445,7 +445,7 @@ SET @@session.collation_database=DEFAULT/*!*/; BEGIN /*!*/; SET INSERT_ID=6/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1579609943/*!*/; insert into t1 values(null, "f") /*!*/; @@ -474,7 +474,7 @@ SET @@session.collation_database=DEFAULT/*!*/; BEGIN /*!*/; SET INSERT_ID=1/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1579609942/*!*/; insert into t1 values(null, "a") /*!*/; @@ -535,7 +535,7 @@ SET @@session.collation_database=DEFAULT/*!*/; BEGIN /*!*/; SET INSERT_ID=6/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1579609943/*!*/; insert into t1 values(null, "f") /*!*/; @@ -564,7 +564,7 @@ SET @@session.collation_database=DEFAULT/*!*/; BEGIN /*!*/; SET INSERT_ID=3/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1579609944/*!*/; insert into t1 values(null, "c") /*!*/; @@ -605,7 +605,7 @@ SET @@session.collation_database=DEFAULT/*!*/; BEGIN /*!*/; SET INSERT_ID=6/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1579609943/*!*/; insert into t1 values(null, "f") /*!*/; @@ -622,7 +622,7 @@ ROLLBACK /* added by mysqlbinlog */; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; ROLLBACK/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1579609942/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; @@ -720,7 +720,7 @@ SET @@session.collation_database=DEFAULT/*!*/; BEGIN /*!*/; SET INSERT_ID=3/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1579609944/*!*/; insert into t1 values(null, "c") /*!*/; @@ -761,7 +761,7 @@ SET @@session.collation_database=DEFAULT/*!*/; BEGIN /*!*/; SET INSERT_ID=6/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1579609943/*!*/; insert into t1 values(null, "f") /*!*/; @@ -778,7 +778,7 @@ ROLLBACK /* added by mysqlbinlog */; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; ROLLBACK/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1579609942/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; @@ -820,7 +820,7 @@ ROLLBACK /* added by mysqlbinlog */; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; ROLLBACK/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1579609942/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; @@ -904,7 +904,7 @@ SET @@session.collation_database=DEFAULT/*!*/; BEGIN /*!*/; SET INSERT_ID=1/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1579609942/*!*/; insert into t1 values(null, "a") /*!*/; @@ -972,7 +972,7 @@ SET @@session.collation_database=DEFAULT/*!*/; BEGIN /*!*/; SET INSERT_ID=3/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1579609944/*!*/; insert into t1 values(null, "c") /*!*/; @@ -1009,7 +1009,7 @@ ROLLBACK /* added by mysqlbinlog */; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; ROLLBACK/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1579609942/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; @@ -1062,7 +1062,7 @@ SET @@session.collation_database=DEFAULT/*!*/; BEGIN /*!*/; SET INSERT_ID=3/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1579609944/*!*/; insert into t1 values(null, "c") /*!*/; @@ -1088,7 +1088,7 @@ SET @@session.collation_database=DEFAULT/*!*/; BEGIN /*!*/; SET INSERT_ID=3/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1579609944/*!*/; insert into t1 values(null, "c") /*!*/; @@ -1125,7 +1125,7 @@ ROLLBACK /* added by mysqlbinlog */; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; ROLLBACK/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1579609942/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; @@ -1167,7 +1167,7 @@ ROLLBACK /* added by mysqlbinlog */; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; ROLLBACK/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1579609942/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; @@ -1243,7 +1243,7 @@ SET @@session.collation_database=DEFAULT/*!*/; BEGIN /*!*/; SET INSERT_ID=6/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1579609943/*!*/; insert into t1 values(null, "f") /*!*/; @@ -1272,7 +1272,7 @@ SET @@session.collation_database=DEFAULT/*!*/; BEGIN /*!*/; SET INSERT_ID=1/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1579609942/*!*/; insert into t1 values(null, "a") /*!*/; @@ -1333,7 +1333,7 @@ SET @@session.collation_database=DEFAULT/*!*/; BEGIN /*!*/; SET INSERT_ID=6/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1579609943/*!*/; insert into t1 values(null, "f") /*!*/; @@ -1361,7 +1361,7 @@ SET @@session.collation_database=DEFAULT/*!*/; BEGIN /*!*/; SET INSERT_ID=3/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1579609944/*!*/; insert into t1 values(null, "c") /*!*/; @@ -1402,7 +1402,7 @@ SET @@session.collation_database=DEFAULT/*!*/; BEGIN /*!*/; SET INSERT_ID=6/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1579609943/*!*/; insert into t1 values(null, "f") /*!*/; @@ -1419,7 +1419,7 @@ ROLLBACK /* added by mysqlbinlog */; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; ROLLBACK/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1579609942/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; @@ -1516,7 +1516,7 @@ SET @@session.collation_database=DEFAULT/*!*/; BEGIN /*!*/; SET INSERT_ID=3/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1579609944/*!*/; insert into t1 values(null, "c") /*!*/; @@ -1557,7 +1557,7 @@ SET @@session.collation_database=DEFAULT/*!*/; BEGIN /*!*/; SET INSERT_ID=6/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1579609943/*!*/; insert into t1 values(null, "f") /*!*/; @@ -1574,7 +1574,7 @@ ROLLBACK /* added by mysqlbinlog */; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; ROLLBACK/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1579609942/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; @@ -1616,7 +1616,7 @@ ROLLBACK /* added by mysqlbinlog */; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; ROLLBACK/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1579609942/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; diff --git a/mysql-test/r/mysqlbinlog_row.result b/mysql-test/r/mysqlbinlog_row.result index 7ae1ea36899..ce46b7ea898 100644 --- a/mysql-test/r/mysqlbinlog_row.result +++ b/mysql-test/r/mysqlbinlog_row.result @@ -336,7 +336,7 @@ DELIMITER /*!*/; ROLLBACK/*!*/; # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=#/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; diff --git a/mysql-test/r/mysqlbinlog_row_innodb.result b/mysql-test/r/mysqlbinlog_row_innodb.result index 00a3eb79b64..63b64489a37 100644 --- a/mysql-test/r/mysqlbinlog_row_innodb.result +++ b/mysql-test/r/mysqlbinlog_row_innodb.result @@ -2253,7 +2253,7 @@ DELIMITER /*!*/; ROLLBACK/*!*/; # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=#/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; @@ -3876,7 +3876,7 @@ DELIMITER /*!*/; ROLLBACK/*!*/; # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=#/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; @@ -4243,7 +4243,7 @@ DELIMITER /*!*/; ROLLBACK/*!*/; # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=#/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; @@ -4804,7 +4804,7 @@ DELIMITER /*!*/; ROLLBACK/*!*/; # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=#/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; diff --git a/mysql-test/r/mysqlbinlog_row_myisam.result b/mysql-test/r/mysqlbinlog_row_myisam.result index 7b0112d0a91..6e8c7cd64f9 100644 --- a/mysql-test/r/mysqlbinlog_row_myisam.result +++ b/mysql-test/r/mysqlbinlog_row_myisam.result @@ -2253,7 +2253,7 @@ DELIMITER /*!*/; ROLLBACK/*!*/; # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=#/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; @@ -3898,7 +3898,7 @@ DELIMITER /*!*/; ROLLBACK/*!*/; # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=#/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; @@ -4271,7 +4271,7 @@ DELIMITER /*!*/; ROLLBACK/*!*/; # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=#/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; @@ -4842,7 +4842,7 @@ DELIMITER /*!*/; ROLLBACK/*!*/; # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=#/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; diff --git a/mysql-test/r/mysqlbinlog_row_trans.result b/mysql-test/r/mysqlbinlog_row_trans.result index 5c96db7d19b..33c997d76a7 100644 --- a/mysql-test/r/mysqlbinlog_row_trans.result +++ b/mysql-test/r/mysqlbinlog_row_trans.result @@ -132,7 +132,7 @@ DELIMITER /*!*/; ROLLBACK/*!*/; # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=#/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; diff --git a/mysql-test/r/mysqld--help.result b/mysql-test/r/mysqld--help.result index ad55bfa3003..63df79160cc 100644 --- a/mysql-test/r/mysqld--help.result +++ b/mysql-test/r/mysqld--help.result @@ -697,7 +697,7 @@ The following options may be given as the first argument: partial matching --rpl-recovery-rank=# Unused, will be removed - --safe-mode Skip some optimize stages (for testing). + --safe-mode Skip some optimize stages (for testing). Deprecated. --safe-user-create Don't allow new user creation by the user who has no write privileges to the mysql.user table. --secure-auth Disallow authentication for accounts that have old @@ -737,6 +737,9 @@ The following options may be given as the first argument: --slave-load-tmpdir=name The location where the slave should put its temporary files when replicating a LOAD DATA INFILE command + --slave-max-allowed-packet=# + The maximum packet length to sent successfully from the + master to slave. --slave-net-timeout=# Number of seconds to wait for more data from a master/slave connection before aborting the read @@ -1057,6 +1060,7 @@ skip-show-database FALSE skip-slave-start FALSE slave-compressed-protocol FALSE slave-exec-mode STRICT +slave-max-allowed-packet 1073741824 slave-net-timeout 3600 slave-skip-errors (No default value) slave-sql-verify-checksum TRUE diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index ff591c6cb69..7b650addd3d 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -2073,7 +2073,7 @@ DROP TABLE IF EXISTS `v2`; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; /*!50001 CREATE TABLE `v2` ( - `a` varchar(30) + `a` tinyint NOT NULL ) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; /*!50001 DROP TABLE IF EXISTS `v2`*/; @@ -2167,7 +2167,7 @@ DROP TABLE IF EXISTS `v1`; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; /*!50001 CREATE TABLE `v1` ( - `a` int(11) + `a` tinyint NOT NULL ) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; /*!50001 DROP TABLE IF EXISTS `v1`*/; @@ -2241,7 +2241,7 @@ DROP TABLE IF EXISTS `v2`; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; /*!50001 CREATE TABLE `v2` ( - `a` varchar(30) + `a` tinyint NOT NULL ) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; /*!50001 DROP TABLE IF EXISTS `v2`*/; @@ -2355,9 +2355,9 @@ DROP TABLE IF EXISTS `v1`; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; /*!50001 CREATE TABLE `v1` ( - `a` int(11), - `b` int(11), - `c` varchar(30) + `a` tinyint NOT NULL, + `b` tinyint NOT NULL, + `c` tinyint NOT NULL ) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; DROP TABLE IF EXISTS `v2`; @@ -2365,7 +2365,7 @@ DROP TABLE IF EXISTS `v2`; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; /*!50001 CREATE TABLE `v2` ( - `a` int(11) + `a` tinyint NOT NULL ) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; DROP TABLE IF EXISTS `v3`; @@ -2373,9 +2373,9 @@ DROP TABLE IF EXISTS `v3`; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; /*!50001 CREATE TABLE `v3` ( - `a` int(11), - `b` int(11), - `c` varchar(30) + `a` tinyint NOT NULL, + `b` tinyint NOT NULL, + `c` tinyint NOT NULL ) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; /*!50001 DROP TABLE IF EXISTS `v1`*/; @@ -3112,9 +3112,9 @@ DROP TABLE IF EXISTS `v0`; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; /*!50001 CREATE TABLE `v0` ( - `a` int(11), - `b` varchar(32), - `c` varchar(32) + `a` tinyint NOT NULL, + `b` tinyint NOT NULL, + `c` tinyint NOT NULL ) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; DROP TABLE IF EXISTS `v1`; @@ -3122,9 +3122,9 @@ DROP TABLE IF EXISTS `v1`; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; /*!50001 CREATE TABLE `v1` ( - `a` int(11), - `b` varchar(32), - `c` varchar(32) + `a` tinyint NOT NULL, + `b` tinyint NOT NULL, + `c` tinyint NOT NULL ) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; DROP TABLE IF EXISTS `v2`; @@ -3132,9 +3132,9 @@ DROP TABLE IF EXISTS `v2`; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; /*!50001 CREATE TABLE `v2` ( - `a` int(11), - `b` varchar(32), - `c` varchar(32) + `a` tinyint NOT NULL, + `b` tinyint NOT NULL, + `c` tinyint NOT NULL ) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; @@ -3514,7 +3514,7 @@ DROP TABLE IF EXISTS `v1`; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; /*!50001 CREATE TABLE `v1` ( - `id` int(11) + `id` tinyint NOT NULL ) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; @@ -3574,7 +3574,7 @@ USE `mysqldump_views`; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; /*!50001 CREATE TABLE `nasishnasifu` ( - `id` bigint(20) unsigned + `id` tinyint NOT NULL ) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; @@ -3967,7 +3967,7 @@ DROP TABLE IF EXISTS `v2`; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; /*!50001 CREATE TABLE `v2` ( - `c` int(11) + `c` tinyint NOT NULL ) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; /*!50001 DROP TABLE IF EXISTS `v2`*/; @@ -4384,7 +4384,7 @@ DROP TABLE IF EXISTS `v1`; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; /*!50001 CREATE TABLE `v1` ( - `id` int(11) + `id` tinyint NOT NULL ) ENGINE=MyISAM */; SET character_set_client = @saved_cs_client; diff --git a/mysql-test/r/mysqltest.result b/mysql-test/r/mysqltest.result index 25345227d59..fdb3029059f 100644 --- a/mysql-test/r/mysqltest.result +++ b/mysql-test/r/mysqltest.result @@ -690,6 +690,7 @@ Got one of the listed errors insert into t1 values ("Abcd"); Got one of the listed errors garbage; +SELECT * FROM non_existing_table; drop table t2; create table t1 ( f1 char(10)); insert into t1 values ("Abcd"); diff --git a/mysql-test/r/order_by.result b/mysql-test/r/order_by.result index d320b5b669f..53fed519a15 100644 --- a/mysql-test/r/order_by.result +++ b/mysql-test/r/order_by.result @@ -1813,3 +1813,135 @@ Warnings: Note 1003 select `test`.`t2`.`b` AS `b` from `test`.`t1` join `test`.`t2` where (`test`.`t2`.`a` = `test`.`t1`.`b`) group by `test`.`t2`.`b` order by `test`.`t1`.`b` drop table t1,t2; End of 5.2 tests +# +# Bug mdev-449: ORDER BY with small sort_buffer_size +# +CREATE TABLE t1(f0 int auto_increment primary key, f1 int, f2 varchar(200)); +INSERT INTO t1(f1, f2) VALUES +(0,"0"),(1,"1"),(2,"2"),(3,"3"),(4,"4"),(5,"5"), +(6,"6"),(7,"7"),(8,"8"),(9,"9"),(10,"10"), +(11,"11"),(12,"12"),(13,"13"),(14,"14"),(15,"15"), +(16,"16"),(17,"17"),(18,"18"),(19,"19"),(20,"20"), +(21,"21"),(22,"22"),(23,"23"),(24,"24"),(25,"25"), +(26,"26"),(27,"27"),(28,"28"),(29,"29"),(30,"30"), +(31,"31"),(32,"32"),(33,"33"),(34,"34"),(35,"35"), +(36,"36"),(37,"37"),(38,"38"),(39,"39"),(40,"40"), +(41,"41"),(42,"42"),(43,"43"),(44,"44"),(45,"45"), +(46,"46"),(47,"47"),(48,"48"),(49,"49"),(50,"50"), +(51,"51"),(52,"52"),(53,"53"),(54,"54"),(55,"55"), +(56,"56"),(57,"57"),(58,"58"),(59,"59"),(60,"60"), +(61,"61"),(62,"62"),(63,"63"),(64,"64"),(65,"65"), +(66,"66"),(67,"67"),(68,"68"),(69,"69"),(70,"70"), +(71,"71"),(72,"72"),(73,"73"),(74,"74"),(75,"75"), +(76,"76"),(77,"77"),(78,"78"),(79,"79"),(80,"80"), +(81,"81"),(82,"82"),(83,"83"),(84,"84"),(85,"85"), +(86,"86"),(87,"87"),(88,"88"),(89,"89"),(90,"90"), +(91,"91"),(92,"92"),(93,"93"),(94,"94"),(95,"95"), +(96,"96"),(97,"97"),(98,"98"),(99,"99"); +set @save_sort_buffer_size= @@sort_buffer_size; +set sort_buffer_size= 2000; +SELECT * FROM t1 ORDER BY f1 DESC, f0; +f0 f1 f2 +100 99 99 +99 98 98 +98 97 97 +97 96 96 +96 95 95 +95 94 94 +94 93 93 +93 92 92 +92 91 91 +91 90 90 +90 89 89 +89 88 88 +88 87 87 +87 86 86 +86 85 85 +85 84 84 +84 83 83 +83 82 82 +82 81 81 +81 80 80 +80 79 79 +79 78 78 +78 77 77 +77 76 76 +76 75 75 +75 74 74 +74 73 73 +73 72 72 +72 71 71 +71 70 70 +70 69 69 +69 68 68 +68 67 67 +67 66 66 +66 65 65 +65 64 64 +64 63 63 +63 62 62 +62 61 61 +61 60 60 +60 59 59 +59 58 58 +58 57 57 +57 56 56 +56 55 55 +55 54 54 +54 53 53 +53 52 52 +52 51 51 +51 50 50 +50 49 49 +49 48 48 +48 47 47 +47 46 46 +46 45 45 +45 44 44 +44 43 43 +43 42 42 +42 41 41 +41 40 40 +40 39 39 +39 38 38 +38 37 37 +37 36 36 +36 35 35 +35 34 34 +34 33 33 +33 32 32 +32 31 31 +31 30 30 +30 29 29 +29 28 28 +28 27 27 +27 26 26 +26 25 25 +25 24 24 +24 23 23 +23 22 22 +22 21 21 +21 20 20 +20 19 19 +19 18 18 +18 17 17 +17 16 16 +16 15 15 +15 14 14 +14 13 13 +13 12 12 +12 11 11 +11 10 10 +10 9 9 +9 8 8 +8 7 7 +7 6 6 +6 5 5 +5 4 4 +4 3 3 +3 2 2 +2 1 1 +1 0 0 +set sort_buffer_size= @save_sort_buffer_size; +DROP TABLE t1; +End of 5.3 tests diff --git a/mysql-test/r/partition.result b/mysql-test/r/partition.result index 431c5dda116..40586b8d54b 100644 --- a/mysql-test/r/partition.result +++ b/mysql-test/r/partition.result @@ -2473,3 +2473,17 @@ SELECT * FROM vtmp; 1 DROP VIEW vtmp; DROP TABLE t1; +# +# MDEV-365 "Got assertion when doing alter table on a partition" +# +CREATE TABLE t1 ( i INT ) ENGINE=Aria PARTITION BY HASH(i) PARTITIONS 2; +INSERT INTO t1 VALUES (1),(2),(2),(3),(4); +ALTER TABLE t1 ADD PARTITION PARTITIONS 2; +SELECT * from t1 order by i; +i +1 +2 +2 +3 +4 +DROP TABLE t1; diff --git a/mysql-test/r/partition_cache.result b/mysql-test/r/partition_cache.result index ac2da9bb78a..cd579d00952 100644 --- a/mysql-test/r/partition_cache.result +++ b/mysql-test/r/partition_cache.result @@ -27,7 +27,7 @@ a 3 show status like "Qcache_queries_in_cache"; Variable_name Value -Qcache_queries_in_cache 0 +Qcache_queries_in_cache 1 drop table t1; commit; create table t1 (a int not null) PARTITION BY KEY (a) PARTITIONS 3; @@ -50,7 +50,7 @@ a 2 show status like "Qcache_queries_in_cache"; Variable_name Value -Qcache_queries_in_cache 0 +Qcache_queries_in_cache 3 show status like "Qcache_hits"; Variable_name Value Qcache_hits 0 @@ -69,7 +69,7 @@ a 2 show status like "Qcache_queries_in_cache"; Variable_name Value -Qcache_queries_in_cache 0 +Qcache_queries_in_cache 6 show status like "Qcache_hits"; Variable_name Value Qcache_hits 0 @@ -93,14 +93,14 @@ a 2 show status like "Qcache_queries_in_cache"; Variable_name Value -Qcache_queries_in_cache 0 +Qcache_queries_in_cache 2 show status like "Qcache_hits"; Variable_name Value -Qcache_hits 0 +Qcache_hits 1 commit; show status like "Qcache_queries_in_cache"; Variable_name Value -Qcache_queries_in_cache 0 +Qcache_queries_in_cache 2 drop table t3,t2,t1; CREATE TABLE t1 (id int(11) NOT NULL auto_increment, PRIMARY KEY (id)) PARTITION BY HASH (id) PARTITIONS 3; select count(*) from t1; @@ -164,7 +164,7 @@ count(*) 2 show status like "Qcache_queries_in_cache"; Variable_name Value -Qcache_queries_in_cache 0 +Qcache_queries_in_cache 1 connection connection1 SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w'; count(*) @@ -197,9 +197,9 @@ count(*) 2 show status like "Qcache_queries_in_cache"; Variable_name Value -Qcache_queries_in_cache 0 +Qcache_queries_in_cache 1 show status like "Qcache_hits"; Variable_name Value -Qcache_hits 0 +Qcache_hits 1 set @@global.query_cache_size = @save_query_cache_size; drop table t2; diff --git a/mysql-test/r/partition_cache_innodb.result b/mysql-test/r/partition_cache_innodb.result new file mode 100644 index 00000000000..0d0abbb096c --- /dev/null +++ b/mysql-test/r/partition_cache_innodb.result @@ -0,0 +1,151 @@ +SET SESSION STORAGE_ENGINE = innodb; +drop table if exists t1; +set @save_query_cache_size = @@global.query_cache_size; +# Test that partitions works with query cache +flush query cache; +SET GLOBAL query_cache_size=1024*1024*512; +CREATE TABLE `t1` ( +`id` int(11) NOT NULL , +`created_at` datetime NOT NULL, +`cool` tinyint default 0 +); +ALTER TABLE t1 PARTITION BY RANGE (TO_DAYS(created_at)) ( +PARTITION month_2010_4 VALUES LESS THAN (734258), +PARTITION month_2010_5 VALUES LESS THAN (734289), +PARTITION month_max VALUES LESS THAN MAXVALUE +); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` int(11) NOT NULL, + `created_at` datetime NOT NULL, + `cool` tinyint(4) DEFAULT '0' +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +/*!50100 PARTITION BY RANGE (TO_DAYS(created_at)) +(PARTITION month_2010_4 VALUES LESS THAN (734258) ENGINE = InnoDB, + PARTITION month_2010_5 VALUES LESS THAN (734289) ENGINE = InnoDB, + PARTITION month_max VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ +INSERT INTO t1 VALUES (1, now(), 0); +flush status; +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 0 +show status like "Qcache_hits"; +Variable_name Value +Qcache_hits 0 +SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1; +cool +0 +SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1; +cool +0 +SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1; +cool +0 +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 1 +show status like "Qcache_hits"; +Variable_name Value +Qcache_hits 2 +drop table t1; +# Test that sub-partitions works with query cache +flush query cache; +SET GLOBAL query_cache_size=1024*1024*512; +CREATE TABLE `t1` ( +`id` int(11) NOT NULL , +`created_at` datetime NOT NULL, +`cool` tinyint default 0 +) +PARTITION BY RANGE (TO_DAYS(created_at)) +subpartition by hash(cool) subpartitions 3 ( +PARTITION month_2010_4 VALUES LESS THAN (734258), +PARTITION month_2010_5 VALUES LESS THAN (734289), +PARTITION month_max VALUES LESS THAN MAXVALUE +); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` int(11) NOT NULL, + `created_at` datetime NOT NULL, + `cool` tinyint(4) DEFAULT '0' +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +/*!50100 PARTITION BY RANGE (TO_DAYS(created_at)) +SUBPARTITION BY HASH (cool) +SUBPARTITIONS 3 +(PARTITION month_2010_4 VALUES LESS THAN (734258) ENGINE = InnoDB, + PARTITION month_2010_5 VALUES LESS THAN (734289) ENGINE = InnoDB, + PARTITION month_max VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ +INSERT INTO t1 VALUES (1, now(), 0); +flush status; +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 0 +show status like "Qcache_hits"; +Variable_name Value +Qcache_hits 0 +SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1; +cool +0 +SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1; +cool +0 +SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1; +cool +0 +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 1 +show status like "Qcache_hits"; +Variable_name Value +Qcache_hits 2 +drop table t1; +# +# MySQL bug#53775 Query on partitioned table returns cached result +# from previous transaction +# +flush query cache; +flush status; +SET GLOBAL query_cache_size=1024*1024*512; +CREATE TABLE `t1` ( +`id` int(11) NOT NULL , +`created_at` datetime NOT NULL, +`cool` tinyint default 0 +); +ALTER TABLE t1 PARTITION BY RANGE (TO_DAYS(created_at)) ( +PARTITION month_2010_4 VALUES LESS THAN (734258), +PARTITION month_2010_5 VALUES LESS THAN (734289), +PARTITION month_max VALUES LESS THAN MAXVALUE +); +INSERT INTO t1 VALUES (1, now(), 0); +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 0 +show status like "Qcache_hits"; +Variable_name Value +Qcache_hits 0 +BEGIN; +UPDATE `t1` SET `cool` = 1 WHERE `id` = 1; +SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1; +cool +1 +ROLLBACK; +SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1; +cool +0 +BEGIN; +SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1; +cool +0 +ROLLBACK; +SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1; +cool +0 +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 2 +show status like "Qcache_hits"; +Variable_name Value +Qcache_hits 1 +drop table t1; +set @@global.query_cache_size = @save_query_cache_size; diff --git a/mysql-test/r/partition_cache_myisam.result b/mysql-test/r/partition_cache_myisam.result new file mode 100644 index 00000000000..0b617c03590 --- /dev/null +++ b/mysql-test/r/partition_cache_myisam.result @@ -0,0 +1,153 @@ +SET SESSION STORAGE_ENGINE = myisam; +drop table if exists t1; +set @save_query_cache_size = @@global.query_cache_size; +# Test that partitions works with query cache +flush query cache; +SET GLOBAL query_cache_size=1024*1024*512; +CREATE TABLE `t1` ( +`id` int(11) NOT NULL , +`created_at` datetime NOT NULL, +`cool` tinyint default 0 +); +ALTER TABLE t1 PARTITION BY RANGE (TO_DAYS(created_at)) ( +PARTITION month_2010_4 VALUES LESS THAN (734258), +PARTITION month_2010_5 VALUES LESS THAN (734289), +PARTITION month_max VALUES LESS THAN MAXVALUE +); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` int(11) NOT NULL, + `created_at` datetime NOT NULL, + `cool` tinyint(4) DEFAULT '0' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +/*!50100 PARTITION BY RANGE (TO_DAYS(created_at)) +(PARTITION month_2010_4 VALUES LESS THAN (734258) ENGINE = MyISAM, + PARTITION month_2010_5 VALUES LESS THAN (734289) ENGINE = MyISAM, + PARTITION month_max VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ +INSERT INTO t1 VALUES (1, now(), 0); +flush status; +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 0 +show status like "Qcache_hits"; +Variable_name Value +Qcache_hits 0 +SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1; +cool +0 +SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1; +cool +0 +SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1; +cool +0 +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 1 +show status like "Qcache_hits"; +Variable_name Value +Qcache_hits 2 +drop table t1; +# Test that sub-partitions works with query cache +flush query cache; +SET GLOBAL query_cache_size=1024*1024*512; +CREATE TABLE `t1` ( +`id` int(11) NOT NULL , +`created_at` datetime NOT NULL, +`cool` tinyint default 0 +) +PARTITION BY RANGE (TO_DAYS(created_at)) +subpartition by hash(cool) subpartitions 3 ( +PARTITION month_2010_4 VALUES LESS THAN (734258), +PARTITION month_2010_5 VALUES LESS THAN (734289), +PARTITION month_max VALUES LESS THAN MAXVALUE +); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` int(11) NOT NULL, + `created_at` datetime NOT NULL, + `cool` tinyint(4) DEFAULT '0' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +/*!50100 PARTITION BY RANGE (TO_DAYS(created_at)) +SUBPARTITION BY HASH (cool) +SUBPARTITIONS 3 +(PARTITION month_2010_4 VALUES LESS THAN (734258) ENGINE = MyISAM, + PARTITION month_2010_5 VALUES LESS THAN (734289) ENGINE = MyISAM, + PARTITION month_max VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ +INSERT INTO t1 VALUES (1, now(), 0); +flush status; +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 0 +show status like "Qcache_hits"; +Variable_name Value +Qcache_hits 0 +SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1; +cool +0 +SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1; +cool +0 +SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1; +cool +0 +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 1 +show status like "Qcache_hits"; +Variable_name Value +Qcache_hits 2 +drop table t1; +# +# MySQL bug#53775 Query on partitioned table returns cached result +# from previous transaction +# +flush query cache; +flush status; +SET GLOBAL query_cache_size=1024*1024*512; +CREATE TABLE `t1` ( +`id` int(11) NOT NULL , +`created_at` datetime NOT NULL, +`cool` tinyint default 0 +); +ALTER TABLE t1 PARTITION BY RANGE (TO_DAYS(created_at)) ( +PARTITION month_2010_4 VALUES LESS THAN (734258), +PARTITION month_2010_5 VALUES LESS THAN (734289), +PARTITION month_max VALUES LESS THAN MAXVALUE +); +INSERT INTO t1 VALUES (1, now(), 0); +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 0 +show status like "Qcache_hits"; +Variable_name Value +Qcache_hits 0 +BEGIN; +UPDATE `t1` SET `cool` = 1 WHERE `id` = 1; +SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1; +cool +1 +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1; +cool +1 +BEGIN; +SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1; +cool +1 +ROLLBACK; +SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1; +cool +1 +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 2 +show status like "Qcache_hits"; +Variable_name Value +Qcache_hits 2 +drop table t1; +set @@global.query_cache_size = @save_query_cache_size; diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result index 7629775b892..95217d9716a 100644 --- a/mysql-test/r/ps.result +++ b/mysql-test/r/ps.result @@ -3056,7 +3056,7 @@ DROP TABLE t1; End of 5.1 tests. # -# LP bug#1001500 Crash on the second execution of the PS for +# lp:1001500 Crash on the second execution of the PS for # a query with degenerated conjunctive condition # (see also mysql bug#12582849) # @@ -3996,108 +3996,4 @@ Handler_read_rnd_deleted 0 Handler_read_rnd_next 0 deallocate prepare st; drop table t1; -# -# LP bug#993459 Execution of PS for a query with GROUP BY -# returns wrong result (see also mysql bug#13805127) -# -PREPARE s1 FROM -" -SELECT c1, t2.c2, count(c3) -FROM - ( - SELECT 3 as c2 FROM dual WHERE @x = 1 - UNION - SELECT 2 FROM dual WHERE @x = 1 OR @x = 2 - ) AS t1, - ( - SELECT '2012-03-01 01:00:00' AS c1, 3 as c2, 1 as c3 FROM dual - UNION - SELECT '2012-03-01 02:00:00', 3, 2 FROM dual - UNION - SELECT '2012-03-01 01:00:00', 2, 1 FROM dual - ) AS t2 -WHERE t2.c2 = t1.c2 -GROUP BY c1, c2 -"; - -SET @x = 1; -SELECT c1, t2.c2, count(c3) -FROM -( -SELECT 3 as c2 FROM dual WHERE @x = 1 -UNION -SELECT 2 FROM dual WHERE @x = 1 OR @x = 2 -) AS t1, -( -SELECT '2012-03-01 01:00:00' AS c1, 3 as c2, 1 as c3 FROM dual -UNION -SELECT '2012-03-01 02:00:00', 3, 2 FROM dual -UNION -SELECT '2012-03-01 01:99345900:00', 2, 1 FROM dual -) AS t2 -WHERE t2.c2 = t1.c2 -GROUP BY c1, c2; -c1 c2 count(c3) -2012-03-01 01:00:00 3 1 -2012-03-01 01:99345900:00 2 1 -2012-03-01 02:00:00 3 1 - -EXECUTE s1; -c1 c2 count(c3) -2012-03-01 01:00:00 2 1 -2012-03-01 01:00:00 3 1 -2012-03-01 02:00:00 3 1 - -SET @x = 2; -SELECT c1, t2.c2, count(c3) -FROM -( -SELECT 3 as c2 FROM dual WHERE @x = 1 -UNION -SELECT 2 FROM dual WHERE @x = 1 OR @x = 2 -) AS t1, -( -SELECT '2012-03-01 01:00:00' AS c1, 3 as c2, 1 as c3 FROM dual -UNION -SELECT '2012-03-01 02:00:00', 3, 2 FROM dual -UNION -SELECT '2012-03-01 01:00:00', 2, 1 FROM dual -) AS t2 -WHERE t2.c2 = t1.c2 -GROUP BY c1, c2; -c1 c2 count(c3) -2012-03-01 01:00:00 2 1 - -EXECUTE s1; -c1 c2 count(c3) -2012-03-01 01:00:00 2 1 - -SET @x = 1; -SELECT c1, t2.c2, count(c3) -FROM -( -SELECT 3 as c2 FROM dual WHERE @x = 1 -UNION -SELECT 2 FROM dual WHERE @x = 1 OR @x = 2 -) AS t1, -( -SELECT '2012-03-01 01:00:00' AS c1, 3 as c2, 1 as c3 FROM dual -UNION -SELECT '2012-03-01 02:00:00', 3, 2 FROM dual -UNION -SELECT '2012-03-01 01:00:00', 2, 1 FROM dual -) AS t2 -WHERE t2.c2 = t1.c2 -GROUP BY c1, c2; -c1 c2 count(c3) -2012-03-01 01:00:00 2 1 -2012-03-01 01:00:00 3 1 -2012-03-01 02:00:00 3 1 - -EXECUTE s1; -c1 c2 count(c3) -2012-03-01 01:00:00 2 1 -2012-03-01 01:00:00 3 1 -2012-03-01 02:00:00 3 1 -DEALLOCATE PREPARE s1; # End of 5.3 tests diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index d49c67a35fd..293400ece2f 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -7811,9 +7811,12 @@ DROP FUNCTION f1; # -- End of 5.1 tests # ------------------------------------------------------------------ # -# LP bug#993459 Execution of PS for a query with GROUP BY +# lp:993459 Execution of PS for a query with GROUP BY # returns wrong result (see also mysql bug#13805127) # + +# Bug#13805127: Stored program cache produces wrong result in same THD + CREATE PROCEDURE p1(x INT UNSIGNED) BEGIN SELECT c1, t2.c2, count(c3) @@ -7850,7 +7853,7 @@ c1 c2 count(c3) 2012-03-01 02:00:00 3 1 DROP PROCEDURE p1; # -# LP bug#1002157 : testing stored function +# lp:1002157 : testing stored function # bug#62125 result for null incorrectly yields 1292 warning. # DROP FUNCTION IF EXISTS f1; diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index 1863cd09c38..f775336299b 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -4196,7 +4196,7 @@ INSERT INTO t1 VALUES (1,1),(2,1); EXPLAIN SELECT 1 FROM t1 WHERE a = (SELECT COUNT(*) FROM t1 GROUP BY b); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ref a a 5 const 1 Using where; Using index -2 SUBQUERY internal_tmp_table ALL group_key NULL NULL NULL 1 Using temporary; Using filesort +2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using temporary; Using filesort DROP TABLE t1; CREATE TABLE t1 (id int NOT NULL, st CHAR(2), INDEX idx(id)); INSERT INTO t1 VALUES @@ -5966,7 +5966,7 @@ id select_type table type possible_keys key key_len ref rows Extra EXPLAIN SELECT * FROM t1 WHERE EXISTS (SELECT * FROM t1 WHERE a=7); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 4 -2 SUBQUERY t1 ref a a 5 const 1 +2 SUBQUERY t1 ref a a 5 const 1 Using index DROP TABLE t1; # # BUG#12616253 - WRONG RESULT WITH EXISTS(SUBQUERY) (MISSING ROWS) @@ -6127,7 +6127,7 @@ set optimizer_switch=@tmp_optimizer_switch; EXPLAIN SELECT * FROM t1 WHERE EXISTS (SELECT * FROM t1 WHERE a=7); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 4 -2 SUBQUERY t1 ref a a 5 const 1 +2 SUBQUERY t1 ref a a 5 const 1 Using index DROP TABLE t1; # @@ -6612,7 +6612,33 @@ SELECT MIN(a) AS min_a, a FROM t1 WHERE 1=2 HAVING a NOT IN ( SELECT a from t1 U min_a a drop table t1; # -# LP BUG#944706 Query with impossible or constant subquery in WHERE or HAVING is not +# MDEV-367: Different results with and without subquery_cache on +# a query with a constant NOT IN condition +# +CREATE TABLE t1 (a INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1),(2),(3); +set @mdev367_optimizer_switch = @@optimizer_switch; +set optimizer_switch = 'subquery_cache=on'; +SELECT * FROM t1 WHERE ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) OR a > 100; +a +SELECT *, ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) FROM t1; +a ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) +1 NULL +2 NULL +3 NULL +set optimizer_switch=@mdev367_optimizer_switch; +set optimizer_switch = 'subquery_cache=off'; +SELECT * FROM t1 WHERE ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) OR a > 100; +a +SELECT *, ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) FROM t1; +a ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) +1 NULL +2 NULL +3 NULL +set optimizer_switch=@mdev367_optimizer_switch; +DROP TABLE t1; +# +# lp:944706 Query with impossible or constant subquery in WHERE or HAVING is not # precomputed and thus not part of optimization # CREATE TABLE t1 ( a VARCHAR(16), KEY (a) ); @@ -6768,5 +6794,68 @@ id select_type table type possible_keys key key_len ref rows Extra SELECT * FROM t1 WHERE 4 IN (SELECT MAX(b) FROM t2 WHERE EXISTS (SELECT * FROM t1)); a drop table t1,t2; -# return optimizer switch changed in the beginning of this test -set optimizer_switch=@subselect_tmp; +# +# MDEV-410: EXPLAIN shows type=range, while SHOW EXPLAIN and userstat show full table scan is used +# +CREATE TABLE t1 (a VARCHAR(3) PRIMARY KEY) ENGINE=MyISAM; +INSERT INTO t1 VALUES ('USA'); +CREATE TABLE t2 (b INT, c VARCHAR(52), KEY(b)) ENGINE=MyISAM; +INSERT INTO t2 VALUES (3813,'United States'),(3940,'Russia'); +CREATE TABLE t3 (d INT, KEY(d)) ENGINE=MyISAM; +INSERT INTO t3 VALUES (12),(22),(9),(45); +create table t4 like t3; +insert into t4 select * from t3; +# This should not show range access for table t2 +explain +SELECT MIN(b) FROM ( SELECT * FROM t1, t2, t3 WHERE d = b ) AS alias1 +WHERE SLEEP(0.1) OR c < 'p' OR b = ( SELECT MIN(b) FROM t2 ); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 system NULL NULL NULL NULL 1 +1 PRIMARY t2 ALL b NULL NULL NULL 2 Using where +1 PRIMARY t3 ref d d 5 test.t2.b 2 Using where; Using index +3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +set @tmp_mdev410=@@global.userstat; +set global userstat=on; +flush table_statistics; +flush index_statistics; +SELECT MIN(b) FROM ( SELECT * FROM t1, t2, t3 WHERE d = b ) AS alias1 +WHERE SLEEP(0.1) OR c < 'p' OR b = ( SELECT MIN(b) FROM t2 ); +MIN(b) +NULL +# The following shows that t2 was indeed scanned with a full scan. +show table_statistics; +Table_schema Table_name Rows_read Rows_changed Rows_changed_x_#indexes +test t1 2 0 0 +test t2 3 0 0 +show index_statistics; +Table_schema Table_name Index_name Rows_read +test t2 b 1 +set global userstat=@tmp_mdev410; +DROP TABLE t1,t2,t3,t4; +# +# MDEV-430: Server crashes in select_describe on EXPLAIN with +# materialization+semijoin, 2 nested subqueries, aggregate functions +# +CREATE TABLE t1 (a INT, KEY(a)); +INSERT INTO t1 VALUES (1),(8); +CREATE TABLE t2 (b INT, KEY(b)); +INSERT INTO t2 VALUES (45),(17),(20); +EXPLAIN SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t1, t2 WHERE b = a GROUP BY a HAVING a <> 1 ) ; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +2 SUBQUERY t1 index a a 5 NULL 1 Using where; Using index +2 SUBQUERY t2 ref b b 5 test.t1.a 2 Using index +DROP TABLE t1,t2; +# +# MDEV-405: Server crashes in test_if_skip_sort_order on EXPLAIN with GROUP BY and HAVING in EXISTS subquery +# +CREATE TABLE t1 (a INT, KEY(a)); +INSERT INTO t1 VALUES (1),(8); +CREATE TABLE t2 (b INT, KEY(b)); +INSERT INTO t2 VALUES (45),(17),(20); +EXPLAIN SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t1, t2 WHERE b = a GROUP BY a HAVING a <> 1 ) ; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +2 SUBQUERY t1 index a a 5 NULL 1 Using where; Using index +2 SUBQUERY t2 ref b b 5 test.t1.a 2 Using index +DROP TABLE t1,t2; diff --git a/mysql-test/r/subselect2.result b/mysql-test/r/subselect2.result index 41c445329cb..ed00e4ef684 100644 --- a/mysql-test/r/subselect2.result +++ b/mysql-test/r/subselect2.result @@ -161,18 +161,18 @@ SET optimizer_switch='materialization=on,in_to_exists=on'; EXPLAIN SELECT * FROM t2,t3 WHERE (2,9) IN (SELECT DISTINCT a,pk FROM t1) OR a = b; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 index a a 5 NULL 2 Using index -1 PRIMARY t3 index b b 5 NULL 4 Using where; Using index; Using join buffer (flat, BNL join) -2 MATERIALIZED t1 index PRIMARY,a a 5 NULL 2 Using index +1 PRIMARY t2 index a a 5 NULL 2 Using where; Using index +1 PRIMARY t3 ref b b 5 test.t2.a 2 Using index +2 SUBQUERY t1 index_subquery PRIMARY,a a 5 const 0 Using index; Using where SELECT * FROM t2,t3 WHERE (2,9) IN (SELECT DISTINCT a,pk FROM t1) OR a = b; pk a b 0 4 4 EXPLAIN SELECT * FROM t2,t3 WHERE (2,9) IN (SELECT DISTINCT a,pk FROM v1) OR a = b; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 index a a 5 NULL 2 Using index -1 PRIMARY t3 index b b 5 NULL 4 Using where; Using index; Using join buffer (flat, BNL join) -2 MATERIALIZED t1 index PRIMARY,a a 5 NULL 2 Using index +1 PRIMARY t2 index a a 5 NULL 2 Using where; Using index +1 PRIMARY t3 ref b b 5 test.t2.a 2 Using index +2 SUBQUERY t1 index_subquery PRIMARY,a a 5 const 0 Using index; Using where SELECT * FROM t2,t3 WHERE (2,9) IN (SELECT DISTINCT a,pk FROM v1) OR a = b; pk a b 0 4 4 diff --git a/mysql-test/r/subselect4.result b/mysql-test/r/subselect4.result index 72b4f34d9de..28441e4019e 100644 --- a/mysql-test/r/subselect4.result +++ b/mysql-test/r/subselect4.result @@ -627,51 +627,51 @@ SET @@optimizer_switch = 'materialization=on,in_to_exists=off,semijoin=off'; EXPLAIN SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, min(f4) FROM t2); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -2 MATERIALIZED t2 system NULL NULL NULL NULL 0 const row not found +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +2 MATERIALIZED NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, min(f4) FROM t2); f1 f2 EXPLAIN SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3+f4, min(f4) FROM t2); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -2 MATERIALIZED t2 system NULL NULL NULL NULL 0 const row not found +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +2 MATERIALIZED NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3+f4, min(f4) FROM t2); f1 f2 EXPLAIN SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, min(f4)+max(f4) FROM t2); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -2 MATERIALIZED t2 system NULL NULL NULL NULL 0 const row not found +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +2 MATERIALIZED NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, min(f4)+max(f4) FROM t2); f1 f2 EXPLAIN SELECT (2, 0) NOT IN (SELECT f3, min(f4) FROM t2) as not_in; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used -2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT (2, 0) NOT IN (SELECT f3, min(f4) FROM t2) as not_in; not_in NULL EXPLAIN SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, count(f4) FROM t2); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -2 MATERIALIZED t2 system NULL NULL NULL NULL 0 const row not found +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +2 MATERIALIZED NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, count(f4) FROM t2); f1 f2 EXPLAIN SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, f3 + count(f4) FROM t2); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -2 MATERIALIZED t2 system NULL NULL NULL NULL 0 const row not found +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +2 MATERIALIZED NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, f3 + count(f4) FROM t2); f1 f2 EXPLAIN SELECT (2, 0) NOT IN (SELECT f3, count(f4) FROM t2) as not_in; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used -2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT (2, 0) NOT IN (SELECT f3, count(f4) FROM t2) as not_in; not_in NULL @@ -679,7 +679,7 @@ EXPLAIN SELECT (2, 0) NOT IN (SELECT f3, count(f4) FROM t2 HAVING max(f4) > 7) as not_in; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used -2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT (2, 0) NOT IN (SELECT f3, count(f4) FROM t2 HAVING max(f4) > 7) as not_in; not_in 1 @@ -687,7 +687,7 @@ EXPLAIN SELECT (2, 0) NOT IN (SELECT f3, count(f4) FROM t2 HAVING max(f4) is null) as not_in; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used -2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT (2, 0) NOT IN (SELECT f3, count(f4) FROM t2 HAVING max(f4) is null) as not_in; not_in NULL @@ -695,7 +695,7 @@ EXPLAIN SELECT (2, 0) NOT IN (SELECT max(f3+f3), count(f4) FROM t2) as not_in; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used -2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT (2, 0) NOT IN (SELECT max(f3+f3), count(f4) FROM t2) as not_in; not_in NULL @@ -703,7 +703,7 @@ EXPLAIN SELECT (2, 0) NOT IN (SELECT max(f3+f3), count(f4)+f3 FROM t2) as not_in; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used -2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT (2, 0) NOT IN (SELECT max(f3+f3), count(f4)+f3 FROM t2) as not_in; not_in NULL @@ -718,51 +718,51 @@ SET @@optimizer_switch = 'materialization=off,in_to_exists=on,semijoin=off'; EXPLAIN SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, min(f4) FROM t2); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, min(f4) FROM t2); f1 f2 EXPLAIN SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3+f4, min(f4) FROM t2); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3+f4, min(f4) FROM t2); f1 f2 EXPLAIN SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, min(f4)+max(f4) FROM t2); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, min(f4)+max(f4) FROM t2); f1 f2 EXPLAIN SELECT (2, 0) NOT IN (SELECT f3, min(f4) FROM t2) as not_in; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used -2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT (2, 0) NOT IN (SELECT f3, min(f4) FROM t2) as not_in; not_in NULL EXPLAIN SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, count(f4) FROM t2); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, count(f4) FROM t2); f1 f2 EXPLAIN SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, f3 + count(f4) FROM t2); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, f3 + count(f4) FROM t2); f1 f2 EXPLAIN SELECT (2, 0) NOT IN (SELECT f3, count(f4) FROM t2) as not_in; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used -2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT (2, 0) NOT IN (SELECT f3, count(f4) FROM t2) as not_in; not_in NULL @@ -770,7 +770,7 @@ EXPLAIN SELECT (2, 0) NOT IN (SELECT f3, count(f4) FROM t2 HAVING max(f4) > 7) as not_in; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used -2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT (2, 0) NOT IN (SELECT f3, count(f4) FROM t2 HAVING max(f4) > 7) as not_in; not_in 1 @@ -778,7 +778,7 @@ EXPLAIN SELECT (2, 0) NOT IN (SELECT f3, count(f4) FROM t2 HAVING max(f4) is null) as not_in; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used -2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT (2, 0) NOT IN (SELECT f3, count(f4) FROM t2 HAVING max(f4) is null) as not_in; not_in NULL @@ -786,7 +786,7 @@ EXPLAIN SELECT (2, 0) NOT IN (SELECT max(f3+f3), count(f4) FROM t2) as not_in; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used -2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT (2, 0) NOT IN (SELECT max(f3+f3), count(f4) FROM t2) as not_in; not_in NULL @@ -794,7 +794,7 @@ EXPLAIN SELECT (2, 0) NOT IN (SELECT max(f3+f3), count(f4)+f3 FROM t2) as not_in; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used -2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT (2, 0) NOT IN (SELECT max(f3+f3), count(f4)+f3 FROM t2) as not_in; not_in NULL @@ -813,21 +813,21 @@ SET @@optimizer_switch = 'materialization=on,in_to_exists=off,semijoin=off'; EXPLAIN SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, min(f4) FROM t2 WHERE f3 > 10); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE 2 MATERIALIZED t2 range PRIMARY PRIMARY 4 NULL 1 Using index condition; Rowid-ordered scan SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, min(f4) FROM t2 WHERE f3 > 10); f1 f2 EXPLAIN SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3+f4, min(f4) FROM t2 WHERE f3 > 10); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE 2 MATERIALIZED t2 range PRIMARY PRIMARY 4 NULL 1 Using index condition; Rowid-ordered scan SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3+f4, min(f4) FROM t2 WHERE f3 > 10); f1 f2 EXPLAIN SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, min(f4)+max(f4) FROM t2 WHERE f3 > 10); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE 2 MATERIALIZED t2 range PRIMARY PRIMARY 4 NULL 1 Using index condition; Rowid-ordered scan SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, min(f4)+max(f4) FROM t2 WHERE f3 > 10); f1 f2 @@ -842,14 +842,14 @@ NULL EXPLAIN SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, count(f4) FROM t2 WHERE f3 > 10); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE 2 MATERIALIZED t2 range PRIMARY PRIMARY 4 NULL 1 Using index condition; Rowid-ordered scan SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, count(f4) FROM t2 WHERE f3 > 10); f1 f2 EXPLAIN SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, f3 + count(f4) FROM t2 WHERE f3 > 10); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE 2 MATERIALIZED t2 range PRIMARY PRIMARY 4 NULL 1 Using index condition; Rowid-ordered scan SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, f3 + count(f4) FROM t2 WHERE f3 > 10); f1 f2 @@ -904,21 +904,21 @@ SET @@optimizer_switch = 'materialization=off,in_to_exists=on,semijoin=off'; EXPLAIN SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, min(f4) FROM t2 WHERE f3 > 10); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE 2 SUBQUERY t2 range PRIMARY PRIMARY 4 NULL 1 Using index condition; Rowid-ordered scan SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, min(f4) FROM t2 WHERE f3 > 10); f1 f2 EXPLAIN SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3+f4, min(f4) FROM t2 WHERE f3 > 10); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE 2 SUBQUERY t2 range PRIMARY PRIMARY 4 NULL 1 Using index condition; Rowid-ordered scan SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3+f4, min(f4) FROM t2 WHERE f3 > 10); f1 f2 EXPLAIN SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, min(f4)+max(f4) FROM t2 WHERE f3 > 10); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE 2 SUBQUERY t2 range PRIMARY PRIMARY 4 NULL 1 Using index condition; Rowid-ordered scan SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, min(f4)+max(f4) FROM t2 WHERE f3 > 10); f1 f2 @@ -933,14 +933,14 @@ NULL EXPLAIN SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, count(f4) FROM t2 WHERE f3 > 10); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE 2 SUBQUERY t2 range PRIMARY PRIMARY 4 NULL 1 Using index condition; Rowid-ordered scan SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, count(f4) FROM t2 WHERE f3 > 10); f1 f2 EXPLAIN SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, f3 + count(f4) FROM t2 WHERE f3 > 10); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE 2 SUBQUERY t2 range PRIMARY PRIMARY 4 NULL 1 Using index condition; Rowid-ordered scan SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, f3 + count(f4) FROM t2 WHERE f3 > 10); f1 f2 diff --git a/mysql-test/r/subselect_innodb.result b/mysql-test/r/subselect_innodb.result index a0f05a26a46..a4670872fad 100644 --- a/mysql-test/r/subselect_innodb.result +++ b/mysql-test/r/subselect_innodb.result @@ -333,7 +333,7 @@ WHERE (SELECT DISTINCT b FROM t3) > 0); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 const PRIMARY PRIMARY 4 const 1 Using where; Using index 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE -3 SUBQUERY internal_tmp_table ALL group_key NULL NULL NULL 0 Using temporary +3 SUBQUERY t3 ALL NULL NULL NULL NULL 1 Using temporary SELECT * FROM t1 WHERE t1.a = ( @@ -386,7 +386,7 @@ select 1 from t1 where 1 like (select 1 from t1 where 1 <=> (select 1 from t1 gr id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 1 2 SUBQUERY t1 ALL NULL NULL NULL NULL 1 -3 SUBQUERY internal_tmp_table ALL group_key NULL NULL NULL 1 Using temporary; Using filesort +3 SUBQUERY t1 ALL NULL NULL NULL NULL 1 Using temporary; Using filesort select 1 from t1 where 1 like (select 1 from t1 where 1 <=> (select 1 from t1 group by a1)); 1 1 diff --git a/mysql-test/r/subselect_mat.result b/mysql-test/r/subselect_mat.result index 45d0b9ee519..9bb26e8a6e0 100644 --- a/mysql-test/r/subselect_mat.result +++ b/mysql-test/r/subselect_mat.result @@ -2183,7 +2183,7 @@ NULL EXPLAIN SELECT * FROM t2 WHERE (SELECT f3a, f3b FROM t3) NOT IN (SELECT f1a, f1b FROM t1); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 2 +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE 3 MATERIALIZED t1 ALL NULL NULL NULL NULL 2 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table SELECT * FROM t2 WHERE (SELECT f3a, f3b FROM t3) NOT IN (SELECT f1a, f1b FROM t1); diff --git a/mysql-test/r/subselect_mat_cost_bugs.result b/mysql-test/r/subselect_mat_cost_bugs.result index 5a38fe7ca72..8c95c8637aa 100644 --- a/mysql-test/r/subselect_mat_cost_bugs.result +++ b/mysql-test/r/subselect_mat_cost_bugs.result @@ -148,7 +148,7 @@ FROM t2 GROUP BY f1 id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables 2 SUBQUERY t1 system NULL NULL NULL NULL 1 -3 SUBQUERY internal_tmp_table ALL group_key NULL NULL NULL 1 Using temporary; Using filesort +3 SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using temporary; Using filesort drop table t1, t2, t3; # # LP BUG#715034 Item_sum_distinct::clear(): Assertion `tree != 0' failed @@ -162,7 +162,7 @@ EXPLAIN SELECT * FROM (SELECT * FROM t2) AS a2 WHERE (SELECT distinct SUM(distinct f3 ) FROM t1); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 PRIMARY <derived2> system NULL NULL NULL NULL 0 const row not found 3 SUBQUERY t1 index NULL f3 5 NULL 2 Using index 2 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table insert into t2 values (1),(2); diff --git a/mysql-test/r/subselect_no_mat.result b/mysql-test/r/subselect_no_mat.result index 78ab87dbfd6..e72d25fdafa 100644 --- a/mysql-test/r/subselect_no_mat.result +++ b/mysql-test/r/subselect_no_mat.result @@ -4200,7 +4200,7 @@ INSERT INTO t1 VALUES (1,1),(2,1); EXPLAIN SELECT 1 FROM t1 WHERE a = (SELECT COUNT(*) FROM t1 GROUP BY b); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ref a a 5 const 1 Using where; Using index -2 SUBQUERY internal_tmp_table ALL group_key NULL NULL NULL 1 Using temporary; Using filesort +2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using temporary; Using filesort DROP TABLE t1; CREATE TABLE t1 (id int NOT NULL, st CHAR(2), INDEX idx(id)); INSERT INTO t1 VALUES @@ -5967,7 +5967,7 @@ id select_type table type possible_keys key key_len ref rows Extra EXPLAIN SELECT * FROM t1 WHERE EXISTS (SELECT * FROM t1 WHERE a=7); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 4 -2 SUBQUERY t1 ref a a 5 const 1 +2 SUBQUERY t1 ref a a 5 const 1 Using index DROP TABLE t1; # # BUG#12616253 - WRONG RESULT WITH EXISTS(SUBQUERY) (MISSING ROWS) @@ -6126,7 +6126,7 @@ set optimizer_switch=@tmp_optimizer_switch; EXPLAIN SELECT * FROM t1 WHERE EXISTS (SELECT * FROM t1 WHERE a=7); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 4 -2 SUBQUERY t1 ref a a 5 const 1 +2 SUBQUERY t1 ref a a 5 const 1 Using index DROP TABLE t1; # @@ -6611,7 +6611,33 @@ SELECT MIN(a) AS min_a, a FROM t1 WHERE 1=2 HAVING a NOT IN ( SELECT a from t1 U min_a a drop table t1; # -# LP BUG#944706 Query with impossible or constant subquery in WHERE or HAVING is not +# MDEV-367: Different results with and without subquery_cache on +# a query with a constant NOT IN condition +# +CREATE TABLE t1 (a INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1),(2),(3); +set @mdev367_optimizer_switch = @@optimizer_switch; +set optimizer_switch = 'subquery_cache=on'; +SELECT * FROM t1 WHERE ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) OR a > 100; +a +SELECT *, ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) FROM t1; +a ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) +1 NULL +2 NULL +3 NULL +set optimizer_switch=@mdev367_optimizer_switch; +set optimizer_switch = 'subquery_cache=off'; +SELECT * FROM t1 WHERE ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) OR a > 100; +a +SELECT *, ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) FROM t1; +a ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) +1 NULL +2 NULL +3 NULL +set optimizer_switch=@mdev367_optimizer_switch; +DROP TABLE t1; +# +# lp:944706 Query with impossible or constant subquery in WHERE or HAVING is not # precomputed and thus not part of optimization # CREATE TABLE t1 ( a VARCHAR(16), KEY (a) ); @@ -6766,8 +6792,71 @@ id select_type table type possible_keys key key_len ref rows Extra SELECT * FROM t1 WHERE 4 IN (SELECT MAX(b) FROM t2 WHERE EXISTS (SELECT * FROM t1)); a drop table t1,t2; -# return optimizer switch changed in the beginning of this test -set optimizer_switch=@subselect_tmp; +# +# MDEV-410: EXPLAIN shows type=range, while SHOW EXPLAIN and userstat show full table scan is used +# +CREATE TABLE t1 (a VARCHAR(3) PRIMARY KEY) ENGINE=MyISAM; +INSERT INTO t1 VALUES ('USA'); +CREATE TABLE t2 (b INT, c VARCHAR(52), KEY(b)) ENGINE=MyISAM; +INSERT INTO t2 VALUES (3813,'United States'),(3940,'Russia'); +CREATE TABLE t3 (d INT, KEY(d)) ENGINE=MyISAM; +INSERT INTO t3 VALUES (12),(22),(9),(45); +create table t4 like t3; +insert into t4 select * from t3; +# This should not show range access for table t2 +explain +SELECT MIN(b) FROM ( SELECT * FROM t1, t2, t3 WHERE d = b ) AS alias1 +WHERE SLEEP(0.1) OR c < 'p' OR b = ( SELECT MIN(b) FROM t2 ); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 system NULL NULL NULL NULL 1 +1 PRIMARY t2 ALL b NULL NULL NULL 2 Using where +1 PRIMARY t3 ref d d 5 test.t2.b 2 Using where; Using index +3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +set @tmp_mdev410=@@global.userstat; +set global userstat=on; +flush table_statistics; +flush index_statistics; +SELECT MIN(b) FROM ( SELECT * FROM t1, t2, t3 WHERE d = b ) AS alias1 +WHERE SLEEP(0.1) OR c < 'p' OR b = ( SELECT MIN(b) FROM t2 ); +MIN(b) +NULL +# The following shows that t2 was indeed scanned with a full scan. +show table_statistics; +Table_schema Table_name Rows_read Rows_changed Rows_changed_x_#indexes +test t1 2 0 0 +test t2 3 0 0 +show index_statistics; +Table_schema Table_name Index_name Rows_read +test t2 b 1 +set global userstat=@tmp_mdev410; +DROP TABLE t1,t2,t3,t4; +# +# MDEV-430: Server crashes in select_describe on EXPLAIN with +# materialization+semijoin, 2 nested subqueries, aggregate functions +# +CREATE TABLE t1 (a INT, KEY(a)); +INSERT INTO t1 VALUES (1),(8); +CREATE TABLE t2 (b INT, KEY(b)); +INSERT INTO t2 VALUES (45),(17),(20); +EXPLAIN SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t1, t2 WHERE b = a GROUP BY a HAVING a <> 1 ) ; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +2 SUBQUERY t1 index a a 5 NULL 1 Using where; Using index +2 SUBQUERY t2 ref b b 5 test.t1.a 2 Using index +DROP TABLE t1,t2; +# +# MDEV-405: Server crashes in test_if_skip_sort_order on EXPLAIN with GROUP BY and HAVING in EXISTS subquery +# +CREATE TABLE t1 (a INT, KEY(a)); +INSERT INTO t1 VALUES (1),(8); +CREATE TABLE t2 (b INT, KEY(b)); +INSERT INTO t2 VALUES (45),(17),(20); +EXPLAIN SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t1, t2 WHERE b = a GROUP BY a HAVING a <> 1 ) ; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +2 SUBQUERY t1 index a a 5 NULL 1 Using where; Using index +2 SUBQUERY t2 ref b b 5 test.t1.a 2 Using index +DROP TABLE t1,t2; set optimizer_switch=default; select @@optimizer_switch like '%materialization=on%'; @@optimizer_switch like '%materialization=on%' diff --git a/mysql-test/r/subselect_no_opts.result b/mysql-test/r/subselect_no_opts.result index f822a4500f4..9030265356b 100644 --- a/mysql-test/r/subselect_no_opts.result +++ b/mysql-test/r/subselect_no_opts.result @@ -4196,7 +4196,7 @@ INSERT INTO t1 VALUES (1,1),(2,1); EXPLAIN SELECT 1 FROM t1 WHERE a = (SELECT COUNT(*) FROM t1 GROUP BY b); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ref a a 5 const 1 Using where; Using index -2 SUBQUERY internal_tmp_table ALL group_key NULL NULL NULL 1 Using temporary; Using filesort +2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using temporary; Using filesort DROP TABLE t1; CREATE TABLE t1 (id int NOT NULL, st CHAR(2), INDEX idx(id)); INSERT INTO t1 VALUES @@ -5963,7 +5963,7 @@ id select_type table type possible_keys key key_len ref rows Extra EXPLAIN SELECT * FROM t1 WHERE EXISTS (SELECT * FROM t1 WHERE a=7); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 4 -2 SUBQUERY t1 ref a a 5 const 1 +2 SUBQUERY t1 ref a a 5 const 1 Using index DROP TABLE t1; # # BUG#12616253 - WRONG RESULT WITH EXISTS(SUBQUERY) (MISSING ROWS) @@ -6122,7 +6122,7 @@ set optimizer_switch=@tmp_optimizer_switch; EXPLAIN SELECT * FROM t1 WHERE EXISTS (SELECT * FROM t1 WHERE a=7); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 4 -2 SUBQUERY t1 ref a a 5 const 1 +2 SUBQUERY t1 ref a a 5 const 1 Using index DROP TABLE t1; # @@ -6607,7 +6607,33 @@ SELECT MIN(a) AS min_a, a FROM t1 WHERE 1=2 HAVING a NOT IN ( SELECT a from t1 U min_a a drop table t1; # -# LP BUG#944706 Query with impossible or constant subquery in WHERE or HAVING is not +# MDEV-367: Different results with and without subquery_cache on +# a query with a constant NOT IN condition +# +CREATE TABLE t1 (a INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1),(2),(3); +set @mdev367_optimizer_switch = @@optimizer_switch; +set optimizer_switch = 'subquery_cache=on'; +SELECT * FROM t1 WHERE ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) OR a > 100; +a +SELECT *, ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) FROM t1; +a ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) +1 NULL +2 NULL +3 NULL +set optimizer_switch=@mdev367_optimizer_switch; +set optimizer_switch = 'subquery_cache=off'; +SELECT * FROM t1 WHERE ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) OR a > 100; +a +SELECT *, ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) FROM t1; +a ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) +1 NULL +2 NULL +3 NULL +set optimizer_switch=@mdev367_optimizer_switch; +DROP TABLE t1; +# +# lp:944706 Query with impossible or constant subquery in WHERE or HAVING is not # precomputed and thus not part of optimization # CREATE TABLE t1 ( a VARCHAR(16), KEY (a) ); @@ -6763,6 +6789,69 @@ id select_type table type possible_keys key key_len ref rows Extra SELECT * FROM t1 WHERE 4 IN (SELECT MAX(b) FROM t2 WHERE EXISTS (SELECT * FROM t1)); a drop table t1,t2; -# return optimizer switch changed in the beginning of this test -set optimizer_switch=@subselect_tmp; +# +# MDEV-410: EXPLAIN shows type=range, while SHOW EXPLAIN and userstat show full table scan is used +# +CREATE TABLE t1 (a VARCHAR(3) PRIMARY KEY) ENGINE=MyISAM; +INSERT INTO t1 VALUES ('USA'); +CREATE TABLE t2 (b INT, c VARCHAR(52), KEY(b)) ENGINE=MyISAM; +INSERT INTO t2 VALUES (3813,'United States'),(3940,'Russia'); +CREATE TABLE t3 (d INT, KEY(d)) ENGINE=MyISAM; +INSERT INTO t3 VALUES (12),(22),(9),(45); +create table t4 like t3; +insert into t4 select * from t3; +# This should not show range access for table t2 +explain +SELECT MIN(b) FROM ( SELECT * FROM t1, t2, t3 WHERE d = b ) AS alias1 +WHERE SLEEP(0.1) OR c < 'p' OR b = ( SELECT MIN(b) FROM t2 ); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 system NULL NULL NULL NULL 1 +1 PRIMARY t2 ALL b NULL NULL NULL 2 Using where +1 PRIMARY t3 ref d d 5 test.t2.b 2 Using where; Using index +3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +set @tmp_mdev410=@@global.userstat; +set global userstat=on; +flush table_statistics; +flush index_statistics; +SELECT MIN(b) FROM ( SELECT * FROM t1, t2, t3 WHERE d = b ) AS alias1 +WHERE SLEEP(0.1) OR c < 'p' OR b = ( SELECT MIN(b) FROM t2 ); +MIN(b) +NULL +# The following shows that t2 was indeed scanned with a full scan. +show table_statistics; +Table_schema Table_name Rows_read Rows_changed Rows_changed_x_#indexes +test t1 2 0 0 +test t2 3 0 0 +show index_statistics; +Table_schema Table_name Index_name Rows_read +test t2 b 1 +set global userstat=@tmp_mdev410; +DROP TABLE t1,t2,t3,t4; +# +# MDEV-430: Server crashes in select_describe on EXPLAIN with +# materialization+semijoin, 2 nested subqueries, aggregate functions +# +CREATE TABLE t1 (a INT, KEY(a)); +INSERT INTO t1 VALUES (1),(8); +CREATE TABLE t2 (b INT, KEY(b)); +INSERT INTO t2 VALUES (45),(17),(20); +EXPLAIN SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t1, t2 WHERE b = a GROUP BY a HAVING a <> 1 ) ; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +2 SUBQUERY t1 index a a 5 NULL 1 Using where; Using index +2 SUBQUERY t2 ref b b 5 test.t1.a 2 Using index +DROP TABLE t1,t2; +# +# MDEV-405: Server crashes in test_if_skip_sort_order on EXPLAIN with GROUP BY and HAVING in EXISTS subquery +# +CREATE TABLE t1 (a INT, KEY(a)); +INSERT INTO t1 VALUES (1),(8); +CREATE TABLE t2 (b INT, KEY(b)); +INSERT INTO t2 VALUES (45),(17),(20); +EXPLAIN SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t1, t2 WHERE b = a GROUP BY a HAVING a <> 1 ) ; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +2 SUBQUERY t1 index a a 5 NULL 1 Using where; Using index +2 SUBQUERY t2 ref b b 5 test.t1.a 2 Using index +DROP TABLE t1,t2; set @optimizer_switch_for_subselect_test=null; diff --git a/mysql-test/r/subselect_no_scache.result b/mysql-test/r/subselect_no_scache.result index cdad363313d..e68f5990c08 100644 --- a/mysql-test/r/subselect_no_scache.result +++ b/mysql-test/r/subselect_no_scache.result @@ -4202,7 +4202,7 @@ INSERT INTO t1 VALUES (1,1),(2,1); EXPLAIN SELECT 1 FROM t1 WHERE a = (SELECT COUNT(*) FROM t1 GROUP BY b); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ref a a 5 const 1 Using where; Using index -2 SUBQUERY internal_tmp_table ALL group_key NULL NULL NULL 1 Using temporary; Using filesort +2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using temporary; Using filesort DROP TABLE t1; CREATE TABLE t1 (id int NOT NULL, st CHAR(2), INDEX idx(id)); INSERT INTO t1 VALUES @@ -5972,7 +5972,7 @@ id select_type table type possible_keys key key_len ref rows Extra EXPLAIN SELECT * FROM t1 WHERE EXISTS (SELECT * FROM t1 WHERE a=7); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 4 -2 SUBQUERY t1 ref a a 5 const 1 +2 SUBQUERY t1 ref a a 5 const 1 Using index DROP TABLE t1; # # BUG#12616253 - WRONG RESULT WITH EXISTS(SUBQUERY) (MISSING ROWS) @@ -6133,7 +6133,7 @@ set optimizer_switch=@tmp_optimizer_switch; EXPLAIN SELECT * FROM t1 WHERE EXISTS (SELECT * FROM t1 WHERE a=7); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 4 -2 SUBQUERY t1 ref a a 5 const 1 +2 SUBQUERY t1 ref a a 5 const 1 Using index DROP TABLE t1; # @@ -6618,7 +6618,33 @@ SELECT MIN(a) AS min_a, a FROM t1 WHERE 1=2 HAVING a NOT IN ( SELECT a from t1 U min_a a drop table t1; # -# LP BUG#944706 Query with impossible or constant subquery in WHERE or HAVING is not +# MDEV-367: Different results with and without subquery_cache on +# a query with a constant NOT IN condition +# +CREATE TABLE t1 (a INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1),(2),(3); +set @mdev367_optimizer_switch = @@optimizer_switch; +set optimizer_switch = 'subquery_cache=on'; +SELECT * FROM t1 WHERE ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) OR a > 100; +a +SELECT *, ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) FROM t1; +a ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) +1 NULL +2 NULL +3 NULL +set optimizer_switch=@mdev367_optimizer_switch; +set optimizer_switch = 'subquery_cache=off'; +SELECT * FROM t1 WHERE ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) OR a > 100; +a +SELECT *, ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) FROM t1; +a ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) +1 NULL +2 NULL +3 NULL +set optimizer_switch=@mdev367_optimizer_switch; +DROP TABLE t1; +# +# lp:944706 Query with impossible or constant subquery in WHERE or HAVING is not # precomputed and thus not part of optimization # CREATE TABLE t1 ( a VARCHAR(16), KEY (a) ); @@ -6774,8 +6800,71 @@ id select_type table type possible_keys key key_len ref rows Extra SELECT * FROM t1 WHERE 4 IN (SELECT MAX(b) FROM t2 WHERE EXISTS (SELECT * FROM t1)); a drop table t1,t2; -# return optimizer switch changed in the beginning of this test -set optimizer_switch=@subselect_tmp; +# +# MDEV-410: EXPLAIN shows type=range, while SHOW EXPLAIN and userstat show full table scan is used +# +CREATE TABLE t1 (a VARCHAR(3) PRIMARY KEY) ENGINE=MyISAM; +INSERT INTO t1 VALUES ('USA'); +CREATE TABLE t2 (b INT, c VARCHAR(52), KEY(b)) ENGINE=MyISAM; +INSERT INTO t2 VALUES (3813,'United States'),(3940,'Russia'); +CREATE TABLE t3 (d INT, KEY(d)) ENGINE=MyISAM; +INSERT INTO t3 VALUES (12),(22),(9),(45); +create table t4 like t3; +insert into t4 select * from t3; +# This should not show range access for table t2 +explain +SELECT MIN(b) FROM ( SELECT * FROM t1, t2, t3 WHERE d = b ) AS alias1 +WHERE SLEEP(0.1) OR c < 'p' OR b = ( SELECT MIN(b) FROM t2 ); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 system NULL NULL NULL NULL 1 +1 PRIMARY t2 ALL b NULL NULL NULL 2 Using where +1 PRIMARY t3 ref d d 5 test.t2.b 2 Using where; Using index +3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +set @tmp_mdev410=@@global.userstat; +set global userstat=on; +flush table_statistics; +flush index_statistics; +SELECT MIN(b) FROM ( SELECT * FROM t1, t2, t3 WHERE d = b ) AS alias1 +WHERE SLEEP(0.1) OR c < 'p' OR b = ( SELECT MIN(b) FROM t2 ); +MIN(b) +NULL +# The following shows that t2 was indeed scanned with a full scan. +show table_statistics; +Table_schema Table_name Rows_read Rows_changed Rows_changed_x_#indexes +test t1 2 0 0 +test t2 3 0 0 +show index_statistics; +Table_schema Table_name Index_name Rows_read +test t2 b 1 +set global userstat=@tmp_mdev410; +DROP TABLE t1,t2,t3,t4; +# +# MDEV-430: Server crashes in select_describe on EXPLAIN with +# materialization+semijoin, 2 nested subqueries, aggregate functions +# +CREATE TABLE t1 (a INT, KEY(a)); +INSERT INTO t1 VALUES (1),(8); +CREATE TABLE t2 (b INT, KEY(b)); +INSERT INTO t2 VALUES (45),(17),(20); +EXPLAIN SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t1, t2 WHERE b = a GROUP BY a HAVING a <> 1 ) ; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +2 SUBQUERY t1 index a a 5 NULL 1 Using where; Using index +2 SUBQUERY t2 ref b b 5 test.t1.a 2 Using index +DROP TABLE t1,t2; +# +# MDEV-405: Server crashes in test_if_skip_sort_order on EXPLAIN with GROUP BY and HAVING in EXISTS subquery +# +CREATE TABLE t1 (a INT, KEY(a)); +INSERT INTO t1 VALUES (1),(8); +CREATE TABLE t2 (b INT, KEY(b)); +INSERT INTO t2 VALUES (45),(17),(20); +EXPLAIN SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t1, t2 WHERE b = a GROUP BY a HAVING a <> 1 ) ; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +2 SUBQUERY t1 index a a 5 NULL 1 Using where; Using index +2 SUBQUERY t2 ref b b 5 test.t1.a 2 Using index +DROP TABLE t1,t2; set optimizer_switch=default; select @@optimizer_switch like '%subquery_cache=on%'; @@optimizer_switch like '%subquery_cache=on%' diff --git a/mysql-test/r/subselect_no_semijoin.result b/mysql-test/r/subselect_no_semijoin.result index 8e6d4bfccc2..f0ce541294a 100644 --- a/mysql-test/r/subselect_no_semijoin.result +++ b/mysql-test/r/subselect_no_semijoin.result @@ -4196,7 +4196,7 @@ INSERT INTO t1 VALUES (1,1),(2,1); EXPLAIN SELECT 1 FROM t1 WHERE a = (SELECT COUNT(*) FROM t1 GROUP BY b); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ref a a 5 const 1 Using where; Using index -2 SUBQUERY internal_tmp_table ALL group_key NULL NULL NULL 1 Using temporary; Using filesort +2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using temporary; Using filesort DROP TABLE t1; CREATE TABLE t1 (id int NOT NULL, st CHAR(2), INDEX idx(id)); INSERT INTO t1 VALUES @@ -5963,7 +5963,7 @@ id select_type table type possible_keys key key_len ref rows Extra EXPLAIN SELECT * FROM t1 WHERE EXISTS (SELECT * FROM t1 WHERE a=7); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 4 -2 SUBQUERY t1 ref a a 5 const 1 +2 SUBQUERY t1 ref a a 5 const 1 Using index DROP TABLE t1; # # BUG#12616253 - WRONG RESULT WITH EXISTS(SUBQUERY) (MISSING ROWS) @@ -6122,7 +6122,7 @@ set optimizer_switch=@tmp_optimizer_switch; EXPLAIN SELECT * FROM t1 WHERE EXISTS (SELECT * FROM t1 WHERE a=7); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 4 -2 SUBQUERY t1 ref a a 5 const 1 +2 SUBQUERY t1 ref a a 5 const 1 Using index DROP TABLE t1; # @@ -6607,7 +6607,33 @@ SELECT MIN(a) AS min_a, a FROM t1 WHERE 1=2 HAVING a NOT IN ( SELECT a from t1 U min_a a drop table t1; # -# LP BUG#944706 Query with impossible or constant subquery in WHERE or HAVING is not +# MDEV-367: Different results with and without subquery_cache on +# a query with a constant NOT IN condition +# +CREATE TABLE t1 (a INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1),(2),(3); +set @mdev367_optimizer_switch = @@optimizer_switch; +set optimizer_switch = 'subquery_cache=on'; +SELECT * FROM t1 WHERE ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) OR a > 100; +a +SELECT *, ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) FROM t1; +a ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) +1 NULL +2 NULL +3 NULL +set optimizer_switch=@mdev367_optimizer_switch; +set optimizer_switch = 'subquery_cache=off'; +SELECT * FROM t1 WHERE ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) OR a > 100; +a +SELECT *, ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) FROM t1; +a ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) +1 NULL +2 NULL +3 NULL +set optimizer_switch=@mdev367_optimizer_switch; +DROP TABLE t1; +# +# lp:944706 Query with impossible or constant subquery in WHERE or HAVING is not # precomputed and thus not part of optimization # CREATE TABLE t1 ( a VARCHAR(16), KEY (a) ); @@ -6763,7 +6789,70 @@ id select_type table type possible_keys key key_len ref rows Extra SELECT * FROM t1 WHERE 4 IN (SELECT MAX(b) FROM t2 WHERE EXISTS (SELECT * FROM t1)); a drop table t1,t2; -# return optimizer switch changed in the beginning of this test -set optimizer_switch=@subselect_tmp; +# +# MDEV-410: EXPLAIN shows type=range, while SHOW EXPLAIN and userstat show full table scan is used +# +CREATE TABLE t1 (a VARCHAR(3) PRIMARY KEY) ENGINE=MyISAM; +INSERT INTO t1 VALUES ('USA'); +CREATE TABLE t2 (b INT, c VARCHAR(52), KEY(b)) ENGINE=MyISAM; +INSERT INTO t2 VALUES (3813,'United States'),(3940,'Russia'); +CREATE TABLE t3 (d INT, KEY(d)) ENGINE=MyISAM; +INSERT INTO t3 VALUES (12),(22),(9),(45); +create table t4 like t3; +insert into t4 select * from t3; +# This should not show range access for table t2 +explain +SELECT MIN(b) FROM ( SELECT * FROM t1, t2, t3 WHERE d = b ) AS alias1 +WHERE SLEEP(0.1) OR c < 'p' OR b = ( SELECT MIN(b) FROM t2 ); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 system NULL NULL NULL NULL 1 +1 PRIMARY t2 ALL b NULL NULL NULL 2 Using where +1 PRIMARY t3 ref d d 5 test.t2.b 2 Using where; Using index +3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +set @tmp_mdev410=@@global.userstat; +set global userstat=on; +flush table_statistics; +flush index_statistics; +SELECT MIN(b) FROM ( SELECT * FROM t1, t2, t3 WHERE d = b ) AS alias1 +WHERE SLEEP(0.1) OR c < 'p' OR b = ( SELECT MIN(b) FROM t2 ); +MIN(b) +NULL +# The following shows that t2 was indeed scanned with a full scan. +show table_statistics; +Table_schema Table_name Rows_read Rows_changed Rows_changed_x_#indexes +test t1 2 0 0 +test t2 3 0 0 +show index_statistics; +Table_schema Table_name Index_name Rows_read +test t2 b 1 +set global userstat=@tmp_mdev410; +DROP TABLE t1,t2,t3,t4; +# +# MDEV-430: Server crashes in select_describe on EXPLAIN with +# materialization+semijoin, 2 nested subqueries, aggregate functions +# +CREATE TABLE t1 (a INT, KEY(a)); +INSERT INTO t1 VALUES (1),(8); +CREATE TABLE t2 (b INT, KEY(b)); +INSERT INTO t2 VALUES (45),(17),(20); +EXPLAIN SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t1, t2 WHERE b = a GROUP BY a HAVING a <> 1 ) ; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +2 SUBQUERY t1 index a a 5 NULL 1 Using where; Using index +2 SUBQUERY t2 ref b b 5 test.t1.a 2 Using index +DROP TABLE t1,t2; +# +# MDEV-405: Server crashes in test_if_skip_sort_order on EXPLAIN with GROUP BY and HAVING in EXISTS subquery +# +CREATE TABLE t1 (a INT, KEY(a)); +INSERT INTO t1 VALUES (1),(8); +CREATE TABLE t2 (b INT, KEY(b)); +INSERT INTO t2 VALUES (45),(17),(20); +EXPLAIN SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t1, t2 WHERE b = a GROUP BY a HAVING a <> 1 ) ; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +2 SUBQUERY t1 index a a 5 NULL 1 Using where; Using index +2 SUBQUERY t2 ref b b 5 test.t1.a 2 Using index +DROP TABLE t1,t2; set @optimizer_switch_for_subselect_test=null; set @join_cache_level_for_subselect_test=NULL; diff --git a/mysql-test/r/type_blob.result b/mysql-test/r/type_blob.result index fc2e0854620..723efbdcb23 100644 --- a/mysql-test/r/type_blob.result +++ b/mysql-test/r/type_blob.result @@ -878,6 +878,8 @@ ERROR 42000: Column length too big for column 'a' (max = 255); use BLOB or TEXT CREATE TABLE b15776 (a char(4294967296)); ERROR 42000: Display width out of range for 'a' (max = 4294967295) CREATE TABLE b15776 (a year(4294967295)); +Warnings: +Note 1287 'YEAR(4294967295)' is deprecated and will be removed in a future release. Please use YEAR(4) instead INSERT INTO b15776 VALUES (42); SELECT * FROM b15776; a @@ -886,6 +888,8 @@ DROP TABLE b15776; CREATE TABLE b15776 (a year(4294967296)); ERROR 42000: Display width out of range for 'a' (max = 4294967295) CREATE TABLE b15776 (a year(0)); +Warnings: +Note 1287 'YEAR(0)' is deprecated and will be removed in a future release. Please use YEAR(4) instead DROP TABLE b15776; CREATE TABLE b15776 (a year(-2)); ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '-2))' at line 1 diff --git a/mysql-test/r/type_year.result b/mysql-test/r/type_year.result index 5d89a1ee407..4b9bf6f433f 100644 --- a/mysql-test/r/type_year.result +++ b/mysql-test/r/type_year.result @@ -1,5 +1,7 @@ drop table if exists t1; create table t1 (y year,y2 year(2)); +Warnings: +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead insert into t1 values (0,0),(1999,1999),(2000,2000),(2001,2001),(70,70),(69,69); select * from t1; y y2 @@ -50,6 +52,8 @@ End of 5.0 tests # Bug #49480: WHERE using YEAR columns returns unexpected results # CREATE TABLE t2(yy YEAR(2), c2 CHAR(4)); +Warnings: +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead CREATE TABLE t4(yyyy YEAR(4), c4 CHAR(4)); INSERT INTO t2 (c2) VALUES (NULL),(1970),(1999),(2000),(2001),(2069); INSERT INTO t4 (c4) SELECT c2 FROM t2; @@ -358,9 +362,22 @@ total_rows min_value MAX(c1+0) 3 0 2155 DROP TABLE t1; # +# WL#6219: Deprecate and remove YEAR(2) type +# +CREATE TABLE t1 (c1 YEAR(2), c2 YEAR(4)); +Warnings: +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead +ALTER TABLE t1 MODIFY COLUMN c2 YEAR(2); +Warnings: +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead +DROP TABLE t1; +# End of 5.1 tests create function y2k() returns int deterministic return 2000; create table t1 (a year(2), b int); +Warnings: +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead insert t1 values (0,2000); select a from t1 where a=2000; a diff --git a/mysql-test/r/user_var-binlog.result b/mysql-test/r/user_var-binlog.result index 251d0b39098..68d2364986d 100644 --- a/mysql-test/r/user_var-binlog.result +++ b/mysql-test/r/user_var-binlog.result @@ -34,7 +34,7 @@ SET @@session.collation_database=DEFAULT/*!*/; BEGIN /*!*/; SET @`a b`:=_latin1 0x68656C6C6F COLLATE `latin1_swedish_ci`/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=10000/*!*/; INSERT INTO t1 VALUES(@`a b`) /*!*/; diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result index 008f8f41ada..b50f6b81206 100644 --- a/mysql-test/r/view.result +++ b/mysql-test/r/view.result @@ -4674,6 +4674,19 @@ INSERT INTO t2 VALUES (1); DROP TRIGGER tr; DROP VIEW v1; DROP TABLE t1,t2,t3; +# +# LP bug#1007622 Server crashes in handler::increment_statistics on +# inserting into a view over a view +# +CREATE TABLE t1 (a INT); +CREATE ALGORITHM=MERGE VIEW v1 AS SELECT a1.* FROM t1 AS a1, t1 AS a2; +CREATE ALGORITHM=MERGE VIEW v2 AS SELECT * FROM v1; +INSERT INTO v2 (a) VALUES (1) ; +select * from t1; +a +1 +drop view v2,v1; +drop table t1; # ----------------------------------------------------------------- # -- End of 5.3 tests. # ----------------------------------------------------------------- diff --git a/mysql-test/suite/binlog/r/binlog_base64_flag.result b/mysql-test/suite/binlog/r/binlog_base64_flag.result index 33feb5c7591..f84995cac3b 100644 --- a/mysql-test/suite/binlog/r/binlog_base64_flag.result +++ b/mysql-test/suite/binlog/r/binlog_base64_flag.result @@ -35,7 +35,7 @@ DELIMITER /*!*/; # at 4 <#>ROLLBACK/*!*/; # at 102 -<#>use test/*!*/; +<#>use `test`/*!*/; SET TIMESTAMP=1196959712/*!*/; <#>SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/; SET @@session.sql_mode=0/*!*/; diff --git a/mysql-test/suite/binlog/r/binlog_drop_if_exists.result b/mysql-test/suite/binlog/r/binlog_drop_if_exists.result index 0c398bed440..f39b682d2de 100644 --- a/mysql-test/suite/binlog/r/binlog_drop_if_exists.result +++ b/mysql-test/suite/binlog/r/binlog_drop_if_exists.result @@ -96,3 +96,21 @@ master-bin.000001 # Query # # use `test`; DROP VIEW IF EXISTS db_bug_13684.v master-bin.000001 # Query # # use `test`; DROP EVENT IF EXISTS db_bug_13684.e master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `db_bug_13684`.`t` /* generated by server */ master-bin.000001 # Query # # DROP DATABASE IF EXISTS db_bug_13684 +CREATE TABLE t1(id int); +DROP TABLE /* comment */ t1; +CREATE TABLE t1(id int); +DROP TABLE IF EXISTS /* comment */ t1; +CREATE TABLE t1(id int); +DROP TABLE /**/ t1; +CREATE TABLE t1(id int); +DROP TABLE IF EXISTS /* */ t1; +show binlog events from <binlog_start>; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; CREATE TABLE t1(id int) +master-bin.000001 # Query # # use `test`; DROP TABLE /* comment */ `t1` /* generated by server */ +master-bin.000001 # Query # # use `test`; CREATE TABLE t1(id int) +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS /* comment */ `t1` /* generated by server */ +master-bin.000001 # Query # # use `test`; CREATE TABLE t1(id int) +master-bin.000001 # Query # # use `test`; DROP TABLE /**/ `t1` /* generated by server */ +master-bin.000001 # Query # # use `test`; CREATE TABLE t1(id int) +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS /* */ `t1` /* generated by server */ diff --git a/mysql-test/suite/binlog/r/binlog_row_mysqlbinlog_options.result b/mysql-test/suite/binlog/r/binlog_row_mysqlbinlog_options.result index d4a3503b1f2..9c780390ca8 100644 --- a/mysql-test/suite/binlog/r/binlog_row_mysqlbinlog_options.result +++ b/mysql-test/suite/binlog/r/binlog_row_mysqlbinlog_options.result @@ -35,7 +35,7 @@ DELIMITER /*!*/; #010909 4:46:40 server id # end_log_pos # Start: binlog v 4, server v #.##.## created 010909 4:46:40 at startup ROLLBACK/*!*/; # at # -use new_test1/*!*/; +use `new_test1`/*!*/; #010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=#/*!*/; @@ -72,7 +72,7 @@ COMMIT /*!*/; # at # #010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0 -use test2/*!*/; +use `test2`/*!*/; SET TIMESTAMP=1000000000/*!*/; CREATE TABLE t2 (a INT) /*!*/; @@ -115,7 +115,7 @@ SET TIMESTAMP=1000000000/*!*/; COMMIT /*!*/; # at # -use new_test3/*!*/; +use `new_test3`/*!*/; #010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; CREATE TABLE t3 (a INT) @@ -229,7 +229,7 @@ DELIMITER /*!*/; #010909 4:46:40 server id # end_log_pos # Start: binlog v 4, server v #.##.## created 010909 4:46:40 at startup ROLLBACK/*!*/; # at # -use new_test1/*!*/; +use `new_test1`/*!*/; #010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=#/*!*/; @@ -266,7 +266,7 @@ COMMIT /*!*/; # at # #010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0 -use test2/*!*/; +use `test2`/*!*/; SET TIMESTAMP=1000000000/*!*/; CREATE TABLE t2 (a INT) /*!*/; @@ -309,7 +309,7 @@ SET TIMESTAMP=1000000000/*!*/; COMMIT /*!*/; # at # -use new_test3/*!*/; +use `new_test3`/*!*/; #010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; CREATE TABLE t3 (a INT) diff --git a/mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result b/mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result index 4bdafb609a7..3207b9c2180 100644 --- a/mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result +++ b/mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result @@ -26,7 +26,7 @@ SET @@session.collation_database=DEFAULT/*!*/; BEGIN /*!*/; SET @`v`:=_ucs2 0x006100620063 COLLATE `ucs2_general_ci`/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=10000/*!*/; insert into t2 values (@v) /*!*/; diff --git a/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result b/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result index da2e24506fd..978b045d599 100644 --- a/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result +++ b/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result @@ -698,7 +698,7 @@ master-bin.000001 # Query # # BEGIN master-bin.000001 # Intvar # # INSERT_ID=10 master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=# master-bin.000001 # Intvar # # INSERT_ID=10 -master-bin.000001 # Execute_load_query # # use `test`; LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE `t4` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a`, @b) SET `b`= @b + bug27417(2) ;file_id=# +master-bin.000001 # Execute_load_query # # use `test`; LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE `t4` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a`, @`b`) SET `b`= @b + bug27417(2) ;file_id=# master-bin.000001 # Query # # ROLLBACK /* the output must denote there is the query */; drop trigger trg_del_t2; @@ -950,7 +950,7 @@ master-bin.000001 # User var # # @`b`=_latin1 0x3135 COLLATE latin1_swedish_ci master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=# master-bin.000001 # Intvar # # INSERT_ID=10 master-bin.000001 # User var # # @`b`=_latin1 0x3135 COLLATE latin1_swedish_ci -master-bin.000001 # Execute_load_query # # use `test`; LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE `t4` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a`, @b) SET `b`= @b + bug27417(2) ;file_id=# +master-bin.000001 # Execute_load_query # # use `test`; LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE `t4` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a`, @`b`) SET `b`= @b + bug27417(2) ;file_id=# master-bin.000001 # Query # # ROLLBACK drop trigger trg_del_t2; drop table t1,t2,t3,t4,t5; diff --git a/mysql-test/suite/binlog/t/binlog_drop_if_exists.test b/mysql-test/suite/binlog/t/binlog_drop_if_exists.test index 6b2b37ae791..26910432428 100644 --- a/mysql-test/suite/binlog/t/binlog_drop_if_exists.test +++ b/mysql-test/suite/binlog/t/binlog_drop_if_exists.test @@ -113,3 +113,18 @@ if($fixed_bug_25705) --source include/show_binlog_events.inc enable_warnings; + +# Drop comments in binlog +let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1); +CREATE TABLE t1(id int); +DROP TABLE /* comment */ t1; +CREATE TABLE t1(id int); +DROP TABLE IF EXISTS /* comment */ t1; + +CREATE TABLE t1(id int); +DROP TABLE /**/ t1; +CREATE TABLE t1(id int); +DROP TABLE IF EXISTS /* */ t1; + +--source include/show_binlog_events.inc + diff --git a/mysql-test/suite/engines/funcs/r/an_calendar.result b/mysql-test/suite/engines/funcs/r/an_calendar.result index e974a67444e..f057c3b618f 100644 --- a/mysql-test/suite/engines/funcs/r/an_calendar.result +++ b/mysql-test/suite/engines/funcs/r/an_calendar.result @@ -16,7 +16,13 @@ DROP TABLE t1; CREATE TABLE t1(c1 TIME NULL, c2 TIME NULL); SET TIMESTAMP=1171346973; INSERT INTO t1 VALUES(NOW(),NOW()); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 INSERT INTO t1 VALUES(NOW(),NOW()); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 ANALYZE TABLE t1; Table Op Msg_type Msg_text test.t1 analyze status OK diff --git a/mysql-test/suite/engines/funcs/r/datetime_function.result b/mysql-test/suite/engines/funcs/r/datetime_function.result index 182f61f67f0..583552edc7d 100644 --- a/mysql-test/suite/engines/funcs/r/datetime_function.result +++ b/mysql-test/suite/engines/funcs/r/datetime_function.result @@ -25,7 +25,15 @@ INSERT INTO t3 VALUES('2008-02-29 13:13:13'); DROP TABLE t3; CREATE TABLE t3(c1 TIME NOT NULL); INSERT INTO t3 VALUES('1000-01-01 00:00:00'); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 INSERT INTO t3 VALUES('1999-12-31 23:59:59'); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 INSERT INTO t3 VALUES('2000-01-01 00:00:00'); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 INSERT INTO t3 VALUES('2008-02-29 13:13:13'); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 DROP TABLE t3; diff --git a/mysql-test/suite/engines/funcs/r/db_alter_collate_ascii.result b/mysql-test/suite/engines/funcs/r/db_alter_collate_ascii.result index 6a9bfae27db..9792236af0a 100644 --- a/mysql-test/suite/engines/funcs/r/db_alter_collate_ascii.result +++ b/mysql-test/suite/engines/funcs/r/db_alter_collate_ascii.result @@ -77,6 +77,7 @@ utf8_persian_ci utf8 208 # # utf8_esperanto_ci utf8 209 # # utf8_hungarian_ci utf8 210 # # utf8_sinhala_ci utf8 211 # # +utf8_croatian_ci utf8 213 # # utf8_general_mysql500_ci utf8 223 # # ucs2_general_ci ucs2 35 Yes # # ucs2_bin ucs2 90 # # @@ -100,6 +101,7 @@ ucs2_persian_ci ucs2 144 # # ucs2_esperanto_ci ucs2 145 # # ucs2_hungarian_ci ucs2 146 # # ucs2_sinhala_ci ucs2 147 # # +ucs2_croatian_ci ucs2 149 # # ucs2_general_mysql500_ci ucs2 159 # # cp866_general_ci cp866 36 Yes # # cp866_bin cp866 68 # # @@ -137,6 +139,7 @@ utf8mb4_persian_ci utf8mb4 240 # # utf8mb4_esperanto_ci utf8mb4 241 # # utf8mb4_hungarian_ci utf8mb4 242 # # utf8mb4_sinhala_ci utf8mb4 243 # # +utf8mb4_croatian_ci utf8mb4 245 # # cp1251_bulgarian_ci cp1251 14 # # cp1251_ukrainian_ci cp1251 23 # # cp1251_bin cp1251 50 # # @@ -164,6 +167,7 @@ utf16_persian_ci utf16 117 # # utf16_esperanto_ci utf16 118 # # utf16_hungarian_ci utf16 119 # # utf16_sinhala_ci utf16 120 # # +utf16_croatian_ci utf16 215 # # cp1256_general_ci cp1256 57 Yes # # cp1256_bin cp1256 67 # # cp1257_lithuanian_ci cp1257 29 # # @@ -191,6 +195,7 @@ utf32_persian_ci utf32 176 # # utf32_esperanto_ci utf32 177 # # utf32_hungarian_ci utf32 178 # # utf32_sinhala_ci utf32 179 # # +utf32_croatian_ci utf32 214 # # binary binary 63 Yes # # geostd8_general_ci geostd8 92 Yes # # geostd8_bin geostd8 93 # # diff --git a/mysql-test/suite/engines/funcs/r/db_alter_collate_utf8.result b/mysql-test/suite/engines/funcs/r/db_alter_collate_utf8.result index 79d1d4cbac2..9490446e83d 100644 --- a/mysql-test/suite/engines/funcs/r/db_alter_collate_utf8.result +++ b/mysql-test/suite/engines/funcs/r/db_alter_collate_utf8.result @@ -77,6 +77,7 @@ utf8_persian_ci utf8 208 # # utf8_esperanto_ci utf8 209 # # utf8_hungarian_ci utf8 210 # # utf8_sinhala_ci utf8 211 # # +utf8_croatian_ci utf8 213 # # utf8_general_mysql500_ci utf8 223 # # ucs2_general_ci ucs2 35 Yes # # ucs2_bin ucs2 90 # # @@ -100,6 +101,7 @@ ucs2_persian_ci ucs2 144 # # ucs2_esperanto_ci ucs2 145 # # ucs2_hungarian_ci ucs2 146 # # ucs2_sinhala_ci ucs2 147 # # +ucs2_croatian_ci ucs2 149 # # ucs2_general_mysql500_ci ucs2 159 # # cp866_general_ci cp866 36 Yes # # cp866_bin cp866 68 # # @@ -137,6 +139,7 @@ utf8mb4_persian_ci utf8mb4 240 # # utf8mb4_esperanto_ci utf8mb4 241 # # utf8mb4_hungarian_ci utf8mb4 242 # # utf8mb4_sinhala_ci utf8mb4 243 # # +utf8mb4_croatian_ci utf8mb4 245 # # cp1251_bulgarian_ci cp1251 14 # # cp1251_ukrainian_ci cp1251 23 # # cp1251_bin cp1251 50 # # @@ -164,6 +167,7 @@ utf16_persian_ci utf16 117 # # utf16_esperanto_ci utf16 118 # # utf16_hungarian_ci utf16 119 # # utf16_sinhala_ci utf16 120 # # +utf16_croatian_ci utf16 215 # # cp1256_general_ci cp1256 57 Yes # # cp1256_bin cp1256 67 # # cp1257_lithuanian_ci cp1257 29 # # @@ -191,6 +195,7 @@ utf32_persian_ci utf32 176 # # utf32_esperanto_ci utf32 177 # # utf32_hungarian_ci utf32 178 # # utf32_sinhala_ci utf32 179 # # +utf32_croatian_ci utf32 214 # # binary binary 63 Yes # # geostd8_general_ci geostd8 92 Yes # # geostd8_bin geostd8 93 # # diff --git a/mysql-test/suite/engines/funcs/r/db_use_error.result b/mysql-test/suite/engines/funcs/r/db_use_error.result index 03c41e927ac..2051b56b19e 100644 --- a/mysql-test/suite/engines/funcs/r/db_use_error.result +++ b/mysql-test/suite/engines/funcs/r/db_use_error.result @@ -9,7 +9,7 @@ mysql performance_schema test USE DATABASE nond6; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DATABASE nond6' at line 1 +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'DATABASE nond6' at line 1 DROP DATABASE d6; SHOW DATABASES; Database diff --git a/mysql-test/suite/engines/funcs/r/de_calendar_range.result b/mysql-test/suite/engines/funcs/r/de_calendar_range.result index 07543e0c8c4..ab39556e6ce 100644 --- a/mysql-test/suite/engines/funcs/r/de_calendar_range.result +++ b/mysql-test/suite/engines/funcs/r/de_calendar_range.result @@ -33,10 +33,20 @@ DROP TABLE t1; CREATE TABLE t1(c1 TIME NOT NULL PRIMARY KEY); SET TIMESTAMP=1171346973; INSERT INTO t1 (c1) VALUES(NOW()); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 INSERT INTO t1 (c1) VALUES(ADDTIME(NOW(),'1 01:01:01')); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 INSERT INTO t1 (c1) VALUES(ADDTIME(NOW(),'2 02:01:01')); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 INSERT INTO t1 (c1) VALUES(ADDTIME(NOW(),'3 03:01:01')); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 INSERT INTO t1 (c1) VALUES(ADDTIME(NOW(),'4 04:01:01')); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 SELECT * FROM t1 ORDER BY c1; c1 09:09:33 @@ -47,8 +57,6 @@ c1 DELETE FROM t1 WHERE c1 <= ADDTIME(NOW(),'2 02:01:01'); SELECT * FROM t1 ORDER BY c1; c1 -12:10:34 -13:10:34 DROP TABLE t1; CREATE TABLE t1(c1 DATETIME NOT NULL PRIMARY KEY); SET TIMESTAMP=1171346973; diff --git a/mysql-test/suite/engines/funcs/r/in_calendar_2_unique_constraints_duplicate_update.result b/mysql-test/suite/engines/funcs/r/in_calendar_2_unique_constraints_duplicate_update.result index 9c56e23574d..c68baf685e2 100644 --- a/mysql-test/suite/engines/funcs/r/in_calendar_2_unique_constraints_duplicate_update.result +++ b/mysql-test/suite/engines/funcs/r/in_calendar_2_unique_constraints_duplicate_update.result @@ -66,12 +66,42 @@ DROP TABLE t1; CREATE TABLE t1(c1 TIME NOT NULL, c2 TIME NULL, c3 TIME NULL, PRIMARY KEY(c1), UNIQUE(c2)); SET TIMESTAMP=1171346973; INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),ADDTIME(NOW(),'4 04:01:01'),NOW()); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t1 (c1,c2,c3) VALUES(ADDTIME(NOW(),'1 01:01:01'),ADDTIME(NOW(),'3 03:01:01'),NOW()); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t1 (c1,c2,c3) VALUES(ADDTIME(NOW(),'2 02:01:01'),ADDTIME(NOW(),'2 02:01:01'),NOW()); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t1 (c1,c2,c3) VALUES(ADDTIME(NOW(),'3 03:01:01'),ADDTIME(NOW(),'1 01:01:01'),NOW()); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t1 (c1,c2,c3) VALUES(ADDTIME(NOW(),'4 04:01:01'),NOW(),NOW()); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t1 (c1,c2,c3) VALUES(ADDTIME(NOW(),'2 02:01:01'),ADDTIME(NOW(),'2 02:01:01'),NOW()) ON DUPLICATE KEY UPDATE c3=ADDTIME(NOW(),'6 06:01:01'); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),NOW()) ON DUPLICATE KEY UPDATE c3=ADDTIME(NOW(),'6 06:01:01'); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 SELECT * FROM t1; c1 c2 c3 09:09:33 13:10:34 15:10:34 diff --git a/mysql-test/suite/engines/funcs/r/in_calendar_pk_constraint_duplicate_update.result b/mysql-test/suite/engines/funcs/r/in_calendar_pk_constraint_duplicate_update.result index 47355681eae..6e3f717e93d 100644 --- a/mysql-test/suite/engines/funcs/r/in_calendar_pk_constraint_duplicate_update.result +++ b/mysql-test/suite/engines/funcs/r/in_calendar_pk_constraint_duplicate_update.result @@ -29,8 +29,15 @@ DROP TABLE t1; CREATE TABLE t1(c1 TIME NOT NULL PRIMARY KEY); SET TIMESTAMP=1171346973; INSERT INTO t1 (c1) VALUES(NOW()); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 INSERT INTO t1 (c1) VALUES(ADDTIME(NOW(),'1 01:01:01')); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 INSERT INTO t1 (c1) VALUES(NOW()) ON DUPLICATE KEY UPDATE c1=ADDTIME(NOW(),'2 02:01:01'); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c1' at row 1 SELECT * FROM t1; c1 10:10:34 diff --git a/mysql-test/suite/engines/funcs/r/in_calendar_pk_constraint_error.result b/mysql-test/suite/engines/funcs/r/in_calendar_pk_constraint_error.result index f8bff355901..4644894beec 100644 --- a/mysql-test/suite/engines/funcs/r/in_calendar_pk_constraint_error.result +++ b/mysql-test/suite/engines/funcs/r/in_calendar_pk_constraint_error.result @@ -28,7 +28,11 @@ DROP TABLE t1; CREATE TABLE t1(c1 TIME NOT NULL PRIMARY KEY); SET TIMESTAMP=1171346973; INSERT INTO t1 (c1) VALUES(NOW()); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 INSERT INTO t1 (c1) VALUES(ADDTIME(NOW(),'1 01:01:01')); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 INSERT INTO t1 (c1) VALUES(NOW()); ERROR 23000: Duplicate entry '09:09:33' for key 'PRIMARY' SELECT * FROM t1; diff --git a/mysql-test/suite/engines/funcs/r/in_calendar_pk_constraint_ignore.result b/mysql-test/suite/engines/funcs/r/in_calendar_pk_constraint_ignore.result index f8bff355901..4644894beec 100644 --- a/mysql-test/suite/engines/funcs/r/in_calendar_pk_constraint_ignore.result +++ b/mysql-test/suite/engines/funcs/r/in_calendar_pk_constraint_ignore.result @@ -28,7 +28,11 @@ DROP TABLE t1; CREATE TABLE t1(c1 TIME NOT NULL PRIMARY KEY); SET TIMESTAMP=1171346973; INSERT INTO t1 (c1) VALUES(NOW()); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 INSERT INTO t1 (c1) VALUES(ADDTIME(NOW(),'1 01:01:01')); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 INSERT INTO t1 (c1) VALUES(NOW()); ERROR 23000: Duplicate entry '09:09:33' for key 'PRIMARY' SELECT * FROM t1; diff --git a/mysql-test/suite/engines/funcs/r/in_calendar_unique_constraint_duplicate_update.result b/mysql-test/suite/engines/funcs/r/in_calendar_unique_constraint_duplicate_update.result index 5c4307158fa..8af6ff6af13 100644 --- a/mysql-test/suite/engines/funcs/r/in_calendar_unique_constraint_duplicate_update.result +++ b/mysql-test/suite/engines/funcs/r/in_calendar_unique_constraint_duplicate_update.result @@ -29,8 +29,15 @@ DROP TABLE t1; CREATE TABLE t1(c1 TIME NULL UNIQUE); SET TIMESTAMP=1171346973; INSERT INTO t1 (c1) VALUES(NOW()); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 INSERT INTO t1 (c1) VALUES(ADDTIME(NOW(),'1 01:01:01')); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 INSERT INTO t1 (c1) VALUES(NOW()) ON DUPLICATE KEY UPDATE c1=ADDTIME(NOW(),'2 02:01:01'); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c1' at row 1 SELECT * FROM t1; c1 10:10:34 diff --git a/mysql-test/suite/engines/funcs/r/in_calendar_unique_constraint_error.result b/mysql-test/suite/engines/funcs/r/in_calendar_unique_constraint_error.result index 9f6a205530c..c96cd4ba8a8 100644 --- a/mysql-test/suite/engines/funcs/r/in_calendar_unique_constraint_error.result +++ b/mysql-test/suite/engines/funcs/r/in_calendar_unique_constraint_error.result @@ -28,7 +28,11 @@ DROP TABLE t1; CREATE TABLE t1(c1 TIME NULL UNIQUE); SET TIMESTAMP=1171346973; INSERT INTO t1 (c1) VALUES(NOW()); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 INSERT INTO t1 (c1) VALUES(ADDTIME(NOW(),'1 01:01:01')); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 INSERT INTO t1 (c1) VALUES(NOW()); ERROR 23000: Duplicate entry '09:09:33' for key 'c1' SELECT * FROM t1; diff --git a/mysql-test/suite/engines/funcs/r/in_calendar_unique_constraint_ignore.result b/mysql-test/suite/engines/funcs/r/in_calendar_unique_constraint_ignore.result index 5469527b762..210460d33f1 100644 --- a/mysql-test/suite/engines/funcs/r/in_calendar_unique_constraint_ignore.result +++ b/mysql-test/suite/engines/funcs/r/in_calendar_unique_constraint_ignore.result @@ -28,8 +28,14 @@ DROP TABLE t1; CREATE TABLE t1(c1 TIME NULL UNIQUE); SET TIMESTAMP=1171346973; INSERT INTO t1 (c1) VALUES(NOW()); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 INSERT INTO t1 (c1) VALUES(ADDTIME(NOW(),'1 01:01:01')); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 INSERT IGNORE INTO t1 (c1) VALUES(NOW()); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 SELECT * FROM t1; c1 09:09:33 diff --git a/mysql-test/suite/engines/funcs/r/in_multicolumn_calendar_pk_constraint_duplicate_update.result b/mysql-test/suite/engines/funcs/r/in_multicolumn_calendar_pk_constraint_duplicate_update.result index d7dfc9d794c..209f61440cd 100644 --- a/mysql-test/suite/engines/funcs/r/in_multicolumn_calendar_pk_constraint_duplicate_update.result +++ b/mysql-test/suite/engines/funcs/r/in_multicolumn_calendar_pk_constraint_duplicate_update.result @@ -61,11 +61,40 @@ DROP TABLE t1; CREATE TABLE t1(c1 TIME NOT NULL, c2 TIME NOT NULL, c3 TIME NOT NULL, PRIMARY KEY(c1,c2,c3)); SET TIMESTAMP=1171346973; INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),NOW()); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),ADDTIME(NOW(),'1 01:01:01')); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),ADDTIME(NOW(),'1 01:01:01'),NOW()); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t1 (c1,c2,c3) VALUES(ADDTIME(NOW(),'1 01:01:01'),NOW(),NOW()); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),NOW()) ON DUPLICATE KEY UPDATE c1=ADDTIME(NOW(),'2 02:01:01'),c2=ADDTIME(NOW(),'2 02:01:01'),c3=ADDTIME(NOW(),'2 02:01:01'); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),ADDTIME(NOW(),'1 01:01:01')) ON DUPLICATE KEY UPDATE c1=ADDTIME(NOW(),'2 02:01:01'),c2=ADDTIME(NOW(),'2 02:01:01'); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 SELECT * FROM t1; c1 c2 c3 09:09:33 10:10:34 09:09:33 diff --git a/mysql-test/suite/engines/funcs/r/in_multicolumn_calendar_pk_constraint_error.result b/mysql-test/suite/engines/funcs/r/in_multicolumn_calendar_pk_constraint_error.result index d71af8d6375..9c310d3d457 100644 --- a/mysql-test/suite/engines/funcs/r/in_multicolumn_calendar_pk_constraint_error.result +++ b/mysql-test/suite/engines/funcs/r/in_multicolumn_calendar_pk_constraint_error.result @@ -52,9 +52,25 @@ DROP TABLE t1; CREATE TABLE t1(c1 TIME NOT NULL, c2 TIME NOT NULL, c3 TIME NOT NULL, PRIMARY KEY(c1,c2,c3)); SET TIMESTAMP=1171346973; INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),NOW()); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),ADDTIME(NOW(),'1 01:01:01')); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),ADDTIME(NOW(),'1 01:01:01'),NOW()); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t1 (c1,c2,c3) VALUES(ADDTIME(NOW(),'1 01:01:01'),NOW(),NOW()); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),NOW()); ERROR 23000: Duplicate entry '09:09:33-09:09:33-09:09:33' for key 'PRIMARY' INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),ADDTIME(NOW(),'1 01:01:01')); diff --git a/mysql-test/suite/engines/funcs/r/in_multicolumn_calendar_pk_constraint_ignore.result b/mysql-test/suite/engines/funcs/r/in_multicolumn_calendar_pk_constraint_ignore.result index d71af8d6375..9c310d3d457 100644 --- a/mysql-test/suite/engines/funcs/r/in_multicolumn_calendar_pk_constraint_ignore.result +++ b/mysql-test/suite/engines/funcs/r/in_multicolumn_calendar_pk_constraint_ignore.result @@ -52,9 +52,25 @@ DROP TABLE t1; CREATE TABLE t1(c1 TIME NOT NULL, c2 TIME NOT NULL, c3 TIME NOT NULL, PRIMARY KEY(c1,c2,c3)); SET TIMESTAMP=1171346973; INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),NOW()); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),ADDTIME(NOW(),'1 01:01:01')); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),ADDTIME(NOW(),'1 01:01:01'),NOW()); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t1 (c1,c2,c3) VALUES(ADDTIME(NOW(),'1 01:01:01'),NOW(),NOW()); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),NOW()); ERROR 23000: Duplicate entry '09:09:33-09:09:33-09:09:33' for key 'PRIMARY' INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),ADDTIME(NOW(),'1 01:01:01')); diff --git a/mysql-test/suite/engines/funcs/r/in_multicolumn_calendar_unique_constraint_duplicate_update.result b/mysql-test/suite/engines/funcs/r/in_multicolumn_calendar_unique_constraint_duplicate_update.result index edad4bb218d..fe509a0615c 100644 --- a/mysql-test/suite/engines/funcs/r/in_multicolumn_calendar_unique_constraint_duplicate_update.result +++ b/mysql-test/suite/engines/funcs/r/in_multicolumn_calendar_unique_constraint_duplicate_update.result @@ -61,11 +61,40 @@ DROP TABLE t1; CREATE TABLE t1(c1 TIME NULL, c2 TIME NULL, c3 TIME NULL, UNIQUE(c1,c2,c3)); SET TIMESTAMP=1171346973; INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),NOW()); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),ADDTIME(NOW(),'1 01:01:01')); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),ADDTIME(NOW(),'1 01:01:01'),NOW()); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t1 (c1,c2,c3) VALUES(ADDTIME(NOW(),'1 01:01:01'),NOW(),NOW()); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),NOW()) ON DUPLICATE KEY UPDATE c1=ADDTIME(NOW(),'2 02:01:01'),c2=ADDTIME(NOW(),'2 02:01:01'),c3=ADDTIME(NOW(),'2 02:01:01'); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),ADDTIME(NOW(),'1 01:01:01')) ON DUPLICATE KEY UPDATE c1=ADDTIME(NOW(),'2 02:01:01'),c2=ADDTIME(NOW(),'2 02:01:01'); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 SELECT * FROM t1; c1 c2 c3 09:09:33 10:10:34 09:09:33 diff --git a/mysql-test/suite/engines/funcs/r/in_multicolumn_calendar_unique_constraint_error.result b/mysql-test/suite/engines/funcs/r/in_multicolumn_calendar_unique_constraint_error.result index 4d7cadac70c..78b0e81cd56 100644 --- a/mysql-test/suite/engines/funcs/r/in_multicolumn_calendar_unique_constraint_error.result +++ b/mysql-test/suite/engines/funcs/r/in_multicolumn_calendar_unique_constraint_error.result @@ -52,9 +52,25 @@ DROP TABLE t1; CREATE TABLE t1(c1 TIME NULL, c2 TIME NULL, c3 TIME NULL, UNIQUE(c1,c2,c3)); SET TIMESTAMP=1171346973; INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),NOW()); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),ADDTIME(NOW(),'1 01:01:01')); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),ADDTIME(NOW(),'1 01:01:01'),NOW()); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t1 (c1,c2,c3) VALUES(ADDTIME(NOW(),'1 01:01:01'),NOW(),NOW()); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),NOW()); ERROR 23000: Duplicate entry '09:09:33-09:09:33-09:09:33' for key 'c1' INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),ADDTIME(NOW(),'1 01:01:01')); diff --git a/mysql-test/suite/engines/funcs/r/in_multicolumn_calendar_unique_constraint_ignore.result b/mysql-test/suite/engines/funcs/r/in_multicolumn_calendar_unique_constraint_ignore.result index 31f7db1dc9a..a884345be84 100644 --- a/mysql-test/suite/engines/funcs/r/in_multicolumn_calendar_unique_constraint_ignore.result +++ b/mysql-test/suite/engines/funcs/r/in_multicolumn_calendar_unique_constraint_ignore.result @@ -56,11 +56,35 @@ DROP TABLE t1; CREATE TABLE t1(c1 TIME NULL, c2 TIME NULL, c3 TIME NULL, UNIQUE(c1,c2,c3)); SET TIMESTAMP=1171346973; INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),NOW()); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),ADDTIME(NOW(),'1 01:01:01')); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),ADDTIME(NOW(),'1 01:01:01'),NOW()); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t1 (c1,c2,c3) VALUES(ADDTIME(NOW(),'1 01:01:01'),NOW(),NOW()); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),NOW()); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 INSERT IGNORE INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),ADDTIME(NOW(),'1 01:01:01')); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 SELECT * FROM t1; c1 c2 c3 09:09:33 09:09:33 09:09:33 diff --git a/mysql-test/suite/engines/funcs/r/in_multicolumn_number_pk_constraint_duplicate_update.result b/mysql-test/suite/engines/funcs/r/in_multicolumn_number_pk_constraint_duplicate_update.result index d7dfc9d794c..209f61440cd 100644 --- a/mysql-test/suite/engines/funcs/r/in_multicolumn_number_pk_constraint_duplicate_update.result +++ b/mysql-test/suite/engines/funcs/r/in_multicolumn_number_pk_constraint_duplicate_update.result @@ -61,11 +61,40 @@ DROP TABLE t1; CREATE TABLE t1(c1 TIME NOT NULL, c2 TIME NOT NULL, c3 TIME NOT NULL, PRIMARY KEY(c1,c2,c3)); SET TIMESTAMP=1171346973; INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),NOW()); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),ADDTIME(NOW(),'1 01:01:01')); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),ADDTIME(NOW(),'1 01:01:01'),NOW()); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t1 (c1,c2,c3) VALUES(ADDTIME(NOW(),'1 01:01:01'),NOW(),NOW()); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),NOW()) ON DUPLICATE KEY UPDATE c1=ADDTIME(NOW(),'2 02:01:01'),c2=ADDTIME(NOW(),'2 02:01:01'),c3=ADDTIME(NOW(),'2 02:01:01'); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),ADDTIME(NOW(),'1 01:01:01')) ON DUPLICATE KEY UPDATE c1=ADDTIME(NOW(),'2 02:01:01'),c2=ADDTIME(NOW(),'2 02:01:01'); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c1' at row 1 +Note 1265 Data truncated for column 'c2' at row 1 SELECT * FROM t1; c1 c2 c3 09:09:33 10:10:34 09:09:33 diff --git a/mysql-test/suite/engines/funcs/r/in_number_boundary_error.result b/mysql-test/suite/engines/funcs/r/in_number_boundary_error.result index 556b5a05764..53964697506 100644 --- a/mysql-test/suite/engines/funcs/r/in_number_boundary_error.result +++ b/mysql-test/suite/engines/funcs/r/in_number_boundary_error.result @@ -7,7 +7,7 @@ INSERT INTO t4 (c1) VALUES(0); INSERT INTO t4 (c1) VALUES(-1); ERROR 22003: Out of range value for column 'c1' at row 1 INSERT INTO t4 (c1) VALUES('x'); -ERROR HY000: Incorrect integer value: 'x' for column 'c1' at row 1 +ERROR 22007: Incorrect integer value: 'x' for column 'c1' at row 1 INSERT INTO t4 (c1) VALUES('9'); SELECT COUNT(c1) AS total_rows FROM t4; total_rows @@ -26,7 +26,7 @@ INSERT INTO t4 (c1) VALUES(0); INSERT INTO t4 (c1) VALUES(-1); ERROR 22003: Out of range value for column 'c1' at row 1 INSERT INTO t4 (c1) VALUES('x'); -ERROR HY000: Incorrect integer value: 'x' for column 'c1' at row 1 +ERROR 22007: Incorrect integer value: 'x' for column 'c1' at row 1 INSERT INTO t4 (c1) VALUES('9'); SELECT COUNT(c1) AS total_rows FROM t4; total_rows @@ -45,7 +45,7 @@ INSERT INTO t4 (c1) VALUES(0); INSERT INTO t4 (c1) VALUES(-1); ERROR 22003: Out of range value for column 'c1' at row 1 INSERT INTO t4 (c1) VALUES('x'); -ERROR HY000: Incorrect integer value: 'x' for column 'c1' at row 1 +ERROR 22007: Incorrect integer value: 'x' for column 'c1' at row 1 INSERT INTO t4 (c1) VALUES('9'); SELECT COUNT(c1) AS total_rows FROM t4; total_rows @@ -64,7 +64,7 @@ INSERT INTO t4 (c1) VALUES(0); INSERT INTO t4 (c1) VALUES(-1); ERROR 22003: Out of range value for column 'c1' at row 1 INSERT INTO t4 (c1) VALUES('x'); -ERROR HY000: Incorrect integer value: 'x' for column 'c1' at row 1 +ERROR 22007: Incorrect integer value: 'x' for column 'c1' at row 1 INSERT INTO t4 (c1) VALUES('9'); SELECT COUNT(c1) AS total_rows FROM t4; total_rows @@ -83,7 +83,7 @@ INSERT INTO t4 (c1) VALUES(0); INSERT INTO t4 (c1) VALUES(-1); ERROR 22003: Out of range value for column 'c1' at row 1 INSERT INTO t4 (c1) VALUES('x'); -ERROR HY000: Incorrect integer value: 'x' for column 'c1' at row 1 +ERROR 22007: Incorrect integer value: 'x' for column 'c1' at row 1 INSERT INTO t4 (c1) VALUES('9'); SELECT COUNT(c1) AS total_rows FROM t4; total_rows @@ -102,7 +102,7 @@ INSERT INTO t4 (c1) VALUES(0); INSERT INTO t4 (c1) VALUES(-1); ERROR 22003: Out of range value for column 'c1' at row 1 INSERT INTO t4 (c1) VALUES('x'); -ERROR HY000: Incorrect integer value: 'x' for column 'c1' at row 1 +ERROR 22007: Incorrect integer value: 'x' for column 'c1' at row 1 INSERT INTO t4 (c1) VALUES('9'); SELECT COUNT(c1) AS total_rows FROM t4; total_rows diff --git a/mysql-test/suite/engines/funcs/r/in_number_decimal_boundary_error.result b/mysql-test/suite/engines/funcs/r/in_number_decimal_boundary_error.result index fe7fc0e38d7..62ad9a568f9 100644 --- a/mysql-test/suite/engines/funcs/r/in_number_decimal_boundary_error.result +++ b/mysql-test/suite/engines/funcs/r/in_number_decimal_boundary_error.result @@ -7,7 +7,7 @@ INSERT INTO t5 (c1) VALUES(0); INSERT INTO t5 (c1) VALUES(-1); ERROR 22003: Out of range value for column 'c1' at row 1 INSERT INTO t5 (c1) VALUES('x'); -ERROR HY000: Incorrect decimal value: 'x' for column 'c1' at row 1 +ERROR 22007: Incorrect decimal value: 'x' for column 'c1' at row 1 INSERT INTO t5 (c1) VALUES(999999); ERROR 22003: Out of range value for column 'c1' at row 1 SELECT COUNT(c1) AS total_rows FROM t5; @@ -27,7 +27,7 @@ INSERT INTO t5 (c1) VALUES(0); INSERT INTO t5 (c1) VALUES(-1); ERROR 22003: Out of range value for column 'c1' at row 1 INSERT INTO t5 (c1) VALUES('x'); -ERROR HY000: Incorrect decimal value: 'x' for column 'c1' at row 1 +ERROR 22007: Incorrect decimal value: 'x' for column 'c1' at row 1 INSERT INTO t5 (c1) VALUES(999999); ERROR 22003: Out of range value for column 'c1' at row 1 SELECT COUNT(c1) AS total_rows FROM t5; @@ -47,7 +47,7 @@ INSERT INTO t5 (c1) VALUES(0); INSERT INTO t5 (c1) VALUES(-1); ERROR 22003: Out of range value for column 'c1' at row 1 INSERT INTO t5 (c1) VALUES('x'); -ERROR HY000: Incorrect decimal value: 'x' for column 'c1' at row 1 +ERROR 22007: Incorrect decimal value: 'x' for column 'c1' at row 1 INSERT INTO t5 (c1) VALUES(999999); ERROR 22003: Out of range value for column 'c1' at row 1 SELECT COUNT(c1) AS total_rows FROM t5; @@ -67,7 +67,7 @@ INSERT INTO t5 (c1) VALUES(0); INSERT INTO t5 (c1) VALUES(-1); ERROR 22003: Out of range value for column 'c1' at row 1 INSERT INTO t5 (c1) VALUES('x'); -ERROR HY000: Incorrect decimal value: 'x' for column 'c1' at row 1 +ERROR 22007: Incorrect decimal value: 'x' for column 'c1' at row 1 INSERT INTO t5 (c1) VALUES(999999); ERROR 22003: Out of range value for column 'c1' at row 1 SELECT COUNT(c1) AS total_rows FROM t5; diff --git a/mysql-test/suite/engines/funcs/r/ld_all_number_string_calendar_types.result b/mysql-test/suite/engines/funcs/r/ld_all_number_string_calendar_types.result index 63d36edd3aa..4776a3ac748 100644 --- a/mysql-test/suite/engines/funcs/r/ld_all_number_string_calendar_types.result +++ b/mysql-test/suite/engines/funcs/r/ld_all_number_string_calendar_types.result @@ -61,6 +61,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 TINYINT NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -77,6 +81,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 TINYINT NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -93,6 +101,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 TINYINT NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -325,6 +337,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 SMALLINT NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -341,6 +357,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 SMALLINT NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -357,6 +377,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 SMALLINT NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -589,6 +613,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -605,6 +633,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -621,6 +653,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -853,6 +889,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -869,6 +909,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -885,6 +929,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -1117,6 +1165,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 INTEGER NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -1133,6 +1185,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 INTEGER NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -1149,6 +1205,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 INTEGER NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -1381,6 +1441,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 BIGINT NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -1397,6 +1461,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 BIGINT NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -1413,6 +1481,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 BIGINT NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -1645,6 +1717,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DECIMAL NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -1661,6 +1737,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DECIMAL NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -1677,6 +1757,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DECIMAL NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -1909,6 +1993,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DEC NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -1925,6 +2013,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DEC NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -1941,6 +2033,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DEC NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -2173,6 +2269,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 FIXED NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -2189,6 +2289,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 FIXED NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -2205,6 +2309,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 FIXED NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -2437,6 +2545,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 NUMERIC NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -2453,6 +2565,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 NUMERIC NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -2469,6 +2585,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 NUMERIC NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -2701,6 +2821,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DOUBLE NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -2717,6 +2841,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DOUBLE NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -2733,6 +2861,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DOUBLE NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -2965,6 +3097,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 REAL NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -2981,6 +3117,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 REAL NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -2997,6 +3137,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 REAL NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -3229,6 +3373,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DOUBLE PRECISION NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -3245,6 +3393,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DOUBLE PRECISION NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -3261,6 +3413,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DOUBLE PRECISION NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -3493,6 +3649,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 FLOAT NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -3509,6 +3669,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 FLOAT NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -3525,6 +3689,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 FLOAT NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -3757,6 +3925,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 TINYINT NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -3773,6 +3945,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 TINYINT NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -3789,6 +3965,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 TINYINT NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -4021,6 +4201,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 SMALLINT NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -4037,6 +4221,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 SMALLINT NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -4053,6 +4241,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 SMALLINT NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -4285,6 +4477,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -4301,6 +4497,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -4317,6 +4517,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -4549,6 +4753,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -4565,6 +4773,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -4581,6 +4793,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -4813,6 +5029,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 INTEGER NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -4829,6 +5049,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 INTEGER NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -4845,6 +5069,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 INTEGER NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -5077,6 +5305,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 BIGINT NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -5093,6 +5325,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 BIGINT NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -5109,6 +5345,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 BIGINT NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -5341,6 +5581,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DECIMAL NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -5357,6 +5601,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DECIMAL NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -5373,6 +5621,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DECIMAL NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -5605,6 +5857,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DEC NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -5621,6 +5877,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DEC NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -5637,6 +5897,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DEC NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -5869,6 +6133,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 FIXED NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -5885,6 +6153,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 FIXED NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -5901,6 +6173,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 FIXED NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -6133,6 +6409,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 NUMERIC NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -6149,6 +6429,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 NUMERIC NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -6165,6 +6449,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 NUMERIC NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -6397,6 +6685,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DOUBLE NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -6413,6 +6705,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DOUBLE NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -6429,6 +6725,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DOUBLE NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -6661,6 +6961,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 REAL NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -6677,6 +6981,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 REAL NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -6693,6 +7001,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 REAL NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -6925,6 +7237,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DOUBLE PRECISION NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -6941,6 +7257,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DOUBLE PRECISION NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -6957,6 +7277,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DOUBLE PRECISION NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -7189,6 +7513,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 FLOAT NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -7205,6 +7533,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 FLOAT NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -7221,6 +7553,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 FLOAT NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -7453,6 +7789,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 TINYINT NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -7469,6 +7809,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 TINYINT NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -7485,6 +7829,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 TINYINT NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -7717,6 +8065,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 SMALLINT NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -7733,6 +8085,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 SMALLINT NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -7749,6 +8105,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 SMALLINT NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -7981,6 +8341,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -7997,6 +8361,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -8013,6 +8381,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -8245,6 +8617,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -8261,6 +8637,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -8277,6 +8657,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -8509,6 +8893,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 INTEGER NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -8525,6 +8913,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 INTEGER NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -8541,6 +8933,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 INTEGER NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -8773,6 +9169,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 BIGINT NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -8789,6 +9189,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 BIGINT NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -8805,6 +9209,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 BIGINT NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -9037,6 +9445,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DECIMAL NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -9053,6 +9465,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DECIMAL NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -9069,6 +9485,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DECIMAL NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -9301,6 +9721,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DEC NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -9317,6 +9741,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DEC NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -9333,6 +9761,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DEC NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -9565,6 +9997,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 FIXED NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -9581,6 +10017,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 FIXED NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -9597,6 +10037,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 FIXED NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -9829,6 +10273,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 NUMERIC NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -9845,6 +10293,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 NUMERIC NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -9861,6 +10313,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 NUMERIC NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -10093,6 +10549,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DOUBLE NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -10109,6 +10569,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DOUBLE NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -10125,6 +10589,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DOUBLE NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -10357,6 +10825,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 REAL NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -10373,6 +10845,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 REAL NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -10389,6 +10865,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 REAL NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -10621,6 +11101,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DOUBLE PRECISION NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -10637,6 +11121,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DOUBLE PRECISION NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -10653,6 +11141,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DOUBLE PRECISION NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -10885,6 +11377,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 FLOAT NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -10901,6 +11397,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 FLOAT NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -10917,6 +11417,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 FLOAT NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -11149,6 +11653,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 TINYINT NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -11165,6 +11673,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 TINYINT NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -11181,6 +11693,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 TINYINT NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -11413,6 +11929,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 SMALLINT NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -11429,6 +11949,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 SMALLINT NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -11445,6 +11969,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 SMALLINT NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -11677,6 +12205,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -11693,6 +12225,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -11709,6 +12245,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -11941,6 +12481,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -11957,6 +12501,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -11973,6 +12521,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -12205,6 +12757,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 INTEGER NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -12221,6 +12777,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 INTEGER NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -12237,6 +12797,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 INTEGER NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -12469,6 +13033,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 BIGINT NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -12485,6 +13053,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 BIGINT NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -12501,6 +13073,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 BIGINT NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -12733,6 +13309,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DECIMAL NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -12749,6 +13329,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DECIMAL NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -12765,6 +13349,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DECIMAL NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -12997,6 +13585,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DEC NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -13013,6 +13605,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DEC NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -13029,6 +13625,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DEC NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -13261,6 +13861,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 FIXED NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -13277,6 +13881,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 FIXED NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -13293,6 +13901,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 FIXED NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -13525,6 +14137,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 NUMERIC NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -13541,6 +14157,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 NUMERIC NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -13557,6 +14177,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 NUMERIC NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -13789,6 +14413,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DOUBLE NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -13805,6 +14433,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DOUBLE NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -13821,6 +14453,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DOUBLE NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -14053,6 +14689,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 REAL NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -14069,6 +14709,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 REAL NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -14085,6 +14729,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 REAL NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -14317,6 +14965,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DOUBLE PRECISION NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -14333,6 +14985,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DOUBLE PRECISION NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -14349,6 +15005,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 DOUBLE PRECISION NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -14581,6 +15241,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 FLOAT NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -14597,6 +15261,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 FLOAT NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 @@ -14613,6 +15281,10 @@ c1 c2 c3 DROP TABLE t1; CREATE TABLE t1 (c1 FLOAT NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME); LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'; +Warnings: +Note 1265 Data truncated for column 'c3' at row 1 +Note 1265 Data truncated for column 'c3' at row 2 +Note 1265 Data truncated for column 'c3' at row 3 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1; SELECT * FROM t1 ORDER BY c1; c1 c2 c3 diff --git a/mysql-test/suite/engines/funcs/r/sq_all.result b/mysql-test/suite/engines/funcs/r/sq_all.result index ac1908b7b1b..24e62a3f3ba 100644 --- a/mysql-test/suite/engines/funcs/r/sq_all.result +++ b/mysql-test/suite/engines/funcs/r/sq_all.result @@ -13,13 +13,10 @@ SELECT c1 FROM t1 WHERE c1 > ALL (SELECT c1 FROM t2); c1 SELECT c1 FROM t1 WHERE c1 >= ALL (SELECT c1 FROM t2); c1 -100 SELECT c1 FROM t1 WHERE c1 = ALL (SELECT c1 FROM t2); c1 SELECT c1 FROM t1 WHERE c1 <= ALL (SELECT c1 FROM t2); c1 -1 -2 SELECT c1 FROM t1 WHERE c1 <> ALL (SELECT c1 FROM t2); c1 DROP TABLE t1; @@ -37,13 +34,10 @@ SELECT c1 FROM t1 WHERE c1 > ALL (SELECT c1 FROM t2); c1 SELECT c1 FROM t1 WHERE c1 >= ALL (SELECT c1 FROM t2); c1 -100 SELECT c1 FROM t1 WHERE c1 = ALL (SELECT c1 FROM t2); c1 SELECT c1 FROM t1 WHERE c1 <= ALL (SELECT c1 FROM t2); c1 -1 -2 SELECT c1 FROM t1 WHERE c1 <> ALL (SELECT c1 FROM t2); c1 DROP TABLE t1; @@ -61,13 +55,10 @@ SELECT c1 FROM t1 WHERE c1 > ALL (SELECT c1 FROM t2); c1 SELECT c1 FROM t1 WHERE c1 >= ALL (SELECT c1 FROM t2); c1 -100 SELECT c1 FROM t1 WHERE c1 = ALL (SELECT c1 FROM t2); c1 SELECT c1 FROM t1 WHERE c1 <= ALL (SELECT c1 FROM t2); c1 -1 -2 SELECT c1 FROM t1 WHERE c1 <> ALL (SELECT c1 FROM t2); c1 DROP TABLE t1; @@ -85,13 +76,10 @@ SELECT c1 FROM t1 WHERE c1 > ALL (SELECT c1 FROM t2); c1 SELECT c1 FROM t1 WHERE c1 >= ALL (SELECT c1 FROM t2); c1 -100 SELECT c1 FROM t1 WHERE c1 = ALL (SELECT c1 FROM t2); c1 SELECT c1 FROM t1 WHERE c1 <= ALL (SELECT c1 FROM t2); c1 -1 -2 SELECT c1 FROM t1 WHERE c1 <> ALL (SELECT c1 FROM t2); c1 DROP TABLE t1; diff --git a/mysql-test/suite/engines/funcs/r/sq_error.result b/mysql-test/suite/engines/funcs/r/sq_error.result index 5ce36f50e49..c983ff73d12 100644 --- a/mysql-test/suite/engines/funcs/r/sq_error.result +++ b/mysql-test/suite/engines/funcs/r/sq_error.result @@ -11,7 +11,7 @@ INSERT INTO t2 VALUES (2,'abcde'); SELECT * FROM t1 WHERE c2 IN (SELECT c2 FROM t2 ORDER BY c1 LIMIT 1) --error 1241 SELECT (SELECT c1, c2 FROM t2) FROM t1; -ERROR 42000: This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery' +ERROR 42000: This version of MariaDB doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery' SELECT * FROM t1 WHERE c1 = (SELECT c1 FROM t2); ERROR 21000: Subquery returns more than 1 row UPDATE t1 SET c2 = (SELECT MAX(c1) FROM t2); @@ -30,7 +30,7 @@ INSERT INTO t2 VALUES (2,'abcde'); SELECT * FROM t1 WHERE c2 IN (SELECT c2 FROM t2 ORDER BY c1 LIMIT 1) --error 1241 SELECT (SELECT c1, c2 FROM t2) FROM t1; -ERROR 42000: This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery' +ERROR 42000: This version of MariaDB doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery' SELECT * FROM t1 WHERE c1 = (SELECT c1 FROM t2); ERROR 21000: Subquery returns more than 1 row UPDATE t1 SET c2 = (SELECT MAX(c1) FROM t2); @@ -49,7 +49,7 @@ INSERT INTO t2 VALUES (2,'abcde'); SELECT * FROM t1 WHERE c2 IN (SELECT c2 FROM t2 ORDER BY c1 LIMIT 1) --error 1241 SELECT (SELECT c1, c2 FROM t2) FROM t1; -ERROR 42000: This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery' +ERROR 42000: This version of MariaDB doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery' SELECT * FROM t1 WHERE c1 = (SELECT c1 FROM t2); ERROR 21000: Subquery returns more than 1 row UPDATE t1 SET c2 = (SELECT MAX(c1) FROM t2); @@ -68,7 +68,7 @@ INSERT INTO t2 VALUES (2,'abcde'); SELECT * FROM t1 WHERE c2 IN (SELECT c2 FROM t2 ORDER BY c1 LIMIT 1) --error 1241 SELECT (SELECT c1, c2 FROM t2) FROM t1; -ERROR 42000: This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery' +ERROR 42000: This version of MariaDB doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery' SELECT * FROM t1 WHERE c1 = (SELECT c1 FROM t2); ERROR 21000: Subquery returns more than 1 row UPDATE t1 SET c2 = (SELECT MAX(c1) FROM t2); diff --git a/mysql-test/suite/engines/funcs/r/up_calendar_range.result b/mysql-test/suite/engines/funcs/r/up_calendar_range.result index dbd6e2cf8a6..10bef827a88 100644 --- a/mysql-test/suite/engines/funcs/r/up_calendar_range.result +++ b/mysql-test/suite/engines/funcs/r/up_calendar_range.result @@ -39,10 +39,20 @@ DROP TABLE t1; CREATE TABLE t1(c1 TIME NOT NULL); SET TIMESTAMP=1171346973; INSERT INTO t1 (c1) VALUES(NOW()); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 INSERT INTO t1 (c1) VALUES(ADDTIME(NOW(),'1 01:01:01')); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 INSERT INTO t1 (c1) VALUES(ADDTIME(NOW(),'2 02:01:01')); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 INSERT INTO t1 (c1) VALUES(ADDTIME(NOW(),'3 03:01:01')); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 INSERT INTO t1 (c1) VALUES(ADDTIME(NOW(),'4 04:01:01')); +Warnings: +Note 1265 Data truncated for column 'c1' at row 1 SELECT * FROM t1 ORDER BY c1; c1 09:09:33 @@ -54,10 +64,10 @@ UPDATE t1 SET c1 = NOW() WHERE c1 >= ADDTIME(NOW(),'2 02:01:01'); SELECT * FROM t1 ORDER BY c1; c1 09:09:33 -09:09:33 -09:09:33 -09:09:33 10:10:34 +11:10:34 +12:10:34 +13:10:34 DROP TABLE t1; CREATE TABLE t1(c1 DATETIME NOT NULL); SET TIMESTAMP=1171346973; diff --git a/mysql-test/suite/engines/funcs/t/se_join_left.test b/mysql-test/suite/engines/funcs/t/se_join_left.test index 005936acb3b..792f2cdd699 100644 --- a/mysql-test/suite/engines/funcs/t/se_join_left.test +++ b/mysql-test/suite/engines/funcs/t/se_join_left.test @@ -12,8 +12,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 USING (c1); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -27,8 +30,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 USING (c1); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -42,8 +48,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 USING (c1); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -57,8 +66,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 USING (c1); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -72,8 +84,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 USING (c1); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -87,8 +102,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 USING (c1); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -102,8 +120,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 USING (c1); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -117,8 +138,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 USING (c1); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -132,8 +156,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 USING (c1); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -147,8 +174,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 USING (c1); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -162,8 +192,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 USING (c1); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -177,8 +210,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 USING (c1); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -192,8 +228,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 USING (c1); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -207,8 +246,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 USING (c1); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -222,8 +264,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 USING (c1); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -237,8 +282,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 USING (c1); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -252,8 +300,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 USING (c1); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -267,8 +318,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 USING (c1); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -282,8 +336,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 USING (c1); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -297,8 +354,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 USING (c1); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -312,8 +372,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 USING (c1); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -327,8 +390,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 USING (c1); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -342,8 +408,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 USING (c1); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -357,8 +426,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 USING (c1); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -372,8 +444,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 USING (c1); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -387,8 +462,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 USING (c1); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -402,8 +480,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 USING (c1); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -417,8 +498,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 USING (c1); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -432,8 +516,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 USING (c1); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -447,8 +534,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 USING (c1); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -462,8 +552,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 USING (c1); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -477,8 +570,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 USING (c1); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -492,8 +588,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 USING (c1); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -507,8 +606,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 USING (c1); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -522,8 +624,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 USING (c1); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -537,8 +642,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 USING (c1); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -552,8 +660,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 USING (c1); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -567,8 +678,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 USING (c1); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -582,8 +696,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 USING (c1); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -597,8 +714,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 USING (c1); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -612,8 +732,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 USING (c1); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -627,8 +750,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 USING (c1); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -642,8 +768,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 USING (c1); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -657,8 +786,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 USING (c1); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -672,8 +804,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 USING (c1); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -687,8 +822,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 USING (c1); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -702,8 +840,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 USING (c1); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -717,8 +858,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 USING (c1); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -732,8 +876,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 USING (c1); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -747,8 +894,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 USING (c1); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -762,8 +912,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 USING (c1); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -777,8 +930,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 USING (c1); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -792,8 +948,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 USING (c1); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -807,8 +966,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 USING (c1); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -822,8 +984,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 USING (c1); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -837,8 +1002,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 USING (c1); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -852,8 +1020,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 USING (c1); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -867,8 +1038,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 USING (c1); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -882,8 +1056,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 USING (c1); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -897,8 +1074,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 USING (c1); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -912,8 +1092,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 USING (c1); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -927,8 +1110,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 USING (c1); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -942,8 +1128,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 USING (c1); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -957,8 +1146,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 USING (c1); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -972,8 +1164,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 USING (c1); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -987,8 +1182,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 USING (c1); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1002,8 +1200,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 USING (c1); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1017,8 +1218,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 USING (c1); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1032,8 +1236,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 USING (c1); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1047,8 +1254,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 USING (c1); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1062,8 +1272,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 USING (c1); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1077,8 +1290,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 USING (c1); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1092,8 +1308,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 USING (c1); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1107,8 +1326,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 USING (c1); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1122,8 +1344,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 USING (c1); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1137,8 +1362,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 USING (c1); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1152,8 +1380,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 USING (c1); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1167,8 +1398,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 USING (c1); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1182,8 +1416,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 USING (c1); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1197,8 +1434,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 USING (c1); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1212,8 +1452,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 USING (c1); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1227,8 +1470,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 USING (c1); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1242,8 +1488,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 USING (c1); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1257,8 +1506,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 USING (c1); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1272,8 +1524,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 USING (c1); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1287,8 +1542,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 USING (c1); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1302,8 +1560,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 USING (c1); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1317,8 +1578,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 USING (c1); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1332,8 +1596,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 USING (c1); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1347,8 +1614,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 USING (c1); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1362,8 +1632,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 USING (c1); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1377,8 +1650,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 USING (c1); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1392,8 +1668,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 USING (c1); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1407,8 +1686,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 USING (c1); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1422,8 +1704,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 USING (c1); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1437,8 +1722,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 USING (c1); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1452,8 +1740,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 USING (c1); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1467,8 +1758,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 USING (c1); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1482,8 +1776,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 USING (c1); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1497,8 +1794,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 USING (c1); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1512,8 +1812,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 USING (c1); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1527,8 +1830,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 USING (c1); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1542,8 +1848,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 USING (c1); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1557,8 +1866,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 USING (c1); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1572,8 +1884,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 USING (c1); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1587,8 +1902,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 USING (c1); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1602,8 +1920,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 USING (c1); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1617,8 +1938,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 USING (c1); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1632,8 +1956,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 USING (c1); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1647,8 +1974,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 USING (c1); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1662,8 +1992,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 USING (c1); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1677,8 +2010,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 USING (c1); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1692,8 +2028,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 USING (c1); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1707,8 +2046,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 USING (c1); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1722,8 +2064,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 USING (c1); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1737,8 +2082,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 USING (c1); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1752,8 +2100,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 USING (c1); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1767,8 +2118,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 USING (c1); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1782,8 +2136,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 USING (c1); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1797,8 +2154,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 USING (c1); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1812,8 +2172,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 USING (c1); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1827,8 +2190,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 USING (c1); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1842,8 +2208,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 USING (c1); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1857,8 +2226,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 USING (c1); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1872,8 +2244,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 USING (c1); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1887,8 +2262,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 USING (c1); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1902,8 +2280,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 USING (c1); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1917,8 +2298,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 USING (c1); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1932,8 +2316,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 USING (c1); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1947,8 +2334,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 USING (c1); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1962,8 +2352,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 USING (c1); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1977,8 +2370,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 USING (c1); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1992,8 +2388,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 USING (c1); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2007,8 +2406,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 USING (c1); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2022,8 +2424,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 USING (c1); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2037,8 +2442,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 USING (c1); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2052,8 +2460,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 USING (c1); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2067,8 +2478,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 USING (c1); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2082,8 +2496,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 USING (c1); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2097,8 +2514,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 USING (c1); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2112,8 +2532,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 USING (c1); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2127,8 +2550,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 USING (c1); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2142,8 +2568,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 USING (c1); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2157,8 +2586,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 USING (c1); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2172,8 +2604,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 USING (c1); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2187,8 +2622,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 USING (c1); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2202,8 +2640,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 USING (c1); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2217,8 +2658,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 USING (c1); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2232,8 +2676,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 USING (c1); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2247,8 +2694,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 USING (c1); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2262,8 +2712,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 USING (c1); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2277,8 +2730,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 USING (c1); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2292,8 +2748,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 USING (c1); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2307,8 +2766,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 USING (c1); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2322,8 +2784,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 USING (c1); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2337,8 +2802,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 USING (c1); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2352,8 +2820,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 USING (c1); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2367,8 +2838,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 USING (c1); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2382,8 +2856,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 USING (c1); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2397,8 +2874,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 USING (c1); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2412,8 +2892,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 USING (c1); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2427,8 +2910,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 USING (c1); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2442,8 +2928,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 USING (c1); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2457,8 +2946,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 USING (c1); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2472,8 +2964,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 USING (c1); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2487,8 +2982,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 USING (c1); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2502,8 +3000,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 USING (c1); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2517,8 +3018,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 USING (c1); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2532,8 +3036,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 USING (c1); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2547,8 +3054,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 USING (c1); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2562,8 +3072,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 USING (c1); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2577,8 +3090,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 USING (c1); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2592,8 +3108,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 USING (c1); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2607,8 +3126,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 USING (c1); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2622,8 +3144,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 USING (c1); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2637,8 +3162,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 USING (c1); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2652,8 +3180,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 USING (c1); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2667,8 +3198,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 USING (c1); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2682,8 +3216,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 USING (c1); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2697,8 +3234,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 USING (c1); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2712,8 +3252,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 USING (c1); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2727,8 +3270,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 USING (c1); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2742,8 +3288,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 USING (c1); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2757,8 +3306,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 USING (c1); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2772,8 +3324,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 USING (c1); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2787,8 +3342,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 USING (c1); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2802,8 +3360,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 USING (c1); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2817,8 +3378,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 USING (c1); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2832,8 +3396,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 USING (c1); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2847,8 +3414,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 USING (c1); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2862,8 +3432,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 USING (c1); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2877,8 +3450,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 USING (c1); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2892,8 +3468,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 USING (c1); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2907,8 +3486,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 USING (c1); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2922,8 +3504,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 USING (c1); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2937,8 +3522,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 USING (c1); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2952,8 +3540,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 USING (c1); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2967,8 +3558,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 USING (c1); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2982,8 +3576,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 USING (c1); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2997,8 +3594,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 USING (c1); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -3012,8 +3612,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 USING (c1); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -3027,8 +3630,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 USING (c1); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -3042,8 +3648,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 USING (c1); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -3057,8 +3666,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 USING (c1); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -3072,8 +3684,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 USING (c1); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -3087,8 +3702,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 USING (c1); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -3102,8 +3720,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 USING (c1); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -3117,8 +3738,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 USING (c1); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -3132,8 +3756,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 USING (c1); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -3147,8 +3774,11 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 USING (c1); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; diff --git a/mysql-test/suite/engines/funcs/t/se_join_left_outer.test b/mysql-test/suite/engines/funcs/t/se_join_left_outer.test index d986159078b..5e6b8af633b 100644 --- a/mysql-test/suite/engines/funcs/t/se_join_left_outer.test +++ b/mysql-test/suite/engines/funcs/t/se_join_left_outer.test @@ -12,7 +12,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -26,7 +28,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -40,7 +44,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -54,7 +60,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -68,7 +76,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -82,7 +92,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -96,7 +108,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -110,7 +124,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -124,7 +140,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -138,7 +156,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -152,7 +172,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -166,7 +188,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -180,7 +204,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -194,7 +220,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -208,7 +236,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -222,7 +252,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -236,7 +268,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -250,7 +284,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -264,7 +300,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -278,7 +316,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -292,7 +332,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -306,7 +348,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -320,7 +364,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -334,7 +380,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -348,7 +396,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -362,7 +412,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -376,7 +428,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -390,7 +444,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -404,7 +460,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -418,7 +476,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -432,7 +492,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -446,7 +508,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -460,7 +524,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -474,7 +540,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -488,7 +556,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -502,7 +572,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -516,7 +588,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -530,7 +604,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -544,7 +620,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -558,7 +636,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -572,7 +652,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -586,7 +668,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -600,7 +684,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -614,7 +700,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -628,7 +716,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -642,7 +732,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -656,7 +748,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -670,7 +764,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -684,7 +780,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -698,7 +796,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -712,7 +812,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -726,7 +828,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -740,7 +844,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -754,7 +860,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -768,7 +876,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -782,7 +892,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -796,7 +908,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -810,7 +924,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -824,7 +940,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -838,7 +956,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -852,7 +972,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -866,7 +988,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -880,7 +1004,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -894,7 +1020,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -908,7 +1036,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -922,7 +1052,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -936,7 +1068,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -950,7 +1084,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -964,7 +1100,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -978,7 +1116,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -992,7 +1132,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1006,7 +1148,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1020,7 +1164,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1034,7 +1180,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1048,7 +1196,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1062,7 +1212,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1076,7 +1228,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1090,7 +1244,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1104,7 +1260,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1118,7 +1276,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1132,7 +1292,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1146,7 +1308,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1160,7 +1324,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1174,7 +1340,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1188,7 +1356,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1202,7 +1372,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1216,7 +1388,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1230,7 +1404,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1244,7 +1420,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1258,7 +1436,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1272,7 +1452,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1286,7 +1468,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1300,7 +1484,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1314,7 +1500,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1328,7 +1516,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1342,7 +1532,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1356,7 +1548,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1370,7 +1564,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1384,7 +1580,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1398,7 +1596,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1412,7 +1612,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1426,7 +1628,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1440,7 +1644,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1454,7 +1660,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1468,7 +1676,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1482,7 +1692,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1496,7 +1708,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1510,7 +1724,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1524,7 +1740,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1538,7 +1756,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1552,7 +1772,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1566,7 +1788,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1580,7 +1804,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1594,7 +1820,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1608,7 +1836,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1622,7 +1852,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1636,7 +1868,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1650,7 +1884,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1664,7 +1900,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1678,7 +1916,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1692,7 +1932,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1706,7 +1948,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1720,7 +1964,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1734,7 +1980,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1748,7 +1996,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1762,7 +2012,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1776,7 +2028,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1790,7 +2044,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1804,7 +2060,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1818,7 +2076,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1832,7 +2092,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1846,7 +2108,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1860,7 +2124,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1874,7 +2140,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1888,7 +2156,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1902,7 +2172,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1916,7 +2188,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1930,7 +2204,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1944,7 +2220,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1958,7 +2236,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1972,7 +2252,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1986,7 +2268,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2000,7 +2284,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2014,7 +2300,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2028,7 +2316,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2042,7 +2332,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2056,7 +2348,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2070,7 +2364,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2084,7 +2380,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2098,7 +2396,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2112,7 +2412,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2126,7 +2428,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2140,7 +2444,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2154,7 +2460,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2168,7 +2476,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2182,7 +2492,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2196,7 +2508,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2210,7 +2524,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2224,7 +2540,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2238,7 +2556,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2252,7 +2572,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2266,7 +2588,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2280,7 +2604,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2294,7 +2620,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2308,7 +2636,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2322,7 +2652,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2336,7 +2668,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2350,7 +2684,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2364,7 +2700,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2378,7 +2716,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2392,7 +2732,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2406,7 +2748,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2420,7 +2764,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2434,7 +2780,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2448,7 +2796,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2462,7 +2812,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2476,7 +2828,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2490,7 +2844,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2504,7 +2860,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2518,7 +2876,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2532,7 +2892,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2546,7 +2908,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2560,7 +2924,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2574,7 +2940,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2588,7 +2956,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2602,7 +2972,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 LEFT OUTER JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2616,7 +2988,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2630,7 +3004,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2644,7 +3020,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2658,7 +3036,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2672,7 +3052,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2686,7 +3068,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 LEFT OUTER JOIN t3 ON t1.c1 = t3.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2700,7 +3084,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2714,7 +3100,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2728,7 +3116,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2742,7 +3132,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2756,7 +3148,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2770,7 +3164,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 LEFT OUTER JOIN t4 ON t1.c1 = t4.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2784,7 +3180,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2798,7 +3196,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2812,7 +3212,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2826,7 +3228,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2840,7 +3244,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2854,7 +3260,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 LEFT OUTER JOIN t5 ON t1.c1 = t5.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2868,7 +3276,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2882,7 +3292,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2896,7 +3308,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2910,7 +3324,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2924,7 +3340,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2938,7 +3356,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 LEFT OUTER JOIN t6 ON t1.c1 = t6.c1 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; diff --git a/mysql-test/suite/engines/funcs/t/se_join_natural_left.test b/mysql-test/suite/engines/funcs/t/se_join_natural_left.test index 2ff6276cfa5..7b9deea3cb6 100644 --- a/mysql-test/suite/engines/funcs/t/se_join_natural_left.test +++ b/mysql-test/suite/engines/funcs/t/se_join_natural_left.test @@ -12,7 +12,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -26,7 +28,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -40,7 +44,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -54,7 +60,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -68,7 +76,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -82,7 +92,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -96,7 +108,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -110,7 +124,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -124,7 +140,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -138,7 +156,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -152,7 +172,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -166,7 +188,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -180,7 +204,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -194,7 +220,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -208,7 +236,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -222,7 +252,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -236,7 +268,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -250,7 +284,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -264,7 +300,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -278,7 +316,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -292,7 +332,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -306,7 +348,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -320,7 +364,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -334,7 +380,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -348,7 +396,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -362,7 +412,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -376,7 +428,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -390,7 +444,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -404,7 +460,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -418,7 +476,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -432,7 +492,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -446,7 +508,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -460,7 +524,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -474,7 +540,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -488,7 +556,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -502,7 +572,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -516,7 +588,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -530,7 +604,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -544,7 +620,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -558,7 +636,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -572,7 +652,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -586,7 +668,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -600,7 +684,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -614,7 +700,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -628,7 +716,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -642,7 +732,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -656,7 +748,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -670,7 +764,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -684,7 +780,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -698,7 +796,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -712,7 +812,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -726,7 +828,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -740,7 +844,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -754,7 +860,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -768,7 +876,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -782,7 +892,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -796,7 +908,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -810,7 +924,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -824,7 +940,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -838,7 +956,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -852,7 +972,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -866,7 +988,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -880,7 +1004,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -894,7 +1020,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -908,7 +1036,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -922,7 +1052,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -936,7 +1068,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -950,7 +1084,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -964,7 +1100,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -978,7 +1116,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -992,7 +1132,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1006,7 +1148,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1020,7 +1164,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1034,7 +1180,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1048,7 +1196,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1062,7 +1212,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1076,7 +1228,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1090,7 +1244,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1104,7 +1260,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1118,7 +1276,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1132,7 +1292,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1146,7 +1308,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1160,7 +1324,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1174,7 +1340,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1188,7 +1356,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1202,7 +1372,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1216,7 +1388,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1230,7 +1404,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1244,7 +1420,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1258,7 +1436,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1272,7 +1452,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1286,7 +1468,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1300,7 +1484,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1314,7 +1500,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1328,7 +1516,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1342,7 +1532,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1356,7 +1548,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1370,7 +1564,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1384,7 +1580,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1398,7 +1596,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1412,7 +1612,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1426,7 +1628,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1440,7 +1644,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1454,7 +1660,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1468,7 +1676,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1482,7 +1692,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1496,7 +1708,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1510,7 +1724,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1524,7 +1740,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1538,7 +1756,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1552,7 +1772,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1566,7 +1788,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1580,7 +1804,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1594,7 +1820,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1608,7 +1836,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1622,7 +1852,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1636,7 +1868,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1650,7 +1884,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1664,7 +1900,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1678,7 +1916,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1692,7 +1932,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1706,7 +1948,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1720,7 +1964,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1734,7 +1980,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1748,7 +1996,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1762,7 +2012,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1776,7 +2028,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1790,7 +2044,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1804,7 +2060,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1818,7 +2076,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1832,7 +2092,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1846,7 +2108,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1860,7 +2124,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1874,7 +2140,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1888,7 +2156,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1902,7 +2172,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1916,7 +2188,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1930,7 +2204,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1944,7 +2220,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1958,7 +2236,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1972,7 +2252,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1986,7 +2268,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2000,7 +2284,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2014,7 +2300,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2028,7 +2316,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2042,7 +2332,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2056,7 +2348,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2070,7 +2364,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2084,7 +2380,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2098,7 +2396,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2112,7 +2412,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2126,7 +2428,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2140,7 +2444,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2154,7 +2460,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2168,7 +2476,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2182,7 +2492,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2196,7 +2508,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2210,7 +2524,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2224,7 +2540,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2238,7 +2556,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2252,7 +2572,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2266,7 +2588,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2280,7 +2604,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2294,7 +2620,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2308,7 +2636,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2322,7 +2652,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2336,7 +2668,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2350,7 +2684,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2364,7 +2700,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2378,7 +2716,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2392,7 +2732,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2406,7 +2748,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2420,7 +2764,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2434,7 +2780,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2448,7 +2796,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2462,7 +2812,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2476,7 +2828,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2490,7 +2844,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2504,7 +2860,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2518,7 +2876,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2532,7 +2892,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2546,7 +2908,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2560,7 +2924,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2574,7 +2940,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2588,7 +2956,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2602,7 +2972,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT JOIN t2 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2616,7 +2988,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2630,7 +3004,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2644,7 +3020,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2658,7 +3036,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2672,7 +3052,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2686,7 +3068,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT JOIN t3 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2700,7 +3084,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2714,7 +3100,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2728,7 +3116,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2742,7 +3132,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2756,7 +3148,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2770,7 +3164,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT JOIN t4 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2784,7 +3180,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2798,7 +3196,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2812,7 +3212,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2826,7 +3228,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2840,7 +3244,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2854,7 +3260,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT JOIN t5 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2868,7 +3276,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2882,7 +3292,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2896,7 +3308,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2910,7 +3324,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2924,7 +3340,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2938,7 +3356,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT JOIN t6 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; diff --git a/mysql-test/suite/engines/funcs/t/se_join_natural_left_outer.test b/mysql-test/suite/engines/funcs/t/se_join_natural_left_outer.test index 93384418d80..d484cbe5216 100644 --- a/mysql-test/suite/engines/funcs/t/se_join_natural_left_outer.test +++ b/mysql-test/suite/engines/funcs/t/se_join_natural_left_outer.test @@ -12,7 +12,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -26,7 +28,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -40,7 +44,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -54,7 +60,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -68,7 +76,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -82,7 +92,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -96,7 +108,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -110,7 +124,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -124,7 +140,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -138,7 +156,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -152,7 +172,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -166,7 +188,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -180,7 +204,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -194,7 +220,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -208,7 +236,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -222,7 +252,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -236,7 +268,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -250,7 +284,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -264,7 +300,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -278,7 +316,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -292,7 +332,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -306,7 +348,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -320,7 +364,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -334,7 +380,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -348,7 +396,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -362,7 +412,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -376,7 +428,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -390,7 +444,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -404,7 +460,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -418,7 +476,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6 WHERE t1.c1 < 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -432,7 +492,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -446,7 +508,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -460,7 +524,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -474,7 +540,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -488,7 +556,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -502,7 +572,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -516,7 +588,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -530,7 +604,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -544,7 +620,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -558,7 +636,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -572,7 +652,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -586,7 +668,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -600,7 +684,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -614,7 +700,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -628,7 +716,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -642,7 +732,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -656,7 +748,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -670,7 +764,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -684,7 +780,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -698,7 +796,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -712,7 +812,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -726,7 +828,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -740,7 +844,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -754,7 +860,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -768,7 +876,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -782,7 +892,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -796,7 +908,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -810,7 +924,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -824,7 +940,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -838,7 +956,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6 WHERE t1.c1 <= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -852,7 +972,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -866,7 +988,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -880,7 +1004,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -894,7 +1020,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -908,7 +1036,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -922,7 +1052,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -936,7 +1068,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -950,7 +1084,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -964,7 +1100,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -978,7 +1116,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -992,7 +1132,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1006,7 +1148,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1020,7 +1164,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1034,7 +1180,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1048,7 +1196,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1062,7 +1212,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1076,7 +1228,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1090,7 +1244,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1104,7 +1260,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1118,7 +1276,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1132,7 +1292,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1146,7 +1308,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1160,7 +1324,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1174,7 +1340,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1188,7 +1356,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1202,7 +1372,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1216,7 +1388,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1230,7 +1404,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1244,7 +1420,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1258,7 +1436,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6 WHERE t1.c1 = 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1272,7 +1452,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1286,7 +1468,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1300,7 +1484,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1314,7 +1500,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1328,7 +1516,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1342,7 +1532,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1356,7 +1548,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1370,7 +1564,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1384,7 +1580,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1398,7 +1596,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1412,7 +1612,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1426,7 +1628,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1440,7 +1644,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1454,7 +1660,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1468,7 +1676,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1482,7 +1692,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1496,7 +1708,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1510,7 +1724,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1524,7 +1740,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1538,7 +1756,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1552,7 +1772,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1566,7 +1788,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1580,7 +1804,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1594,7 +1820,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1608,7 +1836,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1622,7 +1852,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1636,7 +1868,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1650,7 +1884,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1664,7 +1900,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1678,7 +1916,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6 WHERE t1.c1 >= 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1692,7 +1932,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1706,7 +1948,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1720,7 +1964,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1734,7 +1980,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1748,7 +1996,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1762,7 +2012,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1776,7 +2028,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1790,7 +2044,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1804,7 +2060,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1818,7 +2076,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1832,7 +2092,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1846,7 +2108,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1860,7 +2124,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1874,7 +2140,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1888,7 +2156,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1902,7 +2172,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -1916,7 +2188,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -1930,7 +2204,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -1944,7 +2220,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -1958,7 +2236,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -1972,7 +2252,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -1986,7 +2268,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2000,7 +2284,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2014,7 +2300,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2028,7 +2316,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2042,7 +2332,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2056,7 +2348,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2070,7 +2364,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2084,7 +2380,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2098,7 +2396,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6 WHERE t1.c1 != 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2112,7 +2412,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2126,7 +2428,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2140,7 +2444,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2154,7 +2460,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2168,7 +2476,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2182,7 +2492,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2196,7 +2508,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2210,7 +2524,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2224,7 +2540,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2238,7 +2556,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2252,7 +2572,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2266,7 +2588,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2280,7 +2604,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2294,7 +2620,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2308,7 +2636,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2322,7 +2652,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2336,7 +2668,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2350,7 +2684,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2364,7 +2700,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2378,7 +2716,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2392,7 +2732,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2406,7 +2748,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2420,7 +2764,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2434,7 +2780,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2448,7 +2796,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2462,7 +2812,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2476,7 +2828,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2490,7 +2844,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2504,7 +2860,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2518,7 +2876,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6 WHERE t1.c1 <> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2532,7 +2892,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2546,7 +2908,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2560,7 +2924,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2574,7 +2940,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2588,7 +2956,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2602,7 +2972,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2; +--sorted_result SELECT t1.c1,t2.c1 FROM t1 NATURAL LEFT OUTER JOIN t2 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2616,7 +2988,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2630,7 +3004,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2644,7 +3020,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2658,7 +3036,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2672,7 +3052,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2686,7 +3068,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3; +--sorted_result SELECT t1.c1,t3.c1 FROM t1 NATURAL LEFT OUTER JOIN t3 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2700,7 +3084,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2714,7 +3100,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2728,7 +3116,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2742,7 +3132,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2756,7 +3148,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2770,7 +3164,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4; +--sorted_result SELECT t1.c1,t4.c1 FROM t1 NATURAL LEFT OUTER JOIN t4 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2784,7 +3180,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2798,7 +3196,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2812,7 +3212,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2826,7 +3228,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2840,7 +3244,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2854,7 +3260,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5; +--sorted_result SELECT t1.c1,t5.c1 FROM t1 NATURAL LEFT OUTER JOIN t5 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 TINYINT NOT NULL); @@ -2868,7 +3276,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 SMALLINT NOT NULL); @@ -2882,7 +3292,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 MEDIUMINT NOT NULL); @@ -2896,7 +3308,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INT NOT NULL); @@ -2910,7 +3324,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 INTEGER NOT NULL); @@ -2924,7 +3340,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; CREATE TABLE t1 (c1 BIGINT NOT NULL); @@ -2938,7 +3356,9 @@ INSERT INTO t2 (c1) VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9); INSERT INTO t3 (c1) VALUES(1),(3),(5),(7),(9); INSERT INTO t4 (c1) VALUES(10); INSERT INTO t5 (c1) VALUES(10),(11),(12),(13),(14); +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6; +--sorted_result SELECT t1.c1,t6.c1 FROM t1 NATURAL LEFT OUTER JOIN t6 WHERE t1.c1 <=> 5; DROP TABLE t1,t2,t3,t4,t5,t6; diff --git a/mysql-test/suite/engines/iuds/r/delete_time.result b/mysql-test/suite/engines/iuds/r/delete_time.result index 619b31bf4ce..00b2262e07b 100644 --- a/mysql-test/suite/engines/iuds/r/delete_time.result +++ b/mysql-test/suite/engines/iuds/r/delete_time.result @@ -497,10 +497,10 @@ c2 00:13:13 00:51:51 01:01:01 -02:02:02 03:03:00 08:08:08 100:04:04 +11:11:11 11:11:27 125:00:00 125:05:00 @@ -644,7 +644,7 @@ c1 c2 -838:59:59 -838:59:59 00:04:00 00:04:00 00:54:54 00:54:54 -11:11:11 11:11:11 +02:02:02 02:02:02 12:34:56 NULL SELECT * FROM t2; c1 c2 diff --git a/mysql-test/suite/engines/iuds/r/delete_year.result b/mysql-test/suite/engines/iuds/r/delete_year.result index 02cbe24ecc9..c82f0dae7d9 100644 --- a/mysql-test/suite/engines/iuds/r/delete_year.result +++ b/mysql-test/suite/engines/iuds/r/delete_year.result @@ -2,7 +2,13 @@ DROP TABLE IF EXISTS t1,t2,t3,t4; CREATE TABLE t1(c1 YEAR NOT NULL,c2 YEAR, PRIMARY KEY(c1)); CREATE TABLE t2(c1 YEAR NOT NULL, c2 YEAR, UNIQUE INDEX idx(c1,c2)); CREATE TABLE t3(c1 YEAR(2) NOT NULL,c2 YEAR(2), PRIMARY KEY(c1)); +Warnings: +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead CREATE TABLE t4(c1 YEAR(2), c2 YEAR(2), UNIQUE INDEX idx(c1,c2)); +Warnings: +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead INSERT INTO t1 VALUES (1901,1901),(1970,1970),(1999,1999),(2000,2000),(2155,2155); INSERT INTO t2 VALUES (1901,1901),(1970,1970),(1999,1999),(2000,2000),(2155,2155); INSERT INTO t3 VALUES (1901,1901),(1970,1970),(1999,1999),(2000,2000),(2155,2155); diff --git a/mysql-test/suite/engines/iuds/r/insert_decimal.result b/mysql-test/suite/engines/iuds/r/insert_decimal.result index 6aa7f5aab01..50fde80d81d 100644 --- a/mysql-test/suite/engines/iuds/r/insert_decimal.result +++ b/mysql-test/suite/engines/iuds/r/insert_decimal.result @@ -1013,7 +1013,7 @@ ROUND(c1,c2) TRUNCATE(c1,c2) 1.133000 1.132000 DROP TABLE t5; CREATE TABLE t7(c1 DECIMAL(66,0)); -ERROR 42000: Too big precision 66 specified for column 'c1'. Maximum is 65. +ERROR 42000: Too big precision 66 specified for 'c1'. Maximum is 65. CREATE TABLE t7(c1 DECIMAL(5,10)); ERROR 42000: For float(M,D), double(M,D) or decimal(M,D), M must be >= D (column 'c1'). DROP TABLE t1,t2; diff --git a/mysql-test/suite/engines/iuds/r/insert_number.result b/mysql-test/suite/engines/iuds/r/insert_number.result index fed2e0f683b..ce6a2af6d5f 100644 --- a/mysql-test/suite/engines/iuds/r/insert_number.result +++ b/mysql-test/suite/engines/iuds/r/insert_number.result @@ -5316,12 +5316,20 @@ c1 c2 c3 c4 c5 c6 c7 0 -128 26 27 28 29 30 SELECT * FROM t3 WHERE c2 = 128 ORDER BY c2,c7; c1 c2 c3 c4 c5 c6 c7 +Warnings: +Warning 1264 Out of range value for column 'c2' at row 1 SELECT * FROM t3 WHERE c2 = 128 ORDER BY c2,c7 LIMIT 2; c1 c2 c3 c4 c5 c6 c7 +Warnings: +Warning 1264 Out of range value for column 'c2' at row 1 SELECT * FROM t3 WHERE c2 = 128 ORDER BY c2,c7 DESC; c1 c2 c3 c4 c5 c6 c7 +Warnings: +Warning 1264 Out of range value for column 'c2' at row 1 SELECT * FROM t3 WHERE c2 = 128 ORDER BY c2,c7 DESC LIMIT 2; c1 c2 c3 c4 c5 c6 c7 +Warnings: +Warning 1264 Out of range value for column 'c2' at row 1 SELECT * FROM t3 WHERE c2 <> 128 ORDER BY c2,c7; c1 c2 c3 c4 c5 c6 c7 0 -128 1 2 3 4 5 @@ -11010,12 +11018,20 @@ c1 c2 c3 c4 c5 c6 c7 0 -32768 26 27 28 29 30 SELECT * FROM t3 WHERE c2 = 32768 ORDER BY c2,c7; c1 c2 c3 c4 c5 c6 c7 +Warnings: +Warning 1264 Out of range value for column 'c2' at row 1 SELECT * FROM t3 WHERE c2 = 32768 ORDER BY c2,c7 LIMIT 2; c1 c2 c3 c4 c5 c6 c7 +Warnings: +Warning 1264 Out of range value for column 'c2' at row 1 SELECT * FROM t3 WHERE c2 = 32768 ORDER BY c2,c7 DESC; c1 c2 c3 c4 c5 c6 c7 +Warnings: +Warning 1264 Out of range value for column 'c2' at row 1 SELECT * FROM t3 WHERE c2 = 32768 ORDER BY c2,c7 DESC LIMIT 2; c1 c2 c3 c4 c5 c6 c7 +Warnings: +Warning 1264 Out of range value for column 'c2' at row 1 SELECT * FROM t3 WHERE c2 <> 32768 ORDER BY c2,c7; c1 c2 c3 c4 c5 c6 c7 0 -32768 1 2 3 4 5 @@ -16809,12 +16825,20 @@ c1 c2 c3 c4 c5 c6 c7 0 -8388608 26 27 28 29 30 SELECT * FROM t3 WHERE c2 = 8388608 ORDER BY c2,c7; c1 c2 c3 c4 c5 c6 c7 +Warnings: +Warning 1264 Out of range value for column 'c2' at row 1 SELECT * FROM t3 WHERE c2 = 8388608 ORDER BY c2,c7 LIMIT 2; c1 c2 c3 c4 c5 c6 c7 +Warnings: +Warning 1264 Out of range value for column 'c2' at row 1 SELECT * FROM t3 WHERE c2 = 8388608 ORDER BY c2,c7 DESC; c1 c2 c3 c4 c5 c6 c7 +Warnings: +Warning 1264 Out of range value for column 'c2' at row 1 SELECT * FROM t3 WHERE c2 = 8388608 ORDER BY c2,c7 DESC LIMIT 2; c1 c2 c3 c4 c5 c6 c7 +Warnings: +Warning 1264 Out of range value for column 'c2' at row 1 SELECT * FROM t3 WHERE c2 <> 8388608 ORDER BY c2,c7; c1 c2 c3 c4 c5 c6 c7 0 -8388608 1 2 3 4 5 @@ -22713,12 +22737,20 @@ c1 c2 c3 c4 c5 c6 c7 0 -2147483648 26 27 28 29 30 SELECT * FROM t3 WHERE c2 = 2147483648 ORDER BY c2,c7; c1 c2 c3 c4 c5 c6 c7 +Warnings: +Warning 1264 Out of range value for column 'c2' at row 1 SELECT * FROM t3 WHERE c2 = 2147483648 ORDER BY c2,c7 LIMIT 2; c1 c2 c3 c4 c5 c6 c7 +Warnings: +Warning 1264 Out of range value for column 'c2' at row 1 SELECT * FROM t3 WHERE c2 = 2147483648 ORDER BY c2,c7 DESC; c1 c2 c3 c4 c5 c6 c7 +Warnings: +Warning 1264 Out of range value for column 'c2' at row 1 SELECT * FROM t3 WHERE c2 = 2147483648 ORDER BY c2,c7 DESC LIMIT 2; c1 c2 c3 c4 c5 c6 c7 +Warnings: +Warning 1264 Out of range value for column 'c2' at row 1 SELECT * FROM t3 WHERE c2 <> 2147483648 ORDER BY c2,c7; c1 c2 c3 c4 c5 c6 c7 0 -2147483648 1 2 3 4 5 @@ -28627,12 +28659,20 @@ c1 c2 c3 c4 c5 c6 c7 0 -2147483648 26 27 28 29 30 SELECT * FROM t3 WHERE c2 = 2147483648 ORDER BY c2,c7; c1 c2 c3 c4 c5 c6 c7 +Warnings: +Warning 1264 Out of range value for column 'c2' at row 1 SELECT * FROM t3 WHERE c2 = 2147483648 ORDER BY c2,c7 LIMIT 2; c1 c2 c3 c4 c5 c6 c7 +Warnings: +Warning 1264 Out of range value for column 'c2' at row 1 SELECT * FROM t3 WHERE c2 = 2147483648 ORDER BY c2,c7 DESC; c1 c2 c3 c4 c5 c6 c7 +Warnings: +Warning 1264 Out of range value for column 'c2' at row 1 SELECT * FROM t3 WHERE c2 = 2147483648 ORDER BY c2,c7 DESC LIMIT 2; c1 c2 c3 c4 c5 c6 c7 +Warnings: +Warning 1264 Out of range value for column 'c2' at row 1 SELECT * FROM t3 WHERE c2 <> 2147483648 ORDER BY c2,c7; c1 c2 c3 c4 c5 c6 c7 0 -2147483648 1 2 3 4 5 @@ -32275,8 +32315,6 @@ total_rows min_value max(c1) 23 0 18446744073709551615 SELECT * FROM t2 WHERE c2 = -9223372036854775809; c1 c2 c3 c4 c5 c6 c7 -Warning 1292 Truncated incorrect DECIMAL value: '' -Warnings: SELECT c1,c6 FROM t2; c1 c6 0 0 @@ -34112,20 +34150,12 @@ c1 c2 c3 c4 c5 c6 c7 0 -9223372036854775808 31 32 33 34 35 SELECT * FROM t3 WHERE c2 = -9223372036854775809 ORDER BY c2,c7; c1 c2 c3 c4 c5 c6 c7 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 = -9223372036854775809 ORDER BY c2,c7 LIMIT 2; c1 c2 c3 c4 c5 c6 c7 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 = -9223372036854775809 ORDER BY c2,c7 DESC; c1 c2 c3 c4 c5 c6 c7 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 = -9223372036854775809 ORDER BY c2,c7 DESC LIMIT 2; c1 c2 c3 c4 c5 c6 c7 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 <> -9223372036854775809 ORDER BY c2,c7; c1 c2 c3 c4 c5 c6 c7 0 -9223372036854775808 1 2 3 4 5 @@ -34149,14 +34179,10 @@ c1 c2 c3 c4 c5 c6 c7 0 124 27 28 29 30 31 18446744073709551615 9223372036854775807 26 27 28 29 30 18446744073709551615 9223372036854775807 36 37 38 39 40 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 <> -9223372036854775809 ORDER BY c2,c7 LIMIT 2; c1 c2 c3 c4 c5 c6 c7 0 -9223372036854775808 1 2 3 4 5 0 -9223372036854775808 31 32 33 34 35 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 > -9223372036854775809 ORDER BY c2,c7; c1 c2 c3 c4 c5 c6 c7 0 -9223372036854775808 1 2 3 4 5 @@ -34180,14 +34206,10 @@ c1 c2 c3 c4 c5 c6 c7 0 124 27 28 29 30 31 18446744073709551615 9223372036854775807 26 27 28 29 30 18446744073709551615 9223372036854775807 36 37 38 39 40 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 > -9223372036854775809 ORDER BY c2,c7 LIMIT 2; c1 c2 c3 c4 c5 c6 c7 0 -9223372036854775808 1 2 3 4 5 0 -9223372036854775808 31 32 33 34 35 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 >= -9223372036854775809 ORDER BY c2,c7; c1 c2 c3 c4 c5 c6 c7 0 -9223372036854775808 1 2 3 4 5 @@ -34211,38 +34233,22 @@ c1 c2 c3 c4 c5 c6 c7 0 124 27 28 29 30 31 18446744073709551615 9223372036854775807 26 27 28 29 30 18446744073709551615 9223372036854775807 36 37 38 39 40 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 >= -9223372036854775809 ORDER BY c2,c7 LIMIT 2; c1 c2 c3 c4 c5 c6 c7 0 -9223372036854775808 1 2 3 4 5 0 -9223372036854775808 31 32 33 34 35 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 < -9223372036854775809 ORDER BY c2,c7; c1 c2 c3 c4 c5 c6 c7 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 < -9223372036854775809 ORDER BY c2,c7 LIMIT 2; c1 c2 c3 c4 c5 c6 c7 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 <= -9223372036854775809 ORDER BY c2,c7; c1 c2 c3 c4 c5 c6 c7 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 <= -9223372036854775809 ORDER BY c2,c7 LIMIT 2; c1 c2 c3 c4 c5 c6 c7 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 <=> -9223372036854775809 ORDER BY c2,c7; c1 c2 c3 c4 c5 c6 c7 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 <=> -9223372036854775809 ORDER BY c2,c7 LIMIT 2; c1 c2 c3 c4 c5 c6 c7 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 BETWEEN -9223372036854775809 AND 9223372036854775808 ORDER BY c2,c7; c1 c2 c3 c4 c5 c6 c7 0 -9223372036854775808 1 2 3 4 5 @@ -34266,14 +34272,10 @@ c1 c2 c3 c4 c5 c6 c7 0 124 27 28 29 30 31 18446744073709551615 9223372036854775807 26 27 28 29 30 18446744073709551615 9223372036854775807 36 37 38 39 40 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 BETWEEN -9223372036854775809 AND 9223372036854775808 ORDER BY c2,c7 LIMIT 2; c1 c2 c3 c4 c5 c6 c7 0 -9223372036854775808 1 2 3 4 5 0 -9223372036854775808 31 32 33 34 35 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 IN (-9223372036854775809,9223372036854775808) ORDER BY c2,c7; c1 c2 c3 c4 c5 c6 c7 0 -9223372036854775808 1 2 3 4 5 @@ -34285,13 +34287,9 @@ c1 c2 c3 c4 c5 c6 c7 SELECT * FROM t3 WHERE c2 >= -9223372036854775809 AND c2 < 9223372036854775808 AND c7 = 35 ORDER BY c2,c7; c1 c2 c3 c4 c5 c6 c7 0 -9223372036854775808 31 32 33 34 35 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 >= -9223372036854775809 AND c2 < 9223372036854775808 AND c7 = 35 ORDER BY c2,c7 LIMIT 2; c1 c2 c3 c4 c5 c6 c7 0 -9223372036854775808 31 32 33 34 35 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 IS NULL ORDER BY c2,c7; c1 c2 c3 c4 c5 c6 c7 105 NULL 102 103 104 105 106 @@ -34348,14 +34346,10 @@ c1 c2 c3 c4 c5 c6 c7 0 124 22 23 24 25 26 18446744073709551615 9223372036854775807 36 37 38 39 40 18446744073709551615 9223372036854775807 26 27 28 29 30 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 <> -9223372036854775809 ORDER BY c2,c7 DESC LIMIT 2; c1 c2 c3 c4 c5 c6 c7 0 -9223372036854775808 31 32 33 34 35 0 -9223372036854775808 1 2 3 4 5 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 > -9223372036854775809 ORDER BY c2,c7 DESC; c1 c2 c3 c4 c5 c6 c7 0 -9223372036854775808 31 32 33 34 35 @@ -34379,14 +34373,10 @@ c1 c2 c3 c4 c5 c6 c7 0 124 22 23 24 25 26 18446744073709551615 9223372036854775807 36 37 38 39 40 18446744073709551615 9223372036854775807 26 27 28 29 30 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 > -9223372036854775809 ORDER BY c2,c7 DESC LIMIT 2; c1 c2 c3 c4 c5 c6 c7 0 -9223372036854775808 31 32 33 34 35 0 -9223372036854775808 1 2 3 4 5 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 >= -9223372036854775809 ORDER BY c2,c7 DESC; c1 c2 c3 c4 c5 c6 c7 0 -9223372036854775808 31 32 33 34 35 @@ -34410,38 +34400,22 @@ c1 c2 c3 c4 c5 c6 c7 0 124 22 23 24 25 26 18446744073709551615 9223372036854775807 36 37 38 39 40 18446744073709551615 9223372036854775807 26 27 28 29 30 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 >= -9223372036854775809 ORDER BY c2,c7 DESC LIMIT 2; c1 c2 c3 c4 c5 c6 c7 0 -9223372036854775808 31 32 33 34 35 0 -9223372036854775808 1 2 3 4 5 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 < -9223372036854775809 ORDER BY c2,c7 DESC; c1 c2 c3 c4 c5 c6 c7 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 < -9223372036854775809 ORDER BY c2,c7 DESC LIMIT 2; c1 c2 c3 c4 c5 c6 c7 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 <= -9223372036854775809 ORDER BY c2,c7 DESC; c1 c2 c3 c4 c5 c6 c7 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 <= -9223372036854775809 ORDER BY c2,c7 DESC LIMIT 2; c1 c2 c3 c4 c5 c6 c7 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 <=> -9223372036854775809 ORDER BY c2,c7 DESC; c1 c2 c3 c4 c5 c6 c7 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 <=> -9223372036854775809 ORDER BY c2,c7 DESC LIMIT 2; c1 c2 c3 c4 c5 c6 c7 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 BETWEEN -9223372036854775809 AND 9223372036854775808 ORDER BY c2,c7 DESC; c1 c2 c3 c4 c5 c6 c7 0 -9223372036854775808 31 32 33 34 35 @@ -34465,14 +34439,10 @@ c1 c2 c3 c4 c5 c6 c7 0 124 22 23 24 25 26 18446744073709551615 9223372036854775807 36 37 38 39 40 18446744073709551615 9223372036854775807 26 27 28 29 30 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 BETWEEN -9223372036854775809 AND 9223372036854775808 ORDER BY c2,c7 DESC LIMIT 2; c1 c2 c3 c4 c5 c6 c7 0 -9223372036854775808 31 32 33 34 35 0 -9223372036854775808 1 2 3 4 5 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 IN (-9223372036854775809,9223372036854775808) ORDER BY c2,c7 DESC; c1 c2 c3 c4 c5 c6 c7 0 -9223372036854775808 31 32 33 34 35 @@ -34484,13 +34454,9 @@ c1 c2 c3 c4 c5 c6 c7 SELECT * FROM t3 WHERE c2 >= -9223372036854775809 AND c2 < 9223372036854775808 AND c7 = 35 ORDER BY c2,c7 DESC; c1 c2 c3 c4 c5 c6 c7 0 -9223372036854775808 31 32 33 34 35 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 >= -9223372036854775809 AND c2 < 9223372036854775808 AND c7 = 35 ORDER BY c2,c7 DESC LIMIT 2; c1 c2 c3 c4 c5 c6 c7 0 -9223372036854775808 31 32 33 34 35 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 IS NULL ORDER BY c2,c7 DESC; c1 c2 c3 c4 c5 c6 c7 105 NULL 102 103 104 105 106 @@ -34611,12 +34577,20 @@ c1 c2 c3 c4 c5 c6 c7 0 -9223372036854775808 31 32 33 34 35 SELECT * FROM t3 WHERE c2 = 9223372036854775808 ORDER BY c2,c7; c1 c2 c3 c4 c5 c6 c7 +Warnings: +Warning 1264 Out of range value for column 'c2' at row 1 SELECT * FROM t3 WHERE c2 = 9223372036854775808 ORDER BY c2,c7 LIMIT 2; c1 c2 c3 c4 c5 c6 c7 +Warnings: +Warning 1264 Out of range value for column 'c2' at row 1 SELECT * FROM t3 WHERE c2 = 9223372036854775808 ORDER BY c2,c7 DESC; c1 c2 c3 c4 c5 c6 c7 +Warnings: +Warning 1264 Out of range value for column 'c2' at row 1 SELECT * FROM t3 WHERE c2 = 9223372036854775808 ORDER BY c2,c7 DESC LIMIT 2; c1 c2 c3 c4 c5 c6 c7 +Warnings: +Warning 1264 Out of range value for column 'c2' at row 1 SELECT * FROM t3 WHERE c2 <> 9223372036854775808 ORDER BY c2,c7; c1 c2 c3 c4 c5 c6 c7 0 -9223372036854775808 1 2 3 4 5 @@ -34733,14 +34707,10 @@ c1 c2 c3 c4 c5 c6 c7 0 124 27 28 29 30 31 18446744073709551615 9223372036854775807 26 27 28 29 30 18446744073709551615 9223372036854775807 36 37 38 39 40 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 BETWEEN -9223372036854775809 AND 9223372036854775808 ORDER BY c2,c7 LIMIT 2; c1 c2 c3 c4 c5 c6 c7 0 -9223372036854775808 1 2 3 4 5 0 -9223372036854775808 31 32 33 34 35 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 IN (-9223372036854775809,9223372036854775808) ORDER BY c2,c7; c1 c2 c3 c4 c5 c6 c7 0 -9223372036854775808 1 2 3 4 5 @@ -34752,13 +34722,9 @@ c1 c2 c3 c4 c5 c6 c7 SELECT * FROM t3 WHERE c2 >= -9223372036854775809 AND c2 < 9223372036854775808 AND c7 = 35 ORDER BY c2,c7; c1 c2 c3 c4 c5 c6 c7 0 -9223372036854775808 31 32 33 34 35 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 >= -9223372036854775809 AND c2 < 9223372036854775808 AND c7 = 35 ORDER BY c2,c7 LIMIT 2; c1 c2 c3 c4 c5 c6 c7 0 -9223372036854775808 31 32 33 34 35 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 IS NULL ORDER BY c2,c7; c1 c2 c3 c4 c5 c6 c7 105 NULL 102 103 104 105 106 @@ -34908,14 +34874,10 @@ c1 c2 c3 c4 c5 c6 c7 0 124 22 23 24 25 26 18446744073709551615 9223372036854775807 36 37 38 39 40 18446744073709551615 9223372036854775807 26 27 28 29 30 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 BETWEEN -9223372036854775809 AND 9223372036854775808 ORDER BY c2,c7 DESC LIMIT 2; c1 c2 c3 c4 c5 c6 c7 0 -9223372036854775808 31 32 33 34 35 0 -9223372036854775808 1 2 3 4 5 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 IN (-9223372036854775809,9223372036854775808) ORDER BY c2,c7 DESC; c1 c2 c3 c4 c5 c6 c7 0 -9223372036854775808 31 32 33 34 35 @@ -34927,13 +34889,9 @@ c1 c2 c3 c4 c5 c6 c7 SELECT * FROM t3 WHERE c2 >= -9223372036854775809 AND c2 < 9223372036854775808 AND c7 = 35 ORDER BY c2,c7 DESC; c1 c2 c3 c4 c5 c6 c7 0 -9223372036854775808 31 32 33 34 35 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 >= -9223372036854775809 AND c2 < 9223372036854775808 AND c7 = 35 ORDER BY c2,c7 DESC LIMIT 2; c1 c2 c3 c4 c5 c6 c7 0 -9223372036854775808 31 32 33 34 35 -Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' SELECT * FROM t3 WHERE c2 IS NULL ORDER BY c2,c7 DESC; c1 c2 c3 c4 c5 c6 c7 105 NULL 102 103 104 105 106 diff --git a/mysql-test/suite/engines/iuds/r/insert_time.result b/mysql-test/suite/engines/iuds/r/insert_time.result index bb7ad5d7c0b..39bbb0f179d 100644 --- a/mysql-test/suite/engines/iuds/r/insert_time.result +++ b/mysql-test/suite/engines/iuds/r/insert_time.result @@ -40,12 +40,12 @@ INSERT INTO t4 VALUES('10.22.22','10.22.22','2009-01-26'),(1234567,1234567,'2009 Warnings: Warning 1265 Data truncated for column 'c1' at row 1 Warning 1265 Data truncated for column 'c2' at row 1 -Warning 1264 Out of range value for column 'c1' at row 2 -Warning 1264 Out of range value for column 'c2' at row 2 -Warning 1264 Out of range value for column 'c1' at row 3 -Warning 1264 Out of range value for column 'c2' at row 3 -Warning 1264 Out of range value for column 'c1' at row 4 -Warning 1264 Out of range value for column 'c2' at row 4 +Warning 1265 Data truncated for column 'c1' at row 2 +Warning 1265 Data truncated for column 'c2' at row 2 +Warning 1265 Data truncated for column 'c1' at row 3 +Warning 1265 Data truncated for column 'c2' at row 3 +Warning 1265 Data truncated for column 'c1' at row 4 +Warning 1265 Data truncated for column 'c2' at row 4 Warning 1265 Data truncated for column 'c1' at row 6 Warning 1265 Data truncated for column 'c2' at row 6 INSERT INTO t1 VALUES('8:29:45',NULL,'2009-02-01'); @@ -135,6 +135,8 @@ c1 c2 c3 -838:59:59 -838:59:59 2009-01-08 00:00:00 00:00:00 2009-01-09 00:00:00 00:00:00 2009-01-27 +00:00:00 00:00:00 2009-01-28 +00:00:00 00:00:00 2009-01-29 00:00:10 00:00:10 2009-01-26 00:00:11 00:00:11 2009-01-20 00:00:12 00:00:12 2009-01-13 @@ -160,8 +162,6 @@ c1 c2 c3 491:22:33 491:22:33 2009-01-04 825:23:00 825:23:00 2009-01-05 838:59:59 838:59:59 2009-01-10 -838:59:59 838:59:59 2009-01-28 -838:59:59 838:59:59 2009-01-29 SELECT * FROM t1; c1 c2 c3 -838:59:59 -838:59:59 2009-01-21 @@ -1650,8 +1650,10 @@ SELECT * FROM t1 WHERE c2 BETWEEN NULL AND '10:22:33' ORDER BY c2 LIMIT 2; c1 c2 c3 SELECT * FROM t1 WHERE c2 IN (NULL,'10:22:33') ORDER BY c2; c1 c2 c3 +10:22:33 10:22:33 2009-01-02 SELECT * FROM t1 WHERE c2 IN (NULL,'10:22:33') ORDER BY c2 LIMIT 2; c1 c2 c3 +10:22:33 10:22:33 2009-01-02 SELECT * FROM t1 WHERE c2 >= NULL AND c2 < '10:22:33' AND c1 = '491:22:33' ORDER BY c2; c1 c2 c3 SELECT * FROM t1 WHERE c2 >= NULL AND c2 < '10:22:33' AND c1 = '491:22:33' ORDER BY c2 LIMIT 2; @@ -1723,8 +1725,10 @@ SELECT * FROM t1 WHERE c2 BETWEEN NULL AND '10:22:33' ORDER BY c2 DESC LIMIT 2; c1 c2 c3 SELECT * FROM t1 WHERE c2 IN (NULL,'10:22:33') ORDER BY c2 DESC; c1 c2 c3 +10:22:33 10:22:33 2009-01-02 SELECT * FROM t1 WHERE c2 IN (NULL,'10:22:33') ORDER BY c2 DESC LIMIT 2; c1 c2 c3 +10:22:33 10:22:33 2009-01-02 SELECT * FROM t1 WHERE c2 >= NULL AND c2 < '10:22:33' AND c1 = '491:22:33' ORDER BY c2 DESC; c1 c2 c3 SELECT * FROM t1 WHERE c2 >= NULL AND c2 < '10:22:33' AND c1 = '491:22:33' ORDER BY c2 DESC LIMIT 2; @@ -3218,8 +3222,10 @@ SELECT * FROM t2 WHERE c2 BETWEEN NULL AND '10:22:33' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 SELECT * FROM t2 WHERE c2 IN (NULL,'10:22:33') ORDER BY c1,c2; c1 c2 c3 +10:22:33 10:22:33 2009-01-02 SELECT * FROM t2 WHERE c2 IN (NULL,'10:22:33') ORDER BY c1,c2 LIMIT 2; c1 c2 c3 +10:22:33 10:22:33 2009-01-02 SELECT * FROM t2 WHERE c2 >= NULL AND c2 < '10:22:33' AND c1 = '491:22:33' ORDER BY c1,c2; c1 c2 c3 SELECT * FROM t2 WHERE c2 >= NULL AND c2 < '10:22:33' AND c1 = '491:22:33' ORDER BY c1,c2 LIMIT 2; @@ -3287,8 +3293,10 @@ SELECT * FROM t2 WHERE c2 BETWEEN NULL AND '10:22:33' ORDER BY c1,c2 DESC LIMIT c1 c2 c3 SELECT * FROM t2 WHERE c2 IN (NULL,'10:22:33') ORDER BY c1,c2 DESC; c1 c2 c3 +10:22:33 10:22:33 2009-01-02 SELECT * FROM t2 WHERE c2 IN (NULL,'10:22:33') ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 +10:22:33 10:22:33 2009-01-02 SELECT * FROM t2 WHERE c2 >= NULL AND c2 < '10:22:33' AND c1 = '491:22:33' ORDER BY c1,c2 DESC; c1 c2 c3 SELECT * FROM t2 WHERE c2 >= NULL AND c2 < '10:22:33' AND c1 = '491:22:33' ORDER BY c1,c2 DESC LIMIT 2; @@ -4814,8 +4822,10 @@ SELECT * FROM t3 WHERE c2 BETWEEN NULL AND '10:22:33' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 SELECT * FROM t3 WHERE c2 IN (NULL,'10:22:33') ORDER BY c1,c2; c1 c2 c3 +10:22:33 10:22:33 2009-01-02 SELECT * FROM t3 WHERE c2 IN (NULL,'10:22:33') ORDER BY c1,c2 LIMIT 2; c1 c2 c3 +10:22:33 10:22:33 2009-01-02 SELECT * FROM t3 WHERE c2 >= NULL AND c2 < '10:22:33' AND c1 = '491:22:33' ORDER BY c1,c2; c1 c2 c3 SELECT * FROM t3 WHERE c2 >= NULL AND c2 < '10:22:33' AND c1 = '491:22:33' ORDER BY c1,c2 LIMIT 2; @@ -4887,8 +4897,10 @@ SELECT * FROM t3 WHERE c2 BETWEEN NULL AND '10:22:33' ORDER BY c1,c2 DESC LIMIT c1 c2 c3 SELECT * FROM t3 WHERE c2 IN (NULL,'10:22:33') ORDER BY c1,c2 DESC; c1 c2 c3 +10:22:33 10:22:33 2009-01-02 SELECT * FROM t3 WHERE c2 IN (NULL,'10:22:33') ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 +10:22:33 10:22:33 2009-01-02 SELECT * FROM t3 WHERE c2 >= NULL AND c2 < '10:22:33' AND c1 = '491:22:33' ORDER BY c1,c2 DESC; c1 c2 c3 SELECT * FROM t3 WHERE c2 >= NULL AND c2 < '10:22:33' AND c1 = '491:22:33' ORDER BY c1,c2 DESC LIMIT 2; @@ -5008,28 +5020,24 @@ c1 MIN(c2) 838:59:59 838:59:59 SELECT CAST(235959.123456 AS TIME); CAST(235959.123456 AS TIME) -23:59:59.123456 +23:59:59 SELECT CAST(0.235959123456e+6 AS TIME); CAST(0.235959123456e+6 AS TIME) -23:59:59.123456 +23:59:59 SELECT CAST(235959123456e-6 AS TIME); CAST(235959123456e-6 AS TIME) -23:59:59.123456 +23:59:59 SELECT CAST(235959.1234567 AS TIME); CAST(235959.1234567 AS TIME) -23:59:59.123456 -Warnings: -Warning 1292 Truncated incorrect time value: '235959.1234567' +23:59:59 SELECT CAST(0.2359591234567e6 AS TIME); CAST(0.2359591234567e6 AS TIME) -23:59:59.123456 -Warnings: -Warning 1292 Truncated incorrect time value: '235959.1234567' +23:59:59 SELECT CAST(0.2359591234567e+30 AS TIME); CAST(0.2359591234567e+30 AS TIME) NULL Warnings: -Warning 1292 Truncated incorrect time value: '2.359591234567e29' +Warning 1292 Incorrect datetime value: '2.359591234567e29' select cast('100:55:50' as time) < cast('24:00:00' as time); cast('100:55:50' as time) < cast('24:00:00' as time) 0 @@ -5077,7 +5085,6 @@ c1 c2 c3 INSERT INTO t2(c1,c2) VALUES('12:34:56.78','12:34:56.78') ON DUPLICATE KEY UPDATE c1='12:34:56.79',c2='12:34:57.78'; SELECT * FROM t2 WHERE c1='12:34:56.79' AND c2='12:34:57.78' /* 1 row */; c1 c2 c3 -12:34:56 12:34:57 2009-01-01 SELECT * FROM t1 WHERE c1='10:22:35' AND c2='33 9:23' /* no rows */; c1 c2 c3 INSERT INTO t1(c1,c2) VALUES('10:22:34','34 9:23') ON DUPLICATE KEY UPDATE c1='10:22:35',c2='33 9:23'; @@ -5137,8 +5144,8 @@ c1 c2 c3 09:36:00 09:36:00 2009-01-25 00:00:10 00:00:10 2009-01-26 00:00:00 00:00:00 2009-01-27 -838:59:59 838:59:59 2009-01-28 -838:59:59 838:59:59 2009-01-29 +00:00:00 00:00:00 2009-01-28 +00:00:00 00:00:00 2009-01-29 262:22:00 262:22:00 2009-01-30 00:00:12 00:00:12 2009-01-31 08:29:45 NULL 2009-02-01 @@ -5146,15 +5153,39 @@ c1 c2 c3 TRUNCATE TABLE t5; INSERT INTO t5 SELECT * FROM t4 WHERE c1 >='12colon34colon56'; Warnings: -Warning 1292 Incorrect time value: '12colon34colon56' for column 'c1' at row 1 +Warning 1292 Truncated incorrect time value: '12colon34colon56' SELECT * FROM t5; c1 c2 c3 +12:34:56 12:34:56 2009-01-01 +10:22:33 10:22:33 2009-01-02 +01:23:00 01:23:00 2009-01-03 491:22:33 491:22:33 2009-01-04 825:23:00 825:23:00 2009-01-05 +10:00:00 10:00:00 2009-01-06 +00:00:45 00:00:45 2009-01-07 +00:00:00 00:00:00 2009-01-09 838:59:59 838:59:59 2009-01-10 -838:59:59 838:59:59 2009-01-28 -838:59:59 838:59:59 2009-01-29 +10:11:12 10:11:12 2009-01-11 +11:11:12 11:11:12 2009-01-12 +00:00:12 00:00:12 2009-01-13 +00:12:34 00:12:34 2009-01-14 +12:34:58 12:34:58 2009-01-15 +12:35:56 12:35:56 2009-01-16 +11:11:27 11:11:27 2009-01-17 +08:03:02 08:03:02 2009-01-18 +00:11:12 00:11:12 2009-01-19 +00:00:11 00:00:11 2009-01-20 +00:12:30 00:12:30 2009-01-23 +09:00:45 09:00:45 2009-01-24 +09:36:00 09:36:00 2009-01-25 +00:00:10 00:00:10 2009-01-26 +00:00:00 00:00:00 2009-01-27 +00:00:00 00:00:00 2009-01-28 +00:00:00 00:00:00 2009-01-29 262:22:00 262:22:00 2009-01-30 +00:00:12 00:00:12 2009-01-31 +08:29:45 NULL 2009-02-01 +00:00:00 07:23:55 NULL TRUNCATE TABLE t5; DROP TABLE t5; DROP TABLE t1,t2,t3,t4; diff --git a/mysql-test/suite/engines/iuds/r/insert_year.result b/mysql-test/suite/engines/iuds/r/insert_year.result index 386c8090434..b9618ba4e2d 100644 --- a/mysql-test/suite/engines/iuds/r/insert_year.result +++ b/mysql-test/suite/engines/iuds/r/insert_year.result @@ -3235,9 +3235,21 @@ c1 c2 c3 c4 1999 1999 1998-12-30 1998-12-30 11:30:45 DROP TABLE t1,t2,t3,t4; CREATE TABLE t1(c1 YEAR(2) NOT NULL, c2 YEAR(2) NULL, c3 DATE, c4 DATETIME, PRIMARY KEY(c1), UNIQUE INDEX(c2)); +Warnings: +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead CREATE TABLE t2(c1 YEAR(2) NOT NULL, c2 YEAR(2) NULL, c3 DATE, c4 DATETIME, PRIMARY KEY(c1,c2)); +Warnings: +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead CREATE TABLE t3(c1 YEAR(2) NOT NULL, c2 YEAR(2) NULL, c3 DATE, c4 DATETIME, UNIQUE INDEX idx(c1,c2)); +Warnings: +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead CREATE TABLE t4(c1 YEAR(2) NOT NULL, c2 YEAR(2) NULL, c3 DATE, c4 DATETIME); +Warnings: +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead INSERT INTO t1 VALUES('1901','1901','98-12-31','98.12.31 11:30:45'),('1999','1999','98-12-30','98.12.30 11:30:45'),('2000','2000','98-12-29','98.12.29 11:30:45'),('2001','2001','98-12-28','98.12.28 11:30:45'),('2099','2099','98-12-27','98.12.27 11:30:45'),('2100','2100','98-12-26','98.12.26 11:30:45'),('2155','2155','98-12-26','98.12.26 11:30:45'); INSERT INTO t2 VALUES('1901','1901','98-12-31','98.12.31 11:30:45'),('1999','1999','98-12-30','98.12.30 11:30:45'),('2000','2000','98-12-29','98.12.29 11:30:45'),('2001','2001','98-12-28','98.12.28 11:30:45'),('2099','2099','98-12-27','98.12.27 11:30:45'),('2100','2100','98-12-26','98.12.26 11:30:45'),('2155','2155','98-12-26','98.12.26 11:30:45'); INSERT INTO t3 VALUES('1901','1901','98-12-31','98.12.31 11:30:45'),('1999','1999','98-12-30','98.12.30 11:30:45'),('2000','2000','98-12-29','98.12.29 11:30:45'),('2001','2001','98-12-28','98.12.28 11:30:45'),('2099','2099','98-12-27','98.12.27 11:30:45'),('2100','2100','98-12-26','98.12.26 11:30:45'),('2155','2155','98-12-26','98.12.26 11:30:45'); diff --git a/mysql-test/suite/engines/iuds/r/type_bit_iuds.result b/mysql-test/suite/engines/iuds/r/type_bit_iuds.result index 47e5234f795..e01c7d78680 100644 --- a/mysql-test/suite/engines/iuds/r/type_bit_iuds.result +++ b/mysql-test/suite/engines/iuds/r/type_bit_iuds.result @@ -55941,7 +55941,7 @@ SELECT 0 + (101010101010101010101010101010<<0); 0 + (101010101010101010101010101010<<0) 9223372036854775807 Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' +Warning 1916 Got overflow when converting '101010101010101010101010101010' to INT. Value truncated. CREATE TABLE t1(c1 BIT(0)); CREATE TABLE t2(c1 BIT(0), c2 BIT(0), c3 BIT(0)); INSERT INTO t1 VALUES (b'101010101010101010101010101010'); @@ -56712,7 +56712,7 @@ SELECT 0 + (101010101010101010101010101010<<1); 0 + (101010101010101010101010101010<<1) 18446744073709551614 Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' +Warning 1916 Got overflow when converting '101010101010101010101010101010' to INT. Value truncated. CREATE TABLE t1(c1 BIT(1)); CREATE TABLE t2(c1 BIT(1), c2 BIT(1), c3 BIT(1)); set @v1=1; @@ -57532,7 +57532,7 @@ SELECT 0 + (101010101010101010101010101010<<2); 0 + (101010101010101010101010101010<<2) 18446744073709551612 Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' +Warning 1916 Got overflow when converting '101010101010101010101010101010' to INT. Value truncated. CREATE TABLE t1(c1 BIT(2)); CREATE TABLE t2(c1 BIT(2), c2 BIT(2), c3 BIT(2)); set @v1=2; @@ -58375,7 +58375,7 @@ SELECT 0 + (101010101010101010101010101010<<4); 0 + (101010101010101010101010101010<<4) 18446744073709551600 Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' +Warning 1916 Got overflow when converting '101010101010101010101010101010' to INT. Value truncated. CREATE TABLE t1(c1 BIT(4)); CREATE TABLE t2(c1 BIT(4), c2 BIT(4), c3 BIT(4)); set @v1=4; @@ -59296,7 +59296,7 @@ SELECT 0 + (101010101010101010101010101010<<8); 0 + (101010101010101010101010101010<<8) 18446744073709551360 Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' +Warning 1916 Got overflow when converting '101010101010101010101010101010' to INT. Value truncated. CREATE TABLE t1(c1 BIT(8)); CREATE TABLE t2(c1 BIT(8), c2 BIT(8), c3 BIT(8)); set @v1=8; @@ -60503,7 +60503,7 @@ SELECT 0 + (101010101010101010101010101010<<16); 0 + (101010101010101010101010101010<<16) 18446744073709486080 Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' +Warning 1916 Got overflow when converting '101010101010101010101010101010' to INT. Value truncated. CREATE TABLE t1(c1 BIT(16)); CREATE TABLE t2(c1 BIT(16), c2 BIT(16), c3 BIT(16)); set @v1=16; @@ -61915,7 +61915,7 @@ SELECT 0 + (101010101010101010101010101010<<32); 0 + (101010101010101010101010101010<<32) 18446744069414584320 Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' +Warning 1916 Got overflow when converting '101010101010101010101010101010' to INT. Value truncated. CREATE TABLE t1(c1 BIT(32)); CREATE TABLE t2(c1 BIT(32), c2 BIT(32), c3 BIT(32)); set @v1=32; @@ -63988,7 +63988,7 @@ SELECT 0 + (101010101010101010101010101010<<64); 0 + (101010101010101010101010101010<<64) 0 Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' +Warning 1916 Got overflow when converting '101010101010101010101010101010' to INT. Value truncated. CREATE TABLE t1(c1 BIT(64)); CREATE TABLE t2(c1 BIT(64), c2 BIT(64), c3 BIT(64)); set @v1=64; @@ -67165,7 +67165,7 @@ SELECT 0 + (1010101010101010101010101010101010101010101010101010101010101010<<0) 0 + (1010101010101010101010101010101010101010101010101010101010101010<<0) 9223372036854775807 Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' +Warning 1916 Got overflow when converting '1010101010101010101010101010101010101010101010101010101010101010' to INT. Value truncated. CREATE TABLE t1(c1 BIT(0)); CREATE TABLE t2(c1 BIT(0), c2 BIT(0), c3 BIT(0)); INSERT INTO t1 VALUES (b'1010101010101010101010101010101010101010101010101010101010101010'); @@ -67933,7 +67933,7 @@ SELECT 0 + (1010101010101010101010101010101010101010101010101010101010101010<<1) 0 + (1010101010101010101010101010101010101010101010101010101010101010<<1) 18446744073709551614 Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' +Warning 1916 Got overflow when converting '1010101010101010101010101010101010101010101010101010101010101010' to INT. Value truncated. CREATE TABLE t1(c1 BIT(1)); CREATE TABLE t2(c1 BIT(1), c2 BIT(1), c3 BIT(1)); set @v1=1; @@ -68750,7 +68750,7 @@ SELECT 0 + (1010101010101010101010101010101010101010101010101010101010101010<<2) 0 + (1010101010101010101010101010101010101010101010101010101010101010<<2) 18446744073709551612 Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' +Warning 1916 Got overflow when converting '1010101010101010101010101010101010101010101010101010101010101010' to INT. Value truncated. CREATE TABLE t1(c1 BIT(2)); CREATE TABLE t2(c1 BIT(2), c2 BIT(2), c3 BIT(2)); set @v1=2; @@ -69590,7 +69590,7 @@ SELECT 0 + (1010101010101010101010101010101010101010101010101010101010101010<<4) 0 + (1010101010101010101010101010101010101010101010101010101010101010<<4) 18446744073709551600 Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' +Warning 1916 Got overflow when converting '1010101010101010101010101010101010101010101010101010101010101010' to INT. Value truncated. CREATE TABLE t1(c1 BIT(4)); CREATE TABLE t2(c1 BIT(4), c2 BIT(4), c3 BIT(4)); set @v1=4; @@ -70508,7 +70508,7 @@ SELECT 0 + (1010101010101010101010101010101010101010101010101010101010101010<<8) 0 + (1010101010101010101010101010101010101010101010101010101010101010<<8) 18446744073709551360 Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' +Warning 1916 Got overflow when converting '1010101010101010101010101010101010101010101010101010101010101010' to INT. Value truncated. CREATE TABLE t1(c1 BIT(8)); CREATE TABLE t2(c1 BIT(8), c2 BIT(8), c3 BIT(8)); set @v1=8; @@ -71712,7 +71712,7 @@ SELECT 0 + (1010101010101010101010101010101010101010101010101010101010101010<<16 0 + (1010101010101010101010101010101010101010101010101010101010101010<<16) 18446744073709486080 Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' +Warning 1916 Got overflow when converting '1010101010101010101010101010101010101010101010101010101010101010' to INT. Value truncated. CREATE TABLE t1(c1 BIT(16)); CREATE TABLE t2(c1 BIT(16), c2 BIT(16), c3 BIT(16)); set @v1=16; @@ -73121,7 +73121,7 @@ SELECT 0 + (1010101010101010101010101010101010101010101010101010101010101010<<32 0 + (1010101010101010101010101010101010101010101010101010101010101010<<32) 18446744069414584320 Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' +Warning 1916 Got overflow when converting '1010101010101010101010101010101010101010101010101010101010101010' to INT. Value truncated. CREATE TABLE t1(c1 BIT(32)); CREATE TABLE t2(c1 BIT(32), c2 BIT(32), c3 BIT(32)); set @v1=32; @@ -75197,7 +75197,7 @@ SELECT 0 + (1010101010101010101010101010101010101010101010101010101010101010<<64 0 + (1010101010101010101010101010101010101010101010101010101010101010<<64) 0 Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' +Warning 1916 Got overflow when converting '1010101010101010101010101010101010101010101010101010101010101010' to INT. Value truncated. CREATE TABLE t1(c1 BIT(64)); CREATE TABLE t2(c1 BIT(64), c2 BIT(64), c3 BIT(64)); set @v1=64; @@ -78374,7 +78374,7 @@ SELECT 0 + (10101010101010101010101010101010101010101010101010101010101010101<<0 0 + (10101010101010101010101010101010101010101010101010101010101010101<<0) 9223372036854775807 Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' +Warning 1916 Got overflow when converting '10101010101010101010101010101010101010101010101010101010101010101' to INT. Value truncated. CREATE TABLE t1(c1 BIT(0)); CREATE TABLE t2(c1 BIT(0), c2 BIT(0), c3 BIT(0)); INSERT INTO t1 VALUES (b'10101010101010101010101010101010101010101010101010101010101010101'); @@ -79142,7 +79142,7 @@ SELECT 0 + (10101010101010101010101010101010101010101010101010101010101010101<<1 0 + (10101010101010101010101010101010101010101010101010101010101010101<<1) 18446744073709551614 Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' +Warning 1916 Got overflow when converting '10101010101010101010101010101010101010101010101010101010101010101' to INT. Value truncated. CREATE TABLE t1(c1 BIT(1)); CREATE TABLE t2(c1 BIT(1), c2 BIT(1), c3 BIT(1)); set @v1=1; @@ -79959,7 +79959,7 @@ SELECT 0 + (10101010101010101010101010101010101010101010101010101010101010101<<2 0 + (10101010101010101010101010101010101010101010101010101010101010101<<2) 18446744073709551612 Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' +Warning 1916 Got overflow when converting '10101010101010101010101010101010101010101010101010101010101010101' to INT. Value truncated. CREATE TABLE t1(c1 BIT(2)); CREATE TABLE t2(c1 BIT(2), c2 BIT(2), c3 BIT(2)); set @v1=2; @@ -80799,7 +80799,7 @@ SELECT 0 + (10101010101010101010101010101010101010101010101010101010101010101<<4 0 + (10101010101010101010101010101010101010101010101010101010101010101<<4) 18446744073709551600 Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' +Warning 1916 Got overflow when converting '10101010101010101010101010101010101010101010101010101010101010101' to INT. Value truncated. CREATE TABLE t1(c1 BIT(4)); CREATE TABLE t2(c1 BIT(4), c2 BIT(4), c3 BIT(4)); set @v1=4; @@ -81717,7 +81717,7 @@ SELECT 0 + (10101010101010101010101010101010101010101010101010101010101010101<<8 0 + (10101010101010101010101010101010101010101010101010101010101010101<<8) 18446744073709551360 Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' +Warning 1916 Got overflow when converting '10101010101010101010101010101010101010101010101010101010101010101' to INT. Value truncated. CREATE TABLE t1(c1 BIT(8)); CREATE TABLE t2(c1 BIT(8), c2 BIT(8), c3 BIT(8)); set @v1=8; @@ -82921,7 +82921,7 @@ SELECT 0 + (10101010101010101010101010101010101010101010101010101010101010101<<1 0 + (10101010101010101010101010101010101010101010101010101010101010101<<16) 18446744073709486080 Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' +Warning 1916 Got overflow when converting '10101010101010101010101010101010101010101010101010101010101010101' to INT. Value truncated. CREATE TABLE t1(c1 BIT(16)); CREATE TABLE t2(c1 BIT(16), c2 BIT(16), c3 BIT(16)); set @v1=16; @@ -84330,7 +84330,7 @@ SELECT 0 + (10101010101010101010101010101010101010101010101010101010101010101<<3 0 + (10101010101010101010101010101010101010101010101010101010101010101<<32) 18446744069414584320 Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' +Warning 1916 Got overflow when converting '10101010101010101010101010101010101010101010101010101010101010101' to INT. Value truncated. CREATE TABLE t1(c1 BIT(32)); CREATE TABLE t2(c1 BIT(32), c2 BIT(32), c3 BIT(32)); set @v1=32; @@ -86406,7 +86406,7 @@ SELECT 0 + (10101010101010101010101010101010101010101010101010101010101010101<<6 0 + (10101010101010101010101010101010101010101010101010101010101010101<<64) 0 Warnings: -Warning 1292 Truncated incorrect DECIMAL value: '' +Warning 1916 Got overflow when converting '10101010101010101010101010101010101010101010101010101010101010101' to INT. Value truncated. CREATE TABLE t1(c1 BIT(64)); CREATE TABLE t2(c1 BIT(64), c2 BIT(64), c3 BIT(64)); set @v1=64; diff --git a/mysql-test/suite/engines/iuds/r/update_delete_calendar.result b/mysql-test/suite/engines/iuds/r/update_delete_calendar.result index a04585dfd72..e8324c8b368 100644 --- a/mysql-test/suite/engines/iuds/r/update_delete_calendar.result +++ b/mysql-test/suite/engines/iuds/r/update_delete_calendar.result @@ -71,13 +71,6 @@ Warning 1265 Data truncated for column 'c2' at row 1 SELECT count(*) FROM t1 WHERE c2='10:45:15' OR c2='2009-01-32' OR c2='2009-02-30' OR c2='2009-04-31' OR c2='2009-06-31' OR c2='2009-09-31' /* returns 0 */; count(*) 0 -Warnings: -Warning 1292 Incorrect date value: '10:45:15' for column 'c2' at row 1 -Warning 1292 Incorrect date value: '2009-01-32' for column 'c2' at row 1 -Warning 1292 Incorrect date value: '10:45:15' for column 'c2' at row 1 -Warning 1292 Incorrect date value: '2009-01-32' for column 'c2' at row 1 -Warning 1292 Incorrect date value: '10:45:15' for column 'c2' at row 1 -Warning 1292 Incorrect date value: '2009-01-32' for column 'c2' at row 1 UPDATE t1 SET c2='2009-11-31' WHERE c2='2001-01-16'; Warnings: Warning 1265 Data truncated for column 'c2' at row 1 @@ -108,8 +101,7 @@ c1 c2 c3 2001-01-16 0000-00-00 12 2001-01-17 0000-00-00 13 Warnings: -Warning 1292 Incorrect date value: '0000-00-00' for column 'c2' at row 1 -Warning 1292 Incorrect date value: '0000-00-00' for column 'c2' at row 1 +Warning 1264 Out of range value for column 'c2' at row 1 UPDATE t1 SET c2='0000-00-00' WHERE c2='2001-01-18'; ERROR 22007: Incorrect date value: '0000-00-00' for column 'c2' at row 1 SET SQL_MODE=DEFAULT; @@ -774,20 +766,17 @@ c1 c2 c3 INSERT INTO t1 VALUES('2001-01-09','2001-01-10',6),('2001-01-11','2001-01-12',7); UPDATE t1 SET c1='2001-01-09 24:59:59',c2='2009-01-10 23:60:59' WHERE c1='2001-01-09'; Warnings: -Warning 1264 Out of range value for column 'c1' at row 1 -Warning 1264 Out of range value for column 'c2' at row 1 +Warning 1265 Data truncated for column 'c1' at row 1 +Warning 1265 Data truncated for column 'c2' at row 1 UPDATE t1 SET c2='2001-01-11 23:59:60' WHERE c1='2001-01-11'; Warnings: -Warning 1264 Out of range value for column 'c2' at row 1 +Warning 1265 Data truncated for column 'c2' at row 1 SELECT count(*) FROM t1 WHERE c1='2001-01-09 24:59:59' AND c2='2009-01-10 23:60:59'; count(*) 1 Warnings: -Warning 1292 Incorrect datetime value: '2001-01-09 24:59:59' for column 'c1' at row 1 -Warning 1292 Incorrect datetime value: '2009-01-10 23:60:59' for column 'c2' at row 1 -Warning 1292 Incorrect datetime value: '2001-01-09 24:59:59' for column 'c1' at row 1 -Warning 1292 Truncated incorrect datetime value: '2001-01-09 24:59:59' -Warning 1292 Truncated incorrect datetime value: '2009-01-10 23:60:59' +Warning 1292 Incorrect datetime value: '2001-01-09 24:59:59' +Warning 1292 Incorrect datetime value: '2009-01-10 23:60:59' SELECT count(*) FROM t1 WHERE c2='2001-01-11 23:59:60' /* returns 0 */; count(*) 0 @@ -806,8 +795,7 @@ c1 c2 c3 2001-01-11 00:00:00 0000-00-00 00:00:00 7 2001-01-17 00:00:00 0000-00-00 00:00:00 8 Warnings: -Warning 1292 Incorrect datetime value: '0000-00-00 00:00:00' for column 'c2' at row 1 -Warning 1292 Incorrect datetime value: '0000-00-00 00:00:00' for column 'c2' at row 1 +Warning 1264 Out of range value for column 'c2' at row 1 UPDATE t1 SET c2='0000-00-00 00:00:00' WHERE c2='2001-01-18 07:35'; ERROR 22007: Incorrect datetime value: '0000-00-00 00:00:00' for column 'c2' at row 1 SET SQL_MODE=DEFAULT; @@ -949,15 +937,13 @@ c1 c2 c3 2003-01-01 01:02:03 2002-01-09 01:30:30 10 UPDATE t1 SET c1='2003-01-01 1:2:3' WHERE c2 BETWEEN '20020109 01:30:40' AND '20020109 01:30:50' ORDER BY c2 LIMIT 2; Warnings: -Warning 1292 Incorrect datetime value: '20020109 01:30:40' for column 'c2' at row 1 -Warning 1292 Incorrect datetime value: '20020109 01:30:40' for column 'c2' at row 1 -Warning 1292 Incorrect datetime value: '20020109 01:30:50' for column 'c2' at row 1 +Warning 1292 Incorrect datetime value: '20020109 01:30:40' +Warning 1292 Incorrect datetime value: '20020109 01:30:50' SELECT * FROM t1 WHERE c2 BETWEEN '20020109 01:30:40' AND '20020109 01:30:50' ORDER BY c2; c1 c2 c3 Warnings: -Warning 1292 Incorrect datetime value: '20020109 01:30:40' for column 'c2' at row 1 -Warning 1292 Incorrect datetime value: '20020109 01:30:40' for column 'c2' at row 1 -Warning 1292 Incorrect datetime value: '20020109 01:30:50' for column 'c2' at row 1 +Warning 1292 Incorrect datetime value: '20020109 01:30:40' +Warning 1292 Incorrect datetime value: '20020109 01:30:50' UPDATE t1 SET c1='2003-01-01 1:2:3' WHERE c2 IN('2002-01-09 1:30:55','2002-01-09 2:00') ORDER BY c2 DESC LIMIT 2; SELECT * FROM t1 WHERE c2 IN('2002-01-09 1:30:55','2002-01-09 2:00') ORDER BY c2 DESC; c1 c2 c3 @@ -1389,17 +1375,13 @@ SELECT count(*) FROM t1 WHERE c1='2001-01-09 24:59:59' AND c2='2009-01-10 23:60: count(*) 1 Warnings: -Warning 1292 Incorrect datetime value: '2001-01-09 24:59:59' for column 'c1' at row 1 -Warning 1292 Incorrect datetime value: '2009-01-10 23:60:59' for column 'c2' at row 1 -Warning 1292 Incorrect datetime value: '2001-01-09 24:59:59' for column 'c1' at row 1 -Warning 1292 Truncated incorrect datetime value: '2001-01-09 24:59:59' -Warning 1292 Truncated incorrect datetime value: '2009-01-10 23:60:59' +Warning 1292 Incorrect datetime value: '2001-01-09 24:59:59' +Warning 1292 Incorrect datetime value: '2009-01-10 23:60:59' SELECT count(*) FROM t1 WHERE c1='2001-01-11 23:59:59' AND c2='2001-01-11 23:59:60'; count(*) 1 Warnings: -Warning 1292 Incorrect datetime value: '2001-01-11 23:59:60' for column 'c2' at row 1 -Warning 1292 Truncated incorrect datetime value: '2001-01-11 23:59:60' +Warning 1292 Incorrect datetime value: '2001-01-11 23:59:60' SELECT * FROM t1 WHERE c1='0000-00-00 00:00:00' OR c2='0000-00-00 00:00:00'; c1 c2 c3 0000-00-00 00:00:00 0000-00-00 00:00:00 6 @@ -1412,8 +1394,7 @@ c1 c2 c3 2001-01-11 23:59:59 0000-00-00 00:00:00 7 2001-01-17 00:00:00 0000-00-00 00:00:00 8 Warnings: -Warning 1292 Incorrect datetime value: '0000-00-00 00:00:00' for column 'c2' at row 1 -Warning 1292 Incorrect datetime value: '0000-00-00 00:00:00' for column 'c2' at row 1 +Warning 1265 Data truncated for column 'c2' at row 1 UPDATE t1 SET c1='1972-01-01 07:35',c2='0000-00-00 00:00:00' WHERE c2='2001-01-18 07:35'; ERROR 22007: Incorrect datetime value: '0000-00-00 00:00:00' for column 'c2' at row 1 SET SQL_MODE=DEFAULT; @@ -1552,15 +1533,13 @@ c1 c2 c3 2003-01-01 01:02:03 2002-01-09 01:30:30 10 UPDATE t1 SET c1='2003-01-01 1:2:3' WHERE c2 BETWEEN '20020109 01:30:40' AND '20020109 01:30:50' ORDER BY c2 LIMIT 2; Warnings: -Warning 1292 Incorrect datetime value: '20020109 01:30:40' for column 'c2' at row 1 -Warning 1292 Incorrect datetime value: '20020109 01:30:40' for column 'c2' at row 1 -Warning 1292 Incorrect datetime value: '20020109 01:30:50' for column 'c2' at row 1 +Warning 1292 Incorrect datetime value: '20020109 01:30:40' +Warning 1292 Incorrect datetime value: '20020109 01:30:50' SELECT * FROM t1 WHERE c2 BETWEEN '20020109 01:30:40' AND '20020109 01:30:50' ORDER BY c2; c1 c2 c3 Warnings: -Warning 1292 Incorrect datetime value: '20020109 01:30:40' for column 'c2' at row 1 -Warning 1292 Incorrect datetime value: '20020109 01:30:40' for column 'c2' at row 1 -Warning 1292 Incorrect datetime value: '20020109 01:30:50' for column 'c2' at row 1 +Warning 1292 Incorrect datetime value: '20020109 01:30:40' +Warning 1292 Incorrect datetime value: '20020109 01:30:50' UPDATE t1 SET c1='2003-01-01 1:2:3' WHERE c2 IN('2002-01-09 1:30:55','2002-01-09 2:00') ORDER BY c2 DESC LIMIT 2; SELECT * FROM t1 WHERE c2 IN('2002-01-09 1:30:55','2002-01-09 2:00') ORDER BY c2 DESC; c1 c2 c3 diff --git a/mysql-test/suite/engines/iuds/r/update_delete_number.result b/mysql-test/suite/engines/iuds/r/update_delete_number.result index 8e190870092..7c183068724 100644 --- a/mysql-test/suite/engines/iuds/r/update_delete_number.result +++ b/mysql-test/suite/engines/iuds/r/update_delete_number.result @@ -56,6 +56,8 @@ Warning 1264 Out of range value for column 'c2' at row 3 SELECT COUNT(*) FROM t1 WHERE c1=4294967296 AND c2=2147483648 /* no rows */; COUNT(*) 0 +Warnings: +Warning 1264 Out of range value for column 'c2' at row 1 SELECT * FROM t1 WHERE c1=4294967295 AND c2=2147483647; c1 c2 c3 4294967295 2147483647 10 @@ -1150,6 +1152,8 @@ Warning 1264 Out of range value for column 'c2' at row 3 SELECT COUNT(*) FROM t1 WHERE c1=256 AND c2=128 /* no rows */; COUNT(*) 0 +Warnings: +Warning 1264 Out of range value for column 'c2' at row 1 SELECT * FROM t1 WHERE c1=255 AND c2=127; c1 c2 c3 255 127 10 @@ -1922,6 +1926,8 @@ Warning 1264 Out of range value for column 'c2' at row 3 SELECT COUNT(*) FROM t1 WHERE c1=65536 AND c2=32768 /* no rows */; COUNT(*) 0 +Warnings: +Warning 1264 Out of range value for column 'c2' at row 1 SELECT * FROM t1 WHERE c1=65535 AND c2=32767; c1 c2 c3 65535 32767 10 @@ -2669,6 +2675,8 @@ Warning 1264 Out of range value for column 'c2' at row 3 SELECT COUNT(*) FROM t1 WHERE c1=16777216 AND c2=8388608 /* no rows */; COUNT(*) 0 +Warnings: +Warning 1264 Out of range value for column 'c2' at row 1 SELECT * FROM t1 WHERE c1=16777215 AND c2=8388607; c1 c2 c3 16777215 8388607 10 @@ -3416,6 +3424,8 @@ Warning 1264 Out of range value for column 'c2' at row 3 SELECT COUNT(*) FROM t1 WHERE c1=18446744073709551616 AND c2=9223372036854775808 /* no rows */; COUNT(*) 0 +Warnings: +Warning 1264 Out of range value for column 'c2' at row 1 SELECT * FROM t1 WHERE c1=18446744073709551615 AND c2=9223372036854775807; c1 c2 c3 18446744073709551615 9223372036854775807 10 diff --git a/mysql-test/suite/engines/iuds/r/update_time.result b/mysql-test/suite/engines/iuds/r/update_time.result index 3073f3c985f..09a7cbf0c7f 100644 --- a/mysql-test/suite/engines/iuds/r/update_time.result +++ b/mysql-test/suite/engines/iuds/r/update_time.result @@ -793,10 +793,10 @@ c2 00:09:09 00:11:11 00:11:11 +00:11:11 00:13:13 00:51:51 01:01:01 -02:02:02 03:03:00 08:08:08 100:04:04 @@ -1122,7 +1122,7 @@ c2 838:59:59 NULL UPDATE t4 SET c1=11:11:11 WHERE c2=NULL; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':11:11 WHERE c2=NULL' at line 1 +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ':11:11 WHERE c2=NULL' at line 1 SELECT c1 FROM t4; c1 00:00:01 @@ -1262,7 +1262,7 @@ c1 c2 838:59:59 838:59:59 UPDATE t1 SET c1=c1+1,c2=c2-1 WHERE c1 IN (222222,8385955,1500000) ORDER BY c1; Warnings: -Warning 1264 Out of range value for column 'c2' at row 2 +Warning 1265 Data truncated for column 'c2' at row 2 SELECT * FROM t1; c1 c2 -12:12:12 12:12:12 @@ -1332,7 +1332,7 @@ c1 c2 00:51:51 02:22:22 00:54:54 00:54:54 01:01:01 02:22:22 -02:02:02 02:22:22 +02:02:02 02:02:02 03:03:00 02:22:22 08:08:08 00:00:00 100:04:04 100:04:04 @@ -1374,7 +1374,7 @@ c1 c2 00:51:51 00:51:51 00:54:54 00:11:11 01:01:01 01:01:01 -02:02:02 02:02:02 +02:02:02 00:11:11 03:03:00 03:03:00 08:08:08 08:08:08 11:11:11 00:11:11 diff --git a/mysql-test/suite/engines/iuds/r/update_year.result b/mysql-test/suite/engines/iuds/r/update_year.result index 1b0ead45314..c762d70a276 100644 --- a/mysql-test/suite/engines/iuds/r/update_year.result +++ b/mysql-test/suite/engines/iuds/r/update_year.result @@ -2,7 +2,13 @@ DROP TABLE IF EXISTS t1,t2,t3,t4; CREATE TABLE t1(c1 YEAR NOT NULL,c2 YEAR, PRIMARY KEY(c1)); CREATE TABLE t2(c1 YEAR NOT NULL, c2 YEAR, UNIQUE INDEX idx(c1,c2)); CREATE TABLE t3(c1 YEAR(2) NOT NULL,c2 YEAR(2), PRIMARY KEY(c1)); +Warnings: +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead CREATE TABLE t4(c1 YEAR(2), c2 YEAR(2), UNIQUE INDEX idx(c1,c2)); +Warnings: +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead INSERT INTO t1 VALUES (1901,1901),(1970,1970),(1999,1999),(2000,2000),(2155,2155); INSERT INTO t2 VALUES (1901,1901),(1970,1970),(1999,1999),(2000,2000),(2155,2155); INSERT INTO t3 VALUES (1901,1901),(1970,1970),(1999,1999),(2000,2000),(2155,2155); diff --git a/mysql-test/suite/funcs_1/r/innodb_views.result b/mysql-test/suite/funcs_1/r/innodb_views.result index d9cd0f1e7f8..b50f5640520 100644 --- a/mysql-test/suite/funcs_1/r/innodb_views.result +++ b/mysql-test/suite/funcs_1/r/innodb_views.result @@ -53,6 +53,8 @@ f107 year(4) not null default 2000, f108 enum("1enum","2enum") not null default "1enum", f109 set("1set","2set") not null default "1set" ) engine = innodb; +Warnings: +Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/innodb_tb2.txt' into table tb2; DROP DATABASE IF EXISTS test1; @@ -112,6 +114,8 @@ f107 year(4) not null default 2000, f108 enum("1enum","2enum") not null default "1enum", f109 set("1set","2set") not null default "1set" ) engine = innodb; +Warnings: +Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/innodb_tb2.txt' into table tb2; USE test; diff --git a/mysql-test/suite/funcs_1/r/is_columns_innodb.result b/mysql-test/suite/funcs_1/r/is_columns_innodb.result index f3d3c6b7bad..085017fb529 100644 --- a/mysql-test/suite/funcs_1/r/is_columns_innodb.result +++ b/mysql-test/suite/funcs_1/r/is_columns_innodb.result @@ -132,6 +132,8 @@ f107 year(4) not null default 2000, f108 enum("1enum","2enum") not null default "1enum", f109 set("1set","2set") not null default "1set" ) engine = innodb; +Warnings: +Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/innodb_tb2.txt' into table tb2; drop table if exists tb3 ; @@ -262,6 +264,8 @@ f239 varchar(20000) binary, f240 varchar(2000), f241 char(100) ) engine = innodb; +Warnings: +Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/innodb_tb4.txt' into table tb4; USE test1; @@ -319,6 +323,8 @@ f107 year(4) not null default 2000, f108 enum("1enum","2enum") not null default "1enum", f109 set("1set","2set") not null default "1set" ) engine = innodb; +Warnings: +Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/innodb_tb2.txt' into table tb2; USE test; diff --git a/mysql-test/suite/funcs_1/r/is_columns_memory.result b/mysql-test/suite/funcs_1/r/is_columns_memory.result index 39a5dcd0b0c..7521a9857a6 100644 --- a/mysql-test/suite/funcs_1/r/is_columns_memory.result +++ b/mysql-test/suite/funcs_1/r/is_columns_memory.result @@ -128,6 +128,8 @@ f107 year(4) not null default 2000, f108 enum("1enum","2enum") not null default "1enum", f109 set("1set","2set") not null default "1set" ) engine = memory; +Warnings: +Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/memory_tb2.txt' into table tb2 ; drop table if exists tb3; @@ -251,6 +253,8 @@ f238 varchar(25000) binary, f239 varbinary(0), f240 varchar(1200) ) engine = memory; +Warnings: +Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/memory_tb4.txt' into table tb4; USE test1; @@ -308,6 +312,8 @@ f107 year(4) not null default 2000, f108 enum("1enum","2enum") not null default "1enum", f109 set("1set","2set") not null default "1set" ) engine = memory; +Warnings: +Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/memory_tb2.txt' into table tb2 ; USE test; diff --git a/mysql-test/suite/funcs_1/r/is_columns_myisam.result b/mysql-test/suite/funcs_1/r/is_columns_myisam.result index 03af4ebb89f..6c2586cc3c1 100644 --- a/mysql-test/suite/funcs_1/r/is_columns_myisam.result +++ b/mysql-test/suite/funcs_1/r/is_columns_myisam.result @@ -144,6 +144,8 @@ f115 VARBINARY(27) null , f116 VARBINARY(64) null, f117 VARBINARY(192) null ) engine = myisam; +Warnings: +Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/myisam_tb2.txt' into table tb2; drop table if exists tb3 ; @@ -283,6 +285,8 @@ f240 varchar(120), f241 char(100), f242 bit(30) ) engine = myisam; +Warnings: +Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/myisam_tb4.txt' into table tb4; USE test1; @@ -348,6 +352,8 @@ f115 VARBINARY(27) null , f116 VARBINARY(64) null, f117 VARBINARY(192) null ) engine = myisam; +Warnings: +Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/myisam_tb2.txt' into table tb2; USE test; diff --git a/mysql-test/suite/funcs_1/r/is_columns_myisam_embedded.result b/mysql-test/suite/funcs_1/r/is_columns_myisam_embedded.result index dd8e508e821..150469a4a2f 100644 --- a/mysql-test/suite/funcs_1/r/is_columns_myisam_embedded.result +++ b/mysql-test/suite/funcs_1/r/is_columns_myisam_embedded.result @@ -144,6 +144,8 @@ f115 VARBINARY(27) null , f116 VARBINARY(64) null, f117 VARBINARY(192) null ) engine = myisam; +Warnings: +Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/myisam_tb2.txt' into table tb2; drop table if exists tb3 ; @@ -283,6 +285,8 @@ f240 varchar(120), f241 char(100), f242 bit(30) ) engine = myisam; +Warnings: +Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/myisam_tb4.txt' into table tb4; USE test1; @@ -348,6 +352,8 @@ f115 VARBINARY(27) null , f116 VARBINARY(64) null, f117 VARBINARY(192) null ) engine = myisam; +Warnings: +Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/myisam_tb2.txt' into table tb2; USE test; diff --git a/mysql-test/suite/funcs_1/r/memory_views.result b/mysql-test/suite/funcs_1/r/memory_views.result index 864cbb93b29..a718f986648 100644 --- a/mysql-test/suite/funcs_1/r/memory_views.result +++ b/mysql-test/suite/funcs_1/r/memory_views.result @@ -54,6 +54,8 @@ f107 year(4) not null default 2000, f108 enum("1enum","2enum") not null default "1enum", f109 set("1set","2set") not null default "1set" ) engine = memory; +Warnings: +Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/memory_tb2.txt' into table tb2 ; DROP DATABASE IF EXISTS test1; @@ -113,6 +115,8 @@ f107 year(4) not null default 2000, f108 enum("1enum","2enum") not null default "1enum", f109 set("1set","2set") not null default "1set" ) engine = memory; +Warnings: +Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/memory_tb2.txt' into table tb2 ; USE test; diff --git a/mysql-test/suite/funcs_1/r/myisam_views-big.result b/mysql-test/suite/funcs_1/r/myisam_views-big.result index f4025dfef2a..1ee9c6e0cd6 100644 --- a/mysql-test/suite/funcs_1/r/myisam_views-big.result +++ b/mysql-test/suite/funcs_1/r/myisam_views-big.result @@ -62,6 +62,8 @@ f115 VARBINARY(27) null , f116 VARBINARY(64) null, f117 VARBINARY(192) null ) engine = myisam; +Warnings: +Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/myisam_tb2.txt' into table tb2; DROP DATABASE IF EXISTS test1; @@ -129,6 +131,8 @@ f115 VARBINARY(27) null , f116 VARBINARY(64) null, f117 VARBINARY(192) null ) engine = myisam; +Warnings: +Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/myisam_tb2.txt' into table tb2; USE test; diff --git a/mysql-test/suite/funcs_1/r/storedproc.result b/mysql-test/suite/funcs_1/r/storedproc.result index 7b45ec4c9e1..179d0cd814e 100644 --- a/mysql-test/suite/funcs_1/r/storedproc.result +++ b/mysql-test/suite/funcs_1/r/storedproc.result @@ -7499,9 +7499,13 @@ BEGIN declare x, y, z year(3) default 2005; SELECT x, y, z; END// +Warnings: +Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead CALL sp1(); x y z 2005 2005 2005 +Warnings: +Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead DROP PROCEDURE IF EXISTS sp1; CREATE PROCEDURE sp1( ) BEGIN diff --git a/mysql-test/suite/heap/heap.result b/mysql-test/suite/heap/heap.result index f058c9f9c72..ae562a0dda1 100644 --- a/mysql-test/suite/heap/heap.result +++ b/mysql-test/suite/heap/heap.result @@ -738,3 +738,55 @@ SELECT c2 FROM t1; c2 0 DROP TABLE t1; +CREATE TABLE t1 (a int, index(a)) engine=heap min_rows=10 max_rows=100; +insert into t1 values(1); +select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1"; +data_length index_length +1600 2400 +drop table t1; +CREATE TABLE t1 (a int, index(a)) engine=heap min_rows=10 max_rows=10000; +insert into t1 values(1); +select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1"; +data_length index_length +16000 24000 +drop table t1; +CREATE TABLE t1 (a int, index(a)) engine=heap min_rows=3000 max_rows=3000; +insert into t1 values(1); +select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1"; +data_length index_length +48000 72000 +drop table t1; +CREATE TABLE t1 (a int, index(a)) engine=heap max_rows=15000; +insert into t1 values(1); +select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1"; +data_length index_length +24000 36000 +drop table t1; +create table t1 (c1 int, index(c1)) engine=heap max_rows=10000; +insert into t1 select rand(100000000); +insert into t1 select rand(100000000) from t1; +insert into t1 select rand(100000000) from t1; +insert into t1 select rand(100000000) from t1; +insert into t1 select rand(100000000) from t1; +insert into t1 select rand(100000000) from t1; +insert into t1 select rand(100000000) from t1; +insert into t1 select rand(100000000) from t1; +insert into t1 select rand(100000000) from t1; +insert into t1 select rand(100000000) from t1; +insert into t1 select rand(100000000) from t1 limit 488; +select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1"; +data_length index_length +16000 24000 +insert into t1 select rand(100000000) from t1 limit 1; +select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1"; +data_length index_length +33024 49024 +insert into t1 select rand(100000000) from t1 limit 1000; +select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1"; +data_length index_length +49024 73024 +insert into t1 select rand(100000000) from t1; +select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1"; +data_length index_length +81024 121024 +drop table t1; diff --git a/mysql-test/suite/heap/heap.test b/mysql-test/suite/heap/heap.test index 7d56425799a..6f5046af139 100644 --- a/mysql-test/suite/heap/heap.test +++ b/mysql-test/suite/heap/heap.test @@ -485,3 +485,55 @@ INSERT INTO t1 VALUES('', 0); ALTER TABLE t1 MODIFY c1 VARCHAR(101); SELECT c2 FROM t1; DROP TABLE t1; + +# +# Show that MIN_ROWS and MAX_ROWS have an effect on how data_length +# and index_length are allocated. +# Result is different for 32 / 64 bit machines as pointer lengths are different +# + +CREATE TABLE t1 (a int, index(a)) engine=heap min_rows=10 max_rows=100; +insert into t1 values(1); +--replace_result 800 1600 1200 2400 +select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1"; +drop table t1; +CREATE TABLE t1 (a int, index(a)) engine=heap min_rows=10 max_rows=10000; +insert into t1 values(1); +--replace_result 8000 16000 12000 24000 +select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1"; +drop table t1; +CREATE TABLE t1 (a int, index(a)) engine=heap min_rows=3000 max_rows=3000; +insert into t1 values(1); +--replace_result 24000 48000 36000 72000 +select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1"; +drop table t1; +CREATE TABLE t1 (a int, index(a)) engine=heap max_rows=15000; +insert into t1 values(1); +--replace_result 12000 24000 18000 36000 +select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1"; +drop table t1; + +create table t1 (c1 int, index(c1)) engine=heap max_rows=10000; +insert into t1 select rand(100000000); +insert into t1 select rand(100000000) from t1; +insert into t1 select rand(100000000) from t1; +insert into t1 select rand(100000000) from t1; +insert into t1 select rand(100000000) from t1; +insert into t1 select rand(100000000) from t1; +insert into t1 select rand(100000000) from t1; +insert into t1 select rand(100000000) from t1; +insert into t1 select rand(100000000) from t1; +insert into t1 select rand(100000000) from t1; +insert into t1 select rand(100000000) from t1 limit 488; +--replace_result 8000 16000 12000 24000 +select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1"; +insert into t1 select rand(100000000) from t1 limit 1; +--replace_result 16512 33024 24512 49024 +select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1"; +insert into t1 select rand(100000000) from t1 limit 1000; +--replace_result 24512 49024 36512 73024 +select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1"; +insert into t1 select rand(100000000) from t1; +--replace_result 40512 81024 60512 121024 +select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1"; +drop table t1; diff --git a/mysql-test/suite/innodb/r/innodb_bug52745.result b/mysql-test/suite/innodb/r/innodb_bug52745.result index 74db8b0c20a..927ba0e0e53 100644 --- a/mysql-test/suite/innodb/r/innodb_bug52745.result +++ b/mysql-test/suite/innodb/r/innodb_bug52745.result @@ -58,6 +58,7 @@ col89 float unsigned zerofill DEFAULT NULL, col90 tinyblob ) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1; Warnings: +Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead Note 1291 Column 'col82' has duplicated value '' in ENUM Note 1291 Column 'col82' has duplicated value '' in ENUM INSERT INTO bug52745 SET diff --git a/mysql-test/suite/innodb/t/innodb_bug14007649.test b/mysql-test/suite/innodb/t/innodb_bug14007649.test index 5f613cad6f1..da413e0ce59 100644 --- a/mysql-test/suite/innodb/t/innodb_bug14007649.test +++ b/mysql-test/suite/innodb/t/innodb_bug14007649.test @@ -1,9 +1,9 @@ --source include/have_innodb.inc --source include/have_debug.inc -if (`select plugin_auth_version <= "1.1.8-26.0" from information_schema.plugins where plugin_name='innodb'`) +if (`select plugin_auth_version <= "1.0.17-13.01" from information_schema.plugins where plugin_name='innodb'`) { - --skip Not fixed in XtraDB 1.1.8-26.0 or earlier + --skip Not fixed in XtraDB 1.0.17-13.01 or earlier } create table t1 ( diff --git a/mysql-test/suite/maria/lock.result b/mysql-test/suite/maria/lock.result index 101347c7d4c..b67d1ab7b0d 100644 --- a/mysql-test/suite/maria/lock.result +++ b/mysql-test/suite/maria/lock.result @@ -27,3 +27,6 @@ i drop table t2; unlock tables; drop table t1; +CREATE TABLE t1 (i INT) ENGINE=Aria; +LOCK TABLES t1 WRITE, t1 AS t1a WRITE; +DROP TABLE t1; diff --git a/mysql-test/suite/maria/lock.test b/mysql-test/suite/maria/lock.test index 6116f0b5f08..5b6d17069e7 100644 --- a/mysql-test/suite/maria/lock.test +++ b/mysql-test/suite/maria/lock.test @@ -42,3 +42,11 @@ select * from t1; drop table t2; unlock tables; drop table t1; + +# +# MDEV-366: lock table twice with LOCK TABLES and then drop it +# + +CREATE TABLE t1 (i INT) ENGINE=Aria; +LOCK TABLES t1 WRITE, t1 AS t1a WRITE; +DROP TABLE t1; diff --git a/mysql-test/suite/mtr2/combinations b/mysql-test/suite/mtr2/combinations new file mode 100644 index 00000000000..b26eab8ce1d --- /dev/null +++ b/mysql-test/suite/mtr2/combinations @@ -0,0 +1,5 @@ +[1st] +lock-wait-timeout=5 + +[2nd] +lock-wait-timeout=3 diff --git a/mysql-test/suite/perfschema/disabled.def b/mysql-test/suite/perfschema/disabled.def index 8cae44a3607..8a843692d2a 100644 --- a/mysql-test/suite/perfschema/disabled.def +++ b/mysql-test/suite/perfschema/disabled.def @@ -9,4 +9,4 @@ # Do not use any TAB characters for whitespace. # ############################################################################## - +misc : bug#14113704 24/04/2012 Mayank issue reported causing failure. diff --git a/mysql-test/suite/perfschema/r/func_file_io.result b/mysql-test/suite/perfschema/r/func_file_io.result index d99e77dcd8c..c95fae94803 100644 --- a/mysql-test/suite/perfschema/r/func_file_io.result +++ b/mysql-test/suite/perfschema/r/func_file_io.result @@ -15,6 +15,9 @@ SET @before_count = (SELECT SUM(TIMER_WAIT) FROM performance_schema.events_waits_history_long WHERE (EVENT_NAME = 'wait/io/file/myisam/dfile') AND (OBJECT_NAME LIKE '%t1.MYD')); +SELECT (@before_count >= 0) as have_before_count; +have_before_count +1 SELECT IF(@before_count > 0, 'Success', 'Failure') has_instrumentation; has_instrumentation Success @@ -27,6 +30,9 @@ SET @after_count = (SELECT SUM(TIMER_WAIT) FROM performance_schema.events_waits_history_long WHERE (EVENT_NAME = 'wait/io/file/myisam/dfile') AND (OBJECT_NAME LIKE '%t1.MYD') AND (1 = 1)); +SELECT (@after_count >= 0) as have_after_count; +have_after_count +1 SELECT IF((@after_count - @before_count) > 0, 'Success', 'Failure') test_ff1_timed; test_ff1_timed Success @@ -35,6 +41,9 @@ SET @before_count = (SELECT SUM(TIMER_WAIT) FROM performance_schema.events_waits_history_long WHERE (EVENT_NAME = 'wait/io/file/myisam/dfile') AND (OBJECT_NAME LIKE '%t1.MYD') AND (2 = 2)); +SELECT (@before_count >= 0) as have_before_count; +have_before_count +1 SELECT * FROM t1 WHERE id < 6; id b 1 initial value @@ -46,6 +55,9 @@ SET @after_count = (SELECT SUM(TIMER_WAIT) FROM performance_schema.events_waits_history_long WHERE (EVENT_NAME = 'wait/io/file/myisam/dfile') AND (OBJECT_NAME LIKE '%t1.MYD') AND (3 = 3)); +SELECT (@after_count >= 0) as have_after_count; +have_after_count +1 SELECT IF((COALESCE(@after_count, 0) - COALESCE(@before_count, 0)) = 0, 'Success', 'Failure') test_ff2_timed; test_ff2_timed Success diff --git a/mysql-test/suite/perfschema/r/query_cache.result b/mysql-test/suite/perfschema/r/query_cache.result index c49cb7b718e..8786cd055ca 100644 --- a/mysql-test/suite/perfschema/r/query_cache.result +++ b/mysql-test/suite/perfschema/r/query_cache.result @@ -36,9 +36,9 @@ Qcache_hits 1 select spins from performance_schema.events_waits_current order by event_name limit 1; spins NULL -select name from performance_schema.setup_instruments order by name limit 1; -name -wait/io/file/aria/control +select * from performance_schema.setup_timers where name='wait'; +NAME TIMER_NAME +wait CYCLE show status like "Qcache_queries_in_cache"; Variable_name Value Qcache_queries_in_cache 1 @@ -51,9 +51,9 @@ Qcache_hits 1 select spins from performance_schema.events_waits_current order by event_name limit 1; spins NULL -select name from performance_schema.setup_instruments order by name limit 1; -name -wait/io/file/aria/control +select * from performance_schema.setup_timers where name='wait'; +NAME TIMER_NAME +wait CYCLE show status like "Qcache_queries_in_cache"; Variable_name Value Qcache_queries_in_cache 1 diff --git a/mysql-test/suite/perfschema/t/func_file_io.test b/mysql-test/suite/perfschema/t/func_file_io.test index bcf29a7daa2..e8b01a10bd1 100644 --- a/mysql-test/suite/perfschema/t/func_file_io.test +++ b/mysql-test/suite/perfschema/t/func_file_io.test @@ -41,6 +41,7 @@ SET @before_count = (SELECT SUM(TIMER_WAIT) WHERE (EVENT_NAME = 'wait/io/file/myisam/dfile') AND (OBJECT_NAME LIKE '%t1.MYD')); +SELECT (@before_count >= 0) as have_before_count; SELECT IF(@before_count > 0, 'Success', 'Failure') has_instrumentation; SELECT * FROM t1 WHERE id < 4; @@ -50,6 +51,7 @@ SET @after_count = (SELECT SUM(TIMER_WAIT) WHERE (EVENT_NAME = 'wait/io/file/myisam/dfile') AND (OBJECT_NAME LIKE '%t1.MYD') AND (1 = 1)); +SELECT (@after_count >= 0) as have_after_count; SELECT IF((@after_count - @before_count) > 0, 'Success', 'Failure') test_ff1_timed; UPDATE performance_schema.setup_instruments SET enabled='NO'; @@ -59,6 +61,7 @@ SET @before_count = (SELECT SUM(TIMER_WAIT) WHERE (EVENT_NAME = 'wait/io/file/myisam/dfile') AND (OBJECT_NAME LIKE '%t1.MYD') AND (2 = 2)); +SELECT (@before_count >= 0) as have_before_count; SELECT * FROM t1 WHERE id < 6; SET @after_count = (SELECT SUM(TIMER_WAIT) @@ -66,6 +69,7 @@ SET @after_count = (SELECT SUM(TIMER_WAIT) WHERE (EVENT_NAME = 'wait/io/file/myisam/dfile') AND (OBJECT_NAME LIKE '%t1.MYD') AND (3 = 3)); +SELECT (@after_count >= 0) as have_after_count; SELECT IF((COALESCE(@after_count, 0) - COALESCE(@before_count, 0)) = 0, 'Success', 'Failure') test_ff2_timed; # diff --git a/mysql-test/suite/perfschema/t/query_cache.test b/mysql-test/suite/perfschema/t/query_cache.test index 8c9e5fcd0ed..60d4a648222 100644 --- a/mysql-test/suite/perfschema/t/query_cache.test +++ b/mysql-test/suite/perfschema/t/query_cache.test @@ -34,7 +34,7 @@ show status like "Qcache_hits"; select spins from performance_schema.events_waits_current order by event_name limit 1; -select name from performance_schema.setup_instruments order by name limit 1; +select * from performance_schema.setup_timers where name='wait'; show status like "Qcache_queries_in_cache"; show status like "Qcache_inserts"; @@ -42,7 +42,7 @@ show status like "Qcache_hits"; select spins from performance_schema.events_waits_current order by event_name limit 1; -select name from performance_schema.setup_instruments order by name limit 1; +select * from performance_schema.setup_timers where name='wait'; show status like "Qcache_queries_in_cache"; show status like "Qcache_inserts"; diff --git a/mysql-test/suite/rpl/r/rpl_filter_tables_not_exist.result b/mysql-test/suite/rpl/r/rpl_filter_tables_not_exist.result index fcd03ea74b8..baf0cf81cec 100644 --- a/mysql-test/suite/rpl/r/rpl_filter_tables_not_exist.result +++ b/mysql-test/suite/rpl/r/rpl_filter_tables_not_exist.result @@ -114,22 +114,23 @@ id c 3 3 [on master] drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -CREATE TABLE test.t5 (a INT AUTO_INCREMENT PRIMARY KEY, b INT, c INT); +CREATE TABLE test.t5 (a INT AUTO_INCREMENT PRIMARY KEY, b DECIMAL(20,20), c INT); CREATE TABLE test.t1 (a INT); INSERT INTO test.t1 VALUES(1); call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); -CREATE TABLE test.t_slave (a INT AUTO_INCREMENT PRIMARY KEY, b INT, c INT); +CREATE TABLE test.t_slave (a INT AUTO_INCREMENT PRIMARY KEY, b DECIMAL(20,20), c INT); CREATE TRIGGER t1_update AFTER UPDATE ON test.t1 FOR EACH ROW -INSERT INTO test.t_slave VALUES(NULL, ROUND(RAND() * 1000), @c); +INSERT INTO test.t_slave VALUES(NULL, RAND(), @c); SET INSERT_ID=2; SET @c=2; SET @@rand_seed1=10000000, @@rand_seed2=1000000; -INSERT INTO t5 VALUES (NULL, ROUND(RAND() * 1000), @c); +INSERT INTO t5 VALUES (NULL, RAND(), @c); SELECT b into @b FROM test.t5; UPDATE test.t1 SET a=2; SELECT a AS 'ONE' into @a FROM test.t_slave; SELECT c AS 'NULL' into @c FROM test.t_slave; SELECT b into @b FROM test.t_slave; +include/assert.inc [Random values from master and slave must be different] drop table test.t5; drop table test.t1; drop table test.t_slave; diff --git a/mysql-test/suite/rpl/r/rpl_hrtime.result b/mysql-test/suite/rpl/r/rpl_hrtime.result index e4a825591bf..fbe4ba28409 100644 --- a/mysql-test/suite/rpl/r/rpl_hrtime.result +++ b/mysql-test/suite/rpl/r/rpl_hrtime.result @@ -30,7 +30,7 @@ include/rpl_end.inc /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; ROLLBACK/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1293832861/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; diff --git a/mysql-test/suite/rpl/r/rpl_log_pos.result b/mysql-test/suite/rpl/r/rpl_log_pos.result index 8910f7c8f74..610d18a88c6 100644 --- a/mysql-test/suite/rpl/r/rpl_log_pos.result +++ b/mysql-test/suite/rpl/r/rpl_log_pos.result @@ -11,7 +11,7 @@ include/stop_slave.inc change master to master_log_pos=MASTER_LOG_POS; start slave; include/wait_for_slave_io_error.inc [errno=1236] -Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'log event entry exceeded max_allowed_packet; Increase max_allowed_packet on master; the first event 'master-bin.000001' at XXX, the last event read from 'master-bin.000001' at XXX, the last byte read from 'master-bin.000001' at XXX.'' +Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'binlog truncated in the middle of event; consider out of disk space on master; the first event 'master-bin.000001' at XXX, the last event read from 'master-bin.000001' at XXX, the last byte read from 'master-bin.000001' at XXX.'' include/stop_slave_sql.inc show master status; File Position Binlog_Do_DB Binlog_Ignore_DB diff --git a/mysql-test/suite/rpl/r/rpl_mdev382.result b/mysql-test/suite/rpl/r/rpl_mdev382.result new file mode 100644 index 00000000000..50da7e67bba --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_mdev382.result @@ -0,0 +1,369 @@ +include/master-slave.inc +[connection master] +create table t1 (a int primary key) engine=innodb; +create table t2 (a int primary key) engine=myisam; +begin; +insert into t1 values (1); +SET sql_mode = 'ANSI_QUOTES'; +savepoint `a``; create database couldbebadthingshere; savepoint ``dummy`; +insert into t1 values (2); +insert into t2 values (1); +SET sql_mode = ''; +rollback to savepoint `a``; create database couldbebadthingshere; savepoint ``dummy`; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +insert into t1 values (3); +commit; +show binlog events from <binlog_start>; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; create table t1 (a int primary key) engine=innodb +master-bin.000001 # Query # # use `test`; create table t2 (a int primary key) engine=myisam +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; insert into t2 values (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; insert into t1 values (1) +master-bin.000001 # Query # # SAVEPOINT "a`; create database couldbebadthingshere; savepoint `dummy" +master-bin.000001 # Query # # use `test`; insert into t1 values (2) +master-bin.000001 # Query # # ROLLBACK TO `a``; create database couldbebadthingshere; savepoint ``dummy` +master-bin.000001 # Query # # use `test`; insert into t1 values (3) +master-bin.000001 # Xid # # COMMIT /* XID */ +BEGIN; +insert into t1 values(10); +set sql_mode = 'ANSI_QUOTES'; +set sql_quote_show_create = 1; +savepoint a; +insert into t1 values(11); +savepoint "a""a"; +insert into t1 values(12); +set sql_quote_show_create = 0; +savepoint b; +insert into t1 values(13); +savepoint "b""b"; +insert into t1 values(14); +set sql_mode = ''; +set sql_quote_show_create = 1; +savepoint c; +insert into t1 values(15); +savepoint `c``c`; +insert into t1 values(16); +set sql_quote_show_create = 0; +savepoint d; +insert into t1 values(17); +savepoint `d``d`; +insert into t1 values(18); +COMMIT; +set sql_quote_show_create = 1; +show binlog events from <binlog_start>; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; insert into t1 values(10) +master-bin.000001 # Query # # SAVEPOINT "a" +master-bin.000001 # Query # # use `test`; insert into t1 values(11) +master-bin.000001 # Query # # SAVEPOINT "a""a" +master-bin.000001 # Query # # use `test`; insert into t1 values(12) +master-bin.000001 # Query # # SAVEPOINT b +master-bin.000001 # Query # # use `test`; insert into t1 values(13) +master-bin.000001 # Query # # SAVEPOINT "b""b" +master-bin.000001 # Query # # use `test`; insert into t1 values(14) +master-bin.000001 # Query # # SAVEPOINT `c` +master-bin.000001 # Query # # use `test`; insert into t1 values(15) +master-bin.000001 # Query # # SAVEPOINT `c``c` +master-bin.000001 # Query # # use `test`; insert into t1 values(16) +master-bin.000001 # Query # # SAVEPOINT d +master-bin.000001 # Query # # use `test`; insert into t1 values(17) +master-bin.000001 # Query # # SAVEPOINT `d``d` +master-bin.000001 # Query # # use `test`; insert into t1 values(18) +master-bin.000001 # Xid # # COMMIT /* XID */ +*** Test correct USE statement in SHOW BINLOG EVENTS *** +set sql_mode = 'ANSI_QUOTES'; +CREATE DATABASE "db1`; SELECT 'oops!'"; +use "db1`; SELECT 'oops!'"; +CREATE TABLE t1 (a INT PRIMARY KEY) engine=MyISAM; +INSERT INTO t1 VALUES (1); +set sql_mode = ''; +INSERT INTO t1 VALUES (2); +set sql_mode = 'ANSI_QUOTES'; +show binlog events from <binlog_start>; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # CREATE DATABASE "db1`; SELECT 'oops!'" +master-bin.000001 # Query # # use "db1`; SELECT 'oops!'"; CREATE TABLE t1 (a INT PRIMARY KEY) engine=MyISAM +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use "db1`; SELECT 'oops!'"; INSERT INTO t1 VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use "db1`; SELECT 'oops!'"; INSERT INTO t1 VALUES (2) +master-bin.000001 # Query # # COMMIT +set sql_mode = ''; +set sql_quote_show_create = 0; +show binlog events from <binlog_start>; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # CREATE DATABASE "db1`; SELECT 'oops!'" +master-bin.000001 # Query # # use `db1``; SELECT 'oops!'`; CREATE TABLE t1 (a INT PRIMARY KEY) engine=MyISAM +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `db1``; SELECT 'oops!'`; INSERT INTO t1 VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `db1``; SELECT 'oops!'`; INSERT INTO t1 VALUES (2) +master-bin.000001 # Query # # COMMIT +set sql_quote_show_create = 1; +show binlog events from <binlog_start>; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # CREATE DATABASE "db1`; SELECT 'oops!'" +master-bin.000001 # Query # # use `db1``; SELECT 'oops!'`; CREATE TABLE t1 (a INT PRIMARY KEY) engine=MyISAM +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `db1``; SELECT 'oops!'`; INSERT INTO t1 VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `db1``; SELECT 'oops!'`; INSERT INTO t1 VALUES (2) +master-bin.000001 # Query # # COMMIT +DROP TABLE t1; +use test; +***Test LOAD DATA INFILE with various identifiers that need correct quoting *** +use `db1``; SELECT 'oops!'`; +set timestamp=1000000000; +CREATE TABLE `t``1` (`a``1` VARCHAR(4) PRIMARY KEY, `b``2` VARCHAR(3), +`c``3` VARCHAR(7)); +LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/f''le.txt' INTO TABLE `t``1` + FIELDS TERMINATED BY ',' ESCAPED BY '\\' ENCLOSED BY '''' + LINES TERMINATED BY '\n' + (`a``1`, @`b```) SET `b``2` = @`b```, `c``3` = concat('|', "b""a'z", "!"); +SELECT * FROM `t``1`; +a`1 b`2 c`3 +fo\o bar |b"a'z! +truncate `t``1`; +use test; +LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/f''le.txt' + INTO TABLE `db1``; SELECT 'oops!'`.`t``1` + FIELDS TERMINATED BY ',' ESCAPED BY '\\' ENCLOSED BY '''' + LINES TERMINATED BY '\n' + (`a``1`, `b``2`) SET `c``3` = concat('|', "b""a'z", "!"); +SELECT * FROM `db1``; SELECT 'oops!'`.`t``1`; +a`1 b`2 c`3 +fo\o bar |b"a'z! +show binlog events from <binlog_start>; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `db1``; SELECT 'oops!'`; CREATE TABLE `t``1` (`a``1` VARCHAR(4) PRIMARY KEY, `b``2` VARCHAR(3), +`c``3` VARCHAR(7)) +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=# +master-bin.000001 # Execute_load_query # # use `db1``; SELECT 'oops!'`; LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/f\'le.txt' INTO TABLE `t``1` FIELDS TERMINATED BY ',' ENCLOSED BY '\'' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a``1`, @`b```) SET `b``2`= @`b```, `c``3`= concat('|', "b""a'z", "!") ;file_id=# +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # use `db1``; SELECT 'oops!'`; truncate `t``1` +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=# +master-bin.000001 # Execute_load_query # # use `test`; LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/f\'le.txt' INTO TABLE `db1``; SELECT 'oops!'`.`t``1` FIELDS TERMINATED BY ',' ENCLOSED BY '\'' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a``1`, `b``2`) SET `c``3`= concat('|', "b""a'z", "!") ;file_id=# +master-bin.000001 # Query # # COMMIT +/*!40019 SET @@session.max_insert_delayed_threads=0*/; +/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; +DELIMITER /*!*/; +ROLLBACK/*!*/; +use `db1``; SELECT 'oops!'`/*!*/; +SET TIMESTAMP=1000000000/*!*/; +SET @@session.pseudo_thread_id=999999999/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.sql_mode=0/*!*/; +SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; +/*!\C latin1 *//*!*/; +SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; +SET @@session.lc_time_names=0/*!*/; +SET @@session.collation_database=DEFAULT/*!*/; +CREATE TABLE `t``1` (`a``1` VARCHAR(4) PRIMARY KEY, `b``2` VARCHAR(3), +`c``3` VARCHAR(7)) +/*!*/; +SET TIMESTAMP=1000000000/*!*/; +BEGIN +/*!*/; +SET TIMESTAMP=1000000000/*!*/; +LOAD DATA LOCAL INFILE '<name>' INTO TABLE `t``1` FIELDS TERMINATED BY ',' ENCLOSED BY '\'' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a``1`, @`b```) SET `b``2`= @`b```, `c``3`= concat('|', "b""a'z", "!") +/*!*/; +SET TIMESTAMP=1000000000/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1000000000/*!*/; +truncate `t``1` +/*!*/; +SET TIMESTAMP=1000000000/*!*/; +BEGIN +/*!*/; +use `test`/*!*/; +SET TIMESTAMP=1000000000/*!*/; +LOAD DATA LOCAL INFILE '<name>' INTO TABLE `db1``; SELECT 'oops!'`.`t``1` FIELDS TERMINATED BY ',' ENCLOSED BY '\'' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a``1`, `b``2`) SET `c``3`= concat('|', "b""a'z", "!") +/*!*/; +SET TIMESTAMP=1000000000/*!*/; +COMMIT +/*!*/; +DELIMITER ; +# End of log file +ROLLBACK /* added by mysqlbinlog */; +/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +SELECT * FROM `db1``; SELECT 'oops!'`.`t``1`; +a`1 b`2 c`3 +fo\o bar |b"a'z! +DROP TABLE `db1``; SELECT 'oops!'`.`t``1`; +drop table t1,t2; +*** Test truncation of long SET expression in LOAD DATA *** +CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(1000)); +LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/file.txt' INTO TABLE t1 +FIELDS TERMINATED BY ',' + (a, @b) SET b = CONCAT(@b, '| 123456789A123456789B123456789C123456789D123456789E123456789F123456789G123456789H123456789I123456789J123456789K123456789L123456789M123456789N123456789O123456789P123456789Q123456789R123456789123456789T123456789U123456789V123456789W123456789X123456789Y123456789Z123456789|', @b); +SELECT * FROM t1 ORDER BY a; +a b +1 X| 123456789A123456789B123456789C123456789D123456789E123456789F123456789G123456789H123456789I123456789J123456789K123456789L123456789M123456789N123456789O123456789P123456789Q123456789R123456789123456789T123456789U123456789V123456789W123456789X123456789Y123456789Z123456789|X +2 A| 123456789A123456789B123456789C123456789D123456789E123456789F123456789G123456789H123456789I123456789J123456789K123456789L123456789M123456789N123456789O123456789P123456789Q123456789R123456789123456789T123456789U123456789V123456789W123456789X123456789Y123456789Z123456789|A +show binlog events from <binlog_start>; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=# +master-bin.000001 # Execute_load_query # # use `test`; LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/file.txt' INTO TABLE `t1` FIELDS TERMINATED BY ',' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a`, @`b`) SET `b`= CONCAT(@b, '| 123456789A123456789B123456789C123456789D123456789E123456789F123456789G123456789H123456789I123456789J123456789K123456789L123456789M123456789N123456789O123456789P123456789Q123456789R123456789123456789T123456789U123456789V123456789W123456789X123456789Y123456789Z123456789|', @b) ;file_id=# +master-bin.000001 # Query # # COMMIT +SELECT * FROM t1 ORDER BY a; +a b +1 X| 123456789A123456789B123456789C123456789D123456789E123456789F123456789G123456789H123456789I123456789J123456789K123456789L123456789M123456789N123456789O123456789P123456789Q123456789R123456789123456789T123456789U123456789V123456789W123456789X123456789Y123456789Z123456789|X +2 A| 123456789A123456789B123456789C123456789D123456789E123456789F123456789G123456789H123456789I123456789J123456789K123456789L123456789M123456789N123456789O123456789P123456789Q123456789R123456789123456789T123456789U123456789V123456789W123456789X123456789Y123456789Z123456789|A +DROP TABLE t1; +*** Test user variables whose names require correct quoting *** +use `db1``; SELECT 'oops!'`; +CREATE TABLE t1 (a1 BIGINT PRIMARY KEY, a2 BIGINT, a3 BIGINT, a4 BIGINT UNSIGNED, b DOUBLE, c DECIMAL(65,10), d VARCHAR(100)); +INSERT INTO t1 VALUES (-9223372036854775808,42,9223372036854775807,18446744073709551615,-1234560123456789e110, -1234501234567890123456789012345678901234567890123456789.0123456789, REPEAT("x", 100)); +SELECT @`a``1`:=a1, @`a``2`:=a2, @`a``3`:=a3, @`a``4`:=a4, @`b```:=b, @```c`:=c, @```d```:=d FROM t1; +@`a``1`:=a1 @`a``2`:=a2 @`a``3`:=a3 @`a``4`:=a4 @`b```:=b @```c`:=c @```d```:=d +-9223372036854775808 42 9223372036854775807 18446744073709551615 -1.234560123456789e125 -1234501234567890123456789012345678901234567890123456789.0123456789 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +INSERT INTO t1 VALUES (@`a``1`+1, @`a``2`*100, @`a``3`-1, @`a``4`-1, @`b```/2, @```c`, substr(@```d```, 2, 98)); +show binlog events from <binlog_start>; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `db1``; SELECT 'oops!'`; CREATE TABLE t1 (a1 BIGINT PRIMARY KEY, a2 BIGINT, a3 BIGINT, a4 BIGINT UNSIGNED, b DOUBLE, c DECIMAL(65,10), d VARCHAR(100)) +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `db1``; SELECT 'oops!'`; INSERT INTO t1 VALUES (-9223372036854775808,42,9223372036854775807,18446744073709551615,-1234560123456789e110, -1234501234567890123456789012345678901234567890123456789.0123456789, REPEAT("x", 100)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # User var # # @`a``1`=-9223372036854775808 +master-bin.000001 # User var # # @`a``2`=42 +master-bin.000001 # User var # # @`a``3`=9223372036854775807 +master-bin.000001 # User var # # @`a``4`=18446744073709551615 +master-bin.000001 # User var # # @`b```=-1.234560123456789e125 +master-bin.000001 # User var # # @```c`=-1234501234567890123456789012345678901234567890123456789.0123456789 +master-bin.000001 # User var # # @```d```=_latin1 0x78787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878 COLLATE latin1_swedish_ci +master-bin.000001 # Query # # use `db1``; SELECT 'oops!'`; INSERT INTO t1 VALUES (@`a``1`+1, @`a``2`*100, @`a``3`-1, @`a``4`-1, @`b```/2, @```c`, substr(@```d```, 2, 98)) +master-bin.000001 # Query # # COMMIT +/*!40019 SET @@session.max_insert_delayed_threads=0*/; +/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; +DELIMITER /*!*/; +ROLLBACK/*!*/; +use `db1``; SELECT 'oops!'`/*!*/; +SET TIMESTAMP=1000000000/*!*/; +SET @@session.pseudo_thread_id=999999999/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.sql_mode=0/*!*/; +SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; +/*!\C latin1 *//*!*/; +SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; +SET @@session.lc_time_names=0/*!*/; +SET @@session.collation_database=DEFAULT/*!*/; +CREATE TABLE t1 (a1 BIGINT PRIMARY KEY, a2 BIGINT, a3 BIGINT, a4 BIGINT UNSIGNED, b DOUBLE, c DECIMAL(65,10), d VARCHAR(100)) +/*!*/; +SET TIMESTAMP=1000000000/*!*/; +BEGIN +/*!*/; +SET TIMESTAMP=1000000000/*!*/; +INSERT INTO t1 VALUES (-9223372036854775808,42,9223372036854775807,18446744073709551615,-1234560123456789e110, -1234501234567890123456789012345678901234567890123456789.0123456789, REPEAT("x", 100)) +/*!*/; +SET TIMESTAMP=1000000000/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1000000000/*!*/; +BEGIN +/*!*/; +SET @`a``1`:=-9223372036854775808/*!*/; +SET @`a``2`:=42/*!*/; +SET @`a``3`:=9223372036854775807/*!*/; +SET @`a``4`:=18446744073709551615/*!*/; +SET @`b```:=-1.2345601234568e+125/*!*/; +SET @```c`:=-1234501234567890123456789012345678901234567890123456789.0123456789/*!*/; +SET @```d```:=_latin1 0x78787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878 COLLATE `latin1_swedish_ci`/*!*/; +SET TIMESTAMP=1000000000/*!*/; +INSERT INTO t1 VALUES (@`a``1`+1, @`a``2`*100, @`a``3`-1, @`a``4`-1, @`b```/2, @```c`, substr(@```d```, 2, 98)) +/*!*/; +SET TIMESTAMP=1000000000/*!*/; +COMMIT +/*!*/; +DELIMITER ; +# End of log file +ROLLBACK /* added by mysqlbinlog */; +/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +SELECT * FROM `db1``; SELECT 'oops!'`.t1 ORDER BY a1; +a1 a2 a3 a4 b c d +-9223372036854775808 42 9223372036854775807 18446744073709551615 -1.234560123456789e125 -1234501234567890123456789012345678901234567890123456789.0123456789 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +-9223372036854775807 4200 9223372036854775806 18446744073709551614 -6.172800617283945e124 -1234501234567890123456789012345678901234567890123456789.0123456789 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +DROP TABLE t1; +*** Test correct quoting in foreign key error message *** +use `db1``; SELECT 'oops!'`; +CREATE TABLE `t``1` ( `a``` INT PRIMARY KEY) ENGINE=innodb; +CREATE TABLE `t``2` ( `b``` INT PRIMARY KEY, `c``` INT NOT NULL, +FOREIGN KEY fk (`c```) REFERENCES `t``1`(`a```)) ENGINE=innodb; +TRUNCATE `t``1`; +ERROR 42000: Cannot truncate a table referenced in a foreign key constraint (`db1``; SELECT 'oops!'`.`t``2`, CONSTRAINT `INNODB_FOREIGN_KEY_NAME` FOREIGN KEY (`c```) REFERENCES `db1``; SELECT 'oops!'`.`t``1` (`a```)) +DROP TABLE `t``2`; +DROP TABLE `t``1`; +*** Test correct quoting of DELETE FROM statement binlogged for HEAP table that is emptied due to server restart +include/stop_slave.inc +CREATE TABLE `db1``; SELECT 'oops!'`.`t``1` (`a``` INT PRIMARY KEY) ENGINE=heap; +INSERT INTO `db1``; SELECT 'oops!'`.`t``1` VALUES (1), (2), (5); +SELECT * FROM `db1``; SELECT 'oops!'`.`t``1` ORDER BY 1; +a` +1 +2 +5 +set timestamp=1000000000; +# The table should be empty on the master. +SELECT * FROM `db1``; SELECT 'oops!'`.`t``1`; +a` +# The DELETE statement should be correctly quoted +show binlog events in 'master-bin.000002' from <binlog_start>; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000002 # Query # # BEGIN +master-bin.000002 # Query # # use `test`; DELETE FROM `db1``; SELECT 'oops!'`.`t``1` +master-bin.000002 # Query # # COMMIT +include/start_slave.inc +# The table should be empty on the slave also. +SELECT * FROM `db1``; SELECT 'oops!'`.`t``1`; +a` +DROP TABLE `db1``; SELECT 'oops!'`.`t``1`; +use test; +DROP DATABASE `db1``; SELECT 'oops!'`; +*** Test correct quoting of mysqlbinlog --rewrite-db option *** +CREATE TABLE t1 (a INT PRIMARY KEY); +INSERT INTO t1 VALUES(1); +show binlog events in 'master-bin.000002' from <binlog_start>; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000002 # Query # # BEGIN +master-bin.000002 # Query # # use `test`; INSERT INTO t1 VALUES(1) +master-bin.000002 # Query # # COMMIT +/*!40019 SET @@session.max_insert_delayed_threads=0*/; +/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; +DELIMITER /*!*/; +ROLLBACK/*!*/; +SET TIMESTAMP=1000000000/*!*/; +SET @@session.pseudo_thread_id=999999999/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; +SET @@session.sql_mode=0/*!*/; +SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; +/*!\C latin1 *//*!*/; +SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; +SET @@session.lc_time_names=0/*!*/; +SET @@session.collation_database=DEFAULT/*!*/; +BEGIN +/*!*/; +use `ts``et`/*!*/; +SET TIMESTAMP=1000000000/*!*/; +INSERT INTO t1 VALUES(1) +/*!*/; +SET TIMESTAMP=1000000000/*!*/; +COMMIT +/*!*/; +DELIMITER ; +# End of log file +ROLLBACK /* added by mysqlbinlog */; +/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +DROP TABLE t1; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_packet.result b/mysql-test/suite/rpl/r/rpl_packet.result index 4d5ffae2d63..65fd2800e7d 100644 --- a/mysql-test/suite/rpl/r/rpl_packet.result +++ b/mysql-test/suite/rpl/r/rpl_packet.result @@ -1,7 +1,7 @@ include/master-slave.inc [connection master] -call mtr.add_suppression("Slave I/O: Got a packet bigger than 'max_allowed_packet' bytes, Error_code: 1153"); -call mtr.add_suppression("Slave I/O: Got fatal error 1236 from master when reading data from binary log:"); +call mtr.add_suppression("Slave I/O: Got a packet bigger than 'slave_max_allowed_packet' bytes, Error_code: 1153"); +call mtr.add_suppression("Log entry on master is longer than slave_max_allowed_packet"); drop database if exists DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________; create database DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________; SET @@global.max_allowed_packet=1024; @@ -30,14 +30,14 @@ include/start_slave.inc CREATE TABLE `t1` (`f1` LONGTEXT) ENGINE=MyISAM; INSERT INTO `t1`(`f1`) VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa2048'); include/wait_for_slave_io_error.inc [errno=1153] -Last_IO_Error = 'Got a packet bigger than 'max_allowed_packet' bytes' +Last_IO_Error = 'Got a packet bigger than 'slave_max_allowed_packet' bytes' include/stop_slave_sql.inc include/rpl_reset.inc DROP TABLE t1; CREATE TABLE t1 (f1 int PRIMARY KEY, f2 LONGTEXT, f3 LONGTEXT) ENGINE=MyISAM; INSERT INTO t1(f1, f2, f3) VALUES(1, REPEAT('a', @@global.max_allowed_packet), REPEAT('b', @@global.max_allowed_packet)); -include/wait_for_slave_io_error.inc [errno=1236] -Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'log event entry exceeded max_allowed_packet; Increase max_allowed_packet on master; the first event '.' at XXX, the last event read from 'master-bin.000001' at XXX, the last byte read from 'master-bin.000001' at XXX.'' +include/wait_for_slave_io_error.inc [errno=1153] +Last_IO_Error = 'Got a packet bigger than 'slave_max_allowed_packet' bytes' STOP SLAVE; RESET SLAVE; RESET MASTER; @@ -52,6 +52,7 @@ SET @@global.max_allowed_packet= 1024; Warnings: Warning 1708 The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length' SET @@global.net_buffer_length= 1024; +SET @@global.slave_max_allowed_packet= 1073741824; DROP TABLE t1; RESET SLAVE; include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result b/mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result index 9e3577e1d5c..1a4d5c7574d 100644 --- a/mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result +++ b/mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result @@ -154,7 +154,7 @@ c1 c3 c4 c5 /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; ROLLBACK/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; @@ -176,7 +176,7 @@ ROLLBACK /* added by mysqlbinlog */; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; ROLLBACK/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; @@ -287,7 +287,7 @@ ROLLBACK /* added by mysqlbinlog */; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; ROLLBACK/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; @@ -318,7 +318,7 @@ ROLLBACK /* added by mysqlbinlog */; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; ROLLBACK/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; diff --git a/mysql-test/suite/rpl/r/rpl_sp.result b/mysql-test/suite/rpl/r/rpl_sp.result index 4b9e768861d..8a2a88a8c90 100644 --- a/mysql-test/suite/rpl/r/rpl_sp.result +++ b/mysql-test/suite/rpl/r/rpl_sp.result @@ -670,7 +670,7 @@ drop database if exists mysqltest1 SET TIMESTAMP=t/*!*/; create database mysqltest1 /*!*/; -use mysqltest1/*!*/; +use `mysqltest1`/*!*/; SET TIMESTAMP=t/*!*/; create table t1 (a varchar(100)) /*!*/; @@ -1015,7 +1015,7 @@ drop database mysqltest1 SET TIMESTAMP=t/*!*/; drop user "zedjzlcsjhd"@127.0.0.1 /*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=t/*!*/; drop function if exists f1 /*!*/; @@ -1112,7 +1112,7 @@ create database mysqltest SET TIMESTAMP=t/*!*/; create database mysqltest2 /*!*/; -use mysqltest2/*!*/; +use `mysqltest2`/*!*/; SET TIMESTAMP=t/*!*/; create table t ( t integer ) /*!*/; @@ -1139,7 +1139,7 @@ end SET TIMESTAMP=t/*!*/; BEGIN /*!*/; -use mysqltest/*!*/; +use `mysqltest`/*!*/; SET TIMESTAMP=t/*!*/; SELECT `mysqltest2`.`f1`() /*!*/; @@ -1152,14 +1152,14 @@ drop database mysqltest SET TIMESTAMP=t/*!*/; drop database mysqltest2 /*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=t/*!*/; CREATE DEFINER=`root`@`localhost` PROCEDURE `mysqltestbug36570_p1`() begin select 1; end /*!*/; -use mysql/*!*/; +use `mysql`/*!*/; SET TIMESTAMP=t/*!*/; CREATE DEFINER=`root`@`localhost` PROCEDURE `test`.` mysqltestbug36570_p2`( a int) `label`: diff --git a/mysql-test/suite/rpl/r/rpl_start_slave_deadlock_sys_vars.result b/mysql-test/suite/rpl/r/rpl_start_slave_deadlock_sys_vars.result new file mode 100644 index 00000000000..f69a323f980 --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_start_slave_deadlock_sys_vars.result @@ -0,0 +1,31 @@ +include/master-slave.inc +[connection master] +# connection: slave +SET @save_slave_net_timeout = @@GLOBAL.slave_net_timeout; +STOP SLAVE; +include/wait_for_slave_to_stop.inc +# open an extra connection to the slave +# connection: slave2 +# set debug synchronization point +SET DEBUG_SYNC='fix_slave_net_timeout SIGNAL parked WAIT_FOR go'; +# attempt to set slave_net_timeout, will wait on sync point +SET @@GLOBAL.slave_net_timeout = 100; +# connection: slave +SET DEBUG_SYNC='now WAIT_FOR parked'; +# connection: slave1 +# attempt to start the SQL thread +START SLAVE SQL_THREAD; +# connection: slave +# wait until SQL thread has been started +# sleep a bit so that the SQL thread THD handle is initialized +# signal the set slave_net_timeout to continue +SET DEBUG_SYNC='now SIGNAL go'; +# connection: slave2 +# reap result of set slave_net_timeout +# connection: slave1 +# reap result of starting the SQL thread +# disconnect: slave2 +# connection: slave +# cleanup +SET @@GLOBAL.slave_net_timeout = @save_slave_net_timeout; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_trigger.result b/mysql-test/suite/rpl/r/rpl_trigger.result index 784cd1bcdff..ac6d9155f4b 100644 --- a/mysql-test/suite/rpl/r/rpl_trigger.result +++ b/mysql-test/suite/rpl/r/rpl_trigger.result @@ -4,7 +4,7 @@ DROP TABLE IF EXISTS t1; DROP TABLE IF EXISTS t2; DROP TABLE IF EXISTS t3; create table t1 (a int auto_increment, primary key (a), b int, rand_value double not null); -create table t2 (a int auto_increment, primary key (a), b int); +create table t2 (a int auto_increment, primary key (a), b int) engine=innodb; create table t3 (a int auto_increment, primary key (a), name varchar(64) not null, old_a int, old_b int, rand_value double not null); create trigger t1 before insert on t1 for each row begin @@ -29,7 +29,7 @@ a b 1 2 3 0 4 0 -5 0 +6 0 500 0 select a,name, old_a, old_b, truncate(rand_value,4) from t3; a name old_a old_b truncate(rand_value,4) @@ -39,7 +39,7 @@ a name old_a old_b truncate(rand_value,4) 103 t2 1 2 0.9164 104 t2 3 0 0.8826 105 t2 4 0 0.6635 -106 t2 5 0 0.6699 +106 t2 6 0 0.6699 107 t2 500 0 0.3593 --- On slave -- @@ -52,7 +52,7 @@ a b 1 2 3 0 4 0 -5 0 +6 0 500 0 select a,name, old_a, old_b, truncate(rand_value,4) from t3; a name old_a old_b truncate(rand_value,4) @@ -62,7 +62,7 @@ a name old_a old_b truncate(rand_value,4) 103 t2 1 2 0.9164 104 t2 3 0 0.8826 105 t2 4 0 0.6635 -106 t2 5 0 0.6699 +106 t2 6 0 0.6699 107 t2 500 0 0.3593 drop table t1,t2,t3; select get_lock("bug12480",2); diff --git a/mysql-test/suite/rpl/t/rpl_filter_tables_not_exist.test b/mysql-test/suite/rpl/t/rpl_filter_tables_not_exist.test index b62a6e96437..3572dd53ea7 100644 --- a/mysql-test/suite/rpl/t/rpl_filter_tables_not_exist.test +++ b/mysql-test/suite/rpl/t/rpl_filter_tables_not_exist.test @@ -215,21 +215,23 @@ drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; # be filtered as well. # connection master; -CREATE TABLE test.t5 (a INT AUTO_INCREMENT PRIMARY KEY, b INT, c INT); # ignored on slave +# Although RAND() is from 0 to 1.0, DECIMAL(M,D), requires that M must be >= D. +CREATE TABLE test.t5 (a INT AUTO_INCREMENT PRIMARY KEY, b DECIMAL(20,20), c INT); # ignored on slave CREATE TABLE test.t1 (a INT); # accepted on slave INSERT INTO test.t1 VALUES(1); --sync_slave_with_master call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); -CREATE TABLE test.t_slave (a INT AUTO_INCREMENT PRIMARY KEY, b INT, c INT); +# Although RAND() is from 0 to 1.0, DECIMAL(M,D), requires that M must be >= D. +CREATE TABLE test.t_slave (a INT AUTO_INCREMENT PRIMARY KEY, b DECIMAL(20,20), c INT); CREATE TRIGGER t1_update AFTER UPDATE ON test.t1 FOR EACH ROW - INSERT INTO test.t_slave VALUES(NULL, ROUND(RAND() * 1000), @c); + INSERT INTO test.t_slave VALUES(NULL, RAND(), @c); connection master; SET INSERT_ID=2; SET @c=2; SET @@rand_seed1=10000000, @@rand_seed2=1000000; -INSERT INTO t5 VALUES (NULL, ROUND(RAND() * 1000), @c); # to be ignored +INSERT INTO t5 VALUES (NULL, RAND(), @c); # to be ignored SELECT b into @b FROM test.t5; --let $b_master=`select @b` UPDATE test.t1 SET a=2; # to run trigger on slave @@ -253,10 +255,9 @@ if (`SELECT @a != 2 and @c != NULL`) SELECT b into @b FROM test.t_slave; --let $b_slave=`select @b` -if (`SELECT $b_slave = $b_master`) -{ - --echo Might be pure coincidence of two randoms from master and slave table. Don not panic yet. -} +--let $assert_text= Random values from master and slave must be different +--let $assert_cond= $b_master != $b_slave +--source include/assert.inc # cleanup BUG#11754117 connection master; diff --git a/mysql-test/suite/rpl/t/rpl_mdev382.test b/mysql-test/suite/rpl/t/rpl_mdev382.test new file mode 100644 index 00000000000..e84a29137bc --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_mdev382.test @@ -0,0 +1,265 @@ +--source include/have_innodb.inc +--source include/have_binlog_format_statement.inc +--source include/master-slave.inc + +# MDEV-382: multiple SQL injections in replication code. + +# Test previous SQL injection attack against binlog for SAVEPOINT statement. +# The test would cause syntax error on slave due to improper quoting of +# the savepoint name. +connection master; +create table t1 (a int primary key) engine=innodb; +create table t2 (a int primary key) engine=myisam; + +begin; +insert into t1 values (1); +SET sql_mode = 'ANSI_QUOTES'; +savepoint `a``; create database couldbebadthingshere; savepoint ``dummy`; +insert into t1 values (2); +insert into t2 values (1); +SET sql_mode = ''; +rollback to savepoint `a``; create database couldbebadthingshere; savepoint ``dummy`; +insert into t1 values (3); +commit; + +--source include/show_binlog_events.inc + +# This failed due to syntax error in query when the bug was not fixed. +sync_slave_with_master; +connection slave; + +# Test some more combinations of ANSI_QUOTES and sql_quote_show_create +connection master; +let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1); +BEGIN; +insert into t1 values(10); +set sql_mode = 'ANSI_QUOTES'; +set sql_quote_show_create = 1; +savepoint a; +insert into t1 values(11); +savepoint "a""a"; +insert into t1 values(12); +set sql_quote_show_create = 0; +savepoint b; +insert into t1 values(13); +savepoint "b""b"; +insert into t1 values(14); +set sql_mode = ''; +set sql_quote_show_create = 1; +savepoint c; +insert into t1 values(15); +savepoint `c``c`; +insert into t1 values(16); +set sql_quote_show_create = 0; +savepoint d; +insert into t1 values(17); +savepoint `d``d`; +insert into t1 values(18); +COMMIT; +set sql_quote_show_create = 1; + +--source include/show_binlog_events.inc + +--echo *** Test correct USE statement in SHOW BINLOG EVENTS *** +connection master; +let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1); +set sql_mode = 'ANSI_QUOTES'; +CREATE DATABASE "db1`; SELECT 'oops!'"; +use "db1`; SELECT 'oops!'"; +CREATE TABLE t1 (a INT PRIMARY KEY) engine=MyISAM; +INSERT INTO t1 VALUES (1); +set sql_mode = ''; +INSERT INTO t1 VALUES (2); +set sql_mode = 'ANSI_QUOTES'; +--source include/show_binlog_events.inc +set sql_mode = ''; +set sql_quote_show_create = 0; +--source include/show_binlog_events.inc +set sql_quote_show_create = 1; +--source include/show_binlog_events.inc +DROP TABLE t1; + +use test; + +--echo ***Test LOAD DATA INFILE with various identifiers that need correct quoting *** + +--let $load_file= $MYSQLTEST_VARDIR/tmp/f'le.txt +--write_file $load_file +'fo\\o','bar' +EOF + +use `db1``; SELECT 'oops!'`; +let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1); +set timestamp=1000000000; +CREATE TABLE `t``1` (`a``1` VARCHAR(4) PRIMARY KEY, `b``2` VARCHAR(3), + `c``3` VARCHAR(7)); +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/tmp/f''le.txt' INTO TABLE `t``1` + FIELDS TERMINATED BY ',' ESCAPED BY '\\\\' ENCLOSED BY '''' + LINES TERMINATED BY '\\n' + (`a``1`, @`b```) SET `b``2` = @`b```, `c``3` = concat('|', "b""a'z", "!"); + +SELECT * FROM `t``1`; +# Also test when code prefixes table name with database. +truncate `t``1`; +use test; +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/tmp/f''le.txt' + INTO TABLE `db1``; SELECT 'oops!'`.`t``1` + FIELDS TERMINATED BY ',' ESCAPED BY '\\\\' ENCLOSED BY '''' + LINES TERMINATED BY '\\n' + (`a``1`, `b``2`) SET `c``3` = concat('|', "b""a'z", "!"); +SELECT * FROM `db1``; SELECT 'oops!'`.`t``1`; +let $pos2= query_get_value(SHOW MASTER STATUS, Position, 1); + +--source include/show_binlog_events.inc +let $MYSQLD_DATADIR= `select @@datadir`; +--replace_regex /LOCAL INFILE '.*SQL_LOAD.*' INTO/LOCAL INFILE '<name>' INTO/ +--exec $MYSQL_BINLOG --short-form --start-position=$binlog_start --stop-position=$pos2 $MYSQLD_DATADIR/master-bin.000001 + +sync_slave_with_master; +connection slave; +SELECT * FROM `db1``; SELECT 'oops!'`.`t``1`; +connection master; + +DROP TABLE `db1``; SELECT 'oops!'`.`t``1`; +--remove_file $load_file + +connection master; +drop table t1,t2; + + +--echo *** Test truncation of long SET expression in LOAD DATA *** +CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(1000)); +--let $load_file= $MYSQLTEST_VARDIR/tmp/file.txt +--write_file $load_file +1,X +2,A +EOF + +let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1); +# The bug was that the SET expression was truncated to 256 bytes, so test with +# an expression longer than that. +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +eval LOAD DATA INFILE '$load_file' INTO TABLE t1 + FIELDS TERMINATED BY ',' + (a, @b) SET b = CONCAT(@b, '| 123456789A123456789B123456789C123456789D123456789E123456789F123456789G123456789H123456789I123456789J123456789K123456789L123456789M123456789N123456789O123456789P123456789Q123456789R123456789123456789T123456789U123456789V123456789W123456789X123456789Y123456789Z123456789|', @b); + +SELECT * FROM t1 ORDER BY a; +--source include/show_binlog_events.inc + +sync_slave_with_master; +connection slave; +SELECT * FROM t1 ORDER BY a; + +connection master; +--remove_file $load_file +DROP TABLE t1; + + +--echo *** Test user variables whose names require correct quoting *** +use `db1``; SELECT 'oops!'`; +let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1); +CREATE TABLE t1 (a1 BIGINT PRIMARY KEY, a2 BIGINT, a3 BIGINT, a4 BIGINT UNSIGNED, b DOUBLE, c DECIMAL(65,10), d VARCHAR(100)); +INSERT INTO t1 VALUES (-9223372036854775808,42,9223372036854775807,18446744073709551615,-1234560123456789e110, -1234501234567890123456789012345678901234567890123456789.0123456789, REPEAT("x", 100)); +SELECT @`a``1`:=a1, @`a``2`:=a2, @`a``3`:=a3, @`a``4`:=a4, @`b```:=b, @```c`:=c, @```d```:=d FROM t1; +INSERT INTO t1 VALUES (@`a``1`+1, @`a``2`*100, @`a``3`-1, @`a``4`-1, @`b```/2, @```c`, substr(@```d```, 2, 98)); +let $pos2= query_get_value(SHOW MASTER STATUS, Position, 1); + +--source include/show_binlog_events.inc + +--exec $MYSQL_BINLOG --short-form --start-position=$binlog_start --stop-position=$pos2 $MYSQLD_DATADIR/master-bin.000001 + +sync_slave_with_master; +connection slave; +SELECT * FROM `db1``; SELECT 'oops!'`.t1 ORDER BY a1; + +connection master; +DROP TABLE t1; + +--echo *** Test correct quoting in foreign key error message *** +use `db1``; SELECT 'oops!'`; +CREATE TABLE `t``1` ( `a``` INT PRIMARY KEY) ENGINE=innodb; +CREATE TABLE `t``2` ( `b``` INT PRIMARY KEY, `c``` INT NOT NULL, + FOREIGN KEY fk (`c```) REFERENCES `t``1`(`a```)) ENGINE=innodb; +--replace_regex /t@[0-9]+_ibfk_[0-9]+/INNODB_FOREIGN_KEY_NAME/ +--error ER_TRUNCATE_ILLEGAL_FK +TRUNCATE `t``1`; +DROP TABLE `t``2`; +DROP TABLE `t``1`; + + +--echo *** Test correct quoting of DELETE FROM statement binlogged for HEAP table that is emptied due to server restart + +# Let's keep the slave stopped during master restart, to avoid any potential +# races between slave reconnect and master restart. +connection slave; +--source include/stop_slave.inc + +connection master; +CREATE TABLE `db1``; SELECT 'oops!'`.`t``1` (`a``` INT PRIMARY KEY) ENGINE=heap; +INSERT INTO `db1``; SELECT 'oops!'`.`t``1` VALUES (1), (2), (5); +SELECT * FROM `db1``; SELECT 'oops!'`.`t``1` ORDER BY 1; + +# Restart the master mysqld. +# This will cause an implicit truncation of the memory-based table, which will +# cause logging of an explicit DELETE FROM to binlog. +--write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +wait-rpl_mdev382.test +EOF + +--shutdown_server 30 + +--remove_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +--write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +restart-rpl_mdev382.test +EOF + +connection default; +--enable_reconnect +--source include/wait_until_connected_again.inc +# rpl_end.inc needs to use the connection server_1 +connection server_1; +--enable_reconnect +--source include/wait_until_connected_again.inc +connection master; +--enable_reconnect +--source include/wait_until_connected_again.inc +set timestamp=1000000000; + +--echo # The table should be empty on the master. +let $binlog_file= master-bin.000002; +let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1); +SELECT * FROM `db1``; SELECT 'oops!'`.`t``1`; + +--echo # The DELETE statement should be correctly quoted +--source include/show_binlog_events.inc + +connection slave; +--source include/start_slave.inc + +connection master; +sync_slave_with_master; +connection slave; +--echo # The table should be empty on the slave also. +SELECT * FROM `db1``; SELECT 'oops!'`.`t``1`; + +connection master; +DROP TABLE `db1``; SELECT 'oops!'`.`t``1`; +sync_slave_with_master; + + +connection master; +use test; +DROP DATABASE `db1``; SELECT 'oops!'`; + +--echo *** Test correct quoting of mysqlbinlog --rewrite-db option *** +CREATE TABLE t1 (a INT PRIMARY KEY); +let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1); +INSERT INTO t1 VALUES(1); +--source include/show_binlog_events.inc +let $pos2= query_get_value(SHOW MASTER STATUS, Position, 1); +--exec $MYSQL_BINLOG --short-form --start-position=$binlog_start --stop-position=$pos2 --rewrite-db='test->ts`et' $MYSQLD_DATADIR/master-bin.000002 +DROP TABLE t1; + +--source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_packet-slave.opt b/mysql-test/suite/rpl/t/rpl_packet-slave.opt index 412bc079caa..1aed7d07572 100644 --- a/mysql-test/suite/rpl/t/rpl_packet-slave.opt +++ b/mysql-test/suite/rpl/t/rpl_packet-slave.opt @@ -1 +1 @@ ---max_allowed_packet=1024 --net_buffer_length=1024 +--max_allowed_packet=1024 --net_buffer_length=1024 --slave_max_allowed_packet=1024 diff --git a/mysql-test/suite/rpl/t/rpl_packet.test b/mysql-test/suite/rpl/t/rpl_packet.test index 4f296fed68e..c49d9490bd9 100644 --- a/mysql-test/suite/rpl/t/rpl_packet.test +++ b/mysql-test/suite/rpl/t/rpl_packet.test @@ -11,9 +11,8 @@ # max-out size db name source include/master-slave.inc; source include/have_binlog_format_row.inc; -call mtr.add_suppression("Slave I/O: Got a packet bigger than 'max_allowed_packet' bytes, Error_code: 1153"); -call mtr.add_suppression("Slave I/O: Got fatal error 1236 from master when reading data from binary log:"); - +call mtr.add_suppression("Slave I/O: Got a packet bigger than 'slave_max_allowed_packet' bytes, Error_code: 1153"); +call mtr.add_suppression("Log entry on master is longer than slave_max_allowed_packet"); let $db= DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________; disable_warnings; eval drop database if exists $db; @@ -23,6 +22,7 @@ eval create database $db; connection master; let $old_max_allowed_packet= `SELECT @@global.max_allowed_packet`; let $old_net_buffer_length= `SELECT @@global.net_buffer_length`; +let $old_slave_max_allowed_packet= `SELECT @@global.slave_max_allowed_packet`; SET @@global.max_allowed_packet=1024; SET @@global.net_buffer_length=1024; @@ -123,11 +123,9 @@ INSERT INTO t1(f1, f2, f3) VALUES(1, REPEAT('a', @@global.max_allowed_packet), R connection slave; # The slave I/O thread must stop after receiving -# 1236=ER_MASTER_FATAL_ERROR_READING_BINLOG error message from master. ---let $slave_io_errno= 1236 - -# Mask line numbers ---let $slave_io_error_replace= / at [0-9]*/ at XXX/ +# 1153 = ER_NET_PACKET_TOO_LARGE +--let $slave_io_errno= 1153 +--let $show_slave_io_error= 1 --source include/wait_for_slave_io_error.inc # Remove the bad binlog and clear error status on slave. @@ -167,6 +165,7 @@ connection master; DROP TABLE t1; eval SET @@global.max_allowed_packet= $old_max_allowed_packet; eval SET @@global.net_buffer_length= $old_net_buffer_length; +eval SET @@global.slave_max_allowed_packet= $old_slave_max_allowed_packet; # slave is stopped connection slave; DROP TABLE t1; diff --git a/mysql-test/suite/rpl/t/rpl_start_slave_deadlock_sys_vars.test b/mysql-test/suite/rpl/t/rpl_start_slave_deadlock_sys_vars.test new file mode 100644 index 00000000000..3eaff761108 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_start_slave_deadlock_sys_vars.test @@ -0,0 +1,57 @@ +source include/have_debug_sync.inc; +source include/master-slave.inc; + +--echo # connection: slave +connection slave; +SET @save_slave_net_timeout = @@GLOBAL.slave_net_timeout; +STOP SLAVE; +source include/wait_for_slave_to_stop.inc; + +--echo # open an extra connection to the slave +connect(slave2,127.0.0.1,root,,test,$SLAVE_MYPORT,); +--echo # connection: slave2 +--echo # set debug synchronization point +SET DEBUG_SYNC='fix_slave_net_timeout SIGNAL parked WAIT_FOR go'; +--echo # attempt to set slave_net_timeout, will wait on sync point +--send SET @@GLOBAL.slave_net_timeout = 100 + +--echo # connection: slave +connection slave; +SET DEBUG_SYNC='now WAIT_FOR parked'; + +--echo # connection: slave1 +connection slave1; +--echo # attempt to start the SQL thread +--send START SLAVE SQL_THREAD + +--echo # connection: slave +connection slave; +--echo # wait until SQL thread has been started +let $wait_condition= + select count(*) = 1 from information_schema.processlist + where state = "Waiting for slave thread to start" and info = "START SLAVE SQL_THREAD"; +--source include/wait_condition.inc +--echo # sleep a bit so that the SQL thread THD handle is initialized +sleep 2; +--echo # signal the set slave_net_timeout to continue +SET DEBUG_SYNC='now SIGNAL go'; + +--echo # connection: slave2 +connection slave2; +--echo # reap result of set slave_net_timeout +--reap + +--echo # connection: slave1 +connection slave1; +--echo # reap result of starting the SQL thread +--reap + +--echo # disconnect: slave2 +disconnect slave2; + +--echo # connection: slave +connection slave; +--echo # cleanup +SET @@GLOBAL.slave_net_timeout = @save_slave_net_timeout; + +source include/rpl_end.inc; diff --git a/mysql-test/suite/rpl/t/rpl_trigger.test b/mysql-test/suite/rpl/t/rpl_trigger.test index e2974a21bf7..723fa3e44e2 100644 --- a/mysql-test/suite/rpl/t/rpl_trigger.test +++ b/mysql-test/suite/rpl/t/rpl_trigger.test @@ -3,13 +3,10 @@ # Adding statement include due to Bug 12574 # TODO: Remove statement include once 12574 is patched --source include/have_binlog_format_mixed_or_statement.inc ---source include/master-slave.inc ---source include/have_innodb.inc -connection slave; --source include/have_innodb.inc +--source include/master-slave.inc connection master; - disable_query_log; call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); enable_query_log; @@ -26,7 +23,7 @@ DROP TABLE IF EXISTS t3; # create table t1 (a int auto_increment, primary key (a), b int, rand_value double not null); -create table t2 (a int auto_increment, primary key (a), b int); +create table t2 (a int auto_increment, primary key (a), b int) engine=innodb; create table t3 (a int auto_increment, primary key (a), name varchar(64) not null, old_a int, old_b int, rand_value double not null); delimiter |; diff --git a/mysql-test/suite/storage_engine/1st.result b/mysql-test/suite/storage_engine/1st.result new file mode 100644 index 00000000000..6b686c2b2b4 --- /dev/null +++ b/mysql-test/suite/storage_engine/1st.result @@ -0,0 +1,11 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW CREATE TABLE t1; +SHOW COLUMNS IN t1; +INSERT INTO t1 VALUES (1,'a'); +INSERT INTO t1 (a,b) VALUES (2,'b'); +SELECT * FROM t1; +a b +1 a +2 b +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/1st.test b/mysql-test/suite/storage_engine/1st.test new file mode 100644 index 00000000000..af7a4503948 --- /dev/null +++ b/mysql-test/suite/storage_engine/1st.test @@ -0,0 +1,81 @@ +# +# This test checks some very basic capabilities +# which will be used in almost every other test, +# and will not be checked through support* variables. +# If this test does not pass, there is no point +# at executing other ones. +# +# Minimal requirements: +# - supported column types: INT, CHAR (default CHAR(8), INT(11)); +# - column attributes as declared in define_engine.inc ($default_col_opts) +# (by default empty, which means no additional attributes apart from the type); +# - table attributes as declared in define_engine.inc ($default_tbl_opts) +# (by default empty, which means no additional attributes apart from ENGINE); +# - CREATE TABLE .. (column1 <column options>, column2 <column options>) ENGINE=<storage_engine>; +# - INSERT INTO TABLE .. VALUES (val1,val2); +# - DROP TABLE .. +# - SELECT * FROM .. +# - SHOW CREATE TABLE .. +# - SHOW COLUMNS IN ... +# + +--source have_engine.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +--source create_table.inc +if ($mysql_errname) +{ + --let $functionality = CREATE TABLE + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --disable_result_log + SHOW CREATE TABLE t1; + if ($mysql_errname) + { + --let $functionality = SHOW CREATE TABLE + --source unexpected_result.inc + } + SHOW COLUMNS IN t1; + if ($mysql_errname) + { + --let $functionality = SHOW COLUMNS + --source unexpected_result.inc + } + --enable_result_log + + INSERT INTO t1 VALUES (1,'a'); + if ($mysql_errname) + { + --let $functionality = INSERT INTO .. VALUES + --source unexpected_result.inc + } + + INSERT INTO t1 (a,b) VALUES (2,'b'); + if ($mysql_errname) + { + --let $functionality = INSERT INTO .. (column_list) VALUES + --source unexpected_result.inc + } + + SELECT * FROM t1; + if ($mysql_errname) + { + --let $functionality = SELECT * FROM .. + --source unexpected_result.inc + } + + DROP TABLE t1; + if ($mysql_errname) + { + --let $functionality = DROP TABLE + --source unexpected_result.inc + } + +} +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/alter_table.inc b/mysql-test/suite/storage_engine/alter_table.inc new file mode 100644 index 00000000000..0f78c597455 --- /dev/null +++ b/mysql-test/suite/storage_engine/alter_table.inc @@ -0,0 +1,91 @@ +################################## +# +# This include file will be used for all ALTER TABLE statements in the suite. +# If you need to add additional steps or change the logic, copy the file +# to storage/<engine>/mysql-test/storage_engine/ folder and modify it there. +# +################## +# +# Parameters: +# +# --let $alter_definition = <alter definition> # mandatory, everything that goes after the table name in ALTER statement +# --let $table_name = <table name> # optional, default t1 +# --let $error_codes = <expected error codes, as in --error> # optional, default 0 +# --let $online = [0|1] # optional, default 0 (1 adds ONLINE) +# --let $rename_to = <new table name> # optional, default empty. +# # If set, means we are running RENAME TO, then alter definition is ignored +# +# Usage examples: +# +# --let $alter_definition = ADD COLUMN b $char_col DEFAULT '' +# + +if ($rename_to) +{ + --let $alter_definition = RENAME TO $rename_to +} + +if (!$alter_definition) +{ + --die # The ALTER statement is empty +} + +--let $alter_statement = ALTER + +if ($online) +{ + --let $alter_statement = $alter_statement ONLINE +} + +if (!$table_name) +{ + --let $table_name = t1 +} + +--let $alter_statement = $alter_statement TABLE $table_name $alter_definition + + +# We now have the complete ALTER statement in $alter_statement. +# If your ALTER statement should be composed differently, +# modify the logic above. + +##################### +# Here you can add logic needed BEFORE the main statement +# (e.g. base tables need to be altered, etc.). +# Surround it by --disable_query_log/--enable_query_log +# if you don't want it to appear in the result output. +##################### + +--source obfuscate.inc + +eval $alter_statement; +--source check_errors.inc + +# Make sure you don't add any statements between the main ALTER (above) +# and saving mysql_errno and mysql_errname (below) +# They are saved in case you want to add more logic after the main ALTER, +# because we need the result code of the statement. +# Also, do not change $alter_statement after it is executed! + +--let $my_errno = $mysql_errno +--let $my_errname = $mysql_errname + +##################### +# Here you can add logic needed AFTER the main statement. +# Surround it by --disable_query_log/--enable_query_log +# if you don't want it to appear in the result output. +##################### + +# Unset the parameters, we don't want them to be accidentally reused later +--let $alter_definition = +--let $table_name = +--let $error_codes = +--let $online = 0 +--let $rename_to = + +# Restore the error codes of the main statement +--let $mysql_errno = $my_errno +--let $mysql_errname = $my_errname +# Make sure you don't add any SQL statements after restoring +# mysql_errno and mysql_errname (above) + diff --git a/mysql-test/suite/storage_engine/alter_table.result b/mysql-test/suite/storage_engine/alter_table.result new file mode 100644 index 00000000000..6d868a27a36 --- /dev/null +++ b/mysql-test/suite/storage_engine/alter_table.result @@ -0,0 +1,147 @@ +DROP TABLE IF EXISTS t1, t2; +CREATE TABLE t1 (a <INT_COLUMN>, c <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,c) VALUES (1,'a'),(5,'z'); +ALTER TABLE t1 ADD COLUMN b <INT_COLUMN>; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `c` char(8) DEFAULT NULL, + `b` int(11) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +ALTER TABLE t1 ALTER COLUMN a SET DEFAULT '0'; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT '0', + `c` char(8) DEFAULT NULL, + `b` int(11) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +ALTER TABLE t1 ALTER a DROP DEFAULT; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11), + `c` char(8) DEFAULT NULL, + `b` int(11) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +ALTER TABLE t1 CHANGE COLUMN b b1 <CHAR_COLUMN> FIRST; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `b1` char(8) DEFAULT NULL, + `a` int(11), + `c` char(8) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +ALTER TABLE t1 CHANGE b1 b <INT_COLUMN> AFTER c; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11), + `c` char(8) DEFAULT NULL, + `b` int(11) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +ALTER TABLE t1 CHANGE b b <CHAR_COLUMN>; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11), + `c` char(8) DEFAULT NULL, + `b` char(8) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +ALTER TABLE t1 MODIFY COLUMN b <INT_COLUMN>; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11), + `c` char(8) DEFAULT NULL, + `b` int(11) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +ALTER TABLE t1 MODIFY COLUMN b <CHAR_COLUMN> FIRST; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `b` char(8) DEFAULT NULL, + `a` int(11), + `c` char(8) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +ALTER TABLE t1 MODIFY COLUMN b <INT_COLUMN> AFTER a; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11), + `b` int(11) DEFAULT NULL, + `c` char(8) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +ALTER TABLE t1 DROP COLUMN b; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11), + `c` char(8) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +ALTER TABLE t1 RENAME TO t2; +SHOW CREATE TABLE t1; +ERROR 42S02: Table 'test.t1' doesn't exist +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11), + `c` char(8) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +DROP TABLE t2; +CREATE TABLE t1 (a <INT_COLUMN>, b <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (1,5),(2,2),(4,3); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +ALTER TABLE t1 ORDER BY b ASC, a DESC; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +SELECT * FROM t1; +a b +2 2 +4 3 +1 5 +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>, c <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> CHARACTER SET latin1 COLLATE latin1_general_cs; +INSERT INTO t1 (a,b,c) VALUES (5,'z','t'); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` char(8) COLLATE latin1_general_cs DEFAULT NULL, + `c` char(8) COLLATE latin1_general_cs DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs +ALTER TABLE t1 CONVERT TO CHARACTER SET utf8; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` char(8) DEFAULT NULL, + `c` char(8) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=utf8 +ALTER TABLE t1 DEFAULT CHARACTER SET = latin1 COLLATE latin1_general_ci; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` char(8) CHARACTER SET utf8 DEFAULT NULL, + `c` char(8) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci +ALTER TABLE t1 FORCE; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` char(8) CHARACTER SET utf8 DEFAULT NULL, + `c` char(8) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/alter_table.test b/mysql-test/suite/storage_engine/alter_table.test new file mode 100644 index 00000000000..023d8927e16 --- /dev/null +++ b/mysql-test/suite/storage_engine/alter_table.test @@ -0,0 +1,148 @@ +# +# Basic ALTER TABLE statements. +# +# USAGE of table options in ALTER statements +# is covered in tbl_standard_opts and tbl_opt*.tests. +# +# Index operations are covered in index* tests. +# +# ALTER ONLINE syntax is covered in alter_online_table.test +# ALTER OFFLINE is not covered as it is not supported, as of 5.5.23 +# +# ALTER TABLE ... DISCARD|IMPORT TABLESPACE is covered in alter_tablespace.test +# + +--source have_engine.inc + +--disable_warnings +DROP TABLE IF EXISTS t1, t2; +--enable_warnings + +--let $create_definition = a $int_col, c $char_col +--source create_table.inc +INSERT INTO t1 (a,c) VALUES (1,'a'),(5,'z'); + +# Column operations + +--let $alter_definition = ADD COLUMN b $int_col +--source alter_table.inc +if ($mysql_errname) +{ + --source unexpected_result.inc +} + +--source mask_engine.inc +SHOW CREATE TABLE t1; + +--let $alter_definition = ALTER COLUMN a SET DEFAULT '0' +--source alter_table.inc +--source mask_engine.inc +SHOW CREATE TABLE t1; + +--let $alter_definition = ALTER a DROP DEFAULT +--source alter_table.inc +--source mask_engine.inc +SHOW CREATE TABLE t1; + +--let $alter_definition = CHANGE COLUMN b b1 $char_col FIRST +--source alter_table.inc +--source mask_engine.inc +SHOW CREATE TABLE t1; + +--let $alter_definition = CHANGE b1 b $int_col AFTER c +--source alter_table.inc +--source mask_engine.inc +SHOW CREATE TABLE t1; + +--let $alter_definition = CHANGE b b $char_col +--source alter_table.inc +--source mask_engine.inc +SHOW CREATE TABLE t1; + +--let $alter_definition = MODIFY COLUMN b $int_col +--source alter_table.inc +--source mask_engine.inc +SHOW CREATE TABLE t1; + +--let $alter_definition = MODIFY COLUMN b $char_col FIRST +--source alter_table.inc +--source mask_engine.inc +SHOW CREATE TABLE t1; + +--let $alter_definition = MODIFY COLUMN b $int_col AFTER a +--source alter_table.inc +--source mask_engine.inc +SHOW CREATE TABLE t1; + +--let $alter_definition = DROP COLUMN b +--source alter_table.inc +--source mask_engine.inc +SHOW CREATE TABLE t1; + + +# Rename table + +--let $rename_to = t2 +--source alter_table.inc +--let $error_codes = ER_NO_SUCH_TABLE +SHOW CREATE TABLE t1; +--source check_errors.inc +if ($mysql_errname != 'ER_NO_SUCH_TABLE') +{ + --let $functionality = ALTER TABLE + --source unexpected_result.inc + DROP TABLE t1; +} +if ($mysql_errname == ER_NO_SUCH_TABLE) +{ + --source mask_engine.inc + SHOW CREATE TABLE t2; + DROP TABLE t2; +} + +# ORDER BY +--let $create_definition = a $int_col, b $int_col +--source create_table.inc +INSERT INTO t1 (a,b) VALUES (1,5),(2,2),(4,3); +--source mask_engine.inc +SHOW CREATE TABLE t1; + +--let $alter_definition = ORDER BY b ASC, a DESC +--source alter_table.inc +--source mask_engine.inc +SHOW CREATE TABLE t1; +SELECT * FROM t1; +DROP TABLE t1; + +# Character set, collate + +--let $table_options = CHARACTER SET latin1 COLLATE latin1_general_cs +--let $create_definition = a $int_col, b $char_col, c $char_col +--source create_table.inc +INSERT INTO t1 (a,b,c) VALUES (5,'z','t'); + +--source mask_engine.inc +SHOW CREATE TABLE t1; + +--let $alter_definition = CONVERT TO CHARACTER SET utf8 +--source alter_table.inc +--source mask_engine.inc +SHOW CREATE TABLE t1; + +--let $alter_definition = DEFAULT CHARACTER SET = latin1 COLLATE latin1_general_ci +--source alter_table.inc +--source mask_engine.inc +SHOW CREATE TABLE t1; + +# A 'null' ALTER operation + +--let $alter_definition = FORCE +--source alter_table.inc +--source mask_engine.inc +SHOW CREATE TABLE t1; + +# Cleanup +DROP TABLE t1; + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/alter_table_online.result b/mysql-test/suite/storage_engine/alter_table_online.result new file mode 100644 index 00000000000..0e606bf1f7e --- /dev/null +++ b/mysql-test/suite/storage_engine/alter_table_online.result @@ -0,0 +1,35 @@ +DROP TABLE IF EXISTS t1,t2,t3; +CREATE TABLE t1 (a <INT_COLUMN>, b <INT_COLUMN>, c <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b,c) VALUES (1,100,'a'),(2,200,'b'),(3,300,'c'); +ALTER ONLINE TABLE t1 MODIFY b <INT_COLUMN> DEFAULT 5; +ALTER ONLINE TABLE t1 CHANGE b new_name <INT_COLUMN>; +ALTER ONLINE TABLE t1 COMMENT 'new comment'; +ALTER ONLINE TABLE t1 RENAME TO t2; +DROP TABLE IF EXISTS t2; +CREATE TEMPORARY TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'); +ALTER ONLINE TABLE t1 MODIFY b <INT_COLUMN> DEFAULT 5; +ERROR HY000: Can't execute the given 'ALTER' command as online +ALTER ONLINE TABLE t1 CHANGE b new_name <INT_COLUMN>; +ERROR HY000: Can't execute the given 'ALTER' command as online +ALTER ONLINE TABLE t1 COMMENT 'new comment'; +ERROR HY000: Can't execute the given 'ALTER' command as online +ALTER ONLINE TABLE t1 RENAME TO t2; +ERROR HY000: Can't execute the given 'ALTER' command as online +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <INT_COLUMN>, c <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b,c) VALUES (1,100,'a'),(2,200,'b'),(3,300,'c'); +ALTER ONLINE TABLE t1 DROP COLUMN b, ADD b <INT_COLUMN>; +ERROR HY000: Can't execute the given 'ALTER' command as online +ALTER ONLINE TABLE t1 MODIFY b BIGINT <CUSTOM_COL_OPTIONS>; +ERROR HY000: Can't execute the given 'ALTER' command as online +ALTER ONLINE TABLE t1 ENGINE=MEMORY; +ERROR HY000: Can't execute the given 'ALTER' command as online +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <INT_COLUMN>, c <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +ALTER ONLINE TABLE t1 ADD INDEX (b); +ERROR HY000: Can't execute the given 'ALTER' command as online +ALTER TABLE t1 ADD INDEX (b); +ALTER ONLINE TABLE t1 DROP INDEX b; +ERROR HY000: Can't execute the given 'ALTER' command as online +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/alter_table_online.test b/mysql-test/suite/storage_engine/alter_table_online.test new file mode 100644 index 00000000000..94dec2a72bb --- /dev/null +++ b/mysql-test/suite/storage_engine/alter_table_online.test @@ -0,0 +1,160 @@ +# +# ALTER ONLINE TABLE +# + +--source have_engine.inc + +--disable_warnings +DROP TABLE IF EXISTS t1,t2,t3; +--enable_warnings + +# +# Test of things that can be done online +# We are repeating notification here, because for some engines +# only a part of these ALTER ONLINE statements might be supported. +# + +let $create_definition = a $int_col, b $int_col, c $char_col; +--source create_table.inc + +INSERT INTO t1 (a,b,c) VALUES (1,100,'a'),(2,200,'b'),(3,300,'c'); + +--let $online = 1 +--let $alter_definition = MODIFY b $int_col DEFAULT 5 +--source alter_table.inc +if ($mysql_errname) +{ + --source unexpected_result.inc +} + +--let $online = 1 +--let $alter_definition = CHANGE b new_name $int_col +--source alter_table.inc +if ($mysql_errname) +{ + --source unexpected_result.inc +} + +--let $online = 1 +--let $alter_definition = COMMENT 'new comment' +--source alter_table.inc +if ($mysql_errname) +{ + --source unexpected_result.inc +} + +--let $online = 1 +--let $rename_to = t2 +--source alter_table.inc +if ($mysql_errname) +{ + --source unexpected_result.inc + DROP TABLE t1; +} +DROP TABLE IF EXISTS t2; + +# +# temporary tables always require a copy +# + +--let $temporary = 1 +--source create_table.inc + +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'); + +--let $error_codes = ER_CANT_DO_ONLINE +--let $online = 1 +--let $alter_definition = MODIFY b $int_col DEFAULT 5 +--source alter_table.inc +if ($mysql_errname != ER_CANT_DO_ONLINE) +{ + --source unexpected_result.inc +} + + +--let $error_codes = ER_CANT_DO_ONLINE +--let $online = 1 +--let $alter_definition = CHANGE b new_name $int_col +--source alter_table.inc + +--let $error_codes = ER_CANT_DO_ONLINE +--let $online = 1 +--let $alter_definition = COMMENT 'new comment' +--source alter_table.inc + +--let $error_codes = ER_CANT_DO_ONLINE +--let $online = 1 +--let $rename_to = t2 +--source alter_table.inc + +DROP TABLE t1; + +# +# Test of things that is not possible to do online +# + +--let $create_definition = a $int_col, b $int_col, c $char_col +--source create_table.inc + +INSERT INTO t1 (a,b,c) VALUES (1,100,'a'),(2,200,'b'),(3,300,'c'); + +--let $error_codes = ER_CANT_DO_ONLINE +--let $online = 1 +--let $alter_definition = DROP COLUMN b, ADD b $int_col +--source alter_table.inc +if ($mysql_errname!=ER_CANT_DO_ONLINE) +{ + --source unexpected_result.inc +} + +--let $error_codes = ER_CANT_DO_ONLINE +--let $online = 1 +--let $alter_definition = MODIFY b BIGINT $default_col_opts +--source alter_table.inc + +--let $alternative_engine = `SELECT engine FROM information_schema.engines WHERE engine != '$storage_engine' AND support IN ('YES','DEFAULT')` + +--let $error_codes = ER_CANT_DO_ONLINE +--let $online = 1 +--let $alter_definition = ENGINE=$alternative_engine +--source alter_table.inc + +DROP TABLE t1; + +--let $create_definition = a $int_col, b $int_indexed_col, c $char_col +--source create_table.inc +if ($mysql_errname) +{ + --let $functionality = Column options + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --let $error_codes = ER_CANT_DO_ONLINE + --let $online = 1 + --let $alter_definition = ADD INDEX (b) + --source alter_table.inc + if ($mysql_errname!=ER_CANT_DO_ONLINE) + { + --let $functionality = Adding an index or ALTER ONLINE + --source unexpected_result.inc + } + + --let $alter_definition = ADD INDEX (b) + --source alter_table.inc + if ($mysql_errname) + { + --let $functionality = Adding an index or ALTER TABLE + --source unexpected_result.inc + } + if (!$mysql_errname) + { + --let $error_codes = ER_CANT_DO_ONLINE + --let $online = 1 + --let $alter_definition = DROP INDEX b + --source alter_table.inc + } + DROP TABLE t1; +} + +--source cleanup_engine.inc diff --git a/mysql-test/suite/storage_engine/alter_tablespace.result b/mysql-test/suite/storage_engine/alter_tablespace.result new file mode 100644 index 00000000000..5d8709b2357 --- /dev/null +++ b/mysql-test/suite/storage_engine/alter_tablespace.result @@ -0,0 +1,19 @@ +DROP TABLE IF EXISTS t1, t2; +CREATE TABLE t1 (a <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +ALTER TABLE t1 DISCARD TABLESPACE; +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a) VALUES (1),(2); +SELECT * FROM t1; +a +1 +2 +ALTER TABLE t1 DISCARD TABLESPACE; +SELECT * FROM t1; +ERROR HY000: Got error -1 from storage engine +ALTER TABLE t1 IMPORT TABLESPACE; +SELECT * FROM t1; +a +1 +2 +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/alter_tablespace.test b/mysql-test/suite/storage_engine/alter_tablespace.test new file mode 100644 index 00000000000..6c429bb98ea --- /dev/null +++ b/mysql-test/suite/storage_engine/alter_tablespace.test @@ -0,0 +1,91 @@ +# +# IMPORT / DISCARD TABLESPACE +# +# The test might require additional engine options, +# e.g. for InnoDB it is --innodb-file-per-table + +--source have_engine.inc + +--disable_warnings +DROP TABLE IF EXISTS t1, t2; +--enable_warnings + +--let $create_definition = a $int_col +--source create_table.inc + +--let $alter_definition = DISCARD TABLESPACE + +--source alter_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $alter_statement + --let $functionality = Tablespace operations + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + DROP TABLE t1; + + --let $create_definition = a $int_col + --source create_table.inc + INSERT INTO t1 (a) VALUES (1),(2); + --sorted_result + SELECT * FROM t1; + +# http://dev.mysql.com/doc/mysql-enterprise-backup/3.5/en/partial.restoring.single.html +# To get a "clean" backup we need to either use innobackup, or to monitor show engine innodb status, +# and the documented conditions do not look exactly feasible. So, we will go a simple way: +# just restart the server, and take the backup while the server is down. +# (And we need to have a really clean backup, see MySQL:65429 / LP:1004910) + + --let $datadir = `SELECT @@datadir` + + --write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +restart +wait +EOF + + --enable_reconnect + --shutdown_server 60 + + --source include/wait_until_disconnected.inc + + --replace_result $datadir <DATADIR> + --copy_file $datadir/test/t1.ibd $datadir/test/t1.ibd.save + + --remove_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect + --write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +restart +EOF + + --source include/wait_until_connected_again.inc + + --let $alter_definition = DISCARD TABLESPACE + --source alter_table.inc + + --let $error_codes = ER_GET_ERRNO + SELECT * FROM t1; + --source check_errors.inc + if ($mysql_errname != ER_GET_ERRNO) + { + --let $functionality = Tablespace operations + --source unexpected_result.inc + } + + --move_file $datadir/test/t1.ibd.save $datadir/test/t1.ibd + --let $alter_definition = IMPORT TABLESPACE + --source alter_table.inc + --sorted_result + SELECT * FROM t1; + + # Adding a warning suppression based on what InnoDB currently does + # when it attempts to access a table without an *.ibd file + --disable_query_log + eval CALL mtr.add_suppression('$storage_engine: Error:.*'); + --enable_query_log +} + +DROP TABLE t1; + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/analyze_table.inc b/mysql-test/suite/storage_engine/analyze_table.inc new file mode 100644 index 00000000000..2cbfc17aaa9 --- /dev/null +++ b/mysql-test/suite/storage_engine/analyze_table.inc @@ -0,0 +1,43 @@ +# +# ANALYZE TABLE statements +# +# Note: the output is likely to be different for the engine under test, +# in which case rdiff will be needed. Or, the output might say that +# the storage engine does not support ANALYZE. +# + +--disable_warnings +DROP TABLE IF EXISTS t1,t2; +--enable_warnings + +--let $create_definition = a $int_col, b $char_col +--source create_table.inc +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); +--let $create_definition = a $int_col, b $char_col +--let $table_name = t2 +--source create_table.inc + +INSERT INTO t1 (a,b) VALUES (3,'c'); +ANALYZE TABLE t1; +INSERT INTO t2 (a,b) VALUES (4,'d'); +ANALYZE NO_WRITE_TO_BINLOG TABLE t2; +INSERT INTO t1 (a,b) VALUES (5,'e'); +INSERT INTO t2 (a,b) VALUES (6,'f'); +ANALYZE LOCAL TABLE t1, t2; + +DROP TABLE t1, t2; + +--let $continue = 1 +--source have_default_index.inc + +if ($have_default_index) +{ + --let $create_definition = a $int_indexed_col, $default_index(a) + --source create_table.inc + INSERT INTO t1 (a) VALUES (1),(2),(4),(7); + ANALYZE TABLE t1; + INSERT INTO t1 (a) VALUES (8),(10),(11),(12); + ANALYZE TABLE t1; + DROP TABLE t1; +} + diff --git a/mysql-test/suite/storage_engine/analyze_table.result b/mysql-test/suite/storage_engine/analyze_table.result new file mode 100644 index 00000000000..42904ed334d --- /dev/null +++ b/mysql-test/suite/storage_engine/analyze_table.result @@ -0,0 +1,29 @@ +DROP TABLE IF EXISTS t1,t2; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); +CREATE TABLE t2 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (3,'c'); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +INSERT INTO t2 (a,b) VALUES (4,'d'); +ANALYZE NO_WRITE_TO_BINLOG TABLE t2; +Table Op Msg_type Msg_text +test.t2 analyze status OK +INSERT INTO t1 (a,b) VALUES (5,'e'); +INSERT INTO t2 (a,b) VALUES (6,'f'); +ANALYZE LOCAL TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +DROP TABLE t1, t2; +CREATE TABLE t1 (a <INT_COLUMN>, <CUSTOM_INDEX>(a)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a) VALUES (1),(2),(4),(7); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +INSERT INTO t1 (a) VALUES (8),(10),(11),(12); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/analyze_table.test b/mysql-test/suite/storage_engine/analyze_table.test new file mode 100644 index 00000000000..5222ec8af54 --- /dev/null +++ b/mysql-test/suite/storage_engine/analyze_table.test @@ -0,0 +1,14 @@ +# +# ANALYZE TABLE statements +# +# Note: the output is likely to be different for the engine under test, +# in which case rdiff will be needed. Or, the output might say that +# the storage engine does not support ANALYZE. +# + +--source have_engine.inc + +--source analyze_table.inc + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/autoinc_secondary.result b/mysql-test/suite/storage_engine/autoinc_secondary.result new file mode 100644 index 00000000000..ad2b43bc6fe --- /dev/null +++ b/mysql-test/suite/storage_engine/autoinc_secondary.result @@ -0,0 +1,40 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a <INT_COLUMN> AUTO_INCREMENT, b <CHAR_COLUMN>, PRIMARY KEY (a,b)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (b) VALUES ('a'),('b'),('b'),('c'),('a'); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +1 +SELECT * FROM t1; +a b +1 a +2 b +3 b +4 c +5 a +DROP TABLE t1; +CREATE TABLE t1 (a <CHAR_COLUMN>, b <INT_COLUMN> AUTO_INCREMENT, PRIMARY KEY (a,b)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a) VALUES ('a'),('b'),('b'),('c'),('a'); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +1 +SELECT * FROM t1; +a b +a 1 +a 2 +b 1 +b 2 +c 1 +DROP TABLE t1; +CREATE TABLE t1 (a <CHAR_COLUMN>, b <INT_COLUMN> AUTO_INCREMENT, PRIMARY KEY (a,b), <CUSTOM_INDEX>(b)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a) VALUES ('a'),('b'),('b'),('c'),('a'); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +1 +SELECT * FROM t1; +a b +a 1 +a 5 +b 2 +b 3 +c 4 +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/autoinc_secondary.test b/mysql-test/suite/storage_engine/autoinc_secondary.test new file mode 100644 index 00000000000..8b95f1d859e --- /dev/null +++ b/mysql-test/suite/storage_engine/autoinc_secondary.test @@ -0,0 +1,73 @@ +# +# AUTO_INCREMENT on a secondary column in a multi-part key +# + +--source have_engine.inc +--source have_default_index.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +# +# AUTO_INCREMENT is the primary column in a multiple-column index +# + +--let $create_definition = a $int_col AUTO_INCREMENT, b $char_col, PRIMARY KEY (a,b) +--source create_table.inc +if ($mysql_errname) +{ + --let $functionality = Multi-part keys or PK or AUTO_INCREMENT (on a primary column) + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + INSERT INTO t1 (b) VALUES ('a'),('b'),('b'),('c'),('a'); + SELECT LAST_INSERT_ID(); + --sorted_result + SELECT * FROM t1; + DROP TABLE t1; +} + +# +# AUTO_INCREMENT is the secondary column in a multiple-column index +# + +--let $create_definition = a $char_col, b $int_col AUTO_INCREMENT, PRIMARY KEY (a,b) +--source create_table.inc +if ($mysql_errname) +{ + --let $functionality = Multi-part keys or PK or AUTO_INCREMENT (on a secondary column) + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + INSERT INTO t1 (a) VALUES ('a'),('b'),('b'),('c'),('a'); + SELECT LAST_INSERT_ID(); + --sorted_result + SELECT * FROM t1; + DROP TABLE t1; +} + +# AUTO_INCREMENT is the secondary column in a multiple-column index, +# and primary in another index +# + +--let $create_definition = a $char_col, b $int_indexed_col AUTO_INCREMENT, PRIMARY KEY (a,b), $default_index(b) +--source create_table.inc +if ($mysql_errname) +{ + --let $functionality = Multi-part keys or AUTO_INCREMENT (on the secondary column) or multiple keys + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + INSERT INTO t1 (a) VALUES ('a'),('b'),('b'),('c'),('a'); + SELECT LAST_INSERT_ID(); + --sorted_result + SELECT * FROM t1; + DROP TABLE t1; +} + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/autoinc_vars.result b/mysql-test/suite/storage_engine/autoinc_vars.result new file mode 100644 index 00000000000..60e7d74a22a --- /dev/null +++ b/mysql-test/suite/storage_engine/autoinc_vars.result @@ -0,0 +1,55 @@ +DROP TABLE IF EXISTS t1; +SET auto_increment_offset = 200; +CREATE TABLE t1 (a <INT_COLUMN> AUTO_INCREMENT, b <CHAR_COLUMN>, <CUSTOM_INDEX>(a)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (NULL,'a'),(NULL,'b'),(NULL,'c'); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +1 +SELECT * FROM t1; +a b +1 a +2 b +3 c +SET auto_increment_increment = 300; +INSERT INTO t1 (a,b) VALUES (NULL,'d'),(NULL,'e'),(NULL,'f'); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +200 +SELECT * FROM t1; +a b +1 a +2 b +200 d +3 c +500 e +800 f +SET auto_increment_increment = 50; +INSERT INTO t1 (a,b) VALUES (NULL,'g'),(NULL,'h'),(NULL,'i'); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +850 +SELECT * FROM t1; +a b +1 a +2 b +200 d +3 c +500 e +800 f +850 g +900 h +950 i +DROP TABLE t1; +SET auto_increment_increment = 500; +SET auto_increment_offset = 300; +CREATE TABLE t1 (a TINYINT <CUSTOM_COL_OPTIONS> AUTO_INCREMENT, <CUSTOM_INDEX>(a)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a) VALUES (NULL); +Warnings: +Warning 1264 Out of range value for column 'a' at row 1 +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +127 +SELECT * FROM t1; +a +127 +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/autoinc_vars.test b/mysql-test/suite/storage_engine/autoinc_vars.test new file mode 100644 index 00000000000..ceafcd7138f --- /dev/null +++ b/mysql-test/suite/storage_engine/autoinc_vars.test @@ -0,0 +1,68 @@ +# +# auto-increment-offset and auto-increment-increment +# + +--source have_engine.inc +--source have_default_index.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +# auto_increment_offset +SET auto_increment_offset = 200; +--let $create_definition = a $int_indexed_col AUTO_INCREMENT, b $char_col, $default_index(a) +--source create_table.inc +if ($mysql_errname) +{ + --let $functionality = AUTO_INCREMENT + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + # If auto_increment_offset is greater than auto_increment_increment, + # the offset is ignored + INSERT INTO t1 (a,b) VALUES (NULL,'a'),(NULL,'b'),(NULL,'c'); + SELECT LAST_INSERT_ID(); + --sorted_result + SELECT * FROM t1; + + # auto_increment_increment + + SET auto_increment_increment = 300; + # offset should not be ignored anymore + INSERT INTO t1 (a,b) VALUES (NULL,'d'),(NULL,'e'),(NULL,'f'); + SELECT LAST_INSERT_ID(); + --sorted_result + SELECT * FROM t1; + + SET auto_increment_increment = 50; + INSERT INTO t1 (a,b) VALUES (NULL,'g'),(NULL,'h'),(NULL,'i'); + SELECT LAST_INSERT_ID(); + --sorted_result + SELECT * FROM t1; + DROP TABLE t1; +} + +# offset is greater than the max value + +SET auto_increment_increment = 500; +SET auto_increment_offset = 300; +--let $create_definition = a TINYINT $default_col_indexed_opts AUTO_INCREMENT, $default_index(a) +--source create_table.inc +if ($mysql_errname) +{ + --let $functionality = AUTO_INCREMENT + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + INSERT INTO t1 (a) VALUES (NULL); + SELECT LAST_INSERT_ID(); + --sorted_result + SELECT * FROM t1; + DROP TABLE t1; +} + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/autoincrement.result b/mysql-test/suite/storage_engine/autoincrement.result new file mode 100644 index 00000000000..bc51a2a82af --- /dev/null +++ b/mysql-test/suite/storage_engine/autoincrement.result @@ -0,0 +1,133 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a <INT_COLUMN> AUTO_INCREMENT, b <CHAR_COLUMN>, <CUSTOM_INDEX>(a)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) NOT NULL AUTO_INCREMENT, + `b` char(8) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +INSERT INTO t1 (b) VALUES ('a'),('b'); +SELECT * FROM t1 ORDER BY a; +a b +1 a +2 b +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +1 +INSERT INTO t1 (a,b) VALUES (NULL,'c'),(0,'d'); +SELECT * FROM t1 ORDER BY a; +a b +1 a +2 b +3 c +4 d +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +3 +SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO'; +INSERT INTO t1 (a,b) VALUES (NULL,'e'); +SELECT * FROM t1 ORDER BY a; +a b +1 a +2 b +3 c +4 d +5 e +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +5 +INSERT INTO t1 (a,b) VALUES (0,'f'); +SELECT * FROM t1 ORDER BY a; +a b +0 f +1 a +2 b +3 c +4 d +5 e +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +5 +SET sql_mode = '<INITIAL_SQL_MODE>'; +SHOW TABLE STATUS FROM test LIKE 't1'; +Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment +t1 <STORAGE_ENGINE> # # # # # # # # 6 # # # # # # # +INSERT INTO t1 (a,b) VALUES (6,'g'),(7,'h'); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +5 +SHOW TABLE STATUS FROM test LIKE 't1'; +Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment +t1 # # # # # # # # # 8 # # # # # # # +INSERT INTO t1 (a,b) VALUES (NULL,'i'),(9,'j'); +SELECT * FROM t1 ORDER BY a; +a b +0 f +1 a +2 b +3 c +4 d +5 e +6 g +7 h +8 i +9 j +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +8 +SHOW TABLE STATUS FROM test LIKE 't1'; +Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment +t1 # # # # # # # # # 10 # # # # # # # +INSERT INTO t1 (a,b) VALUES (20,'k'); +SHOW TABLE STATUS FROM test LIKE 't1'; +Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment +t1 # # # # # # # # # 21 # # # # # # # +INSERT INTO t1 (a,b) VALUES (NULL,'l'); +SELECT * FROM t1 ORDER BY a; +a b +0 f +1 a +2 b +3 c +4 d +5 e +6 g +7 h +8 i +9 j +20 k +21 l +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +21 +SHOW TABLE STATUS FROM test LIKE 't1'; +Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment +t1 # # # # # # # # # 22 # # # # # # # +INSERT INTO t1 (a,b) VALUES (-5,'m'); +SELECT * FROM t1 ORDER BY a; +a b +-5 m +0 f +1 a +2 b +3 c +4 d +5 e +6 g +7 h +8 i +9 j +20 k +21 l +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN> AUTO_INCREMENT, b <CHAR_COLUMN>, <CUSTOM_INDEX>(a)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> AUTO_INCREMENT = 100; +INSERT INTO t1 (a,b) VALUES (NULL,'a'),(NULL,'b'); +SELECT * FROM t1; +a b +100 a +101 b +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +100 +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/autoincrement.test b/mysql-test/suite/storage_engine/autoincrement.test new file mode 100644 index 00000000000..fb07ea55c57 --- /dev/null +++ b/mysql-test/suite/storage_engine/autoincrement.test @@ -0,0 +1,114 @@ +# +# Basic AUTO_INCREMENT capabilities +# + +--source have_engine.inc + +--let $skip = 1 +--source have_default_index.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +--let $create_definition = a $int_indexed_col AUTO_INCREMENT, b $char_col, $default_index(a) +--source create_table.inc +if ($mysql_errname) +{ + --let $functionality = AUTO_INCREMENT + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --source mask_engine.inc + SHOW CREATE TABLE t1; + + # Automatic values + + INSERT INTO t1 (b) VALUES ('a'),('b'); + SELECT * FROM t1 ORDER BY a; + SELECT LAST_INSERT_ID(); + + INSERT INTO t1 (a,b) VALUES (NULL,'c'),(0,'d'); + SELECT * FROM t1 ORDER BY a; + SELECT LAST_INSERT_ID(); + + let $sql_mode = `SELECT @@sql_mode`; + SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO'; + + INSERT INTO t1 (a,b) VALUES (NULL,'e'); + SELECT * FROM t1 ORDER BY a; + SELECT LAST_INSERT_ID(); + + INSERT INTO t1 (a,b) VALUES (0,'f'); + SELECT * FROM t1 ORDER BY a; + SELECT LAST_INSERT_ID(); + + --replace_result $sql_mode <INITIAL_SQL_MODE> + eval SET sql_mode = '$sql_mode'; + + # SHOW TABLE STATUS shows the auto-increment value in column 11, + # that's all we need here and further + --source mask_engine.inc + --replace_column 3 # 4 # 5 # 6 # 7 # 8 # 9 # 10 # 12 # 13 # 14 # 15 # 16 # 17 # 18 # + SHOW TABLE STATUS FROM test LIKE 't1'; + + # Mix of automatic and explicit values + + INSERT INTO t1 (a,b) VALUES (6,'g'),(7,'h'); + SELECT LAST_INSERT_ID(); + + --replace_column 2 # 3 # 4 # 5 # 6 # 7 # 8 # 9 # 10 # 12 # 13 # 14 # 15 # 16 # 17 # 18 # + SHOW TABLE STATUS FROM test LIKE 't1'; + + + INSERT INTO t1 (a,b) VALUES (NULL,'i'),(9,'j'); + SELECT * FROM t1 ORDER BY a; + SELECT LAST_INSERT_ID(); + + --replace_column 2 # 3 # 4 # 5 # 6 # 7 # 8 # 9 # 10 # 12 # 13 # 14 # 15 # 16 # 17 # 18 # + SHOW TABLE STATUS FROM test LIKE 't1'; + + # Creating a gap in the sequence + + INSERT INTO t1 (a,b) VALUES (20,'k'); + + --replace_column 2 # 3 # 4 # 5 # 6 # 7 # 8 # 9 # 10 # 12 # 13 # 14 # 15 # 16 # 17 # 18 # + SHOW TABLE STATUS FROM test LIKE 't1'; + + INSERT INTO t1 (a,b) VALUES (NULL,'l'); + SELECT * FROM t1 ORDER BY a; + SELECT LAST_INSERT_ID(); + + --replace_column 2 # 3 # 4 # 5 # 6 # 7 # 8 # 9 # 10 # 12 # 13 # 14 # 15 # 16 # 17 # 18 # + SHOW TABLE STATUS FROM test LIKE 't1'; + + # Negative values: we will try to insert one just to check that it does not cause a crash, + # but won't check what happens to the sequence after that, since the behavior is undefined + + INSERT INTO t1 (a,b) VALUES (-5,'m'); + SELECT * FROM t1 ORDER BY a; + + DROP TABLE t1; +} + +# Autoincrement with table option AUTO_INCREMENT + +--let $create_definition = a $int_indexed_col AUTO_INCREMENT, b $char_col, $default_index(a) +--let $table_options = AUTO_INCREMENT = 100 +--source create_table.inc +if ($mysql_errname) +{ + --let $functionality = AUTO_INCREMENT column or table option + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + INSERT INTO t1 (a,b) VALUES (NULL,'a'),(NULL,'b'); + --sorted_result + SELECT * FROM t1; + SELECT LAST_INSERT_ID(); + DROP TABLE t1; +} +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/cache_index.result b/mysql-test/suite/storage_engine/cache_index.result new file mode 100644 index 00000000000..c8cf0ce2090 --- /dev/null +++ b/mysql-test/suite/storage_engine/cache_index.result @@ -0,0 +1,69 @@ +DROP TABLE IF EXISTS t1, t2; +CREATE TABLE t1 (a <INT_COLUMN>, +b <CHAR_COLUMN>, +<CUSTOM_INDEX> (a) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE t2 (a <INT_COLUMN>, +b <CHAR_COLUMN>, +<CUSTOM_INDEX> (b) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CACHE INDEX t1 INDEX (a), t2 IN <CACHE_NAME>; +ERROR HY000: Unknown key cache '<CACHE_NAME>' +SET GLOBAL <CACHE_NAME>.key_buffer_size=128*1024; +CACHE INDEX t1 INDEX (a), t2 IN <CACHE_NAME>; +Table Op Msg_type Msg_text +test.t1 assign_to_keycache status OK +test.t2 assign_to_keycache status OK +LOAD INDEX INTO CACHE t1, t2; +Table Op Msg_type Msg_text +test.t1 preload_keys status OK +test.t2 preload_keys status OK +INSERT INTO t1 (a,b) VALUES (3,'c'),(4,'d'); +SET GLOBAL <CACHE_NAME>.key_buffer_size=8*1024; +LOAD INDEX INTO CACHE t1, t2 IGNORE LEAVES; +Table Op Msg_type Msg_text +test.t1 preload_keys status OK +test.t2 preload_keys status OK +SET GLOBAL <CACHE_NAME>.key_cache_age_threshold = 100, <CACHE_NAME>.key_cache_block_size = 512, <CACHE_NAME>.key_cache_division_limit = 1, <CACHE_NAME>.key_cache_segments=2; +INSERT INTO t1 (a,b) VALUES (5,'e'),(6,'f'); +LOAD INDEX INTO CACHE t1; +Table Op Msg_type Msg_text +test.t1 preload_keys status OK +SET GLOBAL new_<CACHE_NAME>.key_buffer_size=128*1024; +CACHE INDEX t1 IN new_<CACHE_NAME>; +Table Op Msg_type Msg_text +test.t1 assign_to_keycache status OK +INSERT INTO t1 (a,b) VALUES (7,'g'),(8,'h'); +LOAD INDEX INTO CACHE t1 IGNORE LEAVES; +Table Op Msg_type Msg_text +test.t1 preload_keys status OK +INSERT INTO t1 (a,b) VALUES (9,'i'); +DROP TABLE t2; +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>, +b <CHAR_COLUMN>, +<CUSTOM_INDEX> (a), +<CUSTOM_INDEX> (b) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CACHE INDEX t1 IN <CACHE_NAME>; +Table Op Msg_type Msg_text +test.t1 assign_to_keycache status OK +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); +LOAD INDEX INTO CACHE t1; +Table Op Msg_type Msg_text +test.t1 preload_keys status OK +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>, +b <CHAR_COLUMN>, +<CUSTOM_INDEX> a_b (a,b) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CACHE INDEX t1 IN <CACHE_NAME>; +Table Op Msg_type Msg_text +test.t1 assign_to_keycache status OK +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); +LOAD INDEX INTO CACHE t1; +Table Op Msg_type Msg_text +test.t1 preload_keys status OK +DROP TABLE t1; +SET GLOBAL <CACHE_NAME>.key_buffer_size=0; +SET GLOBAL new_<CACHE_NAME>.key_buffer_size=0; diff --git a/mysql-test/suite/storage_engine/cache_index.test b/mysql-test/suite/storage_engine/cache_index.test new file mode 100644 index 00000000000..42ba9615a40 --- /dev/null +++ b/mysql-test/suite/storage_engine/cache_index.test @@ -0,0 +1,142 @@ +# +# CACHE INDEX and LOAD INDEX INTO CACHE +# + +--source have_engine.inc +--source have_default_index.inc + + +# Due to ancient MySQL bug#16111 we need to generate a unique cache name +--let $cache_name = `SELECT CONNECTION_ID()` +--let $cache_name = my_cache_$cache_name + +--disable_warnings +DROP TABLE IF EXISTS t1, t2; +--enable_warnings + +let $create_definition = + a $int_indexed_col, + b $char_col, + $default_index (a) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $functionality = Indexes on INT columns + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + let $create_definition = + a $int_col, + b $char_indexed_col, + $default_index (b) + ; + let $table_name = t2; + --source create_table.inc + if ($mysql_errname) + { + --let $functionality = Indexes on CHAR columns + --source unexpected_result.inc + } + if (!$mysql_errname) + { + --replace_result $cache_name <CACHE_NAME> + --let $error_codes = ER_UNKNOWN_KEY_CACHE + eval CACHE INDEX t1 INDEX (a), t2 IN $cache_name; + --source check_errors.inc + if ($mysql_errname != ER_UNKNOWN_KEY_CACHE) + { + --let $functionality = Key cache or indexes + --source unexpected_result.inc + } + + --replace_result $cache_name <CACHE_NAME> + eval SET GLOBAL $cache_name.key_buffer_size=128*1024; + --replace_result $cache_name <CACHE_NAME> + eval CACHE INDEX t1 INDEX (a), t2 IN $cache_name; + if ($mysql_errname) + { + --let $functionality = Indexes + --source unexpected_result.inc + } + + LOAD INDEX INTO CACHE t1, t2; + if ($mysql_errname) + { + --let $functionality = Indexes + --source unexpected_result.inc + } + + INSERT INTO t1 (a,b) VALUES (3,'c'),(4,'d'); + --replace_result $cache_name <CACHE_NAME> + eval SET GLOBAL $cache_name.key_buffer_size=8*1024; + LOAD INDEX INTO CACHE t1, t2 IGNORE LEAVES; + + --replace_result $cache_name <CACHE_NAME> + eval SET GLOBAL $cache_name.key_cache_age_threshold = 100, $cache_name.key_cache_block_size = 512, $cache_name.key_cache_division_limit = 1, $cache_name.key_cache_segments=2; + INSERT INTO t1 (a,b) VALUES (5,'e'),(6,'f'); + LOAD INDEX INTO CACHE t1; + + --replace_result $cache_name <CACHE_NAME> + eval SET GLOBAL new_$cache_name.key_buffer_size=128*1024; + --replace_result $cache_name <CACHE_NAME> + eval CACHE INDEX t1 IN new_$cache_name; + INSERT INTO t1 (a,b) VALUES (7,'g'),(8,'h'); + LOAD INDEX INTO CACHE t1 IGNORE LEAVES; + INSERT INTO t1 (a,b) VALUES (9,'i'); + DROP TABLE t2; + } + DROP TABLE t1; +} + +let $create_definition = + a $int_indexed_col, + b $char_indexed_col, + $default_index (a), + $default_index (b) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $functionality = Multiple keys or indexes on INT or CHAR columns + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_result $cache_name <CACHE_NAME> + eval CACHE INDEX t1 IN $cache_name; + INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); + LOAD INDEX INTO CACHE t1; + + DROP TABLE t1; + let $create_definition = + a $int_indexed_col, + b $char_indexed_col, + $default_index a_b (a,b) + ; + --source create_table.inc + if ($mysql_errname) + { + --let $functionality = Multi-part keys + --source unexpected_result.inc + } + + --replace_result $cache_name <CACHE_NAME> + eval CACHE INDEX t1 IN $cache_name; + INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); + LOAD INDEX INTO CACHE t1; + + DROP TABLE t1; +} + +# Cleanup + +--replace_result $cache_name <CACHE_NAME> +eval SET GLOBAL $cache_name.key_buffer_size=0; +--replace_result $cache_name <CACHE_NAME> +eval SET GLOBAL new_$cache_name.key_buffer_size=0; + + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/check_errors.inc b/mysql-test/suite/storage_engine/check_errors.inc new file mode 100644 index 00000000000..e38ff2962f1 --- /dev/null +++ b/mysql-test/suite/storage_engine/check_errors.inc @@ -0,0 +1,80 @@ +# +# Since we run tests in disable_abort_on_error mode, we cannot use --error command, +# and need to check the result manually. +# Usage in a test: +# --let $error_codes = <comma-separated list> # optional, default '' +# --let $mysql_errname = <error name> # optional, default current $mysql_errname (from the last SQL command) +# --let $mysql_errno = <error code> # optional, default current $mysql_errno (from the last SQL command) +# + +if ($error_codes == '0') +{ + --let $error_codes = +} +if ($error_codes == '') +{ + if ($mysql_errname) + { + --echo # ERROR: Statement ended with errno $mysql_errno, errname $mysql_errname (expected to succeed) + } + + # If both error_codes and mysql_errname are false, all is good, no logic needed +} + +if ($error_codes != '') +{ + # If mysql_errname or mysql_errno is equal to $error_codes, it's good too, nothing to do + + if ($mysql_errname != $error_codes) + { + if ($mysql_errno != $error_codes) + { + --let $save_errno = $mysql_errno + --let $save_errname = $mysql_errname + + --let $codeline = `SELECT CONCAT('\'',REPLACE('$error_codes',',','\',\''),'\'')` + --let $result = `SELECT '$save_errname' IN($codeline) or '$save_errno' IN ($codeline)` + + --let $mysql_errno = $save_errno + --let $mysql_errname = $save_errname + + if (!$result) + { + if ($mysql_errname) + { + --echo # ERROR: Statement ended with errno $mysql_errno, errname $mysql_errname (expected results: $error_codes) + } + if (!$mysql_errname) + { + --echo # ERROR: Statement succeeded (expected results: $error_codes) + } + } + # If a list contained more than one error, it could be on one of two reasons: + # first, we do not care which code it is, as long as it is one of the listed errors. + # In this case we will suggest to add an rdiff file if the message differs. + # Second, check_errors might be called from a generalized include file or test, + # which runs with different parameters and thus might produce different results for the same statement. + # Then, the message will be stricter, as the difference with the result file is actually a problem + # which needs to be checked at least. + if ($result) + { + if (!$strict_check) + { + --echo # Statement ended with one of expected results ($error_codes). + --echo # If you got a difference in error message, just add it to rdiff file + } + if ($strict_check) + { + --echo # WARNING: Statement ended with errno $mysql_errno, errname '$mysql_errname'. + --echo # If it differs from the result file, it might indicate a problem. + } + + } + } + } +} + +# Don't want the variables to be accidentally reused later +--let $error_codes = +--let $strict_check = + diff --git a/mysql-test/suite/storage_engine/check_table.inc b/mysql-test/suite/storage_engine/check_table.inc new file mode 100644 index 00000000000..54bdf511cb8 --- /dev/null +++ b/mysql-test/suite/storage_engine/check_table.inc @@ -0,0 +1,62 @@ +# +# CHECK TABLE statements +# +# Note: the output is likely to be different for the engine under test, +# in which case rdiff will be needed. Or, the output might say that +# the storage engine does not support CHECK. +# + +--disable_warnings +DROP TABLE IF EXISTS t1,t2; +--enable_warnings + +--let $create_definition = a $int_col, b $char_col +--source create_table.inc +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); + +--let $table_name = t2 +--let $create_definition = a $int_col, b $char_col +--source create_table.inc + +CHECK TABLE t1; +INSERT INTO t1 (a,b) VALUES (3,'c'); +INSERT INTO t2 (a,b) VALUES (4,'d'); +CHECK TABLE t1, t2 FOR UPGRADE; +INSERT INTO t2 (a,b) VALUES (5,'e'); +CHECK TABLE t2 QUICK; +INSERT INTO t1 (a,b) VALUES (6,'f'); +CHECK TABLE t1 FAST; +INSERT INTO t1 (a,b) VALUES (7,'g'); +INSERT INTO t2 (a,b) VALUES (8,'h'); +CHECK TABLE t2, t1 MEDIUM; +INSERT INTO t1 (a,b) VALUES (9,'i'); +INSERT INTO t2 (a,b) VALUES (10,'j'); +CHECK TABLE t1, t2 EXTENDED; +INSERT INTO t1 (a,b) VALUES (11,'k'); +CHECK TABLE t1 CHANGED; + +DROP TABLE t1, t2; + +--let $continue = 1 +--source have_default_index.inc +if ($have_default_index) +{ + --let $create_definition = a $int_indexed_col, $default_index(a) + --source create_table.inc + INSERT INTO t1 (a) VALUES (1),(2),(5); + CHECK TABLE t1; + INSERT INTO t1 (a) VALUES (6),(8),(12); + CHECK TABLE t1 FOR UPGRADE; + INSERT INTO t1 (a) VALUES (13),(15),(16); + CHECK TABLE t1 QUICK; + INSERT INTO t1 (a) VALUES (17),(120),(132); + CHECK TABLE t1 FAST; + INSERT INTO t1 (a) VALUES (801),(900),(7714); + CHECK TABLE t1 MEDIUM; + INSERT INTO t1 (a) VALUES (8760),(10023),(12000); + CHECK TABLE t1 EXTENDED; + INSERT INTO t1 (a) VALUES (13345),(24456),(78302),(143028); + CHECK TABLE t1 CHANGED; + DROP TABLE t1; +} + diff --git a/mysql-test/suite/storage_engine/check_table.result b/mysql-test/suite/storage_engine/check_table.result new file mode 100644 index 00000000000..83c32778959 --- /dev/null +++ b/mysql-test/suite/storage_engine/check_table.result @@ -0,0 +1,68 @@ +DROP TABLE IF EXISTS t1,t2; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); +CREATE TABLE t2 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check status OK +INSERT INTO t1 (a,b) VALUES (3,'c'); +INSERT INTO t2 (a,b) VALUES (4,'d'); +CHECK TABLE t1, t2 FOR UPGRADE; +Table Op Msg_type Msg_text +test.t1 check status OK +test.t2 check status OK +INSERT INTO t2 (a,b) VALUES (5,'e'); +CHECK TABLE t2 QUICK; +Table Op Msg_type Msg_text +test.t2 check status OK +INSERT INTO t1 (a,b) VALUES (6,'f'); +CHECK TABLE t1 FAST; +Table Op Msg_type Msg_text +test.t1 check status OK +INSERT INTO t1 (a,b) VALUES (7,'g'); +INSERT INTO t2 (a,b) VALUES (8,'h'); +CHECK TABLE t2, t1 MEDIUM; +Table Op Msg_type Msg_text +test.t2 check status OK +test.t1 check status OK +INSERT INTO t1 (a,b) VALUES (9,'i'); +INSERT INTO t2 (a,b) VALUES (10,'j'); +CHECK TABLE t1, t2 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +test.t2 check status OK +INSERT INTO t1 (a,b) VALUES (11,'k'); +CHECK TABLE t1 CHANGED; +Table Op Msg_type Msg_text +test.t1 check status OK +DROP TABLE t1, t2; +CREATE TABLE t1 (a <INT_COLUMN>, <CUSTOM_INDEX>(a)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a) VALUES (1),(2),(5); +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check status OK +INSERT INTO t1 (a) VALUES (6),(8),(12); +CHECK TABLE t1 FOR UPGRADE; +Table Op Msg_type Msg_text +test.t1 check status OK +INSERT INTO t1 (a) VALUES (13),(15),(16); +CHECK TABLE t1 QUICK; +Table Op Msg_type Msg_text +test.t1 check status OK +INSERT INTO t1 (a) VALUES (17),(120),(132); +CHECK TABLE t1 FAST; +Table Op Msg_type Msg_text +test.t1 check status OK +INSERT INTO t1 (a) VALUES (801),(900),(7714); +CHECK TABLE t1 MEDIUM; +Table Op Msg_type Msg_text +test.t1 check status OK +INSERT INTO t1 (a) VALUES (8760),(10023),(12000); +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +INSERT INTO t1 (a) VALUES (13345),(24456),(78302),(143028); +CHECK TABLE t1 CHANGED; +Table Op Msg_type Msg_text +test.t1 check status OK +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/check_table.test b/mysql-test/suite/storage_engine/check_table.test new file mode 100644 index 00000000000..243c8e07161 --- /dev/null +++ b/mysql-test/suite/storage_engine/check_table.test @@ -0,0 +1,14 @@ +# +# CHECK TABLE statements +# +# Note: the output is likely to be different for the engine under test, +# in which case rdiff will be needed. Or, the output might say that +# the storage engine does not support CHECK. +# + +--source have_engine.inc + +--source check_table.inc + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/checksum_table.inc b/mysql-test/suite/storage_engine/checksum_table.inc new file mode 100644 index 00000000000..d4bacce93b7 --- /dev/null +++ b/mysql-test/suite/storage_engine/checksum_table.inc @@ -0,0 +1,31 @@ +# +# CHECKSUM TABLE statements for standard CHECKSUM properties. +# Live checksums are covered in checksum_table_live.test +# + +--disable_warnings +DROP TABLE IF EXISTS t1,t2; +--enable_warnings + +# For most engines CHECKSUM=0 option will be ignored, +# but we are setting it here for those which have it 1 by default +# (there will be another test for live checksum) + +--let $table_options = CHECKSUM=0 +--let $create_definition = a $int_col, b $char_col +--source create_table.inc +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); + +--let $table_name = t2 +--let $table_options = CHECKSUM=0 +--let $create_definition = a $int_col, b $char_col +--source create_table.inc + +CHECKSUM TABLE t1; +CHECKSUM TABLE t2, t1; +CHECKSUM TABLE t1, t2 QUICK; +CHECKSUM TABLE t1, t2 EXTENDED; + +DROP TABLE t1, t2; + + diff --git a/mysql-test/suite/storage_engine/checksum_table.result b/mysql-test/suite/storage_engine/checksum_table.result new file mode 100644 index 00000000000..02d70491fa9 --- /dev/null +++ b/mysql-test/suite/storage_engine/checksum_table.result @@ -0,0 +1,20 @@ +DROP TABLE IF EXISTS t1,t2; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> CHECKSUM=0; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); +CREATE TABLE t2 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> CHECKSUM=0; +CHECKSUM TABLE t1; +Table Checksum +test.t1 4272806499 +CHECKSUM TABLE t2, t1; +Table Checksum +test.t2 0 +test.t1 4272806499 +CHECKSUM TABLE t1, t2 QUICK; +Table Checksum +test.t1 NULL +test.t2 NULL +CHECKSUM TABLE t1, t2 EXTENDED; +Table Checksum +test.t1 4272806499 +test.t2 0 +DROP TABLE t1, t2; diff --git a/mysql-test/suite/storage_engine/checksum_table.test b/mysql-test/suite/storage_engine/checksum_table.test new file mode 100644 index 00000000000..5693e9a1ad3 --- /dev/null +++ b/mysql-test/suite/storage_engine/checksum_table.test @@ -0,0 +1,11 @@ +# +# CHECKSUM TABLE statements for standard CHECKSUM properties. +# Live checksums are covered in checksum_table_live.test +# + +--source have_engine.inc + +--source checksum_table.inc + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/checksum_table_live.inc b/mysql-test/suite/storage_engine/checksum_table_live.inc new file mode 100644 index 00000000000..9614494e620 --- /dev/null +++ b/mysql-test/suite/storage_engine/checksum_table_live.inc @@ -0,0 +1,30 @@ +# +# CHECKSUM TABLE statements for live CHECKSUM. +# +# Note: the feature is likely to be unsupported, in which case +# instead of numeric values some CHECKSUMs will produce NULL +# + +--disable_warnings +DROP TABLE IF EXISTS t1,t2; +--enable_warnings + +# For most engines CHECKSUM=1 option will be ignored, +# and the results will be different + +--let $table_options = CHECKSUM=1 +--let $create_definition = a $int_col, b $char_col +--source create_table.inc +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); +--let $table_name = t2 +--let $table_options = CHECKSUM=1 +--let $create_definition = a $int_col, b $char_col +--source create_table.inc + +CHECKSUM TABLE t1; +CHECKSUM TABLE t2, t1; +CHECKSUM TABLE t1, t2 QUICK; +CHECKSUM TABLE t1, t2 EXTENDED; + +DROP TABLE t1, t2; + diff --git a/mysql-test/suite/storage_engine/checksum_table_live.result b/mysql-test/suite/storage_engine/checksum_table_live.result new file mode 100644 index 00000000000..59ab8f1688a --- /dev/null +++ b/mysql-test/suite/storage_engine/checksum_table_live.result @@ -0,0 +1,20 @@ +DROP TABLE IF EXISTS t1,t2; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> CHECKSUM=1; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); +CREATE TABLE t2 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> CHECKSUM=1; +CHECKSUM TABLE t1; +Table Checksum +test.t1 4272806499 +CHECKSUM TABLE t2, t1; +Table Checksum +test.t2 0 +test.t1 4272806499 +CHECKSUM TABLE t1, t2 QUICK; +Table Checksum +test.t1 4272806499 +test.t2 0 +CHECKSUM TABLE t1, t2 EXTENDED; +Table Checksum +test.t1 4272806499 +test.t2 0 +DROP TABLE t1, t2; diff --git a/mysql-test/suite/storage_engine/checksum_table_live.test b/mysql-test/suite/storage_engine/checksum_table_live.test new file mode 100644 index 00000000000..347755f24df --- /dev/null +++ b/mysql-test/suite/storage_engine/checksum_table_live.test @@ -0,0 +1,13 @@ +# +# CHECKSUM TABLE statements for live CHECKSUM. +# +# Note: the feature is likely to be unsupported, in which case +# instead of numeric values some CHECKSUMs will produce NULL +# + +--source have_engine.inc + +--source checksum_table_live.inc + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/cleanup_engine.inc b/mysql-test/suite/storage_engine/cleanup_engine.inc new file mode 100644 index 00000000000..de3d57eeaeb --- /dev/null +++ b/mysql-test/suite/storage_engine/cleanup_engine.inc @@ -0,0 +1,11 @@ +########################################### +# +# This is a stub of the include file cleanup_engine.inc which +# should be placed in storage/<engine>/mysql-test/storage_engine folder. +# +################################ +# +# Here you can add whatever is needed to cleanup +# in case your define_engine.inc created any artefacts, +# e.g. an additional schema and/or tables. + diff --git a/mysql-test/suite/storage_engine/col_not_null.inc b/mysql-test/suite/storage_engine/col_not_null.inc new file mode 100644 index 00000000000..5f980b0a915 --- /dev/null +++ b/mysql-test/suite/storage_engine/col_not_null.inc @@ -0,0 +1,92 @@ +# +# NOT NULL attribute in columns +# +# Usage: +# let $col_definition = <column type (and possibly more options)>; +# let $col_default = <default non-null value for a column>; +# --source col_not_null.inc +# +# We will add NOT NULL at the end of $col; +# +# Also, if $col_default is defined, +# we will create a table with 2 columns +# (one with DEFAULT $col_default, and one without any default), +# and will also attempt to add a column with DEFAULT NULL. +# + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +--let $create_definition = c $col_definition NOT NULL +--source create_table.inc +if ($mysql_errname) +{ + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + SHOW COLUMNS IN t1; + + --let $error_codes = ER_BAD_NULL_ERROR + INSERT INTO t1 (c) VALUES (NULL); + --source check_errors.inc + + DROP TABLE t1; +} + +if ($col_default != '') +{ + let $create_definition = + c $col_definition NOT NULL, + c2 $col_definition NOT NULL DEFAULT $col_default + ; + --source create_table.inc + if ($mysql_errname) + { + --source unexpected_result.inc + } + if (!$mysql_errname) + { + SHOW COLUMNS IN t1; + + --let $error_codes = ER_INVALID_DEFAULT + --let $alter_definition = ADD COLUMN err $col_definition NOT NULL DEFAULT NULL + --source alter_table.inc + if ($mysql_errname != ER_INVALID_DEFAULT) + { + --let $functionality = ALTER or DEFAULT + --source unexpected_result.inc + } + + --let $error_codes = ER_BAD_NULL_ERROR + INSERT INTO t1 (c) VALUES (NULL); + --source check_errors.inc + if ($mysql_errname != ER_BAD_NULL_ERROR) + { + --let $functionality = NOT NULL columns + --source unexpected_result.inc + } + + # HEX should be universal for all column types + SELECT HEX(c), HEX(c2) FROM t1; + + --let $error_codes = ER_BAD_NULL_ERROR + INSERT INTO t1 (c2) VALUES (NULL); + --source check_errors.inc + + --eval INSERT INTO t1 (c) VALUES ($col_default) + if ($mysql_errname) + { + --let $functionality = DEFAULT + --source unexpected_result.inc + } + SELECT COUNT(c), COUNT(c2) FROM t1; + + DROP TABLE t1; + } +} + +# We don't want to preserve it +let $col_default = ; + diff --git a/mysql-test/suite/storage_engine/col_null.inc b/mysql-test/suite/storage_engine/col_null.inc new file mode 100644 index 00000000000..6f74609869f --- /dev/null +++ b/mysql-test/suite/storage_engine/col_null.inc @@ -0,0 +1,65 @@ +# +# NULL attribute and DEFAULT NULL in columns +# +# Usage: +# let $col_definition = <column type (and possibly more options)>; +# let $col_default = <default non-null value for a column>; +# --source col_null.inc +# +# We will add NULL at the end of $col; +# +# Also, if $col_default is defined, +# we will create a table with 3 columns (one with DEFAULT NULL, +# one with DEFAULT $col_default, and one without any default) +# + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +--let $create_definition = c $col_definition NULL +--source create_table.inc +SHOW COLUMNS IN t1; +if ($mysql_errname) +{ + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + INSERT INTO t1 (c) VALUES (NULL); + if ($mysql_errname) + { + --let $functionality = NULLable columns + --source unexpected_result.inc + } + SELECT COUNT(c), COUNT(*) FROM t1; + + DROP TABLE t1; +} + +if ($col_default != '') +{ + let $create_definition = + c $col_definition NULL, + c1 $col_definition NULL DEFAULT NULL, + c2 $col_definition NULL DEFAULT $col_default + ; + --source create_table.inc + if ($mysql_errname) + { + --source unexpected_result.inc + } + if (!$mysql_errname) + { + SHOW COLUMNS IN t1; + + INSERT INTO t1 (c) VALUES (NULL); + SELECT COUNT(c2), COUNT(c1), COUNT(c), COUNT(*) FROM t1; + + DROP TABLE t1; + } +} + +# We don't want to preserve it +let $col_default = ; + diff --git a/mysql-test/suite/storage_engine/col_opt_default.result b/mysql-test/suite/storage_engine/col_opt_default.result new file mode 100644 index 00000000000..2d0a8508b99 --- /dev/null +++ b/mysql-test/suite/storage_engine/col_opt_default.result @@ -0,0 +1,20 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a <INT_COLUMN> DEFAULT '0') ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +a int(11) # 0 +INSERT INTO t1 (a) VALUES (1); +SELECT * FROM t1; +a +1 +ALTER TABLE t1 ADD COLUMN b <CHAR_COLUMN> DEFAULT ''; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +a int(11) # 0 +b char(8) # +INSERT INTO t1 (b) VALUES ('a'); +SELECT * FROM t1; +a b +0 a +1 +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/col_opt_default.test b/mysql-test/suite/storage_engine/col_opt_default.test new file mode 100644 index 00000000000..f59daef37fc --- /dev/null +++ b/mysql-test/suite/storage_engine/col_opt_default.test @@ -0,0 +1,49 @@ +# +# Check whether DEFAULT column attribute +# is supported in CREATE and ALTER TABLE. +# If the attribute is supported at all, it will be covered +# in more details in col_option_null and col_option_not_null tests. +# + +--source have_engine.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +--let $create_definition = a $int_col DEFAULT '0' +--source create_table.inc +if ($mysql_errname) +{ + --let $functionality = DEFAULT values + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 3 # + SHOW COLUMNS IN t1; + + INSERT INTO t1 (a) VALUES (1); + --sorted_result + SELECT * FROM t1; + + --let $alter_definition = ADD COLUMN b $char_col DEFAULT '' + --source alter_table.inc + if ($mysql_errname) + { + --let $functionality = ALTER or DEFAULT + --source unexpected_result.inc + } + if (!$mysql_errname) + { + --replace_column 3 # + SHOW COLUMNS IN t1; + + INSERT INTO t1 (b) VALUES ('a'); + --sorted_result + SELECT * FROM t1; + } + DROP TABLE t1; +} +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/col_opt_not_null.result b/mysql-test/suite/storage_engine/col_opt_not_null.result new file mode 100644 index 00000000000..00a863fccce --- /dev/null +++ b/mysql-test/suite/storage_engine/col_opt_not_null.result @@ -0,0 +1,2062 @@ +# +# BINARY columns +# +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (b BINARY <CUSTOM_COL_OPTIONS> NOT NULL, +b0 BINARY(0) <CUSTOM_COL_OPTIONS> NOT NULL, +b1 BINARY(1) <CUSTOM_COL_OPTIONS> NOT NULL, +b20 BINARY(20) <CUSTOM_COL_OPTIONS> NOT NULL, +b255 BINARY(255) <CUSTOM_COL_OPTIONS> NOT NULL +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +b binary(1) # # # # +b0 binary(0) # # # # +b1 binary(1) # # # # +b20 binary(20) # # # # +b255 binary(255) # # # # +INSERT INTO t1 VALUES ('','','','',''); +INSERT INTO t1 VALUES ('a','','b','abcdefghi klmnopqrst', 'Creating an article for the Knowledgebase is similar to asking questions. First, navigate to the category where you feel the article should be. Once there, double check that an article doesn\'t already exist which would work.'); +SELECT HEX(b), HEX(b0), HEX(b1), HEX(b20), HEX(b255) FROM t1; +HEX(b) HEX(b0) HEX(b1) HEX(b20) HEX(b255) +00 00 0000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +61 62 616263646566676869206B6C6D6E6F7071727374 4372656174696E6720616E2061727469636C6520666F7220746865204B6E6F776C65646765626173652069732073696D696C617220746F2061736B696E67207175657374696F6E732E2046697273742C206E6176696761746520746F207468652063617465676F727920776865726520796F75206665656C207468652061727469636C652073686F756C642062652E204F6E63652074686572652C20646F75626C6520636865636B207468617420616E2061727469636C6520646F65736E277420616C726561647920657869737420776869636820776F756C6420776F726B2E00000000000000000000000000000000000000000000000000000000000000 +INSERT INTO t1 VALUES ('abc', 'a', 'abc', REPEAT('a',21), REPEAT('x',256)); +Warnings: +Warning 1265 Data truncated for column 'b' at row 1 +Warning 1265 Data truncated for column 'b0' at row 1 +Warning 1265 Data truncated for column 'b1' at row 1 +Warning 1265 Data truncated for column 'b20' at row 1 +Warning 1265 Data truncated for column 'b255' at row 1 +INSERT INTO t1 SELECT b255, b255, b255, b255, CONCAT(b255,b255) FROM t1; +Warnings: +Warning 1265 Data truncated for column 'b' at row 1 +Warning 1265 Data truncated for column 'b0' at row 1 +Warning 1265 Data truncated for column 'b1' at row 1 +Warning 1265 Data truncated for column 'b20' at row 1 +Warning 1265 Data truncated for column 'b255' at row 1 +Warning 1265 Data truncated for column 'b' at row 2 +Warning 1265 Data truncated for column 'b0' at row 2 +Warning 1265 Data truncated for column 'b1' at row 2 +Warning 1265 Data truncated for column 'b20' at row 2 +Warning 1265 Data truncated for column 'b255' at row 2 +Warning 1265 Data truncated for column 'b' at row 3 +Warning 1265 Data truncated for column 'b0' at row 3 +Warning 1265 Data truncated for column 'b1' at row 3 +Warning 1265 Data truncated for column 'b20' at row 3 +Warning 1265 Data truncated for column 'b255' at row 3 +SELECT HEX(b), HEX(b0), HEX(b1), HEX(b20), HEX(b255) FROM t1; +HEX(b) HEX(b0) HEX(b1) HEX(b20) HEX(b255) +00 00 0000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +00 00 0000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +43 43 4372656174696E6720616E2061727469636C6520 4372656174696E6720616E2061727469636C6520666F7220746865204B6E6F776C65646765626173652069732073696D696C617220746F2061736B696E67207175657374696F6E732E2046697273742C206E6176696761746520746F207468652063617465676F727920776865726520796F75206665656C207468652061727469636C652073686F756C642062652E204F6E63652074686572652C20646F75626C6520636865636B207468617420616E2061727469636C6520646F65736E277420616C726561647920657869737420776869636820776F756C6420776F726B2E00000000000000000000000000000000000000000000000000000000000000 +61 61 6161616161616161616161616161616161616161 787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878 +61 62 616263646566676869206B6C6D6E6F7071727374 4372656174696E6720616E2061727469636C6520666F7220746865204B6E6F776C65646765626173652069732073696D696C617220746F2061736B696E67207175657374696F6E732E2046697273742C206E6176696761746520746F207468652063617465676F727920776865726520796F75206665656C207468652061727469636C652073686F756C642062652E204F6E63652074686572652C20646F75626C6520636865636B207468617420616E2061727469636C6520646F65736E277420616C726561647920657869737420776869636820776F756C6420776F726B2E00000000000000000000000000000000000000000000000000000000000000 +78 78 7878787878787878787878787878787878787878 787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878 +ALTER TABLE t1 ADD COLUMN b257 BINARY(257) <CUSTOM_COL_OPTIONS> NOT NULL; +ERROR 42000: Column length too big for column 'b257' (max = 255); use BLOB or TEXT instead +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +b binary(1) # # # # +b0 binary(0) # # # # +b1 binary(1) # # # # +b20 binary(20) # # # # +b255 binary(255) # # # # +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c BINARY <CUSTOM_COL_OPTIONS> NOT NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c binary(1) NO NULL +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +DROP TABLE t1; +CREATE TABLE t1 (c BINARY <CUSTOM_COL_OPTIONS> NOT NULL, +c2 BINARY <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT 0 +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c binary(1) NO NULL +c2 binary(1) NO 0 +ALTER TABLE t1 ADD COLUMN err BINARY <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT NULL; +ERROR 42000: Invalid default value for 'err' +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +SELECT HEX(c), HEX(c2) FROM t1; +HEX(c) HEX(c2) +INSERT INTO t1 (c2) VALUES (NULL); +ERROR 23000: Column 'c2' cannot be null +INSERT INTO t1 (c) VALUES (0); +SELECT COUNT(c), COUNT(c2) FROM t1; +COUNT(c) COUNT(c2) +1 1 +DROP TABLE t1; +# +# VARBINARY columns +# +DROP TABLE IF EXISTS t1, t2; +CREATE TABLE t1 (v0 VARBINARY(0) <CUSTOM_COL_OPTIONS> NOT NULL, +v1 VARBINARY(1) <CUSTOM_COL_OPTIONS> NOT NULL, +v64 VARBINARY(64) <CUSTOM_COL_OPTIONS> NOT NULL, +v65000 VARBINARY(65000) <CUSTOM_COL_OPTIONS> NOT NULL +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +v0 varbinary(0) # # # +v1 varbinary(1) # # # +v64 varbinary(64) # # # +v65000 varbinary(65000) # # # +CREATE TABLE t2 (v VARBINARY(65532) <CUSTOM_COL_OPTIONS> NOT NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t2; +Field Type Null Key Default Extra +v varbinary(65532) # # # +INSERT INTO t1 (v0,v1,v64,v65000) VALUES ('','','',''); +INSERT INTO t1 (v0,v1,v64,v65000) VALUES ('','y','Once there, double check that an article doesn\'t already exist','Here is a list of recommended books on MariaDB and MySQL. We\'ve provided links to Amazon.com here for convenience, but they can be found at many other bookstores, both online and off. + + If you want to have your favorite MySQL / MariaDB book listed here, please leave a comment. + For developers who want to code on MariaDB or MySQL + + * Understanding MySQL Internals by Sasha Pachev, former MySQL developer at MySQL AB. + o This is the only book we know about that describes the internals of MariaDB / MySQL. A must have for anyone who wants to understand and develop on MariaDB! + o Not all topics are covered and some parts are slightly outdated, but still the best book on this topic. + * MySQL 5.1 Plugin Development by Sergei Golubchik and Andrew Hutchings + o A must read for anyone wanting to write a plugin for MariaDB, written by the Sergei who designed the plugin interface for MySQL and MariaDB! + + For MariaDB / MySQL end users + + * MariaDB Crash Course by Ben Forta + o First MariaDB book! + o For people who want to learn SQL and the basics of MariaDB. + o Now shipping. Purchase at Amazon.com or your favorite bookseller. + + * SQL-99 Complete, Really by Peter Gulutzan & Trudy Pelzer. + o Everything you wanted to know about the SQL 99 standard. Excellent reference book! + o Free to read in the Knowledgebase! + + * MySQL (4th Edition) by Paul DuBois + o The \'default\' book to read if you wont to learn to use MySQL / MariaDB. + + * MySQL Cookbook by Paul DuBois + o A lot of examples of how to use MySQL. As with all of Paul\'s books, it\'s worth its weight in gold and even enjoyable reading for such a \'dry\' subject. + + * High Performance MySQL, Second Edition, By Baron Schwartz, Peter Zaitsev, Vadim Tkachenko, Jeremy D. Zawodny, Arjen Lentz, Derek J. Balling, et al. + o \"High Performance MySQL is the definitive guide to building fast, reliable systems with MySQL. Written by noted experts with years of real-world experience building very large systems, this book covers every aspect of MySQL performance in detail, and focuses on robustness, security, and data integrity. Learn advanced techniques in depth so you can bring out MySQL\'s full power.\" (From the book description at O\'Reilly) + + * MySQL Admin Cookbook + o A quick step-by-step guide for MySQL users and database administrators to tackle real-world challenges with MySQL configuration and administration + + * MySQL 5.0 Certification Study Guide, By Paul DuBois, Stefan Hinz, Carsten Pedersen + o This is the official guide to cover the passing of the two MySQL Certification examinations. It is valid till version 5.0 of the server, so while it misses all the features available in MySQL 5.1 and greater (including MariaDB 5.1 and greater), it provides a good basic understanding of MySQL for the end-user. '); +SELECT HEX(v0), HEX(v1), HEX(v64), HEX(v65000) FROM t1; +HEX(v0) HEX(v1) HEX(v64) HEX(v65000) + + 79 4F6E63652074686572652C20646F75626C6520636865636B207468617420616E2061727469636C6520646F65736E277420616C7265616479206578697374 486572652069732061206C697374206F66207265636F6D6D656E64656420626F6F6B73206F6E204D61726961444220616E64204D7953514C2E2057652776652070726F7669646564206C696E6B7320746F20416D617A6F6E2E636F6D206865726520666F7220636F6E76656E69656E63652C2062757420746865792063616E20626520666F756E64206174206D616E79206F7468657220626F6F6B73746F7265732C20626F7468206F6E6C696E6520616E64206F66662E0A0A2020496620796F752077616E7420746F206861766520796F7572206661766F72697465204D7953514C202F204D61726961444220626F6F6B206C697374656420686572652C20706C65617365206C65617665206120636F6D6D656E742E0A2020466F7220646576656C6F706572732077686F2077616E7420746F20636F6465206F6E204D617269614442206F72204D7953514C0A0A2020202020202A20556E6465727374616E64696E67204D7953514C20496E7465726E616C73206279205361736861205061636865762C20666F726D6572204D7953514C20646576656C6F706572206174204D7953514C2041422E0A2020202020202020202020206F205468697320697320746865206F6E6C7920626F6F6B207765206B6E6F772061626F75742074686174206465736372696265732074686520696E7465726E616C73206F66204D617269614442202F204D7953514C2E2041206D757374206861766520666F7220616E796F6E652077686F2077616E747320746F20756E6465727374616E6420616E6420646576656C6F70206F6E204D617269614442210A2020202020202020202020206F204E6F7420616C6C20746F706963732061726520636F766572656420616E6420736F6D652070617274732061726520736C696768746C79206F757464617465642C20627574207374696C6C20746865206265737420626F6F6B206F6E207468697320746F7069632E200A2020202020202A204D7953514C20352E3120506C7567696E20446576656C6F706D656E742062792053657267656920476F6C75626368696B20616E6420416E64726577204875746368696E67730A2020202020202020202020206F2041206D757374207265616420666F7220616E796F6E652077616E74696E6720746F207772697465206120706C7567696E20666F72204D6172696144422C207772697474656E20627920746865205365726765692077686F2064657369676E65642074686520706C7567696E20696E7465726661636520666F72204D7953514C20616E64204D61726961444221200A0A2020466F72204D617269614442202F204D7953514C20656E642075736572730A0A2020202020202A204D61726961444220437261736820436F757273652062792042656E20466F7274610A2020202020202020202020206F204669727374204D61726961444220626F6F6B210A2020202020202020202020206F20466F722070656F706C652077686F2077616E7420746F206C6561726E2053514C20616E642074686520626173696373206F66204D6172696144422E0A2020202020202020202020206F204E6F77207368697070696E672E20507572636861736520617420416D617A6F6E2E636F6D206F7220796F7572206661766F7269746520626F6F6B73656C6C65722E200A0A2020202020202A2053514C2D393920436F6D706C6574652C205265616C6C792062792050657465722047756C75747A616E20262054727564792050656C7A65722E0A2020202020202020202020206F2045766572797468696E6720796F752077616E74656420746F206B6E6F772061626F7574207468652053514C203939207374616E646172642E20457863656C6C656E74207265666572656E636520626F6F6B210A2020202020202020202020206F204672656520746F207265616420696E20746865204B6E6F776C656467656261736521200A0A2020202020202A204D7953514C20283474682045646974696F6E29206279205061756C204475426F69730A2020202020202020202020206F20546865202764656661756C742720626F6F6B20746F207265616420696620796F7520776F6E7420746F206C6561726E20746F20757365204D7953514C202F204D6172696144422E200A0A2020202020202A204D7953514C20436F6F6B626F6F6B206279205061756C204475426F69730A2020202020202020202020206F2041206C6F74206F66206578616D706C6573206F6620686F7720746F20757365204D7953514C2E204173207769746820616C6C206F66205061756C277320626F6F6B732C206974277320776F727468206974732077656967687420696E20676F6C6420616E64206576656E20656E6A6F7961626C652072656164696E6720666F7220737563682061202764727927207375626A6563742E200A0A2020202020202A204869676820506572666F726D616E6365204D7953514C2C205365636F6E642045646974696F6E2C204279204261726F6E20536368776172747A2C205065746572205A6169747365762C20566164696D20546B616368656E6B6F2C204A6572656D7920442E205A61776F646E792C2041726A656E204C656E747A2C20446572656B204A2E2042616C6C696E672C20657420616C2E0A2020202020202020202020206F20224869676820506572666F726D616E6365204D7953514C2069732074686520646566696E697469766520677569646520746F206275696C64696E6720666173742C2072656C6961626C652073797374656D732077697468204D7953514C2E205772697474656E206279206E6F74656420657870657274732077697468207965617273206F66207265616C2D776F726C6420657870657269656E6365206275696C64696E672076657279206C617267652073797374656D732C207468697320626F6F6B20636F7665727320657665727920617370656374206F66204D7953514C20706572666F726D616E636520696E2064657461696C2C20616E6420666F6375736573206F6E20726F627573746E6573732C2073656375726974792C20616E64206461746120696E746567726974792E204C6561726E20616476616E63656420746563686E697175657320696E20646570746820736F20796F752063616E206272696E67206F7574204D7953514C27732066756C6C20706F7765722E22202846726F6D2074686520626F6F6B206465736372697074696F6E206174204F275265696C6C7929200A0A2020202020202A204D7953514C2041646D696E20436F6F6B626F6F6B0A2020202020202020202020206F204120717569636B20737465702D62792D7374657020677569646520666F72204D7953514C20757365727320616E642064617461626173652061646D696E6973747261746F727320746F207461636B6C65207265616C2D776F726C64206368616C6C656E6765732077697468204D7953514C20636F6E66696775726174696F6E20616E642061646D696E697374726174696F6E200A0A2020202020202A204D7953514C20352E302043657274696669636174696F6E2053747564792047756964652C204279205061756C204475426F69732C2053746566616E2048696E7A2C204361727374656E20506564657273656E0A2020202020202020202020206F205468697320697320746865206F6666696369616C20677569646520746F20636F766572207468652070617373696E67206F66207468652074776F204D7953514C2043657274696669636174696F6E206578616D696E6174696F6E732E2049742069732076616C69642074696C6C2076657273696F6E20352E30206F6620746865207365727665722C20736F207768696C65206974206D697373657320616C6C2074686520666561747572657320617661696C61626C6520696E204D7953514C20352E3120616E6420677265617465722028696E636C7564696E67204D61726961444220352E3120616E642067726561746572292C2069742070726F7669646573206120676F6F6420626173696320756E6465727374616E64696E67206F66204D7953514C20666F722074686520656E642D757365722E20 +INSERT INTO t1 (v0,v1,v64,v65000) VALUES ('y', 'yy', REPEAT('c',65), REPEAT('abcdefghi ',6501)); +Warnings: +Warning 1265 Data truncated for column 'v0' at row 1 +Warning 1265 Data truncated for column 'v1' at row 1 +Warning 1265 Data truncated for column 'v64' at row 1 +Warning 1265 Data truncated for column 'v65000' at row 1 +INSERT INTO t1 (v0,v1,v64,v65000) SELECT v65000, v65000, v65000, CONCAT(v65000,v1) FROM t1; +Warnings: +Warning 1265 Data truncated for column 'v0' at row 2 +Warning 1265 Data truncated for column 'v1' at row 2 +Warning 1265 Data truncated for column 'v64' at row 2 +Warning 1265 Data truncated for column 'v0' at row 3 +Warning 1265 Data truncated for column 'v1' at row 3 +Warning 1265 Data truncated for column 'v64' at row 3 +Warning 1265 Data truncated for column 'v65000' at row 3 +SELECT HEX(v0), HEX(v1), HEX(v64), LENGTH(HEX(v65000)) FROM t1; +HEX(v0) HEX(v1) HEX(v64) LENGTH(HEX(v65000)) + 0 + 0 + 48 486572652069732061206C697374206F66207265636F6D6D656E64656420626F6F6B73206F6E204D61726961444220616E64204D7953514C2E20576527766520 5932 + 61 61626364656667686920616263646566676869206162636465666768692061626364656667686920616263646566676869206162636465666768692061626364 130000 + 79 4F6E63652074686572652C20646F75626C6520636865636B207468617420616E2061727469636C6520646F65736E277420616C7265616479206578697374 5930 + 79 63636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363 130000 +ALTER TABLE t1 ADD COLUMN v65536 VARBINARY(65536) <CUSTOM_COL_OPTIONS> NOT NULL; +Warnings: +Note 1246 Converting column 'v65536' from VARBINARY to BLOB +Note 1246 Converting column 'v65536' from VARBINARY to BLOB +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +v0 varbinary(0) # # # +v1 varbinary(1) # # # +v64 varbinary(64) # # # +v65000 varbinary(65000) # # # +v65536 mediumblob # # # +DROP TABLE t1, t2; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c VARBINARY(64) <CUSTOM_COL_OPTIONS> NOT NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c varbinary(64) NO NULL +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +DROP TABLE t1; +CREATE TABLE t1 (c VARBINARY(64) <CUSTOM_COL_OPTIONS> NOT NULL, +c2 VARBINARY(64) <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT 'test' +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c varbinary(64) NO NULL +c2 varbinary(64) NO test +ALTER TABLE t1 ADD COLUMN err VARBINARY(64) <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT NULL; +ERROR 42000: Invalid default value for 'err' +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +SELECT HEX(c), HEX(c2) FROM t1; +HEX(c) HEX(c2) +INSERT INTO t1 (c2) VALUES (NULL); +ERROR 23000: Column 'c2' cannot be null +INSERT INTO t1 (c) VALUES ('test'); +SELECT COUNT(c), COUNT(c2) FROM t1; +COUNT(c) COUNT(c2) +1 1 +DROP TABLE t1; +# +# BIT columns +# +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a BIT <CUSTOM_COL_OPTIONS> NOT NULL, +b BIT(20) <CUSTOM_COL_OPTIONS> NOT NULL, +c BIT(64) <CUSTOM_COL_OPTIONS> NOT NULL, +d BIT(1) <CUSTOM_COL_OPTIONS> NOT NULL +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +a bit(1) # # # +b bit(20) # # # +c bit(64) # # # +d bit(1) # # # +ALTER TABLE t1 DROP COLUMN d; +ALTER TABLE t1 ADD COLUMN d BIT(0) <CUSTOM_COL_OPTIONS> NOT NULL; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +a bit(1) # # # +b bit(20) # # # +c bit(64) # # # +d bit(1) # # # +INSERT INTO t1 VALUES (0,POW(2,20)-1,b'1111111111111111111111111111111111111111111111111111111111111111',1); +SELECT BIN(a), HEX(b), c+0 FROM t1 WHERE d>0; +BIN(a) HEX(b) c+0 +0 FFFFF 18446744073709551615 +INSERT INTO t1 VALUES (1,0,-1,0); +SELECT a+0, b+0, c+0 FROM t1 WHERE d<100; +a+0 b+0 c+0 +0 1048575 18446744073709551615 +1 0 18446744073709551615 +INSERT INTO t1 VALUES (b'1', 'f', 0xFF, 0x0); +SELECT a+0, b+0, c+0 FROM t1 WHERE d IN (0, 2); +a+0 b+0 c+0 +1 0 18446744073709551615 +1 102 255 +INSERT INTO t1 VALUES (0x10,0,0,1); +Warnings: +Warning 1264 Out of range value for column 'a' at row 1 +SELECT * FROM t1; +a b c d +INSERT INTO t1 VALUES (0x01,0,0x10000000000000000,0); +Warnings: +Warning 1264 Out of range value for column 'c' at row 1 +SELECT * FROM t1; +a b c d +DROP TABLE t1; +CREATE TABLE t1 (a BIT(65) <CUSTOM_COL_OPTIONS> NOT NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +ERROR 42000: Display width out of range for 'a' (max = 64) +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c BIT <CUSTOM_COL_OPTIONS> NOT NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c bit(1) NO NULL +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +DROP TABLE t1; +CREATE TABLE t1 (c BIT <CUSTOM_COL_OPTIONS> NOT NULL, +c2 BIT <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT 1 +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c bit(1) NO NULL +c2 bit(1) NO b'1' +ALTER TABLE t1 ADD COLUMN err BIT <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT NULL; +ERROR 42000: Invalid default value for 'err' +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +SELECT HEX(c), HEX(c2) FROM t1; +HEX(c) HEX(c2) +INSERT INTO t1 (c2) VALUES (NULL); +ERROR 23000: Column 'c2' cannot be null +INSERT INTO t1 (c) VALUES (1); +SELECT COUNT(c), COUNT(c2) FROM t1; +COUNT(c) COUNT(c2) +1 1 +DROP TABLE t1; +# +# BLOB columns +# +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (b BLOB <CUSTOM_COL_OPTIONS> NOT NULL, +b0 BLOB(0) <CUSTOM_COL_OPTIONS> NOT NULL, +b1 BLOB(1) <CUSTOM_COL_OPTIONS> NOT NULL, +b300 BLOB(300) <CUSTOM_COL_OPTIONS> NOT NULL, +bm BLOB(65535) <CUSTOM_COL_OPTIONS> NOT NULL, +b70k BLOB(70000) <CUSTOM_COL_OPTIONS> NOT NULL, +b17m BLOB(17000000) <CUSTOM_COL_OPTIONS> NOT NULL, +t TINYBLOB <CUSTOM_COL_OPTIONS> NOT NULL, +m MEDIUMBLOB <CUSTOM_COL_OPTIONS> NOT NULL, +l LONGBLOB <CUSTOM_COL_OPTIONS> NOT NULL +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +b blob # # # +b0 blob # # # +b1 tinyblob # # # +b300 blob # # # +bm blob # # # +b70k mediumblob # # # +b17m longblob # # # +t tinyblob # # # +m mediumblob # # # +l longblob # # # +INSERT INTO t1 VALUES +('','','','','','','','','',''), +('a','b','c','d','e','f','g','h','i','j'), +('test1','test2','test3','test4','test5','test6','test7','test8','test9','test10'), +( REPEAT('a',65535), REPEAT('b',65535), REPEAT('c',255), REPEAT('d',65535), REPEAT('e',65535), REPEAT('f',1048576), HEX(REPEAT('g',1048576)), REPEAT('h',255), REPEAT('i',1048576), HEX(REPEAT('j',1048576)) ); +SELECT LENGTH(b), LENGTH(b0), LENGTH(b1), LENGTH(b300), LENGTH(bm), LENGTH(b70k), LENGTH(b17m), LENGTH(t), LENGTH(m), LENGTH(l) FROM t1; +LENGTH(b) LENGTH(b0) LENGTH(b1) LENGTH(b300) LENGTH(bm) LENGTH(b70k) LENGTH(b17m) LENGTH(t) LENGTH(m) LENGTH(l) +0 0 0 0 0 0 0 0 0 0 +1 1 1 1 1 1 1 1 1 1 +5 5 5 5 5 5 5 5 5 6 +65535 65535 255 65535 65535 1048576 2097152 255 1048576 2097152 +INSERT INTO t1 VALUES +( REPEAT('a',65536), REPEAT('b',65536), REPEAT('c',256), REPEAT('d',65536), REPEAT('e',65536), REPEAT('f',1048576), REPEAT('g',1048576), REPEAT('h',256), REPEAT('i',1048576), REPEAT('j',1048576) ); +Warnings: +Warning 1265 Data truncated for column 'b' at row 1 +Warning 1265 Data truncated for column 'b0' at row 1 +Warning 1265 Data truncated for column 'b1' at row 1 +Warning 1265 Data truncated for column 'b300' at row 1 +Warning 1265 Data truncated for column 'bm' at row 1 +Warning 1265 Data truncated for column 't' at row 1 +SELECT LENGTH(b), LENGTH(b0), LENGTH(b1), LENGTH(b300), LENGTH(bm), LENGTH(b70k), LENGTH(b17m), LENGTH(t), LENGTH(m), LENGTH(l) FROM t1; +LENGTH(b) LENGTH(b0) LENGTH(b1) LENGTH(b300) LENGTH(bm) LENGTH(b70k) LENGTH(b17m) LENGTH(t) LENGTH(m) LENGTH(l) +0 0 0 0 0 0 0 0 0 0 +1 1 1 1 1 1 1 1 1 1 +5 5 5 5 5 5 5 5 5 6 +65535 65535 255 65535 65535 1048576 1048576 255 1048576 1048576 +65535 65535 255 65535 65535 1048576 2097152 255 1048576 2097152 +ALTER TABLE t1 ADD COLUMN bbb BLOB(4294967296); +ERROR 42000: Display width out of range for 'bbb' (max = 4294967295) +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c BLOB <CUSTOM_COL_OPTIONS> NOT NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c blob NO NULL +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c TINYBLOB <CUSTOM_COL_OPTIONS> NOT NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c tinyblob NO NULL +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c MEDIUMBLOB <CUSTOM_COL_OPTIONS> NOT NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c mediumblob NO NULL +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c LONGBLOB <CUSTOM_COL_OPTIONS> NOT NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c longblob NO NULL +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +DROP TABLE t1; +# +# BOOL columns +# +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (b1 BOOL <CUSTOM_COL_OPTIONS> NOT NULL, +b2 BOOLEAN <CUSTOM_COL_OPTIONS> NOT NULL +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +b1 tinyint(1) # # # +b2 tinyint(1) # # # +INSERT INTO t1 VALUES (1,TRUE); +SELECT * FROM t1; +b1 b2 +1 1 +INSERT INTO t1 VALUES (FALSE,0); +SELECT * FROM t1; +b1 b2 +0 0 +1 1 +INSERT INTO t1 VALUES (2,3); +SELECT * FROM t1; +b1 b2 +0 0 +1 1 +2 3 +INSERT INTO t1 VALUES (-1,-2); +SELECT * FROM t1; +b1 b2 +-1 -2 +0 0 +1 1 +2 3 +SELECT IF(b1,'true','false') AS a, IF(b2,'true','false') AS b FROM t1; +a b +false false +true true +true true +true true +SELECT * FROM t1 WHERE b1 = TRUE; +b1 b2 +1 1 +SELECT * FROM t1 WHERE b2 = FALSE; +b1 b2 +0 0 +INSERT INTO t1 VALUES ('a','b'); +Warnings: +Warning 1366 Incorrect integer value: 'a' for column 'b1' at row 1 +Warning 1366 Incorrect integer value: 'b' for column 'b2' at row 1 +SELECT * FROM t1; +b1 b2 +-1 -2 +0 0 +0 0 +1 1 +2 3 +INSERT INTO t1 VALUES (128,-129); +Warnings: +Warning 1264 Out of range value for column 'b1' at row 1 +Warning 1264 Out of range value for column 'b2' at row 1 +SELECT * FROM t1; +b1 b2 +-1 -2 +0 0 +0 0 +1 1 +127 -128 +2 3 +ALTER TABLE t1 ADD COLUMN b3 BOOLEAN UNSIGNED; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'UNSIGNED' at line 1 +ALTER TABLE t1 ADD COLUMN b3 BOOL ZEROFILL; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'ZEROFILL' at line 1 +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c BOOL <CUSTOM_COL_OPTIONS> NOT NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c tinyint(1) NO NULL +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +DROP TABLE t1; +CREATE TABLE t1 (c BOOL <CUSTOM_COL_OPTIONS> NOT NULL, +c2 BOOL <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT '0' +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c tinyint(1) NO NULL +c2 tinyint(1) NO 0 +ALTER TABLE t1 ADD COLUMN err BOOL <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT NULL; +ERROR 42000: Invalid default value for 'err' +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +SELECT HEX(c), HEX(c2) FROM t1; +HEX(c) HEX(c2) +INSERT INTO t1 (c2) VALUES (NULL); +ERROR 23000: Column 'c2' cannot be null +INSERT INTO t1 (c) VALUES ('0'); +SELECT COUNT(c), COUNT(c2) FROM t1; +COUNT(c) COUNT(c2) +1 1 +DROP TABLE t1; +# +# CHAR columns +# +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c CHAR <CUSTOM_COL_OPTIONS> NOT NULL, +c0 CHAR(0) <CUSTOM_COL_OPTIONS> NOT NULL, +c1 CHAR(1) <CUSTOM_COL_OPTIONS> NOT NULL, +c20 CHAR(20) <CUSTOM_COL_OPTIONS> NOT NULL, +c255 CHAR(255) <CUSTOM_COL_OPTIONS> NOT NULL +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c char(1) # # # +c0 char(0) # # # +c1 char(1) # # # +c20 char(20) # # # +c255 char(255) # # # +INSERT INTO t1 VALUES ('','','','',''); +INSERT INTO t1 VALUES ('a','','b','abcdefghi klmnopqrst', 'Creating an article for the Knowledgebase is similar to asking questions. First, navigate to the category where you feel the article should be. Once there, double check that an article doesn\'t already exist which would work.'); +SELECT * FROM t1; +c c0 c1 c20 c255 + +a b abcdefghi klmnopqrst Creating an article for the Knowledgebase is similar to asking questions. First, navigate to the category where you feel the article should be. Once there, double check that an article doesn't already exist which would work. +INSERT INTO t1 VALUES ('abc', 'a', 'abc', REPEAT('a',21), REPEAT('x',256)); +Warnings: +Warning 1265 Data truncated for column 'c' at row 1 +Warning 1265 Data truncated for column 'c0' at row 1 +Warning 1265 Data truncated for column 'c1' at row 1 +Warning 1265 Data truncated for column 'c20' at row 1 +Warning 1265 Data truncated for column 'c255' at row 1 +INSERT INTO t1 SELECT c255, c255, c255, c255, CONCAT(c255,c1) FROM t1; +Warnings: +Warning 1265 Data truncated for column 'c' at row 2 +Warning 1265 Data truncated for column 'c0' at row 2 +Warning 1265 Data truncated for column 'c1' at row 2 +Warning 1265 Data truncated for column 'c20' at row 2 +Warning 1265 Data truncated for column 'c' at row 3 +Warning 1265 Data truncated for column 'c0' at row 3 +Warning 1265 Data truncated for column 'c1' at row 3 +Warning 1265 Data truncated for column 'c20' at row 3 +Warning 1265 Data truncated for column 'c255' at row 3 +SELECT * FROM t1; +c c0 c1 c20 c255 + + +C C Creating an article Creating an article for the Knowledgebase is similar to asking questions. First, navigate to the category where you feel the article should be. Once there, double check that an article doesn't already exist which would work.b +a a aaaaaaaaaaaaaaaaaaaa xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +a b abcdefghi klmnopqrst Creating an article for the Knowledgebase is similar to asking questions. First, navigate to the category where you feel the article should be. Once there, double check that an article doesn't already exist which would work. +x x xxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +SELECT DISTINCT c20, REPEAT('a',LENGTH(c20)), COUNT(*) FROM t1 GROUP BY c1, c20; +c20 REPEAT('a',LENGTH(c20)) COUNT(*) + 2 +Creating an article aaaaaaaaaaaaaaaaaaa 1 +aaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaa 1 +abcdefghi klmnopqrst aaaaaaaaaaaaaaaaaaaa 1 +xxxxxxxxxxxxxxxxxxxx aaaaaaaaaaaaaaaaaaaa 1 +ALTER TABLE t1 ADD COLUMN c257 CHAR(257) <CUSTOM_COL_OPTIONS> NOT NULL; +ERROR 42000: Column length too big for column 'c257' (max = 255); use BLOB or TEXT instead +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c CHAR <CUSTOM_COL_OPTIONS> NOT NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c char(1) NO NULL +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +DROP TABLE t1; +CREATE TABLE t1 (c CHAR <CUSTOM_COL_OPTIONS> NOT NULL, +c2 CHAR <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT '_' +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c char(1) NO NULL +c2 char(1) NO _ +ALTER TABLE t1 ADD COLUMN err CHAR <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT NULL; +ERROR 42000: Invalid default value for 'err' +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +SELECT HEX(c), HEX(c2) FROM t1; +HEX(c) HEX(c2) +INSERT INTO t1 (c2) VALUES (NULL); +ERROR 23000: Column 'c2' cannot be null +INSERT INTO t1 (c) VALUES ('_'); +SELECT COUNT(c), COUNT(c2) FROM t1; +COUNT(c) COUNT(c2) +1 1 +DROP TABLE t1; +# +# VARCHAR columns +# +DROP TABLE IF EXISTS t1, t2; +CREATE TABLE t1 (v0 VARCHAR(0) <CUSTOM_COL_OPTIONS> NOT NULL, +v1 VARCHAR(1) <CUSTOM_COL_OPTIONS> NOT NULL, +v64 VARCHAR(64) <CUSTOM_COL_OPTIONS> NOT NULL, +v65000 VARCHAR(65000) <CUSTOM_COL_OPTIONS> NOT NULL +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +v0 varchar(0) # # # +v1 varchar(1) # # # +v64 varchar(64) # # # +v65000 varchar(65000) # # # +CREATE TABLE t2 (v VARCHAR(65532) <CUSTOM_COL_OPTIONS> NOT NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t2; +Field Type Null Key Default Extra +v varchar(65532) # # # +INSERT INTO t1 (v0,v1,v64,v65000) VALUES ('','','',''); +INSERT INTO t1 (v0,v1,v64,v65000) VALUES ('','y','Once there, double check that an article doesn\'t already exist','Here is a list of recommended books on MariaDB and MySQL. We\'ve provided links to Amazon.com here for convenience, but they can be found at many other bookstores, both online and off. + + If you want to have your favorite MySQL / MariaDB book listed here, please leave a comment. + For developers who want to code on MariaDB or MySQL + + * Understanding MySQL Internals by Sasha Pachev, former MySQL developer at MySQL AB. + o This is the only book we know about that describes the internals of MariaDB / MySQL. A must have for anyone who wants to understand and develop on MariaDB! + o Not all topics are covered and some parts are slightly outdated, but still the best book on this topic. + * MySQL 5.1 Plugin Development by Sergei Golubchik and Andrew Hutchings + o A must read for anyone wanting to write a plugin for MariaDB, written by the Sergei who designed the plugin interface for MySQL and MariaDB! + + For MariaDB / MySQL end users + + * MariaDB Crash Course by Ben Forta + o First MariaDB book! + o For people who want to learn SQL and the basics of MariaDB. + o Now shipping. Purchase at Amazon.com or your favorite bookseller. + + * SQL-99 Complete, Really by Peter Gulutzan & Trudy Pelzer. + o Everything you wanted to know about the SQL 99 standard. Excellent reference book! + o Free to read in the Knowledgebase! + + * MySQL (4th Edition) by Paul DuBois + o The \'default\' book to read if you wont to learn to use MySQL / MariaDB. + + * MySQL Cookbook by Paul DuBois + o A lot of examples of how to use MySQL. As with all of Paul\'s books, it\'s worth its weight in gold and even enjoyable reading for such a \'dry\' subject. + + * High Performance MySQL, Second Edition, By Baron Schwartz, Peter Zaitsev, Vadim Tkachenko, Jeremy D. Zawodny, Arjen Lentz, Derek J. Balling, et al. + o \"High Performance MySQL is the definitive guide to building fast, reliable systems with MySQL. Written by noted experts with years of real-world experience building very large systems, this book covers every aspect of MySQL performance in detail, and focuses on robustness, security, and data integrity. Learn advanced techniques in depth so you can bring out MySQL\'s full power.\" (From the book description at O\'Reilly) + + * MySQL Admin Cookbook + o A quick step-by-step guide for MySQL users and database administrators to tackle real-world challenges with MySQL configuration and administration + + * MySQL 5.0 Certification Study Guide, By Paul DuBois, Stefan Hinz, Carsten Pedersen + o This is the official guide to cover the passing of the two MySQL Certification examinations. It is valid till version 5.0 of the server, so while it misses all the features available in MySQL 5.1 and greater (including MariaDB 5.1 and greater), it provides a good basic understanding of MySQL for the end-user. '); +SELECT * FROM t1; +v0 v1 v64 v65000 + + + + + + + + + + + + y Once there, double check that an article doesn't already exist Here is a list of recommended books on MariaDB and MySQL. We've provided links to Amazon.com here for convenience, but they can be found at many other bookstores, both online and off. + o "High Performance MySQL is the definitive guide to building fast, reliable systems with MySQL. Written by noted experts with years of real-world experience building very large systems, this book covers every aspect of MySQL performance in detail, and focuses on robustness, security, and data integrity. Learn advanced techniques in depth so you can bring out MySQL's full power." (From the book description at O'Reilly) + o A lot of examples of how to use MySQL. As with all of Paul's books, it's worth its weight in gold and even enjoyable reading for such a 'dry' subject. + o A must read for anyone wanting to write a plugin for MariaDB, written by the Sergei who designed the plugin interface for MySQL and MariaDB! + o A quick step-by-step guide for MySQL users and database administrators to tackle real-world challenges with MySQL configuration and administration + o Everything you wanted to know about the SQL 99 standard. Excellent reference book! + o First MariaDB book! + o For people who want to learn SQL and the basics of MariaDB. + o Free to read in the Knowledgebase! + o Not all topics are covered and some parts are slightly outdated, but still the best book on this topic. + o Now shipping. Purchase at Amazon.com or your favorite bookseller. + o The 'default' book to read if you wont to learn to use MySQL / MariaDB. + o This is the official guide to cover the passing of the two MySQL Certification examinations. It is valid till version 5.0 of the server, so while it misses all the features available in MySQL 5.1 and greater (including MariaDB 5.1 and greater), it provides a good basic understanding of MySQL for the end-user. + o This is the only book we know about that describes the internals of MariaDB / MySQL. A must have for anyone who wants to understand and develop on MariaDB! + * High Performance MySQL, Second Edition, By Baron Schwartz, Peter Zaitsev, Vadim Tkachenko, Jeremy D. Zawodny, Arjen Lentz, Derek J. Balling, et al. + * MariaDB Crash Course by Ben Forta + * MySQL (4th Edition) by Paul DuBois + * MySQL 5.0 Certification Study Guide, By Paul DuBois, Stefan Hinz, Carsten Pedersen + * MySQL 5.1 Plugin Development by Sergei Golubchik and Andrew Hutchings + * MySQL Admin Cookbook + * MySQL Cookbook by Paul DuBois + * SQL-99 Complete, Really by Peter Gulutzan & Trudy Pelzer. + * Understanding MySQL Internals by Sasha Pachev, former MySQL developer at MySQL AB. + For MariaDB / MySQL end users + For developers who want to code on MariaDB or MySQL + If you want to have your favorite MySQL / MariaDB book listed here, please leave a comment. +INSERT INTO t1 (v0,v1,v64,v65000) VALUES ('y', 'yy', REPEAT('c',65), REPEAT('abcdefghi ',6501)); +Warnings: +Warning 1265 Data truncated for column 'v0' at row 1 +Warning 1265 Data truncated for column 'v1' at row 1 +Warning 1265 Data truncated for column 'v64' at row 1 +Warning 1265 Data truncated for column 'v65000' at row 1 +INSERT INTO t1 (v0,v1,v64,v65000) SELECT v65000, v65000, v65000, CONCAT(v65000,v1) FROM t1; +Warnings: +Warning 1265 Data truncated for column 'v0' at row 2 +Warning 1265 Data truncated for column 'v1' at row 2 +Warning 1265 Data truncated for column 'v64' at row 2 +Warning 1265 Data truncated for column 'v0' at row 3 +Warning 1265 Data truncated for column 'v1' at row 3 +Warning 1265 Data truncated for column 'v64' at row 3 +Warning 1265 Data truncated for column 'v65000' at row 3 +SELECT v0, v1, v64, LENGTH(v65000) FROM t1; +v0 v1 v64 LENGTH(v65000) + 0 + 0 + H Here is a list of recommended books on MariaDB and MySQL. We've 2966 + a abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcd 65000 + y Once there, double check that an article doesn't already exist 2965 + y cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc 65000 +ALTER TABLE t1 ADD COLUMN v65536 VARCHAR(65536) <CUSTOM_COL_OPTIONS> NOT NULL; +Warnings: +Note 1246 Converting column 'v65536' from VARCHAR to TEXT +Note 1246 Converting column 'v65536' from VARCHAR to TEXT +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +v0 varchar(0) # # # +v1 varchar(1) # # # +v64 varchar(64) # # # +v65000 varchar(65000) # # # +v65536 mediumtext # # # +DROP TABLE t1, t2; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c VARCHAR(64) <CUSTOM_COL_OPTIONS> NOT NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c varchar(64) NO NULL +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +DROP TABLE t1; +CREATE TABLE t1 (c VARCHAR(64) <CUSTOM_COL_OPTIONS> NOT NULL, +c2 VARCHAR(64) <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT 'test default' +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c varchar(64) NO NULL +c2 varchar(64) NO test default +ALTER TABLE t1 ADD COLUMN err VARCHAR(64) <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT NULL; +ERROR 42000: Invalid default value for 'err' +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +SELECT HEX(c), HEX(c2) FROM t1; +HEX(c) HEX(c2) +INSERT INTO t1 (c2) VALUES (NULL); +ERROR 23000: Column 'c2' cannot be null +INSERT INTO t1 (c) VALUES ('test default'); +SELECT COUNT(c), COUNT(c2) FROM t1; +COUNT(c) COUNT(c2) +1 1 +DROP TABLE t1; +# +# date and time columns +# +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (d DATE <CUSTOM_COL_OPTIONS> NOT NULL, +dt DATETIME <CUSTOM_COL_OPTIONS> NOT NULL, +ts TIMESTAMP <CUSTOM_COL_OPTIONS> NOT NULL, +t TIME <CUSTOM_COL_OPTIONS> NOT NULL, +y YEAR <CUSTOM_COL_OPTIONS> NOT NULL, +y4 YEAR(4) <CUSTOM_COL_OPTIONS> NOT NULL, +y2 YEAR(2) <CUSTOM_COL_OPTIONS> NOT NULL +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +d date # # # +dt datetime # # # +ts timestamp # # # on update CURRENT_TIMESTAMP +t time # # # +y year(4) # # # +y4 year(4) # # # +y2 year(2) # # # +SET @tm = '2012-04-09 05:27:00'; +INSERT INTO t1 VALUES +('1000-01-01', '1000-01-01 00:00:00', FROM_UNIXTIME(1), '-838:59:59', '1901', '1901', '00'), +('9999-12-31', '9999-12-31 23:59:59', FROM_UNIXTIME(2147483647), '838:59:59', '2155', '2155', '99'), +('0000-00-00', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '00:00:00', '0', '0', '0'), +(DATE(@tm),@tm,TIMESTAMP(@tm),TIME(@tm),YEAR(@tm),YEAR(@tm),YEAR(@tm)); +SELECT * FROM t1; +d dt ts t y y4 y2 +0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 00:00:00 2000 2000 00 +1000-01-01 1000-01-01 00:00:00 1970-01-01 03:00:01 -838:59:59 1901 1901 00 +2012-04-09 2012-04-09 05:27:00 2012-04-09 05:27:00 05:27:00 2012 2012 12 +9999-12-31 9999-12-31 23:59:59 2038-01-19 07:14:07 838:59:59 2155 2155 99 +INSERT INTO t1 VALUES +('999-13-32', '999-11-31 00:00:00', '0', '-839:00:00', '1900', '1900', '-1' ); +Warnings: +Warning 1265 Data truncated for column 'd' at row 1 +Warning 1265 Data truncated for column 'dt' at row 1 +Warning 1265 Data truncated for column 'ts' at row 1 +Warning 1264 Out of range value for column 't' at row 1 +Warning 1264 Out of range value for column 'y' at row 1 +Warning 1264 Out of range value for column 'y4' at row 1 +Warning 1264 Out of range value for column 'y2' at row 1 +SELECT * FROM t1; +d dt ts t y y4 y2 +0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 -838:59:59 0000 0000 00 +0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 00:00:00 2000 2000 00 +1000-01-01 1000-01-01 00:00:00 1970-01-01 03:00:01 -838:59:59 1901 1901 00 +2012-04-09 2012-04-09 05:27:00 2012-04-09 05:27:00 05:27:00 2012 2012 12 +9999-12-31 9999-12-31 23:59:59 2038-01-19 07:14:07 838:59:59 2155 2155 99 +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c DATE <CUSTOM_COL_OPTIONS> NOT NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c date NO NULL +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +DROP TABLE t1; +CREATE TABLE t1 (c DATE <CUSTOM_COL_OPTIONS> NOT NULL, +c2 DATE <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT '2012-12-21' +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c date NO NULL +c2 date NO 2012-12-21 +ALTER TABLE t1 ADD COLUMN err DATE <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT NULL; +ERROR 42000: Invalid default value for 'err' +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +SELECT HEX(c), HEX(c2) FROM t1; +HEX(c) HEX(c2) +INSERT INTO t1 (c2) VALUES (NULL); +ERROR 23000: Column 'c2' cannot be null +INSERT INTO t1 (c) VALUES ('2012-12-21'); +SELECT COUNT(c), COUNT(c2) FROM t1; +COUNT(c) COUNT(c2) +1 1 +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c DATETIME <CUSTOM_COL_OPTIONS> NOT NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c datetime NO NULL +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +DROP TABLE t1; +CREATE TABLE t1 (c DATETIME <CUSTOM_COL_OPTIONS> NOT NULL, +c2 DATETIME <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT '2012-12-21 12:21:12' +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c datetime NO NULL +c2 datetime NO 2012-12-21 12:21:12 +ALTER TABLE t1 ADD COLUMN err DATETIME <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT NULL; +ERROR 42000: Invalid default value for 'err' +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +SELECT HEX(c), HEX(c2) FROM t1; +HEX(c) HEX(c2) +INSERT INTO t1 (c2) VALUES (NULL); +ERROR 23000: Column 'c2' cannot be null +INSERT INTO t1 (c) VALUES ('2012-12-21 12:21:12'); +SELECT COUNT(c), COUNT(c2) FROM t1; +COUNT(c) COUNT(c2) +1 1 +DROP TABLE t1; +CREATE TABLE t1 (c TIMESTAMP <CUSTOM_COL_OPTIONS> NOT NULL, +c2 TIMESTAMP <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT '2012-02-21 12:21:12' +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +ALTER TABLE t1 ADD COLUMN err TIMESTAMP <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT NULL; +ERROR 42000: Invalid default value for 'err' +INSERT INTO t1 (c) VALUES (NULL); +INSERT INTO t1 (c2) VALUES (NULL); +SELECT c, c2 FROM t1; +c c2 +<TIMESTAMP> <DEFAULT_TIMESTAMP> +<TIMESTAMP> <TIMESTAMP> +DROP TABLE t1; +CREATE TABLE t1 (c TIMESTAMP <CUSTOM_COL_OPTIONS> NOT NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c timestamp NO CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP +INSERT INTO t1 (c) VALUES (NULL); +SELECT * FROM t1; +c +<TIMESTAMP> +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c TIME <CUSTOM_COL_OPTIONS> NOT NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c time NO NULL +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +DROP TABLE t1; +CREATE TABLE t1 (c TIME <CUSTOM_COL_OPTIONS> NOT NULL, +c2 TIME <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT '12:21:12' +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c time NO NULL +c2 time NO 12:21:12 +ALTER TABLE t1 ADD COLUMN err TIME <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT NULL; +ERROR 42000: Invalid default value for 'err' +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +SELECT HEX(c), HEX(c2) FROM t1; +HEX(c) HEX(c2) +INSERT INTO t1 (c2) VALUES (NULL); +ERROR 23000: Column 'c2' cannot be null +INSERT INTO t1 (c) VALUES ('12:21:12'); +SELECT COUNT(c), COUNT(c2) FROM t1; +COUNT(c) COUNT(c2) +1 1 +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c YEAR <CUSTOM_COL_OPTIONS> NOT NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c year(4) NO NULL +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +DROP TABLE t1; +CREATE TABLE t1 (c YEAR <CUSTOM_COL_OPTIONS> NOT NULL, +c2 YEAR <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT '2012' +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c year(4) NO NULL +c2 year(4) NO 2012 +ALTER TABLE t1 ADD COLUMN err YEAR <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT NULL; +ERROR 42000: Invalid default value for 'err' +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +SELECT HEX(c), HEX(c2) FROM t1; +HEX(c) HEX(c2) +INSERT INTO t1 (c2) VALUES (NULL); +ERROR 23000: Column 'c2' cannot be null +INSERT INTO t1 (c) VALUES ('2012'); +SELECT COUNT(c), COUNT(c2) FROM t1; +COUNT(c) COUNT(c2) +1 1 +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c YEAR(2) <CUSTOM_COL_OPTIONS> NOT NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c year(2) NO NULL +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +DROP TABLE t1; +CREATE TABLE t1 (c YEAR(2) <CUSTOM_COL_OPTIONS> NOT NULL, +c2 YEAR(2) <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT '12' +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c year(2) NO NULL +c2 year(2) NO 12 +ALTER TABLE t1 ADD COLUMN err YEAR(2) <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT NULL; +ERROR 42000: Invalid default value for 'err' +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +SELECT HEX(c), HEX(c2) FROM t1; +HEX(c) HEX(c2) +INSERT INTO t1 (c2) VALUES (NULL); +ERROR 23000: Column 'c2' cannot be null +INSERT INTO t1 (c) VALUES ('12'); +SELECT COUNT(c), COUNT(c2) FROM t1; +COUNT(c) COUNT(c2) +1 1 +DROP TABLE t1; +# +# ENUM columns +# +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a ENUM('') <CUSTOM_COL_OPTIONS> NOT NULL, +b ENUM('test1','test2','test3','test4','test5') <CUSTOM_COL_OPTIONS> NOT NULL, +c ENUM('1','2','3','4','5','6','7','8','9','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',' ','11','12','13','14','15','16','17','18','19','1a','1b','1c','1d','1e','1f','1g','1h','1i','1j','1k','1l','1m','1n','1o','1p','1q','1r','1s','1t','1u','1v','1w','1x','1y','1z','20','21','22','23','24','25','26','27','28','29','2a','2b','2c','2d','2e','2f','2g','2h','2i','2j','2k','2l','2m','2n','2o','2p','2q','2r','2s','2t','2u','2v','2w','2x','2y','2z','30','31','32','33','34','35','36','37','38','39','3a','3b','3c','3d','3e','3f','3g','3h','3i','3j','3k','3l','3m','3n','3o','3p','3q','3r','3s','3t','3u','3v','3w','3x','3y','3z','40','41','42','43','44','45','46','47','48','49','4a','4b','4c','4d','4e','4f','4g','4h','4i','4j','4k','4l','4m','4n','4o','4p','4q','4r','4s','4t','4u','4v','4w','4x','4y','4z','50','51','52','53','54','55','56','57','58','59','5a','5b','5c','5d','5e','5f','5g','5h','5i','5j','5k','5l','5m','5n','5o','5p','5q','5r','5s','5t','5u','5v','5w','5x','5y','5z','60','61','62','63','64','65','66','67','68','69','6a','6b','6c','6d','6e','6f','6g','6h','6i','6j','6k','6l','6m','6n','6o','6p','6q','6r','6s','6t','6u','6v','6w','6x','6y','6z','70','71','72','73','74','75') <CUSTOM_COL_OPTIONS> NOT NULL +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +a enum('') # # # +b enum('test1','test2','test3','test4','test5') # # # +c enum('1','2','3','4','5','6','7','8','9','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','','11','12','13','14','15','16','17','18','19','1a','1b','1c','1d','1e','1f','1g','1h','1i','1j','1k','1l','1m','1n','1o','1p','1q','1r','1s','1t','1u','1v','1w','1x','1y','1z','20','21','22','23','24','25','26','27','28','29','2a','2b','2c','2d','2e','2f','2g','2h','2i','2j','2k','2l','2m','2n','2o','2p','2q','2r','2s','2t','2u','2v','2w','2x','2y','2z','30','31','32','33','34','35','36','37','38','39','3a','3b','3c','3d','3e','3f','3g','3h','3i','3j','3k','3l','3m','3n','3o','3p','3q','3r','3s','3t','3u','3v','3w','3x','3y','3z','40','41','42','43','44','45','46','47','48','49','4a','4b','4c','4d','4e','4f','4g','4h','4i','4j','4k','4l','4m','4n','4o','4p','4q','4r','4s','4t','4u','4v','4w','4x','4y','4z','50','51','52','53','54','55','56','57','58','59','5a','5b','5c','5d','5e','5f','5g','5h','5i','5j','5k','5l','5m','5n','5o','5p','5q','5r','5s','5t','5u','5v','5w','5x','5y','5z','60','61','62','63','64','65','66','67','68','69','6a','6b','6c','6d','6e','6f','6g','6h','6i','6j','6k','6l','6m','6n','6o','6p','6q','6r','6s','6t','6u','6v','6w','6x','6y','6z','70','71','72','73','74','75') # # # +INSERT INTO t1 VALUES ('','test2','4'),('',5,2); +SELECT * FROM t1; +a b c + test2 4 + test5 2 +INSERT INTO t1 VALUES (0,'test6',-1); +Warnings: +Warning 1265 Data truncated for column 'a' at row 1 +Warning 1265 Data truncated for column 'b' at row 1 +Warning 1265 Data truncated for column 'c' at row 1 +SELECT * FROM t1; +a b c + + test2 4 + test5 2 +ALTER TABLE t1 ADD COLUMN e ENUM('a','A') <CUSTOM_COL_OPTIONS> NOT NULL; +Warnings: +Note 1291 Column 'e' has duplicated value 'a' in ENUM +Note 1291 Column 'e' has duplicated value 'a' in ENUM +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +a enum('') # # # +b enum('test1','test2','test3','test4','test5') # # # +c enum('1','2','3','4','5','6','7','8','9','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','','11','12','13','14','15','16','17','18','19','1a','1b','1c','1d','1e','1f','1g','1h','1i','1j','1k','1l','1m','1n','1o','1p','1q','1r','1s','1t','1u','1v','1w','1x','1y','1z','20','21','22','23','24','25','26','27','28','29','2a','2b','2c','2d','2e','2f','2g','2h','2i','2j','2k','2l','2m','2n','2o','2p','2q','2r','2s','2t','2u','2v','2w','2x','2y','2z','30','31','32','33','34','35','36','37','38','39','3a','3b','3c','3d','3e','3f','3g','3h','3i','3j','3k','3l','3m','3n','3o','3p','3q','3r','3s','3t','3u','3v','3w','3x','3y','3z','40','41','42','43','44','45','46','47','48','49','4a','4b','4c','4d','4e','4f','4g','4h','4i','4j','4k','4l','4m','4n','4o','4p','4q','4r','4s','4t','4u','4v','4w','4x','4y','4z','50','51','52','53','54','55','56','57','58','59','5a','5b','5c','5d','5e','5f','5g','5h','5i','5j','5k','5l','5m','5n','5o','5p','5q','5r','5s','5t','5u','5v','5w','5x','5y','5z','60','61','62','63','64','65','66','67','68','69','6a','6b','6c','6d','6e','6f','6g','6h','6i','6j','6k','6l','6m','6n','6o','6p','6q','6r','6s','6t','6u','6v','6w','6x','6y','6z','70','71','72','73','74','75') # # # +e enum('a','A') # # # +INSERT INTO t1 VALUES ('','test3','75','A'); +SELECT * FROM t1; +a b c e + a + test2 4 a + test3 75 a + test5 2 a +SELECT * FROM t1 WHERE b='test2' OR a != ''; +a b c e + test2 4 a +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c ENUM('test1','test2','test3') <CUSTOM_COL_OPTIONS> NOT NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c enum('test1','test2','test3') NO NULL +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +DROP TABLE t1; +CREATE TABLE t1 (c ENUM('test1','test2','test3') <CUSTOM_COL_OPTIONS> NOT NULL, +c2 ENUM('test1','test2','test3') <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT 'test2' +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c enum('test1','test2','test3') NO NULL +c2 enum('test1','test2','test3') NO test2 +ALTER TABLE t1 ADD COLUMN err ENUM('test1','test2','test3') <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT NULL; +ERROR 42000: Invalid default value for 'err' +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +SELECT HEX(c), HEX(c2) FROM t1; +HEX(c) HEX(c2) +INSERT INTO t1 (c2) VALUES (NULL); +ERROR 23000: Column 'c2' cannot be null +INSERT INTO t1 (c) VALUES ('test2'); +SELECT COUNT(c), COUNT(c2) FROM t1; +COUNT(c) COUNT(c2) +1 1 +DROP TABLE t1; +# +# Fixed point columns (NUMERIC, DECIMAL) +# +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (d DECIMAL <CUSTOM_COL_OPTIONS> NOT NULL, +d0 DECIMAL(0) <CUSTOM_COL_OPTIONS> NOT NULL, +d1_1 DECIMAL(1,1) <CUSTOM_COL_OPTIONS> NOT NULL, +d10_2 DECIMAL(10,2) <CUSTOM_COL_OPTIONS> NOT NULL, +d60_10 DECIMAL(60,10) <CUSTOM_COL_OPTIONS> NOT NULL, +n NUMERIC <CUSTOM_COL_OPTIONS> NOT NULL, +n0_0 NUMERIC(0,0) <CUSTOM_COL_OPTIONS> NOT NULL, +n1 NUMERIC(1) <CUSTOM_COL_OPTIONS> NOT NULL, +n20_4 NUMERIC(20,4) <CUSTOM_COL_OPTIONS> NOT NULL, +n65_4 NUMERIC(65,4) <CUSTOM_COL_OPTIONS> NOT NULL +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +d decimal(10,0) # # # +d0 decimal(10,0) # # # +d1_1 decimal(1,1) # # # +d10_2 decimal(10,2) # # # +d60_10 decimal(60,10) # # # +n decimal(10,0) # # # +n0_0 decimal(10,0) # # # +n1 decimal(1,0) # # # +n20_4 decimal(20,4) # # # +n65_4 decimal(65,4) # # # +INSERT INTO t1 VALUES (100,123456,0.3,40000.25,123456789123456789.10001,1024,7000.0,8.0,999999.9,9223372036854775807); +INSERT INTO t1 VALUES (0,0,0,0,0,0,0,0,0,0); +INSERT INTO t1 VALUES (9999999999.0,9999999999.0,0.9,99999999.99,99999999999999999999999999999999999999999999999999.9999999999,9999999999.0,9999999999.0,9.0,9999999999999999.9999,9999999999999999999999999999999999999999999999999999999999999.9999); +SELECT * FROM t1; +d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 +0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 +100 123456 0.3 40000.25 123456789123456789.1000100000 1024 7000 8 999999.9000 9223372036854775807.0000 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +INSERT INTO t1 VALUES (-100,-123456,-0.3,-40000.25,-123456789123456789.10001,-1024,-7000.0,-8.0,-999999.9,-9223372036854775807); +INSERT INTO t1 VALUES (-9999999999.0,-9999999999.0,-0.9,-99999999.99,-99999999999999999999999999999999999999999999999999.9999999999,-9999999999.0,-9999999999.0,-9.0,-9999999999999999.9999,-9999999999999999999999999999999999999999999999999999999999999.9999); +SELECT * FROM t1; +d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 +-100 -123456 -0.3 -40000.25 -123456789123456789.1000100000 -1024 -7000 -8 -999999.9000 -9223372036854775807.0000 +-9999999999 -9999999999 -0.9 -99999999.99 -99999999999999999999999999999999999999999999999999.9999999999 -9999999999 -9999999999 -9 -9999999999999999.9999 -9999999999999999999999999999999999999999999999999999999999999.9999 +0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 +100 123456 0.3 40000.25 123456789123456789.1000100000 1024 7000 8 999999.9000 9223372036854775807.0000 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +SELECT * FROM t1 WHERE n20_4 = 9999999999999999.9999 OR d < 100; +d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 +-100 -123456 -0.3 -40000.25 -123456789123456789.1000100000 -1024 -7000 -8 -999999.9000 -9223372036854775807.0000 +-9999999999 -9999999999 -0.9 -99999999.99 -99999999999999999999999999999999999999999999999999.9999999999 -9999999999 -9999999999 -9 -9999999999999999.9999 -9999999999999999999999999999999999999999999999999999999999999.9999 +0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +INSERT INTO t1 SELECT n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4 FROM t1 WHERE n65_4 = ( SELECT MAX(n65_4) FROM t1 ); +Warnings: +Warning 1264 Out of range value for column 'd' at row 1 +Warning 1264 Out of range value for column 'd0' at row 1 +Warning 1264 Out of range value for column 'd1_1' at row 1 +Warning 1264 Out of range value for column 'd10_2' at row 1 +Warning 1264 Out of range value for column 'd60_10' at row 1 +Warning 1264 Out of range value for column 'n' at row 1 +Warning 1264 Out of range value for column 'n0_0' at row 1 +Warning 1264 Out of range value for column 'n1' at row 1 +Warning 1264 Out of range value for column 'n20_4' at row 1 +SELECT * FROM t1; +d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 +-100 -123456 -0.3 -40000.25 -123456789123456789.1000100000 -1024 -7000 -8 -999999.9000 -9223372036854775807.0000 +-9999999999 -9999999999 -0.9 -99999999.99 -99999999999999999999999999999999999999999999999999.9999999999 -9999999999 -9999999999 -9 -9999999999999999.9999 -9999999999999999999999999999999999999999999999999999999999999.9999 +0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 +100 123456 0.3 40000.25 123456789123456789.1000100000 1024 7000 8 999999.9000 9223372036854775807.0000 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +INSERT INTO t1 VALUES (10000000000.0,10000000000.0,1.1,100000000.99,100000000000000000000000000000000000000000000000000.0,10000000000.0,10000000000.0,10.0,10000000000000000.9999,10000000000000000000000000000000000000000000000000000000000000.9999); +Warnings: +Warning 1264 Out of range value for column 'd' at row 1 +Warning 1264 Out of range value for column 'd0' at row 1 +Warning 1264 Out of range value for column 'd1_1' at row 1 +Warning 1264 Out of range value for column 'd10_2' at row 1 +Warning 1264 Out of range value for column 'd60_10' at row 1 +Warning 1264 Out of range value for column 'n' at row 1 +Warning 1264 Out of range value for column 'n0_0' at row 1 +Warning 1264 Out of range value for column 'n1' at row 1 +Warning 1264 Out of range value for column 'n20_4' at row 1 +Warning 1264 Out of range value for column 'n65_4' at row 1 +SELECT * FROM t1; +d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 +-100 -123456 -0.3 -40000.25 -123456789123456789.1000100000 -1024 -7000 -8 -999999.9000 -9223372036854775807.0000 +-9999999999 -9999999999 -0.9 -99999999.99 -99999999999999999999999999999999999999999999999999.9999999999 -9999999999 -9999999999 -9 -9999999999999999.9999 -9999999999999999999999999999999999999999999999999999999999999.9999 +0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 +100 123456 0.3 40000.25 123456789123456789.1000100000 1024 7000 8 999999.9000 9223372036854775807.0000 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +INSERT INTO t1 VALUES (9999999999.1,9999999999.1,1.9,99999999.001,99999999999999999999999999999999999999999999999999.99999999991,9999999999.1,9999999999.1,9.1,9999999999999999.00001,9999999999999999999999999999999999999999999999999999999999999.11111); +Warnings: +Note 1265 Data truncated for column 'd' at row 1 +Note 1265 Data truncated for column 'd0' at row 1 +Warning 1264 Out of range value for column 'd1_1' at row 1 +Note 1265 Data truncated for column 'd10_2' at row 1 +Note 1265 Data truncated for column 'd60_10' at row 1 +Note 1265 Data truncated for column 'n' at row 1 +Note 1265 Data truncated for column 'n0_0' at row 1 +Note 1265 Data truncated for column 'n1' at row 1 +Note 1265 Data truncated for column 'n20_4' at row 1 +Note 1265 Data truncated for column 'n65_4' at row 1 +SELECT * FROM t1; +d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 +-100 -123456 -0.3 -40000.25 -123456789123456789.1000100000 -1024 -7000 -8 -999999.9000 -9223372036854775807.0000 +-9999999999 -9999999999 -0.9 -99999999.99 -99999999999999999999999999999999999999999999999999.9999999999 -9999999999 -9999999999 -9 -9999999999999999.9999 -9999999999999999999999999999999999999999999999999999999999999.9999 +0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 +100 123456 0.3 40000.25 123456789123456789.1000100000 1024 7000 8 999999.9000 9223372036854775807.0000 +9999999999 9999999999 0.9 99999999.00 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.0000 9999999999999999999999999999999999999999999999999999999999999.1111 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +ALTER TABLE t1 ADD COLUMN n66 NUMERIC(66); +ERROR 42000: Too big precision 66 specified for 'n66'. Maximum is 65. +ALTER TABLE t1 ADD COLUMN n66_6 DECIMAL(66,6); +ERROR 42000: Too big precision 66 specified for 'n66_6'. Maximum is 65. +ALTER TABLE t1 ADD COLUMN n66_66 DECIMAL(66,66); +ERROR 42000: Too big scale 66 specified for 'n66_66'. Maximum is 30. +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c DECIMAL <CUSTOM_COL_OPTIONS> NOT NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c decimal(10,0) NO NULL +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +DROP TABLE t1; +CREATE TABLE t1 (c DECIMAL <CUSTOM_COL_OPTIONS> NOT NULL, +c2 DECIMAL <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT 1.1 +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +Warnings: +Note 1265 Data truncated for column 'c2' at row 1 +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c decimal(10,0) NO NULL +c2 decimal(10,0) NO 1 +ALTER TABLE t1 ADD COLUMN err DECIMAL <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT NULL; +ERROR 42000: Invalid default value for 'err' +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +SELECT HEX(c), HEX(c2) FROM t1; +HEX(c) HEX(c2) +INSERT INTO t1 (c2) VALUES (NULL); +ERROR 23000: Column 'c2' cannot be null +INSERT INTO t1 (c) VALUES (1.1); +Warnings: +Note 1265 Data truncated for column 'c' at row 1 +SELECT COUNT(c), COUNT(c2) FROM t1; +COUNT(c) COUNT(c2) +1 1 +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c NUMERIC <CUSTOM_COL_OPTIONS> NOT NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c decimal(10,0) NO NULL +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +DROP TABLE t1; +CREATE TABLE t1 (c NUMERIC <CUSTOM_COL_OPTIONS> NOT NULL, +c2 NUMERIC <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT 0 +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c decimal(10,0) NO NULL +c2 decimal(10,0) NO 0 +ALTER TABLE t1 ADD COLUMN err NUMERIC <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT NULL; +ERROR 42000: Invalid default value for 'err' +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +SELECT HEX(c), HEX(c2) FROM t1; +HEX(c) HEX(c2) +INSERT INTO t1 (c2) VALUES (NULL); +ERROR 23000: Column 'c2' cannot be null +INSERT INTO t1 (c) VALUES (0); +SELECT COUNT(c), COUNT(c2) FROM t1; +COUNT(c) COUNT(c2) +1 1 +DROP TABLE t1; +# +# Floating point columns (FLOAT, DOUBLE) +# +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (f FLOAT <CUSTOM_COL_OPTIONS> NOT NULL, +f0 FLOAT(0) <CUSTOM_COL_OPTIONS> NOT NULL, +r1_1 REAL(1,1) <CUSTOM_COL_OPTIONS> NOT NULL, +f23_0 FLOAT(23) <CUSTOM_COL_OPTIONS> NOT NULL, +f20_3 FLOAT(20,3) <CUSTOM_COL_OPTIONS> NOT NULL, +d DOUBLE <CUSTOM_COL_OPTIONS> NOT NULL, +d1_0 DOUBLE(1,0) <CUSTOM_COL_OPTIONS> NOT NULL, +d10_10 DOUBLE PRECISION (10,10) <CUSTOM_COL_OPTIONS> NOT NULL, +d53 DOUBLE(53,0) <CUSTOM_COL_OPTIONS> NOT NULL, +d53_10 DOUBLE(53,10) <CUSTOM_COL_OPTIONS> NOT NULL +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +f float # # # +f0 float # # # +r1_1 double(1,1) # # # +f23_0 float # # # +f20_3 float(20,3) # # # +d double # # # +d1_0 double(1,0) # # # +d10_10 double(10,10) # # # +d53 double(53,0) # # # +d53_10 double(53,10) # # # +INSERT INTO t1 VALUES (12345.12345,12345.12345,0.9,123456789.123,56789.987,11111111.111,8.0,0.0123456789,1234566789123456789,99999999999999999.99999999); +SELECT * FROM t1; +f 12345.1 +d 11111111.111 +d10_10 0.0123456789 +d1_0 8 +d53 1234566789123456800 +d53_10 100000000000000000.0000000000 +f0 12345.1 +f20_3 56789.988 +f23_0 123457000 +r1_1 0.9 +INSERT INTO t1 VALUES (0,0,0,0,0,0,0,0,0,0); +INSERT INTO t1 VALUES ( +99999999999999999999999999999999999999, +99999999999999999999999999999999999999.9999999999999999, +0.9, +99999999999999999999999999999999999999.9, +99999999999999999.999, +999999999999999999999999999999999999999999999999999999999999999999999999999999999, +9, +0.9999999999, +1999999999999999999999999999999999999999999999999999999, +19999999999999999999999999999999999999999999.9999999999 +); +Warnings: +Warning 1264 Out of range value for column 'd53' at row 1 +Warning 1264 Out of range value for column 'd53_10' at row 1 +SELECT * FROM t1; +f 12345.1 +d 0 +d 11111111.111 +d 1e81 +d10_10 0.0000000000 +d10_10 0.0123456789 +d10_10 0.9999999999 +d1_0 0 +d1_0 8 +d1_0 9 +d53 0 +d53 100000000000000000000000000000000000000000000000000000 +d53 1234566789123456800 +d53_10 0.0000000000 +d53_10 100000000000000000.0000000000 +d53_10 10000000000000000000000000000000000000000000.0000000000 +f 0 +f 1e38 +f0 0 +f0 12345.1 +f0 1e38 +f20_3 0.000 +f20_3 56789.988 +f20_3 99999998430674940.000 +f23_0 0 +f23_0 123457000 +f23_0 1e38 +r1_1 0.0 +r1_1 0.9 +r1_1 0.9 +INSERT INTO t1 VALUES (-999999999999999999999999,-99999999999.999999999999,-0.9,-999.99999999999999999999,-99999999999999999.999,-999999999999999999999999999999999999999999999999999999999999-0.999,-9,-.9999999999,-999999999999999999999999999999.99999999999999999999999,-9999999999999999999999999999999999999999999.9999999999); +SELECT * FROM t1; +f 12345.1 +d -1e60 +d 0 +d 11111111.111 +d 1e81 +d10_10 -0.9999999999 +d10_10 0.0000000000 +d10_10 0.0123456789 +d10_10 0.9999999999 +d1_0 -9 +d1_0 0 +d1_0 8 +d1_0 9 +d53 -1000000000000000000000000000000 +d53 0 +d53 100000000000000000000000000000000000000000000000000000 +d53 1234566789123456800 +d53_10 -10000000000000000000000000000000000000000000.0000000000 +d53_10 0.0000000000 +d53_10 100000000000000000.0000000000 +d53_10 10000000000000000000000000000000000000000000.0000000000 +f -1e24 +f 0 +f 1e38 +f0 -100000000000 +f0 0 +f0 12345.1 +f0 1e38 +f20_3 -99999998430674940.000 +f20_3 0.000 +f20_3 56789.988 +f20_3 99999998430674940.000 +f23_0 -1000 +f23_0 0 +f23_0 123457000 +f23_0 1e38 +r1_1 -0.9 +r1_1 0.0 +r1_1 0.9 +r1_1 0.9 +SELECT MAX(f), MAX(f0), MAX(r1_1), MAX(f23_0), MAX(f20_3), MAX(d), MAX(d1_0), MAX(d10_10), MAX(d53), MAX(d53_10) FROM t1; +MAX(f) 9.999999680285692e37 +MAX(d) 1e81 +MAX(d10_10) 0.9999999999 +MAX(d1_0) 9 +MAX(d53) 100000000000000000000000000000000000000000000000000000 +MAX(d53_10) 10000000000000000000000000000000000000000000.0000000000 +MAX(f0) 9.999999680285692e37 +MAX(f20_3) 99999998430674940.000 +MAX(f23_0) 9.999999680285692e37 +MAX(r1_1) 0.9 +INSERT INTO t1 SELECT d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10 FROM t1 ORDER BY d53_10 DESC LIMIT 1; +Warnings: +Warning 1264 Out of range value for column 'f' at row 1 +Warning 1264 Out of range value for column 'f0' at row 1 +Warning 1264 Out of range value for column 'r1_1' at row 1 +Warning 1264 Out of range value for column 'f23_0' at row 1 +Warning 1264 Out of range value for column 'f20_3' at row 1 +Warning 1264 Out of range value for column 'd1_0' at row 1 +SELECT * FROM t1; +f 12345.1 +d -1e60 +d 0 +d 11111111.111 +d 1e43 +d 1e81 +d10_10 -0.9999999999 +d10_10 0.0000000000 +d10_10 0.0123456789 +d10_10 0.9999999999 +d10_10 10000000000000000000000000000000000000000000.0000000000 +d1_0 -9 +d1_0 0 +d1_0 8 +d1_0 9 +d1_0 9 +d53 -1000000000000000000000000000000 +d53 0 +d53 10000000000000000000000000000000000000000000 +d53 100000000000000000000000000000000000000000000000000000 +d53 1234566789123456800 +d53_10 -10000000000000000000000000000000000000000000.0000000000 +d53_10 0.0000000000 +d53_10 100000000000000000.0000000000 +d53_10 10000000000000000000000000000000000000000000.0000000000 +d53_10 10000000000000000000000000000000000000000000.0000000000 +f -1e24 +f 0 +f 1e38 +f 3.40282e38 +f0 -100000000000 +f0 0 +f0 12345.1 +f0 1e38 +f0 3.40282e38 +f20_3 -99999998430674940.000 +f20_3 0.000 +f20_3 56789.988 +f20_3 99999998430674940.000 +f20_3 99999998430674940.000 +f23_0 -1000 +f23_0 0 +f23_0 123457000 +f23_0 1e38 +f23_0 3.40282e38 +r1_1 -0.9 +r1_1 0.0 +r1_1 0.9 +r1_1 0.9 +r1_1 0.9 +INSERT INTO t1 VALUES ( +999999999999999999999999999999999999999, +999999999999999999999999999999999999999.9999999999999999, +1.9, +999999999999999999999999999999999999999.9, +999999999999999999.999, +9999999999999999999999999999999999999999999999999999999999999999999999999999999999, +99, +1.9999999999, +1999999999999999999999999999999999999999999999999999999, +19999999999999999999999999999999999999999999.9999999999 +); +Warnings: +Warning 1916 Got overflow when converting '' to DECIMAL. Value truncated. +Warning 1264 Out of range value for column 'f' at row 1 +Warning 1264 Out of range value for column 'f0' at row 1 +Warning 1264 Out of range value for column 'r1_1' at row 1 +Warning 1264 Out of range value for column 'f23_0' at row 1 +Warning 1264 Out of range value for column 'f20_3' at row 1 +Warning 1264 Out of range value for column 'd1_0' at row 1 +Warning 1264 Out of range value for column 'd10_10' at row 1 +Warning 1264 Out of range value for column 'd53' at row 1 +Warning 1264 Out of range value for column 'd53_10' at row 1 +SELECT * FROM t1; +f 12345.1 +d -1e60 +d 0 +d 11111111.111 +d 1e43 +d 1e65 +d 1e81 +d10_10 -0.9999999999 +d10_10 0.0000000000 +d10_10 0.0123456789 +d10_10 0.9999999999 +d10_10 0.9999999999 +d10_10 10000000000000000000000000000000000000000000.0000000000 +d1_0 -9 +d1_0 0 +d1_0 8 +d1_0 9 +d1_0 9 +d1_0 9 +d53 -1000000000000000000000000000000 +d53 0 +d53 10000000000000000000000000000000000000000000 +d53 100000000000000000000000000000000000000000000000000000 +d53 100000000000000000000000000000000000000000000000000000 +d53 1234566789123456800 +d53_10 -10000000000000000000000000000000000000000000.0000000000 +d53_10 0.0000000000 +d53_10 100000000000000000.0000000000 +d53_10 10000000000000000000000000000000000000000000.0000000000 +d53_10 10000000000000000000000000000000000000000000.0000000000 +d53_10 10000000000000000000000000000000000000000000.0000000000 +f -1e24 +f 0 +f 1e38 +f 3.40282e38 +f 3.40282e38 +f0 -100000000000 +f0 0 +f0 12345.1 +f0 1e38 +f0 3.40282e38 +f0 3.40282e38 +f20_3 -99999998430674940.000 +f20_3 0.000 +f20_3 56789.988 +f20_3 99999998430674940.000 +f20_3 99999998430674940.000 +f20_3 99999998430674940.000 +f23_0 -1000 +f23_0 0 +f23_0 123457000 +f23_0 1e38 +f23_0 3.40282e38 +f23_0 3.40282e38 +r1_1 -0.9 +r1_1 0.0 +r1_1 0.9 +r1_1 0.9 +r1_1 0.9 +r1_1 0.9 +ALTER TABLE t1 ADD COLUMN d0_0 DOUBLE(0,0); +ERROR 42000: Display width out of range for 'd0_0' (max = 255) +ALTER TABLE t1 ADD COLUMN n66_6 DECIMAL(256,1); +ERROR 42000: Too big precision 256 specified for 'n66_6'. Maximum is 65. +ALTER TABLE t1 ADD COLUMN n66_66 DECIMAL(40,35); +ERROR 42000: Too big scale 35 specified for 'n66_66'. Maximum is 30. +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c FLOAT <CUSTOM_COL_OPTIONS> NOT NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c float NO NULL +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +DROP TABLE t1; +CREATE TABLE t1 (c FLOAT <CUSTOM_COL_OPTIONS> NOT NULL, +c2 FLOAT <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT 1.1 +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c float NO NULL +c2 float NO 1.1 +ALTER TABLE t1 ADD COLUMN err FLOAT <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT NULL; +ERROR 42000: Invalid default value for 'err' +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +SELECT HEX(c), HEX(c2) FROM t1; +HEX(c) HEX(c2) +INSERT INTO t1 (c2) VALUES (NULL); +ERROR 23000: Column 'c2' cannot be null +INSERT INTO t1 (c) VALUES (1.1 ); +SELECT COUNT(c), COUNT(c2) FROM t1; +COUNT(c) COUNT(c2) +1 1 +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c DOUBLE <CUSTOM_COL_OPTIONS> NOT NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c double NO NULL +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +DROP TABLE t1; +CREATE TABLE t1 (c DOUBLE <CUSTOM_COL_OPTIONS> NOT NULL, +c2 DOUBLE <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT 0 +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c double NO NULL +c2 double NO 0 +ALTER TABLE t1 ADD COLUMN err DOUBLE <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT NULL; +ERROR 42000: Invalid default value for 'err' +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +SELECT HEX(c), HEX(c2) FROM t1; +HEX(c) HEX(c2) +INSERT INTO t1 (c2) VALUES (NULL); +ERROR 23000: Column 'c2' cannot be null +INSERT INTO t1 (c) VALUES (0); +SELECT COUNT(c), COUNT(c2) FROM t1; +COUNT(c) COUNT(c2) +1 1 +DROP TABLE t1; +# +# INT columns +# +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (i INT <CUSTOM_COL_OPTIONS> NOT NULL, +i0 INT(0) <CUSTOM_COL_OPTIONS> NOT NULL, +i1 INT(1) <CUSTOM_COL_OPTIONS> NOT NULL, +i20 INT(20) <CUSTOM_COL_OPTIONS> NOT NULL, +t TINYINT <CUSTOM_COL_OPTIONS> NOT NULL, +t0 TINYINT(0) <CUSTOM_COL_OPTIONS> NOT NULL, +t1 TINYINT(1) <CUSTOM_COL_OPTIONS> NOT NULL, +t20 TINYINT(20) <CUSTOM_COL_OPTIONS> NOT NULL, +s SMALLINT <CUSTOM_COL_OPTIONS> NOT NULL, +s0 SMALLINT(0) <CUSTOM_COL_OPTIONS> NOT NULL, +s1 SMALLINT(1) <CUSTOM_COL_OPTIONS> NOT NULL, +s20 SMALLINT(20) <CUSTOM_COL_OPTIONS> NOT NULL, +m MEDIUMINT <CUSTOM_COL_OPTIONS> NOT NULL, +m0 MEDIUMINT(0) <CUSTOM_COL_OPTIONS> NOT NULL, +m1 MEDIUMINT(1) <CUSTOM_COL_OPTIONS> NOT NULL, +m20 MEDIUMINT(20) <CUSTOM_COL_OPTIONS> NOT NULL, +b BIGINT <CUSTOM_COL_OPTIONS> NOT NULL, +b0 BIGINT(0) <CUSTOM_COL_OPTIONS> NOT NULL, +b1 BIGINT(1) <CUSTOM_COL_OPTIONS> NOT NULL, +b20 BIGINT(20) <CUSTOM_COL_OPTIONS> NOT NULL +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +i int(11) # # # +i0 int(11) # # # +i1 int(1) # # # +i20 int(20) # # # +t tinyint(4) # # # +t0 tinyint(4) # # # +t1 tinyint(1) # # # +t20 tinyint(20) # # # +s smallint(6) # # # +s0 smallint(6) # # # +s1 smallint(1) # # # +s20 smallint(20) # # # +m mediumint(9) # # # +m0 mediumint(9) # # # +m1 mediumint(1) # # # +m20 mediumint(20) # # # +b bigint(20) # # # +b0 bigint(20) # # # +b1 bigint(1) # # # +b20 bigint(20) # # # +INSERT INTO t1 VALUES (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20); +INSERT INTO t1 VALUES (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); +INSERT INTO t1 VALUES (2147483647,2147483647,2147483647,2147483647,127,127,127,127,32767,32767,32767,32767,8388607,8388607,8388607,8388607,9223372036854775807,9223372036854775807,9223372036854775807,9223372036854775807); +SELECT * FROM t1; +i i0 i1 i20 t t0 t1 t20 s s0 s1 s20 m m0 m1 m20 b b0 b1 b20 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 +2147483647 2147483647 2147483647 2147483647 127 127 127 127 32767 32767 32767 32767 8388607 8388607 8388607 8388607 9223372036854775807 9223372036854775807 9223372036854775807 9223372036854775807 +INSERT INTO t1 VALUES (-2147483648,-2147483648,-2147483648,-2147483648,-128,-128,-128,-128,-32768,-32768,-32768,-32768,-8388608,-8388608,-8388608,-8388608,-9223372036854775808,-9223372036854775808,-9223372036854775808,-9223372036854775808); +INSERT INTO t1 VALUES (4294967295,4294967295,4294967295,4294967295,255,255,255,255,65535,65535,65535,65535,16777215,16777215,16777215,16777215,18446744073709551615,18446744073709551615,18446744073709551615,18446744073709551615); +Warnings: +Warning 1264 Out of range value for column 'i' at row 1 +Warning 1264 Out of range value for column 'i0' at row 1 +Warning 1264 Out of range value for column 'i1' at row 1 +Warning 1264 Out of range value for column 'i20' at row 1 +Warning 1264 Out of range value for column 't' at row 1 +Warning 1264 Out of range value for column 't0' at row 1 +Warning 1264 Out of range value for column 't1' at row 1 +Warning 1264 Out of range value for column 't20' at row 1 +Warning 1264 Out of range value for column 's' at row 1 +Warning 1264 Out of range value for column 's0' at row 1 +Warning 1264 Out of range value for column 's1' at row 1 +Warning 1264 Out of range value for column 's20' at row 1 +Warning 1264 Out of range value for column 'm' at row 1 +Warning 1264 Out of range value for column 'm0' at row 1 +Warning 1264 Out of range value for column 'm1' at row 1 +Warning 1264 Out of range value for column 'm20' at row 1 +Warning 1264 Out of range value for column 'b' at row 1 +Warning 1264 Out of range value for column 'b0' at row 1 +Warning 1264 Out of range value for column 'b1' at row 1 +Warning 1264 Out of range value for column 'b20' at row 1 +SELECT * FROM t1; +i i0 i1 i20 t t0 t1 t20 s s0 s1 s20 m m0 m1 m20 b b0 b1 b20 +-2147483648 -2147483648 -2147483648 -2147483648 -128 -128 -128 -128 -32768 -32768 -32768 -32768 -8388608 -8388608 -8388608 -8388608 -9223372036854775808 -9223372036854775808 -9223372036854775808 -9223372036854775808 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 +2147483647 2147483647 2147483647 2147483647 127 127 127 127 32767 32767 32767 32767 8388607 8388607 8388607 8388607 9223372036854775807 9223372036854775807 9223372036854775807 9223372036854775807 +2147483647 2147483647 2147483647 2147483647 127 127 127 127 32767 32767 32767 32767 8388607 8388607 8388607 8388607 9223372036854775807 9223372036854775807 9223372036854775807 9223372036854775807 +INSERT INTO t1 VALUES (-2147483649,-2147483649,-2147483649,-2147483649,-129,-129,-129,-129,-32769,-32769,-32769,-32769,-8388609,-8388609,-8388609,-8388609,-9223372036854775809,-9223372036854775809,-9223372036854775809,-9223372036854775809); +Warnings: +Warning 1264 Out of range value for column 'i' at row 1 +Warning 1264 Out of range value for column 'i0' at row 1 +Warning 1264 Out of range value for column 'i1' at row 1 +Warning 1264 Out of range value for column 'i20' at row 1 +Warning 1264 Out of range value for column 't' at row 1 +Warning 1264 Out of range value for column 't0' at row 1 +Warning 1264 Out of range value for column 't1' at row 1 +Warning 1264 Out of range value for column 't20' at row 1 +Warning 1264 Out of range value for column 's' at row 1 +Warning 1264 Out of range value for column 's0' at row 1 +Warning 1264 Out of range value for column 's1' at row 1 +Warning 1264 Out of range value for column 's20' at row 1 +Warning 1264 Out of range value for column 'm' at row 1 +Warning 1264 Out of range value for column 'm0' at row 1 +Warning 1264 Out of range value for column 'm1' at row 1 +Warning 1264 Out of range value for column 'm20' at row 1 +Warning 1264 Out of range value for column 'b' at row 1 +Warning 1264 Out of range value for column 'b0' at row 1 +Warning 1264 Out of range value for column 'b1' at row 1 +Warning 1264 Out of range value for column 'b20' at row 1 +INSERT INTO t1 VALUES (4294967296,4294967296,4294967296,4294967296,256,256,256,256,65536,65536,65536,65536,16777216,16777216,16777216,16777216,18446744073709551616,18446744073709551616,18446744073709551616,18446744073709551616); +Warnings: +Warning 1264 Out of range value for column 'i' at row 1 +Warning 1264 Out of range value for column 'i0' at row 1 +Warning 1264 Out of range value for column 'i1' at row 1 +Warning 1264 Out of range value for column 'i20' at row 1 +Warning 1264 Out of range value for column 't' at row 1 +Warning 1264 Out of range value for column 't0' at row 1 +Warning 1264 Out of range value for column 't1' at row 1 +Warning 1264 Out of range value for column 't20' at row 1 +Warning 1264 Out of range value for column 's' at row 1 +Warning 1264 Out of range value for column 's0' at row 1 +Warning 1264 Out of range value for column 's1' at row 1 +Warning 1264 Out of range value for column 's20' at row 1 +Warning 1264 Out of range value for column 'm' at row 1 +Warning 1264 Out of range value for column 'm0' at row 1 +Warning 1264 Out of range value for column 'm1' at row 1 +Warning 1264 Out of range value for column 'm20' at row 1 +Warning 1264 Out of range value for column 'b' at row 1 +Warning 1264 Out of range value for column 'b0' at row 1 +Warning 1264 Out of range value for column 'b1' at row 1 +Warning 1264 Out of range value for column 'b20' at row 1 +INSERT INTO t1 SELECT b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b FROM t1 WHERE b IN (-9223372036854775808,9223372036854775807,18446744073709551615); +Warnings: +Warning 1264 Out of range value for column 'i' at row 1 +Warning 1264 Out of range value for column 'i0' at row 1 +Warning 1264 Out of range value for column 'i1' at row 1 +Warning 1264 Out of range value for column 'i20' at row 1 +Warning 1264 Out of range value for column 't' at row 1 +Warning 1264 Out of range value for column 't0' at row 1 +Warning 1264 Out of range value for column 't1' at row 1 +Warning 1264 Out of range value for column 't20' at row 1 +Warning 1264 Out of range value for column 's' at row 1 +Warning 1264 Out of range value for column 's0' at row 1 +Warning 1264 Out of range value for column 's1' at row 1 +Warning 1264 Out of range value for column 's20' at row 1 +Warning 1264 Out of range value for column 'm' at row 1 +Warning 1264 Out of range value for column 'm0' at row 1 +Warning 1264 Out of range value for column 'm1' at row 1 +Warning 1264 Out of range value for column 'm20' at row 1 +Warning 1264 Out of range value for column 'i' at row 2 +Warning 1264 Out of range value for column 'i0' at row 2 +Warning 1264 Out of range value for column 'i1' at row 2 +Warning 1264 Out of range value for column 'i20' at row 2 +Warning 1264 Out of range value for column 't' at row 2 +Warning 1264 Out of range value for column 't0' at row 2 +Warning 1264 Out of range value for column 't1' at row 2 +Warning 1264 Out of range value for column 't20' at row 2 +Warning 1264 Out of range value for column 's' at row 2 +Warning 1264 Out of range value for column 's0' at row 2 +Warning 1264 Out of range value for column 's1' at row 2 +Warning 1264 Out of range value for column 's20' at row 2 +Warning 1264 Out of range value for column 'm' at row 2 +Warning 1264 Out of range value for column 'm0' at row 2 +Warning 1264 Out of range value for column 'm1' at row 2 +Warning 1264 Out of range value for column 'm20' at row 2 +Warning 1264 Out of range value for column 'i' at row 3 +Warning 1264 Out of range value for column 'i0' at row 3 +Warning 1264 Out of range value for column 'i1' at row 3 +Warning 1264 Out of range value for column 'i20' at row 3 +Warning 1264 Out of range value for column 't' at row 3 +Warning 1264 Out of range value for column 't0' at row 3 +Warning 1264 Out of range value for column 't1' at row 3 +Warning 1264 Out of range value for column 't20' at row 3 +Warning 1264 Out of range value for column 's' at row 3 +Warning 1264 Out of range value for column 's0' at row 3 +Warning 1264 Out of range value for column 's1' at row 3 +Warning 1264 Out of range value for column 's20' at row 3 +Warning 1264 Out of range value for column 'm' at row 3 +Warning 1264 Out of range value for column 'm0' at row 3 +Warning 1264 Out of range value for column 'm1' at row 3 +Warning 1264 Out of range value for column 'm20' at row 3 +Warning 1264 Out of range value for column 'i' at row 4 +Warning 1264 Out of range value for column 'i0' at row 4 +Warning 1264 Out of range value for column 'i1' at row 4 +Warning 1264 Out of range value for column 'i20' at row 4 +Warning 1264 Out of range value for column 't' at row 4 +Warning 1264 Out of range value for column 't0' at row 4 +Warning 1264 Out of range value for column 't1' at row 4 +Warning 1264 Out of range value for column 't20' at row 4 +Warning 1264 Out of range value for column 's' at row 4 +Warning 1264 Out of range value for column 's0' at row 4 +Warning 1264 Out of range value for column 's1' at row 4 +Warning 1264 Out of range value for column 's20' at row 4 +Warning 1264 Out of range value for column 'm' at row 4 +Warning 1264 Out of range value for column 'm0' at row 4 +Warning 1264 Out of range value for column 'm1' at row 4 +Warning 1264 Out of range value for column 'm20' at row 4 +SELECT * FROM t1; +i i0 i1 i20 t t0 t1 t20 s s0 s1 s20 m m0 m1 m20 b b0 b1 b20 +-2147483648 -2147483648 -2147483648 -2147483648 -128 -128 -128 -128 -32768 -32768 -32768 -32768 -8388608 -8388608 -8388608 -8388608 -9223372036854775808 -9223372036854775808 -9223372036854775808 -9223372036854775808 +-2147483648 -2147483648 -2147483648 -2147483648 -128 -128 -128 -128 -32768 -32768 -32768 -32768 -8388608 -8388608 -8388608 -8388608 -9223372036854775808 -9223372036854775808 -9223372036854775808 -9223372036854775808 +-2147483648 -2147483648 -2147483648 -2147483648 -128 -128 -128 -128 -32768 -32768 -32768 -32768 -8388608 -8388608 -8388608 -8388608 -9223372036854775808 -9223372036854775808 -9223372036854775808 -9223372036854775808 +-2147483648 -2147483648 -2147483648 -2147483648 -128 -128 -128 -128 -32768 -32768 -32768 -32768 -8388608 -8388608 -8388608 -8388608 -9223372036854775808 -9223372036854775808 -9223372036854775808 -9223372036854775808 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 +2147483647 2147483647 2147483647 2147483647 127 127 127 127 32767 32767 32767 32767 8388607 8388607 8388607 8388607 9223372036854775807 9223372036854775807 9223372036854775807 9223372036854775807 +2147483647 2147483647 2147483647 2147483647 127 127 127 127 32767 32767 32767 32767 8388607 8388607 8388607 8388607 9223372036854775807 9223372036854775807 9223372036854775807 9223372036854775807 +2147483647 2147483647 2147483647 2147483647 127 127 127 127 32767 32767 32767 32767 8388607 8388607 8388607 8388607 9223372036854775807 9223372036854775807 9223372036854775807 9223372036854775807 +2147483647 2147483647 2147483647 2147483647 127 127 127 127 32767 32767 32767 32767 8388607 8388607 8388607 8388607 9223372036854775807 9223372036854775807 9223372036854775807 9223372036854775807 +2147483647 2147483647 2147483647 2147483647 127 127 127 127 32767 32767 32767 32767 8388607 8388607 8388607 8388607 9223372036854775807 9223372036854775807 9223372036854775807 9223372036854775807 +2147483647 2147483647 2147483647 2147483647 127 127 127 127 32767 32767 32767 32767 8388607 8388607 8388607 8388607 9223372036854775807 9223372036854775807 9223372036854775807 9223372036854775807 +ALTER TABLE t1 ADD COLUMN i257 INT(257); +ERROR 42000: Display width out of range for 'i257' (max = 255) +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c INT <CUSTOM_COL_OPTIONS> NOT NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c int(11) NO NULL +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +DROP TABLE t1; +CREATE TABLE t1 (c INT <CUSTOM_COL_OPTIONS> NOT NULL, +c2 INT <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT 2147483647 +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c int(11) NO NULL +c2 int(11) NO 2147483647 +ALTER TABLE t1 ADD COLUMN err INT <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT NULL; +ERROR 42000: Invalid default value for 'err' +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +SELECT HEX(c), HEX(c2) FROM t1; +HEX(c) HEX(c2) +INSERT INTO t1 (c2) VALUES (NULL); +ERROR 23000: Column 'c2' cannot be null +INSERT INTO t1 (c) VALUES (2147483647); +SELECT COUNT(c), COUNT(c2) FROM t1; +COUNT(c) COUNT(c2) +1 1 +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c TINYINT <CUSTOM_COL_OPTIONS> NOT NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c tinyint(4) NO NULL +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +DROP TABLE t1; +CREATE TABLE t1 (c TINYINT <CUSTOM_COL_OPTIONS> NOT NULL, +c2 TINYINT <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT 127 +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c tinyint(4) NO NULL +c2 tinyint(4) NO 127 +ALTER TABLE t1 ADD COLUMN err TINYINT <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT NULL; +ERROR 42000: Invalid default value for 'err' +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +SELECT HEX(c), HEX(c2) FROM t1; +HEX(c) HEX(c2) +INSERT INTO t1 (c2) VALUES (NULL); +ERROR 23000: Column 'c2' cannot be null +INSERT INTO t1 (c) VALUES (127 ); +SELECT COUNT(c), COUNT(c2) FROM t1; +COUNT(c) COUNT(c2) +1 1 +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c SMALLINT <CUSTOM_COL_OPTIONS> NOT NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c smallint(6) NO NULL +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +DROP TABLE t1; +CREATE TABLE t1 (c SMALLINT <CUSTOM_COL_OPTIONS> NOT NULL, +c2 SMALLINT <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT 0 +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c smallint(6) NO NULL +c2 smallint(6) NO 0 +ALTER TABLE t1 ADD COLUMN err SMALLINT <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT NULL; +ERROR 42000: Invalid default value for 'err' +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +SELECT HEX(c), HEX(c2) FROM t1; +HEX(c) HEX(c2) +INSERT INTO t1 (c2) VALUES (NULL); +ERROR 23000: Column 'c2' cannot be null +INSERT INTO t1 (c) VALUES (0); +SELECT COUNT(c), COUNT(c2) FROM t1; +COUNT(c) COUNT(c2) +1 1 +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c MEDIUMINT <CUSTOM_COL_OPTIONS> NOT NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c mediumint(9) NO NULL +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +DROP TABLE t1; +CREATE TABLE t1 (c MEDIUMINT <CUSTOM_COL_OPTIONS> NOT NULL, +c2 MEDIUMINT <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT 1 +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c mediumint(9) NO NULL +c2 mediumint(9) NO 1 +ALTER TABLE t1 ADD COLUMN err MEDIUMINT <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT NULL; +ERROR 42000: Invalid default value for 'err' +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +SELECT HEX(c), HEX(c2) FROM t1; +HEX(c) HEX(c2) +INSERT INTO t1 (c2) VALUES (NULL); +ERROR 23000: Column 'c2' cannot be null +INSERT INTO t1 (c) VALUES (1); +SELECT COUNT(c), COUNT(c2) FROM t1; +COUNT(c) COUNT(c2) +1 1 +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c BIGINT <CUSTOM_COL_OPTIONS> NOT NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c bigint(20) NO NULL +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +DROP TABLE t1; +CREATE TABLE t1 (c BIGINT <CUSTOM_COL_OPTIONS> NOT NULL, +c2 BIGINT <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT 9223372036854775807 +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c bigint(20) NO NULL +c2 bigint(20) NO 9223372036854775807 +ALTER TABLE t1 ADD COLUMN err BIGINT <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT NULL; +ERROR 42000: Invalid default value for 'err' +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +SELECT HEX(c), HEX(c2) FROM t1; +HEX(c) HEX(c2) +INSERT INTO t1 (c2) VALUES (NULL); +ERROR 23000: Column 'c2' cannot be null +INSERT INTO t1 (c) VALUES (9223372036854775807); +SELECT COUNT(c), COUNT(c2) FROM t1; +COUNT(c) COUNT(c2) +1 1 +DROP TABLE t1; +# +# SET columns +# +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a SET('') <CUSTOM_COL_OPTIONS> NOT NULL, +b SET('test1','test2','test3','test4','test5') <CUSTOM_COL_OPTIONS> NOT NULL, +c SET('01','02','03','04','05','06','07','08','09','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31','32','33','34','35','36','37','38','39','40','41','42','43','44','45','46','47','48','49','50''51','52','53','54','55','56','57','58','59','60','61','62','63','64') <CUSTOM_COL_OPTIONS> NOT NULL +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +a set('') # # # +b set('test1','test2','test3','test4','test5') # # # +c set('01','02','03','04','05','06','07','08','09','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31','32','33','34','35','36','37','38','39','40','41','42','43','44','45','46','47','48','49','50''51','52','53','54','55','56','57','58','59','60','61','62','63','64') # # # +INSERT INTO t1 VALUES +('','test2,test3','01,34,44,,23'), +('',5,2), +(',','test4,test2',''); +Warnings: +Warning 1265 Data truncated for column 'c' at row 1 +SELECT * FROM t1; +a b c + test1,test3 02 + test2,test3 01,23,34,44 + test2,test4 +INSERT INTO t1 VALUES (0,'test6',-1); +Warnings: +Warning 1265 Data truncated for column 'b' at row 1 +Warning 1265 Data truncated for column 'c' at row 1 +SELECT * FROM t1; +a b c + 01,02,03,04,05,06,07,08,09,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50'51,52,53,54,55,56,57,58,59,60,61,62,63,64 + test1,test3 02 + test2,test3 01,23,34,44 + test2,test4 +ALTER TABLE t1 ADD COLUMN e SET('a','A') <CUSTOM_COL_OPTIONS> NOT NULL; +Warnings: +Note 1291 Column 'e' has duplicated value 'a' in SET +Note 1291 Column 'e' has duplicated value 'a' in SET +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +a set('') # # # +b set('test1','test2','test3','test4','test5') # # # +c set('01','02','03','04','05','06','07','08','09','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31','32','33','34','35','36','37','38','39','40','41','42','43','44','45','46','47','48','49','50''51','52','53','54','55','56','57','58','59','60','61','62','63','64') # # # +e set('a','A') # # # +ALTER TABLE t1 ADD COLUMN f SET('1','2','3','4','5','6','7','8','9','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',' ','11','12','13','14','15','16','17','18','19','1a','1b','1c','1d','1e','1f','1g','1h','1i','1j','1k','1l','1m','1n','1o','1p','1q','1r','1s','1t','1u','1v','1w','1x','1y','1z','20','21','22','23','24','25','26','27','28','29','2a','2b','2c','2d','2e','2f','2g','2h','2i','2j','2k','2l','2m','2n','2o','2p','2q','2r','2s','2t','2u','2v','2w','2x','2y','2z','30','31','32','33','34','35','36','37','38','39','3a','3b','3c','3d','3e','3f','3g','3h','3i') <CUSTOM_COL_OPTIONS> NOT NULL; +ERROR HY000: Too many strings for column f and SET +SELECT * FROM t1 WHERE FIND_IN_SET('test2',b)>0 OR a != ''; +a b c e + test2,test3 01,23,34,44 + test2,test4 +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c SET('test1','test2','test3') <CUSTOM_COL_OPTIONS> NOT NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c set('test1','test2','test3') NO NULL +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +DROP TABLE t1; +CREATE TABLE t1 (c SET('test1','test2','test3') <CUSTOM_COL_OPTIONS> NOT NULL, +c2 SET('test1','test2','test3') <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT 'test2,test3' +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c set('test1','test2','test3') NO NULL +c2 set('test1','test2','test3') NO test2,test3 +ALTER TABLE t1 ADD COLUMN err SET('test1','test2','test3') <CUSTOM_COL_OPTIONS> NOT NULL DEFAULT NULL; +ERROR 42000: Invalid default value for 'err' +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +SELECT HEX(c), HEX(c2) FROM t1; +HEX(c) HEX(c2) +INSERT INTO t1 (c2) VALUES (NULL); +ERROR 23000: Column 'c2' cannot be null +INSERT INTO t1 (c) VALUES ('test2,test3'); +SELECT COUNT(c), COUNT(c2) FROM t1; +COUNT(c) COUNT(c2) +1 1 +DROP TABLE t1; +# +# TEXT columns +# +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (t TEXT <CUSTOM_COL_OPTIONS> NOT NULL, +t0 TEXT(0) <CUSTOM_COL_OPTIONS> NOT NULL, +t1 TEXT(1) <CUSTOM_COL_OPTIONS> NOT NULL, +t300 TEXT(300) <CUSTOM_COL_OPTIONS> NOT NULL, +tm TEXT(65535) <CUSTOM_COL_OPTIONS> NOT NULL, +t70k TEXT(70000) <CUSTOM_COL_OPTIONS> NOT NULL, +t17m TEXT(17000000) <CUSTOM_COL_OPTIONS> NOT NULL, +tt TINYTEXT <CUSTOM_COL_OPTIONS> NOT NULL, +m MEDIUMTEXT <CUSTOM_COL_OPTIONS> NOT NULL, +l LONGTEXT <CUSTOM_COL_OPTIONS> NOT NULL +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +t text # # # +t0 text # # # +t1 tinytext # # # +t300 text # # # +tm text # # # +t70k mediumtext # # # +t17m longtext # # # +tt tinytext # # # +m mediumtext # # # +l longtext # # # +INSERT INTO t1 VALUES +('','','','','','','','','',''), +('a','b','c','d','e','f','g','h','i','j'), +('test1','test2','test3','test4','test5','test6','test7','test8','test9','test10'), +( REPEAT('a',65535), REPEAT('b',65535), REPEAT('c',255), REPEAT('d',65535), REPEAT('e',65535), REPEAT('f',1048576), REPEAT('g',1048576), REPEAT('h',255), REPEAT('i',1048576), REPEAT('j',1048576) ); +SELECT LENGTH(t), LENGTH(t0), LENGTH(t1), LENGTH(t300), LENGTH(tm), LENGTH(t70k), LENGTH(t17m), LENGTH(tt), LENGTH(m), LENGTH(l) FROM t1; +LENGTH(t) LENGTH(t0) LENGTH(t1) LENGTH(t300) LENGTH(tm) LENGTH(t70k) LENGTH(t17m) LENGTH(tt) LENGTH(m) LENGTH(l) +0 0 0 0 0 0 0 0 0 0 +1 1 1 1 1 1 1 1 1 1 +5 5 5 5 5 5 5 5 5 6 +65535 65535 255 65535 65535 1048576 1048576 255 1048576 1048576 +INSERT INTO t1 VALUES +( REPEAT('a',65536), REPEAT('b',65536), REPEAT('c',256), REPEAT('d',65536), REPEAT('e',65536), REPEAT('f',1048576), REPEAT('g',1048576), REPEAT('h',256), REPEAT('i',1048576), REPEAT('j',1048576) ); +Warnings: +Warning 1265 Data truncated for column 't' at row 1 +Warning 1265 Data truncated for column 't0' at row 1 +Warning 1265 Data truncated for column 't1' at row 1 +Warning 1265 Data truncated for column 't300' at row 1 +Warning 1265 Data truncated for column 'tm' at row 1 +Warning 1265 Data truncated for column 'tt' at row 1 +SELECT LENGTH(t), LENGTH(t0), LENGTH(t1), LENGTH(t300), LENGTH(tm), LENGTH(t70k), LENGTH(t17m), LENGTH(tt), LENGTH(m), LENGTH(l) FROM t1; +LENGTH(t) LENGTH(t0) LENGTH(t1) LENGTH(t300) LENGTH(tm) LENGTH(t70k) LENGTH(t17m) LENGTH(tt) LENGTH(m) LENGTH(l) +0 0 0 0 0 0 0 0 0 0 +1 1 1 1 1 1 1 1 1 1 +5 5 5 5 5 5 5 5 5 6 +65535 65535 255 65535 65535 1048576 1048576 255 1048576 1048576 +65535 65535 255 65535 65535 1048576 1048576 255 1048576 1048576 +ALTER TABLE t1 ADD COLUMN ttt TEXT(4294967296); +ERROR 42000: Display width out of range for 'ttt' (max = 4294967295) +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c TEXT <CUSTOM_COL_OPTIONS> NOT NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c text NO NULL +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c TINYTEXT <CUSTOM_COL_OPTIONS> NOT NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c tinytext NO NULL +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c MEDIUMTEXT <CUSTOM_COL_OPTIONS> NOT NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c mediumtext NO NULL +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c LONGTEXT <CUSTOM_COL_OPTIONS> NOT NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c longtext NO NULL +INSERT INTO t1 (c) VALUES (NULL); +ERROR 23000: Column 'c' cannot be null +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/col_opt_not_null.test b/mysql-test/suite/storage_engine/col_opt_not_null.test new file mode 100644 index 00000000000..2cd0e909536 --- /dev/null +++ b/mysql-test/suite/storage_engine/col_opt_not_null.test @@ -0,0 +1,260 @@ +# +# NOT NULL column attribute +# + +let $extra_col_opts = NOT NULL; + +--source have_engine.inc + +--echo # +--echo # BINARY columns +--echo # + +--source type_binary.inc +--let $col_definition = BINARY $default_col_opts +--let $col_default = 0 +--source col_not_null.inc + +--echo # +--echo # VARBINARY columns +--echo # + +--source type_varbinary.inc +--let $col_definition = VARBINARY(64) $default_col_opts +--let $col_default = 'test' +--source col_not_null.inc + +--echo # +--echo # BIT columns +--echo # + +--source type_bit.inc +--let $col_definition = BIT $default_col_opts +--let $col_default = 1 +--source col_not_null.inc + +--echo # +--echo # BLOB columns +--echo # + +--source type_blob.inc + +--let $col_definition = BLOB $default_col_opts +--source col_not_null.inc + +--let $col_definition = TINYBLOB $default_col_opts +--source col_not_null.inc + +--let $col_definition = MEDIUMBLOB $default_col_opts +--source col_not_null.inc + +--let $col_definition = LONGBLOB $default_col_opts +--source col_not_null.inc + +--echo # +--echo # BOOL columns +--echo # + +--source type_bool.inc +--let $col_definition = BOOL $default_col_opts +--let $col_default = '0' +--source col_not_null.inc + +--echo # +--echo # CHAR columns +--echo # + +--source type_char.inc +--let $col_definition = CHAR $default_col_opts +--let $col_default = '_' +--source col_not_null.inc + +--echo # +--echo # VARCHAR columns +--echo # + +--source type_varchar.inc +--let $col_definition = VARCHAR(64) $default_col_opts +--let $col_default = 'test default' +--source col_not_null.inc + +--echo # +--echo # date and time columns +--echo # + +--source type_date_time.inc + +--let $col_definition = DATE $default_col_opts +--let $col_default = '2012-12-21' +--source col_not_null.inc + +--let $col_definition = DATETIME $default_col_opts +--let $col_default = '2012-12-21 12:21:12' +--source col_not_null.inc + +# For TIMESTAMP the behavior is non-standard + +# $col_opts already contains NOT NULL part (it's set in have_engine.inc) + +let $create_definition = + c TIMESTAMP $col_opts, + c2 TIMESTAMP $col_opts DEFAULT '2012-02-21 12:21:12' +; +--source create_table.inc +if ($mysql_errname) +{ + --let $functionality = TIMESTAMP type or NOT NULL columns or DEFAULT + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --let $error_codes = ER_INVALID_DEFAULT + --let $alter_definition = ADD COLUMN err TIMESTAMP $col_opts DEFAULT NULL + --source alter_table.inc + if ($mysql_errname!=ER_INVALID_DEFAULT) + { + --let $functionality = ALTER or DEFAULT + --source unexpected_result.inc + } + + INSERT INTO t1 (c) VALUES (NULL); + INSERT INTO t1 (c2) VALUES (NULL); + --replace_regex /2012-02-21 12:21:12/<DEFAULT_TIMESTAMP>/ /[[:digit:]]{4}-[[:digit:]]{2}-[[:digit:]]{2} [[:digit:]]{2}:[[:digit:]]{2}:[[:digit:]]{2}/<TIMESTAMP>/ + SELECT c, c2 FROM t1; + + DROP TABLE t1; +} + +--let $create_definition = c TIMESTAMP $col_opts +--source create_table.inc +if ($mysql_errname) +{ + --let $functionality = TIMESTAMP type + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + SHOW COLUMNS IN t1; + + INSERT INTO t1 (c) VALUES (NULL); + if ($mysql_errname) + { + --let $functionality = TIMESTAMP + --source unexpected_result.inc + } + + --replace_regex /[[:digit:]]{4}-[[:digit:]]{2}-[[:digit:]]{2} [[:digit:]]{2}:[[:digit:]]{2}:[[:digit:]]{2}/<TIMESTAMP>/ + SELECT * FROM t1; + DROP TABLE t1; +} + +# End of TIMESTAMP exception + + +--let $col_definition = TIME $default_col_opts +--let $col_default = '12:21:12' +--source col_not_null.inc + +--let $col_definition = YEAR $default_col_opts +--let $col_default = '2012' +--source col_not_null.inc + +--let $col_definition = YEAR(2) $default_col_opts +--let $col_default = '12' +--source col_not_null.inc + + +--echo # +--echo # ENUM columns +--echo # + +--source type_enum.inc + +--let $col_definition = ENUM('test1','test2','test3') $default_col_opts +--let $col_default = 'test2' +--source col_not_null.inc + + +--echo # +--echo # Fixed point columns (NUMERIC, DECIMAL) +--echo # + +--source type_fixed.inc + +--let $col_definition = DECIMAL $default_col_opts +--let $col_default = 1.1 +--source col_not_null.inc + +--let $col_definition = NUMERIC $default_col_opts +--let $col_default = 0 +--source col_not_null.inc + +--echo # +--echo # Floating point columns (FLOAT, DOUBLE) +--echo # + +--source type_float.inc + +--let $col_definition = FLOAT $default_col_opts +--let $col_default = 1.1 +--source col_not_null.inc + +--let $col_definition = DOUBLE $default_col_opts +--let $col_default = 0 +--source col_not_null.inc + +--echo # +--echo # INT columns +--echo # + +--source type_int.inc + +--let $col_definition = INT $default_col_opts +--let $col_default = 2147483647 +--source col_not_null.inc + +--let $col_definition = TINYINT $default_col_opts +--let $col_default = 127 +--source col_not_null.inc + +--let $col_definition = SMALLINT $default_col_opts +--let $col_default = 0 +--source col_not_null.inc + +--let $col_definition = MEDIUMINT $default_col_opts +--let $col_default = 1 +--source col_not_null.inc + +--let $col_definition = BIGINT $default_col_opts +--let $col_default = 9223372036854775807 +--source col_not_null.inc + +--echo # +--echo # SET columns +--echo # + +--source type_set.inc +--let $col_definition = SET('test1','test2','test3') $default_col_opts +--let $col_default = 'test2,test3' +--source col_not_null.inc + +--echo # +--echo # TEXT columns +--echo # + +--source type_text.inc + +--let $col_definition = TEXT $default_col_opts +--source col_not_null.inc + +--let $col_definition = TINYTEXT $default_col_opts +--source col_not_null.inc + +--let $col_definition = MEDIUMTEXT $default_col_opts +--source col_not_null.inc + +--let $col_definition = LONGTEXT $default_col_opts +--source col_not_null.inc + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/col_opt_null.result b/mysql-test/suite/storage_engine/col_opt_null.result new file mode 100644 index 00000000000..c6a46f8c18f --- /dev/null +++ b/mysql-test/suite/storage_engine/col_opt_null.result @@ -0,0 +1,1991 @@ +# +# BINARY columns +# +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (b BINARY <CUSTOM_COL_OPTIONS> NULL, +b0 BINARY(0) <CUSTOM_COL_OPTIONS> NULL, +b1 BINARY(1) <CUSTOM_COL_OPTIONS> NULL, +b20 BINARY(20) <CUSTOM_COL_OPTIONS> NULL, +b255 BINARY(255) <CUSTOM_COL_OPTIONS> NULL +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +b binary(1) # # # # +b0 binary(0) # # # # +b1 binary(1) # # # # +b20 binary(20) # # # # +b255 binary(255) # # # # +INSERT INTO t1 VALUES ('','','','',''); +INSERT INTO t1 VALUES ('a','','b','abcdefghi klmnopqrst', 'Creating an article for the Knowledgebase is similar to asking questions. First, navigate to the category where you feel the article should be. Once there, double check that an article doesn\'t already exist which would work.'); +SELECT HEX(b), HEX(b0), HEX(b1), HEX(b20), HEX(b255) FROM t1; +HEX(b) HEX(b0) HEX(b1) HEX(b20) HEX(b255) +00 00 0000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +61 62 616263646566676869206B6C6D6E6F7071727374 4372656174696E6720616E2061727469636C6520666F7220746865204B6E6F776C65646765626173652069732073696D696C617220746F2061736B696E67207175657374696F6E732E2046697273742C206E6176696761746520746F207468652063617465676F727920776865726520796F75206665656C207468652061727469636C652073686F756C642062652E204F6E63652074686572652C20646F75626C6520636865636B207468617420616E2061727469636C6520646F65736E277420616C726561647920657869737420776869636820776F756C6420776F726B2E00000000000000000000000000000000000000000000000000000000000000 +INSERT INTO t1 VALUES ('abc', 'a', 'abc', REPEAT('a',21), REPEAT('x',256)); +Warnings: +Warning 1265 Data truncated for column 'b' at row 1 +Warning 1265 Data truncated for column 'b0' at row 1 +Warning 1265 Data truncated for column 'b1' at row 1 +Warning 1265 Data truncated for column 'b20' at row 1 +Warning 1265 Data truncated for column 'b255' at row 1 +INSERT INTO t1 SELECT b255, b255, b255, b255, CONCAT(b255,b255) FROM t1; +Warnings: +Warning 1265 Data truncated for column 'b' at row 1 +Warning 1265 Data truncated for column 'b0' at row 1 +Warning 1265 Data truncated for column 'b1' at row 1 +Warning 1265 Data truncated for column 'b20' at row 1 +Warning 1265 Data truncated for column 'b255' at row 1 +Warning 1265 Data truncated for column 'b' at row 2 +Warning 1265 Data truncated for column 'b0' at row 2 +Warning 1265 Data truncated for column 'b1' at row 2 +Warning 1265 Data truncated for column 'b20' at row 2 +Warning 1265 Data truncated for column 'b255' at row 2 +Warning 1265 Data truncated for column 'b' at row 3 +Warning 1265 Data truncated for column 'b0' at row 3 +Warning 1265 Data truncated for column 'b1' at row 3 +Warning 1265 Data truncated for column 'b20' at row 3 +Warning 1265 Data truncated for column 'b255' at row 3 +SELECT HEX(b), HEX(b0), HEX(b1), HEX(b20), HEX(b255) FROM t1; +HEX(b) HEX(b0) HEX(b1) HEX(b20) HEX(b255) +00 00 0000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +00 00 0000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +43 43 4372656174696E6720616E2061727469636C6520 4372656174696E6720616E2061727469636C6520666F7220746865204B6E6F776C65646765626173652069732073696D696C617220746F2061736B696E67207175657374696F6E732E2046697273742C206E6176696761746520746F207468652063617465676F727920776865726520796F75206665656C207468652061727469636C652073686F756C642062652E204F6E63652074686572652C20646F75626C6520636865636B207468617420616E2061727469636C6520646F65736E277420616C726561647920657869737420776869636820776F756C6420776F726B2E00000000000000000000000000000000000000000000000000000000000000 +61 61 6161616161616161616161616161616161616161 787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878 +61 62 616263646566676869206B6C6D6E6F7071727374 4372656174696E6720616E2061727469636C6520666F7220746865204B6E6F776C65646765626173652069732073696D696C617220746F2061736B696E67207175657374696F6E732E2046697273742C206E6176696761746520746F207468652063617465676F727920776865726520796F75206665656C207468652061727469636C652073686F756C642062652E204F6E63652074686572652C20646F75626C6520636865636B207468617420616E2061727469636C6520646F65736E277420616C726561647920657869737420776869636820776F756C6420776F726B2E00000000000000000000000000000000000000000000000000000000000000 +78 78 7878787878787878787878787878787878787878 787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878 +ALTER TABLE t1 ADD COLUMN b257 BINARY(257) <CUSTOM_COL_OPTIONS> NULL; +ERROR 42000: Column length too big for column 'b257' (max = 255); use BLOB or TEXT instead +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +b binary(1) # # # # +b0 binary(0) # # # # +b1 binary(1) # # # # +b20 binary(20) # # # # +b255 binary(255) # # # # +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c BINARY <CUSTOM_COL_OPTIONS> NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c binary(1) YES NULL +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c), COUNT(*) FROM t1; +COUNT(c) COUNT(*) +0 1 +DROP TABLE t1; +CREATE TABLE t1 (c BINARY <CUSTOM_COL_OPTIONS> NULL, +c1 BINARY <CUSTOM_COL_OPTIONS> NULL DEFAULT NULL, +c2 BINARY <CUSTOM_COL_OPTIONS> NULL DEFAULT 0 +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c binary(1) YES NULL +c1 binary(1) YES NULL +c2 binary(1) YES 0 +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c2), COUNT(c1), COUNT(c), COUNT(*) FROM t1; +COUNT(c2) COUNT(c1) COUNT(c) COUNT(*) +1 0 0 1 +DROP TABLE t1; +# +# VARBINARY columns +# +DROP TABLE IF EXISTS t1, t2; +CREATE TABLE t1 (v0 VARBINARY(0) <CUSTOM_COL_OPTIONS> NULL, +v1 VARBINARY(1) <CUSTOM_COL_OPTIONS> NULL, +v64 VARBINARY(64) <CUSTOM_COL_OPTIONS> NULL, +v65000 VARBINARY(65000) <CUSTOM_COL_OPTIONS> NULL +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +v0 varbinary(0) # # # +v1 varbinary(1) # # # +v64 varbinary(64) # # # +v65000 varbinary(65000) # # # +CREATE TABLE t2 (v VARBINARY(65532) <CUSTOM_COL_OPTIONS> NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t2; +Field Type Null Key Default Extra +v varbinary(65532) # # # +INSERT INTO t1 (v0,v1,v64,v65000) VALUES ('','','',''); +INSERT INTO t1 (v0,v1,v64,v65000) VALUES ('','y','Once there, double check that an article doesn\'t already exist','Here is a list of recommended books on MariaDB and MySQL. We\'ve provided links to Amazon.com here for convenience, but they can be found at many other bookstores, both online and off. + + If you want to have your favorite MySQL / MariaDB book listed here, please leave a comment. + For developers who want to code on MariaDB or MySQL + + * Understanding MySQL Internals by Sasha Pachev, former MySQL developer at MySQL AB. + o This is the only book we know about that describes the internals of MariaDB / MySQL. A must have for anyone who wants to understand and develop on MariaDB! + o Not all topics are covered and some parts are slightly outdated, but still the best book on this topic. + * MySQL 5.1 Plugin Development by Sergei Golubchik and Andrew Hutchings + o A must read for anyone wanting to write a plugin for MariaDB, written by the Sergei who designed the plugin interface for MySQL and MariaDB! + + For MariaDB / MySQL end users + + * MariaDB Crash Course by Ben Forta + o First MariaDB book! + o For people who want to learn SQL and the basics of MariaDB. + o Now shipping. Purchase at Amazon.com or your favorite bookseller. + + * SQL-99 Complete, Really by Peter Gulutzan & Trudy Pelzer. + o Everything you wanted to know about the SQL 99 standard. Excellent reference book! + o Free to read in the Knowledgebase! + + * MySQL (4th Edition) by Paul DuBois + o The \'default\' book to read if you wont to learn to use MySQL / MariaDB. + + * MySQL Cookbook by Paul DuBois + o A lot of examples of how to use MySQL. As with all of Paul\'s books, it\'s worth its weight in gold and even enjoyable reading for such a \'dry\' subject. + + * High Performance MySQL, Second Edition, By Baron Schwartz, Peter Zaitsev, Vadim Tkachenko, Jeremy D. Zawodny, Arjen Lentz, Derek J. Balling, et al. + o \"High Performance MySQL is the definitive guide to building fast, reliable systems with MySQL. Written by noted experts with years of real-world experience building very large systems, this book covers every aspect of MySQL performance in detail, and focuses on robustness, security, and data integrity. Learn advanced techniques in depth so you can bring out MySQL\'s full power.\" (From the book description at O\'Reilly) + + * MySQL Admin Cookbook + o A quick step-by-step guide for MySQL users and database administrators to tackle real-world challenges with MySQL configuration and administration + + * MySQL 5.0 Certification Study Guide, By Paul DuBois, Stefan Hinz, Carsten Pedersen + o This is the official guide to cover the passing of the two MySQL Certification examinations. It is valid till version 5.0 of the server, so while it misses all the features available in MySQL 5.1 and greater (including MariaDB 5.1 and greater), it provides a good basic understanding of MySQL for the end-user. '); +SELECT HEX(v0), HEX(v1), HEX(v64), HEX(v65000) FROM t1; +HEX(v0) HEX(v1) HEX(v64) HEX(v65000) + + 79 4F6E63652074686572652C20646F75626C6520636865636B207468617420616E2061727469636C6520646F65736E277420616C7265616479206578697374 486572652069732061206C697374206F66207265636F6D6D656E64656420626F6F6B73206F6E204D61726961444220616E64204D7953514C2E2057652776652070726F7669646564206C696E6B7320746F20416D617A6F6E2E636F6D206865726520666F7220636F6E76656E69656E63652C2062757420746865792063616E20626520666F756E64206174206D616E79206F7468657220626F6F6B73746F7265732C20626F7468206F6E6C696E6520616E64206F66662E0A0A2020496620796F752077616E7420746F206861766520796F7572206661766F72697465204D7953514C202F204D61726961444220626F6F6B206C697374656420686572652C20706C65617365206C65617665206120636F6D6D656E742E0A2020466F7220646576656C6F706572732077686F2077616E7420746F20636F6465206F6E204D617269614442206F72204D7953514C0A0A2020202020202A20556E6465727374616E64696E67204D7953514C20496E7465726E616C73206279205361736861205061636865762C20666F726D6572204D7953514C20646576656C6F706572206174204D7953514C2041422E0A2020202020202020202020206F205468697320697320746865206F6E6C7920626F6F6B207765206B6E6F772061626F75742074686174206465736372696265732074686520696E7465726E616C73206F66204D617269614442202F204D7953514C2E2041206D757374206861766520666F7220616E796F6E652077686F2077616E747320746F20756E6465727374616E6420616E6420646576656C6F70206F6E204D617269614442210A2020202020202020202020206F204E6F7420616C6C20746F706963732061726520636F766572656420616E6420736F6D652070617274732061726520736C696768746C79206F757464617465642C20627574207374696C6C20746865206265737420626F6F6B206F6E207468697320746F7069632E200A2020202020202A204D7953514C20352E3120506C7567696E20446576656C6F706D656E742062792053657267656920476F6C75626368696B20616E6420416E64726577204875746368696E67730A2020202020202020202020206F2041206D757374207265616420666F7220616E796F6E652077616E74696E6720746F207772697465206120706C7567696E20666F72204D6172696144422C207772697474656E20627920746865205365726765692077686F2064657369676E65642074686520706C7567696E20696E7465726661636520666F72204D7953514C20616E64204D61726961444221200A0A2020466F72204D617269614442202F204D7953514C20656E642075736572730A0A2020202020202A204D61726961444220437261736820436F757273652062792042656E20466F7274610A2020202020202020202020206F204669727374204D61726961444220626F6F6B210A2020202020202020202020206F20466F722070656F706C652077686F2077616E7420746F206C6561726E2053514C20616E642074686520626173696373206F66204D6172696144422E0A2020202020202020202020206F204E6F77207368697070696E672E20507572636861736520617420416D617A6F6E2E636F6D206F7220796F7572206661766F7269746520626F6F6B73656C6C65722E200A0A2020202020202A2053514C2D393920436F6D706C6574652C205265616C6C792062792050657465722047756C75747A616E20262054727564792050656C7A65722E0A2020202020202020202020206F2045766572797468696E6720796F752077616E74656420746F206B6E6F772061626F7574207468652053514C203939207374616E646172642E20457863656C6C656E74207265666572656E636520626F6F6B210A2020202020202020202020206F204672656520746F207265616420696E20746865204B6E6F776C656467656261736521200A0A2020202020202A204D7953514C20283474682045646974696F6E29206279205061756C204475426F69730A2020202020202020202020206F20546865202764656661756C742720626F6F6B20746F207265616420696620796F7520776F6E7420746F206C6561726E20746F20757365204D7953514C202F204D6172696144422E200A0A2020202020202A204D7953514C20436F6F6B626F6F6B206279205061756C204475426F69730A2020202020202020202020206F2041206C6F74206F66206578616D706C6573206F6620686F7720746F20757365204D7953514C2E204173207769746820616C6C206F66205061756C277320626F6F6B732C206974277320776F727468206974732077656967687420696E20676F6C6420616E64206576656E20656E6A6F7961626C652072656164696E6720666F7220737563682061202764727927207375626A6563742E200A0A2020202020202A204869676820506572666F726D616E6365204D7953514C2C205365636F6E642045646974696F6E2C204279204261726F6E20536368776172747A2C205065746572205A6169747365762C20566164696D20546B616368656E6B6F2C204A6572656D7920442E205A61776F646E792C2041726A656E204C656E747A2C20446572656B204A2E2042616C6C696E672C20657420616C2E0A2020202020202020202020206F20224869676820506572666F726D616E6365204D7953514C2069732074686520646566696E697469766520677569646520746F206275696C64696E6720666173742C2072656C6961626C652073797374656D732077697468204D7953514C2E205772697474656E206279206E6F74656420657870657274732077697468207965617273206F66207265616C2D776F726C6420657870657269656E6365206275696C64696E672076657279206C617267652073797374656D732C207468697320626F6F6B20636F7665727320657665727920617370656374206F66204D7953514C20706572666F726D616E636520696E2064657461696C2C20616E6420666F6375736573206F6E20726F627573746E6573732C2073656375726974792C20616E64206461746120696E746567726974792E204C6561726E20616476616E63656420746563686E697175657320696E20646570746820736F20796F752063616E206272696E67206F7574204D7953514C27732066756C6C20706F7765722E22202846726F6D2074686520626F6F6B206465736372697074696F6E206174204F275265696C6C7929200A0A2020202020202A204D7953514C2041646D696E20436F6F6B626F6F6B0A2020202020202020202020206F204120717569636B20737465702D62792D7374657020677569646520666F72204D7953514C20757365727320616E642064617461626173652061646D696E6973747261746F727320746F207461636B6C65207265616C2D776F726C64206368616C6C656E6765732077697468204D7953514C20636F6E66696775726174696F6E20616E642061646D696E697374726174696F6E200A0A2020202020202A204D7953514C20352E302043657274696669636174696F6E2053747564792047756964652C204279205061756C204475426F69732C2053746566616E2048696E7A2C204361727374656E20506564657273656E0A2020202020202020202020206F205468697320697320746865206F6666696369616C20677569646520746F20636F766572207468652070617373696E67206F66207468652074776F204D7953514C2043657274696669636174696F6E206578616D696E6174696F6E732E2049742069732076616C69642074696C6C2076657273696F6E20352E30206F6620746865207365727665722C20736F207768696C65206974206D697373657320616C6C2074686520666561747572657320617661696C61626C6520696E204D7953514C20352E3120616E6420677265617465722028696E636C7564696E67204D61726961444220352E3120616E642067726561746572292C2069742070726F7669646573206120676F6F6420626173696320756E6465727374616E64696E67206F66204D7953514C20666F722074686520656E642D757365722E20 +INSERT INTO t1 (v0,v1,v64,v65000) VALUES ('y', 'yy', REPEAT('c',65), REPEAT('abcdefghi ',6501)); +Warnings: +Warning 1265 Data truncated for column 'v0' at row 1 +Warning 1265 Data truncated for column 'v1' at row 1 +Warning 1265 Data truncated for column 'v64' at row 1 +Warning 1265 Data truncated for column 'v65000' at row 1 +INSERT INTO t1 (v0,v1,v64,v65000) SELECT v65000, v65000, v65000, CONCAT(v65000,v1) FROM t1; +Warnings: +Warning 1265 Data truncated for column 'v0' at row 2 +Warning 1265 Data truncated for column 'v1' at row 2 +Warning 1265 Data truncated for column 'v64' at row 2 +Warning 1265 Data truncated for column 'v0' at row 3 +Warning 1265 Data truncated for column 'v1' at row 3 +Warning 1265 Data truncated for column 'v64' at row 3 +Warning 1265 Data truncated for column 'v65000' at row 3 +SELECT HEX(v0), HEX(v1), HEX(v64), LENGTH(HEX(v65000)) FROM t1; +HEX(v0) HEX(v1) HEX(v64) LENGTH(HEX(v65000)) + 0 + 0 + 48 486572652069732061206C697374206F66207265636F6D6D656E64656420626F6F6B73206F6E204D61726961444220616E64204D7953514C2E20576527766520 5932 + 61 61626364656667686920616263646566676869206162636465666768692061626364656667686920616263646566676869206162636465666768692061626364 130000 + 79 4F6E63652074686572652C20646F75626C6520636865636B207468617420616E2061727469636C6520646F65736E277420616C7265616479206578697374 5930 + 79 63636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363 130000 +ALTER TABLE t1 ADD COLUMN v65536 VARBINARY(65536) <CUSTOM_COL_OPTIONS> NULL; +Warnings: +Note 1246 Converting column 'v65536' from VARBINARY to BLOB +Note 1246 Converting column 'v65536' from VARBINARY to BLOB +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +v0 varbinary(0) # # # +v1 varbinary(1) # # # +v64 varbinary(64) # # # +v65000 varbinary(65000) # # # +v65536 mediumblob # # # +DROP TABLE t1, t2; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c VARBINARY(64) <CUSTOM_COL_OPTIONS> NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c varbinary(64) YES NULL +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c), COUNT(*) FROM t1; +COUNT(c) COUNT(*) +0 1 +DROP TABLE t1; +CREATE TABLE t1 (c VARBINARY(64) <CUSTOM_COL_OPTIONS> NULL, +c1 VARBINARY(64) <CUSTOM_COL_OPTIONS> NULL DEFAULT NULL, +c2 VARBINARY(64) <CUSTOM_COL_OPTIONS> NULL DEFAULT 'test' +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c varbinary(64) YES NULL +c1 varbinary(64) YES NULL +c2 varbinary(64) YES test +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c2), COUNT(c1), COUNT(c), COUNT(*) FROM t1; +COUNT(c2) COUNT(c1) COUNT(c) COUNT(*) +1 0 0 1 +DROP TABLE t1; +# +# BIT columns +# +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a BIT <CUSTOM_COL_OPTIONS> NULL, +b BIT(20) <CUSTOM_COL_OPTIONS> NULL, +c BIT(64) <CUSTOM_COL_OPTIONS> NULL, +d BIT(1) <CUSTOM_COL_OPTIONS> NULL +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +a bit(1) # # # +b bit(20) # # # +c bit(64) # # # +d bit(1) # # # +ALTER TABLE t1 DROP COLUMN d; +ALTER TABLE t1 ADD COLUMN d BIT(0) <CUSTOM_COL_OPTIONS> NULL; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +a bit(1) # # # +b bit(20) # # # +c bit(64) # # # +d bit(1) # # # +INSERT INTO t1 VALUES (0,POW(2,20)-1,b'1111111111111111111111111111111111111111111111111111111111111111',1); +SELECT BIN(a), HEX(b), c+0 FROM t1 WHERE d>0; +BIN(a) HEX(b) c+0 +0 FFFFF 18446744073709551615 +INSERT INTO t1 VALUES (1,0,-1,0); +SELECT a+0, b+0, c+0 FROM t1 WHERE d<100; +a+0 b+0 c+0 +0 1048575 18446744073709551615 +1 0 18446744073709551615 +INSERT INTO t1 VALUES (b'1', 'f', 0xFF, 0x0); +SELECT a+0, b+0, c+0 FROM t1 WHERE d IN (0, 2); +a+0 b+0 c+0 +1 0 18446744073709551615 +1 102 255 +INSERT INTO t1 VALUES (0x10,0,0,1); +Warnings: +Warning 1264 Out of range value for column 'a' at row 1 +SELECT * FROM t1; +a b c d +INSERT INTO t1 VALUES (0x01,0,0x10000000000000000,0); +Warnings: +Warning 1264 Out of range value for column 'c' at row 1 +SELECT * FROM t1; +a b c d +DROP TABLE t1; +CREATE TABLE t1 (a BIT(65) <CUSTOM_COL_OPTIONS> NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +ERROR 42000: Display width out of range for 'a' (max = 64) +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c BIT <CUSTOM_COL_OPTIONS> NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c bit(1) YES NULL +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c), COUNT(*) FROM t1; +COUNT(c) COUNT(*) +0 1 +DROP TABLE t1; +CREATE TABLE t1 (c BIT <CUSTOM_COL_OPTIONS> NULL, +c1 BIT <CUSTOM_COL_OPTIONS> NULL DEFAULT NULL, +c2 BIT <CUSTOM_COL_OPTIONS> NULL DEFAULT 1 +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c bit(1) YES NULL +c1 bit(1) YES NULL +c2 bit(1) YES b'1' +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c2), COUNT(c1), COUNT(c), COUNT(*) FROM t1; +COUNT(c2) COUNT(c1) COUNT(c) COUNT(*) +1 0 0 1 +DROP TABLE t1; +# +# BLOB columns +# +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (b BLOB <CUSTOM_COL_OPTIONS> NULL, +b0 BLOB(0) <CUSTOM_COL_OPTIONS> NULL, +b1 BLOB(1) <CUSTOM_COL_OPTIONS> NULL, +b300 BLOB(300) <CUSTOM_COL_OPTIONS> NULL, +bm BLOB(65535) <CUSTOM_COL_OPTIONS> NULL, +b70k BLOB(70000) <CUSTOM_COL_OPTIONS> NULL, +b17m BLOB(17000000) <CUSTOM_COL_OPTIONS> NULL, +t TINYBLOB <CUSTOM_COL_OPTIONS> NULL, +m MEDIUMBLOB <CUSTOM_COL_OPTIONS> NULL, +l LONGBLOB <CUSTOM_COL_OPTIONS> NULL +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +b blob # # # +b0 blob # # # +b1 tinyblob # # # +b300 blob # # # +bm blob # # # +b70k mediumblob # # # +b17m longblob # # # +t tinyblob # # # +m mediumblob # # # +l longblob # # # +INSERT INTO t1 VALUES +('','','','','','','','','',''), +('a','b','c','d','e','f','g','h','i','j'), +('test1','test2','test3','test4','test5','test6','test7','test8','test9','test10'), +( REPEAT('a',65535), REPEAT('b',65535), REPEAT('c',255), REPEAT('d',65535), REPEAT('e',65535), REPEAT('f',1048576), HEX(REPEAT('g',1048576)), REPEAT('h',255), REPEAT('i',1048576), HEX(REPEAT('j',1048576)) ); +SELECT LENGTH(b), LENGTH(b0), LENGTH(b1), LENGTH(b300), LENGTH(bm), LENGTH(b70k), LENGTH(b17m), LENGTH(t), LENGTH(m), LENGTH(l) FROM t1; +LENGTH(b) LENGTH(b0) LENGTH(b1) LENGTH(b300) LENGTH(bm) LENGTH(b70k) LENGTH(b17m) LENGTH(t) LENGTH(m) LENGTH(l) +0 0 0 0 0 0 0 0 0 0 +1 1 1 1 1 1 1 1 1 1 +5 5 5 5 5 5 5 5 5 6 +65535 65535 255 65535 65535 1048576 2097152 255 1048576 2097152 +INSERT INTO t1 VALUES +( REPEAT('a',65536), REPEAT('b',65536), REPEAT('c',256), REPEAT('d',65536), REPEAT('e',65536), REPEAT('f',1048576), REPEAT('g',1048576), REPEAT('h',256), REPEAT('i',1048576), REPEAT('j',1048576) ); +Warnings: +Warning 1265 Data truncated for column 'b' at row 1 +Warning 1265 Data truncated for column 'b0' at row 1 +Warning 1265 Data truncated for column 'b1' at row 1 +Warning 1265 Data truncated for column 'b300' at row 1 +Warning 1265 Data truncated for column 'bm' at row 1 +Warning 1265 Data truncated for column 't' at row 1 +SELECT LENGTH(b), LENGTH(b0), LENGTH(b1), LENGTH(b300), LENGTH(bm), LENGTH(b70k), LENGTH(b17m), LENGTH(t), LENGTH(m), LENGTH(l) FROM t1; +LENGTH(b) LENGTH(b0) LENGTH(b1) LENGTH(b300) LENGTH(bm) LENGTH(b70k) LENGTH(b17m) LENGTH(t) LENGTH(m) LENGTH(l) +0 0 0 0 0 0 0 0 0 0 +1 1 1 1 1 1 1 1 1 1 +5 5 5 5 5 5 5 5 5 6 +65535 65535 255 65535 65535 1048576 1048576 255 1048576 1048576 +65535 65535 255 65535 65535 1048576 2097152 255 1048576 2097152 +ALTER TABLE t1 ADD COLUMN bbb BLOB(4294967296); +ERROR 42000: Display width out of range for 'bbb' (max = 4294967295) +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c BLOB <CUSTOM_COL_OPTIONS> NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c blob YES NULL +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c), COUNT(*) FROM t1; +COUNT(c) COUNT(*) +0 1 +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c TINYBLOB <CUSTOM_COL_OPTIONS> NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c tinyblob YES NULL +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c), COUNT(*) FROM t1; +COUNT(c) COUNT(*) +0 1 +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c MEDIUMBLOB <CUSTOM_COL_OPTIONS> NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c mediumblob YES NULL +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c), COUNT(*) FROM t1; +COUNT(c) COUNT(*) +0 1 +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c LONGBLOB <CUSTOM_COL_OPTIONS> NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c longblob YES NULL +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c), COUNT(*) FROM t1; +COUNT(c) COUNT(*) +0 1 +DROP TABLE t1; +# +# BOOL columns +# +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (b1 BOOL <CUSTOM_COL_OPTIONS> NULL, +b2 BOOLEAN <CUSTOM_COL_OPTIONS> NULL +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +b1 tinyint(1) # # # +b2 tinyint(1) # # # +INSERT INTO t1 VALUES (1,TRUE); +SELECT * FROM t1; +b1 b2 +1 1 +INSERT INTO t1 VALUES (FALSE,0); +SELECT * FROM t1; +b1 b2 +0 0 +1 1 +INSERT INTO t1 VALUES (2,3); +SELECT * FROM t1; +b1 b2 +0 0 +1 1 +2 3 +INSERT INTO t1 VALUES (-1,-2); +SELECT * FROM t1; +b1 b2 +-1 -2 +0 0 +1 1 +2 3 +SELECT IF(b1,'true','false') AS a, IF(b2,'true','false') AS b FROM t1; +a b +false false +true true +true true +true true +SELECT * FROM t1 WHERE b1 = TRUE; +b1 b2 +1 1 +SELECT * FROM t1 WHERE b2 = FALSE; +b1 b2 +0 0 +INSERT INTO t1 VALUES ('a','b'); +Warnings: +Warning 1366 Incorrect integer value: 'a' for column 'b1' at row 1 +Warning 1366 Incorrect integer value: 'b' for column 'b2' at row 1 +SELECT * FROM t1; +b1 b2 +-1 -2 +0 0 +0 0 +1 1 +2 3 +INSERT INTO t1 VALUES (128,-129); +Warnings: +Warning 1264 Out of range value for column 'b1' at row 1 +Warning 1264 Out of range value for column 'b2' at row 1 +SELECT * FROM t1; +b1 b2 +-1 -2 +0 0 +0 0 +1 1 +127 -128 +2 3 +ALTER TABLE t1 ADD COLUMN b3 BOOLEAN UNSIGNED; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'UNSIGNED' at line 1 +ALTER TABLE t1 ADD COLUMN b3 BOOL ZEROFILL; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'ZEROFILL' at line 1 +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c BOOL <CUSTOM_COL_OPTIONS> NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c tinyint(1) YES NULL +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c), COUNT(*) FROM t1; +COUNT(c) COUNT(*) +0 1 +DROP TABLE t1; +CREATE TABLE t1 (c BOOL <CUSTOM_COL_OPTIONS> NULL, +c1 BOOL <CUSTOM_COL_OPTIONS> NULL DEFAULT NULL, +c2 BOOL <CUSTOM_COL_OPTIONS> NULL DEFAULT '0' +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c tinyint(1) YES NULL +c1 tinyint(1) YES NULL +c2 tinyint(1) YES 0 +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c2), COUNT(c1), COUNT(c), COUNT(*) FROM t1; +COUNT(c2) COUNT(c1) COUNT(c) COUNT(*) +1 0 0 1 +DROP TABLE t1; +# +# CHAR columns +# +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c CHAR <CUSTOM_COL_OPTIONS> NULL, +c0 CHAR(0) <CUSTOM_COL_OPTIONS> NULL, +c1 CHAR(1) <CUSTOM_COL_OPTIONS> NULL, +c20 CHAR(20) <CUSTOM_COL_OPTIONS> NULL, +c255 CHAR(255) <CUSTOM_COL_OPTIONS> NULL +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c char(1) # # # +c0 char(0) # # # +c1 char(1) # # # +c20 char(20) # # # +c255 char(255) # # # +INSERT INTO t1 VALUES ('','','','',''); +INSERT INTO t1 VALUES ('a','','b','abcdefghi klmnopqrst', 'Creating an article for the Knowledgebase is similar to asking questions. First, navigate to the category where you feel the article should be. Once there, double check that an article doesn\'t already exist which would work.'); +SELECT * FROM t1; +c c0 c1 c20 c255 + +a b abcdefghi klmnopqrst Creating an article for the Knowledgebase is similar to asking questions. First, navigate to the category where you feel the article should be. Once there, double check that an article doesn't already exist which would work. +INSERT INTO t1 VALUES ('abc', 'a', 'abc', REPEAT('a',21), REPEAT('x',256)); +Warnings: +Warning 1265 Data truncated for column 'c' at row 1 +Warning 1265 Data truncated for column 'c0' at row 1 +Warning 1265 Data truncated for column 'c1' at row 1 +Warning 1265 Data truncated for column 'c20' at row 1 +Warning 1265 Data truncated for column 'c255' at row 1 +INSERT INTO t1 SELECT c255, c255, c255, c255, CONCAT(c255,c1) FROM t1; +Warnings: +Warning 1265 Data truncated for column 'c' at row 2 +Warning 1265 Data truncated for column 'c0' at row 2 +Warning 1265 Data truncated for column 'c1' at row 2 +Warning 1265 Data truncated for column 'c20' at row 2 +Warning 1265 Data truncated for column 'c' at row 3 +Warning 1265 Data truncated for column 'c0' at row 3 +Warning 1265 Data truncated for column 'c1' at row 3 +Warning 1265 Data truncated for column 'c20' at row 3 +Warning 1265 Data truncated for column 'c255' at row 3 +SELECT * FROM t1; +c c0 c1 c20 c255 + + +C C Creating an article Creating an article for the Knowledgebase is similar to asking questions. First, navigate to the category where you feel the article should be. Once there, double check that an article doesn't already exist which would work.b +a a aaaaaaaaaaaaaaaaaaaa xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +a b abcdefghi klmnopqrst Creating an article for the Knowledgebase is similar to asking questions. First, navigate to the category where you feel the article should be. Once there, double check that an article doesn't already exist which would work. +x x xxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +SELECT DISTINCT c20, REPEAT('a',LENGTH(c20)), COUNT(*) FROM t1 GROUP BY c1, c20; +c20 REPEAT('a',LENGTH(c20)) COUNT(*) + 2 +Creating an article aaaaaaaaaaaaaaaaaaa 1 +aaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaa 1 +abcdefghi klmnopqrst aaaaaaaaaaaaaaaaaaaa 1 +xxxxxxxxxxxxxxxxxxxx aaaaaaaaaaaaaaaaaaaa 1 +ALTER TABLE t1 ADD COLUMN c257 CHAR(257) <CUSTOM_COL_OPTIONS> NULL; +ERROR 42000: Column length too big for column 'c257' (max = 255); use BLOB or TEXT instead +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c CHAR <CUSTOM_COL_OPTIONS> NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c char(1) YES NULL +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c), COUNT(*) FROM t1; +COUNT(c) COUNT(*) +0 1 +DROP TABLE t1; +CREATE TABLE t1 (c CHAR <CUSTOM_COL_OPTIONS> NULL, +c1 CHAR <CUSTOM_COL_OPTIONS> NULL DEFAULT NULL, +c2 CHAR <CUSTOM_COL_OPTIONS> NULL DEFAULT '_' +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c char(1) YES NULL +c1 char(1) YES NULL +c2 char(1) YES _ +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c2), COUNT(c1), COUNT(c), COUNT(*) FROM t1; +COUNT(c2) COUNT(c1) COUNT(c) COUNT(*) +1 0 0 1 +DROP TABLE t1; +# +# VARCHAR columns +# +DROP TABLE IF EXISTS t1, t2; +CREATE TABLE t1 (v0 VARCHAR(0) <CUSTOM_COL_OPTIONS> NULL, +v1 VARCHAR(1) <CUSTOM_COL_OPTIONS> NULL, +v64 VARCHAR(64) <CUSTOM_COL_OPTIONS> NULL, +v65000 VARCHAR(65000) <CUSTOM_COL_OPTIONS> NULL +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +v0 varchar(0) # # # +v1 varchar(1) # # # +v64 varchar(64) # # # +v65000 varchar(65000) # # # +CREATE TABLE t2 (v VARCHAR(65532) <CUSTOM_COL_OPTIONS> NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t2; +Field Type Null Key Default Extra +v varchar(65532) # # # +INSERT INTO t1 (v0,v1,v64,v65000) VALUES ('','','',''); +INSERT INTO t1 (v0,v1,v64,v65000) VALUES ('','y','Once there, double check that an article doesn\'t already exist','Here is a list of recommended books on MariaDB and MySQL. We\'ve provided links to Amazon.com here for convenience, but they can be found at many other bookstores, both online and off. + + If you want to have your favorite MySQL / MariaDB book listed here, please leave a comment. + For developers who want to code on MariaDB or MySQL + + * Understanding MySQL Internals by Sasha Pachev, former MySQL developer at MySQL AB. + o This is the only book we know about that describes the internals of MariaDB / MySQL. A must have for anyone who wants to understand and develop on MariaDB! + o Not all topics are covered and some parts are slightly outdated, but still the best book on this topic. + * MySQL 5.1 Plugin Development by Sergei Golubchik and Andrew Hutchings + o A must read for anyone wanting to write a plugin for MariaDB, written by the Sergei who designed the plugin interface for MySQL and MariaDB! + + For MariaDB / MySQL end users + + * MariaDB Crash Course by Ben Forta + o First MariaDB book! + o For people who want to learn SQL and the basics of MariaDB. + o Now shipping. Purchase at Amazon.com or your favorite bookseller. + + * SQL-99 Complete, Really by Peter Gulutzan & Trudy Pelzer. + o Everything you wanted to know about the SQL 99 standard. Excellent reference book! + o Free to read in the Knowledgebase! + + * MySQL (4th Edition) by Paul DuBois + o The \'default\' book to read if you wont to learn to use MySQL / MariaDB. + + * MySQL Cookbook by Paul DuBois + o A lot of examples of how to use MySQL. As with all of Paul\'s books, it\'s worth its weight in gold and even enjoyable reading for such a \'dry\' subject. + + * High Performance MySQL, Second Edition, By Baron Schwartz, Peter Zaitsev, Vadim Tkachenko, Jeremy D. Zawodny, Arjen Lentz, Derek J. Balling, et al. + o \"High Performance MySQL is the definitive guide to building fast, reliable systems with MySQL. Written by noted experts with years of real-world experience building very large systems, this book covers every aspect of MySQL performance in detail, and focuses on robustness, security, and data integrity. Learn advanced techniques in depth so you can bring out MySQL\'s full power.\" (From the book description at O\'Reilly) + + * MySQL Admin Cookbook + o A quick step-by-step guide for MySQL users and database administrators to tackle real-world challenges with MySQL configuration and administration + + * MySQL 5.0 Certification Study Guide, By Paul DuBois, Stefan Hinz, Carsten Pedersen + o This is the official guide to cover the passing of the two MySQL Certification examinations. It is valid till version 5.0 of the server, so while it misses all the features available in MySQL 5.1 and greater (including MariaDB 5.1 and greater), it provides a good basic understanding of MySQL for the end-user. '); +SELECT * FROM t1; +v0 v1 v64 v65000 + + + + + + + + + + + + y Once there, double check that an article doesn't already exist Here is a list of recommended books on MariaDB and MySQL. We've provided links to Amazon.com here for convenience, but they can be found at many other bookstores, both online and off. + o "High Performance MySQL is the definitive guide to building fast, reliable systems with MySQL. Written by noted experts with years of real-world experience building very large systems, this book covers every aspect of MySQL performance in detail, and focuses on robustness, security, and data integrity. Learn advanced techniques in depth so you can bring out MySQL's full power." (From the book description at O'Reilly) + o A lot of examples of how to use MySQL. As with all of Paul's books, it's worth its weight in gold and even enjoyable reading for such a 'dry' subject. + o A must read for anyone wanting to write a plugin for MariaDB, written by the Sergei who designed the plugin interface for MySQL and MariaDB! + o A quick step-by-step guide for MySQL users and database administrators to tackle real-world challenges with MySQL configuration and administration + o Everything you wanted to know about the SQL 99 standard. Excellent reference book! + o First MariaDB book! + o For people who want to learn SQL and the basics of MariaDB. + o Free to read in the Knowledgebase! + o Not all topics are covered and some parts are slightly outdated, but still the best book on this topic. + o Now shipping. Purchase at Amazon.com or your favorite bookseller. + o The 'default' book to read if you wont to learn to use MySQL / MariaDB. + o This is the official guide to cover the passing of the two MySQL Certification examinations. It is valid till version 5.0 of the server, so while it misses all the features available in MySQL 5.1 and greater (including MariaDB 5.1 and greater), it provides a good basic understanding of MySQL for the end-user. + o This is the only book we know about that describes the internals of MariaDB / MySQL. A must have for anyone who wants to understand and develop on MariaDB! + * High Performance MySQL, Second Edition, By Baron Schwartz, Peter Zaitsev, Vadim Tkachenko, Jeremy D. Zawodny, Arjen Lentz, Derek J. Balling, et al. + * MariaDB Crash Course by Ben Forta + * MySQL (4th Edition) by Paul DuBois + * MySQL 5.0 Certification Study Guide, By Paul DuBois, Stefan Hinz, Carsten Pedersen + * MySQL 5.1 Plugin Development by Sergei Golubchik and Andrew Hutchings + * MySQL Admin Cookbook + * MySQL Cookbook by Paul DuBois + * SQL-99 Complete, Really by Peter Gulutzan & Trudy Pelzer. + * Understanding MySQL Internals by Sasha Pachev, former MySQL developer at MySQL AB. + For MariaDB / MySQL end users + For developers who want to code on MariaDB or MySQL + If you want to have your favorite MySQL / MariaDB book listed here, please leave a comment. +INSERT INTO t1 (v0,v1,v64,v65000) VALUES ('y', 'yy', REPEAT('c',65), REPEAT('abcdefghi ',6501)); +Warnings: +Warning 1265 Data truncated for column 'v0' at row 1 +Warning 1265 Data truncated for column 'v1' at row 1 +Warning 1265 Data truncated for column 'v64' at row 1 +Warning 1265 Data truncated for column 'v65000' at row 1 +INSERT INTO t1 (v0,v1,v64,v65000) SELECT v65000, v65000, v65000, CONCAT(v65000,v1) FROM t1; +Warnings: +Warning 1265 Data truncated for column 'v0' at row 2 +Warning 1265 Data truncated for column 'v1' at row 2 +Warning 1265 Data truncated for column 'v64' at row 2 +Warning 1265 Data truncated for column 'v0' at row 3 +Warning 1265 Data truncated for column 'v1' at row 3 +Warning 1265 Data truncated for column 'v64' at row 3 +Warning 1265 Data truncated for column 'v65000' at row 3 +SELECT v0, v1, v64, LENGTH(v65000) FROM t1; +v0 v1 v64 LENGTH(v65000) + 0 + 0 + H Here is a list of recommended books on MariaDB and MySQL. We've 2966 + a abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcd 65000 + y Once there, double check that an article doesn't already exist 2965 + y cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc 65000 +ALTER TABLE t1 ADD COLUMN v65536 VARCHAR(65536) <CUSTOM_COL_OPTIONS> NULL; +Warnings: +Note 1246 Converting column 'v65536' from VARCHAR to TEXT +Note 1246 Converting column 'v65536' from VARCHAR to TEXT +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +v0 varchar(0) # # # +v1 varchar(1) # # # +v64 varchar(64) # # # +v65000 varchar(65000) # # # +v65536 mediumtext # # # +DROP TABLE t1, t2; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c VARCHAR(64) <CUSTOM_COL_OPTIONS> NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c varchar(64) YES NULL +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c), COUNT(*) FROM t1; +COUNT(c) COUNT(*) +0 1 +DROP TABLE t1; +CREATE TABLE t1 (c VARCHAR(64) <CUSTOM_COL_OPTIONS> NULL, +c1 VARCHAR(64) <CUSTOM_COL_OPTIONS> NULL DEFAULT NULL, +c2 VARCHAR(64) <CUSTOM_COL_OPTIONS> NULL DEFAULT 'test default' +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c varchar(64) YES NULL +c1 varchar(64) YES NULL +c2 varchar(64) YES test default +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c2), COUNT(c1), COUNT(c), COUNT(*) FROM t1; +COUNT(c2) COUNT(c1) COUNT(c) COUNT(*) +1 0 0 1 +DROP TABLE t1; +# +# date and time columns +# +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (d DATE <CUSTOM_COL_OPTIONS> NULL, +dt DATETIME <CUSTOM_COL_OPTIONS> NULL, +ts TIMESTAMP <CUSTOM_COL_OPTIONS> NULL, +t TIME <CUSTOM_COL_OPTIONS> NULL, +y YEAR <CUSTOM_COL_OPTIONS> NULL, +y4 YEAR(4) <CUSTOM_COL_OPTIONS> NULL, +y2 YEAR(2) <CUSTOM_COL_OPTIONS> NULL +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +d date # # # +dt datetime # # # +ts timestamp # # # +t time # # # +y year(4) # # # +y4 year(4) # # # +y2 year(2) # # # +SET @tm = '2012-04-09 05:27:00'; +INSERT INTO t1 VALUES +('1000-01-01', '1000-01-01 00:00:00', FROM_UNIXTIME(1), '-838:59:59', '1901', '1901', '00'), +('9999-12-31', '9999-12-31 23:59:59', FROM_UNIXTIME(2147483647), '838:59:59', '2155', '2155', '99'), +('0000-00-00', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '00:00:00', '0', '0', '0'), +(DATE(@tm),@tm,TIMESTAMP(@tm),TIME(@tm),YEAR(@tm),YEAR(@tm),YEAR(@tm)); +SELECT * FROM t1; +d dt ts t y y4 y2 +0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 00:00:00 2000 2000 00 +1000-01-01 1000-01-01 00:00:00 1970-01-01 03:00:01 -838:59:59 1901 1901 00 +2012-04-09 2012-04-09 05:27:00 2012-04-09 05:27:00 05:27:00 2012 2012 12 +9999-12-31 9999-12-31 23:59:59 2038-01-19 07:14:07 838:59:59 2155 2155 99 +INSERT INTO t1 VALUES +('999-13-32', '999-11-31 00:00:00', '0', '-839:00:00', '1900', '1900', '-1' ); +Warnings: +Warning 1265 Data truncated for column 'd' at row 1 +Warning 1265 Data truncated for column 'dt' at row 1 +Warning 1265 Data truncated for column 'ts' at row 1 +Warning 1264 Out of range value for column 't' at row 1 +Warning 1264 Out of range value for column 'y' at row 1 +Warning 1264 Out of range value for column 'y4' at row 1 +Warning 1264 Out of range value for column 'y2' at row 1 +SELECT * FROM t1; +d dt ts t y y4 y2 +0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 -838:59:59 0000 0000 00 +0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 00:00:00 2000 2000 00 +1000-01-01 1000-01-01 00:00:00 1970-01-01 03:00:01 -838:59:59 1901 1901 00 +2012-04-09 2012-04-09 05:27:00 2012-04-09 05:27:00 05:27:00 2012 2012 12 +9999-12-31 9999-12-31 23:59:59 2038-01-19 07:14:07 838:59:59 2155 2155 99 +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c DATE <CUSTOM_COL_OPTIONS> NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c date YES NULL +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c), COUNT(*) FROM t1; +COUNT(c) COUNT(*) +0 1 +DROP TABLE t1; +CREATE TABLE t1 (c DATE <CUSTOM_COL_OPTIONS> NULL, +c1 DATE <CUSTOM_COL_OPTIONS> NULL DEFAULT NULL, +c2 DATE <CUSTOM_COL_OPTIONS> NULL DEFAULT '2012-12-21' +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c date YES NULL +c1 date YES NULL +c2 date YES 2012-12-21 +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c2), COUNT(c1), COUNT(c), COUNT(*) FROM t1; +COUNT(c2) COUNT(c1) COUNT(c) COUNT(*) +1 0 0 1 +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c DATETIME <CUSTOM_COL_OPTIONS> NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c datetime YES NULL +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c), COUNT(*) FROM t1; +COUNT(c) COUNT(*) +0 1 +DROP TABLE t1; +CREATE TABLE t1 (c DATETIME <CUSTOM_COL_OPTIONS> NULL, +c1 DATETIME <CUSTOM_COL_OPTIONS> NULL DEFAULT NULL, +c2 DATETIME <CUSTOM_COL_OPTIONS> NULL DEFAULT '2012-12-21 12:21:12' +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c datetime YES NULL +c1 datetime YES NULL +c2 datetime YES 2012-12-21 12:21:12 +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c2), COUNT(c1), COUNT(c), COUNT(*) FROM t1; +COUNT(c2) COUNT(c1) COUNT(c) COUNT(*) +1 0 0 1 +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c TIMESTAMP <CUSTOM_COL_OPTIONS> NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c timestamp YES NULL +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c), COUNT(*) FROM t1; +COUNT(c) COUNT(*) +0 1 +DROP TABLE t1; +CREATE TABLE t1 (c TIMESTAMP <CUSTOM_COL_OPTIONS> NULL, +c1 TIMESTAMP <CUSTOM_COL_OPTIONS> NULL DEFAULT NULL, +c2 TIMESTAMP <CUSTOM_COL_OPTIONS> NULL DEFAULT '2012-12-21 12:21:12' +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c timestamp YES NULL +c1 timestamp YES NULL +c2 timestamp YES 2012-12-21 12:21:12 +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c2), COUNT(c1), COUNT(c), COUNT(*) FROM t1; +COUNT(c2) COUNT(c1) COUNT(c) COUNT(*) +1 0 0 1 +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c TIME <CUSTOM_COL_OPTIONS> NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c time YES NULL +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c), COUNT(*) FROM t1; +COUNT(c) COUNT(*) +0 1 +DROP TABLE t1; +CREATE TABLE t1 (c TIME <CUSTOM_COL_OPTIONS> NULL, +c1 TIME <CUSTOM_COL_OPTIONS> NULL DEFAULT NULL, +c2 TIME <CUSTOM_COL_OPTIONS> NULL DEFAULT '12:21:12' +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c time YES NULL +c1 time YES NULL +c2 time YES 12:21:12 +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c2), COUNT(c1), COUNT(c), COUNT(*) FROM t1; +COUNT(c2) COUNT(c1) COUNT(c) COUNT(*) +1 0 0 1 +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c YEAR <CUSTOM_COL_OPTIONS> NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c year(4) YES NULL +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c), COUNT(*) FROM t1; +COUNT(c) COUNT(*) +0 1 +DROP TABLE t1; +CREATE TABLE t1 (c YEAR <CUSTOM_COL_OPTIONS> NULL, +c1 YEAR <CUSTOM_COL_OPTIONS> NULL DEFAULT NULL, +c2 YEAR <CUSTOM_COL_OPTIONS> NULL DEFAULT '2012' +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c year(4) YES NULL +c1 year(4) YES NULL +c2 year(4) YES 2012 +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c2), COUNT(c1), COUNT(c), COUNT(*) FROM t1; +COUNT(c2) COUNT(c1) COUNT(c) COUNT(*) +1 0 0 1 +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c YEAR(2) <CUSTOM_COL_OPTIONS> NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c year(2) YES NULL +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c), COUNT(*) FROM t1; +COUNT(c) COUNT(*) +0 1 +DROP TABLE t1; +CREATE TABLE t1 (c YEAR(2) <CUSTOM_COL_OPTIONS> NULL, +c1 YEAR(2) <CUSTOM_COL_OPTIONS> NULL DEFAULT NULL, +c2 YEAR(2) <CUSTOM_COL_OPTIONS> NULL DEFAULT '12' +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c year(2) YES NULL +c1 year(2) YES NULL +c2 year(2) YES 12 +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c2), COUNT(c1), COUNT(c), COUNT(*) FROM t1; +COUNT(c2) COUNT(c1) COUNT(c) COUNT(*) +1 0 0 1 +DROP TABLE t1; +# +# ENUM columns +# +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a ENUM('') <CUSTOM_COL_OPTIONS> NULL, +b ENUM('test1','test2','test3','test4','test5') <CUSTOM_COL_OPTIONS> NULL, +c ENUM('1','2','3','4','5','6','7','8','9','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',' ','11','12','13','14','15','16','17','18','19','1a','1b','1c','1d','1e','1f','1g','1h','1i','1j','1k','1l','1m','1n','1o','1p','1q','1r','1s','1t','1u','1v','1w','1x','1y','1z','20','21','22','23','24','25','26','27','28','29','2a','2b','2c','2d','2e','2f','2g','2h','2i','2j','2k','2l','2m','2n','2o','2p','2q','2r','2s','2t','2u','2v','2w','2x','2y','2z','30','31','32','33','34','35','36','37','38','39','3a','3b','3c','3d','3e','3f','3g','3h','3i','3j','3k','3l','3m','3n','3o','3p','3q','3r','3s','3t','3u','3v','3w','3x','3y','3z','40','41','42','43','44','45','46','47','48','49','4a','4b','4c','4d','4e','4f','4g','4h','4i','4j','4k','4l','4m','4n','4o','4p','4q','4r','4s','4t','4u','4v','4w','4x','4y','4z','50','51','52','53','54','55','56','57','58','59','5a','5b','5c','5d','5e','5f','5g','5h','5i','5j','5k','5l','5m','5n','5o','5p','5q','5r','5s','5t','5u','5v','5w','5x','5y','5z','60','61','62','63','64','65','66','67','68','69','6a','6b','6c','6d','6e','6f','6g','6h','6i','6j','6k','6l','6m','6n','6o','6p','6q','6r','6s','6t','6u','6v','6w','6x','6y','6z','70','71','72','73','74','75') <CUSTOM_COL_OPTIONS> NULL +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +a enum('') # # # +b enum('test1','test2','test3','test4','test5') # # # +c enum('1','2','3','4','5','6','7','8','9','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','','11','12','13','14','15','16','17','18','19','1a','1b','1c','1d','1e','1f','1g','1h','1i','1j','1k','1l','1m','1n','1o','1p','1q','1r','1s','1t','1u','1v','1w','1x','1y','1z','20','21','22','23','24','25','26','27','28','29','2a','2b','2c','2d','2e','2f','2g','2h','2i','2j','2k','2l','2m','2n','2o','2p','2q','2r','2s','2t','2u','2v','2w','2x','2y','2z','30','31','32','33','34','35','36','37','38','39','3a','3b','3c','3d','3e','3f','3g','3h','3i','3j','3k','3l','3m','3n','3o','3p','3q','3r','3s','3t','3u','3v','3w','3x','3y','3z','40','41','42','43','44','45','46','47','48','49','4a','4b','4c','4d','4e','4f','4g','4h','4i','4j','4k','4l','4m','4n','4o','4p','4q','4r','4s','4t','4u','4v','4w','4x','4y','4z','50','51','52','53','54','55','56','57','58','59','5a','5b','5c','5d','5e','5f','5g','5h','5i','5j','5k','5l','5m','5n','5o','5p','5q','5r','5s','5t','5u','5v','5w','5x','5y','5z','60','61','62','63','64','65','66','67','68','69','6a','6b','6c','6d','6e','6f','6g','6h','6i','6j','6k','6l','6m','6n','6o','6p','6q','6r','6s','6t','6u','6v','6w','6x','6y','6z','70','71','72','73','74','75') # # # +INSERT INTO t1 VALUES ('','test2','4'),('',5,2); +SELECT * FROM t1; +a b c + test2 4 + test5 2 +INSERT INTO t1 VALUES (0,'test6',-1); +Warnings: +Warning 1265 Data truncated for column 'a' at row 1 +Warning 1265 Data truncated for column 'b' at row 1 +Warning 1265 Data truncated for column 'c' at row 1 +SELECT * FROM t1; +a b c + + test2 4 + test5 2 +ALTER TABLE t1 ADD COLUMN e ENUM('a','A') <CUSTOM_COL_OPTIONS> NULL; +Warnings: +Note 1291 Column 'e' has duplicated value 'a' in ENUM +Note 1291 Column 'e' has duplicated value 'a' in ENUM +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +a enum('') # # # +b enum('test1','test2','test3','test4','test5') # # # +c enum('1','2','3','4','5','6','7','8','9','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','','11','12','13','14','15','16','17','18','19','1a','1b','1c','1d','1e','1f','1g','1h','1i','1j','1k','1l','1m','1n','1o','1p','1q','1r','1s','1t','1u','1v','1w','1x','1y','1z','20','21','22','23','24','25','26','27','28','29','2a','2b','2c','2d','2e','2f','2g','2h','2i','2j','2k','2l','2m','2n','2o','2p','2q','2r','2s','2t','2u','2v','2w','2x','2y','2z','30','31','32','33','34','35','36','37','38','39','3a','3b','3c','3d','3e','3f','3g','3h','3i','3j','3k','3l','3m','3n','3o','3p','3q','3r','3s','3t','3u','3v','3w','3x','3y','3z','40','41','42','43','44','45','46','47','48','49','4a','4b','4c','4d','4e','4f','4g','4h','4i','4j','4k','4l','4m','4n','4o','4p','4q','4r','4s','4t','4u','4v','4w','4x','4y','4z','50','51','52','53','54','55','56','57','58','59','5a','5b','5c','5d','5e','5f','5g','5h','5i','5j','5k','5l','5m','5n','5o','5p','5q','5r','5s','5t','5u','5v','5w','5x','5y','5z','60','61','62','63','64','65','66','67','68','69','6a','6b','6c','6d','6e','6f','6g','6h','6i','6j','6k','6l','6m','6n','6o','6p','6q','6r','6s','6t','6u','6v','6w','6x','6y','6z','70','71','72','73','74','75') # # # +e enum('a','A') # # # +INSERT INTO t1 VALUES ('','test3','75','A'); +SELECT * FROM t1; +a b c e + NULL + test2 4 NULL + test3 75 a + test5 2 NULL +SELECT * FROM t1 WHERE b='test2' OR a != ''; +a b c e + test2 4 NULL +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c ENUM('test1','test2','test3') <CUSTOM_COL_OPTIONS> NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c enum('test1','test2','test3') YES NULL +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c), COUNT(*) FROM t1; +COUNT(c) COUNT(*) +0 1 +DROP TABLE t1; +CREATE TABLE t1 (c ENUM('test1','test2','test3') <CUSTOM_COL_OPTIONS> NULL, +c1 ENUM('test1','test2','test3') <CUSTOM_COL_OPTIONS> NULL DEFAULT NULL, +c2 ENUM('test1','test2','test3') <CUSTOM_COL_OPTIONS> NULL DEFAULT 'test2' +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c enum('test1','test2','test3') YES NULL +c1 enum('test1','test2','test3') YES NULL +c2 enum('test1','test2','test3') YES test2 +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c2), COUNT(c1), COUNT(c), COUNT(*) FROM t1; +COUNT(c2) COUNT(c1) COUNT(c) COUNT(*) +1 0 0 1 +DROP TABLE t1; +# +# Fixed point columns (NUMERIC, DECIMAL) +# +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (d DECIMAL <CUSTOM_COL_OPTIONS> NULL, +d0 DECIMAL(0) <CUSTOM_COL_OPTIONS> NULL, +d1_1 DECIMAL(1,1) <CUSTOM_COL_OPTIONS> NULL, +d10_2 DECIMAL(10,2) <CUSTOM_COL_OPTIONS> NULL, +d60_10 DECIMAL(60,10) <CUSTOM_COL_OPTIONS> NULL, +n NUMERIC <CUSTOM_COL_OPTIONS> NULL, +n0_0 NUMERIC(0,0) <CUSTOM_COL_OPTIONS> NULL, +n1 NUMERIC(1) <CUSTOM_COL_OPTIONS> NULL, +n20_4 NUMERIC(20,4) <CUSTOM_COL_OPTIONS> NULL, +n65_4 NUMERIC(65,4) <CUSTOM_COL_OPTIONS> NULL +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +d decimal(10,0) # # # +d0 decimal(10,0) # # # +d1_1 decimal(1,1) # # # +d10_2 decimal(10,2) # # # +d60_10 decimal(60,10) # # # +n decimal(10,0) # # # +n0_0 decimal(10,0) # # # +n1 decimal(1,0) # # # +n20_4 decimal(20,4) # # # +n65_4 decimal(65,4) # # # +INSERT INTO t1 VALUES (100,123456,0.3,40000.25,123456789123456789.10001,1024,7000.0,8.0,999999.9,9223372036854775807); +INSERT INTO t1 VALUES (0,0,0,0,0,0,0,0,0,0); +INSERT INTO t1 VALUES (9999999999.0,9999999999.0,0.9,99999999.99,99999999999999999999999999999999999999999999999999.9999999999,9999999999.0,9999999999.0,9.0,9999999999999999.9999,9999999999999999999999999999999999999999999999999999999999999.9999); +SELECT * FROM t1; +d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 +0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 +100 123456 0.3 40000.25 123456789123456789.1000100000 1024 7000 8 999999.9000 9223372036854775807.0000 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +INSERT INTO t1 VALUES (-100,-123456,-0.3,-40000.25,-123456789123456789.10001,-1024,-7000.0,-8.0,-999999.9,-9223372036854775807); +INSERT INTO t1 VALUES (-9999999999.0,-9999999999.0,-0.9,-99999999.99,-99999999999999999999999999999999999999999999999999.9999999999,-9999999999.0,-9999999999.0,-9.0,-9999999999999999.9999,-9999999999999999999999999999999999999999999999999999999999999.9999); +SELECT * FROM t1; +d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 +-100 -123456 -0.3 -40000.25 -123456789123456789.1000100000 -1024 -7000 -8 -999999.9000 -9223372036854775807.0000 +-9999999999 -9999999999 -0.9 -99999999.99 -99999999999999999999999999999999999999999999999999.9999999999 -9999999999 -9999999999 -9 -9999999999999999.9999 -9999999999999999999999999999999999999999999999999999999999999.9999 +0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 +100 123456 0.3 40000.25 123456789123456789.1000100000 1024 7000 8 999999.9000 9223372036854775807.0000 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +SELECT * FROM t1 WHERE n20_4 = 9999999999999999.9999 OR d < 100; +d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 +-100 -123456 -0.3 -40000.25 -123456789123456789.1000100000 -1024 -7000 -8 -999999.9000 -9223372036854775807.0000 +-9999999999 -9999999999 -0.9 -99999999.99 -99999999999999999999999999999999999999999999999999.9999999999 -9999999999 -9999999999 -9 -9999999999999999.9999 -9999999999999999999999999999999999999999999999999999999999999.9999 +0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +INSERT INTO t1 SELECT n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4 FROM t1 WHERE n65_4 = ( SELECT MAX(n65_4) FROM t1 ); +Warnings: +Warning 1264 Out of range value for column 'd' at row 1 +Warning 1264 Out of range value for column 'd0' at row 1 +Warning 1264 Out of range value for column 'd1_1' at row 1 +Warning 1264 Out of range value for column 'd10_2' at row 1 +Warning 1264 Out of range value for column 'd60_10' at row 1 +Warning 1264 Out of range value for column 'n' at row 1 +Warning 1264 Out of range value for column 'n0_0' at row 1 +Warning 1264 Out of range value for column 'n1' at row 1 +Warning 1264 Out of range value for column 'n20_4' at row 1 +SELECT * FROM t1; +d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 +-100 -123456 -0.3 -40000.25 -123456789123456789.1000100000 -1024 -7000 -8 -999999.9000 -9223372036854775807.0000 +-9999999999 -9999999999 -0.9 -99999999.99 -99999999999999999999999999999999999999999999999999.9999999999 -9999999999 -9999999999 -9 -9999999999999999.9999 -9999999999999999999999999999999999999999999999999999999999999.9999 +0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 +100 123456 0.3 40000.25 123456789123456789.1000100000 1024 7000 8 999999.9000 9223372036854775807.0000 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +INSERT INTO t1 VALUES (10000000000.0,10000000000.0,1.1,100000000.99,100000000000000000000000000000000000000000000000000.0,10000000000.0,10000000000.0,10.0,10000000000000000.9999,10000000000000000000000000000000000000000000000000000000000000.9999); +Warnings: +Warning 1264 Out of range value for column 'd' at row 1 +Warning 1264 Out of range value for column 'd0' at row 1 +Warning 1264 Out of range value for column 'd1_1' at row 1 +Warning 1264 Out of range value for column 'd10_2' at row 1 +Warning 1264 Out of range value for column 'd60_10' at row 1 +Warning 1264 Out of range value for column 'n' at row 1 +Warning 1264 Out of range value for column 'n0_0' at row 1 +Warning 1264 Out of range value for column 'n1' at row 1 +Warning 1264 Out of range value for column 'n20_4' at row 1 +Warning 1264 Out of range value for column 'n65_4' at row 1 +SELECT * FROM t1; +d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 +-100 -123456 -0.3 -40000.25 -123456789123456789.1000100000 -1024 -7000 -8 -999999.9000 -9223372036854775807.0000 +-9999999999 -9999999999 -0.9 -99999999.99 -99999999999999999999999999999999999999999999999999.9999999999 -9999999999 -9999999999 -9 -9999999999999999.9999 -9999999999999999999999999999999999999999999999999999999999999.9999 +0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 +100 123456 0.3 40000.25 123456789123456789.1000100000 1024 7000 8 999999.9000 9223372036854775807.0000 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +INSERT INTO t1 VALUES (9999999999.1,9999999999.1,1.9,99999999.001,99999999999999999999999999999999999999999999999999.99999999991,9999999999.1,9999999999.1,9.1,9999999999999999.00001,9999999999999999999999999999999999999999999999999999999999999.11111); +Warnings: +Note 1265 Data truncated for column 'd' at row 1 +Note 1265 Data truncated for column 'd0' at row 1 +Warning 1264 Out of range value for column 'd1_1' at row 1 +Note 1265 Data truncated for column 'd10_2' at row 1 +Note 1265 Data truncated for column 'd60_10' at row 1 +Note 1265 Data truncated for column 'n' at row 1 +Note 1265 Data truncated for column 'n0_0' at row 1 +Note 1265 Data truncated for column 'n1' at row 1 +Note 1265 Data truncated for column 'n20_4' at row 1 +Note 1265 Data truncated for column 'n65_4' at row 1 +SELECT * FROM t1; +d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 +-100 -123456 -0.3 -40000.25 -123456789123456789.1000100000 -1024 -7000 -8 -999999.9000 -9223372036854775807.0000 +-9999999999 -9999999999 -0.9 -99999999.99 -99999999999999999999999999999999999999999999999999.9999999999 -9999999999 -9999999999 -9 -9999999999999999.9999 -9999999999999999999999999999999999999999999999999999999999999.9999 +0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 +100 123456 0.3 40000.25 123456789123456789.1000100000 1024 7000 8 999999.9000 9223372036854775807.0000 +9999999999 9999999999 0.9 99999999.00 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.0000 9999999999999999999999999999999999999999999999999999999999999.1111 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +ALTER TABLE t1 ADD COLUMN n66 NUMERIC(66); +ERROR 42000: Too big precision 66 specified for 'n66'. Maximum is 65. +ALTER TABLE t1 ADD COLUMN n66_6 DECIMAL(66,6); +ERROR 42000: Too big precision 66 specified for 'n66_6'. Maximum is 65. +ALTER TABLE t1 ADD COLUMN n66_66 DECIMAL(66,66); +ERROR 42000: Too big scale 66 specified for 'n66_66'. Maximum is 30. +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c DECIMAL <CUSTOM_COL_OPTIONS> NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c decimal(10,0) YES NULL +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c), COUNT(*) FROM t1; +COUNT(c) COUNT(*) +0 1 +DROP TABLE t1; +CREATE TABLE t1 (c DECIMAL <CUSTOM_COL_OPTIONS> NULL, +c1 DECIMAL <CUSTOM_COL_OPTIONS> NULL DEFAULT NULL, +c2 DECIMAL <CUSTOM_COL_OPTIONS> NULL DEFAULT 1.1 +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +Warnings: +Note 1265 Data truncated for column 'c2' at row 1 +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c decimal(10,0) YES NULL +c1 decimal(10,0) YES NULL +c2 decimal(10,0) YES 1 +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c2), COUNT(c1), COUNT(c), COUNT(*) FROM t1; +COUNT(c2) COUNT(c1) COUNT(c) COUNT(*) +1 0 0 1 +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c NUMERIC <CUSTOM_COL_OPTIONS> NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c decimal(10,0) YES NULL +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c), COUNT(*) FROM t1; +COUNT(c) COUNT(*) +0 1 +DROP TABLE t1; +CREATE TABLE t1 (c NUMERIC <CUSTOM_COL_OPTIONS> NULL, +c1 NUMERIC <CUSTOM_COL_OPTIONS> NULL DEFAULT NULL, +c2 NUMERIC <CUSTOM_COL_OPTIONS> NULL DEFAULT 0 +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c decimal(10,0) YES NULL +c1 decimal(10,0) YES NULL +c2 decimal(10,0) YES 0 +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c2), COUNT(c1), COUNT(c), COUNT(*) FROM t1; +COUNT(c2) COUNT(c1) COUNT(c) COUNT(*) +1 0 0 1 +DROP TABLE t1; +# +# Floating point columns (FLOAT, DOUBLE) +# +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (f FLOAT <CUSTOM_COL_OPTIONS> NULL, +f0 FLOAT(0) <CUSTOM_COL_OPTIONS> NULL, +r1_1 REAL(1,1) <CUSTOM_COL_OPTIONS> NULL, +f23_0 FLOAT(23) <CUSTOM_COL_OPTIONS> NULL, +f20_3 FLOAT(20,3) <CUSTOM_COL_OPTIONS> NULL, +d DOUBLE <CUSTOM_COL_OPTIONS> NULL, +d1_0 DOUBLE(1,0) <CUSTOM_COL_OPTIONS> NULL, +d10_10 DOUBLE PRECISION (10,10) <CUSTOM_COL_OPTIONS> NULL, +d53 DOUBLE(53,0) <CUSTOM_COL_OPTIONS> NULL, +d53_10 DOUBLE(53,10) <CUSTOM_COL_OPTIONS> NULL +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +f float # # # +f0 float # # # +r1_1 double(1,1) # # # +f23_0 float # # # +f20_3 float(20,3) # # # +d double # # # +d1_0 double(1,0) # # # +d10_10 double(10,10) # # # +d53 double(53,0) # # # +d53_10 double(53,10) # # # +INSERT INTO t1 VALUES (12345.12345,12345.12345,0.9,123456789.123,56789.987,11111111.111,8.0,0.0123456789,1234566789123456789,99999999999999999.99999999); +SELECT * FROM t1; +f 12345.1 +d 11111111.111 +d10_10 0.0123456789 +d1_0 8 +d53 1234566789123456800 +d53_10 100000000000000000.0000000000 +f0 12345.1 +f20_3 56789.988 +f23_0 123457000 +r1_1 0.9 +INSERT INTO t1 VALUES (0,0,0,0,0,0,0,0,0,0); +INSERT INTO t1 VALUES ( +99999999999999999999999999999999999999, +99999999999999999999999999999999999999.9999999999999999, +0.9, +99999999999999999999999999999999999999.9, +99999999999999999.999, +999999999999999999999999999999999999999999999999999999999999999999999999999999999, +9, +0.9999999999, +1999999999999999999999999999999999999999999999999999999, +19999999999999999999999999999999999999999999.9999999999 +); +Warnings: +Warning 1264 Out of range value for column 'd53' at row 1 +Warning 1264 Out of range value for column 'd53_10' at row 1 +SELECT * FROM t1; +f 12345.1 +d 0 +d 11111111.111 +d 1e81 +d10_10 0.0000000000 +d10_10 0.0123456789 +d10_10 0.9999999999 +d1_0 0 +d1_0 8 +d1_0 9 +d53 0 +d53 100000000000000000000000000000000000000000000000000000 +d53 1234566789123456800 +d53_10 0.0000000000 +d53_10 100000000000000000.0000000000 +d53_10 10000000000000000000000000000000000000000000.0000000000 +f 0 +f 1e38 +f0 0 +f0 12345.1 +f0 1e38 +f20_3 0.000 +f20_3 56789.988 +f20_3 99999998430674940.000 +f23_0 0 +f23_0 123457000 +f23_0 1e38 +r1_1 0.0 +r1_1 0.9 +r1_1 0.9 +INSERT INTO t1 VALUES (-999999999999999999999999,-99999999999.999999999999,-0.9,-999.99999999999999999999,-99999999999999999.999,-999999999999999999999999999999999999999999999999999999999999-0.999,-9,-.9999999999,-999999999999999999999999999999.99999999999999999999999,-9999999999999999999999999999999999999999999.9999999999); +SELECT * FROM t1; +f 12345.1 +d -1e60 +d 0 +d 11111111.111 +d 1e81 +d10_10 -0.9999999999 +d10_10 0.0000000000 +d10_10 0.0123456789 +d10_10 0.9999999999 +d1_0 -9 +d1_0 0 +d1_0 8 +d1_0 9 +d53 -1000000000000000000000000000000 +d53 0 +d53 100000000000000000000000000000000000000000000000000000 +d53 1234566789123456800 +d53_10 -10000000000000000000000000000000000000000000.0000000000 +d53_10 0.0000000000 +d53_10 100000000000000000.0000000000 +d53_10 10000000000000000000000000000000000000000000.0000000000 +f -1e24 +f 0 +f 1e38 +f0 -100000000000 +f0 0 +f0 12345.1 +f0 1e38 +f20_3 -99999998430674940.000 +f20_3 0.000 +f20_3 56789.988 +f20_3 99999998430674940.000 +f23_0 -1000 +f23_0 0 +f23_0 123457000 +f23_0 1e38 +r1_1 -0.9 +r1_1 0.0 +r1_1 0.9 +r1_1 0.9 +SELECT MAX(f), MAX(f0), MAX(r1_1), MAX(f23_0), MAX(f20_3), MAX(d), MAX(d1_0), MAX(d10_10), MAX(d53), MAX(d53_10) FROM t1; +MAX(f) 9.999999680285692e37 +MAX(d) 1e81 +MAX(d10_10) 0.9999999999 +MAX(d1_0) 9 +MAX(d53) 100000000000000000000000000000000000000000000000000000 +MAX(d53_10) 10000000000000000000000000000000000000000000.0000000000 +MAX(f0) 9.999999680285692e37 +MAX(f20_3) 99999998430674940.000 +MAX(f23_0) 9.999999680285692e37 +MAX(r1_1) 0.9 +INSERT INTO t1 SELECT d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10 FROM t1 ORDER BY d53_10 DESC LIMIT 1; +Warnings: +Warning 1264 Out of range value for column 'f' at row 1 +Warning 1264 Out of range value for column 'f0' at row 1 +Warning 1264 Out of range value for column 'r1_1' at row 1 +Warning 1264 Out of range value for column 'f23_0' at row 1 +Warning 1264 Out of range value for column 'f20_3' at row 1 +Warning 1264 Out of range value for column 'd1_0' at row 1 +SELECT * FROM t1; +f 12345.1 +d -1e60 +d 0 +d 11111111.111 +d 1e43 +d 1e81 +d10_10 -0.9999999999 +d10_10 0.0000000000 +d10_10 0.0123456789 +d10_10 0.9999999999 +d10_10 10000000000000000000000000000000000000000000.0000000000 +d1_0 -9 +d1_0 0 +d1_0 8 +d1_0 9 +d1_0 9 +d53 -1000000000000000000000000000000 +d53 0 +d53 10000000000000000000000000000000000000000000 +d53 100000000000000000000000000000000000000000000000000000 +d53 1234566789123456800 +d53_10 -10000000000000000000000000000000000000000000.0000000000 +d53_10 0.0000000000 +d53_10 100000000000000000.0000000000 +d53_10 10000000000000000000000000000000000000000000.0000000000 +d53_10 10000000000000000000000000000000000000000000.0000000000 +f -1e24 +f 0 +f 1e38 +f 3.40282e38 +f0 -100000000000 +f0 0 +f0 12345.1 +f0 1e38 +f0 3.40282e38 +f20_3 -99999998430674940.000 +f20_3 0.000 +f20_3 56789.988 +f20_3 99999998430674940.000 +f20_3 99999998430674940.000 +f23_0 -1000 +f23_0 0 +f23_0 123457000 +f23_0 1e38 +f23_0 3.40282e38 +r1_1 -0.9 +r1_1 0.0 +r1_1 0.9 +r1_1 0.9 +r1_1 0.9 +INSERT INTO t1 VALUES ( +999999999999999999999999999999999999999, +999999999999999999999999999999999999999.9999999999999999, +1.9, +999999999999999999999999999999999999999.9, +999999999999999999.999, +9999999999999999999999999999999999999999999999999999999999999999999999999999999999, +99, +1.9999999999, +1999999999999999999999999999999999999999999999999999999, +19999999999999999999999999999999999999999999.9999999999 +); +Warnings: +Warning 1916 Got overflow when converting '' to DECIMAL. Value truncated. +Warning 1264 Out of range value for column 'f' at row 1 +Warning 1264 Out of range value for column 'f0' at row 1 +Warning 1264 Out of range value for column 'r1_1' at row 1 +Warning 1264 Out of range value for column 'f23_0' at row 1 +Warning 1264 Out of range value for column 'f20_3' at row 1 +Warning 1264 Out of range value for column 'd1_0' at row 1 +Warning 1264 Out of range value for column 'd10_10' at row 1 +Warning 1264 Out of range value for column 'd53' at row 1 +Warning 1264 Out of range value for column 'd53_10' at row 1 +SELECT * FROM t1; +f 12345.1 +d -1e60 +d 0 +d 11111111.111 +d 1e43 +d 1e65 +d 1e81 +d10_10 -0.9999999999 +d10_10 0.0000000000 +d10_10 0.0123456789 +d10_10 0.9999999999 +d10_10 0.9999999999 +d10_10 10000000000000000000000000000000000000000000.0000000000 +d1_0 -9 +d1_0 0 +d1_0 8 +d1_0 9 +d1_0 9 +d1_0 9 +d53 -1000000000000000000000000000000 +d53 0 +d53 10000000000000000000000000000000000000000000 +d53 100000000000000000000000000000000000000000000000000000 +d53 100000000000000000000000000000000000000000000000000000 +d53 1234566789123456800 +d53_10 -10000000000000000000000000000000000000000000.0000000000 +d53_10 0.0000000000 +d53_10 100000000000000000.0000000000 +d53_10 10000000000000000000000000000000000000000000.0000000000 +d53_10 10000000000000000000000000000000000000000000.0000000000 +d53_10 10000000000000000000000000000000000000000000.0000000000 +f -1e24 +f 0 +f 1e38 +f 3.40282e38 +f 3.40282e38 +f0 -100000000000 +f0 0 +f0 12345.1 +f0 1e38 +f0 3.40282e38 +f0 3.40282e38 +f20_3 -99999998430674940.000 +f20_3 0.000 +f20_3 56789.988 +f20_3 99999998430674940.000 +f20_3 99999998430674940.000 +f20_3 99999998430674940.000 +f23_0 -1000 +f23_0 0 +f23_0 123457000 +f23_0 1e38 +f23_0 3.40282e38 +f23_0 3.40282e38 +r1_1 -0.9 +r1_1 0.0 +r1_1 0.9 +r1_1 0.9 +r1_1 0.9 +r1_1 0.9 +ALTER TABLE t1 ADD COLUMN d0_0 DOUBLE(0,0); +ERROR 42000: Display width out of range for 'd0_0' (max = 255) +ALTER TABLE t1 ADD COLUMN n66_6 DECIMAL(256,1); +ERROR 42000: Too big precision 256 specified for 'n66_6'. Maximum is 65. +ALTER TABLE t1 ADD COLUMN n66_66 DECIMAL(40,35); +ERROR 42000: Too big scale 35 specified for 'n66_66'. Maximum is 30. +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c FLOAT <CUSTOM_COL_OPTIONS> NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c float YES NULL +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c), COUNT(*) FROM t1; +COUNT(c) COUNT(*) +0 1 +DROP TABLE t1; +CREATE TABLE t1 (c FLOAT <CUSTOM_COL_OPTIONS> NULL, +c1 FLOAT <CUSTOM_COL_OPTIONS> NULL DEFAULT NULL, +c2 FLOAT <CUSTOM_COL_OPTIONS> NULL DEFAULT 1.1 +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c float YES NULL +c1 float YES NULL +c2 float YES 1.1 +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c2), COUNT(c1), COUNT(c), COUNT(*) FROM t1; +COUNT(c2) COUNT(c1) COUNT(c) COUNT(*) +1 0 0 1 +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c DOUBLE <CUSTOM_COL_OPTIONS> NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c double YES NULL +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c), COUNT(*) FROM t1; +COUNT(c) COUNT(*) +0 1 +DROP TABLE t1; +CREATE TABLE t1 (c DOUBLE <CUSTOM_COL_OPTIONS> NULL, +c1 DOUBLE <CUSTOM_COL_OPTIONS> NULL DEFAULT NULL, +c2 DOUBLE <CUSTOM_COL_OPTIONS> NULL DEFAULT 0 +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c double YES NULL +c1 double YES NULL +c2 double YES 0 +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c2), COUNT(c1), COUNT(c), COUNT(*) FROM t1; +COUNT(c2) COUNT(c1) COUNT(c) COUNT(*) +1 0 0 1 +DROP TABLE t1; +# +# INT columns +# +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (i INT <CUSTOM_COL_OPTIONS> NULL, +i0 INT(0) <CUSTOM_COL_OPTIONS> NULL, +i1 INT(1) <CUSTOM_COL_OPTIONS> NULL, +i20 INT(20) <CUSTOM_COL_OPTIONS> NULL, +t TINYINT <CUSTOM_COL_OPTIONS> NULL, +t0 TINYINT(0) <CUSTOM_COL_OPTIONS> NULL, +t1 TINYINT(1) <CUSTOM_COL_OPTIONS> NULL, +t20 TINYINT(20) <CUSTOM_COL_OPTIONS> NULL, +s SMALLINT <CUSTOM_COL_OPTIONS> NULL, +s0 SMALLINT(0) <CUSTOM_COL_OPTIONS> NULL, +s1 SMALLINT(1) <CUSTOM_COL_OPTIONS> NULL, +s20 SMALLINT(20) <CUSTOM_COL_OPTIONS> NULL, +m MEDIUMINT <CUSTOM_COL_OPTIONS> NULL, +m0 MEDIUMINT(0) <CUSTOM_COL_OPTIONS> NULL, +m1 MEDIUMINT(1) <CUSTOM_COL_OPTIONS> NULL, +m20 MEDIUMINT(20) <CUSTOM_COL_OPTIONS> NULL, +b BIGINT <CUSTOM_COL_OPTIONS> NULL, +b0 BIGINT(0) <CUSTOM_COL_OPTIONS> NULL, +b1 BIGINT(1) <CUSTOM_COL_OPTIONS> NULL, +b20 BIGINT(20) <CUSTOM_COL_OPTIONS> NULL +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +i int(11) # # # +i0 int(11) # # # +i1 int(1) # # # +i20 int(20) # # # +t tinyint(4) # # # +t0 tinyint(4) # # # +t1 tinyint(1) # # # +t20 tinyint(20) # # # +s smallint(6) # # # +s0 smallint(6) # # # +s1 smallint(1) # # # +s20 smallint(20) # # # +m mediumint(9) # # # +m0 mediumint(9) # # # +m1 mediumint(1) # # # +m20 mediumint(20) # # # +b bigint(20) # # # +b0 bigint(20) # # # +b1 bigint(1) # # # +b20 bigint(20) # # # +INSERT INTO t1 VALUES (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20); +INSERT INTO t1 VALUES (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); +INSERT INTO t1 VALUES (2147483647,2147483647,2147483647,2147483647,127,127,127,127,32767,32767,32767,32767,8388607,8388607,8388607,8388607,9223372036854775807,9223372036854775807,9223372036854775807,9223372036854775807); +SELECT * FROM t1; +i i0 i1 i20 t t0 t1 t20 s s0 s1 s20 m m0 m1 m20 b b0 b1 b20 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 +2147483647 2147483647 2147483647 2147483647 127 127 127 127 32767 32767 32767 32767 8388607 8388607 8388607 8388607 9223372036854775807 9223372036854775807 9223372036854775807 9223372036854775807 +INSERT INTO t1 VALUES (-2147483648,-2147483648,-2147483648,-2147483648,-128,-128,-128,-128,-32768,-32768,-32768,-32768,-8388608,-8388608,-8388608,-8388608,-9223372036854775808,-9223372036854775808,-9223372036854775808,-9223372036854775808); +INSERT INTO t1 VALUES (4294967295,4294967295,4294967295,4294967295,255,255,255,255,65535,65535,65535,65535,16777215,16777215,16777215,16777215,18446744073709551615,18446744073709551615,18446744073709551615,18446744073709551615); +Warnings: +Warning 1264 Out of range value for column 'i' at row 1 +Warning 1264 Out of range value for column 'i0' at row 1 +Warning 1264 Out of range value for column 'i1' at row 1 +Warning 1264 Out of range value for column 'i20' at row 1 +Warning 1264 Out of range value for column 't' at row 1 +Warning 1264 Out of range value for column 't0' at row 1 +Warning 1264 Out of range value for column 't1' at row 1 +Warning 1264 Out of range value for column 't20' at row 1 +Warning 1264 Out of range value for column 's' at row 1 +Warning 1264 Out of range value for column 's0' at row 1 +Warning 1264 Out of range value for column 's1' at row 1 +Warning 1264 Out of range value for column 's20' at row 1 +Warning 1264 Out of range value for column 'm' at row 1 +Warning 1264 Out of range value for column 'm0' at row 1 +Warning 1264 Out of range value for column 'm1' at row 1 +Warning 1264 Out of range value for column 'm20' at row 1 +Warning 1264 Out of range value for column 'b' at row 1 +Warning 1264 Out of range value for column 'b0' at row 1 +Warning 1264 Out of range value for column 'b1' at row 1 +Warning 1264 Out of range value for column 'b20' at row 1 +SELECT * FROM t1; +i i0 i1 i20 t t0 t1 t20 s s0 s1 s20 m m0 m1 m20 b b0 b1 b20 +-2147483648 -2147483648 -2147483648 -2147483648 -128 -128 -128 -128 -32768 -32768 -32768 -32768 -8388608 -8388608 -8388608 -8388608 -9223372036854775808 -9223372036854775808 -9223372036854775808 -9223372036854775808 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 +2147483647 2147483647 2147483647 2147483647 127 127 127 127 32767 32767 32767 32767 8388607 8388607 8388607 8388607 9223372036854775807 9223372036854775807 9223372036854775807 9223372036854775807 +2147483647 2147483647 2147483647 2147483647 127 127 127 127 32767 32767 32767 32767 8388607 8388607 8388607 8388607 9223372036854775807 9223372036854775807 9223372036854775807 9223372036854775807 +INSERT INTO t1 VALUES (-2147483649,-2147483649,-2147483649,-2147483649,-129,-129,-129,-129,-32769,-32769,-32769,-32769,-8388609,-8388609,-8388609,-8388609,-9223372036854775809,-9223372036854775809,-9223372036854775809,-9223372036854775809); +Warnings: +Warning 1264 Out of range value for column 'i' at row 1 +Warning 1264 Out of range value for column 'i0' at row 1 +Warning 1264 Out of range value for column 'i1' at row 1 +Warning 1264 Out of range value for column 'i20' at row 1 +Warning 1264 Out of range value for column 't' at row 1 +Warning 1264 Out of range value for column 't0' at row 1 +Warning 1264 Out of range value for column 't1' at row 1 +Warning 1264 Out of range value for column 't20' at row 1 +Warning 1264 Out of range value for column 's' at row 1 +Warning 1264 Out of range value for column 's0' at row 1 +Warning 1264 Out of range value for column 's1' at row 1 +Warning 1264 Out of range value for column 's20' at row 1 +Warning 1264 Out of range value for column 'm' at row 1 +Warning 1264 Out of range value for column 'm0' at row 1 +Warning 1264 Out of range value for column 'm1' at row 1 +Warning 1264 Out of range value for column 'm20' at row 1 +Warning 1264 Out of range value for column 'b' at row 1 +Warning 1264 Out of range value for column 'b0' at row 1 +Warning 1264 Out of range value for column 'b1' at row 1 +Warning 1264 Out of range value for column 'b20' at row 1 +INSERT INTO t1 VALUES (4294967296,4294967296,4294967296,4294967296,256,256,256,256,65536,65536,65536,65536,16777216,16777216,16777216,16777216,18446744073709551616,18446744073709551616,18446744073709551616,18446744073709551616); +Warnings: +Warning 1264 Out of range value for column 'i' at row 1 +Warning 1264 Out of range value for column 'i0' at row 1 +Warning 1264 Out of range value for column 'i1' at row 1 +Warning 1264 Out of range value for column 'i20' at row 1 +Warning 1264 Out of range value for column 't' at row 1 +Warning 1264 Out of range value for column 't0' at row 1 +Warning 1264 Out of range value for column 't1' at row 1 +Warning 1264 Out of range value for column 't20' at row 1 +Warning 1264 Out of range value for column 's' at row 1 +Warning 1264 Out of range value for column 's0' at row 1 +Warning 1264 Out of range value for column 's1' at row 1 +Warning 1264 Out of range value for column 's20' at row 1 +Warning 1264 Out of range value for column 'm' at row 1 +Warning 1264 Out of range value for column 'm0' at row 1 +Warning 1264 Out of range value for column 'm1' at row 1 +Warning 1264 Out of range value for column 'm20' at row 1 +Warning 1264 Out of range value for column 'b' at row 1 +Warning 1264 Out of range value for column 'b0' at row 1 +Warning 1264 Out of range value for column 'b1' at row 1 +Warning 1264 Out of range value for column 'b20' at row 1 +INSERT INTO t1 SELECT b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b FROM t1 WHERE b IN (-9223372036854775808,9223372036854775807,18446744073709551615); +Warnings: +Warning 1264 Out of range value for column 'i' at row 1 +Warning 1264 Out of range value for column 'i0' at row 1 +Warning 1264 Out of range value for column 'i1' at row 1 +Warning 1264 Out of range value for column 'i20' at row 1 +Warning 1264 Out of range value for column 't' at row 1 +Warning 1264 Out of range value for column 't0' at row 1 +Warning 1264 Out of range value for column 't1' at row 1 +Warning 1264 Out of range value for column 't20' at row 1 +Warning 1264 Out of range value for column 's' at row 1 +Warning 1264 Out of range value for column 's0' at row 1 +Warning 1264 Out of range value for column 's1' at row 1 +Warning 1264 Out of range value for column 's20' at row 1 +Warning 1264 Out of range value for column 'm' at row 1 +Warning 1264 Out of range value for column 'm0' at row 1 +Warning 1264 Out of range value for column 'm1' at row 1 +Warning 1264 Out of range value for column 'm20' at row 1 +Warning 1264 Out of range value for column 'i' at row 2 +Warning 1264 Out of range value for column 'i0' at row 2 +Warning 1264 Out of range value for column 'i1' at row 2 +Warning 1264 Out of range value for column 'i20' at row 2 +Warning 1264 Out of range value for column 't' at row 2 +Warning 1264 Out of range value for column 't0' at row 2 +Warning 1264 Out of range value for column 't1' at row 2 +Warning 1264 Out of range value for column 't20' at row 2 +Warning 1264 Out of range value for column 's' at row 2 +Warning 1264 Out of range value for column 's0' at row 2 +Warning 1264 Out of range value for column 's1' at row 2 +Warning 1264 Out of range value for column 's20' at row 2 +Warning 1264 Out of range value for column 'm' at row 2 +Warning 1264 Out of range value for column 'm0' at row 2 +Warning 1264 Out of range value for column 'm1' at row 2 +Warning 1264 Out of range value for column 'm20' at row 2 +Warning 1264 Out of range value for column 'i' at row 3 +Warning 1264 Out of range value for column 'i0' at row 3 +Warning 1264 Out of range value for column 'i1' at row 3 +Warning 1264 Out of range value for column 'i20' at row 3 +Warning 1264 Out of range value for column 't' at row 3 +Warning 1264 Out of range value for column 't0' at row 3 +Warning 1264 Out of range value for column 't1' at row 3 +Warning 1264 Out of range value for column 't20' at row 3 +Warning 1264 Out of range value for column 's' at row 3 +Warning 1264 Out of range value for column 's0' at row 3 +Warning 1264 Out of range value for column 's1' at row 3 +Warning 1264 Out of range value for column 's20' at row 3 +Warning 1264 Out of range value for column 'm' at row 3 +Warning 1264 Out of range value for column 'm0' at row 3 +Warning 1264 Out of range value for column 'm1' at row 3 +Warning 1264 Out of range value for column 'm20' at row 3 +Warning 1264 Out of range value for column 'i' at row 4 +Warning 1264 Out of range value for column 'i0' at row 4 +Warning 1264 Out of range value for column 'i1' at row 4 +Warning 1264 Out of range value for column 'i20' at row 4 +Warning 1264 Out of range value for column 't' at row 4 +Warning 1264 Out of range value for column 't0' at row 4 +Warning 1264 Out of range value for column 't1' at row 4 +Warning 1264 Out of range value for column 't20' at row 4 +Warning 1264 Out of range value for column 's' at row 4 +Warning 1264 Out of range value for column 's0' at row 4 +Warning 1264 Out of range value for column 's1' at row 4 +Warning 1264 Out of range value for column 's20' at row 4 +Warning 1264 Out of range value for column 'm' at row 4 +Warning 1264 Out of range value for column 'm0' at row 4 +Warning 1264 Out of range value for column 'm1' at row 4 +Warning 1264 Out of range value for column 'm20' at row 4 +SELECT * FROM t1; +i i0 i1 i20 t t0 t1 t20 s s0 s1 s20 m m0 m1 m20 b b0 b1 b20 +-2147483648 -2147483648 -2147483648 -2147483648 -128 -128 -128 -128 -32768 -32768 -32768 -32768 -8388608 -8388608 -8388608 -8388608 -9223372036854775808 -9223372036854775808 -9223372036854775808 -9223372036854775808 +-2147483648 -2147483648 -2147483648 -2147483648 -128 -128 -128 -128 -32768 -32768 -32768 -32768 -8388608 -8388608 -8388608 -8388608 -9223372036854775808 -9223372036854775808 -9223372036854775808 -9223372036854775808 +-2147483648 -2147483648 -2147483648 -2147483648 -128 -128 -128 -128 -32768 -32768 -32768 -32768 -8388608 -8388608 -8388608 -8388608 -9223372036854775808 -9223372036854775808 -9223372036854775808 -9223372036854775808 +-2147483648 -2147483648 -2147483648 -2147483648 -128 -128 -128 -128 -32768 -32768 -32768 -32768 -8388608 -8388608 -8388608 -8388608 -9223372036854775808 -9223372036854775808 -9223372036854775808 -9223372036854775808 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 +2147483647 2147483647 2147483647 2147483647 127 127 127 127 32767 32767 32767 32767 8388607 8388607 8388607 8388607 9223372036854775807 9223372036854775807 9223372036854775807 9223372036854775807 +2147483647 2147483647 2147483647 2147483647 127 127 127 127 32767 32767 32767 32767 8388607 8388607 8388607 8388607 9223372036854775807 9223372036854775807 9223372036854775807 9223372036854775807 +2147483647 2147483647 2147483647 2147483647 127 127 127 127 32767 32767 32767 32767 8388607 8388607 8388607 8388607 9223372036854775807 9223372036854775807 9223372036854775807 9223372036854775807 +2147483647 2147483647 2147483647 2147483647 127 127 127 127 32767 32767 32767 32767 8388607 8388607 8388607 8388607 9223372036854775807 9223372036854775807 9223372036854775807 9223372036854775807 +2147483647 2147483647 2147483647 2147483647 127 127 127 127 32767 32767 32767 32767 8388607 8388607 8388607 8388607 9223372036854775807 9223372036854775807 9223372036854775807 9223372036854775807 +2147483647 2147483647 2147483647 2147483647 127 127 127 127 32767 32767 32767 32767 8388607 8388607 8388607 8388607 9223372036854775807 9223372036854775807 9223372036854775807 9223372036854775807 +ALTER TABLE t1 ADD COLUMN i257 INT(257); +ERROR 42000: Display width out of range for 'i257' (max = 255) +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c INT <CUSTOM_COL_OPTIONS> NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c int(11) YES NULL +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c), COUNT(*) FROM t1; +COUNT(c) COUNT(*) +0 1 +DROP TABLE t1; +CREATE TABLE t1 (c INT <CUSTOM_COL_OPTIONS> NULL, +c1 INT <CUSTOM_COL_OPTIONS> NULL DEFAULT NULL, +c2 INT <CUSTOM_COL_OPTIONS> NULL DEFAULT 2147483647 +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c int(11) YES NULL +c1 int(11) YES NULL +c2 int(11) YES 2147483647 +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c2), COUNT(c1), COUNT(c), COUNT(*) FROM t1; +COUNT(c2) COUNT(c1) COUNT(c) COUNT(*) +1 0 0 1 +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c TINYINT <CUSTOM_COL_OPTIONS> NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c tinyint(4) YES NULL +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c), COUNT(*) FROM t1; +COUNT(c) COUNT(*) +0 1 +DROP TABLE t1; +CREATE TABLE t1 (c TINYINT <CUSTOM_COL_OPTIONS> NULL, +c1 TINYINT <CUSTOM_COL_OPTIONS> NULL DEFAULT NULL, +c2 TINYINT <CUSTOM_COL_OPTIONS> NULL DEFAULT 127 +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c tinyint(4) YES NULL +c1 tinyint(4) YES NULL +c2 tinyint(4) YES 127 +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c2), COUNT(c1), COUNT(c), COUNT(*) FROM t1; +COUNT(c2) COUNT(c1) COUNT(c) COUNT(*) +1 0 0 1 +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c SMALLINT <CUSTOM_COL_OPTIONS> NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c smallint(6) YES NULL +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c), COUNT(*) FROM t1; +COUNT(c) COUNT(*) +0 1 +DROP TABLE t1; +CREATE TABLE t1 (c SMALLINT <CUSTOM_COL_OPTIONS> NULL, +c1 SMALLINT <CUSTOM_COL_OPTIONS> NULL DEFAULT NULL, +c2 SMALLINT <CUSTOM_COL_OPTIONS> NULL DEFAULT 0 +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c smallint(6) YES NULL +c1 smallint(6) YES NULL +c2 smallint(6) YES 0 +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c2), COUNT(c1), COUNT(c), COUNT(*) FROM t1; +COUNT(c2) COUNT(c1) COUNT(c) COUNT(*) +1 0 0 1 +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c MEDIUMINT <CUSTOM_COL_OPTIONS> NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c mediumint(9) YES NULL +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c), COUNT(*) FROM t1; +COUNT(c) COUNT(*) +0 1 +DROP TABLE t1; +CREATE TABLE t1 (c MEDIUMINT <CUSTOM_COL_OPTIONS> NULL, +c1 MEDIUMINT <CUSTOM_COL_OPTIONS> NULL DEFAULT NULL, +c2 MEDIUMINT <CUSTOM_COL_OPTIONS> NULL DEFAULT 1 +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c mediumint(9) YES NULL +c1 mediumint(9) YES NULL +c2 mediumint(9) YES 1 +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c2), COUNT(c1), COUNT(c), COUNT(*) FROM t1; +COUNT(c2) COUNT(c1) COUNT(c) COUNT(*) +1 0 0 1 +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c BIGINT <CUSTOM_COL_OPTIONS> NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c bigint(20) YES NULL +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c), COUNT(*) FROM t1; +COUNT(c) COUNT(*) +0 1 +DROP TABLE t1; +CREATE TABLE t1 (c BIGINT <CUSTOM_COL_OPTIONS> NULL, +c1 BIGINT <CUSTOM_COL_OPTIONS> NULL DEFAULT NULL, +c2 BIGINT <CUSTOM_COL_OPTIONS> NULL DEFAULT 9223372036854775807 +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c bigint(20) YES NULL +c1 bigint(20) YES NULL +c2 bigint(20) YES 9223372036854775807 +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c2), COUNT(c1), COUNT(c), COUNT(*) FROM t1; +COUNT(c2) COUNT(c1) COUNT(c) COUNT(*) +1 0 0 1 +DROP TABLE t1; +# +# SET columns +# +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a SET('') <CUSTOM_COL_OPTIONS> NULL, +b SET('test1','test2','test3','test4','test5') <CUSTOM_COL_OPTIONS> NULL, +c SET('01','02','03','04','05','06','07','08','09','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31','32','33','34','35','36','37','38','39','40','41','42','43','44','45','46','47','48','49','50''51','52','53','54','55','56','57','58','59','60','61','62','63','64') <CUSTOM_COL_OPTIONS> NULL +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +a set('') # # # +b set('test1','test2','test3','test4','test5') # # # +c set('01','02','03','04','05','06','07','08','09','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31','32','33','34','35','36','37','38','39','40','41','42','43','44','45','46','47','48','49','50''51','52','53','54','55','56','57','58','59','60','61','62','63','64') # # # +INSERT INTO t1 VALUES +('','test2,test3','01,34,44,,23'), +('',5,2), +(',','test4,test2',''); +Warnings: +Warning 1265 Data truncated for column 'c' at row 1 +SELECT * FROM t1; +a b c + test1,test3 02 + test2,test3 01,23,34,44 + test2,test4 +INSERT INTO t1 VALUES (0,'test6',-1); +Warnings: +Warning 1265 Data truncated for column 'b' at row 1 +Warning 1265 Data truncated for column 'c' at row 1 +SELECT * FROM t1; +a b c + 01,02,03,04,05,06,07,08,09,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50'51,52,53,54,55,56,57,58,59,60,61,62,63,64 + test1,test3 02 + test2,test3 01,23,34,44 + test2,test4 +ALTER TABLE t1 ADD COLUMN e SET('a','A') <CUSTOM_COL_OPTIONS> NULL; +Warnings: +Note 1291 Column 'e' has duplicated value 'a' in SET +Note 1291 Column 'e' has duplicated value 'a' in SET +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +a set('') # # # +b set('test1','test2','test3','test4','test5') # # # +c set('01','02','03','04','05','06','07','08','09','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31','32','33','34','35','36','37','38','39','40','41','42','43','44','45','46','47','48','49','50''51','52','53','54','55','56','57','58','59','60','61','62','63','64') # # # +e set('a','A') # # # +ALTER TABLE t1 ADD COLUMN f SET('1','2','3','4','5','6','7','8','9','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',' ','11','12','13','14','15','16','17','18','19','1a','1b','1c','1d','1e','1f','1g','1h','1i','1j','1k','1l','1m','1n','1o','1p','1q','1r','1s','1t','1u','1v','1w','1x','1y','1z','20','21','22','23','24','25','26','27','28','29','2a','2b','2c','2d','2e','2f','2g','2h','2i','2j','2k','2l','2m','2n','2o','2p','2q','2r','2s','2t','2u','2v','2w','2x','2y','2z','30','31','32','33','34','35','36','37','38','39','3a','3b','3c','3d','3e','3f','3g','3h','3i') <CUSTOM_COL_OPTIONS> NULL; +ERROR HY000: Too many strings for column f and SET +SELECT * FROM t1 WHERE FIND_IN_SET('test2',b)>0 OR a != ''; +a b c e + test2,test3 01,23,34,44 NULL + test2,test4 NULL +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c SET('test1','test2','test3') <CUSTOM_COL_OPTIONS> NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c set('test1','test2','test3') YES NULL +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c), COUNT(*) FROM t1; +COUNT(c) COUNT(*) +0 1 +DROP TABLE t1; +CREATE TABLE t1 (c SET('test1','test2','test3') <CUSTOM_COL_OPTIONS> NULL, +c1 SET('test1','test2','test3') <CUSTOM_COL_OPTIONS> NULL DEFAULT NULL, +c2 SET('test1','test2','test3') <CUSTOM_COL_OPTIONS> NULL DEFAULT 'test2,test3' +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c set('test1','test2','test3') YES NULL +c1 set('test1','test2','test3') YES NULL +c2 set('test1','test2','test3') YES test2,test3 +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c2), COUNT(c1), COUNT(c), COUNT(*) FROM t1; +COUNT(c2) COUNT(c1) COUNT(c) COUNT(*) +1 0 0 1 +DROP TABLE t1; +# +# TEXT columns +# +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (t TEXT <CUSTOM_COL_OPTIONS> NULL, +t0 TEXT(0) <CUSTOM_COL_OPTIONS> NULL, +t1 TEXT(1) <CUSTOM_COL_OPTIONS> NULL, +t300 TEXT(300) <CUSTOM_COL_OPTIONS> NULL, +tm TEXT(65535) <CUSTOM_COL_OPTIONS> NULL, +t70k TEXT(70000) <CUSTOM_COL_OPTIONS> NULL, +t17m TEXT(17000000) <CUSTOM_COL_OPTIONS> NULL, +tt TINYTEXT <CUSTOM_COL_OPTIONS> NULL, +m MEDIUMTEXT <CUSTOM_COL_OPTIONS> NULL, +l LONGTEXT <CUSTOM_COL_OPTIONS> NULL +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +t text # # # +t0 text # # # +t1 tinytext # # # +t300 text # # # +tm text # # # +t70k mediumtext # # # +t17m longtext # # # +tt tinytext # # # +m mediumtext # # # +l longtext # # # +INSERT INTO t1 VALUES +('','','','','','','','','',''), +('a','b','c','d','e','f','g','h','i','j'), +('test1','test2','test3','test4','test5','test6','test7','test8','test9','test10'), +( REPEAT('a',65535), REPEAT('b',65535), REPEAT('c',255), REPEAT('d',65535), REPEAT('e',65535), REPEAT('f',1048576), REPEAT('g',1048576), REPEAT('h',255), REPEAT('i',1048576), REPEAT('j',1048576) ); +SELECT LENGTH(t), LENGTH(t0), LENGTH(t1), LENGTH(t300), LENGTH(tm), LENGTH(t70k), LENGTH(t17m), LENGTH(tt), LENGTH(m), LENGTH(l) FROM t1; +LENGTH(t) LENGTH(t0) LENGTH(t1) LENGTH(t300) LENGTH(tm) LENGTH(t70k) LENGTH(t17m) LENGTH(tt) LENGTH(m) LENGTH(l) +0 0 0 0 0 0 0 0 0 0 +1 1 1 1 1 1 1 1 1 1 +5 5 5 5 5 5 5 5 5 6 +65535 65535 255 65535 65535 1048576 1048576 255 1048576 1048576 +INSERT INTO t1 VALUES +( REPEAT('a',65536), REPEAT('b',65536), REPEAT('c',256), REPEAT('d',65536), REPEAT('e',65536), REPEAT('f',1048576), REPEAT('g',1048576), REPEAT('h',256), REPEAT('i',1048576), REPEAT('j',1048576) ); +Warnings: +Warning 1265 Data truncated for column 't' at row 1 +Warning 1265 Data truncated for column 't0' at row 1 +Warning 1265 Data truncated for column 't1' at row 1 +Warning 1265 Data truncated for column 't300' at row 1 +Warning 1265 Data truncated for column 'tm' at row 1 +Warning 1265 Data truncated for column 'tt' at row 1 +SELECT LENGTH(t), LENGTH(t0), LENGTH(t1), LENGTH(t300), LENGTH(tm), LENGTH(t70k), LENGTH(t17m), LENGTH(tt), LENGTH(m), LENGTH(l) FROM t1; +LENGTH(t) LENGTH(t0) LENGTH(t1) LENGTH(t300) LENGTH(tm) LENGTH(t70k) LENGTH(t17m) LENGTH(tt) LENGTH(m) LENGTH(l) +0 0 0 0 0 0 0 0 0 0 +1 1 1 1 1 1 1 1 1 1 +5 5 5 5 5 5 5 5 5 6 +65535 65535 255 65535 65535 1048576 1048576 255 1048576 1048576 +65535 65535 255 65535 65535 1048576 1048576 255 1048576 1048576 +ALTER TABLE t1 ADD COLUMN ttt TEXT(4294967296); +ERROR 42000: Display width out of range for 'ttt' (max = 4294967295) +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c TEXT <CUSTOM_COL_OPTIONS> NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c text YES NULL +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c), COUNT(*) FROM t1; +COUNT(c) COUNT(*) +0 1 +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c TINYTEXT <CUSTOM_COL_OPTIONS> NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c tinytext YES NULL +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c), COUNT(*) FROM t1; +COUNT(c) COUNT(*) +0 1 +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c MEDIUMTEXT <CUSTOM_COL_OPTIONS> NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c mediumtext YES NULL +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c), COUNT(*) FROM t1; +COUNT(c) COUNT(*) +0 1 +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c LONGTEXT <CUSTOM_COL_OPTIONS> NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c longtext YES NULL +INSERT INTO t1 (c) VALUES (NULL); +SELECT COUNT(c), COUNT(*) FROM t1; +COUNT(c) COUNT(*) +0 1 +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/col_opt_null.test b/mysql-test/suite/storage_engine/col_opt_null.test new file mode 100644 index 00000000000..29979d29dfd --- /dev/null +++ b/mysql-test/suite/storage_engine/col_opt_null.test @@ -0,0 +1,208 @@ +# +# NULL column attribute +# + +let $extra_col_opts = NULL; + +--source have_engine.inc + +--echo # +--echo # BINARY columns +--echo # + +--source type_binary.inc +--let $col_definition = BINARY $default_col_opts +--let $col_default = 0 +--source col_null.inc + +--echo # +--echo # VARBINARY columns +--echo # + +--source type_varbinary.inc +--let $col_definition = VARBINARY(64) $default_col_opts +--let $col_default = 'test' +--source col_null.inc + +--echo # +--echo # BIT columns +--echo # + +--source type_bit.inc +--let $col_definition = BIT $default_col_opts +--let $col_default = 1 +--source col_null.inc + +--echo # +--echo # BLOB columns +--echo # + +--source type_blob.inc + +--let $col_definition = BLOB $default_col_opts +--source col_null.inc + +--let $col_definition = TINYBLOB $default_col_opts +--source col_null.inc + +--let $col_definition = MEDIUMBLOB $default_col_opts +--source col_null.inc + +--let $col_definition = LONGBLOB $default_col_opts +--source col_null.inc + +--echo # +--echo # BOOL columns +--echo # + +--source type_bool.inc +--let $col_definition = BOOL $default_col_opts +--let $col_default = '0' +--source col_null.inc + + +--echo # +--echo # CHAR columns +--echo # + +--source type_char.inc +--let $col_definition = CHAR $default_col_opts +--let $col_default = '_' +--source col_null.inc + +--echo # +--echo # VARCHAR columns +--echo # + + +--source type_varchar.inc +--let $col_definition = VARCHAR(64) $default_col_opts +--let $col_default = 'test default' +--source col_null.inc + + +--echo # +--echo # date and time columns +--echo # + +--source type_date_time.inc + +--let $col_definition = DATE $default_col_opts +--let $col_default = '2012-12-21' +--source col_null.inc + +--let $col_definition = DATETIME $default_col_opts +--let $col_default = '2012-12-21 12:21:12' +--source col_null.inc + +--let $col_definition = TIMESTAMP $default_col_opts +--let $col_default = '2012-12-21 12:21:12' +--source col_null.inc + +--let $col_definition = TIME $default_col_opts +--let $col_default = '12:21:12' +--source col_null.inc + +--let $col_definition = YEAR $default_col_opts +--let $col_default = '2012' +--source col_null.inc + +--let $col_definition = YEAR(2) $default_col_opts +--let $col_default = '12' +--source col_null.inc + + +--echo # +--echo # ENUM columns +--echo # + +--source type_enum.inc +--let $col_definition = ENUM('test1','test2','test3') $default_col_opts +--let $col_default = 'test2' +--source col_null.inc + +--echo # +--echo # Fixed point columns (NUMERIC, DECIMAL) +--echo # + +--source type_fixed.inc + +--let $col_definition = DECIMAL $default_col_opts +--let $col_default = 1.1 +--source col_null.inc + +--let $col_definition = NUMERIC $default_col_opts +--let $col_default = 0 +--source col_null.inc + +--echo # +--echo # Floating point columns (FLOAT, DOUBLE) +--echo # + +--source type_float.inc + +--let $col_definition = FLOAT $default_col_opts +--let $col_default = 1.1 +--source col_null.inc + +--let $col_definition = DOUBLE $default_col_opts +--let $col_default = 0 +--source col_null.inc + +--echo # +--echo # INT columns +--echo # + +--source type_int.inc + +--let $col_definition = INT $default_col_opts +--let $col_default = 2147483647 +--source col_null.inc + +--let $col_definition = TINYINT $default_col_opts +--let $col_default = 127 +--source col_null.inc + +--let $col_definition = SMALLINT $default_col_opts +--let $col_default = 0 +--source col_null.inc + +--let $col_definition = MEDIUMINT $default_col_opts +--let $col_default = 1 +--source col_null.inc + +--let $col_definition = BIGINT $default_col_opts +--let $col_default = 9223372036854775807 +--source col_null.inc + +--echo # +--echo # SET columns +--echo # + +--source type_set.inc +--let $col_definition = SET('test1','test2','test3') $default_col_opts +--let $col_default = 'test2,test3' +--source col_null.inc + + +--echo # +--echo # TEXT columns +--echo # + +--source type_text.inc + +--let $col_definition = TEXT $default_col_opts +--source col_null.inc + +--let $col_definition = TINYTEXT $default_col_opts +--source col_null.inc + +--let $col_definition = MEDIUMTEXT $default_col_opts +--source col_null.inc + +--let $col_definition = LONGTEXT $default_col_opts +--source col_null.inc + + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/col_opt_unsigned.result b/mysql-test/suite/storage_engine/col_opt_unsigned.result new file mode 100644 index 00000000000..a68aa48ee79 --- /dev/null +++ b/mysql-test/suite/storage_engine/col_opt_unsigned.result @@ -0,0 +1,697 @@ +# +# Fixed point columns (NUMERIC, DECIMAL) +# +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (d DECIMAL UNSIGNED <CUSTOM_COL_OPTIONS>, +d0 DECIMAL(0) UNSIGNED <CUSTOM_COL_OPTIONS>, +d1_1 DECIMAL(1,1) UNSIGNED <CUSTOM_COL_OPTIONS>, +d10_2 DECIMAL(10,2) UNSIGNED <CUSTOM_COL_OPTIONS>, +d60_10 DECIMAL(60,10) UNSIGNED <CUSTOM_COL_OPTIONS>, +n NUMERIC UNSIGNED <CUSTOM_COL_OPTIONS>, +n0_0 NUMERIC(0,0) UNSIGNED <CUSTOM_COL_OPTIONS>, +n1 NUMERIC(1) UNSIGNED <CUSTOM_COL_OPTIONS>, +n20_4 NUMERIC(20,4) UNSIGNED <CUSTOM_COL_OPTIONS>, +n65_4 NUMERIC(65,4) UNSIGNED <CUSTOM_COL_OPTIONS> +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +d decimal(10,0) unsigned # # # +d0 decimal(10,0) unsigned # # # +d1_1 decimal(1,1) unsigned # # # +d10_2 decimal(10,2) unsigned # # # +d60_10 decimal(60,10) unsigned # # # +n decimal(10,0) unsigned # # # +n0_0 decimal(10,0) unsigned # # # +n1 decimal(1,0) unsigned # # # +n20_4 decimal(20,4) unsigned # # # +n65_4 decimal(65,4) unsigned # # # +INSERT INTO t1 VALUES (100,123456,0.3,40000.25,123456789123456789.10001,1024,7000.0,8.0,999999.9,9223372036854775807); +INSERT INTO t1 VALUES (0,0,0,0,0,0,0,0,0,0); +INSERT INTO t1 VALUES (9999999999.0,9999999999.0,0.9,99999999.99,99999999999999999999999999999999999999999999999999.9999999999,9999999999.0,9999999999.0,9.0,9999999999999999.9999,9999999999999999999999999999999999999999999999999999999999999.9999); +SELECT * FROM t1; +d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 +0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 +100 123456 0.3 40000.25 123456789123456789.1000100000 1024 7000 8 999999.9000 9223372036854775807.0000 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +INSERT INTO t1 VALUES (-100,-123456,-0.3,-40000.25,-123456789123456789.10001,-1024,-7000.0,-8.0,-999999.9,-9223372036854775807); +Warnings: +Warning 1264 Out of range value for column 'd' at row 1 +Warning 1264 Out of range value for column 'd0' at row 1 +Warning 1264 Out of range value for column 'd1_1' at row 1 +Warning 1264 Out of range value for column 'd10_2' at row 1 +Warning 1264 Out of range value for column 'd60_10' at row 1 +Warning 1264 Out of range value for column 'n' at row 1 +Warning 1264 Out of range value for column 'n0_0' at row 1 +Warning 1264 Out of range value for column 'n1' at row 1 +Warning 1264 Out of range value for column 'n20_4' at row 1 +Warning 1264 Out of range value for column 'n65_4' at row 1 +INSERT INTO t1 VALUES (-9999999999.0,-9999999999.0,-0.9,-99999999.99,-99999999999999999999999999999999999999999999999999.9999999999,-9999999999.0,-9999999999.0,-9.0,-9999999999999999.9999,-9999999999999999999999999999999999999999999999999999999999999.9999); +Warnings: +Warning 1264 Out of range value for column 'd' at row 1 +Warning 1264 Out of range value for column 'd0' at row 1 +Warning 1264 Out of range value for column 'd1_1' at row 1 +Warning 1264 Out of range value for column 'd10_2' at row 1 +Warning 1264 Out of range value for column 'd60_10' at row 1 +Warning 1264 Out of range value for column 'n' at row 1 +Warning 1264 Out of range value for column 'n0_0' at row 1 +Warning 1264 Out of range value for column 'n1' at row 1 +Warning 1264 Out of range value for column 'n20_4' at row 1 +Warning 1264 Out of range value for column 'n65_4' at row 1 +SELECT * FROM t1; +d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 +0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 +0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 +0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 +100 123456 0.3 40000.25 123456789123456789.1000100000 1024 7000 8 999999.9000 9223372036854775807.0000 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +SELECT * FROM t1 WHERE n20_4 = 9999999999999999.9999 OR d < 100; +d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 +0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 +0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 +0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +INSERT INTO t1 SELECT n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4 FROM t1 WHERE n65_4 = ( SELECT MAX(n65_4) FROM t1 ); +Warnings: +Warning 1264 Out of range value for column 'd' at row 1 +Warning 1264 Out of range value for column 'd0' at row 1 +Warning 1264 Out of range value for column 'd1_1' at row 1 +Warning 1264 Out of range value for column 'd10_2' at row 1 +Warning 1264 Out of range value for column 'd60_10' at row 1 +Warning 1264 Out of range value for column 'n' at row 1 +Warning 1264 Out of range value for column 'n0_0' at row 1 +Warning 1264 Out of range value for column 'n1' at row 1 +Warning 1264 Out of range value for column 'n20_4' at row 1 +SELECT * FROM t1; +d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 +0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 +0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 +0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 +100 123456 0.3 40000.25 123456789123456789.1000100000 1024 7000 8 999999.9000 9223372036854775807.0000 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +INSERT INTO t1 VALUES (10000000000.0,10000000000.0,1.1,100000000.99,100000000000000000000000000000000000000000000000000.0,10000000000.0,10000000000.0,10.0,10000000000000000.9999,10000000000000000000000000000000000000000000000000000000000000.9999); +Warnings: +Warning 1264 Out of range value for column 'd' at row 1 +Warning 1264 Out of range value for column 'd0' at row 1 +Warning 1264 Out of range value for column 'd1_1' at row 1 +Warning 1264 Out of range value for column 'd10_2' at row 1 +Warning 1264 Out of range value for column 'd60_10' at row 1 +Warning 1264 Out of range value for column 'n' at row 1 +Warning 1264 Out of range value for column 'n0_0' at row 1 +Warning 1264 Out of range value for column 'n1' at row 1 +Warning 1264 Out of range value for column 'n20_4' at row 1 +Warning 1264 Out of range value for column 'n65_4' at row 1 +SELECT * FROM t1; +d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 +0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 +0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 +0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 +100 123456 0.3 40000.25 123456789123456789.1000100000 1024 7000 8 999999.9000 9223372036854775807.0000 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +INSERT INTO t1 VALUES (9999999999.1,9999999999.1,1.9,99999999.001,99999999999999999999999999999999999999999999999999.99999999991,9999999999.1,9999999999.1,9.1,9999999999999999.00001,9999999999999999999999999999999999999999999999999999999999999.11111); +Warnings: +Note 1265 Data truncated for column 'd' at row 1 +Note 1265 Data truncated for column 'd0' at row 1 +Warning 1264 Out of range value for column 'd1_1' at row 1 +Note 1265 Data truncated for column 'd10_2' at row 1 +Note 1265 Data truncated for column 'd60_10' at row 1 +Note 1265 Data truncated for column 'n' at row 1 +Note 1265 Data truncated for column 'n0_0' at row 1 +Note 1265 Data truncated for column 'n1' at row 1 +Note 1265 Data truncated for column 'n20_4' at row 1 +Note 1265 Data truncated for column 'n65_4' at row 1 +SELECT * FROM t1; +d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 +0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 +0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 +0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 +100 123456 0.3 40000.25 123456789123456789.1000100000 1024 7000 8 999999.9000 9223372036854775807.0000 +9999999999 9999999999 0.9 99999999.00 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.0000 9999999999999999999999999999999999999999999999999999999999999.1111 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +ALTER TABLE t1 ADD COLUMN n66 NUMERIC(66); +ERROR 42000: Too big precision 66 specified for 'n66'. Maximum is 65. +ALTER TABLE t1 ADD COLUMN n66_6 DECIMAL(66,6); +ERROR 42000: Too big precision 66 specified for 'n66_6'. Maximum is 65. +ALTER TABLE t1 ADD COLUMN n66_66 DECIMAL(66,66); +ERROR 42000: Too big scale 66 specified for 'n66_66'. Maximum is 30. +DROP TABLE t1; +CREATE TABLE t1 (a DECIMAL UNSIGNED <CUSTOM_COL_OPTIONS>, +b NUMERIC UNSIGNED <CUSTOM_COL_OPTIONS> +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +a decimal(10,0) unsigned # # # # +b decimal(10,0) unsigned # # # # +INSERT INTO t1 (a,b) VALUES (1.0,-1.0); +Warnings: +Warning 1264 Out of range value for column 'b' at row 1 +INSERT INTO t1 (a,b) VALUES (-100,100); +Warnings: +Warning 1264 Out of range value for column 'a' at row 1 +SELECT * FROM t1; +a b +0 100 +1 0 +DROP TABLE t1; +# +# Floating point columns (FLOAT, DOUBLE) +# +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (f FLOAT UNSIGNED <CUSTOM_COL_OPTIONS>, +f0 FLOAT(0) UNSIGNED <CUSTOM_COL_OPTIONS>, +r1_1 REAL(1,1) UNSIGNED <CUSTOM_COL_OPTIONS>, +f23_0 FLOAT(23) UNSIGNED <CUSTOM_COL_OPTIONS>, +f20_3 FLOAT(20,3) UNSIGNED <CUSTOM_COL_OPTIONS>, +d DOUBLE UNSIGNED <CUSTOM_COL_OPTIONS>, +d1_0 DOUBLE(1,0) UNSIGNED <CUSTOM_COL_OPTIONS>, +d10_10 DOUBLE PRECISION (10,10) UNSIGNED <CUSTOM_COL_OPTIONS>, +d53 DOUBLE(53,0) UNSIGNED <CUSTOM_COL_OPTIONS>, +d53_10 DOUBLE(53,10) UNSIGNED <CUSTOM_COL_OPTIONS> +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +f float unsigned # # # +f0 float unsigned # # # +r1_1 double(1,1) unsigned # # # +f23_0 float unsigned # # # +f20_3 float(20,3) unsigned # # # +d double unsigned # # # +d1_0 double(1,0) unsigned # # # +d10_10 double(10,10) unsigned # # # +d53 double(53,0) unsigned # # # +d53_10 double(53,10) unsigned # # # +INSERT INTO t1 VALUES (12345.12345,12345.12345,0.9,123456789.123,56789.987,11111111.111,8.0,0.0123456789,1234566789123456789,99999999999999999.99999999); +SELECT * FROM t1; +f 12345.1 +d 11111111.111 +d10_10 0.0123456789 +d1_0 8 +d53 1234566789123456800 +d53_10 100000000000000000.0000000000 +f0 12345.1 +f20_3 56789.988 +f23_0 123457000 +r1_1 0.9 +INSERT INTO t1 VALUES (0,0,0,0,0,0,0,0,0,0); +INSERT INTO t1 VALUES ( +99999999999999999999999999999999999999, +99999999999999999999999999999999999999.9999999999999999, +0.9, +99999999999999999999999999999999999999.9, +99999999999999999.999, +999999999999999999999999999999999999999999999999999999999999999999999999999999999, +9, +0.9999999999, +1999999999999999999999999999999999999999999999999999999, +19999999999999999999999999999999999999999999.9999999999 +); +Warnings: +Warning 1264 Out of range value for column 'd53' at row 1 +Warning 1264 Out of range value for column 'd53_10' at row 1 +SELECT * FROM t1; +f 12345.1 +d 0 +d 11111111.111 +d 1e81 +d10_10 0.0000000000 +d10_10 0.0123456789 +d10_10 0.9999999999 +d1_0 0 +d1_0 8 +d1_0 9 +d53 0 +d53 100000000000000000000000000000000000000000000000000000 +d53 1234566789123456800 +d53_10 0.0000000000 +d53_10 100000000000000000.0000000000 +d53_10 10000000000000000000000000000000000000000000.0000000000 +f 0 +f 1e38 +f0 0 +f0 12345.1 +f0 1e38 +f20_3 0.000 +f20_3 56789.988 +f20_3 99999998430674940.000 +f23_0 0 +f23_0 123457000 +f23_0 1e38 +r1_1 0.0 +r1_1 0.9 +r1_1 0.9 +INSERT INTO t1 VALUES (-999999999999999999999999,-99999999999.999999999999,-0.9,-999.99999999999999999999,-99999999999999999.999,-999999999999999999999999999999999999999999999999999999999999-0.999,-9,-.9999999999,-999999999999999999999999999999.99999999999999999999999,-9999999999999999999999999999999999999999999.9999999999); +Warnings: +Warning 1264 Out of range value for column 'f' at row 1 +Warning 1264 Out of range value for column 'f0' at row 1 +Warning 1264 Out of range value for column 'r1_1' at row 1 +Warning 1264 Out of range value for column 'f23_0' at row 1 +Warning 1264 Out of range value for column 'f20_3' at row 1 +Warning 1264 Out of range value for column 'd' at row 1 +Warning 1264 Out of range value for column 'd1_0' at row 1 +Warning 1264 Out of range value for column 'd10_10' at row 1 +Warning 1264 Out of range value for column 'd53' at row 1 +Warning 1264 Out of range value for column 'd53_10' at row 1 +SELECT * FROM t1; +f 12345.1 +d 0 +d 0 +d 11111111.111 +d 1e81 +d10_10 0.0000000000 +d10_10 0.0000000000 +d10_10 0.0123456789 +d10_10 0.9999999999 +d1_0 0 +d1_0 0 +d1_0 8 +d1_0 9 +d53 0 +d53 0 +d53 100000000000000000000000000000000000000000000000000000 +d53 1234566789123456800 +d53_10 0.0000000000 +d53_10 0.0000000000 +d53_10 100000000000000000.0000000000 +d53_10 10000000000000000000000000000000000000000000.0000000000 +f 0 +f 0 +f 1e38 +f0 0 +f0 0 +f0 12345.1 +f0 1e38 +f20_3 0.000 +f20_3 0.000 +f20_3 56789.988 +f20_3 99999998430674940.000 +f23_0 0 +f23_0 0 +f23_0 123457000 +f23_0 1e38 +r1_1 0.0 +r1_1 0.0 +r1_1 0.9 +r1_1 0.9 +SELECT MAX(f), MAX(f0), MAX(r1_1), MAX(f23_0), MAX(f20_3), MAX(d), MAX(d1_0), MAX(d10_10), MAX(d53), MAX(d53_10) FROM t1; +MAX(f) 9.999999680285692e37 +MAX(d) 1e81 +MAX(d10_10) 0.9999999999 +MAX(d1_0) 9 +MAX(d53) 100000000000000000000000000000000000000000000000000000 +MAX(d53_10) 10000000000000000000000000000000000000000000.0000000000 +MAX(f0) 9.999999680285692e37 +MAX(f20_3) 99999998430674940.000 +MAX(f23_0) 9.999999680285692e37 +MAX(r1_1) 0.9 +INSERT INTO t1 SELECT d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10 FROM t1 ORDER BY d53_10 DESC LIMIT 1; +Warnings: +Warning 1264 Out of range value for column 'f' at row 1 +Warning 1264 Out of range value for column 'f0' at row 1 +Warning 1264 Out of range value for column 'r1_1' at row 1 +Warning 1264 Out of range value for column 'f23_0' at row 1 +Warning 1264 Out of range value for column 'f20_3' at row 1 +Warning 1264 Out of range value for column 'd1_0' at row 1 +SELECT * FROM t1; +f 12345.1 +d 0 +d 0 +d 11111111.111 +d 1e43 +d 1e81 +d10_10 0.0000000000 +d10_10 0.0000000000 +d10_10 0.0123456789 +d10_10 0.9999999999 +d10_10 10000000000000000000000000000000000000000000.0000000000 +d1_0 0 +d1_0 0 +d1_0 8 +d1_0 9 +d1_0 9 +d53 0 +d53 0 +d53 10000000000000000000000000000000000000000000 +d53 100000000000000000000000000000000000000000000000000000 +d53 1234566789123456800 +d53_10 0.0000000000 +d53_10 0.0000000000 +d53_10 100000000000000000.0000000000 +d53_10 10000000000000000000000000000000000000000000.0000000000 +d53_10 10000000000000000000000000000000000000000000.0000000000 +f 0 +f 0 +f 1e38 +f 3.40282e38 +f0 0 +f0 0 +f0 12345.1 +f0 1e38 +f0 3.40282e38 +f20_3 0.000 +f20_3 0.000 +f20_3 56789.988 +f20_3 99999998430674940.000 +f20_3 99999998430674940.000 +f23_0 0 +f23_0 0 +f23_0 123457000 +f23_0 1e38 +f23_0 3.40282e38 +r1_1 0.0 +r1_1 0.0 +r1_1 0.9 +r1_1 0.9 +r1_1 0.9 +INSERT INTO t1 VALUES ( +999999999999999999999999999999999999999, +999999999999999999999999999999999999999.9999999999999999, +1.9, +999999999999999999999999999999999999999.9, +999999999999999999.999, +9999999999999999999999999999999999999999999999999999999999999999999999999999999999, +99, +1.9999999999, +1999999999999999999999999999999999999999999999999999999, +19999999999999999999999999999999999999999999.9999999999 +); +Warnings: +Warning 1916 Got overflow when converting '' to DECIMAL. Value truncated. +Warning 1264 Out of range value for column 'f' at row 1 +Warning 1264 Out of range value for column 'f0' at row 1 +Warning 1264 Out of range value for column 'r1_1' at row 1 +Warning 1264 Out of range value for column 'f23_0' at row 1 +Warning 1264 Out of range value for column 'f20_3' at row 1 +Warning 1264 Out of range value for column 'd1_0' at row 1 +Warning 1264 Out of range value for column 'd10_10' at row 1 +Warning 1264 Out of range value for column 'd53' at row 1 +Warning 1264 Out of range value for column 'd53_10' at row 1 +SELECT * FROM t1; +f 12345.1 +d 0 +d 0 +d 11111111.111 +d 1e43 +d 1e65 +d 1e81 +d10_10 0.0000000000 +d10_10 0.0000000000 +d10_10 0.0123456789 +d10_10 0.9999999999 +d10_10 0.9999999999 +d10_10 10000000000000000000000000000000000000000000.0000000000 +d1_0 0 +d1_0 0 +d1_0 8 +d1_0 9 +d1_0 9 +d1_0 9 +d53 0 +d53 0 +d53 10000000000000000000000000000000000000000000 +d53 100000000000000000000000000000000000000000000000000000 +d53 100000000000000000000000000000000000000000000000000000 +d53 1234566789123456800 +d53_10 0.0000000000 +d53_10 0.0000000000 +d53_10 100000000000000000.0000000000 +d53_10 10000000000000000000000000000000000000000000.0000000000 +d53_10 10000000000000000000000000000000000000000000.0000000000 +d53_10 10000000000000000000000000000000000000000000.0000000000 +f 0 +f 0 +f 1e38 +f 3.40282e38 +f 3.40282e38 +f0 0 +f0 0 +f0 12345.1 +f0 1e38 +f0 3.40282e38 +f0 3.40282e38 +f20_3 0.000 +f20_3 0.000 +f20_3 56789.988 +f20_3 99999998430674940.000 +f20_3 99999998430674940.000 +f20_3 99999998430674940.000 +f23_0 0 +f23_0 0 +f23_0 123457000 +f23_0 1e38 +f23_0 3.40282e38 +f23_0 3.40282e38 +r1_1 0.0 +r1_1 0.0 +r1_1 0.9 +r1_1 0.9 +r1_1 0.9 +r1_1 0.9 +ALTER TABLE t1 ADD COLUMN d0_0 DOUBLE(0,0); +ERROR 42000: Display width out of range for 'd0_0' (max = 255) +ALTER TABLE t1 ADD COLUMN n66_6 DECIMAL(256,1); +ERROR 42000: Too big precision 256 specified for 'n66_6'. Maximum is 65. +ALTER TABLE t1 ADD COLUMN n66_66 DECIMAL(40,35); +ERROR 42000: Too big scale 35 specified for 'n66_66'. Maximum is 30. +DROP TABLE t1; +CREATE TABLE t1 (a DOUBLE UNSIGNED <CUSTOM_COL_OPTIONS>, +b FLOAT UNSIGNED <CUSTOM_COL_OPTIONS> +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +a double unsigned # # # # +b float unsigned # # # # +INSERT INTO t1 (a,b) VALUES (1.0,-1.0); +Warnings: +Warning 1264 Out of range value for column 'b' at row 1 +INSERT INTO t1 (a,b) VALUES (-100,100); +Warnings: +Warning 1264 Out of range value for column 'a' at row 1 +SELECT * FROM t1; +a b +0 100 +1 0 +DROP TABLE t1; +# +# INT columns +# +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (i INT UNSIGNED <CUSTOM_COL_OPTIONS>, +i0 INT(0) UNSIGNED <CUSTOM_COL_OPTIONS>, +i1 INT(1) UNSIGNED <CUSTOM_COL_OPTIONS>, +i20 INT(20) UNSIGNED <CUSTOM_COL_OPTIONS>, +t TINYINT UNSIGNED <CUSTOM_COL_OPTIONS>, +t0 TINYINT(0) UNSIGNED <CUSTOM_COL_OPTIONS>, +t1 TINYINT(1) UNSIGNED <CUSTOM_COL_OPTIONS>, +t20 TINYINT(20) UNSIGNED <CUSTOM_COL_OPTIONS>, +s SMALLINT UNSIGNED <CUSTOM_COL_OPTIONS>, +s0 SMALLINT(0) UNSIGNED <CUSTOM_COL_OPTIONS>, +s1 SMALLINT(1) UNSIGNED <CUSTOM_COL_OPTIONS>, +s20 SMALLINT(20) UNSIGNED <CUSTOM_COL_OPTIONS>, +m MEDIUMINT UNSIGNED <CUSTOM_COL_OPTIONS>, +m0 MEDIUMINT(0) UNSIGNED <CUSTOM_COL_OPTIONS>, +m1 MEDIUMINT(1) UNSIGNED <CUSTOM_COL_OPTIONS>, +m20 MEDIUMINT(20) UNSIGNED <CUSTOM_COL_OPTIONS>, +b BIGINT UNSIGNED <CUSTOM_COL_OPTIONS>, +b0 BIGINT(0) UNSIGNED <CUSTOM_COL_OPTIONS>, +b1 BIGINT(1) UNSIGNED <CUSTOM_COL_OPTIONS>, +b20 BIGINT(20) UNSIGNED <CUSTOM_COL_OPTIONS> +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +i int(10) unsigned # # # +i0 int(10) unsigned # # # +i1 int(1) unsigned # # # +i20 int(20) unsigned # # # +t tinyint(3) unsigned # # # +t0 tinyint(3) unsigned # # # +t1 tinyint(1) unsigned # # # +t20 tinyint(20) unsigned # # # +s smallint(5) unsigned # # # +s0 smallint(5) unsigned # # # +s1 smallint(1) unsigned # # # +s20 smallint(20) unsigned # # # +m mediumint(8) unsigned # # # +m0 mediumint(8) unsigned # # # +m1 mediumint(1) unsigned # # # +m20 mediumint(20) unsigned # # # +b bigint(20) unsigned # # # +b0 bigint(20) unsigned # # # +b1 bigint(1) unsigned # # # +b20 bigint(20) unsigned # # # +INSERT INTO t1 VALUES (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20); +INSERT INTO t1 VALUES (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); +INSERT INTO t1 VALUES (2147483647,2147483647,2147483647,2147483647,127,127,127,127,32767,32767,32767,32767,8388607,8388607,8388607,8388607,9223372036854775807,9223372036854775807,9223372036854775807,9223372036854775807); +SELECT * FROM t1; +i i0 i1 i20 t t0 t1 t20 s s0 s1 s20 m m0 m1 m20 b b0 b1 b20 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 +2147483647 2147483647 2147483647 2147483647 127 127 127 127 32767 32767 32767 32767 8388607 8388607 8388607 8388607 9223372036854775807 9223372036854775807 9223372036854775807 9223372036854775807 +INSERT INTO t1 VALUES (-2147483648,-2147483648,-2147483648,-2147483648,-128,-128,-128,-128,-32768,-32768,-32768,-32768,-8388608,-8388608,-8388608,-8388608,-9223372036854775808,-9223372036854775808,-9223372036854775808,-9223372036854775808); +Warnings: +Warning 1264 Out of range value for column 'i' at row 1 +Warning 1264 Out of range value for column 'i0' at row 1 +Warning 1264 Out of range value for column 'i1' at row 1 +Warning 1264 Out of range value for column 'i20' at row 1 +Warning 1264 Out of range value for column 't' at row 1 +Warning 1264 Out of range value for column 't0' at row 1 +Warning 1264 Out of range value for column 't1' at row 1 +Warning 1264 Out of range value for column 't20' at row 1 +Warning 1264 Out of range value for column 's' at row 1 +Warning 1264 Out of range value for column 's0' at row 1 +Warning 1264 Out of range value for column 's1' at row 1 +Warning 1264 Out of range value for column 's20' at row 1 +Warning 1264 Out of range value for column 'm' at row 1 +Warning 1264 Out of range value for column 'm0' at row 1 +Warning 1264 Out of range value for column 'm1' at row 1 +Warning 1264 Out of range value for column 'm20' at row 1 +Warning 1264 Out of range value for column 'b' at row 1 +Warning 1264 Out of range value for column 'b0' at row 1 +Warning 1264 Out of range value for column 'b1' at row 1 +Warning 1264 Out of range value for column 'b20' at row 1 +INSERT INTO t1 VALUES (4294967295,4294967295,4294967295,4294967295,255,255,255,255,65535,65535,65535,65535,16777215,16777215,16777215,16777215,18446744073709551615,18446744073709551615,18446744073709551615,18446744073709551615); +SELECT * FROM t1; +i i0 i1 i20 t t0 t1 t20 s s0 s1 s20 m m0 m1 m20 b b0 b1 b20 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 +2147483647 2147483647 2147483647 2147483647 127 127 127 127 32767 32767 32767 32767 8388607 8388607 8388607 8388607 9223372036854775807 9223372036854775807 9223372036854775807 9223372036854775807 +4294967295 4294967295 4294967295 4294967295 255 255 255 255 65535 65535 65535 65535 16777215 16777215 16777215 16777215 18446744073709551615 18446744073709551615 18446744073709551615 18446744073709551615 +INSERT INTO t1 VALUES (-2147483649,-2147483649,-2147483649,-2147483649,-129,-129,-129,-129,-32769,-32769,-32769,-32769,-8388609,-8388609,-8388609,-8388609,-9223372036854775809,-9223372036854775809,-9223372036854775809,-9223372036854775809); +Warnings: +Warning 1264 Out of range value for column 'i' at row 1 +Warning 1264 Out of range value for column 'i0' at row 1 +Warning 1264 Out of range value for column 'i1' at row 1 +Warning 1264 Out of range value for column 'i20' at row 1 +Warning 1264 Out of range value for column 't' at row 1 +Warning 1264 Out of range value for column 't0' at row 1 +Warning 1264 Out of range value for column 't1' at row 1 +Warning 1264 Out of range value for column 't20' at row 1 +Warning 1264 Out of range value for column 's' at row 1 +Warning 1264 Out of range value for column 's0' at row 1 +Warning 1264 Out of range value for column 's1' at row 1 +Warning 1264 Out of range value for column 's20' at row 1 +Warning 1264 Out of range value for column 'm' at row 1 +Warning 1264 Out of range value for column 'm0' at row 1 +Warning 1264 Out of range value for column 'm1' at row 1 +Warning 1264 Out of range value for column 'm20' at row 1 +Warning 1264 Out of range value for column 'b' at row 1 +Warning 1264 Out of range value for column 'b0' at row 1 +Warning 1264 Out of range value for column 'b1' at row 1 +Warning 1264 Out of range value for column 'b20' at row 1 +INSERT INTO t1 VALUES (4294967296,4294967296,4294967296,4294967296,256,256,256,256,65536,65536,65536,65536,16777216,16777216,16777216,16777216,18446744073709551616,18446744073709551616,18446744073709551616,18446744073709551616); +Warnings: +Warning 1264 Out of range value for column 'i' at row 1 +Warning 1264 Out of range value for column 'i0' at row 1 +Warning 1264 Out of range value for column 'i1' at row 1 +Warning 1264 Out of range value for column 'i20' at row 1 +Warning 1264 Out of range value for column 't' at row 1 +Warning 1264 Out of range value for column 't0' at row 1 +Warning 1264 Out of range value for column 't1' at row 1 +Warning 1264 Out of range value for column 't20' at row 1 +Warning 1264 Out of range value for column 's' at row 1 +Warning 1264 Out of range value for column 's0' at row 1 +Warning 1264 Out of range value for column 's1' at row 1 +Warning 1264 Out of range value for column 's20' at row 1 +Warning 1264 Out of range value for column 'm' at row 1 +Warning 1264 Out of range value for column 'm0' at row 1 +Warning 1264 Out of range value for column 'm1' at row 1 +Warning 1264 Out of range value for column 'm20' at row 1 +Warning 1264 Out of range value for column 'b' at row 1 +Warning 1264 Out of range value for column 'b0' at row 1 +Warning 1264 Out of range value for column 'b1' at row 1 +Warning 1264 Out of range value for column 'b20' at row 1 +INSERT INTO t1 SELECT b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b FROM t1 WHERE b IN (-9223372036854775808,9223372036854775807,18446744073709551615); +Warnings: +Warning 1264 Out of range value for column 'i' at row 1 +Warning 1264 Out of range value for column 'i0' at row 1 +Warning 1264 Out of range value for column 'i1' at row 1 +Warning 1264 Out of range value for column 'i20' at row 1 +Warning 1264 Out of range value for column 't' at row 1 +Warning 1264 Out of range value for column 't0' at row 1 +Warning 1264 Out of range value for column 't1' at row 1 +Warning 1264 Out of range value for column 't20' at row 1 +Warning 1264 Out of range value for column 's' at row 1 +Warning 1264 Out of range value for column 's0' at row 1 +Warning 1264 Out of range value for column 's1' at row 1 +Warning 1264 Out of range value for column 's20' at row 1 +Warning 1264 Out of range value for column 'm' at row 1 +Warning 1264 Out of range value for column 'm0' at row 1 +Warning 1264 Out of range value for column 'm1' at row 1 +Warning 1264 Out of range value for column 'm20' at row 1 +Warning 1264 Out of range value for column 'i' at row 2 +Warning 1264 Out of range value for column 'i0' at row 2 +Warning 1264 Out of range value for column 'i1' at row 2 +Warning 1264 Out of range value for column 'i20' at row 2 +Warning 1264 Out of range value for column 't' at row 2 +Warning 1264 Out of range value for column 't0' at row 2 +Warning 1264 Out of range value for column 't1' at row 2 +Warning 1264 Out of range value for column 't20' at row 2 +Warning 1264 Out of range value for column 's' at row 2 +Warning 1264 Out of range value for column 's0' at row 2 +Warning 1264 Out of range value for column 's1' at row 2 +Warning 1264 Out of range value for column 's20' at row 2 +Warning 1264 Out of range value for column 'm' at row 2 +Warning 1264 Out of range value for column 'm0' at row 2 +Warning 1264 Out of range value for column 'm1' at row 2 +Warning 1264 Out of range value for column 'm20' at row 2 +Warning 1264 Out of range value for column 'i' at row 3 +Warning 1264 Out of range value for column 'i0' at row 3 +Warning 1264 Out of range value for column 'i1' at row 3 +Warning 1264 Out of range value for column 'i20' at row 3 +Warning 1264 Out of range value for column 't' at row 3 +Warning 1264 Out of range value for column 't0' at row 3 +Warning 1264 Out of range value for column 't1' at row 3 +Warning 1264 Out of range value for column 't20' at row 3 +Warning 1264 Out of range value for column 's' at row 3 +Warning 1264 Out of range value for column 's0' at row 3 +Warning 1264 Out of range value for column 's1' at row 3 +Warning 1264 Out of range value for column 's20' at row 3 +Warning 1264 Out of range value for column 'm' at row 3 +Warning 1264 Out of range value for column 'm0' at row 3 +Warning 1264 Out of range value for column 'm1' at row 3 +Warning 1264 Out of range value for column 'm20' at row 3 +SELECT * FROM t1; +i i0 i1 i20 t t0 t1 t20 s s0 s1 s20 m m0 m1 m20 b b0 b1 b20 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 +2147483647 2147483647 2147483647 2147483647 127 127 127 127 32767 32767 32767 32767 8388607 8388607 8388607 8388607 9223372036854775807 9223372036854775807 9223372036854775807 9223372036854775807 +4294967295 4294967295 4294967295 4294967295 255 255 255 255 65535 65535 65535 65535 16777215 16777215 16777215 16777215 18446744073709551615 18446744073709551615 18446744073709551615 18446744073709551615 +4294967295 4294967295 4294967295 4294967295 255 255 255 255 65535 65535 65535 65535 16777215 16777215 16777215 16777215 18446744073709551615 18446744073709551615 18446744073709551615 18446744073709551615 +4294967295 4294967295 4294967295 4294967295 255 255 255 255 65535 65535 65535 65535 16777215 16777215 16777215 16777215 18446744073709551615 18446744073709551615 18446744073709551615 18446744073709551615 +4294967295 4294967295 4294967295 4294967295 255 255 255 255 65535 65535 65535 65535 16777215 16777215 16777215 16777215 18446744073709551615 18446744073709551615 18446744073709551615 18446744073709551615 +4294967295 4294967295 4294967295 4294967295 255 255 255 255 65535 65535 65535 65535 16777215 16777215 16777215 16777215 9223372036854775807 9223372036854775807 9223372036854775807 9223372036854775807 +ALTER TABLE t1 ADD COLUMN i257 INT(257); +ERROR 42000: Display width out of range for 'i257' (max = 255) +DROP TABLE t1; +CREATE TABLE t1 (t TINYINT UNSIGNED <CUSTOM_COL_OPTIONS>, +s SMALLINT UNSIGNED <CUSTOM_COL_OPTIONS>, +m MEDIUMINT UNSIGNED <CUSTOM_COL_OPTIONS>, +i INT UNSIGNED <CUSTOM_COL_OPTIONS>, +b BIGINT UNSIGNED <CUSTOM_COL_OPTIONS> +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +t tinyint(3) unsigned # # # # +s smallint(5) unsigned # # # # +m mediumint(8) unsigned # # # # +i int(10) unsigned # # # # +b bigint(20) unsigned # # # # +INSERT INTO t1 (t,s,m,i,b) VALUES (255,65535,16777215,4294967295,18446744073709551615); +INSERT INTO t1 (t,s,m,i,b) VALUES (-1,-1,-1,-1,-1); +Warnings: +Warning 1264 Out of range value for column 't' at row 1 +Warning 1264 Out of range value for column 's' at row 1 +Warning 1264 Out of range value for column 'm' at row 1 +Warning 1264 Out of range value for column 'i' at row 1 +Warning 1264 Out of range value for column 'b' at row 1 +SELECT * FROM t1; +t s m i b +0 0 0 0 0 +255 65535 16777215 4294967295 18446744073709551615 +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/col_opt_unsigned.test b/mysql-test/suite/storage_engine/col_opt_unsigned.test new file mode 100644 index 00000000000..e9d4566de7f --- /dev/null +++ b/mysql-test/suite/storage_engine/col_opt_unsigned.test @@ -0,0 +1,95 @@ +# +# UNSIGNED column attribute +# + +let $extra_type_opts = UNSIGNED; + +--source have_engine.inc + +--echo # +--echo # Fixed point columns (NUMERIC, DECIMAL) +--echo # + +--source type_fixed.inc +let $create_definition = + a DECIMAL $col_opts, + b NUMERIC $col_opts +; +--source create_table.inc +if ($mysql_errname) +{ + --let $functionality = Fixed point types or UNSIGNED columns + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 3 # 4 # 5 # 6 # + SHOW COLUMNS IN t1; + + INSERT INTO t1 (a,b) VALUES (1.0,-1.0); + INSERT INTO t1 (a,b) VALUES (-100,100); + --sorted_result + SELECT * FROM t1; + DROP TABLE t1; +} + +--echo # +--echo # Floating point columns (FLOAT, DOUBLE) +--echo # + +--source type_float.inc +let $create_definition = + a DOUBLE $col_opts, + b FLOAT $col_opts +; +--source create_table.inc +if ($mysql_errname) +{ + --let $functionality = Floating point types or UNSIGNED columns + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 3 # 4 # 5 # 6 # + SHOW COLUMNS IN t1; + + INSERT INTO t1 (a,b) VALUES (1.0,-1.0); + INSERT INTO t1 (a,b) VALUES (-100,100); + --sorted_result + SELECT * FROM t1; + DROP TABLE t1; +} + +--echo # +--echo # INT columns +--echo # + +--source type_int.inc +let $create_definition = + t TINYINT $col_opts, + s SMALLINT $col_opts, + m MEDIUMINT $col_opts, + i INT $col_opts, + b BIGINT $col_opts +; +--source create_table.inc +if ($mysql_errname) +{ + --let $functionality = INT types or UNSIGNED columns + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 3 # 4 # 5 # 6 # + SHOW COLUMNS IN t1; + + INSERT INTO t1 (t,s,m,i,b) VALUES (255,65535,16777215,4294967295,18446744073709551615); + INSERT INTO t1 (t,s,m,i,b) VALUES (-1,-1,-1,-1,-1); + --sorted_result + SELECT * FROM t1; + DROP TABLE t1; + +} + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/col_opt_zerofill.result b/mysql-test/suite/storage_engine/col_opt_zerofill.result new file mode 100644 index 00000000000..c2445c5bbc7 --- /dev/null +++ b/mysql-test/suite/storage_engine/col_opt_zerofill.result @@ -0,0 +1,679 @@ +# +# Fixed point columns (NUMERIC, DECIMAL) +# +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (d DECIMAL ZEROFILL <CUSTOM_COL_OPTIONS>, +d0 DECIMAL(0) ZEROFILL <CUSTOM_COL_OPTIONS>, +d1_1 DECIMAL(1,1) ZEROFILL <CUSTOM_COL_OPTIONS>, +d10_2 DECIMAL(10,2) ZEROFILL <CUSTOM_COL_OPTIONS>, +d60_10 DECIMAL(60,10) ZEROFILL <CUSTOM_COL_OPTIONS>, +n NUMERIC ZEROFILL <CUSTOM_COL_OPTIONS>, +n0_0 NUMERIC(0,0) ZEROFILL <CUSTOM_COL_OPTIONS>, +n1 NUMERIC(1) ZEROFILL <CUSTOM_COL_OPTIONS>, +n20_4 NUMERIC(20,4) ZEROFILL <CUSTOM_COL_OPTIONS>, +n65_4 NUMERIC(65,4) ZEROFILL <CUSTOM_COL_OPTIONS> +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +d decimal(10,0) unsigned zerofill # # # +d0 decimal(10,0) unsigned zerofill # # # +d1_1 decimal(1,1) unsigned zerofill # # # +d10_2 decimal(10,2) unsigned zerofill # # # +d60_10 decimal(60,10) unsigned zerofill # # # +n decimal(10,0) unsigned zerofill # # # +n0_0 decimal(10,0) unsigned zerofill # # # +n1 decimal(1,0) unsigned zerofill # # # +n20_4 decimal(20,4) unsigned zerofill # # # +n65_4 decimal(65,4) unsigned zerofill # # # +INSERT INTO t1 VALUES (100,123456,0.3,40000.25,123456789123456789.10001,1024,7000.0,8.0,999999.9,9223372036854775807); +INSERT INTO t1 VALUES (0,0,0,0,0,0,0,0,0,0); +INSERT INTO t1 VALUES (9999999999.0,9999999999.0,0.9,99999999.99,99999999999999999999999999999999999999999999999999.9999999999,9999999999.0,9999999999.0,9.0,9999999999999999.9999,9999999999999999999999999999999999999999999999999999999999999.9999); +SELECT * FROM t1; +d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 +0000000000 0000000000 0.0 00000000.00 00000000000000000000000000000000000000000000000000.0000000000 0000000000 0000000000 0 0000000000000000.0000 0000000000000000000000000000000000000000000000000000000000000.0000 +0000000100 0000123456 0.3 00040000.25 00000000000000000000000000000000123456789123456789.1000100000 0000001024 0000007000 8 0000000000999999.9000 0000000000000000000000000000000000000000009223372036854775807.0000 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +INSERT INTO t1 VALUES (-100,-123456,-0.3,-40000.25,-123456789123456789.10001,-1024,-7000.0,-8.0,-999999.9,-9223372036854775807); +Warnings: +Warning 1264 Out of range value for column 'd' at row 1 +Warning 1264 Out of range value for column 'd0' at row 1 +Warning 1264 Out of range value for column 'd1_1' at row 1 +Warning 1264 Out of range value for column 'd10_2' at row 1 +Warning 1264 Out of range value for column 'd60_10' at row 1 +Warning 1264 Out of range value for column 'n' at row 1 +Warning 1264 Out of range value for column 'n0_0' at row 1 +Warning 1264 Out of range value for column 'n1' at row 1 +Warning 1264 Out of range value for column 'n20_4' at row 1 +Warning 1264 Out of range value for column 'n65_4' at row 1 +INSERT INTO t1 VALUES (-9999999999.0,-9999999999.0,-0.9,-99999999.99,-99999999999999999999999999999999999999999999999999.9999999999,-9999999999.0,-9999999999.0,-9.0,-9999999999999999.9999,-9999999999999999999999999999999999999999999999999999999999999.9999); +Warnings: +Warning 1264 Out of range value for column 'd' at row 1 +Warning 1264 Out of range value for column 'd0' at row 1 +Warning 1264 Out of range value for column 'd1_1' at row 1 +Warning 1264 Out of range value for column 'd10_2' at row 1 +Warning 1264 Out of range value for column 'd60_10' at row 1 +Warning 1264 Out of range value for column 'n' at row 1 +Warning 1264 Out of range value for column 'n0_0' at row 1 +Warning 1264 Out of range value for column 'n1' at row 1 +Warning 1264 Out of range value for column 'n20_4' at row 1 +Warning 1264 Out of range value for column 'n65_4' at row 1 +SELECT * FROM t1; +d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 +0000000000 0000000000 0.0 00000000.00 00000000000000000000000000000000000000000000000000.0000000000 0000000000 0000000000 0 0000000000000000.0000 0000000000000000000000000000000000000000000000000000000000000.0000 +0000000000 0000000000 0.0 00000000.00 00000000000000000000000000000000000000000000000000.0000000000 0000000000 0000000000 0 0000000000000000.0000 0000000000000000000000000000000000000000000000000000000000000.0000 +0000000000 0000000000 0.0 00000000.00 00000000000000000000000000000000000000000000000000.0000000000 0000000000 0000000000 0 0000000000000000.0000 0000000000000000000000000000000000000000000000000000000000000.0000 +0000000100 0000123456 0.3 00040000.25 00000000000000000000000000000000123456789123456789.1000100000 0000001024 0000007000 8 0000000000999999.9000 0000000000000000000000000000000000000000009223372036854775807.0000 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +SELECT * FROM t1 WHERE n20_4 = 9999999999999999.9999 OR d < 100; +d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 +0000000000 0000000000 0.0 00000000.00 00000000000000000000000000000000000000000000000000.0000000000 0000000000 0000000000 0 0000000000000000.0000 0000000000000000000000000000000000000000000000000000000000000.0000 +0000000000 0000000000 0.0 00000000.00 00000000000000000000000000000000000000000000000000.0000000000 0000000000 0000000000 0 0000000000000000.0000 0000000000000000000000000000000000000000000000000000000000000.0000 +0000000000 0000000000 0.0 00000000.00 00000000000000000000000000000000000000000000000000.0000000000 0000000000 0000000000 0 0000000000000000.0000 0000000000000000000000000000000000000000000000000000000000000.0000 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +INSERT INTO t1 SELECT n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4 FROM t1 WHERE n65_4 = ( SELECT MAX(n65_4) FROM t1 ); +Warnings: +Warning 1264 Out of range value for column 'd' at row 1 +Warning 1264 Out of range value for column 'd0' at row 1 +Warning 1264 Out of range value for column 'd1_1' at row 1 +Warning 1264 Out of range value for column 'd10_2' at row 1 +Warning 1264 Out of range value for column 'd60_10' at row 1 +Warning 1264 Out of range value for column 'n' at row 1 +Warning 1264 Out of range value for column 'n0_0' at row 1 +Warning 1264 Out of range value for column 'n1' at row 1 +Warning 1264 Out of range value for column 'n20_4' at row 1 +SELECT * FROM t1; +d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 +0000000000 0000000000 0.0 00000000.00 00000000000000000000000000000000000000000000000000.0000000000 0000000000 0000000000 0 0000000000000000.0000 0000000000000000000000000000000000000000000000000000000000000.0000 +0000000000 0000000000 0.0 00000000.00 00000000000000000000000000000000000000000000000000.0000000000 0000000000 0000000000 0 0000000000000000.0000 0000000000000000000000000000000000000000000000000000000000000.0000 +0000000000 0000000000 0.0 00000000.00 00000000000000000000000000000000000000000000000000.0000000000 0000000000 0000000000 0 0000000000000000.0000 0000000000000000000000000000000000000000000000000000000000000.0000 +0000000100 0000123456 0.3 00040000.25 00000000000000000000000000000000123456789123456789.1000100000 0000001024 0000007000 8 0000000000999999.9000 0000000000000000000000000000000000000000009223372036854775807.0000 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +INSERT INTO t1 VALUES (10000000000.0,10000000000.0,1.1,100000000.99,100000000000000000000000000000000000000000000000000.0,10000000000.0,10000000000.0,10.0,10000000000000000.9999,10000000000000000000000000000000000000000000000000000000000000.9999); +Warnings: +Warning 1264 Out of range value for column 'd' at row 1 +Warning 1264 Out of range value for column 'd0' at row 1 +Warning 1264 Out of range value for column 'd1_1' at row 1 +Warning 1264 Out of range value for column 'd10_2' at row 1 +Warning 1264 Out of range value for column 'd60_10' at row 1 +Warning 1264 Out of range value for column 'n' at row 1 +Warning 1264 Out of range value for column 'n0_0' at row 1 +Warning 1264 Out of range value for column 'n1' at row 1 +Warning 1264 Out of range value for column 'n20_4' at row 1 +Warning 1264 Out of range value for column 'n65_4' at row 1 +SELECT * FROM t1; +d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 +0000000000 0000000000 0.0 00000000.00 00000000000000000000000000000000000000000000000000.0000000000 0000000000 0000000000 0 0000000000000000.0000 0000000000000000000000000000000000000000000000000000000000000.0000 +0000000000 0000000000 0.0 00000000.00 00000000000000000000000000000000000000000000000000.0000000000 0000000000 0000000000 0 0000000000000000.0000 0000000000000000000000000000000000000000000000000000000000000.0000 +0000000000 0000000000 0.0 00000000.00 00000000000000000000000000000000000000000000000000.0000000000 0000000000 0000000000 0 0000000000000000.0000 0000000000000000000000000000000000000000000000000000000000000.0000 +0000000100 0000123456 0.3 00040000.25 00000000000000000000000000000000123456789123456789.1000100000 0000001024 0000007000 8 0000000000999999.9000 0000000000000000000000000000000000000000009223372036854775807.0000 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +INSERT INTO t1 VALUES (9999999999.1,9999999999.1,1.9,99999999.001,99999999999999999999999999999999999999999999999999.99999999991,9999999999.1,9999999999.1,9.1,9999999999999999.00001,9999999999999999999999999999999999999999999999999999999999999.11111); +Warnings: +Note 1265 Data truncated for column 'd' at row 1 +Note 1265 Data truncated for column 'd0' at row 1 +Warning 1264 Out of range value for column 'd1_1' at row 1 +Note 1265 Data truncated for column 'd10_2' at row 1 +Note 1265 Data truncated for column 'd60_10' at row 1 +Note 1265 Data truncated for column 'n' at row 1 +Note 1265 Data truncated for column 'n0_0' at row 1 +Note 1265 Data truncated for column 'n1' at row 1 +Note 1265 Data truncated for column 'n20_4' at row 1 +Note 1265 Data truncated for column 'n65_4' at row 1 +SELECT * FROM t1; +d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 +0000000000 0000000000 0.0 00000000.00 00000000000000000000000000000000000000000000000000.0000000000 0000000000 0000000000 0 0000000000000000.0000 0000000000000000000000000000000000000000000000000000000000000.0000 +0000000000 0000000000 0.0 00000000.00 00000000000000000000000000000000000000000000000000.0000000000 0000000000 0000000000 0 0000000000000000.0000 0000000000000000000000000000000000000000000000000000000000000.0000 +0000000000 0000000000 0.0 00000000.00 00000000000000000000000000000000000000000000000000.0000000000 0000000000 0000000000 0 0000000000000000.0000 0000000000000000000000000000000000000000000000000000000000000.0000 +0000000100 0000123456 0.3 00040000.25 00000000000000000000000000000000123456789123456789.1000100000 0000001024 0000007000 8 0000000000999999.9000 0000000000000000000000000000000000000000009223372036854775807.0000 +9999999999 9999999999 0.9 99999999.00 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.0000 9999999999999999999999999999999999999999999999999999999999999.1111 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +ALTER TABLE t1 ADD COLUMN n66 NUMERIC(66); +ERROR 42000: Too big precision 66 specified for 'n66'. Maximum is 65. +ALTER TABLE t1 ADD COLUMN n66_6 DECIMAL(66,6); +ERROR 42000: Too big precision 66 specified for 'n66_6'. Maximum is 65. +ALTER TABLE t1 ADD COLUMN n66_66 DECIMAL(66,66); +ERROR 42000: Too big scale 66 specified for 'n66_66'. Maximum is 30. +DROP TABLE t1; +CREATE TABLE t1 (a DECIMAL ZEROFILL <CUSTOM_COL_OPTIONS>, +b NUMERIC ZEROFILL <CUSTOM_COL_OPTIONS> +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +a decimal(10,0) unsigned zerofill # # # # +b decimal(10,0) unsigned zerofill # # # # +INSERT INTO t1 (a,b) VALUES (1.1,1234); +Warnings: +Note 1265 Data truncated for column 'a' at row 1 +SELECT * FROM t1; +a b +0000000001 0000001234 +DROP TABLE t1; +# +# Floating point columns (FLOAT, DOUBLE) +# +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (f FLOAT ZEROFILL <CUSTOM_COL_OPTIONS>, +f0 FLOAT(0) ZEROFILL <CUSTOM_COL_OPTIONS>, +r1_1 REAL(1,1) ZEROFILL <CUSTOM_COL_OPTIONS>, +f23_0 FLOAT(23) ZEROFILL <CUSTOM_COL_OPTIONS>, +f20_3 FLOAT(20,3) ZEROFILL <CUSTOM_COL_OPTIONS>, +d DOUBLE ZEROFILL <CUSTOM_COL_OPTIONS>, +d1_0 DOUBLE(1,0) ZEROFILL <CUSTOM_COL_OPTIONS>, +d10_10 DOUBLE PRECISION (10,10) ZEROFILL <CUSTOM_COL_OPTIONS>, +d53 DOUBLE(53,0) ZEROFILL <CUSTOM_COL_OPTIONS>, +d53_10 DOUBLE(53,10) ZEROFILL <CUSTOM_COL_OPTIONS> +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +f float unsigned zerofill # # # +f0 float unsigned zerofill # # # +r1_1 double(1,1) unsigned zerofill # # # +f23_0 float unsigned zerofill # # # +f20_3 float(20,3) unsigned zerofill # # # +d double unsigned zerofill # # # +d1_0 double(1,0) unsigned zerofill # # # +d10_10 double(10,10) unsigned zerofill # # # +d53 double(53,0) unsigned zerofill # # # +d53_10 double(53,10) unsigned zerofill # # # +INSERT INTO t1 VALUES (12345.12345,12345.12345,0.9,123456789.123,56789.987,11111111.111,8.0,0.0123456789,1234566789123456789,99999999999999999.99999999); +SELECT * FROM t1; +f 0000012345.1 +d 000000000011111111.111 +d10_10 0.0123456789 +d1_0 8 +d53 00000000000000000000000000000000001234566789123456800 +d53_10 000000000000000000000000100000000000000000.0000000000 +f0 0000012345.1 +f20_3 0000000000056789.988 +f23_0 000123457000 +r1_1 0.9 +INSERT INTO t1 VALUES (0,0,0,0,0,0,0,0,0,0); +INSERT INTO t1 VALUES ( +99999999999999999999999999999999999999, +99999999999999999999999999999999999999.9999999999999999, +0.9, +99999999999999999999999999999999999999.9, +99999999999999999.999, +999999999999999999999999999999999999999999999999999999999999999999999999999999999, +9, +0.9999999999, +1999999999999999999999999999999999999999999999999999999, +19999999999999999999999999999999999999999999.9999999999 +); +Warnings: +Warning 1264 Out of range value for column 'd53' at row 1 +Warning 1264 Out of range value for column 'd53_10' at row 1 +SELECT * FROM t1; +f 0000012345.1 +d 0000000000000000000000 +d 0000000000000000001e81 +d 000000000011111111.111 +d10_10 0.0000000000 +d10_10 0.0123456789 +d10_10 0.9999999999 +d1_0 0 +d1_0 8 +d1_0 9 +d53 00000000000000000000000000000000000000000000000000000 +d53 00000000000000000000000000000000001234566789123456800 +d53 100000000000000000000000000000000000000000000000000000 +d53_10 000000000000000000000000000000000000000000.0000000000 +d53_10 000000000000000000000000100000000000000000.0000000000 +d53_10 10000000000000000000000000000000000000000000.0000000000 +f 000000000000 +f 000000001e38 +f0 000000000000 +f0 000000001e38 +f0 0000012345.1 +f20_3 0000000000000000.000 +f20_3 0000000000056789.988 +f20_3 99999998430674940.000 +f23_0 000000000000 +f23_0 000000001e38 +f23_0 000123457000 +r1_1 0.0 +r1_1 0.9 +r1_1 0.9 +INSERT INTO t1 VALUES (-999999999999999999999999,-99999999999.999999999999,-0.9,-999.99999999999999999999,-99999999999999999.999,-999999999999999999999999999999999999999999999999999999999999-0.999,-9,-.9999999999,-999999999999999999999999999999.99999999999999999999999,-9999999999999999999999999999999999999999999.9999999999); +Warnings: +Warning 1264 Out of range value for column 'f' at row 1 +Warning 1264 Out of range value for column 'f0' at row 1 +Warning 1264 Out of range value for column 'r1_1' at row 1 +Warning 1264 Out of range value for column 'f23_0' at row 1 +Warning 1264 Out of range value for column 'f20_3' at row 1 +Warning 1264 Out of range value for column 'd' at row 1 +Warning 1264 Out of range value for column 'd1_0' at row 1 +Warning 1264 Out of range value for column 'd10_10' at row 1 +Warning 1264 Out of range value for column 'd53' at row 1 +Warning 1264 Out of range value for column 'd53_10' at row 1 +SELECT * FROM t1; +f 0000012345.1 +d 0000000000000000000000 +d 0000000000000000000000 +d 0000000000000000001e81 +d 000000000011111111.111 +d10_10 0.0000000000 +d10_10 0.0000000000 +d10_10 0.0123456789 +d10_10 0.9999999999 +d1_0 0 +d1_0 0 +d1_0 8 +d1_0 9 +d53 00000000000000000000000000000000000000000000000000000 +d53 00000000000000000000000000000000000000000000000000000 +d53 00000000000000000000000000000000001234566789123456800 +d53 100000000000000000000000000000000000000000000000000000 +d53_10 000000000000000000000000000000000000000000.0000000000 +d53_10 000000000000000000000000000000000000000000.0000000000 +d53_10 000000000000000000000000100000000000000000.0000000000 +d53_10 10000000000000000000000000000000000000000000.0000000000 +f 000000000000 +f 000000000000 +f 000000001e38 +f0 000000000000 +f0 000000000000 +f0 000000001e38 +f0 0000012345.1 +f20_3 0000000000000000.000 +f20_3 0000000000000000.000 +f20_3 0000000000056789.988 +f20_3 99999998430674940.000 +f23_0 000000000000 +f23_0 000000000000 +f23_0 000000001e38 +f23_0 000123457000 +r1_1 0.0 +r1_1 0.0 +r1_1 0.9 +r1_1 0.9 +SELECT MAX(f), MAX(f0), MAX(r1_1), MAX(f23_0), MAX(f20_3), MAX(d), MAX(d1_0), MAX(d10_10), MAX(d53), MAX(d53_10) FROM t1; +MAX(f) 9.999999680285692e37 +MAX(d) 1e81 +MAX(d10_10) 0.9999999999 +MAX(d1_0) 9 +MAX(d53) 100000000000000000000000000000000000000000000000000000 +MAX(d53_10) 10000000000000000000000000000000000000000000.0000000000 +MAX(f0) 9.999999680285692e37 +MAX(f20_3) 99999998430674940.000 +MAX(f23_0) 9.999999680285692e37 +MAX(r1_1) 0.9 +INSERT INTO t1 SELECT d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10 FROM t1 ORDER BY d53_10 DESC LIMIT 1; +Warnings: +Warning 1264 Out of range value for column 'f' at row 1 +Warning 1264 Out of range value for column 'f0' at row 1 +Warning 1264 Out of range value for column 'r1_1' at row 1 +Warning 1264 Out of range value for column 'f23_0' at row 1 +Warning 1264 Out of range value for column 'f20_3' at row 1 +Warning 1264 Out of range value for column 'd1_0' at row 1 +SELECT * FROM t1; +f 0000012345.1 +d 0000000000000000000000 +d 0000000000000000000000 +d 0000000000000000001e43 +d 0000000000000000001e81 +d 000000000011111111.111 +d10_10 0.0000000000 +d10_10 0.0000000000 +d10_10 0.0123456789 +d10_10 0.9999999999 +d10_10 10000000000000000000000000000000000000000000.0000000000 +d1_0 0 +d1_0 0 +d1_0 8 +d1_0 9 +d1_0 9 +d53 00000000000000000000000000000000000000000000000000000 +d53 00000000000000000000000000000000000000000000000000000 +d53 00000000000000000000000000000000001234566789123456800 +d53 00000000010000000000000000000000000000000000000000000 +d53 100000000000000000000000000000000000000000000000000000 +d53_10 000000000000000000000000000000000000000000.0000000000 +d53_10 000000000000000000000000000000000000000000.0000000000 +d53_10 000000000000000000000000100000000000000000.0000000000 +d53_10 10000000000000000000000000000000000000000000.0000000000 +d53_10 10000000000000000000000000000000000000000000.0000000000 +f 000000000000 +f 000000000000 +f 000000001e38 +f 003.40282e38 +f0 000000000000 +f0 000000000000 +f0 000000001e38 +f0 0000012345.1 +f0 003.40282e38 +f20_3 0000000000000000.000 +f20_3 0000000000000000.000 +f20_3 0000000000056789.988 +f20_3 99999998430674940.000 +f20_3 99999998430674940.000 +f23_0 000000000000 +f23_0 000000000000 +f23_0 000000001e38 +f23_0 000123457000 +f23_0 003.40282e38 +r1_1 0.0 +r1_1 0.0 +r1_1 0.9 +r1_1 0.9 +r1_1 0.9 +INSERT INTO t1 VALUES ( +999999999999999999999999999999999999999, +999999999999999999999999999999999999999.9999999999999999, +1.9, +999999999999999999999999999999999999999.9, +999999999999999999.999, +9999999999999999999999999999999999999999999999999999999999999999999999999999999999, +99, +1.9999999999, +1999999999999999999999999999999999999999999999999999999, +19999999999999999999999999999999999999999999.9999999999 +); +Warnings: +Warning 1916 Got overflow when converting '' to DECIMAL. Value truncated. +Warning 1264 Out of range value for column 'f' at row 1 +Warning 1264 Out of range value for column 'f0' at row 1 +Warning 1264 Out of range value for column 'r1_1' at row 1 +Warning 1264 Out of range value for column 'f23_0' at row 1 +Warning 1264 Out of range value for column 'f20_3' at row 1 +Warning 1264 Out of range value for column 'd1_0' at row 1 +Warning 1264 Out of range value for column 'd10_10' at row 1 +Warning 1264 Out of range value for column 'd53' at row 1 +Warning 1264 Out of range value for column 'd53_10' at row 1 +SELECT * FROM t1; +f 0000012345.1 +d 0000000000000000000000 +d 0000000000000000000000 +d 0000000000000000001e43 +d 0000000000000000001e65 +d 0000000000000000001e81 +d 000000000011111111.111 +d10_10 0.0000000000 +d10_10 0.0000000000 +d10_10 0.0123456789 +d10_10 0.9999999999 +d10_10 0.9999999999 +d10_10 10000000000000000000000000000000000000000000.0000000000 +d1_0 0 +d1_0 0 +d1_0 8 +d1_0 9 +d1_0 9 +d1_0 9 +d53 00000000000000000000000000000000000000000000000000000 +d53 00000000000000000000000000000000000000000000000000000 +d53 00000000000000000000000000000000001234566789123456800 +d53 00000000010000000000000000000000000000000000000000000 +d53 100000000000000000000000000000000000000000000000000000 +d53 100000000000000000000000000000000000000000000000000000 +d53_10 000000000000000000000000000000000000000000.0000000000 +d53_10 000000000000000000000000000000000000000000.0000000000 +d53_10 000000000000000000000000100000000000000000.0000000000 +d53_10 10000000000000000000000000000000000000000000.0000000000 +d53_10 10000000000000000000000000000000000000000000.0000000000 +d53_10 10000000000000000000000000000000000000000000.0000000000 +f 000000000000 +f 000000000000 +f 000000001e38 +f 003.40282e38 +f 003.40282e38 +f0 000000000000 +f0 000000000000 +f0 000000001e38 +f0 0000012345.1 +f0 003.40282e38 +f0 003.40282e38 +f20_3 0000000000000000.000 +f20_3 0000000000000000.000 +f20_3 0000000000056789.988 +f20_3 99999998430674940.000 +f20_3 99999998430674940.000 +f20_3 99999998430674940.000 +f23_0 000000000000 +f23_0 000000000000 +f23_0 000000001e38 +f23_0 000123457000 +f23_0 003.40282e38 +f23_0 003.40282e38 +r1_1 0.0 +r1_1 0.0 +r1_1 0.9 +r1_1 0.9 +r1_1 0.9 +r1_1 0.9 +ALTER TABLE t1 ADD COLUMN d0_0 DOUBLE(0,0); +ERROR 42000: Display width out of range for 'd0_0' (max = 255) +ALTER TABLE t1 ADD COLUMN n66_6 DECIMAL(256,1); +ERROR 42000: Too big precision 256 specified for 'n66_6'. Maximum is 65. +ALTER TABLE t1 ADD COLUMN n66_66 DECIMAL(40,35); +ERROR 42000: Too big scale 35 specified for 'n66_66'. Maximum is 30. +DROP TABLE t1; +CREATE TABLE t1 (a DOUBLE ZEROFILL <CUSTOM_COL_OPTIONS>, +b FLOAT ZEROFILL <CUSTOM_COL_OPTIONS> +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +a double unsigned zerofill # # # # +b float unsigned zerofill # # # # +INSERT INTO t1 (a,b) VALUES (1,1234.5); +SELECT * FROM t1; +a b +0000000000000000000001 0000001234.5 +DROP TABLE t1; +# +# INT columns +# +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (i INT ZEROFILL <CUSTOM_COL_OPTIONS>, +i0 INT(0) ZEROFILL <CUSTOM_COL_OPTIONS>, +i1 INT(1) ZEROFILL <CUSTOM_COL_OPTIONS>, +i20 INT(20) ZEROFILL <CUSTOM_COL_OPTIONS>, +t TINYINT ZEROFILL <CUSTOM_COL_OPTIONS>, +t0 TINYINT(0) ZEROFILL <CUSTOM_COL_OPTIONS>, +t1 TINYINT(1) ZEROFILL <CUSTOM_COL_OPTIONS>, +t20 TINYINT(20) ZEROFILL <CUSTOM_COL_OPTIONS>, +s SMALLINT ZEROFILL <CUSTOM_COL_OPTIONS>, +s0 SMALLINT(0) ZEROFILL <CUSTOM_COL_OPTIONS>, +s1 SMALLINT(1) ZEROFILL <CUSTOM_COL_OPTIONS>, +s20 SMALLINT(20) ZEROFILL <CUSTOM_COL_OPTIONS>, +m MEDIUMINT ZEROFILL <CUSTOM_COL_OPTIONS>, +m0 MEDIUMINT(0) ZEROFILL <CUSTOM_COL_OPTIONS>, +m1 MEDIUMINT(1) ZEROFILL <CUSTOM_COL_OPTIONS>, +m20 MEDIUMINT(20) ZEROFILL <CUSTOM_COL_OPTIONS>, +b BIGINT ZEROFILL <CUSTOM_COL_OPTIONS>, +b0 BIGINT(0) ZEROFILL <CUSTOM_COL_OPTIONS>, +b1 BIGINT(1) ZEROFILL <CUSTOM_COL_OPTIONS>, +b20 BIGINT(20) ZEROFILL <CUSTOM_COL_OPTIONS> +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +i int(10) unsigned zerofill # # # +i0 int(10) unsigned zerofill # # # +i1 int(1) unsigned zerofill # # # +i20 int(20) unsigned zerofill # # # +t tinyint(3) unsigned zerofill # # # +t0 tinyint(3) unsigned zerofill # # # +t1 tinyint(1) unsigned zerofill # # # +t20 tinyint(20) unsigned zerofill # # # +s smallint(5) unsigned zerofill # # # +s0 smallint(5) unsigned zerofill # # # +s1 smallint(1) unsigned zerofill # # # +s20 smallint(20) unsigned zerofill # # # +m mediumint(8) unsigned zerofill # # # +m0 mediumint(8) unsigned zerofill # # # +m1 mediumint(1) unsigned zerofill # # # +m20 mediumint(20) unsigned zerofill # # # +b bigint(20) unsigned zerofill # # # +b0 bigint(20) unsigned zerofill # # # +b1 bigint(1) unsigned zerofill # # # +b20 bigint(20) unsigned zerofill # # # +INSERT INTO t1 VALUES (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20); +INSERT INTO t1 VALUES (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); +INSERT INTO t1 VALUES (2147483647,2147483647,2147483647,2147483647,127,127,127,127,32767,32767,32767,32767,8388607,8388607,8388607,8388607,9223372036854775807,9223372036854775807,9223372036854775807,9223372036854775807); +SELECT * FROM t1; +i i0 i1 i20 t t0 t1 t20 s s0 s1 s20 m m0 m1 m20 b b0 b1 b20 +0000000000 0000000000 0 00000000000000000000 000 000 0 00000000000000000000 00000 00000 0 00000000000000000000 00000000 00000000 0 00000000000000000000 00000000000000000000 00000000000000000000 0 00000000000000000000 +0000000001 0000000002 3 00000000000000000004 005 006 7 00000000000000000008 00009 00010 11 00000000000000000012 00000013 00000014 15 00000000000000000016 00000000000000000017 00000000000000000018 19 00000000000000000020 +2147483647 2147483647 2147483647 00000000002147483647 127 127 127 00000000000000000127 32767 32767 32767 00000000000000032767 08388607 08388607 8388607 00000000000008388607 09223372036854775807 09223372036854775807 9223372036854775807 09223372036854775807 +INSERT INTO t1 VALUES (-2147483648,-2147483648,-2147483648,-2147483648,-128,-128,-128,-128,-32768,-32768,-32768,-32768,-8388608,-8388608,-8388608,-8388608,-9223372036854775808,-9223372036854775808,-9223372036854775808,-9223372036854775808); +Warnings: +Warning 1264 Out of range value for column 'i' at row 1 +Warning 1264 Out of range value for column 'i0' at row 1 +Warning 1264 Out of range value for column 'i1' at row 1 +Warning 1264 Out of range value for column 'i20' at row 1 +Warning 1264 Out of range value for column 't' at row 1 +Warning 1264 Out of range value for column 't0' at row 1 +Warning 1264 Out of range value for column 't1' at row 1 +Warning 1264 Out of range value for column 't20' at row 1 +Warning 1264 Out of range value for column 's' at row 1 +Warning 1264 Out of range value for column 's0' at row 1 +Warning 1264 Out of range value for column 's1' at row 1 +Warning 1264 Out of range value for column 's20' at row 1 +Warning 1264 Out of range value for column 'm' at row 1 +Warning 1264 Out of range value for column 'm0' at row 1 +Warning 1264 Out of range value for column 'm1' at row 1 +Warning 1264 Out of range value for column 'm20' at row 1 +Warning 1264 Out of range value for column 'b' at row 1 +Warning 1264 Out of range value for column 'b0' at row 1 +Warning 1264 Out of range value for column 'b1' at row 1 +Warning 1264 Out of range value for column 'b20' at row 1 +INSERT INTO t1 VALUES (4294967295,4294967295,4294967295,4294967295,255,255,255,255,65535,65535,65535,65535,16777215,16777215,16777215,16777215,18446744073709551615,18446744073709551615,18446744073709551615,18446744073709551615); +SELECT * FROM t1; +i i0 i1 i20 t t0 t1 t20 s s0 s1 s20 m m0 m1 m20 b b0 b1 b20 +0000000000 0000000000 0 00000000000000000000 000 000 0 00000000000000000000 00000 00000 0 00000000000000000000 00000000 00000000 0 00000000000000000000 00000000000000000000 00000000000000000000 0 00000000000000000000 +0000000000 0000000000 0 00000000000000000000 000 000 0 00000000000000000000 00000 00000 0 00000000000000000000 00000000 00000000 0 00000000000000000000 00000000000000000000 00000000000000000000 0 00000000000000000000 +0000000001 0000000002 3 00000000000000000004 005 006 7 00000000000000000008 00009 00010 11 00000000000000000012 00000013 00000014 15 00000000000000000016 00000000000000000017 00000000000000000018 19 00000000000000000020 +2147483647 2147483647 2147483647 00000000002147483647 127 127 127 00000000000000000127 32767 32767 32767 00000000000000032767 08388607 08388607 8388607 00000000000008388607 09223372036854775807 09223372036854775807 9223372036854775807 09223372036854775807 +4294967295 4294967295 4294967295 00000000004294967295 255 255 255 00000000000000000255 65535 65535 65535 00000000000000065535 16777215 16777215 16777215 00000000000016777215 18446744073709551615 18446744073709551615 18446744073709551615 18446744073709551615 +INSERT INTO t1 VALUES (-2147483649,-2147483649,-2147483649,-2147483649,-129,-129,-129,-129,-32769,-32769,-32769,-32769,-8388609,-8388609,-8388609,-8388609,-9223372036854775809,-9223372036854775809,-9223372036854775809,-9223372036854775809); +Warnings: +Warning 1264 Out of range value for column 'i' at row 1 +Warning 1264 Out of range value for column 'i0' at row 1 +Warning 1264 Out of range value for column 'i1' at row 1 +Warning 1264 Out of range value for column 'i20' at row 1 +Warning 1264 Out of range value for column 't' at row 1 +Warning 1264 Out of range value for column 't0' at row 1 +Warning 1264 Out of range value for column 't1' at row 1 +Warning 1264 Out of range value for column 't20' at row 1 +Warning 1264 Out of range value for column 's' at row 1 +Warning 1264 Out of range value for column 's0' at row 1 +Warning 1264 Out of range value for column 's1' at row 1 +Warning 1264 Out of range value for column 's20' at row 1 +Warning 1264 Out of range value for column 'm' at row 1 +Warning 1264 Out of range value for column 'm0' at row 1 +Warning 1264 Out of range value for column 'm1' at row 1 +Warning 1264 Out of range value for column 'm20' at row 1 +Warning 1264 Out of range value for column 'b' at row 1 +Warning 1264 Out of range value for column 'b0' at row 1 +Warning 1264 Out of range value for column 'b1' at row 1 +Warning 1264 Out of range value for column 'b20' at row 1 +INSERT INTO t1 VALUES (4294967296,4294967296,4294967296,4294967296,256,256,256,256,65536,65536,65536,65536,16777216,16777216,16777216,16777216,18446744073709551616,18446744073709551616,18446744073709551616,18446744073709551616); +Warnings: +Warning 1264 Out of range value for column 'i' at row 1 +Warning 1264 Out of range value for column 'i0' at row 1 +Warning 1264 Out of range value for column 'i1' at row 1 +Warning 1264 Out of range value for column 'i20' at row 1 +Warning 1264 Out of range value for column 't' at row 1 +Warning 1264 Out of range value for column 't0' at row 1 +Warning 1264 Out of range value for column 't1' at row 1 +Warning 1264 Out of range value for column 't20' at row 1 +Warning 1264 Out of range value for column 's' at row 1 +Warning 1264 Out of range value for column 's0' at row 1 +Warning 1264 Out of range value for column 's1' at row 1 +Warning 1264 Out of range value for column 's20' at row 1 +Warning 1264 Out of range value for column 'm' at row 1 +Warning 1264 Out of range value for column 'm0' at row 1 +Warning 1264 Out of range value for column 'm1' at row 1 +Warning 1264 Out of range value for column 'm20' at row 1 +Warning 1264 Out of range value for column 'b' at row 1 +Warning 1264 Out of range value for column 'b0' at row 1 +Warning 1264 Out of range value for column 'b1' at row 1 +Warning 1264 Out of range value for column 'b20' at row 1 +INSERT INTO t1 SELECT b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b FROM t1 WHERE b IN (-9223372036854775808,9223372036854775807,18446744073709551615); +Warnings: +Warning 1264 Out of range value for column 'i' at row 1 +Warning 1264 Out of range value for column 'i0' at row 1 +Warning 1264 Out of range value for column 'i1' at row 1 +Warning 1264 Out of range value for column 'i20' at row 1 +Warning 1264 Out of range value for column 't' at row 1 +Warning 1264 Out of range value for column 't0' at row 1 +Warning 1264 Out of range value for column 't1' at row 1 +Warning 1264 Out of range value for column 't20' at row 1 +Warning 1264 Out of range value for column 's' at row 1 +Warning 1264 Out of range value for column 's0' at row 1 +Warning 1264 Out of range value for column 's1' at row 1 +Warning 1264 Out of range value for column 's20' at row 1 +Warning 1264 Out of range value for column 'm' at row 1 +Warning 1264 Out of range value for column 'm0' at row 1 +Warning 1264 Out of range value for column 'm1' at row 1 +Warning 1264 Out of range value for column 'm20' at row 1 +Warning 1264 Out of range value for column 'i' at row 2 +Warning 1264 Out of range value for column 'i0' at row 2 +Warning 1264 Out of range value for column 'i1' at row 2 +Warning 1264 Out of range value for column 'i20' at row 2 +Warning 1264 Out of range value for column 't' at row 2 +Warning 1264 Out of range value for column 't0' at row 2 +Warning 1264 Out of range value for column 't1' at row 2 +Warning 1264 Out of range value for column 't20' at row 2 +Warning 1264 Out of range value for column 's' at row 2 +Warning 1264 Out of range value for column 's0' at row 2 +Warning 1264 Out of range value for column 's1' at row 2 +Warning 1264 Out of range value for column 's20' at row 2 +Warning 1264 Out of range value for column 'm' at row 2 +Warning 1264 Out of range value for column 'm0' at row 2 +Warning 1264 Out of range value for column 'm1' at row 2 +Warning 1264 Out of range value for column 'm20' at row 2 +Warning 1264 Out of range value for column 'i' at row 3 +Warning 1264 Out of range value for column 'i0' at row 3 +Warning 1264 Out of range value for column 'i1' at row 3 +Warning 1264 Out of range value for column 'i20' at row 3 +Warning 1264 Out of range value for column 't' at row 3 +Warning 1264 Out of range value for column 't0' at row 3 +Warning 1264 Out of range value for column 't1' at row 3 +Warning 1264 Out of range value for column 't20' at row 3 +Warning 1264 Out of range value for column 's' at row 3 +Warning 1264 Out of range value for column 's0' at row 3 +Warning 1264 Out of range value for column 's1' at row 3 +Warning 1264 Out of range value for column 's20' at row 3 +Warning 1264 Out of range value for column 'm' at row 3 +Warning 1264 Out of range value for column 'm0' at row 3 +Warning 1264 Out of range value for column 'm1' at row 3 +Warning 1264 Out of range value for column 'm20' at row 3 +SELECT * FROM t1; +i i0 i1 i20 t t0 t1 t20 s s0 s1 s20 m m0 m1 m20 b b0 b1 b20 +0000000000 0000000000 0 00000000000000000000 000 000 0 00000000000000000000 00000 00000 0 00000000000000000000 00000000 00000000 0 00000000000000000000 00000000000000000000 00000000000000000000 0 00000000000000000000 +0000000000 0000000000 0 00000000000000000000 000 000 0 00000000000000000000 00000 00000 0 00000000000000000000 00000000 00000000 0 00000000000000000000 00000000000000000000 00000000000000000000 0 00000000000000000000 +0000000000 0000000000 0 00000000000000000000 000 000 0 00000000000000000000 00000 00000 0 00000000000000000000 00000000 00000000 0 00000000000000000000 00000000000000000000 00000000000000000000 0 00000000000000000000 +0000000001 0000000002 3 00000000000000000004 005 006 7 00000000000000000008 00009 00010 11 00000000000000000012 00000013 00000014 15 00000000000000000016 00000000000000000017 00000000000000000018 19 00000000000000000020 +2147483647 2147483647 2147483647 00000000002147483647 127 127 127 00000000000000000127 32767 32767 32767 00000000000000032767 08388607 08388607 8388607 00000000000008388607 09223372036854775807 09223372036854775807 9223372036854775807 09223372036854775807 +4294967295 4294967295 4294967295 00000000004294967295 255 255 255 00000000000000000255 65535 65535 65535 00000000000000065535 16777215 16777215 16777215 00000000000016777215 09223372036854775807 09223372036854775807 9223372036854775807 09223372036854775807 +4294967295 4294967295 4294967295 00000000004294967295 255 255 255 00000000000000000255 65535 65535 65535 00000000000000065535 16777215 16777215 16777215 00000000000016777215 18446744073709551615 18446744073709551615 18446744073709551615 18446744073709551615 +4294967295 4294967295 4294967295 00000000004294967295 255 255 255 00000000000000000255 65535 65535 65535 00000000000000065535 16777215 16777215 16777215 00000000000016777215 18446744073709551615 18446744073709551615 18446744073709551615 18446744073709551615 +4294967295 4294967295 4294967295 00000000004294967295 255 255 255 00000000000000000255 65535 65535 65535 00000000000000065535 16777215 16777215 16777215 00000000000016777215 18446744073709551615 18446744073709551615 18446744073709551615 18446744073709551615 +4294967295 4294967295 4294967295 00000000004294967295 255 255 255 00000000000000000255 65535 65535 65535 00000000000000065535 16777215 16777215 16777215 00000000000016777215 18446744073709551615 18446744073709551615 18446744073709551615 18446744073709551615 +ALTER TABLE t1 ADD COLUMN i257 INT(257); +ERROR 42000: Display width out of range for 'i257' (max = 255) +DROP TABLE t1; +CREATE TABLE t1 (t TINYINT ZEROFILL <CUSTOM_COL_OPTIONS>, +s SMALLINT ZEROFILL <CUSTOM_COL_OPTIONS>, +m MEDIUMINT ZEROFILL <CUSTOM_COL_OPTIONS>, +i INT ZEROFILL <CUSTOM_COL_OPTIONS>, +b BIGINT ZEROFILL <CUSTOM_COL_OPTIONS> +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +t tinyint(3) unsigned zerofill # # # # +s smallint(5) unsigned zerofill # # # # +m mediumint(8) unsigned zerofill # # # # +i int(10) unsigned zerofill # # # # +b bigint(20) unsigned zerofill # # # # +INSERT INTO t1 (t,s,m,i,b) VALUES (1,10,100,1000,0); +SELECT * FROM t1; +t s m i b +001 00010 00000100 0000001000 00000000000000000000 +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/col_opt_zerofill.test b/mysql-test/suite/storage_engine/col_opt_zerofill.test new file mode 100644 index 00000000000..83b7dcf28c1 --- /dev/null +++ b/mysql-test/suite/storage_engine/col_opt_zerofill.test @@ -0,0 +1,88 @@ +# +# ZEROFILL column attribute +# + +let $extra_type_opts = ZEROFILL; + +--source have_engine.inc + +--echo # +--echo # Fixed point columns (NUMERIC, DECIMAL) +--echo # + +--source type_fixed.inc +let $create_definition = + a DECIMAL $col_opts, + b NUMERIC $col_opts +; +--source create_table.inc +if ($mysql_errname) +{ + --let $functionality = Fixed point types or ZEROFILL columns + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 3 # 4 # 5 # 6 # + SHOW COLUMNS IN t1; + + INSERT INTO t1 (a,b) VALUES (1.1,1234); + SELECT * FROM t1; + DROP TABLE t1; +} + +--echo # +--echo # Floating point columns (FLOAT, DOUBLE) +--echo # + +--source type_float.inc +let $create_definition = + a DOUBLE $col_opts, + b FLOAT $col_opts +; +--source create_table.inc +if ($mysql_errname) +{ + --let $functionality = Floating point types or ZEROFILL columns + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 3 # 4 # 5 # 6 # + SHOW COLUMNS IN t1; + + INSERT INTO t1 (a,b) VALUES (1,1234.5); + SELECT * FROM t1; + DROP TABLE t1; +} + +--echo # +--echo # INT columns +--echo # + +--source type_int.inc +let $create_definition = + t TINYINT $col_opts, + s SMALLINT $col_opts, + m MEDIUMINT $col_opts, + i INT $col_opts, + b BIGINT $col_opts +; +--source create_table.inc +if ($mysql_errname) +{ + --let $functionality = INT types or UNSIGNED columns + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 3 # 4 # 5 # 6 # + SHOW COLUMNS IN t1; + + INSERT INTO t1 (t,s,m,i,b) VALUES (1,10,100,1000,0); + SELECT * FROM t1; + DROP TABLE t1; +} + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/create_table.inc b/mysql-test/suite/storage_engine/create_table.inc new file mode 100644 index 00000000000..9a1cba5100a --- /dev/null +++ b/mysql-test/suite/storage_engine/create_table.inc @@ -0,0 +1,174 @@ +################################## +# +# This include file will be used for all CREATE TABLE statements in the suite. +# If you need to add additional steps or change the logic, copy the file +# to storage/<engine>/mysql-test/storage_engine/ folder and modify it there. +# +################## +# +# Parameters: +# +# --let $create_definition = <column names, types, indexes) # optional, default a $int_col, b $char_col (based on defaults) +# --let $table_name = <table name> # optional, default t1 +# --let $table_options = <table options> # optional, default based on define_engine.inc +# --let $partition_options = <partitioning definition> # optional, default none +# --let $as_select = <SELECT statement> # optional, default empty +# --let $error_codes = <expected error codes, as in --error> # optional, default 0 +# --let $if_not_exists = [0|1] # optional, default 0 (1 adds IF NOT EXISTS clause) +# --let $default_engine = [0|1] # optional, default 0 (with 1 will rely on default engine, no ENGINE=) +# --let $temporary = [0|1] # optional, default 0 (1 adds TEMPORARY) +# --let $disable_query_log = [0|1] # optional, default 0 (1 disables logging of CREATE) +# +# Usage examples: +# +# --source create_table.inc -- creates a default table +# +# --let $create_definition = a INT NOT NULL, b CHAR(1) PRIMARY KEY, INDEX(a) +# --let $table_options = AUTO_INCREMENT = 100 +# --let $partition_options = PARTITION BY HASH(a) PARTITIONS 2 +# --let $as_select = SELECT 1, 'a' +# --source create_table.inc +# +# Additionally, a test can define $extra_tbl_options. The difference with $table_options +# is that its value is persistent and will be used until it is unset explicitly, or +# until the test ends. The purpose of it is to allow one test to call another test, +# when the called test does not know about specific options the calling test might require, +# and thus cannot set them on per-create basis. + +--let $create_statement = CREATE + +if ($temporary) +{ + --let $create_statement = $create_statement TEMPORARY +} + +--let $create_statement = $create_statement TABLE + +if ($if_not_exists) +{ + --let $create_statement = $create_statement IF NOT EXISTS +} + +if (!$table_name) +{ + --let $table_name = t1 +} + +--let $create_statement = $create_statement $table_name + +if (!$create_definition) +{ + # If $create_definition is not defined, and AS SELECT is requested, + # we should not set $create_definition to the default value, + # because it might be inconsistent with the SELECT. + if (!$as_select) + { + --let $create_definition = a $int_col, b $char_col + } +} + +if ($create_definition) +{ + --let $create_statement = $create_statement ($create_definition) +} + +# If $default_engine is set, we will rely on the default storage engine + +if (!$default_engine) +{ + --let $create_statement = $create_statement ENGINE=$storage_engine +} + +# Default table options from define_engine.inc +--let $create_statement = $create_statement $default_tbl_opts + +# The calling script could request additional table options +if ($table_options) +{ + --let $create_statement = $create_statement $table_options +} + +# The difference between $extra_tbl_opts and $table_options +# is that its $extra_tbl_opts is persistent -- it will not be unset at the end of this file, +# and will be used until it is unset explicitly by the calling test, +# or until the test ends. The purpose of it is to allow one test to call another test, +# when the called test does not know about specific options the calling test might require, +# and thus cannot set them on per-create basis. + +if ($extra_tbl_opts) +{ + --let $create_statement = $create_statement $extra_tbl_opts +} + +if ($as_select) +{ + --let $create_statement = $create_statement AS $as_select +} + +if ($partition_options) +{ + --let $create_statement = $create_statement $partition_options +} + +# We now have the complete CREATE statement in $create_statement. +# If your CREATE statement should be composed differently, +# modify the logic above. + +##################### +# Here you can add logic needed BEFORE the main table creation +# (e.g. the table needs a base table, a reference table, etc.). +# Surround it by --disable_query_log/--enable_query_log +# if you don't want it to appear in the result output. +##################### + +if ($disable_query_log) +{ + --disable_query_log +} + +--source obfuscate.inc + +eval $create_statement; +--source strict_check_errors.inc + +# Make sure you don't add any statements between the main CREATE (above) +# and saving mysql_errno and mysql_errname (below) +# They are saved in case you want to add more logic after the main CREATE, +# because we need the result code of the table creation. +# Also, do not change $create_statement after it is executed! + +--let $my_errno = $mysql_errno +--let $my_errname = $mysql_errname + + +if ($disable_query_log) +{ + --enable_query_log +} + +##################### +# Here you can add logic needed AFTER the main table creation, +# e.g. triggers creation. +# Surround it by --disable_query_log/--enable_query_log +# if you don't want it to appear in the result output. +##################### + + +# Unset the parameters, we don't want them to be accidentally reused later +--let $create_definition = +--let $table_name = t1 +--let $table_options = +--let $partition_options = +--let $as_select = 0 +--let $error_codes = +--let $if_not_exists = 0 +--let $default_engine = 0 +--let $temporary = 0 +--let $disable_query_log = 0 + +# Restore the error codes of the main statement +--let $mysql_errno = $my_errno +--let $mysql_errname = $my_errname +# Make sure you don't add any SQL statements after restoring +# mysql_errno and mysql_errname (above) + diff --git a/mysql-test/suite/storage_engine/create_table.result b/mysql-test/suite/storage_engine/create_table.result new file mode 100644 index 00000000000..87bf37046ba --- /dev/null +++ b/mysql-test/suite/storage_engine/create_table.result @@ -0,0 +1,45 @@ +DROP TABLE IF EXISTS t1,t2; +CREATE TABLE t1 (a <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +CREATE TABLE IF NOT EXISTS t1 (a <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +Warnings: +Note 1050 Table 't1' already exists +CREATE TABLE t2 LIKE t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +CREATE TEMPORARY TABLE t2 LIKE t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TEMPORARY TABLE `t2` ( + `a` int(11) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +DROP TEMPORARY TABLE t2; +DROP TABLE t2; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> AS SELECT 1 UNION SELECT 2; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `1` bigint(20) NOT NULL DEFAULT '0' +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +SELECT * FROM t1; +1 +1 +2 +DROP TABLE t1; +SET storage_engine = <STORAGE_ENGINE>; +CREATE TABLE t1 (a <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +FLUSH LOGS; +DROP TABLE IF EXISTS t1; diff --git a/mysql-test/suite/storage_engine/create_table.test b/mysql-test/suite/storage_engine/create_table.test new file mode 100644 index 00000000000..2f8971d8b27 --- /dev/null +++ b/mysql-test/suite/storage_engine/create_table.test @@ -0,0 +1,107 @@ +# +# Basic CREATE TABLE statements +# + +--source have_engine.inc + +--disable_warnings +DROP TABLE IF EXISTS t1,t2; +--enable_warnings + +# Simple create table with minimal table options +# which are defined in have_engine.inc +# (default empty) plus ENGINE= + +--let $create_definition = a $int_col +--source create_table.inc +if ($mysql_errname) +{ + --let $functionality = CREATE TABLE + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --source mask_engine.inc + SHOW CREATE TABLE t1; + + # IF NOT EXISTS + --let $if_not_exists = 1 + --let $create_definition = a $int_col + --source create_table.inc +} + +# CREATE .. LIKE + +CREATE TABLE t2 LIKE t1; +if ($mysql_errname) +{ + --let $functionality = CREATE TABLE .. LIKE + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --source mask_engine.inc + SHOW CREATE TABLE t2; + + eval + CREATE TEMPORARY TABLE t2 LIKE t1; + if ($mysql_errname) + { + --let $functionality = Temporary tables + --source unexpected_result.inc + } + if (!$mysql_errname) + { + --source mask_engine.inc + SHOW CREATE TABLE t2; + + DROP TEMPORARY TABLE t2; + } + DROP TABLE t2; +} +DROP TABLE IF EXISTS t1; + +# CREATE .. AS SELECT + +--let $as_select = SELECT 1 UNION SELECT 2 +--source create_table.inc +if ($mysql_errname) +{ + --let $functionality = CREATE TABLE .. AS SELECT + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --source mask_engine.inc + SHOW CREATE TABLE t1; + --sorted_result + SELECT * FROM t1; + DROP TABLE t1; +} + +# Use the engine as default + +--source mask_engine.inc +eval SET storage_engine = $storage_engine; + +--let $tbl_opts = $default_tbl_opts +--let $create_definition = a $int_col +--source create_table.inc +if ($mysql_errname) +{ + --let $functionality = CREATE TABLE or using the engine as default + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --source mask_engine.inc + SHOW CREATE TABLE t1; +} + +# Just to add FLUSH LOGS into the mix while we are in the most common test +FLUSH LOGS; + +DROP TABLE IF EXISTS t1; + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/define_engine.inc b/mysql-test/suite/storage_engine/define_engine.inc new file mode 100644 index 00000000000..33d1fc5c8bf --- /dev/null +++ b/mysql-test/suite/storage_engine/define_engine.inc @@ -0,0 +1,45 @@ +########################################### +# +# This is a template of the include file define_engine.inc which +# should be placed in storage/<engine>/mysql-test/storage_engine folder. +# +################################ +# +# The name of the engine under test must be defined in $ENGINE variable. +# You can set it either here (uncomment and edit) or in your environment. +# +# let $ENGINE =; +# +################################ +# +# The following three variables define specific options for columns and tables. +# Normally there should be none needed, but for some engines it can be different. +# If the engine requires specific column option for all or indexed columns, +# set them inside the comment, e.g. /*!NOT NULL*/. +# Do the same for table options if needed, e.g. /*!INSERT_METHOD=LAST*/ + +let $default_col_opts = /*!*/; +let $default_col_indexed_opts = /*!*/; +let $default_tbl_opts = /*!*/; + +# INDEX, UNIQUE INDEX, PRIMARY KEY, special index type - choose the fist that the engine allows, +# or set it to /*!*/ if none is supported + +let $default_index = /*!INDEX*/; + +# If the engine does not support the following types, replace them with the closest possible + +let $default_int_type = INT(11); +let $default_char_type = CHAR(8); + +################################ + +--disable_query_log +--disable_result_log + +# Here you can place your custom MTR code which needs to be executed before each test, +# e.g. creation of an additional schema or table, etc. +# The cleanup part should be defined in cleanup_engine.inc + +--enable_query_log +--enable_result_log diff --git a/mysql-test/suite/storage_engine/delete.result b/mysql-test/suite/storage_engine/delete.result new file mode 100644 index 00000000000..1d84516c86a --- /dev/null +++ b/mysql-test/suite/storage_engine/delete.result @@ -0,0 +1,77 @@ +DROP TABLE IF EXISTS t1,t2; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (10000,'foobar'),(1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'); +INSERT INTO t1 (a,b) SELECT a, b FROM t1; +DELETE FROM t1 WHERE b IN ('c'); +SELECT * FROM t1; +a b +1 a +1 a +10000 foobar +10000 foobar +2 b +2 b +4 d +4 d +5 e +5 e +DELETE FROM t1 WHERE a < 0 OR b = 'a'; +SELECT * FROM t1; +a b +10000 foobar +10000 foobar +2 b +2 b +4 d +4 d +5 e +5 e +DELETE FROM t1 WHERE a <= 4 ORDER BY b DESC LIMIT 1; +SELECT * FROM t1; +a b +10000 foobar +10000 foobar +2 b +2 b +4 d +5 e +5 e +CREATE TABLE t2 (c <CHAR_COLUMN>, d <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t2 (c,d) SELECT b, a FROM t1; +SELECT * FROM t2; +c d +b 2 +b 2 +d 4 +e 5 +e 5 +foobar 10000 +foobar 10000 +DELETE t2.* FROM t1, t2 WHERE c < b AND a + d != 1; +SELECT * FROM t1; +a b +10000 foobar +10000 foobar +2 b +2 b +4 d +5 e +5 e +SELECT * FROM t2; +c d +foobar 10000 +foobar 10000 +DELETE FROM t2, t1.* USING t2, t1 WHERE c = 'foobar' and b = c; +SELECT * FROM t1; +a b +2 b +2 b +4 d +5 e +5 e +SELECT * FROM t2; +c d +DELETE FROM t1; +SELECT * FROM t1; +a b +DROP TABLE t1, t2; diff --git a/mysql-test/suite/storage_engine/delete.test b/mysql-test/suite/storage_engine/delete.test new file mode 100644 index 00000000000..802093e2977 --- /dev/null +++ b/mysql-test/suite/storage_engine/delete.test @@ -0,0 +1,68 @@ +# +# Basic DELETE statements. +# DELETE LOW_PRIORITY is covered in delete_low_prio test +# DELETE QUICK is covered in delete_quick test (syntax only) +# DELETE IGNORE is covered in delete_ignore test +# + +--source have_engine.inc + +--disable_warnings +DROP TABLE IF EXISTS t1,t2; +--enable_warnings + +--let $create_definition = a $int_col, b $char_col +--source create_table.inc +INSERT INTO t1 (a,b) VALUES (10000,'foobar'),(1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'); +INSERT INTO t1 (a,b) SELECT a, b FROM t1; + +# Single-table DELETE + +DELETE FROM t1 WHERE b IN ('c'); +if ($mysql_errname) +{ + --let $functionality = DELETE FROM + --source unexpected_result.inc +} +--sorted_result +SELECT * FROM t1; + +DELETE FROM t1 WHERE a < 0 OR b = 'a'; +--sorted_result +SELECT * FROM t1; + +# ORDER BY and LIMIT +DELETE FROM t1 WHERE a <= 4 ORDER BY b DESC LIMIT 1; +--sorted_result +SELECT * FROM t1; + +# Multi-table DELETE + +--let $create_definition = c $char_col, d $int_col +--let $table_name = t2 +--source create_table.inc +INSERT INTO t2 (c,d) SELECT b, a FROM t1; +--sorted_result +SELECT * FROM t2; + +DELETE t2.* FROM t1, t2 WHERE c < b AND a + d != 1; +--sorted_result +SELECT * FROM t1; +--sorted_result +SELECT * FROM t2; + +DELETE FROM t2, t1.* USING t2, t1 WHERE c = 'foobar' and b = c; +--sorted_result +SELECT * FROM t1; +--sorted_result +SELECT * FROM t2; + +DELETE FROM t1; +--sorted_result +SELECT * FROM t1; + +# Cleanup +DROP TABLE t1, t2; + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/delete_ignore.result b/mysql-test/suite/storage_engine/delete_ignore.result new file mode 100644 index 00000000000..a15c338ea04 --- /dev/null +++ b/mysql-test/suite/storage_engine/delete_ignore.result @@ -0,0 +1,59 @@ +DROP TABLE IF EXISTS t1,t2; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (10000,'foobar'),(1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'); +INSERT INTO t1 (a,b) SELECT a, b FROM t1; +CREATE TABLE t2 (c <CHAR_COLUMN>, d <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t2 (c,d) SELECT b, a FROM t1; +SELECT * FROM t1; +a b +1 a +1 a +10000 foobar +10000 foobar +2 b +2 b +3 c +3 c +4 d +4 d +5 e +5 e +SELECT * FROM t2; +c d +a 1 +a 1 +b 2 +b 2 +c 3 +c 3 +d 4 +d 4 +e 5 +e 5 +foobar 10000 +foobar 10000 +DELETE IGNORE FROM t1 WHERE b IS NOT NULL ORDER BY a LIMIT 1; +SELECT * FROM t1; +a b +1 a +10000 foobar +10000 foobar +2 b +2 b +3 c +3 c +4 d +4 d +5 e +5 e +DELETE IGNORE t1.*, t2.* FROM t1, t2 WHERE c < b OR a != ( SELECT 1 UNION SELECT 2 ); +Warnings: +Warning 1242 Subquery returns more than 1 row +SELECT * FROM t1; +a b +1 a +SELECT * FROM t2; +c d +foobar 10000 +foobar 10000 +DROP TABLE t1, t2; diff --git a/mysql-test/suite/storage_engine/delete_ignore.test b/mysql-test/suite/storage_engine/delete_ignore.test new file mode 100644 index 00000000000..fa98ec92029 --- /dev/null +++ b/mysql-test/suite/storage_engine/delete_ignore.test @@ -0,0 +1,44 @@ +# +# DELETE IGNORE +# + +--source have_engine.inc + +--disable_warnings +DROP TABLE IF EXISTS t1,t2; +--enable_warnings + +--let $create_definition = a $int_col, b $char_col +--source create_table.inc +INSERT INTO t1 (a,b) VALUES (10000,'foobar'),(1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'); +INSERT INTO t1 (a,b) SELECT a, b FROM t1; + +--let $create_definition = c $char_col, d $int_col +--let $table_name = t2 +--source create_table.inc +INSERT INTO t2 (c,d) SELECT b, a FROM t1; +--sorted_result +SELECT * FROM t1; +--sorted_result +SELECT * FROM t2; + +DELETE IGNORE FROM t1 WHERE b IS NOT NULL ORDER BY a LIMIT 1; +if ($mysql_errname) +{ + --let $functionality = DELETE IGNORE FROM .. + --source unexpected_result.inc +} +--sorted_result +SELECT * FROM t1; + +DELETE IGNORE t1.*, t2.* FROM t1, t2 WHERE c < b OR a != ( SELECT 1 UNION SELECT 2 ); +--sorted_result +SELECT * FROM t1; +--sorted_result +SELECT * FROM t2; + +# Cleanup +DROP TABLE t1, t2; + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/delete_low_prio.result b/mysql-test/suite/storage_engine/delete_low_prio.result new file mode 100644 index 00000000000..be334612a2b --- /dev/null +++ b/mysql-test/suite/storage_engine/delete_low_prio.result @@ -0,0 +1,59 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (1,'f'),(2,'b'); +SET LOW_PRIORITY_UPDATES = 0; +SET lock_wait_timeout = 4; +connect con1,localhost,root,,; +SET lock_wait_timeout = 2; +SELECT SLEEP(1) FROM t1; +connection default; +DELETE FROM t1; +connect con2,localhost,root,,; +SET lock_wait_timeout = 3; +SELECT SLEEP(1) FROM t1; +SLEEP(1) +connection con1; +SLEEP(1) +0 +0 +connection default; +SELECT * FROM t1; +a b +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); +connection con1; +SELECT SLEEP(1) FROM t1; +connection default; +DELETE LOW_PRIORITY FROM t1; +connection con2; +SELECT SLEEP(1) FROM t1; +SLEEP(1) +0 +0 +connection con1; +SLEEP(1) +0 +0 +connection default; +SELECT * FROM t1; +a b +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); +SET LOW_PRIORITY_UPDATES = 1; +connection con1; +SELECT SLEEP(1) FROM t1; +connection default; +DELETE FROM t1; +connection con2; +SELECT SLEEP(1) FROM t1; +SLEEP(1) +0 +0 +connection con1; +SLEEP(1) +0 +0 +connection default; +SELECT * FROM t1; +a b +disconnect con1; +disconnect con2; +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/delete_low_prio.test b/mysql-test/suite/storage_engine/delete_low_prio.test new file mode 100644 index 00000000000..34677df5373 --- /dev/null +++ b/mysql-test/suite/storage_engine/delete_low_prio.test @@ -0,0 +1,162 @@ +# +# DELETE LOW_PRIORITY +# +--source have_engine.inc + +--source include/count_sessions.inc + +--enable_connect_log + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +--let $create_definiiton = a $int_col, b $char_col +--source create_table.inc +INSERT INTO t1 (a,b) VALUES (1,'f'),(2,'b'); + +# We will have 3 connections: +# con1 will start SELECT which should give us enough time; +# default will run DELETE +# con2 will then start another SELECT. +# With LOW_PRIORITY_UPDATES = 0, +# with standard DELETE we should see all rows in con1 resultset, +# but no rows in con2 resultset. +# With DELETE LOW_PRIORITY we should see all rows in both resultsets. +# Then we will set LOW_PRIORITY_UPDATES to 1. +# Then with standard DELETE we should see all rows in both resultsets. + +SET LOW_PRIORITY_UPDATES = 0; +SET lock_wait_timeout = 4; + +# Normal DELETE with low_priority_updates=0 + +--connect (con1,localhost,root,,) +SET lock_wait_timeout = 2; +--send +SELECT SLEEP(1) FROM t1; + +--connection default +let $show_statement = SHOW PROCESSLIST; +let $field = State; +let $condition = = 'User sleep'; +# We don't need to wait long, +# if the feature works, threads +# should show up in the processlist right away +let $wait_timeout = 2; +--source include/wait_show_condition.inc + +--send +DELETE FROM t1; + +--connect (con2,localhost,root,,) +SET lock_wait_timeout = 3; + +let $field = Info; +let $condition = = 'DELETE FROM t1'; +let $wait_timeout = 2; +--source include/wait_show_condition.inc +if (!$found) +{ + --let $mysql_errname = timeout in wait_show_condition.inc + --let $functionality = DELETE or table locking + --source unexpected_result.inc +} +if ($found) +{ + SELECT SLEEP(1) FROM t1; +} + +--connection con1 +--reap + +--connection default +--reap +--sorted_result +SELECT * FROM t1; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); + + +# DELETE LOW_PRIORITY + +--connection con1 +--send +SELECT SLEEP(1) FROM t1; + +--connection default +let $field = State; +let $condition = = 'User sleep'; +let $wait_timeout = 2; +--source include/wait_show_condition.inc +--send +DELETE LOW_PRIORITY FROM t1; + +--connection con2 +let $field = Info; +let $condition = = 'DELETE LOW_PRIORITY FROM t1'; +let $wait_timeout = 2; +--source include/wait_show_condition.inc +if (!$found) +{ + --let $mysql_errname = timeout in wait_show_condition.inc + --let $functionality = DELETE LOW_PRIORITY or table locking + --source unexpected_result.inc +} +if ($found) +{ + SELECT SLEEP(1) FROM t1; +} + +--connection con1 +--reap + +--connection default +--reap +--sorted_result +SELECT * FROM t1; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); + +SET LOW_PRIORITY_UPDATES = 1; + +# Normal DELETE with low_priority_updates=1 + +--connection con1 +--send +SELECT SLEEP(1) FROM t1; + +--connection default +let $field = State; +let $condition = = 'User sleep'; +let $wait_timeout = 2; +--source include/wait_show_condition.inc +--send +DELETE FROM t1; + +--connection con2 +let $field = Info; +let $condition = = 'DELETE FROM t1'; +let $wait_timeout = 2; +--source include/wait_show_condition.inc +if ($found) +{ + SELECT SLEEP(1) FROM t1; +} + +--connection con1 +--reap + +--connection default +--reap +--sorted_result +SELECT * FROM t1; + +--disconnect con1 +--disconnect con2 + +# Cleanup +DROP TABLE t1; + +--source include/wait_until_count_sessions.inc + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/delete_quick.result b/mysql-test/suite/storage_engine/delete_quick.result new file mode 100644 index 00000000000..30d4841b51f --- /dev/null +++ b/mysql-test/suite/storage_engine/delete_quick.result @@ -0,0 +1,25 @@ +DROP TABLE IF EXISTS t1,t2; +CREATE TABLE t1 (a <INT_COLUMN>, <CUSTOM_INDEX> (a), b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'); +DELETE QUICK FROM t1 WHERE a = 1 OR b > 'foo'; +SELECT * FROM t1; +a b +2 b +3 c +4 d +5 e +CREATE TABLE t2 (c <CHAR_COLUMN>, d <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t2 SELECT b, a FROM t1; +SELECT * FROM t2; +c d +b 2 +c 3 +d 4 +e 5 +DELETE QUICK FROM t2, t1.* USING t2, t1 WHERE c IS NULL OR a = d; +SELECT * FROM t1; +a b +SELECT * FROM t2; +c d +DROP TABLE t2; +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/delete_quick.test b/mysql-test/suite/storage_engine/delete_quick.test new file mode 100644 index 00000000000..3b37096de4f --- /dev/null +++ b/mysql-test/suite/storage_engine/delete_quick.test @@ -0,0 +1,55 @@ +# +# DELETE QUICK syntax. +# For now we only check that the keyword is accepted, +# without actually checking whether the feature works. +# + +--source have_engine.inc +--source have_default_index.inc + +--disable_warnings +DROP TABLE IF EXISTS t1,t2; +--enable_warnings + +--let $create_definition = a $int_indexed_col, $default_index (a), b $char_col +--source create_table.inc +if ($mysql_errname) +{ + --source unexpected_result.inc +} +if (!$mysql_errname) + { + INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'); + + DELETE QUICK FROM t1 WHERE a = 1 OR b > 'foo'; + if ($mysql_errname) + { + --let $functionality = DELETE or DELETE QUICK + --source unexpected_result.inc + } + if (!$mysql_errname) + { + --sorted_result + SELECT * FROM t1; + + --let $create_definition = c $char_col, d $int_col + --let $table_name = t2 + --source create_table.inc + INSERT INTO t2 SELECT b, a FROM t1; + --sorted_result + SELECT * FROM t2; + + DELETE QUICK FROM t2, t1.* USING t2, t1 WHERE c IS NULL OR a = d; + --sorted_result + SELECT * FROM t1; + --sorted_result + SELECT * FROM t2; + DROP TABLE t2; + } + DROP TABLE t1; +} + +# Cleanup + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/delete_with_keys.result b/mysql-test/suite/storage_engine/delete_with_keys.result new file mode 100644 index 00000000000..6622cc1fb64 --- /dev/null +++ b/mysql-test/suite/storage_engine/delete_with_keys.result @@ -0,0 +1,38 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>, <CUSTOM_INDEX> (b)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(6,'x'),(7,'y'),(8,'z'); +DELETE FROM t1 WHERE b > 'y'; +DELETE FROM t1 WHERE a=2; +SELECT * FROM t1; +a b +1 a +3 c +4 d +5 e +6 x +7 y +DELETE FROM t1; +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN> PRIMARY KEY, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(6,'x'),(7,'y'),(8,'z'); +DELETE FROM t1 WHERE b > 'y'; +DELETE FROM t1 WHERE a=2; +SELECT * FROM t1; +a b +1 a +3 c +4 d +5 e +6 x +7 y +DELETE FROM t1; +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <INT_COLUMN>, c <INT_COLUMN>, <CUSTOM_INDEX>(a), <CUSTOM_INDEX>(b)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b,c) VALUES (1,2,3),(4,5,6),(7,8,9); +DELETE FROM t1 WHERE a = 10 OR b = 20 ORDER BY c LIMIT 1; +SELECT * FROM t1; +a b c +1 2 3 +4 5 6 +7 8 9 +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/delete_with_keys.test b/mysql-test/suite/storage_engine/delete_with_keys.test new file mode 100644 index 00000000000..274801b6d0e --- /dev/null +++ b/mysql-test/suite/storage_engine/delete_with_keys.test @@ -0,0 +1,74 @@ +# +# DELETE statements for tables with keys +# +--source have_engine.inc +--source have_default_index.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +--let $create_definition = a $int_col, b $char_indexed_col, $default_index (b) +--source create_table.inc +if ($mysql_errname) +{ + --let $functionality = Index on a CHAR column + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(6,'x'),(7,'y'),(8,'z'); + DELETE FROM t1 WHERE b > 'y'; + if ($mysql_errname) + { + --let $functionality = DELETE + --source unexpected_result.inc + } + if (!$mysql_errname) + { + DELETE FROM t1 WHERE a=2; + + --sorted_result + SELECT * FROM t1; + DELETE FROM t1; + } + DROP TABLE t1; +} + +--let $create_definition = a $int_indexed_col PRIMARY KEY, b $char_col +--source create_table.inc +if ($mysql_errname) +{ + --let $functionality = PRIMARY KEY + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(6,'x'),(7,'y'),(8,'z'); + DELETE FROM t1 WHERE b > 'y'; + DELETE FROM t1 WHERE a=2; + + --sorted_result + SELECT * FROM t1; + DELETE FROM t1; + DROP TABLE t1; +} + +--let $create_definition = a $int_indexed_col, b $int_col, c $int_indexed_col, $default_index(a), $default_index(b) +--source create_table.inc +if ($mysql_errname) +{ + --let $functionality = Multiple indexes + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + INSERT INTO t1 (a,b,c) VALUES (1,2,3),(4,5,6),(7,8,9); + DELETE FROM t1 WHERE a = 10 OR b = 20 ORDER BY c LIMIT 1; + --sorted_result + SELECT * FROM t1; + DROP TABLE t1; +} + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/describe.result b/mysql-test/suite/storage_engine/describe.result new file mode 100644 index 00000000000..61c3d6bafd1 --- /dev/null +++ b/mysql-test/suite/storage_engine/describe.result @@ -0,0 +1,18 @@ +DROP TABLE IF EXISTS t1, t2, t3; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> CHARACTER SET utf8; +INSERT INTO t1 (a,b) VALUES (100,'foo'),(2, 'b'); +CREATE TABLE t2 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> CHARACTER SET utf8; +INSERT INTO t2 (a,b) VALUES (1, 'bar'); +CREATE TABLE t3 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> CHARACTER SET utf8; +DESCRIBE t1; +Field Type Null Key Default Extra +a int(11) YES NULL +b char(8) YES NULL +DESC t2 a; +Field Type Null Key Default Extra +a int(11) YES NULL +DESCRIBE t3 '%'; +Field Type Null Key Default Extra +a int(11) YES NULL +b char(8) YES NULL +DROP TABLE t1, t2, t3; diff --git a/mysql-test/suite/storage_engine/describe.test b/mysql-test/suite/storage_engine/describe.test new file mode 100644 index 00000000000..9f792469e83 --- /dev/null +++ b/mysql-test/suite/storage_engine/describe.test @@ -0,0 +1,50 @@ +# +# DESCRIBE statement +# +# Note: the output might well be different +# (depending on default values for the engine). +# Examine mismatch carefully and, if columns are shown +# with correct options, add an rdiff. +# If you create combinations (with different startup options), +# you might have to add an rdiff for each of them. +# + +--source have_engine.inc + +--disable_warnings +DROP TABLE IF EXISTS t1, t2, t3; +--enable_warnings + +--let $create_definition = a $int_col, b $char_col +--let $table_options = CHARACTER SET utf8 +--source create_table.inc +if ($mysql_errname) +{ + --let $functionality = CHARACTER SET + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + INSERT INTO t1 (a,b) VALUES (100,'foo'),(2, 'b'); + + --let $create_definition = a $int_col, b $char_col + --let $table_options = CHARACTER SET utf8 + --let $table_name = t2 + --source create_table.inc + + INSERT INTO t2 (a,b) VALUES (1, 'bar'); + + --let $create_definition = a $int_col, b $char_col + --let $table_name = t3 + --let $table_options = CHARACTER SET utf8 + --source create_table.inc + + DESCRIBE t1; + DESC t2 a; + DESCRIBE t3 '%'; + + DROP TABLE t1, t2, t3; +} + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/disabled.def b/mysql-test/suite/storage_engine/disabled.def new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/mysql-test/suite/storage_engine/disabled.def diff --git a/mysql-test/suite/storage_engine/foreign_keys.result b/mysql-test/suite/storage_engine/foreign_keys.result new file mode 100644 index 00000000000..5374e78d9b1 --- /dev/null +++ b/mysql-test/suite/storage_engine/foreign_keys.result @@ -0,0 +1,71 @@ +DROP TABLE IF EXISTS t1, t2; +CREATE TABLE t1 (a <INT_COLUMN>, +b <CHAR_COLUMN>, +<CUSTOM_INDEX> (a) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE t2 (a <INT_COLUMN>, +b <CHAR_COLUMN>, +FOREIGN KEY (a) REFERENCES t1(a) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` char(8) DEFAULT NULL, + KEY `a` (`a`), + CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`a`) REFERENCES `t1` (`a`) +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +INSERT INTO t2 (a,b) VALUES (1,'a'),(2,'b'); +ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`a`) REFERENCES `t1` (`a`)) +INSERT INTO t1 (a,b) VALUES (1,'c'),(2,'d'); +INSERT INTO t2 (a,b) VALUES (1,'a'),(2,'b'); +UPDATE t2 SET a=a+1; +ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`a`) REFERENCES `t1` (`a`)) +UPDATE t1 SET a=3 WHERE a=2; +ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`a`) REFERENCES `t1` (`a`)) +DELETE FROM t1 WHERE a=2; +ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`a`) REFERENCES `t1` (`a`)) +DELETE FROM t2 WHERE a=2; +SELECT * FROM t1; +a b +1 c +2 d +SELECT * FROM t2; +a b +1 a +DROP TABLE t1; +ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails +DROP TABLE t2; +CREATE TABLE t2 (a <INT_COLUMN>, +b <CHAR_COLUMN>, +FOREIGN KEY (a) REFERENCES t1(a) +ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` char(8) DEFAULT NULL, + KEY `a` (`a`), + CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`a`) REFERENCES `t1` (`a`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +INSERT INTO t2 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'); +ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`a`) REFERENCES `t1` (`a`) ON DELETE CASCADE ON UPDATE CASCADE) +INSERT INTO t1 (a,b) VALUES (3,'a'),(4,'a'); +INSERT INTO t2 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(4,'e'),(3,'a'); +UPDATE t1 SET a=a+1; +SELECT * FROM t2; +a b +5 a +5 a +5 b +5 c +5 d +5 e +DELETE FROM t1 WHERE b='a' LIMIT 2; +SELECT * FROM t2; +a b +TRUNCATE TABLE t1; +ERROR 42000: Cannot truncate a table referenced in a foreign key constraint (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`a`) REFERENCES `test`.`t1` (`a`)) +DROP TABLE t2; +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/foreign_keys.test b/mysql-test/suite/storage_engine/foreign_keys.test new file mode 100644 index 00000000000..643ca8bf6b1 --- /dev/null +++ b/mysql-test/suite/storage_engine/foreign_keys.test @@ -0,0 +1,148 @@ +# +# Simple foreign keys setup +# + +--source have_engine.inc +--source have_default_index.inc + +--disable_warnings +DROP TABLE IF EXISTS t1, t2; + +let $create_definition = + a $int_indexed_col, + b $char_col, + $default_index (a) +; +--source create_table.inc +if ($mysql_errname) +{ + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + let $create_definition = + a $int_indexed_col, + b $char_col, + FOREIGN KEY (a) REFERENCES t1(a) + ; + --let $table_name = t2 + --source create_table.inc + if ($mysql_errname) + { + --let $functionality = Foreign keys + --source unexpected_result.inc + } + if (!$mysql_errname) + { + --source mask_engine.inc + SHOW CREATE TABLE t2; + + --let $error_codes = ER_NO_REFERENCED_ROW_2 + INSERT INTO t2 (a,b) VALUES (1,'a'),(2,'b'); + --source check_errors.inc + if ($mysql_errname != ER_NO_REFERENCED_ROW_2) + { + --let $functionality = Foreign keys + --source unexpected_result.inc + } + INSERT INTO t1 (a,b) VALUES (1,'c'),(2,'d'); + INSERT INTO t2 (a,b) VALUES (1,'a'),(2,'b'); + + --let $error_codes = ER_NO_REFERENCED_ROW_2 + UPDATE t2 SET a=a+1; + --source check_errors.inc + if ($mysql_errname != ER_NO_REFERENCED_ROW_2) + { + --let $functionality = Foreign keys + --source unexpected_result.inc + } + + --let $error_codes = ER_ROW_IS_REFERENCED_2 + UPDATE t1 SET a=3 WHERE a=2; + --source check_errors.inc + + --let $error_codes = ER_ROW_IS_REFERENCED_2 + DELETE FROM t1 WHERE a=2; + --source check_errors.inc + if ($mysql_errname != ER_ROW_IS_REFERENCED_2) + { + --let $functionality = Foreign keys + --source unexpected_result.inc + } + + DELETE FROM t2 WHERE a=2; + + --sorted_result + SELECT * FROM t1; + SELECT * FROM t2; + + --let $error_codes = ER_ROW_IS_REFERENCED + DROP TABLE t1; + --source check_errors.inc + if ($mysql_errname != ER_ROW_IS_REFERENCED) + { + --let $functionality = Foreign keys + --source unexpected_result.inc + } + + DROP TABLE t2; + } + + let $create_definition = + a $int_indexed_col, + b $char_col, + FOREIGN KEY (a) REFERENCES t1(a) + ON DELETE CASCADE ON UPDATE CASCADE + ; + --let $table_name = t2 + --source create_table.inc + if ($mysql_errname) + { + --let $functionality = Foreign keys or ON DELETE|UPDATE CASCADE + --source unexpected_result.inc + } + if (!$mysql_errname) + { + --source mask_engine.inc + SHOW CREATE TABLE t2; + + --let $error_codes = ER_NO_REFERENCED_ROW_2 + INSERT INTO t2 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'); + --source check_errors.inc + INSERT INTO t1 (a,b) VALUES (3,'a'),(4,'a'); + INSERT INTO t2 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(4,'e'),(3,'a'); + + UPDATE t1 SET a=a+1; + if ($mysql_errname) + { + --let $functionality = UPDATE + --source unexpected_result.inc + } + --sorted_result + SELECT * FROM t2; + + DELETE FROM t1 WHERE b='a' LIMIT 2; + if ($mysql_errname) + { + --let $functionality = DELETE + --source unexpected_result.inc + } + --sorted_result + SELECT * FROM t2; + + --let $error_codes = ER_TRUNCATE_ILLEGAL_FK + TRUNCATE TABLE t1; + --source check_errors.inc + if ($mysql_errname != ER_TRUNCATE_ILLEGAL_FK) + { + --let $functionality = Foreign keys + --source unexpected_result.inc + } + + DROP TABLE t2; + } + DROP TABLE t1; +} + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/fulltext_search.result b/mysql-test/suite/storage_engine/fulltext_search.result new file mode 100644 index 00000000000..4363d0aba25 --- /dev/null +++ b/mysql-test/suite/storage_engine/fulltext_search.result @@ -0,0 +1,132 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (v0 VARCHAR(64) <CUSTOM_COL_OPTIONS>, +v1 VARCHAR(16384) <CUSTOM_COL_OPTIONS>, +v2 TEXT <CUSTOM_COL_OPTIONS>, +FULLTEXT v1 (v1) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEXES IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 v1 1 v1 # # NULL NULL YES FULLTEXT +INSERT INTO t1 (v0,v1,v2) VALUES ('text1','Here is a list of recommended books on MariaDB and MySQL. We\'ve provided links to Amazon.com here for convenience, but they can be found at many other bookstores, both online and off. +If you want to have your favorite MySQL / MariaDB book listed here, please leave a comment. +For developers who want to code on MariaDB or MySQL +* Understanding MySQL Internals by Sasha Pachev, former MySQL developer at MySQL AB. +o This is the only book we know about that describes the internals of MariaDB / MySQL. A must have for anyone who wants to understand and develop on MariaDB! +o Not all topics are covered and some parts are slightly outdated, but still the best book on this topic. +* MySQL 5.1 Plugin Development by Sergei Golubchik and Andrew Hutchings +o A must read for anyone wanting to write a plugin for MariaDB, written by the Sergei who designed the plugin interface for MySQL and MariaDB! +For MariaDB / MySQL end users +* MariaDB Crash Course by Ben Forta +o First MariaDB book! +o For people who want to learn SQL and the basics of MariaDB. +o Now shipping. Purchase at Amazon.com or your favorite bookseller. +* SQL-99 Complete, Really by Peter Gulutzan & Trudy Pelzer. +o Everything you wanted to know about the SQL 99 standard. Excellent reference book! +o Free to read in the Knowledgebase! +* MySQL (4th Edition) by Paul DuBois +o The \'default\' book to read if you wont to learn to use MySQL / MariaDB. +* MySQL Cookbook by Paul DuBois +o A lot of examples of how to use MySQL. As with all of Paul\'s books, it\'s worth its weight in gold and even enjoyable reading for such a \'dry\' subject. +* High Performance MySQL, Second Edition, By Baron Schwartz, Peter Zaitsev, Vadim Tkachenko, Jeremy D. Zawodny, Arjen Lentz, Derek J. Balling, et al. +o \"High Performance MySQL is the definitive guide to building fast, reliable systems with MySQL. Written by noted experts with years of real-world experience building very large systems, this book covers every aspect of MySQL performance in detail, and focuses on robustness, security, and data integrity. Learn advanced techniques in depth so you can bring out MySQL\'s full power.\" (From the book description at O\'Reilly) + + * MySQL Admin Cookbook + o A quick step-by-step guide for MySQL users and database administrators to tackle real-world challenges with MySQL configuration and administration + + * MySQL 5.0 Certification Study Guide, By Paul DuBois, Stefan Hinz, Carsten Pedersen + o This is the official guide to cover the passing of the two MySQL Certification examinations. It is valid till version 5.0 of the server, so while it misses all the features available in MySQL 5.1 and greater (including MariaDB 5.1 and greater), it provides a good basic understanding of MySQL for the end-user. ', +'There are several reasons why contributing code is one of the easiest and most rewarding ways to contribute to MariaDB: + + 1. We are very responsive toward reviews of submitted code and as soon as the review is done, the submitted code is merged into an existing MariaDB tree and made available to everyone, not just select customers. + 2. Code reviews are performed by the MariaDB core development team and the quality, detail, and timeliness of our reviews are better than you will find elsewhere. + 3. With MariaDB everyone has access to the latest code. + 4. If a patch is very safe and/or very useful we are willing to push it into the stable code (as long as it can\'t break any existing applications). We are willing to do this to ensure the freedom to add small, needed fixes on a stable release so users don\'t have to wait a year for something to be added which is critical to their business. + 5. If you are an active contributor, you can become a member of maria-captains, even if you aren\'t working for Monty Program Ab. All captains have the same rights as any other captain to accept and reject patches. Our development model is truly open for everyone. +The Contributing Code page details many of the actual steps involved in working with the MariaDB source code. It\'s important that you use the same tools and submit patches in the same way as other developers to keep development running smoothly.' + ), ('text2','test1','test2'); +SELECT v0 FROM t1 WHERE MATCH(v1) AGAINST ('contributing' IN NATURAL LANGUAGE MODE); +v0 +INSERT INTO t1 (v0,v1,v2) VALUES ('text3','test','test'); +SELECT v0, MATCH(v1) AGAINST('contributing' IN NATURAL LANGUAGE MODE) AS rating FROM t1 WHERE MATCH(v1) AGAINST ('contributing' IN NATURAL LANGUAGE MODE); +v0 rating +INSERT INTO t1 (v0,v1,v2) VALUES ('text4','Contributing more...','...is a good idea'),('text5','test','test'); +SELECT v0, MATCH(v1) AGAINST('contributing') AS rating FROM t1 WHERE MATCH(v1) AGAINST ('contributing'); +v0 rating +text4 1.3705332279205322 +SELECT v0 FROM t1 WHERE MATCH(v1,v2) AGAINST ('-test1 +critical +Cook*' IN BOOLEAN MODE); +v0 +text1 +SELECT v0 FROM t1 WHERE MATCH(v1,v2) AGAINST ('-patch +critical +Cook*' IN BOOLEAN MODE); +v0 +SELECT v0, MATCH(v1) AGAINST('database' WITH QUERY EXPANSION) AS rating FROM t1 WHERE MATCH(v1) AGAINST ('database' WITH QUERY EXPANSION); +v0 rating +text1 178.11756896972656 +DROP TABLE t1; +CREATE TABLE t1 (v0 VARCHAR(64) <CUSTOM_COL_OPTIONS>, +v1 VARCHAR(16384) <CUSTOM_COL_OPTIONS>, +v2 TEXT <CUSTOM_COL_OPTIONS>, +FULLTEXT v1 (v1), +FULLTEXT v1_v2 (v1,v2) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEXES IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 v1 1 v1 # # NULL NULL YES FULLTEXT +t1 1 v1_v2 1 v1 # # NULL NULL YES FULLTEXT +t1 1 v1_v2 2 v2 # # NULL NULL YES FULLTEXT +INSERT INTO t1 (v0,v1,v2) VALUES ('text1','Here is a list of recommended books on MariaDB and MySQL. We\'ve provided links to Amazon.com here for convenience, but they can be found at many other bookstores, both online and off. +If you want to have your favorite MySQL / MariaDB book listed here, please leave a comment. +For developers who want to code on MariaDB or MySQL +* Understanding MySQL Internals by Sasha Pachev, former MySQL developer at MySQL AB. +o This is the only book we know about that describes the internals of MariaDB / MySQL. A must have for anyone who wants to understand and develop on MariaDB! +o Not all topics are covered and some parts are slightly outdated, but still the best book on this topic. +* MySQL 5.1 Plugin Development by Sergei Golubchik and Andrew Hutchings +o A must read for anyone wanting to write a plugin for MariaDB, written by the Sergei who designed the plugin interface for MySQL and MariaDB! +For MariaDB / MySQL end users +* MariaDB Crash Course by Ben Forta +o First MariaDB book! +o For people who want to learn SQL and the basics of MariaDB. +o Now shipping. Purchase at Amazon.com or your favorite bookseller. +* SQL-99 Complete, Really by Peter Gulutzan & Trudy Pelzer. +o Everything you wanted to know about the SQL 99 standard. Excellent reference book! +o Free to read in the Knowledgebase! +* MySQL (4th Edition) by Paul DuBois +o The \'default\' book to read if you wont to learn to use MySQL / MariaDB. +* MySQL Cookbook by Paul DuBois +o A lot of examples of how to use MySQL. As with all of Paul\'s books, it\'s worth its weight in gold and even enjoyable reading for such a \'dry\' subject. +* High Performance MySQL, Second Edition, By Baron Schwartz, Peter Zaitsev, Vadim Tkachenko, Jeremy D. Zawodny, Arjen Lentz, Derek J. Balling, et al. +o \"High Performance MySQL is the definitive guide to building fast, reliable systems with MySQL. Written by noted experts with years of real-world experience building very large systems, this book covers every aspect of MySQL performance in detail, and focuses on robustness, security, and data integrity. Learn advanced techniques in depth so you can bring out MySQL\'s full power.\" (From the book description at O\'Reilly) + + * MySQL Admin Cookbook + o A quick step-by-step guide for MySQL users and database administrators to tackle real-world challenges with MySQL configuration and administration + + * MySQL 5.0 Certification Study Guide, By Paul DuBois, Stefan Hinz, Carsten Pedersen + o This is the official guide to cover the passing of the two MySQL Certification examinations. It is valid till version 5.0 of the server, so while it misses all the features available in MySQL 5.1 and greater (including MariaDB 5.1 and greater), it provides a good basic understanding of MySQL for the end-user. ', +'There are several reasons why contributing code is one of the easiest and most rewarding ways to contribute to MariaDB: + + 1. We are very responsive toward reviews of submitted code and as soon as the review is done, the submitted code is merged into an existing MariaDB tree and made available to everyone, not just select customers. + 2. Code reviews are performed by the MariaDB core development team and the quality, detail, and timeliness of our reviews are better than you will find elsewhere. + 3. With MariaDB everyone has access to the latest code. + 4. If a patch is very safe and/or very useful we are willing to push it into the stable code (as long as it can\'t break any existing applications). We are willing to do this to ensure the freedom to add small, needed fixes on a stable release so users don\'t have to wait a year for something to be added which is critical to their business. + 5. If you are an active contributor, you can become a member of maria-captains, even if you aren\'t working for Monty Program Ab. All captains have the same rights as any other captain to accept and reject patches. Our development model is truly open for everyone. +The Contributing Code page details many of the actual steps involved in working with the MariaDB source code. It\'s important that you use the same tools and submit patches in the same way as other developers to keep development running smoothly.' + ), ('text2','test1','test2'); +SELECT v0 FROM t1 WHERE MATCH(v1,v2) AGAINST ('contributing' IN NATURAL LANGUAGE MODE); +v0 +INSERT INTO t1 (v0,v1,v2) VALUES ('text3','test','test'); +SELECT v0, MATCH(v1,v2) AGAINST('contributing' IN NATURAL LANGUAGE MODE) AS rating FROM t1 WHERE MATCH(v1,v2) AGAINST ('contributing' IN NATURAL LANGUAGE MODE); +v0 rating +text1 0.2809644043445587 +INSERT INTO t1 (v0,v1,v2) VALUES ('text4','Contributing more...','...is a good idea'),('text5','test','test'); +SELECT v0, MATCH(v1) AGAINST('contributing') AS rating FROM t1 WHERE MATCH(v1) AGAINST ('contributing'); +v0 rating +text4 1.3705332279205322 +SELECT v0 FROM t1 WHERE MATCH(v1,v2) AGAINST ('-test1 +critical +Cook*' IN BOOLEAN MODE); +v0 +text1 +SELECT v0 FROM t1 WHERE MATCH(v1,v2) AGAINST ('-patch +critical +Cook*' IN BOOLEAN MODE); +v0 +SELECT v0, MATCH(v1,v2) AGAINST('database' WITH QUERY EXPANSION) AS rating FROM t1 WHERE MATCH(v1,v2) AGAINST ('database' WITH QUERY EXPANSION); +v0 rating +text1 190.56150817871094 +text4 1.1758291721343994 +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/fulltext_search.test b/mysql-test/suite/storage_engine/fulltext_search.test new file mode 100644 index 00000000000..47857a17241 --- /dev/null +++ b/mysql-test/suite/storage_engine/fulltext_search.test @@ -0,0 +1,187 @@ +# +# Full-text indexes and search +# + +--source have_engine.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +let $create_definition = + v0 VARCHAR(64) $col_opts, + v1 VARCHAR(16384) $col_indexed_opts, + v2 TEXT $col_opts, + FULLTEXT v1 (v1) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $functionality = FULLTEXT indexes or VARCHAR|TEXT data types + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 6 # 7 # + SHOW INDEXES IN t1; + + INSERT INTO t1 (v0,v1,v2) VALUES ('text1','Here is a list of recommended books on MariaDB and MySQL. We\'ve provided links to Amazon.com here for convenience, but they can be found at many other bookstores, both online and off. + + If you want to have your favorite MySQL / MariaDB book listed here, please leave a comment. + For developers who want to code on MariaDB or MySQL + + * Understanding MySQL Internals by Sasha Pachev, former MySQL developer at MySQL AB. + o This is the only book we know about that describes the internals of MariaDB / MySQL. A must have for anyone who wants to understand and develop on MariaDB! + o Not all topics are covered and some parts are slightly outdated, but still the best book on this topic. + * MySQL 5.1 Plugin Development by Sergei Golubchik and Andrew Hutchings + o A must read for anyone wanting to write a plugin for MariaDB, written by the Sergei who designed the plugin interface for MySQL and MariaDB! + + For MariaDB / MySQL end users + + * MariaDB Crash Course by Ben Forta + o First MariaDB book! + o For people who want to learn SQL and the basics of MariaDB. + o Now shipping. Purchase at Amazon.com or your favorite bookseller. + + * SQL-99 Complete, Really by Peter Gulutzan & Trudy Pelzer. + o Everything you wanted to know about the SQL 99 standard. Excellent reference book! + o Free to read in the Knowledgebase! + + * MySQL (4th Edition) by Paul DuBois + o The \'default\' book to read if you wont to learn to use MySQL / MariaDB. + + * MySQL Cookbook by Paul DuBois + o A lot of examples of how to use MySQL. As with all of Paul\'s books, it\'s worth its weight in gold and even enjoyable reading for such a \'dry\' subject. + + * High Performance MySQL, Second Edition, By Baron Schwartz, Peter Zaitsev, Vadim Tkachenko, Jeremy D. Zawodny, Arjen Lentz, Derek J. Balling, et al. + o \"High Performance MySQL is the definitive guide to building fast, reliable systems with MySQL. Written by noted experts with years of real-world experience building very large systems, this book covers every aspect of MySQL performance in detail, and focuses on robustness, security, and data integrity. Learn advanced techniques in depth so you can bring out MySQL\'s full power.\" (From the book description at O\'Reilly) + + * MySQL Admin Cookbook + o A quick step-by-step guide for MySQL users and database administrators to tackle real-world challenges with MySQL configuration and administration + + * MySQL 5.0 Certification Study Guide, By Paul DuBois, Stefan Hinz, Carsten Pedersen + o This is the official guide to cover the passing of the two MySQL Certification examinations. It is valid till version 5.0 of the server, so while it misses all the features available in MySQL 5.1 and greater (including MariaDB 5.1 and greater), it provides a good basic understanding of MySQL for the end-user. ', + + 'There are several reasons why contributing code is one of the easiest and most rewarding ways to contribute to MariaDB: + + 1. We are very responsive toward reviews of submitted code and as soon as the review is done, the submitted code is merged into an existing MariaDB tree and made available to everyone, not just select customers. + 2. Code reviews are performed by the MariaDB core development team and the quality, detail, and timeliness of our reviews are better than you will find elsewhere. + 3. With MariaDB everyone has access to the latest code. + 4. If a patch is very safe and/or very useful we are willing to push it into the stable code (as long as it can\'t break any existing applications). We are willing to do this to ensure the freedom to add small, needed fixes on a stable release so users don\'t have to wait a year for something to be added which is critical to their business. + 5. If you are an active contributor, you can become a member of maria-captains, even if you aren\'t working for Monty Program Ab. All captains have the same rights as any other captain to accept and reject patches. Our development model is truly open for everyone. + + The Contributing Code page details many of the actual steps involved in working with the MariaDB source code. It\'s important that you use the same tools and submit patches in the same way as other developers to keep development running smoothly.' + ), ('text2','test1','test2'); + + # 50% rule -- no result if the string is represented in at least 50% rows + SELECT v0 FROM t1 WHERE MATCH(v1) AGAINST ('contributing' IN NATURAL LANGUAGE MODE); + + # Adding a row to start getting results + INSERT INTO t1 (v0,v1,v2) VALUES ('text3','test','test'); + SELECT v0, MATCH(v1) AGAINST('contributing' IN NATURAL LANGUAGE MODE) AS rating FROM t1 WHERE MATCH(v1) AGAINST ('contributing' IN NATURAL LANGUAGE MODE); + + INSERT INTO t1 (v0,v1,v2) VALUES ('text4','Contributing more...','...is a good idea'),('text5','test','test'); + SELECT v0, MATCH(v1) AGAINST('contributing') AS rating FROM t1 WHERE MATCH(v1) AGAINST ('contributing'); + + # Boolean mode + + SELECT v0 FROM t1 WHERE MATCH(v1,v2) AGAINST ('-test1 +critical +Cook*' IN BOOLEAN MODE); + SELECT v0 FROM t1 WHERE MATCH(v1,v2) AGAINST ('-patch +critical +Cook*' IN BOOLEAN MODE); + + # Query expansion + + SELECT v0, MATCH(v1) AGAINST('database' WITH QUERY EXPANSION) AS rating FROM t1 WHERE MATCH(v1) AGAINST ('database' WITH QUERY EXPANSION); + DROP TABLE t1; +} + + +let $create_definition = + v0 VARCHAR(64) $col_opts, + v1 VARCHAR(16384) $col_opts, + v2 TEXT $col_opts, + FULLTEXT v1 (v1), + FULLTEXT v1_v2 (v1,v2) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $functionality = FULLTEXT indexes or multiple keys or VARCHAR|TEXT data types + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 6 # 7 # + SHOW INDEXES IN t1; + + INSERT INTO t1 (v0,v1,v2) VALUES ('text1','Here is a list of recommended books on MariaDB and MySQL. We\'ve provided links to Amazon.com here for convenience, but they can be found at many other bookstores, both online and off. + + If you want to have your favorite MySQL / MariaDB book listed here, please leave a comment. + For developers who want to code on MariaDB or MySQL + + * Understanding MySQL Internals by Sasha Pachev, former MySQL developer at MySQL AB. + o This is the only book we know about that describes the internals of MariaDB / MySQL. A must have for anyone who wants to understand and develop on MariaDB! + o Not all topics are covered and some parts are slightly outdated, but still the best book on this topic. + * MySQL 5.1 Plugin Development by Sergei Golubchik and Andrew Hutchings + o A must read for anyone wanting to write a plugin for MariaDB, written by the Sergei who designed the plugin interface for MySQL and MariaDB! + + For MariaDB / MySQL end users + + * MariaDB Crash Course by Ben Forta + o First MariaDB book! + o For people who want to learn SQL and the basics of MariaDB. + o Now shipping. Purchase at Amazon.com or your favorite bookseller. + + * SQL-99 Complete, Really by Peter Gulutzan & Trudy Pelzer. + o Everything you wanted to know about the SQL 99 standard. Excellent reference book! + o Free to read in the Knowledgebase! + + * MySQL (4th Edition) by Paul DuBois + o The \'default\' book to read if you wont to learn to use MySQL / MariaDB. + + * MySQL Cookbook by Paul DuBois + o A lot of examples of how to use MySQL. As with all of Paul\'s books, it\'s worth its weight in gold and even enjoyable reading for such a \'dry\' subject. + + * High Performance MySQL, Second Edition, By Baron Schwartz, Peter Zaitsev, Vadim Tkachenko, Jeremy D. Zawodny, Arjen Lentz, Derek J. Balling, et al. + o \"High Performance MySQL is the definitive guide to building fast, reliable systems with MySQL. Written by noted experts with years of real-world experience building very large systems, this book covers every aspect of MySQL performance in detail, and focuses on robustness, security, and data integrity. Learn advanced techniques in depth so you can bring out MySQL\'s full power.\" (From the book description at O\'Reilly) + + * MySQL Admin Cookbook + o A quick step-by-step guide for MySQL users and database administrators to tackle real-world challenges with MySQL configuration and administration + + * MySQL 5.0 Certification Study Guide, By Paul DuBois, Stefan Hinz, Carsten Pedersen + o This is the official guide to cover the passing of the two MySQL Certification examinations. It is valid till version 5.0 of the server, so while it misses all the features available in MySQL 5.1 and greater (including MariaDB 5.1 and greater), it provides a good basic understanding of MySQL for the end-user. ', + + 'There are several reasons why contributing code is one of the easiest and most rewarding ways to contribute to MariaDB: + + 1. We are very responsive toward reviews of submitted code and as soon as the review is done, the submitted code is merged into an existing MariaDB tree and made available to everyone, not just select customers. + 2. Code reviews are performed by the MariaDB core development team and the quality, detail, and timeliness of our reviews are better than you will find elsewhere. + 3. With MariaDB everyone has access to the latest code. + 4. If a patch is very safe and/or very useful we are willing to push it into the stable code (as long as it can\'t break any existing applications). We are willing to do this to ensure the freedom to add small, needed fixes on a stable release so users don\'t have to wait a year for something to be added which is critical to their business. + 5. If you are an active contributor, you can become a member of maria-captains, even if you aren\'t working for Monty Program Ab. All captains have the same rights as any other captain to accept and reject patches. Our development model is truly open for everyone. + + The Contributing Code page details many of the actual steps involved in working with the MariaDB source code. It\'s important that you use the same tools and submit patches in the same way as other developers to keep development running smoothly.' + ), ('text2','test1','test2'); + + # 50% rule -- no result if the string is represented in at least 50% rows + SELECT v0 FROM t1 WHERE MATCH(v1,v2) AGAINST ('contributing' IN NATURAL LANGUAGE MODE); + + # Adding a row to start getting results + INSERT INTO t1 (v0,v1,v2) VALUES ('text3','test','test'); + SELECT v0, MATCH(v1,v2) AGAINST('contributing' IN NATURAL LANGUAGE MODE) AS rating FROM t1 WHERE MATCH(v1,v2) AGAINST ('contributing' IN NATURAL LANGUAGE MODE); + + INSERT INTO t1 (v0,v1,v2) VALUES ('text4','Contributing more...','...is a good idea'),('text5','test','test'); + SELECT v0, MATCH(v1) AGAINST('contributing') AS rating FROM t1 WHERE MATCH(v1) AGAINST ('contributing'); + + # Boolean mode + + SELECT v0 FROM t1 WHERE MATCH(v1,v2) AGAINST ('-test1 +critical +Cook*' IN BOOLEAN MODE); + SELECT v0 FROM t1 WHERE MATCH(v1,v2) AGAINST ('-patch +critical +Cook*' IN BOOLEAN MODE); + + # Query expansion + + SELECT v0, MATCH(v1,v2) AGAINST('database' WITH QUERY EXPANSION) AS rating FROM t1 WHERE MATCH(v1,v2) AGAINST ('database' WITH QUERY EXPANSION); + + DROP TABLE t1; +} + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/handler.result b/mysql-test/suite/storage_engine/handler.result new file mode 100644 index 00000000000..be29b98cb78 --- /dev/null +++ b/mysql-test/suite/storage_engine/handler.result @@ -0,0 +1,77 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a <CHAR_COLUMN>, b <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES ('foobar',1000),('a',1),('bar',200),('foo',100); +HANDLER t1 OPEN AS h1; +HANDLER t1 READ FIRST; +ERROR 42S02: Unknown table 't1' in HANDLER +HANDLER h1 READ FIRST; +a b +foobar 1000 +HANDLER h1 READ NEXT; +a b +a 1 +HANDLER h1 READ FIRST WHERE a < 'foo'; +a b +a 1 +HANDLER h1 READ NEXT; +a b +bar 200 +HANDLER h1 READ NEXT; +a b +foo 100 +HANDLER h1 READ NEXT; +a b +HANDLER h1 READ FIRST LIMIT 2; +a b +foobar 1000 +a 1 +HANDLER h1 READ NEXT; +a b +bar 200 +HANDLER h1 READ NEXT WHERE b>500 LIMIT 2; +a b +HANDLER t1 OPEN; +HANDLER h1 READ FIRST WHERE b>500 LIMIT 5; +a b +foobar 1000 +HANDLER t1 READ NEXT; +a b +foobar 1000 +HANDLER h1 READ NEXT WHERE b<100; +a b +HANDLER t1 CLOSE; +HANDLER h1 READ FIRST; +a b +foobar 1000 +HANDLER t1 CLOSE; +ERROR 42S02: Unknown table 't1' in HANDLER +DROP TABLE t1; +HANDLER h1 CLOSE; +ERROR 42S02: Unknown table 'h1' in HANDLER +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>, <CUSTOM_INDEX> (a)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (b,a) VALUES ('a',1),('b',200),('f',100),('b',101),('c',2); +HANDLER t1 OPEN AS h1; +HANDLER h1 READ a = (100); +a b +100 f +HANDLER h1 READ a <= (100) WHERE b < 'f'; +a b +2 c +HANDLER h1 READ a > (2) WHERE b IS NOT NULL LIMIT 2; +a b +100 f +101 b +HANDLER h1 READ a FIRST; +a b +1 a +HANDLER h1 READ a LAST; +a b +200 b +HANDLER h1 READ a PREV; +a b +101 b +HANDLER h1 READ a NEXT; +a b +200 b +HANDLER h1 CLOSE; +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/handler.test b/mysql-test/suite/storage_engine/handler.test new file mode 100644 index 00000000000..200ab649636 --- /dev/null +++ b/mysql-test/suite/storage_engine/handler.test @@ -0,0 +1,81 @@ +# +# Basic HANDLER syntax +# +# HANDLER .. READ <index_name> is covered in handler_index test +# + +--source have_engine.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +--let $create_definition = a $char_col, b $int_col +--source create_table.inc +INSERT INTO t1 (a,b) VALUES ('foobar',1000),('a',1),('bar',200),('foo',100); + +HANDLER t1 OPEN AS h1; +if ($mysql_errname) +{ + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --let $error_codes = ER_UNKNOWN_TABLE + HANDLER t1 READ FIRST; + --source check_errors.inc + HANDLER h1 READ FIRST; + HANDLER h1 READ NEXT; + HANDLER h1 READ FIRST WHERE a < 'foo'; + HANDLER h1 READ NEXT; + HANDLER h1 READ NEXT; + HANDLER h1 READ NEXT; + HANDLER h1 READ FIRST LIMIT 2; + HANDLER h1 READ NEXT; + HANDLER h1 READ NEXT WHERE b>500 LIMIT 2; + HANDLER t1 OPEN; + HANDLER h1 READ FIRST WHERE b>500 LIMIT 5; + HANDLER t1 READ NEXT; + HANDLER h1 READ NEXT WHERE b<100; + HANDLER t1 CLOSE; + HANDLER h1 READ FIRST; + --let $error_codes = ER_UNKNOWN_TABLE + HANDLER t1 CLOSE; + --source check_errors.inc +} + +DROP TABLE t1; + +--let $error_codes = ER_UNKNOWN_TABLE +HANDLER h1 CLOSE; +--source check_errors.inc + +--let $continue = 1 +--source have_default_index.inc + +if ($have_default_index) +{ + --let $create_definition = a $int_indexed_col, b $char_col, $default_index (a) + --source create_table.inc + INSERT INTO t1 (b,a) VALUES ('a',1),('b',200),('f',100),('b',101),('c',2); + if ($mysql_errname) + { + --source unexpected_result.inc + } + HANDLER t1 OPEN AS h1; + if (!$mysql_errname) + { + HANDLER h1 READ a = (100); + HANDLER h1 READ a <= (100) WHERE b < 'f'; + HANDLER h1 READ a > (2) WHERE b IS NOT NULL LIMIT 2; + HANDLER h1 READ a FIRST; + HANDLER h1 READ a LAST; + HANDLER h1 READ a PREV; + HANDLER h1 READ a NEXT; + HANDLER h1 CLOSE; + } + DROP TABLE t1; +} + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/have_default_index.inc b/mysql-test/suite/storage_engine/have_default_index.inc new file mode 100644 index 00000000000..fb5111c7180 --- /dev/null +++ b/mysql-test/suite/storage_engine/have_default_index.inc @@ -0,0 +1,20 @@ +# +# This include file either just prints the message, or skips the rest of the test +# Usage: +# --let $continue = 1; # optional +# --source have_default_index.inc +# + +--let $have_default_index = 1 +if ($default_index == '/*!*/ /*Custom index*/') +{ + if (!$continue) + { + --source cleanup_engine.inc + --skip # Configuration does not allow indexes. Check \$default_index value + } + --echo # According to the configuration, the engine does not allow indexes. Check \$default_index value + --let $have_default_index = 0 + --let $continue = 0 +} + diff --git a/mysql-test/suite/storage_engine/have_engine.inc b/mysql-test/suite/storage_engine/have_engine.inc new file mode 100644 index 00000000000..5a6f05f42af --- /dev/null +++ b/mysql-test/suite/storage_engine/have_engine.inc @@ -0,0 +1,127 @@ +########################################### +# +# This include file executes define_engine.inc which belongs to the storage engine +# and then checks and sets test options and parameters. +# +# The name of the engine under test must be defined in $ENGINE variable. +# You can define it either in define_engine.inc or in your environment. +# +################################ +# +# The following three variables define specific options for columns and tables. +# Normally there should be none needed, but for some engines it can be different. +# If the engine requires specific column option for all or indexed columns, +# set them inside the comment, e.g. /*!NOT NULL*/. +# Do the same for table options if needed, e.g. /*!INSERT_METHOD=LAST*/ + +let $default_col_opts = /*!*/; +let $default_col_indexed_opts = /*!*/; +let $default_tbl_opts = /*!*/; + +# INDEX, UNIQUE INDEX, PRIMARY KEY, special index type -- choose minimal that the engine allows, +# or set it to /*!*/ if none is supported + +let $default_index = /*!INDEX*/; + +# If the engine does not support these types, replace them with the closest possible + +let $default_int_type = INT(11); +let $default_char_type = CHAR(8); + +################################ +# +# Here the actual work starts +# define_engine.inc will set the ENGINE variable +# and possibly redefine some of default_* variables + +--source define_engine.inc + +if (!$ENGINE) +{ + --skip ERROR: Storage engine under test is not defined, export ENGINE env variable or set it in define_engine.inc +} + +# Check that the storage engine is loaded. Here we don't need to worry about the case, +# as I_S is case-insensitive. + +if (!`SELECT engine FROM INFORMATION_SCHEMA.ENGINES WHERE engine = '$ENGINE' AND support IN ('YES', 'DEFAULT', 'ENABLED')`) +{ + --skip The test requires $ENGINE engine +} + +# Further in tests we will use $storage_engine variable + +let $storage_engine = $ENGINE; + +# In case somebody removed comment tags in define_engine.inc +if (!$default_col_opts) +{ + let $default_col_opts = /*!*/; +} +if (!$default_col_indexed_opts) +{ + let $default_col_indexed_opts = /*!*/; +} +if (!$default_tbl_opts) +{ + let $default_tbl_opts = /*!*/; +} +if (!$default_index) +{ + let $default_index = /*!*/; +} + +# Adding a comment after default options helps later to mask the custom values in result output +let $default_index = $default_index /*Custom index*/; +let $default_col_opts = $default_col_opts /*Custom column options*/; +let $default_col_indexed_opts = $default_col_indexed_opts /*Custom indexed column options*/; +let $default_tbl_opts = $default_tbl_opts /*Custom table options*/; + + +# Finally, set some variables which will make our life easier later. +# For many tests, we need a simple INT or CHAR column, but with +# (optional) column attributes which the engine might require. +# Also, a test might be called by another test, and the calling test +# might need additional attributes. So, here we are collecting them all together. +# Example: +# CSV engine requires all columns to be NOT NULL, so its define_engine.inc file will contain +# let $default_col_opts = /*!NOT NULL*/; +# Then, we have test1.test which calls have_engine.inc. +# If it's executed directly, it will have $int_col = 'INT(11) NOT NULL' for CSV and 'INT(11)' for MyISAM. +# Another test, test2.test might set $extra_type_opts = UNSIGNED and/or $extra_col_opts = NULL +# and call test1.test. +# If both are set, test1.test will be executed for MyISAM with 'INT(11) UNSIGNED NULL', +# and for CSV INT(11) UNSIGNED NOT NULL NULL (and will fail because CSV does not support nullable columns) + +let $col_opts = $default_col_opts; +let $col_indexed_opts = $default_col_indexed_opts; + +if ($extra_col_opts) +{ + let $col_opts = $col_opts $extra_col_opts; + let $col_indexed_opts = $col_indexed_opts $extra_col_opts; +} + +if ($extra_type_opts) +{ + let $col_opts = $extra_type_opts $col_opts; + let $col_indexed_opts = $extra_type_opts $col_indexed_opts; +} + +let $int_col = $default_int_type $col_opts; +let $int_indexed_col = $default_int_type $col_indexed_opts; + +let $char_col = $default_char_type $col_opts; +let $char_indexed_col = $default_char_type $col_indexed_opts; + + + +if (`SELECT @@global.log_bin = 'ON' AND @@global.binlog_format = 'STATEMENT'`) +{ + --disable_query_log + CALL mtr.add_suppression('Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT'); + --enable_query_log +} + +--disable_abort_on_error + diff --git a/mysql-test/suite/storage_engine/index.inc b/mysql-test/suite/storage_engine/index.inc new file mode 100644 index 00000000000..ac7632fb2b4 --- /dev/null +++ b/mysql-test/suite/storage_engine/index.inc @@ -0,0 +1,194 @@ +# +# Basic syntax related to indexes: +# unique and non-unique keys, +# single- and multi-column keys, +# index option COMMENT. +# +# See other index* tests for operations +# which are less likely to be supported +# +# PRIMARY KEY syntax is covered in index_primary test. +# Index types BTREE|HASH -- in index_type_btree|hash tests. +# SPATIAL -- in type_spatial_indexes test. +# FULLTEXT -- in fulltext_search test. +# KEY_BLOCK_SIZE -- in index_key_block_size test. +# +# Usage to call the test from another test: +# +# A calling test may define $index_type, in which case +# USING clause will be added to the syntax. +# + +let $using_index_type = ; +if ($index_type) +{ + let $using_index_type = USING $index_type; +} + +--source have_engine.inc + +--let $continue = 1 +--source have_default_index.inc + +if ($have_default_index) +{ + + let $create_definition = + a $int_indexed_col, + b $char_col, + $default_index $using_index_type (a) + ; + --source create_table.inc + if ($mysql_errname) + { + --let $my_last_stmt = $create_statement + --source unexpected_result.inc + } + if (!$mysql_errname) + { + # Cardinality is not the exact science, so here and further + # we'll be masking it + --replace_column 6 # 7 # 10 # + SHOW KEYS IN t1; + DROP TABLE t1; + } + + let $create_definition = + a $int_indexed_col, + b $char_indexed_col, + $default_index a_b $using_index_type (a,b) COMMENT 'a_b index' + ; + --source create_table.inc + if ($mysql_errname) + { + --let $functionality = Multi-part indexes + --let $my_last_stmt = $create_statement + --source unexpected_result.inc + } + if (!$mysql_errname) + { + --replace_column 6 # 7 # 10 # + SHOW KEYS IN t1; + DROP TABLE t1; + } + + + let $create_definition = + a $int_indexed_col, + b $char_indexed_col, + $default_index $using_index_type (a), + $default_index $using_index_type (b) + ; + --source create_table.inc + if ($mysql_errname) + { + --let $functionality = Multiple indexes + --let $my_last_stmt = $create_statement + --source unexpected_result.inc + } + if (!$mysql_errname) + { + --replace_column 6 # 7 # 10 # + SHOW KEYS IN t1; + DROP TABLE t1; + } + + let $create_definition = + a $int_indexed_col, + b $char_col, + UNIQUE INDEX $using_index_type (a) + ; + --source create_table.inc + if ($mysql_errname) + { + --let $functionality = Unique indexes + --let $my_last_stmt = $create_statement + --source unexpected_result.inc + } + if (!$mysql_errname) + { + --replace_column 6 # 7 # 10 # + SHOW KEYS IN t1; + INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); + --let $error_codes = ER_DUP_ENTRY,ER_DUP_KEY + INSERT INTO t1 (a,b) VALUES (1,'c'); + --source check_errors.inc + + DROP TABLE t1; + } + + + # + # ALTER TABLE + # + + --let $create_definition = a $int_indexed_col, b $char_col + --source create_table.inc + if ($mysql_errname) + { + --let $functionality = Column options + --let $my_last_stmt = $create_statement + --source unexpected_result.inc + } + if (!$mysql_errname) + { + INSERT INTO t1 (a,b) VALUES (100,'z'); + + --let $alter_definition = ADD $default_index (a) $using_index_type COMMENT 'simple index on a' + --source alter_table.inc + if ($mysql_errname) + { + --let $functionality = ALTER TABLE .. ADD INDEX + --let $my_last_stmt = $alter_statement + --source unexpected_result.inc + } + if (!$mysql_errname) + { + --replace_column 6 # 7 # 10 # + SHOW INDEX FROM t1; + --let $alter_definition = DROP KEY a + --source alter_table.inc + } + DROP TABLE t1; + } + + let $create_definition = + a $int_indexed_col, + b $char_col, + UNIQUE INDEX $using_index_type (a) + ; + --source create_table.inc + if ($mysql_errname) + { + --let $functionality = Unique indexes + --let $my_last_stmt = $create_statement + --source unexpected_result.inc + } + if (!$mysql_errname) + { + --replace_column 6 # 7 # 10 # + SHOW KEYS IN t1; + INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); + --let $error_codes = ER_DUP_ENTRY,ER_DUP_KEY + INSERT INTO t1 (a,b) VALUES (1,'c'); + --source check_errors.inc + + --let $alter_definition = DROP INDEX a + --source alter_table.inc + if ($mysql_errname) + { + --let $functionality = ALTER TABLE .. DROP INDEX + --let $my_last_stmt = $alter_statement + --source unexpected_result.inc + } + if (!$mysql_errname) + { + INSERT INTO t1 (a,b) VALUES (1,'c'); + --let $error_codes = ER_DUP_ENTRY,ER_DUP_KEY + --let $alter_definition = ADD UNIQUE INDEX a(a) $using_index_type + --source alter_table.inc + } + DROP TABLE t1; + } +} + diff --git a/mysql-test/suite/storage_engine/index.result b/mysql-test/suite/storage_engine/index.result new file mode 100644 index 00000000000..baf9a4d4da2 --- /dev/null +++ b/mysql-test/suite/storage_engine/index.result @@ -0,0 +1,67 @@ +CREATE TABLE t1 (a <INT_COLUMN>, +b <CHAR_COLUMN>, +<CUSTOM_INDEX> (a) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW KEYS IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 a 1 a # # NULL NULL # BTREE +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>, +b <CHAR_COLUMN>, +<CUSTOM_INDEX> a_b (a,b) COMMENT 'a_b index' + ) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW KEYS IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 a_b 1 a # # NULL NULL # BTREE a_b index +t1 1 a_b 2 b # # NULL NULL # BTREE a_b index +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>, +b <CHAR_COLUMN>, +<CUSTOM_INDEX> (a), +<CUSTOM_INDEX> (b) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW KEYS IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 a 1 a # # NULL NULL # BTREE +t1 1 b 1 b # # NULL NULL # BTREE +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>, +b <CHAR_COLUMN>, +UNIQUE INDEX (a) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW KEYS IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 0 a 1 a # # NULL NULL # BTREE +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); +INSERT INTO t1 (a,b) VALUES (1,'c'); +ERROR 23000: Duplicate entry '1' for key 'a' +# Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY). +# If you got a difference in error message, just add it to rdiff file +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (100,'z'); +ALTER TABLE t1 ADD <CUSTOM_INDEX> (a) COMMENT 'simple index on a'; +SHOW INDEX FROM t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 a 1 a # # NULL NULL # BTREE simple index on a +ALTER TABLE t1 DROP KEY a; +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>, +b <CHAR_COLUMN>, +UNIQUE INDEX (a) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW KEYS IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 0 a 1 a # # NULL NULL # BTREE +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); +INSERT INTO t1 (a,b) VALUES (1,'c'); +ERROR 23000: Duplicate entry '1' for key 'a' +# Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY). +# If you got a difference in error message, just add it to rdiff file +ALTER TABLE t1 DROP INDEX a; +INSERT INTO t1 (a,b) VALUES (1,'c'); +ALTER TABLE t1 ADD UNIQUE INDEX a(a) ; +ERROR 23000: Duplicate entry '1' for key 'a' +# Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY). +# If you got a difference in error message, just add it to rdiff file +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/index.test b/mysql-test/suite/storage_engine/index.test new file mode 100644 index 00000000000..0dba3d1b299 --- /dev/null +++ b/mysql-test/suite/storage_engine/index.test @@ -0,0 +1,23 @@ +# +# Basic syntax related to indexes: +# unique and non-unique keys, +# single- and multi-column keys, +# index option COMMENT. +# +# See other index* tests for operations +# which are less likely to be supported +# +# PRIMARY KEY syntax is covered in index_primary test. +# Index types BTREE|HASH -- in index_type_btree|hash tests. +# SPATIAL -- in type_spatial_indexes test. +# FULLTEXT -- in fulltext_search test. +# KEY_BLOCK_SIZE -- in index_key_block_size test. +# + +--source have_engine.inc +--source have_default_index.inc + +--source index.inc + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/index_enable_disable.result b/mysql-test/suite/storage_engine/index_enable_disable.result new file mode 100644 index 00000000000..e7bb9cf3939 --- /dev/null +++ b/mysql-test/suite/storage_engine/index_enable_disable.result @@ -0,0 +1,45 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a <INT_COLUMN>, <CUSTOM_INDEX>(a)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a) VALUES (10); +INSERT INTO t1 (a) VALUES +(1),(2),(3),(4),(5),(6),(7),(8),(9), +(21),(22),(23),(24),(25),(26),(27),(28),(29); +EXPLAIN SELECT a FROM t1 ORDER BY a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL a 5 NULL # Using index +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 a 1 a # # NULL NULL YES BTREE +ALTER TABLE t1 DISABLE KEYS; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 a 1 a # # NULL NULL YES BTREE disabled +EXPLAIN SELECT a FROM t1 ORDER BY a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 19 Using filesort +INSERT INTO t1 (a) VALUES +(11),(12),(13),(14),(15),(16),(17),(18),(19),(20); +ALTER TABLE t1 ENABLE KEYS; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 a 1 a # # NULL NULL YES BTREE +EXPLAIN SELECT a FROM t1 ORDER BY a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL a 5 NULL # Using index +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>, UNIQUE INDEX(a)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a) VALUES +(1),(2),(3),(4),(5),(6),(7),(8),(9), +(21),(22),(23),(24),(25),(26),(27),(28),(29); +ALTER TABLE t1 DISABLE KEYS; +INSERT INTO t1 (a) VALUES (29); +ERROR 23000: Duplicate entry '29' for key 'a' +# Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY). +# If you got a difference in error message, just add it to rdiff file +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 0 a 1 a # # NULL NULL YES BTREE +EXPLAIN SELECT a FROM t1 ORDER BY a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL a 5 NULL # Using index +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/index_enable_disable.test b/mysql-test/suite/storage_engine/index_enable_disable.test new file mode 100644 index 00000000000..4f0297ea2f0 --- /dev/null +++ b/mysql-test/suite/storage_engine/index_enable_disable.test @@ -0,0 +1,88 @@ +# +# ENABLE KEYS / DISABLE KEYS +# + +--source have_engine.inc +--source have_default_index.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + + +--let $create_definition = a $int_indexed_col, $default_index(a) +--source create_table.inc +INSERT INTO t1 (a) VALUES (10); + +INSERT INTO t1 (a) VALUES + (1),(2),(3),(4),(5),(6),(7),(8),(9), + (21),(22),(23),(24),(25),(26),(27),(28),(29); +# Plan should use the index. +# Masking the `rows` column as the value might vary a bit +--replace_column 9 # +EXPLAIN SELECT a FROM t1 ORDER BY a; + +--replace_column 6 # 7 # +SHOW INDEX IN t1; + +--let $alter_definition = DISABLE KEYS +--source alter_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $alter_statement + --let $functionality = ALTER .. DISABLE KEYS + --source unexpected_result.inc +} + +# Now comment should say 'disabled' +--replace_column 6 # 7 # +SHOW INDEX IN t1; + +# And the plan should not use the index +EXPLAIN SELECT a FROM t1 ORDER BY a; +INSERT INTO t1 (a) VALUES + (11),(12),(13),(14),(15),(16),(17),(18),(19),(20); + +# The index should be back active +--let $alter_definition = ENABLE KEYS +--source alter_table.inc +--replace_column 6 # 7 # +SHOW INDEX IN t1; +--replace_column 9 # +EXPLAIN SELECT a FROM t1 ORDER BY a; + +DROP TABLE t1; + +--let $create_definition = a $int_indexed_col, UNIQUE INDEX(a) +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Unique keys + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + INSERT INTO t1 (a) VALUES + (1),(2),(3),(4),(5),(6),(7),(8),(9), + (21),(22),(23),(24),(25),(26),(27),(28),(29); + + # For unique indexes DISABLE KEYS has no effect + + --let $alter_definition = DISABLE KEYS + --source alter_table.inc + --let $error_codes = ER_DUP_ENTRY,ER_DUP_KEY + INSERT INTO t1 (a) VALUES (29); + --source check_errors.inc + --replace_column 6 # 7 # + SHOW INDEX IN t1; + --replace_column 9 # + EXPLAIN SELECT a FROM t1 ORDER BY a; + + DROP TABLE t1; +} + +# Cleanup + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/index_key_block_size.result b/mysql-test/suite/storage_engine/index_key_block_size.result new file mode 100644 index 00000000000..0e00f02e922 --- /dev/null +++ b/mysql-test/suite/storage_engine/index_key_block_size.result @@ -0,0 +1,43 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a <INT_COLUMN>, +b <CHAR_COLUMN>, +<CUSTOM_INDEX> (a) KEY_BLOCK_SIZE=8 +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW KEYS IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 a 1 a # # NULL NULL # # +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>, +b <CHAR_COLUMN>, +<CUSTOM_INDEX> ind1(b ASC) KEY_BLOCK_SIZE=0 +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 ind1 1 b # # NULL NULL # # +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>, +b <CHAR_COLUMN>, +UNIQUE INDEX ind2(b(1) DESC) KEY_BLOCK_SIZE=32768 COMMENT 'big key_block_size value' +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 0 ind2 1 b # # 1 NULL # # big key_block_size value +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>, +b <CHAR_COLUMN>, +<CUSTOM_INDEX> a_b(a,b) KEY_BLOCK_SIZE=8192 +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 a_b 1 a # # NULL NULL # # +t1 1 a_b 2 b # # NULL NULL # # +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>, +b <CHAR_COLUMN> +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (100,'z'); +ALTER TABLE t1 ADD <CUSTOM_INDEX>(a) KEY_BLOCK_SIZE 8192; +SHOW INDEX FROM t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 a 1 a # # NULL NULL # # +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/index_key_block_size.test b/mysql-test/suite/storage_engine/index_key_block_size.test new file mode 100644 index 00000000000..21304f0380e --- /dev/null +++ b/mysql-test/suite/storage_engine/index_key_block_size.test @@ -0,0 +1,125 @@ +# +# KEY_BLOCK_SIZE index option. +# +# The results are likely to be different +# depending on the engine +# + +--source have_engine.inc +--source have_default_index.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +let $create_definition = + a $int_indexed_col, + b $char_col, + $default_index (a) KEY_BLOCK_SIZE=8 +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + # Cardinality is not the exact science, so here and further + # we'll be masking it + --replace_column 6 # 7 # 10 # 11 # + SHOW KEYS IN t1; + + DROP TABLE t1; +} + + +let $create_definition = + a $int_col, + b $char_indexed_col, + $default_index ind1(b ASC) KEY_BLOCK_SIZE=0 +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Indexes on CHAR columns + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + DROP TABLE t1; +} + +let $create_definition = + a $int_col, + b $char_indexed_col, + UNIQUE INDEX ind2(b(1) DESC) KEY_BLOCK_SIZE=32768 COMMENT 'big key_block_size value' +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Unique keys on char columns + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + DROP TABLE t1; +} + +let $create_definition = + a $int_indexed_col, + b $char_indexed_col, + $default_index a_b(a,b) KEY_BLOCK_SIZE=8192 +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Multi-part keys + --source unexpected_result.inc +} +if (!$mysql_errname) +{ +--replace_column 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + DROP TABLE t1; +} + +# +# ALTER TABLE +# + +let $create_definition = + a $int_indexed_col, + b $char_col +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + INSERT INTO t1 (a,b) VALUES (100,'z'); + + --let $alter_definition = ADD $default_index(a) KEY_BLOCK_SIZE 8192 + --source alter_table.inc + --replace_column 6 # 7 # 10 # 11 # + SHOW INDEX FROM t1; + + DROP TABLE t1; +} + + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/index_primary.result b/mysql-test/suite/storage_engine/index_primary.result new file mode 100644 index 00000000000..04b114f385e --- /dev/null +++ b/mysql-test/suite/storage_engine/index_primary.result @@ -0,0 +1,53 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a <INT_COLUMN> PRIMARY KEY, +b <CHAR_COLUMN> +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW KEYS IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 0 PRIMARY 1 a # # NULL NULL # # +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); +INSERT INTO t1 (a,b) VALUES (1,'c'); +ERROR 23000: Duplicate entry '1' for key 'PRIMARY' +# Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY). +# If you got a difference in error message, just add it to rdiff file +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN> PRIMARY KEY, +b <CHAR_COLUMN> PRIMARY KEY +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +ERROR 42000: Multiple primary key defined +CREATE TABLE t1 (a <INT_COLUMN>, +b <CHAR_COLUMN>, +PRIMARY KEY (a,b) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 0 PRIMARY 1 a # # NULL NULL # # +t1 0 PRIMARY 2 b # # NULL NULL # # +INSERT INTO t1 (a,b) VALUES (1,'a'),(1,'b'),(2,'a'),(2,'b'); +INSERT INTO t1 (a,b) VALUES (1,'b'); +ERROR 23000: Duplicate entry '1-b' for key 'PRIMARY' +# Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY). +# If you got a difference in error message, just add it to rdiff file +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN> KEY, +b <CHAR_COLUMN>, +<CUSTOM_INDEX> (b) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 0 PRIMARY 1 a # # NULL NULL # # +t1 1 b 1 b # # NULL NULL # # +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>, +b <CHAR_COLUMN> PRIMARY KEY +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 0 PRIMARY 1 b # # NULL NULL # # +ALTER TABLE t1 DROP INDEX `PRIMARY`; +ALTER TABLE t1 ADD CONSTRAINT PRIMARY KEY pk (a); +SHOW KEYS IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 0 PRIMARY 1 a # # NULL NULL # # +ALTER TABLE t1 DROP PRIMARY KEY; +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/index_primary.test b/mysql-test/suite/storage_engine/index_primary.test new file mode 100644 index 00000000000..55671d99e46 --- /dev/null +++ b/mysql-test/suite/storage_engine/index_primary.test @@ -0,0 +1,136 @@ +# +# Basic syntax related to primary keys +# + +--source have_engine.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +let $create_definition = + a $int_indexed_col PRIMARY KEY, + b $char_col +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = PRIMARY KEY + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 6 # 7 # 10 # 11 # + SHOW KEYS IN t1; + + INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); + --let $error_codes = ER_DUP_ENTRY,ER_DUP_KEY + INSERT INTO t1 (a,b) VALUES (1,'c'); + --source check_errors.inc + + DROP TABLE t1; +} + +--let $error_codes = ER_MULTIPLE_PRI_KEY +let $create_definition = + a $int_indexed_col PRIMARY KEY, + b $char_indexed_col PRIMARY KEY +; +--source create_table.inc +if ($mysql_errname != ER_MULTIPLE_PRI_KEY) +{ + --let $my_last_stmt = $create_statement + --let $functionality = PRIMARY KEY + --source unexpected_result.inc +} + +let $create_definition = + a $int_indexed_col, + b $char_indexed_col, + PRIMARY KEY (a,b) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Multi-part keys + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + INSERT INTO t1 (a,b) VALUES (1,'a'),(1,'b'),(2,'a'),(2,'b'); + --let $error_codes = ER_DUP_ENTRY,ER_DUP_KEY + INSERT INTO t1 (a,b) VALUES (1,'b'); + --source check_errors.inc + DROP TABLE t1; +} + + +--let $continue = 1 +--source have_default_index.inc +if ($have_default_index) +{ + # KEY in a column definition means PK! + let $create_definition = + a $int_indexed_col KEY, + b $char_indexed_col, + $default_index (b) + ; + --source create_table.inc + if ($mysql_errname) + { + --let $my_last_stmt = $create_statement + --let $functionality = Multiple keys or PK or keys on CHAR columns + --source unexpected_result.inc + } + if (!$mysql_errname) + { + --replace_column 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + DROP TABLE t1; + } +} + +let $create_definition = + a $int_indexed_col, + b $char_indexed_col PRIMARY KEY +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + + --replace_column 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + --let $alter_definition = DROP INDEX `PRIMARY` + --source alter_table.inc + if ($mysql_errname) + { + --let $my_last_stmt = $alter_statement + --let $functionality = ALTER TABLE + --source unexpected_result.inc + } + if (!$mysql_errname) + { + --let $alter_definition = ADD CONSTRAINT PRIMARY KEY pk (a) + --source alter_table.inc + --source mask_engine.inc + --replace_column 6 # 7 # 10 # 11 # + SHOW KEYS IN t1; + --let $alter_definition = DROP PRIMARY KEY + --source alter_table.inc + } + + DROP TABLE t1; +} + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/index_type_btree.result b/mysql-test/suite/storage_engine/index_type_btree.result new file mode 100644 index 00000000000..e0b3ac546f2 --- /dev/null +++ b/mysql-test/suite/storage_engine/index_type_btree.result @@ -0,0 +1,67 @@ +CREATE TABLE t1 (a <INT_COLUMN>, +b <CHAR_COLUMN>, +<CUSTOM_INDEX> USING BTREE (a) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW KEYS IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 a 1 a # # NULL NULL # BTREE +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>, +b <CHAR_COLUMN>, +<CUSTOM_INDEX> a_b USING BTREE (a,b) COMMENT 'a_b index' + ) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW KEYS IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 a_b 1 a # # NULL NULL # BTREE a_b index +t1 1 a_b 2 b # # NULL NULL # BTREE a_b index +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>, +b <CHAR_COLUMN>, +<CUSTOM_INDEX> USING BTREE (a), +<CUSTOM_INDEX> USING BTREE (b) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW KEYS IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 a 1 a # # NULL NULL # BTREE +t1 1 b 1 b # # NULL NULL # BTREE +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>, +b <CHAR_COLUMN>, +UNIQUE INDEX USING BTREE (a) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW KEYS IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 0 a 1 a # # NULL NULL # BTREE +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); +INSERT INTO t1 (a,b) VALUES (1,'c'); +ERROR 23000: Duplicate entry '1' for key 'a' +# Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY). +# If you got a difference in error message, just add it to rdiff file +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (100,'z'); +ALTER TABLE t1 ADD <CUSTOM_INDEX> (a) USING BTREE COMMENT 'simple index on a'; +SHOW INDEX FROM t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 a 1 a # # NULL NULL # BTREE simple index on a +ALTER TABLE t1 DROP KEY a; +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>, +b <CHAR_COLUMN>, +UNIQUE INDEX USING BTREE (a) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW KEYS IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 0 a 1 a # # NULL NULL # BTREE +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); +INSERT INTO t1 (a,b) VALUES (1,'c'); +ERROR 23000: Duplicate entry '1' for key 'a' +# Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY). +# If you got a difference in error message, just add it to rdiff file +ALTER TABLE t1 DROP INDEX a; +INSERT INTO t1 (a,b) VALUES (1,'c'); +ALTER TABLE t1 ADD UNIQUE INDEX a(a) USING BTREE; +ERROR 23000: Duplicate entry '1' for key 'a' +# Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY). +# If you got a difference in error message, just add it to rdiff file +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/index_type_btree.test b/mysql-test/suite/storage_engine/index_type_btree.test new file mode 100644 index 00000000000..c521221820e --- /dev/null +++ b/mysql-test/suite/storage_engine/index_type_btree.test @@ -0,0 +1,12 @@ +# +# Index type BTREE +# + +--source have_engine.inc + +let $index_type = BTREE; + +--source index.inc + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/index_type_hash.result b/mysql-test/suite/storage_engine/index_type_hash.result new file mode 100644 index 00000000000..f26663418bf --- /dev/null +++ b/mysql-test/suite/storage_engine/index_type_hash.result @@ -0,0 +1,67 @@ +CREATE TABLE t1 (a <INT_COLUMN>, +b <CHAR_COLUMN>, +<CUSTOM_INDEX> USING HASH (a) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW KEYS IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 a 1 a # # NULL NULL # HASH +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>, +b <CHAR_COLUMN>, +<CUSTOM_INDEX> a_b USING HASH (a,b) COMMENT 'a_b index' + ) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW KEYS IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 a_b 1 a # # NULL NULL # HASH a_b index +t1 1 a_b 2 b # # NULL NULL # HASH a_b index +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>, +b <CHAR_COLUMN>, +<CUSTOM_INDEX> USING HASH (a), +<CUSTOM_INDEX> USING HASH (b) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW KEYS IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 a 1 a # # NULL NULL # HASH +t1 1 b 1 b # # NULL NULL # HASH +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>, +b <CHAR_COLUMN>, +UNIQUE INDEX USING HASH (a) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW KEYS IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 0 a 1 a # # NULL NULL # HASH +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); +INSERT INTO t1 (a,b) VALUES (1,'c'); +ERROR 23000: Duplicate entry '1' for key 'a' +# Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY). +# If you got a difference in error message, just add it to rdiff file +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (100,'z'); +ALTER TABLE t1 ADD <CUSTOM_INDEX> (a) USING HASH COMMENT 'simple index on a'; +SHOW INDEX FROM t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 a 1 a # # NULL NULL # HASH simple index on a +ALTER TABLE t1 DROP KEY a; +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>, +b <CHAR_COLUMN>, +UNIQUE INDEX USING HASH (a) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW KEYS IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 0 a 1 a # # NULL NULL # HASH +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); +INSERT INTO t1 (a,b) VALUES (1,'c'); +ERROR 23000: Duplicate entry '1' for key 'a' +# Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY). +# If you got a difference in error message, just add it to rdiff file +ALTER TABLE t1 DROP INDEX a; +INSERT INTO t1 (a,b) VALUES (1,'c'); +ALTER TABLE t1 ADD UNIQUE INDEX a(a) USING HASH; +ERROR 23000: Duplicate entry '1' for key 'a' +# Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY). +# If you got a difference in error message, just add it to rdiff file +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/index_type_hash.test b/mysql-test/suite/storage_engine/index_type_hash.test new file mode 100644 index 00000000000..c63f41c6344 --- /dev/null +++ b/mysql-test/suite/storage_engine/index_type_hash.test @@ -0,0 +1,12 @@ +# +# Index type HASH +# + +--source have_engine.inc + +let $index_type = HASH; + +--source index.inc + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/insert.result b/mysql-test/suite/storage_engine/insert.result new file mode 100644 index 00000000000..a07a6e8d9a4 --- /dev/null +++ b/mysql-test/suite/storage_engine/insert.result @@ -0,0 +1,149 @@ +DROP TABLE IF EXISTS t1, t2; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 VALUES (100,'foobar'),(1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'); +SELECT * FROM t1; +a b +1 a +100 foobar +2 b +3 c +4 d +5 e +INSERT t1 VALUE (10,'foo'),(11,'abc'); +SELECT * FROM t1; +a b +1 a +10 foo +100 foobar +11 abc +2 b +3 c +4 d +5 e +INSERT INTO t1 (b,a) VALUES ('test',0); +SELECT * FROM t1; +a b +0 test +1 a +10 foo +100 foobar +11 abc +2 b +3 c +4 d +5 e +INSERT INTO t1 VALUES (DEFAULT,DEFAULT); +SELECT * FROM t1; +a b +0 test +1 a +10 foo +100 foobar +11 abc +2 b +3 c +4 d +5 e +NULL NULL +INSERT t1 (a) VALUE (10),(20); +SELECT * FROM t1; +a b +0 test +1 a +10 NULL +10 foo +100 foobar +11 abc +2 b +20 NULL +3 c +4 d +5 e +NULL NULL +INSERT INTO t1 SET a = 11, b = 'f'; +SELECT * FROM t1; +a b +0 test +1 a +10 NULL +10 foo +100 foobar +11 abc +11 f +2 b +20 NULL +3 c +4 d +5 e +NULL NULL +INSERT t1 SET b = DEFAULT; +SELECT * FROM t1; +a b +0 test +1 a +10 NULL +10 foo +100 foobar +11 abc +11 f +2 b +20 NULL +3 c +4 d +5 e +NULL NULL +NULL NULL +CREATE TABLE t2 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t2 SELECT * FROM t1; +INSERT INTO t1 (a) SELECT a FROM t2 WHERE b = 'foo'; +SELECT * FROM t1; +a b +0 test +1 a +10 NULL +10 NULL +10 foo +100 foobar +11 abc +11 f +2 b +20 NULL +3 c +4 d +5 e +NULL NULL +NULL NULL +INSERT t1 SELECT * FROM t1; +SELECT * FROM t1; +a b +0 test +0 test +1 a +1 a +10 NULL +10 NULL +10 NULL +10 NULL +10 foo +10 foo +100 foobar +100 foobar +11 abc +11 abc +11 f +11 f +2 b +2 b +20 NULL +20 NULL +3 c +3 c +4 d +4 d +5 e +5 e +NULL NULL +NULL NULL +NULL NULL +NULL NULL +DROP TABLE t1, t2; diff --git a/mysql-test/suite/storage_engine/insert.test b/mysql-test/suite/storage_engine/insert.test new file mode 100644 index 00000000000..d9076219eb0 --- /dev/null +++ b/mysql-test/suite/storage_engine/insert.test @@ -0,0 +1,78 @@ +# +# Basic INSERT statements +# +# LOW_PRIORITY|HIGH_PRIORITY are covered in insert_high_low_prio test +# DELAYED is covered in insert_delayed test +# IGNORE and ON DUPLICATE KEY UPDATE are covered in insert_with_keys test + +--source have_engine.inc + +--disable_warnings +DROP TABLE IF EXISTS t1, t2; +--enable_warnings + +--source create_table.inc + +# INSERT [INTO] .. VALUES|VALUE .. + +INSERT INTO t1 VALUES (100,'foobar'),(1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'); +if ($mysql_errname) +{ + --let $functionality = INSERT + --source unexpected_result.inc +} +--sorted_result +SELECT * FROM t1; + +INSERT t1 VALUE (10,'foo'),(11,'abc'); +--sorted_result +SELECT * FROM t1; + +INSERT INTO t1 (b,a) VALUES ('test',0); +--sorted_result +SELECT * FROM t1; + +INSERT INTO t1 VALUES (DEFAULT,DEFAULT); +--sorted_result +SELECT * FROM t1; + +INSERT t1 (a) VALUE (10),(20); +--sorted_result +SELECT * FROM t1; + +# INSERT [INTO] .. SET + +INSERT INTO t1 SET a = 11, b = 'f'; +--sorted_result +SELECT * FROM t1; + +INSERT t1 SET b = DEFAULT; +--sorted_result +SELECT * FROM t1; + + +# INSERT .. SELECT + +--let $table_name = t2 +--source create_table.inc +INSERT INTO t2 SELECT * FROM t1; +if ($mysql_errname) +{ + --let $functionality = INSERT .. SELECT + --source unexpected_result.inc +} + + +INSERT INTO t1 (a) SELECT a FROM t2 WHERE b = 'foo'; +--sorted_result +SELECT * FROM t1; + +INSERT t1 SELECT * FROM t1; +--sorted_result +SELECT * FROM t1; + +# Cleanup +DROP TABLE t1, t2; + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/insert_delayed.result b/mysql-test/suite/storage_engine/insert_delayed.result new file mode 100644 index 00000000000..98e149bdf96 --- /dev/null +++ b/mysql-test/suite/storage_engine/insert_delayed.result @@ -0,0 +1,25 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (1,'f'),(2,'b'); +LOCK TABLE t1 READ; +connect con0,localhost,root,,; +SET lock_wait_timeout = 1; +INSERT DELAYED INTO t1 (a,b) VALUES (3,'c'); +INSERT DELAYED INTO t1 SET a=4, b='d'; +INSERT DELAYED INTO t1 SELECT 5, 'e'; +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +disconnect con0; +connection default; +SELECT * FROM t1; +a b +1 f +2 b +UNLOCK TABLES; +FLUSH TABLES; +SELECT * FROM t1; +a b +1 f +2 b +3 c +4 d +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/insert_delayed.test b/mysql-test/suite/storage_engine/insert_delayed.test new file mode 100644 index 00000000000..7c3c4eec768 --- /dev/null +++ b/mysql-test/suite/storage_engine/insert_delayed.test @@ -0,0 +1,62 @@ +# +# INSERT DELAYED +# + +--source have_engine.inc + +if (`SELECT @@log_bin AND @@binlog_format IN ('statement','mixed')`) +{ + --source cleanup_engine.inc + --skip # INSERT DELAYED does not work with binlog format STATEMENT or MIXED +} + +--source include/count_sessions.inc + +--enable_connect_log + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +--let $create_definition = a $int_col, b $char_col +--source create_table.inc +INSERT INTO t1 (a,b) VALUES (1,'f'),(2,'b'); + +LOCK TABLE t1 READ; +if ($mysql_errname) +{ + --let $functionality = LOCK TABLE .. READ + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --connect (con0,localhost,root,,) + SET lock_wait_timeout = 1; + INSERT DELAYED INTO t1 (a,b) VALUES (3,'c'); + if ($mysql_errname) + { + --let $functionality = INSERT DELAYED + --source unexpected_result.inc + } + INSERT DELAYED INTO t1 SET a=4, b='d'; + # DELAYED is ignored with INSERT .. SELECT + --let $error_codes = ER_LOCK_WAIT_TIMEOUT + INSERT DELAYED INTO t1 SELECT 5, 'e'; + --source check_errors.inc + + --disconnect con0 + --connection default + SELECT * FROM t1; +} +UNLOCK TABLES; +FLUSH TABLES; +SELECT * FROM t1; + +# Cleanup +DROP TABLE t1; + +let $wait_timeout = 30; +--source include/wait_until_count_sessions.inc + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/insert_high_prio.result b/mysql-test/suite/storage_engine/insert_high_prio.result new file mode 100644 index 00000000000..66378564ff7 --- /dev/null +++ b/mysql-test/suite/storage_engine/insert_high_prio.result @@ -0,0 +1,64 @@ +DROP TABLE IF EXISTS t1; +SET @low_prio_updates = @@global.low_priority_updates; +SET @concur_insert = @@global.concurrent_insert; +SET GLOBAL concurrent_insert = NEVER; +connect con0,localhost,root,,; +SET lock_wait_timeout = 4; +connect con1,localhost,root,,; +SET lock_wait_timeout = 4; +connect con2,localhost,root,,; +SET lock_wait_timeout = 4; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (1,'f'),(2,'b'); +SET GLOBAL LOW_PRIORITY_UPDATES = 1; +connection con1; +SELECT SLEEP(1) FROM t1; +connection con0; +INSERT INTO t1 (a,b) VALUES (3,'z'); +connection con2; +# Should return only 2 rows +SELECT SLEEP(1) FROM t1; +SLEEP(1) +0 +0 +connection con1; +SLEEP(1) +0 +0 +connection con0; +SELECT * FROM t1; +a b +1 f +2 b +3 z +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (1,'f'),(2,'b'); +connection con1; +SELECT SLEEP(1) FROM t1; +connection con0; +INSERT HIGH_PRIORITY INTO t1 (a,b) VALUES (3,'z'); +connection con2; +# Should return 3 rows +SELECT SLEEP(1) FROM t1; +SLEEP(1) +0 +0 +0 +connection con1; +SLEEP(1) +0 +0 +connection con0; +SELECT * FROM t1; +a b +1 f +2 b +3 z +disconnect con1; +disconnect con2; +disconnect con0; +connection default; +SET GLOBAL low_priority_updates = @low_prio_updates; +SET GLOBAL concurrent_insert = @concur_insert; +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/insert_high_prio.test b/mysql-test/suite/storage_engine/insert_high_prio.test new file mode 100644 index 00000000000..819e996d468 --- /dev/null +++ b/mysql-test/suite/storage_engine/insert_high_prio.test @@ -0,0 +1,143 @@ +# +# INSERT HIGH_PRIOIRITY +# +--source have_engine.inc + +--source include/count_sessions.inc + +--enable_connect_log + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +# We will be changing the GLOBAL value of low_priority_updates +# due to bug#64892 +# (Session-level low_priority_updates does not work for INSERT) +SET @low_prio_updates = @@global.low_priority_updates; + +# Concurrent insert might interfere +# with HIGH|LOW_PRIORITY logic +SET @concur_insert = @@global.concurrent_insert; +SET GLOBAL concurrent_insert = NEVER; + +# We will have 3 connections: +# con1 will start SELECT which should give us enough time; +# con0 will run INSERT +# con2 will then start another SELECT. +# With standard INSERT and low_priority_updates=1 +# we should see only old rows in both resultsets, +# while with INSERT HIGH_PRIORITY we should see new rows in con2 resultset. + +--connect (con0,localhost,root,,) +SET lock_wait_timeout = 4; +--connect (con1,localhost,root,,) +SET lock_wait_timeout = 4; +--connect (con2,localhost,root,,) +SET lock_wait_timeout = 4; + + +--source create_table.inc +INSERT INTO t1 (a,b) VALUES (1,'f'),(2,'b'); + +# Normal INSERT with low_priority_updates=1 +# should work like INSERT LOW_PRIORITY + +SET GLOBAL LOW_PRIORITY_UPDATES = 1; + +--connection con1 +--send +SELECT SLEEP(1) FROM t1; + +--connection con0 +let $show_statement = SHOW PROCESSLIST; +let $field = State; +let $condition = = 'User sleep'; +let $wait_timeout = 2; +--source include/wait_show_condition.inc +--send +INSERT INTO t1 (a,b) VALUES (3,'z'); + +--connection con2 +let $condition = = 'Waiting for table level lock'; +let $wait_timeout = 2; +--source include/wait_show_condition.inc +if (!$found) +{ + --let $mysql_errname = timeout in wait_show_condition.inc + --let $functionality = @@low_priority_updates or INSERT or table locking + --source unexpected_result.inc +} +if ($found) +{ + --echo # Should return only 2 rows + SELECT SLEEP(1) FROM t1; +} + +--connection con1 +--reap + +--connection con0 +--reap +--sorted_result +SELECT * FROM t1; + +DROP TABLE t1; + +--source create_table.inc +INSERT INTO t1 (a,b) VALUES (1,'f'),(2,'b'); + +# INSERT HIGH_PRIORITY should override low_priority_updates=1 + +--connection con1 +--send +SELECT SLEEP(1) FROM t1; + +--connection con0 +let $condition = = 'User sleep'; +let $wait_timeout = 2; +--source include/wait_show_condition.inc +--send +INSERT HIGH_PRIORITY INTO t1 (a,b) VALUES (3,'z'); + +--connection con2 +let $condition = = 'Waiting for table level lock'; +let $wait_timeout = 2; +--source include/wait_show_condition.inc +if (!$found) +{ + --let $mysql_errname = timeout in wait_show_condition.inc + --let $functionality = @@low_priority_updates or INSERT HIGH_PRIORITY or table locking + --source unexpected_result.inc +} +if ($found) +{ + --echo # Should return 3 rows + SELECT SLEEP(1) FROM t1; +} + +--connection con1 +--reap + +--connection con0 +--reap +--sorted_result +SELECT * FROM t1; + +--disconnect con1 +--disconnect con2 +--disconnect con0 +let $wait_timeout = 30; + +--connection default + +SET GLOBAL low_priority_updates = @low_prio_updates; +SET GLOBAL concurrent_insert = @concur_insert; + +# Cleanup +DROP TABLE t1; + +--source include/wait_until_count_sessions.inc + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/insert_low_prio.result b/mysql-test/suite/storage_engine/insert_low_prio.result new file mode 100644 index 00000000000..561b6296380 --- /dev/null +++ b/mysql-test/suite/storage_engine/insert_low_prio.result @@ -0,0 +1,39 @@ +DROP TABLE IF EXISTS t1; +SET @low_prio_updates = @@global.low_priority_updates; +SET @concur_insert = @@global.concurrent_insert; +SET GLOBAL concurrent_insert = NEVER; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (1,'f'),(2,'b'); +connect con0,localhost,root,,; +SET lock_wait_timeout = 4; +connect con1,localhost,root,,; +SET lock_wait_timeout = 4; +connect con2,localhost,root,,; +SET lock_wait_timeout = 4; +connection con1; +SELECT SLEEP(1) FROM t1; +connection con0; +INSERT LOW_PRIORITY INTO t1 (a,b) VALUES (3,'z'); +connection con2; +# Should return only 2 rows +SELECT SLEEP(1) FROM t1; +SLEEP(1) +0 +0 +connection con1; +SLEEP(1) +0 +0 +connection con0; +SELECT * FROM t1; +a b +1 f +2 b +3 z +disconnect con0; +disconnect con1; +disconnect con2; +connection default; +SET GLOBAL low_priority_updates = @low_prio_updates; +SET GLOBAL concurrent_insert = @concur_insert; +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/insert_low_prio.test b/mysql-test/suite/storage_engine/insert_low_prio.test new file mode 100644 index 00000000000..30f47833162 --- /dev/null +++ b/mysql-test/suite/storage_engine/insert_low_prio.test @@ -0,0 +1,95 @@ +# +# INSERT LOW_PRIORITY +# +--source have_engine.inc + +--source include/count_sessions.inc + +--enable_connect_log + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +# We will be changing the GLOBAL value of low_priority_updates +# due to bug#64892 +# (Session-level low_priority_updates does not work for INSERT) +SET @low_prio_updates = @@global.low_priority_updates; + +# Concurrent insert might interfere +# with HIGH|LOW_PRIORITY logic +SET @concur_insert = @@global.concurrent_insert; +SET GLOBAL concurrent_insert = NEVER; + +--source create_table.inc +INSERT INTO t1 (a,b) VALUES (1,'f'),(2,'b'); + +# We will have 3 connections: +# con1 will start SELECT which should give us enough time; +# con0 will run INSERT +# con2 will then start another SELECT. +# With INSERT LOW_PRIORITY we should see only old rows in both resultsets. + +--connect (con0,localhost,root,,) +SET lock_wait_timeout = 4; +--connect (con1,localhost,root,,) +SET lock_wait_timeout = 4; +--connect (con2,localhost,root,,) +SET lock_wait_timeout = 4; + +--connection con1 + +--send +SELECT SLEEP(1) FROM t1; + +--connection con0 +let $show_statement = SHOW PROCESSLIST; +let $field = State; +let $condition = = 'User sleep'; +# We don't need to wait long, +# thread should show up in the processlist right away +let $wait_timeout = 2; +--source include/wait_show_condition.inc +--send +INSERT LOW_PRIORITY INTO t1 (a,b) VALUES (3,'z'); + +--connection con2 + +let $condition = = 'Waiting for table level lock'; +let $wait_timeout = 2; +--source include/wait_show_condition.inc +if (!$found) +{ + --let $mysql_errname = timeout in wait_show_condition + --let $functionality = INSERT LOW_PRIORITY or table locking + --source unexpected_result.inc +} +if ($found) +{ + --echo # Should return only 2 rows + SELECT SLEEP(1) FROM t1; +} + +--connection con1 +--reap + +--connection con0 +--reap +--sorted_result +SELECT * FROM t1; + +--disconnect con0 +--disconnect con1 +--disconnect con2 +--connection default + +SET GLOBAL low_priority_updates = @low_prio_updates; +SET GLOBAL concurrent_insert = @concur_insert; + +# Cleanup +DROP TABLE t1; + +--source include/wait_until_count_sessions.inc + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/insert_with_keys.result b/mysql-test/suite/storage_engine/insert_with_keys.result new file mode 100644 index 00000000000..175e7eeb2c7 --- /dev/null +++ b/mysql-test/suite/storage_engine/insert_with_keys.result @@ -0,0 +1,148 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>, <CUSTOM_INDEX>(b)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'); +INSERT INTO t1 (a,b) VALUES (100,'a'), (6,'f'); +INSERT INTO t1 (a,b) VALUES (30,'m'),(29,'n'); +INSERT INTO t1 (a,b) VALUES (1,'a'),(12345,'z'); +INSERT INTO t1 (a,b) VALUES (3,'a'),(0,''); +SELECT * FROM t1; +a b +0 +1 a +1 a +100 a +12345 z +2 b +29 n +3 a +3 c +30 m +4 d +5 e +6 f +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>, UNIQUE INDEX(a)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'); +INSERT INTO t1 (a,b) VALUES (100,'a'), (6,'f'); +INSERT INTO t1 (a,b) VALUES (30,'m'),(29,'n'); +INSERT INTO t1 (a,b) VALUES (1,'a'),(12345,'z'); +ERROR 23000: Duplicate entry '1' for key 'a' +# Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY). +# If you got a difference in error message, just add it to rdiff file +INSERT INTO t1 (a,b) VALUES (3,'a'),(0,''); +ERROR 23000: Duplicate entry '3' for key 'a' +# Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY). +# If you got a difference in error message, just add it to rdiff file +INSERT INTO t1 (a,b) VALUES (0,''); +SELECT * FROM t1; +a b +0 +1 a +100 a +2 b +29 n +3 c +30 m +4 d +5 e +6 f +INSERT IGNORE INTO t1 (a,b) VALUES (1,'a'),(12345,'z'); +INSERT INTO t1 (a,b) VALUES (3,'a'),(4,'d') ON DUPLICATE KEY UPDATE a = a+10; +SELECT * FROM t1; +a b +0 +1 a +100 a +12345 z +13 c +14 d +2 b +29 n +30 m +5 e +6 f +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>, UNIQUE INDEX(a,b)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'); +INSERT INTO t1 (a,b) VALUES (100,'a'), (6,'f'); +INSERT INTO t1 (a,b) VALUES (30,'m'),(29,'n'); +INSERT INTO t1 (a,b) VALUES (100,'b'), (2,'c'); +INSERT INTO t1 (a,b) VALUES (1,'a'),(12345,'z'); +ERROR 23000: Duplicate entry '1-a' for key 'a' +# Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY). +# If you got a difference in error message, just add it to rdiff file +SELECT * FROM t1; +a b +1 a +100 a +100 b +2 b +2 c +29 n +3 c +30 m +4 d +5 e +6 f +INSERT IGNORE INTO t1 (a,b) VALUES (1,'a'),(12345,'z'); +INSERT INTO t1 (a,b) VALUES (1,'a'),(12345,'z') ON DUPLICATE KEY UPDATE a = a+VALUES(a); +SELECT * FROM t1; +a b +100 a +100 b +2 a +2 b +2 c +24690 z +29 n +3 c +30 m +4 d +5 e +6 f +INSERT INTO t1 (a,b) VALUES (101,'x'),(101,'x'); +ERROR 23000: Duplicate entry '101-x' for key 'a' +# Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY). +# If you got a difference in error message, just add it to rdiff file +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN> PRIMARY KEY, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'); +INSERT INTO t1 (a,b) VALUES (100,'a'), (6,'f'); +INSERT INTO t1 (a,b) VALUES (30,'m'),(29,'n'); +INSERT INTO t1 (a,b) VALUES (1,'a'),(12345,'z'); +ERROR 23000: Duplicate entry '1' for key 'PRIMARY' +# Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY). +# If you got a difference in error message, just add it to rdiff file +INSERT INTO t1 (a,b) VALUES (3,'a'),(0,''); +ERROR 23000: Duplicate entry '3' for key 'PRIMARY' +# Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY). +# If you got a difference in error message, just add it to rdiff file +INSERT INTO t1 (a,b) VALUES (0,''); +SELECT * FROM t1; +a b +0 +1 a +100 a +2 b +29 n +3 c +30 m +4 d +5 e +6 f +INSERT IGNORE INTO t1 (a,b) VALUES (1,'a'),(12345,'z'); +INSERT INTO t1 (a,b) VALUES (1,'a'),(12345,'z') ON DUPLICATE KEY UPDATE b = CONCAT(b,b); +SELECT * FROM t1; +a b +0 +1 aa +100 a +12345 zz +2 b +29 n +3 c +30 m +4 d +5 e +6 f +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/insert_with_keys.test b/mysql-test/suite/storage_engine/insert_with_keys.test new file mode 100644 index 00000000000..1959b55c707 --- /dev/null +++ b/mysql-test/suite/storage_engine/insert_with_keys.test @@ -0,0 +1,143 @@ +# +# INSERT statements for tables with keys +# +--source have_engine.inc +--source have_default_index.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +--let $create_definition = a $int_col, b $char_indexed_col, $default_index(b) +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Indexes on CHAR columns + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'); + INSERT INTO t1 (a,b) VALUES (100,'a'), (6,'f'); + INSERT INTO t1 (a,b) VALUES (30,'m'),(29,'n'); + INSERT INTO t1 (a,b) VALUES (1,'a'),(12345,'z'); + INSERT INTO t1 (a,b) VALUES (3,'a'),(0,''); + --sorted_result + SELECT * FROM t1; + DROP TABLE t1; +} + +--let $create_definition = a $int_indexed_col, b $char_col, UNIQUE INDEX(a) +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Unique indexes + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'); + INSERT INTO t1 (a,b) VALUES (100,'a'), (6,'f'); + INSERT INTO t1 (a,b) VALUES (30,'m'),(29,'n'); + --let $error_codes = ER_DUP_ENTRY,ER_DUP_KEY + INSERT INTO t1 (a,b) VALUES (1,'a'),(12345,'z'); + --source check_errors.inc + --let $error_codes = ER_DUP_ENTRY,ER_DUP_KEY + INSERT INTO t1 (a,b) VALUES (3,'a'),(0,''); + --source check_errors.inc + INSERT INTO t1 (a,b) VALUES (0,''); + --sorted_result + SELECT * FROM t1; + + INSERT IGNORE INTO t1 (a,b) VALUES (1,'a'),(12345,'z'); + if ($mysql_errname) + { + --source unexpected_result.inc + } + INSERT INTO t1 (a,b) VALUES (3,'a'),(4,'d') ON DUPLICATE KEY UPDATE a = a+10; + if ($mysql_errname) + { + --source unexpected_result.inc + } + + --sorted_result + SELECT * FROM t1; + + DROP TABLE t1; +} + +--let $create_definition = a $int_indexed_col, b $char_indexed_col, UNIQUE INDEX(a,b) +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Multi-part indexes + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'); + INSERT INTO t1 (a,b) VALUES (100,'a'), (6,'f'); + INSERT INTO t1 (a,b) VALUES (30,'m'),(29,'n'); + INSERT INTO t1 (a,b) VALUES (100,'b'), (2,'c'); + --let $error_codes = ER_DUP_ENTRY,ER_DUP_KEY + INSERT INTO t1 (a,b) VALUES (1,'a'),(12345,'z'); + --source check_errors.inc + --sorted_result + SELECT * FROM t1; + + INSERT IGNORE INTO t1 (a,b) VALUES (1,'a'),(12345,'z'); + INSERT INTO t1 (a,b) VALUES (1,'a'),(12345,'z') ON DUPLICATE KEY UPDATE a = a+VALUES(a); + --sorted_result + SELECT * FROM t1; + + --let $error_codes = ER_DUP_ENTRY,ER_DUP_KEY + INSERT INTO t1 (a,b) VALUES (101,'x'),(101,'x'); + --source check_errors.inc + DROP TABLE t1; +} + +--let $create_definition = a $int_indexed_col PRIMARY KEY, b $char_col +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Primary keys + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'); + INSERT INTO t1 (a,b) VALUES (100,'a'), (6,'f'); + INSERT INTO t1 (a,b) VALUES (30,'m'),(29,'n'); + --let $error_codes = ER_DUP_ENTRY,ER_DUP_KEY + INSERT INTO t1 (a,b) VALUES (1,'a'),(12345,'z'); + --source check_errors.inc + --let $error_codes = ER_DUP_ENTRY,ER_DUP_KEY + INSERT INTO t1 (a,b) VALUES (3,'a'),(0,''); + --source check_errors.inc + INSERT INTO t1 (a,b) VALUES (0,''); + --sorted_result + SELECT * FROM t1; + + INSERT IGNORE INTO t1 (a,b) VALUES (1,'a'),(12345,'z'); + if ($mysql_errname) + { + --source unexpected_result.inc + } + + INSERT INTO t1 (a,b) VALUES (1,'a'),(12345,'z') ON DUPLICATE KEY UPDATE b = CONCAT(b,b); + if ($mysql_errname) + { + --source unexpected_result.inc + } + --sorted_result + SELECT * FROM t1; + + DROP TABLE t1; +} + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/loaddata.result b/mysql-test/suite/storage_engine/loaddata.result new file mode 100644 index 00000000000..85608cdc32a --- /dev/null +++ b/mysql-test/suite/storage_engine/loaddata.result @@ -0,0 +1,68 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +LOAD DATA INFILE '<DATADIR>/se_loaddata.dat' INTO TABLE t1 +FIELDS TERMINATED BY ','; +SELECT * FROM t1; +a b +1 foo +2 bar +3 +4 abc +LOAD DATA LOCAL INFILE '<DATADIR>/se_loaddata.dat' INTO TABLE t1 +CHARACTER SET utf8 COLUMNS TERMINATED BY ',' + ESCAPED BY '/'; +SELECT * FROM t1; +a b +1 foo +1 foo +2 bar +2 bar +3 +3 +4 abc +4 abc +LOAD DATA INFILE '<DATADIR>/se_loaddata.dat' INTO TABLE t1 +FIELDS TERMINATED BY ';' + OPTIONALLY ENCLOSED BY '''' + LINES STARTING BY 'prefix:' +IGNORE 2 LINES +(a,b); +Warnings: +Warning 1262 Row 2 was truncated; it contained more data than there were input columns +SELECT * FROM t1; +a b +0 +1 foo +1 foo +100 foo +2 bar +2 bar +3 +3 +4 abc +4 abc +7 test +LOAD DATA LOCAL INFILE '<DATADIR>/se_loaddata.dat' INTO TABLE t1 +FIELDS TERMINATED BY ';' + (a) SET b='loaded'; +Warnings: +Warning 1262 Row 1 was truncated; it contained more data than there were input columns +Warning 1262 Row 2 was truncated; it contained more data than there were input columns +Warning 1262 Row 3 was truncated; it contained more data than there were input columns +SELECT * FROM t1; +a b +0 +0 loaded +1 foo +1 foo +100 foo +102 loaded +2 bar +2 bar +3 +3 +4 abc +4 abc +5 loaded +7 test +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/loaddata.test b/mysql-test/suite/storage_engine/loaddata.test new file mode 100644 index 00000000000..c413184af00 --- /dev/null +++ b/mysql-test/suite/storage_engine/loaddata.test @@ -0,0 +1,88 @@ +# +# Basic LOAD DATA statements +# + +--source have_engine.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +--source create_table.inc + +let $datadir = `SELECT @@datadir`; + +--write_file $datadir/se_loaddata.dat +1,foo, +2,bar, +3,, +4,abc, +EOF + +--replace_result $datadir <DATADIR> +eval +LOAD DATA INFILE '$datadir/se_loaddata.dat' INTO TABLE t1 + FIELDS TERMINATED BY ','; +if ($mysql_errname) +{ + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --sorted_result + SELECT * FROM t1; + + --replace_result $datadir <DATADIR> + eval + LOAD DATA LOCAL INFILE '$datadir/se_loaddata.dat' INTO TABLE t1 + CHARACTER SET utf8 COLUMNS TERMINATED BY ',' + ESCAPED BY '/'; + --sorted_result + SELECT * FROM t1; + + --remove_file $datadir/se_loaddata.dat + --write_file $datadir/se_loaddata.dat +prefix:5;'foo'; +prefix:6;''; +prefix:100;foo; +prefix:7;'test';suffix +101;abc; +102;'z'; +prefix:0;; +EOF + + --replace_result $datadir <DATADIR> + eval + LOAD DATA INFILE '$datadir/se_loaddata.dat' INTO TABLE t1 + FIELDS TERMINATED BY ';' + OPTIONALLY ENCLOSED BY '''' + LINES STARTING BY 'prefix:' + IGNORE 2 LINES + (a,b); + + --sorted_result + SELECT * FROM t1; + + --remove_file $datadir/se_loaddata.dat + --write_file $datadir/se_loaddata.dat +5;YYY; +102;'zzz'; +0;'test'; +EOF + + --replace_result $datadir <DATADIR> + eval + LOAD DATA LOCAL INFILE '$datadir/se_loaddata.dat' INTO TABLE t1 + FIELDS TERMINATED BY ';' + (a) SET b='loaded'; + + --sorted_result + SELECT * FROM t1; +} + +# Cleanup +--remove_file $datadir/se_loaddata.dat +DROP TABLE t1; + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/lock.result b/mysql-test/suite/storage_engine/lock.result new file mode 100644 index 00000000000..73573381110 --- /dev/null +++ b/mysql-test/suite/storage_engine/lock.result @@ -0,0 +1,111 @@ +connect con1,localhost,root,,; +SET lock_wait_timeout=1; +connection default; +DROP TABLE IF EXISTS t1, t2, t3; +CREATE TABLE t1 (id <INT_COLUMN>, id2 <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (id,id2) VALUES (1,1),(1,2),(1,3); +LOCK TABLE t1 LOW_PRIORITY WRITE; +SELECT id2,COUNT(DISTINCT id) FROM t1 GROUP BY id2; +id2 COUNT(DISTINCT id) +1 1 +2 1 +3 1 +UPDATE t1 SET id=-1 WHERE id=1; +connection con1; +SELECT * FROM t1; +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +LOCK TABLE t1 READ; +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +connection default; +LOCK TABLE t1 READ; +UPDATE t1 SET id=1 WHERE id=1; +ERROR HY000: Table 't1' was locked with a READ lock and can't be updated +connection con1; +SELECT COUNT(DISTINCT id) FROM t1; +COUNT(DISTINCT id) +1 +UPDATE t1 SET id=2 WHERE id=2; +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +LOCK TABLE t1 WRITE; +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +LOCK TABLE t1 READ; +UNLOCK TABLES; +connection default; +CREATE TABLE t2 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +ERROR HY000: Table 't2' was not locked with LOCK TABLES +CREATE TEMPORARY TABLE t2 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +DROP TABLE IF EXISTS t2; +UNLOCK TABLES; +CREATE TABLE t2 (id <INT_COLUMN>, id2 <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +LOCK TABLE t1 WRITE, t2 WRITE; +INSERT INTO t2 SELECT * FROM t1; +UPDATE t1 SET id=1 WHERE id=-1; +DROP TABLE t1,t2; +CREATE TABLE t1 (i1 <INT_COLUMN>, nr <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE t2 (nr <INT_COLUMN>, nm <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t2 (nr,nm) VALUES (1,3); +INSERT INTO t2 (nr,nm) VALUES (2,4); +lock tables t1 write, t2 read; +INSERT INTO t1 (i1,nr) SELECT 1, nr FROM t2 WHERE nm=3; +INSERT INTO t1 (i1,nr) SELECT 2, nr FROM t2 WHERE nm=4; +UNLOCK TABLES; +LOCK TABLES t1 WRITE; +INSERT INTO t1 (i1,nr) SELECT i1, nr FROM t1; +ERROR HY000: Table 't1' was not locked with LOCK TABLES +UNLOCK TABLES; +LOCK TABLES t1 WRITE, t1 AS t1_alias READ; +INSERT INTO t1 (i1,nr) SELECT i1, nr FROM t1 AS t1_alias; +DROP TABLE t1,t2; +ERROR HY000: Table 't2' was not locked with LOCK TABLES +UNLOCK TABLES; +DROP TABLE t1,t2; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE t2 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE t3 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +LOCK TABLES t1 WRITE, t2 WRITE, t3 WRITE; +DROP TABLE t2, t3, t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE t2 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE t3 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +LOCK TABLES t1 WRITE, t2 WRITE, t3 WRITE, t1 AS t4 READ; +ALTER TABLE t2 ADD COLUMN c2 <INT_COLUMN>; +DROP TABLE t1, t2, t3; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE t2 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +LOCK TABLE t1 READ, t2 READ; +FLUSH TABLE t1; +ERROR HY000: Table 't1' was locked with a READ lock and can't be updated +FLUSH TABLES; +ERROR HY000: Table 't2' was locked with a READ lock and can't be updated +FLUSH TABLES t1, t2 WITH READ LOCK; +ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction +UNLOCK TABLES; +FLUSH TABLES t1, t2 WITH READ LOCK; +connection con1; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +connection default; +UNLOCK TABLES; +FLUSH TABLES WITH READ LOCK; +connection con1; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +connection default; +UNLOCK TABLES; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); +FLUSH TABLES WITH READ LOCK AND DISABLE CHECKPOINT; +DROP TABLE t1, t2; +ERROR HY000: Can't execute the query because you have a conflicting read lock +UNLOCK TABLES; +DROP TABLE t1, t2; +disconnect con1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE t2 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +LOCK TABLE t1 WRITE, t2 WRITE; +CREATE TEMPORARY TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +FLUSH TABLE t1; +DROP TEMPORARY TABLE t1; +SELECT * FROM t1; +a b +UNLOCK TABLES; +DROP TABLE t1, t2; diff --git a/mysql-test/suite/storage_engine/lock.test b/mysql-test/suite/storage_engine/lock.test new file mode 100644 index 00000000000..16872bdaa7d --- /dev/null +++ b/mysql-test/suite/storage_engine/lock.test @@ -0,0 +1,244 @@ +# Standard table locking: +# LOCK TABLE .. READ +# LOCK TABLE .. [LOW_PRIORITY] WRITE +# UNLOCK TABLES +# +# and global locking: +# FLUSH TABLES [..] WITH READ LOCK +# +# +--source have_engine.inc + +--enable_connect_log + +# Save the initial number of concurrent sessions. +--source include/count_sessions.inc + +connect (con1,localhost,root,,); +SET lock_wait_timeout=1; + +connection default; + +--disable_warnings +DROP TABLE IF EXISTS t1, t2, t3; +--enable_warnings + +--let $create_definition = id $int_col, id2 $int_col +--source create_table.inc + +INSERT INTO t1 (id,id2) VALUES (1,1),(1,2),(1,3); + +# LOW_PRIORITY has no effect, but is still syntactically correct +LOCK TABLE t1 LOW_PRIORITY WRITE; +SELECT id2,COUNT(DISTINCT id) FROM t1 GROUP BY id2; + +UPDATE t1 SET id=-1 WHERE id=1; +if ($mysql_errname) +{ + --let $functionality = UPDATE + --source unexpected_result.inc +} + +connection con1; +# With WRITE lock held by connection 'default', +# nobody else can access the table +--let $error_codes = ER_LOCK_WAIT_TIMEOUT +SELECT * FROM t1; +--source check_errors.inc +--let $error_codes = ER_LOCK_WAIT_TIMEOUT +LOCK TABLE t1 READ; +--source check_errors.inc + +connection default; +LOCK TABLE t1 READ; +--let $error_codes = ER_TABLE_NOT_LOCKED_FOR_WRITE +UPDATE t1 SET id=1 WHERE id=1; +--source check_errors.inc +if ($mysql_errname != ER_TABLE_NOT_LOCKED_FOR_WRITE) +{ + --let $functonality = UPDATE or locking + --source unexpected_result.inc +} + +connection con1; +# With READ lock held by connection 'default', +# it should be possible to read from the table +# or acquire another READ lock, +# but not update it or acquire WRITE lock +SELECT COUNT(DISTINCT id) FROM t1; +--let $error_codes = ER_LOCK_WAIT_TIMEOUT +UPDATE t1 SET id=2 WHERE id=2; +--source check_errors.inc +--let $error_codes = ER_LOCK_WAIT_TIMEOUT +LOCK TABLE t1 WRITE; +--source check_errors.inc +LOCK TABLE t1 READ; +UNLOCK TABLES; + + +--connection default + +--let $error_codes = ER_TABLE_NOT_LOCKED +--let $table_name = t2 +--source create_table.inc + +--let $table_name = t2 +--let $temporary = 1 +--source create_table.inc + +DROP TABLE IF EXISTS t2; + +UNLOCK TABLES; + +--let $table_name = t2 +--let $create_definition = id $int_col, id2 $int_col +--source create_table.inc +LOCK TABLE t1 WRITE, t2 WRITE; +INSERT INTO t2 SELECT * FROM t1; +UPDATE t1 SET id=1 WHERE id=-1; +if ($mysql_errname) +{ + --let $functionality = UPDATE + --source unexpected_result.inc +} +DROP TABLE t1,t2; + +# +# INSERT ... SELECT with lock tables +# + +--let $create_definition = i1 $int_col, nr $int_col +--source create_table.inc + +--let $table_name = t2 +--let $create_definition = nr $int_col, nm $int_col +--source create_table.inc + +INSERT INTO t2 (nr,nm) VALUES (1,3); +INSERT INTO t2 (nr,nm) VALUES (2,4); + +lock tables t1 write, t2 read; +INSERT INTO t1 (i1,nr) SELECT 1, nr FROM t2 WHERE nm=3; +INSERT INTO t1 (i1,nr) SELECT 2, nr FROM t2 WHERE nm=4; +UNLOCK TABLES; + +LOCK TABLES t1 WRITE; +--let $error_codes = ER_TABLE_NOT_LOCKED +INSERT INTO t1 (i1,nr) SELECT i1, nr FROM t1; +--source check_errors.inc +UNLOCK TABLES; +LOCK TABLES t1 WRITE, t1 AS t1_alias READ; +INSERT INTO t1 (i1,nr) SELECT i1, nr FROM t1 AS t1_alias; +--let $error_codes = ER_TABLE_NOT_LOCKED +DROP TABLE t1,t2; +--source check_errors.inc +UNLOCK TABLES; +DROP TABLE t1,t2; + +# +# Check that a dropped table is removed from a lock + +--source create_table.inc +--let $table_name = t2 +--source create_table.inc +--let $table_name = t3 +--source create_table.inc +LOCK TABLES t1 WRITE, t2 WRITE, t3 WRITE; +# This removes one table after the other from the lock. +DROP TABLE t2, t3, t1; +# +# Check that a lock merge works +--source create_table.inc +--let $table_name = t2 +--source create_table.inc +--let $table_name = t3 +--source create_table.inc +LOCK TABLES t1 WRITE, t2 WRITE, t3 WRITE, t1 AS t4 READ; + +--let $alter_definition = ADD COLUMN c2 $int_col +--let $table_name = t2 +--source alter_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $alter_statement + --let $functionality = ALTER TABLE + --source unexpected_result.inc +} + +DROP TABLE t1, t2, t3; + +# FLUSH TABLES is not permitted when there is an active LOCK TABLES .. READ, +# FLUSH TABLES .. WITH READ LOCK should be used instead +# (and for other connections the table is locked) + +--source create_table.inc +--let $table_name = t2 +--source create_table.inc + +LOCK TABLE t1 READ, t2 READ; +--let $error_codes = ER_TABLE_NOT_LOCKED_FOR_WRITE +FLUSH TABLE t1; +--source check_errors.inc +--let $error_codes = ER_TABLE_NOT_LOCKED_FOR_WRITE +FLUSH TABLES; +--source check_errors.inc +--let $error_codes = ER_LOCK_OR_ACTIVE_TRANSACTION +FLUSH TABLES t1, t2 WITH READ LOCK; +--source check_errors.inc +UNLOCK TABLES; + +FLUSH TABLES t1, t2 WITH READ LOCK; + +--connection con1 +--let $error_codes = ER_LOCK_WAIT_TIMEOUT +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); +--source check_errors.inc + +--connection default +UNLOCK TABLES; + +# Global lock + +FLUSH TABLES WITH READ LOCK; + +--connection con1 +--let $error_codes = ER_LOCK_WAIT_TIMEOUT +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); +--source check_errors.inc + +--connection default +UNLOCK TABLES; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); +FLUSH TABLES WITH READ LOCK AND DISABLE CHECKPOINT; +--let $error_codes = ER_CANT_UPDATE_WITH_READLOCK +DROP TABLE t1, t2; +--source check_errors.inc +UNLOCK TABLES; +DROP TABLE t1, t2; + +--disconnect con1 + +# +# Ensure that FLUSH TABLES doesn't substitute a base locked table +# with a temporary one. +# + +--source create_table.inc +--let $table_name = t2 +--source create_table.inc +LOCK TABLE t1 WRITE, t2 WRITE; + +--let $temporary = 1 +--source create_table.inc +FLUSH TABLE t1; +DROP TEMPORARY TABLE t1; +SELECT * FROM t1; +UNLOCK TABLES; +DROP TABLE t1, t2; + +# Check that all connections opened by test cases in this file are really +# gone so execution of other tests won't be affected by their presence. +--source include/wait_until_count_sessions.inc + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/lock_concurrent.result b/mysql-test/suite/storage_engine/lock_concurrent.result new file mode 100644 index 00000000000..65ab3e86fde --- /dev/null +++ b/mysql-test/suite/storage_engine/lock_concurrent.result @@ -0,0 +1,12 @@ +SET lock_wait_timeout = 1; +CREATE TABLE t1 (a <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +LOCK TABLES t1 WRITE CONCURRENT, t1 AS t2 READ; +SET lock_wait_timeout = 1; +LOCK TABLES t1 READ LOCAL; +UNLOCK TABLES; +UNLOCK TABLES; +LOCK TABLES t1 READ LOCAL; +LOCK TABLES t1 WRITE CONCURRENT, t1 AS t2 READ; +UNLOCK TABLES; +UNLOCK TABLES; +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/lock_concurrent.test b/mysql-test/suite/storage_engine/lock_concurrent.test new file mode 100644 index 00000000000..b75ccf0dd9f --- /dev/null +++ b/mysql-test/suite/storage_engine/lock_concurrent.test @@ -0,0 +1,52 @@ +# +# READ LOCAL / WRITE CONCURRENT locks. +# This test is separate from the main lock.test +# because the feature is likely to be unsupported. +# + +--source have_engine.inc + +--source include/count_sessions.inc + +SET lock_wait_timeout = 1; + +--let $create_definition = a $int_col +--source create_table.inc + +LOCK TABLES t1 WRITE CONCURRENT, t1 AS t2 READ; + +connect (con1,localhost,root,,); +SET lock_wait_timeout = 1; + +# If this statement fails with ER_LOCK_WAIT_TIMEOUT, +# most likely the engine does not support LOCK .. WRITE CONCURRENT +LOCK TABLES t1 READ LOCAL; +if ($mysql_errname) +{ + --let $functionality = LOCK .. WRITE CONCURRENT + --source unexpected_result.inc +} + +UNLOCK TABLES; + +connection default; +UNLOCK TABLES; + +connection con1; +LOCK TABLES t1 READ LOCAL; + +connection default; +LOCK TABLES t1 WRITE CONCURRENT, t1 AS t2 READ; +UNLOCK TABLES; + +connection con1; +UNLOCK TABLES; +disconnect con1; + +connection default; +DROP TABLE t1; + +--source include/wait_until_count_sessions.inc + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/mask_engine.inc b/mysql-test/suite/storage_engine/mask_engine.inc new file mode 100644 index 00000000000..3c00af39825 --- /dev/null +++ b/mysql-test/suite/storage_engine/mask_engine.inc @@ -0,0 +1,14 @@ +# +# This include file just replaces the storage engine under test by the generic string <STORAGE_ENGINE> +# in the next statement. More masks can be added by defining $add_regex, e.g. +# let $add_regex = /$data_dir/<DATA_DIR>/ /$index_dir/<INDEX_DIR>/ +# + +--let $regex = /$storage_engine/<STORAGE_ENGINE>/i +if ($add_regex) +{ + --let $regex = $regex $add_regex +} +--let $add_regex = +--replace_regex $regex + diff --git a/mysql-test/suite/storage_engine/misc.result b/mysql-test/suite/storage_engine/misc.result new file mode 100644 index 00000000000..591f172d796 --- /dev/null +++ b/mysql-test/suite/storage_engine/misc.result @@ -0,0 +1,79 @@ +INSERT INTO mysql.event ( +db, +name, +body, +definer, +interval_value, +interval_field, +originator, +character_set_client, +collation_connection, +db_collation, +body_utf8) +values ( +database(), +"ev1", +"select 1", +user(), +100, +"SECOND_MICROSECOND", +1, +'utf8', +'utf8_general_ci', +'utf8_general_ci', +'select 1'); +SHOW EVENTS; +ERROR 42000: This version of MariaDB doesn't yet support 'MICROSECOND' +DROP EVENT ev1; +SELECT TABLE_NAME, COLUMN_NAME, REFERENCED_TABLE_NAME, REFERENCED_COLUMN_NAME +FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE ORDER BY TABLE_NAME; +TABLE_NAME COLUMN_NAME REFERENCED_TABLE_NAME REFERENCED_COLUMN_NAME +columns_priv Column_name NULL NULL +columns_priv Db NULL NULL +columns_priv Host NULL NULL +columns_priv Table_name NULL NULL +columns_priv User NULL NULL +db Db NULL NULL +db Host NULL NULL +db User NULL NULL +event db NULL NULL +event name NULL NULL +func name NULL NULL +help_category help_category_id NULL NULL +help_category name NULL NULL +help_keyword help_keyword_id NULL NULL +help_keyword name NULL NULL +help_relation help_keyword_id NULL NULL +help_relation help_topic_id NULL NULL +help_topic help_topic_id NULL NULL +help_topic name NULL NULL +host Db NULL NULL +host Host NULL NULL +ndb_binlog_index epoch NULL NULL +plugin name NULL NULL +proc db NULL NULL +proc name NULL NULL +proc type NULL NULL +procs_priv Db NULL NULL +procs_priv Host NULL NULL +procs_priv Routine_name NULL NULL +procs_priv Routine_type NULL NULL +procs_priv User NULL NULL +proxies_priv Host NULL NULL +proxies_priv Proxied_host NULL NULL +proxies_priv Proxied_user NULL NULL +proxies_priv User NULL NULL +servers Server_name NULL NULL +tables_priv Db NULL NULL +tables_priv Host NULL NULL +tables_priv Table_name NULL NULL +tables_priv User NULL NULL +time_zone Time_zone_id NULL NULL +time_zone_leap_second Transition_time NULL NULL +time_zone_name Name NULL NULL +time_zone_transition Time_zone_id NULL NULL +time_zone_transition Transition_time NULL NULL +time_zone_transition_type Time_zone_id NULL NULL +time_zone_transition_type Transition_type_id NULL NULL +user Host NULL NULL +user User NULL NULL diff --git a/mysql-test/suite/storage_engine/misc.test b/mysql-test/suite/storage_engine/misc.test new file mode 100644 index 00000000000..9357ea5767a --- /dev/null +++ b/mysql-test/suite/storage_engine/misc.test @@ -0,0 +1,47 @@ +# +# Different statements not related to an engine, +# but added to provide function coverage for handler.cc and handler.h. +# The test can be disabled or removed later. +# + +# hits get_error_message(int, String*) + +--source have_engine.inc + +INSERT INTO mysql.event ( + db, + name, + body, + definer, + interval_value, + interval_field, + originator, + character_set_client, + collation_connection, + db_collation, + body_utf8) +values ( + database(), + "ev1", + "select 1", + user(), + 100, + "SECOND_MICROSECOND", + 1, + 'utf8', + 'utf8_general_ci', + 'utf8_general_ci', + 'select 1'); + +--let $error_codes = ER_NOT_SUPPORTED_YET +SHOW EVENTS; +--source check_errors.inc +DROP EVENT ev1; + +# hits get_foreign_key_list(THD*, List<st_foreign_key_info>*) +--sorted_result +SELECT TABLE_NAME, COLUMN_NAME, REFERENCED_TABLE_NAME, REFERENCED_COLUMN_NAME +FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE ORDER BY TABLE_NAME; + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/my.cnf b/mysql-test/suite/storage_engine/my.cnf new file mode 100644 index 00000000000..e83954c469d --- /dev/null +++ b/mysql-test/suite/storage_engine/my.cnf @@ -0,0 +1,7 @@ +!include include/default_my.cnf + +[server] +sql-mode=NO_ENGINE_SUBSTITUTION +binlog-format=row +log-bin=master-bin + diff --git a/mysql-test/suite/storage_engine/obfuscate.inc b/mysql-test/suite/storage_engine/obfuscate.inc new file mode 100644 index 00000000000..96c9e5a2956 --- /dev/null +++ b/mysql-test/suite/storage_engine/obfuscate.inc @@ -0,0 +1,4 @@ +let $storage_engine_search_string = ENGINE=$storage_engine; + +--replace_result ' ' ' ' ' ,' ',' ' )' ')' '( ' '(' $default_tbl_opts <CUSTOM_TABLE_OPTIONS> $int_indexed_col <INT_COLUMN> $char_indexed_col <CHAR_COLUMN> $int_col <INT_COLUMN> $char_col <CHAR_COLUMN> $default_col_indexed_opts <CUSTOM_COL_OPTIONS> $default_col_opts <CUSTOM_COL_OPTIONS> $storage_engine_search_string ENGINE=<STORAGE_ENGINE> $default_index <CUSTOM_INDEX> + diff --git a/mysql-test/suite/storage_engine/optimize_table.inc b/mysql-test/suite/storage_engine/optimize_table.inc new file mode 100644 index 00000000000..acf80de3cea --- /dev/null +++ b/mysql-test/suite/storage_engine/optimize_table.inc @@ -0,0 +1,42 @@ +# +# OPTIMIZE TABLE statements +# +# Note: the output is likely to be different for the engine under test, +# in which case rdiff will be needed. Or, the output might say that +# the storage engine does not support OPTIMIZE. +# + +--disable_warnings +DROP TABLE IF EXISTS t1,t2; +--enable_warnings + +--source create_table.inc +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); +--let $table_name = t2 +--source create_table.inc + +INSERT INTO t1 (a,b) VALUES (3,'c'),(4,'d'); +OPTIMIZE TABLE t1; +INSERT INTO t2 (a,b) VALUES (4,'d'); +OPTIMIZE NO_WRITE_TO_BINLOG TABLE t2; +INSERT INTO t2 (a,b) VALUES (5,'e'); +INSERT INTO t1 (a,b) VALUES (6,'f'); +OPTIMIZE LOCAL TABLE t1, t2; +OPTIMIZE TABLE t1, t2; + +DROP TABLE t1, t2; + +# OPTIMIZE on a table with index + +--let $continue = 1 +--source have_default_index.inc +if ($have_default_index) +{ + --let $create_definition = a $int_indexed_col, b $char_col, $default_index (a) + --source create_table.inc + INSERT INTO t1 (a,b) VALUES (1,'a'),(100,'b'),(2,'c'),(3,'d'); + OPTIMIZE TABLE t1; + DROP TABLE t1; +} + + diff --git a/mysql-test/suite/storage_engine/optimize_table.result b/mysql-test/suite/storage_engine/optimize_table.result new file mode 100644 index 00000000000..4bb0bd296bc --- /dev/null +++ b/mysql-test/suite/storage_engine/optimize_table.result @@ -0,0 +1,29 @@ +DROP TABLE IF EXISTS t1,t2; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); +CREATE TABLE t2 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (3,'c'),(4,'d'); +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +INSERT INTO t2 (a,b) VALUES (4,'d'); +OPTIMIZE NO_WRITE_TO_BINLOG TABLE t2; +Table Op Msg_type Msg_text +test.t2 optimize status OK +INSERT INTO t2 (a,b) VALUES (5,'e'); +INSERT INTO t1 (a,b) VALUES (6,'f'); +OPTIMIZE LOCAL TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 optimize status OK +test.t2 optimize status OK +OPTIMIZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 optimize status Table is already up to date +test.t2 optimize status Table is already up to date +DROP TABLE t1, t2; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>, <CUSTOM_INDEX> (a)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (1,'a'),(100,'b'),(2,'c'),(3,'d'); +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/optimize_table.test b/mysql-test/suite/storage_engine/optimize_table.test new file mode 100644 index 00000000000..a32a2c846a5 --- /dev/null +++ b/mysql-test/suite/storage_engine/optimize_table.test @@ -0,0 +1,14 @@ +# +# OPTIMIZE TABLE statements +# +# Note: the output is likely to be different for the engine under test, +# in which case rdiff will be needed. Or, the output might say that +# the storage engine does not support OPTIMIZE. +# + +--source have_engine.inc + +--source optimize_table.inc + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/parts/alter_table.result b/mysql-test/suite/storage_engine/parts/alter_table.result new file mode 100644 index 00000000000..d94fd3d5d14 --- /dev/null +++ b/mysql-test/suite/storage_engine/parts/alter_table.result @@ -0,0 +1,42 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> PARTITION BY HASH(a) PARTITIONS 2; +INSERT INTO t1 (a) VALUES (1),(2),(2),(3),(4); +ALTER TABLE t1 ADD PARTITION PARTITIONS 2; +EXPLAIN PARTiTIONS SELECT a FROM t1 WHERE a = 3; +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE t1 p3 # # # # # # # +ALTER TABLE t1 COALESCE PARTITION 1; +EXPLAIN PARTiTIONS SELECT a FROM t1 WHERE a = 3; +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE t1 p0 # # # # # # # +ALTER TABLE t1 REORGANIZE PARTITION; +EXPLAIN PARTiTIONS SELECT a FROM t1 WHERE a = 2; +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE t1 p0 # # # # # # # +ALTER TABLE t1 REBUILD PARTITION p0; +EXPLAIN PARTiTIONS SELECT a FROM t1; +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE t1 p0 # # # # # # # +ALTER TABLE t1 REMOVE PARTITIONING; +EXPLAIN PARTiTIONS SELECT a FROM t1; +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE t1 NULL # # # # # # # +ALTER TABLE t1 PARTITION BY LIST(a) (PARTITION p0 VALUES IN (1,2,3), PARTITION p1 VALUES IN (101,102)); +ERROR HY000: Table has no partition for value 4 +ALTER TABLE t1 PARTITION BY LIST(a) (PARTITION p0 VALUES IN (1,2,3,4), PARTITION p1 VALUES IN (101,102)); +INSERT INTO t1 (a) VALUES (50); +ERROR HY000: Table has no partition for value 50 +ALTER TABLE t1 ADD PARTITION (PARTITION p2 VALUES IN (50,51)); +INSERT INTO t1 (a) VALUES (50); +ALTER TABLE t1 DROP PARTITION p1; +ALTER TABLE t1 REORGANIZE PARTITION p0, p2 INTO (PARTITION p0 VALUES IN (1,2,3), PARTITION p1 VALUES IN (4), PARTITION p2 VALUES IN (50,51), PARTITION p3 VALUES IN (101,102)); +EXPLAIN PARTiTIONS SELECT a FROM t1 WHERE a = 2; +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE t1 p0 # # # # # # # +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> PARTITION BY LIST(a) SUBPARTITION by HASH(b) ( +PARTITION abc VALUES IN (1,2,3), +PARTITION def VALUES IN (100,101,102) +); +ALTER TABLE t1 DROP PARTITION abc; +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/parts/alter_table.test b/mysql-test/suite/storage_engine/parts/alter_table.test new file mode 100644 index 00000000000..48f1f3f7d96 --- /dev/null +++ b/mysql-test/suite/storage_engine/parts/alter_table.test @@ -0,0 +1,107 @@ +# +# Basic ALTER TABLE statements related to partitioning +# + +--source include/have_partition.inc +--source ../have_engine.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +--let $create_definition = a $int_col +--let $partition_options = PARTITION BY HASH(a) PARTITIONS 2 +--source ../create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Partitions + --source ../unexpected_result.inc +} +if (!$mysql_errname) +{ + INSERT INTO t1 (a) VALUES (1),(2),(2),(3),(4); + + --let $alter_definition = ADD PARTITION PARTITIONS 2 + --source ../alter_table.inc + if ($mysql_errname) + { + --let $my_last_stmt = $alter_statement + --let $functionality = ALTER TABLE + --source ../unexpected_result.inc + } + --replace_column 5 # 6 # 7 # 8 # 9 # 10 # 11 # + EXPLAIN PARTiTIONS SELECT a FROM t1 WHERE a = 3; + + --let $alter_definition = COALESCE PARTITION 1 + --source ../alter_table.inc + --replace_column 5 # 6 # 7 # 8 # 9 # 10 # 11 # + EXPLAIN PARTiTIONS SELECT a FROM t1 WHERE a = 3; + + --let $alter_definition = REORGANIZE PARTITION + --source ../alter_table.inc + --replace_column 5 # 6 # 7 # 8 # 9 # 10 # 11 # + EXPLAIN PARTiTIONS SELECT a FROM t1 WHERE a = 2; + + --let $alter_definition = REBUILD PARTITION p0 + --source ../alter_table.inc + --replace_column 5 # 6 # 7 # 8 # 9 # 10 # 11 # + EXPLAIN PARTiTIONS SELECT a FROM t1; + + --let $alter_definition = REMOVE PARTITIONING + --source ../alter_table.inc + --replace_column 5 # 6 # 7 # 8 # 9 # 10 # 11 # + EXPLAIN PARTiTIONS SELECT a FROM t1; + + --let $error_codes = ER_NO_PARTITION_FOR_GIVEN_VALUE + --let $alter_definition = PARTITION BY LIST(a) ( PARTITION p0 VALUES IN (1,2,3), PARTITION p1 VALUES IN (101,102) ) + --source ../alter_table.inc + if ($mysql_errname != ER_NO_PARTITION_FOR_GIVEN_VALUE) + { + --let $my_last_stmt = $alter_statement + --let $my_functionality = ALTER TABLE or INSERT + --source ../unexpected_result.inc + } + + --let $alter_definition = PARTITION BY LIST(a) ( PARTITION p0 VALUES IN (1,2,3,4), PARTITION p1 VALUES IN (101,102) ) + --source ../alter_table.inc + + --let $error_codes = ER_NO_PARTITION_FOR_GIVEN_VALUE + INSERT INTO t1 (a) VALUES (50); + --source ../check_errors.inc + --let $alter_definition = ADD PARTITION ( PARTITION p2 VALUES IN (50,51) ) + --source ../alter_table.inc + INSERT INTO t1 (a) VALUES (50); + + --let $alter_definition = DROP PARTITION p1 + --source ../alter_table.inc + --let $alter_definition = REORGANIZE PARTITION p0, p2 INTO ( PARTITION p0 VALUES IN (1,2,3), PARTITION p1 VALUES IN (4), PARTITION p2 VALUES IN (50,51), PARTITION p3 VALUES IN (101,102) ) + --source ../alter_table.inc + --replace_column 5 # 6 # 7 # 8 # 9 # 10 # 11 # + EXPLAIN PARTiTIONS SELECT a FROM t1 WHERE a = 2; + DROP TABLE t1; +} + + +--let $create_definition = a $int_col, b $int_col +let $partition_options = PARTITION BY LIST(a) SUBPARTITION by HASH(b) ( + PARTITION abc VALUES IN (1,2,3), + PARTITION def VALUES IN (100,101,102) +); +--source ../create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Partitions or subpartitions + --source ../unexpected_result.inc +} +if (!$mysql_errname) +{ + --let $alter_definition = DROP PARTITION abc + --source ../alter_table.inc + + DROP TABLE t1; +} + +--source ../cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/parts/analyze_table.result b/mysql-test/suite/storage_engine/parts/analyze_table.result new file mode 100644 index 00000000000..8cd210e4965 --- /dev/null +++ b/mysql-test/suite/storage_engine/parts/analyze_table.result @@ -0,0 +1,47 @@ +DROP TABLE IF EXISTS t1,t2; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> PARTITION BY HASH(a) PARTITIONS 2; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(2,'d'),(4,'e'),(100,'f'),(101,'g'); +CREATE TABLE t2 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t2 (a,b) SELECT a,b FROM t1; +INSERT INTO t1 (a,b) VALUES (3,'c'); +ALTER TABLE t1 ANALYZE PARTITION p0; +Table Op Msg_type Msg_text +test.t1 analyze status OK +INSERT INTO t2 (a,b) VALUES (4,'d'), (1000,'e'); +ALTER TABLE t1 ANALYZE PARTITION LOCAL ALL; +Table Op Msg_type Msg_text +test.t1 analyze status OK +INSERT INTO t1 (a,b) VALUES (5,'f'),(50,'g'); +ALTER TABLE t1 ANALYZE PARTITION NO_WRITE_TO_BINLOG p1,p0; +Table Op Msg_type Msg_text +test.t1 analyze status OK +DROP TABLE t1, t2; +DROP TABLE IF EXISTS t1,t2; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> PARTITION BY HASH(a) PARTITIONS 2; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); +CREATE TABLE t2 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> PARTITION BY HASH(a) PARTITIONS 2; +INSERT INTO t1 (a,b) VALUES (3,'c'); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +INSERT INTO t2 (a,b) VALUES (4,'d'); +ANALYZE NO_WRITE_TO_BINLOG TABLE t2; +Table Op Msg_type Msg_text +test.t2 analyze status OK +INSERT INTO t1 (a,b) VALUES (5,'e'); +INSERT INTO t2 (a,b) VALUES (6,'f'); +ANALYZE LOCAL TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +DROP TABLE t1, t2; +CREATE TABLE t1 (a <INT_COLUMN>, <CUSTOM_INDEX>(a)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> PARTITION BY HASH(a) PARTITIONS 2; +INSERT INTO t1 (a) VALUES (1),(2),(4),(7); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +INSERT INTO t1 (a) VALUES (8),(10),(11),(12); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/parts/analyze_table.test b/mysql-test/suite/storage_engine/parts/analyze_table.test new file mode 100644 index 00000000000..2ff8fff1a03 --- /dev/null +++ b/mysql-test/suite/storage_engine/parts/analyze_table.test @@ -0,0 +1,61 @@ +# +# ANALYZE TABLE for partitioned tables and ANALYZE PARTITION +# +--source include/have_partition.inc +--source ../have_engine.inc + + +--disable_warnings +DROP TABLE IF EXISTS t1,t2; +--enable_warnings + +--let $partition_options = PARTITION BY HASH(a) PARTITIONS 2 +--source ../create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Partitions + --source ../unexpected_result.inc +} +if (!$mysql_errname) +{ + INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(2,'d'),(4,'e'),(100,'f'),(101,'g'); + let $partiton_options = PARTITION BY RANGE(a) ( + PARTITION p0 VALUES LESS THAN (100), + PARTITION p1 VALUES LESS THAN MAXVALUE + ); + --let $table_name = t2 + --source ../create_table.inc + + INSERT INTO t2 (a,b) SELECT a,b FROM t1; + + INSERT INTO t1 (a,b) VALUES (3,'c'); + + --let $alter_definition = ANALYZE PARTITION p0 + --source ../alter_table.inc + if ($mysql_errname) + { + --let $my_last_stmt = $alter_statement + --let $functionality = ALTER TABLE .. ANALYZE PARTITION + --source unexpected_result.inc + } + + INSERT INTO t2 (a,b) VALUES (4,'d'), (1000,'e'); + + --let $alter_definition = ANALYZE PARTITION LOCAL ALL + --source ../alter_table.inc + + INSERT INTO t1 (a,b) VALUES (5,'f'),(50,'g'); + + --let $alter_definition = ANALYZE PARTITION NO_WRITE_TO_BINLOG p1,p0 + --source ../alter_table.inc + + DROP TABLE t1, t2; +} + +let $extra_tbl_opts = PARTITION BY HASH(a) PARTITIONS 2; +--source ../analyze_table.inc +let $extra_tbl_opts =; + + +--source ../cleanup_engine.inc diff --git a/mysql-test/suite/storage_engine/parts/check_table.result b/mysql-test/suite/storage_engine/parts/check_table.result new file mode 100644 index 00000000000..6bd8d68e419 --- /dev/null +++ b/mysql-test/suite/storage_engine/parts/check_table.result @@ -0,0 +1,104 @@ +DROP TABLE IF EXISTS t1, t2; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> PARTITION BY HASH(a) PARTITIONS 2; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(2,'d'),(4,'e'),(100,'f'),(101,'g'); +CREATE TABLE t2 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> PARTITION BY RANGE(a) ( +PARTITION p0 VALUES LESS THAN (100), +PARTITION p1 VALUES LESS THAN MAXVALUE +); +INSERT INTO t2 (a,b) SELECT a, b FROM t1; +ALTER TABLE t1 CHECK PARTITION p0; +Table Op Msg_type Msg_text +test.t1 check status OK +INSERT INTO t1 (a,b) VALUES (3,'c'); +ALTER TABLE t1 CHECK PARTITION p0, p1 FOR UPGRADE; +Table Op Msg_type Msg_text +test.t1 check status OK +INSERT INTO t2 (a,b) VALUES (10000,'e'); +ALTER TABLE t2 CHECK PARTITION p0 QUICK; +Table Op Msg_type Msg_text +test.t2 check status OK +INSERT INTO t1 (a,b) VALUES (6,'f'); +ALTER TABLE t1 CHECK PARTITION p1 FAST; +Table Op Msg_type Msg_text +test.t1 check status OK +INSERT INTO t2 (a,b) VALUES (8,'h'); +ALTER TABLE t2 CHECK PARTITION p1 MEDIUM; +Table Op Msg_type Msg_text +test.t2 check status OK +INSERT INTO t1 (a,b) VALUES (9,'i'); +ALTER TABLE t1 CHECK PARTITION ALL EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +INSERT INTO t1 (a,b) VALUES (11,'k'); +ALTER TABLE t1 CHECK PARTITION p0 CHANGED; +Table Op Msg_type Msg_text +test.t1 check status OK +DROP TABLE t1, t2; +DROP TABLE IF EXISTS t1,t2; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> PARTITION BY HASH(a) PARTITIONS 2; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); +CREATE TABLE t2 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> PARTITION BY HASH(a) PARTITIONS 2; +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check status OK +INSERT INTO t1 (a,b) VALUES (3,'c'); +INSERT INTO t2 (a,b) VALUES (4,'d'); +CHECK TABLE t1, t2 FOR UPGRADE; +Table Op Msg_type Msg_text +test.t1 check status OK +test.t2 check status OK +INSERT INTO t2 (a,b) VALUES (5,'e'); +CHECK TABLE t2 QUICK; +Table Op Msg_type Msg_text +test.t2 check status OK +INSERT INTO t1 (a,b) VALUES (6,'f'); +CHECK TABLE t1 FAST; +Table Op Msg_type Msg_text +test.t1 check status OK +INSERT INTO t1 (a,b) VALUES (7,'g'); +INSERT INTO t2 (a,b) VALUES (8,'h'); +CHECK TABLE t2, t1 MEDIUM; +Table Op Msg_type Msg_text +test.t2 check status OK +test.t1 check status OK +INSERT INTO t1 (a,b) VALUES (9,'i'); +INSERT INTO t2 (a,b) VALUES (10,'j'); +CHECK TABLE t1, t2 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +test.t2 check status OK +INSERT INTO t1 (a,b) VALUES (11,'k'); +CHECK TABLE t1 CHANGED; +Table Op Msg_type Msg_text +test.t1 check status OK +DROP TABLE t1, t2; +CREATE TABLE t1 (a <INT_COLUMN>, <CUSTOM_INDEX>(a)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> PARTITION BY HASH(a) PARTITIONS 2; +INSERT INTO t1 (a) VALUES (1),(2),(5); +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check status OK +INSERT INTO t1 (a) VALUES (6),(8),(12); +CHECK TABLE t1 FOR UPGRADE; +Table Op Msg_type Msg_text +test.t1 check status OK +INSERT INTO t1 (a) VALUES (13),(15),(16); +CHECK TABLE t1 QUICK; +Table Op Msg_type Msg_text +test.t1 check status OK +INSERT INTO t1 (a) VALUES (17),(120),(132); +CHECK TABLE t1 FAST; +Table Op Msg_type Msg_text +test.t1 check status OK +INSERT INTO t1 (a) VALUES (801),(900),(7714); +CHECK TABLE t1 MEDIUM; +Table Op Msg_type Msg_text +test.t1 check status OK +INSERT INTO t1 (a) VALUES (8760),(10023),(12000); +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +INSERT INTO t1 (a) VALUES (13345),(24456),(78302),(143028); +CHECK TABLE t1 CHANGED; +Table Op Msg_type Msg_text +test.t1 check status OK +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/parts/check_table.test b/mysql-test/suite/storage_engine/parts/check_table.test new file mode 100644 index 00000000000..9a42620393f --- /dev/null +++ b/mysql-test/suite/storage_engine/parts/check_table.test @@ -0,0 +1,82 @@ +# +# CHECK TABLE for partitioned tables and ANALYZE PARTITION +# + +--source include/have_partition.inc +--source ../have_engine.inc + + +--disable_warnings +DROP TABLE IF EXISTS t1, t2; +--enable_warnings + +--let $partition_options = PARTITION BY HASH(a) PARTITIONS 2 +--source ../create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Partitions + --source ../unexpected_result.inc +} +if (!$mysql_errname) +{ + INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(2,'d'),(4,'e'),(100,'f'),(101,'g'); + + let $partition_options = PARTITION BY RANGE(a) ( + PARTITION p0 VALUES LESS THAN (100), + PARTITION p1 VALUES LESS THAN MAXVALUE + ); + --let $table_name = t2 + --source ../create_table.inc + + INSERT INTO t2 (a,b) SELECT a, b FROM t1; + + let $alter_definition = CHECK PARTITION p0; + --source ../alter_table.inc + if ($mysql_errname) + { + --let $my_last_stmt = $alter_statement + --let $functionality = ALTER TABLE .. CHECK PARTITION + --source ../unexpected_result.inc + } + + INSERT INTO t1 (a,b) VALUES (3,'c'); + + let $alter_definition = CHECK PARTITION p0, p1 FOR UPGRADE; + --source ../alter_table.inc + + INSERT INTO t2 (a,b) VALUES (10000,'e'); + + let $alter_definition = CHECK PARTITION p0 QUICK; + let $table_name = t2; + --source ../alter_table.inc + + INSERT INTO t1 (a,b) VALUES (6,'f'); + + let $alter_definition = CHECK PARTITION p1 FAST; + --source ../alter_table.inc + + INSERT INTO t2 (a,b) VALUES (8,'h'); + + let $alter_definition = CHECK PARTITION p1 MEDIUM; + let $table_name = t2; + --source ../alter_table.inc + + INSERT INTO t1 (a,b) VALUES (9,'i'); + + let $alter_definition = CHECK PARTITION ALL EXTENDED; + --source ../alter_table.inc + + INSERT INTO t1 (a,b) VALUES (11,'k'); + + let $alter_definition = CHECK PARTITION p0 CHANGED; + --source ../alter_table.inc + + DROP TABLE t1, t2; +} + +let $extra_tbl_opts = PARTITION BY HASH(a) PARTITIONS 2; +--source ../check_table.inc + +--source ../cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/parts/checksum_table.result b/mysql-test/suite/storage_engine/parts/checksum_table.result new file mode 100644 index 00000000000..666cb7f25a9 --- /dev/null +++ b/mysql-test/suite/storage_engine/parts/checksum_table.result @@ -0,0 +1,40 @@ +DROP TABLE IF EXISTS t1,t2; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> CHECKSUM=0 PARTITION BY HASH(a) PARTITIONS 2; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); +CREATE TABLE t2 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> CHECKSUM=0 PARTITION BY HASH(a) PARTITIONS 2; +CHECKSUM TABLE t1; +Table Checksum +test.t1 4272806499 +CHECKSUM TABLE t2, t1; +Table Checksum +test.t2 0 +test.t1 4272806499 +CHECKSUM TABLE t1, t2 QUICK; +Table Checksum +test.t1 NULL +test.t2 NULL +CHECKSUM TABLE t1, t2 EXTENDED; +Table Checksum +test.t1 4272806499 +test.t2 0 +DROP TABLE t1, t2; +DROP TABLE IF EXISTS t1,t2; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> CHECKSUM=1 PARTITION BY HASH(a) PARTITIONS 2; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); +CREATE TABLE t2 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> CHECKSUM=1 PARTITION BY HASH(a) PARTITIONS 2; +CHECKSUM TABLE t1; +Table Checksum +test.t1 0 +CHECKSUM TABLE t2, t1; +Table Checksum +test.t2 0 +test.t1 0 +CHECKSUM TABLE t1, t2 QUICK; +Table Checksum +test.t1 0 +test.t2 0 +CHECKSUM TABLE t1, t2 EXTENDED; +Table Checksum +test.t1 4272806499 +test.t2 0 +DROP TABLE t1, t2; diff --git a/mysql-test/suite/storage_engine/parts/checksum_table.test b/mysql-test/suite/storage_engine/parts/checksum_table.test new file mode 100644 index 00000000000..eff70e3cadf --- /dev/null +++ b/mysql-test/suite/storage_engine/parts/checksum_table.test @@ -0,0 +1,13 @@ +# +# CHECKSUM TABLE for partitioned tables +# + +--source include/have_partition.inc +--source ../have_engine.inc + +let $extra_tbl_opts = PARTITION BY HASH(a) PARTITIONS 2; +--source ../checksum_table.inc +--source ../checksum_table_live.inc + +--source ../cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/parts/create_table.result b/mysql-test/suite/storage_engine/parts/create_table.result new file mode 100644 index 00000000000..945ed2312c0 --- /dev/null +++ b/mysql-test/suite/storage_engine/parts/create_table.result @@ -0,0 +1,91 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> PARTITION BY HASH(a) PARTITIONS 2; +INSERT INTO t1 (a) VALUES (1),(2),(3),(2); +EXPLAIN PARTITIONS SELECT a FROM t1; +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE t1 p0,p1 # # # # # # # +EXPLAIN PARTITIONS SELECT a FROM t1 WHERE a=2; +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE t1 p0 # # # # # # # +DROP TABLE t1; +CREATE TABLE t1 (a <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> PARTITION BY KEY(a) PARTITIONS 2; +INSERT INTO t1 (a) VALUES ('a'),('b'),('c'); +EXPLAIN PARTITIONS SELECT a FROM t1; +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE t1 p0,p1 # # # # # # # +EXPLAIN PARTITIONS SELECT a FROM t1 WHERE a = 'b'; +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE t1 p1 # # # # # # # +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>, <CUSTOM_INDEX> (a)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> PARTITION BY KEY(a) PARTITIONS 2; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 a 1 a # # NULL NULL # # +INSERT INTO t1 (a) VALUES (1),(2),(3),(5); +EXPLAIN PARTITIONS SELECT a FROM t1; +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE t1 p0,p1 # # # # # # # +EXPLAIN PARTITIONS SELECT a FROM t1 WHERE a IN (1,3); +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE t1 p0 # # # # # # # +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN> PRIMARY KEY) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> PARTITION BY KEY() PARTITIONS 2; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 0 PRIMARY 1 a # # NULL NULL # # +INSERT INTO t1 (a) VALUES (1),(200),(3),(2); +EXPLAIN PARTITIONS SELECT a FROM t1; +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE t1 p0,p1 # # # # # # # +EXPLAIN PARTITIONS SELECT a FROM t1 WHERE a=2; +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE t1 p1 # # # # # # # +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> PARTITION BY RANGE(a) ( +PARTITION p0 VALUES LESS THAN (10), +PARTITION p1 VALUES LESS THAN (1000) +); +INSERT INTO t1 (a) VALUES (1),(2),(400); +EXPLAIN PARTITIONS SELECT a FROM t1; +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE t1 p0,p1 # # # # # # # +EXPLAIN PARTITIONS SELECT a FROM t1 WHERE a = 2; +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE t1 p0 # # # # # # # +INSERT INTO t1 (a) VALUES (10000); +ERROR HY000: Table has no partition for value 10000 +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> PARTITION BY LIST(a) ( +PARTITION abc VALUES IN (1,2,3), +PARTITION def VALUES IN (100,101,102) +); +INSERT INTO t1 (a) VALUES (1),(101),(1); +EXPLAIN PARTITIONS SELECT a FROM t1; +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE t1 abc,def # # # # # # # +EXPLAIN PARTITIONS SELECT a FROM t1 WHERE a = 100; +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL # # # # # # # +INSERT INTO t1 (a) VALUES (50); +ERROR HY000: Table has no partition for value 50 +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> PARTITION BY LIST(a) SUBPARTITION by HASH(b) ( +PARTITION abc VALUES IN (1,2,3), +PARTITION def VALUES IN (100,101,102) +); +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +INSERT INTO t1 (a,b) VALUES (1,1),(101,2),(1,3); +EXPLAIN PARTITIONS SELECT a FROM t1; +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE t1 abc_abcsp0,def_defsp0 # # # # # # # +EXPLAIN PARTITIONS SELECT a FROM t1 WHERE a = 100; +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL # # # # # # # +SELECT TABLE_SCHEMA, TABLE_NAME, PARTITION_NAME, SUBPARTITION_NAME, PARTITION_METHOD, SUBPARTITION_METHOD +FROM INFORMATION_SCHEMA.PARTITIONS WHERE TABLE_NAME = 't1'; +TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_METHOD SUBPARTITION_METHOD +test t1 abc abcsp0 LIST HASH +test t1 def defsp0 LIST HASH +SELECT * FROM INFORMATION_SCHEMA.PARTITIONS; +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/parts/create_table.test b/mysql-test/suite/storage_engine/parts/create_table.test new file mode 100644 index 00000000000..69ab51f7281 --- /dev/null +++ b/mysql-test/suite/storage_engine/parts/create_table.test @@ -0,0 +1,179 @@ +# +# Basic CREATE TABLE .. PARTITION statements +# + +--source include/have_partition.inc +--source ../have_engine.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +let $create_definition = a $int_col; +let $partition_options = PARTITION BY HASH(a) PARTITIONS 2; +--source ../create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Partitions + --source ../unexpected_result.inc +} +if (!$mysql_errname) +{ + INSERT INTO t1 (a) VALUES (1),(2),(3),(2); + # We are only interested in partition information + --replace_column 5 # 6 # 7 # 8 # 9 # 10 # 11 # + EXPLAIN PARTITIONS SELECT a FROM t1; + --replace_column 5 # 6 # 7 # 8 # 9 # 10 # 11 # + EXPLAIN PARTITIONS SELECT a FROM t1 WHERE a=2; + + DROP TABLE t1; +} + +let $create_definition = a $char_col; +let $partition_options = PARTITION BY KEY(a) PARTITIONS 2; +--source ../create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Partitions or CHAR types + --source ../unexpected_result.inc +} +if (!$mysql_errname) +{ + INSERT INTO t1 (a) VALUES ('a'),('b'),('c'); + --replace_column 5 # 6 # 7 # 8 # 9 # 10 # 11 # + EXPLAIN PARTITIONS SELECT a FROM t1; + --replace_column 5 # 6 # 7 # 8 # 9 # 10 # 11 # + EXPLAIN PARTITIONS SELECT a FROM t1 WHERE a = 'b'; + DROP TABLE t1; +} + +--let $continue = 1 +--source ../have_default_index.inc +if ($have_default_index) +{ + let $create_definition = a $int_indexed_col, $default_index (a); + let $partition_options = PARTITION BY KEY(a) PARTITIONS 2; + --source ../create_table.inc + if ($mysql_errname) + { + --let $my_last_stmt = $create_statement + --let $functionality = Partitions or indexes + --source ../unexpected_result.inc + } + if (!$mysql_errname) + { + --source ../mask_engine.inc + --replace_column 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + INSERT INTO t1 (a) VALUES (1),(2),(3),(5); + --replace_column 5 # 6 # 7 # 8 # 9 # 10 # 11 # + EXPLAIN PARTITIONS SELECT a FROM t1; + --replace_column 5 # 6 # 7 # 8 # 9 # 10 # 11 # + EXPLAIN PARTITIONS SELECT a FROM t1 WHERE a IN (1,3); + DROP TABLE t1; + } +} + +let $create_definition = a $int_indexed_col PRIMARY KEY; +let $partition_options = PARTITION BY KEY() PARTITIONS 2; +--source ../create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = PK + --source ../unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + INSERT INTO t1 (a) VALUES (1),(200),(3),(2); + --replace_column 5 # 6 # 7 # 8 # 9 # 10 # 11 # + EXPLAIN PARTITIONS SELECT a FROM t1; + --replace_column 5 # 6 # 7 # 8 # 9 # 10 # 11 # + EXPLAIN PARTITIONS SELECT a FROM t1 WHERE a=2; + DROP TABLE t1; +} + + +let $create_definition = a $int_col; +let $partition_options = PARTITION BY RANGE(a) ( + PARTITION p0 VALUES LESS THAN (10), + PARTITION p1 VALUES LESS THAN (1000) +); +--source ../create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Partitions + --source ../unexpected_result.inc +} +if (!$mysql_errname) +{ + INSERT INTO t1 (a) VALUES (1),(2),(400); + --replace_column 5 # 6 # 7 # 8 # 9 # 10 # 11 # + EXPLAIN PARTITIONS SELECT a FROM t1; + --replace_column 5 # 6 # 7 # 8 # 9 # 10 # 11 # + EXPLAIN PARTITIONS SELECT a FROM t1 WHERE a = 2; + + --let $error_codes = ER_NO_PARTITION_FOR_GIVEN_VALUE + INSERT INTO t1 (a) VALUES (10000); + --source ../check_errors.inc + DROP TABLE t1; + + let $create_definition = a $int_col; + let $partition_options = PARTITION BY LIST(a) ( + PARTITION abc VALUES IN (1,2,3), + PARTITION def VALUES IN (100,101,102) + ); + --source ../create_table.inc + + INSERT INTO t1 (a) VALUES (1),(101),(1); + --replace_column 5 # 6 # 7 # 8 # 9 # 10 # 11 # + EXPLAIN PARTITIONS SELECT a FROM t1; + --replace_column 5 # 6 # 7 # 8 # 9 # 10 # 11 # + EXPLAIN PARTITIONS SELECT a FROM t1 WHERE a = 100; + --let $error_codes = ER_NO_PARTITION_FOR_GIVEN_VALUE + INSERT INTO t1 (a) VALUES (50); + --source ../check_errors.inc + DROP TABLE t1; +} + +let $create_definition = a $int_col, b $int_col; +let partition_options = PARTITION BY LIST(a) SUBPARTITION by HASH(b) ( + PARTITION abc VALUES IN (1,2,3), + PARTITION def VALUES IN (100,101,102) +); +--source ../create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Partitions or subpartitions + --source ../unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + INSERT INTO t1 (a,b) VALUES (1,1),(101,2),(1,3); + --replace_column 5 # 6 # 7 # 8 # 9 # 10 # 11 # + EXPLAIN PARTITIONS SELECT a FROM t1; + --replace_column 5 # 6 # 7 # 8 # 9 # 10 # 11 # + EXPLAIN PARTITIONS SELECT a FROM t1 WHERE a = 100; + + --sorted_result + SELECT TABLE_SCHEMA, TABLE_NAME, PARTITION_NAME, SUBPARTITION_NAME, PARTITION_METHOD, SUBPARTITION_METHOD + FROM INFORMATION_SCHEMA.PARTITIONS WHERE TABLE_NAME = 't1'; + # This is just to hit some more handler functions while we are here + --disable_result_log + SELECT * FROM INFORMATION_SCHEMA.PARTITIONS; + --enable_result_log + + DROP TABLE t1; +} +--source ../cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/parts/my.cnf b/mysql-test/suite/storage_engine/parts/my.cnf new file mode 100644 index 00000000000..d61663106b2 --- /dev/null +++ b/mysql-test/suite/storage_engine/parts/my.cnf @@ -0,0 +1,9 @@ +!include include/default_my.cnf + +[server] +sql-mode=NO_ENGINE_SUBSTITUTION +binlog-format=row +log-bin=master-bin +partition + + diff --git a/mysql-test/suite/storage_engine/parts/optimize_table.result b/mysql-test/suite/storage_engine/parts/optimize_table.result new file mode 100644 index 00000000000..da165bc1520 --- /dev/null +++ b/mysql-test/suite/storage_engine/parts/optimize_table.result @@ -0,0 +1,54 @@ +DROP TABLE IF EXISTS t1,t2; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> PARTITION BY HASH(a) PARTITIONS 2; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(2,'d'),(4,'e'),(100,'f'),(101,'g'); +CREATE TABLE t2 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> PARTITION BY RANGE(a) ( +PARTITION p0 VALUES LESS THAN (100), +PARTITION p1 VALUES LESS THAN MAXVALUE +); +INSERT INTO t2 (a,b) SELECT a, b FROM t1; +INSERT INTO t1 (a,b) VALUES (3,'c'),(4,'d'); +ALTER TABLE t1 OPTIMIZE PARTITION p1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +INSERT INTO t2 (a,b) VALUES (4,'d'); +ALTER TABLE t2 OPTIMIZE PARTITION p0 NO_WRITE_TO_BINLOG; +Table Op Msg_type Msg_text +test.t2 optimize status OK +INSERT INTO t1 (a,b) VALUES (6,'f'); +ALTER TABLE t1 OPTIMIZE PARTITION ALL LOCAL; +Table Op Msg_type Msg_text +test.t1 optimize status OK +INSERT INTO t2 (a,b) VALUES (5,'e'); +ALTER TABLE t2 OPTIMIZE PARTITION p1,p0; +Table Op Msg_type Msg_text +test.t2 optimize status OK +DROP TABLE t1, t2; +DROP TABLE IF EXISTS t1,t2; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> PARTITION BY HASH(a) PARTITIONS 2; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); +CREATE TABLE t2 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> PARTITION BY HASH(a) PARTITIONS 2; +INSERT INTO t1 (a,b) VALUES (3,'c'),(4,'d'); +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +INSERT INTO t2 (a,b) VALUES (4,'d'); +OPTIMIZE NO_WRITE_TO_BINLOG TABLE t2; +Table Op Msg_type Msg_text +test.t2 optimize status OK +INSERT INTO t2 (a,b) VALUES (5,'e'); +INSERT INTO t1 (a,b) VALUES (6,'f'); +OPTIMIZE LOCAL TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 optimize status OK +test.t2 optimize status OK +OPTIMIZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 optimize status OK +test.t2 optimize status OK +DROP TABLE t1, t2; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>, <CUSTOM_INDEX> (a)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> PARTITION BY HASH(a) PARTITIONS 2; +INSERT INTO t1 (a,b) VALUES (1,'a'),(100,'b'),(2,'c'),(3,'d'); +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/parts/optimize_table.test b/mysql-test/suite/storage_engine/parts/optimize_table.test new file mode 100644 index 00000000000..8c136933d60 --- /dev/null +++ b/mysql-test/suite/storage_engine/parts/optimize_table.test @@ -0,0 +1,69 @@ +# +# OPTIMIZE TABLE with partitions and OPTIMIZE PARTITIONS +# + +--source include/have_partition.inc +--source ../have_engine.inc + +--disable_warnings +DROP TABLE IF EXISTS t1,t2; +--enable_warnings + +let $partition_options = PARTITION BY HASH(a) PARTITIONS 2; +--source ../create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Partitions + --source ../unexpected_result.inc +} +if (!$mysql_errname) +{ + INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(2,'d'),(4,'e'),(100,'f'),(101,'g'); + + let $table_name = t2; + let $partition_options = PARTITION BY RANGE(a) ( + PARTITION p0 VALUES LESS THAN (100), + PARTITION p1 VALUES LESS THAN MAXVALUE + ); + --source ../create_table.inc + + INSERT INTO t2 (a,b) SELECT a, b FROM t1; + + INSERT INTO t1 (a,b) VALUES (3,'c'),(4,'d'); + + let $alter_definition = OPTIMIZE PARTITION p1; + --source ../alter_table.inc + if ($mysql_errname) + { + --let $my_last_stmt = $alter_statement + --let $functionality = ALTER TABLE .. OPTIMIZE PARTITION + --source ../unexpected_result.inc + } + + INSERT INTO t2 (a,b) VALUES (4,'d'); + + let $table_name = t2; + let $alter_definition = OPTIMIZE PARTITION p0 NO_WRITE_TO_BINLOG; + --source ../alter_table.inc + + INSERT INTO t1 (a,b) VALUES (6,'f'); + + let $alter_definition = OPTIMIZE PARTITION ALL LOCAL; + --source ../alter_table.inc + + INSERT INTO t2 (a,b) VALUES (5,'e'); + + let $table_name = t2; + let $alter_definition = OPTIMIZE PARTITION p1,p0; + --source ../alter_table.inc + + DROP TABLE t1, t2; +} + +let $extra_tbl_opts = PARTITION BY HASH(a) PARTITIONS 2; +--source ../optimize_table.inc + + +--source ../cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/parts/repair_table.result b/mysql-test/suite/storage_engine/parts/repair_table.result new file mode 100644 index 00000000000..b156df6d7dc --- /dev/null +++ b/mysql-test/suite/storage_engine/parts/repair_table.result @@ -0,0 +1,236 @@ +call mtr.add_suppression("Table '.*t1.*' is marked as crashed and should be repaired"); +DROP TABLE IF EXISTS t1, t2; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> PARTITION BY HASH(a) PARTITIONS 2; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(2,'d'),(4,'e'),(100,'f'),(101,'g'); +CREATE TABLE t2 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> PARTITION BY RANGE(a) ( +PARTITION p0 VALUES LESS THAN (100), +PARTITION p1 VALUES LESS THAN MAXVALUE +); +INSERT INTO t2 (a,b) SELECT a, b FROM t1; +ALTER TABLE t1 REPAIR PARTITION p0; +Table Op Msg_type Msg_text +test.t1 repair status OK +INSERT INTO t1 VALUES (3,'c'); +ALTER TABLE t1 REPAIR PARTITION NO_WRITE_TO_BINLOG p0, p1; +Table Op Msg_type Msg_text +test.t1 repair status OK +INSERT INTO t2 (a,b) VALUES (5,'e'),(6,'f'); +ALTER TABLE t2 REPAIR PARTITION LOCAL p1; +Table Op Msg_type Msg_text +test.t2 repair status OK +INSERT INTO t1 (a,b) VALUES (7,'g'),(8,'h'); +ALTER TABLE t1 REPAIR PARTITION LOCAL ALL EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +INSERT INTO t1 VALUES (10,'j'); +ALTER TABLE t1 REPAIR PARTITION p1 QUICK USE_FRM; +Table Op Msg_type Msg_text +test.t1 repair status OK +INSERT INTO t2 (a,b) VALUES (12,'l'); +ALTER TABLE t2 REPAIR PARTITION NO_WRITE_TO_BINLOG ALL QUICK EXTENDED USE_FRM; +Table Op Msg_type Msg_text +test.t2 repair status OK +DROP TABLE t1, t2; +DROP TABLE IF EXISTS t1,t2; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> PARTITION BY HASH(a) PARTITIONS 2; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); +CREATE TABLE t2 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> PARTITION BY HASH(a) PARTITIONS 2; +REPAIR TABLE t1; +Table Op Msg_type Msg_text +test.t1 repair status OK +INSERT INTO t1 (a,b) VALUES (3,'c'); +INSERT INTO t2 (a,b) VALUES (4,'d'); +REPAIR NO_WRITE_TO_BINLOG TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 repair status OK +test.t2 repair status OK +INSERT INTO t2 (a,b) VALUES (5,'e'),(6,'f'); +REPAIR LOCAL TABLE t2; +Table Op Msg_type Msg_text +test.t2 repair status OK +INSERT INTO t1 (a,b) VALUES (7,'g'),(8,'h'); +INSERT INTO t2 (a,b) VALUES (9,'i'); +REPAIR LOCAL TABLE t2, t1 EXTENDED; +Table Op Msg_type Msg_text +test.t2 repair status OK +test.t1 repair status OK +INSERT INTO t1 (a,b) VALUES (10,'j'); +INSERT INTO t2 (a,b) VALUES (11,'k'); +REPAIR TABLE t1, t2 QUICK USE_FRM; +Table Op Msg_type Msg_text +test.t1 repair status OK +test.t2 repair status OK +INSERT INTO t1 (a,b) VALUES (12,'l'); +INSERT INTO t2 (a,b) VALUES (13,'m'); +REPAIR NO_WRITE_TO_BINLOG TABLE t1, t2 QUICK EXTENDED USE_FRM; +Table Op Msg_type Msg_text +test.t1 repair status OK +test.t2 repair status OK +FLUSH TABLE t1; +INSERT INTO t1 (a,b) VALUES (14,'n'); +ERROR HY000: Failed to read from the .par file +# Statement ended with one of expected results (0,130,ER_FAILED_READ_FROM_PAR_FILE,ER_OPEN_AS_READONLY). +# If you got a difference in error message, just add it to rdiff file +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check Error Failed to read from the .par file +test.t1 check Error Incorrect information in file: './test/t1.frm' +test.t1 check error Corrupt +SELECT * FROM t1; +ERROR HY000: Failed to read from the .par file +# Statement ended with one of expected results (0,130,ER_FAILED_READ_FROM_PAR_FILE,ER_OPEN_AS_READONLY). +# If you got a difference in error message, just add it to rdiff file +REPAIR TABLE t1; +Table Op Msg_type Msg_text +test.t1 repair Error Failed to read from the .par file +test.t1 repair Error Incorrect information in file: './test/t1.frm' +test.t1 repair error Corrupt +DROP TABLE t1, t2; +call mtr.add_suppression("Got an error from thread_id=.*"); +call mtr.add_suppression("MySQL thread id .*, query id .* localhost.*root Checking table"); +call mtr.add_suppression(" '\..test.t1'"); +call mtr.add_suppression("Couldn't repair table: test.t1"); +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>, <CUSTOM_INDEX> (a)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> PARTITION BY HASH(a) PARTITIONS 2; +REPAIR TABLE t1; +Table Op Msg_type Msg_text +test.t1 repair status OK +INSERT INTO t1 (a,b) VALUES (7,'g'),(8,'h'); +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +INSERT INTO t1 (a,b) VALUES (10,'j'); +REPAIR TABLE t1 USE_FRM; +Table Op Msg_type Msg_text +test.t1 repair status OK +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1.frm +t1.par +INSERT INTO t1 (a,b) VALUES (14,'n'),(15,'o'); +# Statement ended with one of expected results (0,144). +# If you got a difference in error message, just add it to rdiff file +FLUSH TABLE t1; +Restoring <DATADIR>/test/t1#P#p0.MYD +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check error Size of datafile is: 26 Should be: 39 +test.t1 check error Partition p0 returned error +test.t1 check error Corrupt +SELECT * FROM t1; +a b +8 h +10 j +7 g +15 o +Warnings: +Error 145 Table './test/t1#P#p0' is marked as crashed and should be repaired +Error 1194 Table 't1' is marked as crashed and should be repaired +Error 1034 Number of rows changed from 3 to 2 +# Statement ended with one of expected results (0,ER_NOT_KEYFILE,144). +# If you got a difference in error message, just add it to rdiff file +INSERT INTO t1 (a,b) VALUES (14,'n'),(15,'o'); +# Statement ended with one of expected results (0,144). +# If you got a difference in error message, just add it to rdiff file +FLUSH TABLE t1; +Restoring <DATADIR>/test/t1#P#p0.MYI +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check warning Size of datafile is: 39 Should be: 26 +test.t1 check error Record-count is not ok; is 3 Should be: 2 +test.t1 check warning Found 3 key parts. Should be: 2 +test.t1 check error Partition p0 returned error +test.t1 check error Corrupt +SELECT * FROM t1; +a b +8 h +10 j +14 n +7 g +15 o +15 o +Warnings: +Error 145 Table './test/t1#P#p0' is marked as crashed and should be repaired +Error 1194 Table 't1' is marked as crashed and should be repaired +Error 1034 Number of rows changed from 2 to 3 +# Statement ended with one of expected results (0,ER_NOT_KEYFILE,144). +# If you got a difference in error message, just add it to rdiff file +INSERT INTO t1 (a,b) VALUES (14,'n'),(15,'o'); +# Statement ended with one of expected results (0,144). +# If you got a difference in error message, just add it to rdiff file +FLUSH TABLE t1; +Restoring <DATADIR>/test/t1#P#p1.MYD +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check error Size of datafile is: 39 Should be: 52 +test.t1 check error Partition p1 returned error +test.t1 check error Corrupt +SELECT * FROM t1; +a b +8 h +10 j +14 n +14 n +7 g +15 o +15 o +Warnings: +Error 145 Table './test/t1#P#p1' is marked as crashed and should be repaired +Error 1194 Table 't1' is marked as crashed and should be repaired +Error 1034 Number of rows changed from 4 to 3 +# Statement ended with one of expected results (0,ER_NOT_KEYFILE,144). +# If you got a difference in error message, just add it to rdiff file +INSERT INTO t1 (a,b) VALUES (14,'n'),(15,'o'); +# Statement ended with one of expected results (0,144). +# If you got a difference in error message, just add it to rdiff file +FLUSH TABLE t1; +Restoring <DATADIR>/test/t1#P#p1.MYI +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check warning Size of datafile is: 52 Should be: 39 +test.t1 check error Record-count is not ok; is 4 Should be: 3 +test.t1 check warning Found 4 key parts. Should be: 3 +test.t1 check error Partition p1 returned error +test.t1 check error Corrupt +SELECT * FROM t1; +a b +8 h +10 j +14 n +14 n +14 n +7 g +15 o +15 o +15 o +Warnings: +Error 145 Table './test/t1#P#p1' is marked as crashed and should be repaired +Error 1194 Table 't1' is marked as crashed and should be repaired +Error 1034 Number of rows changed from 3 to 4 +# Statement ended with one of expected results (0,ER_NOT_KEYFILE,144). +# If you got a difference in error message, just add it to rdiff file +INSERT INTO t1 (a,b) VALUES (14,'n'),(15,'o'); +# Statement ended with one of expected results (0,144). +# If you got a difference in error message, just add it to rdiff file +FLUSH TABLE t1; +Restoring <DATADIR>/test/t1.par +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check status OK +SELECT * FROM t1; +a b +8 h +10 j +14 n +14 n +14 n +14 n +7 g +15 o +15 o +15 o +15 o +# Statement ended with one of expected results (0,ER_NOT_KEYFILE,144). +# If you got a difference in error message, just add it to rdiff file +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/parts/repair_table.test b/mysql-test/suite/storage_engine/parts/repair_table.test new file mode 100644 index 00000000000..f77b2ef8de4 --- /dev/null +++ b/mysql-test/suite/storage_engine/parts/repair_table.test @@ -0,0 +1,78 @@ +# +# REPAIR TABLE for partitioned tables and REPAIR PARTITION +# + +--source include/have_partition.inc +--source ../have_engine.inc + +call mtr.add_suppression("Table '.*t1.*' is marked as crashed and should be repaired"); + +--disable_warnings +DROP TABLE IF EXISTS t1, t2; +--enable_warnings + +let $partition_options = PARTITION BY HASH(a) PARTITIONS 2; +--source ../create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Partitions + --source ../unexpected_result.inc +} +if (!$mysql_errname) +{ + INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(2,'d'),(4,'e'),(100,'f'),(101,'g'); + + let $table_name = t2; + let $partition_options = PARTITION BY RANGE(a) ( + PARTITION p0 VALUES LESS THAN (100), + PARTITION p1 VALUES LESS THAN MAXVALUE + ); + --source ../create_table.inc + + INSERT INTO t2 (a,b) SELECT a, b FROM t1; + + let $alter_definition = REPAIR PARTITION p0; + --source ../alter_table.inc + + INSERT INTO t1 VALUES (3,'c'); + + let $alter_definition = REPAIR PARTITION NO_WRITE_TO_BINLOG p0, p1; + --source ../alter_table.inc + if ($mysql_errname) + { + --let $my_last_stmt = $alter_statement + --let $functionality = ALTER TABLE + --source ../unexpected_result.inc + } + + INSERT INTO t2 (a,b) VALUES (5,'e'),(6,'f'); + + let $table_name = t2; + let $alter_definition = REPAIR PARTITION LOCAL p1; + --source ../alter_table.inc + + INSERT INTO t1 (a,b) VALUES (7,'g'),(8,'h'); + + let $alter_definition = REPAIR PARTITION LOCAL ALL EXTENDED; + --source ../alter_table.inc + + INSERT INTO t1 VALUES (10,'j'); + + let $alter_definition = REPAIR PARTITION p1 QUICK USE_FRM; + --source ../alter_table.inc + + INSERT INTO t2 (a,b) VALUES (12,'l'); + + let $table_name = t2; + let $alter_definition = REPAIR PARTITION NO_WRITE_TO_BINLOG ALL QUICK EXTENDED USE_FRM; + --source ../alter_table.inc + + DROP TABLE t1, t2; +} + +let $extra_tbl_opts = PARTITION BY HASH(a) PARTITIONS 2; +--source ../repair_table.inc + +--source ../cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/parts/truncate_table.result b/mysql-test/suite/storage_engine/parts/truncate_table.result new file mode 100644 index 00000000000..e46f4c97de5 --- /dev/null +++ b/mysql-test/suite/storage_engine/parts/truncate_table.result @@ -0,0 +1,68 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> PARTITION BY HASH(a) PARTITIONS 2; +TRUNCATE TABLE t1; +INSERT INTO t1 (a,b) VALUES (1,'a'), (2,'b'), (3,'c'); +TRUNCATE TABLE t1; +SELECT * FROM t1; +a b +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN> KEY AUTO_INCREMENT, c <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> PARTITION BY HASH(a) PARTITIONS 2; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) NOT NULL AUTO_INCREMENT, + `c` char(8) DEFAULT NULL, + PRIMARY KEY (`a`) +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +/*!50100 PARTITION BY HASH (a) +PARTITIONS 2 */ +INSERT INTO t1 (c) VALUES ('a'),('b'),('c'); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) NOT NULL AUTO_INCREMENT, + `c` char(8) DEFAULT NULL, + PRIMARY KEY (`a`) +) ENGINE=<STORAGE_ENGINE> AUTO_INCREMENT=4 DEFAULT CHARSET=latin1 +/*!50100 PARTITION BY HASH (a) +PARTITIONS 2 */ +TRUNCATE TABLE t1; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) NOT NULL AUTO_INCREMENT, + `c` char(8) DEFAULT NULL, + PRIMARY KEY (`a`) +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +/*!50100 PARTITION BY HASH (a) +PARTITIONS 2 */ +INSERT INTO t1 (c) VALUES ('d'); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) NOT NULL AUTO_INCREMENT, + `c` char(8) DEFAULT NULL, + PRIMARY KEY (`a`) +) ENGINE=<STORAGE_ENGINE> AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 +/*!50100 PARTITION BY HASH (a) +PARTITIONS 2 */ +SELECT * FROM t1; +a c +1 d +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> PARTITION BY HASH(a) PARTITIONS 2; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(2,'d'),(4,'e'),(100,'f'),(101,'g'); +ALTER TABLE t1 TRUNCATE PARTITION p0; +SELECT * FROM t1; +a b +1 a +101 g +3 c +EXPLAIN PARTITIONS SELECT * FROM t1; +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE t1 p0,p1 # # # # # # +INSERT INTO t1 (a,b) VALUES (1,'a'), (2,'b'), (3,'c'); +ALTER TABLE t1 TRUNCATE PARTITION ALL; +SELECT * FROM t1; +a b +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/parts/truncate_table.test b/mysql-test/suite/storage_engine/parts/truncate_table.test new file mode 100644 index 00000000000..20f316d5297 --- /dev/null +++ b/mysql-test/suite/storage_engine/parts/truncate_table.test @@ -0,0 +1,111 @@ +# +# TRUNCATE TABLE with partitions and TRUNCATE PARTITION +# + +--source include/have_partition.inc +--source ../have_engine.inc + +# A part of the standard TRUNCATE test + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + + +# Truncate partitioned table + +let $partition_options = PARTITION BY HASH(a) PARTITIONS 2; +--source ../create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Partitions + --source ../unexpected_result.inc +} +if (!$mysql_errname) +{ + TRUNCATE TABLE t1; + if ($mysql_errname) + { + --let $functionality = TRUNCATE TABLE + --source ../unexpected_result.inc + } + + INSERT INTO t1 (a,b) VALUES (1,'a'), (2,'b'), (3,'c'); + TRUNCATE TABLE t1; + SELECT * FROM t1; + + DROP TABLE t1; +} + + +# Truncate resets auto-increment value on the table + +let $create_definition = a $int_indexed_col KEY AUTO_INCREMENT, c $char_col; +let $partition_options = PARTITION BY HASH(a) PARTITIONS 2; +--source ../create_table.inc + +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Partitions or PK or auto-increment + --source ../unexpected_result.inc +} +if (!$mysql_errname) +{ + --source ../mask_engine.inc + SHOW CREATE TABLE t1; + INSERT INTO t1 (c) VALUES ('a'),('b'),('c'); + --source ../mask_engine.inc + SHOW CREATE TABLE t1; + TRUNCATE TABLE t1; + --source ../mask_engine.inc + SHOW CREATE TABLE t1; + INSERT INTO t1 (c) VALUES ('d'); + --source ../mask_engine.inc + SHOW CREATE TABLE t1; + SELECT * FROM t1; + DROP TABLE t1; +} + + +# Truncate partitions + +let $partition_options = PARTITION BY HASH(a) PARTITIONS 2; +--source ../create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Partitions + --source ../unexpected_result.inc +} +if (!$mysql_errname) +{ + INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(2,'d'),(4,'e'),(100,'f'),(101,'g'); + + let $alter_definition = TRUNCATE PARTITION p0; + --source ../alter_table.inc + if ($mysql_errname) + { + --let $my_last_stmt = $alter_statement + --let $functionality = ALTER TABLE + --source ../unexpected_result.inc + } + + --sorted_result + SELECT * FROM t1; + --replace_column 5 # 6 # 7 # 8 # 9 # 10 # + EXPLAIN PARTITIONS SELECT * FROM t1; + + INSERT INTO t1 (a,b) VALUES (1,'a'), (2,'b'), (3,'c'); + + let $alter_definition = TRUNCATE PARTITION ALL; + --source ../alter_table.inc + + SELECT * FROM t1; + + DROP TABLE t1; +} + +--source ../cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/repair_table.inc b/mysql-test/suite/storage_engine/repair_table.inc new file mode 100644 index 00000000000..83d2f02e20a --- /dev/null +++ b/mysql-test/suite/storage_engine/repair_table.inc @@ -0,0 +1,155 @@ +# +# REPAIR TABLE statements +# +# Note: the output is likely to be different for the engine under test, +# in which case rdiff will be needed. Or, the output might say that +# the storage engine does not support REPAIR. +# + +--disable_warnings +DROP TABLE IF EXISTS t1,t2; +--enable_warnings + +--source create_table.inc +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); +--let $table_name = t2 +--source create_table.inc + +REPAIR TABLE t1; +if ($mysql_errname) +{ + --source unexpected_result.inc +} +INSERT INTO t1 (a,b) VALUES (3,'c'); +INSERT INTO t2 (a,b) VALUES (4,'d'); +REPAIR NO_WRITE_TO_BINLOG TABLE t1, t2; +INSERT INTO t2 (a,b) VALUES (5,'e'),(6,'f'); +REPAIR LOCAL TABLE t2; +INSERT INTO t1 (a,b) VALUES (7,'g'),(8,'h'); +INSERT INTO t2 (a,b) VALUES (9,'i'); +REPAIR LOCAL TABLE t2, t1 EXTENDED; +INSERT INTO t1 (a,b) VALUES (10,'j'); +INSERT INTO t2 (a,b) VALUES (11,'k'); +REPAIR TABLE t1, t2 QUICK USE_FRM; +INSERT INTO t1 (a,b) VALUES (12,'l'); +INSERT INTO t2 (a,b) VALUES (13,'m'); +REPAIR NO_WRITE_TO_BINLOG TABLE t1, t2 QUICK EXTENDED USE_FRM; +FLUSH TABLE t1; + +let my_datadir = `SELECT @@datadir`; + +# Now we'll override all table files except for frm. +# Some engines are more enduring to table files corruption +# than others, so the result of the following INSERT and REPAIR +# will be different for different engines + +--perl +@files = glob "$ENV{my_datadir}/test/t1.*"; +foreach (@files) +{ + next if /.frm$/; + rename($_,"$_.save"); + open(FILE,">$_") || print "Could not open $_\n" && exit; + print FILE ""; + close(FILE); +} +EOF + +# We don't worry so much about the INSERT or SELECT result, +# it's REPAIR that we are after. +# The preceding INSERT, however, helps to trigger +# a bit more internals +--let $error_codes = 0,130,ER_FAILED_READ_FROM_PAR_FILE,ER_OPEN_AS_READONLY +INSERT INTO t1 (a,b) VALUES (14,'n'); +--source check_errors.inc +CHECK TABLE t1; +--let $error_codes = 0,130,ER_FAILED_READ_FROM_PAR_FILE,ER_OPEN_AS_READONLY +SELECT * FROM t1; +--source check_errors.inc +--enable_warnings +REPAIR TABLE t1; + +--perl +@files = glob "$ENV{my_datadir}/test/t1.*.save"; +foreach (@files) +{ + $nm = $_; + $nm =~ s/\.save$//; + rename($_,$nm); +} +EOF + +DROP TABLE t1, t2; + +--let $continue = 1 +--source have_default_index.inc + +if ($have_default_index) +{ + call mtr.add_suppression("Got an error from thread_id=.*"); + call mtr.add_suppression("MySQL thread id .*, query id .* localhost.*root Checking table"); + call mtr.add_suppression(" '\..test.t1'"); + call mtr.add_suppression("Couldn't repair table: test.t1"); + + --let $create_definition = a $int_indexed_col, b $char_col, $default_index (a) + --source create_table.inc + REPAIR TABLE t1; + INSERT INTO t1 (a,b) VALUES (7,'g'),(8,'h'); + REPAIR TABLE t1 EXTENDED; + INSERT INTO t1 (a,b) VALUES (10,'j'); + REPAIR TABLE t1 USE_FRM; + + # We will take files one by one (except for frm file), + # save the file, update the table, then restore the file + # and check the table. + # Results here can be very different depending on the engine. + + let $my_errno = 0; + + --list_files $my_datadir/test + + while (!$my_errno) + { + --error 0,1 + --perl + use File::Copy; + @files = glob "$ENV{my_datadir}/test/t1*"; + foreach (@files) + { + next if /.(?:frm|save|done)$/; + next if -e "$_.done"; + copy($_,"$_.save"); + exit 0; + } + # No more files + exit 1; + EOF + let $my_errno = $errno; + if (!$my_errno) + { + --let $error_codes = 0,144 + INSERT INTO t1 (a,b) VALUES (14,'n'),(15,'o'); + --source check_errors.inc + FLUSH TABLE t1; + --replace_result $my_datadir <DATADIR> + --perl + use File::Copy; + @files = glob "$ENV{my_datadir}/test/t1*.save"; + $nm = $files[0]; + $nm =~ s/\.save$//; + print "Restoring $nm\n"; + copy($files[0],"$nm.done"); + rename($files[0],$nm); + EOF + CHECK TABLE t1; + --let $error_codes = 0,ER_NOT_KEYFILE,144 + SELECT * FROM t1; + --source check_errors.inc + } + } + DROP TABLE t1; +} + +--remove_files_wildcard $my_datadir/test t1* + + diff --git a/mysql-test/suite/storage_engine/repair_table.result b/mysql-test/suite/storage_engine/repair_table.result new file mode 100644 index 00000000000..f1af943fd7b --- /dev/null +++ b/mysql-test/suite/storage_engine/repair_table.result @@ -0,0 +1,106 @@ +DROP TABLE IF EXISTS t1,t2; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); +CREATE TABLE t2 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +REPAIR TABLE t1; +Table Op Msg_type Msg_text +test.t1 repair status OK +INSERT INTO t1 (a,b) VALUES (3,'c'); +INSERT INTO t2 (a,b) VALUES (4,'d'); +REPAIR NO_WRITE_TO_BINLOG TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 repair status OK +test.t2 repair status OK +INSERT INTO t2 (a,b) VALUES (5,'e'),(6,'f'); +REPAIR LOCAL TABLE t2; +Table Op Msg_type Msg_text +test.t2 repair status OK +INSERT INTO t1 (a,b) VALUES (7,'g'),(8,'h'); +INSERT INTO t2 (a,b) VALUES (9,'i'); +REPAIR LOCAL TABLE t2, t1 EXTENDED; +Table Op Msg_type Msg_text +test.t2 repair status OK +test.t1 repair status OK +INSERT INTO t1 (a,b) VALUES (10,'j'); +INSERT INTO t2 (a,b) VALUES (11,'k'); +REPAIR TABLE t1, t2 QUICK USE_FRM; +Table Op Msg_type Msg_text +test.t1 repair warning Number of rows changed from 0 to 6 +test.t1 repair status OK +test.t2 repair warning Number of rows changed from 0 to 5 +test.t2 repair status OK +INSERT INTO t1 (a,b) VALUES (12,'l'); +INSERT INTO t2 (a,b) VALUES (13,'m'); +REPAIR NO_WRITE_TO_BINLOG TABLE t1, t2 QUICK EXTENDED USE_FRM; +Table Op Msg_type Msg_text +test.t1 repair warning Number of rows changed from 0 to 7 +test.t1 repair status OK +test.t2 repair warning Number of rows changed from 0 to 6 +test.t2 repair status OK +FLUSH TABLE t1; +INSERT INTO t1 (a,b) VALUES (14,'n'); +ERROR HY000: Incorrect file format 't1' +# Statement ended with one of expected results (0,130,ER_FAILED_READ_FROM_PAR_FILE,ER_OPEN_AS_READONLY). +# If you got a difference in error message, just add it to rdiff file +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check Error Incorrect file format 't1' +test.t1 check error Corrupt +SELECT * FROM t1; +ERROR HY000: Incorrect file format 't1' +# Statement ended with one of expected results (0,130,ER_FAILED_READ_FROM_PAR_FILE,ER_OPEN_AS_READONLY). +# If you got a difference in error message, just add it to rdiff file +REPAIR TABLE t1; +Table Op Msg_type Msg_text +test.t1 repair Error Incorrect file format 't1' +test.t1 repair error Corrupt +DROP TABLE t1, t2; +call mtr.add_suppression("Got an error from thread_id=.*"); +call mtr.add_suppression("MySQL thread id .*, query id .* localhost.*root Checking table"); +call mtr.add_suppression(" '\..test.t1'"); +call mtr.add_suppression("Couldn't repair table: test.t1"); +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>, <CUSTOM_INDEX> (a)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +REPAIR TABLE t1; +Table Op Msg_type Msg_text +test.t1 repair status OK +INSERT INTO t1 (a,b) VALUES (7,'g'),(8,'h'); +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +INSERT INTO t1 (a,b) VALUES (10,'j'); +REPAIR TABLE t1 USE_FRM; +Table Op Msg_type Msg_text +test.t1 repair warning Number of rows changed from 0 to 3 +test.t1 repair status OK +t1.MYD +t1.MYI +t1.frm +INSERT INTO t1 (a,b) VALUES (14,'n'),(15,'o'); +# Statement ended with one of expected results (0,144). +# If you got a difference in error message, just add it to rdiff file +FLUSH TABLE t1; +Restoring <DATADIR>/test/t1.MYD +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check error Size of datafile is: 39 Should be: 65 +test.t1 check error Corrupt +SELECT * FROM t1; +ERROR HY000: Incorrect key file for table 't1'; try to repair it +# Statement ended with one of expected results (0,ER_NOT_KEYFILE,144). +# If you got a difference in error message, just add it to rdiff file +INSERT INTO t1 (a,b) VALUES (14,'n'),(15,'o'); +ERROR HY000: Table './test/t1' is marked as crashed and last (automatic?) repair failed +# Statement ended with one of expected results (0,144). +# If you got a difference in error message, just add it to rdiff file +FLUSH TABLE t1; +Restoring <DATADIR>/test/t1.MYI +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check warning Table is marked as crashed and last repair failed +test.t1 check error Size of datafile is: 39 Should be: 65 +test.t1 check error Corrupt +SELECT * FROM t1; +ERROR HY000: Table './test/t1' is marked as crashed and last (automatic?) repair failed +# Statement ended with one of expected results (0,ER_NOT_KEYFILE,144). +# If you got a difference in error message, just add it to rdiff file +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/repair_table.test b/mysql-test/suite/storage_engine/repair_table.test new file mode 100644 index 00000000000..5e3068b0970 --- /dev/null +++ b/mysql-test/suite/storage_engine/repair_table.test @@ -0,0 +1,14 @@ +# +# REPAIR TABLE statements +# +# Note: the output is likely to be different for the engine under test, +# in which case rdiff will be needed. Or, the output might say that +# the storage engine does not support REPAIR. +# + +--source have_engine.inc + +--source repair_table.inc + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/replace.result b/mysql-test/suite/storage_engine/replace.result new file mode 100644 index 00000000000..c8fbca8f534 --- /dev/null +++ b/mysql-test/suite/storage_engine/replace.result @@ -0,0 +1,47 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +REPLACE INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'); +SELECT * FROM t1; +a b +1 a +2 b +3 c +4 d +5 e +REPLACE t1 (a,b) VALUE (10,'foo'),(10,'foo'); +SELECT * FROM t1; +a b +1 a +10 foo +10 foo +2 b +3 c +4 d +5 e +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>, UNIQUE INDEX (a)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +REPLACE INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'); +INSERT INTO t1 (a,b) VALUES (2,'d'); +ERROR 23000: Duplicate entry '2' for key 'a' +# Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY). +# If you got a difference in error message, just add it to rdiff file +REPLACE INTO t1 (a,b) VALUES (2,'d'); +SELECT * FROM t1; +a b +1 a +2 d +3 c +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>, PRIMARY KEY (b)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +REPLACE INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'); +INSERT INTO t1 (a,b) VALUES (4,'b'); +ERROR 23000: Duplicate entry 'b' for key 'PRIMARY' +# Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY). +# If you got a difference in error message, just add it to rdiff file +REPLACE INTO t1 (a,b) VALUES (4,'b'); +SELECT * FROM t1; +a b +1 a +3 c +4 b +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/replace.test b/mysql-test/suite/storage_engine/replace.test new file mode 100644 index 00000000000..368ed62a300 --- /dev/null +++ b/mysql-test/suite/storage_engine/replace.test @@ -0,0 +1,67 @@ +# +# Basic REPLACE statements +# +--source have_engine.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +--source create_table.inc + +# When there is no duplicate key, REPLACE should work as INSERT + +REPLACE INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'); +--sorted_result +SELECT * FROM t1; + +REPLACE t1 (a,b) VALUE (10,'foo'),(10,'foo'); +--sorted_result +SELECT * FROM t1; + +DROP TABLE t1; + +--let $create_definition = a $int_indexed_col, b $char_col, UNIQUE INDEX (a) +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Unique keys + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + REPLACE INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'); + --let $error_codes = ER_DUP_ENTRY,ER_DUP_KEY + INSERT INTO t1 (a,b) VALUES (2,'d'); + --source check_errors.inc + REPLACE INTO t1 (a,b) VALUES (2,'d'); + --sorted_result + SELECT * FROM t1; + + DROP TABLE t1; +} + +--let $create_definition = a $int_col, b $char_indexed_col, PRIMARY KEY (b) +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Primary keys + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + REPLACE INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'); + --let $error_codes = ER_DUP_ENTRY,ER_DUP_KEY + INSERT INTO t1 (a,b) VALUES (4,'b'); + --source check_errors.inc + REPLACE INTO t1 (a,b) VALUES (4,'b'); + --sorted_result + SELECT * FROM t1; + + DROP TABLE t1; +} + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/se-innodb.out b/mysql-test/suite/storage_engine/se-innodb.out new file mode 100644 index 00000000000..406e5066132 --- /dev/null +++ b/mysql-test/suite/storage_engine/se-innodb.out @@ -0,0 +1 @@ +Can't open perl script "./mtr": No such file or directory diff --git a/mysql-test/suite/storage_engine/select.result b/mysql-test/suite/storage_engine/select.result new file mode 100644 index 00000000000..d2331f4d869 --- /dev/null +++ b/mysql-test/suite/storage_engine/select.result @@ -0,0 +1,390 @@ +DROP TABLE IF EXISTS t1, t2; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (100,'foobar'),(1,'z'),(200,'bar'); +CREATE TABLE t2 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t2 (a,b) SELECT a, b FROM t1; +INSERT INTO t1 (a,b) SELECT a, b FROM t2; +SELECT * FROM t1; +a b +1 z +1 z +100 foobar +100 foobar +200 bar +200 bar +SELECT DISTINCT a FROM t1; +a +1 +100 +200 +SELECT ALL b, a FROM t1; +b a +bar 200 +bar 200 +foobar 100 +foobar 100 +z 1 +z 1 +SELECT STRAIGHT_JOIN SQL_CACHE t1.* FROM t2, t1 WHERE t1.a <> t2.a; +a b +1 z +1 z +1 z +1 z +100 foobar +100 foobar +100 foobar +100 foobar +200 bar +200 bar +200 bar +200 bar +SELECT SQL_SMALL_RESULT SQL_NO_CACHE t1.a FROM t1, t2; +a +1 +1 +1 +1 +1 +1 +100 +100 +100 +100 +100 +100 +200 +200 +200 +200 +200 +200 +SELECT SQL_BIG_RESULT SQL_CALC_FOUND_ROWS DISTINCT(t2.a) +FROM t1 t1_1, t2, t1 t1_2; +a +1 +100 +200 +SELECT FOUND_ROWS(); +FOUND_ROWS() +3 +SET GLOBAL query_cache_size = 1024*1024; +SELECT SQL_CACHE * FROM t1, t2; +a b a b +1 z 1 z +1 z 1 z +1 z 100 foobar +1 z 100 foobar +1 z 200 bar +1 z 200 bar +100 foobar 1 z +100 foobar 1 z +100 foobar 100 foobar +100 foobar 100 foobar +100 foobar 200 bar +100 foobar 200 bar +200 bar 1 z +200 bar 1 z +200 bar 100 foobar +200 bar 100 foobar +200 bar 200 bar +200 bar 200 bar +SET GLOBAL query_cache_size = 0; +SELECT a+10 AS field1, CONCAT(b,':',b) AS field2 FROM t1 +WHERE b > 'b' AND a IS NOT NULL +GROUP BY 2 DESC, field1 ASC +HAVING field1 < 1000 +ORDER BY field2, 1 DESC, field1*2 +LIMIT 5 OFFSET 1 ROWS EXAMINED 100000; +field1 field2 +11 z:z +110 foobar:foobar +SELECT SUM(a), MAX(a), b FROM t1 GROUP BY b WITH ROLLUP; +SUM(a) MAX(a) b +2 1 z +200 100 foobar +400 200 bar +602 200 NULL +SELECT * FROM t2 WHERE a>0 PROCEDURE ANALYSE(); +Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype +test.t2.a 1 200 1 3 0 0 100.3333 81.2418 ENUM('1','100','200') NOT NULL +test.t2.b bar z 1 6 0 0 3.3333 NULL ENUM('bar','foobar','z') NOT NULL +SELECT t1.a, t2.b FROM t2, t1 WHERE t1.a = t2.a ORDER BY t2.b, t1.a +INTO OUTFILE '<DATADIR>/select.out' +CHARACTER SET utf8 +FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY ''''; +200,'bar' +200,'bar' +100,'foobar' +100,'foobar' +1,'z' +1,'z' +SELECT t1.a, t2.b FROM t2, t1 WHERE t1.a = t2.a ORDER BY t2.b, t1.a +INTO DUMPFILE '<DATADIR>/select.dump'; +ERROR 42000: Result consisted of more than one row +SELECT t1.*, t2.* FROM t1, t2 ORDER BY t2.b, t1.a, t2.a, t1.b LIMIT 1 +INTO DUMPFILE '<DATADIR>/select.dump'; +1z200bar +SELECT MIN(a), MAX(a) FROM t1 INTO @min, @max; +SELECT @min, @max; +@min @max +1 200 +SELECT t1_1.*, t2.* FROM t2, t1 AS t1_1, t1 AS t1_2 +WHERE t1_1.a = t1_2.a AND t2.a = t1_1.a; +a b a b +1 z 1 z +1 z 1 z +1 z 1 z +1 z 1 z +100 foobar 100 foobar +100 foobar 100 foobar +100 foobar 100 foobar +100 foobar 100 foobar +200 bar 200 bar +200 bar 200 bar +200 bar 200 bar +200 bar 200 bar +SELECT alias1.* FROM ( SELECT * FROM t1 ) alias1, t2 WHERE t2.a IN (100,200); +a b +1 z +1 z +1 z +1 z +100 foobar +100 foobar +100 foobar +100 foobar +200 bar +200 bar +200 bar +200 bar +SELECT t1.a FROM { OJ t1 LEFT OUTER JOIN t2 ON t1.a = t2.a+10 }; +a +1 +1 +100 +100 +200 +200 +SELECT t1.* FROM t2 INNER JOIN t1; +a b +1 z +1 z +1 z +1 z +1 z +1 z +100 foobar +100 foobar +100 foobar +100 foobar +100 foobar +100 foobar +200 bar +200 bar +200 bar +200 bar +200 bar +200 bar +SELECT t1_2.* FROM t1 t1_1 CROSS JOIN t1 t1_2 ON t1_1.b = t1_2.b; +a b +1 z +1 z +1 z +1 z +100 foobar +100 foobar +100 foobar +100 foobar +200 bar +200 bar +200 bar +200 bar +SELECT t1.a, t2.b FROM t2 STRAIGHT_JOIN t1 WHERE t1.b > t2.b; +a b +1 bar +1 bar +1 foobar +1 foobar +100 bar +100 bar +SELECT t1.a, t2.b FROM t2 STRAIGHT_JOIN t1 ON t1.b > t2.b ORDER BY t1.a, t2.b; +a b +1 bar +1 bar +1 foobar +1 foobar +100 bar +100 bar +SELECT t2.* FROM t1 LEFT JOIN t2 USING (a) ORDER BY t2.a, t2.b LIMIT 1; +a b +1 z +SELECT t2.* FROM t2 LEFT OUTER JOIN t1 ON t1.a = t2.a WHERE t1.a IS NOT NULL; +a b +1 z +1 z +100 foobar +100 foobar +200 bar +200 bar +SELECT SUM(t2.a) FROM t1 RIGHT JOIN t2 ON t2.b = t1.b; +SUM(t2.a) +602 +SELECT MIN(t2.a) FROM t1 RIGHT OUTER JOIN t2 USING (b,a); +MIN(t2.a) +1 +SELECT alias.b FROM t1 NATURAL JOIN ( SELECT * FROM t1 ) alias WHERE b > ''; +b +bar +bar +bar +bar +foobar +foobar +foobar +foobar +z +z +z +z +SELECT t2.b FROM ( SELECT * FROM t1 ) alias NATURAL LEFT JOIN t2 WHERE b IS NOT NULL; +b +bar +bar +foobar +foobar +z +z +SELECT t1.*, t2.* FROM t1 NATURAL LEFT OUTER JOIN t2; +a b a b +1 z 1 z +1 z 1 z +100 foobar 100 foobar +100 foobar 100 foobar +200 bar 200 bar +200 bar 200 bar +SELECT t2_2.* FROM t2 t2_1 NATURAL RIGHT JOIN t2 t2_2 WHERE t2_1.a IN ( SELECT a FROM t1 ); +a b +1 z +100 foobar +200 bar +SELECT t1_2.b FROM t1 t1_1 NATURAL RIGHT OUTER JOIN t1 t1_2 INNER JOIN t2; +b +bar +bar +bar +bar +bar +bar +bar +bar +bar +bar +bar +bar +foobar +foobar +foobar +foobar +foobar +foobar +foobar +foobar +foobar +foobar +foobar +foobar +z +z +z +z +z +z +z +z +z +z +z +z +SELECT ( SELECT MIN(a) FROM ( SELECT * FROM t1 ) alias1 ) AS min_a FROM t2; +min_a +1 +1 +1 +SELECT * FROM t2 WHERE a = ( SELECT MIN(a) FROM t1 ); +a b +1 z +SELECT * FROM t2 WHERE b LIKE ( SELECT b FROM t1 ORDER BY b LIMIT 1 ); +a b +200 bar +SELECT t2.* FROM t1 t1_outer, t2 WHERE ( t1_outer.a, t2.b ) IN ( SELECT a, b FROM t2 WHERE a = t1_outer.a ); +a b +1 z +1 z +100 foobar +100 foobar +200 bar +200 bar +SELECT * FROM t2 WHERE b = ANY ( SELECT b FROM t1 WHERE a > 1 ); +a b +100 foobar +200 bar +SELECT * FROM t2 WHERE b > ALL ( SELECT b FROM t1 WHERE b < 'foo' ); +a b +1 z +100 foobar +SELECT * FROM t1 WHERE ROW(a, b) = ( SELECT a, b FROM t2 ORDER BY a, b LIMIT 1 ); +a b +1 z +1 z +SELECT * FROM t1 WHERE EXISTS ( SELECT * FROM t2 WHERE t2.b > t1.b ); +a b +100 foobar +100 foobar +200 bar +200 bar +SELECT t1.* FROM t1, t2 ORDER BY ( SELECT b FROM t1 WHERE a IS NULL ORDER BY b LIMIT 1 ) DESC; +a b +1 z +1 z +1 z +1 z +1 z +1 z +100 foobar +100 foobar +100 foobar +100 foobar +100 foobar +100 foobar +200 bar +200 bar +200 bar +200 bar +200 bar +200 bar +SELECT a, b FROM t1 HAVING a IN ( SELECT a FROM t2 WHERE b = t1.b ); +a b +1 z +1 z +100 foobar +100 foobar +200 bar +200 bar +SELECT * FROM t1 UNION SELECT * FROM t2 UNION DISTINCT SELECT * FROM t1; +a b +1 z +100 foobar +200 bar +SELECT * FROM t1 UNION SELECT * FROM t2 UNION ALL SELECT * FROM t1; +a b +1 z +1 z +1 z +100 foobar +100 foobar +100 foobar +200 bar +200 bar +200 bar +DROP TABLE t1, t2; diff --git a/mysql-test/suite/storage_engine/select.test b/mysql-test/suite/storage_engine/select.test new file mode 100644 index 00000000000..528fa64cfb2 --- /dev/null +++ b/mysql-test/suite/storage_engine/select.test @@ -0,0 +1,210 @@ +# +# Basic SELECT statements +# +# HIGH_PRIORITY is covered in select_high_prio test +# FOR UPDATE - in trx/select_for_update test +# LOCK IN SHARE MODE - in trx/select_lock_in_share_mode test +# index hints - in type_*_indexes tests +# +--source have_engine.inc + +--disable_warnings +DROP TABLE IF EXISTS t1, t2; +--enable_warnings + +--source create_table.inc +INSERT INTO t1 (a,b) VALUES (100,'foobar'),(1,'z'),(200,'bar'); + +--let $table_name = t2 +--source create_table.inc +INSERT INTO t2 (a,b) SELECT a, b FROM t1; +INSERT INTO t1 (a,b) SELECT a, b FROM t2; + +--sorted_result +SELECT * FROM t1; + +# Modifiers + +--sorted_result +SELECT DISTINCT a FROM t1; + +--sorted_result +SELECT ALL b, a FROM t1; + +# Optimizer and cache directives should not have any visible effect here, +# but we will add them for completness + +--sorted_result +SELECT STRAIGHT_JOIN SQL_CACHE t1.* FROM t2, t1 WHERE t1.a <> t2.a; + +--sorted_result +SELECT SQL_SMALL_RESULT SQL_NO_CACHE t1.a FROM t1, t2; + +--sorted_result +SELECT SQL_BIG_RESULT SQL_CALC_FOUND_ROWS DISTINCT(t2.a) + FROM t1 t1_1, t2, t1 t1_2; +SELECT FOUND_ROWS(); + +let $query_cache = `SELECT @@query_cache_size`; +SET GLOBAL query_cache_size = 1024*1024; +--sorted_result +SELECT SQL_CACHE * FROM t1, t2; +eval SET GLOBAL query_cache_size = $query_cache; + +# Combination of main clauses + +--sorted_result +SELECT a+10 AS field1, CONCAT(b,':',b) AS field2 FROM t1 +WHERE b > 'b' AND a IS NOT NULL +GROUP BY 2 DESC, field1 ASC +HAVING field1 < 1000 +ORDER BY field2, 1 DESC, field1*2 +LIMIT 5 OFFSET 1 ROWS EXAMINED 100000; + +# ROLLUP +--sorted_result +SELECT SUM(a), MAX(a), b FROM t1 GROUP BY b WITH ROLLUP; + +# Procedure + +--sorted_result +SELECT * FROM t2 WHERE a>0 PROCEDURE ANALYSE(); + +# SELECT INTO +let $datadir = `SELECT @@datadir`; + +--replace_result $datadir <DATADIR> +eval +SELECT t1.a, t2.b FROM t2, t1 WHERE t1.a = t2.a ORDER BY t2.b, t1.a + INTO OUTFILE '$datadir/select.out' + CHARACTER SET utf8 + FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY ''''; +--cat_file $datadir/select.out +--remove_file $datadir/select.out + +--replace_result $datadir <DATADIR> +--let $error_codes = ER_TOO_MANY_ROWS +eval +SELECT t1.a, t2.b FROM t2, t1 WHERE t1.a = t2.a ORDER BY t2.b, t1.a + INTO DUMPFILE '$datadir/select.dump'; +--source check_errors.inc +--remove_file $datadir/select.dump +--replace_result $datadir <DATADIR> +eval +SELECT t1.*, t2.* FROM t1, t2 ORDER BY t2.b, t1.a, t2.a, t1.b LIMIT 1 + INTO DUMPFILE '$datadir/select.dump'; + +--cat_file $datadir/select.dump +--echo +--remove_file $datadir/select.dump + +SELECT MIN(a), MAX(a) FROM t1 INTO @min, @max; +SELECT @min, @max; + +# Joins + +--sorted_result +SELECT t1_1.*, t2.* FROM t2, t1 AS t1_1, t1 AS t1_2 + WHERE t1_1.a = t1_2.a AND t2.a = t1_1.a; + +--sorted_result +SELECT alias1.* FROM ( SELECT * FROM t1 ) alias1, t2 WHERE t2.a IN (100,200); + +--sorted_result +SELECT t1.a FROM { OJ t1 LEFT OUTER JOIN t2 ON t1.a = t2.a+10 }; + +--sorted_result +SELECT t1.* FROM t2 INNER JOIN t1; + +--sorted_result +SELECT t1_2.* FROM t1 t1_1 CROSS JOIN t1 t1_2 ON t1_1.b = t1_2.b; + +--sorted_result +SELECT t1.a, t2.b FROM t2 STRAIGHT_JOIN t1 WHERE t1.b > t2.b; + +SELECT t1.a, t2.b FROM t2 STRAIGHT_JOIN t1 ON t1.b > t2.b ORDER BY t1.a, t2.b; + +SELECT t2.* FROM t1 LEFT JOIN t2 USING (a) ORDER BY t2.a, t2.b LIMIT 1; + +--sorted_result +SELECT t2.* FROM t2 LEFT OUTER JOIN t1 ON t1.a = t2.a WHERE t1.a IS NOT NULL; + +SELECT SUM(t2.a) FROM t1 RIGHT JOIN t2 ON t2.b = t1.b; + +SELECT MIN(t2.a) FROM t1 RIGHT OUTER JOIN t2 USING (b,a); + +--sorted_result +SELECT alias.b FROM t1 NATURAL JOIN ( SELECT * FROM t1 ) alias WHERE b > ''; + +--sorted_result +SELECT t2.b FROM ( SELECT * FROM t1 ) alias NATURAL LEFT JOIN t2 WHERE b IS NOT NULL; + +--sorted_result +SELECT t1.*, t2.* FROM t1 NATURAL LEFT OUTER JOIN t2; + +--sorted_result +SELECT t2_2.* FROM t2 t2_1 NATURAL RIGHT JOIN t2 t2_2 WHERE t2_1.a IN ( SELECT a FROM t1 ); + +--sorted_result +SELECT t1_2.b FROM t1 t1_1 NATURAL RIGHT OUTER JOIN t1 t1_2 INNER JOIN t2; + +# Subquery as scalar operand, subquery in the FROM clause + +--sorted_result +SELECT ( SELECT MIN(a) FROM ( SELECT * FROM t1 ) alias1 ) AS min_a FROM t2; + +# Comparison using subqueries + +--sorted_result +SELECT * FROM t2 WHERE a = ( SELECT MIN(a) FROM t1 ); + +--sorted_result +SELECT * FROM t2 WHERE b LIKE ( SELECT b FROM t1 ORDER BY b LIMIT 1 ); + +# Subquery with IN, correlated subquery + +--sorted_result +SELECT t2.* FROM t1 t1_outer, t2 WHERE ( t1_outer.a, t2.b ) IN ( SELECT a, b FROM t2 WHERE a = t1_outer.a ); + +# Subquery with ANY, ALL + +--sorted_result +SELECT * FROM t2 WHERE b = ANY ( SELECT b FROM t1 WHERE a > 1 ); + +--sorted_result +SELECT * FROM t2 WHERE b > ALL ( SELECT b FROM t1 WHERE b < 'foo' ); + +# Row subqueries + +--sorted_result +SELECT * FROM t1 WHERE ROW(a, b) = ( SELECT a, b FROM t2 ORDER BY a, b LIMIT 1 ); + +# Subquery with EXISTS + +--sorted_result +SELECT * FROM t1 WHERE EXISTS ( SELECT * FROM t2 WHERE t2.b > t1.b ); + +# Subquery in ORDER BY + +--sorted_result +SELECT t1.* FROM t1, t2 ORDER BY ( SELECT b FROM t1 WHERE a IS NULL ORDER BY b LIMIT 1 ) DESC; + +# Subquery in HAVING + +--sorted_result +SELECT a, b FROM t1 HAVING a IN ( SELECT a FROM t2 WHERE b = t1.b ); + +# Union + +--sorted_result +SELECT * FROM t1 UNION SELECT * FROM t2 UNION DISTINCT SELECT * FROM t1; + +--sorted_result +SELECT * FROM t1 UNION SELECT * FROM t2 UNION ALL SELECT * FROM t1; + + +# Cleanup +DROP TABLE t1, t2; + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/select_high_prio.result b/mysql-test/suite/storage_engine/select_high_prio.result new file mode 100644 index 00000000000..b3b70df3731 --- /dev/null +++ b/mysql-test/suite/storage_engine/select_high_prio.result @@ -0,0 +1,45 @@ +DROP TABLE IF EXISTS t1; +connect con0,localhost,root,,; +SET lock_wait_timeout = 4; +connect con1,localhost,root,,; +SET lock_wait_timeout = 4; +connect con2,localhost,root,,; +SET lock_wait_timeout = 4; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (1,'f'),(2,'b'); +connection con1; +LOCK TABLE t1 READ; +connection con0; +UPDATE t1 SET b = CONCAT(b,b); +connection con2; +SELECT * FROM t1; +connection con1; +UNLOCK TABLES; +connection con0; +connection con2; +# Should return the new data +a b +1 ff +2 bb +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (1,'f'),(2,'b'); +connection con1; +LOCK TABLE t1 READ; +connection con0; +UPDATE t1 SET b = CONCAT(b,b,b); +connection con2; +SET lock_wait_timeout = 1; +# Should return old data +SELECT HIGH_PRIORITY * FROM t1; +a b +1 f +2 b +connection con1; +UNLOCK TABLES; +connection con0; +disconnect con1; +disconnect con2; +disconnect con0; +connection default; +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/select_high_prio.test b/mysql-test/suite/storage_engine/select_high_prio.test new file mode 100644 index 00000000000..385752e8d4e --- /dev/null +++ b/mysql-test/suite/storage_engine/select_high_prio.test @@ -0,0 +1,139 @@ +# +# SELECT HIGH_PRIOIRITY +# +--source have_engine.inc + +--source include/count_sessions.inc + +--enable_connect_log + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +# We will have 3 connections: +# con1 will lock a table in READ mode +# con0 will run UPDATE (and will wait on the lock) +# con2 will start another SELECT +# con1 will then unlock the table +# +# With standard SELECT we should see updated rows in the 2nd result set, +# while with SELECT HIGH_PRIORITY we should still see only old rows in con2 resultset +# (and it shouldn't wait till the table is unlocked and UPDATE is executed). + +--connect (con0,localhost,root,,) +SET lock_wait_timeout = 4; +--connect (con1,localhost,root,,) +SET lock_wait_timeout = 4; +--connect (con2,localhost,root,,) +SET lock_wait_timeout = 4; + + +# Part 1: Standard SELECT +# should be executed after the UPDATE + +--source create_table.inc +INSERT INTO t1 (a,b) VALUES (1,'f'),(2,'b'); + +--connection con1 +LOCK TABLE t1 READ; + +--connection con0 +--send +UPDATE t1 SET b = CONCAT(b,b); + +--connection con2 +let $show_statement = SHOW PROCESSLIST; +let $field = State; +let $condition = LIKE 'Waiting for table%'; +let $wait_timeout = 2; +--source include/wait_show_condition.inc +--send +SELECT * FROM t1; + +--connection con1 +let $show_statement = SHOW PROCESSLIST; +let $field = Info; +let $condition = = 'SELECT * FROM t1'; +let $wait_timeout = 2; +--source include/wait_show_condition.inc +if (!$found) +{ + --let $mysql_errname = timeout in wait_show_condition.inc + --let $functionality = Table locking or UPDATE + --source unexpected_result.inc +} + +UNLOCK TABLES; + +--connection con0 +--reap +if ($mysql_errname) +{ + --let $my_last_stmt = UPDATE t1 SET b = CONCAT(b,b) + --let $functionality = UPDATE + --source unexpected_result.inc +} + +--connection con2 +--echo # Should return the new data +--sorted_result +--reap + +DROP TABLE t1; + + +# Part 2: SELECT HIGH_PRIORITY +# should be executed before the UPDATE + +--source create_table.inc +INSERT INTO t1 (a,b) VALUES (1,'f'),(2,'b'); + +--connection con1 +LOCK TABLE t1 READ; + +--connection con0 +--send +UPDATE t1 SET b = CONCAT(b,b,b); + +--connection con2 +let $condition = LIKE 'Waiting for table%'; +let $field = State; +let $wait_timeout = 2; +--source include/wait_show_condition.inc +SET lock_wait_timeout = 1; +--echo # Should return old data +--sorted_result +SELECT HIGH_PRIORITY * FROM t1; +if ($mysql_errname) +{ + --let $functionality = SELECT HIGH_PRIORITY + --source unexpected_result.inc +} + +--connection con1 +UNLOCK TABLES; + +--connection con0 +--reap +if ($mysql_errname) +{ + --let $my_last_stmt = UPDATE t1 SET b = CONCAT(b,b,b) + --let $functionality = UPDATE + --source unexpected_result.inc +} + +--disconnect con1 +--disconnect con2 +--disconnect con0 +let $wait_timeout = 30; + +--connection default + +# Cleanup +DROP TABLE t1; + +--source include/wait_until_count_sessions.inc + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/show_engine.result b/mysql-test/suite/storage_engine/show_engine.result new file mode 100644 index 00000000000..ab8c6b8f428 --- /dev/null +++ b/mysql-test/suite/storage_engine/show_engine.result @@ -0,0 +1,11 @@ +# For most engines SHOW ENGINE .. STATUS produces an empty result, +# so the default result file is empty; but returning a value here is not an error. +# The Status column is masked, because it is likely to contain some +# volatile data (timestamps, memory info, etc.) +SHOW ENGINE <STORAGE_ENGINE> STATUS; +Type Name Status +<STORAGE_ENGINE> ### Engine status, can be long and changeable ### +# For SHOW MUTEX even the number of lines is volatile, so the result logging is disabled, +# the test only checks that the command does not produce any errors +SHOW ENGINE <STORAGE_ENGINE> MUTEX; +SHOW ENGINE ALL MUTEX; diff --git a/mysql-test/suite/storage_engine/show_engine.test b/mysql-test/suite/storage_engine/show_engine.test new file mode 100644 index 00000000000..dca0c6b35c7 --- /dev/null +++ b/mysql-test/suite/storage_engine/show_engine.test @@ -0,0 +1,31 @@ +# +# SHOW ENGINE STATUS command +# +# The result might be empty, in which case the test will require rdiff, +# as it is optimistically expects some output from the command +# + +--source have_engine.inc + +--echo # For most engines SHOW ENGINE .. STATUS produces an empty result, +--echo # so the default result file is empty; but returning a value here is not an error. +--echo # The Status column is masked, because it is likely to contain some +--echo # volatile data (timestamps, memory info, etc.) + +--source mask_engine.inc +--replace_column 3 '### Engine status, can be long and changeable ###' +eval +SHOW ENGINE $storage_engine STATUS; + +--echo # For SHOW MUTEX even the number of lines is volatile, so the result logging is disabled, +--echo # the test only checks that the command does not produce any errors +--disable_result_log +--source mask_engine.inc +eval +SHOW ENGINE $storage_engine MUTEX; +--source mask_engine.inc +SHOW ENGINE ALL MUTEX; +--enable_result_log + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/show_table_status.result b/mysql-test/suite/storage_engine/show_table_status.result new file mode 100644 index 00000000000..98de48f816b --- /dev/null +++ b/mysql-test/suite/storage_engine/show_table_status.result @@ -0,0 +1,62 @@ +DROP TABLE IF EXISTS t1, t2, t3; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (100,'a'),(2,'foo'); +CREATE TABLE t2 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t2 (a,b) VALUES (1,'bar'); +CREATE TABLE t3 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> CHARACTER SET utf8; +SHOW TABLE STATUS WHERE name IN ( 't1', 't2', 't3' ); +Name t1 +Engine <STORAGE_ENGINE> +Version 10 +Row_format ### +Rows 2 +Avg_row_length ### +Data_length ### +Max_data_length ### +Index_length ### +Data_free ### +Auto_increment NULL +Create_time ### +Update_time ### +Check_time NULL +Collation latin1_swedish_ci +Checksum NULL +Create_options +Comment +Name t2 +Engine <STORAGE_ENGINE> +Version 10 +Row_format ### +Rows 1 +Avg_row_length ### +Data_length ### +Max_data_length ### +Index_length ### +Data_free ### +Auto_increment NULL +Create_time ### +Update_time ### +Check_time NULL +Collation latin1_swedish_ci +Checksum NULL +Create_options +Comment +Name t3 +Engine <STORAGE_ENGINE> +Version 10 +Row_format ### +Rows 0 +Avg_row_length ### +Data_length ### +Max_data_length ### +Index_length ### +Data_free ### +Auto_increment NULL +Create_time ### +Update_time ### +Check_time NULL +Collation utf8_general_ci +Checksum NULL +Create_options +Comment +DROP TABLE t1, t2, t3; diff --git a/mysql-test/suite/storage_engine/show_table_status.test b/mysql-test/suite/storage_engine/show_table_status.test new file mode 100644 index 00000000000..469d7e33a20 --- /dev/null +++ b/mysql-test/suite/storage_engine/show_table_status.test @@ -0,0 +1,30 @@ +# +# SHOW TABLE STATUS statement +# +# Note: the output might be different if even with such tiny tables +# the number of rows is approximate. In this case rdiff will be needed +# + +--source have_engine.inc + +--disable_warnings +DROP TABLE IF EXISTS t1, t2, t3; +--enable_warnings + +--source create_table.inc +INSERT INTO t1 (a,b) VALUES (100,'a'),(2,'foo'); + +--let $table_name = t2 +--source create_table.inc +INSERT INTO t2 (a,b) VALUES (1,'bar'); + +--let $table_name = t3 +--let $table_options = CHARACTER SET utf8 +--source create_table.inc + +--replace_column 2 <STORAGE_ENGINE> 4 ### 6 ### 7 ### 8 ### 9 ### 10 ### 12 ### 13 ### +--query_vertical SHOW TABLE STATUS WHERE name IN ( 't1', 't2', 't3' ) +DROP TABLE t1, t2, t3; + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/strict_check_errors.inc b/mysql-test/suite/storage_engine/strict_check_errors.inc new file mode 100644 index 00000000000..f28fccb0169 --- /dev/null +++ b/mysql-test/suite/storage_engine/strict_check_errors.inc @@ -0,0 +1,23 @@ +# +# Since we run tests in disable_abort_on_error mode, we cannot use --error command, +# and need to check the result manually. +# Usage in a test: +# --let $error_codes = <comma-separated list> # optional, default '' +# --let $mysql_errname = <error name> # optional, default current $mysql_errname (from the last SQL command) +# --let $mysql_errno = <error code> # optional, default current $mysql_errno (from the last SQL command) +# +# The difference between strict_check_errors.inc and check_errors.inc is only +# that they will produce different messages when there is a list of acceptable error codes (more than one), +# and the statement finished with one of them. + +# If a list contained more than one error, it could be on one of two reasons: +# first, we do not care which code it is, as long as it is one of the listed errors. +# In this case we will suggest to add an rdiff file if the message differs. +# Second, check_errors might be called from a generalized include file or test, +# which runs with different parameters and thus might produce different results for the same statement. +# Then, the message will be stricter, as the difference with the result file is actually a problem +# which needs to be checked at least. + +--let $strict_check = 1 +--source check_errors.inc + diff --git a/mysql-test/suite/storage_engine/tbl_opt_ai.result b/mysql-test/suite/storage_engine/tbl_opt_ai.result new file mode 100644 index 00000000000..d83e446bede --- /dev/null +++ b/mysql-test/suite/storage_engine/tbl_opt_ai.result @@ -0,0 +1,14 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> AUTO_INCREMENT=10; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> AUTO_INCREMENT=10 DEFAULT CHARSET=latin1 +ALTER TABLE t1 AUTO_INCREMENT=100; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> AUTO_INCREMENT=100 DEFAULT CHARSET=latin1 +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/tbl_opt_ai.test b/mysql-test/suite/storage_engine/tbl_opt_ai.test new file mode 100644 index 00000000000..e0d26cd46b0 --- /dev/null +++ b/mysql-test/suite/storage_engine/tbl_opt_ai.test @@ -0,0 +1,35 @@ +# +# Check whether AUTO_INCREMENT option +# is supported in CREATE and ALTER TABLE +# +# Note: the test does not check whether the option +# has any real effect on the table, only +# that it's accepted +# + +--source have_engine.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +--let $create_definition = a $int_col +--let $table_options = AUTO_INCREMENT=10 +--source create_table.inc +--source mask_engine.inc +SHOW CREATE TABLE t1; + +--let $alter_definition = AUTO_INCREMENT=100 +--source alter_table.inc +if ($mysql_errname) +{ + --let $functionality = ALTER TABLE + --source unexpected_result.inc +} +--source mask_engine.inc +SHOW CREATE TABLE t1; + +DROP TABLE t1; + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/tbl_opt_avg_row_length.result b/mysql-test/suite/storage_engine/tbl_opt_avg_row_length.result new file mode 100644 index 00000000000..39debfcc8d1 --- /dev/null +++ b/mysql-test/suite/storage_engine/tbl_opt_avg_row_length.result @@ -0,0 +1,16 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> AVG_ROW_LENGTH=300; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` char(8) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 AVG_ROW_LENGTH=300 +ALTER TABLE t1 AVG_ROW_LENGTH=30000000; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` char(8) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 AVG_ROW_LENGTH=30000000 +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/tbl_opt_avg_row_length.test b/mysql-test/suite/storage_engine/tbl_opt_avg_row_length.test new file mode 100644 index 00000000000..2ddde478511 --- /dev/null +++ b/mysql-test/suite/storage_engine/tbl_opt_avg_row_length.test @@ -0,0 +1,35 @@ +# +# Check whether AVG_ROW_LENGTH option +# is supported in CREATE and ALTER TABLE +# +# Note: the test does not check whether the option +# has any real effect on the table, only +# that it's accepted +# + +--source have_engine.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +--let $table_options = AVG_ROW_LENGTH=300 +--source create_table.inc + +--source mask_engine.inc +SHOW CREATE TABLE t1; + +--let $alter_definition = AVG_ROW_LENGTH=30000000 +--source alter_table.inc +if ($mysql_errname) +{ + --let $functionality = ALTER TABLE + --source unexpected_result.inc +} +--source mask_engine.inc +SHOW CREATE TABLE t1; + +DROP TABLE t1; + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/tbl_opt_checksum.result b/mysql-test/suite/storage_engine/tbl_opt_checksum.result new file mode 100644 index 00000000000..3f86eb08df3 --- /dev/null +++ b/mysql-test/suite/storage_engine/tbl_opt_checksum.result @@ -0,0 +1,16 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> CHECKSUM=1; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` char(8) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 CHECKSUM=1 +ALTER TABLE t1 CHECKSUM=0; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` char(8) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/tbl_opt_checksum.test b/mysql-test/suite/storage_engine/tbl_opt_checksum.test new file mode 100644 index 00000000000..04d8cf9d9c6 --- /dev/null +++ b/mysql-test/suite/storage_engine/tbl_opt_checksum.test @@ -0,0 +1,30 @@ +# +# Check whether CHECKSUM option is supported +# in CREATE and ALTER TABLE. +# + +--source have_engine.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +--let $table_options = CHECKSUM=1 +--source create_table.inc +--source mask_engine.inc +SHOW CREATE TABLE t1; + +--let $alter_definition = CHECKSUM=0 +--source alter_table.inc +if ($mysql_errname) +{ + --let $functionality = ALTER TABLE + --source unexpected_result.inc +} +--source mask_engine.inc +SHOW CREATE TABLE t1; + +DROP TABLE t1; + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/tbl_opt_connection.result b/mysql-test/suite/storage_engine/tbl_opt_connection.result new file mode 100644 index 00000000000..e382613f32c --- /dev/null +++ b/mysql-test/suite/storage_engine/tbl_opt_connection.result @@ -0,0 +1,24 @@ +DROP TABLE IF EXISTS t1; +CREATE DATABASE test_remote; +CREATE SERVER test_connection FOREIGN DATA WRAPPER mysql +OPTIONS (USER 'root', HOST 'localhost', DATABASE 'test_remote'); +CREATE SERVER test_connection2 FOREIGN DATA WRAPPER mysql +OPTIONS (USER 'root', HOST 'localhost', DATABASE 'test_remote'); +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> CONNECTION='test_connection'; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` char(8) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 CONNECTION='test_connection' +ALTER TABLE t1 CONNECTION='test_connection2'; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` char(8) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 CONNECTION='test_connection2' +DROP TABLE t1; +DROP SERVER test_connection; +DROP SERVER test_connection2; +DROP DATABASE test_remote; diff --git a/mysql-test/suite/storage_engine/tbl_opt_connection.test b/mysql-test/suite/storage_engine/tbl_opt_connection.test new file mode 100644 index 00000000000..df92df7e308 --- /dev/null +++ b/mysql-test/suite/storage_engine/tbl_opt_connection.test @@ -0,0 +1,52 @@ +# +# Check whether CONNECTION option is supported +# is supported in CREATE and ALTER TABLE +# +# Note: the test does not check whether the option +# has any real effect on the table, only +# that it's accepted +# + +--source have_engine.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +CREATE DATABASE test_remote; +CREATE SERVER test_connection FOREIGN DATA WRAPPER mysql +OPTIONS (USER 'root', HOST 'localhost', DATABASE 'test_remote'); +CREATE SERVER test_connection2 FOREIGN DATA WRAPPER mysql +OPTIONS (USER 'root', HOST 'localhost', DATABASE 'test_remote'); + +--let $table_options = CONNECTION='test_connection' +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --source mask_engine.inc + SHOW CREATE TABLE t1; + --let $alter_definition = CONNECTION='test_connection2' + --source alter_table.inc + if ($mysql_errname) + { + --let $my_last_stmt = $alter_statement + --let $functionality = ALTER TABLE + --source unexpected_result.inc + } + --source mask_engine.inc + SHOW CREATE TABLE t1; + + DROP TABLE t1; +} + +DROP SERVER test_connection; +DROP SERVER test_connection2; +DROP DATABASE test_remote; + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/tbl_opt_data_index_dir.result b/mysql-test/suite/storage_engine/tbl_opt_data_index_dir.result new file mode 100644 index 00000000000..b8c5e75c88c --- /dev/null +++ b/mysql-test/suite/storage_engine/tbl_opt_data_index_dir.result @@ -0,0 +1,16 @@ +DROP TABLE IF EXISTS t1; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` char(8) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 DATA DIRECTORY='<DATA_DIR>' INDEX DIRECTORY='<INDEX_DIR>' +Warnings: +Warning 1618 <INDEX DIRECTORY> option ignored +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` char(8) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 DATA DIRECTORY='<DATA_DIR>' INDEX DIRECTORY='<INDEX_DIR>' +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/tbl_opt_data_index_dir.test b/mysql-test/suite/storage_engine/tbl_opt_data_index_dir.test new file mode 100644 index 00000000000..fa7a27eb8af --- /dev/null +++ b/mysql-test/suite/storage_engine/tbl_opt_data_index_dir.test @@ -0,0 +1,51 @@ +# +# Check whether DATA DIRECTORY and INDEX DIRECTORY +# are supported in CREATE and ALTER TABLE +# +# Note: the test does not check whether the options +# have any real effect on the table, only +# that they are accepted +# + +--source have_engine.inc + +--let $data_dir = $MYSQLTEST_VARDIR/storage_engine_data_dir/ +--let $index_dir = $MYSQLTEST_VARDIR/storage_engine_index_dir/ +--mkdir $data_dir +--mkdir $index_dir + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +--let $table_options = DATA DIRECTORY = '$data_dir' INDEX DIRECTORY = '$index_dir' +# We cannot mask the folders name here, but we can switch off query logging +--let $disable_query_log = 1 +--source create_table.inc + +--source mask_engine.inc +--replace_result $data_dir <DATA_DIR> $index_dir <INDEX_DIR> +SHOW CREATE TABLE t1; + +--let $alter_definition = INDEX DIRECTORY = '$data_dir' +--disable_query_log +--source alter_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $alter_statement + --let $functionality = ALTER TABLE + --source unexpected_result.inc +} +--enable_query_log +--source mask_engine.inc +--replace_result $data_dir <DATA_DIR> $index_dir <INDEX_DIR> +SHOW CREATE TABLE t1; + +DROP TABLE t1; + +--source cleanup_engine.inc + +--rmdir $data_dir +--rmdir $index_dir + + diff --git a/mysql-test/suite/storage_engine/tbl_opt_delay_key_write.result b/mysql-test/suite/storage_engine/tbl_opt_delay_key_write.result new file mode 100644 index 00000000000..170f7b782a8 --- /dev/null +++ b/mysql-test/suite/storage_engine/tbl_opt_delay_key_write.result @@ -0,0 +1,16 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> DELAY_KEY_WRITE=1; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` char(8) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 DELAY_KEY_WRITE=1 +ALTER TABLE t1 DELAY_KEY_WRITE=0; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` char(8) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/tbl_opt_delay_key_write.test b/mysql-test/suite/storage_engine/tbl_opt_delay_key_write.test new file mode 100644 index 00000000000..724cd9e0566 --- /dev/null +++ b/mysql-test/suite/storage_engine/tbl_opt_delay_key_write.test @@ -0,0 +1,35 @@ +# +# Check whether DELAY_KEY_WRITE option +# is supported in CREATE and ALTER TABLE +# +# Note: the test does not check whether the option +# has any real effect on the table, only +# that it's accepted +# + +--source have_engine.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +--let $table_options = DELAY_KEY_WRITE=1 +--source create_table.inc +--source mask_engine.inc +SHOW CREATE TABLE t1; + +--let $alter_definition = DELAY_KEY_WRITE=0 +--source alter_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $alter_statement + --let $functionality = ALTER TABLE + --source unexpected_result.inc +} +--source mask_engine.inc +SHOW CREATE TABLE t1; + +DROP TABLE t1; + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/tbl_opt_insert_method.result b/mysql-test/suite/storage_engine/tbl_opt_insert_method.result new file mode 100644 index 00000000000..e538c821c78 --- /dev/null +++ b/mysql-test/suite/storage_engine/tbl_opt_insert_method.result @@ -0,0 +1,16 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> INSERT_METHOD=FIRST; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` char(8) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 INSERT_METHOD=FIRST +ALTER TABLE t1 INSERT_METHOD=NO; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` char(8) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/tbl_opt_insert_method.test b/mysql-test/suite/storage_engine/tbl_opt_insert_method.test new file mode 100644 index 00000000000..29378e7445b --- /dev/null +++ b/mysql-test/suite/storage_engine/tbl_opt_insert_method.test @@ -0,0 +1,35 @@ +# +# Check whether INSERT_METHOD option +# is supported in CREATE and ALTER TABLE +# +# Note: the test does not check whether the option +# has any real effect on the table, only +# that it's accepted +# + +--source have_engine.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +--let $table_options = INSERT_METHOD=FIRST +--source create_table.inc +--source mask_engine.inc +SHOW CREATE TABLE t1; + +--let $alter_definition = INSERT_METHOD=NO +--source alter_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $alter_statement + --let $functionality = ALTER TABLE + --source unexpected_result.inc +} +--source mask_engine.inc +SHOW CREATE TABLE t1; + +DROP TABLE t1; + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/tbl_opt_key_block_size.result b/mysql-test/suite/storage_engine/tbl_opt_key_block_size.result new file mode 100644 index 00000000000..f76fdb0caab --- /dev/null +++ b/mysql-test/suite/storage_engine/tbl_opt_key_block_size.result @@ -0,0 +1,16 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> KEY_BLOCK_SIZE=8; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` char(8) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=8 +ALTER TABLE t1 KEY_BLOCK_SIZE=1; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` char(8) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=1 +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/tbl_opt_key_block_size.test b/mysql-test/suite/storage_engine/tbl_opt_key_block_size.test new file mode 100644 index 00000000000..9c9109a90af --- /dev/null +++ b/mysql-test/suite/storage_engine/tbl_opt_key_block_size.test @@ -0,0 +1,35 @@ +# +# Check whether KEY_BLOCK_SIZE option +# is supported in CREATE and ALTER TABLE +# +# Note: the test does not check whether the option +# has any real effect on the table, only +# that it's accepted +# + +--source have_engine.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +--let $table_options = KEY_BLOCK_SIZE=8 +--source create_table.inc +--source mask_engine.inc +SHOW CREATE TABLE t1; + +--let $alter_definition = KEY_BLOCK_SIZE=1 +--source alter_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $alter_statement + --let $functionality = ALTER TABLE + --source unexpected_result.inc +} +--source mask_engine.inc +SHOW CREATE TABLE t1; + +DROP TABLE t1; + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/tbl_opt_max_rows.result b/mysql-test/suite/storage_engine/tbl_opt_max_rows.result new file mode 100644 index 00000000000..977cf53acd6 --- /dev/null +++ b/mysql-test/suite/storage_engine/tbl_opt_max_rows.result @@ -0,0 +1,16 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> MAX_ROWS=10000000; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` char(8) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 MAX_ROWS=10000000 +ALTER TABLE t1 MAX_ROWS=30000000; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` char(8) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 MAX_ROWS=30000000 +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/tbl_opt_max_rows.test b/mysql-test/suite/storage_engine/tbl_opt_max_rows.test new file mode 100644 index 00000000000..cbf9ad934db --- /dev/null +++ b/mysql-test/suite/storage_engine/tbl_opt_max_rows.test @@ -0,0 +1,35 @@ +# +# Check whether MAX_ROWS option +# is supported in CREATE and ALTER TABLE +# +# Note: the test does not check whether the option +# has any real effect on the table, only +# that it's accepted +# + +--source have_engine.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +--let $table_options = MAX_ROWS=10000000 +--source create_table.inc +--source mask_engine.inc +SHOW CREATE TABLE t1; + +--let $alter_definition = MAX_ROWS=30000000 +--source alter_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $alter_statement + --let $functionality = ALTER TABLE + --source unexpected_result.inc +} +--source mask_engine.inc +SHOW CREATE TABLE t1; + +DROP TABLE t1; + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/tbl_opt_min_rows.result b/mysql-test/suite/storage_engine/tbl_opt_min_rows.result new file mode 100644 index 00000000000..0407d6b6425 --- /dev/null +++ b/mysql-test/suite/storage_engine/tbl_opt_min_rows.result @@ -0,0 +1,16 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> MIN_ROWS=1; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` char(8) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 MIN_ROWS=1 +ALTER TABLE t1 MIN_ROWS=10000; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` char(8) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 MIN_ROWS=10000 +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/tbl_opt_min_rows.test b/mysql-test/suite/storage_engine/tbl_opt_min_rows.test new file mode 100644 index 00000000000..75b6e7b14d1 --- /dev/null +++ b/mysql-test/suite/storage_engine/tbl_opt_min_rows.test @@ -0,0 +1,35 @@ +# +# Check whether MIN_ROWS option +# is supported in CREATE and ALTER TABLE +# +# Note: the test does not check whether the option +# has any real effect on the table, only +# that it's accepted +# + +--source have_engine.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +--let $table_options = MIN_ROWS=1 +--source create_table.inc +--source mask_engine.inc +SHOW CREATE TABLE t1; + +--let $alter_definition = MIN_ROWS=10000 +--source alter_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $alter_statement + --let $functionality = ALTER TABLE + --source unexpected_result.inc +} +--source mask_engine.inc +SHOW CREATE TABLE t1; + +DROP TABLE t1; + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/tbl_opt_pack_keys.result b/mysql-test/suite/storage_engine/tbl_opt_pack_keys.result new file mode 100644 index 00000000000..1f56c035442 --- /dev/null +++ b/mysql-test/suite/storage_engine/tbl_opt_pack_keys.result @@ -0,0 +1,16 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> PACK_KEYS=1; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` char(8) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 PACK_KEYS=1 +ALTER TABLE t1 PACK_KEYS=0; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` char(8) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 PACK_KEYS=0 +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/tbl_opt_pack_keys.test b/mysql-test/suite/storage_engine/tbl_opt_pack_keys.test new file mode 100644 index 00000000000..f0d9387fe08 --- /dev/null +++ b/mysql-test/suite/storage_engine/tbl_opt_pack_keys.test @@ -0,0 +1,35 @@ +# +# Check whether PACK KEYS option +# is supported in CREATE and ALTER TABLE +# +# Note: the test does not check whether the option +# has any real effect on the table, only +# that it's accepted +# + +--source have_engine.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +--let $table_options = PACK_KEYS=1 +--source create_table.inc +--source mask_engine.inc +SHOW CREATE TABLE t1; + +--let $alter_definition = PACK_KEYS=0 +--source alter_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $alter_statement + --let $functionality = ALTER TABLE + --source unexpected_result.inc +} +--source mask_engine.inc +SHOW CREATE TABLE t1; + +DROP TABLE t1; + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/tbl_opt_password.result b/mysql-test/suite/storage_engine/tbl_opt_password.result new file mode 100644 index 00000000000..43c409dac14 --- /dev/null +++ b/mysql-test/suite/storage_engine/tbl_opt_password.result @@ -0,0 +1,16 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> PASSWORD='password'; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` char(8) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +ALTER TABLE t1 PASSWORD='new_password'; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` char(8) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/tbl_opt_password.test b/mysql-test/suite/storage_engine/tbl_opt_password.test new file mode 100644 index 00000000000..471295e54e4 --- /dev/null +++ b/mysql-test/suite/storage_engine/tbl_opt_password.test @@ -0,0 +1,40 @@ +# +# Check whether PASSWORD option +# is supported in CREATE and ALTER TABLE +# +# Note: the test does not check whether the option +# has any real effect on the table, only +# that it's accepted +# +# This option is not supported by any known engines, +# that's why the result file does not contain it; +# but it's syntactically acceptable. +# + + +--source have_engine.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +--let $table_options = PASSWORD='password' +--source create_table.inc +--source mask_engine.inc +SHOW CREATE TABLE t1; + +--let $alter_definition = PASSWORD='new_password' +--source alter_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $alter_statement + --let $functionality = ALTER TABLE + --source unexpected_result.inc +} +--source mask_engine.inc +SHOW CREATE TABLE t1; + +DROP TABLE t1; + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/tbl_opt_row_format.result b/mysql-test/suite/storage_engine/tbl_opt_row_format.result new file mode 100644 index 00000000000..5f1cf713bb6 --- /dev/null +++ b/mysql-test/suite/storage_engine/tbl_opt_row_format.result @@ -0,0 +1,16 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> ROW_FORMAT=FIXED; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` char(8) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 ROW_FORMAT=FIXED +ALTER TABLE t1 ROW_FORMAT=DYNAMIC; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` char(8) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/tbl_opt_row_format.test b/mysql-test/suite/storage_engine/tbl_opt_row_format.test new file mode 100644 index 00000000000..d6347551da0 --- /dev/null +++ b/mysql-test/suite/storage_engine/tbl_opt_row_format.test @@ -0,0 +1,35 @@ +# +# Check whether ROW_FORMAT option +# is supported in CREATE and ALTER TABLE +# +# Note: the test does not check whether the option +# has any real effect on the table, only +# that it's accepted +# + +--source have_engine.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +--let $table_options = ROW_FORMAT=FIXED +--source create_table.inc +--source mask_engine.inc +SHOW CREATE TABLE t1; + +--let $alter_definition = ROW_FORMAT=DYNAMIC +--source alter_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $alter_statement + --let $functionality = ALTER TABLE + --source unexpected_result.inc +} +--source mask_engine.inc +SHOW CREATE TABLE t1; + +DROP TABLE t1; + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/tbl_opt_union.result b/mysql-test/suite/storage_engine/tbl_opt_union.result new file mode 100644 index 00000000000..81521eff8a2 --- /dev/null +++ b/mysql-test/suite/storage_engine/tbl_opt_union.result @@ -0,0 +1,14 @@ +DROP TABLE IF EXISTS t1, child1, child2; +CREATE TABLE t1 (a <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> UNION(child1); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 UNION=(`child1`) +ALTER TABLE t1 UNION = (child1,child2); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 UNION=(`child1`,`child2`) +DROP TABLE t1, child1, child2; diff --git a/mysql-test/suite/storage_engine/tbl_opt_union.test b/mysql-test/suite/storage_engine/tbl_opt_union.test new file mode 100644 index 00000000000..fa134ab8344 --- /dev/null +++ b/mysql-test/suite/storage_engine/tbl_opt_union.test @@ -0,0 +1,41 @@ +# +# Check whether UNION option +# is supported in CREATE and ALTER TABLE +# +# Note: the test does not check whether the option +# has any real effect on the table, only +# that it's accepted +# + +--source have_engine.inc + +--disable_warnings +DROP TABLE IF EXISTS t1, child1, child2; +--enable_warnings + +--disable_query_log +eval CREATE TABLE child1 (a $int_col) ENGINE=MyISAM; +eval CREATE TABLE child2 (a $int_col) ENGINE=MyISAM; +--enable_query_log + +--let $table_options = UNION(child1) +--let $create_definition = a $int_col +--source create_table.inc +--source mask_engine.inc +SHOW CREATE TABLE t1; + +--let $alter_definition = UNION = (child1,child2) +--source alter_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $alter_statement + --let $functionality = ALTER TABLE + --source unexpected_result.inc +} +--source mask_engine.inc +SHOW CREATE TABLE t1; + +DROP TABLE t1, child1, child2; + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/tbl_standard_opts.result b/mysql-test/suite/storage_engine/tbl_standard_opts.result new file mode 100644 index 00000000000..b4b183aacb2 --- /dev/null +++ b/mysql-test/suite/storage_engine/tbl_standard_opts.result @@ -0,0 +1,40 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> DEFAULT CHARACTER SET = utf8 +COLLATE = utf8_general_ci +COMMENT = 'standard table options' +; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` char(8) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=utf8 COMMENT='standard table options' +ALTER TABLE t1 COMMENT = 'table altered'; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` char(8) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=utf8 COMMENT='table altered' +ALTER TABLE t1 ENGINE=MEMORY; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` char(8) DEFAULT NULL +) ENGINE=MEMORY DEFAULT CHARSET=utf8 COMMENT='table altered' +ALTER TABLE t1 ENGINE=<STORAGE_ENGINE>; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` char(8) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=utf8 COMMENT='table altered' +ALTER TABLE t1 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` char(8) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 COMMENT='table altered' +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/tbl_standard_opts.test b/mysql-test/suite/storage_engine/tbl_standard_opts.test new file mode 100644 index 00000000000..7e723788cd7 --- /dev/null +++ b/mysql-test/suite/storage_engine/tbl_standard_opts.test @@ -0,0 +1,60 @@ +# +# Standard options in CREATE and ALTER TABLE +# +# Note: the test does not check whether the options +# have any real effect on the table, only +# that they are accepted +# + +--source have_engine.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +# Create table with standard options + +let $table_options = + DEFAULT CHARACTER SET = utf8 + COLLATE = utf8_general_ci + COMMENT = 'standard table options' +; +--source create_table.inc +--source mask_engine.inc +SHOW CREATE TABLE t1; + + +# Alter comment + +--let $alter_definition = COMMENT = 'table altered' +--source alter_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $alter_statement + --let $functionality = ALTER TABLE + --source unexpected_result.inc +} +--source mask_engine.inc +SHOW CREATE TABLE t1; + +# Alter ENGINE value + +--let $alter_definition = ENGINE=MEMORY +--source alter_table.inc +SHOW CREATE TABLE t1; +--let $alter_definition = ENGINE=$storage_engine +--source alter_table.inc +--source mask_engine.inc +SHOW CREATE TABLE t1; + +# Alter character set and collation + +--let $alter_definition = CHARACTER SET = latin1 COLLATE = latin1_swedish_ci +--source alter_table.inc +--source mask_engine.inc +SHOW CREATE TABLE t1; + +DROP TABLE t1; + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/tbl_temporary.result b/mysql-test/suite/storage_engine/tbl_temporary.result new file mode 100644 index 00000000000..b81fa0a788b --- /dev/null +++ b/mysql-test/suite/storage_engine/tbl_temporary.result @@ -0,0 +1,11 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c CHAR(1)) ENGINE=MyISAM; +CREATE TEMPORARY TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TEMPORARY TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` char(8) DEFAULT NULL +) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +DROP TEMPORARY TABLE t1; +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/tbl_temporary.test b/mysql-test/suite/storage_engine/tbl_temporary.test new file mode 100644 index 00000000000..963238c37a5 --- /dev/null +++ b/mysql-test/suite/storage_engine/tbl_temporary.test @@ -0,0 +1,32 @@ +# +# The test checks whether a temporary table +# can be created with the engine under test. +# + +--source have_engine.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +# This is a base table which we want to mask +CREATE TABLE t1 (c CHAR(1)) ENGINE=MyISAM; + +--let $temporary = 1 +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Temporary tables + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --source mask_engine.inc + SHOW CREATE TABLE t1; + + DROP TEMPORARY TABLE t1; + DROP TABLE t1; +} +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/truncate_table.result b/mysql-test/suite/storage_engine/truncate_table.result new file mode 100644 index 00000000000..0a774c4b8dd --- /dev/null +++ b/mysql-test/suite/storage_engine/truncate_table.result @@ -0,0 +1,41 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +TRUNCATE TABLE t1; +INSERT INTO t1 (a,b) VALUES (1,'a'), (2,'b'), (3,'c'); +TRUNCATE TABLE t1; +SELECT * FROM t1; +a b +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN> KEY AUTO_INCREMENT, c <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW TABLE STATUS LIKE 't1'; +Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment +t1 # # # # # # # # # 1 # # # # # # # +INSERT INTO t1 (c) VALUES ('a'),('b'),('c'); +SHOW TABLE STATUS LIKE 't1'; +Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment +t1 # # # # # # # # # 4 # # # # # # # +TRUNCATE TABLE t1; +SHOW TABLE STATUS LIKE 't1'; +Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment +t1 # # # # # # # # # 1 # # # # # # # +INSERT INTO t1 (c) VALUES ('d'); +SHOW TABLE STATUS LIKE 't1'; +Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment +t1 # # # # # # # # # 2 # # # # # # # +SELECT * FROM t1; +a c +1 d +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'); +HANDLER t1 OPEN AS h1; +HANDLER h1 READ FIRST; +a b +1 a +TRUNCATE TABLE t1; +HANDLER h1 READ NEXT; +ERROR 42S02: Unknown table 'h1' in HANDLER +HANDLER t1 OPEN AS h2; +HANDLER h2 READ FIRST; +a b +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/truncate_table.test b/mysql-test/suite/storage_engine/truncate_table.test new file mode 100644 index 00000000000..c84fba143b7 --- /dev/null +++ b/mysql-test/suite/storage_engine/truncate_table.test @@ -0,0 +1,81 @@ +# +# TRUNCATE TABLE +# + +--source have_engine.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +--source create_table.inc +TRUNCATE TABLE t1; +if ($mysql_errname) +{ + --let $functionality = TRUNCATE TABLE + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + INSERT INTO t1 (a,b) VALUES (1,'a'), (2,'b'), (3,'c'); + TRUNCATE TABLE t1; + SELECT * FROM t1; +} +DROP TABLE t1; + + +# Truncate resets auto-increment value on the table + +--let $create_definition = a $int_indexed_col KEY AUTO_INCREMENT, c $char_col +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = PK or AUTO_INCREMENT + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 2 # 3 # 4 # 5 # 6 # 7 # 8 # 9 # 10 # 12 # 13 # 14 # 15 # 16 # 17 # 18 # + SHOW TABLE STATUS LIKE 't1'; + + INSERT INTO t1 (c) VALUES ('a'),('b'),('c'); + --replace_column 2 # 3 # 4 # 5 # 6 # 7 # 8 # 9 # 10 # 12 # 13 # 14 # 15 # 16 # 17 # 18 # + SHOW TABLE STATUS LIKE 't1'; + + TRUNCATE TABLE t1; + --replace_column 2 # 3 # 4 # 5 # 6 # 7 # 8 # 9 # 10 # 12 # 13 # 14 # 15 # 16 # 17 # 18 # + SHOW TABLE STATUS LIKE 't1'; + + INSERT INTO t1 (c) VALUES ('d'); + --replace_column 2 # 3 # 4 # 5 # 6 # 7 # 8 # 9 # 10 # 12 # 13 # 14 # 15 # 16 # 17 # 18 # + SHOW TABLE STATUS LIKE 't1'; + + SELECT * FROM t1; + DROP TABLE t1; +} + +# Truncate closes handlers + +--source create_table.inc +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'); +HANDLER t1 OPEN AS h1; +if ($mysql_errname) +{ + --let $functionality = HANDLER + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + HANDLER h1 READ FIRST; + TRUNCATE TABLE t1; + --let $error_codes = ER_UNKNOWN_TABLE + HANDLER h1 READ NEXT; + --source check_errors.inc + HANDLER t1 OPEN AS h2; + HANDLER h2 READ FIRST; +} +DROP TABLE t1; + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/trx/cons_snapshot_repeatable_read.result b/mysql-test/suite/storage_engine/trx/cons_snapshot_repeatable_read.result new file mode 100644 index 00000000000..a52f18fc623 --- /dev/null +++ b/mysql-test/suite/storage_engine/trx/cons_snapshot_repeatable_read.result @@ -0,0 +1,18 @@ +DROP TABLE IF EXISTS t1; +connect con1,localhost,root,,; +connect con2,localhost,root,,; +connection con1; +CREATE TABLE t1 (a <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ; +START TRANSACTION WITH CONSISTENT SNAPSHOT; +connection con2; +INSERT INTO t1 (a) VALUES (1); +connection con1; +# If consistent read works on this isolation level (REPEATABLE READ), the following SELECT should not return the value we inserted (1) +SELECT * FROM t1; +a +COMMIT; +connection default; +disconnect con1; +disconnect con2; +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/trx/cons_snapshot_repeatable_read.test b/mysql-test/suite/storage_engine/trx/cons_snapshot_repeatable_read.test new file mode 100644 index 00000000000..e44e260e1d4 --- /dev/null +++ b/mysql-test/suite/storage_engine/trx/cons_snapshot_repeatable_read.test @@ -0,0 +1,9 @@ +--source ../have_engine.inc +--source support_transactions.inc + +let $trx_isolation = REPEATABLE READ; + +--source consistent_snapshot.inc + +--source ../cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/trx/cons_snapshot_serializable.result b/mysql-test/suite/storage_engine/trx/cons_snapshot_serializable.result new file mode 100644 index 00000000000..8d75ea075a2 --- /dev/null +++ b/mysql-test/suite/storage_engine/trx/cons_snapshot_serializable.result @@ -0,0 +1,18 @@ +DROP TABLE IF EXISTS t1; +connect con1,localhost,root,,; +connect con2,localhost,root,,; +connection con1; +CREATE TABLE t1 (a <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE; +START TRANSACTION WITH CONSISTENT SNAPSHOT; +connection con2; +INSERT INTO t1 (a) VALUES (1); +connection con1; +# If consistent read works on this isolation level (SERIALIZABLE), the following SELECT should not return the value we inserted (1) +SELECT * FROM t1; +a +COMMIT; +connection default; +disconnect con1; +disconnect con2; +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/trx/cons_snapshot_serializable.test b/mysql-test/suite/storage_engine/trx/cons_snapshot_serializable.test new file mode 100644 index 00000000000..9d516066927 --- /dev/null +++ b/mysql-test/suite/storage_engine/trx/cons_snapshot_serializable.test @@ -0,0 +1,9 @@ +--source ../have_engine.inc +--source support_transactions.inc + +let $trx_isolation = SERIALIZABLE; + +--source consistent_snapshot.inc + +--source ../cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/trx/consistent_snapshot.inc b/mysql-test/suite/storage_engine/trx/consistent_snapshot.inc new file mode 100644 index 00000000000..8dc9d6c4bb1 --- /dev/null +++ b/mysql-test/suite/storage_engine/trx/consistent_snapshot.inc @@ -0,0 +1,50 @@ +# +# TRANSACTION WITH CONSISTENT SNAPSHOT +# + +--source ../have_engine.inc + +--enable_connect_log + +# Save the initial number of concurrent sessions +--source include/count_sessions.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +connect (con1,localhost,root,,); +connect (con2,localhost,root,,); + +connection con1; + +let $create_definition = a $int_col; +--source ../create_table.inc + +eval SET SESSION TRANSACTION ISOLATION LEVEL $trx_isolation; + +# While a consistent snapshot transaction is executed, +# no external inserts should be visible to the transaction. +# But it should only work this way for REPEATABLE-READ and SERIALIZABLE + +START TRANSACTION WITH CONSISTENT SNAPSHOT; + +connection con2; +INSERT INTO t1 (a) VALUES (1); +if ($mysql_errname) +{ + --echo # INSERT finished with error $mysql_errname +} + +connection con1; +--echo # If consistent read works on this isolation level ($trx_isolation), the following SELECT should not return the value we inserted (1) +SELECT * FROM t1; +COMMIT; + +connection default; +disconnect con1; +disconnect con2; +DROP TABLE t1; + +--source include/wait_until_count_sessions.inc + diff --git a/mysql-test/suite/storage_engine/trx/delete.result b/mysql-test/suite/storage_engine/trx/delete.result new file mode 100644 index 00000000000..827877a7e30 --- /dev/null +++ b/mysql-test/suite/storage_engine/trx/delete.result @@ -0,0 +1,72 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(6,'f'),(7,'g'),(8,'h'),(10000,'foobar'); +INSERT INTO t1 (a,b) SELECT a, b FROM t1; +BEGIN; +DELETE FROM t1 WHERE b IN ('c'); +SELECT * FROM t1; +a b +1 a +1 a +10000 foobar +10000 foobar +2 b +2 b +4 d +4 d +5 e +5 e +6 f +6 f +7 g +7 g +8 h +8 h +DELETE FROM t1 WHERE a < 0 OR b = 'a'; +COMMIT; +SELECT * FROM t1; +a b +10000 foobar +10000 foobar +2 b +2 b +4 d +4 d +5 e +5 e +6 f +6 f +7 g +7 g +8 h +8 h +BEGIN; +DELETE FROM t1 WHERE a <= 4 ORDER BY b DESC LIMIT 1; +SAVEPOINT spt1; +DELETE FROM t1; +RELEASE SAVEPOINT spt1; +ROLLBACK; +SELECT * FROM t1; +a b +10000 foobar +10000 foobar +2 b +2 b +4 d +4 d +5 e +5 e +6 f +6 f +7 g +7 g +8 h +8 h +BEGIN; +DELETE FROM t1 WHERE a <= 4 ORDER BY b DESC LIMIT 1; +SAVEPOINT spt1; +DELETE FROM t1; +INSERT INTO t1 (a,b) VALUES (1,'a'); +ROLLBACK TO SAVEPOINT spt1; +COMMIT; +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/trx/delete.test b/mysql-test/suite/storage_engine/trx/delete.test new file mode 100644 index 00000000000..0898eebb49a --- /dev/null +++ b/mysql-test/suite/storage_engine/trx/delete.test @@ -0,0 +1,51 @@ +# +# Transactional DELETE +# + +--source ../have_engine.inc +--source support_transactions.inc +--source support_savepoints.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +--source ../create_table.inc +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(6,'f'),(7,'g'),(8,'h'),(10000,'foobar'); +INSERT INTO t1 (a,b) SELECT a, b FROM t1; + +BEGIN; +DELETE FROM t1 WHERE b IN ('c'); +if ($mysql_errname) +{ + --let $functionality = DELETE + --source ../unexpected_result.inc +} +--sorted_result +SELECT * FROM t1; +DELETE FROM t1 WHERE a < 0 OR b = 'a'; +COMMIT; +--sorted_result +SELECT * FROM t1; + +BEGIN; +DELETE FROM t1 WHERE a <= 4 ORDER BY b DESC LIMIT 1; +SAVEPOINT spt1; +DELETE FROM t1; +RELEASE SAVEPOINT spt1; +ROLLBACK; +--sorted_result +SELECT * FROM t1; + +BEGIN; +DELETE FROM t1 WHERE a <= 4 ORDER BY b DESC LIMIT 1; +SAVEPOINT spt1; +DELETE FROM t1; +INSERT INTO t1 (a,b) VALUES (1,'a'); +ROLLBACK TO SAVEPOINT spt1; +COMMIT; + +DROP TABLE t1; + +--source ../cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/trx/insert.result b/mysql-test/suite/storage_engine/trx/insert.result new file mode 100644 index 00000000000..986d63b2a07 --- /dev/null +++ b/mysql-test/suite/storage_engine/trx/insert.result @@ -0,0 +1,55 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +BEGIN; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(100,'foo'); +INSERT t1 (a,b) VALUE (10,'foo'),(11,'abc'); +COMMIT; +SELECT * FROM t1; +a b +1 a +10 foo +100 foo +11 abc +2 b +3 c +4 d +5 e +BEGIN; +INSERT INTO t1 (b,a) VALUES ('test',0); +SAVEPOINT spt1; +INSERT INTO t1 (a,b) VALUES (DEFAULT,DEFAULT); +RELEASE SAVEPOINT spt1; +INSERT INTO t1 (a,b) VALUES (DEFAULT,DEFAULT); +ROLLBACK; +SELECT * FROM t1; +a b +1 a +10 foo +100 foo +11 abc +2 b +3 c +4 d +5 e +BEGIN; +INSERT t1 (a) VALUE (10),(20); +SAVEPOINT spt1; +INSERT INTO t1 SET a = 11, b = 'f'; +INSERT t1 SET b = DEFAULT; +ROLLBACK TO SAVEPOINT spt1; +INSERT INTO t1 (b,a) VALUES ('test1',10); +COMMIT; +SELECT * FROM t1; +a b +1 a +10 NULL +10 foo +10 test1 +100 foo +11 abc +2 b +20 NULL +3 c +4 d +5 e +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/trx/insert.test b/mysql-test/suite/storage_engine/trx/insert.test new file mode 100644 index 00000000000..c458f90b1bb --- /dev/null +++ b/mysql-test/suite/storage_engine/trx/insert.test @@ -0,0 +1,44 @@ +# +# Transactional INSERT +# +--source ../have_engine.inc +--source support_transactions.inc +--source support_savepoints.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +--source ../create_table.inc +BEGIN; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(100,'foo'); +INSERT t1 (a,b) VALUE (10,'foo'),(11,'abc'); +COMMIT; +--sorted_result +SELECT * FROM t1; + +BEGIN; +INSERT INTO t1 (b,a) VALUES ('test',0); +SAVEPOINT spt1; +INSERT INTO t1 (a,b) VALUES (DEFAULT,DEFAULT); +RELEASE SAVEPOINT spt1; +INSERT INTO t1 (a,b) VALUES (DEFAULT,DEFAULT); +ROLLBACK; +--sorted_result +SELECT * FROM t1; + +BEGIN; +INSERT t1 (a) VALUE (10),(20); +SAVEPOINT spt1; +INSERT INTO t1 SET a = 11, b = 'f'; +INSERT t1 SET b = DEFAULT; +ROLLBACK TO SAVEPOINT spt1; +INSERT INTO t1 (b,a) VALUES ('test1',10); +COMMIT; +--sorted_result +SELECT * FROM t1; + +DROP TABLE t1; + +--source ../cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/trx/level_read_committed.result b/mysql-test/suite/storage_engine/trx/level_read_committed.result new file mode 100644 index 00000000000..12c0c2f42a8 --- /dev/null +++ b/mysql-test/suite/storage_engine/trx/level_read_committed.result @@ -0,0 +1,91 @@ +DROP TABLE IF EXISTS t1; +connect con1,localhost,root,,; +SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; +connect con2,localhost,root,,; +SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; +connection con1; +CREATE TABLE t1 (a <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +START TRANSACTION; +SELECT * FROM t1; +a +connection con2; +BEGIN; +INSERT INTO t1 (a) VALUES(1); +# WARNING: Statement ended with errno 0, errname ''. +# If it differs from the result file, it might indicate a problem. +connection con1; +SELECT * FROM t1; +a +connection con2; +INSERT INTO t1 (a) VALUES (2); +# WARNING: Statement ended with errno 0, errname ''. +# If it differs from the result file, it might indicate a problem. +connection con1; +SELECT * FROM t1; +a +INSERT INTO t1 (a) SELECT a+100 FROM t1; +# WARNING: Statement ended with errno 0, errname ''. +# If it differs from the result file, it might indicate a problem. +SELECT * FROM t1; +a +connection con2; +SELECT * FROM t1; +a +1 +2 +COMMIT; +SELECT * FROM t1; +a +1 +2 +connection con1; +SELECT * FROM t1; +a +1 +2 +INSERT INTO t1 (a) SELECT a+200 FROM t1; +# WARNING: Statement ended with errno 0, errname ''. +# If it differs from the result file, it might indicate a problem. +SELECT * FROM t1; +a +1 +2 +201 +202 +COMMIT; +SELECT * FROM t1; +a +1 +2 +201 +202 +connection con2; +SELECT * FROM t1; +a +1 +2 +201 +202 +connection default; +disconnect con1; +disconnect con2; +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +connect con1,localhost,root,,; +connect con2,localhost,root,,; +connection con1; +CREATE TABLE t1 (a <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; +START TRANSACTION WITH CONSISTENT SNAPSHOT; +connection con2; +INSERT INTO t1 (a) VALUES (1); +connection con1; +# If consistent read works on this isolation level (READ COMMITTED), the following SELECT should not return the value we inserted (1) +SELECT * FROM t1; +a +1 +COMMIT; +connection default; +disconnect con1; +disconnect con2; +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/trx/level_read_committed.test b/mysql-test/suite/storage_engine/trx/level_read_committed.test new file mode 100644 index 00000000000..77bd562c433 --- /dev/null +++ b/mysql-test/suite/storage_engine/trx/level_read_committed.test @@ -0,0 +1,10 @@ +--source ../have_engine.inc +--source support_transactions.inc + +let $trx_isolation = READ COMMITTED; + +--source transaction_isolation.inc +--source consistent_snapshot.inc + +--source ../cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/trx/level_read_uncommitted.result b/mysql-test/suite/storage_engine/trx/level_read_uncommitted.result new file mode 100644 index 00000000000..2bf93768b00 --- /dev/null +++ b/mysql-test/suite/storage_engine/trx/level_read_uncommitted.result @@ -0,0 +1,116 @@ +DROP TABLE IF EXISTS t1; +connect con1,localhost,root,,; +SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; +connect con2,localhost,root,,; +SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; +connection con1; +CREATE TABLE t1 (a <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +START TRANSACTION; +SELECT * FROM t1; +a +connection con2; +BEGIN; +INSERT INTO t1 (a) VALUES(1); +# WARNING: Statement ended with errno 0, errname ''. +# If it differs from the result file, it might indicate a problem. +connection con1; +SELECT * FROM t1; +a +1 +connection con2; +INSERT INTO t1 (a) VALUES (2); +# WARNING: Statement ended with errno 0, errname ''. +# If it differs from the result file, it might indicate a problem. +connection con1; +SELECT * FROM t1; +a +1 +2 +INSERT INTO t1 (a) SELECT a+100 FROM t1; +# WARNING: Statement ended with errno 0, errname ''. +# If it differs from the result file, it might indicate a problem. +SELECT * FROM t1; +a +1 +101 +102 +2 +connection con2; +SELECT * FROM t1; +a +1 +101 +102 +2 +COMMIT; +SELECT * FROM t1; +a +1 +101 +102 +2 +connection con1; +SELECT * FROM t1; +a +1 +101 +102 +2 +INSERT INTO t1 (a) SELECT a+200 FROM t1; +# WARNING: Statement ended with errno 0, errname ''. +# If it differs from the result file, it might indicate a problem. +SELECT * FROM t1; +a +1 +101 +102 +2 +201 +202 +301 +302 +COMMIT; +SELECT * FROM t1; +a +1 +101 +102 +2 +201 +202 +301 +302 +connection con2; +SELECT * FROM t1; +a +1 +101 +102 +2 +201 +202 +301 +302 +connection default; +disconnect con1; +disconnect con2; +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +connect con1,localhost,root,,; +connect con2,localhost,root,,; +connection con1; +CREATE TABLE t1 (a <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; +START TRANSACTION WITH CONSISTENT SNAPSHOT; +connection con2; +INSERT INTO t1 (a) VALUES (1); +connection con1; +# If consistent read works on this isolation level (READ UNCOMMITTED), the following SELECT should not return the value we inserted (1) +SELECT * FROM t1; +a +1 +COMMIT; +connection default; +disconnect con1; +disconnect con2; +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/trx/level_read_uncommitted.test b/mysql-test/suite/storage_engine/trx/level_read_uncommitted.test new file mode 100644 index 00000000000..48310fc22be --- /dev/null +++ b/mysql-test/suite/storage_engine/trx/level_read_uncommitted.test @@ -0,0 +1,9 @@ +--source ../have_engine.inc +--source support_transactions.inc + +let $trx_isolation = READ UNCOMMITTED; +--source transaction_isolation.inc +--source consistent_snapshot.inc + +--source ../cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/trx/level_repeatable_read.result b/mysql-test/suite/storage_engine/trx/level_repeatable_read.result new file mode 100644 index 00000000000..82324c16801 --- /dev/null +++ b/mysql-test/suite/storage_engine/trx/level_repeatable_read.result @@ -0,0 +1,69 @@ +DROP TABLE IF EXISTS t1; +connect con1,localhost,root,,; +SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ; +connect con2,localhost,root,,; +SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ; +connection con1; +CREATE TABLE t1 (a <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +START TRANSACTION; +SELECT * FROM t1; +a +connection con2; +BEGIN; +INSERT INTO t1 (a) VALUES(1); +# WARNING: Statement ended with errno 0, errname ''. +# If it differs from the result file, it might indicate a problem. +connection con1; +SELECT * FROM t1; +a +connection con2; +INSERT INTO t1 (a) VALUES (2); +# WARNING: Statement ended with errno 0, errname ''. +# If it differs from the result file, it might indicate a problem. +connection con1; +SELECT * FROM t1; +a +INSERT INTO t1 (a) SELECT a+100 FROM t1; +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +# WARNING: Statement ended with errno 1205, errname 'ER_LOCK_WAIT_TIMEOUT'. +# If it differs from the result file, it might indicate a problem. +SELECT * FROM t1; +a +connection con2; +SELECT * FROM t1; +a +1 +2 +COMMIT; +SELECT * FROM t1; +a +1 +2 +connection con1; +SELECT * FROM t1; +a +INSERT INTO t1 (a) SELECT a+200 FROM t1; +# WARNING: Statement ended with errno 0, errname ''. +# If it differs from the result file, it might indicate a problem. +SELECT * FROM t1; +a +201 +202 +COMMIT; +SELECT * FROM t1; +a +1 +2 +201 +202 +connection con2; +SELECT * FROM t1; +a +1 +2 +201 +202 +connection default; +disconnect con1; +disconnect con2; +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/trx/level_repeatable_read.test b/mysql-test/suite/storage_engine/trx/level_repeatable_read.test new file mode 100644 index 00000000000..cb33d1093b5 --- /dev/null +++ b/mysql-test/suite/storage_engine/trx/level_repeatable_read.test @@ -0,0 +1,8 @@ +--source ../have_engine.inc +--source support_transactions.inc + +let $trx_isolation = REPEATABLE READ; +--source transaction_isolation.inc + +--source ../cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/trx/level_serializable.result b/mysql-test/suite/storage_engine/trx/level_serializable.result new file mode 100644 index 00000000000..0f990dfbf77 --- /dev/null +++ b/mysql-test/suite/storage_engine/trx/level_serializable.result @@ -0,0 +1,56 @@ +DROP TABLE IF EXISTS t1; +connect con1,localhost,root,,; +SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE; +connect con2,localhost,root,,; +SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE; +connection con1; +CREATE TABLE t1 (a <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +START TRANSACTION; +SELECT * FROM t1; +a +connection con2; +BEGIN; +INSERT INTO t1 (a) VALUES(1); +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +# WARNING: Statement ended with errno 1205, errname 'ER_LOCK_WAIT_TIMEOUT'. +# If it differs from the result file, it might indicate a problem. +connection con1; +SELECT * FROM t1; +a +connection con2; +INSERT INTO t1 (a) VALUES (2); +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +# WARNING: Statement ended with errno 1205, errname 'ER_LOCK_WAIT_TIMEOUT'. +# If it differs from the result file, it might indicate a problem. +connection con1; +SELECT * FROM t1; +a +INSERT INTO t1 (a) SELECT a+100 FROM t1; +# WARNING: Statement ended with errno 0, errname ''. +# If it differs from the result file, it might indicate a problem. +SELECT * FROM t1; +a +connection con2; +SELECT * FROM t1; +a +COMMIT; +SELECT * FROM t1; +a +connection con1; +SELECT * FROM t1; +a +INSERT INTO t1 (a) SELECT a+200 FROM t1; +# WARNING: Statement ended with errno 0, errname ''. +# If it differs from the result file, it might indicate a problem. +SELECT * FROM t1; +a +COMMIT; +SELECT * FROM t1; +a +connection con2; +SELECT * FROM t1; +a +connection default; +disconnect con1; +disconnect con2; +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/trx/level_serializable.test b/mysql-test/suite/storage_engine/trx/level_serializable.test new file mode 100644 index 00000000000..4372b48905d --- /dev/null +++ b/mysql-test/suite/storage_engine/trx/level_serializable.test @@ -0,0 +1,8 @@ +--source ../have_engine.inc +--source support_transactions.inc + +let $trx_isolation = SERIALIZABLE; +--source transaction_isolation.inc + +--source ../cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/trx/my.cnf b/mysql-test/suite/storage_engine/trx/my.cnf new file mode 100644 index 00000000000..e83954c469d --- /dev/null +++ b/mysql-test/suite/storage_engine/trx/my.cnf @@ -0,0 +1,7 @@ +!include include/default_my.cnf + +[server] +sql-mode=NO_ENGINE_SUBSTITUTION +binlog-format=row +log-bin=master-bin + diff --git a/mysql-test/suite/storage_engine/trx/select_for_update.result b/mysql-test/suite/storage_engine/trx/select_for_update.result new file mode 100644 index 00000000000..8b0de87de05 --- /dev/null +++ b/mysql-test/suite/storage_engine/trx/select_for_update.result @@ -0,0 +1,35 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'a'); +connect con1,localhost,root,,; +BEGIN; +SELECT * FROM t1 WHERE b='a' FOR UPDATE; +a b +1 a +3 a +connection default; +SET lock_wait_timeout = 1; +SELECT * FROM t1 WHERE b='a'; +a b +1 a +3 a +SELECT * FROM t1 WHERE b='a' LOCK IN SHARE MODE; +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +UPDATE t1 SET b='c' WHERE b='a'; +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +connection con1; +COMMIT; +SELECT * FROM t1; +a b +1 a +2 b +3 a +disconnect con1; +connection default; +UPDATE t1 SET b='c' WHERE b='a'; +SELECT * FROM t1; +a b +1 c +2 b +3 c +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/trx/select_for_update.test b/mysql-test/suite/storage_engine/trx/select_for_update.test new file mode 100644 index 00000000000..93ccc1915df --- /dev/null +++ b/mysql-test/suite/storage_engine/trx/select_for_update.test @@ -0,0 +1,87 @@ +# +# SELECT .. FOR UPDATE +# +# If the engine has its own lock timeouts, +# it makes sense to set them to minimum to decrease +# the duration of the test. + +--source ../have_engine.inc +--source support_transactions.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +--enable_connect_log + +--source include/count_sessions.inc + +--source ../create_table.inc +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'a'); + +--connect (con1,localhost,root,,) +BEGIN; +--sorted_result +SELECT * FROM t1 WHERE b='a' FOR UPDATE; +if ($mysql_errname) +{ + --let $functionality = SELECT .. FOR UPDATE + --source ../unexpected_result.inc +} + +--connection default +SET lock_wait_timeout = 1; + +# Should still be able to select + +--sorted_result +SELECT * FROM t1 WHERE b='a'; +if ($mysql_errname) +{ + --let $functionality = SELECT .. FOR UPDATE or locking + --source ../unexpected_result.inc +} + +# ... but not with LOCK IN SHARE MODE + +--sorted_result +--let $error_codes = ER_LOCK_WAIT_TIMEOUT +SELECT * FROM t1 WHERE b='a' LOCK IN SHARE MODE; +--source ../check_errors.inc +if ($mysql_errname != ER_LOCK_WAIT_TIMEOUT) +{ + --let $functionality = SELECT .. FOR UPDATE or LOCK IN SHARE MODE + --source ../unexpected_result.inc +} + +--let $error_codes = ER_LOCK_WAIT_TIMEOUT +UPDATE t1 SET b='c' WHERE b='a'; +--source ../check_errors.inc +if ($mysql_errname != ER_LOCK_WAIT_TIMEOUT) +{ + --let $functionality = UPDATE or SELECT .. FOR UPDATE + --source ../unexpected_result.inc +} + +--connection con1 +COMMIT; +--sorted_result +SELECT * FROM t1; + +--disconnect con1 +--connection default +# Now it can be updated all right +UPDATE t1 SET b='c' WHERE b='a'; +if ($mysql_errname) +{ + --let $functionality = UPDATE + --source ../unexpected_result.inc +} +--sorted_result +SELECT * FROM t1; + +DROP TABLE t1; + +--source include/wait_until_count_sessions.inc +--source ../cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/trx/select_lock_in_share_mode.result b/mysql-test/suite/storage_engine/trx/select_lock_in_share_mode.result new file mode 100644 index 00000000000..00610a03bd8 --- /dev/null +++ b/mysql-test/suite/storage_engine/trx/select_lock_in_share_mode.result @@ -0,0 +1,37 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'a'); +connect con1,localhost,root,,; +BEGIN; +SELECT * FROM t1 WHERE b='a' LOCK IN SHARE MODE; +a b +1 a +3 a +connection default; +SET lock_wait_timeout = 1; +SELECT * FROM t1 WHERE b='a'; +a b +1 a +3 a +SELECT * FROM t1 WHERE b='a' LOCK IN SHARE MODE; +a b +1 a +3 a +UPDATE t1 SET b='c' WHERE b='a'; +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +connection con1; +COMMIT; +SELECT * FROM t1; +a b +1 a +2 b +3 a +disconnect con1; +connection default; +UPDATE t1 SET b='c' WHERE b='a'; +SELECT * FROM t1; +a b +1 c +2 b +3 c +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/trx/select_lock_in_share_mode.test b/mysql-test/suite/storage_engine/trx/select_lock_in_share_mode.test new file mode 100644 index 00000000000..a50c86403e9 --- /dev/null +++ b/mysql-test/suite/storage_engine/trx/select_lock_in_share_mode.test @@ -0,0 +1,82 @@ +# +# SELECT .. LOCK IN SHARE MODE +# +# If the engine has its own lock timeouts, +# it makes sense to set them to minimum to decrease +# the duration of the test. + +--source ../have_engine.inc +--source support_transactions.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +--enable_connect_log + +--source include/count_sessions.inc + +--source ../create_table.inc +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'a'); + +--connect (con1,localhost,root,,) +BEGIN; +--sorted_result +SELECT * FROM t1 WHERE b='a' LOCK IN SHARE MODE; +if ($mysql_errname) +{ + --let $functionality = LOCK IN SHARE MODE + --source ../unexpected_result.inc +} + +--connection default +SET lock_wait_timeout = 1; + +# Should still be able to select + +--sorted_result +SELECT * FROM t1 WHERE b='a'; +if ($mysql_errname) +{ + --let $functionality = LOCK IN SHARE MODE + --source ../unexpected_result.inc +} +--sorted_result +SELECT * FROM t1 WHERE b='a' LOCK IN SHARE MODE; +if ($mysql_errname) +{ + --let $functionality = LOCK IN SHARE MODE + --source ../unexpected_result.inc +} + +--let $error_codes = ER_LOCK_WAIT_TIMEOUT +UPDATE t1 SET b='c' WHERE b='a'; +--source ../check_errors.inc +if ($mysql_errname != ER_LOCK_WAIT_TIMEOUT) +{ + --let $functionality = LOCK IN SHARE MODE or UPDATE + --source ../unexpected_result.inc +} + +--connection con1 +COMMIT; +--sorted_result +SELECT * FROM t1; + +--disconnect con1 +--connection default +# Now it can be updated all right +UPDATE t1 SET b='c' WHERE b='a'; +if ($mysql_errname) +{ + --let $functionality = UPDATE + --source ../unexpected_result.inc +} +--sorted_result +SELECT * FROM t1; + +DROP TABLE t1; + +--source include/wait_until_count_sessions.inc +--source ../cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/trx/support_savepoints.inc b/mysql-test/suite/storage_engine/trx/support_savepoints.inc new file mode 100644 index 00000000000..36dbfce26b2 --- /dev/null +++ b/mysql-test/suite/storage_engine/trx/support_savepoints.inc @@ -0,0 +1,10 @@ +if (!`SELECT savepoints='YES' FROM INFORMATION_SCHEMA.ENGINES WHERE engine = '$storage_engine'`) +{ + --echo # -- WARNING ---------------------------------------------------------------- + --echo # According to I_S.ENGINES, $storage_engine does not support savepoints. + --echo # If it is true, the test will most likely fail; you can + --echo # either create an rdiff file (recommended), or add the test to disabled.def. + --echo # If savepoints should be supported, check the data in Information Schema. + --echo # --------------------------------------------------------------------------- +} + diff --git a/mysql-test/suite/storage_engine/trx/support_transactions.inc b/mysql-test/suite/storage_engine/trx/support_transactions.inc new file mode 100644 index 00000000000..ff1224c5a3d --- /dev/null +++ b/mysql-test/suite/storage_engine/trx/support_transactions.inc @@ -0,0 +1,10 @@ +if (!`SELECT transactions='YES' FROM INFORMATION_SCHEMA.ENGINES WHERE engine = '$storage_engine'`) +{ + --echo # -- WARNING ---------------------------------------------------------------- + --echo # According to I_S.ENGINES, $storage_engine does not support transactions. + --echo # If it is true, the test will most likely fail; you can + --echo # either create an rdiff file, or add the test to disabled.def. + --echo # If transactions should be supported, check the data in Information Schema. + --echo # --------------------------------------------------------------------------- +} + diff --git a/mysql-test/suite/storage_engine/trx/support_xa.inc b/mysql-test/suite/storage_engine/trx/support_xa.inc new file mode 100644 index 00000000000..d51fc48aaa9 --- /dev/null +++ b/mysql-test/suite/storage_engine/trx/support_xa.inc @@ -0,0 +1,12 @@ +--let $support_xa = 1 +if (!`SELECT xa='YES' FROM INFORMATION_SCHEMA.ENGINES WHERE engine = '$storage_engine'`) +{ + --echo # -- WARNING ---------------------------------------------------------------- + --echo # According to I_S.ENGINES, $storage_engine does not support XA. + --echo # If it is true, the test will most likely fail; you can + --echo # either create an rdiff file, or add the test to disabled.def. + --echo # If XA should be supported, check the data in Information Schema. + --echo # --------------------------------------------------------------------------- + --let $support_xa = 0 +} + diff --git a/mysql-test/suite/storage_engine/trx/transaction_isolation.inc b/mysql-test/suite/storage_engine/trx/transaction_isolation.inc new file mode 100644 index 00000000000..c81071d99b6 --- /dev/null +++ b/mysql-test/suite/storage_engine/trx/transaction_isolation.inc @@ -0,0 +1,99 @@ +# +# Basic check for transaction isolation. +# The results should be different depending on the isolation level. +# For some isolation levels, some statements will end with a timeout. +# If the engine has its own timeout parameters, reduce them to minimum, +# otherwise the test will take very long. +# If the timeout value is greater than the testcase-timeout the test is run with, +# it might fail due to the testcase timeout. +# + +--source ../have_engine.inc + +--enable_connect_log + +# Save the initial number of concurrent sessions +--source include/count_sessions.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +connect (con1,localhost,root,,); +eval SET SESSION TRANSACTION ISOLATION LEVEL $trx_isolation; +connect (con2,localhost,root,,); +eval SET SESSION TRANSACTION ISOLATION LEVEL $trx_isolation; + +connection con1; + +let $create_definition = a $int_col; +--source ../create_table.inc + +START TRANSACTION; +--sorted_result +SELECT * FROM t1; # First snapshot + +connection con2; + +BEGIN; +--let $error_codes = 0,ER_LOCK_WAIT_TIMEOUT +INSERT INTO t1 (a) VALUES(1); +--source ../strict_check_errors.inc + +connection con1; +--sorted_result +SELECT * FROM t1; # Second snapshot + +connection con2; +--let $error_codes = 0,ER_LOCK_WAIT_TIMEOUT +INSERT INTO t1 (a) VALUES (2); +--source ../strict_check_errors.inc + +connection con1; +--sorted_result +SELECT * FROM t1; # Third snapshot + +--let $error_codes = 0,ER_LOCK_WAIT_TIMEOUT +INSERT INTO t1 (a) SELECT a+100 FROM t1; +--source ../strict_check_errors.inc + +--sorted_result +SELECT * FROM t1; + +connection con2; +--sorted_result +SELECT * FROM t1; # Inside the transaction +COMMIT; +--sorted_result +SELECT * FROM t1; # Outside the transaction + +connection con1; +--sorted_result +SELECT * FROM t1; # Inside the transaction + +# Note: INSERT .. SELECT might be tricky, for example for InnoDB +# even with REPEATABLE-READ it works as if it is executed with READ COMMITTED. +# The test will have a 'logical' result for repeatable read, even although +# we currently don't have an engine which works this way. + +--let $error_codes = 0,ER_LOCK_WAIT_TIMEOUT +INSERT INTO t1 (a) SELECT a+200 FROM t1; +--source ../strict_check_errors.inc + +--sorted_result +SELECT * FROM t1; +COMMIT; +--sorted_result +SELECT * FROM t1; # Outside the transaction + +connection con2; +--sorted_result +SELECT * FROM t1; # After both transactions have committed + +connection default; +disconnect con1; +disconnect con2; +DROP TABLE t1; + +--source include/wait_until_count_sessions.inc + diff --git a/mysql-test/suite/storage_engine/trx/update.result b/mysql-test/suite/storage_engine/trx/update.result new file mode 100644 index 00000000000..e609bfcbc23 --- /dev/null +++ b/mysql-test/suite/storage_engine/trx/update.result @@ -0,0 +1,48 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(10000,'foobar'); +INSERT INTO t1 (a,b) SELECT a, b FROM t1; +BEGIN; +UPDATE t1 SET a=a+100; +UPDATE t1 SET a=a-50, b=DEFAULT WHERE a>100; +COMMIT; +SELECT * FROM t1; +a b +10050 NULL +10050 NULL +51 NULL +51 NULL +52 NULL +52 NULL +53 NULL +53 NULL +54 NULL +54 NULL +55 NULL +55 NULL +BEGIN; +UPDATE t1 SET b = 'update' WHERE a <= 4 ORDER BY a DESC, b ASC LIMIT 3; +UPDATE t1 SET b = ''; +ROLLBACK; +BEGIN; +UPDATE t1 SET b = 'update2' WHERE a <= 100; +SAVEPOINT spt1; +UPDATE t1 SET b = ''; +ROLLBACK TO SAVEPOINT spt1; +UPDATE t1 SET b = 'upd' WHERE a = 10050; +COMMIT; +SELECT * FROM t1; +a b +10050 upd +10050 upd +51 update2 +51 update2 +52 update2 +52 update2 +53 update2 +53 update2 +54 update2 +54 update2 +55 update2 +55 update2 +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/trx/update.test b/mysql-test/suite/storage_engine/trx/update.test new file mode 100644 index 00000000000..df65e244528 --- /dev/null +++ b/mysql-test/suite/storage_engine/trx/update.test @@ -0,0 +1,50 @@ +# +# Transactional UPDATE +# + +--source ../have_engine.inc +--source support_transactions.inc +--source support_savepoints.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +--source ../create_table.inc +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(10000,'foobar'); +INSERT INTO t1 (a,b) SELECT a, b FROM t1; + +BEGIN; +UPDATE t1 SET a=a+100; +if ($mysql_errname) +{ + --let $functionality = UPDATE + --source ../unexpected_result.inc +} +if (!$mysql_errname) +{ + UPDATE t1 SET a=a-50, b=DEFAULT WHERE a>100; + COMMIT; + --sorted_result + SELECT * FROM t1; + + BEGIN; + UPDATE t1 SET b = 'update' WHERE a <= 4 ORDER BY a DESC, b ASC LIMIT 3; + UPDATE t1 SET b = ''; + ROLLBACK; + + BEGIN; + UPDATE t1 SET b = 'update2' WHERE a <= 100; + SAVEPOINT spt1; + UPDATE t1 SET b = ''; + ROLLBACK TO SAVEPOINT spt1; + UPDATE t1 SET b = 'upd' WHERE a = 10050; + COMMIT; + --sorted_result + SELECT * FROM t1; +} + +DROP TABLE t1; + +--source ../cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/trx/xa.result b/mysql-test/suite/storage_engine/trx/xa.result new file mode 100644 index 00000000000..3e2cb43a11c --- /dev/null +++ b/mysql-test/suite/storage_engine/trx/xa.result @@ -0,0 +1,96 @@ +DROP TABLE IF EXISTS t1; +connect con1,localhost,root,,; +connect con2,localhost,root,,; +connection con1; +CREATE TABLE t1 (a <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +connection con2; +XA START 'xa1'; +INSERT INTO t1 (a) VALUES (1); +connection con1; +SELECT * FROM t1; +a +connection con2; +INSERT INTO t1 (a) VALUES (2); +XA END 'xa1'; +connection con1; +SELECT * FROM t1; +a +connection con2; +XA PREPARE 'xa1'; +connection con1; +SELECT * FROM t1; +a +connection con2; +XA RECOVER; +formatID gtrid_length bqual_length data +1 3 0 xa1 +XA COMMIT 'xa1'; +connection con1; +SELECT * FROM t1; +a +1 +2 +connection con2; +XA START 'xa2'; +INSERT INTO t1 (a) VALUES (3); +connection con1; +SELECT * FROM t1; +a +1 +2 +connection con2; +INSERT INTO t1 (a) VALUES (4); +XA END 'xa2'; +connection con1; +SELECT * FROM t1; +a +1 +2 +connection con2; +XA COMMIT 'xa2' ONE PHASE; +connection con1; +SELECT * FROM t1; +a +1 +2 +3 +4 +connection con2; +XA START 'xa3'; +INSERT INTO t1 (a) VALUES (5); +connection con1; +SELECT * FROM t1; +a +1 +2 +3 +4 +connection con2; +INSERT INTO t1 (a) VALUES (6); +XA END 'xa3'; +connection con1; +SELECT * FROM t1; +a +1 +2 +3 +4 +connection con2; +XA PREPARE 'xa3'; +connection con1; +SELECT * FROM t1; +a +1 +2 +3 +4 +connection con2; +XA ROLLBACK 'xa3'; +connection con1; +SELECT * FROM t1; +a +1 +2 +3 +4 +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/trx/xa.test b/mysql-test/suite/storage_engine/trx/xa.test new file mode 100644 index 00000000000..c64ba7cd27b --- /dev/null +++ b/mysql-test/suite/storage_engine/trx/xa.test @@ -0,0 +1,118 @@ +# +# Basic XA transactions syntax +# + +--source ../have_engine.inc +--source support_xa.inc + +--enable_connect_log + +# Save the initial number of concurrent sessions +--source include/count_sessions.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +--connect (con1,localhost,root,,) +--connect (con2,localhost,root,,) + +--connection con1 +--let $create_definition = a $int_col +--source ../create_table.inc + +--connection con2 + +# Two-phase COMMIT + +XA START 'xa1'; +INSERT INTO t1 (a) VALUES (1); + +--connection con1 +--sorted_result +SELECT * FROM t1; + +--connection con2 +INSERT INTO t1 (a) VALUES (2); +XA END 'xa1'; + +--connection con1 +--sorted_result +SELECT * FROM t1; + +--connection con2 +XA PREPARE 'xa1'; + +--connection con1 +--sorted_result +SELECT * FROM t1; + +--connection con2 +XA RECOVER; +XA COMMIT 'xa1'; + +--connection con1 +--sorted_result +SELECT * FROM t1; + +# One-phase COMMIT + +--connection con2 +XA START 'xa2'; +INSERT INTO t1 (a) VALUES (3); + +--connection con1 +--sorted_result +SELECT * FROM t1; + +--connection con2 +INSERT INTO t1 (a) VALUES (4); +XA END 'xa2'; + +--connection con1 +--sorted_result +SELECT * FROM t1; + +--connection con2 +XA COMMIT 'xa2' ONE PHASE; + +--connection con1 +--sorted_result +SELECT * FROM t1; + +# Rollback + +--connection con2 +XA START 'xa3'; +INSERT INTO t1 (a) VALUES (5); + +--connection con1 +--sorted_result +SELECT * FROM t1; + +--connection con2 +INSERT INTO t1 (a) VALUES (6); +XA END 'xa3'; + +--connection con1 +--sorted_result +SELECT * FROM t1; + +--connection con2 +XA PREPARE 'xa3'; + +--connection con1 +--sorted_result +SELECT * FROM t1; + +--connection con2 +XA ROLLBACK 'xa3'; + +--connection con1 +--sorted_result +SELECT * FROM t1; + +DROP TABLE t1; + +--source ../cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/trx/xa_recovery.result b/mysql-test/suite/storage_engine/trx/xa_recovery.result new file mode 100644 index 00000000000..e14e9a0bf1a --- /dev/null +++ b/mysql-test/suite/storage_engine/trx/xa_recovery.result @@ -0,0 +1,29 @@ +call mtr.add_suppression("Found 2 prepared XA transactions"); +FLUSH TABLES; +DROP TABLE IF EXISTS t1; +connect con1,localhost,root,,; +connect con2,localhost,root,,; +connection con1; +CREATE TABLE t1 (a <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +XA START 'xa1'; +INSERT INTO t1 (a) VALUES (1),(2); +XA END 'xa1'; +XA PREPARE 'xa1'; +connection con2; +XA START 'xa2'; +INSERT INTO t1 (a) VALUES (3); +INSERT INTO t1 (a) VALUES (4); +XA END 'xa2'; +XA PREPARE 'xa2'; +connection default; +XA RECOVER; +formatID gtrid_length bqual_length data +1 3 0 xa1 +1 3 0 xa2 +XA ROLLBACK 'xa1'; +XA COMMIT 'xa2'; +SELECT * FROM t1; +a +3 +4 +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/trx/xa_recovery.test b/mysql-test/suite/storage_engine/trx/xa_recovery.test new file mode 100644 index 00000000000..d7ac2e782d1 --- /dev/null +++ b/mysql-test/suite/storage_engine/trx/xa_recovery.test @@ -0,0 +1,71 @@ +# +# Server restart with uncommitted XA transactions +# + +--source ../have_engine.inc +--source support_xa.inc + +# Before we start, we want to restart the server gracefully, +# so GCOV information and everything else is properly stored + +--enable_reconnect +--append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +restart +EOF +--shutdown_server 60 +--source include/wait_until_connected_again.inc + + +call mtr.add_suppression("Found 2 prepared XA transactions"); +if (!$support_xa) +{ + --disable_query_log + call mtr.add_suppression("Table '.*t1' is marked as crashed and should be repaired"); + call mtr.add_suppression("Checking table: '.*t1'"); + --enable_query_log +} + +--enable_connect_log + +# Close all unused tables to prevent unrelated corruption +FLUSH TABLES; + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +--connect (con1,localhost,root,,) +--connect (con2,localhost,root,,) + +--connection con1 +--let $create_definition = a $int_col +--source ../create_table.inc + +XA START 'xa1'; +INSERT INTO t1 (a) VALUES (1),(2); +XA END 'xa1'; +XA PREPARE 'xa1'; + +--connection con2 +XA START 'xa2'; +INSERT INTO t1 (a) VALUES (3); +INSERT INTO t1 (a) VALUES (4); +XA END 'xa2'; +XA PREPARE 'xa2'; + +--connection default +--enable_reconnect +--append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +restart +EOF +--shutdown_server 0 +--source include/wait_until_disconnected.inc +--source include/wait_until_connected_again.inc +XA RECOVER; +XA ROLLBACK 'xa1'; +XA COMMIT 'xa2'; +SELECT * FROM t1; +DROP TABLE t1; + +--source ../cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/type_binary.inc b/mysql-test/suite/storage_engine/type_binary.inc new file mode 100644 index 00000000000..812a1cc9527 --- /dev/null +++ b/mysql-test/suite/storage_engine/type_binary.inc @@ -0,0 +1,52 @@ +# +# BINARY column types +# + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +let $create_definition = + b BINARY $col_opts, + b0 BINARY(0) $col_opts, + b1 BINARY(1) $col_opts, + b20 BINARY(20) $col_opts, + b255 BINARY(255) $col_opts +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = BINARY types + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 3 # 4 # 5 # 6 # + SHOW COLUMNS IN t1; + + # Valid values + + INSERT INTO t1 VALUES ('','','','',''); + INSERT INTO t1 VALUES ('a','','b','abcdefghi klmnopqrst', 'Creating an article for the Knowledgebase is similar to asking questions. First, navigate to the category where you feel the article should be. Once there, double check that an article doesn\'t already exist which would work.'); + + --sorted_result + SELECT HEX(b), HEX(b0), HEX(b1), HEX(b20), HEX(b255) FROM t1; + + # Invalid values + + INSERT INTO t1 VALUES ('abc', 'a', 'abc', REPEAT('a',21), REPEAT('x',256)); + INSERT INTO t1 SELECT b255, b255, b255, b255, CONCAT(b255,b255) FROM t1; + + --sorted_result + SELECT HEX(b), HEX(b0), HEX(b1), HEX(b20), HEX(b255) FROM t1; + + --let $error_codes = ER_TOO_BIG_FIELDLENGTH + --let $alter_definition = ADD COLUMN b257 BINARY(257) $col_opts + --source alter_table.inc + --replace_column 3 # 4 # 5 # 6 # + SHOW COLUMNS IN t1; + + DROP TABLE t1; +} + diff --git a/mysql-test/suite/storage_engine/type_binary.result b/mysql-test/suite/storage_engine/type_binary.result new file mode 100644 index 00000000000..455dbb57a7e --- /dev/null +++ b/mysql-test/suite/storage_engine/type_binary.result @@ -0,0 +1,62 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (b BINARY <CUSTOM_COL_OPTIONS>, +b0 BINARY(0) <CUSTOM_COL_OPTIONS>, +b1 BINARY(1) <CUSTOM_COL_OPTIONS>, +b20 BINARY(20) <CUSTOM_COL_OPTIONS>, +b255 BINARY(255) <CUSTOM_COL_OPTIONS> +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +b binary(1) # # # # +b0 binary(0) # # # # +b1 binary(1) # # # # +b20 binary(20) # # # # +b255 binary(255) # # # # +INSERT INTO t1 VALUES ('','','','',''); +INSERT INTO t1 VALUES ('a','','b','abcdefghi klmnopqrst', 'Creating an article for the Knowledgebase is similar to asking questions. First, navigate to the category where you feel the article should be. Once there, double check that an article doesn\'t already exist which would work.'); +SELECT HEX(b), HEX(b0), HEX(b1), HEX(b20), HEX(b255) FROM t1; +HEX(b) HEX(b0) HEX(b1) HEX(b20) HEX(b255) +00 00 0000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +61 62 616263646566676869206B6C6D6E6F7071727374 4372656174696E6720616E2061727469636C6520666F7220746865204B6E6F776C65646765626173652069732073696D696C617220746F2061736B696E67207175657374696F6E732E2046697273742C206E6176696761746520746F207468652063617465676F727920776865726520796F75206665656C207468652061727469636C652073686F756C642062652E204F6E63652074686572652C20646F75626C6520636865636B207468617420616E2061727469636C6520646F65736E277420616C726561647920657869737420776869636820776F756C6420776F726B2E00000000000000000000000000000000000000000000000000000000000000 +INSERT INTO t1 VALUES ('abc', 'a', 'abc', REPEAT('a',21), REPEAT('x',256)); +Warnings: +Warning 1265 Data truncated for column 'b' at row 1 +Warning 1265 Data truncated for column 'b0' at row 1 +Warning 1265 Data truncated for column 'b1' at row 1 +Warning 1265 Data truncated for column 'b20' at row 1 +Warning 1265 Data truncated for column 'b255' at row 1 +INSERT INTO t1 SELECT b255, b255, b255, b255, CONCAT(b255,b255) FROM t1; +Warnings: +Warning 1265 Data truncated for column 'b' at row 1 +Warning 1265 Data truncated for column 'b0' at row 1 +Warning 1265 Data truncated for column 'b1' at row 1 +Warning 1265 Data truncated for column 'b20' at row 1 +Warning 1265 Data truncated for column 'b255' at row 1 +Warning 1265 Data truncated for column 'b' at row 2 +Warning 1265 Data truncated for column 'b0' at row 2 +Warning 1265 Data truncated for column 'b1' at row 2 +Warning 1265 Data truncated for column 'b20' at row 2 +Warning 1265 Data truncated for column 'b255' at row 2 +Warning 1265 Data truncated for column 'b' at row 3 +Warning 1265 Data truncated for column 'b0' at row 3 +Warning 1265 Data truncated for column 'b1' at row 3 +Warning 1265 Data truncated for column 'b20' at row 3 +Warning 1265 Data truncated for column 'b255' at row 3 +SELECT HEX(b), HEX(b0), HEX(b1), HEX(b20), HEX(b255) FROM t1; +HEX(b) HEX(b0) HEX(b1) HEX(b20) HEX(b255) +00 00 0000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +00 00 0000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +43 43 4372656174696E6720616E2061727469636C6520 4372656174696E6720616E2061727469636C6520666F7220746865204B6E6F776C65646765626173652069732073696D696C617220746F2061736B696E67207175657374696F6E732E2046697273742C206E6176696761746520746F207468652063617465676F727920776865726520796F75206665656C207468652061727469636C652073686F756C642062652E204F6E63652074686572652C20646F75626C6520636865636B207468617420616E2061727469636C6520646F65736E277420616C726561647920657869737420776869636820776F756C6420776F726B2E00000000000000000000000000000000000000000000000000000000000000 +61 61 6161616161616161616161616161616161616161 787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878 +61 62 616263646566676869206B6C6D6E6F7071727374 4372656174696E6720616E2061727469636C6520666F7220746865204B6E6F776C65646765626173652069732073696D696C617220746F2061736B696E67207175657374696F6E732E2046697273742C206E6176696761746520746F207468652063617465676F727920776865726520796F75206665656C207468652061727469636C652073686F756C642062652E204F6E63652074686572652C20646F75626C6520636865636B207468617420616E2061727469636C6520646F65736E277420616C726561647920657869737420776869636820776F756C6420776F726B2E00000000000000000000000000000000000000000000000000000000000000 +78 78 7878787878787878787878787878787878787878 787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878 +ALTER TABLE t1 ADD COLUMN b257 BINARY(257) <CUSTOM_COL_OPTIONS>; +ERROR 42000: Column length too big for column 'b257' (max = 255); use BLOB or TEXT instead +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +b binary(1) # # # # +b0 binary(0) # # # # +b1 binary(1) # # # # +b20 binary(20) # # # # +b255 binary(255) # # # # +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/type_binary.test b/mysql-test/suite/storage_engine/type_binary.test new file mode 100644 index 00000000000..7820e3ab1d2 --- /dev/null +++ b/mysql-test/suite/storage_engine/type_binary.test @@ -0,0 +1,10 @@ +# +# BINARY column types +# + +--source have_engine.inc + +--source type_binary.inc + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/type_binary_indexes.result b/mysql-test/suite/storage_engine/type_binary_indexes.result new file mode 100644 index 00000000000..6f828aed100 --- /dev/null +++ b/mysql-test/suite/storage_engine/type_binary_indexes.result @@ -0,0 +1,126 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (b BINARY <CUSTOM_COL_OPTIONS>, +b20 BINARY(20) <CUSTOM_COL_OPTIONS>, +v16 VARBINARY(16) <CUSTOM_COL_OPTIONS>, +v128 VARBINARY(128) <CUSTOM_COL_OPTIONS>, +<CUSTOM_INDEX> b20 (b20) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 # 1 b20 # # NULL NULL # # +INSERT INTO t1 (b,b20,v16,v128) VALUES ('a','char1','varchar1a','varchar1b'),('a','char2','varchar2a','varchar2b'),('b','char3','varchar1a','varchar1b'),('c','char4','varchar3a','varchar3b'); +SELECT HEX(b20) FROM t1 ORDER BY b20; +HEX(b20) +6368617231000000000000000000000000000000 +6368617232000000000000000000000000000000 +6368617233000000000000000000000000000000 +6368617234000000000000000000000000000000 +DROP TABLE t1; +CREATE TABLE t1 (b BINARY <CUSTOM_COL_OPTIONS>, +b20 BINARY(20) <CUSTOM_COL_OPTIONS> PRIMARY KEY, +v16 VARBINARY(16) <CUSTOM_COL_OPTIONS>, +v128 VARBINARY(128) <CUSTOM_COL_OPTIONS> +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 0 PRIMARY 1 b20 # # NULL NULL # # +INSERT INTO t1 (b,b20,v16,v128) VALUES ('a','char1','varchar1a','varchar1b'),('a','char2','varchar2a','varchar2b'),('b','char3','varchar1a','varchar1b'),('c','char4','varchar3a','varchar3b'); +EXPLAIN SELECT HEX(b20) FROM t1 ORDER BY b20; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # PRIMARY # # # # +SELECT HEX(b20) FROM t1 ORDER BY b20; +HEX(b20) +6368617231000000000000000000000000000000 +6368617232000000000000000000000000000000 +6368617233000000000000000000000000000000 +6368617234000000000000000000000000000000 +EXPLAIN SELECT HEX(b20) FROM t1 IGNORE INDEX (PRIMARY) ORDER BY b20 DESC; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # NULL # # # # +SELECT HEX(b20) FROM t1 ORDER BY b20 DESC; +HEX(b20) +6368617234000000000000000000000000000000 +6368617233000000000000000000000000000000 +6368617232000000000000000000000000000000 +6368617231000000000000000000000000000000 +DROP TABLE t1; +CREATE TABLE t1 (b BINARY <CUSTOM_COL_OPTIONS>, +b20 BINARY(20) <CUSTOM_COL_OPTIONS>, +v16 VARBINARY(16) <CUSTOM_COL_OPTIONS>, +v128 VARBINARY(128) <CUSTOM_COL_OPTIONS>, +UNIQUE INDEX b_v (b,v128) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 0 b_v 1 b # # NULL NULL # # +t1 0 b_v 2 v128 # # NULL NULL # # +INSERT INTO t1 (b,b20,v16,v128) VALUES ('a','char1','varchar1a','varchar1b'),('a','char2','varchar2a','varchar2b'),('b','char3','varchar1a','varchar1b'),('c','char4','varchar3a','varchar3b'); +EXPLAIN SELECT HEX(b), HEX(v128) FROM t1 WHERE b != 'a' AND v128 > 'varchar'; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # b_v # # # # +SELECT HEX(b), HEX(v128) FROM t1 WHERE b != 'a' AND v128 > 'varchar'; +HEX(b) HEX(v128) +62 766172636861723162 +63 766172636861723362 +EXPLAIN SELECT HEX(b), HEX(v128) FROM t1 USE INDEX (b_v) WHERE b != 'a' AND v128 > 'varchar'; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # b_v # # # # +SELECT HEX(b), HEX(v128) FROM t1 USE INDEX (b_v) WHERE b != 'a' AND v128 > 'varchar'; +HEX(b) HEX(v128) +62 766172636861723162 +63 766172636861723362 +EXPLAIN SELECT HEX(v128), COUNT(*) FROM t1 GROUP BY HEX(v128); +id select_type table type possible_keys key key_len ref rows Extra +# # # # # b_v # # # # +SELECT HEX(v128), COUNT(*) FROM t1 GROUP BY HEX(v128); +HEX(v128) COUNT(*) +766172636861723162 2 +766172636861723262 1 +766172636861723362 1 +DROP TABLE t1; +CREATE TABLE t1 (b BINARY <CUSTOM_COL_OPTIONS>, +b20 BINARY(20) <CUSTOM_COL_OPTIONS>, +v16 VARBINARY(16) <CUSTOM_COL_OPTIONS>, +v128 VARBINARY(128) <CUSTOM_COL_OPTIONS>, +INDEX (v16(10)) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 v16 1 v16 # # 10 NULL # # +INSERT INTO t1 (b,b20,v16,v128) VALUES ('a','char1','varchar1a','varchar1b'),('a','char2','varchar2a','varchar2b'),('b','char3','varchar1a','varchar1b'),('c','char4','varchar3a','varchar3b'),('d','char5','varchar4a','varchar3b'),('e','char6','varchar2a','varchar3b'); +INSERT INTO t1 SELECT * FROM t1; +EXPLAIN SELECT HEX(SUBSTRING(v16,0,3)) FROM t1 WHERE v16 LIKE 'varchar%'; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # NULL # # # # +SELECT HEX(SUBSTRING(v16,7,3)) FROM t1 WHERE v16 LIKE 'varchar%'; +HEX(SUBSTRING(v16,7,3)) +723161 +723161 +723161 +723161 +723261 +723261 +723261 +723261 +723361 +723361 +723461 +723461 +EXPLAIN SELECT HEX(SUBSTRING(v16,0,3)) FROM t1 FORCE INDEX (v16) WHERE v16 LIKE 'varchar%'; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # v16 # # # # +SELECT HEX(SUBSTRING(v16,7,3)) FROM t1 FORCE INDEX (v16) WHERE v16 LIKE 'varchar%'; +HEX(SUBSTRING(v16,7,3)) +723161 +723161 +723161 +723161 +723261 +723261 +723261 +723261 +723361 +723361 +723461 +723461 +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/type_binary_indexes.test b/mysql-test/suite/storage_engine/type_binary_indexes.test new file mode 100644 index 00000000000..24b16aa5175 --- /dev/null +++ b/mysql-test/suite/storage_engine/type_binary_indexes.test @@ -0,0 +1,149 @@ +# +# BINARY and VARBINARY columns with indexes +# + +--source have_engine.inc +--source have_default_index.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +# Default index as set in define_engine.inc + +let $create_definition = + b BINARY $col_opts, + b20 BINARY(20) $col_indexed_opts, + v16 VARBINARY(16) $col_opts, + v128 VARBINARY(128) $col_opts, + $default_index b20 (b20) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = BINARY or VARBINARY types or indexes + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 3 # 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + INSERT INTO t1 (b,b20,v16,v128) VALUES ('a','char1','varchar1a','varchar1b'),('a','char2','varchar2a','varchar2b'),('b','char3','varchar1a','varchar1b'),('c','char4','varchar3a','varchar3b'); + + SELECT HEX(b20) FROM t1 ORDER BY b20; + DROP TABLE t1; +} + + +# PK, UNIQUE INDEX, INDEX + +let $create_definition = + b BINARY $col_opts, + b20 BINARY(20) $col_indexed_opts PRIMARY KEY, + v16 VARBINARY(16) $col_opts, + v128 VARBINARY(128) $col_opts +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = BINARY or VARBINARY types or PK + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + INSERT INTO t1 (b,b20,v16,v128) VALUES ('a','char1','varchar1a','varchar1b'),('a','char2','varchar2a','varchar2b'),('b','char3','varchar1a','varchar1b'),('c','char4','varchar3a','varchar3b'); + + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT HEX(b20) FROM t1 ORDER BY b20; + SELECT HEX(b20) FROM t1 ORDER BY b20; + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT HEX(b20) FROM t1 IGNORE INDEX (PRIMARY) ORDER BY b20 DESC; + SELECT HEX(b20) FROM t1 ORDER BY b20 DESC; + + DROP TABLE t1; +} + +let $create_definition = + b BINARY $col_indexed_opts, + b20 BINARY(20) $col_opts, + v16 VARBINARY(16) $col_opts, + v128 VARBINARY(128) $col_indexed_opts, + UNIQUE INDEX b_v (b,v128) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = BINARY or VARBINARY types or unique keys or multi-part keys + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + INSERT INTO t1 (b,b20,v16,v128) VALUES ('a','char1','varchar1a','varchar1b'),('a','char2','varchar2a','varchar2b'),('b','char3','varchar1a','varchar1b'),('c','char4','varchar3a','varchar3b'); + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT HEX(b), HEX(v128) FROM t1 WHERE b != 'a' AND v128 > 'varchar'; + --sorted_result + SELECT HEX(b), HEX(v128) FROM t1 WHERE b != 'a' AND v128 > 'varchar'; + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT HEX(b), HEX(v128) FROM t1 USE INDEX (b_v) WHERE b != 'a' AND v128 > 'varchar'; + --sorted_result + SELECT HEX(b), HEX(v128) FROM t1 USE INDEX (b_v) WHERE b != 'a' AND v128 > 'varchar'; + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT HEX(v128), COUNT(*) FROM t1 GROUP BY HEX(v128); + --sorted_result + SELECT HEX(v128), COUNT(*) FROM t1 GROUP BY HEX(v128); + + DROP TABLE t1; +} + +let $create_definition = + b BINARY $col_opts, + b20 BINARY(20) $col_opts, + v16 VARBINARY(16) $col_indexed_opts, + v128 VARBINARY(128) $col_opts, + INDEX (v16(10)) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = BINARY or VARBINARY types or non-unique keys + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + INSERT INTO t1 (b,b20,v16,v128) VALUES ('a','char1','varchar1a','varchar1b'),('a','char2','varchar2a','varchar2b'),('b','char3','varchar1a','varchar1b'),('c','char4','varchar3a','varchar3b'),('d','char5','varchar4a','varchar3b'),('e','char6','varchar2a','varchar3b'); + INSERT INTO t1 SELECT * FROM t1; + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT HEX(SUBSTRING(v16,0,3)) FROM t1 WHERE v16 LIKE 'varchar%'; + --sorted_result + SELECT HEX(SUBSTRING(v16,7,3)) FROM t1 WHERE v16 LIKE 'varchar%'; + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT HEX(SUBSTRING(v16,0,3)) FROM t1 FORCE INDEX (v16) WHERE v16 LIKE 'varchar%'; + --sorted_result + SELECT HEX(SUBSTRING(v16,7,3)) FROM t1 FORCE INDEX (v16) WHERE v16 LIKE 'varchar%'; + + DROP TABLE t1; +} + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/type_bit.inc b/mysql-test/suite/storage_engine/type_bit.inc new file mode 100644 index 00000000000..1a232305e1c --- /dev/null +++ b/mysql-test/suite/storage_engine/type_bit.inc @@ -0,0 +1,76 @@ +# +# BIT column type +# + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +# Valid values + +let $create_definition = + a BIT $col_opts, + b BIT(20) $col_opts, + c BIT(64) $col_opts, + d BIT(1) $col_opts +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = BIT types + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 3 # 4 # 5 # + SHOW COLUMNS IN t1; + + --let $alter_definition = DROP COLUMN d + --source alter_table.inc + if ($mysql_errname) + { + --let $my_last_stmt = $alter_statement + --let $functionality = ALTER TABLE + --source unexpected_result.inc + } + if (!$mysql_errname) + { + --let $alter_definition = ADD COLUMN d BIT(0) $col_opts + --source alter_table.inc + + --replace_column 3 # 4 # 5 # + SHOW COLUMNS IN t1; + } + + INSERT INTO t1 VALUES (0,POW(2,20)-1,b'1111111111111111111111111111111111111111111111111111111111111111',1); + --sorted_result + SELECT BIN(a), HEX(b), c+0 FROM t1 WHERE d>0; + + INSERT INTO t1 VALUES (1,0,-1,0); + --sorted_result + SELECT a+0, b+0, c+0 FROM t1 WHERE d<100; + + INSERT INTO t1 VALUES (b'1', 'f', 0xFF, 0x0); + --sorted_result + SELECT a+0, b+0, c+0 FROM t1 WHERE d IN (0, 2); + + # Out of range values + # (should produce warnings) + + INSERT INTO t1 VALUES (0x10,0,0,1); + --sorted_result + SELECT * FROM t1; + + INSERT INTO t1 VALUES (0x01,0,0x10000000000000000,0); + --sorted_result + SELECT * FROM t1; + + DROP TABLE t1; + + --let $error_codes = ER_TOO_BIG_DISPLAYWIDTH + --let $create_definition = a BIT(65) $col_opts + --source create_table.inc +} + + diff --git a/mysql-test/suite/storage_engine/type_bit.result b/mysql-test/suite/storage_engine/type_bit.result new file mode 100644 index 00000000000..69b9ac53d76 --- /dev/null +++ b/mysql-test/suite/storage_engine/type_bit.result @@ -0,0 +1,47 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a BIT <CUSTOM_COL_OPTIONS>, +b BIT(20) <CUSTOM_COL_OPTIONS>, +c BIT(64) <CUSTOM_COL_OPTIONS>, +d BIT(1) <CUSTOM_COL_OPTIONS> +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +a bit(1) # # # +b bit(20) # # # +c bit(64) # # # +d bit(1) # # # +ALTER TABLE t1 DROP COLUMN d; +ALTER TABLE t1 ADD COLUMN d BIT(0) <CUSTOM_COL_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +a bit(1) # # # +b bit(20) # # # +c bit(64) # # # +d bit(1) # # # +INSERT INTO t1 VALUES (0,POW(2,20)-1,b'1111111111111111111111111111111111111111111111111111111111111111',1); +SELECT BIN(a), HEX(b), c+0 FROM t1 WHERE d>0; +BIN(a) HEX(b) c+0 +0 FFFFF 18446744073709551615 +INSERT INTO t1 VALUES (1,0,-1,0); +SELECT a+0, b+0, c+0 FROM t1 WHERE d<100; +a+0 b+0 c+0 +0 1048575 18446744073709551615 +1 0 18446744073709551615 +INSERT INTO t1 VALUES (b'1', 'f', 0xFF, 0x0); +SELECT a+0, b+0, c+0 FROM t1 WHERE d IN (0, 2); +a+0 b+0 c+0 +1 0 18446744073709551615 +1 102 255 +INSERT INTO t1 VALUES (0x10,0,0,1); +Warnings: +Warning 1264 Out of range value for column 'a' at row 1 +SELECT * FROM t1; +a b c d +INSERT INTO t1 VALUES (0x01,0,0x10000000000000000,0); +Warnings: +Warning 1264 Out of range value for column 'c' at row 1 +SELECT * FROM t1; +a b c d +DROP TABLE t1; +CREATE TABLE t1 (a BIT(65) <CUSTOM_COL_OPTIONS>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +ERROR 42000: Display width out of range for 'a' (max = 64) diff --git a/mysql-test/suite/storage_engine/type_bit.test b/mysql-test/suite/storage_engine/type_bit.test new file mode 100644 index 00000000000..1670a633f57 --- /dev/null +++ b/mysql-test/suite/storage_engine/type_bit.test @@ -0,0 +1,10 @@ +# +# BIT column type +# + +--source have_engine.inc + +--source type_bit.inc + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/type_bit_indexes.result b/mysql-test/suite/storage_engine/type_bit_indexes.result new file mode 100644 index 00000000000..af8ddf7d6c9 --- /dev/null +++ b/mysql-test/suite/storage_engine/type_bit_indexes.result @@ -0,0 +1,132 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a BIT <CUSTOM_COL_OPTIONS>, +b BIT(20) <CUSTOM_COL_OPTIONS>, +c BIT(32) <CUSTOM_COL_OPTIONS>, +d BIT(64) <CUSTOM_COL_OPTIONS>, +<CUSTOM_INDEX> b (b) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 # 1 b # # NULL NULL # # +INSERT INTO t1 (a,b,c,d) VALUES +(0,0xFFFFF,0,1),(0,256,0xAAA,0x12345),(1,16,0,0xFFFFFFF),(0,11,12,13), +(1,100,101,102),(0,12,13,14),(1,13,14,15),(0,101,201,202),(1,1000,1001,1002), +(1,0xFFFF,0xFFFFFFFF,0xFFFFFFFFFFFFFFFF); +SELECT b+0 FROM t1 ORDER BY b; +b+0 +11 +12 +13 +16 +100 +101 +256 +1000 +65535 +1048575 +DROP TABLE t1; +CREATE TABLE t1 (a BIT <CUSTOM_COL_OPTIONS>, +b BIT(20) <CUSTOM_COL_OPTIONS> PRIMARY KEY, +c BIT(32) <CUSTOM_COL_OPTIONS>, +d BIT(64) <CUSTOM_COL_OPTIONS> +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 0 PRIMARY 1 b # # NULL NULL # # +INSERT INTO t1 (a,b,c,d) VALUES +(0,0xFFFFF,0,1),(0,256,0xAAA,0x12345),(1,16,0,0xFFFFFFF),(0,11,12,13), +(1,100,101,102),(0,12,13,14),(1,13,14,15),(0,101,201,202),(1,1000,1001,1002), +(1,0xFFFF,0xFFFFFFFF,0xFFFFFFFFFFFFFFFF); +EXPLAIN SELECT b+0 FROM t1 ORDER BY b; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # PRIMARY # # # # +SELECT b+0 FROM t1 ORDER BY b; +b+0 +11 +12 +13 +16 +100 +101 +256 +1000 +65535 +1048575 +DROP TABLE t1; +CREATE TABLE t1 (a BIT <CUSTOM_COL_OPTIONS>, +b BIT(20) <CUSTOM_COL_OPTIONS>, +c BIT(32) <CUSTOM_COL_OPTIONS>, +d BIT(64) <CUSTOM_COL_OPTIONS>, +UNIQUE INDEX b_c (b,c) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 0 b_c 1 b # # NULL NULL # # +t1 0 b_c 2 c # # NULL NULL # # +INSERT INTO t1 (a,b,c,d) VALUES +(0,0xFFFFF,0,1),(0,256,0xAAA,0x12345),(1,16,0,0xFFFFFFF),(0,11,12,13), +(1,100,101,102),(0,12,13,14),(1,13,14,15),(0,101,201,202),(1,1000,1001,1002), +(1,0xFFFF,0xFFFFFFFF,0xFFFFFFFFFFFFFFFF); +EXPLAIN SELECT HEX(b+c) FROM t1 WHERE c > 1 OR HEX(b) < 0xFFFFFF; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # b_c # # # # +SELECT HEX(b+c) FROM t1 WHERE c > 1 OR HEX(b) < 0xFFFFFF; +HEX(b+c) +10 +10000FFFE +12E +17 +19 +1B +7D1 +BAA +C9 +FFFFF +DROP TABLE t1; +CREATE TABLE t1 (a BIT <CUSTOM_COL_OPTIONS>, +b BIT(20) <CUSTOM_COL_OPTIONS>, +c BIT(32) <CUSTOM_COL_OPTIONS>, +d BIT(64) <CUSTOM_COL_OPTIONS>, +INDEX(a) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 a 1 a # # NULL NULL # # +INSERT INTO t1 (a,b,c,d) VALUES +(0,0xFFFFF,0,1),(0,256,0xAAA,0x12345),(1,16,0,0xFFFFFFF),(0,11,12,13), +(1,100,101,102),(0,12,13,14),(1,13,14,15),(0,101,201,202),(1,1000,1001,1002), +(1,0xFFFF,0xFFFFFFFF,0xFFFFFFFFFFFFFFFF); +EXPLAIN SELECT DISTINCT a+0 FROM t1 ORDER BY a; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # a # # # # +SELECT DISTINCT a+0 FROM t1 ORDER BY a; +a+0 +0 +1 +DROP TABLE t1; +CREATE TABLE t1 (a BIT <CUSTOM_COL_OPTIONS>, +b BIT(20) <CUSTOM_COL_OPTIONS>, +c BIT(32) <CUSTOM_COL_OPTIONS>, +d BIT(64) <CUSTOM_COL_OPTIONS>, +UNIQUE INDEX (d) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 0 d 1 d # # NULL NULL # # +INSERT INTO t1 (a,b,c,d) VALUES +(0,0xFFFFF,0,1),(0,256,0xAAA,0x12345),(1,16,0,0xFFFFFFF),(0,11,12,13), +(1,100,101,102),(0,12,13,14),(1,13,14,15),(0,101,201,202),(1,1000,1001,1002), +(1,0xFFFF,0xFFFFFFFF,0xFFFFFFFFFFFFFFFF); +EXPLAIN SELECT d FROM t1 WHERE d BETWEEN 1 AND 10000; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # d # # # # +SELECT d+0 FROM t1 WHERE d BETWEEN 1 AND 10000; +d+0 +1 +1002 +102 +13 +14 +15 +202 +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/type_bit_indexes.test b/mysql-test/suite/storage_engine/type_bit_indexes.test new file mode 100644 index 00000000000..df88d50b5d9 --- /dev/null +++ b/mysql-test/suite/storage_engine/type_bit_indexes.test @@ -0,0 +1,175 @@ +# +# BIT columns with indexes +# + +--source have_engine.inc +--source have_default_index.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + + +# Default index as set in define_engine.inc + +let $create_definition = + a BIT $col_opts, + b BIT(20) $col_indexed_opts, + c BIT(32) $col_opts, + d BIT(64) $col_opts, + $default_index b (b) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = BIT types or indexes + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 3 # 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + INSERT INTO t1 (a,b,c,d) VALUES + (0,0xFFFFF,0,1),(0,256,0xAAA,0x12345),(1,16,0,0xFFFFFFF),(0,11,12,13), + (1,100,101,102),(0,12,13,14),(1,13,14,15),(0,101,201,202),(1,1000,1001,1002), + (1,0xFFFF,0xFFFFFFFF,0xFFFFFFFFFFFFFFFF); + + SELECT b+0 FROM t1 ORDER BY b; + + DROP TABLE t1; +} + + +# PK, UNIQUE KEY, KEY + + +let $create_definition = + a BIT $col_opts, + b BIT(20) $col_indexed_opts PRIMARY KEY, + c BIT(32) $col_opts, + d BIT(64) $col_opts +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = BIT types or PK + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + INSERT INTO t1 (a,b,c,d) VALUES + (0,0xFFFFF,0,1),(0,256,0xAAA,0x12345),(1,16,0,0xFFFFFFF),(0,11,12,13), + (1,100,101,102),(0,12,13,14),(1,13,14,15),(0,101,201,202),(1,1000,1001,1002), + (1,0xFFFF,0xFFFFFFFF,0xFFFFFFFFFFFFFFFF); + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT b+0 FROM t1 ORDER BY b; + SELECT b+0 FROM t1 ORDER BY b; + + DROP TABLE t1; +} + + +let $create_definition = + a BIT $col_opts, + b BIT(20) $col_indexed_opts, + c BIT(32) $col_indexed_opts, + d BIT(64) $col_opts, +UNIQUE INDEX b_c (b,c) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = BIT types or unique keys or multi-part keys + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + INSERT INTO t1 (a,b,c,d) VALUES + (0,0xFFFFF,0,1),(0,256,0xAAA,0x12345),(1,16,0,0xFFFFFFF),(0,11,12,13), + (1,100,101,102),(0,12,13,14),(1,13,14,15),(0,101,201,202),(1,1000,1001,1002), + (1,0xFFFF,0xFFFFFFFF,0xFFFFFFFFFFFFFFFF); + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT HEX(b+c) FROM t1 WHERE c > 1 OR HEX(b) < 0xFFFFFF; + --sorted_result + SELECT HEX(b+c) FROM t1 WHERE c > 1 OR HEX(b) < 0xFFFFFF; + + DROP TABLE t1; +} + +let $create_definition = + a BIT $col_indexed_opts, + b BIT(20) $col_opts, + c BIT(32) $col_opts, + d BIT(64) $col_opts, +INDEX(a) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = BIT types or non-unique keys + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + INSERT INTO t1 (a,b,c,d) VALUES + (0,0xFFFFF,0,1),(0,256,0xAAA,0x12345),(1,16,0,0xFFFFFFF),(0,11,12,13), + (1,100,101,102),(0,12,13,14),(1,13,14,15),(0,101,201,202),(1,1000,1001,1002), + (1,0xFFFF,0xFFFFFFFF,0xFFFFFFFFFFFFFFFF); + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT DISTINCT a+0 FROM t1 ORDER BY a; + SELECT DISTINCT a+0 FROM t1 ORDER BY a; + + DROP TABLE t1; +} + +let $create_definition = + a BIT $col_opts, + b BIT(20) $col_opts, + c BIT(32) $col_opts, + d BIT(64) $col_indexed_opts, +UNIQUE INDEX (d) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = BIT types or unique keys + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + INSERT INTO t1 (a,b,c,d) VALUES + (0,0xFFFFF,0,1),(0,256,0xAAA,0x12345),(1,16,0,0xFFFFFFF),(0,11,12,13), + (1,100,101,102),(0,12,13,14),(1,13,14,15),(0,101,201,202),(1,1000,1001,1002), + (1,0xFFFF,0xFFFFFFFF,0xFFFFFFFFFFFFFFFF); + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT d FROM t1 WHERE d BETWEEN 1 AND 10000; + --sorted_result + SELECT d+0 FROM t1 WHERE d BETWEEN 1 AND 10000; + + DROP TABLE t1; +} + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/type_blob.inc b/mysql-test/suite/storage_engine/type_blob.inc new file mode 100644 index 00000000000..93a52fc9971 --- /dev/null +++ b/mysql-test/suite/storage_engine/type_blob.inc @@ -0,0 +1,65 @@ +# +# BLOB column types +# + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +let $create_definition = + b BLOB $col_opts, + b0 BLOB(0) $col_opts, + b1 BLOB(1) $col_opts, + b300 BLOB(300) $col_opts, + bm BLOB(65535) $col_opts, + b70k BLOB(70000) $col_opts, + b17m BLOB(17000000) $col_opts, + t TINYBLOB $col_opts, + m MEDIUMBLOB $col_opts, + l LONGBLOB $col_opts +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = BLOB types + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 3 # 4 # 5 # + SHOW COLUMNS IN t1; + + # Valid values + # (cannot get MAX for all columns due to max_allowed_packet limitations) + + INSERT INTO t1 VALUES + ('','','','','','','','','',''), + ('a','b','c','d','e','f','g','h','i','j'), + ('test1','test2','test3','test4','test5','test6','test7','test8','test9','test10'), + ( REPEAT('a',65535), REPEAT('b',65535), REPEAT('c',255), REPEAT('d',65535), REPEAT('e',65535), REPEAT('f',1048576), HEX(REPEAT('g',1048576)), REPEAT('h',255), REPEAT('i',1048576), HEX(REPEAT('j',1048576)) ); + + --sorted_result + SELECT LENGTH(b), LENGTH(b0), LENGTH(b1), LENGTH(b300), LENGTH(bm), LENGTH(b70k), LENGTH(b17m), LENGTH(t), LENGTH(m), LENGTH(l) FROM t1; + + # Invalid values (produce warnings, except for mediumblob and longblob columns for which the values are within limits) + + INSERT INTO t1 VALUES + ( REPEAT('a',65536), REPEAT('b',65536), REPEAT('c',256), REPEAT('d',65536), REPEAT('e',65536), REPEAT('f',1048576), REPEAT('g',1048576), REPEAT('h',256), REPEAT('i',1048576), REPEAT('j',1048576) ); + + --sorted_result + SELECT LENGTH(b), LENGTH(b0), LENGTH(b1), LENGTH(b300), LENGTH(bm), LENGTH(b70k), LENGTH(b17m), LENGTH(t), LENGTH(m), LENGTH(l) FROM t1; + + --let $error_codes = ER_TOO_BIG_DISPLAYWIDTH + --let $alter_definition = ADD COLUMN bbb BLOB(4294967296) + --source alter_table.inc + if ($mysql_errname != ER_TOO_BIG_DISPLAYWIDTH) + { + --let $my_last_stmt = $alter_statement + --let $functionality = ALTER TABLE + --source unexpected_result.inc + } + + DROP TABLE t1; +} + diff --git a/mysql-test/suite/storage_engine/type_blob.result b/mysql-test/suite/storage_engine/type_blob.result new file mode 100644 index 00000000000..a93391f749a --- /dev/null +++ b/mysql-test/suite/storage_engine/type_blob.result @@ -0,0 +1,54 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (b BLOB <CUSTOM_COL_OPTIONS>, +b0 BLOB(0) <CUSTOM_COL_OPTIONS>, +b1 BLOB(1) <CUSTOM_COL_OPTIONS>, +b300 BLOB(300) <CUSTOM_COL_OPTIONS>, +bm BLOB(65535) <CUSTOM_COL_OPTIONS>, +b70k BLOB(70000) <CUSTOM_COL_OPTIONS>, +b17m BLOB(17000000) <CUSTOM_COL_OPTIONS>, +t TINYBLOB <CUSTOM_COL_OPTIONS>, +m MEDIUMBLOB <CUSTOM_COL_OPTIONS>, +l LONGBLOB <CUSTOM_COL_OPTIONS> +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +b blob # # # +b0 blob # # # +b1 tinyblob # # # +b300 blob # # # +bm blob # # # +b70k mediumblob # # # +b17m longblob # # # +t tinyblob # # # +m mediumblob # # # +l longblob # # # +INSERT INTO t1 VALUES +('','','','','','','','','',''), +('a','b','c','d','e','f','g','h','i','j'), +('test1','test2','test3','test4','test5','test6','test7','test8','test9','test10'), +( REPEAT('a',65535), REPEAT('b',65535), REPEAT('c',255), REPEAT('d',65535), REPEAT('e',65535), REPEAT('f',1048576), HEX(REPEAT('g',1048576)), REPEAT('h',255), REPEAT('i',1048576), HEX(REPEAT('j',1048576)) ); +SELECT LENGTH(b), LENGTH(b0), LENGTH(b1), LENGTH(b300), LENGTH(bm), LENGTH(b70k), LENGTH(b17m), LENGTH(t), LENGTH(m), LENGTH(l) FROM t1; +LENGTH(b) LENGTH(b0) LENGTH(b1) LENGTH(b300) LENGTH(bm) LENGTH(b70k) LENGTH(b17m) LENGTH(t) LENGTH(m) LENGTH(l) +0 0 0 0 0 0 0 0 0 0 +1 1 1 1 1 1 1 1 1 1 +5 5 5 5 5 5 5 5 5 6 +65535 65535 255 65535 65535 1048576 2097152 255 1048576 2097152 +INSERT INTO t1 VALUES +( REPEAT('a',65536), REPEAT('b',65536), REPEAT('c',256), REPEAT('d',65536), REPEAT('e',65536), REPEAT('f',1048576), REPEAT('g',1048576), REPEAT('h',256), REPEAT('i',1048576), REPEAT('j',1048576) ); +Warnings: +Warning 1265 Data truncated for column 'b' at row 1 +Warning 1265 Data truncated for column 'b0' at row 1 +Warning 1265 Data truncated for column 'b1' at row 1 +Warning 1265 Data truncated for column 'b300' at row 1 +Warning 1265 Data truncated for column 'bm' at row 1 +Warning 1265 Data truncated for column 't' at row 1 +SELECT LENGTH(b), LENGTH(b0), LENGTH(b1), LENGTH(b300), LENGTH(bm), LENGTH(b70k), LENGTH(b17m), LENGTH(t), LENGTH(m), LENGTH(l) FROM t1; +LENGTH(b) LENGTH(b0) LENGTH(b1) LENGTH(b300) LENGTH(bm) LENGTH(b70k) LENGTH(b17m) LENGTH(t) LENGTH(m) LENGTH(l) +0 0 0 0 0 0 0 0 0 0 +1 1 1 1 1 1 1 1 1 1 +5 5 5 5 5 5 5 5 5 6 +65535 65535 255 65535 65535 1048576 1048576 255 1048576 1048576 +65535 65535 255 65535 65535 1048576 2097152 255 1048576 2097152 +ALTER TABLE t1 ADD COLUMN bbb BLOB(4294967296); +ERROR 42000: Display width out of range for 'bbb' (max = 4294967295) +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/type_blob.test b/mysql-test/suite/storage_engine/type_blob.test new file mode 100644 index 00000000000..2f8ae88372e --- /dev/null +++ b/mysql-test/suite/storage_engine/type_blob.test @@ -0,0 +1,10 @@ +# +# BLOB column types +# + +--source have_engine.inc + +--source type_blob.inc + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/type_blob_indexes.result b/mysql-test/suite/storage_engine/type_blob_indexes.result new file mode 100644 index 00000000000..8e732e153b9 --- /dev/null +++ b/mysql-test/suite/storage_engine/type_blob_indexes.result @@ -0,0 +1,152 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (b BLOB <CUSTOM_COL_OPTIONS>, +t TINYBLOB <CUSTOM_COL_OPTIONS>, +m MEDIUMBLOB <CUSTOM_COL_OPTIONS>, +l LONGBLOB <CUSTOM_COL_OPTIONS>, +<CUSTOM_INDEX> b (b(32)) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 # 1 b # # 32 NULL # # +INSERT INTO t1 (b,t,m,l) VALUES +('','','',''), +('a','b','c','d'), +('b','d','c','b'), +('test1','test2','test3','test4'), +(REPEAT('a',128),REPEAT('b',128),REPEAT('c',128),REPEAT('d',128)), +(HEX('abcd'),HEX('def'),HEX('a'),HEX('abc')), +('abc','def','ghi','jkl'), +('test2','test3','test4','test5'), +('test3','test4','test5','test6'), +(REPEAT('b',128),REPEAT('f',128),REPEAT('e',128),REPEAT('d',128)), +(REPEAT('c',128),REPEAT('b',128),REPEAT('c',128),REPEAT('e',128)); +SELECT SUBSTRING(b,16) AS f FROM t1 WHERE b IN ('test1','test2') ORDER BY f; +f + + +SELECT SUBSTRING(b,16) AS f FROM t1 USE INDEX () WHERE b IN ('test1','test2') ORDER BY f; +f + + +DROP TABLE t1; +CREATE TABLE t1 (b BLOB <CUSTOM_COL_OPTIONS>, +t TINYBLOB <CUSTOM_COL_OPTIONS>, +m MEDIUMBLOB <CUSTOM_COL_OPTIONS>, +l LONGBLOB <CUSTOM_COL_OPTIONS>, +PRIMARY KEY b (b(32)) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 0 PRIMARY 1 b # # 32 NULL # # +INSERT INTO t1 (b,t,m,l) VALUES +('','','',''), +('a','b','c','d'), +('b','d','c','b'), +('test1','test2','test3','test4'), +(REPEAT('a',128),REPEAT('b',128),REPEAT('c',128),REPEAT('d',128)), +(HEX('abcd'),HEX('def'),HEX('a'),HEX('abc')), +('abc','def','ghi','jkl'), +('test2','test3','test4','test5'), +('test3','test4','test5','test6'), +(REPEAT('b',128),REPEAT('f',128),REPEAT('e',128),REPEAT('d',128)), +(REPEAT('c',128),REPEAT('b',128),REPEAT('c',128),REPEAT('e',128)); +EXPLAIN SELECT SUBSTRING(b,16) AS f FROM t1 WHERE b IN ('test1','test2') ORDER BY f; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # PRIMARY # # # # +SELECT SUBSTRING(b,16) AS f FROM t1 WHERE b IN ('test1','test2') ORDER BY f; +f + + +EXPLAIN SELECT SUBSTRING(b,16) AS f FROM t1 USE INDEX () WHERE b IN ('test1','test2') ORDER BY f; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # NULL # # # # +SELECT SUBSTRING(b,16) AS f FROM t1 USE INDEX () WHERE b IN ('test1','test2') ORDER BY f; +f + + +DROP TABLE t1; +CREATE TABLE t1 (b BLOB <CUSTOM_COL_OPTIONS>, +t TINYBLOB <CUSTOM_COL_OPTIONS>, +m MEDIUMBLOB <CUSTOM_COL_OPTIONS>, +l LONGBLOB <CUSTOM_COL_OPTIONS>, +UNIQUE INDEX l_t (l(256),t(64)) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 0 l_t 1 l # # 256 NULL # # +t1 0 l_t 2 t # # 64 NULL # # +INSERT INTO t1 (b,t,m,l) VALUES +('','','',''), +('a','b','c','d'), +('b','d','c','b'), +('test1','test2','test3','test4'), +(REPEAT('a',128),REPEAT('b',128),REPEAT('c',128),REPEAT('d',128)), +(HEX('abcd'),HEX('def'),HEX('a'),HEX('abc')), +('abc','def','ghi','jkl'), +('test2','test3','test4','test5'), +('test3','test4','test5','test6'), +(REPEAT('b',128),REPEAT('f',128),REPEAT('e',128),REPEAT('d',128)), +(REPEAT('c',128),REPEAT('b',128),REPEAT('c',128),REPEAT('e',128)); +EXPLAIN SELECT SUBSTRING(t,64), SUBSTRING(l,256) FROM t1 WHERE t!=l AND l NOT IN ('test1') ORDER BY t, l DESC; +id select_type table type possible_keys key key_len ref rows Extra +# # # # l_t # # # # # +SELECT SUBSTRING(t,64), SUBSTRING(l,256) FROM t1 WHERE t!=l AND l NOT IN ('test1') ORDER BY t, l DESC; +SUBSTRING(t,64) SUBSTRING(l,256) + + +bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb +bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb + + +fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + + + +EXPLAIN SELECT SUBSTRING(t,64), SUBSTRING(l,256) FROM t1 FORCE INDEX (l_t) WHERE t!=l AND l NOT IN ('test1') ORDER BY t, l DESC; +id select_type table type possible_keys key key_len ref rows Extra +# # # # l_t # # # # # +SELECT SUBSTRING(t,64), SUBSTRING(l,256) FROM t1 FORCE INDEX (l_t) WHERE t!=l AND l NOT IN ('test1') ORDER BY t, l DESC; +SUBSTRING(t,64) SUBSTRING(l,256) + + +bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb +bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb + + +fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + + + +DROP TABLE t1; +CREATE TABLE t1 (b BLOB <CUSTOM_COL_OPTIONS>, +t TINYBLOB <CUSTOM_COL_OPTIONS>, +m MEDIUMBLOB <CUSTOM_COL_OPTIONS>, +l LONGBLOB <CUSTOM_COL_OPTIONS>, +INDEX (m(128)) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 m 1 m # # 128 NULL # # +INSERT INTO t1 (b,t,m,l) VALUES +('','','',''), +('a','b','c','d'), +('b','d','c','b'), +('test1','test2','test3','test4'), +(REPEAT('a',128),REPEAT('b',128),REPEAT('c',128),REPEAT('d',128)), +(HEX('abcd'),HEX('def'),HEX('a'),HEX('abc')), +('abc','def','ghi','jkl'), +('test2','test3','test4','test5'), +('test3','test4','test5','test6'), +(REPEAT('b',128),REPEAT('f',128),REPEAT('e',128),REPEAT('d',128)), +(REPEAT('c',128),REPEAT('b',128),REPEAT('c',128),REPEAT('e',128)); +EXPLAIN SELECT SUBSTRING(m,128) AS f FROM t1 WHERE m = 'test1' ORDER BY f DESC; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # m # # # # +SELECT SUBSTRING(m,128) AS f FROM t1 WHERE m = 'test1' ORDER BY f DESC; +f +EXPLAIN SELECT SUBSTRING(m,128) AS f FROM t1 IGNORE INDEX FOR ORDER BY (m) WHERE m = 'test1' ORDER BY f DESC; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # m # # # # +SELECT SUBSTRING(m,128) AS f FROM t1 IGNORE INDEX FOR ORDER BY (m) WHERE m = 'test1' ORDER BY f DESC; +f +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/type_blob_indexes.test b/mysql-test/suite/storage_engine/type_blob_indexes.test new file mode 100644 index 00000000000..7a3e09939bf --- /dev/null +++ b/mysql-test/suite/storage_engine/type_blob_indexes.test @@ -0,0 +1,188 @@ +# +# BLOB columns with indexes +# + +--source have_engine.inc +--source have_default_index.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + + +# Default index as set in define_engine.inc + +let $create_definition = + b BLOB $col_indexed_opts, + t TINYBLOB $col_opts, + m MEDIUMBLOB $col_opts, + l LONGBLOB $col_opts, + $default_index b (b(32)) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = BLOB types or indexes + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 3 # 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + INSERT INTO t1 (b,t,m,l) VALUES + ('','','',''), + ('a','b','c','d'), + ('b','d','c','b'), + ('test1','test2','test3','test4'), + (REPEAT('a',128),REPEAT('b',128),REPEAT('c',128),REPEAT('d',128)), + (HEX('abcd'),HEX('def'),HEX('a'),HEX('abc')), + ('abc','def','ghi','jkl'), + ('test2','test3','test4','test5'), + ('test3','test4','test5','test6'), + (REPEAT('b',128),REPEAT('f',128),REPEAT('e',128),REPEAT('d',128)), + (REPEAT('c',128),REPEAT('b',128),REPEAT('c',128),REPEAT('e',128)); + + SELECT SUBSTRING(b,16) AS f FROM t1 WHERE b IN ('test1','test2') ORDER BY f; + SELECT SUBSTRING(b,16) AS f FROM t1 USE INDEX () WHERE b IN ('test1','test2') ORDER BY f; + + DROP TABLE t1; +} + + + +# PK, UNIQUE INDEX, INDEX + +let $create_definition = + b BLOB $col_indexed_opts, + t TINYBLOB $col_opts, + m MEDIUMBLOB $col_opts, + l LONGBLOB $col_opts, + PRIMARY KEY b (b(32)) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = BLOB types or PK + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + INSERT INTO t1 (b,t,m,l) VALUES + ('','','',''), + ('a','b','c','d'), + ('b','d','c','b'), + ('test1','test2','test3','test4'), + (REPEAT('a',128),REPEAT('b',128),REPEAT('c',128),REPEAT('d',128)), + (HEX('abcd'),HEX('def'),HEX('a'),HEX('abc')), + ('abc','def','ghi','jkl'), + ('test2','test3','test4','test5'), + ('test3','test4','test5','test6'), + (REPEAT('b',128),REPEAT('f',128),REPEAT('e',128),REPEAT('d',128)), + (REPEAT('c',128),REPEAT('b',128),REPEAT('c',128),REPEAT('e',128)); + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT SUBSTRING(b,16) AS f FROM t1 WHERE b IN ('test1','test2') ORDER BY f; + SELECT SUBSTRING(b,16) AS f FROM t1 WHERE b IN ('test1','test2') ORDER BY f; + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT SUBSTRING(b,16) AS f FROM t1 USE INDEX () WHERE b IN ('test1','test2') ORDER BY f; + SELECT SUBSTRING(b,16) AS f FROM t1 USE INDEX () WHERE b IN ('test1','test2') ORDER BY f; + + DROP TABLE t1; +} + +let $create_definition = + b BLOB $col_opts, + t TINYBLOB $col_indexed_opts, + m MEDIUMBLOB $col_opts, + l LONGBLOB $col_indexed_opts, + UNIQUE INDEX l_t (l(256),t(64)) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = BLOB types or unique indexes or multi-part indexes + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + INSERT INTO t1 (b,t,m,l) VALUES + ('','','',''), + ('a','b','c','d'), + ('b','d','c','b'), + ('test1','test2','test3','test4'), + (REPEAT('a',128),REPEAT('b',128),REPEAT('c',128),REPEAT('d',128)), + (HEX('abcd'),HEX('def'),HEX('a'),HEX('abc')), + ('abc','def','ghi','jkl'), + ('test2','test3','test4','test5'), + ('test3','test4','test5','test6'), + (REPEAT('b',128),REPEAT('f',128),REPEAT('e',128),REPEAT('d',128)), + (REPEAT('c',128),REPEAT('b',128),REPEAT('c',128),REPEAT('e',128)); + + # Here we are getting possible key l_t, but not the final key + --replace_column 1 # 2 # 3 # 4 # 6 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT SUBSTRING(t,64), SUBSTRING(l,256) FROM t1 WHERE t!=l AND l NOT IN ('test1') ORDER BY t, l DESC; + SELECT SUBSTRING(t,64), SUBSTRING(l,256) FROM t1 WHERE t!=l AND l NOT IN ('test1') ORDER BY t, l DESC; + + --replace_column 1 # 2 # 3 # 4 # 6 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT SUBSTRING(t,64), SUBSTRING(l,256) FROM t1 FORCE INDEX (l_t) WHERE t!=l AND l NOT IN ('test1') ORDER BY t, l DESC; + SELECT SUBSTRING(t,64), SUBSTRING(l,256) FROM t1 FORCE INDEX (l_t) WHERE t!=l AND l NOT IN ('test1') ORDER BY t, l DESC; + DROP TABLE t1; + +} + +let $create_definition = + b BLOB $col_opts, + t TINYBLOB $col_opts, + m MEDIUMBLOB $col_indexed_opts, + l LONGBLOB $col_opts, + INDEX (m(128)) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = BLOB types or non-unique indexes + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + INSERT INTO t1 (b,t,m,l) VALUES + ('','','',''), + ('a','b','c','d'), + ('b','d','c','b'), + ('test1','test2','test3','test4'), + (REPEAT('a',128),REPEAT('b',128),REPEAT('c',128),REPEAT('d',128)), + (HEX('abcd'),HEX('def'),HEX('a'),HEX('abc')), + ('abc','def','ghi','jkl'), + ('test2','test3','test4','test5'), + ('test3','test4','test5','test6'), + (REPEAT('b',128),REPEAT('f',128),REPEAT('e',128),REPEAT('d',128)), + (REPEAT('c',128),REPEAT('b',128),REPEAT('c',128),REPEAT('e',128)); + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT SUBSTRING(m,128) AS f FROM t1 WHERE m = 'test1' ORDER BY f DESC; + SELECT SUBSTRING(m,128) AS f FROM t1 WHERE m = 'test1' ORDER BY f DESC; + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT SUBSTRING(m,128) AS f FROM t1 IGNORE INDEX FOR ORDER BY (m) WHERE m = 'test1' ORDER BY f DESC; + SELECT SUBSTRING(m,128) AS f FROM t1 IGNORE INDEX FOR ORDER BY (m) WHERE m = 'test1' ORDER BY f DESC; + + DROP TABLE t1; +} + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/type_bool.inc b/mysql-test/suite/storage_engine/type_bool.inc new file mode 100644 index 00000000000..ae7d0043c49 --- /dev/null +++ b/mysql-test/suite/storage_engine/type_bool.inc @@ -0,0 +1,81 @@ +# +# BOOLEAN column type +# + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +let $create_definition = + b1 BOOL $col_opts, + b2 BOOLEAN $col_opts +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = BOOLEAN types + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + + --replace_column 3 # 4 # 5 # + SHOW COLUMNS IN t1; + + # Valid values + + INSERT INTO t1 VALUES (1,TRUE); + --sorted_result + SELECT * FROM t1; + + INSERT INTO t1 VALUES (FALSE,0); + --sorted_result + SELECT * FROM t1; + + INSERT INTO t1 VALUES (2,3); + --sorted_result + SELECT * FROM t1; + + INSERT INTO t1 VALUES (-1,-2); + --sorted_result + SELECT * FROM t1; + + --sorted_result + SELECT IF(b1,'true','false') AS a, IF(b2,'true','false') AS b FROM t1; + + --sorted_result + SELECT * FROM t1 WHERE b1 = TRUE; + + --sorted_result + SELECT * FROM t1 WHERE b2 = FALSE; + + # Invalid values + + INSERT INTO t1 VALUES ('a','b'); + --sorted_result + SELECT * FROM t1; + + INSERT INTO t1 VALUES (128,-129); + --sorted_result + SELECT * FROM t1; + + # This is why we don't have zerofill and unsigned tests + # for boolean columns: + --let $error_codes = ER_PARSE_ERROR + --let $alter_definition = ADD COLUMN b3 BOOLEAN UNSIGNED + --source alter_table.inc + if ($mysql_errname != ER_PARSE_ERROR) + { + --let $my_last_stmt = $alter_statement + --let $functionality = ALTER TABLE + --source unexpected_result.inc + } + --let $error_codes = ER_PARSE_ERROR + --let $alter_definition = ADD COLUMN b3 BOOL ZEROFILL + --source alter_table.inc + + DROP TABLE t1; +} + + diff --git a/mysql-test/suite/storage_engine/type_bool.result b/mysql-test/suite/storage_engine/type_bool.result new file mode 100644 index 00000000000..89beaa11a16 --- /dev/null +++ b/mysql-test/suite/storage_engine/type_bool.result @@ -0,0 +1,70 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (b1 BOOL <CUSTOM_COL_OPTIONS>, +b2 BOOLEAN <CUSTOM_COL_OPTIONS> +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +b1 tinyint(1) # # # +b2 tinyint(1) # # # +INSERT INTO t1 VALUES (1,TRUE); +SELECT * FROM t1; +b1 b2 +1 1 +INSERT INTO t1 VALUES (FALSE,0); +SELECT * FROM t1; +b1 b2 +0 0 +1 1 +INSERT INTO t1 VALUES (2,3); +SELECT * FROM t1; +b1 b2 +0 0 +1 1 +2 3 +INSERT INTO t1 VALUES (-1,-2); +SELECT * FROM t1; +b1 b2 +-1 -2 +0 0 +1 1 +2 3 +SELECT IF(b1,'true','false') AS a, IF(b2,'true','false') AS b FROM t1; +a b +false false +true true +true true +true true +SELECT * FROM t1 WHERE b1 = TRUE; +b1 b2 +1 1 +SELECT * FROM t1 WHERE b2 = FALSE; +b1 b2 +0 0 +INSERT INTO t1 VALUES ('a','b'); +Warnings: +Warning 1366 Incorrect integer value: 'a' for column 'b1' at row 1 +Warning 1366 Incorrect integer value: 'b' for column 'b2' at row 1 +SELECT * FROM t1; +b1 b2 +-1 -2 +0 0 +0 0 +1 1 +2 3 +INSERT INTO t1 VALUES (128,-129); +Warnings: +Warning 1264 Out of range value for column 'b1' at row 1 +Warning 1264 Out of range value for column 'b2' at row 1 +SELECT * FROM t1; +b1 b2 +-1 -2 +0 0 +0 0 +1 1 +127 -128 +2 3 +ALTER TABLE t1 ADD COLUMN b3 BOOLEAN UNSIGNED; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'UNSIGNED' at line 1 +ALTER TABLE t1 ADD COLUMN b3 BOOL ZEROFILL; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'ZEROFILL' at line 1 +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/type_bool.test b/mysql-test/suite/storage_engine/type_bool.test new file mode 100644 index 00000000000..40ef56769e9 --- /dev/null +++ b/mysql-test/suite/storage_engine/type_bool.test @@ -0,0 +1,10 @@ +# +# BOOLEAN column type +# + +--source have_engine.inc + +--source type_bool.inc + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/type_char.inc b/mysql-test/suite/storage_engine/type_char.inc new file mode 100644 index 00000000000..8484fc23b10 --- /dev/null +++ b/mysql-test/suite/storage_engine/type_char.inc @@ -0,0 +1,59 @@ +# +# CHAR column types +# + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +let $create_definition = + c CHAR $col_opts, + c0 CHAR(0) $col_opts, + c1 CHAR(1) $col_opts, + c20 CHAR(20) $col_opts, + c255 CHAR(255) $col_opts +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = CHAR types + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 3 # 4 # 5 # + SHOW COLUMNS IN t1; + + # Valid values + + INSERT INTO t1 VALUES ('','','','',''); + INSERT INTO t1 VALUES ('a','','b','abcdefghi klmnopqrst', 'Creating an article for the Knowledgebase is similar to asking questions. First, navigate to the category where you feel the article should be. Once there, double check that an article doesn\'t already exist which would work.'); + + --sorted_result + SELECT * FROM t1; + + # Invalid values + + INSERT INTO t1 VALUES ('abc', 'a', 'abc', REPEAT('a',21), REPEAT('x',256)); + INSERT INTO t1 SELECT c255, c255, c255, c255, CONCAT(c255,c1) FROM t1; + + --sorted_result + SELECT * FROM t1; + + --sorted_result + SELECT DISTINCT c20, REPEAT('a',LENGTH(c20)), COUNT(*) FROM t1 GROUP BY c1, c20; + + --let $error_codes = ER_TOO_BIG_FIELDLENGTH + --let $alter_definition = ADD COLUMN c257 CHAR(257) $col_opts + --source alter_table.inc + if ($mysql_errname != ER_TOO_BIG_FIELDLENGTH) + { + --let $my_last_stmt = $alter_statement + --let $functionality = ALTER TABLE + --source unexpected_result.inc + } + DROP TABLE t1; +} + + diff --git a/mysql-test/suite/storage_engine/type_char.result b/mysql-test/suite/storage_engine/type_char.result new file mode 100644 index 00000000000..61d3cf2419d --- /dev/null +++ b/mysql-test/suite/storage_engine/type_char.result @@ -0,0 +1,56 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c CHAR <CUSTOM_COL_OPTIONS>, +c0 CHAR(0) <CUSTOM_COL_OPTIONS>, +c1 CHAR(1) <CUSTOM_COL_OPTIONS>, +c20 CHAR(20) <CUSTOM_COL_OPTIONS>, +c255 CHAR(255) <CUSTOM_COL_OPTIONS> +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +c char(1) # # # +c0 char(0) # # # +c1 char(1) # # # +c20 char(20) # # # +c255 char(255) # # # +INSERT INTO t1 VALUES ('','','','',''); +INSERT INTO t1 VALUES ('a','','b','abcdefghi klmnopqrst', 'Creating an article for the Knowledgebase is similar to asking questions. First, navigate to the category where you feel the article should be. Once there, double check that an article doesn\'t already exist which would work.'); +SELECT * FROM t1; +c c0 c1 c20 c255 + +a b abcdefghi klmnopqrst Creating an article for the Knowledgebase is similar to asking questions. First, navigate to the category where you feel the article should be. Once there, double check that an article doesn't already exist which would work. +INSERT INTO t1 VALUES ('abc', 'a', 'abc', REPEAT('a',21), REPEAT('x',256)); +Warnings: +Warning 1265 Data truncated for column 'c' at row 1 +Warning 1265 Data truncated for column 'c0' at row 1 +Warning 1265 Data truncated for column 'c1' at row 1 +Warning 1265 Data truncated for column 'c20' at row 1 +Warning 1265 Data truncated for column 'c255' at row 1 +INSERT INTO t1 SELECT c255, c255, c255, c255, CONCAT(c255,c1) FROM t1; +Warnings: +Warning 1265 Data truncated for column 'c' at row 2 +Warning 1265 Data truncated for column 'c0' at row 2 +Warning 1265 Data truncated for column 'c1' at row 2 +Warning 1265 Data truncated for column 'c20' at row 2 +Warning 1265 Data truncated for column 'c' at row 3 +Warning 1265 Data truncated for column 'c0' at row 3 +Warning 1265 Data truncated for column 'c1' at row 3 +Warning 1265 Data truncated for column 'c20' at row 3 +Warning 1265 Data truncated for column 'c255' at row 3 +SELECT * FROM t1; +c c0 c1 c20 c255 + + +C C Creating an article Creating an article for the Knowledgebase is similar to asking questions. First, navigate to the category where you feel the article should be. Once there, double check that an article doesn't already exist which would work.b +a a aaaaaaaaaaaaaaaaaaaa xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +a b abcdefghi klmnopqrst Creating an article for the Knowledgebase is similar to asking questions. First, navigate to the category where you feel the article should be. Once there, double check that an article doesn't already exist which would work. +x x xxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +SELECT DISTINCT c20, REPEAT('a',LENGTH(c20)), COUNT(*) FROM t1 GROUP BY c1, c20; +c20 REPEAT('a',LENGTH(c20)) COUNT(*) + 2 +Creating an article aaaaaaaaaaaaaaaaaaa 1 +aaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaa 1 +abcdefghi klmnopqrst aaaaaaaaaaaaaaaaaaaa 1 +xxxxxxxxxxxxxxxxxxxx aaaaaaaaaaaaaaaaaaaa 1 +ALTER TABLE t1 ADD COLUMN c257 CHAR(257) <CUSTOM_COL_OPTIONS>; +ERROR 42000: Column length too big for column 'c257' (max = 255); use BLOB or TEXT instead +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/type_char.test b/mysql-test/suite/storage_engine/type_char.test new file mode 100644 index 00000000000..ef552f47060 --- /dev/null +++ b/mysql-test/suite/storage_engine/type_char.test @@ -0,0 +1,10 @@ +# +# CHAR column types +# + +--source have_engine.inc + +--source type_char.inc + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/type_char_indexes.result b/mysql-test/suite/storage_engine/type_char_indexes.result new file mode 100644 index 00000000000..f02fcef3ef0 --- /dev/null +++ b/mysql-test/suite/storage_engine/type_char_indexes.result @@ -0,0 +1,144 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c CHAR <CUSTOM_COL_OPTIONS>, +c20 CHAR(20) <CUSTOM_COL_OPTIONS>, +v16 VARCHAR(16) <CUSTOM_COL_OPTIONS>, +v128 VARCHAR(128) <CUSTOM_COL_OPTIONS>, +<CUSTOM_INDEX> c20 (c20) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 # 1 c20 # # NULL NULL # # +INSERT INTO t1 (c,c20,v16,v128) VALUES ('a','char1','varchar1a','varchar1b'),('a','char2','varchar2a','varchar2b'),('b','char3','varchar1a','varchar1b'),('c','char4','varchar3a','varchar3b'); +SELECT c20 FROM t1 ORDER BY c20; +c20 +char1 +char2 +char3 +char4 +DROP TABLE t1; +CREATE TABLE t1 (c CHAR <CUSTOM_COL_OPTIONS>, +c20 CHAR(20) <CUSTOM_COL_OPTIONS>, +v16 VARCHAR(16) <CUSTOM_COL_OPTIONS>, +v128 VARCHAR(128) <CUSTOM_COL_OPTIONS>, +<CUSTOM_INDEX> v16 (v16) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 # 1 v16 # # NULL NULL # # +INSERT INTO t1 (c,c20,v16,v128) VALUES ('a','char1','varchar1a','varchar1b'),('a','char2','varchar2a','varchar2b'),('b','char1','varchar3a','varchar1b'),('c','char4','varchar4a','varchar4b'); +SELECT v16 FROM t1 ORDER BY v16; +v16 +varchar1a +varchar2a +varchar3a +varchar4a +DROP TABLE t1; +CREATE TABLE t1 (c CHAR <CUSTOM_COL_OPTIONS>, +c20 CHAR(20) <CUSTOM_COL_OPTIONS> PRIMARY KEY, +v16 VARCHAR(16) <CUSTOM_COL_OPTIONS>, +v128 VARCHAR(128) <CUSTOM_COL_OPTIONS> +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 0 PRIMARY 1 c20 # # NULL NULL # # +INSERT INTO t1 (c,c20,v16,v128) VALUES ('a','char1','varchar1a','varchar1b'),('a','char2','varchar2a','varchar2b'),('b','char3','varchar1a','varchar1b'),('c','char4','varchar3a','varchar3b'); +EXPLAIN SELECT c20 FROM t1 ORDER BY c20; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # PRIMARY # # # # +SELECT c20 FROM t1 ORDER BY c20; +c20 +char1 +char2 +char3 +char4 +EXPLAIN SELECT c20 FROM t1 FORCE INDEX FOR ORDER BY (PRIMARY) ORDER BY c20; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # PRIMARY # # # # +SELECT c20 FROM t1 FORCE INDEX FOR ORDER BY (PRIMARY) ORDER BY c20; +c20 +char1 +char2 +char3 +char4 +DROP TABLE t1; +CREATE TABLE t1 (c CHAR <CUSTOM_COL_OPTIONS>, +c20 CHAR(20) <CUSTOM_COL_OPTIONS>, +v16 VARCHAR(16) <CUSTOM_COL_OPTIONS>, +v128 VARCHAR(128) <CUSTOM_COL_OPTIONS>, +UNIQUE INDEX c_v (c,v128) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 0 c_v 1 c # # NULL NULL # # +t1 0 c_v 2 v128 # # NULL NULL # # +INSERT INTO t1 (c,c20,v16,v128) VALUES ('a','char1','varchar1a','varchar1b'),('a','char2','varchar2a','varchar2b'),('b','char3','varchar1a','varchar1b'),('c','char4','varchar3a','varchar3b'); +EXPLAIN SELECT c, v128 FROM t1 WHERE c != 'a' AND v128 > 'varchar'; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # c_v # # # # +SELECT c, v128 FROM t1 WHERE c != 'a' AND v128 > 'varchar'; +c v128 +b varchar1b +c varchar3b +EXPLAIN SELECT v128, COUNT(*) FROM t1 GROUP BY v128; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # c_v # # # # +SELECT v128, COUNT(*) FROM t1 GROUP BY v128; +v128 COUNT(*) +varchar1b 2 +varchar2b 1 +varchar3b 1 +EXPLAIN SELECT v128, COUNT(*) FROM t1 USE INDEX FOR GROUP BY (c_v) GROUP BY v128; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # c_v # # # # +SELECT v128, COUNT(*) FROM t1 USE INDEX FOR GROUP BY (c_v) GROUP BY v128; +v128 COUNT(*) +varchar1b 2 +varchar2b 1 +varchar3b 1 +SET SESSION optimizer_switch = 'engine_condition_pushdown=on'; +EXPLAIN SELECT * FROM t1 WHERE c > 'a'; +id select_type table type possible_keys key key_len ref rows Extra +# # # range c_v c_v # # # Using index condition +SELECT * FROM t1 WHERE c > 'a'; +c c20 v16 v128 +b char3 varchar1a varchar1b +c char4 varchar3a varchar3b +SET SESSION optimizer_switch = @@global.optimizer_switch; +DROP TABLE t1; +CREATE TABLE t1 (c CHAR <CUSTOM_COL_OPTIONS>, +c20 CHAR(20) <CUSTOM_COL_OPTIONS>, +v16 VARCHAR(16) <CUSTOM_COL_OPTIONS>, +v128 VARCHAR(128) <CUSTOM_COL_OPTIONS>, +INDEX (v16) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 v16 1 v16 # # NULL NULL # # +INSERT INTO t1 (c,c20,v16,v128) VALUES ('a','char1','varchar1a','varchar1b'),('a','char2','varchar2a','varchar2b'),('b','char3','varchar1a','varchar1b'),('c','char4','varchar3a','varchar3b'); +EXPLAIN SELECT SUBSTRING(v16,0,3) FROM t1 WHERE v16 LIKE 'varchar%'; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # v16 # # # # +SELECT SUBSTRING(v16,7,3) FROM t1 WHERE v16 LIKE 'varchar%'; +SUBSTRING(v16,7,3) +r1a +r1a +r2a +r3a +EXPLAIN SELECT SUBSTRING(v16,0,3) FROM t1 IGNORE INDEX (v16) WHERE v16 LIKE 'varchar%'; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # NULL # # # # +SELECT SUBSTRING(v16,7,3) FROM t1 IGNORE INDEX (v16) WHERE v16 LIKE 'varchar%'; +SUBSTRING(v16,7,3) +r1a +r1a +r2a +r3a +EXPLAIN SELECT * FROM t1 WHERE v16 = 'varchar1a' OR v16 = 'varchar3a' ORDER BY v16; +id select_type table type possible_keys key key_len ref rows Extra +# # # range # v16 # # # # +SELECT * FROM t1 WHERE v16 = 'varchar1a' OR v16 = 'varchar3a' ORDER BY v16; +c c20 v16 v128 +a char1 varchar1a varchar1b +b char3 varchar1a varchar1b +c char4 varchar3a varchar3b +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/type_char_indexes.test b/mysql-test/suite/storage_engine/type_char_indexes.test new file mode 100644 index 00000000000..582800eabba --- /dev/null +++ b/mysql-test/suite/storage_engine/type_char_indexes.test @@ -0,0 +1,186 @@ +# +# CHAR and VARCHAR columns with indexes +# + +--source have_engine.inc +--source have_default_index.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +# Default index as set in define_engine.inc + +let $create_definition = + c CHAR $col_opts, + c20 CHAR(20) $col_indexed_opts, + v16 VARCHAR(16) $col_opts, + v128 VARCHAR(128) $col_opts, + $default_index c20 (c20) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = CHAR or VARCHAR types or indexes + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 3 # 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + INSERT INTO t1 (c,c20,v16,v128) VALUES ('a','char1','varchar1a','varchar1b'),('a','char2','varchar2a','varchar2b'),('b','char3','varchar1a','varchar1b'),('c','char4','varchar3a','varchar3b'); + + SELECT c20 FROM t1 ORDER BY c20; + + DROP TABLE t1; +} + +let $create_definition = + c CHAR $col_opts, + c20 CHAR(20) $col_opts, + v16 VARCHAR(16) $col_indexed_opts, + v128 VARCHAR(128) $col_opts, + $default_index v16 (v16) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = CHAR or VARCHAR types or indexes + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 3 # 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + INSERT INTO t1 (c,c20,v16,v128) VALUES ('a','char1','varchar1a','varchar1b'),('a','char2','varchar2a','varchar2b'),('b','char1','varchar3a','varchar1b'),('c','char4','varchar4a','varchar4b'); + + SELECT v16 FROM t1 ORDER BY v16; + + DROP TABLE t1; +} + + +# PK, UNIQUE INDEX, INDEX + +let $create_definition = + c CHAR $col_opts, + c20 CHAR(20) $col_indexed_opts PRIMARY KEY, + v16 VARCHAR(16) $col_opts, + v128 VARCHAR(128) $col_opts +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = CHAR or VARCHAR types or PK + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + INSERT INTO t1 (c,c20,v16,v128) VALUES ('a','char1','varchar1a','varchar1b'),('a','char2','varchar2a','varchar2b'),('b','char3','varchar1a','varchar1b'),('c','char4','varchar3a','varchar3b'); + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT c20 FROM t1 ORDER BY c20; + SELECT c20 FROM t1 ORDER BY c20; + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT c20 FROM t1 FORCE INDEX FOR ORDER BY (PRIMARY) ORDER BY c20; + SELECT c20 FROM t1 FORCE INDEX FOR ORDER BY (PRIMARY) ORDER BY c20; + + DROP TABLE t1; +} + +let $create_definition = + c CHAR $col_indexed_opts, + c20 CHAR(20) $col_opts, + v16 VARCHAR(16) $col_opts, + v128 VARCHAR(128) $col_indexed_opts, + UNIQUE INDEX c_v (c,v128) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = CHAR or VARCHAR types or unique keys or multi-part keys + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + INSERT INTO t1 (c,c20,v16,v128) VALUES ('a','char1','varchar1a','varchar1b'),('a','char2','varchar2a','varchar2b'),('b','char3','varchar1a','varchar1b'),('c','char4','varchar3a','varchar3b'); + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT c, v128 FROM t1 WHERE c != 'a' AND v128 > 'varchar'; + --sorted_result + SELECT c, v128 FROM t1 WHERE c != 'a' AND v128 > 'varchar'; + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT v128, COUNT(*) FROM t1 GROUP BY v128; + --sorted_result + SELECT v128, COUNT(*) FROM t1 GROUP BY v128; + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT v128, COUNT(*) FROM t1 USE INDEX FOR GROUP BY (c_v) GROUP BY v128; + --sorted_result + SELECT v128, COUNT(*) FROM t1 USE INDEX FOR GROUP BY (c_v) GROUP BY v128; + + SET SESSION optimizer_switch = 'engine_condition_pushdown=on'; + --replace_column 1 # 2 # 3 # 7 # 8 # 9 # + EXPLAIN SELECT * FROM t1 WHERE c > 'a'; + --sorted_result + SELECT * FROM t1 WHERE c > 'a'; + SET SESSION optimizer_switch = @@global.optimizer_switch; + + DROP TABLE t1; +} + +let $create_definition = + c CHAR $col_opts, + c20 CHAR(20) $col_opts, + v16 VARCHAR(16) $col_indexed_opts, + v128 VARCHAR(128) $col_opts, + INDEX (v16) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = CHAR or VARCHAR types or non-unique indexes + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + INSERT INTO t1 (c,c20,v16,v128) VALUES ('a','char1','varchar1a','varchar1b'),('a','char2','varchar2a','varchar2b'),('b','char3','varchar1a','varchar1b'),('c','char4','varchar3a','varchar3b'); + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT SUBSTRING(v16,0,3) FROM t1 WHERE v16 LIKE 'varchar%'; + --sorted_result + SELECT SUBSTRING(v16,7,3) FROM t1 WHERE v16 LIKE 'varchar%'; + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT SUBSTRING(v16,0,3) FROM t1 IGNORE INDEX (v16) WHERE v16 LIKE 'varchar%'; + --sorted_result + SELECT SUBSTRING(v16,7,3) FROM t1 IGNORE INDEX (v16) WHERE v16 LIKE 'varchar%'; + + --replace_column 1 # 2 # 3 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT * FROM t1 WHERE v16 = 'varchar1a' OR v16 = 'varchar3a' ORDER BY v16; + --sorted_result + SELECT * FROM t1 WHERE v16 = 'varchar1a' OR v16 = 'varchar3a' ORDER BY v16; + + DROP TABLE t1; +} + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/type_date_time.inc b/mysql-test/suite/storage_engine/type_date_time.inc new file mode 100644 index 00000000000..d0b953984be --- /dev/null +++ b/mysql-test/suite/storage_engine/type_date_time.inc @@ -0,0 +1,55 @@ +# +# Date and time column types +# (DATE, DATETIME, TIMESTAMP, TIME, YEAR) +# + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +let $create_definition = + d DATE $col_opts, + dt DATETIME $col_opts, + ts TIMESTAMP $col_opts, + t TIME $col_opts, + y YEAR $col_opts, + y4 YEAR(4) $col_opts, + y2 YEAR(2) $col_opts +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Date and time types + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 3 # 4 # 5 # + SHOW COLUMNS IN t1; + + SET @tm = '2012-04-09 05:27:00'; + + # Valid values + # '1970-01-01 00:00:01' + INSERT INTO t1 VALUES + ('1000-01-01', '1000-01-01 00:00:00', FROM_UNIXTIME(1), '-838:59:59', '1901', '1901', '00'), + ('9999-12-31', '9999-12-31 23:59:59', FROM_UNIXTIME(2147483647), '838:59:59', '2155', '2155', '99'), + ('0000-00-00', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '00:00:00', '0', '0', '0'), + (DATE(@tm),@tm,TIMESTAMP(@tm),TIME(@tm),YEAR(@tm),YEAR(@tm),YEAR(@tm)); + + --sorted_result + SELECT * FROM t1; + + # Invalid values + + INSERT INTO t1 VALUES + ('999-13-32', '999-11-31 00:00:00', '0', '-839:00:00', '1900', '1900', '-1' ); + + --sorted_result + SELECT * FROM t1; + + DROP TABLE t1; +} + + diff --git a/mysql-test/suite/storage_engine/type_date_time.result b/mysql-test/suite/storage_engine/type_date_time.result new file mode 100644 index 00000000000..ba3a888562e --- /dev/null +++ b/mysql-test/suite/storage_engine/type_date_time.result @@ -0,0 +1,48 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (d DATE <CUSTOM_COL_OPTIONS>, +dt DATETIME <CUSTOM_COL_OPTIONS>, +ts TIMESTAMP <CUSTOM_COL_OPTIONS>, +t TIME <CUSTOM_COL_OPTIONS>, +y YEAR <CUSTOM_COL_OPTIONS>, +y4 YEAR(4) <CUSTOM_COL_OPTIONS>, +y2 YEAR(2) <CUSTOM_COL_OPTIONS> +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +d date # # # +dt datetime # # # +ts timestamp # # # on update CURRENT_TIMESTAMP +t time # # # +y year(4) # # # +y4 year(4) # # # +y2 year(2) # # # +SET @tm = '2012-04-09 05:27:00'; +INSERT INTO t1 VALUES +('1000-01-01', '1000-01-01 00:00:00', FROM_UNIXTIME(1), '-838:59:59', '1901', '1901', '00'), +('9999-12-31', '9999-12-31 23:59:59', FROM_UNIXTIME(2147483647), '838:59:59', '2155', '2155', '99'), +('0000-00-00', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '00:00:00', '0', '0', '0'), +(DATE(@tm),@tm,TIMESTAMP(@tm),TIME(@tm),YEAR(@tm),YEAR(@tm),YEAR(@tm)); +SELECT * FROM t1; +d dt ts t y y4 y2 +0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 00:00:00 2000 2000 00 +1000-01-01 1000-01-01 00:00:00 1970-01-01 03:00:01 -838:59:59 1901 1901 00 +2012-04-09 2012-04-09 05:27:00 2012-04-09 05:27:00 05:27:00 2012 2012 12 +9999-12-31 9999-12-31 23:59:59 2038-01-19 07:14:07 838:59:59 2155 2155 99 +INSERT INTO t1 VALUES +('999-13-32', '999-11-31 00:00:00', '0', '-839:00:00', '1900', '1900', '-1' ); +Warnings: +Warning 1265 Data truncated for column 'd' at row 1 +Warning 1265 Data truncated for column 'dt' at row 1 +Warning 1265 Data truncated for column 'ts' at row 1 +Warning 1264 Out of range value for column 't' at row 1 +Warning 1264 Out of range value for column 'y' at row 1 +Warning 1264 Out of range value for column 'y4' at row 1 +Warning 1264 Out of range value for column 'y2' at row 1 +SELECT * FROM t1; +d dt ts t y y4 y2 +0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 -838:59:59 0000 0000 00 +0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 00:00:00 2000 2000 00 +1000-01-01 1000-01-01 00:00:00 1970-01-01 03:00:01 -838:59:59 1901 1901 00 +2012-04-09 2012-04-09 05:27:00 2012-04-09 05:27:00 05:27:00 2012 2012 12 +9999-12-31 9999-12-31 23:59:59 2038-01-19 07:14:07 838:59:59 2155 2155 99 +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/type_date_time.test b/mysql-test/suite/storage_engine/type_date_time.test new file mode 100644 index 00000000000..7f6c325ec3e --- /dev/null +++ b/mysql-test/suite/storage_engine/type_date_time.test @@ -0,0 +1,11 @@ +# +# Date and time column types +# (DATE, DATETIME, TIMESTAMP, TIME, YEAR) +# + +--source have_engine.inc + +--source type_date_time.inc + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/type_date_time_indexes.result b/mysql-test/suite/storage_engine/type_date_time_indexes.result new file mode 100644 index 00000000000..f259aea2cc4 --- /dev/null +++ b/mysql-test/suite/storage_engine/type_date_time_indexes.result @@ -0,0 +1,278 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (d DATE <CUSTOM_COL_OPTIONS>, +dt DATETIME <CUSTOM_COL_OPTIONS>, +ts TIMESTAMP <CUSTOM_COL_OPTIONS>, +t TIME <CUSTOM_COL_OPTIONS>, +y YEAR <CUSTOM_COL_OPTIONS>, +<CUSTOM_INDEX> d (d) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 # 1 d # # NULL NULL # # +SET @tm = '2012-04-09 05:27:00'; +INSERT INTO t1 (d,dt,ts,t,y) VALUES +('2012-01-12', '2010-11-22 12:33:54', '2011-11-14 21:45:55', '00:12:33', '2000'), +('2012-01-22', '2010-11-22 11:43:14', '2011-11-14 21:45:55', '00:12:32', '2001'), +('2012-03-31', '2011-08-28 21:33:56', '1999-04-30 19:11:08', '12:00:00', '1999'), +('2012-03-13', '2011-08-27 21:33:56', '1999-03-30 19:11:08', '12:10:00', '1998'), +('2011-03-31', '2011-08-28 20:33:56', '1997-01-31 11:54:01', '22:04:10', '1994'), +(DATE(@tm),@tm,TIMESTAMP(@tm),TIME(@tm),YEAR(@tm)); +SELECT d FROM t1 ORDER BY d LIMIT 3; +d +2011-03-31 +2012-01-12 +2012-01-22 +DROP TABLE t1; +CREATE TABLE t1 (d DATE <CUSTOM_COL_OPTIONS>, +dt DATETIME <CUSTOM_COL_OPTIONS>, +ts TIMESTAMP <CUSTOM_COL_OPTIONS>, +t TIME <CUSTOM_COL_OPTIONS>, +y YEAR <CUSTOM_COL_OPTIONS>, +<CUSTOM_INDEX> dt (dt) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 # 1 dt # # NULL NULL # # +SET @tm = '2012-04-09 05:27:00'; +INSERT INTO t1 (d,dt,ts,t,y) VALUES +('2012-01-12', '2010-11-22 12:33:54', '2011-11-14 21:45:55', '00:12:33', '2000'), +('2012-01-12', '2010-11-22 11:43:14', '2011-11-14 21:45:55', '00:12:32', '2001'), +('2012-03-31', '2011-08-28 21:33:56', '1999-04-30 19:11:08', '12:00:00', '1999'), +('2012-03-13', '2011-08-27 21:33:56', '1999-03-30 19:11:08', '12:10:00', '1998'), +('2011-03-31', '2011-08-28 20:33:56', '1997-01-31 11:54:01', '22:04:10', '1994'), +(DATE(@tm),@tm,TIMESTAMP(@tm),TIME(@tm),YEAR(@tm)); +SELECT dt FROM t1 ORDER BY dt LIMIT 3; +dt +2010-11-22 11:43:14 +2010-11-22 12:33:54 +2011-08-27 21:33:56 +DROP TABLE t1; +CREATE TABLE t1 (d DATE <CUSTOM_COL_OPTIONS>, +dt DATETIME <CUSTOM_COL_OPTIONS>, +ts TIMESTAMP <CUSTOM_COL_OPTIONS>, +t TIME <CUSTOM_COL_OPTIONS>, +y YEAR <CUSTOM_COL_OPTIONS>, +<CUSTOM_INDEX> ts (ts) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 # 1 ts # # NULL NULL # # +SET @tm = '2012-04-09 05:27:00'; +INSERT INTO t1 (d,dt,ts,t,y) VALUES +('2012-01-12', '2010-11-22 12:33:54', '2011-11-14 21:45:25', '00:12:33', '2000'), +('2012-01-12', '2010-11-22 11:43:14', '2011-11-14 21:45:55', '00:12:32', '2001'), +('2012-03-31', '2011-08-28 21:33:56', '1999-04-30 19:11:08', '12:00:00', '1999'), +('2012-03-13', '2011-08-27 21:33:56', '1999-03-30 19:11:08', '12:10:00', '1998'), +('2011-03-31', '2011-08-28 20:33:56', '1997-01-31 11:54:01', '22:04:10', '1994'), +(DATE(@tm),@tm,TIMESTAMP(@tm),TIME(@tm),YEAR(@tm)); +SELECT ts FROM t1 ORDER BY ts LIMIT 3; +ts +1997-01-31 11:54:01 +1999-03-30 19:11:08 +1999-04-30 19:11:08 +DROP TABLE t1; +CREATE TABLE t1 (d DATE <CUSTOM_COL_OPTIONS>, +dt DATETIME <CUSTOM_COL_OPTIONS>, +ts TIMESTAMP <CUSTOM_COL_OPTIONS>, +t TIME <CUSTOM_COL_OPTIONS>, +y YEAR <CUSTOM_COL_OPTIONS>, +<CUSTOM_INDEX> t (t) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 # 1 t # # NULL NULL # # +SET @tm = '2012-04-09 05:27:00'; +INSERT INTO t1 (d,dt,ts,t,y) VALUES +('2012-01-12', '2010-11-22 12:33:54', '2011-11-14 21:45:25', '00:12:33', '2000'), +('2012-01-12', '2010-11-22 11:43:14', '2011-11-14 21:45:55', '00:12:32', '2001'), +('2012-03-31', '2011-08-28 21:33:56', '1999-04-30 19:11:08', '12:00:00', '1999'), +('2012-03-13', '2011-08-27 21:33:56', '1999-03-30 19:11:08', '12:10:00', '1998'), +('2011-03-31', '2011-08-28 20:33:56', '1997-01-31 11:54:01', '22:04:10', '1994'), +(DATE(@tm),@tm,TIMESTAMP(@tm),TIME(@tm),YEAR(@tm)); +SELECT t FROM t1 ORDER BY t LIMIT 3; +t +00:12:32 +00:12:33 +05:27:00 +DROP TABLE t1; +CREATE TABLE t1 (d DATE <CUSTOM_COL_OPTIONS>, +dt DATETIME <CUSTOM_COL_OPTIONS>, +ts TIMESTAMP <CUSTOM_COL_OPTIONS>, +t TIME <CUSTOM_COL_OPTIONS>, +y YEAR <CUSTOM_COL_OPTIONS>, +<CUSTOM_INDEX> y (y) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 # 1 y # # NULL NULL # # +SET @tm = '2012-04-09 05:27:00'; +INSERT INTO t1 (d,dt,ts,t,y) VALUES +('2012-01-12', '2010-11-22 12:33:54', '2011-11-14 21:45:25', '00:12:33', '2000'), +('2012-01-12', '2010-11-22 11:43:14', '2011-11-14 21:45:55', '00:12:32', '2001'), +('2012-03-31', '2011-08-28 21:33:56', '1999-04-30 19:11:08', '12:00:00', '1999'), +('2012-03-13', '2011-08-27 21:33:56', '1999-03-30 19:11:08', '12:10:00', '1998'), +('2011-03-31', '2011-08-28 20:33:56', '1997-01-31 11:54:01', '22:04:10', '1994'), +(DATE(@tm),@tm,TIMESTAMP(@tm),TIME(@tm),YEAR(@tm)); +SELECT y FROM t1 ORDER BY y LIMIT 3; +y +1994 +1998 +1999 +DROP TABLE t1; +CREATE TABLE t1 (d DATE <CUSTOM_COL_OPTIONS>, +dt DATETIME <CUSTOM_COL_OPTIONS> PRIMARY KEY, +ts TIMESTAMP <CUSTOM_COL_OPTIONS>, +t TIME <CUSTOM_COL_OPTIONS>, +y YEAR <CUSTOM_COL_OPTIONS> +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 0 PRIMARY 1 dt # # NULL NULL # # +SET @tm = '2012-04-09 05:27:00'; +INSERT INTO t1 (d,dt,ts,t,y) VALUES +('2012-01-12', '2010-11-22 12:33:54', '2011-11-14 21:45:55', '00:12:33', '2000'), +('2012-01-12', '2010-11-22 11:43:14', '2011-11-14 21:45:55', '00:12:32', '2001'), +('2012-03-31', '2011-08-28 21:33:56', '1999-04-30 19:11:08', '12:00:00', '1999'), +('2012-03-13', '2011-08-27 21:33:56', '1999-03-30 19:11:08', '12:10:00', '1998'), +('2011-03-31', '2011-08-28 20:33:56', '1997-01-31 11:54:01', '22:04:10', '1994'), +(DATE(@tm),@tm,TIMESTAMP(@tm),TIME(@tm),YEAR(@tm)); +EXPLAIN SELECT dt FROM t1 ORDER BY dt LIMIT 3; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # PRIMARY # # # # +SELECT dt FROM t1 ORDER BY dt LIMIT 3; +dt +2010-11-22 11:43:14 +2010-11-22 12:33:54 +2011-08-27 21:33:56 +EXPLAIN SELECT dt FROM t1 FORCE INDEX FOR ORDER BY (PRIMARY) ORDER BY dt LIMIT 3; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # PRIMARY # # # # +SELECT dt FROM t1 FORCE INDEX FOR ORDER BY (PRIMARY) ORDER BY dt LIMIT 3; +dt +2010-11-22 11:43:14 +2010-11-22 12:33:54 +2011-08-27 21:33:56 +INSERT INTO t1 (d,dt,ts,t,y) VALUES +('2012-01-11', '2010-11-22 12:33:54', '2011-11-14 21:45:55', '00:12:33', '2000'); +ERROR 23000: Duplicate entry '2010-11-22 12:33:54' for key 'PRIMARY' +# Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY). +# If you got a difference in error message, just add it to rdiff file +DROP TABLE t1; +CREATE TABLE t1 (d DATE <CUSTOM_COL_OPTIONS>, +dt DATETIME <CUSTOM_COL_OPTIONS>, +ts TIMESTAMP <CUSTOM_COL_OPTIONS>, +t TIME <CUSTOM_COL_OPTIONS>, +y YEAR <CUSTOM_COL_OPTIONS>, +INDEX (ts) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 ts 1 ts # # NULL NULL # # +SET @tm = '2012-04-09 05:27:00'; +INSERT INTO t1 (d,dt,ts,t,y) VALUES +('2012-01-12', '2010-11-22 12:33:54', '2011-11-14 21:45:55', '00:12:33', '2000'), +('2012-01-12', '2010-11-22 11:43:14', '2011-11-14 21:45:55', '00:12:32', '2001'), +('2012-03-31', '2011-08-28 21:33:56', '1999-04-30 19:11:08', '12:00:00', '1999'), +('2012-03-13', '2011-08-27 21:33:56', '1999-03-30 19:11:08', '12:10:00', '1998'), +('2011-03-31', '2011-08-28 20:33:56', '1997-01-31 11:54:01', '22:04:10', '1994'), +(DATE(@tm),@tm,TIMESTAMP(@tm),TIME(@tm),YEAR(@tm)); +EXPLAIN SELECT ts FROM t1 WHERE ts > NOW(); +id select_type table type possible_keys key key_len ref rows Extra +# # # # # ts # # # # +SELECT ts FROM t1 WHERE ts > NOW(); +ts +EXPLAIN SELECT ts FROM t1 USE INDEX () WHERE ts > NOW(); +id select_type table type possible_keys key key_len ref rows Extra +# # # # # NULL # # # # +SELECT ts FROM t1 USE INDEX () WHERE ts > NOW(); +ts +DROP TABLE t1; +CREATE TABLE t1 (d DATE <CUSTOM_COL_OPTIONS>, +dt DATETIME <CUSTOM_COL_OPTIONS>, +ts TIMESTAMP <CUSTOM_COL_OPTIONS>, +t TIME <CUSTOM_COL_OPTIONS>, +y YEAR <CUSTOM_COL_OPTIONS>, +UNIQUE INDEX d_t (d,t) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 0 d_t 1 d # # NULL NULL # # +t1 0 d_t 2 t # # NULL NULL # # +SET @tm = '2012-04-09 05:27:00'; +INSERT INTO t1 (d,dt,ts,t,y) VALUES +('2012-01-12', '2010-11-22 12:33:54', '2011-11-14 21:45:55', '00:12:33', '2000'), +('2012-01-12', '2010-11-22 11:43:14', '2011-11-14 21:45:55', '00:12:32', '2001'), +('2012-03-31', '2011-08-28 21:33:56', '1999-04-30 19:11:08', '12:00:00', '1999'), +('2012-03-13', '2011-08-27 21:33:56', '1999-03-30 19:11:08', '12:10:00', '1998'), +('2011-03-31', '2011-08-28 20:33:56', '1997-01-31 11:54:01', '22:04:10', '1994'), +(DATE(@tm),@tm,TIMESTAMP(@tm),TIME(@tm),YEAR(@tm)); +EXPLAIN SELECT d, t FROM t1 WHERE CONCAT(d,' ',t) != CURRENT_DATE(); +id select_type table type possible_keys key key_len ref rows Extra +# # # # # d_t # # # # +SELECT d, t FROM t1 WHERE CONCAT(d,' ',t) != CURRENT_DATE(); +d t +2011-03-31 22:04:10 +2012-01-12 00:12:32 +2012-01-12 00:12:33 +2012-03-13 12:10:00 +2012-03-31 12:00:00 +2012-04-09 05:27:00 +EXPLAIN SELECT d, t FROM t1 IGNORE INDEX (d_t) WHERE CONCAT(d,' ',t) != CURRENT_DATE(); +id select_type table type possible_keys key key_len ref rows Extra +# # # # # NULL # # # # +SELECT d, t FROM t1 IGNORE INDEX (d_t) WHERE CONCAT(d,' ',t) != CURRENT_DATE(); +d t +2011-03-31 22:04:10 +2012-01-12 00:12:32 +2012-01-12 00:12:33 +2012-03-13 12:10:00 +2012-03-31 12:00:00 +2012-04-09 05:27:00 +INSERT INTO t1 (d,dt,ts,t,y) VALUES +('2012-01-12', '2010-11-22 12:33:53', '2011-11-14 21:45:55', '00:12:33', '2000'); +ERROR 23000: Duplicate entry '2012-01-12-00:12:33' for key 'd_t' +# Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY). +# If you got a difference in error message, just add it to rdiff file +DROP TABLE t1; +CREATE TABLE t1 (d DATE <CUSTOM_COL_OPTIONS>, +dt DATETIME <CUSTOM_COL_OPTIONS>, +ts TIMESTAMP <CUSTOM_COL_OPTIONS>, +t TIME <CUSTOM_COL_OPTIONS>, +y YEAR <CUSTOM_COL_OPTIONS>, +INDEX (y,t) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 y 1 y # # NULL NULL # # +t1 1 y 2 t # # NULL NULL # # +SET @tm = '2012-04-09 05:27:00'; +INSERT INTO t1 (d,dt,ts,t,y) VALUES +('2012-01-12', '2010-11-22 12:33:54', '2011-11-14 21:45:55', '00:12:33', '2000'), +('2012-01-12', '2010-11-22 11:43:14', '2011-11-14 21:45:55', '00:12:32', '2001'), +('2012-03-31', '2011-08-28 21:33:56', '1999-04-30 19:11:08', '12:00:00', '1999'), +('2012-03-13', '2011-08-27 21:33:56', '1999-03-30 19:11:08', '12:10:00', '1998'), +('2011-03-31', '2011-08-28 20:33:56', '1997-01-31 11:54:01', '22:04:10', '1994'), +(DATE(@tm),@tm,TIMESTAMP(@tm),TIME(@tm),YEAR(@tm)); +EXPLAIN SELECT y, COUNT(*) FROM t1 GROUP BY y; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # y # # # # +SELECT y, COUNT(*) FROM t1 GROUP BY y; +y COUNT(*) +1994 1 +1998 1 +1999 1 +2000 1 +2001 1 +2012 1 +EXPLAIN SELECT y, COUNT(*) FROM t1 USE INDEX FOR GROUP BY () GROUP BY y; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # y # # # # +SELECT y, COUNT(*) FROM t1 USE INDEX FOR GROUP BY () GROUP BY y; +y COUNT(*) +1994 1 +1998 1 +1999 1 +2000 1 +2001 1 +2012 1 +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/type_date_time_indexes.test b/mysql-test/suite/storage_engine/type_date_time_indexes.test new file mode 100644 index 00000000000..bb06432f079 --- /dev/null +++ b/mysql-test/suite/storage_engine/type_date_time_indexes.test @@ -0,0 +1,366 @@ +# +# Date and time columns with indexes +# (DATE, DATETIME, TIMESTAMP, TIME, YEAR) +# + +--source have_engine.inc +--source have_default_index.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + + +# Default index as set in define_engine.inc + +let $create_definition = + d DATE $col_indexed_opts, + dt DATETIME $col_opts, + ts TIMESTAMP $col_opts, + t TIME $col_opts, + y YEAR $col_opts, + $default_index d (d) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Date and time types or indexes + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 3 # 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + SET @tm = '2012-04-09 05:27:00'; + + INSERT INTO t1 (d,dt,ts,t,y) VALUES + ('2012-01-12', '2010-11-22 12:33:54', '2011-11-14 21:45:55', '00:12:33', '2000'), + ('2012-01-22', '2010-11-22 11:43:14', '2011-11-14 21:45:55', '00:12:32', '2001'), + ('2012-03-31', '2011-08-28 21:33:56', '1999-04-30 19:11:08', '12:00:00', '1999'), + ('2012-03-13', '2011-08-27 21:33:56', '1999-03-30 19:11:08', '12:10:00', '1998'), + ('2011-03-31', '2011-08-28 20:33:56', '1997-01-31 11:54:01', '22:04:10', '1994'), + (DATE(@tm),@tm,TIMESTAMP(@tm),TIME(@tm),YEAR(@tm)); + + SELECT d FROM t1 ORDER BY d LIMIT 3; + + DROP TABLE t1; +} + +let $create_definition = + d DATE $col_opts, + dt DATETIME $col_indexed_opts, + ts TIMESTAMP $col_opts, + t TIME $col_opts, + y YEAR $col_opts, + $default_index dt (dt) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Date and time types or indexes + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 3 # 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + SET @tm = '2012-04-09 05:27:00'; + + INSERT INTO t1 (d,dt,ts,t,y) VALUES + ('2012-01-12', '2010-11-22 12:33:54', '2011-11-14 21:45:55', '00:12:33', '2000'), + ('2012-01-12', '2010-11-22 11:43:14', '2011-11-14 21:45:55', '00:12:32', '2001'), + ('2012-03-31', '2011-08-28 21:33:56', '1999-04-30 19:11:08', '12:00:00', '1999'), + ('2012-03-13', '2011-08-27 21:33:56', '1999-03-30 19:11:08', '12:10:00', '1998'), + ('2011-03-31', '2011-08-28 20:33:56', '1997-01-31 11:54:01', '22:04:10', '1994'), + (DATE(@tm),@tm,TIMESTAMP(@tm),TIME(@tm),YEAR(@tm)); + + SELECT dt FROM t1 ORDER BY dt LIMIT 3; + + DROP TABLE t1; +} + +let $create_definition = + d DATE $col_opts, + dt DATETIME $col_opts, + ts TIMESTAMP $col_indexed_opts, + t TIME $col_opts, + y YEAR $col_opts, + $default_index ts (ts) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Date and time types or indexes + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 3 # 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + SET @tm = '2012-04-09 05:27:00'; + + INSERT INTO t1 (d,dt,ts,t,y) VALUES + ('2012-01-12', '2010-11-22 12:33:54', '2011-11-14 21:45:25', '00:12:33', '2000'), + ('2012-01-12', '2010-11-22 11:43:14', '2011-11-14 21:45:55', '00:12:32', '2001'), + ('2012-03-31', '2011-08-28 21:33:56', '1999-04-30 19:11:08', '12:00:00', '1999'), + ('2012-03-13', '2011-08-27 21:33:56', '1999-03-30 19:11:08', '12:10:00', '1998'), + ('2011-03-31', '2011-08-28 20:33:56', '1997-01-31 11:54:01', '22:04:10', '1994'), + (DATE(@tm),@tm,TIMESTAMP(@tm),TIME(@tm),YEAR(@tm)); + + SELECT ts FROM t1 ORDER BY ts LIMIT 3; + + DROP TABLE t1; +} + +let $create_definition = + d DATE $col_opts, + dt DATETIME $col_opts, + ts TIMESTAMP $col_opts, + t TIME $col_indexed_opts, + y YEAR $col_opts, + $default_index t (t) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Date and time types or indexes + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 3 # 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + SET @tm = '2012-04-09 05:27:00'; + + INSERT INTO t1 (d,dt,ts,t,y) VALUES + ('2012-01-12', '2010-11-22 12:33:54', '2011-11-14 21:45:25', '00:12:33', '2000'), + ('2012-01-12', '2010-11-22 11:43:14', '2011-11-14 21:45:55', '00:12:32', '2001'), + ('2012-03-31', '2011-08-28 21:33:56', '1999-04-30 19:11:08', '12:00:00', '1999'), + ('2012-03-13', '2011-08-27 21:33:56', '1999-03-30 19:11:08', '12:10:00', '1998'), + ('2011-03-31', '2011-08-28 20:33:56', '1997-01-31 11:54:01', '22:04:10', '1994'), + (DATE(@tm),@tm,TIMESTAMP(@tm),TIME(@tm),YEAR(@tm)); + + SELECT t FROM t1 ORDER BY t LIMIT 3; + + DROP TABLE t1; +} + +let $create_definition = + d DATE $col_opts, + dt DATETIME $col_opts, + ts TIMESTAMP $col_opts, + t TIME $col_opts, + y YEAR $col_indexed_opts, + $default_index y (y) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Date and time types or indexes + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 3 # 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + SET @tm = '2012-04-09 05:27:00'; + + INSERT INTO t1 (d,dt,ts,t,y) VALUES + ('2012-01-12', '2010-11-22 12:33:54', '2011-11-14 21:45:25', '00:12:33', '2000'), + ('2012-01-12', '2010-11-22 11:43:14', '2011-11-14 21:45:55', '00:12:32', '2001'), + ('2012-03-31', '2011-08-28 21:33:56', '1999-04-30 19:11:08', '12:00:00', '1999'), + ('2012-03-13', '2011-08-27 21:33:56', '1999-03-30 19:11:08', '12:10:00', '1998'), + ('2011-03-31', '2011-08-28 20:33:56', '1997-01-31 11:54:01', '22:04:10', '1994'), + (DATE(@tm),@tm,TIMESTAMP(@tm),TIME(@tm),YEAR(@tm)); + + SELECT y FROM t1 ORDER BY y LIMIT 3; + + DROP TABLE t1; +} + + +# PK, UNIQUE INDEX, INDEX + + +let $create_definition = + d DATE $col_opts, + dt DATETIME $col_indexed_opts PRIMARY KEY, + ts TIMESTAMP $col_opts, + t TIME $col_opts, + y YEAR $col_opts +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Date and time types or PK + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + SET @tm = '2012-04-09 05:27:00'; + + INSERT INTO t1 (d,dt,ts,t,y) VALUES + ('2012-01-12', '2010-11-22 12:33:54', '2011-11-14 21:45:55', '00:12:33', '2000'), + ('2012-01-12', '2010-11-22 11:43:14', '2011-11-14 21:45:55', '00:12:32', '2001'), + ('2012-03-31', '2011-08-28 21:33:56', '1999-04-30 19:11:08', '12:00:00', '1999'), + ('2012-03-13', '2011-08-27 21:33:56', '1999-03-30 19:11:08', '12:10:00', '1998'), + ('2011-03-31', '2011-08-28 20:33:56', '1997-01-31 11:54:01', '22:04:10', '1994'), + (DATE(@tm),@tm,TIMESTAMP(@tm),TIME(@tm),YEAR(@tm)); + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT dt FROM t1 ORDER BY dt LIMIT 3; + SELECT dt FROM t1 ORDER BY dt LIMIT 3; + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT dt FROM t1 FORCE INDEX FOR ORDER BY (PRIMARY) ORDER BY dt LIMIT 3; + SELECT dt FROM t1 FORCE INDEX FOR ORDER BY (PRIMARY) ORDER BY dt LIMIT 3; + + --let $error_codes = ER_DUP_ENTRY,ER_DUP_KEY + INSERT INTO t1 (d,dt,ts,t,y) VALUES + ('2012-01-11', '2010-11-22 12:33:54', '2011-11-14 21:45:55', '00:12:33', '2000'); + --source check_errors.inc + + DROP TABLE t1; +} + +let $create_definition = + d DATE $col_opts, + dt DATETIME $col_opts, + ts TIMESTAMP $col_indexed_opts, + t TIME $col_opts, + y YEAR $col_opts, + INDEX (ts) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Date and time types or non-unique keys + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + SET @tm = '2012-04-09 05:27:00'; + + INSERT INTO t1 (d,dt,ts,t,y) VALUES + ('2012-01-12', '2010-11-22 12:33:54', '2011-11-14 21:45:55', '00:12:33', '2000'), + ('2012-01-12', '2010-11-22 11:43:14', '2011-11-14 21:45:55', '00:12:32', '2001'), + ('2012-03-31', '2011-08-28 21:33:56', '1999-04-30 19:11:08', '12:00:00', '1999'), + ('2012-03-13', '2011-08-27 21:33:56', '1999-03-30 19:11:08', '12:10:00', '1998'), + ('2011-03-31', '2011-08-28 20:33:56', '1997-01-31 11:54:01', '22:04:10', '1994'), + (DATE(@tm),@tm,TIMESTAMP(@tm),TIME(@tm),YEAR(@tm)); + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT ts FROM t1 WHERE ts > NOW(); + --sorted_result + SELECT ts FROM t1 WHERE ts > NOW(); + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT ts FROM t1 USE INDEX () WHERE ts > NOW(); + --sorted_result + SELECT ts FROM t1 USE INDEX () WHERE ts > NOW(); + + DROP TABLE t1; +} + +let $create_definition = + d DATE $col_indexed_opts, + dt DATETIME $col_opts, + ts TIMESTAMP $col_opts, + t TIME $col_indexed_opts, + y YEAR $col_opts, + UNIQUE INDEX d_t (d,t) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Date and time types or unique keys or multi-part keys + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + SET @tm = '2012-04-09 05:27:00'; + + INSERT INTO t1 (d,dt,ts,t,y) VALUES + ('2012-01-12', '2010-11-22 12:33:54', '2011-11-14 21:45:55', '00:12:33', '2000'), + ('2012-01-12', '2010-11-22 11:43:14', '2011-11-14 21:45:55', '00:12:32', '2001'), + ('2012-03-31', '2011-08-28 21:33:56', '1999-04-30 19:11:08', '12:00:00', '1999'), + ('2012-03-13', '2011-08-27 21:33:56', '1999-03-30 19:11:08', '12:10:00', '1998'), + ('2011-03-31', '2011-08-28 20:33:56', '1997-01-31 11:54:01', '22:04:10', '1994'), + (DATE(@tm),@tm,TIMESTAMP(@tm),TIME(@tm),YEAR(@tm)); + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT d, t FROM t1 WHERE CONCAT(d,' ',t) != CURRENT_DATE(); + --sorted_result + SELECT d, t FROM t1 WHERE CONCAT(d,' ',t) != CURRENT_DATE(); + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT d, t FROM t1 IGNORE INDEX (d_t) WHERE CONCAT(d,' ',t) != CURRENT_DATE(); + --sorted_result + SELECT d, t FROM t1 IGNORE INDEX (d_t) WHERE CONCAT(d,' ',t) != CURRENT_DATE(); + + --let $error_codes = ER_DUP_ENTRY,ER_DUP_KEY + INSERT INTO t1 (d,dt,ts,t,y) VALUES + ('2012-01-12', '2010-11-22 12:33:53', '2011-11-14 21:45:55', '00:12:33', '2000'); + --source check_errors.inc + + DROP TABLE t1; +} + +let $create_definition = + d DATE $col_opts, + dt DATETIME $col_opts, + ts TIMESTAMP $col_opts, + t TIME $col_indexed_opts, + y YEAR $col_indexed_opts, + INDEX (y,t) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Date and time types or non-unique keys or multi-part keys + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + SET @tm = '2012-04-09 05:27:00'; + + INSERT INTO t1 (d,dt,ts,t,y) VALUES + ('2012-01-12', '2010-11-22 12:33:54', '2011-11-14 21:45:55', '00:12:33', '2000'), + ('2012-01-12', '2010-11-22 11:43:14', '2011-11-14 21:45:55', '00:12:32', '2001'), + ('2012-03-31', '2011-08-28 21:33:56', '1999-04-30 19:11:08', '12:00:00', '1999'), + ('2012-03-13', '2011-08-27 21:33:56', '1999-03-30 19:11:08', '12:10:00', '1998'), + ('2011-03-31', '2011-08-28 20:33:56', '1997-01-31 11:54:01', '22:04:10', '1994'), + (DATE(@tm),@tm,TIMESTAMP(@tm),TIME(@tm),YEAR(@tm)); + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT y, COUNT(*) FROM t1 GROUP BY y; + --sorted_result + SELECT y, COUNT(*) FROM t1 GROUP BY y; + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT y, COUNT(*) FROM t1 USE INDEX FOR GROUP BY () GROUP BY y; + --sorted_result + SELECT y, COUNT(*) FROM t1 USE INDEX FOR GROUP BY () GROUP BY y; + + DROP TABLE t1; +} + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/type_enum.inc b/mysql-test/suite/storage_engine/type_enum.inc new file mode 100644 index 00000000000..6b9b83fc52e --- /dev/null +++ b/mysql-test/suite/storage_engine/type_enum.inc @@ -0,0 +1,69 @@ +# +# ENUM column type +# + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +# Valid values. +# We cannot test the maximum of 65,536 here, +# because mysqltest has the standard limit of MAX_QUERY=256K; +# but we can at least try 257 + +let $create_definition = + a ENUM('') $col_opts, + b ENUM('test1','test2','test3','test4','test5') $col_opts, + c ENUM('1','2','3','4','5','6','7','8','9','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',' ','11','12','13','14','15','16','17','18','19','1a','1b','1c','1d','1e','1f','1g','1h','1i','1j','1k','1l','1m','1n','1o','1p','1q','1r','1s','1t','1u','1v','1w','1x','1y','1z','20','21','22','23','24','25','26','27','28','29','2a','2b','2c','2d','2e','2f','2g','2h','2i','2j','2k','2l','2m','2n','2o','2p','2q','2r','2s','2t','2u','2v','2w','2x','2y','2z','30','31','32','33','34','35','36','37','38','39','3a','3b','3c','3d','3e','3f','3g','3h','3i','3j','3k','3l','3m','3n','3o','3p','3q','3r','3s','3t','3u','3v','3w','3x','3y','3z','40','41','42','43','44','45','46','47','48','49','4a','4b','4c','4d','4e','4f','4g','4h','4i','4j','4k','4l','4m','4n','4o','4p','4q','4r','4s','4t','4u','4v','4w','4x','4y','4z','50','51','52','53','54','55','56','57','58','59','5a','5b','5c','5d','5e','5f','5g','5h','5i','5j','5k','5l','5m','5n','5o','5p','5q','5r','5s','5t','5u','5v','5w','5x','5y','5z','60','61','62','63','64','65','66','67','68','69','6a','6b','6c','6d','6e','6f','6g','6h','6i','6j','6k','6l','6m','6n','6o','6p','6q','6r','6s','6t','6u','6v','6w','6x','6y','6z','70','71','72','73','74','75') $col_opts +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = ENUM type + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 3 # 4 # 5 # + SHOW COLUMNS IN t1; + + INSERT INTO t1 VALUES ('','test2','4'),('',5,2); + --sorted_result + SELECT * FROM t1; + + # Out of range values + # (should produce warnings) + + INSERT INTO t1 VALUES (0,'test6',-1); + --sorted_result + SELECT * FROM t1; + + # Non-unique values in enum + # (should produce a warning) + --let $alter_definition = ADD COLUMN e ENUM('a','A') $col_opts + --source alter_table.inc + if ($mysql_errname) + { + --let $my_last_stmt = $alter_statement + --let $functionality = ALTER TABLE + --source unexpected_result.inc + } + + --replace_column 3 # 4 # 5 # + SHOW COLUMNS IN t1; + + INSERT INTO t1 VALUES ('','test3','75','A'); + --sorted_result + SELECT * FROM t1; + + # Simple comparison + + --sorted_result + SELECT * FROM t1 WHERE b='test2' OR a != ''; + + DROP TABLE t1; +} + + + diff --git a/mysql-test/suite/storage_engine/type_enum.result b/mysql-test/suite/storage_engine/type_enum.result new file mode 100644 index 00000000000..920aa5c7807 --- /dev/null +++ b/mysql-test/suite/storage_engine/type_enum.result @@ -0,0 +1,46 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a ENUM('') <CUSTOM_COL_OPTIONS>, +b ENUM('test1','test2','test3','test4','test5') <CUSTOM_COL_OPTIONS>, +c ENUM('1','2','3','4','5','6','7','8','9','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',' ','11','12','13','14','15','16','17','18','19','1a','1b','1c','1d','1e','1f','1g','1h','1i','1j','1k','1l','1m','1n','1o','1p','1q','1r','1s','1t','1u','1v','1w','1x','1y','1z','20','21','22','23','24','25','26','27','28','29','2a','2b','2c','2d','2e','2f','2g','2h','2i','2j','2k','2l','2m','2n','2o','2p','2q','2r','2s','2t','2u','2v','2w','2x','2y','2z','30','31','32','33','34','35','36','37','38','39','3a','3b','3c','3d','3e','3f','3g','3h','3i','3j','3k','3l','3m','3n','3o','3p','3q','3r','3s','3t','3u','3v','3w','3x','3y','3z','40','41','42','43','44','45','46','47','48','49','4a','4b','4c','4d','4e','4f','4g','4h','4i','4j','4k','4l','4m','4n','4o','4p','4q','4r','4s','4t','4u','4v','4w','4x','4y','4z','50','51','52','53','54','55','56','57','58','59','5a','5b','5c','5d','5e','5f','5g','5h','5i','5j','5k','5l','5m','5n','5o','5p','5q','5r','5s','5t','5u','5v','5w','5x','5y','5z','60','61','62','63','64','65','66','67','68','69','6a','6b','6c','6d','6e','6f','6g','6h','6i','6j','6k','6l','6m','6n','6o','6p','6q','6r','6s','6t','6u','6v','6w','6x','6y','6z','70','71','72','73','74','75') <CUSTOM_COL_OPTIONS> +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +a enum('') # # # +b enum('test1','test2','test3','test4','test5') # # # +c enum('1','2','3','4','5','6','7','8','9','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','','11','12','13','14','15','16','17','18','19','1a','1b','1c','1d','1e','1f','1g','1h','1i','1j','1k','1l','1m','1n','1o','1p','1q','1r','1s','1t','1u','1v','1w','1x','1y','1z','20','21','22','23','24','25','26','27','28','29','2a','2b','2c','2d','2e','2f','2g','2h','2i','2j','2k','2l','2m','2n','2o','2p','2q','2r','2s','2t','2u','2v','2w','2x','2y','2z','30','31','32','33','34','35','36','37','38','39','3a','3b','3c','3d','3e','3f','3g','3h','3i','3j','3k','3l','3m','3n','3o','3p','3q','3r','3s','3t','3u','3v','3w','3x','3y','3z','40','41','42','43','44','45','46','47','48','49','4a','4b','4c','4d','4e','4f','4g','4h','4i','4j','4k','4l','4m','4n','4o','4p','4q','4r','4s','4t','4u','4v','4w','4x','4y','4z','50','51','52','53','54','55','56','57','58','59','5a','5b','5c','5d','5e','5f','5g','5h','5i','5j','5k','5l','5m','5n','5o','5p','5q','5r','5s','5t','5u','5v','5w','5x','5y','5z','60','61','62','63','64','65','66','67','68','69','6a','6b','6c','6d','6e','6f','6g','6h','6i','6j','6k','6l','6m','6n','6o','6p','6q','6r','6s','6t','6u','6v','6w','6x','6y','6z','70','71','72','73','74','75') # # # +INSERT INTO t1 VALUES ('','test2','4'),('',5,2); +SELECT * FROM t1; +a b c + test2 4 + test5 2 +INSERT INTO t1 VALUES (0,'test6',-1); +Warnings: +Warning 1265 Data truncated for column 'a' at row 1 +Warning 1265 Data truncated for column 'b' at row 1 +Warning 1265 Data truncated for column 'c' at row 1 +SELECT * FROM t1; +a b c + + test2 4 + test5 2 +ALTER TABLE t1 ADD COLUMN e ENUM('a','A') <CUSTOM_COL_OPTIONS>; +Warnings: +Note 1291 Column 'e' has duplicated value 'a' in ENUM +Note 1291 Column 'e' has duplicated value 'a' in ENUM +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +a enum('') # # # +b enum('test1','test2','test3','test4','test5') # # # +c enum('1','2','3','4','5','6','7','8','9','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','','11','12','13','14','15','16','17','18','19','1a','1b','1c','1d','1e','1f','1g','1h','1i','1j','1k','1l','1m','1n','1o','1p','1q','1r','1s','1t','1u','1v','1w','1x','1y','1z','20','21','22','23','24','25','26','27','28','29','2a','2b','2c','2d','2e','2f','2g','2h','2i','2j','2k','2l','2m','2n','2o','2p','2q','2r','2s','2t','2u','2v','2w','2x','2y','2z','30','31','32','33','34','35','36','37','38','39','3a','3b','3c','3d','3e','3f','3g','3h','3i','3j','3k','3l','3m','3n','3o','3p','3q','3r','3s','3t','3u','3v','3w','3x','3y','3z','40','41','42','43','44','45','46','47','48','49','4a','4b','4c','4d','4e','4f','4g','4h','4i','4j','4k','4l','4m','4n','4o','4p','4q','4r','4s','4t','4u','4v','4w','4x','4y','4z','50','51','52','53','54','55','56','57','58','59','5a','5b','5c','5d','5e','5f','5g','5h','5i','5j','5k','5l','5m','5n','5o','5p','5q','5r','5s','5t','5u','5v','5w','5x','5y','5z','60','61','62','63','64','65','66','67','68','69','6a','6b','6c','6d','6e','6f','6g','6h','6i','6j','6k','6l','6m','6n','6o','6p','6q','6r','6s','6t','6u','6v','6w','6x','6y','6z','70','71','72','73','74','75') # # # +e enum('a','A') # # # +INSERT INTO t1 VALUES ('','test3','75','A'); +SELECT * FROM t1; +a b c e + NULL + test2 4 NULL + test3 75 a + test5 2 NULL +SELECT * FROM t1 WHERE b='test2' OR a != ''; +a b c e + test2 4 NULL +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/type_enum.test b/mysql-test/suite/storage_engine/type_enum.test new file mode 100644 index 00000000000..3476e8a0e9f --- /dev/null +++ b/mysql-test/suite/storage_engine/type_enum.test @@ -0,0 +1,10 @@ +# +# ENUM column type +# + +--source have_engine.inc + +--source type_enum.inc + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/type_enum_indexes.result b/mysql-test/suite/storage_engine/type_enum_indexes.result new file mode 100644 index 00000000000..f8af1aed103 --- /dev/null +++ b/mysql-test/suite/storage_engine/type_enum_indexes.result @@ -0,0 +1,108 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a ENUM('N.America','S.America','Africa','Europe','Australia','Asia','Antarctica') <CUSTOM_COL_OPTIONS>, +b ENUM('test1','test2','test3','test4','test5') <CUSTOM_COL_OPTIONS>, +c ENUM('1a','1b','1d','1j','4a','4z','5a','5b','6v','6z') <CUSTOM_COL_OPTIONS>, +<CUSTOM_INDEX> a (a) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b,c) VALUES +('N.America','test1','5a'),('Europe','test1','5b'),('Europe','test2','6v'), +('Africa','test3','4z'),('Africa','test4','1j'),('Antarctica','test4','1d'); +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 # 1 a # # NULL NULL # # +SELECT a FROM t1 WHERE b > 'test2' ORDER BY a; +a +Africa +Africa +Antarctica +DROP TABLE t1; +CREATE TABLE t1 (a ENUM('N.America','S.America','Africa','Europe','Australia','Asia','Antarctica') <CUSTOM_COL_OPTIONS>, +b ENUM('test1','test2','test3','test4','test5') <CUSTOM_COL_OPTIONS>, +c ENUM('1a','1b','1d','1j','4a','4z','5a','5b','6v','6z') <CUSTOM_COL_OPTIONS>, +UNIQUE KEY a_b (a,b) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b,c) VALUES +('N.America','test1','5a'),('Europe','test1','5b'),('Europe','test2','6v'), +('Africa','test3','4z'),('Africa','test4','1j'),('Antarctica','test4','1d'); +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 0 a_b 1 a # # NULL NULL # # +t1 0 a_b 2 b # # NULL NULL # # +EXPLAIN SELECT a FROM t1 WHERE b > 'test2' ORDER BY a; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # a_b # # # # +SELECT a FROM t1 WHERE b > 'test2' ORDER BY a; +a +Africa +Africa +Antarctica +EXPLAIN SELECT a FROM t1 FORCE INDEX (a_b) WHERE b > 'test2' ORDER BY a; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # a_b # # # # +SELECT a FROM t1 FORCE INDEX (a_b) WHERE b > 'test2' ORDER BY a; +a +Africa +Africa +Antarctica +DROP TABLE t1; +CREATE TABLE t1 (a ENUM('N.America','S.America','Africa','Europe','Australia','Asia','Antarctica') <CUSTOM_COL_OPTIONS>, +b ENUM('test1','test2','test3','test4','test5') <CUSTOM_COL_OPTIONS>, +c ENUM('1a','1b','1d','1j','4a','4z','5a','5b','6v','6z') <CUSTOM_COL_OPTIONS> PRIMARY KEY +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b,c) VALUES +('N.America','test1','5a'),('Europe','test1','5b'),('Europe','test2','6v'), +('Africa','test3','4z'),('Africa','test4','1j'),('Antarctica','test4','1d'); +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 0 PRIMARY 1 c # # NULL NULL # # +EXPLAIN SELECT c FROM t1 WHERE c BETWEEN '1d' AND '6u'; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # PRIMARY # # # # +SELECT c FROM t1 WHERE c BETWEEN '1d' AND '6u'; +c +1d +1j +4z +5a +5b +EXPLAIN SELECT c FROM t1 USE INDEX () WHERE c BETWEEN '1d' AND '6u'; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # NULL # # # # +SELECT c FROM t1 USE INDEX () WHERE c BETWEEN '1d' AND '6u'; +c +1d +1j +4z +5a +5b +DROP TABLE t1; +CREATE TABLE t1 (a ENUM('N.America','S.America','Africa','Europe','Australia','Asia','Antarctica') <CUSTOM_COL_OPTIONS>, +b ENUM('test1','test2','test3','test4','test5') <CUSTOM_COL_OPTIONS>, +c ENUM('1a','1b','1d','1j','4a','4z','5a','5b','6v','6z') <CUSTOM_COL_OPTIONS>, +INDEX(b) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b,c) VALUES +('N.America','test1','5a'),('Europe','test1','5b'),('Europe','test2','6v'), +('Africa','test3','4z'),('Africa','test4','1j'),('Antarctica','test4','1d'); +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 b 1 b # # NULL NULL # # +EXPLAIN SELECT DISTINCT b FROM t1; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # b # # # # +SELECT DISTINCT b FROM t1; +b +test1 +test2 +test3 +test4 +EXPLAIN SELECT DISTINCT b FROM t1 IGNORE INDEX (b); +id select_type table type possible_keys key key_len ref rows Extra +# # # # # NULL # # # # +SELECT DISTINCT b FROM t1 IGNORE INDEX (b); +b +test1 +test2 +test3 +test4 +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/type_enum_indexes.test b/mysql-test/suite/storage_engine/type_enum_indexes.test new file mode 100644 index 00000000000..ba20197c3a9 --- /dev/null +++ b/mysql-test/suite/storage_engine/type_enum_indexes.test @@ -0,0 +1,146 @@ +# +# ENUM columns with indexes +# + +--source have_engine.inc +--source have_default_index.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +# Default index as set in define_engine.inc + +let $create_definition = + a ENUM('N.America','S.America','Africa','Europe','Australia','Asia','Antarctica') $col_indexed_opts, + b ENUM('test1','test2','test3','test4','test5') $col_opts, + c ENUM('1a','1b','1d','1j','4a','4z','5a','5b','6v','6z') $col_opts, + $default_index a (a) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = ENUM types or indexes + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + INSERT INTO t1 (a,b,c) VALUES + ('N.America','test1','5a'),('Europe','test1','5b'),('Europe','test2','6v'), + ('Africa','test3','4z'),('Africa','test4','1j'),('Antarctica','test4','1d'); + + --replace_column 3 # 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + SELECT a FROM t1 WHERE b > 'test2' ORDER BY a; + DROP TABLE t1; +} + + +# PK, UNIQUE INDEX, INDEX + +let $create_definition = + a ENUM('N.America','S.America','Africa','Europe','Australia','Asia','Antarctica') $col_indexed_opts, + b ENUM('test1','test2','test3','test4','test5') $col_indexed_opts, + c ENUM('1a','1b','1d','1j','4a','4z','5a','5b','6v','6z') $col_opts, + UNIQUE KEY a_b (a,b) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = ENUM types or unique keys or multi-part keys + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + INSERT INTO t1 (a,b,c) VALUES + ('N.America','test1','5a'),('Europe','test1','5b'),('Europe','test2','6v'), + ('Africa','test3','4z'),('Africa','test4','1j'),('Antarctica','test4','1d'); + + --replace_column 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT a FROM t1 WHERE b > 'test2' ORDER BY a; + SELECT a FROM t1 WHERE b > 'test2' ORDER BY a; + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT a FROM t1 FORCE INDEX (a_b) WHERE b > 'test2' ORDER BY a; + SELECT a FROM t1 FORCE INDEX (a_b) WHERE b > 'test2' ORDER BY a; + + DROP TABLE t1; +} + +let $create_definition = + a ENUM('N.America','S.America','Africa','Europe','Australia','Asia','Antarctica') $col_opts, + b ENUM('test1','test2','test3','test4','test5') $col_opts, + c ENUM('1a','1b','1d','1j','4a','4z','5a','5b','6v','6z') $col_indexed_opts PRIMARY KEY +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = ENUM types or PK + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + INSERT INTO t1 (a,b,c) VALUES + ('N.America','test1','5a'),('Europe','test1','5b'),('Europe','test2','6v'), + ('Africa','test3','4z'),('Africa','test4','1j'),('Antarctica','test4','1d'); + + --replace_column 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT c FROM t1 WHERE c BETWEEN '1d' AND '6u'; + --sorted_result + SELECT c FROM t1 WHERE c BETWEEN '1d' AND '6u'; + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT c FROM t1 USE INDEX () WHERE c BETWEEN '1d' AND '6u'; + --sorted_result + SELECT c FROM t1 USE INDEX () WHERE c BETWEEN '1d' AND '6u'; + + DROP TABLE t1; +} + +let $create_definition = + a ENUM('N.America','S.America','Africa','Europe','Australia','Asia','Antarctica') $col_opts, + b ENUM('test1','test2','test3','test4','test5') $col_indexed_opts, + c ENUM('1a','1b','1d','1j','4a','4z','5a','5b','6v','6z') $col_opts, + INDEX(b) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = ENUM types or non-unique keys + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + INSERT INTO t1 (a,b,c) VALUES + ('N.America','test1','5a'),('Europe','test1','5b'),('Europe','test2','6v'), + ('Africa','test3','4z'),('Africa','test4','1j'),('Antarctica','test4','1d'); + + --replace_column 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT DISTINCT b FROM t1; + --sorted_result + SELECT DISTINCT b FROM t1; + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT DISTINCT b FROM t1 IGNORE INDEX (b); + --sorted_result + SELECT DISTINCT b FROM t1 IGNORE INDEX (b); + + DROP TABLE t1; +} + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/type_fixed.inc b/mysql-test/suite/storage_engine/type_fixed.inc new file mode 100644 index 00000000000..6765fb575bc --- /dev/null +++ b/mysql-test/suite/storage_engine/type_fixed.inc @@ -0,0 +1,89 @@ +# +# Fixed point types +# + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +let $create_definition = + d DECIMAL $col_opts, + d0 DECIMAL(0) $col_opts, + d1_1 DECIMAL(1,1) $col_opts, + d10_2 DECIMAL(10,2) $col_opts, + d60_10 DECIMAL(60,10) $col_opts, + n NUMERIC $col_opts, + n0_0 NUMERIC(0,0) $col_opts, + n1 NUMERIC(1) $col_opts, + n20_4 NUMERIC(20,4) $col_opts, + n65_4 NUMERIC(65,4) $col_opts +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Fixed point types + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 3 # 4 # 5 # + SHOW COLUMNS IN t1; + + # Always valid values + + INSERT INTO t1 VALUES (100,123456,0.3,40000.25,123456789123456789.10001,1024,7000.0,8.0,999999.9,9223372036854775807); + INSERT INTO t1 VALUES (0,0,0,0,0,0,0,0,0,0); + INSERT INTO t1 VALUES (9999999999.0,9999999999.0,0.9,99999999.99,99999999999999999999999999999999999999999999999999.9999999999,9999999999.0,9999999999.0,9.0,9999999999999999.9999,9999999999999999999999999999999999999999999999999999999999999.9999); + + --sorted_result + SELECT * FROM t1; + + # Values which can be valid or not, + # depending on whether columns are SIGNED or UNSIGNED + # (if not valid should produce warnings) + + INSERT INTO t1 VALUES (-100,-123456,-0.3,-40000.25,-123456789123456789.10001,-1024,-7000.0,-8.0,-999999.9,-9223372036854775807); + INSERT INTO t1 VALUES (-9999999999.0,-9999999999.0,-0.9,-99999999.99,-99999999999999999999999999999999999999999999999999.9999999999,-9999999999.0,-9999999999.0,-9.0,-9999999999999999.9999,-9999999999999999999999999999999999999999999999999999999999999.9999); + + --sorted_result + SELECT * FROM t1; + + --sorted_result + SELECT * FROM t1 WHERE n20_4 = 9999999999999999.9999 OR d < 100; + + # Invalid values + + INSERT INTO t1 SELECT n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4 FROM t1 WHERE n65_4 = ( SELECT MAX(n65_4) FROM t1 ); + + --sorted_result + SELECT * FROM t1; + + INSERT INTO t1 VALUES (10000000000.0,10000000000.0,1.1,100000000.99,100000000000000000000000000000000000000000000000000.0,10000000000.0,10000000000.0,10.0,10000000000000000.9999,10000000000000000000000000000000000000000000000000000000000000.9999); + --sorted_result + SELECT * FROM t1; + + INSERT INTO t1 VALUES (9999999999.1,9999999999.1,1.9,99999999.001,99999999999999999999999999999999999999999999999999.99999999991,9999999999.1,9999999999.1,9.1,9999999999999999.00001,9999999999999999999999999999999999999999999999999999999999999.11111); + --sorted_result + SELECT * FROM t1; + + --let $error_codes = ER_TOO_BIG_PRECISION + --let $alter_definition = ADD COLUMN n66 NUMERIC(66) + --source alter_table.inc + if ($mysql_errname != ER_TOO_BIG_PRECISION) + { + --let $my_last_stmt = $alter_statement + --let $functionality = ALTER TABLE + --source unexpected_result.inc + } + + --let $error_codes = ER_TOO_BIG_PRECISION + --let $alter_definition = ADD COLUMN n66_6 DECIMAL(66,6) + --source alter_table.inc + --let $error_codes = ER_TOO_BIG_SCALE + --let $alter_definition = ADD COLUMN n66_66 DECIMAL(66,66) + --source alter_table.inc + + DROP TABLE t1; +} + diff --git a/mysql-test/suite/storage_engine/type_fixed.result b/mysql-test/suite/storage_engine/type_fixed.result new file mode 100644 index 00000000000..2c1566538db --- /dev/null +++ b/mysql-test/suite/storage_engine/type_fixed.result @@ -0,0 +1,116 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (d DECIMAL <CUSTOM_COL_OPTIONS>, +d0 DECIMAL(0) <CUSTOM_COL_OPTIONS>, +d1_1 DECIMAL(1,1) <CUSTOM_COL_OPTIONS>, +d10_2 DECIMAL(10,2) <CUSTOM_COL_OPTIONS>, +d60_10 DECIMAL(60,10) <CUSTOM_COL_OPTIONS>, +n NUMERIC <CUSTOM_COL_OPTIONS>, +n0_0 NUMERIC(0,0) <CUSTOM_COL_OPTIONS>, +n1 NUMERIC(1) <CUSTOM_COL_OPTIONS>, +n20_4 NUMERIC(20,4) <CUSTOM_COL_OPTIONS>, +n65_4 NUMERIC(65,4) <CUSTOM_COL_OPTIONS> +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +d decimal(10,0) # # # +d0 decimal(10,0) # # # +d1_1 decimal(1,1) # # # +d10_2 decimal(10,2) # # # +d60_10 decimal(60,10) # # # +n decimal(10,0) # # # +n0_0 decimal(10,0) # # # +n1 decimal(1,0) # # # +n20_4 decimal(20,4) # # # +n65_4 decimal(65,4) # # # +INSERT INTO t1 VALUES (100,123456,0.3,40000.25,123456789123456789.10001,1024,7000.0,8.0,999999.9,9223372036854775807); +INSERT INTO t1 VALUES (0,0,0,0,0,0,0,0,0,0); +INSERT INTO t1 VALUES (9999999999.0,9999999999.0,0.9,99999999.99,99999999999999999999999999999999999999999999999999.9999999999,9999999999.0,9999999999.0,9.0,9999999999999999.9999,9999999999999999999999999999999999999999999999999999999999999.9999); +SELECT * FROM t1; +d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 +0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 +100 123456 0.3 40000.25 123456789123456789.1000100000 1024 7000 8 999999.9000 9223372036854775807.0000 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +INSERT INTO t1 VALUES (-100,-123456,-0.3,-40000.25,-123456789123456789.10001,-1024,-7000.0,-8.0,-999999.9,-9223372036854775807); +INSERT INTO t1 VALUES (-9999999999.0,-9999999999.0,-0.9,-99999999.99,-99999999999999999999999999999999999999999999999999.9999999999,-9999999999.0,-9999999999.0,-9.0,-9999999999999999.9999,-9999999999999999999999999999999999999999999999999999999999999.9999); +SELECT * FROM t1; +d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 +-100 -123456 -0.3 -40000.25 -123456789123456789.1000100000 -1024 -7000 -8 -999999.9000 -9223372036854775807.0000 +-9999999999 -9999999999 -0.9 -99999999.99 -99999999999999999999999999999999999999999999999999.9999999999 -9999999999 -9999999999 -9 -9999999999999999.9999 -9999999999999999999999999999999999999999999999999999999999999.9999 +0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 +100 123456 0.3 40000.25 123456789123456789.1000100000 1024 7000 8 999999.9000 9223372036854775807.0000 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +SELECT * FROM t1 WHERE n20_4 = 9999999999999999.9999 OR d < 100; +d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 +-100 -123456 -0.3 -40000.25 -123456789123456789.1000100000 -1024 -7000 -8 -999999.9000 -9223372036854775807.0000 +-9999999999 -9999999999 -0.9 -99999999.99 -99999999999999999999999999999999999999999999999999.9999999999 -9999999999 -9999999999 -9 -9999999999999999.9999 -9999999999999999999999999999999999999999999999999999999999999.9999 +0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +INSERT INTO t1 SELECT n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4 FROM t1 WHERE n65_4 = ( SELECT MAX(n65_4) FROM t1 ); +Warnings: +Warning 1264 Out of range value for column 'd' at row 1 +Warning 1264 Out of range value for column 'd0' at row 1 +Warning 1264 Out of range value for column 'd1_1' at row 1 +Warning 1264 Out of range value for column 'd10_2' at row 1 +Warning 1264 Out of range value for column 'd60_10' at row 1 +Warning 1264 Out of range value for column 'n' at row 1 +Warning 1264 Out of range value for column 'n0_0' at row 1 +Warning 1264 Out of range value for column 'n1' at row 1 +Warning 1264 Out of range value for column 'n20_4' at row 1 +SELECT * FROM t1; +d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 +-100 -123456 -0.3 -40000.25 -123456789123456789.1000100000 -1024 -7000 -8 -999999.9000 -9223372036854775807.0000 +-9999999999 -9999999999 -0.9 -99999999.99 -99999999999999999999999999999999999999999999999999.9999999999 -9999999999 -9999999999 -9 -9999999999999999.9999 -9999999999999999999999999999999999999999999999999999999999999.9999 +0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 +100 123456 0.3 40000.25 123456789123456789.1000100000 1024 7000 8 999999.9000 9223372036854775807.0000 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +INSERT INTO t1 VALUES (10000000000.0,10000000000.0,1.1,100000000.99,100000000000000000000000000000000000000000000000000.0,10000000000.0,10000000000.0,10.0,10000000000000000.9999,10000000000000000000000000000000000000000000000000000000000000.9999); +Warnings: +Warning 1264 Out of range value for column 'd' at row 1 +Warning 1264 Out of range value for column 'd0' at row 1 +Warning 1264 Out of range value for column 'd1_1' at row 1 +Warning 1264 Out of range value for column 'd10_2' at row 1 +Warning 1264 Out of range value for column 'd60_10' at row 1 +Warning 1264 Out of range value for column 'n' at row 1 +Warning 1264 Out of range value for column 'n0_0' at row 1 +Warning 1264 Out of range value for column 'n1' at row 1 +Warning 1264 Out of range value for column 'n20_4' at row 1 +Warning 1264 Out of range value for column 'n65_4' at row 1 +SELECT * FROM t1; +d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 +-100 -123456 -0.3 -40000.25 -123456789123456789.1000100000 -1024 -7000 -8 -999999.9000 -9223372036854775807.0000 +-9999999999 -9999999999 -0.9 -99999999.99 -99999999999999999999999999999999999999999999999999.9999999999 -9999999999 -9999999999 -9 -9999999999999999.9999 -9999999999999999999999999999999999999999999999999999999999999.9999 +0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 +100 123456 0.3 40000.25 123456789123456789.1000100000 1024 7000 8 999999.9000 9223372036854775807.0000 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +INSERT INTO t1 VALUES (9999999999.1,9999999999.1,1.9,99999999.001,99999999999999999999999999999999999999999999999999.99999999991,9999999999.1,9999999999.1,9.1,9999999999999999.00001,9999999999999999999999999999999999999999999999999999999999999.11111); +Warnings: +Note 1265 Data truncated for column 'd' at row 1 +Note 1265 Data truncated for column 'd0' at row 1 +Warning 1264 Out of range value for column 'd1_1' at row 1 +Note 1265 Data truncated for column 'd10_2' at row 1 +Note 1265 Data truncated for column 'd60_10' at row 1 +Note 1265 Data truncated for column 'n' at row 1 +Note 1265 Data truncated for column 'n0_0' at row 1 +Note 1265 Data truncated for column 'n1' at row 1 +Note 1265 Data truncated for column 'n20_4' at row 1 +Note 1265 Data truncated for column 'n65_4' at row 1 +SELECT * FROM t1; +d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 +-100 -123456 -0.3 -40000.25 -123456789123456789.1000100000 -1024 -7000 -8 -999999.9000 -9223372036854775807.0000 +-9999999999 -9999999999 -0.9 -99999999.99 -99999999999999999999999999999999999999999999999999.9999999999 -9999999999 -9999999999 -9 -9999999999999999.9999 -9999999999999999999999999999999999999999999999999999999999999.9999 +0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 +100 123456 0.3 40000.25 123456789123456789.1000100000 1024 7000 8 999999.9000 9223372036854775807.0000 +9999999999 9999999999 0.9 99999999.00 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.0000 9999999999999999999999999999999999999999999999999999999999999.1111 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 +ALTER TABLE t1 ADD COLUMN n66 NUMERIC(66); +ERROR 42000: Too big precision 66 specified for 'n66'. Maximum is 65. +ALTER TABLE t1 ADD COLUMN n66_6 DECIMAL(66,6); +ERROR 42000: Too big precision 66 specified for 'n66_6'. Maximum is 65. +ALTER TABLE t1 ADD COLUMN n66_66 DECIMAL(66,66); +ERROR 42000: Too big scale 66 specified for 'n66_66'. Maximum is 30. +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/type_fixed.test b/mysql-test/suite/storage_engine/type_fixed.test new file mode 100644 index 00000000000..30b0f44d713 --- /dev/null +++ b/mysql-test/suite/storage_engine/type_fixed.test @@ -0,0 +1,10 @@ +# +# Fixed point types +# + +--source have_engine.inc + +--source type_fixed.inc + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/type_fixed_indexes.result b/mysql-test/suite/storage_engine/type_fixed_indexes.result new file mode 100644 index 00000000000..b1fe27cf735 --- /dev/null +++ b/mysql-test/suite/storage_engine/type_fixed_indexes.result @@ -0,0 +1,148 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (d1 DECIMAL(10,2) <CUSTOM_COL_OPTIONS>, +d2 DECIMAL(60,10) <CUSTOM_COL_OPTIONS>, +n1 NUMERIC <CUSTOM_COL_OPTIONS>, +n2 NUMERIC(65,4) <CUSTOM_COL_OPTIONS>, +<CUSTOM_INDEX> d1 (d1) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 # 1 d1 # # NULL NULL # # +INSERT INTO t1 (d1,d2,n1,n2) VALUES +(10.22,60.12345,123456,14.3456), +(10.0,60.12345,123456,14), +(11.14,15,123456,13), +(100,100,1,2), +(0,0,0,0), +(4540424564.23,3343303441.0,12,13), +(15,17,23,100000); +Warnings: +Warning 1264 Out of range value for column 'd1' at row 6 +SELECT d1 FROM t1 ORDER BY d1 DESC; +d1 +99999999.99 +100.00 +15.00 +11.14 +10.22 +10.00 +0.00 +DROP TABLE t1; +CREATE TABLE t1 (d1 DECIMAL(10,2) <CUSTOM_COL_OPTIONS> PRIMARY KEY, +d2 DECIMAL(60,10) <CUSTOM_COL_OPTIONS>, +n1 NUMERIC <CUSTOM_COL_OPTIONS>, +n2 NUMERIC(65,4) <CUSTOM_COL_OPTIONS> +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 0 PRIMARY 1 d1 # # NULL NULL # # +INSERT INTO t1 (d1,d2,n1,n2) VALUES +(10.22,60.12345,123456,14.3456), +(10.0,60.12345,123456,14), +(11.14,15,123456,13), +(100,100,1,2), +(0,0,0,0), +(4540424564.23,3343303441.0,12,13), +(15,17,23,100000); +Warnings: +Warning 1264 Out of range value for column 'd1' at row 6 +EXPLAIN SELECT d1 FROM t1 ORDER BY d1 DESC; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # PRIMARY # # # # +SELECT d1 FROM t1 ORDER BY d1 DESC; +d1 +99999999.99 +100.00 +15.00 +11.14 +10.22 +10.00 +0.00 +EXPLAIN SELECT d1 FROM t1 IGNORE INDEX FOR ORDER BY (PRIMARY) ORDER BY d1 DESC; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # PRIMARY # # # # +SELECT d1 FROM t1 IGNORE INDEX FOR ORDER BY (PRIMARY) ORDER BY d1 DESC; +d1 +99999999.99 +100.00 +15.00 +11.14 +10.22 +10.00 +0.00 +DROP TABLE t1; +CREATE TABLE t1 (d1 DECIMAL(10,2) <CUSTOM_COL_OPTIONS>, +d2 DECIMAL(60,10) <CUSTOM_COL_OPTIONS>, +n1 NUMERIC <CUSTOM_COL_OPTIONS>, +n2 NUMERIC(65,4) <CUSTOM_COL_OPTIONS>, +UNIQUE INDEX n1_n2 (n1,n2) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 0 n1_n2 1 n1 # # NULL NULL # # +t1 0 n1_n2 2 n2 # # NULL NULL # # +INSERT INTO t1 (d1,d2,n1,n2) VALUES +(10.22,60.12345,123456,14.3456), +(10.0,60.12345,123456,14), +(11.14,15,123456,13), +(100,100,1,2), +(0,0,0,0), +(4540424564.23,3343303441.0,12,13), +(15,17,23,100000); +Warnings: +Warning 1264 Out of range value for column 'd1' at row 6 +EXPLAIN SELECT DISTINCT n1+n2 FROM t1; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # n1_n2 # # # # +SELECT DISTINCT n1+n2 FROM t1; +n1+n2 +0.0000 +100023.0000 +123469.0000 +123470.0000 +123470.3456 +25.0000 +3.0000 +DROP TABLE t1; +CREATE TABLE t1 (d1 DECIMAL(10,2) <CUSTOM_COL_OPTIONS>, +d2 DECIMAL(60,10) <CUSTOM_COL_OPTIONS>, +n1 NUMERIC <CUSTOM_COL_OPTIONS>, +n2 NUMERIC(65,4) <CUSTOM_COL_OPTIONS>, +INDEX (d2) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 d2 1 d2 # # NULL NULL # # +INSERT INTO t1 (d1,d2,n1,n2) VALUES +(10.22,60.12345,123456,14.3456), +(10.0,60.12345,123456,14), +(11.14,15,123456,13), +(100,100,1,2), +(0,0,0,0), +(4540424564.23,3343303441.0,12,13), +(15,17,23,100000); +Warnings: +Warning 1264 Out of range value for column 'd1' at row 6 +EXPLAIN SELECT d2, COUNT(*) FROM t1 GROUP BY d2; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # d2 # # # # +SELECT d2, COUNT(*) FROM t1 GROUP BY d2; +d2 COUNT(*) +0.0000000000 1 +100.0000000000 1 +15.0000000000 1 +17.0000000000 1 +3343303441.0000000000 1 +60.1234500000 2 +EXPLAIN SELECT d2, COUNT(*) FROM t1 IGNORE INDEX FOR GROUP BY (d2) GROUP BY d2; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # d2 # # # # +SELECT d2, COUNT(*) FROM t1 IGNORE INDEX FOR GROUP BY (d2) GROUP BY d2; +d2 COUNT(*) +0.0000000000 1 +100.0000000000 1 +15.0000000000 1 +17.0000000000 1 +3343303441.0000000000 1 +60.1234500000 2 +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/type_fixed_indexes.test b/mysql-test/suite/storage_engine/type_fixed_indexes.test new file mode 100644 index 00000000000..0d3e825c1b0 --- /dev/null +++ b/mysql-test/suite/storage_engine/type_fixed_indexes.test @@ -0,0 +1,167 @@ +# +# Fixed point columns with indexes +# + +--source have_engine.inc +--source have_default_index.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + + +# Default index as set in define_engine.inc + +let $create_definition = + d1 DECIMAL(10,2) $col_indexed_opts, + d2 DECIMAL(60,10) $col_opts, + n1 NUMERIC $col_opts, + n2 NUMERIC(65,4) $col_opts, + $default_index d1 (d1) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Fixed point types or indexes + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 3 # 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + INSERT INTO t1 (d1,d2,n1,n2) VALUES + (10.22,60.12345,123456,14.3456), + (10.0,60.12345,123456,14), + (11.14,15,123456,13), + (100,100,1,2), + (0,0,0,0), + (4540424564.23,3343303441.0,12,13), + (15,17,23,100000); + + SELECT d1 FROM t1 ORDER BY d1 DESC; + + DROP TABLE t1; +} + + +# PK, UNIQUE INDEX, INDEX + +let $create_definition = + d1 DECIMAL(10,2) $col_indexed_opts PRIMARY KEY, + d2 DECIMAL(60,10) $col_opts, + n1 NUMERIC $col_opts, + n2 NUMERIC(65,4) $col_opts +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Fixed point types or PK + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + INSERT INTO t1 (d1,d2,n1,n2) VALUES + (10.22,60.12345,123456,14.3456), + (10.0,60.12345,123456,14), + (11.14,15,123456,13), + (100,100,1,2), + (0,0,0,0), + (4540424564.23,3343303441.0,12,13), + (15,17,23,100000); + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT d1 FROM t1 ORDER BY d1 DESC; + SELECT d1 FROM t1 ORDER BY d1 DESC; + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT d1 FROM t1 IGNORE INDEX FOR ORDER BY (PRIMARY) ORDER BY d1 DESC; + SELECT d1 FROM t1 IGNORE INDEX FOR ORDER BY (PRIMARY) ORDER BY d1 DESC; + + DROP TABLE t1; +} + +let $create_definition = + d1 DECIMAL(10,2) $col_opts, + d2 DECIMAL(60,10) $col_opts, + n1 NUMERIC $col_indexed_opts, + n2 NUMERIC(65,4) $col_indexed_opts, + UNIQUE INDEX n1_n2 (n1,n2) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Fixed point types or unique keys or multi-part keys + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + INSERT INTO t1 (d1,d2,n1,n2) VALUES + (10.22,60.12345,123456,14.3456), + (10.0,60.12345,123456,14), + (11.14,15,123456,13), + (100,100,1,2), + (0,0,0,0), + (4540424564.23,3343303441.0,12,13), + (15,17,23,100000); + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT DISTINCT n1+n2 FROM t1; + --sorted_result + SELECT DISTINCT n1+n2 FROM t1; + + DROP TABLE t1; +} + +let $create_definition = + d1 DECIMAL(10,2) $col_opts, + d2 DECIMAL(60,10) $col_indexed_opts, + n1 NUMERIC $col_opts, + n2 NUMERIC(65,4) $col_opts, + INDEX (d2) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Fixed point types or non-unique keys + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + INSERT INTO t1 (d1,d2,n1,n2) VALUES + (10.22,60.12345,123456,14.3456), + (10.0,60.12345,123456,14), + (11.14,15,123456,13), + (100,100,1,2), + (0,0,0,0), + (4540424564.23,3343303441.0,12,13), + (15,17,23,100000); + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT d2, COUNT(*) FROM t1 GROUP BY d2; + --sorted_result + SELECT d2, COUNT(*) FROM t1 GROUP BY d2; + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT d2, COUNT(*) FROM t1 IGNORE INDEX FOR GROUP BY (d2) GROUP BY d2; + --sorted_result + SELECT d2, COUNT(*) FROM t1 IGNORE INDEX FOR GROUP BY (d2) GROUP BY d2; + + DROP TABLE t1; +} + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/type_float.inc b/mysql-test/suite/storage_engine/type_float.inc new file mode 100644 index 00000000000..7e355f01e0d --- /dev/null +++ b/mysql-test/suite/storage_engine/type_float.inc @@ -0,0 +1,111 @@ +# +# Float types +# + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +let $create_definition = + f FLOAT $col_opts, + f0 FLOAT(0) $col_opts, + r1_1 REAL(1,1) $col_opts, + f23_0 FLOAT(23) $col_opts, + f20_3 FLOAT(20,3) $col_opts, + d DOUBLE $col_opts, + d1_0 DOUBLE(1,0) $col_opts, + d10_10 DOUBLE PRECISION (10,10) $col_opts, + d53 DOUBLE(53,0) $col_opts, + d53_10 DOUBLE(53,10) $col_opts +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Float point types + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 3 # 4 # 5 # + SHOW COLUMNS IN t1; + + # Always valid values + + INSERT INTO t1 VALUES (12345.12345,12345.12345,0.9,123456789.123,56789.987,11111111.111,8.0,0.0123456789,1234566789123456789,99999999999999999.99999999); + + --sorted_result + --query_vertical SELECT * FROM t1 + + INSERT INTO t1 VALUES (0,0,0,0,0,0,0,0,0,0); + INSERT INTO t1 VALUES ( + 99999999999999999999999999999999999999, + 99999999999999999999999999999999999999.9999999999999999, + 0.9, + 99999999999999999999999999999999999999.9, + 99999999999999999.999, + 999999999999999999999999999999999999999999999999999999999999999999999999999999999, + 9, + 0.9999999999, + 1999999999999999999999999999999999999999999999999999999, + 19999999999999999999999999999999999999999999.9999999999 + ); + + --sorted_result + --query_vertical SELECT * FROM t1 + + # Values which can be valid or not, + # depending on whether columns are SIGNED or UNSIGNED + # (if not valid should produce warnings) + + INSERT INTO t1 VALUES (-999999999999999999999999,-99999999999.999999999999,-0.9,-999.99999999999999999999,-99999999999999999.999,-999999999999999999999999999999999999999999999999999999999999-0.999,-9,-.9999999999,-999999999999999999999999999999.99999999999999999999999,-9999999999999999999999999999999999999999999.9999999999); + + --sorted_result + --query_vertical SELECT * FROM t1 + + --sorted_result + --query_vertical SELECT MAX(f), MAX(f0), MAX(r1_1), MAX(f23_0), MAX(f20_3), MAX(d), MAX(d1_0), MAX(d10_10), MAX(d53), MAX(d53_10) FROM t1 + + # Invalid values + + INSERT INTO t1 SELECT d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10 FROM t1 ORDER BY d53_10 DESC LIMIT 1; + + --sorted_result + --query_vertical SELECT * FROM t1 + + INSERT INTO t1 VALUES ( + 999999999999999999999999999999999999999, + 999999999999999999999999999999999999999.9999999999999999, + 1.9, + 999999999999999999999999999999999999999.9, + 999999999999999999.999, + 9999999999999999999999999999999999999999999999999999999999999999999999999999999999, + 99, + 1.9999999999, + 1999999999999999999999999999999999999999999999999999999, + 19999999999999999999999999999999999999999999.9999999999 + ); + + --sorted_result + --query_vertical SELECT * FROM t1 + + --let $error_codes = ER_TOO_BIG_DISPLAYWIDTH + --let $alter_definition = ADD COLUMN d0_0 DOUBLE(0,0) + --source alter_table.inc + if ($mysql_errname != ER_TOO_BIG_DISPLAYWIDTH) + { + --let $my_last_stmt = $alter_statement + --let $functionality = ALTER TABLE + --source unexpected_result.inc + } + + --let $error_codes = ER_TOO_BIG_PRECISION + --let $alter_definition = ADD COLUMN n66_6 DECIMAL(256,1) + --source alter_table.inc + --let $error_codes = ER_TOO_BIG_SCALE + --let $alter_definition = ADD COLUMN n66_66 DECIMAL(40,35) + --source alter_table.inc + + DROP TABLE t1; +} + diff --git a/mysql-test/suite/storage_engine/type_float.result b/mysql-test/suite/storage_engine/type_float.result new file mode 100644 index 00000000000..1f863505430 --- /dev/null +++ b/mysql-test/suite/storage_engine/type_float.result @@ -0,0 +1,286 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (f FLOAT <CUSTOM_COL_OPTIONS>, +f0 FLOAT(0) <CUSTOM_COL_OPTIONS>, +r1_1 REAL(1,1) <CUSTOM_COL_OPTIONS>, +f23_0 FLOAT(23) <CUSTOM_COL_OPTIONS>, +f20_3 FLOAT(20,3) <CUSTOM_COL_OPTIONS>, +d DOUBLE <CUSTOM_COL_OPTIONS>, +d1_0 DOUBLE(1,0) <CUSTOM_COL_OPTIONS>, +d10_10 DOUBLE PRECISION (10,10) <CUSTOM_COL_OPTIONS>, +d53 DOUBLE(53,0) <CUSTOM_COL_OPTIONS>, +d53_10 DOUBLE(53,10) <CUSTOM_COL_OPTIONS> +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +f float # # # +f0 float # # # +r1_1 double(1,1) # # # +f23_0 float # # # +f20_3 float(20,3) # # # +d double # # # +d1_0 double(1,0) # # # +d10_10 double(10,10) # # # +d53 double(53,0) # # # +d53_10 double(53,10) # # # +INSERT INTO t1 VALUES (12345.12345,12345.12345,0.9,123456789.123,56789.987,11111111.111,8.0,0.0123456789,1234566789123456789,99999999999999999.99999999); +SELECT * FROM t1; +f 12345.1 +d 11111111.111 +d10_10 0.0123456789 +d1_0 8 +d53 1234566789123456800 +d53_10 100000000000000000.0000000000 +f0 12345.1 +f20_3 56789.988 +f23_0 123457000 +r1_1 0.9 +INSERT INTO t1 VALUES (0,0,0,0,0,0,0,0,0,0); +INSERT INTO t1 VALUES ( +99999999999999999999999999999999999999, +99999999999999999999999999999999999999.9999999999999999, +0.9, +99999999999999999999999999999999999999.9, +99999999999999999.999, +999999999999999999999999999999999999999999999999999999999999999999999999999999999, +9, +0.9999999999, +1999999999999999999999999999999999999999999999999999999, +19999999999999999999999999999999999999999999.9999999999 +); +Warnings: +Warning 1264 Out of range value for column 'd53' at row 1 +Warning 1264 Out of range value for column 'd53_10' at row 1 +SELECT * FROM t1; +f 12345.1 +d 0 +d 11111111.111 +d 1e81 +d10_10 0.0000000000 +d10_10 0.0123456789 +d10_10 0.9999999999 +d1_0 0 +d1_0 8 +d1_0 9 +d53 0 +d53 100000000000000000000000000000000000000000000000000000 +d53 1234566789123456800 +d53_10 0.0000000000 +d53_10 100000000000000000.0000000000 +d53_10 10000000000000000000000000000000000000000000.0000000000 +f 0 +f 1e38 +f0 0 +f0 12345.1 +f0 1e38 +f20_3 0.000 +f20_3 56789.988 +f20_3 99999998430674940.000 +f23_0 0 +f23_0 123457000 +f23_0 1e38 +r1_1 0.0 +r1_1 0.9 +r1_1 0.9 +INSERT INTO t1 VALUES (-999999999999999999999999,-99999999999.999999999999,-0.9,-999.99999999999999999999,-99999999999999999.999,-999999999999999999999999999999999999999999999999999999999999-0.999,-9,-.9999999999,-999999999999999999999999999999.99999999999999999999999,-9999999999999999999999999999999999999999999.9999999999); +SELECT * FROM t1; +f 12345.1 +d -1e60 +d 0 +d 11111111.111 +d 1e81 +d10_10 -0.9999999999 +d10_10 0.0000000000 +d10_10 0.0123456789 +d10_10 0.9999999999 +d1_0 -9 +d1_0 0 +d1_0 8 +d1_0 9 +d53 -1000000000000000000000000000000 +d53 0 +d53 100000000000000000000000000000000000000000000000000000 +d53 1234566789123456800 +d53_10 -10000000000000000000000000000000000000000000.0000000000 +d53_10 0.0000000000 +d53_10 100000000000000000.0000000000 +d53_10 10000000000000000000000000000000000000000000.0000000000 +f -1e24 +f 0 +f 1e38 +f0 -100000000000 +f0 0 +f0 12345.1 +f0 1e38 +f20_3 -99999998430674940.000 +f20_3 0.000 +f20_3 56789.988 +f20_3 99999998430674940.000 +f23_0 -1000 +f23_0 0 +f23_0 123457000 +f23_0 1e38 +r1_1 -0.9 +r1_1 0.0 +r1_1 0.9 +r1_1 0.9 +SELECT MAX(f), MAX(f0), MAX(r1_1), MAX(f23_0), MAX(f20_3), MAX(d), MAX(d1_0), MAX(d10_10), MAX(d53), MAX(d53_10) FROM t1; +MAX(f) 9.999999680285692e37 +MAX(d) 1e81 +MAX(d10_10) 0.9999999999 +MAX(d1_0) 9 +MAX(d53) 100000000000000000000000000000000000000000000000000000 +MAX(d53_10) 10000000000000000000000000000000000000000000.0000000000 +MAX(f0) 9.999999680285692e37 +MAX(f20_3) 99999998430674940.000 +MAX(f23_0) 9.999999680285692e37 +MAX(r1_1) 0.9 +INSERT INTO t1 SELECT d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10 FROM t1 ORDER BY d53_10 DESC LIMIT 1; +Warnings: +Warning 1264 Out of range value for column 'f' at row 1 +Warning 1264 Out of range value for column 'f0' at row 1 +Warning 1264 Out of range value for column 'r1_1' at row 1 +Warning 1264 Out of range value for column 'f23_0' at row 1 +Warning 1264 Out of range value for column 'f20_3' at row 1 +Warning 1264 Out of range value for column 'd1_0' at row 1 +SELECT * FROM t1; +f 12345.1 +d -1e60 +d 0 +d 11111111.111 +d 1e43 +d 1e81 +d10_10 -0.9999999999 +d10_10 0.0000000000 +d10_10 0.0123456789 +d10_10 0.9999999999 +d10_10 10000000000000000000000000000000000000000000.0000000000 +d1_0 -9 +d1_0 0 +d1_0 8 +d1_0 9 +d1_0 9 +d53 -1000000000000000000000000000000 +d53 0 +d53 10000000000000000000000000000000000000000000 +d53 100000000000000000000000000000000000000000000000000000 +d53 1234566789123456800 +d53_10 -10000000000000000000000000000000000000000000.0000000000 +d53_10 0.0000000000 +d53_10 100000000000000000.0000000000 +d53_10 10000000000000000000000000000000000000000000.0000000000 +d53_10 10000000000000000000000000000000000000000000.0000000000 +f -1e24 +f 0 +f 1e38 +f 3.40282e38 +f0 -100000000000 +f0 0 +f0 12345.1 +f0 1e38 +f0 3.40282e38 +f20_3 -99999998430674940.000 +f20_3 0.000 +f20_3 56789.988 +f20_3 99999998430674940.000 +f20_3 99999998430674940.000 +f23_0 -1000 +f23_0 0 +f23_0 123457000 +f23_0 1e38 +f23_0 3.40282e38 +r1_1 -0.9 +r1_1 0.0 +r1_1 0.9 +r1_1 0.9 +r1_1 0.9 +INSERT INTO t1 VALUES ( +999999999999999999999999999999999999999, +999999999999999999999999999999999999999.9999999999999999, +1.9, +999999999999999999999999999999999999999.9, +999999999999999999.999, +9999999999999999999999999999999999999999999999999999999999999999999999999999999999, +99, +1.9999999999, +1999999999999999999999999999999999999999999999999999999, +19999999999999999999999999999999999999999999.9999999999 +); +Warnings: +Warning 1916 Got overflow when converting '' to DECIMAL. Value truncated. +Warning 1264 Out of range value for column 'f' at row 1 +Warning 1264 Out of range value for column 'f0' at row 1 +Warning 1264 Out of range value for column 'r1_1' at row 1 +Warning 1264 Out of range value for column 'f23_0' at row 1 +Warning 1264 Out of range value for column 'f20_3' at row 1 +Warning 1264 Out of range value for column 'd1_0' at row 1 +Warning 1264 Out of range value for column 'd10_10' at row 1 +Warning 1264 Out of range value for column 'd53' at row 1 +Warning 1264 Out of range value for column 'd53_10' at row 1 +SELECT * FROM t1; +f 12345.1 +d -1e60 +d 0 +d 11111111.111 +d 1e43 +d 1e65 +d 1e81 +d10_10 -0.9999999999 +d10_10 0.0000000000 +d10_10 0.0123456789 +d10_10 0.9999999999 +d10_10 0.9999999999 +d10_10 10000000000000000000000000000000000000000000.0000000000 +d1_0 -9 +d1_0 0 +d1_0 8 +d1_0 9 +d1_0 9 +d1_0 9 +d53 -1000000000000000000000000000000 +d53 0 +d53 10000000000000000000000000000000000000000000 +d53 100000000000000000000000000000000000000000000000000000 +d53 100000000000000000000000000000000000000000000000000000 +d53 1234566789123456800 +d53_10 -10000000000000000000000000000000000000000000.0000000000 +d53_10 0.0000000000 +d53_10 100000000000000000.0000000000 +d53_10 10000000000000000000000000000000000000000000.0000000000 +d53_10 10000000000000000000000000000000000000000000.0000000000 +d53_10 10000000000000000000000000000000000000000000.0000000000 +f -1e24 +f 0 +f 1e38 +f 3.40282e38 +f 3.40282e38 +f0 -100000000000 +f0 0 +f0 12345.1 +f0 1e38 +f0 3.40282e38 +f0 3.40282e38 +f20_3 -99999998430674940.000 +f20_3 0.000 +f20_3 56789.988 +f20_3 99999998430674940.000 +f20_3 99999998430674940.000 +f20_3 99999998430674940.000 +f23_0 -1000 +f23_0 0 +f23_0 123457000 +f23_0 1e38 +f23_0 3.40282e38 +f23_0 3.40282e38 +r1_1 -0.9 +r1_1 0.0 +r1_1 0.9 +r1_1 0.9 +r1_1 0.9 +r1_1 0.9 +ALTER TABLE t1 ADD COLUMN d0_0 DOUBLE(0,0); +ERROR 42000: Display width out of range for 'd0_0' (max = 255) +ALTER TABLE t1 ADD COLUMN n66_6 DECIMAL(256,1); +ERROR 42000: Too big precision 256 specified for 'n66_6'. Maximum is 65. +ALTER TABLE t1 ADD COLUMN n66_66 DECIMAL(40,35); +ERROR 42000: Too big scale 35 specified for 'n66_66'. Maximum is 30. +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/type_float.test b/mysql-test/suite/storage_engine/type_float.test new file mode 100644 index 00000000000..eb197542962 --- /dev/null +++ b/mysql-test/suite/storage_engine/type_float.test @@ -0,0 +1,10 @@ +# +# Float types +# + +--source have_engine.inc + +--source type_float.inc + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/type_float_indexes.result b/mysql-test/suite/storage_engine/type_float_indexes.result new file mode 100644 index 00000000000..905c9da40da --- /dev/null +++ b/mysql-test/suite/storage_engine/type_float_indexes.result @@ -0,0 +1,146 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (f FLOAT <CUSTOM_COL_OPTIONS>, +r REAL(20,3) <CUSTOM_COL_OPTIONS>, +d DOUBLE <CUSTOM_COL_OPTIONS>, +dp DOUBLE PRECISION (64,10) <CUSTOM_COL_OPTIONS>, +<CUSTOM_INDEX> f (f) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 # 1 f # # NULL NULL # # +INSERT INTO t1 (f,r,d,dp) VALUES +(1.2345,1422.22,1.2345,1234567.89), +(0,0,0,0), +(-1,-1,-1,-1), +(17.5843,4953453454.44,29229114.0,1111111.23), +(4644,1422.22,466664.999,0.5); +SELECT f FROM t1 ORDER BY f; +f +-1 +0 +1.2345 +17.5843 +4644 +DROP TABLE t1; +CREATE TABLE t1 (f FLOAT <CUSTOM_COL_OPTIONS> PRIMARY KEY, +r REAL(20,3) <CUSTOM_COL_OPTIONS>, +d DOUBLE <CUSTOM_COL_OPTIONS>, +dp DOUBLE PRECISION (64,10) <CUSTOM_COL_OPTIONS> +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 0 PRIMARY 1 f # # NULL NULL # # +INSERT INTO t1 (f,r,d,dp) VALUES +(1.2345,1422.22,1.2345,1234567.89), +(0,0,0,0), +(-1,-1,-1,-1), +(17.5843,4953453454.44,29229114.0,1111111.23), +(4644,1422.22,466664.999,0.5); +EXPLAIN SELECT f FROM t1 ORDER BY f; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # PRIMARY # # # # +SELECT f FROM t1 ORDER BY f; +f +-1 +0 +1.2345 +17.5843 +4644 +EXPLAIN SELECT f FROM t1 IGNORE INDEX (PRIMARY) ORDER BY f; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # NULL # # # # +SELECT f FROM t1 IGNORE INDEX (PRIMARY) ORDER BY f; +f +-1 +0 +1.2345 +17.5843 +4644 +ALTER TABLE t1 DROP PRIMARY KEY; +ALTER TABLE t1 ADD UNIQUE KEY(d); +EXPLAIN SELECT d FROM t1 WHERE r > 0 and d > 0 ORDER BY d; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # d # # # # +SELECT d FROM t1 WHERE r > 0 and d > 0 ORDER BY d; +d +1.2345 +466664.999 +29229114 +DROP TABLE t1; +CREATE TABLE t1 (f FLOAT <CUSTOM_COL_OPTIONS>, +r REAL(20,3) <CUSTOM_COL_OPTIONS>, +d DOUBLE <CUSTOM_COL_OPTIONS>, +dp DOUBLE PRECISION (64,10) <CUSTOM_COL_OPTIONS>, +UNIQUE KEY r_dp (r,dp) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 0 r_dp 1 r # # NULL NULL # # +t1 0 r_dp 2 dp # # NULL NULL # # +INSERT INTO t1 (f,r,d,dp) VALUES +(1.2345,1422.22,1.2345,1234567.89), +(0,0,0,0), +(-1,-1,-1,-1), +(17.5843,4953453454.44,29229114.0,1111111.23), +(4644,1422.22,466664.999,0.5); +EXPLAIN SELECT r, dp FROM t1 WHERE r > 0 or dp > 0; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # r_dp # # # # +SELECT r, dp FROM t1 WHERE r > 0 or dp > 0; +r dp +1422.220 0.5000000000 +1422.220 1234567.8900000000 +4953453454.440 1111111.2300000000 +DROP TABLE t1; +CREATE TABLE t1 (f FLOAT <CUSTOM_COL_OPTIONS>, +r REAL(20,3) <CUSTOM_COL_OPTIONS>, +d DOUBLE <CUSTOM_COL_OPTIONS>, +dp DOUBLE PRECISION (64,10) <CUSTOM_COL_OPTIONS>, +UNIQUE KEY(d) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 0 d 1 d # # NULL NULL # # +INSERT INTO t1 (f,r,d,dp) VALUES +(1.2345,1422.22,1.2345,1234567.89), +(0,0,0,0), +(-1,-1,-1,-1), +(17.5843,4953453454.44,29229114.0,1111111.23), +(4644,1422.22,466664.999,0.5); +EXPLAIN SELECT DISTINCT d FROM t1 ORDER BY d; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # d # # # # +SELECT DISTINCT d FROM t1 ORDER BY d; +d +-1 +0 +1.2345 +466664.999 +29229114 +DROP TABLE t1; +CREATE TABLE t1 (f FLOAT <CUSTOM_COL_OPTIONS>, +r REAL(20,3) <CUSTOM_COL_OPTIONS>, +d DOUBLE <CUSTOM_COL_OPTIONS>, +dp DOUBLE PRECISION (64,10) <CUSTOM_COL_OPTIONS>, +KEY(d) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 d 1 d # # NULL NULL # # +INSERT INTO t1 (f,r,d,dp) VALUES +(1.2345,1422.22,1.2345,1234567.89), +(0,0,0,0), +(-1,-1,-1,-1), +(17.5843,4953453454.44,29229114.0,1111111.23), +(4644,1422.22,466664.999,0.5); +EXPLAIN SELECT DISTINCT d FROM t1 ORDER BY d; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # d # # # # +SELECT DISTINCT d FROM t1 ORDER BY d; +d +-1 +0 +1.2345 +466664.999 +29229114 +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/type_float_indexes.test b/mysql-test/suite/storage_engine/type_float_indexes.test new file mode 100644 index 00000000000..0f1afc600a1 --- /dev/null +++ b/mysql-test/suite/storage_engine/type_float_indexes.test @@ -0,0 +1,203 @@ +# +# Float type columns with indexes +# + +--source have_engine.inc +--source have_default_index.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +# Default index as set in define_engine.inc + +let $create_definition = + f FLOAT $col_indexed_opts, + r REAL(20,3) $col_opts, + d DOUBLE $col_opts, + dp DOUBLE PRECISION (64,10) $col_opts, + $default_index f (f) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Float point types or PK + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 3 # 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + INSERT INTO t1 (f,r,d,dp) VALUES + (1.2345,1422.22,1.2345,1234567.89), + (0,0,0,0), + (-1,-1,-1,-1), + (17.5843,4953453454.44,29229114.0,1111111.23), + (4644,1422.22,466664.999,0.5); + + SELECT f FROM t1 ORDER BY f; + + DROP TABLE t1; +} + + +# PK, UNIQUE INDEX, INDEX + +let $create_definition = + f FLOAT $col_indexed_opts PRIMARY KEY, + r REAL(20,3) $col_opts, + d DOUBLE $col_opts, + dp DOUBLE PRECISION (64,10) $col_opts +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Float point types or PK + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + INSERT INTO t1 (f,r,d,dp) VALUES + (1.2345,1422.22,1.2345,1234567.89), + (0,0,0,0), + (-1,-1,-1,-1), + (17.5843,4953453454.44,29229114.0,1111111.23), + (4644,1422.22,466664.999,0.5); + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT f FROM t1 ORDER BY f; + SELECT f FROM t1 ORDER BY f; + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT f FROM t1 IGNORE INDEX (PRIMARY) ORDER BY f; + SELECT f FROM t1 IGNORE INDEX (PRIMARY) ORDER BY f; + + + --let $alter_definition = DROP PRIMARY KEY + --source alter_table.inc + if ($mysql_errname) + { + --let $my_last_stmt = $alter_statement + --source unexpected_result.inc + } + if (!$mysql_errname) + { + --let $alter_definition = ADD UNIQUE KEY(d) + --source alter_table.inc + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT d FROM t1 WHERE r > 0 and d > 0 ORDER BY d; + SELECT d FROM t1 WHERE r > 0 and d > 0 ORDER BY d; + } + DROP TABLE t1; +} + +let $create_definition = + f FLOAT $col_opts, + r REAL(20,3) $col_indexed_opts, + d DOUBLE $col_opts, + dp DOUBLE PRECISION (64,10) $col_indexed_opts, + UNIQUE KEY r_dp (r,dp) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Float point types or unique keys or multi-part keys + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + INSERT INTO t1 (f,r,d,dp) VALUES + (1.2345,1422.22,1.2345,1234567.89), + (0,0,0,0), + (-1,-1,-1,-1), + (17.5843,4953453454.44,29229114.0,1111111.23), + (4644,1422.22,466664.999,0.5); + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT r, dp FROM t1 WHERE r > 0 or dp > 0; + --sorted_result + SELECT r, dp FROM t1 WHERE r > 0 or dp > 0; + + DROP TABLE t1; +} + +let $create_definition = + f FLOAT $col_opts, + r REAL(20,3) $col_opts, + d DOUBLE $col_indexed_opts, + dp DOUBLE PRECISION (64,10) $col_opts, + UNIQUE KEY(d) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Float point types or unique keys + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + INSERT INTO t1 (f,r,d,dp) VALUES + (1.2345,1422.22,1.2345,1234567.89), + (0,0,0,0), + (-1,-1,-1,-1), + (17.5843,4953453454.44,29229114.0,1111111.23), + (4644,1422.22,466664.999,0.5); + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT DISTINCT d FROM t1 ORDER BY d; + SELECT DISTINCT d FROM t1 ORDER BY d; + + DROP TABLE t1; +} + + +let $create_definition = + f FLOAT $col_opts, + r REAL(20,3) $col_opts, + d DOUBLE $col_indexed_opts, + dp DOUBLE PRECISION (64,10) $col_opts, + KEY(d) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Float point types or non-unique keys + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + INSERT INTO t1 (f,r,d,dp) VALUES + (1.2345,1422.22,1.2345,1234567.89), + (0,0,0,0), + (-1,-1,-1,-1), + (17.5843,4953453454.44,29229114.0,1111111.23), + (4644,1422.22,466664.999,0.5); + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT DISTINCT d FROM t1 ORDER BY d; + SELECT DISTINCT d FROM t1 ORDER BY d; + + DROP TABLE t1; +} + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/type_int.inc b/mysql-test/suite/storage_engine/type_int.inc new file mode 100644 index 00000000000..5aaea78fcd5 --- /dev/null +++ b/mysql-test/suite/storage_engine/type_int.inc @@ -0,0 +1,84 @@ +# +# INT column types +# + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +let $create_definition = + i INT $col_opts, + i0 INT(0) $col_opts, + i1 INT(1) $col_opts, + i20 INT(20) $col_opts, + t TINYINT $col_opts, + t0 TINYINT(0) $col_opts, + t1 TINYINT(1) $col_opts, + t20 TINYINT(20) $col_opts, + s SMALLINT $col_opts, + s0 SMALLINT(0) $col_opts, + s1 SMALLINT(1) $col_opts, + s20 SMALLINT(20) $col_opts, + m MEDIUMINT $col_opts, + m0 MEDIUMINT(0) $col_opts, + m1 MEDIUMINT(1) $col_opts, + m20 MEDIUMINT(20) $col_opts, + b BIGINT $col_opts, + b0 BIGINT(0) $col_opts, + b1 BIGINT(1) $col_opts, + b20 BIGINT(20) $col_opts +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = INT types + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 3 # 4 # 5 # + SHOW COLUMNS IN t1; + + # Always valid values + + INSERT INTO t1 VALUES (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20); + INSERT INTO t1 VALUES (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); + INSERT INTO t1 VALUES (2147483647,2147483647,2147483647,2147483647,127,127,127,127,32767,32767,32767,32767,8388607,8388607,8388607,8388607,9223372036854775807,9223372036854775807,9223372036854775807,9223372036854775807); + --sorted_result + SELECT * FROM t1; + + # Values which can be valid or not, + # depending on whether columns are SIGNED or UNSIGNED + # (if not valid should produce warnings) + + INSERT INTO t1 VALUES (-2147483648,-2147483648,-2147483648,-2147483648,-128,-128,-128,-128,-32768,-32768,-32768,-32768,-8388608,-8388608,-8388608,-8388608,-9223372036854775808,-9223372036854775808,-9223372036854775808,-9223372036854775808); + INSERT INTO t1 VALUES (4294967295,4294967295,4294967295,4294967295,255,255,255,255,65535,65535,65535,65535,16777215,16777215,16777215,16777215,18446744073709551615,18446744073709551615,18446744073709551615,18446744073709551615); + + --sorted_result + SELECT * FROM t1; + + # Invalid values + + INSERT INTO t1 VALUES (-2147483649,-2147483649,-2147483649,-2147483649,-129,-129,-129,-129,-32769,-32769,-32769,-32769,-8388609,-8388609,-8388609,-8388609,-9223372036854775809,-9223372036854775809,-9223372036854775809,-9223372036854775809); + + INSERT INTO t1 VALUES (4294967296,4294967296,4294967296,4294967296,256,256,256,256,65536,65536,65536,65536,16777216,16777216,16777216,16777216,18446744073709551616,18446744073709551616,18446744073709551616,18446744073709551616); + + INSERT INTO t1 SELECT b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b FROM t1 WHERE b IN (-9223372036854775808,9223372036854775807,18446744073709551615); + + --sorted_result + SELECT * FROM t1; + + --let $error_codes = ER_TOO_BIG_DISPLAYWIDTH + --let $alter_definition = ADD COLUMN i257 INT(257) + --source alter_table.inc + if ($mysql_errname != ER_TOO_BIG_DISPLAYWIDTH) + { + --let $my_last_stmt = $alter_statement + --let $functionality = ALTER TABLE + --source unexpected_result.inc + } + + DROP TABLE t1; +} + diff --git a/mysql-test/suite/storage_engine/type_int.result b/mysql-test/suite/storage_engine/type_int.result new file mode 100644 index 00000000000..47f4ebad93a --- /dev/null +++ b/mysql-test/suite/storage_engine/type_int.result @@ -0,0 +1,209 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (i INT <CUSTOM_COL_OPTIONS>, +i0 INT(0) <CUSTOM_COL_OPTIONS>, +i1 INT(1) <CUSTOM_COL_OPTIONS>, +i20 INT(20) <CUSTOM_COL_OPTIONS>, +t TINYINT <CUSTOM_COL_OPTIONS>, +t0 TINYINT(0) <CUSTOM_COL_OPTIONS>, +t1 TINYINT(1) <CUSTOM_COL_OPTIONS>, +t20 TINYINT(20) <CUSTOM_COL_OPTIONS>, +s SMALLINT <CUSTOM_COL_OPTIONS>, +s0 SMALLINT(0) <CUSTOM_COL_OPTIONS>, +s1 SMALLINT(1) <CUSTOM_COL_OPTIONS>, +s20 SMALLINT(20) <CUSTOM_COL_OPTIONS>, +m MEDIUMINT <CUSTOM_COL_OPTIONS>, +m0 MEDIUMINT(0) <CUSTOM_COL_OPTIONS>, +m1 MEDIUMINT(1) <CUSTOM_COL_OPTIONS>, +m20 MEDIUMINT(20) <CUSTOM_COL_OPTIONS>, +b BIGINT <CUSTOM_COL_OPTIONS>, +b0 BIGINT(0) <CUSTOM_COL_OPTIONS>, +b1 BIGINT(1) <CUSTOM_COL_OPTIONS>, +b20 BIGINT(20) <CUSTOM_COL_OPTIONS> +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +i int(11) # # # +i0 int(11) # # # +i1 int(1) # # # +i20 int(20) # # # +t tinyint(4) # # # +t0 tinyint(4) # # # +t1 tinyint(1) # # # +t20 tinyint(20) # # # +s smallint(6) # # # +s0 smallint(6) # # # +s1 smallint(1) # # # +s20 smallint(20) # # # +m mediumint(9) # # # +m0 mediumint(9) # # # +m1 mediumint(1) # # # +m20 mediumint(20) # # # +b bigint(20) # # # +b0 bigint(20) # # # +b1 bigint(1) # # # +b20 bigint(20) # # # +INSERT INTO t1 VALUES (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20); +INSERT INTO t1 VALUES (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); +INSERT INTO t1 VALUES (2147483647,2147483647,2147483647,2147483647,127,127,127,127,32767,32767,32767,32767,8388607,8388607,8388607,8388607,9223372036854775807,9223372036854775807,9223372036854775807,9223372036854775807); +SELECT * FROM t1; +i i0 i1 i20 t t0 t1 t20 s s0 s1 s20 m m0 m1 m20 b b0 b1 b20 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 +2147483647 2147483647 2147483647 2147483647 127 127 127 127 32767 32767 32767 32767 8388607 8388607 8388607 8388607 9223372036854775807 9223372036854775807 9223372036854775807 9223372036854775807 +INSERT INTO t1 VALUES (-2147483648,-2147483648,-2147483648,-2147483648,-128,-128,-128,-128,-32768,-32768,-32768,-32768,-8388608,-8388608,-8388608,-8388608,-9223372036854775808,-9223372036854775808,-9223372036854775808,-9223372036854775808); +INSERT INTO t1 VALUES (4294967295,4294967295,4294967295,4294967295,255,255,255,255,65535,65535,65535,65535,16777215,16777215,16777215,16777215,18446744073709551615,18446744073709551615,18446744073709551615,18446744073709551615); +Warnings: +Warning 1264 Out of range value for column 'i' at row 1 +Warning 1264 Out of range value for column 'i0' at row 1 +Warning 1264 Out of range value for column 'i1' at row 1 +Warning 1264 Out of range value for column 'i20' at row 1 +Warning 1264 Out of range value for column 't' at row 1 +Warning 1264 Out of range value for column 't0' at row 1 +Warning 1264 Out of range value for column 't1' at row 1 +Warning 1264 Out of range value for column 't20' at row 1 +Warning 1264 Out of range value for column 's' at row 1 +Warning 1264 Out of range value for column 's0' at row 1 +Warning 1264 Out of range value for column 's1' at row 1 +Warning 1264 Out of range value for column 's20' at row 1 +Warning 1264 Out of range value for column 'm' at row 1 +Warning 1264 Out of range value for column 'm0' at row 1 +Warning 1264 Out of range value for column 'm1' at row 1 +Warning 1264 Out of range value for column 'm20' at row 1 +Warning 1264 Out of range value for column 'b' at row 1 +Warning 1264 Out of range value for column 'b0' at row 1 +Warning 1264 Out of range value for column 'b1' at row 1 +Warning 1264 Out of range value for column 'b20' at row 1 +SELECT * FROM t1; +i i0 i1 i20 t t0 t1 t20 s s0 s1 s20 m m0 m1 m20 b b0 b1 b20 +-2147483648 -2147483648 -2147483648 -2147483648 -128 -128 -128 -128 -32768 -32768 -32768 -32768 -8388608 -8388608 -8388608 -8388608 -9223372036854775808 -9223372036854775808 -9223372036854775808 -9223372036854775808 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 +2147483647 2147483647 2147483647 2147483647 127 127 127 127 32767 32767 32767 32767 8388607 8388607 8388607 8388607 9223372036854775807 9223372036854775807 9223372036854775807 9223372036854775807 +2147483647 2147483647 2147483647 2147483647 127 127 127 127 32767 32767 32767 32767 8388607 8388607 8388607 8388607 9223372036854775807 9223372036854775807 9223372036854775807 9223372036854775807 +INSERT INTO t1 VALUES (-2147483649,-2147483649,-2147483649,-2147483649,-129,-129,-129,-129,-32769,-32769,-32769,-32769,-8388609,-8388609,-8388609,-8388609,-9223372036854775809,-9223372036854775809,-9223372036854775809,-9223372036854775809); +Warnings: +Warning 1264 Out of range value for column 'i' at row 1 +Warning 1264 Out of range value for column 'i0' at row 1 +Warning 1264 Out of range value for column 'i1' at row 1 +Warning 1264 Out of range value for column 'i20' at row 1 +Warning 1264 Out of range value for column 't' at row 1 +Warning 1264 Out of range value for column 't0' at row 1 +Warning 1264 Out of range value for column 't1' at row 1 +Warning 1264 Out of range value for column 't20' at row 1 +Warning 1264 Out of range value for column 's' at row 1 +Warning 1264 Out of range value for column 's0' at row 1 +Warning 1264 Out of range value for column 's1' at row 1 +Warning 1264 Out of range value for column 's20' at row 1 +Warning 1264 Out of range value for column 'm' at row 1 +Warning 1264 Out of range value for column 'm0' at row 1 +Warning 1264 Out of range value for column 'm1' at row 1 +Warning 1264 Out of range value for column 'm20' at row 1 +Warning 1264 Out of range value for column 'b' at row 1 +Warning 1264 Out of range value for column 'b0' at row 1 +Warning 1264 Out of range value for column 'b1' at row 1 +Warning 1264 Out of range value for column 'b20' at row 1 +INSERT INTO t1 VALUES (4294967296,4294967296,4294967296,4294967296,256,256,256,256,65536,65536,65536,65536,16777216,16777216,16777216,16777216,18446744073709551616,18446744073709551616,18446744073709551616,18446744073709551616); +Warnings: +Warning 1264 Out of range value for column 'i' at row 1 +Warning 1264 Out of range value for column 'i0' at row 1 +Warning 1264 Out of range value for column 'i1' at row 1 +Warning 1264 Out of range value for column 'i20' at row 1 +Warning 1264 Out of range value for column 't' at row 1 +Warning 1264 Out of range value for column 't0' at row 1 +Warning 1264 Out of range value for column 't1' at row 1 +Warning 1264 Out of range value for column 't20' at row 1 +Warning 1264 Out of range value for column 's' at row 1 +Warning 1264 Out of range value for column 's0' at row 1 +Warning 1264 Out of range value for column 's1' at row 1 +Warning 1264 Out of range value for column 's20' at row 1 +Warning 1264 Out of range value for column 'm' at row 1 +Warning 1264 Out of range value for column 'm0' at row 1 +Warning 1264 Out of range value for column 'm1' at row 1 +Warning 1264 Out of range value for column 'm20' at row 1 +Warning 1264 Out of range value for column 'b' at row 1 +Warning 1264 Out of range value for column 'b0' at row 1 +Warning 1264 Out of range value for column 'b1' at row 1 +Warning 1264 Out of range value for column 'b20' at row 1 +INSERT INTO t1 SELECT b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b FROM t1 WHERE b IN (-9223372036854775808,9223372036854775807,18446744073709551615); +Warnings: +Warning 1264 Out of range value for column 'i' at row 1 +Warning 1264 Out of range value for column 'i0' at row 1 +Warning 1264 Out of range value for column 'i1' at row 1 +Warning 1264 Out of range value for column 'i20' at row 1 +Warning 1264 Out of range value for column 't' at row 1 +Warning 1264 Out of range value for column 't0' at row 1 +Warning 1264 Out of range value for column 't1' at row 1 +Warning 1264 Out of range value for column 't20' at row 1 +Warning 1264 Out of range value for column 's' at row 1 +Warning 1264 Out of range value for column 's0' at row 1 +Warning 1264 Out of range value for column 's1' at row 1 +Warning 1264 Out of range value for column 's20' at row 1 +Warning 1264 Out of range value for column 'm' at row 1 +Warning 1264 Out of range value for column 'm0' at row 1 +Warning 1264 Out of range value for column 'm1' at row 1 +Warning 1264 Out of range value for column 'm20' at row 1 +Warning 1264 Out of range value for column 'i' at row 2 +Warning 1264 Out of range value for column 'i0' at row 2 +Warning 1264 Out of range value for column 'i1' at row 2 +Warning 1264 Out of range value for column 'i20' at row 2 +Warning 1264 Out of range value for column 't' at row 2 +Warning 1264 Out of range value for column 't0' at row 2 +Warning 1264 Out of range value for column 't1' at row 2 +Warning 1264 Out of range value for column 't20' at row 2 +Warning 1264 Out of range value for column 's' at row 2 +Warning 1264 Out of range value for column 's0' at row 2 +Warning 1264 Out of range value for column 's1' at row 2 +Warning 1264 Out of range value for column 's20' at row 2 +Warning 1264 Out of range value for column 'm' at row 2 +Warning 1264 Out of range value for column 'm0' at row 2 +Warning 1264 Out of range value for column 'm1' at row 2 +Warning 1264 Out of range value for column 'm20' at row 2 +Warning 1264 Out of range value for column 'i' at row 3 +Warning 1264 Out of range value for column 'i0' at row 3 +Warning 1264 Out of range value for column 'i1' at row 3 +Warning 1264 Out of range value for column 'i20' at row 3 +Warning 1264 Out of range value for column 't' at row 3 +Warning 1264 Out of range value for column 't0' at row 3 +Warning 1264 Out of range value for column 't1' at row 3 +Warning 1264 Out of range value for column 't20' at row 3 +Warning 1264 Out of range value for column 's' at row 3 +Warning 1264 Out of range value for column 's0' at row 3 +Warning 1264 Out of range value for column 's1' at row 3 +Warning 1264 Out of range value for column 's20' at row 3 +Warning 1264 Out of range value for column 'm' at row 3 +Warning 1264 Out of range value for column 'm0' at row 3 +Warning 1264 Out of range value for column 'm1' at row 3 +Warning 1264 Out of range value for column 'm20' at row 3 +Warning 1264 Out of range value for column 'i' at row 4 +Warning 1264 Out of range value for column 'i0' at row 4 +Warning 1264 Out of range value for column 'i1' at row 4 +Warning 1264 Out of range value for column 'i20' at row 4 +Warning 1264 Out of range value for column 't' at row 4 +Warning 1264 Out of range value for column 't0' at row 4 +Warning 1264 Out of range value for column 't1' at row 4 +Warning 1264 Out of range value for column 't20' at row 4 +Warning 1264 Out of range value for column 's' at row 4 +Warning 1264 Out of range value for column 's0' at row 4 +Warning 1264 Out of range value for column 's1' at row 4 +Warning 1264 Out of range value for column 's20' at row 4 +Warning 1264 Out of range value for column 'm' at row 4 +Warning 1264 Out of range value for column 'm0' at row 4 +Warning 1264 Out of range value for column 'm1' at row 4 +Warning 1264 Out of range value for column 'm20' at row 4 +SELECT * FROM t1; +i i0 i1 i20 t t0 t1 t20 s s0 s1 s20 m m0 m1 m20 b b0 b1 b20 +-2147483648 -2147483648 -2147483648 -2147483648 -128 -128 -128 -128 -32768 -32768 -32768 -32768 -8388608 -8388608 -8388608 -8388608 -9223372036854775808 -9223372036854775808 -9223372036854775808 -9223372036854775808 +-2147483648 -2147483648 -2147483648 -2147483648 -128 -128 -128 -128 -32768 -32768 -32768 -32768 -8388608 -8388608 -8388608 -8388608 -9223372036854775808 -9223372036854775808 -9223372036854775808 -9223372036854775808 +-2147483648 -2147483648 -2147483648 -2147483648 -128 -128 -128 -128 -32768 -32768 -32768 -32768 -8388608 -8388608 -8388608 -8388608 -9223372036854775808 -9223372036854775808 -9223372036854775808 -9223372036854775808 +-2147483648 -2147483648 -2147483648 -2147483648 -128 -128 -128 -128 -32768 -32768 -32768 -32768 -8388608 -8388608 -8388608 -8388608 -9223372036854775808 -9223372036854775808 -9223372036854775808 -9223372036854775808 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 +2147483647 2147483647 2147483647 2147483647 127 127 127 127 32767 32767 32767 32767 8388607 8388607 8388607 8388607 9223372036854775807 9223372036854775807 9223372036854775807 9223372036854775807 +2147483647 2147483647 2147483647 2147483647 127 127 127 127 32767 32767 32767 32767 8388607 8388607 8388607 8388607 9223372036854775807 9223372036854775807 9223372036854775807 9223372036854775807 +2147483647 2147483647 2147483647 2147483647 127 127 127 127 32767 32767 32767 32767 8388607 8388607 8388607 8388607 9223372036854775807 9223372036854775807 9223372036854775807 9223372036854775807 +2147483647 2147483647 2147483647 2147483647 127 127 127 127 32767 32767 32767 32767 8388607 8388607 8388607 8388607 9223372036854775807 9223372036854775807 9223372036854775807 9223372036854775807 +2147483647 2147483647 2147483647 2147483647 127 127 127 127 32767 32767 32767 32767 8388607 8388607 8388607 8388607 9223372036854775807 9223372036854775807 9223372036854775807 9223372036854775807 +2147483647 2147483647 2147483647 2147483647 127 127 127 127 32767 32767 32767 32767 8388607 8388607 8388607 8388607 9223372036854775807 9223372036854775807 9223372036854775807 9223372036854775807 +ALTER TABLE t1 ADD COLUMN i257 INT(257); +ERROR 42000: Display width out of range for 'i257' (max = 255) +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/type_int.test b/mysql-test/suite/storage_engine/type_int.test new file mode 100644 index 00000000000..1e1ca36854b --- /dev/null +++ b/mysql-test/suite/storage_engine/type_int.test @@ -0,0 +1,10 @@ +# +# INT column types +# + +--source have_engine.inc + +--source type_int.inc + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/type_int_indexes.result b/mysql-test/suite/storage_engine/type_int_indexes.result new file mode 100644 index 00000000000..aa82d6b9c4e --- /dev/null +++ b/mysql-test/suite/storage_engine/type_int_indexes.result @@ -0,0 +1,133 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (i INT <CUSTOM_COL_OPTIONS>, +t TINYINT <CUSTOM_COL_OPTIONS>, +s SMALLINT <CUSTOM_COL_OPTIONS>, +m MEDIUMINT <CUSTOM_COL_OPTIONS>, +b BIGINT <CUSTOM_COL_OPTIONS>, +<CUSTOM_INDEX> i (i) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 # 1 i # # NULL NULL # # +INSERT INTO t1 (i,t,s,m,b) VALUES (1,2,3,4,5),(1000,100,10000,1000000,1000000000000000000),(5,100,10000,1000000,100000000000000000),(2,3,4,5,6),(3,4,5,6,7),(101,102,103,104,105),(10001,103,10002,10003,10004),(10,11,12,13,14),(11,12,13,14,15),(12,13,14,15,16); +SELECT i FROM t1 ORDER BY i; +i +1 +2 +3 +5 +10 +11 +12 +101 +1000 +10001 +DROP TABLE t1; +CREATE TABLE t1 (i INT <CUSTOM_COL_OPTIONS> PRIMARY KEY, +t TINYINT <CUSTOM_COL_OPTIONS>, +s SMALLINT <CUSTOM_COL_OPTIONS>, +m MEDIUMINT <CUSTOM_COL_OPTIONS>, +b BIGINT <CUSTOM_COL_OPTIONS> +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (i,t,s,m,b) VALUES (1,2,3,4,5),(1000,100,10000,1000000,1000000000000000000),(5,100,10000,1000000,100000000000000000),(2,3,4,5,6),(3,4,5,6,7),(101,102,103,104,105),(10001,103,10002,10003,10004),(10,11,12,13,14),(11,12,13,14,15),(12,13,14,15,16); +EXPLAIN SELECT i FROM t1 ORDER BY i; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # PRIMARY # # # Using index +SELECT i FROM t1 ORDER BY i; +i +1 +2 +3 +5 +10 +11 +12 +101 +1000 +10001 +ALTER TABLE t1 DROP PRIMARY KEY; +ALTER TABLE t1 ADD PRIMARY KEY (i,t); +INSERT INTO t1 (i,t,s,m,b) VALUES (1,3,2,4,5); +EXPLAIN SELECT i, t FROM t1 ORDER BY i, t; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # PRIMARY # # # Using index +SELECT i, t FROM t1 ORDER BY i, t; +i t +1 2 +1 3 +2 3 +3 4 +5 100 +10 11 +11 12 +12 13 +101 102 +1000 100 +10001 103 +DROP TABLE t1; +CREATE TABLE t1 (i INT <CUSTOM_COL_OPTIONS>, +t TINYINT <CUSTOM_COL_OPTIONS>, +s SMALLINT <CUSTOM_COL_OPTIONS>, +m MEDIUMINT <CUSTOM_COL_OPTIONS>, +b BIGINT <CUSTOM_COL_OPTIONS>, +INDEX s_m (s,m) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (i,t,s,m,b) VALUES (1,2,3,4,5),(1000,100,10000,1000000,1000000000000000000),(5,100,10000,1000000,100000000000000000),(2,3,4,5,6),(3,4,5,6,7),(101,102,103,104,105),(10001,103,10002,10003,10004),(10,11,12,13,14),(11,12,13,14,15),(12,13,14,15,16); +EXPLAIN SELECT s, m FROM t1 WHERE s != 10 AND m != 1; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # s_m # # # Using where; Using index +SELECT s, m FROM t1 WHERE s != 10 AND m != 1; +s m +10000 1000000 +10000 1000000 +10002 10003 +103 104 +12 13 +13 14 +14 15 +3 4 +4 5 +5 6 +DROP TABLE t1; +CREATE TABLE t1 (i INT <CUSTOM_COL_OPTIONS>, +t TINYINT <CUSTOM_COL_OPTIONS>, +s SMALLINT <CUSTOM_COL_OPTIONS>, +m MEDIUMINT <CUSTOM_COL_OPTIONS>, +b BIGINT <CUSTOM_COL_OPTIONS>, +UNIQUE KEY b_t (b,t) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (i,t,s,m,b) VALUES (1,2,3,4,5),(1000,100,10000,1000000,1000000000000000000),(5,100,10000,1000000,100000000000000000),(2,3,4,5,6),(3,4,5,6,7),(101,102,103,104,105),(10001,103,10002,10003,10004),(10,11,12,13,14),(11,12,13,14,15),(12,13,14,15,16); +SELECT b+t FROM t1 WHERE (b,t) IN ( SELECT b, t FROM t1 WHERE i>1 ) ORDER BY b+t; +b+t +9 +11 +25 +27 +29 +207 +10107 +100000000000000100 +1000000000000000100 +SELECT b+t FROM t1 FORCE INDEX (b_t) WHERE (b,t) IN ( SELECT b, t FROM t1 WHERE i>1 ) ORDER BY b+t; +b+t +9 +11 +25 +27 +29 +207 +10107 +100000000000000100 +1000000000000000100 +SELECT b+t FROM t1 IGNORE INDEX (b_t) WHERE (b,t) IN ( SELECT b, t FROM t1 WHERE i>1 ) ORDER BY b+t; +b+t +9 +11 +25 +27 +29 +207 +10107 +100000000000000100 +1000000000000000100 +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/type_int_indexes.test b/mysql-test/suite/storage_engine/type_int_indexes.test new file mode 100644 index 00000000000..f8270c91ae3 --- /dev/null +++ b/mysql-test/suite/storage_engine/type_int_indexes.test @@ -0,0 +1,146 @@ +# +# INT column types with indexes +# + +--source have_engine.inc +--source have_default_index.inc + + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + + +# Default index as set in define_engine.inc + +let $create_definition = + i INT $col_indexed_opts, + t TINYINT $col_opts, + s SMALLINT $col_opts, + m MEDIUMINT $col_opts, + b BIGINT $col_opts, + $default_index i (i) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = INT types or indexes on them + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 3 # 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + INSERT INTO t1 (i,t,s,m,b) VALUES (1,2,3,4,5),(1000,100,10000,1000000,1000000000000000000),(5,100,10000,1000000,100000000000000000),(2,3,4,5,6),(3,4,5,6,7),(101,102,103,104,105),(10001,103,10002,10003,10004),(10,11,12,13,14),(11,12,13,14,15),(12,13,14,15,16); + + SELECT i FROM t1 ORDER BY i; + + DROP TABLE t1; +} + + +# PK, UNIQUE INDEX, INDEX + +let $create_definition = + i INT $col_indexed_opts PRIMARY KEY, + t TINYINT $col_opts, + s SMALLINT $col_opts, + m MEDIUMINT $col_opts, + b BIGINT $col_opts +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = INT types or PK + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + INSERT INTO t1 (i,t,s,m,b) VALUES (1,2,3,4,5),(1000,100,10000,1000000,1000000000000000000),(5,100,10000,1000000,100000000000000000),(2,3,4,5,6),(3,4,5,6,7),(101,102,103,104,105),(10001,103,10002,10003,10004),(10,11,12,13,14),(11,12,13,14,15),(12,13,14,15,16); + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # + EXPLAIN SELECT i FROM t1 ORDER BY i; + SELECT i FROM t1 ORDER BY i; + + --let $alter_definition = DROP PRIMARY KEY + --source alter_table.inc + if ($mysql_errname) + { + --let $my_last_stmt = $alter_statement + --let $functionality = ALTER TABLE + --source unexpected_result.inc + } + if (!$mysql_errname) + { + --let $alter_definition = ADD PRIMARY KEY (i,t) + --source alter_table.inc + + INSERT INTO t1 (i,t,s,m,b) VALUES (1,3,2,4,5); + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # + EXPLAIN SELECT i, t FROM t1 ORDER BY i, t; + SELECT i, t FROM t1 ORDER BY i, t; + } + + DROP TABLE t1; +} + +let $create_definition = + i INT $col_opts, + t TINYINT $col_opts, + s SMALLINT $col_indexed_opts, + m MEDIUMINT $col_indexed_opts, + b BIGINT $col_opts, + INDEX s_m (s,m) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = INT types or non-unique indexes or multi-part indexes + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + INSERT INTO t1 (i,t,s,m,b) VALUES (1,2,3,4,5),(1000,100,10000,1000000,1000000000000000000),(5,100,10000,1000000,100000000000000000),(2,3,4,5,6),(3,4,5,6,7),(101,102,103,104,105),(10001,103,10002,10003,10004),(10,11,12,13,14),(11,12,13,14,15),(12,13,14,15,16); + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # + EXPLAIN SELECT s, m FROM t1 WHERE s != 10 AND m != 1; + --sorted_result + SELECT s, m FROM t1 WHERE s != 10 AND m != 1; + + DROP TABLE t1; +} + +let $create_definition = + i INT $col_opts, + t TINYINT $col_indexed_opts, + s SMALLINT $col_opts, + m MEDIUMINT $col_opts, + b BIGINT $col_indexed_opts, + UNIQUE KEY b_t (b,t) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = INT types or unique keys or multi-part keys + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + INSERT INTO t1 (i,t,s,m,b) VALUES (1,2,3,4,5),(1000,100,10000,1000000,1000000000000000000),(5,100,10000,1000000,100000000000000000),(2,3,4,5,6),(3,4,5,6,7),(101,102,103,104,105),(10001,103,10002,10003,10004),(10,11,12,13,14),(11,12,13,14,15),(12,13,14,15,16); + + # This query should use the index b_t, we just don't want to run EXPLAIN + # (to avoid mismatches due to different subquery-related plans) + SELECT b+t FROM t1 WHERE (b,t) IN ( SELECT b, t FROM t1 WHERE i>1 ) ORDER BY b+t; + SELECT b+t FROM t1 FORCE INDEX (b_t) WHERE (b,t) IN ( SELECT b, t FROM t1 WHERE i>1 ) ORDER BY b+t; + SELECT b+t FROM t1 IGNORE INDEX (b_t) WHERE (b,t) IN ( SELECT b, t FROM t1 WHERE i>1 ) ORDER BY b+t; + + DROP TABLE t1; +} + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/type_set.inc b/mysql-test/suite/storage_engine/type_set.inc new file mode 100644 index 00000000000..b4844b00ec7 --- /dev/null +++ b/mysql-test/suite/storage_engine/type_set.inc @@ -0,0 +1,69 @@ +# +# SET column type +# + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +# Valid values. + +let $create_definition = + a SET('') $col_opts, + b SET('test1','test2','test3','test4','test5') $col_opts, + c SET('01','02','03','04','05','06','07','08','09','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31','32','33','34','35','36','37','38','39','40','41','42','43','44','45','46','47','48','49','50''51','52','53','54','55','56','57','58','59','60','61','62','63','64') $col_opts +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = SET types + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 3 # 4 # 5 # + SHOW COLUMNS IN t1; + + INSERT INTO t1 VALUES + ('','test2,test3','01,34,44,,23'), + ('',5,2), + (',','test4,test2',''); + --sorted_result + SELECT * FROM t1; + + # Out of range values + # (should produce warnings) + + INSERT INTO t1 VALUES (0,'test6',-1); + --sorted_result + SELECT * FROM t1; + + # Non-unique values in set + # (should produce a warning) + --let $alter_definition = ADD COLUMN e SET('a','A') $col_opts + --source alter_table.inc + if ($mysql_errname) + { + --let $my_last_stmt = $alter_statement + --let $functionality = ALTER TABLE + --source unexpected_result.inc + } + if (!$mysql_errname) + { + --replace_column 3 # 4 # 5 # + SHOW COLUMNS IN t1; + + --let $error_codes = ER_TOO_BIG_SET + --let $alter_definition = ADD COLUMN f SET('1','2','3','4','5','6','7','8','9','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',' ','11','12','13','14','15','16','17','18','19','1a','1b','1c','1d','1e','1f','1g','1h','1i','1j','1k','1l','1m','1n','1o','1p','1q','1r','1s','1t','1u','1v','1w','1x','1y','1z','20','21','22','23','24','25','26','27','28','29','2a','2b','2c','2d','2e','2f','2g','2h','2i','2j','2k','2l','2m','2n','2o','2p','2q','2r','2s','2t','2u','2v','2w','2x','2y','2z','30','31','32','33','34','35','36','37','38','39','3a','3b','3c','3d','3e','3f','3g','3h','3i') $col_opts + --source alter_table.inc + } + + # Simple comparison + + --sorted_result + SELECT * FROM t1 WHERE FIND_IN_SET('test2',b)>0 OR a != ''; + + DROP TABLE t1; +} + diff --git a/mysql-test/suite/storage_engine/type_set.result b/mysql-test/suite/storage_engine/type_set.result new file mode 100644 index 00000000000..210b07748bc --- /dev/null +++ b/mysql-test/suite/storage_engine/type_set.result @@ -0,0 +1,48 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a SET('') <CUSTOM_COL_OPTIONS>, +b SET('test1','test2','test3','test4','test5') <CUSTOM_COL_OPTIONS>, +c SET('01','02','03','04','05','06','07','08','09','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31','32','33','34','35','36','37','38','39','40','41','42','43','44','45','46','47','48','49','50''51','52','53','54','55','56','57','58','59','60','61','62','63','64') <CUSTOM_COL_OPTIONS> +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +a set('') # # # +b set('test1','test2','test3','test4','test5') # # # +c set('01','02','03','04','05','06','07','08','09','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31','32','33','34','35','36','37','38','39','40','41','42','43','44','45','46','47','48','49','50''51','52','53','54','55','56','57','58','59','60','61','62','63','64') # # # +INSERT INTO t1 VALUES +('','test2,test3','01,34,44,,23'), +('',5,2), +(',','test4,test2',''); +Warnings: +Warning 1265 Data truncated for column 'c' at row 1 +SELECT * FROM t1; +a b c + test1,test3 02 + test2,test3 01,23,34,44 + test2,test4 +INSERT INTO t1 VALUES (0,'test6',-1); +Warnings: +Warning 1265 Data truncated for column 'b' at row 1 +Warning 1265 Data truncated for column 'c' at row 1 +SELECT * FROM t1; +a b c + 01,02,03,04,05,06,07,08,09,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50'51,52,53,54,55,56,57,58,59,60,61,62,63,64 + test1,test3 02 + test2,test3 01,23,34,44 + test2,test4 +ALTER TABLE t1 ADD COLUMN e SET('a','A') <CUSTOM_COL_OPTIONS>; +Warnings: +Note 1291 Column 'e' has duplicated value 'a' in SET +Note 1291 Column 'e' has duplicated value 'a' in SET +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +a set('') # # # +b set('test1','test2','test3','test4','test5') # # # +c set('01','02','03','04','05','06','07','08','09','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31','32','33','34','35','36','37','38','39','40','41','42','43','44','45','46','47','48','49','50''51','52','53','54','55','56','57','58','59','60','61','62','63','64') # # # +e set('a','A') # # # +ALTER TABLE t1 ADD COLUMN f SET('1','2','3','4','5','6','7','8','9','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',' ','11','12','13','14','15','16','17','18','19','1a','1b','1c','1d','1e','1f','1g','1h','1i','1j','1k','1l','1m','1n','1o','1p','1q','1r','1s','1t','1u','1v','1w','1x','1y','1z','20','21','22','23','24','25','26','27','28','29','2a','2b','2c','2d','2e','2f','2g','2h','2i','2j','2k','2l','2m','2n','2o','2p','2q','2r','2s','2t','2u','2v','2w','2x','2y','2z','30','31','32','33','34','35','36','37','38','39','3a','3b','3c','3d','3e','3f','3g','3h','3i') <CUSTOM_COL_OPTIONS>; +ERROR HY000: Too many strings for column f and SET +SELECT * FROM t1 WHERE FIND_IN_SET('test2',b)>0 OR a != ''; +a b c e + test2,test3 01,23,34,44 NULL + test2,test4 NULL +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/type_set.test b/mysql-test/suite/storage_engine/type_set.test new file mode 100644 index 00000000000..7313ccaf7fe --- /dev/null +++ b/mysql-test/suite/storage_engine/type_set.test @@ -0,0 +1,10 @@ +# +# SET column type +# + +--source have_engine.inc + +--source type_set.inc + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/type_set_indexes.result b/mysql-test/suite/storage_engine/type_set_indexes.result new file mode 100644 index 00000000000..871202d7b97 --- /dev/null +++ b/mysql-test/suite/storage_engine/type_set_indexes.result @@ -0,0 +1,137 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a SET('N.America','S.America','Africa','Antarctica','Australia','Europe','Asia') <CUSTOM_COL_OPTIONS>, +b SET('test1','test2','test3','test4','test5') <CUSTOM_COL_OPTIONS>, +c SET('01','22','23','33','34','39','40','44','50','63','64') <CUSTOM_COL_OPTIONS>, +<CUSTOM_INDEX> c (c) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 # 1 c # # NULL NULL # # +INSERT INTO t1 (a,b,c) VALUES +('','test2,test3','01,34,44,23'), +('',5,2), +('N.America,Asia','test4,test2',''), +('Africa,Europe,Asia','test2,test3','01'), +('Antarctica','test3','34,44'), +('Asia','test5','50'), +('Europe,S.America','test1,','39'); +Warnings: +Warning 1265 Data truncated for column 'b' at row 7 +SELECT c FROM t1 ORDER BY c; +c + +01 +22 +39 +34,44 +01,23,34,44 +50 +DROP TABLE t1; +CREATE TABLE t1 (a SET('N.America','S.America','Africa','Antarctica','Australia','Europe','Asia') <CUSTOM_COL_OPTIONS>, +b SET('test1','test2','test3','test4','test5') <CUSTOM_COL_OPTIONS>, +c SET('01','22','23','33','34','39','40','44','50','63','64') <CUSTOM_COL_OPTIONS> PRIMARY KEY +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 0 PRIMARY 1 c # # NULL NULL # # +INSERT INTO t1 (a,b,c) VALUES +('','test2,test3','01,34,44,23'), +('',5,2), +('N.America,Asia','test4,test2',''), +('Africa,Europe,Asia','test2,test3','01'), +('Antarctica','test3','34,44'), +('Asia','test5','50'), +('Europe,S.America','test1,','39'); +Warnings: +Warning 1265 Data truncated for column 'b' at row 7 +EXPLAIN SELECT c FROM t1 ORDER BY c; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # PRIMARY # # # # +SELECT c FROM t1 ORDER BY c; +c + +01 +22 +39 +34,44 +01,23,34,44 +50 +EXPLAIN SELECT c FROM t1 IGNORE INDEX FOR ORDER BY (PRIMARY) ORDER BY c; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # PRIMARY # # # # +SELECT c FROM t1 IGNORE INDEX FOR ORDER BY (PRIMARY) ORDER BY c; +c + +01 +22 +39 +34,44 +01,23,34,44 +50 +INSERT INTO t1 (a,b,c) VALUES ('Antarctica','test3','02'); +ERROR 23000: Duplicate entry '22' for key 'PRIMARY' +# Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY). +# If you got a difference in error message, just add it to rdiff file +INSERT INTO t1 (a,b,c) VALUES ('','test1','34,44'); +ERROR 23000: Duplicate entry '34,44' for key 'PRIMARY' +# Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY). +# If you got a difference in error message, just add it to rdiff file +DROP TABLE t1; +CREATE TABLE t1 (a SET('N.America','S.America','Africa','Antarctica','Australia','Europe','Asia') <CUSTOM_COL_OPTIONS>, +b SET('test1','test2','test3','test4','test5') <CUSTOM_COL_OPTIONS>, +c SET('01','22','23','33','34','39','40','44','50','63','64') <CUSTOM_COL_OPTIONS>, +INDEX(a) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 a 1 a # # NULL NULL # # +INSERT INTO t1 (a,b,c) VALUES +('','test2,test3','01,34,44,23'), +('',5,2), +('N.America,Asia','test4,test2',''), +('Africa,Europe,Asia','test2,test3','01'), +('Antarctica','test3','34,44'), +('Asia','test5','50'), +('Europe,S.America','test1,','39'); +Warnings: +Warning 1265 Data truncated for column 'b' at row 7 +EXPLAIN SELECT a FROM t1 WHERE FIND_IN_SET('Europe',a) > 0; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # a # # # # +SELECT a FROM t1 WHERE FIND_IN_SET('Europe',a) > 0; +a +Africa,Europe,Asia +S.America,Europe +DROP TABLE t1; +CREATE TABLE t1 (a SET('N.America','S.America','Africa','Antarctica','Australia','Europe','Asia') <CUSTOM_COL_OPTIONS>, +b SET('test1','test2','test3','test4','test5') <CUSTOM_COL_OPTIONS>, +c SET('01','22','23','33','34','39','40','44','50','63','64') <CUSTOM_COL_OPTIONS>, +UNIQUE INDEX b_a (b,a) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 0 b_a 1 b # # NULL NULL # # +t1 0 b_a 2 a # # NULL NULL # # +INSERT INTO t1 (a,b,c) VALUES +('','test2,test3','01,34,44,23'), +('',5,2), +('N.America,Asia','test4,test2',''), +('Africa,Europe,Asia','test2,test3','01'), +('Antarctica','test3','34,44'), +('Asia','test5','50'), +('Europe,S.America','test1,','39'); +Warnings: +Warning 1265 Data truncated for column 'b' at row 7 +EXPLAIN SELECT DISTINCT a, b FROM t1 ORDER BY b DESC, a; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # b_a # # # # +SELECT DISTINCT a, b FROM t1 ORDER BY b DESC, a; +a b + test1,test3 + test2,test3 +Africa,Europe,Asia test2,test3 +Antarctica test3 +Asia test5 +N.America,Asia test2,test4 +S.America,Europe test1 +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/type_set_indexes.test b/mysql-test/suite/storage_engine/type_set_indexes.test new file mode 100644 index 00000000000..3223c957cea --- /dev/null +++ b/mysql-test/suite/storage_engine/type_set_indexes.test @@ -0,0 +1,167 @@ +# +# SET columns with indexes +# + +--source have_engine.inc +--source have_default_index.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +# Default index as configured in define_engine.inc + +let $create_definition = + a SET('N.America','S.America','Africa','Antarctica','Australia','Europe','Asia') $col_opts, + b SET('test1','test2','test3','test4','test5') $col_opts, + c SET('01','22','23','33','34','39','40','44','50','63','64') $col_indexed_opts, + $default_index c (c) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = SET types or indexes on them + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 3 # 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + INSERT INTO t1 (a,b,c) VALUES + ('','test2,test3','01,34,44,23'), + ('',5,2), + ('N.America,Asia','test4,test2',''), + ('Africa,Europe,Asia','test2,test3','01'), + ('Antarctica','test3','34,44'), + ('Asia','test5','50'), + ('Europe,S.America','test1,','39'); + + SELECT c FROM t1 ORDER BY c; + + DROP TABLE t1; +} + + +# PK, UNIQUE INDEX, INDEX + + +let $create_definition = + a SET('N.America','S.America','Africa','Antarctica','Australia','Europe','Asia') $col_opts, + b SET('test1','test2','test3','test4','test5') $col_opts, + c SET('01','22','23','33','34','39','40','44','50','63','64') $col_indexed_opts PRIMARY KEY +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = SET types or PK + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + INSERT INTO t1 (a,b,c) VALUES + ('','test2,test3','01,34,44,23'), + ('',5,2), + ('N.America,Asia','test4,test2',''), + ('Africa,Europe,Asia','test2,test3','01'), + ('Antarctica','test3','34,44'), + ('Asia','test5','50'), + ('Europe,S.America','test1,','39'); + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT c FROM t1 ORDER BY c; + SELECT c FROM t1 ORDER BY c; + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT c FROM t1 IGNORE INDEX FOR ORDER BY (PRIMARY) ORDER BY c; + SELECT c FROM t1 IGNORE INDEX FOR ORDER BY (PRIMARY) ORDER BY c; + + + --let $error_codes = ER_DUP_ENTRY,ER_DUP_KEY + INSERT INTO t1 (a,b,c) VALUES ('Antarctica','test3','02'); + --source check_errors.inc + + --let $error_codes = ER_DUP_ENTRY,ER_DUP_KEY + INSERT INTO t1 (a,b,c) VALUES ('','test1','34,44'); + --source check_errors.inc + + DROP TABLE t1; +} + +let $create_definition = + a SET('N.America','S.America','Africa','Antarctica','Australia','Europe','Asia') $col_indexed_opts, + b SET('test1','test2','test3','test4','test5') $col_opts, + c SET('01','22','23','33','34','39','40','44','50','63','64') $col_opts, + INDEX(a) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = SET types or non-unique keys + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + INSERT INTO t1 (a,b,c) VALUES + ('','test2,test3','01,34,44,23'), + ('',5,2), + ('N.America,Asia','test4,test2',''), + ('Africa,Europe,Asia','test2,test3','01'), + ('Antarctica','test3','34,44'), + ('Asia','test5','50'), + ('Europe,S.America','test1,','39'); + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT a FROM t1 WHERE FIND_IN_SET('Europe',a) > 0; + --sorted_result + SELECT a FROM t1 WHERE FIND_IN_SET('Europe',a) > 0; + + DROP TABLE t1; +} + +let $create_definition = + a SET('N.America','S.America','Africa','Antarctica','Australia','Europe','Asia') $col_indexed_opts, + b SET('test1','test2','test3','test4','test5') $col_indexed_opts, + c SET('01','22','23','33','34','39','40','44','50','63','64') $col_opts, + UNIQUE INDEX b_a (b,a) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = SET types or unique keys or multi-part keys + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + INSERT INTO t1 (a,b,c) VALUES + ('','test2,test3','01,34,44,23'), + ('',5,2), + ('N.America,Asia','test4,test2',''), + ('Africa,Europe,Asia','test2,test3','01'), + ('Antarctica','test3','34,44'), + ('Asia','test5','50'), + ('Europe,S.America','test1,','39'); + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT DISTINCT a, b FROM t1 ORDER BY b DESC, a; + --sorted_result + SELECT DISTINCT a, b FROM t1 ORDER BY b DESC, a; + + DROP TABLE t1; +} + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/type_spatial.inc b/mysql-test/suite/storage_engine/type_spatial.inc new file mode 100644 index 00000000000..5195f779bcc --- /dev/null +++ b/mysql-test/suite/storage_engine/type_spatial.inc @@ -0,0 +1,738 @@ +# +# Spatial objects +# + +# +# A calling test can initialize $index variable, +# which can be SPATIAL, or INDEX, or UNIQUE INDEX; +# Logic for creating tables with spatial and non-spatial indexes is different +# + +--disable_warnings +DROP TABLE IF EXISTS t1, gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry; +--enable_warnings + +--disable_warnings +DROP DATABASE IF EXISTS gis_ogs; +--enable_warnings + +CREATE DATABASE gis_ogs; + + +if ($index=='') +{ + --let $table_name = gis_point + --let $create_definition = fid $int_col, g POINT + --source create_table.inc + if ($mysql_errname) + { + --let $my_last_stmt = $create_statement + --let $functionality = Geometry types + --source unexpected_result.inc + } + if (!$mysql_errname) + { + --let $table_name = gis_line + --let $create_definition = fid $int_col, g LINESTRING + --source create_table.inc + --let $table_name = gis_polygon + --let $create_definition = fid $int_col, g POLYGON + --source create_table.inc + --let $table_name = gis_multi_point + --let $create_definition = fid $int_col, g MULTIPOINT + --source create_table.inc + --let $table_name = gis_multi_line + --let $create_definition = fid $int_col, g MULTILINESTRING + --source create_table.inc + --let $table_name = gis_multi_polygon + --let $create_definition = fid $int_col, g MULTIPOLYGON + --source create_table.inc + --let $table_name = gis_geometrycollection + --let $create_definition = fid $int_col, g GEOMETRYCOLLECTION + --source create_table.inc + --let $table_name = gis_geometry + --let $create_definition = fid $int_col, g GEOMETRY + --source create_table.inc + + USE gis_ogs; + + --let $table_name = lakes + let $create_definition = + fid INT $col_opts, + name CHAR(64) $col_opts, + shore POLYGON; + --source create_table.inc + + --let $table_name = road_segments + let $create_definition = + fid INT $col_opts, + name CHAR(64) $col_opts, + aliases CHAR(64) $col_opts, + num_lanes INT $col_opts, + centerline LINESTRING; + --source create_table.inc + + --let $table_name = divided_routes + let $create_definition = + fid INT $col_opts, + name CHAR(64) $col_opts, + num_lanes INT $col_opts, + centerlines MULTILINESTRING; + --source create_table.inc + + --let $table_name = forests + let $create_definition = + fid INT $col_opts, + name CHAR(64) $col_opts, + boundary MULTIPOLYGON; + --source create_table.inc + + --let $table_name = bridges + let $create_definition = + fid INT $col_opts, + name CHAR(64) $col_opts, + position POINT; + --source create_table.inc + + --let $table_name = streams + let $create_definition = + fid INT $col_opts, + name CHAR(64) $col_opts, + centerline LINESTRING; + --source create_table.inc + + --let $table_name = buildings + let $create_definition = + fid INT $col_opts, + name CHAR(64) $col_opts, + position POINT, + footprint POLYGON; + --source create_table.inc + + --let $table_name = ponds + let $create_definition = + fid INT $col_opts, + name CHAR(64) $col_opts, + type CHAR(64) $col_opts, + shores MULTIPOLYGON; + --source create_table.inc + + --let $table_name = named_places + let $create_definition = + fid INT $col_opts, + name CHAR(64) $col_opts, + boundary POLYGON; + --source create_table.inc + + --let $table_name = map_neatlines + let $create_definition = + fid INT $col_opts, + neatline POLYGON; + --source create_table.inc + } +} + +if ($index == 'SPATIAL') +{ + --let $table_name = gis_point + --let $create_definition = fid $int_col, g POINT NOT NULL, SPATIAL INDEX(g) + --source create_table.inc + if ($mysql_errname) + { + --let $my_last_stmt = $create_statement + --let $functionality = Geometry types or spatial indexes + --source unexpected_result.inc + } + if (!$mysql_errname) + { + --let $table_name = gis_line + --let $create_definition = fid $int_col, g LINESTRING NOT NULL, SPATIAL INDEX(g) + --source create_table.inc + --let $table_name = gis_polygon + --let $create_definition = fid $int_col, g POLYGON NOT NULL, SPATIAL INDEX(g) + --source create_table.inc + --let $table_name = gis_multi_point + --let $create_definition = fid $int_col, g MULTIPOINT NOT NULL, SPATIAL INDEX(g) + --source create_table.inc + --let $table_name = gis_multi_line + --let $create_definition = fid $int_col, g MULTILINESTRING NOT NULL, SPATIAL INDEX(g) + --source create_table.inc + --let $table_name = gis_multi_polygon + --let $create_definition = fid $int_col, g MULTIPOLYGON NOT NULL, SPATIAL INDEX(g) + --source create_table.inc + --let $table_name = gis_geometrycollection + --let $create_definition = fid $int_col, g GEOMETRYCOLLECTION NOT NULL, SPATIAL INDEX(g) + --source create_table.inc + --let $table_name = gis_geometry + --let $create_definition = fid $int_col, g GEOMETRY NOT NULL + --source create_table.inc + + USE gis_ogs; + + --let $table_name = lakes + let $create_definition = + fid INT $col_opts, + name CHAR(64) $col_opts, + shore POLYGON NOT NULL, SPATIAL INDEX s(shore); + --source create_table.inc + + --let $table_name = road_segments + let $create_definition = + fid INT $col_opts, + name CHAR(64) $col_opts, + aliases CHAR(64) $col_opts, + num_lanes INT $col_opts, + centerline LINESTRING NOT NULL, SPATIAL INDEX c(centerline); + --source create_table.inc + + --let $table_name = divided_routes + let $create_definition = + fid INT $col_opts, + name CHAR(64) $col_opts, + num_lanes INT $col_opts, + centerlines MULTILINESTRING NOT NULL, SPATIAL INDEX c(centerlines); + --source create_table.inc + + --let $table_name = forests + let $create_definition = + fid INT $col_opts, + name CHAR(64) $col_opts, + boundary MULTIPOLYGON NOT NULL, SPATIAL INDEX b(boundary); + --source create_table.inc + + --let $table_name = bridges + let $create_definition = + fid INT $col_opts, + name CHAR(64) $col_opts, + position POINT NOT NULL, SPATIAL INDEX p(position); + --source create_table.inc + + --let $table_name = streams + let $create_definition = + fid INT $col_opts, + name CHAR(64) $col_opts, + centerline LINESTRING NOT NULL, SPATIAL INDEX c(centerline); + --source create_table.inc + + --let $table_name = buildings + let $create_definition = + fid INT $col_opts, + name CHAR(64) $col_opts, + position POINT NOT NULL, + footprint POLYGON NOT NULL, SPATIAL INDEX p(position), SPATIAL INDEX f(footprint); + --source create_table.inc + + --let $table_name = ponds + let $create_definition = + fid INT $col_opts, + name CHAR(64) $col_opts, + type CHAR(64) $col_opts, + shores MULTIPOLYGON NOT NULL, SPATIAL INDEX s(shores); + --source create_table.inc + + --let $table_name = named_places + let $create_definition = + fid INT $col_opts, + name CHAR(64) $col_opts, + boundary POLYGON NOT NULL, SPATIAL INDEX b(boundary); + --source create_table.inc + + --let $table_name = map_neatlines + let $create_definition = + fid INT $col_opts, + neatline POLYGON NOT NULL, SPATIAL INDEX n(neatline); + --source create_table.inc + } + let $index =; +} + +if ($index) +{ + --let $table_name = gis_point + --let $create_definition = fid $int_col, g POINT, $index g(g(128)) + --source create_table.inc + if ($mysql_errname) + { + --let $my_last_stmt = $create_statement + --let $functionality = Geometry types or indexes on them + --source unexpected_result.inc + } + if (!$mysql_errname) + { + --let $table_name = gis_line + --let $create_definition = fid $int_col, g LINESTRING, $index g(g(256)) + --source create_table.inc + --let $table_name = gis_polygon + --let $create_definition = fid $int_col, g POLYGON, $index g(g(512)) + --source create_table.inc + --let $table_name = gis_multi_point + --let $create_definition = fid $int_col, g MULTIPOINT, $index g(g(128)) + --source create_table.inc + --let $table_name = gis_multi_line + --let $create_definition = fid $int_col, g MULTILINESTRING, $index g(g(256)) + --source create_table.inc + --let $table_name = gis_multi_polygon + --let $create_definition = fid $int_col, g MULTIPOLYGON + --source create_table.inc + --let $table_name = gis_geometrycollection + --let $create_definition = fid $int_col, g GEOMETRYCOLLECTION + --source create_table.inc + --let $table_name = gis_geometry + --let $create_definition = fid $int_col, g GEOMETRY + --source create_table.inc + + USE gis_ogs; + + --let $table_name = lakes + let $create_definition = + fid INT $col_opts, + name CHAR(64) $col_opts, + shore POLYGON $spatial_col_opts, $index s(shore(64)); + --source create_table.inc + + --let $table_name = road_segments + let $create_definition = + fid INT $col_opts, + name CHAR(64) $col_opts, + aliases CHAR(64) $col_opts, + num_lanes INT $col_opts, + centerline LINESTRING $spatial_col_opts, $index c(centerline(128)); + --source create_table.inc + + --let $table_name = divided_routes + let $create_definition = + fid INT $col_opts, + name CHAR(64) $col_opts, + num_lanes INT $col_opts, + centerlines MULTILINESTRING $spatial_col_opts, $index c(centerlines(512)); + --source create_table.inc + + --let $table_name = forests + let $create_definition = + fid INT $col_opts, + name CHAR(64) $col_opts, + boundary MULTIPOLYGON $spatial_col_opts, $index b(boundary(128)); + --source create_table.inc + + --let $table_name = bridges + let $create_definition = + fid INT $col_opts, + name CHAR(64) $col_opts, + position POINT $spatial_col_opts, $index p(`position`(64)); + --source create_table.inc + + --let $table_name = streams + let $create_definition = + fid INT $col_opts, + name CHAR(64) $col_opts, + centerline LINESTRING $spatial_col_opts, $index c(centerline(256)); + --source create_table.inc + + --let $table_name = buildings + let $create_definition = + fid INT $col_opts, + name CHAR(64) $col_opts, + position POINT $spatial_col_opts, + footprint POLYGON $spatial_col_opts, $index p(`position`(64)), $index f(footprint(128)); + --source create_table.inc + + --let $table_name = ponds + let $create_definition = + fid INT $col_opts, + name CHAR(64) $col_opts, + type CHAR(64) $col_opts, + shores MULTIPOLYGON $spatial_col_opts, $index s(shores(256)); + --source create_table.inc + + --let $table_name = named_places + let $create_definition = + fid INT $col_opts, + name CHAR(64) $col_opts, + boundary POLYGON $spatial_col_opts, $index b(boundary(512)); + --source create_table.inc + + --let $table_name = map_neatlines + let $create_definition = + fid INT $col_opts, + neatline POLYGON $spatial_col_opts, $index n(neatline(700)); + --source create_table.inc + } +} + +if (!$mysql_errname) +{ + USE test; + + SHOW FIELDS FROM gis_point; + SHOW FIELDS FROM gis_line; + SHOW FIELDS FROM gis_polygon; + SHOW FIELDS FROM gis_multi_point; + SHOW FIELDS FROM gis_multi_line; + SHOW FIELDS FROM gis_multi_polygon; + SHOW FIELDS FROM gis_geometrycollection; + SHOW FIELDS FROM gis_geometry; + + INSERT INTO gis_point VALUES + (101, PointFromText('POINT(10 10)')), + (102, PointFromText('POINT(20 10)')), + (103, PointFromText('POINT(20 20)')), + (104, PointFromWKB(AsWKB(PointFromText('POINT(10 20)')))); + + INSERT INTO gis_line VALUES + (105, LineFromText('LINESTRING(0 0,0 10,10 0)')), + (106, LineStringFromText('LINESTRING(10 10,20 10,20 20,10 20,10 10)')), + (107, LineStringFromWKB(AsWKB(LineString(Point(10, 10), Point(40, 10))))); + + INSERT INTO gis_polygon VALUES + (108, PolygonFromText('POLYGON((10 10,20 10,20 20,10 20,10 10))')), + (109, PolyFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))')), + (110, PolyFromWKB(AsWKB(Polygon(LineString(Point(0, 0), Point(30, 0), Point(30, 30), Point(0, 0)))))); + + INSERT INTO gis_multi_point VALUES + (111, MultiPointFromText('MULTIPOINT(0 0,10 10,10 20,20 20)')), + (112, MPointFromText('MULTIPOINT(1 1,11 11,11 21,21 21)')), + (113, MPointFromWKB(AsWKB(MultiPoint(Point(3, 6), Point(4, 10))))); + + INSERT INTO gis_multi_line VALUES + (114, MultiLineStringFromText('MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48))')), + (115, MLineFromText('MULTILINESTRING((10 48,10 21,10 0))')), + (116, MLineFromWKB(AsWKB(MultiLineString(LineString(Point(1, 2), Point(3, 5)), LineString(Point(2, 5), Point(5, 8), Point(21, 7)))))); + + INSERT INTO gis_multi_polygon VALUES + (117, MultiPolygonFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')), + (118, MPolyFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')), + (119, MPolyFromWKB(AsWKB(MultiPolygon(Polygon(LineString(Point(0, 3), Point(3, 3), Point(3, 0), Point(0, 3))))))); + + INSERT INTO gis_geometrycollection VALUES + (120, GeomCollFromText('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(0 0,10 10))')), + (121, GeometryFromWKB(AsWKB(GeometryCollection(Point(44, 6), LineString(Point(3, 6), Point(7, 9)))))), + (122, GeomFromText('GeometryCollection()')), + (123, GeomFromText('GeometryCollection EMPTY')); + + INSERT into gis_geometry SELECT * FROM gis_point; + INSERT into gis_geometry SELECT * FROM gis_line; + INSERT into gis_geometry SELECT * FROM gis_polygon; + INSERT into gis_geometry SELECT * FROM gis_multi_point; + INSERT into gis_geometry SELECT * FROM gis_multi_line; + INSERT into gis_geometry SELECT * FROM gis_multi_polygon; + INSERT into gis_geometry SELECT * FROM gis_geometrycollection; + + SELECT fid, AsText(g) FROM gis_point; + SELECT fid, AsText(g) FROM gis_line; + SELECT fid, AsText(g) FROM gis_polygon; + SELECT fid, AsText(g) FROM gis_multi_point; + SELECT fid, AsText(g) FROM gis_multi_line; + SELECT fid, AsText(g) FROM gis_multi_polygon; + SELECT fid, AsText(g) FROM gis_geometrycollection; + SELECT fid, AsText(g) FROM gis_geometry; + + SELECT fid, Dimension(g) FROM gis_geometry; + SELECT fid, GeometryType(g) FROM gis_geometry; + SELECT fid, IsEmpty(g) FROM gis_geometry; + SELECT fid, AsText(Envelope(g)) FROM gis_geometry; + + SELECT fid, X(g) FROM gis_point; + SELECT fid, Y(g) FROM gis_point; + + SELECT fid, AsText(StartPoint(g)) FROM gis_line; + SELECT fid, AsText(EndPoint(g)) FROM gis_line; + SELECT fid, GLength(g) FROM gis_line; + SELECT fid, NumPoints(g) FROM gis_line; + SELECT fid, AsText(PointN(g, 2)) FROM gis_line; + SELECT fid, IsClosed(g) FROM gis_line; + + SELECT fid, AsText(Centroid(g)) FROM gis_polygon; + SELECT fid, Area(g) FROM gis_polygon; + SELECT fid, AsText(ExteriorRing(g)) FROM gis_polygon; + SELECT fid, NumInteriorRings(g) FROM gis_polygon; + SELECT fid, AsText(InteriorRingN(g, 1)) FROM gis_polygon; + + SELECT fid, IsClosed(g) FROM gis_multi_line; + + SELECT fid, AsText(Centroid(g)) FROM gis_multi_polygon; + SELECT fid, Area(g) FROM gis_multi_polygon; + + SELECT fid, NumGeometries(g) from gis_multi_point; + SELECT fid, NumGeometries(g) from gis_multi_line; + SELECT fid, NumGeometries(g) from gis_multi_polygon; + SELECT fid, NumGeometries(g) from gis_geometrycollection; + + SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_point; + SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_line; + SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_polygon; + SELECT fid, AsText(GeometryN(g, 2)) from gis_geometrycollection; + SELECT fid, AsText(GeometryN(g, 1)) from gis_geometrycollection; + + SELECT g1.fid as first, g2.fid as second, + Within(g1.g, g2.g) as w, Contains(g1.g, g2.g) as c, Overlaps(g1.g, g2.g) as o, + Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t, + Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r + FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second; + + DROP TABLE gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry; + + + USE gis_ogs; + + --echo # Lakes + INSERT INTO lakes VALUES ( + 101, 'BLUE LAKE', + PolyFromText( + 'POLYGON( + (52 18,66 23,73 9,48 6,52 18), + (59 18,67 18,67 13,59 13,59 18) + )', + 101)); + + --echo # Road Segments + + INSERT INTO road_segments VALUES(102, 'Route 5', NULL, 2, + LineFromText( + 'LINESTRING( 0 18, 10 21, 16 23, 28 26, 44 31 )' ,101)); + + INSERT INTO road_segments VALUES(103, 'Route 5', 'Main Street', 4, + LineFromText( + 'LINESTRING( 44 31, 56 34, 70 38 )' ,101)); + + INSERT INTO road_segments VALUES(104, 'Route 5', NULL, 2, + LineFromText( + 'LINESTRING( 70 38, 72 48 )' ,101)); + + INSERT INTO road_segments VALUES(105, 'Main Street', NULL, 4, + LineFromText( + 'LINESTRING( 70 38, 84 42 )' ,101)); + + INSERT INTO road_segments VALUES(106, 'Dirt Road by Green Forest', NULL, + 1, + LineFromText( + 'LINESTRING( 28 26, 28 0 )',101)); + + --echo # DividedRoutes + + INSERT INTO divided_routes VALUES(119, 'Route 75', 4, + MLineFromText( + 'MULTILINESTRING((10 48,10 21,10 0), + (16 0,16 23,16 48))', 101)); + + --echo # Forests + + INSERT INTO forests VALUES(109, 'Green Forest', + MPolyFromText( + 'MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26), + (52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))', + 101)); + + --echo # Bridges + + INSERT INTO bridges VALUES(110, 'Cam Bridge', PointFromText( + 'POINT( 44 31 )', 101)); + + --echo # Streams + + INSERT INTO streams VALUES(111, 'Cam Stream', + LineFromText( + 'LINESTRING( 38 48, 44 41, 41 36, 44 31, 52 18 )', 101)); + + INSERT INTO streams VALUES(112, NULL, + LineFromText( + 'LINESTRING( 76 0, 78 4, 73 9 )', 101)); + + --echo # Buildings + + INSERT INTO buildings VALUES(113, '123 Main Street', + PointFromText( + 'POINT( 52 30 )', 101), + PolyFromText( + 'POLYGON( ( 50 31, 54 31, 54 29, 50 29, 50 31) )', 101)); + + INSERT INTO buildings VALUES(114, '215 Main Street', + PointFromText( + 'POINT( 64 33 )', 101), + PolyFromText( + 'POLYGON( ( 66 34, 62 34, 62 32, 66 32, 66 34) )', 101)); + + + --echo # Ponds + + INSERT INTO ponds VALUES(120, NULL, 'Stock Pond', + MPolyFromText( + 'MULTIPOLYGON( ( ( 24 44, 22 42, 24 40, 24 44) ), + ( ( 26 44, 26 40, 28 42, 26 44) ) )', 101)); + + --echo # Named Places + + INSERT INTO named_places VALUES(117, 'Ashton', + PolyFromText( + 'POLYGON( ( 62 48, 84 48, 84 30, 56 30, 56 34, 62 48) )', 101)); + + INSERT INTO named_places VALUES(118, 'Goose Island', + PolyFromText( + 'POLYGON( ( 67 13, 67 18, 59 18, 59 13, 67 13) )', 101)); + + --echo # Map Neatlines + + INSERT INTO map_neatlines VALUES(115, + PolyFromText( + 'POLYGON( ( 0 0, 0 48, 84 48, 84 0, 0 0 ) )', 101)); + + SELECT Dimension(shore) + FROM lakes + WHERE name = 'Blue Lake'; + + SELECT GeometryType(centerlines) + FROM divided_routes + WHERE name = 'Route 75'; + + SELECT AsText(boundary) + FROM named_places + WHERE name = 'Goose Island'; + + SELECT AsText(PolyFromWKB(AsBinary(boundary),101)) + FROM named_places + WHERE name = 'Goose Island'; + + SELECT SRID(boundary) + FROM named_places + WHERE name = 'Goose Island'; + + SELECT IsEmpty(centerline) + FROM road_segments + WHERE name = 'Route 5' + AND aliases = 'Main Street'; + + SELECT AsText(Envelope(boundary)) + FROM named_places + WHERE name = 'Goose Island'; + + SELECT X(position) + FROM bridges + WHERE name = 'Cam Bridge'; + + SELECT Y(position) + FROM bridges + WHERE name = 'Cam Bridge'; + + SELECT AsText(StartPoint(centerline)) + FROM road_segments + WHERE fid = 102; + + SELECT AsText(EndPoint(centerline)) + FROM road_segments + WHERE fid = 102; + + SELECT GLength(centerline) + FROM road_segments + WHERE fid = 106; + + SELECT NumPoints(centerline) + FROM road_segments + WHERE fid = 102; + + SELECT AsText(PointN(centerline, 1)) + FROM road_segments + WHERE fid = 102; + + SELECT AsText(Centroid(boundary)) + FROM named_places + WHERE name = 'Goose Island'; + + SELECT Area(boundary) + FROM named_places + WHERE name = 'Goose Island'; + + SELECT AsText(ExteriorRing(shore)) + FROM lakes + WHERE name = 'Blue Lake'; + + SELECT NumInteriorRings(shore) + FROM lakes + WHERE name = 'Blue Lake'; + + SELECT AsText(InteriorRingN(shore, 1)) + FROM lakes + WHERE name = 'Blue Lake'; + + SELECT NumGeometries(centerlines) + FROM divided_routes + WHERE name = 'Route 75'; + + SELECT AsText(GeometryN(centerlines, 2)) + FROM divided_routes + WHERE name = 'Route 75'; + + SELECT IsClosed(centerlines) + FROM divided_routes + WHERE name = 'Route 75'; + + SELECT GLength(centerlines) + FROM divided_routes + WHERE name = 'Route 75'; + + SELECT AsText(Centroid(shores)) + FROM ponds + WHERE fid = 120; + + SELECT Area(shores) + FROM ponds + WHERE fid = 120; + + SELECT ST_Equals(boundary, + PolyFromText('POLYGON( ( 67 13, 67 18, 59 18, 59 13, 67 13) )',1)) + FROM named_places + WHERE name = 'Goose Island'; + + SELECT ST_Disjoint(centerlines, boundary) + FROM divided_routes, named_places + WHERE divided_routes.name = 'Route 75' + AND named_places.name = 'Ashton'; + + SELECT ST_Touches(centerline, shore) + FROM streams, lakes + WHERE streams.name = 'Cam Stream' + AND lakes.name = 'Blue Lake'; + + SELECT Crosses(road_segments.centerline, divided_routes.centerlines) + FROM road_segments, divided_routes + WHERE road_segments.fid = 102 + AND divided_routes.name = 'Route 75'; + + SELECT ST_Intersects(road_segments.centerline, divided_routes.centerlines) + FROM road_segments, divided_routes + WHERE road_segments.fid = 102 + AND divided_routes.name = 'Route 75'; + + SELECT ST_Contains(forests.boundary, named_places.boundary) + FROM forests, named_places + WHERE forests.name = 'Green Forest' + AND named_places.name = 'Ashton'; + + SELECT ST_Distance(position, boundary) + FROM bridges, named_places + WHERE bridges.name = 'Cam Bridge' + AND named_places.name = 'Ashton'; + + SELECT AsText(ST_Difference(named_places.boundary, forests.boundary)) + FROM named_places, forests + WHERE named_places.name = 'Ashton' + AND forests.name = 'Green Forest'; + + SELECT AsText(ST_Union(shore, boundary)) + FROM lakes, named_places + WHERE lakes.name = 'Blue Lake' + AND named_places.name = 'Goose Island'; + + SELECT AsText(ST_SymDifference(shore, boundary)) + FROM lakes, named_places + WHERE lakes.name = 'Blue Lake' + AND named_places.name = 'Ashton'; + + SELECT count(*) + FROM buildings, bridges + WHERE ST_Contains(ST_Buffer(bridges.position, 15.0), buildings.footprint) = 1; + +} + +DROP DATABASE gis_ogs; +USE test; + + diff --git a/mysql-test/suite/storage_engine/type_spatial.result b/mysql-test/suite/storage_engine/type_spatial.result new file mode 100644 index 00000000000..c6b856ab8b0 --- /dev/null +++ b/mysql-test/suite/storage_engine/type_spatial.result @@ -0,0 +1,700 @@ +DROP TABLE IF EXISTS t1, gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry; +DROP DATABASE IF EXISTS gis_ogs; +CREATE DATABASE gis_ogs; +CREATE TABLE gis_point (fid <INT_COLUMN>, g POINT) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE gis_line (fid <INT_COLUMN>, g LINESTRING) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE gis_polygon (fid <INT_COLUMN>, g POLYGON) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE gis_multi_point (fid <INT_COLUMN>, g MULTIPOINT) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE gis_multi_line (fid <INT_COLUMN>, g MULTILINESTRING) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE gis_multi_polygon (fid <INT_COLUMN>, g MULTIPOLYGON) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE gis_geometrycollection (fid <INT_COLUMN>, g GEOMETRYCOLLECTION) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE gis_geometry (fid <INT_COLUMN>, g GEOMETRY) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +USE gis_ogs; +CREATE TABLE lakes (fid INT <CUSTOM_COL_OPTIONS>, +name CHAR(64) <CUSTOM_COL_OPTIONS>, +shore POLYGON) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE road_segments (fid INT <CUSTOM_COL_OPTIONS>, +name CHAR(64) <CUSTOM_COL_OPTIONS>, +aliases CHAR(64) <CUSTOM_COL_OPTIONS>, +num_lanes INT <CUSTOM_COL_OPTIONS>, +centerline LINESTRING) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE divided_routes (fid INT <CUSTOM_COL_OPTIONS>, +name CHAR(64) <CUSTOM_COL_OPTIONS>, +num_lanes INT <CUSTOM_COL_OPTIONS>, +centerlines MULTILINESTRING) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE forests (fid INT <CUSTOM_COL_OPTIONS>, +name CHAR(64) <CUSTOM_COL_OPTIONS>, +boundary MULTIPOLYGON) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE bridges (fid INT <CUSTOM_COL_OPTIONS>, +name CHAR(64) <CUSTOM_COL_OPTIONS>, +position POINT) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE streams (fid INT <CUSTOM_COL_OPTIONS>, +name CHAR(64) <CUSTOM_COL_OPTIONS>, +centerline LINESTRING) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE buildings (fid INT <CUSTOM_COL_OPTIONS>, +name CHAR(64) <CUSTOM_COL_OPTIONS>, +position POINT, +footprint POLYGON) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE ponds (fid INT <CUSTOM_COL_OPTIONS>, +name CHAR(64) <CUSTOM_COL_OPTIONS>, +type CHAR(64) <CUSTOM_COL_OPTIONS>, +shores MULTIPOLYGON) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE named_places (fid INT <CUSTOM_COL_OPTIONS>, +name CHAR(64) <CUSTOM_COL_OPTIONS>, +boundary POLYGON) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE map_neatlines (fid INT <CUSTOM_COL_OPTIONS>, +neatline POLYGON) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +USE test; +SHOW FIELDS FROM gis_point; +Field Type Null Key Default Extra +fid int(11) YES NULL +g point YES NULL +SHOW FIELDS FROM gis_line; +Field Type Null Key Default Extra +fid int(11) YES NULL +g linestring YES NULL +SHOW FIELDS FROM gis_polygon; +Field Type Null Key Default Extra +fid int(11) YES NULL +g polygon YES NULL +SHOW FIELDS FROM gis_multi_point; +Field Type Null Key Default Extra +fid int(11) YES NULL +g multipoint YES NULL +SHOW FIELDS FROM gis_multi_line; +Field Type Null Key Default Extra +fid int(11) YES NULL +g multilinestring YES NULL +SHOW FIELDS FROM gis_multi_polygon; +Field Type Null Key Default Extra +fid int(11) YES NULL +g multipolygon YES NULL +SHOW FIELDS FROM gis_geometrycollection; +Field Type Null Key Default Extra +fid int(11) YES NULL +g geometrycollection YES NULL +SHOW FIELDS FROM gis_geometry; +Field Type Null Key Default Extra +fid int(11) YES NULL +g geometry YES NULL +INSERT INTO gis_point VALUES +(101, PointFromText('POINT(10 10)')), +(102, PointFromText('POINT(20 10)')), +(103, PointFromText('POINT(20 20)')), +(104, PointFromWKB(AsWKB(PointFromText('POINT(10 20)')))); +INSERT INTO gis_line VALUES +(105, LineFromText('LINESTRING(0 0,0 10,10 0)')), +(106, LineStringFromText('LINESTRING(10 10,20 10,20 20,10 20,10 10)')), +(107, LineStringFromWKB(AsWKB(LineString(Point(10, 10), Point(40, 10))))); +INSERT INTO gis_polygon VALUES +(108, PolygonFromText('POLYGON((10 10,20 10,20 20,10 20,10 10))')), +(109, PolyFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))')), +(110, PolyFromWKB(AsWKB(Polygon(LineString(Point(0, 0), Point(30, 0), Point(30, 30), Point(0, 0)))))); +INSERT INTO gis_multi_point VALUES +(111, MultiPointFromText('MULTIPOINT(0 0,10 10,10 20,20 20)')), +(112, MPointFromText('MULTIPOINT(1 1,11 11,11 21,21 21)')), +(113, MPointFromWKB(AsWKB(MultiPoint(Point(3, 6), Point(4, 10))))); +INSERT INTO gis_multi_line VALUES +(114, MultiLineStringFromText('MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48))')), +(115, MLineFromText('MULTILINESTRING((10 48,10 21,10 0))')), +(116, MLineFromWKB(AsWKB(MultiLineString(LineString(Point(1, 2), Point(3, 5)), LineString(Point(2, 5), Point(5, 8), Point(21, 7)))))); +INSERT INTO gis_multi_polygon VALUES +(117, MultiPolygonFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')), +(118, MPolyFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')), +(119, MPolyFromWKB(AsWKB(MultiPolygon(Polygon(LineString(Point(0, 3), Point(3, 3), Point(3, 0), Point(0, 3))))))); +INSERT INTO gis_geometrycollection VALUES +(120, GeomCollFromText('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(0 0,10 10))')), +(121, GeometryFromWKB(AsWKB(GeometryCollection(Point(44, 6), LineString(Point(3, 6), Point(7, 9)))))), +(122, GeomFromText('GeometryCollection()')), +(123, GeomFromText('GeometryCollection EMPTY')); +INSERT into gis_geometry SELECT * FROM gis_point; +INSERT into gis_geometry SELECT * FROM gis_line; +INSERT into gis_geometry SELECT * FROM gis_polygon; +INSERT into gis_geometry SELECT * FROM gis_multi_point; +INSERT into gis_geometry SELECT * FROM gis_multi_line; +INSERT into gis_geometry SELECT * FROM gis_multi_polygon; +INSERT into gis_geometry SELECT * FROM gis_geometrycollection; +SELECT fid, AsText(g) FROM gis_point; +fid AsText(g) +101 POINT(10 10) +102 POINT(20 10) +103 POINT(20 20) +104 POINT(10 20) +SELECT fid, AsText(g) FROM gis_line; +fid AsText(g) +105 LINESTRING(0 0,0 10,10 0) +106 LINESTRING(10 10,20 10,20 20,10 20,10 10) +107 LINESTRING(10 10,40 10) +SELECT fid, AsText(g) FROM gis_polygon; +fid AsText(g) +108 POLYGON((10 10,20 10,20 20,10 20,10 10)) +109 POLYGON((0 0,50 0,50 50,0 50,0 0),(10 10,20 10,20 20,10 20,10 10)) +110 POLYGON((0 0,30 0,30 30,0 0)) +SELECT fid, AsText(g) FROM gis_multi_point; +fid AsText(g) +111 MULTIPOINT(0 0,10 10,10 20,20 20) +112 MULTIPOINT(1 1,11 11,11 21,21 21) +113 MULTIPOINT(3 6,4 10) +SELECT fid, AsText(g) FROM gis_multi_line; +fid AsText(g) +114 MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48)) +115 MULTILINESTRING((10 48,10 21,10 0)) +116 MULTILINESTRING((1 2,3 5),(2 5,5 8,21 7)) +SELECT fid, AsText(g) FROM gis_multi_polygon; +fid AsText(g) +117 MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18))) +118 MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18))) +119 MULTIPOLYGON(((0 3,3 3,3 0,0 3))) +SELECT fid, AsText(g) FROM gis_geometrycollection; +fid AsText(g) +120 GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(0 0,10 10)) +121 GEOMETRYCOLLECTION(POINT(44 6),LINESTRING(3 6,7 9)) +122 GEOMETRYCOLLECTION EMPTY +123 GEOMETRYCOLLECTION EMPTY +SELECT fid, AsText(g) FROM gis_geometry; +fid AsText(g) +101 POINT(10 10) +102 POINT(20 10) +103 POINT(20 20) +104 POINT(10 20) +105 LINESTRING(0 0,0 10,10 0) +106 LINESTRING(10 10,20 10,20 20,10 20,10 10) +107 LINESTRING(10 10,40 10) +108 POLYGON((10 10,20 10,20 20,10 20,10 10)) +109 POLYGON((0 0,50 0,50 50,0 50,0 0),(10 10,20 10,20 20,10 20,10 10)) +110 POLYGON((0 0,30 0,30 30,0 0)) +111 MULTIPOINT(0 0,10 10,10 20,20 20) +112 MULTIPOINT(1 1,11 11,11 21,21 21) +113 MULTIPOINT(3 6,4 10) +114 MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48)) +115 MULTILINESTRING((10 48,10 21,10 0)) +116 MULTILINESTRING((1 2,3 5),(2 5,5 8,21 7)) +117 MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18))) +118 MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18))) +119 MULTIPOLYGON(((0 3,3 3,3 0,0 3))) +120 GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(0 0,10 10)) +121 GEOMETRYCOLLECTION(POINT(44 6),LINESTRING(3 6,7 9)) +122 GEOMETRYCOLLECTION EMPTY +123 GEOMETRYCOLLECTION EMPTY +SELECT fid, Dimension(g) FROM gis_geometry; +fid Dimension(g) +101 0 +102 0 +103 0 +104 0 +105 1 +106 1 +107 1 +108 2 +109 2 +110 2 +111 0 +112 0 +113 0 +114 1 +115 1 +116 1 +117 2 +118 2 +119 2 +120 1 +121 1 +122 0 +123 0 +SELECT fid, GeometryType(g) FROM gis_geometry; +fid GeometryType(g) +101 POINT +102 POINT +103 POINT +104 POINT +105 LINESTRING +106 LINESTRING +107 LINESTRING +108 POLYGON +109 POLYGON +110 POLYGON +111 MULTIPOINT +112 MULTIPOINT +113 MULTIPOINT +114 MULTILINESTRING +115 MULTILINESTRING +116 MULTILINESTRING +117 MULTIPOLYGON +118 MULTIPOLYGON +119 MULTIPOLYGON +120 GEOMETRYCOLLECTION +121 GEOMETRYCOLLECTION +122 GEOMETRYCOLLECTION +123 GEOMETRYCOLLECTION +SELECT fid, IsEmpty(g) FROM gis_geometry; +fid IsEmpty(g) +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +SELECT fid, AsText(Envelope(g)) FROM gis_geometry; +fid AsText(Envelope(g)) +101 POLYGON((10 10,10 10,10 10,10 10,10 10)) +102 POLYGON((20 10,20 10,20 10,20 10,20 10)) +103 POLYGON((20 20,20 20,20 20,20 20,20 20)) +104 POLYGON((10 20,10 20,10 20,10 20,10 20)) +105 POLYGON((0 0,10 0,10 10,0 10,0 0)) +106 POLYGON((10 10,20 10,20 20,10 20,10 10)) +107 POLYGON((10 10,40 10,40 10,10 10,10 10)) +108 POLYGON((10 10,20 10,20 20,10 20,10 10)) +109 POLYGON((0 0,50 0,50 50,0 50,0 0)) +110 POLYGON((0 0,30 0,30 30,0 30,0 0)) +111 POLYGON((0 0,20 0,20 20,0 20,0 0)) +112 POLYGON((1 1,21 1,21 21,1 21,1 1)) +113 POLYGON((3 6,4 6,4 10,3 10,3 6)) +114 POLYGON((10 0,16 0,16 48,10 48,10 0)) +115 POLYGON((10 0,10 0,10 48,10 48,10 0)) +116 POLYGON((1 2,21 2,21 8,1 8,1 2)) +117 POLYGON((28 0,84 0,84 42,28 42,28 0)) +118 POLYGON((28 0,84 0,84 42,28 42,28 0)) +119 POLYGON((0 0,3 0,3 3,0 3,0 0)) +120 POLYGON((0 0,10 0,10 10,0 10,0 0)) +121 POLYGON((3 6,44 6,44 9,3 9,3 6)) +122 GEOMETRYCOLLECTION EMPTY +123 GEOMETRYCOLLECTION EMPTY +SELECT fid, X(g) FROM gis_point; +fid X(g) +101 10 +102 20 +103 20 +104 10 +SELECT fid, Y(g) FROM gis_point; +fid Y(g) +101 10 +102 10 +103 20 +104 20 +SELECT fid, AsText(StartPoint(g)) FROM gis_line; +fid AsText(StartPoint(g)) +105 POINT(0 0) +106 POINT(10 10) +107 POINT(10 10) +SELECT fid, AsText(EndPoint(g)) FROM gis_line; +fid AsText(EndPoint(g)) +105 POINT(10 0) +106 POINT(10 10) +107 POINT(40 10) +SELECT fid, GLength(g) FROM gis_line; +fid GLength(g) +105 24.14213562373095 +106 40 +107 30 +SELECT fid, NumPoints(g) FROM gis_line; +fid NumPoints(g) +105 3 +106 5 +107 2 +SELECT fid, AsText(PointN(g, 2)) FROM gis_line; +fid AsText(PointN(g, 2)) +105 POINT(0 10) +106 POINT(20 10) +107 POINT(40 10) +SELECT fid, IsClosed(g) FROM gis_line; +fid IsClosed(g) +105 0 +106 1 +107 0 +SELECT fid, AsText(Centroid(g)) FROM gis_polygon; +fid AsText(Centroid(g)) +108 POINT(15 15) +109 POINT(25.416666666666668 25.416666666666668) +110 POINT(20 10) +SELECT fid, Area(g) FROM gis_polygon; +fid Area(g) +108 100 +109 2400 +110 450 +SELECT fid, AsText(ExteriorRing(g)) FROM gis_polygon; +fid AsText(ExteriorRing(g)) +108 LINESTRING(10 10,20 10,20 20,10 20,10 10) +109 LINESTRING(0 0,50 0,50 50,0 50,0 0) +110 LINESTRING(0 0,30 0,30 30,0 0) +SELECT fid, NumInteriorRings(g) FROM gis_polygon; +fid NumInteriorRings(g) +108 0 +109 1 +110 0 +SELECT fid, AsText(InteriorRingN(g, 1)) FROM gis_polygon; +fid AsText(InteriorRingN(g, 1)) +108 NULL +109 LINESTRING(10 10,20 10,20 20,10 20,10 10) +110 NULL +SELECT fid, IsClosed(g) FROM gis_multi_line; +fid IsClosed(g) +114 0 +115 0 +116 0 +SELECT fid, AsText(Centroid(g)) FROM gis_multi_polygon; +fid AsText(Centroid(g)) +117 POINT(55.58852775304245 17.426536064113982) +118 POINT(55.58852775304245 17.426536064113982) +119 POINT(2 2) +SELECT fid, Area(g) FROM gis_multi_polygon; +fid Area(g) +117 1684.5 +118 1684.5 +119 4.5 +SELECT fid, NumGeometries(g) from gis_multi_point; +fid NumGeometries(g) +111 4 +112 4 +113 2 +SELECT fid, NumGeometries(g) from gis_multi_line; +fid NumGeometries(g) +114 2 +115 1 +116 2 +SELECT fid, NumGeometries(g) from gis_multi_polygon; +fid NumGeometries(g) +117 2 +118 2 +119 1 +SELECT fid, NumGeometries(g) from gis_geometrycollection; +fid NumGeometries(g) +120 2 +121 2 +122 0 +123 0 +SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_point; +fid AsText(GeometryN(g, 2)) +111 POINT(10 10) +112 POINT(11 11) +113 POINT(4 10) +SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_line; +fid AsText(GeometryN(g, 2)) +114 LINESTRING(16 0,16 23,16 48) +115 NULL +116 LINESTRING(2 5,5 8,21 7) +SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_polygon; +fid AsText(GeometryN(g, 2)) +117 POLYGON((59 18,67 18,67 13,59 13,59 18)) +118 POLYGON((59 18,67 18,67 13,59 13,59 18)) +119 NULL +SELECT fid, AsText(GeometryN(g, 2)) from gis_geometrycollection; +fid AsText(GeometryN(g, 2)) +120 LINESTRING(0 0,10 10) +121 LINESTRING(3 6,7 9) +122 NULL +123 NULL +SELECT fid, AsText(GeometryN(g, 1)) from gis_geometrycollection; +fid AsText(GeometryN(g, 1)) +120 POINT(0 0) +121 POINT(44 6) +122 NULL +123 NULL +SELECT g1.fid as first, g2.fid as second, +Within(g1.g, g2.g) as w, Contains(g1.g, g2.g) as c, Overlaps(g1.g, g2.g) as o, +Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t, +Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r +FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second; +first second w c o e d t i r +120 120 1 1 0 1 0 1 1 0 +120 121 0 0 1 0 0 0 1 0 +120 122 0 1 NULL 0 NULL 0 NULL 0 +120 123 0 1 NULL 0 NULL 0 NULL 0 +121 120 0 0 1 0 0 0 1 0 +121 121 1 1 0 1 0 1 1 0 +121 122 0 1 NULL 0 NULL 0 NULL 0 +121 123 0 1 NULL 0 NULL 0 NULL 0 +122 120 1 0 NULL 0 NULL 0 NULL 0 +122 121 1 0 NULL 0 NULL 0 NULL 0 +122 122 1 1 NULL 1 NULL 0 NULL 0 +122 123 1 1 NULL 1 NULL 0 NULL 0 +123 120 1 0 NULL 0 NULL 0 NULL 0 +123 121 1 0 NULL 0 NULL 0 NULL 0 +123 122 1 1 NULL 1 NULL 0 NULL 0 +123 123 1 1 NULL 1 NULL 0 NULL 0 +DROP TABLE gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry; +USE gis_ogs; +# Lakes +INSERT INTO lakes VALUES ( +101, 'BLUE LAKE', +PolyFromText( +'POLYGON( + (52 18,66 23,73 9,48 6,52 18), + (59 18,67 18,67 13,59 13,59 18) + )', +101)); +# Road Segments +INSERT INTO road_segments VALUES(102, 'Route 5', NULL, 2, +LineFromText( +'LINESTRING( 0 18, 10 21, 16 23, 28 26, 44 31 )' ,101)); +INSERT INTO road_segments VALUES(103, 'Route 5', 'Main Street', 4, +LineFromText( +'LINESTRING( 44 31, 56 34, 70 38 )' ,101)); +INSERT INTO road_segments VALUES(104, 'Route 5', NULL, 2, +LineFromText( +'LINESTRING( 70 38, 72 48 )' ,101)); +INSERT INTO road_segments VALUES(105, 'Main Street', NULL, 4, +LineFromText( +'LINESTRING( 70 38, 84 42 )' ,101)); +INSERT INTO road_segments VALUES(106, 'Dirt Road by Green Forest', NULL, +1, +LineFromText( +'LINESTRING( 28 26, 28 0 )',101)); +# DividedRoutes +INSERT INTO divided_routes VALUES(119, 'Route 75', 4, +MLineFromText( +'MULTILINESTRING((10 48,10 21,10 0), + (16 0,16 23,16 48))', 101)); +# Forests +INSERT INTO forests VALUES(109, 'Green Forest', +MPolyFromText( +'MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26), + (52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))', +101)); +# Bridges +INSERT INTO bridges VALUES(110, 'Cam Bridge', PointFromText( +'POINT( 44 31 )', 101)); +# Streams +INSERT INTO streams VALUES(111, 'Cam Stream', +LineFromText( +'LINESTRING( 38 48, 44 41, 41 36, 44 31, 52 18 )', 101)); +INSERT INTO streams VALUES(112, NULL, +LineFromText( +'LINESTRING( 76 0, 78 4, 73 9 )', 101)); +# Buildings +INSERT INTO buildings VALUES(113, '123 Main Street', +PointFromText( +'POINT( 52 30 )', 101), +PolyFromText( +'POLYGON( ( 50 31, 54 31, 54 29, 50 29, 50 31) )', 101)); +INSERT INTO buildings VALUES(114, '215 Main Street', +PointFromText( +'POINT( 64 33 )', 101), +PolyFromText( +'POLYGON( ( 66 34, 62 34, 62 32, 66 32, 66 34) )', 101)); +# Ponds +INSERT INTO ponds VALUES(120, NULL, 'Stock Pond', +MPolyFromText( +'MULTIPOLYGON( ( ( 24 44, 22 42, 24 40, 24 44) ), + ( ( 26 44, 26 40, 28 42, 26 44) ) )', 101)); +# Named Places +INSERT INTO named_places VALUES(117, 'Ashton', +PolyFromText( +'POLYGON( ( 62 48, 84 48, 84 30, 56 30, 56 34, 62 48) )', 101)); +INSERT INTO named_places VALUES(118, 'Goose Island', +PolyFromText( +'POLYGON( ( 67 13, 67 18, 59 18, 59 13, 67 13) )', 101)); +# Map Neatlines +INSERT INTO map_neatlines VALUES(115, +PolyFromText( +'POLYGON( ( 0 0, 0 48, 84 48, 84 0, 0 0 ) )', 101)); +SELECT Dimension(shore) +FROM lakes +WHERE name = 'Blue Lake'; +Dimension(shore) +2 +SELECT GeometryType(centerlines) +FROM divided_routes +WHERE name = 'Route 75'; +GeometryType(centerlines) +MULTILINESTRING +SELECT AsText(boundary) +FROM named_places +WHERE name = 'Goose Island'; +AsText(boundary) +POLYGON((67 13,67 18,59 18,59 13,67 13)) +SELECT AsText(PolyFromWKB(AsBinary(boundary),101)) +FROM named_places +WHERE name = 'Goose Island'; +AsText(PolyFromWKB(AsBinary(boundary),101)) +POLYGON((67 13,67 18,59 18,59 13,67 13)) +SELECT SRID(boundary) +FROM named_places +WHERE name = 'Goose Island'; +SRID(boundary) +101 +SELECT IsEmpty(centerline) +FROM road_segments +WHERE name = 'Route 5' +AND aliases = 'Main Street'; +IsEmpty(centerline) +0 +SELECT AsText(Envelope(boundary)) +FROM named_places +WHERE name = 'Goose Island'; +AsText(Envelope(boundary)) +POLYGON((59 13,67 13,67 18,59 18,59 13)) +SELECT X(position) +FROM bridges +WHERE name = 'Cam Bridge'; +X(position) +44 +SELECT Y(position) +FROM bridges +WHERE name = 'Cam Bridge'; +Y(position) +31 +SELECT AsText(StartPoint(centerline)) +FROM road_segments +WHERE fid = 102; +AsText(StartPoint(centerline)) +POINT(0 18) +SELECT AsText(EndPoint(centerline)) +FROM road_segments +WHERE fid = 102; +AsText(EndPoint(centerline)) +POINT(44 31) +SELECT GLength(centerline) +FROM road_segments +WHERE fid = 106; +GLength(centerline) +26 +SELECT NumPoints(centerline) +FROM road_segments +WHERE fid = 102; +NumPoints(centerline) +5 +SELECT AsText(PointN(centerline, 1)) +FROM road_segments +WHERE fid = 102; +AsText(PointN(centerline, 1)) +POINT(0 18) +SELECT AsText(Centroid(boundary)) +FROM named_places +WHERE name = 'Goose Island'; +AsText(Centroid(boundary)) +POINT(63 15.5) +SELECT Area(boundary) +FROM named_places +WHERE name = 'Goose Island'; +Area(boundary) +40 +SELECT AsText(ExteriorRing(shore)) +FROM lakes +WHERE name = 'Blue Lake'; +AsText(ExteriorRing(shore)) +LINESTRING(52 18,66 23,73 9,48 6,52 18) +SELECT NumInteriorRings(shore) +FROM lakes +WHERE name = 'Blue Lake'; +NumInteriorRings(shore) +1 +SELECT AsText(InteriorRingN(shore, 1)) +FROM lakes +WHERE name = 'Blue Lake'; +AsText(InteriorRingN(shore, 1)) +LINESTRING(59 18,67 18,67 13,59 13,59 18) +SELECT NumGeometries(centerlines) +FROM divided_routes +WHERE name = 'Route 75'; +NumGeometries(centerlines) +2 +SELECT AsText(GeometryN(centerlines, 2)) +FROM divided_routes +WHERE name = 'Route 75'; +AsText(GeometryN(centerlines, 2)) +LINESTRING(16 0,16 23,16 48) +SELECT IsClosed(centerlines) +FROM divided_routes +WHERE name = 'Route 75'; +IsClosed(centerlines) +0 +SELECT GLength(centerlines) +FROM divided_routes +WHERE name = 'Route 75'; +GLength(centerlines) +96 +SELECT AsText(Centroid(shores)) +FROM ponds +WHERE fid = 120; +AsText(Centroid(shores)) +POINT(25 42) +SELECT Area(shores) +FROM ponds +WHERE fid = 120; +Area(shores) +8 +SELECT ST_Equals(boundary, +PolyFromText('POLYGON( ( 67 13, 67 18, 59 18, 59 13, 67 13) )',1)) +FROM named_places +WHERE name = 'Goose Island'; +ST_Equals(boundary, +PolyFromText('POLYGON( ( 67 13, 67 18, 59 18, 59 13, 67 13) )',1)) +1 +SELECT ST_Disjoint(centerlines, boundary) +FROM divided_routes, named_places +WHERE divided_routes.name = 'Route 75' +AND named_places.name = 'Ashton'; +ST_Disjoint(centerlines, boundary) +1 +SELECT ST_Touches(centerline, shore) +FROM streams, lakes +WHERE streams.name = 'Cam Stream' +AND lakes.name = 'Blue Lake'; +ST_Touches(centerline, shore) +1 +SELECT Crosses(road_segments.centerline, divided_routes.centerlines) +FROM road_segments, divided_routes +WHERE road_segments.fid = 102 +AND divided_routes.name = 'Route 75'; +Crosses(road_segments.centerline, divided_routes.centerlines) +1 +SELECT ST_Intersects(road_segments.centerline, divided_routes.centerlines) +FROM road_segments, divided_routes +WHERE road_segments.fid = 102 +AND divided_routes.name = 'Route 75'; +ST_Intersects(road_segments.centerline, divided_routes.centerlines) +1 +SELECT ST_Contains(forests.boundary, named_places.boundary) +FROM forests, named_places +WHERE forests.name = 'Green Forest' +AND named_places.name = 'Ashton'; +ST_Contains(forests.boundary, named_places.boundary) +0 +SELECT ST_Distance(position, boundary) +FROM bridges, named_places +WHERE bridges.name = 'Cam Bridge' +AND named_places.name = 'Ashton'; +ST_Distance(position, boundary) +12 +SELECT AsText(ST_Difference(named_places.boundary, forests.boundary)) +FROM named_places, forests +WHERE named_places.name = 'Ashton' +AND forests.name = 'Green Forest'; +AsText(ST_Difference(named_places.boundary, forests.boundary)) +POLYGON((56 34,62 48,84 48,84 42,56 34)) +SELECT AsText(ST_Union(shore, boundary)) +FROM lakes, named_places +WHERE lakes.name = 'Blue Lake' +AND named_places.name = 'Goose Island'; +AsText(ST_Union(shore, boundary)) +POLYGON((48 6,52 18,66 23,73 9,48 6)) +SELECT AsText(ST_SymDifference(shore, boundary)) +FROM lakes, named_places +WHERE lakes.name = 'Blue Lake' +AND named_places.name = 'Ashton'; +AsText(ST_SymDifference(shore, boundary)) +MULTIPOLYGON(((48 6,52 18,66 23,73 9,48 6),(59 13,59 18,67 18,67 13,59 13)),((56 30,56 34,62 48,84 48,84 30,56 30))) +SELECT count(*) +FROM buildings, bridges +WHERE ST_Contains(ST_Buffer(bridges.position, 15.0), buildings.footprint) = 1; +count(*) +1 +DROP DATABASE gis_ogs; +USE test; diff --git a/mysql-test/suite/storage_engine/type_spatial.test b/mysql-test/suite/storage_engine/type_spatial.test new file mode 100644 index 00000000000..e71805c5516 --- /dev/null +++ b/mysql-test/suite/storage_engine/type_spatial.test @@ -0,0 +1,10 @@ +# +# Spatial objects +# + +--source have_engine.inc + +--source type_spatial.inc + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/type_spatial_indexes.result b/mysql-test/suite/storage_engine/type_spatial_indexes.result new file mode 100644 index 00000000000..a3c2a4d4e75 --- /dev/null +++ b/mysql-test/suite/storage_engine/type_spatial_indexes.result @@ -0,0 +1,1400 @@ +DROP TABLE IF EXISTS t1, gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry; +DROP DATABASE IF EXISTS gis_ogs; +CREATE DATABASE gis_ogs; +CREATE TABLE gis_point (fid <INT_COLUMN>, g POINT, <CUSTOM_INDEX> g(g(128))) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE gis_line (fid <INT_COLUMN>, g LINESTRING, <CUSTOM_INDEX> g(g(256))) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE gis_polygon (fid <INT_COLUMN>, g POLYGON, <CUSTOM_INDEX> g(g(512))) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE gis_multi_point (fid <INT_COLUMN>, g MULTIPOINT, <CUSTOM_INDEX> g(g(128))) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE gis_multi_line (fid <INT_COLUMN>, g MULTILINESTRING, <CUSTOM_INDEX> g(g(256))) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE gis_multi_polygon (fid <INT_COLUMN>, g MULTIPOLYGON) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE gis_geometrycollection (fid <INT_COLUMN>, g GEOMETRYCOLLECTION) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE gis_geometry (fid <INT_COLUMN>, g GEOMETRY) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +USE gis_ogs; +CREATE TABLE lakes (fid INT <CUSTOM_COL_OPTIONS>, +name CHAR(64) <CUSTOM_COL_OPTIONS>, +shore POLYGON, <CUSTOM_INDEX> s(shore(64))) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE road_segments (fid INT <CUSTOM_COL_OPTIONS>, +name CHAR(64) <CUSTOM_COL_OPTIONS>, +aliases CHAR(64) <CUSTOM_COL_OPTIONS>, +num_lanes INT <CUSTOM_COL_OPTIONS>, +centerline LINESTRING, <CUSTOM_INDEX> c(centerline(128))) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE divided_routes (fid INT <CUSTOM_COL_OPTIONS>, +name CHAR(64) <CUSTOM_COL_OPTIONS>, +num_lanes INT <CUSTOM_COL_OPTIONS>, +centerlines MULTILINESTRING, <CUSTOM_INDEX> c(centerlines(512))) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE forests (fid INT <CUSTOM_COL_OPTIONS>, +name CHAR(64) <CUSTOM_COL_OPTIONS>, +boundary MULTIPOLYGON, <CUSTOM_INDEX> b(boundary(128))) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE bridges (fid INT <CUSTOM_COL_OPTIONS>, +name CHAR(64) <CUSTOM_COL_OPTIONS>, +position POINT, <CUSTOM_INDEX> p(`position`(64))) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE streams (fid INT <CUSTOM_COL_OPTIONS>, +name CHAR(64) <CUSTOM_COL_OPTIONS>, +centerline LINESTRING, <CUSTOM_INDEX> c(centerline(256))) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE buildings (fid INT <CUSTOM_COL_OPTIONS>, +name CHAR(64) <CUSTOM_COL_OPTIONS>, +position POINT, +footprint POLYGON, <CUSTOM_INDEX> p(`position`(64)), <CUSTOM_INDEX> f(footprint(128))) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE ponds (fid INT <CUSTOM_COL_OPTIONS>, +name CHAR(64) <CUSTOM_COL_OPTIONS>, +type CHAR(64) <CUSTOM_COL_OPTIONS>, +shores MULTIPOLYGON, <CUSTOM_INDEX> s(shores(256))) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE named_places (fid INT <CUSTOM_COL_OPTIONS>, +name CHAR(64) <CUSTOM_COL_OPTIONS>, +boundary POLYGON, <CUSTOM_INDEX> b(boundary(512))) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE map_neatlines (fid INT <CUSTOM_COL_OPTIONS>, +neatline POLYGON, <CUSTOM_INDEX> n(neatline(700))) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +USE test; +SHOW FIELDS FROM gis_point; +Field Type Null Key Default Extra +fid int(11) YES NULL +g point YES MUL NULL +SHOW FIELDS FROM gis_line; +Field Type Null Key Default Extra +fid int(11) YES NULL +g linestring YES MUL NULL +SHOW FIELDS FROM gis_polygon; +Field Type Null Key Default Extra +fid int(11) YES NULL +g polygon YES MUL NULL +SHOW FIELDS FROM gis_multi_point; +Field Type Null Key Default Extra +fid int(11) YES NULL +g multipoint YES MUL NULL +SHOW FIELDS FROM gis_multi_line; +Field Type Null Key Default Extra +fid int(11) YES NULL +g multilinestring YES MUL NULL +SHOW FIELDS FROM gis_multi_polygon; +Field Type Null Key Default Extra +fid int(11) YES NULL +g multipolygon YES NULL +SHOW FIELDS FROM gis_geometrycollection; +Field Type Null Key Default Extra +fid int(11) YES NULL +g geometrycollection YES NULL +SHOW FIELDS FROM gis_geometry; +Field Type Null Key Default Extra +fid int(11) YES NULL +g geometry YES NULL +INSERT INTO gis_point VALUES +(101, PointFromText('POINT(10 10)')), +(102, PointFromText('POINT(20 10)')), +(103, PointFromText('POINT(20 20)')), +(104, PointFromWKB(AsWKB(PointFromText('POINT(10 20)')))); +INSERT INTO gis_line VALUES +(105, LineFromText('LINESTRING(0 0,0 10,10 0)')), +(106, LineStringFromText('LINESTRING(10 10,20 10,20 20,10 20,10 10)')), +(107, LineStringFromWKB(AsWKB(LineString(Point(10, 10), Point(40, 10))))); +INSERT INTO gis_polygon VALUES +(108, PolygonFromText('POLYGON((10 10,20 10,20 20,10 20,10 10))')), +(109, PolyFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))')), +(110, PolyFromWKB(AsWKB(Polygon(LineString(Point(0, 0), Point(30, 0), Point(30, 30), Point(0, 0)))))); +INSERT INTO gis_multi_point VALUES +(111, MultiPointFromText('MULTIPOINT(0 0,10 10,10 20,20 20)')), +(112, MPointFromText('MULTIPOINT(1 1,11 11,11 21,21 21)')), +(113, MPointFromWKB(AsWKB(MultiPoint(Point(3, 6), Point(4, 10))))); +INSERT INTO gis_multi_line VALUES +(114, MultiLineStringFromText('MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48))')), +(115, MLineFromText('MULTILINESTRING((10 48,10 21,10 0))')), +(116, MLineFromWKB(AsWKB(MultiLineString(LineString(Point(1, 2), Point(3, 5)), LineString(Point(2, 5), Point(5, 8), Point(21, 7)))))); +INSERT INTO gis_multi_polygon VALUES +(117, MultiPolygonFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')), +(118, MPolyFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')), +(119, MPolyFromWKB(AsWKB(MultiPolygon(Polygon(LineString(Point(0, 3), Point(3, 3), Point(3, 0), Point(0, 3))))))); +INSERT INTO gis_geometrycollection VALUES +(120, GeomCollFromText('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(0 0,10 10))')), +(121, GeometryFromWKB(AsWKB(GeometryCollection(Point(44, 6), LineString(Point(3, 6), Point(7, 9)))))), +(122, GeomFromText('GeometryCollection()')), +(123, GeomFromText('GeometryCollection EMPTY')); +INSERT into gis_geometry SELECT * FROM gis_point; +INSERT into gis_geometry SELECT * FROM gis_line; +INSERT into gis_geometry SELECT * FROM gis_polygon; +INSERT into gis_geometry SELECT * FROM gis_multi_point; +INSERT into gis_geometry SELECT * FROM gis_multi_line; +INSERT into gis_geometry SELECT * FROM gis_multi_polygon; +INSERT into gis_geometry SELECT * FROM gis_geometrycollection; +SELECT fid, AsText(g) FROM gis_point; +fid AsText(g) +101 POINT(10 10) +102 POINT(20 10) +103 POINT(20 20) +104 POINT(10 20) +SELECT fid, AsText(g) FROM gis_line; +fid AsText(g) +105 LINESTRING(0 0,0 10,10 0) +106 LINESTRING(10 10,20 10,20 20,10 20,10 10) +107 LINESTRING(10 10,40 10) +SELECT fid, AsText(g) FROM gis_polygon; +fid AsText(g) +108 POLYGON((10 10,20 10,20 20,10 20,10 10)) +109 POLYGON((0 0,50 0,50 50,0 50,0 0),(10 10,20 10,20 20,10 20,10 10)) +110 POLYGON((0 0,30 0,30 30,0 0)) +SELECT fid, AsText(g) FROM gis_multi_point; +fid AsText(g) +111 MULTIPOINT(0 0,10 10,10 20,20 20) +112 MULTIPOINT(1 1,11 11,11 21,21 21) +113 MULTIPOINT(3 6,4 10) +SELECT fid, AsText(g) FROM gis_multi_line; +fid AsText(g) +114 MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48)) +115 MULTILINESTRING((10 48,10 21,10 0)) +116 MULTILINESTRING((1 2,3 5),(2 5,5 8,21 7)) +SELECT fid, AsText(g) FROM gis_multi_polygon; +fid AsText(g) +117 MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18))) +118 MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18))) +119 MULTIPOLYGON(((0 3,3 3,3 0,0 3))) +SELECT fid, AsText(g) FROM gis_geometrycollection; +fid AsText(g) +120 GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(0 0,10 10)) +121 GEOMETRYCOLLECTION(POINT(44 6),LINESTRING(3 6,7 9)) +122 GEOMETRYCOLLECTION EMPTY +123 GEOMETRYCOLLECTION EMPTY +SELECT fid, AsText(g) FROM gis_geometry; +fid AsText(g) +101 POINT(10 10) +102 POINT(20 10) +103 POINT(20 20) +104 POINT(10 20) +105 LINESTRING(0 0,0 10,10 0) +106 LINESTRING(10 10,20 10,20 20,10 20,10 10) +107 LINESTRING(10 10,40 10) +108 POLYGON((10 10,20 10,20 20,10 20,10 10)) +109 POLYGON((0 0,50 0,50 50,0 50,0 0),(10 10,20 10,20 20,10 20,10 10)) +110 POLYGON((0 0,30 0,30 30,0 0)) +111 MULTIPOINT(0 0,10 10,10 20,20 20) +112 MULTIPOINT(1 1,11 11,11 21,21 21) +113 MULTIPOINT(3 6,4 10) +114 MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48)) +115 MULTILINESTRING((10 48,10 21,10 0)) +116 MULTILINESTRING((1 2,3 5),(2 5,5 8,21 7)) +117 MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18))) +118 MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18))) +119 MULTIPOLYGON(((0 3,3 3,3 0,0 3))) +120 GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(0 0,10 10)) +121 GEOMETRYCOLLECTION(POINT(44 6),LINESTRING(3 6,7 9)) +122 GEOMETRYCOLLECTION EMPTY +123 GEOMETRYCOLLECTION EMPTY +SELECT fid, Dimension(g) FROM gis_geometry; +fid Dimension(g) +101 0 +102 0 +103 0 +104 0 +105 1 +106 1 +107 1 +108 2 +109 2 +110 2 +111 0 +112 0 +113 0 +114 1 +115 1 +116 1 +117 2 +118 2 +119 2 +120 1 +121 1 +122 0 +123 0 +SELECT fid, GeometryType(g) FROM gis_geometry; +fid GeometryType(g) +101 POINT +102 POINT +103 POINT +104 POINT +105 LINESTRING +106 LINESTRING +107 LINESTRING +108 POLYGON +109 POLYGON +110 POLYGON +111 MULTIPOINT +112 MULTIPOINT +113 MULTIPOINT +114 MULTILINESTRING +115 MULTILINESTRING +116 MULTILINESTRING +117 MULTIPOLYGON +118 MULTIPOLYGON +119 MULTIPOLYGON +120 GEOMETRYCOLLECTION +121 GEOMETRYCOLLECTION +122 GEOMETRYCOLLECTION +123 GEOMETRYCOLLECTION +SELECT fid, IsEmpty(g) FROM gis_geometry; +fid IsEmpty(g) +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +SELECT fid, AsText(Envelope(g)) FROM gis_geometry; +fid AsText(Envelope(g)) +101 POLYGON((10 10,10 10,10 10,10 10,10 10)) +102 POLYGON((20 10,20 10,20 10,20 10,20 10)) +103 POLYGON((20 20,20 20,20 20,20 20,20 20)) +104 POLYGON((10 20,10 20,10 20,10 20,10 20)) +105 POLYGON((0 0,10 0,10 10,0 10,0 0)) +106 POLYGON((10 10,20 10,20 20,10 20,10 10)) +107 POLYGON((10 10,40 10,40 10,10 10,10 10)) +108 POLYGON((10 10,20 10,20 20,10 20,10 10)) +109 POLYGON((0 0,50 0,50 50,0 50,0 0)) +110 POLYGON((0 0,30 0,30 30,0 30,0 0)) +111 POLYGON((0 0,20 0,20 20,0 20,0 0)) +112 POLYGON((1 1,21 1,21 21,1 21,1 1)) +113 POLYGON((3 6,4 6,4 10,3 10,3 6)) +114 POLYGON((10 0,16 0,16 48,10 48,10 0)) +115 POLYGON((10 0,10 0,10 48,10 48,10 0)) +116 POLYGON((1 2,21 2,21 8,1 8,1 2)) +117 POLYGON((28 0,84 0,84 42,28 42,28 0)) +118 POLYGON((28 0,84 0,84 42,28 42,28 0)) +119 POLYGON((0 0,3 0,3 3,0 3,0 0)) +120 POLYGON((0 0,10 0,10 10,0 10,0 0)) +121 POLYGON((3 6,44 6,44 9,3 9,3 6)) +122 GEOMETRYCOLLECTION EMPTY +123 GEOMETRYCOLLECTION EMPTY +SELECT fid, X(g) FROM gis_point; +fid X(g) +101 10 +102 20 +103 20 +104 10 +SELECT fid, Y(g) FROM gis_point; +fid Y(g) +101 10 +102 10 +103 20 +104 20 +SELECT fid, AsText(StartPoint(g)) FROM gis_line; +fid AsText(StartPoint(g)) +105 POINT(0 0) +106 POINT(10 10) +107 POINT(10 10) +SELECT fid, AsText(EndPoint(g)) FROM gis_line; +fid AsText(EndPoint(g)) +105 POINT(10 0) +106 POINT(10 10) +107 POINT(40 10) +SELECT fid, GLength(g) FROM gis_line; +fid GLength(g) +105 24.14213562373095 +106 40 +107 30 +SELECT fid, NumPoints(g) FROM gis_line; +fid NumPoints(g) +105 3 +106 5 +107 2 +SELECT fid, AsText(PointN(g, 2)) FROM gis_line; +fid AsText(PointN(g, 2)) +105 POINT(0 10) +106 POINT(20 10) +107 POINT(40 10) +SELECT fid, IsClosed(g) FROM gis_line; +fid IsClosed(g) +105 0 +106 1 +107 0 +SELECT fid, AsText(Centroid(g)) FROM gis_polygon; +fid AsText(Centroid(g)) +108 POINT(15 15) +109 POINT(25.416666666666668 25.416666666666668) +110 POINT(20 10) +SELECT fid, Area(g) FROM gis_polygon; +fid Area(g) +108 100 +109 2400 +110 450 +SELECT fid, AsText(ExteriorRing(g)) FROM gis_polygon; +fid AsText(ExteriorRing(g)) +108 LINESTRING(10 10,20 10,20 20,10 20,10 10) +109 LINESTRING(0 0,50 0,50 50,0 50,0 0) +110 LINESTRING(0 0,30 0,30 30,0 0) +SELECT fid, NumInteriorRings(g) FROM gis_polygon; +fid NumInteriorRings(g) +108 0 +109 1 +110 0 +SELECT fid, AsText(InteriorRingN(g, 1)) FROM gis_polygon; +fid AsText(InteriorRingN(g, 1)) +108 NULL +109 LINESTRING(10 10,20 10,20 20,10 20,10 10) +110 NULL +SELECT fid, IsClosed(g) FROM gis_multi_line; +fid IsClosed(g) +114 0 +115 0 +116 0 +SELECT fid, AsText(Centroid(g)) FROM gis_multi_polygon; +fid AsText(Centroid(g)) +117 POINT(55.58852775304245 17.426536064113982) +118 POINT(55.58852775304245 17.426536064113982) +119 POINT(2 2) +SELECT fid, Area(g) FROM gis_multi_polygon; +fid Area(g) +117 1684.5 +118 1684.5 +119 4.5 +SELECT fid, NumGeometries(g) from gis_multi_point; +fid NumGeometries(g) +111 4 +112 4 +113 2 +SELECT fid, NumGeometries(g) from gis_multi_line; +fid NumGeometries(g) +114 2 +115 1 +116 2 +SELECT fid, NumGeometries(g) from gis_multi_polygon; +fid NumGeometries(g) +117 2 +118 2 +119 1 +SELECT fid, NumGeometries(g) from gis_geometrycollection; +fid NumGeometries(g) +120 2 +121 2 +122 0 +123 0 +SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_point; +fid AsText(GeometryN(g, 2)) +111 POINT(10 10) +112 POINT(11 11) +113 POINT(4 10) +SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_line; +fid AsText(GeometryN(g, 2)) +114 LINESTRING(16 0,16 23,16 48) +115 NULL +116 LINESTRING(2 5,5 8,21 7) +SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_polygon; +fid AsText(GeometryN(g, 2)) +117 POLYGON((59 18,67 18,67 13,59 13,59 18)) +118 POLYGON((59 18,67 18,67 13,59 13,59 18)) +119 NULL +SELECT fid, AsText(GeometryN(g, 2)) from gis_geometrycollection; +fid AsText(GeometryN(g, 2)) +120 LINESTRING(0 0,10 10) +121 LINESTRING(3 6,7 9) +122 NULL +123 NULL +SELECT fid, AsText(GeometryN(g, 1)) from gis_geometrycollection; +fid AsText(GeometryN(g, 1)) +120 POINT(0 0) +121 POINT(44 6) +122 NULL +123 NULL +SELECT g1.fid as first, g2.fid as second, +Within(g1.g, g2.g) as w, Contains(g1.g, g2.g) as c, Overlaps(g1.g, g2.g) as o, +Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t, +Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r +FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second; +first second w c o e d t i r +120 120 1 1 0 1 0 1 1 0 +120 121 0 0 1 0 0 0 1 0 +120 122 0 1 NULL 0 NULL 0 NULL 0 +120 123 0 1 NULL 0 NULL 0 NULL 0 +121 120 0 0 1 0 0 0 1 0 +121 121 1 1 0 1 0 1 1 0 +121 122 0 1 NULL 0 NULL 0 NULL 0 +121 123 0 1 NULL 0 NULL 0 NULL 0 +122 120 1 0 NULL 0 NULL 0 NULL 0 +122 121 1 0 NULL 0 NULL 0 NULL 0 +122 122 1 1 NULL 1 NULL 0 NULL 0 +122 123 1 1 NULL 1 NULL 0 NULL 0 +123 120 1 0 NULL 0 NULL 0 NULL 0 +123 121 1 0 NULL 0 NULL 0 NULL 0 +123 122 1 1 NULL 1 NULL 0 NULL 0 +123 123 1 1 NULL 1 NULL 0 NULL 0 +DROP TABLE gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry; +USE gis_ogs; +# Lakes +INSERT INTO lakes VALUES ( +101, 'BLUE LAKE', +PolyFromText( +'POLYGON( + (52 18,66 23,73 9,48 6,52 18), + (59 18,67 18,67 13,59 13,59 18) + )', +101)); +# Road Segments +INSERT INTO road_segments VALUES(102, 'Route 5', NULL, 2, +LineFromText( +'LINESTRING( 0 18, 10 21, 16 23, 28 26, 44 31 )' ,101)); +INSERT INTO road_segments VALUES(103, 'Route 5', 'Main Street', 4, +LineFromText( +'LINESTRING( 44 31, 56 34, 70 38 )' ,101)); +INSERT INTO road_segments VALUES(104, 'Route 5', NULL, 2, +LineFromText( +'LINESTRING( 70 38, 72 48 )' ,101)); +INSERT INTO road_segments VALUES(105, 'Main Street', NULL, 4, +LineFromText( +'LINESTRING( 70 38, 84 42 )' ,101)); +INSERT INTO road_segments VALUES(106, 'Dirt Road by Green Forest', NULL, +1, +LineFromText( +'LINESTRING( 28 26, 28 0 )',101)); +# DividedRoutes +INSERT INTO divided_routes VALUES(119, 'Route 75', 4, +MLineFromText( +'MULTILINESTRING((10 48,10 21,10 0), + (16 0,16 23,16 48))', 101)); +# Forests +INSERT INTO forests VALUES(109, 'Green Forest', +MPolyFromText( +'MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26), + (52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))', +101)); +# Bridges +INSERT INTO bridges VALUES(110, 'Cam Bridge', PointFromText( +'POINT( 44 31 )', 101)); +# Streams +INSERT INTO streams VALUES(111, 'Cam Stream', +LineFromText( +'LINESTRING( 38 48, 44 41, 41 36, 44 31, 52 18 )', 101)); +INSERT INTO streams VALUES(112, NULL, +LineFromText( +'LINESTRING( 76 0, 78 4, 73 9 )', 101)); +# Buildings +INSERT INTO buildings VALUES(113, '123 Main Street', +PointFromText( +'POINT( 52 30 )', 101), +PolyFromText( +'POLYGON( ( 50 31, 54 31, 54 29, 50 29, 50 31) )', 101)); +INSERT INTO buildings VALUES(114, '215 Main Street', +PointFromText( +'POINT( 64 33 )', 101), +PolyFromText( +'POLYGON( ( 66 34, 62 34, 62 32, 66 32, 66 34) )', 101)); +# Ponds +INSERT INTO ponds VALUES(120, NULL, 'Stock Pond', +MPolyFromText( +'MULTIPOLYGON( ( ( 24 44, 22 42, 24 40, 24 44) ), + ( ( 26 44, 26 40, 28 42, 26 44) ) )', 101)); +# Named Places +INSERT INTO named_places VALUES(117, 'Ashton', +PolyFromText( +'POLYGON( ( 62 48, 84 48, 84 30, 56 30, 56 34, 62 48) )', 101)); +INSERT INTO named_places VALUES(118, 'Goose Island', +PolyFromText( +'POLYGON( ( 67 13, 67 18, 59 18, 59 13, 67 13) )', 101)); +# Map Neatlines +INSERT INTO map_neatlines VALUES(115, +PolyFromText( +'POLYGON( ( 0 0, 0 48, 84 48, 84 0, 0 0 ) )', 101)); +SELECT Dimension(shore) +FROM lakes +WHERE name = 'Blue Lake'; +Dimension(shore) +2 +SELECT GeometryType(centerlines) +FROM divided_routes +WHERE name = 'Route 75'; +GeometryType(centerlines) +MULTILINESTRING +SELECT AsText(boundary) +FROM named_places +WHERE name = 'Goose Island'; +AsText(boundary) +POLYGON((67 13,67 18,59 18,59 13,67 13)) +SELECT AsText(PolyFromWKB(AsBinary(boundary),101)) +FROM named_places +WHERE name = 'Goose Island'; +AsText(PolyFromWKB(AsBinary(boundary),101)) +POLYGON((67 13,67 18,59 18,59 13,67 13)) +SELECT SRID(boundary) +FROM named_places +WHERE name = 'Goose Island'; +SRID(boundary) +101 +SELECT IsEmpty(centerline) +FROM road_segments +WHERE name = 'Route 5' +AND aliases = 'Main Street'; +IsEmpty(centerline) +0 +SELECT AsText(Envelope(boundary)) +FROM named_places +WHERE name = 'Goose Island'; +AsText(Envelope(boundary)) +POLYGON((59 13,67 13,67 18,59 18,59 13)) +SELECT X(position) +FROM bridges +WHERE name = 'Cam Bridge'; +X(position) +44 +SELECT Y(position) +FROM bridges +WHERE name = 'Cam Bridge'; +Y(position) +31 +SELECT AsText(StartPoint(centerline)) +FROM road_segments +WHERE fid = 102; +AsText(StartPoint(centerline)) +POINT(0 18) +SELECT AsText(EndPoint(centerline)) +FROM road_segments +WHERE fid = 102; +AsText(EndPoint(centerline)) +POINT(44 31) +SELECT GLength(centerline) +FROM road_segments +WHERE fid = 106; +GLength(centerline) +26 +SELECT NumPoints(centerline) +FROM road_segments +WHERE fid = 102; +NumPoints(centerline) +5 +SELECT AsText(PointN(centerline, 1)) +FROM road_segments +WHERE fid = 102; +AsText(PointN(centerline, 1)) +POINT(0 18) +SELECT AsText(Centroid(boundary)) +FROM named_places +WHERE name = 'Goose Island'; +AsText(Centroid(boundary)) +POINT(63 15.5) +SELECT Area(boundary) +FROM named_places +WHERE name = 'Goose Island'; +Area(boundary) +40 +SELECT AsText(ExteriorRing(shore)) +FROM lakes +WHERE name = 'Blue Lake'; +AsText(ExteriorRing(shore)) +LINESTRING(52 18,66 23,73 9,48 6,52 18) +SELECT NumInteriorRings(shore) +FROM lakes +WHERE name = 'Blue Lake'; +NumInteriorRings(shore) +1 +SELECT AsText(InteriorRingN(shore, 1)) +FROM lakes +WHERE name = 'Blue Lake'; +AsText(InteriorRingN(shore, 1)) +LINESTRING(59 18,67 18,67 13,59 13,59 18) +SELECT NumGeometries(centerlines) +FROM divided_routes +WHERE name = 'Route 75'; +NumGeometries(centerlines) +2 +SELECT AsText(GeometryN(centerlines, 2)) +FROM divided_routes +WHERE name = 'Route 75'; +AsText(GeometryN(centerlines, 2)) +LINESTRING(16 0,16 23,16 48) +SELECT IsClosed(centerlines) +FROM divided_routes +WHERE name = 'Route 75'; +IsClosed(centerlines) +0 +SELECT GLength(centerlines) +FROM divided_routes +WHERE name = 'Route 75'; +GLength(centerlines) +96 +SELECT AsText(Centroid(shores)) +FROM ponds +WHERE fid = 120; +AsText(Centroid(shores)) +POINT(25 42) +SELECT Area(shores) +FROM ponds +WHERE fid = 120; +Area(shores) +8 +SELECT ST_Equals(boundary, +PolyFromText('POLYGON( ( 67 13, 67 18, 59 18, 59 13, 67 13) )',1)) +FROM named_places +WHERE name = 'Goose Island'; +ST_Equals(boundary, +PolyFromText('POLYGON( ( 67 13, 67 18, 59 18, 59 13, 67 13) )',1)) +1 +SELECT ST_Disjoint(centerlines, boundary) +FROM divided_routes, named_places +WHERE divided_routes.name = 'Route 75' +AND named_places.name = 'Ashton'; +ST_Disjoint(centerlines, boundary) +1 +SELECT ST_Touches(centerline, shore) +FROM streams, lakes +WHERE streams.name = 'Cam Stream' +AND lakes.name = 'Blue Lake'; +ST_Touches(centerline, shore) +1 +SELECT Crosses(road_segments.centerline, divided_routes.centerlines) +FROM road_segments, divided_routes +WHERE road_segments.fid = 102 +AND divided_routes.name = 'Route 75'; +Crosses(road_segments.centerline, divided_routes.centerlines) +1 +SELECT ST_Intersects(road_segments.centerline, divided_routes.centerlines) +FROM road_segments, divided_routes +WHERE road_segments.fid = 102 +AND divided_routes.name = 'Route 75'; +ST_Intersects(road_segments.centerline, divided_routes.centerlines) +1 +SELECT ST_Contains(forests.boundary, named_places.boundary) +FROM forests, named_places +WHERE forests.name = 'Green Forest' +AND named_places.name = 'Ashton'; +ST_Contains(forests.boundary, named_places.boundary) +0 +SELECT ST_Distance(position, boundary) +FROM bridges, named_places +WHERE bridges.name = 'Cam Bridge' +AND named_places.name = 'Ashton'; +ST_Distance(position, boundary) +12 +SELECT AsText(ST_Difference(named_places.boundary, forests.boundary)) +FROM named_places, forests +WHERE named_places.name = 'Ashton' +AND forests.name = 'Green Forest'; +AsText(ST_Difference(named_places.boundary, forests.boundary)) +POLYGON((56 34,62 48,84 48,84 42,56 34)) +SELECT AsText(ST_Union(shore, boundary)) +FROM lakes, named_places +WHERE lakes.name = 'Blue Lake' +AND named_places.name = 'Goose Island'; +AsText(ST_Union(shore, boundary)) +POLYGON((48 6,52 18,66 23,73 9,48 6)) +SELECT AsText(ST_SymDifference(shore, boundary)) +FROM lakes, named_places +WHERE lakes.name = 'Blue Lake' +AND named_places.name = 'Ashton'; +AsText(ST_SymDifference(shore, boundary)) +MULTIPOLYGON(((48 6,52 18,66 23,73 9,48 6),(59 13,59 18,67 18,67 13,59 13)),((56 30,56 34,62 48,84 48,84 30,56 30))) +SELECT count(*) +FROM buildings, bridges +WHERE ST_Contains(ST_Buffer(bridges.position, 15.0), buildings.footprint) = 1; +count(*) +1 +DROP DATABASE gis_ogs; +USE test; +DROP TABLE IF EXISTS t1, gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry; +DROP DATABASE IF EXISTS gis_ogs; +CREATE DATABASE gis_ogs; +CREATE TABLE gis_point (fid <INT_COLUMN>, g POINT NOT NULL, SPATIAL INDEX(g)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE gis_line (fid <INT_COLUMN>, g LINESTRING NOT NULL, SPATIAL INDEX(g)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE gis_polygon (fid <INT_COLUMN>, g POLYGON NOT NULL, SPATIAL INDEX(g)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE gis_multi_point (fid <INT_COLUMN>, g MULTIPOINT NOT NULL, SPATIAL INDEX(g)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE gis_multi_line (fid <INT_COLUMN>, g MULTILINESTRING NOT NULL, SPATIAL INDEX(g)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE gis_multi_polygon (fid <INT_COLUMN>, g MULTIPOLYGON NOT NULL, SPATIAL INDEX(g)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE gis_geometrycollection (fid <INT_COLUMN>, g GEOMETRYCOLLECTION NOT NULL, SPATIAL INDEX(g)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE gis_geometry (fid <INT_COLUMN>, g GEOMETRY NOT NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +USE gis_ogs; +CREATE TABLE lakes (fid INT <CUSTOM_COL_OPTIONS>, +name CHAR(64) <CUSTOM_COL_OPTIONS>, +shore POLYGON NOT NULL, SPATIAL INDEX s(shore)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE road_segments (fid INT <CUSTOM_COL_OPTIONS>, +name CHAR(64) <CUSTOM_COL_OPTIONS>, +aliases CHAR(64) <CUSTOM_COL_OPTIONS>, +num_lanes INT <CUSTOM_COL_OPTIONS>, +centerline LINESTRING NOT NULL, SPATIAL INDEX c(centerline)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE divided_routes (fid INT <CUSTOM_COL_OPTIONS>, +name CHAR(64) <CUSTOM_COL_OPTIONS>, +num_lanes INT <CUSTOM_COL_OPTIONS>, +centerlines MULTILINESTRING NOT NULL, SPATIAL INDEX c(centerlines)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE forests (fid INT <CUSTOM_COL_OPTIONS>, +name CHAR(64) <CUSTOM_COL_OPTIONS>, +boundary MULTIPOLYGON NOT NULL, SPATIAL INDEX b(boundary)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE bridges (fid INT <CUSTOM_COL_OPTIONS>, +name CHAR(64) <CUSTOM_COL_OPTIONS>, +position POINT NOT NULL, SPATIAL INDEX p(position)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE streams (fid INT <CUSTOM_COL_OPTIONS>, +name CHAR(64) <CUSTOM_COL_OPTIONS>, +centerline LINESTRING NOT NULL, SPATIAL INDEX c(centerline)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE buildings (fid INT <CUSTOM_COL_OPTIONS>, +name CHAR(64) <CUSTOM_COL_OPTIONS>, +position POINT NOT NULL, +footprint POLYGON NOT NULL, SPATIAL INDEX p(position), SPATIAL INDEX f(footprint)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE ponds (fid INT <CUSTOM_COL_OPTIONS>, +name CHAR(64) <CUSTOM_COL_OPTIONS>, +type CHAR(64) <CUSTOM_COL_OPTIONS>, +shores MULTIPOLYGON NOT NULL, SPATIAL INDEX s(shores)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE named_places (fid INT <CUSTOM_COL_OPTIONS>, +name CHAR(64) <CUSTOM_COL_OPTIONS>, +boundary POLYGON NOT NULL, SPATIAL INDEX b(boundary)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +CREATE TABLE map_neatlines (fid INT <CUSTOM_COL_OPTIONS>, +neatline POLYGON NOT NULL, SPATIAL INDEX n(neatline)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +USE test; +SHOW FIELDS FROM gis_point; +Field Type Null Key Default Extra +fid int(11) YES NULL +g point NO MUL NULL +SHOW FIELDS FROM gis_line; +Field Type Null Key Default Extra +fid int(11) YES NULL +g linestring NO MUL NULL +SHOW FIELDS FROM gis_polygon; +Field Type Null Key Default Extra +fid int(11) YES NULL +g polygon NO MUL NULL +SHOW FIELDS FROM gis_multi_point; +Field Type Null Key Default Extra +fid int(11) YES NULL +g multipoint NO MUL NULL +SHOW FIELDS FROM gis_multi_line; +Field Type Null Key Default Extra +fid int(11) YES NULL +g multilinestring NO MUL NULL +SHOW FIELDS FROM gis_multi_polygon; +Field Type Null Key Default Extra +fid int(11) YES NULL +g multipolygon NO MUL NULL +SHOW FIELDS FROM gis_geometrycollection; +Field Type Null Key Default Extra +fid int(11) YES NULL +g geometrycollection NO MUL NULL +SHOW FIELDS FROM gis_geometry; +Field Type Null Key Default Extra +fid int(11) YES NULL +g geometry NO NULL +INSERT INTO gis_point VALUES +(101, PointFromText('POINT(10 10)')), +(102, PointFromText('POINT(20 10)')), +(103, PointFromText('POINT(20 20)')), +(104, PointFromWKB(AsWKB(PointFromText('POINT(10 20)')))); +INSERT INTO gis_line VALUES +(105, LineFromText('LINESTRING(0 0,0 10,10 0)')), +(106, LineStringFromText('LINESTRING(10 10,20 10,20 20,10 20,10 10)')), +(107, LineStringFromWKB(AsWKB(LineString(Point(10, 10), Point(40, 10))))); +INSERT INTO gis_polygon VALUES +(108, PolygonFromText('POLYGON((10 10,20 10,20 20,10 20,10 10))')), +(109, PolyFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))')), +(110, PolyFromWKB(AsWKB(Polygon(LineString(Point(0, 0), Point(30, 0), Point(30, 30), Point(0, 0)))))); +INSERT INTO gis_multi_point VALUES +(111, MultiPointFromText('MULTIPOINT(0 0,10 10,10 20,20 20)')), +(112, MPointFromText('MULTIPOINT(1 1,11 11,11 21,21 21)')), +(113, MPointFromWKB(AsWKB(MultiPoint(Point(3, 6), Point(4, 10))))); +INSERT INTO gis_multi_line VALUES +(114, MultiLineStringFromText('MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48))')), +(115, MLineFromText('MULTILINESTRING((10 48,10 21,10 0))')), +(116, MLineFromWKB(AsWKB(MultiLineString(LineString(Point(1, 2), Point(3, 5)), LineString(Point(2, 5), Point(5, 8), Point(21, 7)))))); +INSERT INTO gis_multi_polygon VALUES +(117, MultiPolygonFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')), +(118, MPolyFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')), +(119, MPolyFromWKB(AsWKB(MultiPolygon(Polygon(LineString(Point(0, 3), Point(3, 3), Point(3, 0), Point(0, 3))))))); +INSERT INTO gis_geometrycollection VALUES +(120, GeomCollFromText('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(0 0,10 10))')), +(121, GeometryFromWKB(AsWKB(GeometryCollection(Point(44, 6), LineString(Point(3, 6), Point(7, 9)))))), +(122, GeomFromText('GeometryCollection()')), +(123, GeomFromText('GeometryCollection EMPTY')); +INSERT into gis_geometry SELECT * FROM gis_point; +INSERT into gis_geometry SELECT * FROM gis_line; +INSERT into gis_geometry SELECT * FROM gis_polygon; +INSERT into gis_geometry SELECT * FROM gis_multi_point; +INSERT into gis_geometry SELECT * FROM gis_multi_line; +INSERT into gis_geometry SELECT * FROM gis_multi_polygon; +INSERT into gis_geometry SELECT * FROM gis_geometrycollection; +SELECT fid, AsText(g) FROM gis_point; +fid AsText(g) +101 POINT(10 10) +102 POINT(20 10) +103 POINT(20 20) +104 POINT(10 20) +SELECT fid, AsText(g) FROM gis_line; +fid AsText(g) +105 LINESTRING(0 0,0 10,10 0) +106 LINESTRING(10 10,20 10,20 20,10 20,10 10) +107 LINESTRING(10 10,40 10) +SELECT fid, AsText(g) FROM gis_polygon; +fid AsText(g) +108 POLYGON((10 10,20 10,20 20,10 20,10 10)) +109 POLYGON((0 0,50 0,50 50,0 50,0 0),(10 10,20 10,20 20,10 20,10 10)) +110 POLYGON((0 0,30 0,30 30,0 0)) +SELECT fid, AsText(g) FROM gis_multi_point; +fid AsText(g) +111 MULTIPOINT(0 0,10 10,10 20,20 20) +112 MULTIPOINT(1 1,11 11,11 21,21 21) +113 MULTIPOINT(3 6,4 10) +SELECT fid, AsText(g) FROM gis_multi_line; +fid AsText(g) +114 MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48)) +115 MULTILINESTRING((10 48,10 21,10 0)) +116 MULTILINESTRING((1 2,3 5),(2 5,5 8,21 7)) +SELECT fid, AsText(g) FROM gis_multi_polygon; +fid AsText(g) +117 MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18))) +118 MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18))) +119 MULTIPOLYGON(((0 3,3 3,3 0,0 3))) +SELECT fid, AsText(g) FROM gis_geometrycollection; +fid AsText(g) +120 GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(0 0,10 10)) +121 GEOMETRYCOLLECTION(POINT(44 6),LINESTRING(3 6,7 9)) +122 GEOMETRYCOLLECTION EMPTY +123 GEOMETRYCOLLECTION EMPTY +SELECT fid, AsText(g) FROM gis_geometry; +fid AsText(g) +101 POINT(10 10) +102 POINT(20 10) +103 POINT(20 20) +104 POINT(10 20) +105 LINESTRING(0 0,0 10,10 0) +106 LINESTRING(10 10,20 10,20 20,10 20,10 10) +107 LINESTRING(10 10,40 10) +108 POLYGON((10 10,20 10,20 20,10 20,10 10)) +109 POLYGON((0 0,50 0,50 50,0 50,0 0),(10 10,20 10,20 20,10 20,10 10)) +110 POLYGON((0 0,30 0,30 30,0 0)) +111 MULTIPOINT(0 0,10 10,10 20,20 20) +112 MULTIPOINT(1 1,11 11,11 21,21 21) +113 MULTIPOINT(3 6,4 10) +114 MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48)) +115 MULTILINESTRING((10 48,10 21,10 0)) +116 MULTILINESTRING((1 2,3 5),(2 5,5 8,21 7)) +117 MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18))) +118 MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18))) +119 MULTIPOLYGON(((0 3,3 3,3 0,0 3))) +120 GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(0 0,10 10)) +121 GEOMETRYCOLLECTION(POINT(44 6),LINESTRING(3 6,7 9)) +122 GEOMETRYCOLLECTION EMPTY +123 GEOMETRYCOLLECTION EMPTY +SELECT fid, Dimension(g) FROM gis_geometry; +fid Dimension(g) +101 0 +102 0 +103 0 +104 0 +105 1 +106 1 +107 1 +108 2 +109 2 +110 2 +111 0 +112 0 +113 0 +114 1 +115 1 +116 1 +117 2 +118 2 +119 2 +120 1 +121 1 +122 0 +123 0 +SELECT fid, GeometryType(g) FROM gis_geometry; +fid GeometryType(g) +101 POINT +102 POINT +103 POINT +104 POINT +105 LINESTRING +106 LINESTRING +107 LINESTRING +108 POLYGON +109 POLYGON +110 POLYGON +111 MULTIPOINT +112 MULTIPOINT +113 MULTIPOINT +114 MULTILINESTRING +115 MULTILINESTRING +116 MULTILINESTRING +117 MULTIPOLYGON +118 MULTIPOLYGON +119 MULTIPOLYGON +120 GEOMETRYCOLLECTION +121 GEOMETRYCOLLECTION +122 GEOMETRYCOLLECTION +123 GEOMETRYCOLLECTION +SELECT fid, IsEmpty(g) FROM gis_geometry; +fid IsEmpty(g) +101 0 +102 0 +103 0 +104 0 +105 0 +106 0 +107 0 +108 0 +109 0 +110 0 +111 0 +112 0 +113 0 +114 0 +115 0 +116 0 +117 0 +118 0 +119 0 +120 0 +121 0 +122 0 +123 0 +SELECT fid, AsText(Envelope(g)) FROM gis_geometry; +fid AsText(Envelope(g)) +101 POLYGON((10 10,10 10,10 10,10 10,10 10)) +102 POLYGON((20 10,20 10,20 10,20 10,20 10)) +103 POLYGON((20 20,20 20,20 20,20 20,20 20)) +104 POLYGON((10 20,10 20,10 20,10 20,10 20)) +105 POLYGON((0 0,10 0,10 10,0 10,0 0)) +106 POLYGON((10 10,20 10,20 20,10 20,10 10)) +107 POLYGON((10 10,40 10,40 10,10 10,10 10)) +108 POLYGON((10 10,20 10,20 20,10 20,10 10)) +109 POLYGON((0 0,50 0,50 50,0 50,0 0)) +110 POLYGON((0 0,30 0,30 30,0 30,0 0)) +111 POLYGON((0 0,20 0,20 20,0 20,0 0)) +112 POLYGON((1 1,21 1,21 21,1 21,1 1)) +113 POLYGON((3 6,4 6,4 10,3 10,3 6)) +114 POLYGON((10 0,16 0,16 48,10 48,10 0)) +115 POLYGON((10 0,10 0,10 48,10 48,10 0)) +116 POLYGON((1 2,21 2,21 8,1 8,1 2)) +117 POLYGON((28 0,84 0,84 42,28 42,28 0)) +118 POLYGON((28 0,84 0,84 42,28 42,28 0)) +119 POLYGON((0 0,3 0,3 3,0 3,0 0)) +120 POLYGON((0 0,10 0,10 10,0 10,0 0)) +121 POLYGON((3 6,44 6,44 9,3 9,3 6)) +122 GEOMETRYCOLLECTION EMPTY +123 GEOMETRYCOLLECTION EMPTY +SELECT fid, X(g) FROM gis_point; +fid X(g) +101 10 +102 20 +103 20 +104 10 +SELECT fid, Y(g) FROM gis_point; +fid Y(g) +101 10 +102 10 +103 20 +104 20 +SELECT fid, AsText(StartPoint(g)) FROM gis_line; +fid AsText(StartPoint(g)) +105 POINT(0 0) +106 POINT(10 10) +107 POINT(10 10) +SELECT fid, AsText(EndPoint(g)) FROM gis_line; +fid AsText(EndPoint(g)) +105 POINT(10 0) +106 POINT(10 10) +107 POINT(40 10) +SELECT fid, GLength(g) FROM gis_line; +fid GLength(g) +105 24.14213562373095 +106 40 +107 30 +SELECT fid, NumPoints(g) FROM gis_line; +fid NumPoints(g) +105 3 +106 5 +107 2 +SELECT fid, AsText(PointN(g, 2)) FROM gis_line; +fid AsText(PointN(g, 2)) +105 POINT(0 10) +106 POINT(20 10) +107 POINT(40 10) +SELECT fid, IsClosed(g) FROM gis_line; +fid IsClosed(g) +105 0 +106 1 +107 0 +SELECT fid, AsText(Centroid(g)) FROM gis_polygon; +fid AsText(Centroid(g)) +108 POINT(15 15) +109 POINT(25.416666666666668 25.416666666666668) +110 POINT(20 10) +SELECT fid, Area(g) FROM gis_polygon; +fid Area(g) +108 100 +109 2400 +110 450 +SELECT fid, AsText(ExteriorRing(g)) FROM gis_polygon; +fid AsText(ExteriorRing(g)) +108 LINESTRING(10 10,20 10,20 20,10 20,10 10) +109 LINESTRING(0 0,50 0,50 50,0 50,0 0) +110 LINESTRING(0 0,30 0,30 30,0 0) +SELECT fid, NumInteriorRings(g) FROM gis_polygon; +fid NumInteriorRings(g) +108 0 +109 1 +110 0 +SELECT fid, AsText(InteriorRingN(g, 1)) FROM gis_polygon; +fid AsText(InteriorRingN(g, 1)) +108 NULL +109 LINESTRING(10 10,20 10,20 20,10 20,10 10) +110 NULL +SELECT fid, IsClosed(g) FROM gis_multi_line; +fid IsClosed(g) +114 0 +115 0 +116 0 +SELECT fid, AsText(Centroid(g)) FROM gis_multi_polygon; +fid AsText(Centroid(g)) +117 POINT(55.58852775304245 17.426536064113982) +118 POINT(55.58852775304245 17.426536064113982) +119 POINT(2 2) +SELECT fid, Area(g) FROM gis_multi_polygon; +fid Area(g) +117 1684.5 +118 1684.5 +119 4.5 +SELECT fid, NumGeometries(g) from gis_multi_point; +fid NumGeometries(g) +111 4 +112 4 +113 2 +SELECT fid, NumGeometries(g) from gis_multi_line; +fid NumGeometries(g) +114 2 +115 1 +116 2 +SELECT fid, NumGeometries(g) from gis_multi_polygon; +fid NumGeometries(g) +117 2 +118 2 +119 1 +SELECT fid, NumGeometries(g) from gis_geometrycollection; +fid NumGeometries(g) +120 2 +121 2 +122 0 +123 0 +SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_point; +fid AsText(GeometryN(g, 2)) +111 POINT(10 10) +112 POINT(11 11) +113 POINT(4 10) +SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_line; +fid AsText(GeometryN(g, 2)) +114 LINESTRING(16 0,16 23,16 48) +115 NULL +116 LINESTRING(2 5,5 8,21 7) +SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_polygon; +fid AsText(GeometryN(g, 2)) +117 POLYGON((59 18,67 18,67 13,59 13,59 18)) +118 POLYGON((59 18,67 18,67 13,59 13,59 18)) +119 NULL +SELECT fid, AsText(GeometryN(g, 2)) from gis_geometrycollection; +fid AsText(GeometryN(g, 2)) +120 LINESTRING(0 0,10 10) +121 LINESTRING(3 6,7 9) +122 NULL +123 NULL +SELECT fid, AsText(GeometryN(g, 1)) from gis_geometrycollection; +fid AsText(GeometryN(g, 1)) +120 POINT(0 0) +121 POINT(44 6) +122 NULL +123 NULL +SELECT g1.fid as first, g2.fid as second, +Within(g1.g, g2.g) as w, Contains(g1.g, g2.g) as c, Overlaps(g1.g, g2.g) as o, +Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t, +Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r +FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second; +first second w c o e d t i r +120 120 1 1 0 1 0 1 1 0 +120 121 0 0 1 0 0 0 1 0 +120 122 0 1 NULL 0 NULL 0 NULL 0 +120 123 0 1 NULL 0 NULL 0 NULL 0 +121 120 0 0 1 0 0 0 1 0 +121 121 1 1 0 1 0 1 1 0 +121 122 0 1 NULL 0 NULL 0 NULL 0 +121 123 0 1 NULL 0 NULL 0 NULL 0 +122 120 1 0 NULL 0 NULL 0 NULL 0 +122 121 1 0 NULL 0 NULL 0 NULL 0 +122 122 1 1 NULL 1 NULL 0 NULL 0 +122 123 1 1 NULL 1 NULL 0 NULL 0 +123 120 1 0 NULL 0 NULL 0 NULL 0 +123 121 1 0 NULL 0 NULL 0 NULL 0 +123 122 1 1 NULL 1 NULL 0 NULL 0 +123 123 1 1 NULL 1 NULL 0 NULL 0 +DROP TABLE gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry; +USE gis_ogs; +# Lakes +INSERT INTO lakes VALUES ( +101, 'BLUE LAKE', +PolyFromText( +'POLYGON( + (52 18,66 23,73 9,48 6,52 18), + (59 18,67 18,67 13,59 13,59 18) + )', +101)); +# Road Segments +INSERT INTO road_segments VALUES(102, 'Route 5', NULL, 2, +LineFromText( +'LINESTRING( 0 18, 10 21, 16 23, 28 26, 44 31 )' ,101)); +INSERT INTO road_segments VALUES(103, 'Route 5', 'Main Street', 4, +LineFromText( +'LINESTRING( 44 31, 56 34, 70 38 )' ,101)); +INSERT INTO road_segments VALUES(104, 'Route 5', NULL, 2, +LineFromText( +'LINESTRING( 70 38, 72 48 )' ,101)); +INSERT INTO road_segments VALUES(105, 'Main Street', NULL, 4, +LineFromText( +'LINESTRING( 70 38, 84 42 )' ,101)); +INSERT INTO road_segments VALUES(106, 'Dirt Road by Green Forest', NULL, +1, +LineFromText( +'LINESTRING( 28 26, 28 0 )',101)); +# DividedRoutes +INSERT INTO divided_routes VALUES(119, 'Route 75', 4, +MLineFromText( +'MULTILINESTRING((10 48,10 21,10 0), + (16 0,16 23,16 48))', 101)); +# Forests +INSERT INTO forests VALUES(109, 'Green Forest', +MPolyFromText( +'MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26), + (52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))', +101)); +# Bridges +INSERT INTO bridges VALUES(110, 'Cam Bridge', PointFromText( +'POINT( 44 31 )', 101)); +# Streams +INSERT INTO streams VALUES(111, 'Cam Stream', +LineFromText( +'LINESTRING( 38 48, 44 41, 41 36, 44 31, 52 18 )', 101)); +INSERT INTO streams VALUES(112, NULL, +LineFromText( +'LINESTRING( 76 0, 78 4, 73 9 )', 101)); +# Buildings +INSERT INTO buildings VALUES(113, '123 Main Street', +PointFromText( +'POINT( 52 30 )', 101), +PolyFromText( +'POLYGON( ( 50 31, 54 31, 54 29, 50 29, 50 31) )', 101)); +INSERT INTO buildings VALUES(114, '215 Main Street', +PointFromText( +'POINT( 64 33 )', 101), +PolyFromText( +'POLYGON( ( 66 34, 62 34, 62 32, 66 32, 66 34) )', 101)); +# Ponds +INSERT INTO ponds VALUES(120, NULL, 'Stock Pond', +MPolyFromText( +'MULTIPOLYGON( ( ( 24 44, 22 42, 24 40, 24 44) ), + ( ( 26 44, 26 40, 28 42, 26 44) ) )', 101)); +# Named Places +INSERT INTO named_places VALUES(117, 'Ashton', +PolyFromText( +'POLYGON( ( 62 48, 84 48, 84 30, 56 30, 56 34, 62 48) )', 101)); +INSERT INTO named_places VALUES(118, 'Goose Island', +PolyFromText( +'POLYGON( ( 67 13, 67 18, 59 18, 59 13, 67 13) )', 101)); +# Map Neatlines +INSERT INTO map_neatlines VALUES(115, +PolyFromText( +'POLYGON( ( 0 0, 0 48, 84 48, 84 0, 0 0 ) )', 101)); +SELECT Dimension(shore) +FROM lakes +WHERE name = 'Blue Lake'; +Dimension(shore) +2 +SELECT GeometryType(centerlines) +FROM divided_routes +WHERE name = 'Route 75'; +GeometryType(centerlines) +MULTILINESTRING +SELECT AsText(boundary) +FROM named_places +WHERE name = 'Goose Island'; +AsText(boundary) +POLYGON((67 13,67 18,59 18,59 13,67 13)) +SELECT AsText(PolyFromWKB(AsBinary(boundary),101)) +FROM named_places +WHERE name = 'Goose Island'; +AsText(PolyFromWKB(AsBinary(boundary),101)) +POLYGON((67 13,67 18,59 18,59 13,67 13)) +SELECT SRID(boundary) +FROM named_places +WHERE name = 'Goose Island'; +SRID(boundary) +101 +SELECT IsEmpty(centerline) +FROM road_segments +WHERE name = 'Route 5' +AND aliases = 'Main Street'; +IsEmpty(centerline) +0 +SELECT AsText(Envelope(boundary)) +FROM named_places +WHERE name = 'Goose Island'; +AsText(Envelope(boundary)) +POLYGON((59 13,67 13,67 18,59 18,59 13)) +SELECT X(position) +FROM bridges +WHERE name = 'Cam Bridge'; +X(position) +44 +SELECT Y(position) +FROM bridges +WHERE name = 'Cam Bridge'; +Y(position) +31 +SELECT AsText(StartPoint(centerline)) +FROM road_segments +WHERE fid = 102; +AsText(StartPoint(centerline)) +POINT(0 18) +SELECT AsText(EndPoint(centerline)) +FROM road_segments +WHERE fid = 102; +AsText(EndPoint(centerline)) +POINT(44 31) +SELECT GLength(centerline) +FROM road_segments +WHERE fid = 106; +GLength(centerline) +26 +SELECT NumPoints(centerline) +FROM road_segments +WHERE fid = 102; +NumPoints(centerline) +5 +SELECT AsText(PointN(centerline, 1)) +FROM road_segments +WHERE fid = 102; +AsText(PointN(centerline, 1)) +POINT(0 18) +SELECT AsText(Centroid(boundary)) +FROM named_places +WHERE name = 'Goose Island'; +AsText(Centroid(boundary)) +POINT(63 15.5) +SELECT Area(boundary) +FROM named_places +WHERE name = 'Goose Island'; +Area(boundary) +40 +SELECT AsText(ExteriorRing(shore)) +FROM lakes +WHERE name = 'Blue Lake'; +AsText(ExteriorRing(shore)) +LINESTRING(52 18,66 23,73 9,48 6,52 18) +SELECT NumInteriorRings(shore) +FROM lakes +WHERE name = 'Blue Lake'; +NumInteriorRings(shore) +1 +SELECT AsText(InteriorRingN(shore, 1)) +FROM lakes +WHERE name = 'Blue Lake'; +AsText(InteriorRingN(shore, 1)) +LINESTRING(59 18,67 18,67 13,59 13,59 18) +SELECT NumGeometries(centerlines) +FROM divided_routes +WHERE name = 'Route 75'; +NumGeometries(centerlines) +2 +SELECT AsText(GeometryN(centerlines, 2)) +FROM divided_routes +WHERE name = 'Route 75'; +AsText(GeometryN(centerlines, 2)) +LINESTRING(16 0,16 23,16 48) +SELECT IsClosed(centerlines) +FROM divided_routes +WHERE name = 'Route 75'; +IsClosed(centerlines) +0 +SELECT GLength(centerlines) +FROM divided_routes +WHERE name = 'Route 75'; +GLength(centerlines) +96 +SELECT AsText(Centroid(shores)) +FROM ponds +WHERE fid = 120; +AsText(Centroid(shores)) +POINT(25 42) +SELECT Area(shores) +FROM ponds +WHERE fid = 120; +Area(shores) +8 +SELECT ST_Equals(boundary, +PolyFromText('POLYGON( ( 67 13, 67 18, 59 18, 59 13, 67 13) )',1)) +FROM named_places +WHERE name = 'Goose Island'; +ST_Equals(boundary, +PolyFromText('POLYGON( ( 67 13, 67 18, 59 18, 59 13, 67 13) )',1)) +1 +SELECT ST_Disjoint(centerlines, boundary) +FROM divided_routes, named_places +WHERE divided_routes.name = 'Route 75' +AND named_places.name = 'Ashton'; +ST_Disjoint(centerlines, boundary) +1 +SELECT ST_Touches(centerline, shore) +FROM streams, lakes +WHERE streams.name = 'Cam Stream' +AND lakes.name = 'Blue Lake'; +ST_Touches(centerline, shore) +1 +SELECT Crosses(road_segments.centerline, divided_routes.centerlines) +FROM road_segments, divided_routes +WHERE road_segments.fid = 102 +AND divided_routes.name = 'Route 75'; +Crosses(road_segments.centerline, divided_routes.centerlines) +1 +SELECT ST_Intersects(road_segments.centerline, divided_routes.centerlines) +FROM road_segments, divided_routes +WHERE road_segments.fid = 102 +AND divided_routes.name = 'Route 75'; +ST_Intersects(road_segments.centerline, divided_routes.centerlines) +1 +SELECT ST_Contains(forests.boundary, named_places.boundary) +FROM forests, named_places +WHERE forests.name = 'Green Forest' +AND named_places.name = 'Ashton'; +ST_Contains(forests.boundary, named_places.boundary) +0 +SELECT ST_Distance(position, boundary) +FROM bridges, named_places +WHERE bridges.name = 'Cam Bridge' +AND named_places.name = 'Ashton'; +ST_Distance(position, boundary) +12 +SELECT AsText(ST_Difference(named_places.boundary, forests.boundary)) +FROM named_places, forests +WHERE named_places.name = 'Ashton' +AND forests.name = 'Green Forest'; +AsText(ST_Difference(named_places.boundary, forests.boundary)) +POLYGON((56 34,62 48,84 48,84 42,56 34)) +SELECT AsText(ST_Union(shore, boundary)) +FROM lakes, named_places +WHERE lakes.name = 'Blue Lake' +AND named_places.name = 'Goose Island'; +AsText(ST_Union(shore, boundary)) +POLYGON((48 6,52 18,66 23,73 9,48 6)) +SELECT AsText(ST_SymDifference(shore, boundary)) +FROM lakes, named_places +WHERE lakes.name = 'Blue Lake' +AND named_places.name = 'Ashton'; +AsText(ST_SymDifference(shore, boundary)) +MULTIPOLYGON(((48 6,52 18,66 23,73 9,48 6),(59 13,59 18,67 18,67 13,59 13)),((56 30,56 34,62 48,84 48,84 30,56 30))) +SELECT count(*) +FROM buildings, bridges +WHERE ST_Contains(ST_Buffer(bridges.position, 15.0), buildings.footprint) = 1; +count(*) +1 +DROP DATABASE gis_ogs; +USE test; diff --git a/mysql-test/suite/storage_engine/type_spatial_indexes.test b/mysql-test/suite/storage_engine/type_spatial_indexes.test new file mode 100644 index 00000000000..ae9fc592a3a --- /dev/null +++ b/mysql-test/suite/storage_engine/type_spatial_indexes.test @@ -0,0 +1,15 @@ +# +# Indexes on spatial objects +# (spatial and non-spatial indexes) +# + +--source have_engine.inc + +--let $index = $default_index +--source type_spatial.inc + +let $index = SPATIAL; +--source type_spatial.inc + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/type_text.inc b/mysql-test/suite/storage_engine/type_text.inc new file mode 100644 index 00000000000..0f31e91c776 --- /dev/null +++ b/mysql-test/suite/storage_engine/type_text.inc @@ -0,0 +1,65 @@ +# +# TEXT column types +# + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +let $create_definition = + t TEXT $col_opts, + t0 TEXT(0) $col_opts, + t1 TEXT(1) $col_opts, + t300 TEXT(300) $col_opts, + tm TEXT(65535) $col_opts, + t70k TEXT(70000) $col_opts, + t17m TEXT(17000000) $col_opts, + tt TINYTEXT $col_opts, + m MEDIUMTEXT $col_opts, + l LONGTEXT $col_opts +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = TEXT types + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 3 # 4 # 5 # + SHOW COLUMNS IN t1; + + # Valid values + # (cannot get MAX for all columns due to max_allowed_packet limitations) + + INSERT INTO t1 VALUES + ('','','','','','','','','',''), + ('a','b','c','d','e','f','g','h','i','j'), + ('test1','test2','test3','test4','test5','test6','test7','test8','test9','test10'), + ( REPEAT('a',65535), REPEAT('b',65535), REPEAT('c',255), REPEAT('d',65535), REPEAT('e',65535), REPEAT('f',1048576), REPEAT('g',1048576), REPEAT('h',255), REPEAT('i',1048576), REPEAT('j',1048576) ); + + --sorted_result + SELECT LENGTH(t), LENGTH(t0), LENGTH(t1), LENGTH(t300), LENGTH(tm), LENGTH(t70k), LENGTH(t17m), LENGTH(tt), LENGTH(m), LENGTH(l) FROM t1; + + # Invalid values (produce warnings, except for mediumtext and longtext columns for which the values are within limits) + + INSERT INTO t1 VALUES + ( REPEAT('a',65536), REPEAT('b',65536), REPEAT('c',256), REPEAT('d',65536), REPEAT('e',65536), REPEAT('f',1048576), REPEAT('g',1048576), REPEAT('h',256), REPEAT('i',1048576), REPEAT('j',1048576) ); + + --sorted_result + SELECT LENGTH(t), LENGTH(t0), LENGTH(t1), LENGTH(t300), LENGTH(tm), LENGTH(t70k), LENGTH(t17m), LENGTH(tt), LENGTH(m), LENGTH(l) FROM t1; + + --let $error_codes = ER_TOO_BIG_DISPLAYWIDTH + --let $alter_definition = ADD COLUMN ttt TEXT(4294967296) + --source alter_table.inc + if ($mysql_errname != ER_TOO_BIG_DISPLAYWIDTH) + { + --let $my_last_stmt = $alter_statement + --let $functionality = ALTER TABLE + --source unexpected_result.inc + } + DROP TABLE t1; +} + + diff --git a/mysql-test/suite/storage_engine/type_text.result b/mysql-test/suite/storage_engine/type_text.result new file mode 100644 index 00000000000..b3ca7a8d9da --- /dev/null +++ b/mysql-test/suite/storage_engine/type_text.result @@ -0,0 +1,54 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (t TEXT <CUSTOM_COL_OPTIONS>, +t0 TEXT(0) <CUSTOM_COL_OPTIONS>, +t1 TEXT(1) <CUSTOM_COL_OPTIONS>, +t300 TEXT(300) <CUSTOM_COL_OPTIONS>, +tm TEXT(65535) <CUSTOM_COL_OPTIONS>, +t70k TEXT(70000) <CUSTOM_COL_OPTIONS>, +t17m TEXT(17000000) <CUSTOM_COL_OPTIONS>, +tt TINYTEXT <CUSTOM_COL_OPTIONS>, +m MEDIUMTEXT <CUSTOM_COL_OPTIONS>, +l LONGTEXT <CUSTOM_COL_OPTIONS> +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +t text # # # +t0 text # # # +t1 tinytext # # # +t300 text # # # +tm text # # # +t70k mediumtext # # # +t17m longtext # # # +tt tinytext # # # +m mediumtext # # # +l longtext # # # +INSERT INTO t1 VALUES +('','','','','','','','','',''), +('a','b','c','d','e','f','g','h','i','j'), +('test1','test2','test3','test4','test5','test6','test7','test8','test9','test10'), +( REPEAT('a',65535), REPEAT('b',65535), REPEAT('c',255), REPEAT('d',65535), REPEAT('e',65535), REPEAT('f',1048576), REPEAT('g',1048576), REPEAT('h',255), REPEAT('i',1048576), REPEAT('j',1048576) ); +SELECT LENGTH(t), LENGTH(t0), LENGTH(t1), LENGTH(t300), LENGTH(tm), LENGTH(t70k), LENGTH(t17m), LENGTH(tt), LENGTH(m), LENGTH(l) FROM t1; +LENGTH(t) LENGTH(t0) LENGTH(t1) LENGTH(t300) LENGTH(tm) LENGTH(t70k) LENGTH(t17m) LENGTH(tt) LENGTH(m) LENGTH(l) +0 0 0 0 0 0 0 0 0 0 +1 1 1 1 1 1 1 1 1 1 +5 5 5 5 5 5 5 5 5 6 +65535 65535 255 65535 65535 1048576 1048576 255 1048576 1048576 +INSERT INTO t1 VALUES +( REPEAT('a',65536), REPEAT('b',65536), REPEAT('c',256), REPEAT('d',65536), REPEAT('e',65536), REPEAT('f',1048576), REPEAT('g',1048576), REPEAT('h',256), REPEAT('i',1048576), REPEAT('j',1048576) ); +Warnings: +Warning 1265 Data truncated for column 't' at row 1 +Warning 1265 Data truncated for column 't0' at row 1 +Warning 1265 Data truncated for column 't1' at row 1 +Warning 1265 Data truncated for column 't300' at row 1 +Warning 1265 Data truncated for column 'tm' at row 1 +Warning 1265 Data truncated for column 'tt' at row 1 +SELECT LENGTH(t), LENGTH(t0), LENGTH(t1), LENGTH(t300), LENGTH(tm), LENGTH(t70k), LENGTH(t17m), LENGTH(tt), LENGTH(m), LENGTH(l) FROM t1; +LENGTH(t) LENGTH(t0) LENGTH(t1) LENGTH(t300) LENGTH(tm) LENGTH(t70k) LENGTH(t17m) LENGTH(tt) LENGTH(m) LENGTH(l) +0 0 0 0 0 0 0 0 0 0 +1 1 1 1 1 1 1 1 1 1 +5 5 5 5 5 5 5 5 5 6 +65535 65535 255 65535 65535 1048576 1048576 255 1048576 1048576 +65535 65535 255 65535 65535 1048576 1048576 255 1048576 1048576 +ALTER TABLE t1 ADD COLUMN ttt TEXT(4294967296); +ERROR 42000: Display width out of range for 'ttt' (max = 4294967295) +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/type_text.test b/mysql-test/suite/storage_engine/type_text.test new file mode 100644 index 00000000000..63e710195d2 --- /dev/null +++ b/mysql-test/suite/storage_engine/type_text.test @@ -0,0 +1,10 @@ +# +# TEXT column types +# + +--source have_engine.inc + +--source type_text.inc + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/type_text_indexes.result b/mysql-test/suite/storage_engine/type_text_indexes.result new file mode 100644 index 00000000000..a23373e2c0d --- /dev/null +++ b/mysql-test/suite/storage_engine/type_text_indexes.result @@ -0,0 +1,137 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (t TEXT <CUSTOM_COL_OPTIONS>, +tt TINYTEXT <CUSTOM_COL_OPTIONS>, +m MEDIUMTEXT <CUSTOM_COL_OPTIONS>, +l LONGTEXT <CUSTOM_COL_OPTIONS>, +<CUSTOM_INDEX> t (t(32)) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 # 1 t # # 32 NULL # # +INSERT INTO t1 (t,tt,m,l) VALUES +('','','',''), +('a','b','c','d'), +('b','d','c','b'), +('test1','test2','test3','test4'), +(REPEAT('a',128),REPEAT('b',128),REPEAT('c',128),REPEAT('d',128)), +('abc','def','ghi','jkl'), +('test2','test3','test4','test5'), +('test3','test4','test5','test6'), +(REPEAT('b',128),REPEAT('f',128),REPEAT('e',128),REPEAT('d',128)), +(REPEAT('c',128),REPEAT('b',128),REPEAT('c',128),REPEAT('e',128)); +SELECT SUBSTRING(t,16) AS f FROM t1 WHERE t IN ('test1','test2') ORDER BY f; +f + + +DROP TABLE t1; +CREATE TABLE t1 (t TEXT <CUSTOM_COL_OPTIONS>, +tt TINYTEXT <CUSTOM_COL_OPTIONS>, +m MEDIUMTEXT <CUSTOM_COL_OPTIONS>, +l LONGTEXT <CUSTOM_COL_OPTIONS>, +PRIMARY KEY t (t(32)) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 0 PRIMARY 1 t # # 32 NULL # # +INSERT INTO t1 (t,tt,m,l) VALUES +('','','',''), +('a','b','c','d'), +('b','d','c','b'), +('test1','test2','test3','test4'), +(REPEAT('a',128),REPEAT('b',128),REPEAT('c',128),REPEAT('d',128)), +('abc','def','ghi','jkl'), +('test2','test3','test4','test5'), +('test3','test4','test5','test6'), +(REPEAT('b',128),REPEAT('f',128),REPEAT('e',128),REPEAT('d',128)), +(REPEAT('c',128),REPEAT('b',128),REPEAT('c',128),REPEAT('e',128)); +EXPLAIN SELECT SUBSTRING(t,16) AS f FROM t1 WHERE t IN ('test1','test2') ORDER BY f; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # PRIMARY # # # # +SELECT SUBSTRING(t,16) AS f FROM t1 WHERE t IN ('test1','test2') ORDER BY f; +f + + +EXPLAIN SELECT SUBSTRING(t,16) AS f FROM t1 IGNORE INDEX (PRIMARY) WHERE t IN ('test1','test2') ORDER BY f; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # NULL # # # # +SELECT SUBSTRING(t,16) AS f FROM t1 IGNORE INDEX (PRIMARY) WHERE t IN ('test1','test2') ORDER BY f; +f + + +DROP TABLE t1; +CREATE TABLE t1 (t TEXT <CUSTOM_COL_OPTIONS>, +tt TINYTEXT <CUSTOM_COL_OPTIONS>, +m MEDIUMTEXT <CUSTOM_COL_OPTIONS>, +l LONGTEXT <CUSTOM_COL_OPTIONS>, +UNIQUE INDEX l_tt (l(256),tt(64)) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 0 l_tt 1 l # # 256 NULL # # +t1 0 l_tt 2 tt # # 64 NULL # # +INSERT INTO t1 (t,tt,m,l) VALUES +('','','',''), +('a','b','c','d'), +('b','d','c','b'), +('test1','test2','test3','test4'), +(REPEAT('a',128),REPEAT('b',128),REPEAT('c',128),REPEAT('d',128)), +('abc','def','ghi','jkl'), +('test2','test3','test4','test5'), +('test3','test4','test5','test6'), +(REPEAT('b',128),REPEAT('f',128),REPEAT('e',128),REPEAT('d',128)), +(REPEAT('c',128),REPEAT('b',128),REPEAT('c',128),REPEAT('e',128)); +EXPLAIN SELECT SUBSTRING(tt,64), SUBSTRING(l,256) FROM t1 WHERE tt!=l AND l NOT IN ('test1') ORDER BY tt, l DESC; +id select_type table type possible_keys key key_len ref rows Extra +# # # # l_tt # # # # # +SELECT SUBSTRING(tt,64), SUBSTRING(l,256) FROM t1 WHERE tt!=l AND l NOT IN ('test1') ORDER BY tt, l DESC; +SUBSTRING(tt,64) SUBSTRING(l,256) + +bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb +bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb + + +fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + + + +EXPLAIN SELECT SUBSTRING(tt,64), SUBSTRING(l,256) FROM t1 FORCE INDEX (l_t) WHERE tt!=l AND l NOT IN ('test1') ORDER BY tt, l DESC; +id select_type table type possible_keys key key_len ref rows Extra +# # # # l_tt l_tt # # # # +SELECT SUBSTRING(tt,64), SUBSTRING(l,256) FROM t1 FORCE INDEX (l_t) WHERE tt!=l AND l NOT IN ('test1') ORDER BY tt, l DESC; +SUBSTRING(tt,64) SUBSTRING(l,256) + +bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb +bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb + + +fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + + + +DROP TABLE t1; +CREATE TABLE t1 (t TEXT <CUSTOM_COL_OPTIONS>, +tt TINYTEXT <CUSTOM_COL_OPTIONS>, +m MEDIUMTEXT <CUSTOM_COL_OPTIONS>, +l LONGTEXT <CUSTOM_COL_OPTIONS>, +INDEX (m(128)) +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW INDEX IN t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 m 1 m # # 128 NULL # # +INSERT INTO t1 (t,tt,m,l) VALUES +('','','',''), +('a','b','c','d'), +('b','d','c','b'), +('test1','test2','test3','test4'), +(REPEAT('a',128),REPEAT('b',128),REPEAT('c',128),REPEAT('d',128)), +('abc','def','ghi','jkl'), +('test2','test3','test4','test5'), +('test3','test4','test5','test6'), +(REPEAT('b',128),REPEAT('f',128),REPEAT('e',128),REPEAT('d',128)), +(REPEAT('c',128),REPEAT('b',128),REPEAT('c',128),REPEAT('e',128)); +EXPLAIN SELECT SUBSTRING(m,128) AS f FROM t1 WHERE m = 'test1' ORDER BY f DESC; +id select_type table type possible_keys key key_len ref rows Extra +# # # # # m # # # # +SELECT SUBSTRING(m,128) AS f FROM t1 WHERE m = 'test1' ORDER BY f DESC; +f +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/type_text_indexes.test b/mysql-test/suite/storage_engine/type_text_indexes.test new file mode 100644 index 00000000000..091717f5a9e --- /dev/null +++ b/mysql-test/suite/storage_engine/type_text_indexes.test @@ -0,0 +1,175 @@ +# +# TEXT columns with indexes +# + +--source have_engine.inc +--source have_default_index.inc + + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +# Default index as configured in define_engine + +let $create_definition = + t TEXT $col_indexed_opts, + tt TINYTEXT $col_opts, + m MEDIUMTEXT $col_opts, + l LONGTEXT $col_opts, + $default_index t (t(32)) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = TEXT types or indexes on them + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 3 # 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + INSERT INTO t1 (t,tt,m,l) VALUES + ('','','',''), + ('a','b','c','d'), + ('b','d','c','b'), + ('test1','test2','test3','test4'), + (REPEAT('a',128),REPEAT('b',128),REPEAT('c',128),REPEAT('d',128)), + ('abc','def','ghi','jkl'), + ('test2','test3','test4','test5'), + ('test3','test4','test5','test6'), + (REPEAT('b',128),REPEAT('f',128),REPEAT('e',128),REPEAT('d',128)), + (REPEAT('c',128),REPEAT('b',128),REPEAT('c',128),REPEAT('e',128)); + + SELECT SUBSTRING(t,16) AS f FROM t1 WHERE t IN ('test1','test2') ORDER BY f; + + DROP TABLE t1; +} + +# PK, UNIQUE INDEX, INDEX + +let $create_definition = + t TEXT $col_indexed_opts, + tt TINYTEXT $col_opts, + m MEDIUMTEXT $col_opts, + l LONGTEXT $col_opts, + PRIMARY KEY t (t(32)) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = TEXT types or PK + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + INSERT INTO t1 (t,tt,m,l) VALUES + ('','','',''), + ('a','b','c','d'), + ('b','d','c','b'), + ('test1','test2','test3','test4'), + (REPEAT('a',128),REPEAT('b',128),REPEAT('c',128),REPEAT('d',128)), + ('abc','def','ghi','jkl'), + ('test2','test3','test4','test5'), + ('test3','test4','test5','test6'), + (REPEAT('b',128),REPEAT('f',128),REPEAT('e',128),REPEAT('d',128)), + (REPEAT('c',128),REPEAT('b',128),REPEAT('c',128),REPEAT('e',128)); + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT SUBSTRING(t,16) AS f FROM t1 WHERE t IN ('test1','test2') ORDER BY f; + SELECT SUBSTRING(t,16) AS f FROM t1 WHERE t IN ('test1','test2') ORDER BY f; + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT SUBSTRING(t,16) AS f FROM t1 IGNORE INDEX (PRIMARY) WHERE t IN ('test1','test2') ORDER BY f; + SELECT SUBSTRING(t,16) AS f FROM t1 IGNORE INDEX (PRIMARY) WHERE t IN ('test1','test2') ORDER BY f; + DROP TABLE t1; +} + +let $create_definition = + t TEXT $col_opts, + tt TINYTEXT $col_indexed_opts, + m MEDIUMTEXT $col_opts, + l LONGTEXT $col_indexed_opts, + UNIQUE INDEX l_tt (l(256),tt(64)) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = TEXT types or unique keys or multi-part keys + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + INSERT INTO t1 (t,tt,m,l) VALUES + ('','','',''), + ('a','b','c','d'), + ('b','d','c','b'), + ('test1','test2','test3','test4'), + (REPEAT('a',128),REPEAT('b',128),REPEAT('c',128),REPEAT('d',128)), + ('abc','def','ghi','jkl'), + ('test2','test3','test4','test5'), + ('test3','test4','test5','test6'), + (REPEAT('b',128),REPEAT('f',128),REPEAT('e',128),REPEAT('d',128)), + (REPEAT('c',128),REPEAT('b',128),REPEAT('c',128),REPEAT('e',128)); + + # Here we are getting possible key l_t, but not the final key + --replace_column 1 # 2 # 3 # 4 # 6 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT SUBSTRING(tt,64), SUBSTRING(l,256) FROM t1 WHERE tt!=l AND l NOT IN ('test1') ORDER BY tt, l DESC; + SELECT SUBSTRING(tt,64), SUBSTRING(l,256) FROM t1 WHERE tt!=l AND l NOT IN ('test1') ORDER BY tt, l DESC; + + --replace_column 1 # 2 # 3 # 4 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT SUBSTRING(tt,64), SUBSTRING(l,256) FROM t1 FORCE INDEX (l_t) WHERE tt!=l AND l NOT IN ('test1') ORDER BY tt, l DESC; + SELECT SUBSTRING(tt,64), SUBSTRING(l,256) FROM t1 FORCE INDEX (l_t) WHERE tt!=l AND l NOT IN ('test1') ORDER BY tt, l DESC; + DROP TABLE t1; +} + +let $create_definition = + t TEXT $col_opts, + tt TINYTEXT $col_opts, + m MEDIUMTEXT $col_indexed_opts, + l LONGTEXT $col_opts, + INDEX (m(128)) +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = TEXT types or non-unique keys + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 6 # 7 # 10 # 11 # + SHOW INDEX IN t1; + + INSERT INTO t1 (t,tt,m,l) VALUES + ('','','',''), + ('a','b','c','d'), + ('b','d','c','b'), + ('test1','test2','test3','test4'), + (REPEAT('a',128),REPEAT('b',128),REPEAT('c',128),REPEAT('d',128)), + ('abc','def','ghi','jkl'), + ('test2','test3','test4','test5'), + ('test3','test4','test5','test6'), + (REPEAT('b',128),REPEAT('f',128),REPEAT('e',128),REPEAT('d',128)), + (REPEAT('c',128),REPEAT('b',128),REPEAT('c',128),REPEAT('e',128)); + + --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # + EXPLAIN SELECT SUBSTRING(m,128) AS f FROM t1 WHERE m = 'test1' ORDER BY f DESC; + SELECT SUBSTRING(m,128) AS f FROM t1 WHERE m = 'test1' ORDER BY f DESC; + + DROP TABLE t1; +} + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/type_varbinary.inc b/mysql-test/suite/storage_engine/type_varbinary.inc new file mode 100644 index 00000000000..5801f228567 --- /dev/null +++ b/mysql-test/suite/storage_engine/type_varbinary.inc @@ -0,0 +1,101 @@ +# +# VARBINARY column types +# + +--disable_warnings +DROP TABLE IF EXISTS t1, t2; +--enable_warnings + +let $create_definition = + v0 VARBINARY(0) $col_opts, + v1 VARBINARY(1) $col_opts, + v64 VARBINARY(64) $col_opts, + v65000 VARBINARY(65000) $col_opts +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = VARBINARY types + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 3 # 4 # 5 # + SHOW COLUMNS IN t1; + + --let $create_definition = v VARBINARY(65532) $col_opts + --let $table_name = t2 + --source create_table.inc + --replace_column 3 # 4 # 5 # + SHOW COLUMNS IN t2; + + # Valid values + + INSERT INTO t1 (v0,v1,v64,v65000) VALUES ('','','',''); + INSERT INTO t1 (v0,v1,v64,v65000) VALUES ('','y','Once there, double check that an article doesn\'t already exist','Here is a list of recommended books on MariaDB and MySQL. We\'ve provided links to Amazon.com here for convenience, but they can be found at many other bookstores, both online and off. + + If you want to have your favorite MySQL / MariaDB book listed here, please leave a comment. + For developers who want to code on MariaDB or MySQL + + * Understanding MySQL Internals by Sasha Pachev, former MySQL developer at MySQL AB. + o This is the only book we know about that describes the internals of MariaDB / MySQL. A must have for anyone who wants to understand and develop on MariaDB! + o Not all topics are covered and some parts are slightly outdated, but still the best book on this topic. + * MySQL 5.1 Plugin Development by Sergei Golubchik and Andrew Hutchings + o A must read for anyone wanting to write a plugin for MariaDB, written by the Sergei who designed the plugin interface for MySQL and MariaDB! + + For MariaDB / MySQL end users + + * MariaDB Crash Course by Ben Forta + o First MariaDB book! + o For people who want to learn SQL and the basics of MariaDB. + o Now shipping. Purchase at Amazon.com or your favorite bookseller. + + * SQL-99 Complete, Really by Peter Gulutzan & Trudy Pelzer. + o Everything you wanted to know about the SQL 99 standard. Excellent reference book! + o Free to read in the Knowledgebase! + + * MySQL (4th Edition) by Paul DuBois + o The \'default\' book to read if you wont to learn to use MySQL / MariaDB. + + * MySQL Cookbook by Paul DuBois + o A lot of examples of how to use MySQL. As with all of Paul\'s books, it\'s worth its weight in gold and even enjoyable reading for such a \'dry\' subject. + + * High Performance MySQL, Second Edition, By Baron Schwartz, Peter Zaitsev, Vadim Tkachenko, Jeremy D. Zawodny, Arjen Lentz, Derek J. Balling, et al. + o \"High Performance MySQL is the definitive guide to building fast, reliable systems with MySQL. Written by noted experts with years of real-world experience building very large systems, this book covers every aspect of MySQL performance in detail, and focuses on robustness, security, and data integrity. Learn advanced techniques in depth so you can bring out MySQL\'s full power.\" (From the book description at O\'Reilly) + + * MySQL Admin Cookbook + o A quick step-by-step guide for MySQL users and database administrators to tackle real-world challenges with MySQL configuration and administration + + * MySQL 5.0 Certification Study Guide, By Paul DuBois, Stefan Hinz, Carsten Pedersen + o This is the official guide to cover the passing of the two MySQL Certification examinations. It is valid till version 5.0 of the server, so while it misses all the features available in MySQL 5.1 and greater (including MariaDB 5.1 and greater), it provides a good basic understanding of MySQL for the end-user. '); + + --sorted_result + SELECT HEX(v0), HEX(v1), HEX(v64), HEX(v65000) FROM t1; + + # Invalid values + + INSERT INTO t1 (v0,v1,v64,v65000) VALUES ('y', 'yy', REPEAT('c',65), REPEAT('abcdefghi ',6501)); + INSERT INTO t1 (v0,v1,v64,v65000) SELECT v65000, v65000, v65000, CONCAT(v65000,v1) FROM t1; + + --sorted_result + SELECT HEX(v0), HEX(v1), HEX(v64), LENGTH(HEX(v65000)) FROM t1; + + --let $alter_definition = ADD COLUMN v65536 VARBINARY(65536) $col_opts + --source alter_table.inc + if ($mysql_errname) + { + --let $my_last_stmt = $alter_statement + --let $functionality = ALTER TABLE or BLOB types + --source unexpected_result.inc + } + if (!$mysql_errname) + { + --replace_column 3 # 4 # 5 # + SHOW COLUMNS IN t1; + } + + DROP TABLE t1, t2; +} + + diff --git a/mysql-test/suite/storage_engine/type_varbinary.result b/mysql-test/suite/storage_engine/type_varbinary.result new file mode 100644 index 00000000000..309de3fe387 --- /dev/null +++ b/mysql-test/suite/storage_engine/type_varbinary.result @@ -0,0 +1,92 @@ +DROP TABLE IF EXISTS t1, t2; +CREATE TABLE t1 (v0 VARBINARY(0) <CUSTOM_COL_OPTIONS>, +v1 VARBINARY(1) <CUSTOM_COL_OPTIONS>, +v64 VARBINARY(64) <CUSTOM_COL_OPTIONS>, +v65000 VARBINARY(65000) <CUSTOM_COL_OPTIONS> +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +v0 varbinary(0) # # # +v1 varbinary(1) # # # +v64 varbinary(64) # # # +v65000 varbinary(65000) # # # +CREATE TABLE t2 (v VARBINARY(65532) <CUSTOM_COL_OPTIONS>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t2; +Field Type Null Key Default Extra +v varbinary(65532) # # # +INSERT INTO t1 (v0,v1,v64,v65000) VALUES ('','','',''); +INSERT INTO t1 (v0,v1,v64,v65000) VALUES ('','y','Once there, double check that an article doesn\'t already exist','Here is a list of recommended books on MariaDB and MySQL. We\'ve provided links to Amazon.com here for convenience, but they can be found at many other bookstores, both online and off. + + If you want to have your favorite MySQL / MariaDB book listed here, please leave a comment. + For developers who want to code on MariaDB or MySQL + + * Understanding MySQL Internals by Sasha Pachev, former MySQL developer at MySQL AB. + o This is the only book we know about that describes the internals of MariaDB / MySQL. A must have for anyone who wants to understand and develop on MariaDB! + o Not all topics are covered and some parts are slightly outdated, but still the best book on this topic. + * MySQL 5.1 Plugin Development by Sergei Golubchik and Andrew Hutchings + o A must read for anyone wanting to write a plugin for MariaDB, written by the Sergei who designed the plugin interface for MySQL and MariaDB! + + For MariaDB / MySQL end users + + * MariaDB Crash Course by Ben Forta + o First MariaDB book! + o For people who want to learn SQL and the basics of MariaDB. + o Now shipping. Purchase at Amazon.com or your favorite bookseller. + + * SQL-99 Complete, Really by Peter Gulutzan & Trudy Pelzer. + o Everything you wanted to know about the SQL 99 standard. Excellent reference book! + o Free to read in the Knowledgebase! + + * MySQL (4th Edition) by Paul DuBois + o The \'default\' book to read if you wont to learn to use MySQL / MariaDB. + + * MySQL Cookbook by Paul DuBois + o A lot of examples of how to use MySQL. As with all of Paul\'s books, it\'s worth its weight in gold and even enjoyable reading for such a \'dry\' subject. + + * High Performance MySQL, Second Edition, By Baron Schwartz, Peter Zaitsev, Vadim Tkachenko, Jeremy D. Zawodny, Arjen Lentz, Derek J. Balling, et al. + o \"High Performance MySQL is the definitive guide to building fast, reliable systems with MySQL. Written by noted experts with years of real-world experience building very large systems, this book covers every aspect of MySQL performance in detail, and focuses on robustness, security, and data integrity. Learn advanced techniques in depth so you can bring out MySQL\'s full power.\" (From the book description at O\'Reilly) + + * MySQL Admin Cookbook + o A quick step-by-step guide for MySQL users and database administrators to tackle real-world challenges with MySQL configuration and administration + + * MySQL 5.0 Certification Study Guide, By Paul DuBois, Stefan Hinz, Carsten Pedersen + o This is the official guide to cover the passing of the two MySQL Certification examinations. It is valid till version 5.0 of the server, so while it misses all the features available in MySQL 5.1 and greater (including MariaDB 5.1 and greater), it provides a good basic understanding of MySQL for the end-user. '); +SELECT HEX(v0), HEX(v1), HEX(v64), HEX(v65000) FROM t1; +HEX(v0) HEX(v1) HEX(v64) HEX(v65000) + + 79 4F6E63652074686572652C20646F75626C6520636865636B207468617420616E2061727469636C6520646F65736E277420616C7265616479206578697374 486572652069732061206C697374206F66207265636F6D6D656E64656420626F6F6B73206F6E204D61726961444220616E64204D7953514C2E2057652776652070726F7669646564206C696E6B7320746F20416D617A6F6E2E636F6D206865726520666F7220636F6E76656E69656E63652C2062757420746865792063616E20626520666F756E64206174206D616E79206F7468657220626F6F6B73746F7265732C20626F7468206F6E6C696E6520616E64206F66662E0A0A2020496620796F752077616E7420746F206861766520796F7572206661766F72697465204D7953514C202F204D61726961444220626F6F6B206C697374656420686572652C20706C65617365206C65617665206120636F6D6D656E742E0A2020466F7220646576656C6F706572732077686F2077616E7420746F20636F6465206F6E204D617269614442206F72204D7953514C0A0A2020202020202A20556E6465727374616E64696E67204D7953514C20496E7465726E616C73206279205361736861205061636865762C20666F726D6572204D7953514C20646576656C6F706572206174204D7953514C2041422E0A2020202020202020202020206F205468697320697320746865206F6E6C7920626F6F6B207765206B6E6F772061626F75742074686174206465736372696265732074686520696E7465726E616C73206F66204D617269614442202F204D7953514C2E2041206D757374206861766520666F7220616E796F6E652077686F2077616E747320746F20756E6465727374616E6420616E6420646576656C6F70206F6E204D617269614442210A2020202020202020202020206F204E6F7420616C6C20746F706963732061726520636F766572656420616E6420736F6D652070617274732061726520736C696768746C79206F757464617465642C20627574207374696C6C20746865206265737420626F6F6B206F6E207468697320746F7069632E200A2020202020202A204D7953514C20352E3120506C7567696E20446576656C6F706D656E742062792053657267656920476F6C75626368696B20616E6420416E64726577204875746368696E67730A2020202020202020202020206F2041206D757374207265616420666F7220616E796F6E652077616E74696E6720746F207772697465206120706C7567696E20666F72204D6172696144422C207772697474656E20627920746865205365726765692077686F2064657369676E65642074686520706C7567696E20696E7465726661636520666F72204D7953514C20616E64204D61726961444221200A0A2020466F72204D617269614442202F204D7953514C20656E642075736572730A0A2020202020202A204D61726961444220437261736820436F757273652062792042656E20466F7274610A2020202020202020202020206F204669727374204D61726961444220626F6F6B210A2020202020202020202020206F20466F722070656F706C652077686F2077616E7420746F206C6561726E2053514C20616E642074686520626173696373206F66204D6172696144422E0A2020202020202020202020206F204E6F77207368697070696E672E20507572636861736520617420416D617A6F6E2E636F6D206F7220796F7572206661766F7269746520626F6F6B73656C6C65722E200A0A2020202020202A2053514C2D393920436F6D706C6574652C205265616C6C792062792050657465722047756C75747A616E20262054727564792050656C7A65722E0A2020202020202020202020206F2045766572797468696E6720796F752077616E74656420746F206B6E6F772061626F7574207468652053514C203939207374616E646172642E20457863656C6C656E74207265666572656E636520626F6F6B210A2020202020202020202020206F204672656520746F207265616420696E20746865204B6E6F776C656467656261736521200A0A2020202020202A204D7953514C20283474682045646974696F6E29206279205061756C204475426F69730A2020202020202020202020206F20546865202764656661756C742720626F6F6B20746F207265616420696620796F7520776F6E7420746F206C6561726E20746F20757365204D7953514C202F204D6172696144422E200A0A2020202020202A204D7953514C20436F6F6B626F6F6B206279205061756C204475426F69730A2020202020202020202020206F2041206C6F74206F66206578616D706C6573206F6620686F7720746F20757365204D7953514C2E204173207769746820616C6C206F66205061756C277320626F6F6B732C206974277320776F727468206974732077656967687420696E20676F6C6420616E64206576656E20656E6A6F7961626C652072656164696E6720666F7220737563682061202764727927207375626A6563742E200A0A2020202020202A204869676820506572666F726D616E6365204D7953514C2C205365636F6E642045646974696F6E2C204279204261726F6E20536368776172747A2C205065746572205A6169747365762C20566164696D20546B616368656E6B6F2C204A6572656D7920442E205A61776F646E792C2041726A656E204C656E747A2C20446572656B204A2E2042616C6C696E672C20657420616C2E0A2020202020202020202020206F20224869676820506572666F726D616E6365204D7953514C2069732074686520646566696E697469766520677569646520746F206275696C64696E6720666173742C2072656C6961626C652073797374656D732077697468204D7953514C2E205772697474656E206279206E6F74656420657870657274732077697468207965617273206F66207265616C2D776F726C6420657870657269656E6365206275696C64696E672076657279206C617267652073797374656D732C207468697320626F6F6B20636F7665727320657665727920617370656374206F66204D7953514C20706572666F726D616E636520696E2064657461696C2C20616E6420666F6375736573206F6E20726F627573746E6573732C2073656375726974792C20616E64206461746120696E746567726974792E204C6561726E20616476616E63656420746563686E697175657320696E20646570746820736F20796F752063616E206272696E67206F7574204D7953514C27732066756C6C20706F7765722E22202846726F6D2074686520626F6F6B206465736372697074696F6E206174204F275265696C6C7929200A0A2020202020202A204D7953514C2041646D696E20436F6F6B626F6F6B0A2020202020202020202020206F204120717569636B20737465702D62792D7374657020677569646520666F72204D7953514C20757365727320616E642064617461626173652061646D696E6973747261746F727320746F207461636B6C65207265616C2D776F726C64206368616C6C656E6765732077697468204D7953514C20636F6E66696775726174696F6E20616E642061646D696E697374726174696F6E200A0A2020202020202A204D7953514C20352E302043657274696669636174696F6E2053747564792047756964652C204279205061756C204475426F69732C2053746566616E2048696E7A2C204361727374656E20506564657273656E0A2020202020202020202020206F205468697320697320746865206F6666696369616C20677569646520746F20636F766572207468652070617373696E67206F66207468652074776F204D7953514C2043657274696669636174696F6E206578616D696E6174696F6E732E2049742069732076616C69642074696C6C2076657273696F6E20352E30206F6620746865207365727665722C20736F207768696C65206974206D697373657320616C6C2074686520666561747572657320617661696C61626C6520696E204D7953514C20352E3120616E6420677265617465722028696E636C7564696E67204D61726961444220352E3120616E642067726561746572292C2069742070726F7669646573206120676F6F6420626173696320756E6465727374616E64696E67206F66204D7953514C20666F722074686520656E642D757365722E20 +INSERT INTO t1 (v0,v1,v64,v65000) VALUES ('y', 'yy', REPEAT('c',65), REPEAT('abcdefghi ',6501)); +Warnings: +Warning 1265 Data truncated for column 'v0' at row 1 +Warning 1265 Data truncated for column 'v1' at row 1 +Warning 1265 Data truncated for column 'v64' at row 1 +Warning 1265 Data truncated for column 'v65000' at row 1 +INSERT INTO t1 (v0,v1,v64,v65000) SELECT v65000, v65000, v65000, CONCAT(v65000,v1) FROM t1; +Warnings: +Warning 1265 Data truncated for column 'v0' at row 2 +Warning 1265 Data truncated for column 'v1' at row 2 +Warning 1265 Data truncated for column 'v64' at row 2 +Warning 1265 Data truncated for column 'v0' at row 3 +Warning 1265 Data truncated for column 'v1' at row 3 +Warning 1265 Data truncated for column 'v64' at row 3 +Warning 1265 Data truncated for column 'v65000' at row 3 +SELECT HEX(v0), HEX(v1), HEX(v64), LENGTH(HEX(v65000)) FROM t1; +HEX(v0) HEX(v1) HEX(v64) LENGTH(HEX(v65000)) + 0 + 0 + 48 486572652069732061206C697374206F66207265636F6D6D656E64656420626F6F6B73206F6E204D61726961444220616E64204D7953514C2E20576527766520 5932 + 61 61626364656667686920616263646566676869206162636465666768692061626364656667686920616263646566676869206162636465666768692061626364 130000 + 79 4F6E63652074686572652C20646F75626C6520636865636B207468617420616E2061727469636C6520646F65736E277420616C7265616479206578697374 5930 + 79 63636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363 130000 +ALTER TABLE t1 ADD COLUMN v65536 VARBINARY(65536) <CUSTOM_COL_OPTIONS>; +Warnings: +Note 1246 Converting column 'v65536' from VARBINARY to BLOB +Note 1246 Converting column 'v65536' from VARBINARY to BLOB +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +v0 varbinary(0) # # # +v1 varbinary(1) # # # +v64 varbinary(64) # # # +v65000 varbinary(65000) # # # +v65536 mediumblob # # # +DROP TABLE t1, t2; diff --git a/mysql-test/suite/storage_engine/type_varbinary.test b/mysql-test/suite/storage_engine/type_varbinary.test new file mode 100644 index 00000000000..65240995522 --- /dev/null +++ b/mysql-test/suite/storage_engine/type_varbinary.test @@ -0,0 +1,10 @@ +# +# VARBINARY column types +# + +--source have_engine.inc + +--source type_varbinary.inc + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/type_varchar.inc b/mysql-test/suite/storage_engine/type_varchar.inc new file mode 100644 index 00000000000..472f74e0dd1 --- /dev/null +++ b/mysql-test/suite/storage_engine/type_varchar.inc @@ -0,0 +1,100 @@ +# +# VARCHAR column types +# + +--disable_warnings +DROP TABLE IF EXISTS t1, t2; +--enable_warnings + +let $create_definition = + v0 VARCHAR(0) $col_opts, + v1 VARCHAR(1) $col_opts, + v64 VARCHAR(64) $col_opts, + v65000 VARCHAR(65000) $col_opts +; +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = CHAR or VARCHAR types + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 3 # 4 # 5 # + SHOW COLUMNS IN t1; + + --let $table_name = t2 + --let $create_definition = v VARCHAR(65532) $col_opts + --source create_table.inc + + --replace_column 3 # 4 # 5 # + SHOW COLUMNS IN t2; + + # Valid values + + INSERT INTO t1 (v0,v1,v64,v65000) VALUES ('','','',''); + INSERT INTO t1 (v0,v1,v64,v65000) VALUES ('','y','Once there, double check that an article doesn\'t already exist','Here is a list of recommended books on MariaDB and MySQL. We\'ve provided links to Amazon.com here for convenience, but they can be found at many other bookstores, both online and off. + + If you want to have your favorite MySQL / MariaDB book listed here, please leave a comment. + For developers who want to code on MariaDB or MySQL + + * Understanding MySQL Internals by Sasha Pachev, former MySQL developer at MySQL AB. + o This is the only book we know about that describes the internals of MariaDB / MySQL. A must have for anyone who wants to understand and develop on MariaDB! + o Not all topics are covered and some parts are slightly outdated, but still the best book on this topic. + * MySQL 5.1 Plugin Development by Sergei Golubchik and Andrew Hutchings + o A must read for anyone wanting to write a plugin for MariaDB, written by the Sergei who designed the plugin interface for MySQL and MariaDB! + + For MariaDB / MySQL end users + + * MariaDB Crash Course by Ben Forta + o First MariaDB book! + o For people who want to learn SQL and the basics of MariaDB. + o Now shipping. Purchase at Amazon.com or your favorite bookseller. + + * SQL-99 Complete, Really by Peter Gulutzan & Trudy Pelzer. + o Everything you wanted to know about the SQL 99 standard. Excellent reference book! + o Free to read in the Knowledgebase! + + * MySQL (4th Edition) by Paul DuBois + o The \'default\' book to read if you wont to learn to use MySQL / MariaDB. + + * MySQL Cookbook by Paul DuBois + o A lot of examples of how to use MySQL. As with all of Paul\'s books, it\'s worth its weight in gold and even enjoyable reading for such a \'dry\' subject. + + * High Performance MySQL, Second Edition, By Baron Schwartz, Peter Zaitsev, Vadim Tkachenko, Jeremy D. Zawodny, Arjen Lentz, Derek J. Balling, et al. + o \"High Performance MySQL is the definitive guide to building fast, reliable systems with MySQL. Written by noted experts with years of real-world experience building very large systems, this book covers every aspect of MySQL performance in detail, and focuses on robustness, security, and data integrity. Learn advanced techniques in depth so you can bring out MySQL\'s full power.\" (From the book description at O\'Reilly) + + * MySQL Admin Cookbook + o A quick step-by-step guide for MySQL users and database administrators to tackle real-world challenges with MySQL configuration and administration + + * MySQL 5.0 Certification Study Guide, By Paul DuBois, Stefan Hinz, Carsten Pedersen + o This is the official guide to cover the passing of the two MySQL Certification examinations. It is valid till version 5.0 of the server, so while it misses all the features available in MySQL 5.1 and greater (including MariaDB 5.1 and greater), it provides a good basic understanding of MySQL for the end-user. '); + + --sorted_result + SELECT * FROM t1; + + # Invalid values + + INSERT INTO t1 (v0,v1,v64,v65000) VALUES ('y', 'yy', REPEAT('c',65), REPEAT('abcdefghi ',6501)); + INSERT INTO t1 (v0,v1,v64,v65000) SELECT v65000, v65000, v65000, CONCAT(v65000,v1) FROM t1; + + --sorted_result + SELECT v0, v1, v64, LENGTH(v65000) FROM t1; + + --let $alter_definition = ADD COLUMN v65536 VARCHAR(65536) $col_opts + --source alter_table.inc + if ($mysql_errname) + { + --let $my_last_stmt = $alter_statement + --let $functionality = ALTER TABLE or TEXT types + --source unexpected_result.inc + } + if (!$mysql_errname) + { + --replace_column 3 # 4 # 5 # + SHOW COLUMNS IN t1; + } + DROP TABLE t1, t2; +} + diff --git a/mysql-test/suite/storage_engine/type_varchar.result b/mysql-test/suite/storage_engine/type_varchar.result new file mode 100644 index 00000000000..055c8dcd7ca --- /dev/null +++ b/mysql-test/suite/storage_engine/type_varchar.result @@ -0,0 +1,127 @@ +DROP TABLE IF EXISTS t1, t2; +CREATE TABLE t1 (v0 VARCHAR(0) <CUSTOM_COL_OPTIONS>, +v1 VARCHAR(1) <CUSTOM_COL_OPTIONS>, +v64 VARCHAR(64) <CUSTOM_COL_OPTIONS>, +v65000 VARCHAR(65000) <CUSTOM_COL_OPTIONS> +) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +v0 varchar(0) # # # +v1 varchar(1) # # # +v64 varchar(64) # # # +v65000 varchar(65000) # # # +CREATE TABLE t2 (v VARCHAR(65532) <CUSTOM_COL_OPTIONS>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t2; +Field Type Null Key Default Extra +v varchar(65532) # # # +INSERT INTO t1 (v0,v1,v64,v65000) VALUES ('','','',''); +INSERT INTO t1 (v0,v1,v64,v65000) VALUES ('','y','Once there, double check that an article doesn\'t already exist','Here is a list of recommended books on MariaDB and MySQL. We\'ve provided links to Amazon.com here for convenience, but they can be found at many other bookstores, both online and off. + + If you want to have your favorite MySQL / MariaDB book listed here, please leave a comment. + For developers who want to code on MariaDB or MySQL + + * Understanding MySQL Internals by Sasha Pachev, former MySQL developer at MySQL AB. + o This is the only book we know about that describes the internals of MariaDB / MySQL. A must have for anyone who wants to understand and develop on MariaDB! + o Not all topics are covered and some parts are slightly outdated, but still the best book on this topic. + * MySQL 5.1 Plugin Development by Sergei Golubchik and Andrew Hutchings + o A must read for anyone wanting to write a plugin for MariaDB, written by the Sergei who designed the plugin interface for MySQL and MariaDB! + + For MariaDB / MySQL end users + + * MariaDB Crash Course by Ben Forta + o First MariaDB book! + o For people who want to learn SQL and the basics of MariaDB. + o Now shipping. Purchase at Amazon.com or your favorite bookseller. + + * SQL-99 Complete, Really by Peter Gulutzan & Trudy Pelzer. + o Everything you wanted to know about the SQL 99 standard. Excellent reference book! + o Free to read in the Knowledgebase! + + * MySQL (4th Edition) by Paul DuBois + o The \'default\' book to read if you wont to learn to use MySQL / MariaDB. + + * MySQL Cookbook by Paul DuBois + o A lot of examples of how to use MySQL. As with all of Paul\'s books, it\'s worth its weight in gold and even enjoyable reading for such a \'dry\' subject. + + * High Performance MySQL, Second Edition, By Baron Schwartz, Peter Zaitsev, Vadim Tkachenko, Jeremy D. Zawodny, Arjen Lentz, Derek J. Balling, et al. + o \"High Performance MySQL is the definitive guide to building fast, reliable systems with MySQL. Written by noted experts with years of real-world experience building very large systems, this book covers every aspect of MySQL performance in detail, and focuses on robustness, security, and data integrity. Learn advanced techniques in depth so you can bring out MySQL\'s full power.\" (From the book description at O\'Reilly) + + * MySQL Admin Cookbook + o A quick step-by-step guide for MySQL users and database administrators to tackle real-world challenges with MySQL configuration and administration + + * MySQL 5.0 Certification Study Guide, By Paul DuBois, Stefan Hinz, Carsten Pedersen + o This is the official guide to cover the passing of the two MySQL Certification examinations. It is valid till version 5.0 of the server, so while it misses all the features available in MySQL 5.1 and greater (including MariaDB 5.1 and greater), it provides a good basic understanding of MySQL for the end-user. '); +SELECT * FROM t1; +v0 v1 v64 v65000 + + + + + + + + + + + + y Once there, double check that an article doesn't already exist Here is a list of recommended books on MariaDB and MySQL. We've provided links to Amazon.com here for convenience, but they can be found at many other bookstores, both online and off. + o "High Performance MySQL is the definitive guide to building fast, reliable systems with MySQL. Written by noted experts with years of real-world experience building very large systems, this book covers every aspect of MySQL performance in detail, and focuses on robustness, security, and data integrity. Learn advanced techniques in depth so you can bring out MySQL's full power." (From the book description at O'Reilly) + o A lot of examples of how to use MySQL. As with all of Paul's books, it's worth its weight in gold and even enjoyable reading for such a 'dry' subject. + o A must read for anyone wanting to write a plugin for MariaDB, written by the Sergei who designed the plugin interface for MySQL and MariaDB! + o A quick step-by-step guide for MySQL users and database administrators to tackle real-world challenges with MySQL configuration and administration + o Everything you wanted to know about the SQL 99 standard. Excellent reference book! + o First MariaDB book! + o For people who want to learn SQL and the basics of MariaDB. + o Free to read in the Knowledgebase! + o Not all topics are covered and some parts are slightly outdated, but still the best book on this topic. + o Now shipping. Purchase at Amazon.com or your favorite bookseller. + o The 'default' book to read if you wont to learn to use MySQL / MariaDB. + o This is the official guide to cover the passing of the two MySQL Certification examinations. It is valid till version 5.0 of the server, so while it misses all the features available in MySQL 5.1 and greater (including MariaDB 5.1 and greater), it provides a good basic understanding of MySQL for the end-user. + o This is the only book we know about that describes the internals of MariaDB / MySQL. A must have for anyone who wants to understand and develop on MariaDB! + * High Performance MySQL, Second Edition, By Baron Schwartz, Peter Zaitsev, Vadim Tkachenko, Jeremy D. Zawodny, Arjen Lentz, Derek J. Balling, et al. + * MariaDB Crash Course by Ben Forta + * MySQL (4th Edition) by Paul DuBois + * MySQL 5.0 Certification Study Guide, By Paul DuBois, Stefan Hinz, Carsten Pedersen + * MySQL 5.1 Plugin Development by Sergei Golubchik and Andrew Hutchings + * MySQL Admin Cookbook + * MySQL Cookbook by Paul DuBois + * SQL-99 Complete, Really by Peter Gulutzan & Trudy Pelzer. + * Understanding MySQL Internals by Sasha Pachev, former MySQL developer at MySQL AB. + For MariaDB / MySQL end users + For developers who want to code on MariaDB or MySQL + If you want to have your favorite MySQL / MariaDB book listed here, please leave a comment. +INSERT INTO t1 (v0,v1,v64,v65000) VALUES ('y', 'yy', REPEAT('c',65), REPEAT('abcdefghi ',6501)); +Warnings: +Warning 1265 Data truncated for column 'v0' at row 1 +Warning 1265 Data truncated for column 'v1' at row 1 +Warning 1265 Data truncated for column 'v64' at row 1 +Warning 1265 Data truncated for column 'v65000' at row 1 +INSERT INTO t1 (v0,v1,v64,v65000) SELECT v65000, v65000, v65000, CONCAT(v65000,v1) FROM t1; +Warnings: +Warning 1265 Data truncated for column 'v0' at row 2 +Warning 1265 Data truncated for column 'v1' at row 2 +Warning 1265 Data truncated for column 'v64' at row 2 +Warning 1265 Data truncated for column 'v0' at row 3 +Warning 1265 Data truncated for column 'v1' at row 3 +Warning 1265 Data truncated for column 'v64' at row 3 +Warning 1265 Data truncated for column 'v65000' at row 3 +SELECT v0, v1, v64, LENGTH(v65000) FROM t1; +v0 v1 v64 LENGTH(v65000) + 0 + 0 + H Here is a list of recommended books on MariaDB and MySQL. We've 2966 + a abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcd 65000 + y Once there, double check that an article doesn't already exist 2965 + y cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc 65000 +ALTER TABLE t1 ADD COLUMN v65536 VARCHAR(65536) <CUSTOM_COL_OPTIONS>; +Warnings: +Note 1246 Converting column 'v65536' from VARCHAR to TEXT +Note 1246 Converting column 'v65536' from VARCHAR to TEXT +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +v0 varchar(0) # # # +v1 varchar(1) # # # +v64 varchar(64) # # # +v65000 varchar(65000) # # # +v65536 mediumtext # # # +DROP TABLE t1, t2; diff --git a/mysql-test/suite/storage_engine/type_varchar.test b/mysql-test/suite/storage_engine/type_varchar.test new file mode 100644 index 00000000000..8f7c5e72a72 --- /dev/null +++ b/mysql-test/suite/storage_engine/type_varchar.test @@ -0,0 +1,10 @@ +# +# VARCHAR column types +# + +--source have_engine.inc + +--source type_varchar.inc + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/unexpected_result.inc b/mysql-test/suite/storage_engine/unexpected_result.inc new file mode 100644 index 00000000000..2552988dddc --- /dev/null +++ b/mysql-test/suite/storage_engine/unexpected_result.inc @@ -0,0 +1,50 @@ +# +# This include file prints a standard message about possibly unsupported functionality +# when a statement finished not as expected. +# Usage: +# --let $functionality = Foreign keys # optional +# --let $my_last_stmt = INSERT INTO t VALUES (1) # optional + +--let $versions = + +if (!$functionality) +{ + --let $functionality = Functionality +} +if ($mysql_errname) +{ + --let $result = finished with $mysql_errname + if ($mysql_errname == ER_SYNTAX_ERROR) + { + --let $functionality = $functionality or the syntax + } + if ($mysql_errname == ER_ILLEGAL_HA) + { + --let $functionality = $functionality or the syntax + --let $versions = unsupported + } +} +if (!$mysql_errname) +{ + --let $result = succeeded unexpectedly +} +if (!$versions) +{ + --let $versions = unsupported|malfunctioning, or the problem was caused by previous errors +} + +--echo # ------------ UNEXPECTED RESULT ------------ +if ($my_last_stmt) +{ + --echo # [ $my_last_stmt ] +} +--echo # The statement|command $result. +--echo # $functionality or the mix could be $versions. +--echo # You can change the engine code, or create an rdiff, or disable the test by adding it to disabled.def. +--echo # Further in this test, the message might sometimes be suppressed; a part of the test might be skipped. +--echo # Also, this problem may cause a chain effect (more errors of different kinds in the test). +--echo # ------------------------------------------- + +--let $my_last_stmt = +--let $functionality = + diff --git a/mysql-test/suite/storage_engine/update.result b/mysql-test/suite/storage_engine/update.result new file mode 100644 index 00000000000..3b96558c7c5 --- /dev/null +++ b/mysql-test/suite/storage_engine/update.result @@ -0,0 +1,50 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(10000,'foobar'); +INSERT INTO t1 (a,b) SELECT a, b FROM t1; +UPDATE t1 SET a=a+100; +SELECT * FROM t1; +a b +101 a +101 a +10100 foobar +10100 foobar +102 b +102 b +103 c +103 c +104 d +104 d +105 e +105 e +UPDATE t1 SET a=a-100, b=DEFAULT WHERE a>100; +SELECT * FROM t1; +a b +1 NULL +1 NULL +10000 NULL +10000 NULL +2 NULL +2 NULL +3 NULL +3 NULL +4 NULL +4 NULL +5 NULL +5 NULL +UPDATE t1 SET b = 'update' WHERE a <= 4 ORDER BY b DESC, a ASC LIMIT 1; +SELECT * FROM t1; +a b +1 NULL +1 update +10000 NULL +10000 NULL +2 NULL +2 NULL +3 NULL +3 NULL +4 NULL +4 NULL +5 NULL +5 NULL +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/update.test b/mysql-test/suite/storage_engine/update.test new file mode 100644 index 00000000000..4f892fa547d --- /dev/null +++ b/mysql-test/suite/storage_engine/update.test @@ -0,0 +1,43 @@ +# +# Basic UPDATE statements. +# UPDATE LOW_PRIORITY is covered in update_low_prio test +# UPDATE IGNORE is covered in update_ignore test +# Multi-table update is covered in update_multi test +# + +--source have_engine.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +--source create_table.inc +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(10000,'foobar'); +INSERT INTO t1 (a,b) SELECT a, b FROM t1; + +UPDATE t1 SET a=a+100; +if ($mysql_errname) +{ + --let $functionality = UPDATE + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --sorted_result + SELECT * FROM t1; + + UPDATE t1 SET a=a-100, b=DEFAULT WHERE a>100; + --sorted_result + SELECT * FROM t1; + + # ORDER BY and LIMIT + UPDATE t1 SET b = 'update' WHERE a <= 4 ORDER BY b DESC, a ASC LIMIT 1; + --sorted_result + SELECT * FROM t1; +} + +# Cleanup +DROP TABLE t1; + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/update_ignore.result b/mysql-test/suite/storage_engine/update_ignore.result new file mode 100644 index 00000000000..26b7168196a --- /dev/null +++ b/mysql-test/suite/storage_engine/update_ignore.result @@ -0,0 +1,54 @@ +DROP TABLE IF EXISTS t1,t2; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(10000,'foobar'); +INSERT INTO t1 (a,b) SELECT a, b FROM t1; +CREATE TABLE t2 (c <CHAR_COLUMN>, d <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t2 (c,d) SELECT b, a FROM t1; +UPDATE IGNORE t1 SET b = 'upd1' WHERE b IS NOT NULL ORDER BY a LIMIT 1; +SELECT * FROM t1; +a b +1 a +1 upd1 +10000 foobar +10000 foobar +2 b +2 b +3 c +3 c +4 d +4 d +5 e +5 e +UPDATE IGNORE t1, t2 SET b = 'upd2a', c = 'upd2b' +WHERE c < b OR a != ( SELECT 1 UNION SELECT 2 ); +Warnings: +Warning 1242 Subquery returns more than 1 row +SELECT * FROM t1; +a b +1 a +1 upd2a +10000 upd2a +10000 upd2a +2 upd2a +2 upd2a +3 upd2a +3 upd2a +4 upd2a +4 upd2a +5 upd2a +5 upd2a +SELECT * FROM t2; +c d +upd2b 1 +upd2b 1 +upd2b 10000 +upd2b 10000 +upd2b 2 +upd2b 2 +upd2b 3 +upd2b 3 +upd2b 4 +upd2b 4 +upd2b 5 +upd2b 5 +DROP TABLE t1, t2; diff --git a/mysql-test/suite/storage_engine/update_ignore.test b/mysql-test/suite/storage_engine/update_ignore.test new file mode 100644 index 00000000000..ddd4f7405a3 --- /dev/null +++ b/mysql-test/suite/storage_engine/update_ignore.test @@ -0,0 +1,43 @@ +# +# UPDATE IGNORE +# + +--source have_engine.inc + +--disable_warnings +DROP TABLE IF EXISTS t1,t2; +--enable_warnings + +--source create_table.inc +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(10000,'foobar'); +INSERT INTO t1 (a,b) SELECT a, b FROM t1; + +--let $table_name = t2 +--let $create_definition = c $char_col, d $int_col +--source create_table.inc +INSERT INTO t2 (c,d) SELECT b, a FROM t1; + +UPDATE IGNORE t1 SET b = 'upd1' WHERE b IS NOT NULL ORDER BY a LIMIT 1; +if ($mysql_errname) +{ + --let $functionality = UPDATE IGNORE + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --sorted_result + SELECT * FROM t1; + + UPDATE IGNORE t1, t2 SET b = 'upd2a', c = 'upd2b' + WHERE c < b OR a != ( SELECT 1 UNION SELECT 2 ); + --sorted_result + SELECT * FROM t1; + --sorted_result + SELECT * FROM t2; +} + +# Cleanup +DROP TABLE t1, t2; + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/update_low_prio.result b/mysql-test/suite/storage_engine/update_low_prio.result new file mode 100644 index 00000000000..31a31b6be62 --- /dev/null +++ b/mysql-test/suite/storage_engine/update_low_prio.result @@ -0,0 +1,66 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (11,'foobar'),(12,'b'); +SET LOW_PRIORITY_UPDATES = 0; +SET lock_wait_timeout = 4; +connect con1,localhost,root,,; +SET lock_wait_timeout = 2; +SELECT a+SLEEP(1) FROM t1; +connection default; +UPDATE t1 SET a=a+10; +connect con2,localhost,root,,; +SET lock_wait_timeout = 3; +SELECT a+SLEEP(1) FROM t1; +a+SLEEP(1) +21 +22 +connection con1; +a+SLEEP(1) +11 +12 +connection default; +SELECT * FROM t1; +a b +21 foobar +22 b +connection con1; +SELECT a+SLEEP(1) FROM t1; +connection default; +UPDATE LOW_PRIORITY t1 SET a=a+20; +connection con2; +SELECT a+SLEEP(1) FROM t1; +a+SLEEP(1) +21 +22 +connection con1; +a+SLEEP(1) +21 +22 +connection default; +SELECT * FROM t1; +a b +41 foobar +42 b +SET LOW_PRIORITY_UPDATES = 1; +connection con1; +SELECT a+SLEEP(1) FROM t1; +connection default; +UPDATE t1 SET a=a+30; +connection con2; +SELECT a+SLEEP(1) FROM t1; +a+SLEEP(1) +41 +42 +connection con1; +a+SLEEP(1) +41 +42 +connection default; +SELECT * FROM t1; +a b +71 foobar +72 b +disconnect con1; +disconnect con2; +connection default; +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/update_low_prio.test b/mysql-test/suite/storage_engine/update_low_prio.test new file mode 100644 index 00000000000..6c089c7172f --- /dev/null +++ b/mysql-test/suite/storage_engine/update_low_prio.test @@ -0,0 +1,167 @@ +# +# UPDATE LOW_PRIORITY +# +--source have_engine.inc + +--source include/count_sessions.inc + +--enable_connect_log + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +--source create_table.inc +INSERT INTO t1 (a,b) VALUES (11,'foobar'),(12,'b'); + +# We will have 3 connections: +# con1 will start SELECT which should give us enough time; +# default will run UPDATE +# con2 will then start another SELECT. +# With LOW_PRIORITY_UPDATES = 0, +# with standard UPDATE we should see old data in con1 resultset, +# but new data in con2 resultset. +# With UPDATE LOW_PRIORITY we should see old data in both resultsets. +# Then we will set LOW_PRIORITY_UPDATES to 1. +# Then with standard UPDATE we should also see old data in both resultsets. + +SET LOW_PRIORITY_UPDATES = 0; +SET lock_wait_timeout = 4; + +# Normal UPDATE with low_priority_updates=0 + +--connect (con1,localhost,root,,) +SET lock_wait_timeout = 2; +--send +SELECT a+SLEEP(1) FROM t1; + +--connection default +let $show_statement = SHOW PROCESSLIST; +let $field = State; +let $condition = = 'User sleep'; +# We don't need to wait long, +# if the feature works, threads +# should show up in the processlist right away +let $wait_timeout = 2; +--source include/wait_show_condition.inc +--send +UPDATE t1 SET a=a+10; + +--connect (con2,localhost,root,,) +SET lock_wait_timeout = 3; +let $field = Info; +let $condition = = 'UPDATE t1 SET a=a+10'; +let $wait_timeout = 2; +--source include/wait_show_condition.inc +if (!$found) +{ + --let $mysql_errname = timeout in wait_show_condition.inc + --let $functionality = Table locking + --source unexpected_result.inc +} +--sorted_result +SELECT a+SLEEP(1) FROM t1; + +--connection con1 +--sorted_result +--reap + +--connection default +--reap +if ($mysql_errname) +{ + --let $my_last_stmt = UPDATE t1 SET a=a+10 + --let $functionality = UPDATE + --source unexpected_result.inc +} + +--sorted_result +SELECT * FROM t1; + +# UPDATE LOW_PRIORITY + +--connection con1 +--send +SELECT a+SLEEP(1) FROM t1; + +--connection default +let $field = State; +let $condition = = 'User sleep'; +let $wait_timeout = 2; +--source include/wait_show_condition.inc +--send +UPDATE LOW_PRIORITY t1 SET a=a+20; + +--connection con2 +let $field = Info; +let $condition = = 'UPDATE LOW_PRIORITY t1 SET a=a+20'; +let $wait_timeout = 2; +--source include/wait_show_condition.inc +--sorted_result +SELECT a+SLEEP(1) FROM t1; + +--connection con1 +--sorted_result +--reap + +--connection default +--reap +--sorted_result +SELECT * FROM t1; + +SET LOW_PRIORITY_UPDATES = 1; + +# Normal UPDATE with low_priority_updates=1 + +--connection con1 +--send +SELECT a+SLEEP(1) FROM t1; + +--connection default +let $field = State; +let $condition = = 'User sleep'; +let $wait_timeout = 2; +--source include/wait_show_condition.inc +--send +UPDATE t1 SET a=a+30; + +--connection con2 +let $field = Info; +let $condition = = 'UPDATE t1 SET a=a+30'; +let $wait_timeout = 2; +--source include/wait_show_condition.inc +if (!$found) +{ + --let $mysql_errname = timeout in wait_show_condition.inc + --let $functionality = Table locking + --source unexpected_result.inc +} +--sorted_result +SELECT a+SLEEP(1) FROM t1; + +--connection con1 +--sorted_result +--reap + +--connection default +--reap +if ($mysql_errname) +{ + --let $my_last_stmt = UPDATE t1 SET a=a+30 + --let $functionality = UPDATE + --source unexpected_result.inc +} +--sorted_result +SELECT * FROM t1; + +--disconnect con1 +--disconnect con2 + +--connection default +# Cleanup +DROP TABLE t1; + +--source include/wait_until_count_sessions.inc + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/update_multi.result b/mysql-test/suite/storage_engine/update_multi.result new file mode 100644 index 00000000000..42b2f239dd2 --- /dev/null +++ b/mysql-test/suite/storage_engine/update_multi.result @@ -0,0 +1,65 @@ +DROP TABLE IF EXISTS t1,t2; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(10000,'foobar'); +INSERT INTO t1 (a,b) SELECT a, b FROM t1; +CREATE TABLE t2 (c <CHAR_COLUMN>, d <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t2 (c,d) SELECT b, a FROM t1; +UPDATE t1, t2 SET t1.a = t2.d+100, t2.c = 'multi' WHERE c < b AND a + d != 1; +SELECT * FROM t1; +a b +1 a +1 a +101 b +101 b +101 c +101 c +101 d +101 d +101 e +101 e +101 foobar +101 foobar +SELECT * FROM t2; +c d +foobar 10000 +foobar 10000 +multi 1 +multi 1 +multi 2 +multi 2 +multi 3 +multi 3 +multi 4 +multi 4 +multi 5 +multi 5 +UPDATE t2, t1 SET t2.d = DEFAULT WHERE c = 'foobar' and b = c; +SELECT * FROM t1; +a b +1 a +1 a +101 b +101 b +101 c +101 c +101 d +101 d +101 e +101 e +101 foobar +101 foobar +SELECT * FROM t2; +c d +foobar NULL +foobar NULL +multi 1 +multi 1 +multi 2 +multi 2 +multi 3 +multi 3 +multi 4 +multi 4 +multi 5 +multi 5 +DROP TABLE t1, t2; diff --git a/mysql-test/suite/storage_engine/update_multi.test b/mysql-test/suite/storage_engine/update_multi.test new file mode 100644 index 00000000000..589a8319382 --- /dev/null +++ b/mysql-test/suite/storage_engine/update_multi.test @@ -0,0 +1,44 @@ +# +# Multi-table UPDATE statements. +# + +--source have_engine.inc + +--disable_warnings +DROP TABLE IF EXISTS t1,t2; +--enable_warnings + +--source create_table.inc +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(10000,'foobar'); +INSERT INTO t1 (a,b) SELECT a, b FROM t1; + +--let $table_name = t2 +--let $create_definition = c $char_col, d $int_col +--source create_table.inc +INSERT INTO t2 (c,d) SELECT b, a FROM t1; + +UPDATE t1, t2 SET t1.a = t2.d+100, t2.c = 'multi' WHERE c < b AND a + d != 1; +if ($mysql_errname) +{ + --let $functionality = UPDATE + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --sorted_result + SELECT * FROM t1; + --sorted_result + SELECT * FROM t2; + + UPDATE t2, t1 SET t2.d = DEFAULT WHERE c = 'foobar' and b = c; + --sorted_result + SELECT * FROM t1; + --sorted_result + SELECT * FROM t2; +} + +# Cleanup +DROP TABLE t1, t2; + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/update_with_keys.result b/mysql-test/suite/storage_engine/update_with_keys.result new file mode 100644 index 00000000000..8250f31a19e --- /dev/null +++ b/mysql-test/suite/storage_engine/update_with_keys.result @@ -0,0 +1,90 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>, INDEX(b)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(6,'x'),(7,'y'),(8,'z'); +UPDATE t1 SET a=100, b='f' WHERE b IN ('b','c'); +UPDATE t1 SET b='m' WHERE b = 'f'; +UPDATE t1 SET b='z' WHERE a < 2; +UPDATE t1 SET b=''; +SELECT * FROM t1; +a b +1 +100 +100 +4 +5 +6 +7 +8 +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>, UNIQUE INDEX(a)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(0,'f'),(100,'a'); +UPDATE t1 SET a=a+200; +UPDATE t1 SET a=0 WHERE a > 250; +UPDATE t1 SET a=205 WHERE a=200; +ERROR 23000: Duplicate entry '205' for key 'a' +# Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY). +# If you got a difference in error message, just add it to rdiff file +UPDATE t1 SET a=12345 ORDER BY a, b LIMIT 1; +SELECT * FROM t1; +a b +12345 a +200 f +201 a +202 b +203 c +204 d +205 e +UPDATE t1 SET a=80 WHERE a IN (202,203); +ERROR 23000: Duplicate entry '80' for key 'a' +# Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY). +# If you got a difference in error message, just add it to rdiff file +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>, UNIQUE INDEX(a,b)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(100,'a'),(6,'f'); +UPDATE t1 SET a=6 WHERE a=3; +UPDATE t1 SET a=100 WHERE a=1; +ERROR 23000: Duplicate entry '100-a' for key 'a' +# Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY). +# If you got a difference in error message, just add it to rdiff file +UPDATE t1 SET a=4, b='d' WHERE b='f'; +ERROR 23000: Duplicate entry '4-d' for key 'a' +# Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY). +# If you got a difference in error message, just add it to rdiff file +UPDATE t1 SET a=a+1; +SELECT * FROM t1; +a b +101 a +2 a +3 b +5 d +6 e +7 c +7 f +UPDATE t1 SET b='z'; +ERROR 23000: Duplicate entry '7-z' for key 'a' +# Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY). +# If you got a difference in error message, just add it to rdiff file +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN> PRIMARY KEY, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(0,'f'),(100,'a'); +UPDATE t1 SET a=a+200; +UPDATE t1 SET a=0 WHERE a > 250; +UPDATE t1 SET a=205 WHERE a=200; +ERROR 23000: Duplicate entry '205' for key 'PRIMARY' +# Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY). +# If you got a difference in error message, just add it to rdiff file +UPDATE t1 SET a=12345 ORDER BY a DESC, b LIMIT 1; +SELECT * FROM t1; +a b +0 a +12345 e +200 f +201 a +202 b +203 c +204 d +UPDATE t1 SET a=80 WHERE a IN (202,203); +ERROR 23000: Duplicate entry '80' for key 'PRIMARY' +# Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY). +# If you got a difference in error message, just add it to rdiff file +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/update_with_keys.test b/mysql-test/suite/storage_engine/update_with_keys.test new file mode 100644 index 00000000000..578ee3b3294 --- /dev/null +++ b/mysql-test/suite/storage_engine/update_with_keys.test @@ -0,0 +1,152 @@ +# +# UPDATE statements for tables with keys +# +--source have_engine.inc +--source have_default_index.inc + + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +--let $create_definition = a $int_col, b $char_col, INDEX(b) +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Non-unique keys + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(6,'x'),(7,'y'),(8,'z'); + UPDATE t1 SET a=100, b='f' WHERE b IN ('b','c'); + if ($mysql_errname) + { + --let $functionality = UPDATE + --source unexpected_result.inc + } + if (!$mysql_errname) + { + UPDATE t1 SET b='m' WHERE b = 'f'; + UPDATE t1 SET b='z' WHERE a < 2; + UPDATE t1 SET b=''; + --sorted_result + SELECT * FROM t1; + } + DROP TABLE t1; +} + +--let $create_definition = a $int_col, b $char_col, UNIQUE INDEX(a) +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Unique keys + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(0,'f'),(100,'a'); + UPDATE t1 SET a=a+200; + if ($mysql_errname) + { + --let $functionality = UPDATE + --source unexpected_result.inc + } + if (!$mysql_errname) + { + UPDATE t1 SET a=0 WHERE a > 250; + --let $error_codes = ER_DUP_ENTRY,ER_DUP_KEY + UPDATE t1 SET a=205 WHERE a=200; + --source check_errors.inc + UPDATE t1 SET a=12345 ORDER BY a, b LIMIT 1; + --sorted_result + SELECT * FROM t1; + + # We'll check that the next update causes an error, + # but won't check the result because it might be different depending + # on whether the engine is transactional or not + --let $error_codes = ER_DUP_ENTRY,ER_DUP_KEY + UPDATE t1 SET a=80 WHERE a IN (202,203); + --source check_errors.inc + } + DROP TABLE t1; +} + +--let $create_definition = a $int_col, b $char_col, UNIQUE INDEX(a,b) +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Unique keys or multi-part keys + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(100,'a'),(6,'f'); + UPDATE t1 SET a=6 WHERE a=3; + if ($mysql_errname) + { + --let $functionality = UPDATE + --source unexpected_result.inc + } + if (!$mysql_errname) + { + --let $error_codes = ER_DUP_ENTRY,ER_DUP_KEY + UPDATE t1 SET a=100 WHERE a=1; + --source check_errors.inc + --let $error_codes = ER_DUP_ENTRY,ER_DUP_KEY + UPDATE t1 SET a=4, b='d' WHERE b='f'; + --source check_errors.inc + UPDATE t1 SET a=a+1; + --sorted_result + SELECT * FROM t1; + --let $error_codes = ER_DUP_ENTRY,ER_DUP_KEY + UPDATE t1 SET b='z'; + --source check_errors.inc + } + DROP TABLE t1; +} + +--let $create_definition = a $int_col PRIMARY KEY, b $char_col +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Primary key + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(0,'f'),(100,'a'); + UPDATE t1 SET a=a+200; + if ($mysql_errname) + { + --let $functionality = UPDATE + --source unexpected_result.inc + } + if (!$mysql_errname) + { + UPDATE t1 SET a=0 WHERE a > 250; + --let $error_codes = ER_DUP_ENTRY,ER_DUP_KEY + UPDATE t1 SET a=205 WHERE a=200; + --source check_errors.inc + UPDATE t1 SET a=12345 ORDER BY a DESC, b LIMIT 1; + + --sorted_result + SELECT * FROM t1; + + # We'll check that the next update causes an error, + # but won't check the result because it might be different depending + # on whether the engine is transactional or not + + --let $error_codes = ER_DUP_ENTRY,ER_DUP_KEY + UPDATE t1 SET a=80 WHERE a IN (202,203); + --source check_errors.inc + } + DROP TABLE t1; +} + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/storage_engine/vcol.result b/mysql-test/suite/storage_engine/vcol.result new file mode 100644 index 00000000000..bae7636f6cb --- /dev/null +++ b/mysql-test/suite/storage_engine/vcol.result @@ -0,0 +1,69 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <INT_COLUMN> GENERATED ALWAYS AS (a+1)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +a int(11) # # +b int(11) # # VIRTUAL +INSERT INTO t1 (a) VALUES (1),(2); +INSERT INTO t1 (a,b) VALUES (3,3),(4,4); +Warnings: +Warning 1906 The value specified for computed column 'b' in table 't1' ignored +Warning 1906 The value specified for computed column 'b' in table 't1' ignored +SELECT * FROM t1; +a b +1 2 +2 3 +3 4 +4 5 +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <INT_COLUMN> GENERATED ALWAYS AS (a+1) PERSISTENT) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +a int(11) # # +b int(11) # # PERSISTENT +INSERT INTO t1 (a) VALUES (1),(2); +INSERT INTO t1 (a,b) VALUES (3,3),(4,4); +Warnings: +Warning 1906 The value specified for computed column 'b' in table 't1' ignored +Warning 1906 The value specified for computed column 'b' in table 't1' ignored +SELECT * FROM t1; +a b +1 2 +2 3 +3 4 +4 5 +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <INT_COLUMN> GENERATED ALWAYS AS (a+1) VIRTUAL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +a int(11) # # +b int(11) # # VIRTUAL +INSERT INTO t1 (a) VALUES (1),(2); +INSERT INTO t1 (a,b) VALUES (3,3),(4,4); +Warnings: +Warning 1906 The value specified for computed column 'b' in table 't1' ignored +Warning 1906 The value specified for computed column 'b' in table 't1' ignored +SELECT * FROM t1; +a b +1 2 +2 3 +3 4 +4 5 +DROP TABLE t1; +CREATE TABLE t1 (a <INT_COLUMN>, b <INT_COLUMN> AS (a+1) PERSISTENT) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +SHOW COLUMNS IN t1; +Field Type Null Key Default Extra +a int(11) # # +b int(11) # # PERSISTENT +INSERT INTO t1 (a) VALUES (1),(2); +INSERT INTO t1 (a,b) VALUES (3,3),(4,4); +Warnings: +Warning 1906 The value specified for computed column 'b' in table 't1' ignored +Warning 1906 The value specified for computed column 'b' in table 't1' ignored +SELECT * FROM t1; +a b +1 2 +2 3 +3 4 +4 5 +DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/vcol.test b/mysql-test/suite/storage_engine/vcol.test new file mode 100644 index 00000000000..90819ffbd47 --- /dev/null +++ b/mysql-test/suite/storage_engine/vcol.test @@ -0,0 +1,72 @@ +# +# Virtual columns +# + +--source have_engine.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +let $create_definition = a $int_col, b $int_col GENERATED ALWAYS AS (a+1); +--source create_table.inc +if ($mysql_errname) +{ + --let $my_last_stmt = $create_statement + --let $functionality = Virtual columns + --source unexpected_result.inc +} +if (!$mysql_errname) +{ + --replace_column 3 # 5 # + SHOW COLUMNS IN t1; + + INSERT INTO t1 (a) VALUES (1),(2); + INSERT INTO t1 (a,b) VALUES (3,3),(4,4); + --sorted_result + SELECT * FROM t1; + + DROP TABLE t1; + + let $create_definition = a $int_col, b $int_col GENERATED ALWAYS AS (a+1) PERSISTENT; + --source create_table.inc + + --replace_column 3 # 5 # + SHOW COLUMNS IN t1; + + INSERT INTO t1 (a) VALUES (1),(2); + INSERT INTO t1 (a,b) VALUES (3,3),(4,4); + --sorted_result + SELECT * FROM t1; + + DROP TABLE t1; + + let $create_definition = a $int_col, b $int_col GENERATED ALWAYS AS (a+1) VIRTUAL; + --source create_table.inc + + --replace_column 3 # 5 # + SHOW COLUMNS IN t1; + + INSERT INTO t1 (a) VALUES (1),(2); + INSERT INTO t1 (a,b) VALUES (3,3),(4,4); + --sorted_result + SELECT * FROM t1; + + DROP TABLE t1; + + let $create_definition = a $int_col, b $int_col AS (a+1) PERSISTENT; + --source create_table.inc + + --replace_column 3 # 5 # + SHOW COLUMNS IN t1; + + INSERT INTO t1 (a) VALUES (1),(2); + INSERT INTO t1 (a,b) VALUES (3,3),(4,4); + --sorted_result + SELECT * FROM t1; + + DROP TABLE t1; +} + +--source cleanup_engine.inc + diff --git a/mysql-test/suite/sys_vars/r/slave_max_allowed_packet_basic.result b/mysql-test/suite/sys_vars/r/slave_max_allowed_packet_basic.result new file mode 100644 index 00000000000..a5fe9b35ed5 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/slave_max_allowed_packet_basic.result @@ -0,0 +1,147 @@ +SET @start_value = @@global.slave_max_allowed_packet; +SELECT @start_value; +@start_value +1073741824 +'#--------------------FN_DYNVARS_072_01------------------------#' +SET @@global.slave_max_allowed_packet = 5000; +Warnings: +Warning 1292 Truncated incorrect slave_max_allowed_packet value: '5000' +SET @@global.slave_max_allowed_packet = DEFAULT; +SELECT @@global.slave_max_allowed_packet; +@@global.slave_max_allowed_packet +1073741824 +'#---------------------FN_DYNVARS_072_02-------------------------#' +SET @@global.slave_max_allowed_packet = @start_value; +SELECT @@global.slave_max_allowed_packet = 1073741824; +@@global.slave_max_allowed_packet = 1073741824 +1 +'Bug# 34876: Incorrect Default Value is assigned to variable'; +'#--------------------FN_DYNVARS_072_03------------------------#' +SET @@global.slave_max_allowed_packet = 1024; +SELECT @@global.slave_max_allowed_packet; +@@global.slave_max_allowed_packet +1024 +SET @@global.slave_max_allowed_packet = 1073741824; +SELECT @@global.slave_max_allowed_packet; +@@global.slave_max_allowed_packet +1073741824 +SET @@global.slave_max_allowed_packet = 1073741824; +SELECT @@global.slave_max_allowed_packet; +@@global.slave_max_allowed_packet +1073741824 +SET @@global.slave_max_allowed_packet = 1025; +Warnings: +Warning 1292 Truncated incorrect slave_max_allowed_packet value: '1025' +SELECT @@global.slave_max_allowed_packet; +@@global.slave_max_allowed_packet +1024 +SET @@global.slave_max_allowed_packet = 65535; +Warnings: +Warning 1292 Truncated incorrect slave_max_allowed_packet value: '65535' +SELECT @@global.slave_max_allowed_packet; +@@global.slave_max_allowed_packet +64512 +'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; +'#--------------------FN_DYNVARS_072_04-------------------------#' +SET @@global.slave_max_allowed_packet = -1; +Warnings: +Warning 1292 Truncated incorrect slave_max_allowed_packet value: '-1' +SELECT @@global.slave_max_allowed_packet; +@@global.slave_max_allowed_packet +1024 +SET @@global.slave_max_allowed_packet = 100000000000; +Warnings: +Warning 1292 Truncated incorrect slave_max_allowed_packet value: '100000000000' +SELECT @@global.slave_max_allowed_packet; +@@global.slave_max_allowed_packet +1073741824 +SET @@global.slave_max_allowed_packet = 10000.01; +ERROR 42000: Incorrect argument type to variable 'slave_max_allowed_packet' +SELECT @@global.slave_max_allowed_packet; +@@global.slave_max_allowed_packet +1073741824 +SET @@global.slave_max_allowed_packet = -1024; +Warnings: +Warning 1292 Truncated incorrect slave_max_allowed_packet value: '-1024' +SELECT @@global.slave_max_allowed_packet; +@@global.slave_max_allowed_packet +1024 +SET @@global.slave_max_allowed_packet = 4294967296; +Warnings: +Warning 1292 Truncated incorrect slave_max_allowed_packet value: '4294967296' +SELECT @@global.slave_max_allowed_packet; +@@global.slave_max_allowed_packet +1073741824 +SET @@global.slave_max_allowed_packet = 1023; +Warnings: +Warning 1292 Truncated incorrect slave_max_allowed_packet value: '1023' +SELECT @@global.slave_max_allowed_packet; +@@global.slave_max_allowed_packet +1024 +'Bug # 34837: Errors are not coming on assigning invalid values to variable'; +SET @@global.slave_max_allowed_packet = ON; +ERROR 42000: Incorrect argument type to variable 'slave_max_allowed_packet' +SELECT @@global.slave_max_allowed_packet; +@@global.slave_max_allowed_packet +1024 +SET @@global.slave_max_allowed_packet = 'test'; +ERROR 42000: Incorrect argument type to variable 'slave_max_allowed_packet' +SELECT @@global.slave_max_allowed_packet; +@@global.slave_max_allowed_packet +1024 +'#-------------------FN_DYNVARS_072_05----------------------------#' +SET @@session.slave_max_allowed_packet = 4096; +ERROR HY000: Variable 'slave_max_allowed_packet' is a GLOBAL variable and should be set with SET GLOBAL +SELECT @@session.slave_max_allowed_packet; +ERROR HY000: Variable 'slave_max_allowed_packet' is a GLOBAL variable +'#----------------------FN_DYNVARS_072_06------------------------#' +SELECT @@global.slave_max_allowed_packet = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='slave_max_allowed_packet'; +@@global.slave_max_allowed_packet = VARIABLE_VALUE +1 +SELECT @@slave_max_allowed_packet = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='slave_max_allowed_packet'; +@@slave_max_allowed_packet = VARIABLE_VALUE +1 +'#---------------------FN_DYNVARS_072_07----------------------#' +SET @@global.slave_max_allowed_packet = TRUE; +Warnings: +Warning 1292 Truncated incorrect slave_max_allowed_packet value: '1' +SELECT @@global.slave_max_allowed_packet; +@@global.slave_max_allowed_packet +1024 +SET @@global.slave_max_allowed_packet = FALSE; +Warnings: +Warning 1292 Truncated incorrect slave_max_allowed_packet value: '0' +SELECT @@global.slave_max_allowed_packet; +@@global.slave_max_allowed_packet +1024 +'#---------------------FN_DYNVARS_072_08----------------------#' +SET @@global.slave_max_allowed_packet = 5000; +Warnings: +Warning 1292 Truncated incorrect slave_max_allowed_packet value: '5000' +SELECT @@slave_max_allowed_packet = @@global.slave_max_allowed_packet; +@@slave_max_allowed_packet = @@global.slave_max_allowed_packet +1 +'#---------------------FN_DYNVARS_072_09----------------------#' +SET slave_max_allowed_packet = 6000; +ERROR HY000: Variable 'slave_max_allowed_packet' is a GLOBAL variable and should be set with SET GLOBAL +SELECT @@slave_max_allowed_packet; +@@slave_max_allowed_packet +4096 +SET local.slave_max_allowed_packet = 7000; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'slave_max_allowed_packet = 7000' at line 1 +SELECT local.slave_max_allowed_packet; +ERROR 42S02: Unknown table 'local' in field list +SET global.slave_max_allowed_packet = 8000; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'slave_max_allowed_packet = 8000' at line 1 +SELECT global.slave_max_allowed_packet; +ERROR 42S02: Unknown table 'global' in field list +SELECT slave_max_allowed_packet = @@session.slave_max_allowed_packet; +ERROR 42S22: Unknown column 'slave_max_allowed_packet' in 'field list' +SET @@global.slave_max_allowed_packet = @start_value; +SELECT @@global.slave_max_allowed_packet; +@@global.slave_max_allowed_packet +1073741824 diff --git a/mysql-test/suite/sys_vars/t/slave_max_allowed_packet_basic.test b/mysql-test/suite/sys_vars/t/slave_max_allowed_packet_basic.test new file mode 100644 index 00000000000..4caaae84906 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/slave_max_allowed_packet_basic.test @@ -0,0 +1,177 @@ +############## mysql-test\t\slave_max_allowed_packet_basic.test ################## +# # +# Variable Name: slave_max_allowed_packet # +# Scope: GLOBAL # +# Access Type: Dynamic # +# Data Type: numeric # +# Default Value:1073741824 # +# Range: 1024 - 1073741824 # +# # +# # +# # +# Description: Test Cases of Dynamic System Variable slave_max_allowed_packet # +# that checks the behavior of this variable in the following ways# +# * Default Value # +# * Valid & Invalid values # +# * Scope & Access method # +# * Data Integrity # +# # +############################################################################### + +--source include/load_sysvars.inc + +######################################################################## +# START OF slave_max_allowed_packet TESTS # +######################################################################## + + +########################################################################### +# Saving initial value of slave_max_allowed_packet in a temporary variable# +########################################################################### + +SET @start_value = @@global.slave_max_allowed_packet; +SELECT @start_value; + + +--echo '#--------------------FN_DYNVARS_072_01------------------------#' +######################################################################## +# Display the DEFAULT value of slave_max_allowed_packet # +######################################################################## + +SET @@global.slave_max_allowed_packet = 5000; +SET @@global.slave_max_allowed_packet = DEFAULT; +SELECT @@global.slave_max_allowed_packet; + + +--echo '#---------------------FN_DYNVARS_072_02-------------------------#' +############################################### +# Verify default value of variable # +############################################### + +SET @@global.slave_max_allowed_packet = @start_value; +SELECT @@global.slave_max_allowed_packet = 1073741824; +--echo 'Bug# 34876: Incorrect Default Value is assigned to variable'; + +--echo '#--------------------FN_DYNVARS_072_03------------------------#' +######################################################################## +# Change the value of slave_max_allowed_packet to a valid value # +######################################################################## + +SET @@global.slave_max_allowed_packet = 1024; +SELECT @@global.slave_max_allowed_packet; +SET @@global.slave_max_allowed_packet = 1073741824; +SELECT @@global.slave_max_allowed_packet; +SET @@global.slave_max_allowed_packet = 1073741824; +SELECT @@global.slave_max_allowed_packet; +SET @@global.slave_max_allowed_packet = 1025; +SELECT @@global.slave_max_allowed_packet; +SET @@global.slave_max_allowed_packet = 65535; +SELECT @@global.slave_max_allowed_packet; +--echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; + + +--echo '#--------------------FN_DYNVARS_072_04-------------------------#' +########################################################################### +# Change the value of slave_max_allowed_packet to invalid value # +########################################################################### + +SET @@global.slave_max_allowed_packet = -1; +SELECT @@global.slave_max_allowed_packet; +SET @@global.slave_max_allowed_packet = 100000000000; +SELECT @@global.slave_max_allowed_packet; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.slave_max_allowed_packet = 10000.01; +SELECT @@global.slave_max_allowed_packet; +SET @@global.slave_max_allowed_packet = -1024; +SELECT @@global.slave_max_allowed_packet; +SET @@global.slave_max_allowed_packet = 4294967296; +SELECT @@global.slave_max_allowed_packet; +SET @@global.slave_max_allowed_packet = 1023; +SELECT @@global.slave_max_allowed_packet; + +--echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.slave_max_allowed_packet = ON; +SELECT @@global.slave_max_allowed_packet; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.slave_max_allowed_packet = 'test'; +SELECT @@global.slave_max_allowed_packet; + + +--echo '#-------------------FN_DYNVARS_072_05----------------------------#' +########################################################################### +# Test if accessing session slave_max_allowed_packet gives error # +########################################################################### + +--Error ER_GLOBAL_VARIABLE +SET @@session.slave_max_allowed_packet = 4096; +--Error ER_INCORRECT_GLOBAL_LOCAL_VAR +SELECT @@session.slave_max_allowed_packet; + + +--echo '#----------------------FN_DYNVARS_072_06------------------------#' +############################################################################## +# Check if the value in GLOBAL & SESSION Tables matches values in variable # +############################################################################## + +SELECT @@global.slave_max_allowed_packet = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='slave_max_allowed_packet'; + +SELECT @@slave_max_allowed_packet = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='slave_max_allowed_packet'; + + +--echo '#---------------------FN_DYNVARS_072_07----------------------#' +################################################################### +# Check if TRUE and FALSE values can be used on variable # +################################################################### + +SET @@global.slave_max_allowed_packet = TRUE; +SELECT @@global.slave_max_allowed_packet; +SET @@global.slave_max_allowed_packet = FALSE; +SELECT @@global.slave_max_allowed_packet; + + +--echo '#---------------------FN_DYNVARS_072_08----------------------#' +######################################################################################################## +# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable # +######################################################################################################## + +SET @@global.slave_max_allowed_packet = 5000; +SELECT @@slave_max_allowed_packet = @@global.slave_max_allowed_packet; + + +--echo '#---------------------FN_DYNVARS_072_09----------------------#' +################################################################################ +# Check if slave_max_allowed_packet can be accessed with and without @@ sign # +################################################################################ + +--Error ER_GLOBAL_VARIABLE +SET slave_max_allowed_packet = 6000; +SELECT @@slave_max_allowed_packet; +--Error ER_PARSE_ERROR +SET local.slave_max_allowed_packet = 7000; +--Error ER_UNKNOWN_TABLE +SELECT local.slave_max_allowed_packet; +--Error ER_PARSE_ERROR +SET global.slave_max_allowed_packet = 8000; +--Error ER_UNKNOWN_TABLE +SELECT global.slave_max_allowed_packet; +--Error ER_BAD_FIELD_ERROR +SELECT slave_max_allowed_packet = @@session.slave_max_allowed_packet; + + +############################## +# Restore initial value # +############################## + +SET @@global.slave_max_allowed_packet = @start_value; +SELECT @@global.slave_max_allowed_packet; + + +######################################################################## +# END OF slave_max_allowed_packet TESTS # +######################################################################## diff --git a/mysql-test/t/case.test b/mysql-test/t/case.test index 9d6cc7d375a..f536f556780 100644 --- a/mysql-test/t/case.test +++ b/mysql-test/t/case.test @@ -175,6 +175,16 @@ drop table t1, t2; --echo End of 5.0 tests # +# lp:1001510 +# Bug #11764313 57135: CRASH IN ITEM_FUNC_CASE::FIND_ITEM WITH CASE WHEN +# ELSE CLAUSE +# + +CREATE TABLE t1(a YEAR); +SELECT 1 FROM t1 WHERE a=1 AND CASE 1 WHEN a THEN 1 ELSE 1 END; +DROP TABLE t1; + +# # lp:839387 Assertion `(Item_result)i != TIME_RESULT' failed with CASE + datetime # @@ -182,3 +192,4 @@ create table t1 (f1 time); insert t1 values ('00:00:00'),('00:01:00'); select case t1.f1 when '00:00:00' then 1 end from t1; drop table t1; + diff --git a/mysql-test/t/compare.test b/mysql-test/t/compare.test index 103244eb2f7..d2b2a7e5523 100644 --- a/mysql-test/t/compare.test +++ b/mysql-test/t/compare.test @@ -86,3 +86,11 @@ SELECT * FROM t1 WHERE a > '2008-01-01' AND a = '0000-00-00'; DROP TABLE t1; --echo End of 5.0 tests + +# +# Bug #11764818 57692: Crash in item_func_in::val_int() with ZEROFILL +# + +CREATE TABLE t1(a INT ZEROFILL); +SELECT 1 FROM t1 WHERE t1.a IN (1, t1.a) AND t1.a=2; +DROP TABLE t1; diff --git a/mysql-test/t/create-big.test b/mysql-test/t/create-big.test index d487608f7e1..8d916f8da82 100644 --- a/mysql-test/t/create-big.test +++ b/mysql-test/t/create-big.test @@ -132,11 +132,20 @@ set debug_sync='create_table_select_before_create SIGNAL parked WAIT_FOR go'; --send create table t1 select 1 as i; connection addconroot1; set debug_sync='now WAIT_FOR parked'; ---error ER_TABLE_EXISTS_ERROR -alter table t3 rename to t1; +--send alter table t3 rename to t1 +connection addconroot2; +# Wait until the above ALTER TABLE RENAME is blocked due to CREATE +let $wait_condition= + select count(*) = 1 from information_schema.processlist + where state = "Waiting for table metadata lock" and + info = "alter table t3 rename to t1"; +--source include/wait_condition.inc set debug_sync='now SIGNAL go'; connection default; --reap +connection addconroot1; +--error ER_TABLE_EXISTS_ERROR +--reap connection default; show create table t1; drop table t1; @@ -146,11 +155,21 @@ set debug_sync='create_table_select_before_create SIGNAL parked WAIT_FOR go'; --send create table t1 select 1 as i; connection addconroot1; set debug_sync='now WAIT_FOR parked'; ---error ER_TABLE_EXISTS_ERROR -alter table t3 rename to t1, add k int; +--send alter table t3 rename to t1, add k int +connection addconroot2; +# Wait until the above ALTER TABLE RENAME is blocked due to CREATE +let $wait_condition= + select count(*) = 1 from information_schema.processlist + where state = "Waiting for table metadata lock" and + info = "alter table t3 rename to t1, add k int"; +--source include/wait_condition.inc set debug_sync='now SIGNAL go'; connection default; --reap +connection addconroot1; +--error ER_TABLE_EXISTS_ERROR +--reap +connection default; show create table t1; drop table t1,t3; diff --git a/mysql-test/t/ctype_utf32.test b/mysql-test/t/ctype_utf32.test index 5fc01e4467e..91221b4f7c7 100644 --- a/mysql-test/t/ctype_utf32.test +++ b/mysql-test/t/ctype_utf32.test @@ -854,6 +854,11 @@ SELECT 'a' AS id, REPEAT('bla bla', 100) AS body) t1 GROUP BY id ORDER BY l DESC; +--echo # +--echo # incorrect charset for val_str_ascii +--echo # + +SELECT '2010-10-10 10:10:10' + INTERVAL GeometryType(GeomFromText('POINT(1 1)')) hour_second; --echo # --echo # End of 5.5 tests diff --git a/mysql-test/t/func_group_innodb.test b/mysql-test/t/func_group_innodb.test index bfe91f1f587..6706792d162 100644 --- a/mysql-test/t/func_group_innodb.test +++ b/mysql-test/t/func_group_innodb.test @@ -84,20 +84,6 @@ select count(*), min(7), max(7) from t2m, t1i; drop table t1m, t1i, t2m, t2i; - ---echo # ---echo # Bug#13723054 CRASH WITH MIN/MAX AFTER QUICK_GROUP_MIN_MAX_SELECT::NEXT_MIN ---echo # - -CREATE TABLE t1(a BLOB, b VARCHAR(255) CHARSET LATIN1, c INT, - KEY(b, c, a(765))) ENGINE=INNODB; -INSERT INTO t1(a, b, c) VALUES ('', 'a', 0), ('', 'a', null), ('', 'a', 0); - -SELECT MIN(c) FROM t1 GROUP BY b; -EXPLAIN SELECT MIN(c) FROM t1 GROUP BY b; - -DROP TABLE t1; - --echo # --echo # Bug #57954: BIT_AND function returns incorrect results when --echo # semijoin=on @@ -173,4 +159,19 @@ SELECT member_id_to, COUNT(*) FROM t1 WHERE r_date = DROP TABLE t1; +--echo # End of test BUG#12713907 + +--echo # +--echo # Bug#13723054 CRASH WITH MIN/MAX AFTER QUICK_GROUP_MIN_MAX_SELECT::NEXT_MIN +--echo # + +CREATE TABLE t1(a BLOB, b VARCHAR(255) CHARSET LATIN1, c INT, + KEY(b, c, a(765))) ENGINE=INNODB; +INSERT INTO t1(a, b, c) VALUES ('', 'a', 0), ('', 'a', null), ('', 'a', 0); + +SELECT MIN(c) FROM t1 GROUP BY b; +EXPLAIN SELECT MIN(c) FROM t1 GROUP BY b; + +DROP TABLE t1; + --echo End of 5.5 tests diff --git a/mysql-test/t/index_merge_innodb.test b/mysql-test/t/index_merge_innodb.test index 0fd3c54c787..6a1cb53dc40 100644 --- a/mysql-test/t/index_merge_innodb.test +++ b/mysql-test/t/index_merge_innodb.test @@ -156,6 +156,21 @@ select * from t1 where t1.zone_id=830 AND modified=9; drop table t0, t1; +--echo # +--echo # MDEV-376: Wrong result (missing rows) with index_merge+index_merge_intersection, join +--echo # +CREATE TABLE t1 ( + a INT, b CHAR(1), c CHAR(1), KEY(a), KEY(b) +) ENGINE=InnoDB; + +INSERT INTO t1 VALUES (8,'v','v'),(8,'m','m'),(9,'d','d'); + + +SELECT ta.* FROM t1 AS ta, t1 AS tb +WHERE ( tb.b != ta.b OR tb.a = ta.a ) + AND ( tb.b = ta.c OR tb.b = ta.b ); + +DROP TABLE t1; set optimizer_switch= @optimizer_switch_save; diff --git a/mysql-test/t/mdev375.test b/mysql-test/t/mdev375.test new file mode 100644 index 00000000000..547d57aa587 --- /dev/null +++ b/mysql-test/t/mdev375.test @@ -0,0 +1,20 @@ +# +# MDEV-375 Server crashes in THD::print_aborted_warning with log_warnings > 3 +# +SET GLOBAL log_warnings=4; +SET GLOBAL max_connections=2; + +--connect (con1,localhost,root,,) +SELECT 1; +--connect (con2,localhost,root,,) +SELECT 2; +--disable_query_log +--error ER_CON_COUNT_ERROR +--connect (con3,localhost,root,,) +--enable_query_log + +--connection default +SELECT 0; + +SET GLOBAL log_warnings=default; +SET GLOBAL max_connections=default; diff --git a/mysql-test/t/mysql_plugin.test b/mysql-test/t/mysql_plugin.test index 71617b86330..a05b5a624d9 100644 --- a/mysql-test/t/mysql_plugin.test +++ b/mysql-test/t/mysql_plugin.test @@ -372,11 +372,11 @@ let $MYSQL_PLUGIN_CMD= $MYSQL_PLUGIN -n --datadir=$MYSQL_DATADIR --basedir=$MYSQ --echo # Show the help. --echo # replace_result $MYSQL_PLUGIN mysql_plugin; ---replace_regex /Ver [0-9.]+ Distrib [0-9.]+/Ver V.V.VV Distrib XX.XX.XX/ /XX-m[0-9]+/XX/ +--replace_regex /Ver [0-9.]+ Distrib [0-9.]+/Ver V.V.VV Distrib XX.XX.XX/ /XX-m[0-9]+/XX/ /XX[a-z]/XX/ --exec $MYSQL_PLUGIN --help replace_result $MYSQL_PLUGIN mysql_plugin; ---replace_regex /Ver [0-9.]+ Distrib [0-9.]+/Ver V.V.VV Distrib XX.XX.XX/ /XX-m[0-9]+/XX/ +--replace_regex /Ver [0-9.]+ Distrib [0-9.]+/Ver V.V.VV Distrib XX.XX.XX/ /XX-m[0-9]+/XX/ /XX[a-z]/XX/ --exec $MYSQL_PLUGIN --version # diff --git a/mysql-test/t/mysqltest.test b/mysql-test/t/mysqltest.test index a7585bea4f8..ffbec36873e 100644 --- a/mysql-test/t/mysqltest.test +++ b/mysql-test/t/mysqltest.test @@ -2120,6 +2120,11 @@ insert into t1 values ("Abcd"); --error $errno1,ER_PARSE_ERROR garbage; +let $errno_multi = $errno1,ER_NO_SUCH_TABLE,$errno2,1062; + +--error $errno_multi +SELECT * FROM non_existing_table; + drop table t2; diff --git a/mysql-test/t/order_by.test b/mysql-test/t/order_by.test index a6f50107cbe..2912e190af8 100644 --- a/mysql-test/t/order_by.test +++ b/mysql-test/t/order_by.test @@ -1613,3 +1613,42 @@ SELECT t2.b FROM t1, t2 WHERE t1.b = t2.a GROUP BY t2.b ORDER BY t1.b; drop table t1,t2; --echo End of 5.2 tests + +--echo # +--echo # Bug mdev-449: ORDER BY with small sort_buffer_size +--echo # + +CREATE TABLE t1(f0 int auto_increment primary key, f1 int, f2 varchar(200)); +INSERT INTO t1(f1, f2) VALUES +(0,"0"),(1,"1"),(2,"2"),(3,"3"),(4,"4"),(5,"5"), +(6,"6"),(7,"7"),(8,"8"),(9,"9"),(10,"10"), +(11,"11"),(12,"12"),(13,"13"),(14,"14"),(15,"15"), +(16,"16"),(17,"17"),(18,"18"),(19,"19"),(20,"20"), +(21,"21"),(22,"22"),(23,"23"),(24,"24"),(25,"25"), +(26,"26"),(27,"27"),(28,"28"),(29,"29"),(30,"30"), +(31,"31"),(32,"32"),(33,"33"),(34,"34"),(35,"35"), +(36,"36"),(37,"37"),(38,"38"),(39,"39"),(40,"40"), +(41,"41"),(42,"42"),(43,"43"),(44,"44"),(45,"45"), +(46,"46"),(47,"47"),(48,"48"),(49,"49"),(50,"50"), +(51,"51"),(52,"52"),(53,"53"),(54,"54"),(55,"55"), +(56,"56"),(57,"57"),(58,"58"),(59,"59"),(60,"60"), +(61,"61"),(62,"62"),(63,"63"),(64,"64"),(65,"65"), +(66,"66"),(67,"67"),(68,"68"),(69,"69"),(70,"70"), +(71,"71"),(72,"72"),(73,"73"),(74,"74"),(75,"75"), +(76,"76"),(77,"77"),(78,"78"),(79,"79"),(80,"80"), +(81,"81"),(82,"82"),(83,"83"),(84,"84"),(85,"85"), +(86,"86"),(87,"87"),(88,"88"),(89,"89"),(90,"90"), +(91,"91"),(92,"92"),(93,"93"),(94,"94"),(95,"95"), +(96,"96"),(97,"97"),(98,"98"),(99,"99"); + +set @save_sort_buffer_size= @@sort_buffer_size; +set sort_buffer_size= 2000; + +SELECT * FROM t1 ORDER BY f1 DESC, f0; + +set sort_buffer_size= @save_sort_buffer_size; + +DROP TABLE t1; + +--echo End of 5.3 tests + diff --git a/mysql-test/t/partition.test b/mysql-test/t/partition.test index 08c028c8224..ef0d3df6661 100644 --- a/mysql-test/t/partition.test +++ b/mysql-test/t/partition.test @@ -2476,3 +2476,13 @@ SELECT 1 FROM t1 AS t1_0 JOIN t1 ON t1_0.a LIKE (SELECT 1 FROM t1); SELECT * FROM vtmp; DROP VIEW vtmp; DROP TABLE t1; + +--echo # +--echo # MDEV-365 "Got assertion when doing alter table on a partition" +--echo # + +CREATE TABLE t1 ( i INT ) ENGINE=Aria PARTITION BY HASH(i) PARTITIONS 2; +INSERT INTO t1 VALUES (1),(2),(2),(3),(4); +ALTER TABLE t1 ADD PARTITION PARTITIONS 2; +SELECT * from t1 order by i; +DROP TABLE t1; diff --git a/mysql-test/t/partition_cache_innodb.test b/mysql-test/t/partition_cache_innodb.test new file mode 100644 index 00000000000..dbcfea3088c --- /dev/null +++ b/mysql-test/t/partition_cache_innodb.test @@ -0,0 +1,14 @@ +# t/cache_innodb.test +# +# Last update: +# 2006-07-26 ML test refactored (MySQL 5.1) +# main code t/innodb_cache.test --> include/query_cache.inc +# new wrapper t/cache_innodb.test +# + +--source include/have_query_cache.inc +--source include/have_innodb.inc +--source include/have_partition.inc +let $engine_type= innodb; + +--source include/query_cache_partitions.inc diff --git a/mysql-test/t/partition_cache_myisam.test b/mysql-test/t/partition_cache_myisam.test new file mode 100644 index 00000000000..5347225f6da --- /dev/null +++ b/mysql-test/t/partition_cache_myisam.test @@ -0,0 +1,14 @@ +# t/cache_innodb.test +# +# Last update: +# 2006-07-26 ML test refactored (MySQL 5.1) +# main code t/innodb_cache.test --> include/query_cache.inc +# new wrapper t/cache_innodb.test +# + +--source include/have_query_cache.inc + +--source include/have_partition.inc +let $engine_type= myisam; + +--source include/query_cache_partitions.inc diff --git a/mysql-test/t/ps.test b/mysql-test/t/ps.test index d955b46469c..ff28631862c 100644 --- a/mysql-test/t/ps.test +++ b/mysql-test/t/ps.test @@ -3125,7 +3125,7 @@ DROP TABLE t1; --echo End of 5.1 tests. --echo # ---echo # LP bug#1001500 Crash on the second execution of the PS for +--echo # lp:1001500 Crash on the second execution of the PS for --echo # a query with degenerated conjunctive condition --echo # (see also mysql bug#12582849) --echo # @@ -3572,94 +3572,4 @@ show status like '%Handler_read%'; deallocate prepare st; drop table t1; ---echo # ---echo # LP bug#993459 Execution of PS for a query with GROUP BY ---echo # returns wrong result (see also mysql bug#13805127) ---echo # - -PREPARE s1 FROM -" -SELECT c1, t2.c2, count(c3) -FROM - ( - SELECT 3 as c2 FROM dual WHERE @x = 1 - UNION - SELECT 2 FROM dual WHERE @x = 1 OR @x = 2 - ) AS t1, - ( - SELECT '2012-03-01 01:00:00' AS c1, 3 as c2, 1 as c3 FROM dual - UNION - SELECT '2012-03-01 02:00:00', 3, 2 FROM dual - UNION - SELECT '2012-03-01 01:00:00', 2, 1 FROM dual - ) AS t2 -WHERE t2.c2 = t1.c2 -GROUP BY c1, c2 -"; - ---echo -SET @x = 1; -SELECT c1, t2.c2, count(c3) -FROM - ( - SELECT 3 as c2 FROM dual WHERE @x = 1 - UNION - SELECT 2 FROM dual WHERE @x = 1 OR @x = 2 - ) AS t1, - ( - SELECT '2012-03-01 01:00:00' AS c1, 3 as c2, 1 as c3 FROM dual - UNION - SELECT '2012-03-01 02:00:00', 3, 2 FROM dual - UNION - SELECT '2012-03-01 01:99345900:00', 2, 1 FROM dual - ) AS t2 -WHERE t2.c2 = t1.c2 -GROUP BY c1, c2; ---echo -EXECUTE s1; - ---echo -SET @x = 2; -SELECT c1, t2.c2, count(c3) -FROM - ( - SELECT 3 as c2 FROM dual WHERE @x = 1 - UNION - SELECT 2 FROM dual WHERE @x = 1 OR @x = 2 - ) AS t1, - ( - SELECT '2012-03-01 01:00:00' AS c1, 3 as c2, 1 as c3 FROM dual - UNION - SELECT '2012-03-01 02:00:00', 3, 2 FROM dual - UNION - SELECT '2012-03-01 01:00:00', 2, 1 FROM dual - ) AS t2 -WHERE t2.c2 = t1.c2 -GROUP BY c1, c2; ---echo -EXECUTE s1; - ---echo -SET @x = 1; -SELECT c1, t2.c2, count(c3) -FROM - ( - SELECT 3 as c2 FROM dual WHERE @x = 1 - UNION - SELECT 2 FROM dual WHERE @x = 1 OR @x = 2 - ) AS t1, - ( - SELECT '2012-03-01 01:00:00' AS c1, 3 as c2, 1 as c3 FROM dual - UNION - SELECT '2012-03-01 02:00:00', 3, 2 FROM dual - UNION - SELECT '2012-03-01 01:00:00', 2, 1 FROM dual - ) AS t2 -WHERE t2.c2 = t1.c2 -GROUP BY c1, c2; ---echo -EXECUTE s1; - -DEALLOCATE PREPARE s1; - --echo # End of 5.3 tests diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test index 148ee6172b2..7fc8dad3bb9 100644 --- a/mysql-test/t/sp.test +++ b/mysql-test/t/sp.test @@ -9111,9 +9111,14 @@ DROP FUNCTION f1; --echo # ------------------------------------------------------------------ --echo # ---echo # LP bug#993459 Execution of PS for a query with GROUP BY +--echo # lp:993459 Execution of PS for a query with GROUP BY --echo # returns wrong result (see also mysql bug#13805127) --echo # + +--echo +--echo # Bug#13805127: Stored program cache produces wrong result in same THD +--echo + delimiter |; CREATE PROCEDURE p1(x INT UNSIGNED) @@ -9147,7 +9152,7 @@ CALL p1(1); DROP PROCEDURE p1; --echo # ---echo # LP bug#1002157 : testing stored function +--echo # lp:1002157 : testing stored function --echo # bug#62125 result for null incorrectly yields 1292 warning. --echo # diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test index 85dc68f5d99..9f35ecc43f1 100644 --- a/mysql-test/t/subselect.test +++ b/mysql-test/t/subselect.test @@ -5576,7 +5576,28 @@ SELECT MIN(a) AS min_a, a FROM t1 WHERE 1=2 HAVING a NOT IN ( SELECT a from t1 U drop table t1; --echo # ---echo # LP BUG#944706 Query with impossible or constant subquery in WHERE or HAVING is not +--echo # MDEV-367: Different results with and without subquery_cache on +--echo # a query with a constant NOT IN condition +--echo # +CREATE TABLE t1 (a INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1),(2),(3); + +set @mdev367_optimizer_switch = @@optimizer_switch; + +set optimizer_switch = 'subquery_cache=on'; +SELECT * FROM t1 WHERE ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) OR a > 100; +SELECT *, ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) FROM t1; +set optimizer_switch=@mdev367_optimizer_switch; + +set optimizer_switch = 'subquery_cache=off'; +SELECT * FROM t1 WHERE ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) OR a > 100; +SELECT *, ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) FROM t1; +set optimizer_switch=@mdev367_optimizer_switch; + +DROP TABLE t1; + +--echo # +--echo # lp:944706 Query with impossible or constant subquery in WHERE or HAVING is not --echo # precomputed and thus not part of optimization --echo # @@ -5686,5 +5707,65 @@ SELECT * FROM t1 WHERE 4 IN (SELECT MAX(b) FROM t2 WHERE EXISTS (SELECT * FROM t drop table t1,t2; ---echo # return optimizer switch changed in the beginning of this test -set optimizer_switch=@subselect_tmp; +--echo # +--echo # MDEV-410: EXPLAIN shows type=range, while SHOW EXPLAIN and userstat show full table scan is used +--echo # +CREATE TABLE t1 (a VARCHAR(3) PRIMARY KEY) ENGINE=MyISAM; +INSERT INTO t1 VALUES ('USA'); + +CREATE TABLE t2 (b INT, c VARCHAR(52), KEY(b)) ENGINE=MyISAM; +INSERT INTO t2 VALUES (3813,'United States'),(3940,'Russia'); + +CREATE TABLE t3 (d INT, KEY(d)) ENGINE=MyISAM; +INSERT INTO t3 VALUES (12),(22),(9),(45); + +create table t4 like t3; +insert into t4 select * from t3; + +--echo # This should not show range access for table t2 +explain +SELECT MIN(b) FROM ( SELECT * FROM t1, t2, t3 WHERE d = b ) AS alias1 +WHERE SLEEP(0.1) OR c < 'p' OR b = ( SELECT MIN(b) FROM t2 ); + +set @tmp_mdev410=@@global.userstat; +set global userstat=on; +flush table_statistics; +flush index_statistics; + +SELECT MIN(b) FROM ( SELECT * FROM t1, t2, t3 WHERE d = b ) AS alias1 +WHERE SLEEP(0.1) OR c < 'p' OR b = ( SELECT MIN(b) FROM t2 ); + +--echo # The following shows that t2 was indeed scanned with a full scan. +show table_statistics; +show index_statistics; +set global userstat=@tmp_mdev410; + +DROP TABLE t1,t2,t3,t4; + +--echo # +--echo # MDEV-430: Server crashes in select_describe on EXPLAIN with +--echo # materialization+semijoin, 2 nested subqueries, aggregate functions +--echo # +CREATE TABLE t1 (a INT, KEY(a)); +INSERT INTO t1 VALUES (1),(8); + +CREATE TABLE t2 (b INT, KEY(b)); +INSERT INTO t2 VALUES (45),(17),(20); + +EXPLAIN SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t1, t2 WHERE b = a GROUP BY a HAVING a <> 1 ) ; + +DROP TABLE t1,t2; + +--echo # +--echo # MDEV-405: Server crashes in test_if_skip_sort_order on EXPLAIN with GROUP BY and HAVING in EXISTS subquery +--echo # +CREATE TABLE t1 (a INT, KEY(a)); +INSERT INTO t1 VALUES (1),(8); + +CREATE TABLE t2 (b INT, KEY(b)); +INSERT INTO t2 VALUES (45),(17),(20); + +EXPLAIN SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t1, t2 WHERE b = a GROUP BY a HAVING a <> 1 ) ; + +DROP TABLE t1,t2; + diff --git a/mysql-test/t/type_year.test b/mysql-test/t/type_year.test index 0a0c73da39b..685587fe3c5 100644 --- a/mysql-test/t/type_year.test +++ b/mysql-test/t/type_year.test @@ -161,6 +161,14 @@ SELECT COUNT(*) AS total_rows, MIN(c1+0) AS min_value, MAX(c1+0) FROM t1; DROP TABLE t1; --echo # +--echo # WL#6219: Deprecate and remove YEAR(2) type +--echo # + +CREATE TABLE t1 (c1 YEAR(2), c2 YEAR(4)); +ALTER TABLE t1 MODIFY COLUMN c2 YEAR(2); +DROP TABLE t1; + +--echo # --echo End of 5.1 tests # diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test index 0585073a6f5..17026e45724 100644 --- a/mysql-test/t/view.test +++ b/mysql-test/t/view.test @@ -4613,6 +4613,19 @@ DROP TRIGGER tr; DROP VIEW v1; DROP TABLE t1,t2,t3; +--echo # +--echo # LP bug#1007622 Server crashes in handler::increment_statistics on +--echo # inserting into a view over a view +--echo # + +CREATE TABLE t1 (a INT); +CREATE ALGORITHM=MERGE VIEW v1 AS SELECT a1.* FROM t1 AS a1, t1 AS a2; +CREATE ALGORITHM=MERGE VIEW v2 AS SELECT * FROM v1; +INSERT INTO v2 (a) VALUES (1) ; +select * from t1; +drop view v2,v1; +drop table t1; + --echo # ----------------------------------------------------------------- --echo # -- End of 5.3 tests. --echo # ----------------------------------------------------------------- diff --git a/mysys/charset-def.c b/mysys/charset-def.c index 4183b1fcd99..e9f2ecdea49 100644 --- a/mysys/charset-def.c +++ b/mysys/charset-def.c @@ -326,7 +326,7 @@ my_bool init_compiled_charsets(myf flags __attribute__((unused))) add_compiled_collation(&my_charset_utf16_hungarian_uca_ci); add_compiled_collation(&my_charset_utf16_sinhala_uca_ci); add_compiled_collation(&my_charset_utf16_croatian_uca_ci); -#endif /* HAVE_UCA_COLLATIOINS */ +#endif /* HAVE_UCA_COLLATIONS */ #endif /* HAVE_CHARSET_utf16 */ diff --git a/mysys/mf_iocache2.c b/mysys/mf_iocache2.c index 3c23d0737e7..72372ae6bc0 100644 --- a/mysys/mf_iocache2.c +++ b/mysys/mf_iocache2.c @@ -287,6 +287,40 @@ my_off_t my_b_filelength(IO_CACHE *info) } +size_t +my_b_write_backtick_quote(IO_CACHE *info, const char *str, size_t len) +{ + const uchar *start; + const uchar *p= (const uchar *)str; + const uchar *end= p + len; + size_t count; + size_t total= 0; + + if (my_b_write(info, (uchar *)"`", 1)) + return (size_t)-1; + ++total; + for (;;) + { + start= p; + while (p < end && *p != '`') + ++p; + count= p - start; + if (count && my_b_write(info, start, count)) + return (size_t)-1; + total+= count; + if (p >= end) + break; + if (my_b_write(info, (uchar *)"``", 2)) + return (size_t)-1; + total+= 2; + ++p; + } + if (my_b_write(info, (uchar *)"`", 1)) + return (size_t)-1; + ++total; + return total; +} + /* Simple printf version. Supports '%s', '%d', '%u', "%ld" and "%lu" Used for logging in MySQL @@ -311,6 +345,7 @@ size_t my_b_vprintf(IO_CACHE *info, const char* fmt, va_list args) uint minimum_width_sign; uint precision; /* as yet unimplemented for anything but %b */ my_bool is_zero_padded; + my_bool backtick_quoting; /* Store the location of the beginning of a format directive, for the @@ -345,6 +380,7 @@ size_t my_b_vprintf(IO_CACHE *info, const char* fmt, va_list args) fmt++; is_zero_padded= FALSE; + backtick_quoting= FALSE; minimum_width_sign= 1; minimum_width= 0; precision= 0; @@ -357,6 +393,8 @@ process_flags: minimum_width_sign= -1; fmt++; goto process_flags; case '0': is_zero_padded= TRUE; fmt++; goto process_flags; + case '`': + backtick_quoting= TRUE; fmt++; goto process_flags; case '#': /** @todo Implement "#" conversion flag. */ fmt++; goto process_flags; case ' ': @@ -400,9 +438,19 @@ process_flags: reg2 char *par = va_arg(args, char *); size_t length2 = strlen(par); /* TODO: implement precision */ - out_length+= length2; - if (my_b_write(info, (uchar*) par, length2)) - goto err; + if (backtick_quoting) + { + size_t total= my_b_write_backtick_quote(info, (uchar *) par, length2); + if (total == (size_t)-1) + goto err; + out_length+= total; + } + else + { + out_length+= length2; + if (my_b_write(info, (uchar*) par, length2)) + goto err; + } } else if (*fmt == 'b') /* Sized buffer parameter, only precision makes sense */ { @@ -433,7 +481,11 @@ process_flags: memset(buffz, '0', minimum_width - length2); else memset(buffz, ' ', minimum_width - length2); - my_b_write(info, buffz, minimum_width - length2); + if (my_b_write(info, buffz, minimum_width - length2)) + { + my_afree(buffz); + goto err; + } my_afree(buffz); } diff --git a/mysys/my_chsize.c b/mysys/my_chsize.c index 97ecd881af1..63964916d6f 100644 --- a/mysys/my_chsize.c +++ b/mysys/my_chsize.c @@ -67,13 +67,6 @@ int my_chsize(File fd, my_off_t newlength, int filler, myf MyFlags) goto err; } DBUG_RETURN(0); -#elif defined(HAVE_CHSIZE) - if (chsize(fd, (off_t) newlength)) - { - my_errno=errno; - goto err; - } - DBUG_RETURN(0); #else /* Fill space between requested length and true length with 'filler' diff --git a/mysys/my_lock.c b/mysys/my_lock.c index c9e599904fa..54ec3838b58 100644 --- a/mysys/my_lock.c +++ b/mysys/my_lock.c @@ -212,7 +212,7 @@ int my_lock(File fd, int locktype, my_off_t start, my_off_t length, if (lockf(fd,locktype,length) != -1) DBUG_RETURN(0); #endif /* HAVE_FCNTL */ -#endif /* HAVE_LOCKING */ +#endif /* _WIN32 */ /* We got an error. We don't want EACCES errors */ my_errno=(errno == EACCES) ? EAGAIN : errno ? errno : -1; diff --git a/mysys/my_pthread.c b/mysys/my_pthread.c index d29cbcc5048..20e53a23ab5 100644 --- a/mysys/my_pthread.c +++ b/mysys/my_pthread.c @@ -30,20 +30,6 @@ uint thd_lib_detected= 0; -/* To allow use of pthread_getspecific with two arguments */ - -#ifdef HAVE_NONPOSIX_PTHREAD_GETSPECIFIC -#undef pthread_getspecific - -void *my_pthread_getspecific_imp(pthread_key_t key) -{ - void *value; - if (pthread_getspecific(key,(void *) &value)) - return 0; - return value; -} -#endif - /* Some functions for RTS threads, AIX, Siemens Unix and UnixWare 7 (and DEC OSF/1 3.2 too) @@ -51,18 +37,6 @@ void *my_pthread_getspecific_imp(pthread_key_t key) int my_pthread_create_detached=1; -#if defined(HAVE_NONPOSIX_SIGWAIT) || defined(HAVE_DEC_3_2_THREADS) - -int my_sigwait(const sigset_t *set,int *sig) -{ - int signal=sigwait((sigset_t*) set); - if (signal < 0) - return errno; - *sig=signal; - return 0; -} -#endif - /* localtime_r for SCO 3.2V4.2 */ #if !defined(HAVE_LOCALTIME_R) || !defined(HAVE_GMTIME_R) @@ -117,7 +91,7 @@ struct tm *gmtime_r(const time_t *clock, struct tm *res) ** Author: Gary Wisniewski <garyw@spidereye.com.au>, much modified by Monty ****************************************************************************/ -#if !defined(HAVE_SIGWAIT) && !defined(sigwait) && !defined(__WIN__) && !defined(HAVE_rts_threads) && !defined(HAVE_NONPOSIX_SIGWAIT) && !defined(HAVE_DEC_3_2_THREADS) +#if !defined(HAVE_SIGWAIT) && !defined(sigwait) && !defined(__WIN__) && !defined(HAVE_rts_threads) #if !defined(DONT_USE_SIGSUSPEND) @@ -269,13 +243,7 @@ void *sigwait_thread(void *set_arg) for (;;) { /* Wait for signals */ -#ifdef HAVE_NOT_BROKEN_SELECT - fd_set fd; - FD_ZERO(&fd); - select(0,&fd,0,0,0); -#else sleep(1); /* Because of broken BSDI */ -#endif } } @@ -352,39 +320,6 @@ int sigwait(sigset_t *setp, int *sigp) #undef pthread_attr_getstacksize /***************************************************************************** -** Patches for AIX and DEC OSF/1 3.2 -*****************************************************************************/ - -#if defined(HAVE_NONPOSIX_PTHREAD_MUTEX_INIT) - -#include <netdb.h> - -int my_pthread_mutex_noposix_init(pthread_mutex_t *mp, - const pthread_mutexattr_t *attr) -{ - int error; - if (!attr) - error=pthread_mutex_init(mp,pthread_mutexattr_default); - else - error=pthread_mutex_init(mp,*attr); - return error; -} - -int my_pthread_cond_noposix_init(pthread_cond_t *mp, - const pthread_condattr_t *attr) -{ - int error; - if (!attr) - error=pthread_cond_init(mp,pthread_condattr_default); - else - error=pthread_cond_init(mp,*attr); - return error; -} - -#endif - - -/***************************************************************************** Patches for HPUX We need these because the pthread_mutex.. code returns -1 on error, instead of the error code. @@ -394,7 +329,7 @@ int my_pthread_cond_noposix_init(pthread_cond_t *mp, this has to be added here. ****************************************************************************/ -#if defined(HPUX10) || defined(HAVE_BROKEN_PTHREAD_COND_TIMEDWAIT) +#if defined(HPUX10) int my_pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex, struct timespec *abstime) diff --git a/mysys/my_rename.c b/mysys/my_rename.c index 6704d7c87d0..b89bc4c8fbd 100644 --- a/mysys/my_rename.c +++ b/mysys/my_rename.c @@ -27,22 +27,6 @@ int my_rename(const char *from, const char *to, myf MyFlags) DBUG_ENTER("my_rename"); DBUG_PRINT("my",("from %s to %s MyFlags %d", from, to, MyFlags)); -#if defined(HAVE_FILE_VERSIONS) - { /* Check that there isn't a old file */ - int save_errno; - MY_STAT my_stat_result; - save_errno=my_errno; - if (my_stat(to,&my_stat_result,MYF(0))) - { - my_errno=EEXIST; - error= -1; - if (MyFlags & MY_FAE+MY_WME) - my_error(EE_LINK, MYF(ME_BELL+ME_WAITTANG),from,to,my_errno); - DBUG_RETURN(error); - } - my_errno=save_errno; - } -#endif #if defined(HAVE_RENAME) #if defined(__WIN__) /* diff --git a/mysys/my_write.c b/mysys/my_write.c index dc04b60f613..c4cba7a927d 100644 --- a/mysys/my_write.c +++ b/mysys/my_write.c @@ -47,6 +47,11 @@ size_t my_write(File Filedes, const uchar *Buffer, size_t Count, myf MyFlags) #else writtenbytes= write(Filedes, Buffer, Count); #endif + DBUG_EXECUTE_IF("simulate_file_write_error", + { + errno= ENOSPC; + writtenbytes= (size_t) -1; + }); if (writtenbytes == Count) break; if (writtenbytes != (size_t) -1) diff --git a/mysys/thr_mutex.c b/mysys/thr_mutex.c index 45f4220c835..17cda782b30 100644 --- a/mysys/thr_mutex.c +++ b/mysys/thr_mutex.c @@ -43,9 +43,6 @@ #undef pthread_cond_wait #undef pthread_cond_timedwait #undef safe_mutex_free_deadlock_data -#ifdef HAVE_NONPOSIX_PTHREAD_MUTEX_INIT -#define pthread_mutex_init(a,b) my_pthread_noposix_mutex_init((a),(b)) -#endif #endif /* DO_NOT_REMOVE_THREAD_WRAPPERS */ #ifdef PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP diff --git a/mysys/waiting_threads.c b/mysys/waiting_threads.c index f7e74e012d2..0a9474e68b4 100644 --- a/mysys/waiting_threads.c +++ b/mysys/waiting_threads.c @@ -193,7 +193,9 @@ uint32 wt_success_stats; static my_atomic_rwlock_t cycle_stats_lock, wait_stats_lock, success_stats_lock; +#ifdef HAVE_PSI_INTERFACE extern PSI_cond_key key_WT_RESOURCE_cond; +#endif #ifdef SAFE_STATISTICS #define incr(VAR, LOCK) \ diff --git a/plugin/auth_pam/auth_pam.c b/plugin/auth_pam/auth_pam.c index d8211294910..4f549142e72 100644 --- a/plugin/auth_pam/auth_pam.c +++ b/plugin/auth_pam/auth_pam.c @@ -107,7 +107,7 @@ static int conv(int n, const struct pam_message **msg, #define DO(X) if ((status = (X)) != PAM_SUCCESS) goto end -#ifdef SOLARIS +#if defined(SOLARIS) || defined(__sun) typedef void** pam_get_item_3_arg; #else typedef const void** pam_get_item_3_arg; diff --git a/plugin/semisync/semisync.cc b/plugin/semisync/semisync.cc index 83c7791c14b..022773eed0a 100644 --- a/plugin/semisync/semisync.cc +++ b/plugin/semisync/semisync.cc @@ -26,5 +26,5 @@ const unsigned long Trace::kTraceDetail = 0x0010; const unsigned long Trace::kTraceNetWait = 0x0020; const unsigned long Trace::kTraceFunction = 0x0040; -const char ReplSemiSyncBase::kSyncHeader[2] = +const unsigned char ReplSemiSyncBase::kSyncHeader[2] = {ReplSemiSyncBase::kPacketMagicNum, 0}; diff --git a/plugin/semisync/semisync.h b/plugin/semisync/semisync.h index 57353f3c156..900ce5d8bf9 100644 --- a/plugin/semisync/semisync.h +++ b/plugin/semisync/semisync.h @@ -71,7 +71,7 @@ public: class ReplSemiSyncBase :public Trace { public: - static const char kSyncHeader[2]; /* three byte packet header */ + static const unsigned char kSyncHeader[2]; /* three byte packet header */ /* Constants in network packet header. */ static const unsigned char kPacketMagicNum; diff --git a/plugin/semisync/semisync_master.cc b/plugin/semisync/semisync_master.cc index 3fef4b67aac..f8eb962b857 100644 --- a/plugin/semisync/semisync_master.cc +++ b/plugin/semisync/semisync_master.cc @@ -1049,11 +1049,12 @@ int ReplSemiSyncMaster::readSlaveReply(NET *net, uint32 server_id, ulong log_file_len = 0; ulong packet_len; int result = -1; - struct timespec start_ts; ulong trc_level = trace_level_; LINT_INIT_STRUCT(start_ts); + LINT_INIT_STRUCT(start_ts); + function_enter(kWho); assert((unsigned char)event_buf[1] == kPacketMagicNum); diff --git a/plugin/semisync/semisync_master_plugin.cc b/plugin/semisync/semisync_master_plugin.cc index 9a325018242..b6ff23cd1ad 100644 --- a/plugin/semisync/semisync_master_plugin.cc +++ b/plugin/semisync/semisync_master_plugin.cc @@ -180,7 +180,7 @@ static MYSQL_SYSVAR_ULONG(timeout, rpl_semi_sync_master_timeout, "The timeout value (in ms) for semi-synchronous replication in the master", NULL, // check fix_rpl_semi_sync_master_timeout, // update - 10000, 0, ~0L, 1); + 10000, 0, ~0UL, 1); static MYSQL_SYSVAR_BOOL(wait_no_slave, rpl_semi_sync_master_wait_no_slave, PLUGIN_VAR_OPCMDARG, @@ -194,7 +194,7 @@ static MYSQL_SYSVAR_ULONG(trace_level, rpl_semi_sync_master_trace_level, "The tracing level for semi-sync replication.", NULL, // check &fix_rpl_semi_sync_master_trace_level, // update - 32, 0, ~0L, 1); + 32, 0, ~0UL, 1); static SYS_VAR* semi_sync_master_system_vars[]= { MYSQL_SYSVAR(enabled), diff --git a/plugin/semisync/semisync_slave_plugin.cc b/plugin/semisync/semisync_slave_plugin.cc index d5472b9cc83..5d373fa0862 100644 --- a/plugin/semisync/semisync_slave_plugin.cc +++ b/plugin/semisync/semisync_slave_plugin.cc @@ -161,7 +161,7 @@ static MYSQL_SYSVAR_ULONG(trace_level, rpl_semi_sync_slave_trace_level, "The tracing level for semi-sync replication.", NULL, // check &fix_rpl_semi_sync_trace_level, // update - 32, 0, ~0L, 1); + 32, 0, ~0UL, 1); static SYS_VAR* semi_sync_slave_system_vars[]= { MYSQL_SYSVAR(enabled), diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index a0a2e446609..91a47bf3d48 100644 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -283,6 +283,7 @@ SET(mysql_config_COMPONENT COMPONENT Development) SET(msql2mysql_COMPONENT COMPONENT Client) SET(mysqlaccess_COMPONENT COMPONENT Client) SET(mysql_find_rows_COMPONENT COMPONENT Client) +SET(mytop_COMPONENT Client) IF(WIN32) # On Windows, some .sh and some .pl.in files are configured @@ -311,7 +312,6 @@ IF(WIN32) ENDFOREACH() ELSE() # On Unix, most of the files end up in the bin directory - SET(mysql_config_COMPONENT COMPONENT Development) SET(BIN_SCRIPTS msql2mysql mysql_config @@ -322,6 +322,7 @@ ELSE() mysqlaccess mysql_convert_table_format mysql_find_rows + mytop mysqlhotcopy mysqldumpslow mysqld_multi diff --git a/scripts/fill_help_tables.sql b/scripts/fill_help_tables.sql index 7751c37cbc3..939f15ed45a 100644 --- a/scripts/fill_help_tables.sql +++ b/scripts/fill_help_tables.sql @@ -1,18 +1,19 @@ --- Copyright (c) 2003, &year, Oracle and/or its affiliates. All rights reserved. --- Copyright (C) 2011 Monty Program Ab --- +-- Copyright (c) 2003, 2008-2012, Oracle and/or its affiliates. All rights reserved. +-- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; version 2 of the License. --- +-- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. --- +-- -- You should have received a copy of the GNU General Public License -- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +-- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +-- DO NOT EDIT THIS FILE. It is generated automatically. -- To use this file, load its contents into the mysql database. For example, -- with the mysql client program, process the file like this, where @@ -28,547 +29,553 @@ delete from help_keyword; delete from help_relation; insert into help_category (help_category_id,name,parent_category_id,url) values (1,'Geographic',0,''); -insert into help_category (help_category_id,name,parent_category_id,url) values (2,'Polygon properties',32,''); -insert into help_category (help_category_id,name,parent_category_id,url) values (3,'WKT',32,''); -insert into help_category (help_category_id,name,parent_category_id,url) values (4,'Numeric Functions',36,''); -insert into help_category (help_category_id,name,parent_category_id,url) values (5,'Plugins',33,''); -insert into help_category (help_category_id,name,parent_category_id,url) values (6,'MBR',32,''); -insert into help_category (help_category_id,name,parent_category_id,url) values (7,'Control flow functions',36,''); -insert into help_category (help_category_id,name,parent_category_id,url) values (8,'Transactions',33,''); -insert into help_category (help_category_id,name,parent_category_id,url) values (9,'Account Management',33,''); -insert into help_category (help_category_id,name,parent_category_id,url) values (10,'Point properties',32,''); -insert into help_category (help_category_id,name,parent_category_id,url) values (11,'Encryption Functions',36,''); -insert into help_category (help_category_id,name,parent_category_id,url) values (12,'LineString properties',32,''); -insert into help_category (help_category_id,name,parent_category_id,url) values (13,'Logical operators',36,''); -insert into help_category (help_category_id,name,parent_category_id,url) values (14,'Miscellaneous Functions',36,''); -insert into help_category (help_category_id,name,parent_category_id,url) values (15,'Information Functions',36,''); -insert into help_category (help_category_id,name,parent_category_id,url) values (16,'Functions and Modifiers for Use with GROUP BY',33,''); -insert into help_category (help_category_id,name,parent_category_id,url) values (17,'Comparison operators',36,''); -insert into help_category (help_category_id,name,parent_category_id,url) values (18,'Bit Functions',36,''); -insert into help_category (help_category_id,name,parent_category_id,url) values (19,'Table Maintenance',33,''); -insert into help_category (help_category_id,name,parent_category_id,url) values (20,'Data Types',33,''); -insert into help_category (help_category_id,name,parent_category_id,url) values (21,'User-Defined Functions',33,''); -insert into help_category (help_category_id,name,parent_category_id,url) values (22,'Compound Statements',33,''); -insert into help_category (help_category_id,name,parent_category_id,url) values (23,'Geometry constructors',32,''); -insert into help_category (help_category_id,name,parent_category_id,url) values (24,'GeometryCollection properties',1,''); -insert into help_category (help_category_id,name,parent_category_id,url) values (25,'Administration',33,''); -insert into help_category (help_category_id,name,parent_category_id,url) values (26,'Data Manipulation',33,''); -insert into help_category (help_category_id,name,parent_category_id,url) values (27,'Utility',33,''); -insert into help_category (help_category_id,name,parent_category_id,url) values (28,'Language Structure',33,''); -insert into help_category (help_category_id,name,parent_category_id,url) values (29,'Geometry relations',32,''); -insert into help_category (help_category_id,name,parent_category_id,url) values (30,'Date and Time Functions',36,''); -insert into help_category (help_category_id,name,parent_category_id,url) values (31,'WKB',32,''); -insert into help_category (help_category_id,name,parent_category_id,url) values (32,'Geographic Features',33,''); -insert into help_category (help_category_id,name,parent_category_id,url) values (33,'Contents',0,''); -insert into help_category (help_category_id,name,parent_category_id,url) values (34,'Geometry properties',32,''); -insert into help_category (help_category_id,name,parent_category_id,url) values (35,'String Functions',36,''); -insert into help_category (help_category_id,name,parent_category_id,url) values (36,'Functions',33,''); -insert into help_category (help_category_id,name,parent_category_id,url) values (37,'Data Definition',33,''); +insert into help_category (help_category_id,name,parent_category_id,url) values (2,'Polygon properties',34,''); +insert into help_category (help_category_id,name,parent_category_id,url) values (3,'WKT',34,''); +insert into help_category (help_category_id,name,parent_category_id,url) values (4,'Numeric Functions',38,''); +insert into help_category (help_category_id,name,parent_category_id,url) values (5,'Plugins',35,''); +insert into help_category (help_category_id,name,parent_category_id,url) values (6,'MBR',34,''); +insert into help_category (help_category_id,name,parent_category_id,url) values (7,'Control flow functions',38,''); +insert into help_category (help_category_id,name,parent_category_id,url) values (8,'Transactions',35,''); +insert into help_category (help_category_id,name,parent_category_id,url) values (9,'Help Metadata',35,''); +insert into help_category (help_category_id,name,parent_category_id,url) values (10,'Account Management',35,''); +insert into help_category (help_category_id,name,parent_category_id,url) values (11,'Point properties',34,''); +insert into help_category (help_category_id,name,parent_category_id,url) values (12,'Encryption Functions',38,''); +insert into help_category (help_category_id,name,parent_category_id,url) values (13,'LineString properties',34,''); +insert into help_category (help_category_id,name,parent_category_id,url) values (14,'Miscellaneous Functions',38,''); +insert into help_category (help_category_id,name,parent_category_id,url) values (15,'Logical operators',38,''); +insert into help_category (help_category_id,name,parent_category_id,url) values (16,'Functions and Modifiers for Use with GROUP BY',35,''); +insert into help_category (help_category_id,name,parent_category_id,url) values (17,'Information Functions',38,''); +insert into help_category (help_category_id,name,parent_category_id,url) values (18,'Comparison operators',38,''); +insert into help_category (help_category_id,name,parent_category_id,url) values (19,'Bit Functions',38,''); +insert into help_category (help_category_id,name,parent_category_id,url) values (20,'Table Maintenance',35,''); +insert into help_category (help_category_id,name,parent_category_id,url) values (21,'User-Defined Functions',35,''); +insert into help_category (help_category_id,name,parent_category_id,url) values (22,'Data Types',35,''); +insert into help_category (help_category_id,name,parent_category_id,url) values (23,'Compound Statements',35,''); +insert into help_category (help_category_id,name,parent_category_id,url) values (24,'Geometry constructors',34,''); +insert into help_category (help_category_id,name,parent_category_id,url) values (25,'GeometryCollection properties',1,''); +insert into help_category (help_category_id,name,parent_category_id,url) values (26,'Administration',35,''); +insert into help_category (help_category_id,name,parent_category_id,url) values (27,'Data Manipulation',35,''); +insert into help_category (help_category_id,name,parent_category_id,url) values (28,'Utility',35,''); +insert into help_category (help_category_id,name,parent_category_id,url) values (29,'Language Structure',35,''); +insert into help_category (help_category_id,name,parent_category_id,url) values (30,'Geometry relations',34,''); +insert into help_category (help_category_id,name,parent_category_id,url) values (31,'Date and Time Functions',38,''); +insert into help_category (help_category_id,name,parent_category_id,url) values (32,'WKB',34,''); +insert into help_category (help_category_id,name,parent_category_id,url) values (33,'Procedures',35,''); +insert into help_category (help_category_id,name,parent_category_id,url) values (34,'Geographic Features',35,''); +insert into help_category (help_category_id,name,parent_category_id,url) values (35,'Contents',0,''); +insert into help_category (help_category_id,name,parent_category_id,url) values (36,'Geometry properties',34,''); +insert into help_category (help_category_id,name,parent_category_id,url) values (37,'String Functions',38,''); +insert into help_category (help_category_id,name,parent_category_id,url) values (38,'Functions',35,''); +insert into help_category (help_category_id,name,parent_category_id,url) values (39,'Data Definition',35,''); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (0,16,'MIN','Syntax:\nMIN([DISTINCT] expr)\n\nReturns the minimum value of expr. MIN() may take a string argument; in\nsuch cases, it returns the minimum string value. See\nhttp://dev.mysql.com/doc/refman/5.1/en/mysql-indexes.html. The DISTINCT\nkeyword can be used to find the minimum of the distinct values of expr,\nhowever, this produces the same result as omitting DISTINCT.\n\nMIN() returns NULL if there were no matching rows.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/group-by-functions.html\n\n','mysql> SELECT student_name, MIN(test_score), MAX(test_score)\n -> FROM student\n -> GROUP BY student_name;\n','http://dev.mysql.com/doc/refman/5.1/en/group-by-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (1,26,'JOIN','MySQL supports the following JOIN syntaxes for the table_references\npart of SELECT statements and multiple-table DELETE and UPDATE\nstatements:\n\ntable_references:\n table_reference [, table_reference] ...\n\ntable_reference:\n table_factor\n | join_table\n\ntable_factor:\n tbl_name [[AS] alias] [index_hint_list]\n | table_subquery [AS] alias\n | ( table_references )\n | { OJ table_reference LEFT OUTER JOIN table_reference\n ON conditional_expr }\n\njoin_table:\n table_reference [INNER | CROSS] JOIN table_factor [join_condition]\n | table_reference STRAIGHT_JOIN table_factor\n | table_reference STRAIGHT_JOIN table_factor ON conditional_expr\n | table_reference {LEFT|RIGHT} [OUTER] JOIN table_reference join_condition\n | table_reference NATURAL [{LEFT|RIGHT} [OUTER]] JOIN table_factor\n\njoin_condition:\n ON conditional_expr\n | USING (column_list)\n\nindex_hint_list:\n index_hint [, index_hint] ...\n\nindex_hint:\n USE {INDEX|KEY}\n [{FOR {JOIN|ORDER BY|GROUP BY}] ([index_list])\n | IGNORE {INDEX|KEY}\n [{FOR {JOIN|ORDER BY|GROUP BY}] (index_list)\n | FORCE {INDEX|KEY}\n [{FOR {JOIN|ORDER BY|GROUP BY}] (index_list)\n\nindex_list:\n index_name [, index_name] ...\n\nA table reference is also known as a join expression.\n\nThe syntax of table_factor is extended in comparison with the SQL\nStandard. The latter accepts only table_reference, not a list of them\ninside a pair of parentheses.\n\nThis is a conservative extension if we consider each comma in a list of\ntable_reference items as equivalent to an inner join. For example:\n\nSELECT * FROM t1 LEFT JOIN (t2, t3, t4)\n ON (t2.a=t1.a AND t3.b=t1.b AND t4.c=t1.c)\n\nis equivalent to:\n\nSELECT * FROM t1 LEFT JOIN (t2 CROSS JOIN t3 CROSS JOIN t4)\n ON (t2.a=t1.a AND t3.b=t1.b AND t4.c=t1.c)\n\nIn MySQL, CROSS JOIN is a syntactic equivalent to INNER JOIN (they can\nreplace each other). In standard SQL, they are not equivalent. INNER\nJOIN is used with an ON clause, CROSS JOIN is used otherwise.\n\nIn general, parentheses can be ignored in join expressions containing\nonly inner join operations. MySQL also supports nested joins (see\nhttp://dev.mysql.com/doc/refman/5.1/en/nested-join-optimization.html).\n\nIndex hints can be specified to affect how the MySQL optimizer makes\nuse of indexes. For more information, see\nhttp://dev.mysql.com/doc/refman/5.1/en/index-hints.html.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/join.html\n\n','SELECT left_tbl.*\n FROM left_tbl LEFT JOIN right_tbl ON left_tbl.id = right_tbl.id\n WHERE right_tbl.id IS NULL;\n','http://dev.mysql.com/doc/refman/5.1/en/join.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (2,35,'HEX','Syntax:\nHEX(N_or_S)\n\nIf N_or_S is a number, returns a string representation of the\nhexadecimal value of N, where N is a longlong (BIGINT) number. This is\nequivalent to CONV(N,10,16).\n\nIf N_or_S is a string, returns a hexadecimal string representation of\nN_or_S where each character in N_or_S is converted to two hexadecimal\ndigits. The inverse of this operation is performed by the UNHEX()\nfunction.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/string-functions.html\n\n','mysql> SELECT HEX(255);\n -> \'FF\'\nmysql> SELECT 0x616263;\n -> \'abc\'\nmysql> SELECT HEX(\'abc\');\n -> 616263\n','http://dev.mysql.com/doc/refman/5.1/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (3,26,'REPLACE','Syntax:\nREPLACE [LOW_PRIORITY | DELAYED]\n [INTO] tbl_name [(col_name,...)]\n {VALUES | VALUE} ({expr | DEFAULT},...),(...),...\n\nOr:\n\nREPLACE [LOW_PRIORITY | DELAYED]\n [INTO] tbl_name\n SET col_name={expr | DEFAULT}, ...\n\nOr:\n\nREPLACE [LOW_PRIORITY | DELAYED]\n [INTO] tbl_name [(col_name,...)]\n SELECT ...\n\nREPLACE works exactly like INSERT, except that if an old row in the\ntable has the same value as a new row for a PRIMARY KEY or a UNIQUE\nindex, the old row is deleted before the new row is inserted. See [HELP\nINSERT].\n\nREPLACE is a MySQL extension to the SQL standard. It either inserts, or\ndeletes and inserts. For another MySQL extension to standard SQL ---\nthat either inserts or updates --- see\nhttp://dev.mysql.com/doc/refman/5.1/en/insert-on-duplicate.html.\n\nNote that unless the table has a PRIMARY KEY or UNIQUE index, using a\nREPLACE statement makes no sense. It becomes equivalent to INSERT,\nbecause there is no index to be used to determine whether a new row\nduplicates another.\n\nValues for all columns are taken from the values specified in the\nREPLACE statement. Any missing columns are set to their default values,\njust as happens for INSERT. You cannot refer to values from the current\nrow and use them in the new row. If you use an assignment such as SET\ncol_name = col_name + 1, the reference to the column name on the right\nhand side is treated as DEFAULT(col_name), so the assignment is\nequivalent to SET col_name = DEFAULT(col_name) + 1.\n\nTo use REPLACE, you must have both the INSERT and DELETE privileges for\nthe table.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/replace.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/replace.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (4,29,'CONTAINS','Contains(g1,g2)\n\nReturns 1 or 0 to indicate whether g1 completely contains g2. This\ntests the opposite relationship as Within().\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/functions-that-test-spatial-relationships-between-geometries.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/functions-that-test-spatial-relationships-between-geometries.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (5,34,'SRID','SRID(g)\n\nReturns an integer indicating the Spatial Reference System ID for the\ngeometry value g.\n\nIn MySQL, the SRID value is just an integer associated with the\ngeometry value. All calculations are done assuming Euclidean (planar)\ngeometry.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/geometry-property-functions.html#general-geometry-property-functions\n\n','mysql> SELECT SRID(GeomFromText(\'LineString(1 1,2 2)\',101));\n+-----------------------------------------------+\n| SRID(GeomFromText(\'LineString(1 1,2 2)\',101)) |\n+-----------------------------------------------+\n| 101 |\n+-----------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.1/en/geometry-property-functions.html#general-geometry-property-functions'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (6,30,'CURRENT_TIMESTAMP','Syntax:\nCURRENT_TIMESTAMP, CURRENT_TIMESTAMP()\n\nCURRENT_TIMESTAMP and CURRENT_TIMESTAMP() are synonyms for NOW().\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (7,25,'SHOW CONTRIBUTORS','Syntax:\nSHOW CONTRIBUTORS\n\nThe SHOW CONTRIBUTORS statement displays information about the people\nwho contribute to MySQL source or to causes that we support. For each\ncontributor, it displays Name, Location, and Comment values.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/show-contributors.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/show-contributors.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (8,16,'VARIANCE','Syntax:\nVARIANCE(expr)\n\nReturns the population standard variance of expr. This is an extension\nto standard SQL. The standard SQL function VAR_POP() can be used\ninstead.\n\nVARIANCE() returns NULL if there were no matching rows.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/group-by-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/group-by-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (9,37,'DROP SERVER','Syntax:\nDROP SERVER [ IF EXISTS ] server_name\n\nDrops the server definition for the server named server_name. The\ncorresponding row within the mysql.servers table will be deleted. This\nstatement requires the SUPER privilege.\n\nDropping a server for a table does not affect any FEDERATED tables that\nused this connection information when they were created. See [HELP\nCREATE SERVER].\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/drop-server.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/drop-server.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (10,25,'SHOW AUTHORS','Syntax:\nSHOW AUTHORS\n\nThe SHOW AUTHORS statement displays information about the people who\nwork on MySQL. For each author, it displays Name, Location, and Comment\nvalues.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/show-authors.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/show-authors.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (11,16,'VAR_SAMP','Syntax:\nVAR_SAMP(expr)\n\nReturns the sample variance of expr. That is, the denominator is the\nnumber of rows minus one.\n\nVAR_SAMP() returns NULL if there were no matching rows.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/group-by-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/group-by-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (12,35,'CONCAT','Syntax:\nCONCAT(str1,str2,...)\n\nReturns the string that results from concatenating the arguments. May\nhave one or more arguments. If all arguments are nonbinary strings, the\nresult is a nonbinary string. If the arguments include any binary\nstrings, the result is a binary string. A numeric argument is converted\nto its equivalent binary string form; if you want to avoid that, you\ncan use an explicit type cast, as in this example:\n\nSELECT CONCAT(CAST(int_col AS CHAR), char_col);\n\nCONCAT() returns NULL if any argument is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/string-functions.html\n\n','mysql> SELECT CONCAT(\'My\', \'S\', \'QL\');\n -> \'MySQL\'\nmysql> SELECT CONCAT(\'My\', NULL, \'QL\');\n -> NULL\nmysql> SELECT CONCAT(14.3);\n -> \'14.3\'\n','http://dev.mysql.com/doc/refman/5.1/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (13,32,'GEOMETRY HIERARCHY','Geometry is the base class. It is an abstract class. The instantiable\nsubclasses of Geometry are restricted to zero-, one-, and\ntwo-dimensional geometric objects that exist in two-dimensional\ncoordinate space. All instantiable geometry classes are defined so that\nvalid instances of a geometry class are topologically closed (that is,\nall defined geometries include their boundary).\n\nThe base Geometry class has subclasses for Point, Curve, Surface, and\nGeometryCollection:\n\no Point represents zero-dimensional objects.\n\no Curve represents one-dimensional objects, and has subclass\n LineString, with sub-subclasses Line and LinearRing.\n\no Surface is designed for two-dimensional objects and has subclass\n Polygon.\n\no GeometryCollection has specialized zero-, one-, and two-dimensional\n collection classes named MultiPoint, MultiLineString, and\n MultiPolygon for modeling geometries corresponding to collections of\n Points, LineStrings, and Polygons, respectively. MultiCurve and\n MultiSurface are introduced as abstract superclasses that generalize\n the collection interfaces to handle Curves and Surfaces.\n\nGeometry, Curve, Surface, MultiCurve, and MultiSurface are defined as\nnoninstantiable classes. They define a common set of methods for their\nsubclasses and are included for extensibility.\n\nPoint, LineString, Polygon, GeometryCollection, MultiPoint,\nMultiLineString, and MultiPolygon are instantiable classes.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/gis-geometry-class-hierarchy.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/gis-geometry-class-hierarchy.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (14,35,'CHAR FUNCTION','Syntax:\nCHAR(N,... [USING charset_name])\n\nCHAR() interprets each argument N as an integer and returns a string\nconsisting of the characters given by the code values of those\nintegers. NULL values are skipped.\nBy default, CHAR() returns a binary string. To produce a string in a\ngiven character set, use the optional USING clause:\n\nmysql> SELECT CHARSET(CHAR(0x65)), CHARSET(CHAR(0x65 USING utf8));\n+---------------------+--------------------------------+\n| CHARSET(CHAR(0x65)) | CHARSET(CHAR(0x65 USING utf8)) |\n+---------------------+--------------------------------+\n| binary | utf8 |\n+---------------------+--------------------------------+\n\nIf USING is given and the result string is illegal for the given\ncharacter set, a warning is issued. Also, if strict SQL mode is\nenabled, the result from CHAR() becomes NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/string-functions.html\n\n','mysql> SELECT CHAR(77,121,83,81,\'76\');\n -> \'MySQL\'\nmysql> SELECT CHAR(77,77.3,\'77.3\');\n -> \'MMM\'\n','http://dev.mysql.com/doc/refman/5.1/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (15,20,'DATETIME','DATETIME\n\nA date and time combination. The supported range is \'1000-01-01\n00:00:00\' to \'9999-12-31 23:59:59\'. MySQL displays DATETIME values in\n\'YYYY-MM-DD HH:MM:SS\' format, but allows assignment of values to\nDATETIME columns using either strings or numbers.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/date-and-time-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/date-and-time-type-overview.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (16,22,'OPEN','Syntax:\nOPEN cursor_name\n\nThis statement opens a previously declared cursor.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/open.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/open.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (17,25,'SHOW CREATE TRIGGER','Syntax:\nSHOW CREATE TRIGGER trigger_name\n\nThis statement shows a CREATE TRIGGER statement that creates the given\ntrigger.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/show-create-trigger.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/show-create-trigger.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (18,25,'SHOW CREATE PROCEDURE','Syntax:\nSHOW CREATE PROCEDURE proc_name\n\nThis statement is a MySQL extension. It returns the exact string that\ncan be used to re-create the named stored procedure. A similar\nstatement, SHOW CREATE FUNCTION, displays information about stored\nfunctions (see [HELP SHOW CREATE FUNCTION]).\n\nBoth statements require that you be the owner of the routine or have\nSELECT access to the mysql.proc table. If you do not have privileges\nfor the routine itself, the value displayed for the Create Procedure or\nCreate Function field will be NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/show-create-procedure.html\n\n','mysql> SHOW CREATE PROCEDURE test.simpleproc\\G\n*************************** 1. row ***************************\n Procedure: simpleproc\n sql_mode:\n Create Procedure: CREATE PROCEDURE `simpleproc`(OUT param1 INT)\n BEGIN\n SELECT COUNT(*) INTO param1 FROM t;\n END\ncharacter_set_client: latin1\ncollation_connection: latin1_swedish_ci\n Database Collation: latin1_swedish_ci\n\nmysql> SHOW CREATE FUNCTION test.hello\\G\n*************************** 1. row ***************************\n Function: hello\n sql_mode:\n Create Function: CREATE FUNCTION `hello`(s CHAR(20))\n RETURNS CHAR(50)\n RETURN CONCAT(\'Hello, \',s,\'!\')\ncharacter_set_client: latin1\ncollation_connection: latin1_swedish_ci\n Database Collation: latin1_swedish_ci\n','http://dev.mysql.com/doc/refman/5.1/en/show-create-procedure.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (19,20,'INTEGER','INTEGER[(M)] [UNSIGNED] [ZEROFILL]\n\nThis type is a synonym for INT.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/numeric-type-overview.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (20,35,'LOWER','Syntax:\nLOWER(str)\n\nReturns the string str with all characters changed to lowercase\naccording to the current character set mapping. The default is latin1\n(cp1252 West European).\n\nmysql> SELECT LOWER(\'QUADRATICALLY\');\n -> \'quadratically\'\n\nLOWER() (and UPPER()) are ineffective when applied to binary strings\n(BINARY, VARBINARY, BLOB). To perform lettercase conversion, convert\nthe string to a nonbinary string:\n\nmysql> SET @str = BINARY \'New York\';\nmysql> SELECT LOWER(@str), LOWER(CONVERT(@str USING latin1));\n+-------------+-----------------------------------+\n| LOWER(@str) | LOWER(CONVERT(@str USING latin1)) |\n+-------------+-----------------------------------+\n| New York | new york |\n+-------------+-----------------------------------+\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/string-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (21,25,'SHOW COLUMNS','Syntax:\nSHOW [FULL] COLUMNS {FROM | IN} tbl_name [{FROM | IN} db_name]\n [LIKE \'pattern\' | WHERE expr]\n\nSHOW COLUMNS displays information about the columns in a given table.\nIt also works for views. The LIKE clause, if present, indicates which\ncolumn names to match. The WHERE clause can be given to select rows\nusing more general conditions, as discussed in\nhttp://dev.mysql.com/doc/refman/5.1/en/extended-show.html.\n\nmysql> SHOW COLUMNS FROM City;\n+------------+----------+------+-----+---------+----------------+\n| Field | Type | Null | Key | Default | Extra |\n+------------+----------+------+-----+---------+----------------+\n| Id | int(11) | NO | PRI | NULL | auto_increment |\n| Name | char(35) | NO | | | |\n| Country | char(3) | NO | UNI | | |\n| District | char(20) | YES | MUL | | |\n| Population | int(11) | NO | | 0 | |\n+------------+----------+------+-----+---------+----------------+\n5 rows in set (0.00 sec)\n\nIf the data types differ from what you expect them to be based on a\nCREATE TABLE statement, note that MySQL sometimes changes data types\nwhen you create or alter a table. The conditions under which this\noccurs are described in\nhttp://dev.mysql.com/doc/refman/5.1/en/silent-column-changes.html.\n\nThe FULL keyword causes the output to include the column collation and\ncomments, as well as the privileges you have for each column.\n\nYou can use db_name.tbl_name as an alternative to the tbl_name FROM\ndb_name syntax. In other words, these two statements are equivalent:\n\nmysql> SHOW COLUMNS FROM mytable FROM mydb;\nmysql> SHOW COLUMNS FROM mydb.mytable;\n\nSHOW COLUMNS displays the following values for each table column:\n\nField indicates the column name.\n\nType indicates the column data type.\n\nCollation indicates the collation for nonbinary string columns, or NULL\nfor other columns. This value is displayed only if you use the FULL\nkeyword.\n\nThe Null field contains YES if NULL values can be stored in the column,\nNO if not.\n\nThe Key field indicates whether the column is indexed:\n\no If Key is empty, the column either is not indexed or is indexed only\n as a secondary column in a multiple-column, nonunique index.\n\no If Key is PRI, the column is a PRIMARY KEY or is one of the columns\n in a multiple-column PRIMARY KEY.\n\no If Key is UNI, the column is the first column of a UNIQUE index. (A\n UNIQUE index allows multiple NULL values, but you can tell whether\n the column allows NULL by checking the Null field.)\n\no If Key is MUL, the column is the first column of a nonunique index in\n which multiple occurrences of a given value are allowed within the\n column.\n\nIf more than one of the Key values applies to a given column of a\ntable, Key displays the one with the highest priority, in the order\nPRI, UNI, MUL.\n\nA UNIQUE index may be displayed as PRI if it cannot contain NULL values\nand there is no PRIMARY KEY in the table. A UNIQUE index may display as\nMUL if several columns form a composite UNIQUE index; although the\ncombination of the columns is unique, each column can still hold\nmultiple occurrences of a given value.\n\nThe Default field indicates the default value that is assigned to the\ncolumn.\n\nThe Extra field contains any additional information that is available\nabout a given column. The value is nonempty in these cases:\nauto_increment for columns that have the AUTO_INCREMENT attribute; as\nof MySQL 5.1.23, on update CURRENT_TIMESTAMP for TIMESTAMP columns that\nhave the ON UPDATE CURRENT_TIMESTAMP attribute.\n\nPrivileges indicates the privileges you have for the column. This value\nis displayed only if you use the FULL keyword.\n\nComment indicates any comment the column has. This value is displayed\nonly if you use the FULL keyword.\n\nSHOW FIELDS is a synonym for SHOW COLUMNS. You can also list a table\'s\ncolumns with the mysqlshow db_name tbl_name command.\n\nThe DESCRIBE statement provides information similar to SHOW COLUMNS.\nSee [HELP DESCRIBE].\n\nThe SHOW CREATE TABLE, SHOW TABLE STATUS, and SHOW INDEX statements\nalso provide information about tables. See [HELP SHOW].\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/show-columns.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/show-columns.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (22,37,'CREATE TRIGGER','Syntax:\nCREATE\n [DEFINER = { user | CURRENT_USER }]\n TRIGGER trigger_name trigger_time trigger_event\n ON tbl_name FOR EACH ROW trigger_stmt\n\nThis statement creates a new trigger. A trigger is a named database\nobject that is associated with a table, and that activates when a\nparticular event occurs for the table. The trigger becomes associated\nwith the table named tbl_name, which must refer to a permanent table.\nYou cannot associate a trigger with a TEMPORARY table or a view.\n\nCREATE TRIGGER requires the TRIGGER privilege for the table associated\nwith the trigger. If binary logging is enabled, the CREATE TRIGGER\nstatement might also require the SUPER privilege, as described in\nhttp://dev.mysql.com/doc/refman/5.1/en/stored-programs-logging.html.\nSUPER may also be required depending on the DEFINER value, as described\nlater. (Before MySQL 5.1.6, there is no TRIGGER privilege and this\nstatement requires the SUPER privilege in all cases.)\n\nThe DEFINER clause determines the security context to be used when\nchecking access privileges at trigger activation time.\n\ntrigger_time is the trigger action time. It can be BEFORE or AFTER to\nindicate that the trigger activates before or after each row to be\nmodified.\n\ntrigger_event indicates the kind of statement that activates the\ntrigger. The trigger_event can be one of the following:\n\no INSERT: The trigger is activated whenever a new row is inserted into\n the table; for example, through INSERT, LOAD DATA, and REPLACE\n statements.\n\no UPDATE: The trigger is activated whenever a row is modified; for\n example, through UPDATE statements.\n\no DELETE: The trigger is activated whenever a row is deleted from the\n table; for example, through DELETE and REPLACE statements. However,\n DROP TABLE and TRUNCATE TABLE statements on the table do not activate\n this trigger, because they do not use DELETE. Dropping a partition\n does not activate DELETE triggers, either. See [HELP TRUNCATE TABLE].\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/create-trigger.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/create-trigger.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (23,30,'MONTH','Syntax:\nMONTH(date)\n\nReturns the month for date, in the range 1 to 12 for January to\nDecember, or 0 for dates such as \'0000-00-00\' or \'2008-00-00\' that have\na zero month part.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html\n\n','mysql> SELECT MONTH(\'2008-02-03\');\n -> 2\n','http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (24,20,'TINYINT','TINYINT[(M)] [UNSIGNED] [ZEROFILL]\n\nA very small integer. The signed range is -128 to 127. The unsigned\nrange is 0 to 255.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/numeric-type-overview.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (25,25,'SHOW TRIGGERS','Syntax:\nSHOW TRIGGERS [{FROM | IN} db_name]\n [LIKE \'pattern\' | WHERE expr]\n\nSHOW TRIGGERS lists the triggers currently defined for tables in a\ndatabase (the default database unless a FROM clause is given). This\nstatement requires the TRIGGER privilege (prior to MySQL 5.1.22, it\nrequires the SUPER privilege). The LIKE clause, if present, indicates\nwhich table names to match and causes the statement to display triggers\nfor those tables. The WHERE clause can be given to select rows using\nmore general conditions, as discussed in\nhttp://dev.mysql.com/doc/refman/5.1/en/extended-show.html.\n\nFor the trigger ins_sum as defined in\nhttp://dev.mysql.com/doc/refman/5.1/en/triggers.html, the output of\nthis statement is as shown here:\n\nmysql> SHOW TRIGGERS LIKE \'acc%\'\\G\n*************************** 1. row ***************************\n Trigger: ins_sum\n Event: INSERT\n Table: account\n Statement: SET @sum = @sum + NEW.amount\n Timing: BEFORE\n Created: NULL\n sql_mode:\n Definer: myname@localhost\ncharacter_set_client: latin1\ncollation_connection: latin1_swedish_ci\n Database Collation: latin1_swedish_ci\n\ncharacter_set_client is the session value of the character_set_client\nsystem variable when the trigger was created. collation_connection is\nthe session value of the collation_connection system variable when the\ntrigger was created. Database Collation is the collation of the\ndatabase with which the trigger is associated. These columns were added\nin MySQL 5.1.21.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/show-triggers.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/show-triggers.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (26,14,'MASTER_POS_WAIT','Syntax:\nMASTER_POS_WAIT(log_name,log_pos[,timeout])\n\nThis function is useful for control of master/slave synchronization. It\nblocks until the slave has read and applied all updates up to the\nspecified position in the master log. The return value is the number of\nlog events the slave had to wait for to advance to the specified\nposition. The function returns NULL if the slave SQL thread is not\nstarted, the slave\'s master information is not initialized, the\narguments are incorrect, or an error occurs. It returns -1 if the\ntimeout has been exceeded. If the slave SQL thread stops while\nMASTER_POS_WAIT() is waiting, the function returns NULL. If the slave\nis past the specified position, the function returns immediately.\n\nIf a timeout value is specified, MASTER_POS_WAIT() stops waiting when\ntimeout seconds have elapsed. timeout must be greater than 0; a zero or\nnegative timeout means no timeout.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/miscellaneous-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/miscellaneous-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (27,35,'REGEXP','Syntax:\nexpr REGEXP pat, expr RLIKE pat\n\nPerforms a pattern match of a string expression expr against a pattern\npat. The pattern can be an extended regular expression. The syntax for\nregular expressions is discussed in\nhttp://dev.mysql.com/doc/refman/5.1/en/regexp.html. Returns 1 if expr\nmatches pat; otherwise it returns 0. If either expr or pat is NULL, the\nresult is NULL. RLIKE is a synonym for REGEXP, provided for mSQL\ncompatibility.\n\nThe pattern need not be a literal string. For example, it can be\nspecified as a string expression or table column.\n\n*Note*: Because MySQL uses the C escape syntax in strings (for example,\n"\\n" to represent the newline character), you must double any "\\" that\nyou use in your REGEXP strings.\n\nREGEXP is not case sensitive, except when used with binary strings.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/regexp.html\n\n','mysql> SELECT \'Monty!\' REGEXP \'.*\';\n -> 1\nmysql> SELECT \'new*\\n*line\' REGEXP \'new\\\\*.\\\\*line\';\n -> 1\nmysql> SELECT \'a\' REGEXP \'A\', \'a\' REGEXP BINARY \'A\';\n -> 1 0\nmysql> SELECT \'a\' REGEXP \'^[a-d]\';\n -> 1\n','http://dev.mysql.com/doc/refman/5.1/en/regexp.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (28,22,'IF STATEMENT','Syntax:\nIF search_condition THEN statement_list\n [ELSEIF search_condition THEN statement_list] ...\n [ELSE statement_list]\nEND IF\n\nIF implements a basic conditional construct. If the search_condition\nevaluates to true, the corresponding SQL statement list is executed. If\nno search_condition matches, the statement list in the ELSE clause is\nexecuted. Each statement_list consists of one or more statements.\n\n*Note*: There is also an IF() function, which differs from the IF\nstatement described here. See\nhttp://dev.mysql.com/doc/refman/5.1/en/control-flow-functions.html.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/if-statement.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/if-statement.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (29,18,'^','Syntax:\n^\n\nBitwise XOR:\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/bit-functions.html\n\n','mysql> SELECT 1 ^ 1;\n -> 0\nmysql> SELECT 1 ^ 0;\n -> 1\nmysql> SELECT 11 ^ 3;\n -> 8\n','http://dev.mysql.com/doc/refman/5.1/en/bit-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (30,37,'DROP VIEW','Syntax:\nDROP VIEW [IF EXISTS]\n view_name [, view_name] ...\n [RESTRICT | CASCADE]\n\nDROP VIEW removes one or more views. You must have the DROP privilege\nfor each view. If any of the views named in the argument list do not\nexist, MySQL returns an error indicating by name which nonexisting\nviews it was unable to drop, but it also drops all of the views in the\nlist that do exist.\n\nThe IF EXISTS clause prevents an error from occurring for views that\ndon\'t exist. When this clause is given, a NOTE is generated for each\nnonexistent view. See [HELP SHOW WARNINGS].\n\nRESTRICT and CASCADE, if given, are parsed and ignored.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/drop-view.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/drop-view.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (31,29,'WITHIN','Within(g1,g2)\n\nReturns 1 or 0 to indicate whether g1 is spatially within g2. This\ntests the opposite relationship as Contains().\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/functions-that-test-spatial-relationships-between-geometries.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/functions-that-test-spatial-relationships-between-geometries.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (32,30,'WEEK','Syntax:\nWEEK(date[,mode])\n\nThis function returns the week number for date. The two-argument form\nof WEEK() allows you to specify whether the week starts on Sunday or\nMonday and whether the return value should be in the range from 0 to 53\nor from 1 to 53. If the mode argument is omitted, the value of the\ndefault_week_format system variable is used. See\nhttp://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html\n\n','mysql> SELECT WEEK(\'2008-02-20\');\n -> 7\nmysql> SELECT WEEK(\'2008-02-20\',0);\n -> 7\nmysql> SELECT WEEK(\'2008-02-20\',1);\n -> 8\nmysql> SELECT WEEK(\'2008-12-31\',1);\n -> 53\n','http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (33,25,'SHOW PLUGINS','Syntax:\nSHOW PLUGINS\n\nSHOW PLUGINS displays information about server plugins.\n\nmysql> SHOW PLUGINS\\G\n*************************** 1. row ***************************\n Name: binlog\n Status: ACTIVE\n Type: STORAGE ENGINE\nLibrary: NULL\nLicense: GPL\n*************************** 2. row ***************************\n Name: CSV\n Status: ACTIVE\n Type: STORAGE ENGINE\nLibrary: NULL\nLicense: GPL\n*************************** 3. row ***************************\n Name: MEMORY\n Status: ACTIVE\n Type: STORAGE ENGINE\nLibrary: NULL\nLicense: GPL\n*************************** 4. row ***************************\n Name: MyISAM\n Status: ACTIVE\n Type: STORAGE ENGINE\nLibrary: NULL\nLicense: GPL\n...\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/show-plugins.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/show-plugins.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (34,21,'DROP FUNCTION UDF','Syntax:\nDROP FUNCTION function_name\n\nThis statement drops the user-defined function (UDF) named\nfunction_name.\n\nTo drop a function, you must have the DELETE privilege for the mysql\ndatabase. This is because DROP FUNCTION removes a row from the\nmysql.func system table that records the function\'s name, type, and\nshared library name.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/drop-function-udf.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/drop-function-udf.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (35,25,'PREPARE','Syntax:\nPREPARE stmt_name FROM preparable_stmt\n\nThe PREPARE statement prepares a statement and assigns it a name,\nstmt_name, by which to refer to the statement later. Statement names\nare not case sensitive. preparable_stmt is either a string literal or a\nuser variable that contains the text of the statement. The text must\nrepresent a single SQL statement, not multiple statements. Within the\nstatement, "?" characters can be used as parameter markers to indicate\nwhere data values are to be bound to the query later when you execute\nit. The "?" characters should not be enclosed within quotes, even if\nyou intend to bind them to string values. Parameter markers can be used\nonly where data values should appear, not for SQL keywords,\nidentifiers, and so forth.\n\nIf a prepared statement with the given name already exists, it is\ndeallocated implicitly before the new statement is prepared. This means\nthat if the new statement contains an error and cannot be prepared, an\nerror is returned and no statement with the given name exists.\n\nA prepared statement is executed with EXECUTE and released with\nDEALLOCATE PREPARE.\n\nThe scope of a prepared statement is the session within which it is\ncreated. Other sessions cannot see it.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/prepare.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/prepare.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (36,8,'LOCK','Syntax:\nLOCK TABLES\n tbl_name [[AS] alias] lock_type\n [, tbl_name [[AS] alias] lock_type] ...\n\nlock_type:\n READ [LOCAL]\n | [LOW_PRIORITY] WRITE\n\nUNLOCK TABLES\n\nMySQL enables client sessions to acquire table locks explicitly for the\npurpose of cooperating with other sessions for access to tables, or to\nprevent other sessions from modifying tables during periods when a\nsession requires exclusive access to them. A session can acquire or\nrelease locks only for itself. One session cannot acquire locks for\nanother session or release locks held by another session.\n\nLocks may be used to emulate transactions or to get more speed when\nupdating tables. This is explained in more detail later in this\nsection.\n\nLOCK TABLES explicitly acquires table locks for the current client\nsession. Table locks can be acquired for base tables or views. You must\nhave the LOCK TABLES privilege, and the SELECT privilege for each\nobject to be locked.\n\nFor view locking, LOCK TABLES adds all base tables used in the view to\nthe set of tables to be locked and locks them automatically. If you\nlock a table explicitly with LOCK TABLES, any tables used in triggers\nare also locked implicitly, as described in\nhttp://dev.mysql.com/doc/refman/5.1/en/lock-tables-and-triggers.html.\n\nUNLOCK TABLES explicitly releases any table locks held by the current\nsession.\n\nAnother use for UNLOCK TABLES is to release the global read lock\nacquired with the FLUSH TABLES WITH READ LOCK statement, which enables\nyou to lock all tables in all databases. See [HELP FLUSH]. (This is a\nvery convenient way to get backups if you have a file system such as\nVeritas that can take snapshots in time.)\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/lock-tables.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/lock-tables.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (37,35,'UPDATEXML','Syntax:\nUpdateXML(xml_target, xpath_expr, new_xml)\n\nThis function replaces a single portion of a given fragment of XML\nmarkup xml_target with a new XML fragment new_xml, and then returns the\nchanged XML. The portion of xml_target that is replaced matches an\nXPath expression xpath_expr supplied by the user. If no expression\nmatching xpath_expr is found, or if multiple matches are found, the\nfunction returns the original xml_target XML fragment. All three\narguments should be strings.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/xml-functions.html\n\n','mysql> SELECT\n -> UpdateXML(\'<a><b>ccc</b><d></d></a>\', \'/a\', \'<e>fff</e>\') AS val1,\n -> UpdateXML(\'<a><b>ccc</b><d></d></a>\', \'/b\', \'<e>fff</e>\') AS val2,\n -> UpdateXML(\'<a><b>ccc</b><d></d></a>\', \'//b\', \'<e>fff</e>\') AS val3,\n -> UpdateXML(\'<a><b>ccc</b><d></d></a>\', \'/a/d\', \'<e>fff</e>\') AS val4,\n -> UpdateXML(\'<a><d></d><b>ccc</b><d></d></a>\', \'/a/d\', \'<e>fff</e>\') AS val5\n -> \\G\n\n*************************** 1. row ***************************\nval1: <e>fff</e>\nval2: <a><b>ccc</b><d></d></a>\nval3: <a><e>fff</e><d></d></a>\nval4: <a><b>ccc</b><e>fff</e></a>\nval5: <a><d></d><b>ccc</b><d></d></a>\n','http://dev.mysql.com/doc/refman/5.1/en/xml-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (38,25,'RESET SLAVE','Syntax:\nRESET SLAVE\n\nRESET SLAVE makes the slave forget its replication position in the\nmaster\'s binary log. This statement is meant to be used for a clean\nstart: It deletes the master.info and relay-log.info files, all the\nrelay log files, and starts a new relay log file. To use RESET SLAVE,\nthe slave replication threads must be stopped (use STOP SLAVE if\nnecessary).\n\n*Note*: All relay log files are deleted, even if they have not been\ncompletely executed by the slave SQL thread. (This is a condition\nlikely to exist on a replication slave if you have issued a STOP SLAVE\nstatement or if the slave is highly loaded.)\n\nConnection information stored in the master.info file is immediately\nreset using any values specified in the corresponding startup options.\nThis information includes values such as master host, master port,\nmaster user, and master password. If the slave SQL thread was in the\nmiddle of replicating temporary tables when it was stopped, and RESET\nSLAVE is issued, these replicated temporary tables are deleted on the\nslave.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/reset-slave.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/reset-slave.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (39,25,'SHOW BINARY LOGS','Syntax:\nSHOW BINARY LOGS\nSHOW MASTER LOGS\n\nLists the binary log files on the server. This statement is used as\npart of the procedure described in [HELP PURGE BINARY LOGS], that shows\nhow to determine which logs can be purged.\n\nmysql> SHOW BINARY LOGS;\n+---------------+-----------+\n| Log_name | File_size |\n+---------------+-----------+\n| binlog.000015 | 724935 |\n| binlog.000016 | 733481 |\n+---------------+-----------+\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/show-binary-logs.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/show-binary-logs.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (40,23,'POLYGON','Polygon(ls1,ls2,...)\n\nConstructs a Polygon value from a number of LineString or WKB\nLineString arguments. If any argument does not represent a LinearRing\n(that is, not a closed and simple LineString), the return value is\nNULL.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/creating-spatial-values.html#gis-mysql-specific-functions\n\n','','http://dev.mysql.com/doc/refman/5.1/en/creating-spatial-values.html#gis-mysql-specific-functions'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (41,30,'MINUTE','Syntax:\nMINUTE(time)\n\nReturns the minute for time, in the range 0 to 59.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html\n\n','mysql> SELECT MINUTE(\'2008-02-03 10:05:03\');\n -> 5\n','http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (42,30,'DAY','Syntax:\nDAY(date)\n\nDAY() is a synonym for DAYOFMONTH().\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (43,35,'MID','Syntax:\nMID(str,pos,len)\n\nMID(str,pos,len) is a synonym for SUBSTRING(str,pos,len).\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/string-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (44,14,'UUID','Syntax:\nUUID()\n\nReturns a Universal Unique Identifier (UUID) generated according to\n"DCE 1.1: Remote Procedure Call" (Appendix A) CAE (Common Applications\nEnvironment) Specifications published by The Open Group in October 1997\n(Document Number C706,\nhttp://www.opengroup.org/public/pubs/catalog/c706.htm).\n\nA UUID is designed as a number that is globally unique in space and\ntime. Two calls to UUID() are expected to generate two different\nvalues, even if these calls are performed on two separate computers\nthat are not connected to each other.\n\nA UUID is a 128-bit number represented by a utf8 string of five\nhexadecimal numbers in aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee format:\n\no The first three numbers are generated from a timestamp.\n\no The fourth number preserves temporal uniqueness in case the timestamp\n value loses monotonicity (for example, due to daylight saving time).\n\no The fifth number is an IEEE 802 node number that provides spatial\n uniqueness. A random number is substituted if the latter is not\n available (for example, because the host computer has no Ethernet\n card, or we do not know how to find the hardware address of an\n interface on your operating system). In this case, spatial uniqueness\n cannot be guaranteed. Nevertheless, a collision should have very low\n probability.\n\n Currently, the MAC address of an interface is taken into account only\n on FreeBSD and Linux. On other operating systems, MySQL uses a\n randomly generated 48-bit number.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/miscellaneous-functions.html\n\n','mysql> SELECT UUID();\n -> \'6ccd780c-baba-1026-9564-0040f4311e29\'\n','http://dev.mysql.com/doc/refman/5.1/en/miscellaneous-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (45,23,'LINESTRING','LineString(pt1,pt2,...)\n\nConstructs a LineString value from a number of Point or WKB Point\narguments. If the number of arguments is less than two, the return\nvalue is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/creating-spatial-values.html#gis-mysql-specific-functions\n\n','','http://dev.mysql.com/doc/refman/5.1/en/creating-spatial-values.html#gis-mysql-specific-functions'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (46,14,'SLEEP','Syntax:\nSLEEP(duration)\n\nSleeps (pauses) for the number of seconds given by the duration\nargument, then returns 0. If SLEEP() is interrupted, it returns 1. The\nduration may have a fractional part given in microseconds.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/miscellaneous-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/miscellaneous-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (47,15,'CONNECTION_ID','Syntax:\nCONNECTION_ID()\n\nReturns the connection ID (thread ID) for the connection. Every\nconnection has an ID that is unique among the set of currently\nconnected clients.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/information-functions.html\n\n','mysql> SELECT CONNECTION_ID();\n -> 23786\n','http://dev.mysql.com/doc/refman/5.1/en/information-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (48,26,'DELETE','Syntax:\nSingle-table syntax:\n\nDELETE [LOW_PRIORITY] [QUICK] [IGNORE] FROM tbl_name\n [WHERE where_condition]\n [ORDER BY ...]\n [LIMIT row_count]\n\nMultiple-table syntax:\n\nDELETE [LOW_PRIORITY] [QUICK] [IGNORE]\n tbl_name[.*] [, tbl_name[.*]] ...\n FROM table_references\n [WHERE where_condition]\n\nOr:\n\nDELETE [LOW_PRIORITY] [QUICK] [IGNORE]\n FROM tbl_name[.*] [, tbl_name[.*]] ...\n USING table_references\n [WHERE where_condition]\n\nFor the single-table syntax, the DELETE statement deletes rows from\ntbl_name and returns a count of the number of deleted rows. This count\ncan be obtained by calling the ROW_COUNT() function (see\nhttp://dev.mysql.com/doc/refman/5.1/en/information-functions.html). The\nWHERE clause, if given, specifies the conditions that identify which\nrows to delete. With no WHERE clause, all rows are deleted. If the\nORDER BY clause is specified, the rows are deleted in the order that is\nspecified. The LIMIT clause places a limit on the number of rows that\ncan be deleted.\n\nFor the multiple-table syntax, DELETE deletes from each tbl_name the\nrows that satisfy the conditions. In this case, ORDER BY and LIMIT\ncannot be used.\n\nwhere_condition is an expression that evaluates to true for each row to\nbe deleted. It is specified as described in\nhttp://dev.mysql.com/doc/refman/5.1/en/select.html.\n\nCurrently, you cannot delete from a table and select from the same\ntable in a subquery.\n\nYou need the DELETE privilege on a table to delete rows from it. You\nneed only the SELECT privilege for any columns that are only read, such\nas those named in the WHERE clause.\n\nAs stated, a DELETE statement with no WHERE clause deletes all rows. A\nfaster way to do this, when you do not need to know the number of\ndeleted rows, is to use TRUNCATE TABLE. However, within a transaction\nor if you have a lock on the table, TRUNCATE TABLE cannot be used\nwhereas DELETE can. See [HELP TRUNCATE TABLE], and [HELP LOCK].\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/delete.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/delete.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (49,4,'ROUND','Syntax:\nROUND(X), ROUND(X,D)\n\nRounds the argument X to D decimal places. The rounding algorithm\ndepends on the data type of X. D defaults to 0 if not specified. D can\nbe negative to cause D digits left of the decimal point of the value X\nto become zero.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/mathematical-functions.html\n\n','mysql> SELECT ROUND(-1.23);\n -> -1\nmysql> SELECT ROUND(-1.58);\n -> -2\nmysql> SELECT ROUND(1.58);\n -> 2\nmysql> SELECT ROUND(1.298, 1);\n -> 1.3\nmysql> SELECT ROUND(1.298, 0);\n -> 1\nmysql> SELECT ROUND(23.298, -1);\n -> 20\n','http://dev.mysql.com/doc/refman/5.1/en/mathematical-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (50,7,'NULLIF','Syntax:\nNULLIF(expr1,expr2)\n\nReturns NULL if expr1 = expr2 is true, otherwise returns expr1. This is\nthe same as CASE WHEN expr1 = expr2 THEN NULL ELSE expr1 END.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/control-flow-functions.html\n\n','mysql> SELECT NULLIF(1,1);\n -> NULL\nmysql> SELECT NULLIF(1,2);\n -> 1\n','http://dev.mysql.com/doc/refman/5.1/en/control-flow-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (51,22,'CLOSE','Syntax:\nCLOSE cursor_name\n\nThis statement closes a previously opened cursor.\n\nIf not closed explicitly, a cursor is closed at the end of the compound\nstatement in which it was declared.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/close.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/close.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (52,25,'STOP SLAVE','Syntax:\nSTOP SLAVE [thread_type [, thread_type] ... ]\n\nthread_type: IO_THREAD | SQL_THREAD\n\nStops the slave threads. STOP SLAVE requires the SUPER privilege.\n\nLike START SLAVE, this statement may be used with the IO_THREAD and\nSQL_THREAD options to name the thread or threads to be stopped.\n\n*Note*: The transactional behavior of STOP SLAVE changed in MySQL\n5.1.35. Previously, it took effect immediately. Beginning with MySQL\n5.1.35, it waits until any current replication event group affecting\none or more non-transactional tables has finished executing (if there\nis any such replication group), or until the user issues a KILL QUERY\nor KILL CONNECTION statement. (Bug#319\n(http://bugs.mysql.com/bug.php?id=319), Bug#38205\n(http://bugs.mysql.com/bug.php?id=38205))\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/stop-slave.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/stop-slave.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (53,30,'TIMEDIFF','Syntax:\nTIMEDIFF(expr1,expr2)\n\nTIMEDIFF() returns expr1 - expr2 expressed as a time value. expr1 and\nexpr2 are time or date-and-time expressions, but both must be of the\nsame type.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html\n\n','mysql> SELECT TIMEDIFF(\'2000:01:01 00:00:00\',\n -> \'2000:01:01 00:00:00.000001\');\n -> \'-00:00:00.000001\'\nmysql> SELECT TIMEDIFF(\'2008-12-31 23:59:59.000001\',\n -> \'2008-12-30 01:01:01.000002\');\n -> \'46:58:57.999999\'\n','http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (54,35,'REPLACE FUNCTION','Syntax:\nREPLACE(str,from_str,to_str)\n\nReturns the string str with all occurrences of the string from_str\nreplaced by the string to_str. REPLACE() performs a case-sensitive\nmatch when searching for from_str.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/string-functions.html\n\n','mysql> SELECT REPLACE(\'www.mysql.com\', \'w\', \'Ww\');\n -> \'WwWwWw.mysql.com\'\n','http://dev.mysql.com/doc/refman/5.1/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (55,27,'USE','Syntax:\nUSE db_name\n\nThe USE db_name statement tells MySQL to use the db_name database as\nthe default (current) database for subsequent statements. The database\nremains the default until the end of the session or another USE\nstatement is issued:\n\nUSE db1;\nSELECT COUNT(*) FROM mytable; # selects from db1.mytable\nUSE db2;\nSELECT COUNT(*) FROM mytable; # selects from db2.mytable\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/use.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/use.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (56,3,'LINEFROMTEXT','LineFromText(wkt[,srid]), LineStringFromText(wkt[,srid])\n\nConstructs a LINESTRING value using its WKT representation and SRID.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/creating-spatial-values.html#gis-wkt-functions\n\n','','http://dev.mysql.com/doc/refman/5.1/en/creating-spatial-values.html#gis-wkt-functions'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (57,7,'CASE OPERATOR','Syntax:\nCASE value WHEN [compare_value] THEN result [WHEN [compare_value] THEN\nresult ...] [ELSE result] END\n\nCASE WHEN [condition] THEN result [WHEN [condition] THEN result ...]\n[ELSE result] END\n\nThe first version returns the result where value=compare_value. The\nsecond version returns the result for the first condition that is true.\nIf there was no matching result value, the result after ELSE is\nreturned, or NULL if there is no ELSE part.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/control-flow-functions.html\n\n','mysql> SELECT CASE 1 WHEN 1 THEN \'one\'\n -> WHEN 2 THEN \'two\' ELSE \'more\' END;\n -> \'one\'\nmysql> SELECT CASE WHEN 1>0 THEN \'true\' ELSE \'false\' END;\n -> \'true\'\nmysql> SELECT CASE BINARY \'B\'\n -> WHEN \'a\' THEN 1 WHEN \'b\' THEN 2 END;\n -> NULL\n','http://dev.mysql.com/doc/refman/5.1/en/control-flow-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (58,25,'SHOW MASTER STATUS','Syntax:\nSHOW MASTER STATUS\n\nThis statement provides status information about the binary log files\nof the master. It requires either the SUPER or REPLICATION CLIENT\nprivilege.\n\nExample:\n\nmysql> SHOW MASTER STATUS;\n+---------------+----------+--------------+------------------+\n| File | Position | Binlog_Do_DB | Binlog_Ignore_DB |\n+---------------+----------+--------------+------------------+\n| mysql-bin.003 | 73 | test | manual,mysql |\n+---------------+----------+--------------+------------------+\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/show-master-status.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/show-master-status.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (59,30,'ADDTIME','Syntax:\nADDTIME(expr1,expr2)\n\nADDTIME() adds expr2 to expr1 and returns the result. expr1 is a time\nor datetime expression, and expr2 is a time expression.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html\n\n','mysql> SELECT ADDTIME(\'2007-12-31 23:59:59.999999\', \'1 1:1:1.000002\');\n -> \'2008-01-02 01:01:01.000001\'\nmysql> SELECT ADDTIME(\'01:00:00.999999\', \'02:00:00.999998\');\n -> \'03:00:01.999997\'\n','http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (60,32,'SPATIAL','MySQL can create spatial indexes using syntax similar to that for\ncreating regular indexes, but extended with the SPATIAL keyword.\nCurrently, columns in spatial indexes must be declared NOT NULL. The\nfollowing examples demonstrate how to create spatial indexes:\n\no With CREATE TABLE:\n\nCREATE TABLE geom (g GEOMETRY NOT NULL, SPATIAL INDEX(g));\n\no With ALTER TABLE:\n\nALTER TABLE geom ADD SPATIAL INDEX(g);\n\no With CREATE INDEX:\n\nCREATE SPATIAL INDEX sp_index ON geom (g);\n\nFor MyISAM tables, SPATIAL INDEX creates an R-tree index. For storage\nengines that support nonspatial indexing of spatial columns, the engine\ncreates a B-tree index. A B-tree index on spatial values will be useful\nfor exact-value lookups, but not for range scans.\n\nFor more information on indexing spatial columns, see [HELP CREATE\nINDEX].\n\nTo drop spatial indexes, use ALTER TABLE or DROP INDEX:\n\no With ALTER TABLE:\n\nALTER TABLE geom DROP INDEX g;\n\no With DROP INDEX:\n\nDROP INDEX sp_index ON geom;\n\nExample: Suppose that a table geom contains more than 32,000\ngeometries, which are stored in the column g of type GEOMETRY. The\ntable also has an AUTO_INCREMENT column fid for storing object ID\nvalues.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/creating-spatial-indexes.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/creating-spatial-indexes.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (61,30,'TIMESTAMPDIFF','Syntax:\nTIMESTAMPDIFF(unit,datetime_expr1,datetime_expr2)\n\nReturns datetime_expr2 - datetime_expr1, where datetime_expr1 and\ndatetime_expr2 are date or datetime expressions. One expression may be\na date and the other a datetime; a date value is treated as a datetime\nhaving the time part \'00:00:00\' where necessary. The unit for the\nresult (an integer) is given by the unit argument. The legal values for\nunit are the same as those listed in the description of the\nTIMESTAMPADD() function.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html\n\n','mysql> SELECT TIMESTAMPDIFF(MONTH,\'2003-02-01\',\'2003-05-01\');\n -> 3\nmysql> SELECT TIMESTAMPDIFF(YEAR,\'2002-05-01\',\'2001-01-01\');\n -> -1\nmysql> SELECT TIMESTAMPDIFF(MINUTE,\'2003-02-01\',\'2003-05-01 12:05:55\');\n -> 128885\n','http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (62,35,'UPPER','Syntax:\nUPPER(str)\n\nReturns the string str with all characters changed to uppercase\naccording to the current character set mapping. The default is latin1\n(cp1252 West European).\n\nmysql> SELECT UPPER(\'Hej\');\n -> \'HEJ\'\n\nUPPER() is ineffective when applied to binary strings (BINARY,\nVARBINARY, BLOB). The description of LOWER() shows how to perform\nlettercase conversion of binary strings.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/string-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (63,30,'FROM_UNIXTIME','Syntax:\nFROM_UNIXTIME(unix_timestamp), FROM_UNIXTIME(unix_timestamp,format)\n\nReturns a representation of the unix_timestamp argument as a value in\n\'YYYY-MM-DD HH:MM:SS\' or YYYYMMDDHHMMSS.uuuuuu format, depending on\nwhether the function is used in a string or numeric context. The value\nis expressed in the current time zone. unix_timestamp is an internal\ntimestamp value such as is produced by the UNIX_TIMESTAMP() function.\n\nIf format is given, the result is formatted according to the format\nstring, which is used the same way as listed in the entry for the\nDATE_FORMAT() function.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html\n\n','mysql> SELECT FROM_UNIXTIME(1196440219);\n -> \'2007-11-30 10:30:19\'\nmysql> SELECT FROM_UNIXTIME(1196440219) + 0;\n -> 20071130103019.000000\nmysql> SELECT FROM_UNIXTIME(UNIX_TIMESTAMP(),\n -> \'%Y %D %M %h:%i:%s %x\');\n -> \'2007 30th November 10:30:59 2007\'\n','http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (64,20,'MEDIUMBLOB','MEDIUMBLOB\n\nA BLOB column with a maximum length of 16,777,215 (224 - 1) bytes. Each\nMEDIUMBLOB value is stored using a three-byte length prefix that\nindicates the number of bytes in the value.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/string-type-overview.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (65,7,'IFNULL','Syntax:\nIFNULL(expr1,expr2)\n\nIf expr1 is not NULL, IFNULL() returns expr1; otherwise it returns\nexpr2. IFNULL() returns a numeric or string value, depending on the\ncontext in which it is used.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/control-flow-functions.html\n\n','mysql> SELECT IFNULL(1,0);\n -> 1\nmysql> SELECT IFNULL(NULL,10);\n -> 10\nmysql> SELECT IFNULL(1/0,10);\n -> 10\nmysql> SELECT IFNULL(1/0,\'yes\');\n -> \'yes\'\n','http://dev.mysql.com/doc/refman/5.1/en/control-flow-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (66,25,'SHOW FUNCTION CODE','Syntax:\nSHOW FUNCTION CODE func_name\n\nThis statement is similar to SHOW PROCEDURE CODE but for stored\nfunctions. See [HELP SHOW PROCEDURE CODE].\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/show-function-code.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/show-function-code.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (67,25,'SHOW ERRORS','Syntax:\nSHOW ERRORS [LIMIT [offset,] row_count]\nSHOW COUNT(*) ERRORS\n\nThis statement is similar to SHOW WARNINGS, except that instead of\ndisplaying errors, warnings, and notes, it displays only errors.\n\nThe LIMIT clause has the same syntax as for the SELECT statement. See\nhttp://dev.mysql.com/doc/refman/5.1/en/select.html.\n\nThe SHOW COUNT(*) ERRORS statement displays the number of errors. You\ncan also retrieve this number from the error_count variable:\n\nSHOW COUNT(*) ERRORS;\nSELECT @@error_count;\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/show-errors.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/show-errors.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (68,17,'LEAST','Syntax:\nLEAST(value1,value2,...)\n\nWith two or more arguments, returns the smallest (minimum-valued)\nargument. The arguments are compared using the following rules:\n\no If the return value is used in an INTEGER context or all arguments\n are integer-valued, they are compared as integers.\n\no If the return value is used in a REAL context or all arguments are\n real-valued, they are compared as reals.\n\no If any argument is a case-sensitive string, the arguments are\n compared as case-sensitive strings.\n\no In all other cases, the arguments are compared as case-insensitive\n strings.\n\nLEAST() returns NULL if any argument is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/comparison-operators.html\n\n','mysql> SELECT LEAST(2,0);\n -> 0\nmysql> SELECT LEAST(34.0,3.0,5.0,767.0);\n -> 3.0\nmysql> SELECT LEAST(\'B\',\'A\',\'C\');\n -> \'A\'\n','http://dev.mysql.com/doc/refman/5.1/en/comparison-operators.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (69,17,'=','=\n\nEqual:\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/comparison-operators.html\n\n','mysql> SELECT 1 = 0;\n -> 0\nmysql> SELECT \'0\' = 0;\n -> 1\nmysql> SELECT \'0.0\' = 0;\n -> 1\nmysql> SELECT \'0.01\' = 0;\n -> 0\nmysql> SELECT \'.01\' = 0.01;\n -> 1\n','http://dev.mysql.com/doc/refman/5.1/en/comparison-operators.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (70,35,'REVERSE','Syntax:\nREVERSE(str)\n\nReturns the string str with the order of the characters reversed.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/string-functions.html\n\n','mysql> SELECT REVERSE(\'abc\');\n -> \'cba\'\n','http://dev.mysql.com/doc/refman/5.1/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (71,17,'ISNULL','Syntax:\nISNULL(expr)\n\nIf expr is NULL, ISNULL() returns 1, otherwise it returns 0.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/comparison-operators.html\n\n','mysql> SELECT ISNULL(1+1);\n -> 0\nmysql> SELECT ISNULL(1/0);\n -> 1\n','http://dev.mysql.com/doc/refman/5.1/en/comparison-operators.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (72,20,'BINARY','BINARY(M)\n\nThe BINARY type is similar to the CHAR type, but stores binary byte\nstrings rather than nonbinary character strings. M represents the\ncolumn length in bytes.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/string-type-overview.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (73,20,'BLOB DATA TYPE','A BLOB is a binary large object that can hold a variable amount of\ndata. The four BLOB types are TINYBLOB, BLOB, MEDIUMBLOB, and LONGBLOB.\nThese differ only in the maximum length of the values they can hold.\nThe four TEXT types are TINYTEXT, TEXT, MEDIUMTEXT, and LONGTEXT. These\ncorrespond to the four BLOB types and have the same maximum lengths and\nstorage requirements. See\nhttp://dev.mysql.com/doc/refman/5.1/en/storage-requirements.html.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/blob.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/blob.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (74,34,'BOUNDARY','Boundary(g)\n\nReturns a geometry that is the closure of the combinatorial boundary of\nthe geometry value g.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/geometry-property-functions.html#general-geometry-property-functions\n\n','','http://dev.mysql.com/doc/refman/5.1/en/geometry-property-functions.html#general-geometry-property-functions'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (75,9,'CREATE USER','Syntax:\nCREATE USER user [IDENTIFIED BY [PASSWORD] \'password\']\n [, user [IDENTIFIED BY [PASSWORD] \'password\']] ...\n\nThe CREATE USER statement creates new MySQL accounts. To use it, you\nmust have the global CREATE USER privilege or the INSERT privilege for\nthe mysql database. For each account, CREATE USER creates a new row in\nthe mysql.user table that has no privileges. An error occurs if the\naccount already exists. Each account is named using the same format as\nfor the GRANT statement; for example, \'jeffrey\'@\'localhost\'. If you\nspecify only the user name part of the account name, a host name part\nof \'%\' is used. For additional information about specifying account\nnames, see [HELP GRANT].\n\nThe account can be given a password with the optional IDENTIFIED BY\nclause. The user value and the password are given the same way as for\nthe GRANT statement. In particular, to specify the password in plain\ntext, omit the PASSWORD keyword. To specify the password as the hashed\nvalue as returned by the PASSWORD() function, include the PASSWORD\nkeyword. See [HELP GRANT].\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/create-user.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/create-user.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (76,23,'POINT','Point(x,y)\n\nConstructs a Point using its coordinates.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/creating-spatial-values.html#gis-mysql-specific-functions\n\n','','http://dev.mysql.com/doc/refman/5.1/en/creating-spatial-values.html#gis-mysql-specific-functions'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (77,15,'CURRENT_USER','Syntax:\nCURRENT_USER, CURRENT_USER()\n\nReturns the user name and host name combination for the MySQL account\nthat the server used to authenticate the current client. This account\ndetermines your access privileges. The return value is a string in the\nutf8 character set.\n\nThe value of CURRENT_USER() can differ from the value of USER().\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/information-functions.html\n\n','mysql> SELECT USER();\n -> \'davida@localhost\'\nmysql> SELECT * FROM mysql.user;\nERROR 1044: Access denied for user \'\'@\'localhost\' to\ndatabase \'mysql\'\nmysql> SELECT CURRENT_USER();\n -> \'@localhost\'\n','http://dev.mysql.com/doc/refman/5.1/en/information-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (78,35,'LCASE','Syntax:\nLCASE(str)\n\nLCASE() is a synonym for LOWER().\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/string-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (79,17,'<=','Syntax:\n<=\n\nLess than or equal:\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/comparison-operators.html\n\n','mysql> SELECT 0.1 <= 2;\n -> 1\n','http://dev.mysql.com/doc/refman/5.1/en/comparison-operators.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (80,25,'SHOW PROFILES','Syntax:\nSHOW PROFILE [type [, type] ... ]\n [FOR QUERY n]\n [LIMIT row_count [OFFSET offset]]\n\ntype:\n ALL\n | BLOCK IO\n | CONTEXT SWITCHES\n | CPU\n | IPC\n | MEMORY\n | PAGE FAULTS\n | SOURCE\n | SWAPS\n\nThe SHOW PROFILES and SHOW PROFILE statements display profiling\ninformation that indicates resource usage for statements executed\nduring the course of the current session.\n\nProfiling is controlled by the profiling session variable, which has a\ndefault value of 0 (OFF). Profiling is enabled by setting profiling to\n1 or ON:\n\nmysql> SET profiling = 1;\n\nSHOW PROFILES displays a list of the most recent statements sent to the\nmaster. The size of the list is controlled by the\nprofiling_history_size session variable, which has a default value of\n15. The maximum value is 100. Setting the value to 0 has the practical\neffect of disabling profiling.\n\nAll statements are profiled except SHOW PROFILES and SHOW PROFILE, so\nyou will find neither of those statements in the profile list.\nMalformed statements are profiled. For example, SHOW PROFILING is an\nillegal statement, and a syntax error occurs if you try to execute it,\nbut it will show up in the profiling list.\n\nSHOW PROFILE displays detailed information about a single statement.\nWithout the FOR QUERY n clause, the output pertains to the most\nrecently executed statement. If FOR QUERY n is included, SHOW PROFILE\ndisplays information for statement n. The values of n correspond to the\nQuery_ID values displayed by SHOW PROFILES.\n\nThe LIMIT row_count clause may be given to limit the output to\nrow_count rows. If LIMIT is given, OFFSET offset may be added to begin\nthe output offset rows into the full set of rows.\n\nBy default, SHOW PROFILE displays Status and Duration columns. The\nStatus values are like the State values displayed by SHOW PROCESSLIST,\nalthought there might be some minor differences in interpretion for the\ntwo statements for some status values (see\nhttp://dev.mysql.com/doc/refman/5.1/en/thread-information.html).\n\nOptional type values may be specified to display specific additional\ntypes of information:\n\no ALL displays all information\n\no BLOCK IO displays counts for block input and output operations\n\no CONTEXT SWITCHES displays counts for voluntary and involuntary\n context switches\n\no CPU displays user and system CPU usage times\n\no IPC displays counts for messages sent and received\n\no MEMORY is not currently implemented\n\no PAGE FAULTS displays counts for major and minor page faults\n\no SOURCE displays the names of functions from the source code, together\n with the name and line number of the file in which the function\n occurs\n\no SWAPS displays swap counts\n\nProfiling is enabled per session. When a session ends, its profiling\ninformation is lost.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/show-profiles.html\n\n','mysql> SELECT @@profiling;\n+-------------+\n| @@profiling |\n+-------------+\n| 0 |\n+-------------+\n1 row in set (0.00 sec)\n\nmysql> SET profiling = 1;\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> DROP TABLE IF EXISTS t1;\nQuery OK, 0 rows affected, 1 warning (0.00 sec)\n\nmysql> CREATE TABLE T1 (id INT);\nQuery OK, 0 rows affected (0.01 sec)\n\nmysql> SHOW PROFILES;\n+----------+----------+--------------------------+\n| Query_ID | Duration | Query |\n+----------+----------+--------------------------+\n| 0 | 0.000088 | SET PROFILING = 1 |\n| 1 | 0.000136 | DROP TABLE IF EXISTS t1 |\n| 2 | 0.011947 | CREATE TABLE t1 (id INT) |\n+----------+----------+--------------------------+\n3 rows in set (0.00 sec)\n\nmysql> SHOW PROFILE;\n+----------------------+----------+\n| Status | Duration |\n+----------------------+----------+\n| checking permissions | 0.000040 |\n| creating table | 0.000056 |\n| After create | 0.011363 |\n| query end | 0.000375 |\n| freeing items | 0.000089 |\n| logging slow query | 0.000019 |\n| cleaning up | 0.000005 |\n+----------------------+----------+\n7 rows in set (0.00 sec)\n\nmysql> SHOW PROFILE FOR QUERY 1;\n+--------------------+----------+\n| Status | Duration |\n+--------------------+----------+\n| query end | 0.000107 |\n| freeing items | 0.000008 |\n| logging slow query | 0.000015 |\n| cleaning up | 0.000006 |\n+--------------------+----------+\n4 rows in set (0.00 sec)\n\nmysql> SHOW PROFILE CPU FOR QUERY 2;\n+----------------------+----------+----------+------------+\n| Status | Duration | CPU_user | CPU_system |\n+----------------------+----------+----------+------------+\n| checking permissions | 0.000040 | 0.000038 | 0.000002 |\n| creating table | 0.000056 | 0.000028 | 0.000028 |\n| After create | 0.011363 | 0.000217 | 0.001571 |\n| query end | 0.000375 | 0.000013 | 0.000028 |\n| freeing items | 0.000089 | 0.000010 | 0.000014 |\n| logging slow query | 0.000019 | 0.000009 | 0.000010 |\n| cleaning up | 0.000005 | 0.000003 | 0.000002 |\n+----------------------+----------+----------+------------+\n7 rows in set (0.00 sec)\n','http://dev.mysql.com/doc/refman/5.1/en/show-profiles.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (81,26,'UPDATE','Syntax:\nSingle-table syntax:\n\nUPDATE [LOW_PRIORITY] [IGNORE] table_reference\n SET col_name1={expr1|DEFAULT} [, col_name2={expr2|DEFAULT}] ...\n [WHERE where_condition]\n [ORDER BY ...]\n [LIMIT row_count]\n\nMultiple-table syntax:\n\nUPDATE [LOW_PRIORITY] [IGNORE] table_references\n SET col_name1={expr1|DEFAULT} [, col_name2={expr2|DEFAULT}] ...\n [WHERE where_condition]\n\nFor the single-table syntax, the UPDATE statement updates columns of\nexisting rows in the named table with new values. The SET clause\nindicates which columns to modify and the values they should be given.\nEach value can be given as an expression, or the keyword DEFAULT to set\na column explicitly to its default value. The WHERE clause, if given,\nspecifies the conditions that identify which rows to update. With no\nWHERE clause, all rows are updated. If the ORDER BY clause is\nspecified, the rows are updated in the order that is specified. The\nLIMIT clause places a limit on the number of rows that can be updated.\n\nFor the multiple-table syntax, UPDATE updates rows in each table named\nin table_references that satisfy the conditions. In this case, ORDER BY\nand LIMIT cannot be used.\n\nwhere_condition is an expression that evaluates to true for each row to\nbe updated.\n\ntable_references and where_condition are is specified as described in\nhttp://dev.mysql.com/doc/refman/5.1/en/select.html.\n\nYou need the UPDATE privilege only for columns referenced in an UPDATE\nthat are actually updated. You need only the SELECT privilege for any\ncolumns that are read but not modified.\n\nThe UPDATE statement supports the following modifiers:\n\no If you use the LOW_PRIORITY keyword, execution of the UPDATE is\n delayed until no other clients are reading from the table. This\n affects only storage engines that use only table-level locking (such\n as MyISAM, MEMORY, and MERGE).\n\no If you use the IGNORE keyword, the update statement does not abort\n even if errors occur during the update. Rows for which duplicate-key\n conflicts occur are not updated. Rows for which columns are updated\n to values that would cause data conversion errors are updated to the\n closest valid values instead.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/update.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/update.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (82,17,'IS NOT NULL','Syntax:\nIS NOT NULL\n\nTests whether a value is not NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/comparison-operators.html\n\n','mysql> SELECT 1 IS NOT NULL, 0 IS NOT NULL, NULL IS NOT NULL;\n -> 1, 1, 0\n','http://dev.mysql.com/doc/refman/5.1/en/comparison-operators.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (83,22,'CASE STATEMENT','Syntax:\nCASE case_value\n WHEN when_value THEN statement_list\n [WHEN when_value THEN statement_list] ...\n [ELSE statement_list]\nEND CASE\n\nOr:\n\nCASE\n WHEN search_condition THEN statement_list\n [WHEN search_condition THEN statement_list] ...\n [ELSE statement_list]\nEND CASE\n\nThe CASE statement for stored programs implements a complex conditional\nconstruct. If a search_condition evaluates to true, the corresponding\nSQL statement list is executed. If no search condition matches, the\nstatement list in the ELSE clause is executed. Each statement_list\nconsists of one or more statements.\n\nIf no when_value or search_condition matches the value tested and the\nCASE statement contains no ELSE clause, a Case not found for CASE\nstatement error results.\n\nEach statement_list consists of one or more statements; an empty\nstatement_list is not allowed. To handle situations where no value is\nmatched by any WHEN clause, use an ELSE containing an empty BEGIN ...\nEND block, as shown in this example: DELIMITER | CREATE PROCEDURE p()\nBEGIN DECLARE v INT DEFAULT 1; CASE v WHEN 2 THEN SELECT v; WHEN 3 THEN\nSELECT 0; ELSE BEGIN END; END CASE; END; | (The indentation used here\nin the ELSE clause is for purposes of clarity only, and is not\notherwise significant.)\n\n*Note*: The syntax of the CASE statement used inside stored programs\ndiffers slightly from that of the SQL CASE expression described in\nhttp://dev.mysql.com/doc/refman/5.1/en/control-flow-functions.html. The\nCASE statement cannot have an ELSE NULL clause, and it is terminated\nwith END CASE instead of END.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/case-statement.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/case-statement.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (84,25,'EXECUTE STATEMENT','Syntax:\nEXECUTE stmt_name\n [USING @var_name [, @var_name] ...]\n\nAfter preparing a statement with PREPARE, you execute it with an\nEXECUTE statement that refers to the prepared statement name. If the\nprepared statement contains any parameter markers, you must supply a\nUSING clause that lists user variables containing the values to be\nbound to the parameters. Parameter values can be supplied only by user\nvariables, and the USING clause must name exactly as many variables as\nthe number of parameter markers in the statement.\n\nYou can execute a given prepared statement multiple times, passing\ndifferent variables to it or setting the variables to different values\nbefore each execution.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/execute.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/execute.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (85,37,'DROP INDEX','Syntax:\nDROP [ONLINE|OFFLINE] INDEX index_name ON tbl_name\n\nDROP INDEX drops the index named index_name from the table tbl_name.\nThis statement is mapped to an ALTER TABLE statement to drop the index.\nSee [HELP ALTER TABLE].\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/drop-index.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/drop-index.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (86,35,'MATCH AGAINST','Syntax:\nMATCH (col1,col2,...) AGAINST (expr [search_modifier])\n\nMySQL has support for full-text indexing and searching:\n\no A full-text index in MySQL is an index of type FULLTEXT.\n\no Full-text indexes can be used only with MyISAM tables, and can be\n created only for CHAR, VARCHAR, or TEXT columns.\n\no A FULLTEXT index definition can be given in the CREATE TABLE\n statement when a table is created, or added later using ALTER TABLE\n or CREATE INDEX.\n\no For large data sets, it is much faster to load your data into a table\n that has no FULLTEXT index and then create the index after that, than\n to load data into a table that has an existing FULLTEXT index.\n\nFull-text searching is performed using MATCH() ... AGAINST syntax.\nMATCH() takes a comma-separated list that names the columns to be\nsearched. AGAINST takes a string to search for, and an optional\nmodifier that indicates what type of search to perform. The search\nstring must be a literal string, not a variable or a column name. There\nare three types of full-text searches:\n\no A boolean search interprets the search string using the rules of a\n special query language. The string contains the words to search for.\n It can also contain operators that specify requirements such that a\n word must be present or absent in matching rows, or that it should be\n weighted higher or lower than usual. Common words such as "some" or\n "then" are stopwords and do not match if present in the search\n string. The IN BOOLEAN MODE modifier specifies a boolean search. For\n more information, see\n http://dev.mysql.com/doc/refman/5.1/en/fulltext-boolean.html.\n\no A natural language search interprets the search string as a phrase in\n natural human language (a phrase in free text). There are no special\n operators. The stopword list applies. In addition, words that are\n present in 50% or more of the rows are considered common and do not\n match. Full-text searches are natural language searches if the IN\n NATURAL LANGUAGE MODE modifier is given or if no modifier is given.\n\no A query expansion search is a modification of a natural language\n search. The search string is used to perform a natural language\n search. Then words from the most relevant rows returned by the search\n are added to the search string and the search is done again. The\n query returns the rows from the second search. The IN NATURAL\n LANGUAGE MODE WITH QUERY EXPANSION or WITH QUERY EXPANSION modifier\n specifies a query expansion search. For more information, see\n http://dev.mysql.com/doc/refman/5.1/en/fulltext-query-expansion.html.\n\nThe IN NATURAL LANGUAGE MODE and IN NATURAL LANGUAGE MODE WITH QUERY\nEXPANSION modifiers were added in MySQL 5.1.7.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/fulltext-search.html\n\n','mysql> SELECT id, body, MATCH (title,body) AGAINST\n -> (\'Security implications of running MySQL as root\'\n -> IN NATURAL LANGUAGE MODE) AS score\n -> FROM articles WHERE MATCH (title,body) AGAINST\n -> (\'Security implications of running MySQL as root\'\n -> IN NATURAL LANGUAGE MODE);\n+----+-------------------------------------+-----------------+\n| id | body | score |\n+----+-------------------------------------+-----------------+\n| 4 | 1. Never run mysqld as root. 2. ... | 1.5219271183014 |\n| 6 | When configured properly, MySQL ... | 1.3114095926285 |\n+----+-------------------------------------+-----------------+\n2 rows in set (0.00 sec)\n','http://dev.mysql.com/doc/refman/5.1/en/fulltext-search.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (87,37,'CREATE EVENT','Syntax:\nCREATE\n [DEFINER = { user | CURRENT_USER }]\n EVENT\n [IF NOT EXISTS]\n event_name\n ON SCHEDULE schedule\n [ON COMPLETION [NOT] PRESERVE]\n [ENABLE | DISABLE | DISABLE ON SLAVE]\n [COMMENT \'comment\']\n DO sql_statement;\n\nschedule:\n AT timestamp [+ INTERVAL interval] ...\n | EVERY interval\n [STARTS timestamp [+ INTERVAL interval] ...]\n [ENDS timestamp [+ INTERVAL interval] ...]\n\ninterval:\n quantity {YEAR | QUARTER | MONTH | DAY | HOUR | MINUTE |\n WEEK | SECOND | YEAR_MONTH | DAY_HOUR | DAY_MINUTE |\n DAY_SECOND | HOUR_MINUTE | HOUR_SECOND | MINUTE_SECOND}\n\nThis statement creates and schedules a new event. It requires the EVENT\nprivilege for the schema in which the event is to be created (and\nperhaps SUPER depending on the DEFINER value, as described later). The\nevent will not run unless the Event Scheduler is enabled. For\ninformation about checking Event Scheduler status and enabling it if\nnecessary, see\nhttp://dev.mysql.com/doc/refman/5.1/en/events-configuration.html.\n\nThe minimum requirements for a valid CREATE EVENT statement are as\nfollows:\n\no The keywords CREATE EVENT plus an event name, which uniquely\n identifies the event within a database schema. (Prior to MySQL\n 5.1.12, the event name needed to be unique only among events created\n by the same user within a schema.)\n\no An ON SCHEDULE clause, which determines when and how often the event\n executes.\n\no A DO clause, which contains the SQL statement to be executed by an\n event.\n\nThis is an example of a minimal CREATE EVENT statement:\n\nCREATE EVENT myevent\n ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR\n DO\n UPDATE myschema.mytable SET mycol = mycol + 1;\n\nThe previous statement creates an event named myevent. This event\nexecutes once --- one hour following its creation --- by running an SQL\nstatement that increments the value of the myschema.mytable table\'s\nmycol column by 1.\n\nThe event_name must be a valid MySQL identifier with a maximum length\nof 64 characters. Event names are not case sensitive, so you cannot\nhave two events named myevent and MyEvent in the same schema. In\ngeneral, the rules governing event names are the same as those for\nnames of stored routines. See\nhttp://dev.mysql.com/doc/refman/5.1/en/identifiers.html.\n\nAn event is associated with a schema. If no schema is indicated as part\nof event_name, the default (current) schema is assumed. To create an\nevent in a specific schema, qualify the event name with a schema using\nschema_name.event_name syntax.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/create-event.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/create-event.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (88,4,'ABS','Syntax:\nABS(X)\n\nReturns the absolute value of X.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/mathematical-functions.html\n\n','mysql> SELECT ABS(2);\n -> 2\nmysql> SELECT ABS(-32);\n -> 32\n','http://dev.mysql.com/doc/refman/5.1/en/mathematical-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (89,31,'POLYFROMWKB','PolyFromWKB(wkb[,srid]), PolygonFromWKB(wkb[,srid])\n\nConstructs a POLYGON value using its WKB representation and SRID.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/creating-spatial-values.html#gis-wkb-functions\n\n','','http://dev.mysql.com/doc/refman/5.1/en/creating-spatial-values.html#gis-wkb-functions'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (90,35,'NOT LIKE','Syntax:\nexpr NOT LIKE pat [ESCAPE \'escape_char\']\n\nThis is the same as NOT (expr LIKE pat [ESCAPE \'escape_char\']).\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/string-comparison-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/string-comparison-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (91,35,'SPACE','Syntax:\nSPACE(N)\n\nReturns a string consisting of N space characters.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/string-functions.html\n\n','mysql> SELECT SPACE(6);\n -> \' \'\n','http://dev.mysql.com/doc/refman/5.1/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (92,6,'MBR DEFINITION','Its MBR (Minimum Bounding Rectangle), or Envelope. This is the bounding\ngeometry, formed by the minimum and maximum (X,Y) coordinates:\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/gis-class-geometry.html\n\n','((MINX MINY, MAXX MINY, MAXX MAXY, MINX MAXY, MINX MINY))\n','http://dev.mysql.com/doc/refman/5.1/en/gis-class-geometry.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (93,23,'GEOMETRYCOLLECTION','GeometryCollection(g1,g2,...)\n\nConstructs a GeometryCollection.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/creating-spatial-values.html#gis-mysql-specific-functions\n\n','','http://dev.mysql.com/doc/refman/5.1/en/creating-spatial-values.html#gis-mysql-specific-functions'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (94,16,'MAX','Syntax:\nMAX([DISTINCT] expr)\n\nReturns the maximum value of expr. MAX() may take a string argument; in\nsuch cases, it returns the maximum string value. See\nhttp://dev.mysql.com/doc/refman/5.1/en/mysql-indexes.html. The DISTINCT\nkeyword can be used to find the maximum of the distinct values of expr,\nhowever, this produces the same result as omitting DISTINCT.\n\nMAX() returns NULL if there were no matching rows.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/group-by-functions.html\n\n','mysql> SELECT student_name, MIN(test_score), MAX(test_score)\n -> FROM student\n -> GROUP BY student_name;\n','http://dev.mysql.com/doc/refman/5.1/en/group-by-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (95,21,'CREATE FUNCTION UDF','Syntax:\nCREATE [AGGREGATE] FUNCTION function_name RETURNS {STRING|INTEGER|REAL|DECIMAL}\n SONAME shared_library_name\n\nA user-defined function (UDF) is a way to extend MySQL with a new\nfunction that works like a native (built-in) MySQL function such as\nABS() or CONCAT().\n\nfunction_name is the name that should be used in SQL statements to\ninvoke the function. The RETURNS clause indicates the type of the\nfunction\'s return value. DECIMAL is a legal value after RETURNS, but\ncurrently DECIMAL functions return string values and should be written\nlike STRING functions.\n\nshared_library_name is the basename of the shared object file that\ncontains the code that implements the function. The file must be\nlocated in the plugin directory. This directory is given by the value\nof the plugin_dir system variable.\n\n*Note*: This is a change in MySQL 5.1. For earlier versions of MySQL,\nthe shared object can be located in any directory that is searched by\nyour system\'s dynamic linker.\n\nTo create a function, you must have the INSERT privilege for the mysql\ndatabase. This is necessary because CREATE FUNCTION adds a row to the\nmysql.func system table that records the function\'s name, type, and\nshared library name. If you do not have this table, you should run the\nmysql_upgrade command to create it. See\nhttp://dev.mysql.com/doc/refman/5.1/en/mysql-upgrade.html.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/create-function-udf.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/create-function-udf.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (96,4,'*','Syntax:\n*\n\nMultiplication:\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/arithmetic-functions.html\n\n','mysql> SELECT 3*5;\n -> 15\nmysql> SELECT 18014398509481984*18014398509481984.0;\n -> 324518553658426726783156020576256.0\nmysql> SELECT 18014398509481984*18014398509481984;\n -> 0\n','http://dev.mysql.com/doc/refman/5.1/en/arithmetic-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (97,20,'TIMESTAMP','TIMESTAMP\n\nA timestamp. The range is \'1970-01-01 00:00:01\' UTC to \'2038-01-19\n03:14:07\' UTC. TIMESTAMP values are stored as the number of seconds\nsince the epoch (\'1970-01-01 00:00:00\' UTC). A TIMESTAMP cannot\nrepresent the value \'1970-01-01 00:00:00\' because that is equivalent to\n0 seconds from the epoch and the value 0 is reserved for representing\n\'0000-00-00 00:00:00\', the "zero" TIMESTAMP value.\n\nA TIMESTAMP column is useful for recording the date and time of an\nINSERT or UPDATE operation. By default, the first TIMESTAMP column in a\ntable is automatically set to the date and time of the most recent\noperation if you do not assign it a value yourself. You can also set\nany TIMESTAMP column to the current date and time by assigning it a\nNULL value. Variations on automatic initialization and update\nproperties are described in\nhttp://dev.mysql.com/doc/refman/5.1/en/timestamp.html.\n\nA TIMESTAMP value is returned as a string in the format \'YYYY-MM-DD\nHH:MM:SS\' with a display width fixed at 19 characters. To obtain the\nvalue as a number, you should add +0 to the timestamp column.\n\n*Note*: The TIMESTAMP format that was used prior to MySQL 4.1 is not\nsupported in MySQL 5.1; see MySQL 3.23, 4.0, 4.1 Reference Manual for\ninformation regarding the old format.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/date-and-time-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/date-and-time-type-overview.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (98,11,'DES_DECRYPT','Syntax:\nDES_DECRYPT(crypt_str[,key_str])\n\nDecrypts a string encrypted with DES_ENCRYPT(). If an error occurs,\nthis function returns NULL.\n\nThis function works only if MySQL has been configured with SSL support.\nSee http://dev.mysql.com/doc/refman/5.1/en/secure-connections.html.\n\nIf no key_str argument is given, DES_DECRYPT() examines the first byte\nof the encrypted string to determine the DES key number that was used\nto encrypt the original string, and then reads the key from the DES key\nfile to decrypt the message. For this to work, the user must have the\nSUPER privilege. The key file can be specified with the --des-key-file\nserver option.\n\nIf you pass this function a key_str argument, that string is used as\nthe key for decrypting the message.\n\nIf the crypt_str argument does not appear to be an encrypted string,\nMySQL returns the given crypt_str.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/encryption-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/encryption-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (99,25,'CACHE INDEX','Syntax:\nCACHE INDEX\n tbl_index_list [, tbl_index_list] ...\n IN key_cache_name\n\ntbl_index_list:\n tbl_name [[INDEX|KEY] (index_name[, index_name] ...)]\n\nThe CACHE INDEX statement assigns table indexes to a specific key\ncache. It is used only for MyISAM tables.\n\nThe following statement assigns indexes from the tables t1, t2, and t3\nto the key cache named hot_cache:\n\nmysql> CACHE INDEX t1, t2, t3 IN hot_cache;\n+---------+--------------------+----------+----------+\n| Table | Op | Msg_type | Msg_text |\n+---------+--------------------+----------+----------+\n| test.t1 | assign_to_keycache | status | OK |\n| test.t2 | assign_to_keycache | status | OK |\n| test.t3 | assign_to_keycache | status | OK |\n+---------+--------------------+----------+----------+\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/cache-index.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/cache-index.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (100,12,'ENDPOINT','EndPoint(ls)\n\nReturns the Point that is the endpoint of the LineString value ls.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/geometry-property-functions.html#linestring-property-functions\n\n','mysql> SET @ls = \'LineString(1 1,2 2,3 3)\';\nmysql> SELECT AsText(EndPoint(GeomFromText(@ls)));\n+-------------------------------------+\n| AsText(EndPoint(GeomFromText(@ls))) |\n+-------------------------------------+\n| POINT(3 3) |\n+-------------------------------------+\n','http://dev.mysql.com/doc/refman/5.1/en/geometry-property-functions.html#linestring-property-functions'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (101,11,'COMPRESS','Syntax:\nCOMPRESS(string_to_compress)\n\nCompresses a string and returns the result as a binary string. This\nfunction requires MySQL to have been compiled with a compression\nlibrary such as zlib. Otherwise, the return value is always NULL. The\ncompressed string can be uncompressed with UNCOMPRESS().\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/encryption-functions.html\n\n','mysql> SELECT LENGTH(COMPRESS(REPEAT(\'a\',1000)));\n -> 21\nmysql> SELECT LENGTH(COMPRESS(\'\'));\n -> 0\nmysql> SELECT LENGTH(COMPRESS(\'a\'));\n -> 13\nmysql> SELECT LENGTH(COMPRESS(REPEAT(\'a\',16)));\n -> 15\n','http://dev.mysql.com/doc/refman/5.1/en/encryption-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (102,26,'INSERT','Syntax:\nINSERT [LOW_PRIORITY | DELAYED | HIGH_PRIORITY] [IGNORE]\n [INTO] tbl_name [(col_name,...)]\n {VALUES | VALUE} ({expr | DEFAULT},...),(...),...\n [ ON DUPLICATE KEY UPDATE\n col_name=expr\n [, col_name=expr] ... ]\n\nOr:\n\nINSERT [LOW_PRIORITY | DELAYED | HIGH_PRIORITY] [IGNORE]\n [INTO] tbl_name\n SET col_name={expr | DEFAULT}, ...\n [ ON DUPLICATE KEY UPDATE\n col_name=expr\n [, col_name=expr] ... ]\n\nOr:\n\nINSERT [LOW_PRIORITY | HIGH_PRIORITY] [IGNORE]\n [INTO] tbl_name [(col_name,...)]\n SELECT ...\n [ ON DUPLICATE KEY UPDATE\n col_name=expr\n [, col_name=expr] ... ]\n\nINSERT inserts new rows into an existing table. The INSERT ... VALUES\nand INSERT ... SET forms of the statement insert rows based on\nexplicitly specified values. The INSERT ... SELECT form inserts rows\nselected from another table or tables. INSERT ... SELECT is discussed\nfurther in [HELP INSERT SELECT].\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/insert.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/insert.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (103,16,'COUNT','Syntax:\nCOUNT(expr)\n\nReturns a count of the number of non-NULL values of expr in the rows\nretrieved by a SELECT statement. The result is a BIGINT value.\n\nCOUNT() returns 0 if there were no matching rows.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/group-by-functions.html\n\n','mysql> SELECT student.student_name,COUNT(*)\n -> FROM student,course\n -> WHERE student.student_id=course.student_id\n -> GROUP BY student_name;\n','http://dev.mysql.com/doc/refman/5.1/en/group-by-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (104,26,'HANDLER','Syntax:\nHANDLER tbl_name OPEN [ [AS] alias]\n\nHANDLER tbl_name READ index_name { = | <= | >= | < | > } (value1,value2,...)\n [ WHERE where_condition ] [LIMIT ... ]\nHANDLER tbl_name READ index_name { FIRST | NEXT | PREV | LAST }\n [ WHERE where_condition ] [LIMIT ... ]\nHANDLER tbl_name READ { FIRST | NEXT }\n [ WHERE where_condition ] [LIMIT ... ]\n\nHANDLER tbl_name CLOSE\n\nThe HANDLER statement provides direct access to table storage engine\ninterfaces. It is available for MyISAM and InnoDB tables.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/handler.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/handler.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (105,3,'MLINEFROMTEXT','MLineFromText(wkt[,srid]), MultiLineStringFromText(wkt[,srid])\n\nConstructs a MULTILINESTRING value using its WKT representation and\nSRID.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/creating-spatial-values.html#gis-wkt-functions\n\n','','http://dev.mysql.com/doc/refman/5.1/en/creating-spatial-values.html#gis-wkt-functions'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (106,31,'GEOMCOLLFROMWKB','GeomCollFromWKB(wkb[,srid]), GeometryCollectionFromWKB(wkb[,srid])\n\nConstructs a GEOMETRYCOLLECTION value using its WKB representation and\nSRID.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/creating-spatial-values.html#gis-wkb-functions\n\n','','http://dev.mysql.com/doc/refman/5.1/en/creating-spatial-values.html#gis-wkb-functions'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (107,37,'RENAME TABLE','Syntax:\nRENAME TABLE tbl_name TO new_tbl_name\n [, tbl_name2 TO new_tbl_name2] ...\n\nThis statement renames one or more tables.\n\nThe rename operation is done atomically, which means that no other\nsession can access any of the tables while the rename is running. For\nexample, if you have an existing table old_table, you can create\nanother table new_table that has the same structure but is empty, and\nthen replace the existing table with the empty one as follows (assuming\nthat backup_table does not already exist):\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/rename-table.html\n\n','CREATE TABLE new_table (...);\nRENAME TABLE old_table TO backup_table, new_table TO old_table;\n','http://dev.mysql.com/doc/refman/5.1/en/rename-table.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (108,20,'BOOLEAN','BOOL, BOOLEAN\n\nThese types are synonyms for TINYINT(1). A value of zero is considered\nfalse. Nonzero values are considered true:\n\nmysql> SELECT IF(0, \'true\', \'false\');\n+------------------------+\n| IF(0, \'true\', \'false\') |\n+------------------------+\n| false |\n+------------------------+\n\nmysql> SELECT IF(1, \'true\', \'false\');\n+------------------------+\n| IF(1, \'true\', \'false\') |\n+------------------------+\n| true |\n+------------------------+\n\nmysql> SELECT IF(2, \'true\', \'false\');\n+------------------------+\n| IF(2, \'true\', \'false\') |\n+------------------------+\n| true |\n+------------------------+\n\nHowever, the values TRUE and FALSE are merely aliases for 1 and 0,\nrespectively, as shown here:\n\nmysql> SELECT IF(0 = FALSE, \'true\', \'false\');\n+--------------------------------+\n| IF(0 = FALSE, \'true\', \'false\') |\n+--------------------------------+\n| true |\n+--------------------------------+\n\nmysql> SELECT IF(1 = TRUE, \'true\', \'false\');\n+-------------------------------+\n| IF(1 = TRUE, \'true\', \'false\') |\n+-------------------------------+\n| true |\n+-------------------------------+\n\nmysql> SELECT IF(2 = TRUE, \'true\', \'false\');\n+-------------------------------+\n| IF(2 = TRUE, \'true\', \'false\') |\n+-------------------------------+\n| false |\n+-------------------------------+\n\nmysql> SELECT IF(2 = FALSE, \'true\', \'false\');\n+--------------------------------+\n| IF(2 = FALSE, \'true\', \'false\') |\n+--------------------------------+\n| false |\n+--------------------------------+\n\nThe last two statements display the results shown because 2 is equal to\nneither 1 nor 0.\n\nWe intend to implement full boolean type handling, in accordance with\nstandard SQL, in a future MySQL release.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/numeric-type-overview.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (109,14,'DEFAULT','Syntax:\nDEFAULT(col_name)\n\nReturns the default value for a table column. An error results if the\ncolumn has no default value.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/miscellaneous-functions.html\n\n','mysql> UPDATE t SET i = DEFAULT(i)+1 WHERE id < 100;\n','http://dev.mysql.com/doc/refman/5.1/en/miscellaneous-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (110,4,'MOD','Syntax:\nMOD(N,M), N % M, N MOD M\n\nModulo operation. Returns the remainder of N divided by M.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/mathematical-functions.html\n\n','mysql> SELECT MOD(234, 10);\n -> 4\nmysql> SELECT 253 % 7;\n -> 1\nmysql> SELECT MOD(29,9);\n -> 2\nmysql> SELECT 29 MOD 9;\n -> 2\n','http://dev.mysql.com/doc/refman/5.1/en/mathematical-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (111,20,'TINYTEXT','TINYTEXT [CHARACTER SET charset_name] [COLLATE collation_name]\n\nA TEXT column with a maximum length of 255 (28 - 1) characters. The\neffective maximum length is less if the value contains multi-byte\ncharacters. Each TINYTEXT value is stored using a one-byte length\nprefix that indicates the number of bytes in the value.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/string-type-overview.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (112,19,'OPTIMIZE TABLE','Syntax:\nOPTIMIZE [NO_WRITE_TO_BINLOG | LOCAL] TABLE\n tbl_name [, tbl_name] ...\n\nOPTIMIZE TABLE should be used if you have deleted a large part of a\ntable or if you have made many changes to a table with variable-length\nrows (tables that have VARCHAR, VARBINARY, BLOB, or TEXT columns).\nDeleted rows are maintained in a linked list and subsequent INSERT\noperations reuse old row positions. You can use OPTIMIZE TABLE to\nreclaim the unused space and to defragment the data file.\n\nThis statement requires SELECT and INSERT privileges for the table.\n\nBeginning with MySQL 5.1.27, OPTIMIZE TABLE is also supported for\npartitioned tables. Also beginning with MySQL 5.1.27, you can use ALTER\nTABLE ... OPTIMIZE PARTITION to optimize one or more partitions; for\nmore information, see [HELP ALTER TABLE], and\nhttp://dev.mysql.com/doc/refman/5.1/en/partitioning-maintenance.html.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/optimize-table.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/optimize-table.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (113,11,'DECODE','Syntax:\nDECODE(crypt_str,pass_str)\n\nDecrypts the encrypted string crypt_str using pass_str as the password.\ncrypt_str should be a string returned from ENCODE().\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/encryption-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/encryption-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (114,17,'<=>','Syntax:\n<=>\n\nNULL-safe equal. This operator performs an equality comparison like the\n= operator, but returns 1 rather than NULL if both operands are NULL,\nand 0 rather than NULL if one operand is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/comparison-operators.html\n\n','mysql> SELECT 1 <=> 1, NULL <=> NULL, 1 <=> NULL;\n -> 1, 1, 0\nmysql> SELECT 1 = 1, NULL = NULL, 1 = NULL;\n -> 1, NULL, NULL\n','http://dev.mysql.com/doc/refman/5.1/en/comparison-operators.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (115,27,'HELP STATEMENT','Syntax:\nHELP \'search_string\'\n\nThe HELP statement returns online information from the MySQL Reference\nmanual. Its proper operation requires that the help tables in the mysql\ndatabase be initialized with help topic information (see\nhttp://dev.mysql.com/doc/refman/5.1/en/server-side-help-support.html).\n\nThe HELP statement searches the help tables for the given search string\nand displays the result of the search. The search string is not case\nsensitive.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/help.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/help.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (116,25,'LOAD DATA FROM MASTER','Syntax:\nLOAD DATA FROM MASTER\n\nThis feature is deprecated and should be avoided. It is subject to\nremoval in a future version of MySQL.\n\nSince the current implementation of LOAD DATA FROM MASTER and LOAD\nTABLE FROM MASTER is very limited, these statements are deprecated as\nof MySQL 4.1 and removed in MySQL 5.5.\n\nThe recommended alternative solution to using LOAD DATA FROM MASTER or\nLOAD TABLE FROM MASTER is using mysqldump or mysqlhotcopy. The latter\nrequires Perl and two Perl modules (DBI and DBD:mysql) and works for\nMyISAM and ARCHIVE tables only. With mysqldump, you can create SQL\ndumps on the master and pipe (or copy) these to a mysql client on the\nslave. This has the advantage of working for all storage engines, but\ncan be quite slow, since it works using SELECT.\n\nThis statement takes a snapshot of the master and copies it to the\nslave. It updates the values of MASTER_LOG_FILE and MASTER_LOG_POS so\nthat the slave starts replicating from the correct position. Any table\nand database exclusion rules specified with the --replicate-*-do-* and\n--replicate-*-ignore-* options are honored. --replicate-rewrite-db is\nnot taken into account because a user could use this option to set up a\nnonunique mapping such as --replicate-rewrite-db="db1->db3" and\n--replicate-rewrite-db="db2->db3", which would confuse the slave when\nloading tables from the master.\n\nUse of this statement is subject to the following conditions:\n\no It works only for MyISAM tables. Attempting to load a non-MyISAM\n table results in the following error:\n\nERROR 1189 (08S01): Net error reading from master\n\no It acquires a global read lock on the master while taking the\n snapshot, which prevents updates on the master during the load\n operation.\n\nIf you are loading large tables, you might have to increase the values\nof net_read_timeout and net_write_timeout on both the master and slave\nservers. See\nhttp://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html.\n\nNote that LOAD DATA FROM MASTER does not copy any tables from the mysql\ndatabase. This makes it easy to have different users and privileges on\nthe master and the slave.\n\nTo use LOAD DATA FROM MASTER, the replication account that is used to\nconnect to the master must have the RELOAD and SUPER privileges on the\nmaster and the SELECT privilege for all master tables you want to load.\nAll master tables for which the user does not have the SELECT privilege\nare ignored by LOAD DATA FROM MASTER. This is because the master hides\nthem from the user: LOAD DATA FROM MASTER calls SHOW DATABASES to know\nthe master databases to load, but SHOW DATABASES returns only databases\nfor which the user has some privilege. See [HELP SHOW DATABASES]. On\nthe slave side, the user that issues LOAD DATA FROM MASTER must have\nprivileges for dropping and creating the databases and tables that are\ncopied.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/load-data-from-master.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/load-data-from-master.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (117,25,'RESET','Syntax:\nRESET reset_option [, reset_option] ...\n\nThe RESET statement is used to clear the state of various server\noperations. You must have the RELOAD privilege to execute RESET.\n\nRESET acts as a stronger version of the FLUSH statement. See [HELP\nFLUSH].\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/reset.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/reset.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (118,14,'GET_LOCK','Syntax:\nGET_LOCK(str,timeout)\n\nTries to obtain a lock with a name given by the string str, using a\ntimeout of timeout seconds. Returns 1 if the lock was obtained\nsuccessfully, 0 if the attempt timed out (for example, because another\nclient has previously locked the name), or NULL if an error occurred\n(such as running out of memory or the thread was killed with mysqladmin\nkill). If you have a lock obtained with GET_LOCK(), it is released when\nyou execute RELEASE_LOCK(), execute a new GET_LOCK(), or your\nconnection terminates (either normally or abnormally). Locks obtained\nwith GET_LOCK() do not interact with transactions. That is, committing\na transaction does not release any such locks obtained during the\ntransaction.\n\nThis function can be used to implement application locks or to simulate\nrecord locks. Names are locked on a server-wide basis. If a name has\nbeen locked by one client, GET_LOCK() blocks any request by another\nclient for a lock with the same name. This allows clients that agree on\na given lock name to use the name to perform cooperative advisory\nlocking. But be aware that it also allows a client that is not among\nthe set of cooperating clients to lock a name, either inadvertently or\ndeliberately, and thus prevent any of the cooperating clients from\nlocking that name. One way to reduce the likelihood of this is to use\nlock names that are database-specific or application-specific. For\nexample, use lock names of the form db_name.str or app_name.str.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/miscellaneous-functions.html\n\n','mysql> SELECT GET_LOCK(\'lock1\',10);\n -> 1\nmysql> SELECT IS_FREE_LOCK(\'lock2\');\n -> 1\nmysql> SELECT GET_LOCK(\'lock2\',10);\n -> 1\nmysql> SELECT RELEASE_LOCK(\'lock2\');\n -> 1\nmysql> SELECT RELEASE_LOCK(\'lock1\');\n -> NULL\n','http://dev.mysql.com/doc/refman/5.1/en/miscellaneous-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (119,35,'UCASE','Syntax:\nUCASE(str)\n\nUCASE() is a synonym for UPPER().\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/string-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (120,25,'SHOW BINLOG EVENTS','Syntax:\nSHOW BINLOG EVENTS\n [IN \'log_name\'] [FROM pos] [LIMIT [offset,] row_count]\n\nShows the events in the binary log. If you do not specify \'log_name\',\nthe first binary log is displayed.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/show-binlog-events.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/show-binlog-events.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (121,31,'MPOLYFROMWKB','MPolyFromWKB(wkb[,srid]), MultiPolygonFromWKB(wkb[,srid])\n\nConstructs a MULTIPOLYGON value using its WKB representation and SRID.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/creating-spatial-values.html#gis-wkb-functions\n\n','','http://dev.mysql.com/doc/refman/5.1/en/creating-spatial-values.html#gis-wkb-functions'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (122,22,'ITERATE','Syntax:\nITERATE label\n\nITERATE can appear only within LOOP, REPEAT, and WHILE statements.\nITERATE means "do the loop again."\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/iterate-statement.html\n\n','CREATE PROCEDURE doiterate(p1 INT)\nBEGIN\n label1: LOOP\n SET p1 = p1 + 1;\n IF p1 < 10 THEN ITERATE label1; END IF;\n LEAVE label1;\n END LOOP label1;\n SET @x = p1;\nEND\n','http://dev.mysql.com/doc/refman/5.1/en/iterate-statement.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (123,26,'DO','Syntax:\nDO expr [, expr] ...\n\nDO executes the expressions but does not return any results. In most\nrespects, DO is shorthand for SELECT expr, ..., but has the advantage\nthat it is slightly faster when you do not care about the result.\n\nDO is useful primarily with functions that have side effects, such as\nRELEASE_LOCK().\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/do.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/do.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (124,30,'CURTIME','Syntax:\nCURTIME()\n\nReturns the current time as a value in \'HH:MM:SS\' or HHMMSS.uuuuuu\nformat, depending on whether the function is used in a string or\nnumeric context. The value is expressed in the current time zone.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html\n\n','mysql> SELECT CURTIME();\n -> \'23:50:26\'\nmysql> SELECT CURTIME() + 0;\n -> 235026.000000\n','http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (125,35,'CHAR_LENGTH','Syntax:\nCHAR_LENGTH(str)\n\nReturns the length of the string str, measured in characters. A\nmulti-byte character counts as a single character. This means that for\na string containing five two-byte characters, LENGTH() returns 10,\nwhereas CHAR_LENGTH() returns 5.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/string-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (126,20,'BIGINT','BIGINT[(M)] [UNSIGNED] [ZEROFILL]\n\nA large integer. The signed range is -9223372036854775808 to\n9223372036854775807. The unsigned range is 0 to 18446744073709551615.\n\nSERIAL is an alias for BIGINT UNSIGNED NOT NULL AUTO_INCREMENT UNIQUE.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/numeric-type-overview.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (127,25,'SET','Syntax:\nSET variable_assignment [, variable_assignment] ...\n\nvariable_assignment:\n user_var_name = expr\n | [GLOBAL | SESSION] system_var_name = expr\n | [@@global. | @@session. | @@]system_var_name = expr\n\nThe SET statement assigns values to different types of variables that\naffect the operation of the server or your client. Older versions of\nMySQL employed SET OPTION, but this syntax is deprecated in favor of\nSET without OPTION.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/set-option.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/set-option.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (128,4,'CONV','Syntax:\nCONV(N,from_base,to_base)\n\nConverts numbers between different number bases. Returns a string\nrepresentation of the number N, converted from base from_base to base\nto_base. Returns NULL if any argument is NULL. The argument N is\ninterpreted as an integer, but may be specified as an integer or a\nstring. The minimum base is 2 and the maximum base is 36. If to_base is\na negative number, N is regarded as a signed number. Otherwise, N is\ntreated as unsigned. CONV() works with 64-bit precision.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/mathematical-functions.html\n\n','mysql> SELECT CONV(\'a\',16,2);\n -> \'1010\'\nmysql> SELECT CONV(\'6E\',18,8);\n -> \'172\'\nmysql> SELECT CONV(-17,10,-18);\n -> \'-H\'\nmysql> SELECT CONV(10+\'10\'+\'10\'+0xa,10,10);\n -> \'40\'\n','http://dev.mysql.com/doc/refman/5.1/en/mathematical-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (129,20,'DATE','DATE\n\nA date. The supported range is \'1000-01-01\' to \'9999-12-31\'. MySQL\ndisplays DATE values in \'YYYY-MM-DD\' format, but allows assignment of\nvalues to DATE columns using either strings or numbers.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/date-and-time-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/date-and-time-type-overview.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (130,25,'SHOW OPEN TABLES','Syntax:\nSHOW OPEN TABLES [{FROM | IN} db_name]\n [LIKE \'pattern\' | WHERE expr]\n\nSHOW OPEN TABLES lists the non-TEMPORARY tables that are currently open\nin the table cache. See\nhttp://dev.mysql.com/doc/refman/5.1/en/table-cache.html. The WHERE\nclause can be given to select rows using more general conditions, as\ndiscussed in http://dev.mysql.com/doc/refman/5.1/en/extended-show.html.\n\nThe FROM and LIKE clauses may be used beginning with MySQL 5.1.24. The\nLIKE clause, if present, indicates which table names to match. The FROM\nclause, if present, restricts the tables shown to those present in the\ndb_name database.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/show-open-tables.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/show-open-tables.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (131,30,'EXTRACT','Syntax:\nEXTRACT(unit FROM date)\n\nThe EXTRACT() function uses the same kinds of unit specifiers as\nDATE_ADD() or DATE_SUB(), but extracts parts from the date rather than\nperforming date arithmetic.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html\n\n','mysql> SELECT EXTRACT(YEAR FROM \'2009-07-02\');\n -> 2009\nmysql> SELECT EXTRACT(YEAR_MONTH FROM \'2009-07-02 01:02:03\');\n -> 200907\nmysql> SELECT EXTRACT(DAY_MINUTE FROM \'2009-07-02 01:02:03\');\n -> 20102\nmysql> SELECT EXTRACT(MICROSECOND\n -> FROM \'2003-01-02 10:30:00.000123\');\n -> 123\n','http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (132,11,'ENCRYPT','Syntax:\nENCRYPT(str[,salt])\n\nEncrypts str using the Unix crypt() system call and returns a binary\nstring. The salt argument should be a string with at least two\ncharacters. If no salt argument is given, a random value is used.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/encryption-functions.html\n\n','mysql> SELECT ENCRYPT(\'hello\');\n -> \'VxuFAJXVARROc\'\n','http://dev.mysql.com/doc/refman/5.1/en/encryption-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (133,25,'SHOW STATUS','Syntax:\nSHOW [GLOBAL | SESSION] STATUS\n [LIKE \'pattern\' | WHERE expr]\n\nSHOW STATUS provides server status information. This information also\ncan be obtained using the mysqladmin extended-status command. The LIKE\nclause, if present, indicates which variable names to match. The WHERE\nclause can be given to select rows using more general conditions, as\ndiscussed in http://dev.mysql.com/doc/refman/5.1/en/extended-show.html.\nThis statement does not require any privilege. It requires only the\nability to connect to the server.\nWith a LIKE clause, the statement displays only rows for those\nvariables with names that match the pattern:\n\nmysql> SHOW STATUS LIKE \'Key%\';\n+--------------------+----------+\n| Variable_name | Value |\n+--------------------+----------+\n| Key_blocks_used | 14955 |\n| Key_read_requests | 96854827 |\n| Key_reads | 162040 |\n| Key_write_requests | 7589728 |\n| Key_writes | 3813196 |\n+--------------------+----------+\n\nWith the GLOBAL modifier, SHOW STATUS displays the status values for\nall connections to MySQL. With SESSION, it displays the status values\nfor the current connection. If no modifier is present, the default is\nSESSION. LOCAL is a synonym for SESSION.\n\nSome status variables have only a global value. For these, you get the\nsame value for both GLOBAL and SESSION. The scope for each status\nvariable is listed at\nhttp://dev.mysql.com/doc/refman/5.1/en/server-status-variables.html.\n\nEach invocation of the SHOW STATUS statement uses an internal temporary\ntable and increments the global Created_tmp_tables value.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/show-status.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/show-status.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (134,35,'EXTRACTVALUE','Syntax:\nExtractValue(xml_frag, xpath_expr)\n\nExtractValue() takes two string arguments, a fragment of XML markup\nxml_frag and an XPath expression xpath_expr (also known as a locator);\nit returns the text (CDATA) of the first text node which is a child of\nthe element(s) matched by the XPath expression. It is the equivalent of\nperforming a match using the xpath_expr after appending /text(). In\nother words, ExtractValue(\'<a><b>Sakila</b></a>\', \'/a/b\') and\nExtractValue(\'<a><b>Sakila</b></a>\', \'/a/b/text()\') produce the same\nresult.\n\nIf multiple matches are found, then the content of the first child text\nnode of each matching element is returned (in the order matched) as a\nsingle, space-delimited string.\n\nIf no matching text node is found for the expression (including the\nimplicit /text()) --- for whatever reason, as long as xpath_expr is\nvalid, and xml_frag consists of elements which are properly nested and\nclosed --- an empty string is returned. No distinction is made between\na match on an empty element and no match at all. This is by design.\n\nIf you need to determine whether no matching element was found in\nxml_frag or such an element was found but contained no child text\nnodes, you should test the result of an expression that uses the XPath\ncount() function. For example, both of these statements return an empty\nstring, as shown here:\n\nmysql> SELECT ExtractValue(\'<a><b/></a>\', \'/a/b\');\n+-------------------------------------+\n| ExtractValue(\'<a><b/></a>\', \'/a/b\') |\n+-------------------------------------+\n| |\n+-------------------------------------+\n1 row in set (0.00 sec)\n\nmysql> SELECT ExtractValue(\'<a><c/></a>\', \'/a/b\');\n+-------------------------------------+\n| ExtractValue(\'<a><c/></a>\', \'/a/b\') |\n+-------------------------------------+\n| |\n+-------------------------------------+\n1 row in set (0.00 sec)\n\nHowever, you can determine whether there was actually a matching\nelement using the following:\n\nmysql> SELECT ExtractValue(\'<a><b/></a>\', \'count(/a/b)\');\n+-------------------------------------+\n| ExtractValue(\'<a><b/></a>\', \'count(/a/b)\') |\n+-------------------------------------+\n| 1 |\n+-------------------------------------+\n1 row in set (0.00 sec)\n\nmysql> SELECT ExtractValue(\'<a><c/></a>\', \'count(/a/b)\');\n+-------------------------------------+\n| ExtractValue(\'<a><c/></a>\', \'count(/a/b)\') |\n+-------------------------------------+\n| 0 |\n+-------------------------------------+\n1 row in set (0.01 sec)\n\n*Important*: ExtractValue() returns only CDATA, and does not return any\ntags that might be contained within a matching tag, nor any of their\ncontent (see the result returned as val1 in the following example).\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/xml-functions.html\n\n','mysql> SELECT\n -> ExtractValue(\'<a>ccc<b>ddd</b></a>\', \'/a\') AS val1,\n -> ExtractValue(\'<a>ccc<b>ddd</b></a>\', \'/a/b\') AS val2,\n -> ExtractValue(\'<a>ccc<b>ddd</b></a>\', \'//b\') AS val3,\n -> ExtractValue(\'<a>ccc<b>ddd</b></a>\', \'/b\') AS val4,\n -> ExtractValue(\'<a>ccc<b>ddd</b><b>eee</b></a>\', \'//b\') AS val5;\n\n+------+------+------+------+---------+\n| val1 | val2 | val3 | val4 | val5 |\n+------+------+------+------+---------+\n| ccc | ddd | ddd | | ddd eee |\n+------+------+------+------+---------+\n','http://dev.mysql.com/doc/refman/5.1/en/xml-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (135,11,'OLD_PASSWORD','Syntax:\nOLD_PASSWORD(str)\n\nOLD_PASSWORD() was added to MySQL when the implementation of PASSWORD()\nwas changed to improve security. OLD_PASSWORD() returns the value of\nthe old (pre-4.1) implementation of PASSWORD() as a binary string, and\nis intended to permit you to reset passwords for any pre-4.1 clients\nthat need to connect to your version 5.1 MySQL server without locking\nthem out. See\nhttp://dev.mysql.com/doc/refman/5.1/en/password-hashing.html.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/encryption-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/encryption-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (136,22,'SET VARIABLE','Syntax:\nSET var_name = expr [, var_name = expr] ...\n\nThe SET statement in stored programs is an extended version of the\ngeneral SET statement (see [HELP SET]). Each var_name may refer to a\nlocal variable declared inside a stored program, a system variable, or\na user-defined variable.\n\nThe SET statement in stored programs is implemented as part of the\npre-existing SET syntax. This allows an extended syntax of SET a=x,\nb=y, ... where different variable types (locally declared variables,\nglobal and session system variables, user-defined variables) can be\nmixed. This also allows combinations of local variables and some\noptions that make sense only for system variables; in that case, the\noptions are recognized but ignored.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/set-statement.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/set-statement.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (137,35,'FORMAT','Syntax:\nFORMAT(X,D)\n\nFormats the number X to a format like \'#,###,###.##\', rounded to D\ndecimal places, and returns the result as a string. If D is 0, the\nresult has no decimal point or fractional part.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/string-functions.html\n\n','mysql> SELECT FORMAT(12332.123456, 4);\n -> \'12,332.1235\'\nmysql> SELECT FORMAT(12332.1,4);\n -> \'12,332.1000\'\nmysql> SELECT FORMAT(12332.2,0);\n -> \'12,332\'\n','http://dev.mysql.com/doc/refman/5.1/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (138,13,'||','Syntax:\nOR, ||\n\nLogical OR. When both operands are non-NULL, the result is 1 if any\noperand is nonzero, and 0 otherwise. With a NULL operand, the result is\n1 if the other operand is nonzero, and NULL otherwise. If both operands\nare NULL, the result is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/logical-operators.html\n\n','mysql> SELECT 1 || 1;\n -> 1\nmysql> SELECT 1 || 0;\n -> 1\nmysql> SELECT 0 || 0;\n -> 0\nmysql> SELECT 0 || NULL;\n -> NULL\nmysql> SELECT 1 || NULL;\n -> 1\n','http://dev.mysql.com/doc/refman/5.1/en/logical-operators.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (139,35,'BIT_LENGTH','Syntax:\nBIT_LENGTH(str)\n\nReturns the length of the string str in bits.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/string-functions.html\n\n','mysql> SELECT BIT_LENGTH(\'text\');\n -> 32\n','http://dev.mysql.com/doc/refman/5.1/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (140,2,'EXTERIORRING','ExteriorRing(poly)\n\nReturns the exterior ring of the Polygon value poly as a LineString.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/geometry-property-functions.html#polygon-property-functions\n\n','mysql> SET @poly =\n -> \'Polygon((0 0,0 3,3 3,3 0,0 0),(1 1,1 2,2 2,2 1,1 1))\';\nmysql> SELECT AsText(ExteriorRing(GeomFromText(@poly)));\n+-------------------------------------------+\n| AsText(ExteriorRing(GeomFromText(@poly))) |\n+-------------------------------------------+\n| LINESTRING(0 0,0 3,3 3,3 0,0 0) |\n+-------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.1/en/geometry-property-functions.html#polygon-property-functions'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (141,31,'GEOMFROMWKB','GeomFromWKB(wkb[,srid]), GeometryFromWKB(wkb[,srid])\n\nConstructs a geometry value of any type using its WKB representation\nand SRID.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/creating-spatial-values.html#gis-wkb-functions\n\n','','http://dev.mysql.com/doc/refman/5.1/en/creating-spatial-values.html#gis-wkb-functions'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (142,25,'SHOW SLAVE HOSTS','Syntax:\nSHOW SLAVE HOSTS\n\nDisplays a list of replication slaves currently registered with the\nmaster. Only slaves started with the --report-host=host_name option are\nvisible in this list.\n\nThe list is displayed on any server (not just the master server). The\noutput looks like this:\n\nmysql> SHOW SLAVE HOSTS;\n+------------+-----------+------+-----------+\n| Server_id | Host | Port | Master_id |\n+------------+-----------+------+-----------+\n| 192168010 | iconnect2 | 3306 | 192168011 |\n| 1921680101 | athena | 3306 | 192168011 |\n+------------+-----------+------+-----------+\n\no Server_id: The unique server ID of the slave server, as configured in\n the server\'s option file, or on the command line with\n --server-id=value.\n\no Host: The host name of the slave server, as configured in the\n server\'s option file, or on the command line with\n --report-host=host_name. Note that this can differ from the machine\n name as configured in the operating system.\n\no Port: The port the slave server is listening on.\n\no Master_id: The unique server ID of the master server that the slave\n server is replicating from.\n\nSome MySQL versions report another variable, Rpl_recovery_rank. This\nvariable was never used, and was eventually removed.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/show-slave-hosts.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/show-slave-hosts.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (143,8,'START TRANSACTION','Syntax:\nSTART TRANSACTION [WITH CONSISTENT SNAPSHOT] | BEGIN [WORK]\nCOMMIT [WORK] [AND [NO] CHAIN] [[NO] RELEASE]\nROLLBACK [WORK] [AND [NO] CHAIN] [[NO] RELEASE]\nSET autocommit = {0 | 1}\n\nThe START TRANSACTION or BEGIN statement begins a new transaction.\nCOMMIT commits the current transaction, making its changes permanent.\nROLLBACK rolls back the current transaction, canceling its changes. The\nSET autocommit statement disables or enables the default autocommit\nmode for the current session.\n\nThe optional WORK keyword is supported for COMMIT and ROLLBACK, as are\nthe CHAIN and RELEASE clauses. CHAIN and RELEASE can be used for\nadditional control over transaction completion. The value of the\ncompletion_type system variable determines the default completion\nbehavior. See\nhttp://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html.\n\n*Note*: Within all stored programs (stored procedures and functions,\ntriggers, and events), the parser treats BEGIN [WORK] as the beginning\nof a BEGIN ... END block. Begin a transaction in this context with\nSTART TRANSACTION instead.\n\nThe AND CHAIN clause causes a new transaction to begin as soon as the\ncurrent one ends, and the new transaction has the same isolation level\nas the just-terminated transaction. The RELEASE clause causes the\nserver to disconnect the current client session after terminating the\ncurrent transaction. Including the NO keyword suppresses CHAIN or\nRELEASE completion, which can be useful if the completion_type system\nvariable is set to cause chaining or release completion by default.\n\nBy default, MySQL runs with autocommit mode enabled. This means that as\nsoon as you execute a statement that updates (modifies) a table, MySQL\nstores the update on disk to make it permanent. To disable autocommit\nmode, use the following statement:\n\nSET autocommit=0;\n\nAfter disabling autocommit mode by setting the autocommit variable to\nzero, changes to transaction-safe tables (such as those for InnoDB or\nNDBCLUSTER) are not made permanent immediately. You must use COMMIT to\nstore your changes to disk or ROLLBACK to ignore the changes.\n\nTo disable autocommit mode for a single series of statements, use the\nSTART TRANSACTION statement:\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/commit.html\n\n','START TRANSACTION;\nSELECT @A:=SUM(salary) FROM table1 WHERE type=1;\nUPDATE table2 SET summary=@A WHERE type=1;\nCOMMIT;\n','http://dev.mysql.com/doc/refman/5.1/en/commit.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (144,17,'BETWEEN AND','Syntax:\nexpr BETWEEN min AND max\n\nIf expr is greater than or equal to min and expr is less than or equal\nto max, BETWEEN returns 1, otherwise it returns 0. This is equivalent\nto the expression (min <= expr AND expr <= max) if all the arguments\nare of the same type. Otherwise type conversion takes place according\nto the rules described in\nhttp://dev.mysql.com/doc/refman/5.1/en/type-conversion.html, but\napplied to all the three arguments.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/comparison-operators.html\n\n','mysql> SELECT 2 BETWEEN 1 AND 3, 2 BETWEEN 3 and 1;\n -> 1, 0\nmysql> SELECT 1 BETWEEN 2 AND 3;\n -> 0\nmysql> SELECT \'b\' BETWEEN \'a\' AND \'c\';\n -> 1\nmysql> SELECT 2 BETWEEN 2 AND \'3\';\n -> 1\nmysql> SELECT 2 BETWEEN 2 AND \'x-3\';\n -> 0\n','http://dev.mysql.com/doc/refman/5.1/en/comparison-operators.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (145,23,'MULTIPOLYGON','MultiPolygon(poly1,poly2,...)\n\nConstructs a MultiPolygon value from a set of Polygon or WKB Polygon\narguments.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/creating-spatial-values.html#gis-mysql-specific-functions\n\n','','http://dev.mysql.com/doc/refman/5.1/en/creating-spatial-values.html#gis-mysql-specific-functions'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (146,30,'TIME_FORMAT','Syntax:\nTIME_FORMAT(time,format)\n\nThis is used like the DATE_FORMAT() function, but the format string may\ncontain format specifiers only for hours, minutes, seconds, and\nmicroseconds. Other specifiers produce a NULL value or 0.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html\n\n','mysql> SELECT TIME_FORMAT(\'100:00:00\', \'%H %k %h %I %l\');\n -> \'100 100 04 04 4\'\n','http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (147,35,'LEFT','Syntax:\nLEFT(str,len)\n\nReturns the leftmost len characters from the string str, or NULL if any\nargument is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/string-functions.html\n\n','mysql> SELECT LEFT(\'foobarbar\', 5);\n -> \'fooba\'\n','http://dev.mysql.com/doc/refman/5.1/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (148,25,'FLUSH QUERY CACHE','You can defragment the query cache to better utilize its memory with\nthe FLUSH QUERY CACHE statement. The statement does not remove any\nqueries from the cache.\n\nThe RESET QUERY CACHE statement removes all query results from the\nquery cache. The FLUSH TABLES statement also does this.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/query-cache-status-and-maintenance.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/query-cache-status-and-maintenance.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (149,20,'SET DATA TYPE','SET(\'value1\',\'value2\',...) [CHARACTER SET charset_name] [COLLATE\ncollation_name]\n\nA set. A string object that can have zero or more values, each of which\nmust be chosen from the list of values \'value1\', \'value2\', ... A SET\ncolumn can have a maximum of 64 members. SET values are represented\ninternally as integers.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/string-type-overview.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (150,4,'RAND','Syntax:\nRAND(), RAND(N)\n\nReturns a random floating-point value v in the range 0 <= v < 1.0. If a\nconstant integer argument N is specified, it is used as the seed value,\nwhich produces a repeatable sequence of column values. In the following\nexample, note that the sequences of values produced by RAND(3) is the\nsame both places where it occurs.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/mathematical-functions.html\n\n','mysql> CREATE TABLE t (i INT);\nQuery OK, 0 rows affected (0.42 sec)\n\nmysql> INSERT INTO t VALUES(1),(2),(3);\nQuery OK, 3 rows affected (0.00 sec)\nRecords: 3 Duplicates: 0 Warnings: 0\n\nmysql> SELECT i, RAND() FROM t;\n+------+------------------+\n| i | RAND() |\n+------+------------------+\n| 1 | 0.61914388706828 |\n| 2 | 0.93845168309142 |\n| 3 | 0.83482678498591 |\n+------+------------------+\n3 rows in set (0.00 sec)\n\nmysql> SELECT i, RAND(3) FROM t;\n+------+------------------+\n| i | RAND(3) |\n+------+------------------+\n| 1 | 0.90576975597606 |\n| 2 | 0.37307905813035 |\n| 3 | 0.14808605345719 |\n+------+------------------+\n3 rows in set (0.00 sec)\n\nmysql> SELECT i, RAND() FROM t;\n+------+------------------+\n| i | RAND() |\n+------+------------------+\n| 1 | 0.35877890638893 |\n| 2 | 0.28941420772058 |\n| 3 | 0.37073435016976 |\n+------+------------------+\n3 rows in set (0.00 sec)\n\nmysql> SELECT i, RAND(3) FROM t;\n+------+------------------+\n| i | RAND(3) |\n+------+------------------+\n| 1 | 0.90576975597606 |\n| 2 | 0.37307905813035 |\n| 3 | 0.14808605345719 |\n+------+------------------+\n3 rows in set (0.01 sec)\n','http://dev.mysql.com/doc/refman/5.1/en/mathematical-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (151,35,'RPAD','Syntax:\nRPAD(str,len,padstr)\n\nReturns the string str, right-padded with the string padstr to a length\nof len characters. If str is longer than len, the return value is\nshortened to len characters.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/string-functions.html\n\n','mysql> SELECT RPAD(\'hi\',5,\'?\');\n -> \'hi???\'\nmysql> SELECT RPAD(\'hi\',1,\'?\');\n -> \'h\'\n','http://dev.mysql.com/doc/refman/5.1/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (152,37,'CREATE DATABASE','Syntax:\nCREATE {DATABASE | SCHEMA} [IF NOT EXISTS] db_name\n [create_specification] ...\n\ncreate_specification:\n [DEFAULT] CHARACTER SET [=] charset_name\n | [DEFAULT] COLLATE [=] collation_name\n\nCREATE DATABASE creates a database with the given name. To use this\nstatement, you need the CREATE privilege for the database. CREATE\nSCHEMA is a synonym for CREATE DATABASE.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/create-database.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/create-database.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (153,20,'DEC','DEC[(M[,D])] [UNSIGNED] [ZEROFILL], NUMERIC[(M[,D])] [UNSIGNED]\n[ZEROFILL], FIXED[(M[,D])] [UNSIGNED] [ZEROFILL]\n\nThese types are synonyms for DECIMAL. The FIXED synonym is available\nfor compatibility with other database systems.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/numeric-type-overview.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (154,16,'VAR_POP','Syntax:\nVAR_POP(expr)\n\nReturns the population standard variance of expr. It considers rows as\nthe whole population, not as a sample, so it has the number of rows as\nthe denominator. You can also use VARIANCE(), which is equivalent but\nis not standard SQL.\n\nVAR_POP() returns NULL if there were no matching rows.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/group-by-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/group-by-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (155,35,'ELT','Syntax:\nELT(N,str1,str2,str3,...)\n\nReturns str1 if N = 1, str2 if N = 2, and so on. Returns NULL if N is\nless than 1 or greater than the number of arguments. ELT() is the\ncomplement of FIELD().\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/string-functions.html\n\n','mysql> SELECT ELT(1, \'ej\', \'Heja\', \'hej\', \'foo\');\n -> \'ej\'\nmysql> SELECT ELT(4, \'ej\', \'Heja\', \'hej\', \'foo\');\n -> \'foo\'\n','http://dev.mysql.com/doc/refman/5.1/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (156,37,'ALTER VIEW','Syntax:\nALTER\n [ALGORITHM = {UNDEFINED | MERGE | TEMPTABLE}]\n [DEFINER = { user | CURRENT_USER }]\n [SQL SECURITY { DEFINER | INVOKER }]\n VIEW view_name [(column_list)]\n AS select_statement\n [WITH [CASCADED | LOCAL] CHECK OPTION]\n\nThis statement changes the definition of a view, which must exist. The\nsyntax is similar to that for CREATE VIEW and the effect is the same as\nfor CREATE OR REPLACE VIEW. See [HELP CREATE VIEW]. This statement\nrequires the CREATE VIEW and DROP privileges for the view, and some\nprivilege for each column referred to in the SELECT statement. As of\nMySQL 5.1.23, ALTER VIEW is allowed only to the definer or users with\nthe SUPER privilege.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/alter-view.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/alter-view.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (157,25,'SHOW DATABASES','Syntax:\nSHOW {DATABASES | SCHEMAS}\n [LIKE \'pattern\' | WHERE expr]\n\nSHOW DATABASES lists the databases on the MySQL server host. SHOW\nSCHEMAS is a synonym for SHOW DATABASES. The LIKE clause, if present,\nindicates which database names to match. The WHERE clause can be given\nto select rows using more general conditions, as discussed in\nhttp://dev.mysql.com/doc/refman/5.1/en/extended-show.html.\n\nYou see only those databases for which you have some kind of privilege,\nunless you have the global SHOW DATABASES privilege. You can also get\nthis list using the mysqlshow command.\n\nIf the server was started with the --skip-show-database option, you\ncannot use this statement at all unless you have the SHOW DATABASES\nprivilege.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/show-databases.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/show-databases.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (158,18,'~','Syntax:\n~\n\nInvert all bits.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/bit-functions.html\n\n','mysql> SELECT 5 & ~1;\n -> 4\n','http://dev.mysql.com/doc/refman/5.1/en/bit-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (159,20,'TEXT','TEXT[(M)] [CHARACTER SET charset_name] [COLLATE collation_name]\n\nA TEXT column with a maximum length of 65,535 (216 - 1) characters. The\neffective maximum length is less if the value contains multi-byte\ncharacters. Each TEXT value is stored using a two-byte length prefix\nthat indicates the number of bytes in the value.\n\nAn optional length M can be given for this type. If this is done, MySQL\ncreates the column as the smallest TEXT type large enough to hold\nvalues M characters long.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/string-type-overview.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (160,35,'CONCAT_WS','Syntax:\nCONCAT_WS(separator,str1,str2,...)\n\nCONCAT_WS() stands for Concatenate With Separator and is a special form\nof CONCAT(). The first argument is the separator for the rest of the\narguments. The separator is added between the strings to be\nconcatenated. The separator can be a string, as can the rest of the\narguments. If the separator is NULL, the result is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/string-functions.html\n\n','mysql> SELECT CONCAT_WS(\',\',\'First name\',\'Second name\',\'Last Name\');\n -> \'First name,Second name,Last Name\'\nmysql> SELECT CONCAT_WS(\',\',\'First name\',NULL,\'Last Name\');\n -> \'First name,Last Name\'\n','http://dev.mysql.com/doc/refman/5.1/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (161,15,'ROW_COUNT','Syntax:\nROW_COUNT()\n\nROW_COUNT() returns the number of rows updated, inserted, or deleted by\nthe preceding statement. This is the same as the row count that the\nmysql client displays and the value from the mysql_affected_rows() C\nAPI function.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/information-functions.html\n\n','mysql> INSERT INTO t VALUES(1),(2),(3);\nQuery OK, 3 rows affected (0.00 sec)\nRecords: 3 Duplicates: 0 Warnings: 0\n\nmysql> SELECT ROW_COUNT();\n+-------------+\n| ROW_COUNT() |\n+-------------+\n| 3 |\n+-------------+\n1 row in set (0.00 sec)\n\nmysql> DELETE FROM t WHERE i IN(1,2);\nQuery OK, 2 rows affected (0.00 sec)\n\nmysql> SELECT ROW_COUNT();\n+-------------+\n| ROW_COUNT() |\n+-------------+\n| 2 |\n+-------------+\n1 row in set (0.00 sec)\n','http://dev.mysql.com/doc/refman/5.1/en/information-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (162,4,'ASIN','Syntax:\nASIN(X)\n\nReturns the arc sine of X, that is, the value whose sine is X. Returns\nNULL if X is not in the range -1 to 1.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/mathematical-functions.html\n\n','mysql> SELECT ASIN(0.2);\n -> 0.20135792079033\nmysql> SELECT ASIN(\'foo\');\n\n+-------------+\n| ASIN(\'foo\') |\n+-------------+\n| 0 |\n+-------------+\n1 row in set, 1 warning (0.00 sec)\n\nmysql> SHOW WARNINGS;\n+---------+------+-----------------------------------------+\n| Level | Code | Message |\n+---------+------+-----------------------------------------+\n| Warning | 1292 | Truncated incorrect DOUBLE value: \'foo\' |\n+---------+------+-----------------------------------------+\n','http://dev.mysql.com/doc/refman/5.1/en/mathematical-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (163,4,'SIGN','Syntax:\nSIGN(X)\n\nReturns the sign of the argument as -1, 0, or 1, depending on whether X\nis negative, zero, or positive.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/mathematical-functions.html\n\n','mysql> SELECT SIGN(-32);\n -> -1\nmysql> SELECT SIGN(0);\n -> 0\nmysql> SELECT SIGN(234);\n -> 1\n','http://dev.mysql.com/doc/refman/5.1/en/mathematical-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (164,30,'SEC_TO_TIME','Syntax:\nSEC_TO_TIME(seconds)\n\nReturns the seconds argument, converted to hours, minutes, and seconds,\nas a TIME value. The range of the result is constrained to that of the\nTIME data type. A warning occurs if the argument corresponds to a value\noutside that range.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html\n\n','mysql> SELECT SEC_TO_TIME(2378);\n -> \'00:39:38\'\nmysql> SELECT SEC_TO_TIME(2378) + 0;\n -> 3938\n','http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (165,20,'FLOAT','FLOAT[(M,D)] [UNSIGNED] [ZEROFILL]\n\nA small (single-precision) floating-point number. Allowable values are\n-3.402823466E+38 to -1.175494351E-38, 0, and 1.175494351E-38 to\n3.402823466E+38. These are the theoretical limits, based on the IEEE\nstandard. The actual range might be slightly smaller depending on your\nhardware or operating system.\n\nM is the total number of digits and D is the number of digits following\nthe decimal point. If M and D are omitted, values are stored to the\nlimits allowed by the hardware. A single-precision floating-point\nnumber is accurate to approximately 7 decimal places.\n\nUNSIGNED, if specified, disallows negative values.\n\nUsing FLOAT might give you some unexpected problems because all\ncalculations in MySQL are done with double precision. See\nhttp://dev.mysql.com/doc/refman/5.1/en/no-matching-rows.html.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/numeric-type-overview.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (166,35,'LOCATE','Syntax:\nLOCATE(substr,str), LOCATE(substr,str,pos)\n\nThe first syntax returns the position of the first occurrence of\nsubstring substr in string str. The second syntax returns the position\nof the first occurrence of substring substr in string str, starting at\nposition pos. Returns 0 if substr is not in str.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/string-functions.html\n\n','mysql> SELECT LOCATE(\'bar\', \'foobarbar\');\n -> 4\nmysql> SELECT LOCATE(\'xbar\', \'foobar\');\n -> 0\nmysql> SELECT LOCATE(\'bar\', \'foobarbar\', 5);\n -> 7\n','http://dev.mysql.com/doc/refman/5.1/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (167,25,'SHOW EVENTS','Syntax:\nSHOW EVENTS [{FROM | IN} schema_name]\n [LIKE \'pattern\' | WHERE expr]\n\nIn its simplest form, SHOW EVENTS lists all of the events in the\ncurrent schema:\n\nmysql> SELECT CURRENT_USER(), SCHEMA();\n+----------------+----------+\n| CURRENT_USER() | SCHEMA() |\n+----------------+----------+\n| jon@ghidora | myschema |\n+----------------+----------+\n1 row in set (0.00 sec)\n\nmysql> SHOW EVENTS\\G\n*************************** 1. row ***************************\n Db: myschema\n Name: e_daily\n Definer: jon@ghidora\n Time zone: SYSTEM\n Type: RECURRING\n Execute at: NULL\n Interval value: 10\n Interval field: SECOND\n Starts: 2006-02-09 10:41:23\n Ends: NULL\n Status: ENABLED\n Originator: 0\ncharacter_set_client: latin1\ncollation_connection: latin1_swedish_ci\n Database Collation: latin1_swedish_ci\n\nTo see events for a specific schema, use the FROM clause. For example,\nto see events for the test schema, use the following statement:\n\nSHOW EVENTS FROM test;\n\nThe LIKE clause, if present, indicates which event names to match. The\nWHERE clause can be given to select rows using more general conditions,\nas discussed in\nhttp://dev.mysql.com/doc/refman/5.1/en/extended-show.html.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/show-events.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/show-events.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (168,15,'CHARSET','Syntax:\nCHARSET(str)\n\nReturns the character set of the string argument.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/information-functions.html\n\n','mysql> SELECT CHARSET(\'abc\');\n -> \'latin1\'\nmysql> SELECT CHARSET(CONVERT(\'abc\' USING utf8));\n -> \'utf8\'\nmysql> SELECT CHARSET(USER());\n -> \'utf8\'\n','http://dev.mysql.com/doc/refman/5.1/en/information-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (169,30,'SUBDATE','Syntax:\nSUBDATE(date,INTERVAL expr unit), SUBDATE(expr,days)\n\nWhen invoked with the INTERVAL form of the second argument, SUBDATE()\nis a synonym for DATE_SUB(). For information on the INTERVAL unit\nargument, see the discussion for DATE_ADD().\n\nmysql> SELECT DATE_SUB(\'2008-01-02\', INTERVAL 31 DAY);\n -> \'2007-12-02\'\nmysql> SELECT SUBDATE(\'2008-01-02\', INTERVAL 31 DAY);\n -> \'2007-12-02\'\n\nThe second form allows the use of an integer value for days. In such\ncases, it is interpreted as the number of days to be subtracted from\nthe date or datetime expression expr.\n\nmysql> SELECT SUBDATE(\'2008-01-02 12:00:00\', 31);\n -> \'2007-12-02 12:00:00\'\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (170,30,'DAYOFYEAR','Syntax:\nDAYOFYEAR(date)\n\nReturns the day of the year for date, in the range 1 to 366.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html\n\n','mysql> SELECT DAYOFYEAR(\'2007-02-03\');\n -> 34\n','http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (171,20,'LONGTEXT','LONGTEXT [CHARACTER SET charset_name] [COLLATE collation_name]\n\nA TEXT column with a maximum length of 4,294,967,295 or 4GB (232 - 1)\ncharacters. The effective maximum length is less if the value contains\nmulti-byte characters. The effective maximum length of LONGTEXT columns\nalso depends on the configured maximum packet size in the client/server\nprotocol and available memory. Each LONGTEXT value is stored using a\nfour-byte length prefix that indicates the number of bytes in the\nvalue.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/string-type-overview.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (172,4,'%','Syntax:\nN % M\n\nModulo operation. Returns the remainder of N divided by M. For more\ninformation, see the description for the MOD() function in\nhttp://dev.mysql.com/doc/refman/5.1/en/mathematical-functions.html.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/arithmetic-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/arithmetic-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (173,25,'KILL','Syntax:\nKILL [CONNECTION | QUERY] thread_id\n\nEach connection to mysqld runs in a separate thread. You can see which\nthreads are running with the SHOW PROCESSLIST statement and kill a\nthread with the KILL thread_id statement.\n\nKILL allows the optional CONNECTION or QUERY modifier:\n\no KILL CONNECTION is the same as KILL with no modifier: It terminates\n the connection associated with the given thread_id.\n\no KILL QUERY terminates the statement that the connection is currently\n executing, but leaves the connection itself intact.\n\nIf you have the PROCESS privilege, you can see all threads. If you have\nthe SUPER privilege, you can kill all threads and statements.\nOtherwise, you can see and kill only your own threads and statements.\n\nYou can also use the mysqladmin processlist and mysqladmin kill\ncommands to examine and kill threads.\n\n*Note*: You cannot use KILL with the Embedded MySQL Server library\nbecause the embedded server merely runs inside the threads of the host\napplication. It does not create any connection threads of its own.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/kill.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/kill.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (174,29,'DISJOINT','Disjoint(g1,g2)\n\nReturns 1 or 0 to indicate whether g1 is spatially disjoint from (does\nnot intersect) g2.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/functions-that-test-spatial-relationships-between-geometries.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/functions-that-test-spatial-relationships-between-geometries.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (175,3,'ASTEXT','AsText(g), AsWKT(g)\n\nConverts a value in internal geometry format to its WKT representation\nand returns the string result.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/functions-to-convert-geometries-between-formats.html\n\n','mysql> SET @g = \'LineString(1 1,2 2,3 3)\';\nmysql> SELECT AsText(GeomFromText(@g));\n+--------------------------+\n| AsText(GeomFromText(@g)) |\n+--------------------------+\n| LINESTRING(1 1,2 2,3 3) |\n+--------------------------+\n','http://dev.mysql.com/doc/refman/5.1/en/functions-to-convert-geometries-between-formats.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (176,35,'LPAD','Syntax:\nLPAD(str,len,padstr)\n\nReturns the string str, left-padded with the string padstr to a length\nof len characters. If str is longer than len, the return value is\nshortened to len characters.\n\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/string-functions.html\n\n','mysql> SELECT LPAD(\'hi\',4,\'??\');\n -> \'??hi\'\nmysql> SELECT LPAD(\'hi\',1,\'??\');\n -> \'h\'\n','http://dev.mysql.com/doc/refman/5.1/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (177,19,'RESTORE TABLE','Syntax:\nRESTORE TABLE tbl_name [, tbl_name] ... FROM \'/path/to/backup/directory\'\n\n*Note*: This statement is deprecated and is removed in MySQL 5.5.\n\nRESTORE TABLE restores the table or tables from a backup that was made\nwith BACKUP TABLE. The directory should be specified as a full path\nname.\n\nExisting tables are not overwritten; if you try to restore over an\nexisting table, an error occurs. Just as for BACKUP TABLE, RESTORE\nTABLE currently works only for MyISAM tables. Restored tables are not\nreplicated from master to slave.\n\nThe backup for each table consists of its .frm format file and .MYD\ndata file. The restore operation restores those files, and then uses\nthem to rebuild the .MYI index file. Restoring takes longer than\nbacking up due to the need to rebuild the indexes. The more indexes the\ntable has, the longer it takes.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/restore-table.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/restore-table.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (178,22,'DECLARE CONDITION','Syntax:\nDECLARE condition_name CONDITION FOR condition_value\n\ncondition_value:\n SQLSTATE [VALUE] sqlstate_value\n | mysql_error_code\n\nThe DECLARE ... CONDITION statement defines a named error condition. It\nspecifies a condition that needs specific handling and associates a\nname with that condition. The name can be referred to in a subsequent\nDECLARE ... HANDLER statement. For an example, see [HELP DECLARE\nHANDLER].\n\nA condition_value for DECLARE ... CONDITION can be an SQLSTATE value (a\n5-character string literal) or a MySQL error code (a number). You\nshould not use SQLSTATE value \'00000\' or MySQL error code 0, because\nthose indicate success rather than an error condition. For a list of\nSQLSTATE values and MySQL error codes, see\nhttp://dev.mysql.com/doc/refman/5.1/en/error-messages-server.html.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/declare-condition.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/declare-condition.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (179,29,'OVERLAPS','Overlaps(g1,g2)\n\nReturns 1 or 0 to indicate whether g1 spatially overlaps g2. The term\nspatially overlaps is used if two geometries intersect and their\nintersection results in a geometry of the same dimension but not equal\nto either of the given geometries.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/functions-that-test-spatial-relationships-between-geometries.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/functions-that-test-spatial-relationships-between-geometries.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (180,25,'SET GLOBAL SQL_SLAVE_SKIP_COUNTER','Syntax:\nSET GLOBAL sql_slave_skip_counter = N\n\nThis statement skips the next N events from the master. This is useful\nfor recovering from replication stops caused by a statement.\n\nThis statement is valid only when the slave threads are not running.\nOtherwise, it produces an error.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/set-global-sql-slave-skip-counter.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/set-global-sql-slave-skip-counter.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (181,24,'NUMGEOMETRIES','NumGeometries(gc)\n\nReturns the number of geometries in the GeometryCollection value gc.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/geometry-property-functions.html#geometrycollection-property-functions\n\n','mysql> SET @gc = \'GeometryCollection(Point(1 1),LineString(2 2, 3 3))\';\nmysql> SELECT NumGeometries(GeomFromText(@gc));\n+----------------------------------+\n| NumGeometries(GeomFromText(@gc)) |\n+----------------------------------+\n| 2 |\n+----------------------------------+\n','http://dev.mysql.com/doc/refman/5.1/en/geometry-property-functions.html#geometrycollection-property-functions'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (182,30,'MONTHNAME','Syntax:\nMONTHNAME(date)\n\nReturns the full name of the month for date. As of MySQL 5.1.12, the\nlanguage used for the name is controlled by the value of the\nlc_time_names system variable\n(http://dev.mysql.com/doc/refman/5.1/en/locale-support.html).\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html\n\n','mysql> SELECT MONTHNAME(\'2008-02-03\');\n -> \'February\'\n','http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (183,36,'PROCEDURE ANALYSE','Syntax:\nANALYSE([max_elements[,max_memory]])\n\nANALYSE() is defined in the sql/sql_analyse.cc source file, which\nserves as an example of how to create a procedure for use with the\nPROCEDURE clause of SELECT statements. ANALYSE() is built in and is\navailable by default; other procedures can be created using the format\ndemonstrated in the source file.\n\nANALYSE() examines the result from a query and returns an analysis of\nthe results that suggests optimal data types for each column that may\nhelp reduce table sizes. To obtain this analysis, append PROCEDURE\nANALYSE to the end of a SELECT statement:\n\nSELECT ... FROM ... WHERE ... PROCEDURE ANALYSE([max_elements,[max_memory]])\n\nFor example:\n\nSELECT col1, col2 FROM table1 PROCEDURE ANALYSE(10, 2000);\n\nThe results show some statistics for the values returned by the query,\nand propose an optimal data type for the columns. This can be helpful\nfor checking your existing tables, or after importing new data. You may\nneed to try different settings for the arguments so that PROCEDURE\nANALYSE() does not suggest the ENUM data type when it is not\nappropriate.\n\nThe arguments are optional and are used as follows:\n\no max_elements (default 256) is the maximum number of distinct values\n that ANALYSE() notices per column. This is used by ANALYSE() to check\n whether the optimal data type should be of type ENUM; if there are\n more than max_elements distinct values, then ENUM is not a suggested\n type.\n\no max_memory (default 8192) is the maximum amount of memory that\n ANALYSE() should allocate per column while trying to find all\n distinct values.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/procedure-analyse.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/procedure-analyse.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (184,25,'CHANGE MASTER TO','Syntax:\nCHANGE MASTER TO option [, option] ...\n\noption:\n MASTER_BIND = \'interface_name\'\n | MASTER_HOST = \'host_name\'\n | MASTER_USER = \'user_name\'\n | MASTER_PASSWORD = \'password\'\n | MASTER_PORT = port_num\n | MASTER_CONNECT_RETRY = interval\n | MASTER_HEARTBEAT_PERIOD = interval\n | MASTER_LOG_FILE = \'master_log_name\'\n | MASTER_LOG_POS = master_log_pos\n | RELAY_LOG_FILE = \'relay_log_name\'\n | RELAY_LOG_POS = relay_log_pos\n | MASTER_SSL = {0|1}\n | MASTER_SSL_CA = \'ca_file_name\'\n | MASTER_SSL_CAPATH = \'ca_directory_name\'\n | MASTER_SSL_CERT = \'cert_file_name\'\n | MASTER_SSL_KEY = \'key_file_name\'\n | MASTER_SSL_CIPHER = \'cipher_list\'\n | MASTER_SSL_VERIFY_SERVER_CERT = {0|1}\n\nCHANGE MASTER TO changes the parameters that the slave server uses for\nconnecting to the master server, for reading the master binary log, and\nreading the slave relay log. It also updates the contents of the\nmaster.info and relay-log.info files. To use CHANGE MASTER TO, the\nslave replication threads must be stopped (use STOP SLAVE if\nnecessary).\n\nOptions not specified retain their value, except as indicated in the\nfollowing discussion. Thus, in most cases, there is no need to specify\noptions that do not change. For example, if the password to connect to\nyour MySQL master has changed, you just need to issue these statements\nto tell the slave about the new password:\n\nSTOP SLAVE; -- if replication was running\nCHANGE MASTER TO MASTER_PASSWORD=\'new3cret\';\nSTART SLAVE; -- if you want to restart replication\n\nMASTER_HOST, MASTER_USER, MASTER_PASSWORD, and MASTER_PORT provide\ninformation to the slave about how to connect to its master:\n\no MASTER_HOST and MASTER_PORT are the host name (or IP address) of the\n master host and its TCP/IP port.\n\n *Note*: Replication cannot use Unix socket files. You must be able to\n connect to the master MySQL server using TCP/IP.\n\n If you specify the MASTER_HOST or MASTER_PORT option, the slave\n assumes that the master server is different from before (even if the\n option value is the same as its current value.) In this case, the old\n values for the master binary log file name and position are\n considered no longer applicable, so if you do not specify\n MASTER_LOG_FILE and MASTER_LOG_POS in the statement,\n MASTER_LOG_FILE=\'\' and MASTER_LOG_POS=4 are silently appended to it.\n\n Setting MASTER_HOST=\'\' (that is, setting its value explicitly to an\n empty string) is not the same as not setting MASTER_HOST at all.\n Setting this option to an empty string causes START SLAVE\n subsequently to fail. This issue is addressed in MySQL 5.5.\n (Bug#28796 (http://bugs.mysql.com/bug.php?id=28796))\n\no MASTER_USER and MASTER_PASSWORD are the user name and password of the\n account to use for connecting to the master.\n\nThe MASTER_SSL_xxx options provide information about using SSL for the\nconnection. They correspond to the --ssl-xxx options described in\nhttp://dev.mysql.com/doc/refman/5.1/en/ssl-options.html, and\nhttp://dev.mysql.com/doc/refman/5.1/en/replication-solutions-ssl.html.\nMASTER_SSL_VERIFY_SERVER_CERT was added in MySQL 5.1.18. These options\ncan be changed even on slaves that are compiled without SSL support.\nThey are saved to the master.info file, but are ignored if the slave\ndoes not have SSL support enabled.\n\nMASTER_CONNECT_RETRY specifies how many seconds to wait between connect\nretries. The default is 60. The number of reconnection attempts is\nlimited by the --master-retry-count server option; for more\ninformation, see\nhttp://dev.mysql.com/doc/refman/5.1/en/replication-options.html.\n\nThe next two options (MASTER_BIND and MASTER_HEARTBEAT_PERIOD) are\navailable in MySQL Cluster NDB 6.3 and later, but are not supported in\nmainline MySQL 5.1:\n\nMASTER_BIND is for use on replication slaves having multiple network\ninterfaces, and determines which of the slave\'s network interfaces is\nchosen for connecting to the master. It is also possible to determine\nwhich network interface is to be used in such cases by starting the\nslave mysqld process with the --master-bind option.\n\nThe ability to bind a replication slave to specific network interface\nwas added in MySQL Cluster NDB 6.3.4.\n\nMASTER_HEARTBEAT_PERIOD is used to set the interval in seconds between\nreplication heartbeats. Whenever the master\'s binary log is updated\nwith an event, the waiting period for the next heartbeat is reset.\ninterval is a decimal value having the range 0 to 4294967 seconds and a\nresolution to hundredths of a second; the smallest nonzero value is\n0.01. Heartbeats are sent by the master only if there are no unsent\nevents in the binary log file for a period longer than interval.\n\nSetting interval to 0 disables heartbeats altogether. The default value\nfor interval is equal to the value of slave_net_timeout divided by 2.\n\nSetting @@global.slave_net_timeout to a value less than that of the\ncurrent heartbeat interval results in a warning being issued. The\neffect of issuing RESET SLAVE on the heartbeat interval is to reset it\nto the default value.\n\nMASTER_HEARTBEAT_PERIOD was added in MySQL Cluster NDB 6.3.4.\n\nMASTER_LOG_FILE and MASTER_LOG_POS are the coordinates at which the\nslave I/O thread should begin reading from the master the next time the\nthread starts. RELAY_LOG_FILE and RELAY_LOG_POS are the coordinates at\nwhich the slave SQL thread should begin reading from the relay log the\nnext time the thread starts. If you specify either of MASTER_LOG_FILE\nor MASTER_LOG_POS, you cannot specify RELAY_LOG_FILE or RELAY_LOG_POS.\nIf neither of MASTER_LOG_FILE or MASTER_LOG_POS is specified, the slave\nuses the last coordinates of the slave SQL thread before CHANGE MASTER\nTO was issued. This ensures that there is no discontinuity in\nreplication, even if the slave SQL thread was late compared to the\nslave I/O thread, when you merely want to change, say, the password to\nuse.\n\nCHANGE MASTER TO deletes all relay log files and starts a new one,\nunless you specify RELAY_LOG_FILE or RELAY_LOG_POS. In that case, relay\nlog files are kept; the relay_log_purge global variable is set silently\nto 0.\n\nCHANGE MASTER TO is useful for setting up a slave when you have the\nsnapshot of the master and have recorded the master binary log\ncoordinates corresponding to the time of the snapshot. After loading\nthe snapshot into the slave to synchronize it to the slave, you can run\nCHANGE MASTER TO MASTER_LOG_FILE=\'log_name\', MASTER_LOG_POS=log_pos on\nthe slave to specify the coodinates at which the slave should begin\nreading the master binary log.\n\nThe following example changes the master server the slave uses and\nestablishes the master binary log coordinates from which the slave\nbegins reading. This is used when you want to set up the slave to\nreplicate the master:\n\nCHANGE MASTER TO\n MASTER_HOST=\'master2.mycompany.com\',\n MASTER_USER=\'replication\',\n MASTER_PASSWORD=\'bigs3cret\',\n MASTER_PORT=3306,\n MASTER_LOG_FILE=\'master2-bin.001\',\n MASTER_LOG_POS=4,\n MASTER_CONNECT_RETRY=10;\n\nThe next example shows an operation that is less frequently employed.\nIt is used when the slave has relay log files that you want it to\nexecute again for some reason. To do this, the master need not be\nreachable. You need only use CHANGE MASTER TO and start the SQL thread\n(START SLAVE SQL_THREAD):\n\nCHANGE MASTER TO\n RELAY_LOG_FILE=\'slave-relay-bin.006\',\n RELAY_LOG_POS=4025;\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/change-master-to.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/change-master-to.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (185,37,'DROP DATABASE','Syntax:\nDROP {DATABASE | SCHEMA} [IF EXISTS] db_name\n\nDROP DATABASE drops all tables in the database and deletes the\ndatabase. Be very careful with this statement! To use DROP DATABASE,\nyou need the DROP privilege on the database. DROP SCHEMA is a synonym\nfor DROP DATABASE.\n\n*Important*: When a database is dropped, user privileges on the\ndatabase are not automatically dropped. See [HELP GRANT].\n\nIF EXISTS is used to prevent an error from occurring if the database\ndoes not exist.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/drop-database.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/drop-database.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (186,6,'MBREQUAL','MBREqual(g1,g2)\n\nReturns 1 or 0 to indicate whether the Minimum Bounding Rectangles of\nthe two geometries g1 and g2 are the same.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/relations-on-geometry-mbr.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/relations-on-geometry-mbr.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (187,30,'TIMESTAMP FUNCTION','Syntax:\nTIMESTAMP(expr), TIMESTAMP(expr1,expr2)\n\nWith a single argument, this function returns the date or datetime\nexpression expr as a datetime value. With two arguments, it adds the\ntime expression expr2 to the date or datetime expression expr1 and\nreturns the result as a datetime value.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html\n\n','mysql> SELECT TIMESTAMP(\'2003-12-31\');\n -> \'2003-12-31 00:00:00\'\nmysql> SELECT TIMESTAMP(\'2003-12-31 12:00:00\',\'12:00:00\');\n -> \'2004-01-01 00:00:00\'\n','http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (188,35,'CHARACTER_LENGTH','Syntax:\nCHARACTER_LENGTH(str)\n\nCHARACTER_LENGTH() is a synonym for CHAR_LENGTH().\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/string-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (189,25,'SHOW GRANTS','Syntax:\nSHOW GRANTS [FOR user]\n\nThis statement lists the GRANT statement or statements that must be\nissued to duplicate the privileges that are granted to a MySQL user\naccount. The account is named using the same format as for the GRANT\nstatement; for example, \'jeffrey\'@\'localhost\'. If you specify only the\nuser name part of the account name, a host name part of \'%\' is used.\nFor additional information about specifying account names, see [HELP\nGRANT].\n\nmysql> SHOW GRANTS FOR \'root\'@\'localhost\';\n+---------------------------------------------------------------------+\n| Grants for root@localhost |\n+---------------------------------------------------------------------+\n| GRANT ALL PRIVILEGES ON *.* TO \'root\'@\'localhost\' WITH GRANT OPTION |\n+---------------------------------------------------------------------+\n\nTo list the privileges granted to the account that you are using to\nconnect to the server, you can use any of the following statements:\n\nSHOW GRANTS;\nSHOW GRANTS FOR CURRENT_USER;\nSHOW GRANTS FOR CURRENT_USER();\n\nAs of MySQL 5.1.12, if SHOW GRANTS FOR CURRENT_USER (or any of the\nequivalent syntaxes) is used in DEFINER context, such as within a\nstored procedure that is defined with SQL SECURITY DEFINER), the grants\ndisplayed are those of the definer and not the invoker.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/show-grants.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/show-grants.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (190,25,'SHOW PRIVILEGES','Syntax:\nSHOW PRIVILEGES\n\nSHOW PRIVILEGES shows the list of system privileges that the MySQL\nserver supports. The exact list of privileges depends on the version of\nyour server.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/show-privileges.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/show-privileges.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (191,37,'CREATE TABLESPACE','Syntax:\nCREATE TABLESPACE tablespace_name\n ADD DATAFILE \'file_name\'\n USE LOGFILE GROUP logfile_group\n [EXTENT_SIZE [=] extent_size]\n [INITIAL_SIZE [=] initial_size]\n [AUTOEXTEND_SIZE [=] autoextend_size]\n [MAX_SIZE [=] max_size]\n [NODEGROUP [=] nodegroup_id]\n [WAIT]\n [COMMENT [=] comment_text]\n ENGINE [=] engine_name\n\nThis statement is used to create a tablespace, which can contain one or\nmore data files, providing storage space for tables. One data file is\ncreated and added to the tablespace using this statement. Additional\ndata files may be added to the tablespace by using the ALTER TABLESPACE\nstatement (see [HELP ALTER TABLESPACE]). For rules covering the naming\nof tablespaces, see\nhttp://dev.mysql.com/doc/refman/5.1/en/identifiers.html.\n\n*Note*: All MySQL Cluster Disk Data objects share the same namespace.\nThis means that each Disk Data object must be uniquely named (and not\nmerely each Disk Data object of a given type). For example, you cannot\nhave a tablespace and a log file group with the same name, or a\ntablespace and a data file with the same name.\n\nPrior to MySQL Cluster NDB 6.2.17, 6.3.23, and 6.4.3, path and file\nnames for data files could not be longer than 128 characters.\n(Bug#31770 (http://bugs.mysql.com/bug.php?id=31770))\n\nA log file group of one or more UNDO log files must be assigned to the\ntablespace to be created with the USE LOGFILE GROUP clause.\nlogfile_group must be an existing log file group created with CREATE\nLOGFILE GROUP (see\nhttp://dev.mysql.com/doc/refman/5.1/en/create-logfile-group.html).\nMultiple tablespaces may use the same log file group for UNDO logging.\n\nThe EXTENT_SIZE sets the size, in bytes, of the extents used by any\nfiles belonging to the tablespace. The default value is 1M. The minimum\nsize is 32K, and theoretical maximum is 2G, although the practical\nmaximum size depends on a number of factors. In most cases, changing\nthe extent size does not have any measurable effect on performance, and\nthe default value is recommended for all but the most unusual\nsituations.\n\nAn extent is a unit of disk space allocation. One extent is filled with\nas much data as that extent can contain before another extent is used.\nIn theory, up to 65,535 (64K) extents may used per data file; however,\nthe recommended maximum is 32,768 (32K). The recommended maximum size\nfor a single data file is 32G --- that is, 32K extents x 1 MB per\nextent. In addition, once an extent is allocated to a given partition,\nit cannot be used to store data from a different partition; an extent\ncannot store data from more than one partition. This means, for example\nthat a tablespace having a single datafile whose INITIAL_SIZE is 256 MB\nand whose EXTENT_SIZE is 128M has just two extents, and so can be used\nto store data from at most two different disk data table partitions.\n\nYou can see how many extents remain free in a given data file by\nquerying the INFORMATION_SCHEMA.FILES table, and so derive an estimate\nfor how much space remains free in the file. For further discussion and\nexamples, see http://dev.mysql.com/doc/refman/5.1/en/files-table.html.\n\nThe INITIAL_SIZE parameter sets the data file\'s total size in bytes.\nOnce the file has been created, its size cannot be changed; however,\nyou can add more data files to the tablespace using ALTER TABLESPACE\n... ADD DATAFILE. See [HELP ALTER TABLESPACE].\n\nINITIAL_SIZE is optional; its default value is 128M.\n\nOn 32-bit systems, the maximum supported value for INITIAL_SIZE is 4G.\n(Bug#29186 (http://bugs.mysql.com/bug.php?id=29186))\n\nWhen setting EXTENT_SIZE or INITIAL_SIZE (either or both), you may\noptionally follow the number with a one-letter abbreviation for an\norder of magnitude, similar to those used in my.cnf. Generally, this is\none of the letters M (for megabytes) or G (for gigabytes).\n\nINITIAL_SIZE, EXTENT_SIZE, and UNDO_BUFFER_SIZE are subject to rounding\nas follows:\n\no EXTENT_SIZE and UNDO_BUFFER_SIZE are each rounded up to the nearest\n whole multiple of 32K.\n\no INITIAL_SIZE is rounded down to the nearest whole multiple of 32K.\n\n For data files, INITIAL_SIZE is subject to further rounding; the\n result just obtained is rounded up to the nearest whole multiple of\n EXTENT_SIZE (after any rounding).\n\nThe rounding just described has always (since Disk Data tablespaces\nwere introduced in MySQL 5.1.6) been performed implicitly, but\nbeginning with MySQL Cluster NDB 6.2.19, MySQL Cluster NDB 6.3.32,\nMySQL Cluster NDB 7.0.13, and MySQL Cluster NDB 7.1.2, this rounding is\ndone explicitly, and a warning is issued by the MySQL Server when any\nsuch rounding is performed. The rounded values are also used by the NDB\nkernel for calculating INFORMATION_SCHEMA.FILES column values and other\npurposes. However, to avoid an unexpected result, we suggest that you\nalways use whole multiples of 32K in specifying these options.\n\nAUTOEXTEND_SIZE, MAX_SIZE, NODEGROUP, WAIT, and COMMENT are parsed but\nignored, and so currently have no effect. These options are intended\nfor future expansion.\n\nThe ENGINE parameter determines the storage engine which uses this\ntablespace, with engine_name being the name of the storage engine. In\nMySQL 5.1, engine_name must be one of the values NDB or NDBCLUSTER.\n\nWhen CREATE TABLESPACE is used with ENGINE = NDB, a tablespace and\nassociated data file are created on each Cluster data node. You can\nverify that the data files were created and obtain information about\nthem by querying the INFORMATION_SCHEMA.FILES table. For example:\n\nmysql> SELECT LOGFILE_GROUP_NAME, FILE_NAME, EXTRA\n -> FROM INFORMATION_SCHEMA.FILES\n -> WHERE TABLESPACE_NAME = \'newts\' AND FILE_TYPE = \'DATAFILE\';\n+--------------------+-------------+----------------+\n| LOGFILE_GROUP_NAME | FILE_NAME | EXTRA |\n+--------------------+-------------+----------------+\n| lg_3 | newdata.dat | CLUSTER_NODE=3 |\n| lg_3 | newdata.dat | CLUSTER_NODE=4 |\n+--------------------+-------------+----------------+\n2 rows in set (0.01 sec)\n\n(See http://dev.mysql.com/doc/refman/5.1/en/files-table.html.)\n\nCREATE TABLESPACE was added in MySQL 5.1.6. In MySQL 5.1, it is useful\nonly with Disk Data storage for MySQL Cluster. See\nhttp://dev.mysql.com/doc/refman/5.1/en/mysql-cluster-disk-data.html.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/create-tablespace.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/create-tablespace.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (192,35,'INSERT FUNCTION','Syntax:\nINSERT(str,pos,len,newstr)\n\nReturns the string str, with the substring beginning at position pos\nand len characters long replaced by the string newstr. Returns the\noriginal string if pos is not within the length of the string. Replaces\nthe rest of the string from position pos if len is not within the\nlength of the rest of the string. Returns NULL if any argument is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/string-functions.html\n\n','mysql> SELECT INSERT(\'Quadratic\', 3, 4, \'What\');\n -> \'QuWhattic\'\nmysql> SELECT INSERT(\'Quadratic\', -1, 4, \'What\');\n -> \'Quadratic\'\nmysql> SELECT INSERT(\'Quadratic\', 3, 100, \'What\');\n -> \'QuWhat\'\n','http://dev.mysql.com/doc/refman/5.1/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (193,4,'CRC32','Syntax:\nCRC32(expr)\n\nComputes a cyclic redundancy check value and returns a 32-bit unsigned\nvalue. The result is NULL if the argument is NULL. The argument is\nexpected to be a string and (if possible) is treated as one if it is\nnot.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/mathematical-functions.html\n\n','mysql> SELECT CRC32(\'MySQL\');\n -> 3259397556\nmysql> SELECT CRC32(\'mysql\');\n -> 2501908538\n','http://dev.mysql.com/doc/refman/5.1/en/mathematical-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (194,13,'XOR','Syntax:\nXOR\n\nLogical XOR. Returns NULL if either operand is NULL. For non-NULL\noperands, evaluates to 1 if an odd number of operands is nonzero,\notherwise 0 is returned.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/logical-operators.html\n\n','mysql> SELECT 1 XOR 1;\n -> 0\nmysql> SELECT 1 XOR 0;\n -> 1\nmysql> SELECT 1 XOR NULL;\n -> NULL\nmysql> SELECT 1 XOR 1 XOR 1;\n -> 1\n','http://dev.mysql.com/doc/refman/5.1/en/logical-operators.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (195,12,'STARTPOINT','StartPoint(ls)\n\nReturns the Point that is the start point of the LineString value ls.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/geometry-property-functions.html#linestring-property-functions\n\n','mysql> SET @ls = \'LineString(1 1,2 2,3 3)\';\nmysql> SELECT AsText(StartPoint(GeomFromText(@ls)));\n+---------------------------------------+\n| AsText(StartPoint(GeomFromText(@ls))) |\n+---------------------------------------+\n| POINT(1 1) |\n+---------------------------------------+\n','http://dev.mysql.com/doc/refman/5.1/en/geometry-property-functions.html#linestring-property-functions'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (196,22,'DECLARE VARIABLE','Syntax:\nDECLARE var_name [, var_name] ... type [DEFAULT value]\n\nThis statement is used to declare local variables within stored\nprograms. To provide a default value for the variable, include a\nDEFAULT clause. The value can be specified as an expression; it need\nnot be a constant. If the DEFAULT clause is missing, the initial value\nis NULL.\n\nLocal variables are treated like stored routine parameters with respect\nto data type and overflow checking. See [HELP CREATE PROCEDURE].\n\nLocal variable names are not case sensitive.\n\nThe scope of a local variable is within the BEGIN ... END block where\nit is declared. The variable can be referred to in blocks nested within\nthe declaring block, except those blocks that declare a variable with\nthe same name.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/declare-local-variable.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/declare-local-variable.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (197,9,'GRANT','Syntax:\nGRANT\n priv_type [(column_list)]\n [, priv_type [(column_list)]] ...\n ON [object_type] priv_level\n TO user [IDENTIFIED BY [PASSWORD] \'password\']\n [, user [IDENTIFIED BY [PASSWORD] \'password\']] ...\n [REQUIRE {NONE | ssl_option [[AND] ssl_option] ...}]\n [WITH with_option ...]\n\nobject_type:\n TABLE\n | FUNCTION\n | PROCEDURE\n\npriv_level:\n *\n | *.*\n | db_name.*\n | db_name.tbl_name\n | tbl_name\n | db_name.routine_name\n\nssl_option:\n SSL\n | X509\n | CIPHER \'cipher\'\n | ISSUER \'issuer\'\n | SUBJECT \'subject\'\n\nwith_option:\n GRANT OPTION\n | MAX_QUERIES_PER_HOUR count\n | MAX_UPDATES_PER_HOUR count\n | MAX_CONNECTIONS_PER_HOUR count\n | MAX_USER_CONNECTIONS count\n\nThe GRANT statement enables system administrators to grant privileges\nto MySQL user accounts. GRANT also serves to specify other account\ncharacteristics such as use of secure connections and limits on access\nto server resources. To use GRANT, you must have the GRANT OPTION\nprivilege, and you must have the privileges that you are granting.\n\nNormally, CREATE USER is used to create an account and GRANT to define\nits privileges. However, if an account named in a GRANT statement does\nnot already exist, GRANT may create it under the conditions described\nlater in the discussion of the NO_AUTO_CREATE_USER SQL mode.\n\nThe REVOKE statement is related to GRANT and enables administrators to\nremove account privileges. To determine what privileges an account has,\nuse SHOW GRANTS. See [HELP REVOKE], and [HELP SHOW GRANTS].\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/grant.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/grant.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (198,3,'MPOLYFROMTEXT','MPolyFromText(wkt[,srid]), MultiPolygonFromText(wkt[,srid])\n\nConstructs a MULTIPOLYGON value using its WKT representation and SRID.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/creating-spatial-values.html#gis-wkt-functions\n\n','','http://dev.mysql.com/doc/refman/5.1/en/creating-spatial-values.html#gis-wkt-functions'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (199,6,'MBRINTERSECTS','MBRIntersects(g1,g2)\n\nReturns 1 or 0 to indicate whether the Minimum Bounding Rectangles of\nthe two geometries g1 and g2 intersect.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/relations-on-geometry-mbr.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/relations-on-geometry-mbr.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (200,16,'BIT_OR','Syntax:\nBIT_OR(expr)\n\nReturns the bitwise OR of all bits in expr. The calculation is\nperformed with 64-bit (BIGINT) precision.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/group-by-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/group-by-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (201,30,'YEARWEEK','Syntax:\nYEARWEEK(date), YEARWEEK(date,mode)\n\nReturns year and week for a date. The mode argument works exactly like\nthe mode argument to WEEK(). The year in the result may be different\nfrom the year in the date argument for the first and the last week of\nthe year.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html\n\n','mysql> SELECT YEARWEEK(\'1987-01-01\');\n -> 198653\n','http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (202,17,'NOT BETWEEN','Syntax:\nexpr NOT BETWEEN min AND max\n\nThis is the same as NOT (expr BETWEEN min AND max).\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/comparison-operators.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/comparison-operators.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (203,17,'IS NOT','Syntax:\nIS NOT boolean_value\n\nTests a value against a boolean value, where boolean_value can be TRUE,\nFALSE, or UNKNOWN.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/comparison-operators.html\n\n','mysql> SELECT 1 IS NOT UNKNOWN, 0 IS NOT UNKNOWN, NULL IS NOT UNKNOWN;\n -> 1, 1, 0\n','http://dev.mysql.com/doc/refman/5.1/en/comparison-operators.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (204,4,'LOG10','Syntax:\nLOG10(X)\n\nReturns the base-10 logarithm of X.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/mathematical-functions.html\n\n','mysql> SELECT LOG10(2);\n -> 0.30102999566398\nmysql> SELECT LOG10(100);\n -> 2\nmysql> SELECT LOG10(-100);\n -> NULL\n','http://dev.mysql.com/doc/refman/5.1/en/mathematical-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (205,4,'SQRT','Syntax:\nSQRT(X)\n\nReturns the square root of a nonnegative number X.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/mathematical-functions.html\n\n','mysql> SELECT SQRT(4);\n -> 2\nmysql> SELECT SQRT(20);\n -> 4.4721359549996\nmysql> SELECT SQRT(-16);\n -> NULL\n','http://dev.mysql.com/doc/refman/5.1/en/mathematical-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (206,20,'DECIMAL','DECIMAL[(M[,D])] [UNSIGNED] [ZEROFILL]\n\nA packed "exact" fixed-point number. M is the total number of digits\n(the precision) and D is the number of digits after the decimal point\n(the scale). The decimal point and (for negative numbers) the "-" sign\nare not counted in M. If D is 0, values have no decimal point or\nfractional part. The maximum number of digits (M) for DECIMAL is 65.\nThe maximum number of supported decimals (D) is 30. If D is omitted,\nthe default is 0. If M is omitted, the default is 10.\n\nUNSIGNED, if specified, disallows negative values.\n\nAll basic calculations (+, -, *, /) with DECIMAL columns are done with\na precision of 65 digits.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/numeric-type-overview.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (207,37,'CREATE INDEX','Syntax:\nCREATE [ONLINE|OFFLINE] [UNIQUE|FULLTEXT|SPATIAL] INDEX index_name\n [index_type]\n ON tbl_name (index_col_name,...)\n [index_option] ...\n\nindex_col_name:\n col_name [(length)] [ASC | DESC]\n\nindex_type:\n USING {BTREE | HASH | RTREE}\n\nindex_option:\n KEY_BLOCK_SIZE [=] value\n | index_type\n | WITH PARSER parser_name\n\nCREATE INDEX is mapped to an ALTER TABLE statement to create indexes.\nSee [HELP ALTER TABLE]. CREATE INDEX cannot be used to create a PRIMARY\nKEY; use ALTER TABLE instead. For more information about indexes, see\nhttp://dev.mysql.com/doc/refman/5.1/en/mysql-indexes.html.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/create-index.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/create-index.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (208,37,'CREATE FUNCTION','The CREATE FUNCTION statement is used to create stored functions and\nuser-defined functions (UDFs):\n\no For information about creating stored functions, see [HELP CREATE\n PROCEDURE].\n\no For information about creating user-defined functions, see [HELP\n CREATE FUNCTION UDF].\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/create-function.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/create-function.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (209,37,'ALTER DATABASE','Syntax:\nALTER {DATABASE | SCHEMA} [db_name]\n alter_specification ...\nALTER {DATABASE | SCHEMA} db_name\n UPGRADE DATA DIRECTORY NAME\n\nalter_specification:\n [DEFAULT] CHARACTER SET [=] charset_name\n | [DEFAULT] COLLATE [=] collation_name\n\nALTER DATABASE enables you to change the overall characteristics of a\ndatabase. These characteristics are stored in the db.opt file in the\ndatabase directory. To use ALTER DATABASE, you need the ALTER privilege\non the database. ALTER SCHEMA is a synonym for ALTER DATABASE.\n\nThe CHARACTER SET clause changes the default database character set.\nThe COLLATE clause changes the default database collation.\nhttp://dev.mysql.com/doc/refman/5.1/en/charset.html, discusses\ncharacter set and collation names.\n\nYou can see what character sets and collations are available using,\nrespectively, the SHOW CHARACTER SET and SHOW COLLATION statements. See\n[HELP SHOW CHARACTER SET], and [HELP SHOW COLLATION], for more\ninformation.\n\nThe database name can be omitted from the first syntax, in which case\nthe statement applies to the default database.\n\nThe syntax that includes the UPGRADE DATA DIRECTORY NAME clause was\nadded in MySQL 5.1.23. It updates the name of the directory associated\nwith the database to use the encoding implemented in MySQL 5.1 for\nmapping database names to database directory names (see\nhttp://dev.mysql.com/doc/refman/5.1/en/identifier-mapping.html). This\nclause is for use under these conditions:\n\no It is intended when upgrading MySQL to 5.1 or later from older\n versions.\n\no It is intended to update a database directory name to the current\n encoding format if the name contains special characters that need\n encoding.\n\no The statement is used by mysqlcheck (as invoked by mysql_upgrade).\n\nFor example,if a database in MySQL 5.0 has a name of a-b-c, the name\ncontains instance of the `-\' character. In 5.0, the database directory\nis also named a-b-c, which is not necessarily safe for all file\nsystems. In MySQL 5.1 and up, the same database name is encoded as\na@002db@002dc to produce a file system-neutral directory name.\n\nWhen a MySQL installation is upgraded to MySQL 5.1 or later from an\nolder version,the server displays a name such as a-b-c (which is in the\nold format) as #mysql50#a-b-c, and you must refer to the name using the\n#mysql50# prefix. Use UPGRADE DATA DIRECTORY NAME in this case to\nexplicitly tell the server to re-encode the database directory name to\nthe current encoding format:\n\nALTER DATABASE `#mysql50#a-b-c` UPGRADE DATA DIRECTORY NAME;\n\nAfter executing this statement, you can refer to the database as a-b-c\nwithout the special #mysql50# prefix.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/alter-database.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/alter-database.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (210,24,'GEOMETRYN','GeometryN(gc,N)\n\nReturns the N-th geometry in the GeometryCollection value gc.\nGeometries are numbered beginning with 1.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/geometry-property-functions.html#geometrycollection-property-functions\n\n','mysql> SET @gc = \'GeometryCollection(Point(1 1),LineString(2 2, 3 3))\';\nmysql> SELECT AsText(GeometryN(GeomFromText(@gc),1));\n+----------------------------------------+\n| AsText(GeometryN(GeomFromText(@gc),1)) |\n+----------------------------------------+\n| POINT(1 1) |\n+----------------------------------------+\n','http://dev.mysql.com/doc/refman/5.1/en/geometry-property-functions.html#geometrycollection-property-functions'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (211,18,'<<','Syntax:\n<<\n\nShifts a longlong (BIGINT) number to the left.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/bit-functions.html\n\n','mysql> SELECT 1 << 2;\n -> 4\n','http://dev.mysql.com/doc/refman/5.1/en/bit-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (212,25,'SHOW TABLE STATUS','Syntax:\nSHOW TABLE STATUS [{FROM | IN} db_name]\n [LIKE \'pattern\' | WHERE expr]\n\nSHOW TABLE STATUS works likes SHOW TABLES, but provides a lot of\ninformation about each non-TEMPORARY table. You can also get this list\nusing the mysqlshow --status db_name command. The LIKE clause, if\npresent, indicates which table names to match. The WHERE clause can be\ngiven to select rows using more general conditions, as discussed in\nhttp://dev.mysql.com/doc/refman/5.1/en/extended-show.html.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/show-table-status.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/show-table-status.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (213,11,'MD5','Syntax:\nMD5(str)\n\nCalculates an MD5 128-bit checksum for the string. The value is\nreturned as a binary string of 32 hex digits, or NULL if the argument\nwas NULL. The return value can, for example, be used as a hash key.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/encryption-functions.html\n\n','mysql> SELECT MD5(\'testing\');\n -> \'ae2b1fca515949e5d54fb22b8ed95575\'\n','http://dev.mysql.com/doc/refman/5.1/en/encryption-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (214,17,'<','Syntax:\n<\n\nLess than:\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/comparison-operators.html\n\n','mysql> SELECT 2 < 2;\n -> 0\n','http://dev.mysql.com/doc/refman/5.1/en/comparison-operators.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (215,30,'UNIX_TIMESTAMP','Syntax:\nUNIX_TIMESTAMP(), UNIX_TIMESTAMP(date)\n\nIf called with no argument, returns a Unix timestamp (seconds since\n\'1970-01-01 00:00:00\' UTC) as an unsigned integer. If UNIX_TIMESTAMP()\nis called with a date argument, it returns the value of the argument as\nseconds since \'1970-01-01 00:00:00\' UTC. date may be a DATE string, a\nDATETIME string, a TIMESTAMP, or a number in the format YYMMDD or\nYYYYMMDD. The server interprets date as a value in the current time\nzone and converts it to an internal value in UTC. Clients can set their\ntime zone as described in\nhttp://dev.mysql.com/doc/refman/5.1/en/time-zone-support.html.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html\n\n','mysql> SELECT UNIX_TIMESTAMP();\n -> 1196440210\nmysql> SELECT UNIX_TIMESTAMP(\'2007-11-30 10:30:19\');\n -> 1196440219\n','http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (216,30,'DAYOFMONTH','Syntax:\nDAYOFMONTH(date)\n\nReturns the day of the month for date, in the range 1 to 31, or 0 for\ndates such as \'0000-00-00\' or \'2008-00-00\' that have a zero day part.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html\n\n','mysql> SELECT DAYOFMONTH(\'2007-02-03\');\n -> 3\n','http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (217,35,'ASCII','Syntax:\nASCII(str)\n\nReturns the numeric value of the leftmost character of the string str.\nReturns 0 if str is the empty string. Returns NULL if str is NULL.\nASCII() works for 8-bit characters.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/string-functions.html\n\n','mysql> SELECT ASCII(\'2\');\n -> 50\nmysql> SELECT ASCII(2);\n -> 50\nmysql> SELECT ASCII(\'dx\');\n -> 100\n','http://dev.mysql.com/doc/refman/5.1/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (218,4,'DIV','Syntax:\nDIV\n\nInteger division. Similar to FLOOR(), but is safe with BIGINT values.\nIncorrect results may occur for noninteger operands that exceed BIGINT\nrange.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/arithmetic-functions.html\n\n','mysql> SELECT 5 DIV 2;\n -> 2\n','http://dev.mysql.com/doc/refman/5.1/en/arithmetic-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (219,9,'RENAME USER','Syntax:\nRENAME USER old_user TO new_user\n [, old_user TO new_user] ...\n\nThe RENAME USER statement renames existing MySQL accounts. To use it,\nyou must have the global CREATE USER privilege or the UPDATE privilege\nfor the mysql database. An error occurs if any old account does not\nexist or any new account exists. Each account is named using the same\nformat as for the GRANT statement; for example, \'jeffrey\'@\'localhost\'.\nIf you specify only the user name part of the account name, a host name\npart of \'%\' is used. For additional information about specifying\naccount names, see [HELP GRANT].\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/rename-user.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/rename-user.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (220,25,'SHOW SLAVE STATUS','Syntax:\nSHOW SLAVE STATUS\n\nThis statement provides status information on essential parameters of\nthe slave threads. It requires either the SUPER or REPLICATION CLIENT\nprivilege.\n\nIf you issue this statement using the mysql client, you can use a \\G\nstatement terminator rather than a semicolon to obtain a more readable\nvertical layout:\n\nmysql> SHOW SLAVE STATUS\\G\n*************************** 1. row ***************************\n Slave_IO_State: Waiting for master to send event\n Master_Host: localhost\n Master_User: root\n Master_Port: 3306\n Connect_Retry: 3\n Master_Log_File: gbichot-bin.005\n Read_Master_Log_Pos: 79\n Relay_Log_File: gbichot-relay-bin.005\n Relay_Log_Pos: 548\n Relay_Master_Log_File: gbichot-bin.005\n Slave_IO_Running: Yes\n Slave_SQL_Running: Yes\n Replicate_Do_DB:\n Replicate_Ignore_DB:\n Replicate_Do_Table:\n Replicate_Ignore_Table:\n Replicate_Wild_Do_Table:\n Replicate_Wild_Ignore_Table:\n Last_Errno: 0\n Last_Error:\n Skip_Counter: 0\n Exec_Master_Log_Pos: 79\n Relay_Log_Space: 552\n Until_Condition: None\n Until_Log_File:\n Until_Log_Pos: 0\n Master_SSL_Allowed: No\n Master_SSL_CA_File:\n Master_SSL_CA_Path:\n Master_SSL_Cert:\n Master_SSL_Cipher:\n Master_SSL_Key:\n Seconds_Behind_Master: 8\nMaster_SSL_Verify_Server_Cert: No\n Last_IO_Errno: 0\n Last_IO_Error:\n Last_SQL_Errno: 0\n Last_SQL_Error:\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/show-slave-status.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/show-slave-status.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (221,32,'GEOMETRY','MySQL provides a standard way of creating spatial columns for geometry\ntypes, for example, with CREATE TABLE or ALTER TABLE. Currently,\nspatial columns are supported for MyISAM, InnoDB, NDB, and ARCHIVE\ntables. See also the annotations about spatial indexes under [HELP\nSPATIAL].\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/creating-spatial-columns.html\n\n','CREATE TABLE geom (g GEOMETRY);\n','http://dev.mysql.com/doc/refman/5.1/en/creating-spatial-columns.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (222,12,'NUMPOINTS','NumPoints(ls)\n\nReturns the number of Point objects in the LineString value ls.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/geometry-property-functions.html#linestring-property-functions\n\n','mysql> SET @ls = \'LineString(1 1,2 2,3 3)\';\nmysql> SELECT NumPoints(GeomFromText(@ls));\n+------------------------------+\n| NumPoints(GeomFromText(@ls)) |\n+------------------------------+\n| 3 |\n+------------------------------+\n','http://dev.mysql.com/doc/refman/5.1/en/geometry-property-functions.html#linestring-property-functions'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (223,37,'ALTER LOGFILE GROUP','Syntax:\nALTER LOGFILE GROUP logfile_group\n ADD UNDOFILE \'file_name\'\n [INITIAL_SIZE [=] size]\n [WAIT]\n ENGINE [=] engine_name\n\nThis statement adds an UNDO file named \'file_name\' to an existing log\nfile group logfile_group. An ALTER LOGFILE GROUP statement has one and\nonly one ADD UNDOFILE clause. No DROP UNDOFILE clause is currently\nsupported.\n\n*Note*: All MySQL Cluster Disk Data objects share the same namespace.\nThis means that each Disk Data object must be uniquely named (and not\nmerely each Disk Data object of a given type). For example, you cannot\nhave a tablespace and an undo log file with the same name, or an undo\nlog file and a data file with the same name.\n\nPrior to MySQL Cluster NDB 6.2.17, 6.3.23, and 6.4.3, path and file\nnames for undo log files could not be longer than 128 characters.\n(Bug#31769 (http://bugs.mysql.com/bug.php?id=31769))\n\nThe optional INITIAL_SIZE parameter sets the UNDO file\'s initial size\nin bytes; if not specified, the initial size default to 128M (128\nmegabytes). You may optionally follow size with a one-letter\nabbreviation for an order of magnitude, similar to those used in\nmy.cnf. Generally, this is one of the letters M (for megabytes) or G\n(for gigabytes).\n\nOn 32-bit systems, the maximum supported value for INITIAL_SIZE is 4G.\n(Bug#29186 (http://bugs.mysql.com/bug.php?id=29186))\n\nBeginning with MySQL Cluster NDB 2.1.18, 6.3.24, and 7.0.4, the minimum\nallowed value for INITIAL_SIZE is 1M. (Bug#29574\n(http://bugs.mysql.com/bug.php?id=29574))\n\n*Note*: WAIT is parsed but otherwise ignored, and so has no effect in\nMySQL 5.1 and MySQL Cluster NDB 6.x. It is intended for future\nexpansion.\n\nThe ENGINE parameter (required) determines the storage engine which is\nused by this log file group, with engine_name being the name of the\nstorage engine. In MySQL 5.1 and MySQL Cluster NDB 6.x, the only\naccepted values for engine_name are "NDBCLUSTER" and "NDB". The two\nvalues are equivalent.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/alter-logfile-group.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/alter-logfile-group.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (224,18,'&','Syntax:\n&\n\nBitwise AND:\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/bit-functions.html\n\n','mysql> SELECT 29 & 15;\n -> 13\n','http://dev.mysql.com/doc/refman/5.1/en/bit-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (225,30,'LOCALTIMESTAMP','Syntax:\nLOCALTIMESTAMP, LOCALTIMESTAMP()\n\nLOCALTIMESTAMP and LOCALTIMESTAMP() are synonyms for NOW().\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (226,35,'CONVERT','Syntax:\nCONVERT(expr,type), CONVERT(expr USING transcoding_name)\n\nThe CONVERT() and CAST() functions take a value of one type and produce\na value of another type.\n\nThe type can be one of the following values:\n\no BINARY[(N)]\n\no CHAR[(N)]\n\no DATE\n\no DATETIME\n\no DECIMAL[(M[,D])]\n\no SIGNED [INTEGER]\n\no TIME\n\no UNSIGNED [INTEGER]\n\nBINARY produces a string with the BINARY data type. See\nhttp://dev.mysql.com/doc/refman/5.1/en/binary-varbinary.html for a\ndescription of how this affects comparisons. If the optional length N\nis given, BINARY(N) causes the cast to use no more than N bytes of the\nargument. Values shorter than N bytes are padded with 0x00 bytes to a\nlength of N.\n\nCHAR(N) causes the cast to use no more than N characters of the\nargument.\n\nCAST() and CONVERT(... USING ...) are standard SQL syntax. The\nnon-USING form of CONVERT() is ODBC syntax.\n\nCONVERT() with USING is used to convert data between different\ncharacter sets. In MySQL, transcoding names are the same as the\ncorresponding character set names. For example, this statement converts\nthe string \'abc\' in the default character set to the corresponding\nstring in the utf8 character set:\n\nSELECT CONVERT(\'abc\' USING utf8);\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/cast-functions.html\n\n','SELECT enum_col FROM tbl_name ORDER BY CAST(enum_col AS CHAR);\n','http://dev.mysql.com/doc/refman/5.1/en/cast-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (227,30,'ADDDATE','Syntax:\nADDDATE(date,INTERVAL expr unit), ADDDATE(expr,days)\n\nWhen invoked with the INTERVAL form of the second argument, ADDDATE()\nis a synonym for DATE_ADD(). The related function SUBDATE() is a\nsynonym for DATE_SUB(). For information on the INTERVAL unit argument,\nsee the discussion for DATE_ADD().\n\nmysql> SELECT DATE_ADD(\'2008-01-02\', INTERVAL 31 DAY);\n -> \'2008-02-02\'\nmysql> SELECT ADDDATE(\'2008-01-02\', INTERVAL 31 DAY);\n -> \'2008-02-02\'\n\nWhen invoked with the days form of the second argument, MySQL treats it\nas an integer number of days to be added to expr.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html\n\n','mysql> SELECT ADDDATE(\'2008-01-02\', 31);\n -> \'2008-02-02\'\n','http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (228,22,'REPEAT LOOP','Syntax:\n[begin_label:] REPEAT\n statement_list\nUNTIL search_condition\nEND REPEAT [end_label]\n\nThe statement list within a REPEAT statement is repeated until the\nsearch_condition is true. Thus, a REPEAT always enters the loop at\nleast once. statement_list consists of one or more statements, each\nterminated by a semicolon (;) statement delimiter.\n\nA REPEAT statement can be labeled. See [HELP BEGIN END] for the rules\nregarding label use.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/repeat-statement.html\n\n','mysql> delimiter //\n\nmysql> CREATE PROCEDURE dorepeat(p1 INT)\n -> BEGIN\n -> SET @x = 0;\n -> REPEAT SET @x = @x + 1; UNTIL @x > p1 END REPEAT;\n -> END\n -> //\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> CALL dorepeat(1000)//\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> SELECT @x//\n+------+\n| @x |\n+------+\n| 1001 |\n+------+\n1 row in set (0.00 sec)\n','http://dev.mysql.com/doc/refman/5.1/en/repeat-statement.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (229,37,'ALTER FUNCTION','Syntax:\nALTER FUNCTION func_name [characteristic ...]\n\ncharacteristic:\n { CONTAINS SQL | NO SQL | READS SQL DATA | MODIFIES SQL DATA }\n | SQL SECURITY { DEFINER | INVOKER }\n | COMMENT \'string\'\n\nThis statement can be used to change the characteristics of a stored\nfunction. More than one change may be specified in an ALTER FUNCTION\nstatement. However, you cannot change the parameters or body of a\nstored function using this statement; to make such changes, you must\ndrop and re-create the function using DROP FUNCTION and CREATE\nFUNCTION.\n\nYou must have the ALTER ROUTINE privilege for the function. (That\nprivilege is granted automatically to the function creator.) If binary\nlogging is enabled, the ALTER FUNCTION statement might also require the\nSUPER privilege, as described in\nhttp://dev.mysql.com/doc/refman/5.1/en/stored-programs-logging.html.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/alter-function.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/alter-function.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (230,20,'SMALLINT','SMALLINT[(M)] [UNSIGNED] [ZEROFILL]\n\nA small integer. The signed range is -32768 to 32767. The unsigned\nrange is 0 to 65535.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/numeric-type-overview.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (231,20,'DOUBLE PRECISION','DOUBLE PRECISION[(M,D)] [UNSIGNED] [ZEROFILL], REAL[(M,D)] [UNSIGNED]\n[ZEROFILL]\n\nThese types are synonyms for DOUBLE. Exception: If the REAL_AS_FLOAT\nSQL mode is enabled, REAL is a synonym for FLOAT rather than DOUBLE.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/numeric-type-overview.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (232,35,'ORD','Syntax:\nORD(str)\n\nIf the leftmost character of the string str is a multi-byte character,\nreturns the code for that character, calculated from the numeric values\nof its constituent bytes using this formula:\n\n (1st byte code)\n+ (2nd byte code x 256)\n+ (3rd byte code x 2562) ...\n\nIf the leftmost character is not a multi-byte character, ORD() returns\nthe same value as the ASCII() function.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/string-functions.html\n\n','mysql> SELECT ORD(\'2\');\n -> 50\n','http://dev.mysql.com/doc/refman/5.1/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (233,25,'DEALLOCATE PREPARE','Syntax:\n{DEALLOCATE | DROP} PREPARE stmt_name\n\nTo deallocate a prepared statement produced with PREPARE, use a\nDEALLOCATE PREPARE statement that refers to the prepared statement\nname. Attempting to execute a prepared statement after deallocating it\nresults in an error.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/deallocate-prepare.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/deallocate-prepare.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (234,34,'ENVELOPE','Envelope(g)\n\nReturns the Minimum Bounding Rectangle (MBR) for the geometry value g.\nThe result is returned as a Polygon value.\n\nThe polygon is defined by the corner points of the bounding box:\n\nPOLYGON((MINX MINY, MAXX MINY, MAXX MAXY, MINX MAXY, MINX MINY))\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/geometry-property-functions.html#general-geometry-property-functions\n\n','mysql> SELECT AsText(Envelope(GeomFromText(\'LineString(1 1,2 2)\')));\n+-------------------------------------------------------+\n| AsText(Envelope(GeomFromText(\'LineString(1 1,2 2)\'))) |\n+-------------------------------------------------------+\n| POLYGON((1 1,2 1,2 2,1 2,1 1)) |\n+-------------------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.1/en/geometry-property-functions.html#general-geometry-property-functions'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (235,14,'IS_FREE_LOCK','Syntax:\nIS_FREE_LOCK(str)\n\nChecks whether the lock named str is free to use (that is, not locked).\nReturns 1 if the lock is free (no one is using the lock), 0 if the lock\nis in use, and NULL if an error occurs (such as an incorrect argument).\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/miscellaneous-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/miscellaneous-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (236,29,'TOUCHES','Touches(g1,g2)\n\nReturns 1 or 0 to indicate whether g1 spatially touches g2. Two\ngeometries spatially touch if the interiors of the geometries do not\nintersect, but the boundary of one of the geometries intersects either\nthe boundary or the interior of the other.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/functions-that-test-spatial-relationships-between-geometries.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/functions-that-test-spatial-relationships-between-geometries.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (237,14,'INET_ATON','Syntax:\nINET_ATON(expr)\n\nGiven the dotted-quad representation of a network address as a string,\nreturns an integer that represents the numeric value of the address.\nAddresses may be 4- or 8-byte addresses.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/miscellaneous-functions.html\n\n','mysql> SELECT INET_ATON(\'209.207.224.40\');\n -> 3520061480\n','http://dev.mysql.com/doc/refman/5.1/en/miscellaneous-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (238,11,'UNCOMPRESS','Syntax:\nUNCOMPRESS(string_to_uncompress)\n\nUncompresses a string compressed by the COMPRESS() function. If the\nargument is not a compressed value, the result is NULL. This function\nrequires MySQL to have been compiled with a compression library such as\nzlib. Otherwise, the return value is always NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/encryption-functions.html\n\n','mysql> SELECT UNCOMPRESS(COMPRESS(\'any string\'));\n -> \'any string\'\nmysql> SELECT UNCOMPRESS(\'any string\');\n -> NULL\n','http://dev.mysql.com/doc/refman/5.1/en/encryption-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (239,20,'AUTO_INCREMENT','The AUTO_INCREMENT attribute can be used to generate a unique identity\nfor new rows:\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/example-auto-increment.html\n\n','CREATE TABLE animals (\n id MEDIUMINT NOT NULL AUTO_INCREMENT,\n name CHAR(30) NOT NULL,\n PRIMARY KEY (id)\n );\n\nINSERT INTO animals (name) VALUES\n (\'dog\'),(\'cat\'),(\'penguin\'),\n (\'lax\'),(\'whale\'),(\'ostrich\');\n\nSELECT * FROM animals;\n','http://dev.mysql.com/doc/refman/5.1/en/example-auto-increment.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (240,34,'ISSIMPLE','IsSimple(g)\n\nCurrently, this function is a placeholder and should not be used. If\nimplemented, its behavior will be as described in the next paragraph.\n\nReturns 1 if the geometry value g has no anomalous geometric points,\nsuch as self-intersection or self-tangency. IsSimple() returns 0 if the\nargument is not simple, and -1 if it is NULL.\n\nThe description of each instantiable geometric class given earlier in\nthe chapter includes the specific conditions that cause an instance of\nthat class to be classified as not simple. (See [HELP Geometry\nhierarchy].)\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/geometry-property-functions.html#general-geometry-property-functions\n\n','','http://dev.mysql.com/doc/refman/5.1/en/geometry-property-functions.html#general-geometry-property-functions'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (241,4,'- BINARY','Syntax:\n-\n\nSubtraction:\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/arithmetic-functions.html\n\n','mysql> SELECT 3-5;\n -> -2\n','http://dev.mysql.com/doc/refman/5.1/en/arithmetic-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (242,3,'GEOMCOLLFROMTEXT','GeomCollFromText(wkt[,srid]), GeometryCollectionFromText(wkt[,srid])\n\nConstructs a GEOMETRYCOLLECTION value using its WKT representation and\nSRID.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/creating-spatial-values.html#gis-wkt-functions\n\n','','http://dev.mysql.com/doc/refman/5.1/en/creating-spatial-values.html#gis-wkt-functions'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (243,3,'WKT DEFINITION','The Well-Known Text (WKT) representation of Geometry is designed to\nexchange geometry data in ASCII form.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/gis-wkt-format.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/gis-wkt-format.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (244,30,'CURRENT_TIME','Syntax:\nCURRENT_TIME, CURRENT_TIME()\n\nCURRENT_TIME and CURRENT_TIME() are synonyms for CURTIME().\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (245,9,'REVOKE','Syntax:\nREVOKE\n priv_type [(column_list)]\n [, priv_type [(column_list)]] ...\n ON [object_type] priv_level\n FROM user [, user] ...\n\nREVOKE ALL PRIVILEGES, GRANT OPTION\n FROM user [, user] ...\n\nThe REVOKE statement enables system administrators to revoke privileges\nfrom MySQL accounts. Each account is named using the same format as for\nthe GRANT statement; for example, \'jeffrey\'@\'localhost\'. If you specify\nonly the user name part of the account name, a host name part of \'%\' is\nused. For details on the levels at which privileges exist, the\nallowable priv_type and priv_level values, and the syntax for\nspecifying users and passwords, see [HELP GRANT]\n\nTo use the first REVOKE syntax, you must have the GRANT OPTION\nprivilege, and you must have the privileges that you are revoking.\n\nTo revoke all privileges, use the second syntax, which drops all\nglobal, database, table, column, and routine privileges for the named\nuser or users:\n\nREVOKE ALL PRIVILEGES, GRANT OPTION FROM user [, user] ...\n\nTo use this REVOKE syntax, you must have the global CREATE USER\nprivilege or the UPDATE privilege for the mysql database.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/revoke.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/revoke.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (246,15,'LAST_INSERT_ID','Syntax:\nLAST_INSERT_ID(), LAST_INSERT_ID(expr)\n\nFor MySQL 5.1.12 and later, LAST_INSERT_ID() (no arguments) returns the\nfirst automatically generated value successfully inserted for an\nAUTO_INCREMENT column as a result of the most recently executed INSERT\nstatement. The value of LAST_INSERT_ID() remains unchanged if no rows\nare successfully inserted.\n\nFor example, after inserting a row that generates an AUTO_INCREMENT\nvalue, you can get the value like this:\n\nmysql> SELECT LAST_INSERT_ID();\n -> 195\n\nIn MySQL 5.1.11 and earlier, LAST_INSERT_ID() (no arguments) returns\nthe first automatically generated value if any rows were successfully\ninserted or updated. This means that the returned value could be a\nvalue that was not successfully inserted into the table. If no rows\nwere successfully inserted, LAST_INSERT_ID() returns 0.\n\nThe value of LAST_INSERT_ID() will be consistent across all versions if\nall rows in the INSERT or UPDATE statement were successful.\n\nif a table contains an AUTO_INCREMENT column and INSERT ... ON\nDUPLICATE KEY UPDATE updates (rather than inserts) a row, the value of\nLAST_INSERT_ID() is not meaningful prior to MySQL 5.1.12. For a\nworkaround, see\nhttp://dev.mysql.com/doc/refman/5.1/en/insert-on-duplicate.html.\n\nThe currently executing statement does not affect the value of\nLAST_INSERT_ID(). Suppose that you generate an AUTO_INCREMENT value\nwith one statement, and then refer to LAST_INSERT_ID() in a\nmultiple-row INSERT statement that inserts rows into a table with its\nown AUTO_INCREMENT column. The value of LAST_INSERT_ID() will remain\nstable in the second statement; its value for the second and later rows\nis not affected by the earlier row insertions. (However, if you mix\nreferences to LAST_INSERT_ID() and LAST_INSERT_ID(expr), the effect is\nundefined.)\n\nIf the previous statement returned an error, the value of\nLAST_INSERT_ID() is undefined. For transactional tables, if the\nstatement is rolled back due to an error, the value of LAST_INSERT_ID()\nis left undefined. For manual ROLLBACK, the value of LAST_INSERT_ID()\nis not restored to that before the transaction; it remains as it was at\nthe point of the ROLLBACK.\n\nWithin the body of a stored routine (procedure or function) or a\ntrigger, the value of LAST_INSERT_ID() changes the same way as for\nstatements executed outside the body of these kinds of objects. The\neffect of a stored routine or trigger upon the value of\nLAST_INSERT_ID() that is seen by following statements depends on the\nkind of routine:\n\no If a stored procedure executes statements that change the value of\n LAST_INSERT_ID(), the changed value will be seen by statements that\n follow the procedure call.\n\no For stored functions and triggers that change the value, the value is\n restored when the function or trigger ends, so following statements\n will not see a changed value.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/information-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/information-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (247,30,'LAST_DAY','Syntax:\nLAST_DAY(date)\n\nTakes a date or datetime value and returns the corresponding value for\nthe last day of the month. Returns NULL if the argument is invalid.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html\n\n','mysql> SELECT LAST_DAY(\'2003-02-05\');\n -> \'2003-02-28\'\nmysql> SELECT LAST_DAY(\'2004-02-05\');\n -> \'2004-02-29\'\nmysql> SELECT LAST_DAY(\'2004-01-01 01:01:01\');\n -> \'2004-01-31\'\nmysql> SELECT LAST_DAY(\'2003-03-32\');\n -> NULL\n','http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (248,20,'MEDIUMINT','MEDIUMINT[(M)] [UNSIGNED] [ZEROFILL]\n\nA medium-sized integer. The signed range is -8388608 to 8388607. The\nunsigned range is 0 to 16777215.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/numeric-type-overview.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (249,4,'FLOOR','Syntax:\nFLOOR(X)\n\nReturns the largest integer value not greater than X.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/mathematical-functions.html\n\n','mysql> SELECT FLOOR(1.23);\n -> 1\nmysql> SELECT FLOOR(-1.23);\n -> -2\n','http://dev.mysql.com/doc/refman/5.1/en/mathematical-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (250,35,'RTRIM','Syntax:\nRTRIM(str)\n\nReturns the string str with trailing space characters removed.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/string-functions.html\n\n','mysql> SELECT RTRIM(\'barbar \');\n -> \'barbar\'\n','http://dev.mysql.com/doc/refman/5.1/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (251,27,'EXPLAIN','Syntax:\nEXPLAIN tbl_name\n\nOr:\n\nEXPLAIN [EXTENDED | PARTITIONS] SELECT select_options\n\nThe EXPLAIN statement can be used either as a synonym for DESCRIBE or\nas a way to obtain information about how MySQL executes a SELECT\nstatement:\n\no EXPLAIN tbl_name is synonymous with DESCRIBE tbl_name or SHOW COLUMNS\n FROM tbl_name.\n\n For a description of the DESCRIBE and SHOW COLUMNS statements, see\n [HELP DESCRIBE], and [HELP SHOW COLUMNS].\n\no When you precede a SELECT statement with the keyword EXPLAIN, MySQL\n displays information from the optimizer about the query execution\n plan. That is, MySQL explains how it would process the SELECT,\n including information about how tables are joined and in which order.\n EXPLAIN EXTENDED can be used to provide additional information.\n\n For information regarding the use of EXPLAIN and EXPLAIN EXTENDED for\n obtaining query execution plan information, see\n http://dev.mysql.com/doc/refman/5.1/en/using-explain.html.\n\no EXPLAIN PARTITIONS is available beginning with MySQL 5.1.5. It is\n useful only when examining queries involving partitioned tables.\n\n For details, see\n http://dev.mysql.com/doc/refman/5.1/en/partitioning-info.html.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/explain.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/explain.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (252,4,'DEGREES','Syntax:\nDEGREES(X)\n\nReturns the argument X, converted from radians to degrees.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/mathematical-functions.html\n\n','mysql> SELECT DEGREES(PI());\n -> 180\nmysql> SELECT DEGREES(PI() / 2);\n -> 90\n','http://dev.mysql.com/doc/refman/5.1/en/mathematical-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (253,20,'VARCHAR','[NATIONAL] VARCHAR(M) [CHARACTER SET charset_name] [COLLATE\ncollation_name]\n\nA variable-length string. M represents the maximum column length in\ncharacters. The range of M is 0 to 65,535. The effective maximum length\nof a VARCHAR is subject to the maximum row size (65,535 bytes, which is\nshared among all columns) and the character set used. For example, utf8\ncharacters can require up to three bytes per character, so a VARCHAR\ncolumn that uses the utf8 character set can be declared to be a maximum\nof 21,844 characters.\n\nMySQL stores VARCHAR values as a one-byte or two-byte length prefix\nplus data. The length prefix indicates the number of bytes in the\nvalue. A VARCHAR column uses one length byte if values require no more\nthan 255 bytes, two length bytes if values may require more than 255\nbytes.\n\n*Note*: MySQL 5.1 follows the standard SQL specification, and does not\nremove trailing spaces from VARCHAR values.\n\nVARCHAR is shorthand for CHARACTER VARYING. NATIONAL VARCHAR is the\nstandard SQL way to define that a VARCHAR column should use some\npredefined character set. MySQL 4.1 and up uses utf8 as this predefined\ncharacter set.\nhttp://dev.mysql.com/doc/refman/5.1/en/charset-national.html. NVARCHAR\nis shorthand for NATIONAL VARCHAR.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/string-type-overview.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (254,35,'UNHEX','Syntax:\n\nUNHEX(str)\n\nPerforms the inverse operation of HEX(str). That is, it interprets each\npair of hexadecimal digits in the argument as a number and converts it\nto the character represented by the number. The resulting characters\nare returned as a binary string.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/string-functions.html\n\n','mysql> SELECT UNHEX(\'4D7953514C\');\n -> \'MySQL\'\nmysql> SELECT 0x4D7953514C;\n -> \'MySQL\'\nmysql> SELECT UNHEX(HEX(\'string\'));\n -> \'string\'\nmysql> SELECT HEX(UNHEX(\'1267\'));\n -> \'1267\'\n','http://dev.mysql.com/doc/refman/5.1/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (255,4,'- UNARY','Syntax:\n-\n\nUnary minus. This operator changes the sign of the argument.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/arithmetic-functions.html\n\n','mysql> SELECT - 2;\n -> -2\n','http://dev.mysql.com/doc/refman/5.1/en/arithmetic-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (256,22,'SELECT INTO','Syntax:\nSELECT col_name [, col_name] ...\n INTO var_name [, var_name] ...\n table_expr\n\nSELECT ... INTO syntax enables selected columns to be stored directly\ninto variables. The query should return a single row. If the query\nreturns no rows, a warning with error code 1329 occurs (No data), and\nthe variable values remain unchanged. If the query returns multiple\nrows, error 1172 occurs (Result consisted of more than one row). If it\nis possible that the statement may retrieve multiple rows, you can use\nLIMIT 1 to limit the result set to a single row.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/select-into-statement.html\n\n','SELECT id,data INTO x,y FROM test.t1 LIMIT 1;\n','http://dev.mysql.com/doc/refman/5.1/en/select-into-statement.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (257,16,'STD','Syntax:\nSTD(expr)\n\nReturns the population standard deviation of expr. This is an extension\nto standard SQL. The standard SQL function STDDEV_POP() can be used\ninstead.\n\nThis function returns NULL if there were no matching rows.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/group-by-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/group-by-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (258,4,'COS','Syntax:\nCOS(X)\n\nReturns the cosine of X, where X is given in radians.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/mathematical-functions.html\n\n','mysql> SELECT COS(PI());\n -> -1\n','http://dev.mysql.com/doc/refman/5.1/en/mathematical-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (259,30,'DATE FUNCTION','Syntax:\nDATE(expr)\n\nExtracts the date part of the date or datetime expression expr.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html\n\n','mysql> SELECT DATE(\'2003-12-31 01:02:03\');\n -> \'2003-12-31\'\n','http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (260,37,'DROP TRIGGER','Syntax:\nDROP TRIGGER [IF EXISTS] [schema_name.]trigger_name\n\nThis statement drops a trigger. The schema (database) name is optional.\nIf the schema is omitted, the trigger is dropped from the default\nschema. DROP TRIGGER was added in MySQL 5.0.2. Its use requires the\nTRIGGER privilege for the table associated with the trigger. (This\nstatement requires the SUPER privilege prior to MySQL 5.1.6.)\n\nUse IF EXISTS to prevent an error from occurring for a trigger that\ndoes not exist. A NOTE is generated for a nonexistent trigger when\nusing IF EXISTS. See [HELP SHOW WARNINGS]. The IF EXISTS clause was\nadded in MySQL 5.1.14.\n\nTriggers for a table are also dropped if you drop the table.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/drop-trigger.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/drop-trigger.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (261,25,'RESET MASTER','Syntax:\nRESET MASTER\n\nDeletes all binary log files listed in the index file, resets the\nbinary log index file to be empty, and creates a new binary log file.\nThis statement is intended to be used only when the master is started\nfor the first time.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/reset-master.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/reset-master.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (262,4,'TAN','Syntax:\nTAN(X)\n\nReturns the tangent of X, where X is given in radians.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/mathematical-functions.html\n\n','mysql> SELECT TAN(PI());\n -> -1.2246063538224e-16\nmysql> SELECT TAN(PI()+1);\n -> 1.5574077246549\n','http://dev.mysql.com/doc/refman/5.1/en/mathematical-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (263,4,'PI','Syntax:\nPI()\n\nReturns the value of π (pi). The default number of decimal places\ndisplayed is seven, but MySQL uses the full double-precision value\ninternally.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/mathematical-functions.html\n\n','mysql> SELECT PI();\n -> 3.141593\nmysql> SELECT PI()+0.000000000000000000;\n -> 3.141592653589793116\n','http://dev.mysql.com/doc/refman/5.1/en/mathematical-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (264,30,'WEEKOFYEAR','Syntax:\nWEEKOFYEAR(date)\n\nReturns the calendar week of the date as a number in the range from 1\nto 53. WEEKOFYEAR() is a compatibility function that is equivalent to\nWEEK(date,3).\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html\n\n','mysql> SELECT WEEKOFYEAR(\'2008-02-20\');\n -> 8\n','http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (265,4,'/','Syntax:\n/\n\nDivision:\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/arithmetic-functions.html\n\n','mysql> SELECT 3/5;\n -> 0.60\n','http://dev.mysql.com/doc/refman/5.1/en/arithmetic-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (266,25,'PURGE BINARY LOGS','Syntax:\nPURGE { BINARY | MASTER } LOGS\n { TO \'log_name\' | BEFORE datetime_expr }\n\nThe binary log is a set of files that contain information about data\nmodifications made by the MySQL server. The log consists of a set of\nbinary log files, plus an index file (see\nhttp://dev.mysql.com/doc/refman/5.1/en/binary-log.html).\n\nThe PURGE BINARY LOGS statement deletes all the binary log files listed\nin the log index file prior to the specified log file name or date.\nBINARY and MASTER are synonyms. Deleted log files also are removed from\nthe list recorded in the index file, so that the given log file becomes\nthe first in the list.\n\nThis statement has no effect if the server was not started with the\n--log-bin option to enable binary logging.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/purge-binary-logs.html\n\n','PURGE BINARY LOGS TO \'mysql-bin.010\';\nPURGE BINARY LOGS BEFORE \'2008-04-02 22:46:26\';\n','http://dev.mysql.com/doc/refman/5.1/en/purge-binary-logs.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (267,16,'STDDEV_SAMP','Syntax:\nSTDDEV_SAMP(expr)\n\nReturns the sample standard deviation of expr (the square root of\nVAR_SAMP().\n\nSTDDEV_SAMP() returns NULL if there were no matching rows.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/group-by-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/group-by-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (268,15,'SCHEMA','Syntax:\nSCHEMA()\n\nThis function is a synonym for DATABASE().\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/information-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/information-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (269,31,'MLINEFROMWKB','MLineFromWKB(wkb[,srid]), MultiLineStringFromWKB(wkb[,srid])\n\nConstructs a MULTILINESTRING value using its WKB representation and\nSRID.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/creating-spatial-values.html#gis-wkb-functions\n\n','','http://dev.mysql.com/doc/refman/5.1/en/creating-spatial-values.html#gis-wkb-functions'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (270,4,'LOG2','Syntax:\nLOG2(X)\n\nReturns the base-2 logarithm of X.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/mathematical-functions.html\n\n','mysql> SELECT LOG2(65536);\n -> 16\nmysql> SELECT LOG2(-100);\n -> NULL\n','http://dev.mysql.com/doc/refman/5.1/en/mathematical-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (271,30,'SUBTIME','Syntax:\nSUBTIME(expr1,expr2)\n\nSUBTIME() returns expr1 - expr2 expressed as a value in the same format\nas expr1. expr1 is a time or datetime expression, and expr2 is a time\nexpression.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html\n\n','mysql> SELECT SUBTIME(\'2007-12-31 23:59:59.999999\',\'1 1:1:1.000002\');\n -> \'2007-12-30 22:58:58.999997\'\nmysql> SELECT SUBTIME(\'01:00:00.999999\', \'02:00:00.999998\');\n -> \'-00:59:59.999999\'\n','http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (272,11,'UNCOMPRESSED_LENGTH','Syntax:\nUNCOMPRESSED_LENGTH(compressed_string)\n\nReturns the length that the compressed string had before being\ncompressed.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/encryption-functions.html\n\n','mysql> SELECT UNCOMPRESSED_LENGTH(COMPRESS(REPEAT(\'a\',30)));\n -> 30\n','http://dev.mysql.com/doc/refman/5.1/en/encryption-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (273,37,'DROP TABLE','Syntax:\nDROP [TEMPORARY] TABLE [IF EXISTS]\n tbl_name [, tbl_name] ...\n [RESTRICT | CASCADE]\n\nDROP TABLE removes one or more tables. You must have the DROP privilege\nfor each table. All table data and the table definition are removed, so\nbe careful with this statement! If any of the tables named in the\nargument list do not exist, MySQL returns an error indicating by name\nwhich nonexisting tables it was unable to drop, but it also drops all\nof the tables in the list that do exist.\n\n*Important*: When a table is dropped, user privileges on the table are\nnot automatically dropped. See [HELP GRANT].\n\nNote that for a partitioned table, DROP TABLE permanently removes the\ntable definition, all of its partitions, and all of the data which was\nstored in those partitions. It also removes the partitioning definition\n(.par) file associated with the dropped table.\n\nUse IF EXISTS to prevent an error from occurring for tables that do not\nexist. A NOTE is generated for each nonexistent table when using IF\nEXISTS. See [HELP SHOW WARNINGS].\n\nRESTRICT and CASCADE are allowed to make porting easier. In MySQL 5.1,\nthey do nothing.\n\n*Note*: DROP TABLE automatically commits the current active\ntransaction, unless you use the TEMPORARY keyword.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/drop-table.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/drop-table.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (274,4,'POW','Syntax:\nPOW(X,Y)\n\nReturns the value of X raised to the power of Y.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/mathematical-functions.html\n\n','mysql> SELECT POW(2,2);\n -> 4\nmysql> SELECT POW(2,-2);\n -> 0.25\n','http://dev.mysql.com/doc/refman/5.1/en/mathematical-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (275,25,'SHOW CREATE TABLE','Syntax:\nSHOW CREATE TABLE tbl_name\n\nShows the CREATE TABLE statement that creates the given table. The\nstatement requires the SELECT privilege for the table. This statement\nalso works with views.\nSHOW CREATE TABLE quotes table and column names according to the value\nof the sql_quote_show_create option. See\nhttp://dev.mysql.com/doc/refman/5.1/en/server-session-variables.html.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/show-create-table.html\n\n','mysql> SHOW CREATE TABLE t\\G\n*************************** 1. row ***************************\n Table: t\nCreate Table: CREATE TABLE t (\n id INT(11) default NULL auto_increment,\n s char(60) default NULL,\n PRIMARY KEY (id)\n) ENGINE=MyISAM\n','http://dev.mysql.com/doc/refman/5.1/en/show-create-table.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (276,26,'DUAL','You are allowed to specify DUAL as a dummy table name in situations\nwhere no tables are referenced:\n\nmysql> SELECT 1 + 1 FROM DUAL;\n -> 2\n\nDUAL is purely for the convenience of people who require that all\nSELECT statements should have FROM and possibly other clauses. MySQL\nmay ignore the clauses. MySQL does not require FROM DUAL if no tables\nare referenced.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/select.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/select.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (277,35,'INSTR','Syntax:\nINSTR(str,substr)\n\nReturns the position of the first occurrence of substring substr in\nstring str. This is the same as the two-argument form of LOCATE(),\nexcept that the order of the arguments is reversed.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/string-functions.html\n\n','mysql> SELECT INSTR(\'foobarbar\', \'bar\');\n -> 4\nmysql> SELECT INSTR(\'xbar\', \'foobar\');\n -> 0\n','http://dev.mysql.com/doc/refman/5.1/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (278,30,'NOW','Syntax:\nNOW()\n\nReturns the current date and time as a value in \'YYYY-MM-DD HH:MM:SS\'\nor YYYYMMDDHHMMSS.uuuuuu format, depending on whether the function is\nused in a string or numeric context. The value is expressed in the\ncurrent time zone.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html\n\n','mysql> SELECT NOW();\n -> \'2007-12-15 23:50:26\'\nmysql> SELECT NOW() + 0;\n -> 20071215235026.000000\n','http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (279,25,'SHOW ENGINES','Syntax:\nSHOW [STORAGE] ENGINES\n\nSHOW ENGINES displays status information about the server\'s storage\nengines. This is particularly useful for checking whether a storage\nengine is supported, or to see what the default engine is. SHOW TABLE\nTYPES is a synonym, but is deprecated and is removed in MySQL 5.5.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/show-engines.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/show-engines.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (280,17,'>=','Syntax:\n>=\n\nGreater than or equal:\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/comparison-operators.html\n\n','mysql> SELECT 2 >= 2;\n -> 1\n','http://dev.mysql.com/doc/refman/5.1/en/comparison-operators.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (281,4,'EXP','Syntax:\nEXP(X)\n\nReturns the value of e (the base of natural logarithms) raised to the\npower of X. The inverse of this function is LOG() (using a single\nargument only) or LN().\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/mathematical-functions.html\n\n','mysql> SELECT EXP(2);\n -> 7.3890560989307\nmysql> SELECT EXP(-2);\n -> 0.13533528323661\nmysql> SELECT EXP(0);\n -> 1\n','http://dev.mysql.com/doc/refman/5.1/en/mathematical-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (282,20,'LONGBLOB','LONGBLOB\n\nA BLOB column with a maximum length of 4,294,967,295 or 4GB (232 - 1)\nbytes. The effective maximum length of LONGBLOB columns depends on the\nconfigured maximum packet size in the client/server protocol and\navailable memory. Each LONGBLOB value is stored using a four-byte\nlength prefix that indicates the number of bytes in the value.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/string-type-overview.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (283,12,'POINTN','PointN(ls,N)\n\nReturns the N-th Point in the Linestring value ls. Points are numbered\nbeginning with 1.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/geometry-property-functions.html#linestring-property-functions\n\n','mysql> SET @ls = \'LineString(1 1,2 2,3 3)\';\nmysql> SELECT AsText(PointN(GeomFromText(@ls),2));\n+-------------------------------------+\n| AsText(PointN(GeomFromText(@ls),2)) |\n+-------------------------------------+\n| POINT(2 2) |\n+-------------------------------------+\n','http://dev.mysql.com/doc/refman/5.1/en/geometry-property-functions.html#linestring-property-functions'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (284,20,'YEAR DATA TYPE','YEAR[(2|4)]\n\nA year in two-digit or four-digit format. The default is four-digit\nformat. In four-digit format, the allowable values are 1901 to 2155,\nand 0000. In two-digit format, the allowable values are 70 to 69,\nrepresenting years from 1970 to 2069. MySQL displays YEAR values in\nYYYY format, but allows you to assign values to YEAR columns using\neither strings or numbers.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/date-and-time-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/date-and-time-type-overview.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (285,16,'SUM','Syntax:\nSUM([DISTINCT] expr)\n\nReturns the sum of expr. If the return set has no rows, SUM() returns\nNULL. The DISTINCT keyword can be used in MySQL 5.1 to sum only the\ndistinct values of expr.\n\nSUM() returns NULL if there were no matching rows.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/group-by-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/group-by-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (286,4,'OCT','Syntax:\nOCT(N)\n\nReturns a string representation of the octal value of N, where N is a\nlonglong (BIGINT) number. This is equivalent to CONV(N,10,8). Returns\nNULL if N is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/mathematical-functions.html\n\n','mysql> SELECT OCT(12);\n -> \'14\'\n','http://dev.mysql.com/doc/refman/5.1/en/mathematical-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (287,30,'SYSDATE','Syntax:\nSYSDATE()\n\nReturns the current date and time as a value in \'YYYY-MM-DD HH:MM:SS\'\nor YYYYMMDDHHMMSS.uuuuuu format, depending on whether the function is\nused in a string or numeric context.\n\nSYSDATE() returns the time at which it executes. This differs from the\nbehavior for NOW(), which returns a constant time that indicates the\ntime at which the statement began to execute. (Within a stored function\nor trigger, NOW() returns the time at which the function or triggering\nstatement began to execute.)\n\nmysql> SELECT NOW(), SLEEP(2), NOW();\n+---------------------+----------+---------------------+\n| NOW() | SLEEP(2) | NOW() |\n+---------------------+----------+---------------------+\n| 2006-04-12 13:47:36 | 0 | 2006-04-12 13:47:36 |\n+---------------------+----------+---------------------+\n\nmysql> SELECT SYSDATE(), SLEEP(2), SYSDATE();\n+---------------------+----------+---------------------+\n| SYSDATE() | SLEEP(2) | SYSDATE() |\n+---------------------+----------+---------------------+\n| 2006-04-12 13:47:44 | 0 | 2006-04-12 13:47:46 |\n+---------------------+----------+---------------------+\n\nIn addition, the SET TIMESTAMP statement affects the value returned by\nNOW() but not by SYSDATE(). This means that timestamp settings in the\nbinary log have no effect on invocations of SYSDATE().\n\nBecause SYSDATE() can return different values even within the same\nstatement, and is not affected by SET TIMESTAMP, it is nondeterministic\nand therefore unsafe for replication if statement-based binary logging\nis used. If that is a problem, you can use row-based logging.\n\nAlternatively, you can use the --sysdate-is-now option to cause\nSYSDATE() to be an alias for NOW(). This works if the option is used on\nboth the master and the slave.\n\nThe nondeterministic nature of SYSDATE() also means that indexes cannot\nbe used for evaluating expressions that refer to it.\n\nBeginning with MySQL 5.1.42, a warning is logged if you use this\nfunction when binlog_format is set to STATEMENT. (Bug#47995\n(http://bugs.mysql.com/bug.php?id=47995))\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (288,5,'UNINSTALL PLUGIN','Syntax:\nUNINSTALL PLUGIN plugin_name\n\nThis statement removes an installed server plugin. It requires the\nDELETE privilege for the mysql.plugin table.\n\nplugin_name must be the name of some plugin that is listed in the\nmysql.plugin table. The server executes the plugin\'s deinitialization\nfunction and removes the row for the plugin from the mysql.plugin\ntable, so that subsequent server restarts will not load and initialize\nthe plugin. UNINSTALL PLUGIN does not remove the plugin\'s shared\nlibrary file.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/uninstall-plugin.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/uninstall-plugin.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (289,31,'ASBINARY','AsBinary(g), AsWKB(g)\n\nConverts a value in internal geometry format to its WKB representation\nand returns the binary result.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/functions-to-convert-geometries-between-formats.html\n\n','SELECT AsBinary(g) FROM geom;\n','http://dev.mysql.com/doc/refman/5.1/en/functions-to-convert-geometries-between-formats.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (290,35,'REPEAT FUNCTION','Syntax:\nREPEAT(str,count)\n\nReturns a string consisting of the string str repeated count times. If\ncount is less than 1, returns an empty string. Returns NULL if str or\ncount are NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/string-functions.html\n\n','mysql> SELECT REPEAT(\'MySQL\', 3);\n -> \'MySQLMySQLMySQL\'\n','http://dev.mysql.com/doc/refman/5.1/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (291,25,'SHOW TABLES','Syntax:\nSHOW [FULL] TABLES [{FROM | IN} db_name]\n [LIKE \'pattern\' | WHERE expr]\n\nSHOW TABLES lists the non-TEMPORARY tables in a given database. You can\nalso get this list using the mysqlshow db_name command. The LIKE\nclause, if present, indicates which table names to match. The WHERE\nclause can be given to select rows using more general conditions, as\ndiscussed in http://dev.mysql.com/doc/refman/5.1/en/extended-show.html.\n\nThis statement also lists any views in the database. The FULL modifier\nis supported such that SHOW FULL TABLES displays a second output\ncolumn. Values for the second column are BASE TABLE for a table and\nVIEW for a view.\n\nIf you have no privileges for a base table or view, it does not show up\nin the output from SHOW TABLES or mysqlshow db_name.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/show-tables.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/show-tables.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (292,30,'MAKEDATE','Syntax:\nMAKEDATE(year,dayofyear)\n\nReturns a date, given year and day-of-year values. dayofyear must be\ngreater than 0 or the result is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html\n\n','mysql> SELECT MAKEDATE(2011,31), MAKEDATE(2011,32);\n -> \'2011-01-31\', \'2011-02-01\'\nmysql> SELECT MAKEDATE(2011,365), MAKEDATE(2014,365);\n -> \'2011-12-31\', \'2014-12-31\'\nmysql> SELECT MAKEDATE(2011,0);\n -> NULL\n','http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (293,35,'BINARY OPERATOR','Syntax:\nBINARY\n\nThe BINARY operator casts the string following it to a binary string.\nThis is an easy way to force a column comparison to be done byte by\nbyte rather than character by character. This causes the comparison to\nbe case sensitive even if the column isn\'t defined as BINARY or BLOB.\nBINARY also causes trailing spaces to be significant.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/cast-functions.html\n\n','mysql> SELECT \'a\' = \'A\';\n -> 1\nmysql> SELECT BINARY \'a\' = \'A\';\n -> 0\nmysql> SELECT \'a\' = \'a \';\n -> 1\nmysql> SELECT BINARY \'a\' = \'a \';\n -> 0\n','http://dev.mysql.com/doc/refman/5.1/en/cast-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (294,6,'MBROVERLAPS','MBROverlaps(g1,g2)\n\nReturns 1 or 0 to indicate whether the Minimum Bounding Rectangles of\nthe two geometries g1 and g2 overlap. The term spatially overlaps is\nused if two geometries intersect and their intersection results in a\ngeometry of the same dimension but not equal to either of the given\ngeometries.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/relations-on-geometry-mbr.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/relations-on-geometry-mbr.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (295,35,'SOUNDEX','Syntax:\nSOUNDEX(str)\n\nReturns a soundex string from str. Two strings that sound almost the\nsame should have identical soundex strings. A standard soundex string\nis four characters long, but the SOUNDEX() function returns an\narbitrarily long string. You can use SUBSTRING() on the result to get a\nstandard soundex string. All nonalphabetic characters in str are\nignored. All international alphabetic characters outside the A-Z range\nare treated as vowels.\n\n*Important*: When using SOUNDEX(), you should be aware of the following\nlimitations:\n\no This function, as currently implemented, is intended to work well\n with strings that are in the English language only. Strings in other\n languages may not produce reliable results.\n\no This function is not guaranteed to provide consistent results with\n strings that use multi-byte character sets, including utf-8.\n\n We hope to remove these limitations in a future release. See\n Bug#22638 (http://bugs.mysql.com/bug.php?id=22638) for more\n information.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/string-functions.html\n\n','mysql> SELECT SOUNDEX(\'Hello\');\n -> \'H400\'\nmysql> SELECT SOUNDEX(\'Quadratically\');\n -> \'Q36324\'\n','http://dev.mysql.com/doc/refman/5.1/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (296,6,'MBRTOUCHES','MBRTouches(g1,g2)\n\nReturns 1 or 0 to indicate whether the Minimum Bounding Rectangles of\nthe two geometries g1 and g2 touch. Two geometries spatially touch if\nthe interiors of the geometries do not intersect, but the boundary of\none of the geometries intersects either the boundary or the interior of\nthe other.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/relations-on-geometry-mbr.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/relations-on-geometry-mbr.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (297,37,'DROP EVENT','Syntax:\nDROP EVENT [IF EXISTS] event_name\n\nThis statement drops the event named event_name. The event immediately\nceases being active, and is deleted completely from the server.\n\nIf the event does not exist, the error ERROR 1517 (HY000): Unknown\nevent \'event_name\' results. You can override this and cause the\nstatement to generate a warning for nonexistent events instead using IF\nEXISTS.\n\nBeginning with MySQL 5.1.12, this statement requires the EVENT\nprivilege for the schema to which the event to be dropped belongs. (In\nMySQL 5.1.11 and earlier, an event could be dropped only by its\ndefiner, or by a user having the SUPER privilege.)\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/drop-event.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/drop-event.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (298,26,'INSERT SELECT','Syntax:\nINSERT [LOW_PRIORITY | HIGH_PRIORITY] [IGNORE]\n [INTO] tbl_name [(col_name,...)]\n SELECT ...\n [ ON DUPLICATE KEY UPDATE col_name=expr, ... ]\n\nWith INSERT ... SELECT, you can quickly insert many rows into a table\nfrom one or many tables. For example:\n\nINSERT INTO tbl_temp2 (fld_id)\n SELECT tbl_temp1.fld_order_id\n FROM tbl_temp1 WHERE tbl_temp1.fld_order_id > 100;\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/insert-select.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/insert-select.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (299,37,'CREATE PROCEDURE','Syntax:\nCREATE\n [DEFINER = { user | CURRENT_USER }]\n PROCEDURE sp_name ([proc_parameter[,...]])\n [characteristic ...] routine_body\n\nCREATE\n [DEFINER = { user | CURRENT_USER }]\n FUNCTION sp_name ([func_parameter[,...]])\n RETURNS type\n [characteristic ...] routine_body\n\nproc_parameter:\n [ IN | OUT | INOUT ] param_name type\n\nfunc_parameter:\n param_name type\n\ntype:\n Any valid MySQL data type\n\ncharacteristic:\n LANGUAGE SQL\n | [NOT] DETERMINISTIC\n | { CONTAINS SQL | NO SQL | READS SQL DATA | MODIFIES SQL DATA }\n | SQL SECURITY { DEFINER | INVOKER }\n | COMMENT \'string\'\n\nroutine_body:\n Valid SQL procedure statement\n\nThese statements create stored routines. By default, a routine is\nassociated with the default database. To associate the routine\nexplicitly with a given database, specify the name as db_name.sp_name\nwhen you create it.\n\nThe CREATE FUNCTION statement is also used in MySQL to support UDFs\n(user-defined functions). See\nhttp://dev.mysql.com/doc/refman/5.1/en/adding-functions.html. A UDF can\nbe regarded as an external stored function. However, do note that\nstored functions share their namespace with UDFs. See\nhttp://dev.mysql.com/doc/refman/5.1/en/function-resolution.html, for\nthe rules describing how the server interprets references to different\nkinds of functions.\n\nTo invoke a stored procedure, use the CALL statement (see [HELP CALL]).\nTo invoke a stored function, refer to it in an expression. The function\nreturns a value during expression evaluation.\n\nTo execute the CREATE PROCEDURE or CREATE FUNCTION statement, it is\nnecessary to have the CREATE ROUTINE privilege. By default, MySQL\nautomatically grants the ALTER ROUTINE and EXECUTE privileges to the\nroutine creator. This behavior can be changed by disabling the\nautomatic_sp_privileges system variable. See\nhttp://dev.mysql.com/doc/refman/5.1/en/stored-routines-privileges.html.\nIf binary logging is enabled, the CREATE FUNCTION statement might also\nrequire the SUPER privilege, as described in\nhttp://dev.mysql.com/doc/refman/5.1/en/stored-programs-logging.html.\nSUPER may also be required depending on the DEFINER value, as described\nlater.\n\nThe DEFINER and SQL SECURITY clauses specify the security context to be\nused when checking access privileges at routine execution time, as\ndescribed later.\n\nIf the routine name is the same as the name of a built-in SQL function,\na syntax error occurs unless you use a space between the name and the\nfollowing parenthesis when defining the routine or invoking it later.\nFor this reason, avoid using the names of existing SQL functions for\nyour own stored routines.\n\nThe IGNORE_SPACE SQL mode applies to built-in functions, not to stored\nroutines. It is always allowable to have spaces after a stored routine\nname, regardless of whether IGNORE_SPACE is enabled.\n\nThe parameter list enclosed within parentheses must always be present.\nIf there are no parameters, an empty parameter list of () should be\nused. Parameter names are not case sensitive.\n\nEach parameter is an IN parameter by default. To specify otherwise for\na parameter, use the keyword OUT or INOUT before the parameter name.\n\n*Note*: Specifying a parameter as IN, OUT, or INOUT is valid only for a\nPROCEDURE. (FUNCTION parameters are always regarded as IN parameters.)\n\nAn IN parameter passes a value into a procedure. The procedure might\nmodify the value, but the modification is not visible to the caller\nwhen the procedure returns. An OUT parameter passes a value from the\nprocedure back to the caller. Its initial value is NULL within the\nprocedure, and its value is visible to the caller when the procedure\nreturns. An INOUT parameter is initialized by the caller, can be\nmodified by the procedure, and any change made by the procedure is\nvisible to the caller when the procedure returns.\n\nFor each OUT or INOUT parameter, pass a user-defined variable in the\nCALL statement that invokes the procedure so that you can obtain its\nvalue when the procedure returns. If you are calling the procedure from\nwithin another stored procedure or function, you can also pass a\nroutine parameter or local routine variable as an IN or INOUT\nparameter.\n\nThe following example shows a simple stored procedure that uses an OUT\nparameter:\n\nmysql> delimiter //\n\nmysql> CREATE PROCEDURE simpleproc (OUT param1 INT)\n -> BEGIN\n -> SELECT COUNT(*) INTO param1 FROM t;\n -> END//\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> delimiter ;\n\nmysql> CALL simpleproc(@a);\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> SELECT @a;\n+------+\n| @a |\n+------+\n| 3 |\n+------+\n1 row in set (0.00 sec)\n\nThe example uses the mysql client delimiter command to change the\nstatement delimiter from ; to // while the procedure is being defined.\nThis allows the ; delimiter used in the procedure body to be passed\nthrough to the server rather than being interpreted by mysql itself.\nSee\nhttp://dev.mysql.com/doc/refman/5.1/en/stored-programs-defining.html.\n\nThe RETURNS clause may be specified only for a FUNCTION, for which it\nis mandatory. It indicates the return type of the function, and the\nfunction body must contain a RETURN value statement. If the RETURN\nstatement returns a value of a different type, the value is coerced to\nthe proper type. For example, if a function specifies an ENUM or SET\nvalue in the RETURNS clause, but the RETURN statement returns an\ninteger, the value returned from the function is the string for the\ncorresponding ENUM member of set of SET members.\n\nThe following example function takes a parameter, performs an operation\nusing an SQL function, and returns the result. In this case, it is\nunnecessary to use delimiter because the function definition contains\nno internal ; statement delimiters:\n\nmysql> CREATE FUNCTION hello (s CHAR(20))\nmysql> RETURNS CHAR(50) DETERMINISTIC\n -> RETURN CONCAT(\'Hello, \',s,\'!\');\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> SELECT hello(\'world\');\n+----------------+\n| hello(\'world\') |\n+----------------+\n| Hello, world! |\n+----------------+\n1 row in set (0.00 sec)\n\nParameter types and function return types can be declared to use any\nvalid data type, except that the COLLATE attribute cannot be used.\n\nThe routine_body consists of a valid SQL procedure statement. This can\nbe a simple statement such as SELECT or INSERT, or it can be a compound\nstatement written using BEGIN and END. Compound statements can contain\ndeclarations, loops, and other control structure statements. The syntax\nfor these statements is described in\nhttp://dev.mysql.com/doc/refman/5.1/en/sql-syntax-compound-statements.h\ntml.\n\nMySQL allows routines to contain DDL statements, such as CREATE and\nDROP. MySQL also allows stored procedures (but not stored functions) to\ncontain SQL transaction statements such as COMMIT. Stored functions may\nnot contain statements that perform explicit or implicit commit or\nrollback. Support for these statements is not required by the SQL\nstandard, which states that each DBMS vendor may decide whether to\nallow them.\n\nStatements that return a result set can be used within a stored\nprocedcure but not within a stored function. This prohibition includes\nSELECT statements that do not have an INTO var_list clause and other\nstatements such as SHOW, EXPLAIN, and CHECK TABLE. For statements that\ncan be determined at function definition time to return a result set, a\nNot allowed to return a result set from a function error occurs\n(ER_SP_NO_RETSET). For statements that can be determined only at\nruntime to return a result set, a PROCEDURE %s can\'t return a result\nset in the given context error occurs (ER_SP_BADSELECT).\n\nUSE statements within stored routines are disallowed. When a routine is\ninvoked, an implicit USE db_name is performed (and undone when the\nroutine terminates). This causes the routine to have the given default\ndatabase while it executes. References to objects in databases other\nthan the routine default database should be qualified with the\nappropriate database name.\n\nFor additional information about statements that are not allowed in\nstored routines, see\nhttp://dev.mysql.com/doc/refman/5.1/en/stored-program-restrictions.html\n.\n\nFor information about invoking stored procedures from within programs\nwritten in a language that has a MySQL interface, see [HELP CALL].\n\nMySQL stores the sql_mode system variable setting that is in effect at\nthe time a routine is created, and always executes the routine with\nthis setting in force, regardless of the server SQL mode in effect when\nthe routine is invoked.\n\nThe switch from the SQL mode of the invoker to that of the routine\noccurs after evaluation of arguments and assignment of the resulting\nvalues to routine parameters. If you define a routine in strict SQL\nmode but invoke it in nonstrict mode, assignment of arguments to\nroutine parameters does not take place in strict mode. If you require\nthat expressions passed to a routine be assigned in strict SQL mode,\nyou should invoke the routine with strict mode in effect.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/create-procedure.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/create-procedure.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (300,20,'VARBINARY','VARBINARY(M)\n\nThe VARBINARY type is similar to the VARCHAR type, but stores binary\nbyte strings rather than nonbinary character strings. M represents the\nmaximum column length in bytes.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/string-type-overview.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (301,25,'LOAD INDEX','Syntax:\nLOAD INDEX INTO CACHE\n tbl_index_list [, tbl_index_list] ...\n\ntbl_index_list:\n tbl_name\n [[INDEX|KEY] (index_name[, index_name] ...)]\n [IGNORE LEAVES]\n\nThe LOAD INDEX INTO CACHE statement preloads a table index into the key\ncache to which it has been assigned by an explicit CACHE INDEX\nstatement, or into the default key cache otherwise. LOAD INDEX INTO\nCACHE is used only for MyISAM tables. It is not supported for tables\nhaving user-defined partitioning (see\nhttp://dev.mysql.com/doc/refman/5.1/en/partitioning-limitations.html.)\n\nThe IGNORE LEAVES modifier causes only blocks for the nonleaf nodes of\nthe index to be preloaded.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/load-index.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/load-index.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (302,26,'UNION','Syntax:\nSELECT ...\nUNION [ALL | DISTINCT] SELECT ...\n[UNION [ALL | DISTINCT] SELECT ...]\n\nUNION is used to combine the result from multiple SELECT statements\ninto a single result set.\n\nThe column names from the first SELECT statement are used as the column\nnames for the results returned. Selected columns listed in\ncorresponding positions of each SELECT statement should have the same\ndata type. (For example, the first column selected by the first\nstatement should have the same type as the first column selected by the\nother statements.)\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/union.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/union.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (303,30,'TO_DAYS','Syntax:\nTO_DAYS(date)\n\nGiven a date date, returns a day number (the number of days since year\n0).\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html\n\n','mysql> SELECT TO_DAYS(950501);\n -> 728779\nmysql> SELECT TO_DAYS(\'2007-10-07\');\n -> 733321\n','http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (304,35,'NOT REGEXP','Syntax:\nexpr NOT REGEXP pat, expr NOT RLIKE pat\n\nThis is the same as NOT (expr REGEXP pat).\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/regexp.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/regexp.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (305,25,'SHOW INDEX','Syntax:\nSHOW {INDEX | INDEXES | KEYS}\n {FROM | IN} tbl_name\n [{FROM | IN} db_name]\n\nSHOW INDEX returns table index information. The format resembles that\nof the SQLStatistics call in ODBC.\nYou can use db_name.tbl_name as an alternative to the tbl_name FROM\ndb_name syntax. These two statements are equivalent:\n\nSHOW INDEX FROM mytable FROM mydb;\nSHOW INDEX FROM mydb.mytable;\n\nYou can also list a table\'s indexes with the mysqlshow -k db_name\ntbl_name command.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/show-index.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/show-index.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (306,25,'SHOW CREATE DATABASE','Syntax:\nSHOW CREATE {DATABASE | SCHEMA} db_name\n\nShows the CREATE DATABASE statement that creates the given database.\nSHOW CREATE SCHEMA is a synonym for SHOW CREATE DATABASE.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/show-create-database.html\n\n','mysql> SHOW CREATE DATABASE test\\G\n*************************** 1. row ***************************\n Database: test\nCreate Database: CREATE DATABASE `test`\n /*!40100 DEFAULT CHARACTER SET latin1 */\n\nmysql> SHOW CREATE SCHEMA test\\G\n*************************** 1. row ***************************\n Database: test\nCreate Database: CREATE DATABASE `test`\n /*!40100 DEFAULT CHARACTER SET latin1 */\n','http://dev.mysql.com/doc/refman/5.1/en/show-create-database.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (307,22,'LEAVE','Syntax:\nLEAVE label\n\nThis statement is used to exit the flow control construct that has the\ngiven label. It can be used within BEGIN ... END or loop constructs\n(LOOP, REPEAT, WHILE).\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/leave-statement.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/leave-statement.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (308,17,'NOT IN','Syntax:\nexpr NOT IN (value,...)\n\nThis is the same as NOT (expr IN (value,...)).\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/comparison-operators.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/comparison-operators.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (309,13,'!','Syntax:\nNOT, !\n\nLogical NOT. Evaluates to 1 if the operand is 0, to 0 if the operand is\nnonzero, and NOT NULL returns NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/logical-operators.html\n\n','mysql> SELECT NOT 10;\n -> 0\nmysql> SELECT NOT 0;\n -> 1\nmysql> SELECT NOT NULL;\n -> NULL\nmysql> SELECT ! (1+1);\n -> 0\nmysql> SELECT ! 1+1;\n -> 1\n','http://dev.mysql.com/doc/refman/5.1/en/logical-operators.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (310,22,'DECLARE HANDLER','Syntax:\nDECLARE handler_type HANDLER\n FOR condition_value [, condition_value] ...\n statement\n\nhandler_type:\n CONTINUE\n | EXIT\n | UNDO\n\ncondition_value:\n SQLSTATE [VALUE] sqlstate_value\n | condition_name\n | SQLWARNING\n | NOT FOUND\n | SQLEXCEPTION\n | mysql_error_code\n\nThe DECLARE ... HANDLER statement specifies handlers that each may deal\nwith one or more conditions. If one of these conditions occurs, the\nspecified statement is executed. statement can be a simple statement\n(for example, SET var_name = value), or it can be a compound statement\nwritten using BEGIN and END (see [HELP BEGIN END]).\n\nFor a CONTINUE handler, execution of the current program continues\nafter execution of the handler statement. For an EXIT handler,\nexecution terminates for the BEGIN ... END compound statement in which\nthe handler is declared. (This is true even if the condition occurs in\nan inner block.) The UNDO handler type statement is not supported.\n\nIf a condition occurs for which no handler has been declared, the\ndefault action is EXIT.\n\nA condition_value for DECLARE ... HANDLER can be any of the following\nvalues:\n\no An SQLSTATE value (a 5-character string literal) or a MySQL error\n code (a number). You should not use SQLSTATE value \'00000\' or MySQL\n error code 0, because those indicate sucess rather than an error\n condition. For a list of SQLSTATE values and MySQL error codes, see\n http://dev.mysql.com/doc/refman/5.1/en/error-messages-server.html.\n\no A condition name previously specified with DECLARE ... CONDITION. See\n [HELP DECLARE CONDITION].\n\no SQLWARNING is shorthand for the class of SQLSTATE values that begin\n with \'01\'.\n\no NOT FOUND is shorthand for the class of SQLSTATE values that begin\n with \'02\'. This is relevant only the context of cursors and is used\n to control what happens when a cursor reaches the end of a data set.\n If no more rows are available, a No Data condition occurs with\n SQLSTATE value 02000. To detect this condition, you can set up a\n handler for it (or for a NOT FOUND condition). An example is shown in\n http://dev.mysql.com/doc/refman/5.1/en/cursors.html. This condition\n also occurs for SELECT ... INTO var_list statements that retrieve no\n rows.\n\no SQLEXCEPTION is shorthand for the class of SQLSTATE values that do\n not begin with \'00\', \'01\', or \'02\'.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/declare-handler.html\n\n','mysql> CREATE TABLE test.t (s1 INT, PRIMARY KEY (s1));\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> delimiter //\n\nmysql> CREATE PROCEDURE handlerdemo ()\n -> BEGIN\n -> DECLARE CONTINUE HANDLER FOR SQLSTATE \'23000\' SET @x2 = 1;\n -> SET @x = 1;\n -> INSERT INTO test.t VALUES (1);\n -> SET @x = 2;\n -> INSERT INTO test.t VALUES (1);\n -> SET @x = 3;\n -> END;\n -> //\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> CALL handlerdemo()//\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> SELECT @x//\n +------+\n | @x |\n +------+\n | 3 |\n +------+\n 1 row in set (0.00 sec)\n','http://dev.mysql.com/doc/refman/5.1/en/declare-handler.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (311,20,'DOUBLE','DOUBLE[(M,D)] [UNSIGNED] [ZEROFILL]\n\nA normal-size (double-precision) floating-point number. Allowable\nvalues are -1.7976931348623157E+308 to -2.2250738585072014E-308, 0, and\n2.2250738585072014E-308 to 1.7976931348623157E+308. These are the\ntheoretical limits, based on the IEEE standard. The actual range might\nbe slightly smaller depending on your hardware or operating system.\n\nM is the total number of digits and D is the number of digits following\nthe decimal point. If M and D are omitted, values are stored to the\nlimits allowed by the hardware. A double-precision floating-point\nnumber is accurate to approximately 15 decimal places.\n\nUNSIGNED, if specified, disallows negative values.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/numeric-type-overview.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (312,20,'TIME','TIME\n\nA time. The range is \'-838:59:59\' to \'838:59:59\'. MySQL displays TIME\nvalues in \'HH:MM:SS\' format, but allows assignment of values to TIME\ncolumns using either strings or numbers.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/date-and-time-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/date-and-time-type-overview.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (313,13,'&&','Syntax:\nAND, &&\n\nLogical AND. Evaluates to 1 if all operands are nonzero and not NULL,\nto 0 if one or more operands are 0, otherwise NULL is returned.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/logical-operators.html\n\n','mysql> SELECT 1 && 1;\n -> 1\nmysql> SELECT 1 && 0;\n -> 0\nmysql> SELECT 1 && NULL;\n -> NULL\nmysql> SELECT 0 && NULL;\n -> 0\nmysql> SELECT NULL && 0;\n -> 0\n','http://dev.mysql.com/doc/refman/5.1/en/logical-operators.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (314,10,'X','X(p)\n\nReturns the X-coordinate value for the point p as a double-precision\nnumber.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/geometry-property-functions.html#point-property-functions\n\n','mysql> SET @pt = \'Point(56.7 53.34)\';\nmysql> SELECT X(GeomFromText(@pt));\n+----------------------+\n| X(GeomFromText(@pt)) |\n+----------------------+\n| 56.7 |\n+----------------------+\n','http://dev.mysql.com/doc/refman/5.1/en/geometry-property-functions.html#point-property-functions'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (315,15,'FOUND_ROWS','Syntax:\nFOUND_ROWS()\n\nA SELECT statement may include a LIMIT clause to restrict the number of\nrows the server returns to the client. In some cases, it is desirable\nto know how many rows the statement would have returned without the\nLIMIT, but without running the statement again. To obtain this row\ncount, include a SQL_CALC_FOUND_ROWS option in the SELECT statement,\nand then invoke FOUND_ROWS() afterward:\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/information-functions.html\n\n','mysql> SELECT SQL_CALC_FOUND_ROWS * FROM tbl_name\n -> WHERE id > 100 LIMIT 10;\nmysql> SELECT FOUND_ROWS();\n','http://dev.mysql.com/doc/refman/5.1/en/information-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (316,15,'SYSTEM_USER','Syntax:\nSYSTEM_USER()\n\nSYSTEM_USER() is a synonym for USER().\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/information-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/information-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (317,29,'CROSSES','Crosses(g1,g2)\n\nReturns 1 if g1 spatially crosses g2. Returns NULL if g1 is a Polygon\nor a MultiPolygon, or if g2 is a Point or a MultiPoint. Otherwise,\nreturns 0.\n\nThe term spatially crosses denotes a spatial relation between two given\ngeometries that has the following properties:\n\no The two geometries intersect\n\no Their intersection results in a geometry that has a dimension that is\n one less than the maximum dimension of the two given geometries\n\no Their intersection is not equal to either of the two given geometries\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/functions-that-test-spatial-relationships-between-geometries.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/functions-that-test-spatial-relationships-between-geometries.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (318,26,'TRUNCATE TABLE','Syntax:\nTRUNCATE [TABLE] tbl_name\n\nTRUNCATE TABLE empties a table completely. It requires the DROP\nprivilege as of MySQL 5.1.16. (Before 5.1.16, it requires the DELETE\nprivilege).\n\nLogically, TRUNCATE TABLE is equivalent to a DELETE statement that\ndeletes all rows, but there are practical differences under some\ncircumstances.\n\nFor an InnoDB table, InnoDB processes TRUNCATE TABLE by deleting rows\none by one if there are any FOREIGN KEY constraints that reference the\ntable. If there are no FOREIGN KEY constraints, InnoDB performs fast\ntruncation by dropping the original table and creating an empty one\nwith the same definition, which is much faster than deleting rows one\nby one. The AUTO_INCREMENT counter is reset to zero by TRUNCATE TABLE,\nregardless of whether there is a FOREIGN KEY constraint.\n\nIn the case that FOREIGN KEY constraints reference the table, InnoDB\ndeletes rows one by one and processes the constraints on each one. If\nthe FOREIGN KEY constraint specifies DELETE CASCADE, rows from the\nchild (referenced) table are deleted, and the truncated table becomes\nempty. If the FOREIGN KEY constraint does not specify CASCADE, the\nTRUNCATE TABLE statement deletes rows one by one and stops if it\nencounters a parent row that is referenced by the child, returning this\nerror:\n\nERROR 1451 (23000): Cannot delete or update a parent row: a foreign\nkey constraint fails (`test`.`child`, CONSTRAINT `child_ibfk_1`\nFOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`))\n\nThis is the same as a DELETE statement with no WHERE clause.\n\nThe count of rows affected by TRUNCATE TABLE is accurate only when it\nis mapped to a DELETE statement.\n\nFor other storage engines, TRUNCATE TABLE differs from DELETE in the\nfollowing ways in MySQL 5.1:\n\no Truncate operations drop and re-create the table, which is much\n faster than deleting rows one by one, particularly for large tables.\n\no Truncate operations cause an implicit commit.\n\no Truncation operations cannot be performed if the session holds an\n active table lock.\n\no Truncation operations do not return a meaningful value for the number\n of deleted rows. The usual result is "0 rows affected," which should\n be interpreted as "no information."\n\no As long as the table format file tbl_name.frm is valid, the table can\n be re-created as an empty table with TRUNCATE TABLE, even if the data\n or index files have become corrupted.\n\no The table handler does not remember the last used AUTO_INCREMENT\n value, but starts counting from the beginning. This is true even for\n MyISAM and InnoDB, which normally do not reuse sequence values.\n\no When used with partitioned tables, TRUNCATE TABLE preserves the\n partitioning; that is, the data and index files are dropped and\n re-created, while the partition definitions (.par) file is\n unaffected.\n\no Since truncation of a table does not make any use of DELETE, the\n TRUNCATE TABLE statement does not invoke ON DELETE triggers.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/truncate-table.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/truncate-table.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (319,16,'BIT_XOR','Syntax:\nBIT_XOR(expr)\n\nReturns the bitwise XOR of all bits in expr. The calculation is\nperformed with 64-bit (BIGINT) precision.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/group-by-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/group-by-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (320,30,'CURRENT_DATE','Syntax:\nCURRENT_DATE, CURRENT_DATE()\n\nCURRENT_DATE and CURRENT_DATE() are synonyms for CURDATE().\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (321,25,'START SLAVE','Syntax:\nSTART SLAVE [thread_type [, thread_type] ... ]\nSTART SLAVE [SQL_THREAD] UNTIL\n MASTER_LOG_FILE = \'log_name\', MASTER_LOG_POS = log_pos\nSTART SLAVE [SQL_THREAD] UNTIL\n RELAY_LOG_FILE = \'log_name\', RELAY_LOG_POS = log_pos\n\nthread_type: IO_THREAD | SQL_THREAD\n\nSTART SLAVE with no thread_type options starts both of the slave\nthreads. The I/O thread reads events from the master server and stores\nthem in the relay log. The SQL thread reads events from the relay log\nand executes them. START SLAVE requires the SUPER privilege.\n\nIf START SLAVE succeeds in starting the slave threads, it returns\nwithout any error. However, even in that case, it might be that the\nslave threads start and then later stop (for example, because they do\nnot manage to connect to the master or read its binary log, or some\nother problem). START SLAVE does not warn you about this. You must\ncheck the slave\'s error log for error messages generated by the slave\nthreads, or check that they are running satisfactorily with SHOW SLAVE\nSTATUS.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/start-slave.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/start-slave.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (322,2,'AREA','Area(poly)\n\nReturns as a double-precision number the area of the Polygon value\npoly, as measured in its spatial reference system.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/geometry-property-functions.html#polygon-property-functions\n\n','mysql> SET @poly = \'Polygon((0 0,0 3,3 0,0 0),(1 1,1 2,2 1,1 1))\';\nmysql> SELECT Area(GeomFromText(@poly));\n+---------------------------+\n| Area(GeomFromText(@poly)) |\n+---------------------------+\n| 4 |\n+---------------------------+\n','http://dev.mysql.com/doc/refman/5.1/en/geometry-property-functions.html#polygon-property-functions'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (323,22,'BEGIN END','Syntax:\n[begin_label:] BEGIN\n [statement_list]\nEND [end_label]\n\nBEGIN ... END syntax is used for writing compound statements, which can\nappear within stored programs. A compound statement can contain\nmultiple statements, enclosed by the BEGIN and END keywords.\nstatement_list represents a list of one or more statements, each\nterminated by a semicolon (;) statement delimiter. statement_list is\noptional, which means that the empty compound statement (BEGIN END) is\nlegal.\n\nUse of multiple statements requires that a client is able to send\nstatement strings containing the ; statement delimiter. This is handled\nin the mysql command-line client with the delimiter command. Changing\nthe ; end-of-statement delimiter (for example, to //) allows ; to be\nused in a program body. For an example, see\nhttp://dev.mysql.com/doc/refman/5.1/en/stored-programs-defining.html.\n\nA BEGIN ... END block can be labeled. Labels follow these rules:\n\no end_label cannot be given unless begin_label is also present.\n\no If both begin_label and end_label are present, they must be the same.\n\no Labels can be up to 16 characters long.\n\nLabels are also allowed for the LOOP, REPEAT, and WHILE statements.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/begin-end.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/begin-end.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (324,25,'FLUSH','Syntax:\nFLUSH [NO_WRITE_TO_BINLOG | LOCAL]\n flush_option [, flush_option] ...\n\nThe FLUSH statement clears or reloads various internal caches used by\nMySQL. One variant acquires a lock. To execute FLUSH, you must have the\nRELOAD privilege.\n\nBy default, FLUSH statements are written to the binary log so that they\nwill be replicated to replication slaves. Logging can be suppressed\nwith the optional NO_WRITE_TO_BINLOG keyword or its alias LOCAL.\n\n*Note*: FLUSH LOGS, FLUSH MASTER, FLUSH SLAVE, and FLUSH TABLES WITH\nREAD LOCK are not written to the binary log in any case because they\nwould cause problems if replicated to a slave.\n\nThe RESET statement is similar to FLUSH. See [HELP RESET], for\ninformation about using the RESET statement with replication.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/flush.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/flush.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (325,25,'SHOW PROCEDURE STATUS','Syntax:\nSHOW PROCEDURE STATUS\n [LIKE \'pattern\' | WHERE expr]\n\nThis statement is a MySQL extension. It returns characteristics of a\nstored procedure, such as the database, name, type, creator, creation\nand modification dates, and character set information. A similar\nstatement, SHOW FUNCTION STATUS, displays information about stored\nfunctions (see [HELP SHOW FUNCTION STATUS]).\n\nThe LIKE clause, if present, indicates which procedure or function\nnames to match. The WHERE clause can be given to select rows using more\ngeneral conditions, as discussed in\nhttp://dev.mysql.com/doc/refman/5.1/en/extended-show.html.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/show-procedure-status.html\n\n','mysql> SHOW PROCEDURE STATUS LIKE \'sp1\'\\G\n*************************** 1. row ***************************\n Db: test\n Name: sp1\n Type: PROCEDURE\n Definer: testuser@localhost\n Modified: 2004-08-03 15:29:37\n Created: 2004-08-03 15:29:37\n Security_type: DEFINER\n Comment:\ncharacter_set_client: latin1\ncollation_connection: latin1_swedish_ci\n Database Collation: latin1_swedish_ci\n','http://dev.mysql.com/doc/refman/5.1/en/show-procedure-status.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (326,27,'DESCRIBE','Syntax:\n{DESCRIBE | DESC} tbl_name [col_name | wild]\n\nDESCRIBE provides information about the columns in a table. It is a\nshortcut for SHOW COLUMNS FROM. These statements also display\ninformation for views. (See [HELP SHOW COLUMNS].)\n\ncol_name can be a column name, or a string containing the SQL "%" and\n"_" wildcard characters to obtain output only for the columns with\nnames matching the string. There is no need to enclose the string\nwithin quotes unless it contains spaces or other special characters.\n\nmysql> DESCRIBE City;\n+------------+----------+------+-----+---------+----------------+\n| Field | Type | Null | Key | Default | Extra |\n+------------+----------+------+-----+---------+----------------+\n| Id | int(11) | NO | PRI | NULL | auto_increment |\n| Name | char(35) | NO | | | |\n| Country | char(3) | NO | UNI | | |\n| District | char(20) | YES | MUL | | |\n| Population | int(11) | NO | | 0 | |\n+------------+----------+------+-----+---------+----------------+\n5 rows in set (0.00 sec)\n\nThe description for SHOW COLUMNS provides more information about the\noutput columns (see [HELP SHOW COLUMNS]).\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/describe.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/describe.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (327,25,'SHOW WARNINGS','Syntax:\nSHOW WARNINGS [LIMIT [offset,] row_count]\nSHOW COUNT(*) WARNINGS\n\nSHOW WARNINGS shows the error, warning, and note messages that resulted\nfrom the last statement that generated messages in the current session.\nIt shows nothing if the last statement used a table and generated no\nmessages. (That is, a statement that uses a table but generates no\nmessages clears the message list.) Statements that do not use tables\nand do not generate messages have no effect on the message list.\n\nWarnings are generated for DML statements such as INSERT, UPDATE, and\nLOAD DATA INFILE as well as DDL statements such as CREATE TABLE and\nALTER TABLE.\n\nA related statement, SHOW ERRORS, shows only the errors. See [HELP SHOW\nERRORS].\n\nThe SHOW COUNT(*) WARNINGS statement displays the total number of\nerrors, warnings, and notes. You can also retrieve this number from the\nwarning_count variable:\n\nSHOW COUNT(*) WARNINGS;\nSELECT @@warning_count;\n\nThe value of warning_count might be greater than the number of messages\ndisplayed by SHOW WARNINGS if the max_error_count system variable is\nset so low that not all messages are stored. An example shown later in\nthis section demonstrates how this can happen.\n\nThe LIMIT clause has the same syntax as for the SELECT statement. See\nhttp://dev.mysql.com/doc/refman/5.1/en/select.html.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/show-warnings.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/show-warnings.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (328,9,'DROP USER','Syntax:\nDROP USER user [, user] ...\n\nThe DROP USER statement removes one or more MySQL accounts. It removes\nprivilege rows for the account from all grant tables. To use this\nstatement, you must have the global CREATE USER privilege or the DELETE\nprivilege for the mysql database. Each account is named using the same\nformat as for the GRANT statement; for example, \'jeffrey\'@\'localhost\'.\nIf you specify only the user name part of the account name, a host name\npart of \'%\' is used. For additional information about specifying\naccount names, see [HELP GRANT].\n\nWith DROP USER, you can remove an account and its privileges as\nfollows:\n\nDROP USER user;\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/drop-user.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/drop-user.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (329,16,'STDDEV_POP','Syntax:\nSTDDEV_POP(expr)\n\nReturns the population standard deviation of expr (the square root of\nVAR_POP()). You can also use STD() or STDDEV(), which are equivalent\nbut not standard SQL.\n\nSTDDEV_POP() returns NULL if there were no matching rows.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/group-by-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/group-by-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (330,25,'SHOW CHARACTER SET','Syntax:\nSHOW CHARACTER SET\n [LIKE \'pattern\' | WHERE expr]\n\nThe SHOW CHARACTER SET statement shows all available character sets.\nThe LIKE clause, if present, indicates which character set names to\nmatch. The WHERE clause can be given to select rows using more general\nconditions, as discussed in\nhttp://dev.mysql.com/doc/refman/5.1/en/extended-show.html. For example:\n\nmysql> SHOW CHARACTER SET LIKE \'latin%\';\n+---------+-----------------------------+-------------------+--------+\n| Charset | Description | Default collation | Maxlen |\n+---------+-----------------------------+-------------------+--------+\n| latin1 | cp1252 West European | latin1_swedish_ci | 1 |\n| latin2 | ISO 8859-2 Central European | latin2_general_ci | 1 |\n| latin5 | ISO 8859-9 Turkish | latin5_turkish_ci | 1 |\n| latin7 | ISO 8859-13 Baltic | latin7_general_ci | 1 |\n+---------+-----------------------------+-------------------+--------+\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/show-character-set.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/show-character-set.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (331,35,'SUBSTRING','Syntax:\nSUBSTRING(str,pos), SUBSTRING(str FROM pos), SUBSTRING(str,pos,len),\nSUBSTRING(str FROM pos FOR len)\n\nThe forms without a len argument return a substring from string str\nstarting at position pos. The forms with a len argument return a\nsubstring len characters long from string str, starting at position\npos. The forms that use FROM are standard SQL syntax. It is also\npossible to use a negative value for pos. In this case, the beginning\nof the substring is pos characters from the end of the string, rather\nthan the beginning. A negative value may be used for pos in any of the\nforms of this function.\n\nFor all forms of SUBSTRING(), the position of the first character in\nthe string from which the substring is to be extracted is reckoned as\n1.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/string-functions.html\n\n','mysql> SELECT SUBSTRING(\'Quadratically\',5);\n -> \'ratically\'\nmysql> SELECT SUBSTRING(\'foobarbar\' FROM 4);\n -> \'barbar\'\nmysql> SELECT SUBSTRING(\'Quadratically\',5,6);\n -> \'ratica\'\nmysql> SELECT SUBSTRING(\'Sakila\', -3);\n -> \'ila\'\nmysql> SELECT SUBSTRING(\'Sakila\', -5, 3);\n -> \'aki\'\nmysql> SELECT SUBSTRING(\'Sakila\' FROM -4 FOR 2);\n -> \'ki\'\n','http://dev.mysql.com/doc/refman/5.1/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (332,34,'ISEMPTY','IsEmpty(g)\n\nReturns 1 if the geometry value g is the empty geometry, 0 if it is not\nempty, and -1 if the argument is NULL. If the geometry is empty, it\nrepresents the empty point set.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/geometry-property-functions.html#general-geometry-property-functions\n\n','','http://dev.mysql.com/doc/refman/5.1/en/geometry-property-functions.html#general-geometry-property-functions'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (333,25,'SHOW FUNCTION STATUS','Syntax:\nSHOW FUNCTION STATUS\n [LIKE \'pattern\' | WHERE expr]\n\nThis statement is similar to SHOW PROCEDURE STATUS but for stored\nfunctions. See [HELP SHOW PROCEDURE STATUS].\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/show-function-status.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/show-function-status.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (334,35,'LTRIM','Syntax:\nLTRIM(str)\n\nReturns the string str with leading space characters removed.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/string-functions.html\n\n','mysql> SELECT LTRIM(\' barbar\');\n -> \'barbar\'\n','http://dev.mysql.com/doc/refman/5.1/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (335,29,'INTERSECTS','Intersects(g1,g2)\n\nReturns 1 or 0 to indicate whether g1 spatially intersects g2.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/functions-that-test-spatial-relationships-between-geometries.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/functions-that-test-spatial-relationships-between-geometries.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (336,26,'CALL','Syntax:\nCALL sp_name([parameter[,...]])\nCALL sp_name[()]\n\nThe CALL statement invokes a stored procedure that was defined\npreviously with CREATE PROCEDURE.\n\nAs of MySQL 5.1.13, stored procedures that take no arguments can be\ninvoked without parentheses. That is, CALL p() and CALL p are\nequivalent.\n\nCALL can pass back values to its caller using parameters that are\ndeclared as OUT or INOUT parameters. When the procedure returns, a\nclient program can also obtain the number of rows affected for the\nfinal statement executed within the routine: At the SQL level, call the\nROW_COUNT() function; from the C API, call the mysql_affected_rows()\nfunction.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/call.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/call.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (337,6,'MBRDISJOINT','MBRDisjoint(g1,g2)\n\nReturns 1 or 0 to indicate whether the Minimum Bounding Rectangles of\nthe two geometries g1 and g2 are disjoint (do not intersect).\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/relations-on-geometry-mbr.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/relations-on-geometry-mbr.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (338,14,'VALUES','Syntax:\nVALUES(col_name)\n\nIn an INSERT ... ON DUPLICATE KEY UPDATE statement, you can use the\nVALUES(col_name) function in the UPDATE clause to refer to column\nvalues from the INSERT portion of the statement. In other words,\nVALUES(col_name) in the UPDATE clause refers to the value of col_name\nthat would be inserted, had no duplicate-key conflict occurred. This\nfunction is especially useful in multiple-row inserts. The VALUES()\nfunction is meaningful only in INSERT ... ON DUPLICATE KEY UPDATE\nstatements and returns NULL otherwise.\nhttp://dev.mysql.com/doc/refman/5.1/en/insert-on-duplicate.html.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/miscellaneous-functions.html\n\n','mysql> INSERT INTO table (a,b,c) VALUES (1,2,3),(4,5,6)\n -> ON DUPLICATE KEY UPDATE c=VALUES(a)+VALUES(b);\n','http://dev.mysql.com/doc/refman/5.1/en/miscellaneous-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (339,35,'SUBSTRING_INDEX','Syntax:\nSUBSTRING_INDEX(str,delim,count)\n\nReturns the substring from string str before count occurrences of the\ndelimiter delim. If count is positive, everything to the left of the\nfinal delimiter (counting from the left) is returned. If count is\nnegative, everything to the right of the final delimiter (counting from\nthe right) is returned. SUBSTRING_INDEX() performs a case-sensitive\nmatch when searching for delim.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/string-functions.html\n\n','mysql> SELECT SUBSTRING_INDEX(\'www.mysql.com\', \'.\', 2);\n -> \'www.mysql\'\nmysql> SELECT SUBSTRING_INDEX(\'www.mysql.com\', \'.\', -2);\n -> \'mysql.com\'\n','http://dev.mysql.com/doc/refman/5.1/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (340,11,'ENCODE','Syntax:\nENCODE(str,pass_str)\n\nEncrypt str using pass_str as the password. To decrypt the result, use\nDECODE().\n\nThe result is a binary string of the same length as str.\n\nThe strength of the encryption is based on how good the random\ngenerator is. It should suffice for short strings.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/encryption-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/encryption-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (341,22,'LOOP','Syntax:\n[begin_label:] LOOP\n statement_list\nEND LOOP [end_label]\n\nLOOP implements a simple loop construct, enabling repeated execution of\nthe statement list, which consists of one or more statements, each\nterminated by a semicolon (;) statement delimiter. The statements\nwithin the loop are repeated until the loop is exited; usually this is\naccomplished with a LEAVE statement.\n\nA LOOP statement can be labeled. See [HELP BEGIN END] for the rules\nregarding label use.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/loop-statement.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/loop-statement.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (342,4,'TRUNCATE','Syntax:\nTRUNCATE(X,D)\n\nReturns the number X, truncated to D decimal places. If D is 0, the\nresult has no decimal point or fractional part. D can be negative to\ncause D digits left of the decimal point of the value X to become zero.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/mathematical-functions.html\n\n','mysql> SELECT TRUNCATE(1.223,1);\n -> 1.2\nmysql> SELECT TRUNCATE(1.999,1);\n -> 1.9\nmysql> SELECT TRUNCATE(1.999,0);\n -> 1\nmysql> SELECT TRUNCATE(-1.999,1);\n -> -1.9\nmysql> SELECT TRUNCATE(122,-2);\n -> 100\nmysql> SELECT TRUNCATE(10.28*100,0);\n -> 1028\n','http://dev.mysql.com/doc/refman/5.1/en/mathematical-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (343,30,'TIMESTAMPADD','Syntax:\nTIMESTAMPADD(unit,interval,datetime_expr)\n\nAdds the integer expression interval to the date or datetime expression\ndatetime_expr. The unit for interval is given by the unit argument,\nwhich should be one of the following values: FRAC_SECOND\n(microseconds), SECOND, MINUTE, HOUR, DAY, WEEK, MONTH, QUARTER, or\nYEAR.\n\nBeginning with MySQL 5.1.24, it is possible to use MICROSECOND in place\nof FRAC_SECOND with this function, and FRAC_SECOND is deprecated.\nFRAC_SECOND is removed in MySQL 5.5.\n\nThe unit value may be specified using one of keywords as shown, or with\na prefix of SQL_TSI_. For example, DAY and SQL_TSI_DAY both are legal.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html\n\n','mysql> SELECT TIMESTAMPADD(MINUTE,1,\'2003-01-02\');\n -> \'2003-01-02 00:01:00\'\nmysql> SELECT TIMESTAMPADD(WEEK,1,\'2003-01-02\');\n -> \'2003-01-09\'\n','http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (344,25,'SHOW','SHOW has many forms that provide information about databases, tables,\ncolumns, or status information about the server. This section describes\nthose following:\n\nSHOW AUTHORS\nSHOW CHARACTER SET [like_or_where]\nSHOW COLLATION [like_or_where]\nSHOW [FULL] COLUMNS FROM tbl_name [FROM db_name] [like_or_where]\nSHOW CONTRIBUTORS\nSHOW CREATE DATABASE db_name\nSHOW CREATE EVENT event_name\nSHOW CREATE FUNCTION func_name\nSHOW CREATE PROCEDURE proc_name\nSHOW CREATE TABLE tbl_name\nSHOW CREATE TRIGGER trigger_name\nSHOW CREATE VIEW view_name\nSHOW DATABASES [like_or_where]\nSHOW ENGINE engine_name {STATUS | MUTEX}\nSHOW [STORAGE] ENGINES\nSHOW ERRORS [LIMIT [offset,] row_count]\nSHOW EVENTS\nSHOW FUNCTION CODE func_name\nSHOW FUNCTION STATUS [like_or_where]\nSHOW GRANTS FOR user\nSHOW INDEX FROM tbl_name [FROM db_name]\nSHOW INNODB STATUS\nSHOW OPEN TABLES [FROM db_name] [like_or_where]\nSHOW PLUGINS\nSHOW PROCEDURE CODE proc_name\nSHOW PROCEDURE STATUS [like_or_where]\nSHOW PRIVILEGES\nSHOW [FULL] PROCESSLIST\nSHOW PROFILE [types] [FOR QUERY n] [OFFSET n] [LIMIT n]\nSHOW PROFILES\nSHOW SCHEDULER STATUS\nSHOW [GLOBAL | SESSION] STATUS [like_or_where]\nSHOW TABLE STATUS [FROM db_name] [like_or_where]\nSHOW [FULL] TABLES [FROM db_name] [like_or_where]\nSHOW TRIGGERS [FROM db_name] [like_or_where]\nSHOW [GLOBAL | SESSION] VARIABLES [like_or_where]\nSHOW WARNINGS [LIMIT [offset,] row_count]\n\nlike_or_where:\n LIKE \'pattern\'\n | WHERE expr\n\nIf the syntax for a given SHOW statement includes a LIKE \'pattern\'\npart, \'pattern\' is a string that can contain the SQL "%" and "_"\nwildcard characters. The pattern is useful for restricting statement\noutput to matching values.\n\nSeveral SHOW statements also accept a WHERE clause that provides more\nflexibility in specifying which rows to display. See\nhttp://dev.mysql.com/doc/refman/5.1/en/extended-show.html.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/show.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/show.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (345,17,'GREATEST','Syntax:\nGREATEST(value1,value2,...)\n\nWith two or more arguments, returns the largest (maximum-valued)\nargument. The arguments are compared using the same rules as for\nLEAST().\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/comparison-operators.html\n\n','mysql> SELECT GREATEST(2,0);\n -> 2\nmysql> SELECT GREATEST(34.0,3.0,5.0,767.0);\n -> 767.0\nmysql> SELECT GREATEST(\'B\',\'A\',\'C\');\n -> \'C\'\n','http://dev.mysql.com/doc/refman/5.1/en/comparison-operators.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (346,25,'SHOW VARIABLES','Syntax:\nSHOW [GLOBAL | SESSION] VARIABLES\n [LIKE \'pattern\' | WHERE expr]\n\nSHOW VARIABLES shows the values of MySQL system variables. This\ninformation also can be obtained using the mysqladmin variables\ncommand. The LIKE clause, if present, indicates which variable names to\nmatch. The WHERE clause can be given to select rows using more general\nconditions, as discussed in\nhttp://dev.mysql.com/doc/refman/5.1/en/extended-show.html. This\nstatement does not require any privilege. It requires only the ability\nto connect to the server.\n\nWith the GLOBAL modifier, SHOW VARIABLES displays the values that are\nused for new connections to MySQL. With SESSION, it displays the values\nthat are in effect for the current connection. If no modifier is\npresent, the default is SESSION. LOCAL is a synonym for SESSION.\nWith a LIKE clause, the statement displays only rows for those\nvariables with names that match the pattern. To obtain the row for a\nspecific variable, use a LIKE clause as shown:\n\nSHOW VARIABLES LIKE \'max_join_size\';\nSHOW SESSION VARIABLES LIKE \'max_join_size\';\n\nTo get a list of variables whose name match a pattern, use the "%"\nwildcard character in a LIKE clause:\n\nSHOW VARIABLES LIKE \'%size%\';\nSHOW GLOBAL VARIABLES LIKE \'%size%\';\n\nWildcard characters can be used in any position within the pattern to\nbe matched. Strictly speaking, because "_" is a wildcard that matches\nany single character, you should escape it as "\\_" to match it\nliterally. In practice, this is rarely necessary.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/show-variables.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/show-variables.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (347,25,'BINLOG','Syntax:\nBINLOG \'str\'\n\nBINLOG is an internal-use statement. It is generated by the mysqlbinlog\nprogram as the printable representation of certain events in binary log\nfiles. (See http://dev.mysql.com/doc/refman/5.1/en/mysqlbinlog.html.)\nThe \'str\' value is a base 64-encoded string the that server decodes to\ndetermine the data change indicated by the corresponding event. This\nstatement requires the SUPER privilege. It was added in MySQL 5.1.5.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/binlog.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/binlog.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (348,16,'BIT_AND','Syntax:\nBIT_AND(expr)\n\nReturns the bitwise AND of all bits in expr. The calculation is\nperformed with 64-bit (BIGINT) precision.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/group-by-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/group-by-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (349,30,'SECOND','Syntax:\nSECOND(time)\n\nReturns the second for time, in the range 0 to 59.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html\n\n','mysql> SELECT SECOND(\'10:05:03\');\n -> 3\n','http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (350,4,'ATAN2','Syntax:\nATAN(Y,X), ATAN2(Y,X)\n\nReturns the arc tangent of the two variables X and Y. It is similar to\ncalculating the arc tangent of Y / X, except that the signs of both\narguments are used to determine the quadrant of the result.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/mathematical-functions.html\n\n','mysql> SELECT ATAN(-2,2);\n -> -0.78539816339745\nmysql> SELECT ATAN2(PI(),0);\n -> 1.5707963267949\n','http://dev.mysql.com/doc/refman/5.1/en/mathematical-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (351,6,'MBRCONTAINS','MBRContains(g1,g2)\n\nReturns 1 or 0 to indicate whether the Minimum Bounding Rectangle of g1\ncontains the Minimum Bounding Rectangle of g2. This tests the opposite\nrelationship as MBRWithin().\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/relations-on-geometry-mbr.html\n\n','mysql> SET @g1 = GeomFromText(\'Polygon((0 0,0 3,3 3,3 0,0 0))\');\nmysql> SET @g2 = GeomFromText(\'Point(1 1)\');\nmysql> SELECT MBRContains(@g1,@g2), MBRContains(@g2,@g1);\n----------------------+----------------------+\n| MBRContains(@g1,@g2) | MBRContains(@g2,@g1) |\n+----------------------+----------------------+\n| 1 | 0 |\n+----------------------+----------------------+\n','http://dev.mysql.com/doc/refman/5.1/en/relations-on-geometry-mbr.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (352,30,'HOUR','Syntax:\nHOUR(time)\n\nReturns the hour for time. The range of the return value is 0 to 23 for\ntime-of-day values. However, the range of TIME values actually is much\nlarger, so HOUR can return values greater than 23.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html\n\n','mysql> SELECT HOUR(\'10:05:03\');\n -> 10\nmysql> SELECT HOUR(\'272:59:59\');\n -> 272\n','http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (353,26,'SELECT','Syntax:\nSELECT\n [ALL | DISTINCT | DISTINCTROW ]\n [HIGH_PRIORITY]\n [STRAIGHT_JOIN]\n [SQL_SMALL_RESULT] [SQL_BIG_RESULT] [SQL_BUFFER_RESULT]\n [SQL_CACHE | SQL_NO_CACHE] [SQL_CALC_FOUND_ROWS]\n select_expr [, select_expr ...]\n [FROM table_references\n [WHERE where_condition]\n [GROUP BY {col_name | expr | position}\n [ASC | DESC], ... [WITH ROLLUP]]\n [HAVING where_condition]\n [ORDER BY {col_name | expr | position}\n [ASC | DESC], ...]\n [LIMIT {[offset,] row_count | row_count OFFSET offset}]\n [PROCEDURE procedure_name(argument_list)]\n [INTO OUTFILE \'file_name\'\n [CHARACTER SET charset_name]\n export_options\n | INTO DUMPFILE \'file_name\'\n | INTO var_name [, var_name]]\n [FOR UPDATE | LOCK IN SHARE MODE]]\n\nSELECT is used to retrieve rows selected from one or more tables, and\ncan include UNION statements and subqueries. See [HELP UNION], and\nhttp://dev.mysql.com/doc/refman/5.1/en/subqueries.html.\n\nThe most commonly used clauses of SELECT statements are these:\n\no Each select_expr indicates a column that you want to retrieve. There\n must be at least one select_expr.\n\no table_references indicates the table or tables from which to retrieve\n rows. Its syntax is described in [HELP JOIN].\n\no The WHERE clause, if given, indicates the condition or conditions\n that rows must satisfy to be selected. where_condition is an\n expression that evaluates to true for each row to be selected. The\n statement selects all rows if there is no WHERE clause.\n\n In the WHERE clause, you can use any of the functions and operators\n that MySQL supports, except for aggregate (summary) functions. See\n http://dev.mysql.com/doc/refman/5.1/en/functions.html.\n\nSELECT can also be used to retrieve rows computed without reference to\nany table.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/select.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/select.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (354,4,'COT','Syntax:\nCOT(X)\n\nReturns the cotangent of X.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/mathematical-functions.html\n\n','mysql> SELECT COT(12);\n -> -1.5726734063977\nmysql> SELECT COT(0);\n -> NULL\n','http://dev.mysql.com/doc/refman/5.1/en/mathematical-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (355,25,'SHOW CREATE EVENT','Syntax:\nSHOW CREATE EVENT event_name\n\nThis statement displays the CREATE EVENT statement needed to re-create\na given event. For example (using the same event e_daily defined and\nthen altered in [HELP SHOW EVENTS]):\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/show-create-event.html\n\n','mysql> SHOW CREATE EVENT test.e_daily\\G\n*************************** 1. row ***************************\n Event: e_daily\n sql_mode:\n time_zone: SYSTEM\n Create Event: CREATE EVENT `e_daily`\n ON SCHEDULE EVERY 1 DAY\n STARTS CURRENT_TIMESTAMP + INTERVAL 6 HOUR\n ON COMPLETION NOT PRESERVE\n ENABLE\n COMMENT \'Saves total number of sessions then\n clears the table each day\'\n DO BEGIN\n INSERT INTO site_activity.totals (time, total)\n SELECT CURRENT_TIMESTAMP, COUNT(*)\n FROM site_activity.sessions;\n DELETE FROM site_activity.sessions;\n END\ncharacter_set_client: latin1\ncollation_connection: latin1_swedish_ci\n Database Collation: latin1_swedish_ci\n','http://dev.mysql.com/doc/refman/5.1/en/show-create-event.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (356,19,'BACKUP TABLE','Syntax:\nBACKUP TABLE tbl_name [, tbl_name] ... TO \'/path/to/backup/directory\'\n\n*Note*: This statement is deprecated and is removed in MySQL 5.5. As an\nalternative, mysqldump or mysqlhotcopy can be used instead.\n\nBACKUP TABLE copies to the backup directory the minimum number of table\nfiles needed to restore the table, after flushing any buffered changes\nto disk. The statement works only for MyISAM tables. It copies the .frm\ndefinition and .MYD data files. The .MYI index file can be rebuilt from\nthose two files. The directory should be specified as a full path name.\nTo restore the table, use RESTORE TABLE.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/backup-table.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/backup-table.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (357,35,'LOAD_FILE','Syntax:\nLOAD_FILE(file_name)\n\nReads the file and returns the file contents as a string. To use this\nfunction, the file must be located on the server host, you must specify\nthe full path name to the file, and you must have the FILE privilege.\nThe file must be readable by all and its size less than\nmax_allowed_packet bytes. If the secure_file_priv system variable is\nset to a nonempty directory name, the file to be loaded must be located\nin that directory.\n\nIf the file does not exist or cannot be read because one of the\npreceding conditions is not satisfied, the function returns NULL.\n\nAs of MySQL 5.1.6, the character_set_filesystem system variable\ncontrols interpretation of file names that are given as literal\nstrings.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/string-functions.html\n\n','mysql> UPDATE t\n SET blob_col=LOAD_FILE(\'/tmp/picture\')\n WHERE id=1;\n','http://dev.mysql.com/doc/refman/5.1/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (358,25,'LOAD TABLE FROM MASTER','Syntax:\nLOAD TABLE tbl_name FROM MASTER\n\nThis feature is deprecated and should be avoided. It is subject to\nremoval in a future version of MySQL.\n\nSince the current implementation of LOAD DATA FROM MASTER and LOAD\nTABLE FROM MASTER is very limited, these statements are deprecated as\nof MySQL 4.1 and removed in MySQL 5.5.\n\nThe recommended alternative solution to using LOAD DATA FROM MASTER or\nLOAD TABLE FROM MASTER is using mysqldump or mysqlhotcopy. The latter\nrequires Perl and two Perl modules (DBI and DBD:mysql) and works for\nMyISAM and ARCHIVE tables only. With mysqldump, you can create SQL\ndumps on the master and pipe (or copy) these to a mysql client on the\nslave. This has the advantage of working for all storage engines, but\ncan be quite slow, since it works using SELECT.\n\nTransfers a copy of the table from the master to the slave. This\nstatement is implemented mainly debugging LOAD DATA FROM MASTER\noperations. To use LOAD TABLE, the account used for connecting to the\nmaster server must have the RELOAD and SUPER privileges on the master\nand the SELECT privilege for the master table to load. On the slave\nside, the user that issues LOAD TABLE FROM MASTER must have privileges\nfor dropping and creating the table.\n\nThe conditions for LOAD DATA FROM MASTER apply here as well. For\nexample, LOAD TABLE FROM MASTER works only for MyISAM tables. The\ntimeout notes for LOAD DATA FROM MASTER apply as well.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/load-table-from-master.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/load-table-from-master.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (359,3,'POINTFROMTEXT','PointFromText(wkt[,srid])\n\nConstructs a POINT value using its WKT representation and SRID.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/creating-spatial-values.html#gis-wkt-functions\n\n','','http://dev.mysql.com/doc/refman/5.1/en/creating-spatial-values.html#gis-wkt-functions'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (360,16,'GROUP_CONCAT','Syntax:\nGROUP_CONCAT(expr)\n\nThis function returns a string result with the concatenated non-NULL\nvalues from a group. It returns NULL if there are no non-NULL values.\nThe full syntax is as follows:\n\nGROUP_CONCAT([DISTINCT] expr [,expr ...]\n [ORDER BY {unsigned_integer | col_name | expr}\n [ASC | DESC] [,col_name ...]]\n [SEPARATOR str_val])\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/group-by-functions.html\n\n','mysql> SELECT student_name,\n -> GROUP_CONCAT(test_score)\n -> FROM student\n -> GROUP BY student_name;\n','http://dev.mysql.com/doc/refman/5.1/en/group-by-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (361,30,'DATE_FORMAT','Syntax:\nDATE_FORMAT(date,format)\n\nFormats the date value according to the format string.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html\n\n','mysql> SELECT DATE_FORMAT(\'2009-10-04 22:23:00\', \'%W %M %Y\');\n -> \'Sunday October 2009\'\nmysql> SELECT DATE_FORMAT(\'2007-10-04 22:23:00\', \'%H:%i:%s\');\n -> \'22:23:00\'\nmysql> SELECT DATE_FORMAT(\'1900-10-04 22:23:00\',\n -> \'%D %y %a %d %m %b %j\');\n -> \'4th 00 Thu 04 10 Oct 277\'\nmysql> SELECT DATE_FORMAT(\'1997-10-04 22:23:00\',\n -> \'%H %k %I %r %T %S %w\');\n -> \'22 22 10 10:23:00 PM 22:23:00 00 6\'\nmysql> SELECT DATE_FORMAT(\'1999-01-01\', \'%X %V\');\n -> \'1998 52\'\nmysql> SELECT DATE_FORMAT(\'2006-06-00\', \'%d\');\n -> \'00\'\n','http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (362,15,'BENCHMARK','Syntax:\nBENCHMARK(count,expr)\n\nThe BENCHMARK() function executes the expression expr repeatedly count\ntimes. It may be used to time how quickly MySQL processes the\nexpression. The result value is always 0. The intended use is from\nwithin the mysql client, which reports query execution times:\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/information-functions.html\n\n','mysql> SELECT BENCHMARK(1000000,ENCODE(\'hello\',\'goodbye\'));\n+----------------------------------------------+\n| BENCHMARK(1000000,ENCODE(\'hello\',\'goodbye\')) |\n+----------------------------------------------+\n| 0 |\n+----------------------------------------------+\n1 row in set (4.74 sec)\n','http://dev.mysql.com/doc/refman/5.1/en/information-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (363,30,'YEAR','Syntax:\nYEAR(date)\n\nReturns the year for date, in the range 1000 to 9999, or 0 for the\n"zero" date.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html\n\n','mysql> SELECT YEAR(\'1987-01-01\');\n -> 1987\n','http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (364,25,'SHOW ENGINE','Syntax:\nSHOW ENGINE engine_name {STATUS | MUTEX}\n\nSHOW ENGINE displays operational information about a storage engine.\nThe following statements currently are supported:\n\nSHOW ENGINE INNODB STATUS\nSHOW ENGINE INNODB MUTEX\nSHOW ENGINE {NDB | NDBCLUSTER} STATUS\n\nOlder (and now deprecated) synonyms are SHOW INNODB STATUS for SHOW\nENGINE INNODB STATUS and SHOW MUTEX STATUS for SHOW ENGINE INNODB\nMUTEX. SHOW INNODB STATUS and SHOW MUTEX STATUS are removed in MySQL\n5.5.\n\nIn MySQL 5.0, SHOW ENGINE INNODB MUTEX is invoked as SHOW MUTEX STATUS.\nThe latter statement displays similar information but in a somewhat\ndifferent output format.\n\nSHOW ENGINE BDB LOGS formerly displayed status information about BDB\nlog files. As of MySQL 5.1.12, the BDB storage engine is not supported,\nand this statement produces a warning.\n\nSHOW ENGINE INNODB STATUS displays extensive information from the\nstandard InnoDB Monitor about the state of the InnoDB storage engine.\nFor information about the standard monitor and other InnoDB Monitors\nthat provide information about InnoDB processing, see\nhttp://dev.mysql.com/doc/refman/5.1/en/innodb-monitors.html.\n\nSHOW ENGINE INNODB MUTEX displays InnoDB mutex statistics. From MySQL\n5.1.2 to 5.1.14, the statement displays the following output fields:\n\no Type\n\n Always InnoDB.\n\no Name\n\n The mutex name and the source file where it is implemented. Example:\n &pool->mutex:mem0pool.c\n\n The mutex name indicates its purpose. For example, the log_sys mutex\n is used by the InnoDB logging subsystem and indicates how intensive\n logging activity is. The buf_pool mutex protects the InnoDB buffer\n pool.\n\no Status\n\n The mutex status. The fields contains several values:\n\n o count indicates how many times the mutex was requested.\n\n o spin_waits indicates how many times the spinlock had to run.\n\n o spin_rounds indicates the number of spinlock rounds. (spin_rounds\n divided by spin_waits provides the average round count.)\n\n o os_waits indicates the number of operating system waits. This\n occurs when the spinlock did not work (the mutex was not locked\n during the spinlock and it was necessary to yield to the operating\n system and wait).\n\n o os_yields indicates the number of times a the thread trying to lock\n a mutex gave up its timeslice and yielded to the operating system\n (on the presumption that allowing other threads to run will free\n the mutex so that it can be locked).\n\n o os_wait_times indicates the amount of time (in ms) spent in\n operating system waits, if the timed_mutexes system variable is 1\n (ON). If timed_mutexes is 0 (OFF), timing is disabled, so\n os_wait_times is 0. timed_mutexes is off by default.\n\nFrom MySQL 5.1.15 on, the statement displays the following output\nfields:\n\no Type\n\n Always InnoDB.\n\no Name\n\n The source file where the mutex is implemented, and the line number\n in the file where the mutex is created. The line number may change\n depending on your version of MySQL.\n\no Status\n\n This field displays the same values as previously described (count,\n spin_waits, spin_rounds, os_waits, os_yields, os_wait_times), but\n only if UNIV_DEBUG was defined at MySQL compilation time (for\n example, in include/univ.h in the InnoDB part of the MySQL source\n tree). If UNIV_DEBUG was not defined, the statement displays only the\n os_waits value. In the latter case (without UNIV_DEBUG), the\n information on which the output is based is insufficient to\n distinguish regular mutexes and mutexes that protect rw-locks (which\n allow multiple readers or a single writer). Consequently, the output\n may appear to contain multiple rows for the same mutex.\n\nInformation from this statement can be used to diagnose system\nproblems. For example, large values of spin_waits and spin_rounds may\nindicate scalability problems.\n\nIf the server has the NDBCLUSTER storage engine enabled, SHOW ENGINE\nNDB STATUS displays cluster status information such as the number of\nconnected data nodes, the cluster connectstring, and cluster binlog\nepochs, as well as counts of various Cluster API objects created by the\nMySQL Server when connected to the cluster. Sample output from this\nstatement is shown here:\n\nmysql> SHOW ENGINE NDB STATUS;\n+------------+-----------------------+--------------------------------------------------+\n| Type | Name | Status |\n+------------+-----------------------+--------------------------------------------------+\n| ndbcluster | connection | cluster_node_id=7,\n connected_host=192.168.0.103, connected_port=1186, number_of_data_nodes=4,\n number_of_ready_data_nodes=3, connect_count=0 |\n| ndbcluster | NdbTransaction | created=6, free=0, sizeof=212 |\n| ndbcluster | NdbOperation | created=8, free=8, sizeof=660 |\n| ndbcluster | NdbIndexScanOperation | created=1, free=1, sizeof=744 |\n| ndbcluster | NdbIndexOperation | created=0, free=0, sizeof=664 |\n| ndbcluster | NdbRecAttr | created=1285, free=1285, sizeof=60 |\n| ndbcluster | NdbApiSignal | created=16, free=16, sizeof=136 |\n| ndbcluster | NdbLabel | created=0, free=0, sizeof=196 |\n| ndbcluster | NdbBranch | created=0, free=0, sizeof=24 |\n| ndbcluster | NdbSubroutine | created=0, free=0, sizeof=68 |\n| ndbcluster | NdbCall | created=0, free=0, sizeof=16 |\n| ndbcluster | NdbBlob | created=1, free=1, sizeof=264 |\n| ndbcluster | NdbReceiver | created=4, free=0, sizeof=68 |\n| ndbcluster | binlog | latest_epoch=155467, latest_trans_epoch=148126,\n latest_received_binlog_epoch=0, latest_handled_binlog_epoch=0,\n latest_applied_binlog_epoch=0 |\n+------------+-----------------------+--------------------------------------------------+\n\nThe rows with connection and binlog in the Name column were added to\nthe output of this statement in MySQL 5.1. The Status column in each of\nthese rows provides information about the MySQL server\'s connection to\nthe cluster and about the cluster binary log\'s status, respectively.\nThe Status information is in the form of comma-delimited set of\nname/value pairs.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/show-engine.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/show-engine.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (365,14,'NAME_CONST','Syntax:\nNAME_CONST(name,value)\n\nReturns the given value. When used to produce a result set column,\nNAME_CONST() causes the column to have the given name. The arguments\nshould be constants.\n\nmysql> SELECT NAME_CONST(\'myname\', 14);\n+--------+\n| myname |\n+--------+\n| 14 |\n+--------+\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/miscellaneous-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/miscellaneous-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (366,14,'RELEASE_LOCK','Syntax:\nRELEASE_LOCK(str)\n\nReleases the lock named by the string str that was obtained with\nGET_LOCK(). Returns 1 if the lock was released, 0 if the lock was not\nestablished by this thread (in which case the lock is not released),\nand NULL if the named lock did not exist. The lock does not exist if it\nwas never obtained by a call to GET_LOCK() or if it has previously been\nreleased.\n\nThe DO statement is convenient to use with RELEASE_LOCK(). See [HELP\nDO].\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/miscellaneous-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/miscellaneous-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (367,17,'IS NULL','Syntax:\nIS NULL\n\nTests whether a value is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/comparison-operators.html\n\n','mysql> SELECT 1 IS NULL, 0 IS NULL, NULL IS NULL;\n -> 0, 0, 1\n','http://dev.mysql.com/doc/refman/5.1/en/comparison-operators.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (368,30,'CONVERT_TZ','Syntax:\nCONVERT_TZ(dt,from_tz,to_tz)\n\nCONVERT_TZ() converts a datetime value dt from the time zone given by\nfrom_tz to the time zone given by to_tz and returns the resulting\nvalue. Time zones are specified as described in\nhttp://dev.mysql.com/doc/refman/5.1/en/time-zone-support.html. This\nfunction returns NULL if the arguments are invalid.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html\n\n','mysql> SELECT CONVERT_TZ(\'2004-01-01 12:00:00\',\'GMT\',\'MET\');\n -> \'2004-01-01 13:00:00\'\nmysql> SELECT CONVERT_TZ(\'2004-01-01 12:00:00\',\'+00:00\',\'+10:00\');\n -> \'2004-01-01 22:00:00\'\n','http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (369,30,'TIME_TO_SEC','Syntax:\nTIME_TO_SEC(time)\n\nReturns the time argument, converted to seconds.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html\n\n','mysql> SELECT TIME_TO_SEC(\'22:23:00\');\n -> 80580\nmysql> SELECT TIME_TO_SEC(\'00:39:38\');\n -> 2378\n','http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (370,30,'WEEKDAY','Syntax:\nWEEKDAY(date)\n\nReturns the weekday index for date (0 = Monday, 1 = Tuesday, ... 6 =\nSunday).\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html\n\n','mysql> SELECT WEEKDAY(\'2008-02-03 22:23:00\');\n -> 6\nmysql> SELECT WEEKDAY(\'2007-11-06\');\n -> 1\n','http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (371,35,'EXPORT_SET','Syntax:\nEXPORT_SET(bits,on,off[,separator[,number_of_bits]])\n\nReturns a string such that for every bit set in the value bits, you get\nan on string and for every bit not set in the value, you get an off\nstring. Bits in bits are examined from right to left (from low-order to\nhigh-order bits). Strings are added to the result from left to right,\nseparated by the separator string (the default being the comma\ncharacter ","). The number of bits examined is given by number_of_bits\n(defaults to 64).\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/string-functions.html\n\n','mysql> SELECT EXPORT_SET(5,\'Y\',\'N\',\',\',4);\n -> \'Y,N,Y,N\'\nmysql> SELECT EXPORT_SET(6,\'1\',\'0\',\',\',10);\n -> \'0,1,1,0,0,0,0,0,0,0\'\n','http://dev.mysql.com/doc/refman/5.1/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (372,37,'ALTER SERVER','Syntax:\nALTER SERVER server_name\n OPTIONS (option [, option] ...)\n\nAlters the server information for server_name, adjusting the specified\noptions as per the CREATE SERVER command. See [HELP CREATE SERVER]. The\ncorresponding fields in the mysql.servers table are updated\naccordingly. This statement requires the SUPER privilege.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/alter-server.html\n\n','ALTER SERVER s OPTIONS (USER \'sally\');\n','http://dev.mysql.com/doc/refman/5.1/en/alter-server.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (373,30,'TIME FUNCTION','Syntax:\nTIME(expr)\n\nExtracts the time part of the time or datetime expression expr and\nreturns it as a string.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html\n\n','mysql> SELECT TIME(\'2003-12-31 01:02:03\');\n -> \'01:02:03\'\nmysql> SELECT TIME(\'2003-12-31 01:02:03.000123\');\n -> \'01:02:03.000123\'\n','http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (374,30,'DATE_ADD','Syntax:\nDATE_ADD(date,INTERVAL expr unit), DATE_SUB(date,INTERVAL expr unit)\n\nThese functions perform date arithmetic. The date argument specifies\nthe starting date or datetime value. expr is an expression specifying\nthe interval value to be added or subtracted from the starting date.\nexpr is a string; it may start with a "-" for negative intervals. unit\nis a keyword indicating the units in which the expression should be\ninterpreted.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html\n\n','mysql> SELECT \'2008-12-31 23:59:59\' + INTERVAL 1 SECOND;\n -> \'2009-01-01 00:00:00\'\nmysql> SELECT INTERVAL 1 DAY + \'2008-12-31\';\n -> \'2009-01-01\'\nmysql> SELECT \'2005-01-01\' - INTERVAL 1 SECOND;\n -> \'2004-12-31 23:59:59\'\nmysql> SELECT DATE_ADD(\'2000-12-31 23:59:59\',\n -> INTERVAL 1 SECOND);\n -> \'2001-01-01 00:00:00\'\nmysql> SELECT DATE_ADD(\'2010-12-31 23:59:59\',\n -> INTERVAL 1 DAY);\n -> \'2011-01-01 23:59:59\'\nmysql> SELECT DATE_ADD(\'2100-12-31 23:59:59\',\n -> INTERVAL \'1:1\' MINUTE_SECOND);\n -> \'2101-01-01 00:01:00\'\nmysql> SELECT DATE_SUB(\'2005-01-01 00:00:00\',\n -> INTERVAL \'1 1:1:1\' DAY_SECOND);\n -> \'2004-12-30 22:58:59\'\nmysql> SELECT DATE_ADD(\'1900-01-01 00:00:00\',\n -> INTERVAL \'-1 10\' DAY_HOUR);\n -> \'1899-12-30 14:00:00\'\nmysql> SELECT DATE_SUB(\'1998-01-02\', INTERVAL 31 DAY);\n -> \'1997-12-02\'\nmysql> SELECT DATE_ADD(\'1992-12-31 23:59:59.000002\',\n -> INTERVAL \'1.999999\' SECOND_MICROSECOND);\n -> \'1993-01-01 00:00:01.000001\'\n','http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (375,35,'CAST','Syntax:\nCAST(expr AS type)\n\nThe CAST() function takes a value of one type and produce a value of\nanother type, similar to CONVERT(). See the description of CONVERT()\nfor more information.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/cast-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/cast-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (376,35,'SOUNDS LIKE','Syntax:\nexpr1 SOUNDS LIKE expr2\n\nThis is the same as SOUNDEX(expr1) = SOUNDEX(expr2).\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/string-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (377,30,'PERIOD_DIFF','Syntax:\nPERIOD_DIFF(P1,P2)\n\nReturns the number of months between periods P1 and P2. P1 and P2\nshould be in the format YYMM or YYYYMM. Note that the period arguments\nP1 and P2 are not date values.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html\n\n','mysql> SELECT PERIOD_DIFF(200802,200703);\n -> 11\n','http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (378,35,'LIKE','Syntax:\nexpr LIKE pat [ESCAPE \'escape_char\']\n\nPattern matching using SQL simple regular expression comparison.\nReturns 1 (TRUE) or 0 (FALSE). If either expr or pat is NULL, the\nresult is NULL.\n\nThe pattern need not be a literal string. For example, it can be\nspecified as a string expression or table column.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/string-comparison-functions.html\n\n','mysql> SELECT \'David!\' LIKE \'David_\';\n -> 1\nmysql> SELECT \'David!\' LIKE \'%D%v%\';\n -> 1\n','http://dev.mysql.com/doc/refman/5.1/en/string-comparison-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (379,23,'MULTIPOINT','MultiPoint(pt1,pt2,...)\n\nConstructs a MultiPoint value using Point or WKB Point arguments.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/creating-spatial-values.html#gis-mysql-specific-functions\n\n','','http://dev.mysql.com/doc/refman/5.1/en/creating-spatial-values.html#gis-mysql-specific-functions'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (380,18,'>>','Syntax:\n>>\n\nShifts a longlong (BIGINT) number to the right.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/bit-functions.html\n\n','mysql> SELECT 4 >> 2;\n -> 1\n','http://dev.mysql.com/doc/refman/5.1/en/bit-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (381,22,'FETCH','Syntax:\nFETCH cursor_name INTO var_name [, var_name] ...\n\nThis statement fetches the next row (if a row exists) using the\nspecified open cursor, and advances the cursor pointer.\n\nIf no more rows are available, a No Data condition occurs with SQLSTATE\nvalue 02000. To detect this condition, you can set up a handler for it\n(or for a NOT FOUND condition). An example is shown in\nhttp://dev.mysql.com/doc/refman/5.1/en/cursors.html.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/fetch.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/fetch.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (382,16,'AVG','Syntax:\nAVG([DISTINCT] expr)\n\nReturns the average value of expr. The DISTINCT option can be used to\nreturn the average of the distinct values of expr.\n\nAVG() returns NULL if there were no matching rows.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/group-by-functions.html\n\n','mysql> SELECT student_name, AVG(test_score)\n -> FROM student\n -> GROUP BY student_name;\n','http://dev.mysql.com/doc/refman/5.1/en/group-by-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (383,28,'TRUE FALSE','The constants TRUE and FALSE evaluate to 1 and 0, respectively. The\nconstant names can be written in any lettercase.\n\nmysql> SELECT TRUE, true, FALSE, false;\n -> 1, 1, 0, 0\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/boolean-values.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/boolean-values.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (384,6,'MBRWITHIN','MBRWithin(g1,g2)\n\nReturns 1 or 0 to indicate whether the Minimum Bounding Rectangle of g1\nis within the Minimum Bounding Rectangle of g2. This tests the opposite\nrelationship as MBRContains().\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/relations-on-geometry-mbr.html\n\n','mysql> SET @g1 = GeomFromText(\'Polygon((0 0,0 3,3 3,3 0,0 0))\');\nmysql> SET @g2 = GeomFromText(\'Polygon((0 0,0 5,5 5,5 0,0 0))\');\nmysql> SELECT MBRWithin(@g1,@g2), MBRWithin(@g2,@g1);\n+--------------------+--------------------+\n| MBRWithin(@g1,@g2) | MBRWithin(@g2,@g1) |\n+--------------------+--------------------+\n| 1 | 0 |\n+--------------------+--------------------+\n','http://dev.mysql.com/doc/refman/5.1/en/relations-on-geometry-mbr.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (385,17,'IN','Syntax:\nexpr IN (value,...)\n\nReturns 1 if expr is equal to any of the values in the IN list, else\nreturns 0. If all values are constants, they are evaluated according to\nthe type of expr and sorted. The search for the item then is done using\na binary search. This means IN is very quick if the IN value list\nconsists entirely of constants. Otherwise, type conversion takes place\naccording to the rules described in\nhttp://dev.mysql.com/doc/refman/5.1/en/type-conversion.html, but\napplied to all the arguments.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/comparison-operators.html\n\n','mysql> SELECT 2 IN (0,3,5,7);\n -> 0\nmysql> SELECT \'wefwf\' IN (\'wee\',\'wefwf\',\'weg\');\n -> 1\n','http://dev.mysql.com/doc/refman/5.1/en/comparison-operators.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (386,35,'QUOTE','Syntax:\nQUOTE(str)\n\nQuotes a string to produce a result that can be used as a properly\nescaped data value in an SQL statement. The string is returned enclosed\nby single quotes and with each instance of single quote ("\'"),\nbackslash ("\\"), ASCII NUL, and Control-Z preceded by a backslash. If\nthe argument is NULL, the return value is the word "NULL" without\nenclosing single quotes.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/string-functions.html\n\n','mysql> SELECT QUOTE(\'Don\\\'t!\');\n -> \'Don\\\'t!\'\nmysql> SELECT QUOTE(NULL);\n -> NULL\n','http://dev.mysql.com/doc/refman/5.1/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (387,15,'SESSION_USER','Syntax:\nSESSION_USER()\n\nSESSION_USER() is a synonym for USER().\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/information-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/information-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (388,25,'HELP COMMAND','Syntax:\nmysql> help search_string\n\nIf you provide an argument to the help command, mysql uses it as a\nsearch string to access server-side help from the contents of the MySQL\nReference Manual. The proper operation of this command requires that\nthe help tables in the mysql database be initialized with help topic\ninformation (see\nhttp://dev.mysql.com/doc/refman/5.1/en/server-side-help-support.html).\n\nIf there is no match for the search string, the search fails:\n\nmysql> help me\n\nNothing found\nPlease try to run \'help contents\' for a list of all accessible topics\n\nUse help contents to see a list of the help categories:\n\nmysql> help contents\nYou asked for help about help category: "Contents"\nFor more information, type \'help <item>\', where <item> is one of the\nfollowing categories:\n Account Management\n Administration\n Data Definition\n Data Manipulation\n Data Types\n Functions\n Functions and Modifiers for Use with GROUP BY\n Geographic Features\n Language Structure\n Plugins\n Storage Engines\n Stored Routines\n Table Maintenance\n Transactions\n Triggers\n\nIf the search string matches multiple items, mysql shows a list of\nmatching topics:\n\nmysql> help logs\nMany help items for your request exist.\nTo make a more specific request, please type \'help <item>\',\nwhere <item> is one of the following topics:\n SHOW\n SHOW BINARY LOGS\n SHOW ENGINE\n SHOW LOGS\n\nUse a topic as the search string to see the help entry for that topic:\n\nmysql> help show binary logs\nName: \'SHOW BINARY LOGS\'\nDescription:\nSyntax:\nSHOW BINARY LOGS\nSHOW MASTER LOGS\n\nLists the binary log files on the server. This statement is used as\npart of the procedure described in [purge-binary-logs], that shows how\nto determine which logs can be purged.\n\nmysql> SHOW BINARY LOGS;\n+---------------+-----------+\n| Log_name | File_size |\n+---------------+-----------+\n| binlog.000015 | 724935 |\n| binlog.000016 | 733481 |\n+---------------+-----------+\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/mysql-server-side-help.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/mysql-server-side-help.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (389,30,'QUARTER','Syntax:\nQUARTER(date)\n\nReturns the quarter of the year for date, in the range 1 to 4.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html\n\n','mysql> SELECT QUARTER(\'2008-04-01\');\n -> 2\n','http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (390,35,'POSITION','Syntax:\nPOSITION(substr IN str)\n\nPOSITION(substr IN str) is a synonym for LOCATE(substr,str).\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/string-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (391,25,'SHOW CREATE FUNCTION','Syntax:\nSHOW CREATE FUNCTION func_name\n\nThis statement is similar to SHOW CREATE PROCEDURE but for stored\nfunctions. See [HELP SHOW CREATE PROCEDURE].\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/show-create-function.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/show-create-function.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (392,14,'IS_USED_LOCK','Syntax:\nIS_USED_LOCK(str)\n\nChecks whether the lock named str is in use (that is, locked). If so,\nit returns the connection identifier of the client that holds the lock.\nOtherwise, it returns NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/miscellaneous-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/miscellaneous-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (393,3,'POLYFROMTEXT','PolyFromText(wkt[,srid]), PolygonFromText(wkt[,srid])\n\nConstructs a POLYGON value using its WKT representation and SRID.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/creating-spatial-values.html#gis-wkt-functions\n\n','','http://dev.mysql.com/doc/refman/5.1/en/creating-spatial-values.html#gis-wkt-functions'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (394,11,'DES_ENCRYPT','Syntax:\nDES_ENCRYPT(str[,{key_num|key_str}])\n\nEncrypts the string with the given key using the Triple-DES algorithm.\n\nThis function works only if MySQL has been configured with SSL support.\nSee http://dev.mysql.com/doc/refman/5.1/en/secure-connections.html.\n\nThe encryption key to use is chosen based on the second argument to\nDES_ENCRYPT(), if one was given. With no argument, the first key from\nthe DES key file is used. With a key_num argument, the given key number\n(0-9) from the DES key file is used. With a key_str argument, the given\nkey string is used to encrypt str.\n\nThe key file can be specified with the --des-key-file server option.\n\nThe return string is a binary string where the first character is\nCHAR(128 | key_num). If an error occurs, DES_ENCRYPT() returns NULL.\n\nThe 128 is added to make it easier to recognize an encrypted key. If\nyou use a string key, key_num is 127.\n\nThe string length for the result is given by this formula:\n\nnew_len = orig_len + (8 - (orig_len % 8)) + 1\n\nEach line in the DES key file has the following format:\n\nkey_num des_key_str\n\nEach key_num value must be a number in the range from 0 to 9. Lines in\nthe file may be in any order. des_key_str is the string that is used to\nencrypt the message. There should be at least one space between the\nnumber and the key. The first key is the default key that is used if\nyou do not specify any key argument to DES_ENCRYPT().\n\nYou can tell MySQL to read new key values from the key file with the\nFLUSH DES_KEY_FILE statement. This requires the RELOAD privilege.\n\nOne benefit of having a set of default keys is that it gives\napplications a way to check for the existence of encrypted column\nvalues, without giving the end user the right to decrypt those values.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/encryption-functions.html\n\n','mysql> SELECT customer_address FROM customer_table \n > WHERE crypted_credit_card = DES_ENCRYPT(\'credit_card_number\');\n','http://dev.mysql.com/doc/refman/5.1/en/encryption-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (395,4,'CEIL','Syntax:\nCEIL(X)\n\nCEIL() is a synonym for CEILING().\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/mathematical-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/mathematical-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (396,35,'LENGTH','Syntax:\nLENGTH(str)\n\nReturns the length of the string str, measured in bytes. A multi-byte\ncharacter counts as multiple bytes. This means that for a string\ncontaining five two-byte characters, LENGTH() returns 10, whereas\nCHAR_LENGTH() returns 5.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/string-functions.html\n\n','mysql> SELECT LENGTH(\'text\');\n -> 4\n','http://dev.mysql.com/doc/refman/5.1/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (397,30,'STR_TO_DATE','Syntax:\nSTR_TO_DATE(str,format)\n\nThis is the inverse of the DATE_FORMAT() function. It takes a string\nstr and a format string format. STR_TO_DATE() returns a DATETIME value\nif the format string contains both date and time parts, or a DATE or\nTIME value if the string contains only date or time parts. If the date,\ntime, or datetime value extracted from str is illegal, STR_TO_DATE()\nreturns NULL and produces a warning.\n\nThe server scans str attempting to match format to it. The format\nstring can contain literal characters and format specifiers beginning\nwith %. Literal characters in format must match literally in str.\nFormat specifiers in format must match a date or time part in str. For\nthe specifiers that can be used in format, see the DATE_FORMAT()\nfunction description.\n\nmysql> SELECT STR_TO_DATE(\'01,5,2013\',\'%d,%m,%Y\');\n -> \'2013-05-01\'\nmysql> SELECT STR_TO_DATE(\'May 1, 2013\',\'%M %d,%Y\');\n -> \'2013-05-01\'\n\nScanning starts at the beginning of str and fails if format is found\nnot to match. Extra characters at the end of str are ignored.\n\nmysql> SELECT STR_TO_DATE(\'a09:30:17\',\'a%h:%i:%s\');\n -> \'09:30:17\'\nmysql> SELECT STR_TO_DATE(\'a09:30:17\',\'%h:%i:%s\');\n -> NULL\nmysql> SELECT STR_TO_DATE(\'09:30:17a\',\'%h:%i:%s\');\n -> \'09:30:17\'\n\nUnspecified date or time parts have a value of 0, so incompletely\nspecified values in str produce a result with some or all parts set to\n0:\n\nmysql> SELECT STR_TO_DATE(\'abc\',\'abc\');\n -> \'0000-00-00\'\nmysql> SELECT STR_TO_DATE(\'9\',\'%m\');\n -> \'0000-09-00\'\nmysql> SELECT STR_TO_DATE(\'9\',\'%s\');\n -> \'00:00:09\'\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (398,10,'Y','Y(p)\n\nReturns the Y-coordinate value for the point p as a double-precision\nnumber.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/geometry-property-functions.html#point-property-functions\n\n','mysql> SET @pt = \'Point(56.7 53.34)\';\nmysql> SELECT Y(GeomFromText(@pt));\n+----------------------+\n| Y(GeomFromText(@pt)) |\n+----------------------+\n| 53.34 |\n+----------------------+\n','http://dev.mysql.com/doc/refman/5.1/en/geometry-property-functions.html#point-property-functions'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (399,25,'SHOW INNODB STATUS','Syntax:\nSHOW INNODB STATUS\n\nIn MySQL 5.1, this is a deprecated synonym for SHOW ENGINE INNODB\nSTATUS. See [HELP SHOW ENGINE]. SHOW INNODB STATUS is removed in MySQL\n5.5.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/show-innodb-status.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/show-innodb-status.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (400,19,'CHECKSUM TABLE','Syntax:\nCHECKSUM TABLE tbl_name [, tbl_name] ... [ QUICK | EXTENDED ]\n\nCHECKSUM TABLE reports a table checksum.\n\nWith QUICK, the live table checksum is reported if it is available, or\nNULL otherwise. This is very fast. A live checksum is enabled by\nspecifying the CHECKSUM=1 table option when you create the table;\ncurrently, this is supported only for MyISAM tables. See [HELP CREATE\nTABLE].\n\nWith EXTENDED, the entire table is read row by row and the checksum is\ncalculated. This can be very slow for large tables.\n\nIf neither QUICK nor EXTENDED is specified, MySQL returns a live\nchecksum if the table storage engine supports it and scans the table\notherwise.\n\nFor a nonexistent table, CHECKSUM TABLE returns NULL and generates a\nwarning.\n\nThe checksum value depends on the table row format. If the row format\nchanges, the checksum also changes. For example, the storage format for\nVARCHAR changed between MySQL 4.1 and 5.0, so if a 4.1 table is\nupgraded to MySQL 5.0, the checksum value may change.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/checksum-table.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/checksum-table.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (401,2,'NUMINTERIORRINGS','NumInteriorRings(poly)\n\nReturns the number of interior rings in the Polygon value poly.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/geometry-property-functions.html#polygon-property-functions\n\n','mysql> SET @poly =\n -> \'Polygon((0 0,0 3,3 3,3 0,0 0),(1 1,1 2,2 2,2 1,1 1))\';\nmysql> SELECT NumInteriorRings(GeomFromText(@poly));\n+---------------------------------------+\n| NumInteriorRings(GeomFromText(@poly)) |\n+---------------------------------------+\n| 1 |\n+---------------------------------------+\n','http://dev.mysql.com/doc/refman/5.1/en/geometry-property-functions.html#polygon-property-functions'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (402,2,'INTERIORRINGN','InteriorRingN(poly,N)\n\nReturns the N-th interior ring for the Polygon value poly as a\nLineString. Rings are numbered beginning with 1.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/geometry-property-functions.html#polygon-property-functions\n\n','mysql> SET @poly =\n -> \'Polygon((0 0,0 3,3 3,3 0,0 0),(1 1,1 2,2 2,2 1,1 1))\';\nmysql> SELECT AsText(InteriorRingN(GeomFromText(@poly),1));\n+----------------------------------------------+\n| AsText(InteriorRingN(GeomFromText(@poly),1)) |\n+----------------------------------------------+\n| LINESTRING(1 1,1 2,2 2,2 1,1 1) |\n+----------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.1/en/geometry-property-functions.html#polygon-property-functions'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (403,30,'UTC_TIME','Syntax:\nUTC_TIME, UTC_TIME()\n\nReturns the current UTC time as a value in \'HH:MM:SS\' or HHMMSS.uuuuuu\nformat, depending on whether the function is used in a string or\nnumeric context.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html\n\n','mysql> SELECT UTC_TIME(), UTC_TIME() + 0;\n -> \'18:07:53\', 180753.000000\n','http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (404,37,'DROP FUNCTION','The DROP FUNCTION statement is used to drop stored functions and\nuser-defined functions (UDFs):\n\no For information about dropping stored functions, see [HELP DROP\n PROCEDURE].\n\no For information about dropping user-defined functions, see [HELP DROP\n FUNCTION UDF].\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/drop-function.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/drop-function.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (405,37,'ALTER EVENT','Syntax:\nALTER\n [DEFINER = { user | CURRENT_USER }]\n EVENT event_name\n [ON SCHEDULE schedule]\n [ON COMPLETION [NOT] PRESERVE]\n [RENAME TO new_event_name]\n [ENABLE | DISABLE | DISABLE ON SLAVE]\n [COMMENT \'comment\']\n [DO sql_statement]\n\nThe ALTER EVENT statement is used to change one or more of the\ncharacteristics of an existing event without the need to drop and\nrecreate it. The syntax for each of the DEFINER, ON SCHEDULE, ON\nCOMPLETION, COMMENT, ENABLE / DISABLE, and DO clauses is exactly the\nsame as when used with CREATE EVENT. (See [HELP CREATE EVENT].)\n\nSupport for the DEFINER clause was added in MySQL 5.1.17.\n\nBeginning with MySQL 5.1.12, this statement requires the EVENT\nprivilege. When a user executes a successful ALTER EVENT statement,\nthat user becomes the definer for the affected event.\n\n(In MySQL 5.1.11 and earlier, an event could be altered only by its\ndefiner, or by a user having the SUPER privilege.)\n\nALTER EVENT works only with an existing event:\n\nmysql> ALTER EVENT no_such_event \n > ON SCHEDULE \n > EVERY \'2:3\' DAY_HOUR;\nERROR 1517 (HY000): Unknown event \'no_such_event\'\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/alter-event.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/alter-event.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (406,16,'STDDEV','Syntax:\nSTDDEV(expr)\n\nReturns the population standard deviation of expr. This function is\nprovided for compatibility with Oracle. The standard SQL function\nSTDDEV_POP() can be used instead.\n\nThis function returns NULL if there were no matching rows.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/group-by-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/group-by-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (407,30,'DATE_SUB','Syntax:\nDATE_SUB(date,INTERVAL expr unit)\n\nSee the description for DATE_ADD().\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (408,30,'PERIOD_ADD','Syntax:\nPERIOD_ADD(P,N)\n\nAdds N months to period P (in the format YYMM or YYYYMM). Returns a\nvalue in the format YYYYMM. Note that the period argument P is not a\ndate value.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html\n\n','mysql> SELECT PERIOD_ADD(200801,2);\n -> 200803\n','http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (409,18,'|','Syntax:\n|\n\nBitwise OR:\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/bit-functions.html\n\n','mysql> SELECT 29 | 15;\n -> 31\n','http://dev.mysql.com/doc/refman/5.1/en/bit-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (410,3,'GEOMFROMTEXT','GeomFromText(wkt[,srid]), GeometryFromText(wkt[,srid])\n\nConstructs a geometry value of any type using its WKT representation\nand SRID.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/creating-spatial-values.html#gis-wkt-functions\n\n','','http://dev.mysql.com/doc/refman/5.1/en/creating-spatial-values.html#gis-wkt-functions'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (411,14,'UUID_SHORT','Syntax:\nUUID_SHORT()\n\nReturns a "short" universal identifier as a 64-bit unsigned integer\n(rather than a string-form 128-bit identifier as returned by the UUID()\nfunction).\n\nThe value of UUID_SHORT() is guaranteed to be unique if the following\nconditions hold:\n\no The server_id of the current host is unique among your set of master\n and slave servers\n\no server_id is between 0 and 255\n\no You don\'t set back your system time for your server between mysqld\n restarts\n\no You do not invoke UUID_SHORT() on average more than 16 million times\n per second between mysqld restarts\n\nThe UUID_SHORT() return value is constructed this way:\n\n (server_id & 255) << 56\n+ (server_startup_time_in_seconds << 24)\n+ incremented_variable++;\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/miscellaneous-functions.html\n\n','mysql> SELECT UUID_SHORT();\n -> 92395783831158784\n','http://dev.mysql.com/doc/refman/5.1/en/miscellaneous-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (412,35,'RIGHT','Syntax:\nRIGHT(str,len)\n\nReturns the rightmost len characters from the string str, or NULL if\nany argument is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/string-functions.html\n\n','mysql> SELECT RIGHT(\'foobarbar\', 4);\n -> \'rbar\'\n','http://dev.mysql.com/doc/refman/5.1/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (413,30,'DATEDIFF','Syntax:\nDATEDIFF(expr1,expr2)\n\nDATEDIFF() returns expr1 - expr2 expressed as a value in days from one\ndate to the other. expr1 and expr2 are date or date-and-time\nexpressions. Only the date parts of the values are used in the\ncalculation.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html\n\n','mysql> SELECT DATEDIFF(\'2007-12-31 23:59:59\',\'2007-12-30\');\n -> 1\nmysql> SELECT DATEDIFF(\'2010-11-30 23:59:59\',\'2010-12-31\');\n -> -31\n','http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (414,37,'DROP TABLESPACE','Syntax:\nDROP TABLESPACE tablespace_name\n ENGINE [=] engine_name\n\nThis statement drops a tablespace that was previously created using\nCREATE TABLESPACE (see [HELP CREATE TABLESPACE]).\n\n*Important*: The tablespace to be dropped must not contain any data\nfiles; in other words, before you can drop a tablespace, you must first\ndrop each of its data files using ALTER TABLESPACE ... DROP DATAFILE\n(see [HELP ALTER TABLESPACE]).\n\nThe ENGINE clause (required) specifies the storage engine used by the\ntablespace. In MySQL 5.1, the only accepted values for engine_name are\nNDB and NDBCLUSTER.\n\nDROP TABLESPACE was added in MySQL 5.1.6. In MySQL 5.1, it is useful\nonly with Disk Data storage for MySQL Cluster. See\nhttp://dev.mysql.com/doc/refman/5.1/en/mysql-cluster-disk-data.html.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/drop-tablespace.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/drop-tablespace.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (415,37,'DROP PROCEDURE','Syntax:\nDROP {PROCEDURE | FUNCTION} [IF EXISTS] sp_name\n\nThis statement is used to drop a stored procedure or function. That is,\nthe specified routine is removed from the server. You must have the\nALTER ROUTINE privilege for the routine. (If the\nautomatic_sp_privileges system variable is enabled, that privilege and\nEXECUTE are granted automatically to the routine creator when the\nroutine is created and dropped from the creator when the routine is\ndropped. See\nhttp://dev.mysql.com/doc/refman/5.1/en/stored-routines-privileges.html.\n)\n\nThe IF EXISTS clause is a MySQL extension. It prevents an error from\noccurring if the procedure or function does not exist. A warning is\nproduced that can be viewed with SHOW WARNINGS.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/drop-procedure.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/drop-procedure.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (416,19,'CHECK TABLE','Syntax:\nCHECK TABLE tbl_name [, tbl_name] ... [option] ...\n\noption = {FOR UPGRADE | QUICK | FAST | MEDIUM | EXTENDED | CHANGED}\n\nCHECK TABLE checks a table or tables for errors. CHECK TABLE works for\nMyISAM, InnoDB, and ARCHIVE tables. Starting with MySQL 5.1.9, CHECK\nTABLE is also valid for CSV tables, see\nhttp://dev.mysql.com/doc/refman/5.1/en/csv-storage-engine.html. For\nMyISAM tables, the key statistics are updated as well.\n\nCHECK TABLE can also check views for problems, such as tables that are\nreferenced in the view definition that no longer exist.\n\nBeginning with MySQL 5.1.27, CHECK TABLE is also supported for\npartitioned tables. Also beginning with MySQL 5.1.27, you can use ALTER\nTABLE ... CHECK PARTITION to check one or more partitions; for more\ninformation, see [HELP ALTER TABLE], and\nhttp://dev.mysql.com/doc/refman/5.1/en/partitioning-maintenance.html.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/check-table.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/check-table.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (417,35,'BIN','Syntax:\nBIN(N)\n\nReturns a string representation of the binary value of N, where N is a\nlonglong (BIGINT) number. This is equivalent to CONV(N,10,2). Returns\nNULL if N is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/string-functions.html\n\n','mysql> SELECT BIN(12);\n -> \'1100\'\n','http://dev.mysql.com/doc/refman/5.1/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (418,5,'INSTALL PLUGIN','Syntax:\nINSTALL PLUGIN plugin_name SONAME \'shared_library_name\'\n\nThis statement installs a server plugin. It requires the INSERT\nprivilege for the mysql.plugin table.\n\nplugin_name is the name of the plugin as defined in the plugin\ndescriptor structure contained in the library file (see\nhttp://dev.mysql.com/doc/refman/5.1/en/plugin-data-structures.html).\nPlugin names are not case sensitive. For maximal compatibility, plugin\nnames should be limited to ASCII letters, digits, and underscore\nbecause they are used in C source files, shell command lines, M4 and\nBourne shell scripts, and SQL environments.\n\nshared_library_name is the name of the shared library that contains the\nplugin code. The name includes the file name extension (for example,\nlibmyplugin.so, libmyplugin.dll, or libmyplugin.dylib).\n\nThe shared library must be located in the plugin directory (the\ndirectory named by the plugin_dir system variable). The library must be\nin the plugin directory itself, not in a subdirectory. By default,\nplugin_dir is the plugin directory under the directory named by the\npkglibdir configuration variable, but it can be changed by setting the\nvalue of plugin_dir at server startup. For example, set its value in a\nmy.cnf file:\n\n[mysqld]\nplugin_dir=/path/to/plugin/directory\n\nIf the value of plugin_dir is a relative path name, it is taken to be\nrelative to the MySQL base directory (the value of the basedir system\nvariable).\n\nINSTALL PLUGIN loads and initializes the plugin code to make the plugin\navailable for use. A plugin is initialized by executing its\ninitialization function, which handles any setup that the plugin must\nperform before it can be used. When the server shuts down, it executes\nthe deinitialization function for each plugin that is loaded so that\nthe plugin has a change to perform any final cleanup.\n\nINSTALL PLUGIN also registers the plugin by adding a line that\nindicates the plugin name and library file name to the mysql.plugin\ntable. At server startup, the server loads and initializes any plugin\nthat is listed in the mysql.plugin table. This means that a plugin is\ninstalled with INSTALL PLUGIN only once, not every time the server\nstarts. Plugin loading at startup does not occur if the server is\nstarted with the --skip-grant-tables option.\n\nA plugin library can contain multiple plugins. For each of them to be\ninstalled, use a separate INSTALL PLUGIN statement. Each statement\nnames a different plugin, but all of them specify the same library\nname.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/install-plugin.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/install-plugin.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (419,22,'DECLARE CURSOR','Syntax:\nDECLARE cursor_name CURSOR FOR select_statement\n\nThis statement declares a cursor. Multiple cursors may be declared in a\nstored program, but each cursor in a given block must have a unique\nname.\n\nThe SELECT statement cannot have an INTO clause.\n\nFor information available through SHOW statements, it is possible in\nmany cases to obtain equivalent information by using a cursor with an\nINFORMATION_SCHEMA table.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/declare-cursor.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/declare-cursor.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (420,26,'LOAD DATA','Syntax:\nLOAD DATA [LOW_PRIORITY | CONCURRENT] [LOCAL] INFILE \'file_name\'\n [REPLACE | IGNORE]\n INTO TABLE tbl_name\n [CHARACTER SET charset_name]\n [{FIELDS | COLUMNS}\n [TERMINATED BY \'string\']\n [[OPTIONALLY] ENCLOSED BY \'char\']\n [ESCAPED BY \'char\']\n ]\n [LINES\n [STARTING BY \'string\']\n [TERMINATED BY \'string\']\n ]\n [IGNORE number LINES]\n [(col_name_or_user_var,...)]\n [SET col_name = expr,...]\n\nThe LOAD DATA INFILE statement reads rows from a text file into a table\nat a very high speed. The file name must be given as a literal string.\n\nLOAD DATA INFILE is the complement of SELECT ... INTO OUTFILE. (See\nhttp://dev.mysql.com/doc/refman/5.1/en/select.html.) To write data from\na table to a file, use SELECT ... INTO OUTFILE. To read the file back\ninto a table, use LOAD DATA INFILE. The syntax of the FIELDS and LINES\nclauses is the same for both statements. Both clauses are optional, but\nFIELDS must precede LINES if both are specified.\n\nFor more information about the efficiency of INSERT versus LOAD DATA\nINFILE and speeding up LOAD DATA INFILE, see\nhttp://dev.mysql.com/doc/refman/5.1/en/insert-speed.html.\n\nThe character set indicated by the character_set_database system\nvariable is used to interpret the information in the file. SET NAMES\nand the setting of character_set_client do not affect interpretation of\ninput. If the contents of the input file use a character set that\ndiffers from the default, it is usually preferable to specify the\ncharacter set of the file by using the CHARACTER SET clause, which is\navailable as of MySQL 5.1.17. A character set of binary specifies "no\nconversion."\n\nLOAD DATA INFILE interprets all fields in the file as having the same\ncharacter set, regardless of the data types of the columns into which\nfield values are loaded. For proper interpretation of file contents,\nyou must ensure that it was written with the correct character set. For\nexample, if you write a data file with mysqldump -T or by issuing a\nSELECT ... INTO OUTFILE statement in mysql, be sure to use a\n--default-character-set option with mysqldump or mysql so that output\nis written in the character set to be used when the file is loaded with\nLOAD DATA INFILE.\n\nNote that it is currently not possible to load data files that use the\nucs2 character set.\n\nAs of MySQL 5.1.6, the character_set_filesystem system variable\ncontrols the interpretation of the file name.\n\nYou can also load data files by using the mysqlimport utility; it\noperates by sending a LOAD DATA INFILE statement to the server. The\n--local option causes mysqlimport to read data files from the client\nhost. You can specify the --compress option to get better performance\nover slow networks if the client and server support the compressed\nprotocol. See http://dev.mysql.com/doc/refman/5.1/en/mysqlimport.html.\n\nIf you use LOW_PRIORITY, execution of the LOAD DATA statement is\ndelayed until no other clients are reading from the table. This affects\nonly storage engines that use only table-level locking (such as MyISAM,\nMEMORY, and MERGE).\n\nIf you specify CONCURRENT with a MyISAM table that satisfies the\ncondition for concurrent inserts (that is, it contains no free blocks\nin the middle), other threads can retrieve data from the table while\nLOAD DATA is executing. Using this option affects the performance of\nLOAD DATA a bit, even if no other thread is using the table at the same\ntime.\n\nPrior to MySQL 5.1.43, CONCURRENT was not replicated when using\nstatement-based replication (see Bug#34628\n(http://bugs.mysql.com/bug.php?id=34628)). However, it is replicated\nwhen using row-based replication, regardless of the version. See\nhttp://dev.mysql.com/doc/refman/5.1/en/replication-features-load-data.h\ntml, for more information.\n\n*Note*: Prior to MySQL 5.1.23, LOAD DATA performed very poorly when\nimporting into partitioned tables. The statement now uses buffering to\nimprove performance; however, the buffer uses 130KB memory per\npartition to achieve this. (Bug#26527\n(http://bugs.mysql.com/bug.php?id=26527))\n\nThe LOCAL keyword, if specified, is interpreted with respect to the\nclient end of the connection:\n\no If LOCAL is specified, the file is read by the client program on the\n client host and sent to the server. The file can be given as a full\n path name to specify its exact location. If given as a relative path\n name, the name is interpreted relative to the directory in which the\n client program was started.\n\no If LOCAL is not specified, the file must be located on the server\n host and is read directly by the server. The server uses the\n following rules to locate the file:\n\n o If the file name is an absolute path name, the server uses it as\n given.\n\n o If the file name is a relative path name with one or more leading\n components, the server searches for the file relative to the\n server\'s data directory.\n\n o If a file name with no leading components is given, the server\n looks for the file in the database directory of the default\n database.\n\nNote that, in the non-LOCAL case, these rules mean that a file named as\n./myfile.txt is read from the server\'s data directory, whereas the file\nnamed as myfile.txt is read from the database directory of the default\ndatabase. For example, if db1 is the default database, the following\nLOAD DATA statement reads the file data.txt from the database directory\nfor db1, even though the statement explicitly loads the file into a\ntable in the db2 database:\n\nLOAD DATA INFILE \'data.txt\' INTO TABLE db2.my_table;\n\nWindows path names are specified using forward slashes rather than\nbackslashes. If you do use backslashes, you must double them.\n\n*Note*: A regression in MySQL 5.1.40 caused the database referenced in\na fully qualified table name to be ignored by LOAD DATA when using\nreplication with either STATEMENT or MIXED as the binary logging\nformat; this could lead to problems if the table was not in the current\ndatabase. As a workaround, you can specify the correct database with\nthe USE statement prior to executing LOAD DATA. If necessary, you can\nreset the default database with a second USE statement following the\nLOAD DATA statement. This issue was fixed in MySQL 5.1.41. (Bug#48297\n(http://bugs.mysql.com/bug.php?id=48297))\n\nFor security reasons, when reading text files located on the server,\nthe files must either reside in the database directory or be readable\nby all. Also, to use LOAD DATA INFILE on server files, you must have\nthe FILE privilege. See\nhttp://dev.mysql.com/doc/refman/5.1/en/privileges-provided.html. For\nnon-LOCAL load operations, if the secure_file_priv system variable is\nset to a nonempty directory name, the file to be loaded must be located\nin that directory.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/load-data.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/load-data.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (421,23,'MULTILINESTRING','MultiLineString(ls1,ls2,...)\n\nConstructs a MultiLineString value using LineString or WKB LineString\narguments.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/creating-spatial-values.html#gis-mysql-specific-functions\n\n','','http://dev.mysql.com/doc/refman/5.1/en/creating-spatial-values.html#gis-mysql-specific-functions'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (422,30,'LOCALTIME','Syntax:\nLOCALTIME, LOCALTIME()\n\nLOCALTIME and LOCALTIME() are synonyms for NOW().\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (423,3,'MPOINTFROMTEXT','MPointFromText(wkt[,srid]), MultiPointFromText(wkt[,srid])\n\nConstructs a MULTIPOINT value using its WKT representation and SRID.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/creating-spatial-values.html#gis-wkt-functions\n\n','','http://dev.mysql.com/doc/refman/5.1/en/creating-spatial-values.html#gis-wkt-functions'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (424,20,'BLOB','BLOB[(M)]\n\nA BLOB column with a maximum length of 65,535 (216 - 1) bytes. Each\nBLOB value is stored using a two-byte length prefix that indicates the\nnumber of bytes in the value.\n\nAn optional length M can be given for this type. If this is done, MySQL\ncreates the column as the smallest BLOB type large enough to hold\nvalues M bytes long.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/string-type-overview.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (425,11,'SHA1','Syntax:\nSHA1(str), SHA(str)\n\nCalculates an SHA-1 160-bit checksum for the string, as described in\nRFC 3174 (Secure Hash Algorithm). The value is returned as a binary\nstring of 40 hex digits, or NULL if the argument was NULL. One of the\npossible uses for this function is as a hash key. You can also use it\nas a cryptographic function for storing passwords. SHA() is synonymous\nwith SHA1().\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/encryption-functions.html\n\n','mysql> SELECT SHA1(\'abc\');\n -> \'a9993e364706816aba3e25717850c26c9cd0d89d\'\n','http://dev.mysql.com/doc/refman/5.1/en/encryption-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (426,35,'SUBSTR','Syntax:\nSUBSTR(str,pos), SUBSTR(str FROM pos), SUBSTR(str,pos,len), SUBSTR(str\nFROM pos FOR len)\n\nSUBSTR() is a synonym for SUBSTRING().\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/string-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (427,11,'PASSWORD','Syntax:\nPASSWORD(str)\n\nCalculates and returns a password string from the plaintext password\nstr and returns a binary string, or NULL if the argument was NULL. This\nis the function that is used for encrypting MySQL passwords for storage\nin the Password column of the user grant table.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/encryption-functions.html\n\n','mysql> SELECT PASSWORD(\'badpwd\');\n -> \'*AAB3E285149C0135D51A520E1940DD3263DC008C\'\n','http://dev.mysql.com/doc/refman/5.1/en/encryption-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (428,20,'CHAR','[NATIONAL] CHAR[(M)] [CHARACTER SET charset_name] [COLLATE\ncollation_name]\n\nA fixed-length string that is always right-padded with spaces to the\nspecified length when stored. M represents the column length in\ncharacters. The range of M is 0 to 255. If M is omitted, the length is\n1.\n\n*Note*: Trailing spaces are removed when CHAR values are retrieved\nunless the PAD_CHAR_TO_FULL_LENGTH SQL mode is enabled.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/string-type-overview.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (429,30,'UTC_DATE','Syntax:\nUTC_DATE, UTC_DATE()\n\nReturns the current UTC date as a value in \'YYYY-MM-DD\' or YYYYMMDD\nformat, depending on whether the function is used in a string or\nnumeric context.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html\n\n','mysql> SELECT UTC_DATE(), UTC_DATE() + 0;\n -> \'2003-08-14\', 20030814\n','http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (430,34,'DIMENSION','Dimension(g)\n\nReturns the inherent dimension of the geometry value g. The result can\nbe -1, 0, 1, or 2. The meaning of these values is given in\nhttp://dev.mysql.com/doc/refman/5.1/en/gis-class-geometry.html.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/geometry-property-functions.html#general-geometry-property-functions\n\n','mysql> SELECT Dimension(GeomFromText(\'LineString(1 1,2 2)\'));\n+------------------------------------------------+\n| Dimension(GeomFromText(\'LineString(1 1,2 2)\')) |\n+------------------------------------------------+\n| 1 |\n+------------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.1/en/geometry-property-functions.html#general-geometry-property-functions'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (431,16,'COUNT DISTINCT','Syntax:\nCOUNT(DISTINCT expr,[expr...])\n\nReturns a count of the number of rows with different non-NULL expr\nvalues.\n\nCOUNT(DISTINCT) returns 0 if there were no matching rows.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/group-by-functions.html\n\n','mysql> SELECT COUNT(DISTINCT results) FROM student;\n','http://dev.mysql.com/doc/refman/5.1/en/group-by-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (432,20,'BIT','BIT[(M)]\n\nA bit-field type. M indicates the number of bits per value, from 1 to\n64. The default is 1 if M is omitted.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/numeric-type-overview.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (433,29,'EQUALS','Equals(g1,g2)\n\nReturns 1 or 0 to indicate whether g1 is spatially equal to g2.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/functions-that-test-spatial-relationships-between-geometries.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/functions-that-test-spatial-relationships-between-geometries.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (434,25,'SHOW CREATE VIEW','Syntax:\nSHOW CREATE VIEW view_name\n\nThis statement shows a CREATE VIEW statement that creates the given\nview.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/show-create-view.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/show-create-view.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (435,17,'INTERVAL','Syntax:\nINTERVAL(N,N1,N2,N3,...)\n\nReturns 0 if N < N1, 1 if N < N2 and so on or -1 if N is NULL. All\narguments are treated as integers. It is required that N1 < N2 < N3 <\n... < Nn for this function to work correctly. This is because a binary\nsearch is used (very fast).\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/comparison-operators.html\n\n','mysql> SELECT INTERVAL(23, 1, 15, 17, 30, 44, 200);\n -> 3\nmysql> SELECT INTERVAL(10, 1, 10, 100, 1000);\n -> 2\nmysql> SELECT INTERVAL(22, 23, 30, 44, 200);\n -> 0\n','http://dev.mysql.com/doc/refman/5.1/en/comparison-operators.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (436,30,'FROM_DAYS','Syntax:\nFROM_DAYS(N)\n\nGiven a day number N, returns a DATE value.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html\n\n','mysql> SELECT FROM_DAYS(730669);\n -> \'2007-07-03\'\n','http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (437,37,'ALTER PROCEDURE','Syntax:\nALTER PROCEDURE proc_name [characteristic ...]\n\ncharacteristic:\n { CONTAINS SQL | NO SQL | READS SQL DATA | MODIFIES SQL DATA }\n | SQL SECURITY { DEFINER | INVOKER }\n | COMMENT \'string\'\n\nThis statement can be used to change the characteristics of a stored\nprocedure. More than one change may be specified in an ALTER PROCEDURE\nstatement. However, you cannot change the parameters or body of a\nstored procedure using this statement; to make such changes, you must\ndrop and re-create the procedure using DROP PROCEDURE and CREATE\nPROCEDURE.\n\nYou must have the ALTER ROUTINE privilege for the procedure. (That\nprivilege is granted automatically to the procedure creator.)\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/alter-procedure.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/alter-procedure.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (438,18,'BIT_COUNT','Syntax:\nBIT_COUNT(N)\n\nReturns the number of bits that are set in the argument N.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/bit-functions.html\n\n','mysql> SELECT BIT_COUNT(29), BIT_COUNT(b\'101010\');\n -> 4, 3\n','http://dev.mysql.com/doc/refman/5.1/en/bit-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (439,35,'OCTET_LENGTH','Syntax:\nOCTET_LENGTH(str)\n\nOCTET_LENGTH() is a synonym for LENGTH().\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/string-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (440,30,'UTC_TIMESTAMP','Syntax:\nUTC_TIMESTAMP, UTC_TIMESTAMP()\n\nReturns the current UTC date and time as a value in \'YYYY-MM-DD\nHH:MM:SS\' or YYYYMMDDHHMMSS.uuuuuu format, depending on whether the\nfunction is used in a string or numeric context.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html\n\n','mysql> SELECT UTC_TIMESTAMP(), UTC_TIMESTAMP() + 0;\n -> \'2003-08-14 18:08:04\', 20030814180804.000000\n','http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (441,11,'AES_ENCRYPT','Syntax:\nAES_ENCRYPT(str,key_str)\n\nAES_ENCRYPT() and AES_DECRYPT() allow encryption and decryption of data\nusing the official AES (Advanced Encryption Standard) algorithm,\npreviously known as "Rijndael." Encoding with a 128-bit key length is\nused, but you can extend it up to 256 bits by modifying the source. We\nchose 128 bits because it is much faster and it is secure enough for\nmost purposes.\n\nAES_ENCRYPT() encrypts a string and returns a binary string.\nAES_DECRYPT() decrypts the encrypted string and returns the original\nstring. The input arguments may be any length. If either argument is\nNULL, the result of this function is also NULL.\n\nBecause AES is a block-level algorithm, padding is used to encode\nuneven length strings and so the result string length may be calculated\nusing this formula:\n\n16 x (trunc(string_length / 16) + 1)\n\nIf AES_DECRYPT() detects invalid data or incorrect padding, it returns\nNULL. However, it is possible for AES_DECRYPT() to return a non-NULL\nvalue (possibly garbage) if the input data or the key is invalid.\n\nYou can use the AES functions to store data in an encrypted form by\nmodifying your queries:\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/encryption-functions.html\n\n','INSERT INTO t VALUES (1,AES_ENCRYPT(\'text\',\'password\'));\n','http://dev.mysql.com/doc/refman/5.1/en/encryption-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (442,4,'+','Syntax:\n+\n\nAddition:\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/arithmetic-functions.html\n\n','mysql> SELECT 3+5;\n -> 8\n','http://dev.mysql.com/doc/refman/5.1/en/arithmetic-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (443,14,'INET_NTOA','Syntax:\nINET_NTOA(expr)\n\nGiven a numeric network address in network byte order (4 or 8 byte),\nreturns the dotted-quad representation of the address as a string.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/miscellaneous-functions.html\n\n','mysql> SELECT INET_NTOA(3520061480);\n -> \'209.207.224.40\'\n','http://dev.mysql.com/doc/refman/5.1/en/miscellaneous-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (444,4,'ACOS','Syntax:\nACOS(X)\n\nReturns the arc cosine of X, that is, the value whose cosine is X.\nReturns NULL if X is not in the range -1 to 1.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/mathematical-functions.html\n\n','mysql> SELECT ACOS(1);\n -> 0\nmysql> SELECT ACOS(1.0001);\n -> NULL\nmysql> SELECT ACOS(0);\n -> 1.5707963267949\n','http://dev.mysql.com/doc/refman/5.1/en/mathematical-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (445,8,'ISOLATION','Syntax:\nSET [GLOBAL | SESSION] TRANSACTION ISOLATION LEVEL\n {\n READ UNCOMMITTED\n | READ COMMITTED\n | REPEATABLE READ\n | SERIALIZABLE\n }\n\nThis statement sets the transaction isolation level globally, for the\ncurrent session, or for the next transaction:\n\no With the GLOBAL keyword, the statement sets the default transaction\n level globally for all subsequent sessions. Existing sessions are\n unaffected.\n\no With the SESSION keyword, the statement sets the default transaction\n level for all subsequent transactions performed within the current\n session.\n\no Without any SESSION or GLOBAL keyword, the statement sets the\n isolation level for the next (not started) transaction performed\n within the current session.\n\nA change to the global default isolation level requires the SUPER\nprivilege. Any session is free to change its session isolation level\n(even in the middle of a transaction), or the isolation level for its\nnext transaction.\n\nTo set the global default isolation level at server startup, use the\n--transaction-isolation=level option to mysqld on the command line or\nin an option file. Values of level for this option use dashes rather\nthan spaces, so the allowable values are READ-UNCOMMITTED,\nREAD-COMMITTED, REPEATABLE-READ, or SERIALIZABLE. For example, to set\nthe default isolation level to REPEATABLE READ, use these lines in the\n[mysqld] section of an option file:\n\n[mysqld]\ntransaction-isolation = REPEATABLE-READ\n\nTo determine the global and session transaction isolation levels at\nruntime, check the value of the tx_isolation system variable:\n\nSELECT @@GLOBAL.tx_isolation, @@tx_isolation;\n\nInnoDB supports each of the translation isolation levels described here\nusing different locking strategies. The default level is REPEATABLE\nREAD. For additional information about InnoDB record-level locks and\nhow it uses them to execute various types of statements, see\nhttp://dev.mysql.com/doc/refman/5.1/en/innodb-record-level-locks.html,\nand http://dev.mysql.com/doc/refman/5.1/en/innodb-locks-set.html.\n\nThe following list describes how MySQL supports the different\ntransaction levels:\n\no READ UNCOMMITTED\n\n SELECT statements are performed in a nonlocking fashion, but a\n possible earlier version of a row might be used. Thus, using this\n isolation level, such reads are not consistent. This is also called a\n "dirty read." Otherwise, this isolation level works like READ\n COMMITTED.\n\no READ COMMITTED\n\n A somewhat Oracle-like isolation level with respect to consistent\n (nonlocking) reads: Each consistent read, even within the same\n transaction, sets and reads its own fresh snapshot. See\n http://dev.mysql.com/doc/refman/5.1/en/innodb-consistent-read.html.\n\n For locking reads (SELECT with FOR UPDATE or LOCK IN SHARE MODE),\n InnoDB locks only index records, not the gaps before them, and thus\n allows the free insertion of new records next to locked records. For\n UPDATE and DELETE statements, locking depends on whether the\n statement uses a unique index with a unique search condition (such as\n WHERE id = 100), or a range-type search condition (such as WHERE id >\n 100). For a unique index with a unique search condition, InnoDB locks\n only the index record found, not the gap before it. For range-type\n searches, InnoDB locks the index range scanned, using gap locks or\n next-key (gap plus index-record) locks to block insertions by other\n sessions into the gaps covered by the range. This is necessary\n because "phantom rows" must be blocked for MySQL replication and\n recovery to work.\n\n *Note*: In MySQL 5.1, if the READ COMMITTED isolation level is used\n or the innodb_locks_unsafe_for_binlog system variable is enabled,\n there is no InnoDB gap locking except for foreign-key constraint\n checking and duplicate-key checking. Also, record locks for\n nonmatching rows are released after MySQL has evaluated the WHERE\n condition. As of MySQL 5.1, if you use READ COMMITTED or enable\n innodb_locks_unsafe_for_binlog, you must use row-based binary\n logging.\n\no REPEATABLE READ\n\n This is the default isolation level for InnoDB. For consistent reads,\n there is an important difference from the READ COMMITTED isolation\n level: All consistent reads within the same transaction read the\n snapshot established by the first read. This convention means that if\n you issue several plain (nonlocking) SELECT statements within the\n same transaction, these SELECT statements are consistent also with\n respect to each other. See\n http://dev.mysql.com/doc/refman/5.1/en/innodb-consistent-read.html.\n\n For locking reads (SELECT with FOR UPDATE or LOCK IN SHARE MODE),\n UPDATE, and DELETE statements, locking depends on whether the\n statement uses a unique index with a unique search condition, or a\n range-type search condition. For a unique index with a unique search\n condition, InnoDB locks only the index record found, not the gap\n before it. For other search conditions, InnoDB locks the index range\n scanned, using gap locks or next-key (gap plus index-record) locks to\n block insertions by other sessions into the gaps covered by the\n range.\n\no SERIALIZABLE\n\n This level is like REPEATABLE READ, but InnoDB implicitly converts\n all plain SELECT statements to SELECT ... LOCK IN SHARE MODE if\n autocommit is disabled. If autocommit is enabled, the SELECT is its\n own transaction. It therefore is known to be read only and can be\n serialized if performed as a consistent (nonlocking) read and need\n not block for other transactions. (This means that to force a plain\n SELECT to block if other transactions have modified the selected\n rows, you should disable autocommit.)\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/set-transaction.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/set-transaction.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (446,4,'CEILING','Syntax:\nCEILING(X)\n\nReturns the smallest integer value not less than X.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/mathematical-functions.html\n\n','mysql> SELECT CEILING(1.23);\n -> 2\nmysql> SELECT CEILING(-1.23);\n -> -1\n','http://dev.mysql.com/doc/refman/5.1/en/mathematical-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (447,4,'SIN','Syntax:\nSIN(X)\n\nReturns the sine of X, where X is given in radians.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/mathematical-functions.html\n\n','mysql> SELECT SIN(PI());\n -> 1.2246063538224e-16\nmysql> SELECT ROUND(SIN(PI()));\n -> 0\n','http://dev.mysql.com/doc/refman/5.1/en/mathematical-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (448,30,'DAYOFWEEK','Syntax:\nDAYOFWEEK(date)\n\nReturns the weekday index for date (1 = Sunday, 2 = Monday, ..., 7 =\nSaturday). These index values correspond to the ODBC standard.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html\n\n','mysql> SELECT DAYOFWEEK(\'2007-02-03\');\n -> 7\n','http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (449,25,'SHOW PROCESSLIST','Syntax:\nSHOW [FULL] PROCESSLIST\n\nSHOW PROCESSLIST shows you which threads are running. You can also get\nthis information from the INFORMATION_SCHEMA PROCESSLIST table or the\nmysqladmin processlist command. If you have the PROCESS privilege, you\ncan see all threads. Otherwise, you can see only your own threads (that\nis, threads associated with the MySQL account that you are using). If\nyou do not use the FULL keyword, only the first 100 characters of each\nstatement are shown in the Info field.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/show-processlist.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/show-processlist.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (450,31,'LINEFROMWKB','LineFromWKB(wkb[,srid]), LineStringFromWKB(wkb[,srid])\n\nConstructs a LINESTRING value using its WKB representation and SRID.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/creating-spatial-values.html#gis-wkb-functions\n\n','','http://dev.mysql.com/doc/refman/5.1/en/creating-spatial-values.html#gis-wkb-functions'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (451,34,'GEOMETRYTYPE','GeometryType(g)\n\nReturns as a string the name of the geometry type of which the geometry\ninstance g is a member. The name corresponds to one of the instantiable\nGeometry subclasses.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/geometry-property-functions.html#general-geometry-property-functions\n\n','mysql> SELECT GeometryType(GeomFromText(\'POINT(1 1)\'));\n+------------------------------------------+\n| GeometryType(GeomFromText(\'POINT(1 1)\')) |\n+------------------------------------------+\n| POINT |\n+------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.1/en/geometry-property-functions.html#general-geometry-property-functions'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (452,37,'CREATE VIEW','Syntax:\nCREATE\n [OR REPLACE]\n [ALGORITHM = {UNDEFINED | MERGE | TEMPTABLE}]\n [DEFINER = { user | CURRENT_USER }]\n [SQL SECURITY { DEFINER | INVOKER }]\n VIEW view_name [(column_list)]\n AS select_statement\n [WITH [CASCADED | LOCAL] CHECK OPTION]\n\nThe CREATE VIEW statement creates a new view, or replaces an existing\none if the OR REPLACE clause is given. If the view does not exist,\nCREATE OR REPLACE VIEW is the same as CREATE VIEW. If the view does\nexist, CREATE OR REPLACE VIEW is the same as ALTER VIEW.\n\nThe select_statement is a SELECT statement that provides the definition\nof the view. (When you select from the view, you select in effect using\nthe SELECT statement.) select_statement can select from base tables or\nother views.\n\nThe view definition is "frozen" at creation time, so changes to the\nunderlying tables afterward do not affect the view definition. For\nexample, if a view is defined as SELECT * on a table, new columns added\nto the table later do not become part of the view.\n\nThe ALGORITHM clause affects how MySQL processes the view. The DEFINER\nand SQL SECURITY clauses specify the security context to be used when\nchecking access privileges at view invocation time. The WITH CHECK\nOPTION clause can be given to constrain inserts or updates to rows in\ntables referenced by the view. These clauses are described later in\nthis section.\n\nThe CREATE VIEW statement requires the CREATE VIEW privilege for the\nview, and some privilege for each column selected by the SELECT\nstatement. For columns used elsewhere in the SELECT statement you must\nhave the SELECT privilege. If the OR REPLACE clause is present, you\nmust also have the DROP privilege for the view.\n\nA view belongs to a database. By default, a new view is created in the\ndefault database. To create the view explicitly in a given database,\nspecify the name as db_name.view_name when you create it.\n\nmysql> CREATE VIEW test.v AS SELECT * FROM t;\n\nBase tables and views share the same namespace within a database, so a\ndatabase cannot contain a base table and a view that have the same\nname.\n\nViews must have unique column names with no duplicates, just like base\ntables. By default, the names of the columns retrieved by the SELECT\nstatement are used for the view column names. To define explicit names\nfor the view columns, the optional column_list clause can be given as a\nlist of comma-separated identifiers. The number of names in column_list\nmust be the same as the number of columns retrieved by the SELECT\nstatement.\n\n*Note*: Prior to MySQL 5.1.29, when you modify an existing view, the\ncurrent view definition is backed up and saved. It is stored in that\ntable\'s database directory, in a subdirectory named arc. The backup\nfile for a view v is named v.frm-00001. If you alter the view again,\nthe next backup is named v.frm-00002. The three latest view backup\ndefinitions are stored. Backed up view definitions are not preserved by\nmysqldump, or any other such programs, but you can retain them using a\nfile copy operation. However, they are not needed for anything but to\nprovide you with a backup of your previous view definition. It is safe\nto remove these backup definitions, but only while mysqld is not\nrunning. If you delete the arc subdirectory or its files while mysqld\nis running, you will receive an error the next time you try to alter\nthe view: mysql> ALTER VIEW v AS SELECT * FROM t; ERROR 6 (HY000):\nError on delete of \'.\\test\\arc/v.frm-0004\' (Errcode: 2)\n\nColumns retrieved by the SELECT statement can be simple references to\ntable columns. They can also be expressions that use functions,\nconstant values, operators, and so forth.\n\nUnqualified table or view names in the SELECT statement are interpreted\nwith respect to the default database. A view can refer to tables or\nviews in other databases by qualifying the table or view name with the\nproper database name.\n\nA view can be created from many kinds of SELECT statements. It can\nrefer to base tables or other views. It can use joins, UNION, and\nsubqueries. The SELECT need not even refer to any tables. The following\nexample defines a view that selects two columns from another table, as\nwell as an expression calculated from those columns:\n\nmysql> CREATE TABLE t (qty INT, price INT);\nmysql> INSERT INTO t VALUES(3, 50);\nmysql> CREATE VIEW v AS SELECT qty, price, qty*price AS value FROM t;\nmysql> SELECT * FROM v;\n+------+-------+-------+\n| qty | price | value |\n+------+-------+-------+\n| 3 | 50 | 150 |\n+------+-------+-------+\n\nA view definition is subject to the following restrictions:\n\no The SELECT statement cannot contain a subquery in the FROM clause.\n\no The SELECT statement cannot refer to system or user variables.\n\no Within a stored program, the definition cannot refer to program\n parameters or local variables.\n\no The SELECT statement cannot refer to prepared statement parameters.\n\no Any table or view referred to in the definition must exist. However,\n after a view has been created, it is possible to drop a table or view\n that the definition refers to. In this case, use of the view results\n in an error. To check a view definition for problems of this kind,\n use the CHECK TABLE statement.\n\no The definition cannot refer to a TEMPORARY table, and you cannot\n create a TEMPORARY view.\n\no Any tables named in the view definition must exist at definition\n time.\n\no You cannot associate a trigger with a view.\n\no As of MySQL 5.1.23, aliases for column names in the SELECT statement\n are checked against the maximum column length of 64 characters (not\n the maximum alias length of 256 characters).\n\nORDER BY is allowed in a view definition, but it is ignored if you\nselect from a view using a statement that has its own ORDER BY.\n\nFor other options or clauses in the definition, they are added to the\noptions or clauses of the statement that references the view, but the\neffect is undefined. For example, if a view definition includes a LIMIT\nclause, and you select from the view using a statement that has its own\nLIMIT clause, it is undefined which limit applies. This same principle\napplies to options such as ALL, DISTINCT, or SQL_SMALL_RESULT that\nfollow the SELECT keyword, and to clauses such as INTO, FOR UPDATE,\nLOCK IN SHARE MODE, and PROCEDURE.\n\nIf you create a view and then change the query processing environment\nby changing system variables, that may affect the results that you get\nfrom the view:\n\nmysql> CREATE VIEW v (mycol) AS SELECT \'abc\';\nQuery OK, 0 rows affected (0.01 sec)\n\nmysql> SET sql_mode = \'\';\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> SELECT "mycol" FROM v;\n+-------+\n| mycol |\n+-------+\n| mycol |\n+-------+\n1 row in set (0.01 sec)\n\nmysql> SET sql_mode = \'ANSI_QUOTES\';\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> SELECT "mycol" FROM v;\n+-------+\n| mycol |\n+-------+\n| abc |\n+-------+\n1 row in set (0.00 sec)\n\nThe DEFINER and SQL SECURITY clauses determine which MySQL account to\nuse when checking access privileges for the view when a statement is\nexecuted that references the view. They were addded in MySQL 5.1.2. The\nlegal SQL SECURITY characteristic values are DEFINER and INVOKER. These\nindicate that the required privileges must be held by the user who\ndefined or invoked the view, respectively. The default SQL SECURITY\nvalue is DEFINER.\n\nIf a user value is given for the DEFINER clause, it should be a MySQL\naccount in \'user_name\'@\'host_name\' format (the same format used in the\nGRANT statement). The user_name and host_name values both are required.\nThe definer can also be given as CURRENT_USER or CURRENT_USER(). The\ndefault DEFINER value is the user who executes the CREATE VIEW\nstatement. This is the same as specifying DEFINER = CURRENT_USER\nexplicitly.\n\nIf you specify the DEFINER clause, these rules determine the legal\nDEFINER user values:\n\no If you do not have the SUPER privilege, the only legal user value is\n your own account, either specified literally or by using\n CURRENT_USER. You cannot set the definer to some other account.\n\no If you have the SUPER privilege, you can specify any syntactically\n legal account name. If the account does not actually exist, a warning\n is generated.\n\no If the SQL SECURITY value is DEFINER but the definer account does not\n exist when the view is referenced, an error occurs.\n\nWithin a view definition, CURRENT_USER returns the view\'s DEFINER value\nby default as of MySQL 5.1.12. For older versions, and for views\ndefined with the SQL SECURITY INVOKER characteristic, CURRENT_USER\nreturns the account for the view\'s invoker. For information about user\nauditing within views, see\nhttp://dev.mysql.com/doc/refman/5.1/en/account-activity-auditing.html.\n\nWithin a stored routine that is defined with the SQL SECURITY DEFINER\ncharacteristic, CURRENT_USER returns the routine\'s DEFINER value. This\nalso affects a view defined within such a program, if the view\ndefinition contains a DEFINER value of CURRENT_USER.\n\nAs of MySQL 5.1.2 (when the DEFINER and SQL SECURITY clauses were\nimplemented), view privileges are checked like this:\n\no At view definition time, the view creator must have the privileges\n needed to use the top-level objects accessed by the view. For\n example, if the view definition refers to table columns, the creator\n must have privileges for the columns, as described previously. If the\n definition refers to a stored function, only the privileges needed to\n invoke the function can be checked. The privileges required when the\n function runs can be checked only as it executes: For different\n invocations of the function, different execution paths within the\n function might be taken.\n\no When a view is referenced, privileges for objects accessed by the\n view are checked against the privileges held by the view creator or\n invoker, depending on whether the SQL SECURITY characteristic is\n DEFINER or INVOKER, respectively.\n\no If reference to a view causes execution of a stored function,\n privilege checking for statements executed within the function depend\n on whether the function is defined with a SQL SECURITY characteristic\n of DEFINER or INVOKER. If the security characteristic is DEFINER, the\n function runs with the privileges of its creator. If the\n characteristic is INVOKER, the function runs with the privileges\n determined by the view\'s SQL SECURITY characteristic.\n\nPrior to MySQL 5.1.2 (before the DEFINER and SQL SECURITY clauses were\nimplemented), privileges required for objects used in a view are\nchecked at view creation time.\n\nExample: A view might depend on a stored function, and that function\nmight invoke other stored routines. For example, the following view\ninvokes a stored function f():\n\nCREATE VIEW v AS SELECT * FROM t WHERE t.id = f(t.name);\n\nSuppose that f() contains a statement such as this:\n\nIF name IS NULL then\n CALL p1();\nELSE\n CALL p2();\nEND IF;\n\nThe privileges required for executing statements within f() need to be\nchecked when f() executes. This might mean that privileges are needed\nfor p1() or p2(), depending on the execution path within f(). Those\nprivileges must be checked at runtime, and the user who must possess\nthe privileges is determined by the SQL SECURITY values of the view v\nand the function f().\n\nThe DEFINER and SQL SECURITY clauses for views are extensions to\nstandard SQL. In standard SQL, views are handled using the rules for\nSQL SECURITY INVOKER.\n\nIf you invoke a view that was created before MySQL 5.1.2, it is treated\nas though it was created with a SQL SECURITY DEFINER clause and with a\nDEFINER value that is the same as your account. However, because the\nactual definer is unknown, MySQL issues a warning. To make the warning\ngo away, it is sufficient to re-create the view so that the view\ndefinition includes a DEFINER clause.\n\nThe optional ALGORITHM clause is a MySQL extension to standard SQL. It\naffects how MySQL processes the view. ALGORITHM takes three values:\nMERGE, TEMPTABLE, or UNDEFINED. The default algorithm is UNDEFINED if\nno ALGORITHM clause is present. For more information, see\nhttp://dev.mysql.com/doc/refman/5.1/en/view-algorithms.html.\n\nSome views are updatable. That is, you can use them in statements such\nas UPDATE, DELETE, or INSERT to update the contents of the underlying\ntable. For a view to be updatable, there must be a one-to-one\nrelationship between the rows in the view and the rows in the\nunderlying table. There are also certain other constructs that make a\nview nonupdatable.\n\nThe WITH CHECK OPTION clause can be given for an updatable view to\nprevent inserts or updates to rows except those for which the WHERE\nclause in the select_statement is true.\n\nIn a WITH CHECK OPTION clause for an updatable view, the LOCAL and\nCASCADED keywords determine the scope of check testing when the view is\ndefined in terms of another view. The LOCAL keyword restricts the CHECK\nOPTION only to the view being defined. CASCADED causes the checks for\nunderlying views to be evaluated as well. When neither keyword is\ngiven, the default is CASCADED.\n\nFor more information about updatable views and the WITH CHECK OPTION\nclause, see\nhttp://dev.mysql.com/doc/refman/5.1/en/view-updatability.html.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/create-view.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/create-view.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (453,35,'TRIM','Syntax:\nTRIM([{BOTH | LEADING | TRAILING} [remstr] FROM] str), TRIM([remstr\nFROM] str)\n\nReturns the string str with all remstr prefixes or suffixes removed. If\nnone of the specifiers BOTH, LEADING, or TRAILING is given, BOTH is\nassumed. remstr is optional and, if not specified, spaces are removed.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/string-functions.html\n\n','mysql> SELECT TRIM(\' bar \');\n -> \'bar\'\nmysql> SELECT TRIM(LEADING \'x\' FROM \'xxxbarxxx\');\n -> \'barxxx\'\nmysql> SELECT TRIM(BOTH \'x\' FROM \'xxxbarxxx\');\n -> \'bar\'\nmysql> SELECT TRIM(TRAILING \'xyz\' FROM \'barxxyz\');\n -> \'barx\'\n','http://dev.mysql.com/doc/refman/5.1/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (454,17,'IS','Syntax:\nIS boolean_value\n\nTests a value against a boolean value, where boolean_value can be TRUE,\nFALSE, or UNKNOWN.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/comparison-operators.html\n\n','mysql> SELECT 1 IS TRUE, 0 IS FALSE, NULL IS UNKNOWN;\n -> 1, 1, 1\n','http://dev.mysql.com/doc/refman/5.1/en/comparison-operators.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (455,30,'GET_FORMAT','Syntax:\nGET_FORMAT({DATE|TIME|DATETIME}, {\'EUR\'|\'USA\'|\'JIS\'|\'ISO\'|\'INTERNAL\'})\n\nReturns a format string. This function is useful in combination with\nthe DATE_FORMAT() and the STR_TO_DATE() functions.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html\n\n','mysql> SELECT DATE_FORMAT(\'2003-10-03\',GET_FORMAT(DATE,\'EUR\'));\n -> \'03.10.2003\'\nmysql> SELECT STR_TO_DATE(\'10.31.2003\',GET_FORMAT(DATE,\'USA\'));\n -> \'2003-10-31\'\n','http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (456,20,'TINYBLOB','TINYBLOB\n\nA BLOB column with a maximum length of 255 (28 - 1) bytes. Each\nTINYBLOB value is stored using a one-byte length prefix that indicates\nthe number of bytes in the value.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/string-type-overview.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (457,8,'SAVEPOINT','Syntax:\nSAVEPOINT identifier\nROLLBACK [WORK] TO [SAVEPOINT] identifier\nRELEASE SAVEPOINT identifier\n\nInnoDB supports the SQL statements SAVEPOINT, ROLLBACK TO SAVEPOINT,\nRELEASE SAVEPOINT and the optional WORK keyword for ROLLBACK.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/savepoint.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/savepoint.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (458,15,'USER','Syntax:\nUSER()\n\nReturns the current MySQL user name and host name as a string in the\nutf8 character set.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/information-functions.html\n\n','mysql> SELECT USER();\n -> \'davida@localhost\'\n','http://dev.mysql.com/doc/refman/5.1/en/information-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (459,37,'ALTER TABLE','Syntax:\nALTER [ONLINE | OFFLINE] [IGNORE] TABLE tbl_name\n {table_options | partitioning_specification}\n\ntable_options:\n table_option [, table_option] ...\n\ntable_option:\n ADD [COLUMN] col_name column_definition\n [FIRST | AFTER col_name ]\n | ADD [COLUMN] (col_name column_definition,...)\n | ADD {INDEX|KEY} [index_name]\n [index_type] (index_col_name,...) [index_option] ...\n | ADD [CONSTRAINT [symbol]] PRIMARY KEY\n [index_type] (index_col_name,...) [index_option] ...\n | ADD [CONSTRAINT [symbol]]\n UNIQUE [INDEX|KEY] [index_name]\n [index_type] (index_col_name,...) [index_option] ...\n | ADD FULLTEXT [INDEX|KEY] [index_name]\n (index_col_name,...) [index_option] ...\n | ADD SPATIAL [INDEX|KEY] [index_name]\n (index_col_name,...) [index_option] ...\n | ADD [CONSTRAINT [symbol]]\n FOREIGN KEY [index_name] (index_col_name,...)\n reference_definition\n | ALTER [COLUMN] col_name {SET DEFAULT literal | DROP DEFAULT}\n | CHANGE [COLUMN] old_col_name new_col_name column_definition\n [FIRST|AFTER col_name]\n | MODIFY [COLUMN] col_name column_definition\n [FIRST | AFTER col_name]\n | DROP [COLUMN] col_name\n | DROP PRIMARY KEY\n | DROP {INDEX|KEY} index_name\n | DROP FOREIGN KEY fk_symbol\n | DISABLE KEYS\n | ENABLE KEYS\n | RENAME [TO] new_tbl_name\n | ORDER BY col_name [, col_name] ...\n | CONVERT TO CHARACTER SET charset_name [COLLATE collation_name]\n | [DEFAULT] CHARACTER SET [=] charset_name [COLLATE [=] collation_name]\n | DISCARD TABLESPACE\n | IMPORT TABLESPACE\n\npartitioning_specification:\n ADD PARTITION (partition_definition)\n | DROP PARTITION partition_names\n | COALESCE PARTITION number\n | REORGANIZE PARTITION [partition_names INTO (partition_definitions)]\n | ANALYZE PARTITION {partition_names | ALL }\n | CHECK PARTITION {partition_names | ALL }\n | OPTIMIZE PARTITION {partition_names | ALL }\n | REBUILD PARTITION {partition_names | ALL }\n | REPAIR PARTITION {partition_names | ALL }\n | PARTITION BY partitioning_expression\n | REMOVE PARTITIONING\n\nindex_col_name:\n col_name [(length)] [ASC | DESC]\n\nindex_type:\n USING {BTREE | HASH | RTREE}\n\nindex_option:\n KEY_BLOCK_SIZE [=] value\n | index_type\n | WITH PARSER parser_name\n\ntable_options:\n table_option [[,] table_option] ... (see CREATE TABLE options)\n\nALTER TABLE enables you to change the structure of an existing table.\nFor example, you can add or delete columns, create or destroy indexes,\nchange the type of existing columns, or rename columns or the table\nitself. You can also change the comment for the table and type of the\ntable.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/alter-table.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/alter-table.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (460,31,'MPOINTFROMWKB','MPointFromWKB(wkb[,srid]), MultiPointFromWKB(wkb[,srid])\n\nConstructs a MULTIPOINT value using its WKB representation and SRID.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/creating-spatial-values.html#gis-wkb-functions\n\n','','http://dev.mysql.com/doc/refman/5.1/en/creating-spatial-values.html#gis-wkb-functions'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (461,20,'CHAR BYTE','The CHAR BYTE data type is an alias for the BINARY data type. This is a\ncompatibility feature.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/string-type-overview.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (462,19,'REPAIR TABLE','Syntax:\nREPAIR [NO_WRITE_TO_BINLOG | LOCAL] TABLE\n tbl_name [, tbl_name] ...\n [QUICK] [EXTENDED] [USE_FRM]\n\nREPAIR TABLE repairs a possibly corrupted table. By default, it has the\nsame effect as myisamchk --recover tbl_name. REPAIR TABLE works for\nMyISAM and for ARCHIVE tables. Starting with MySQL 5.1.9, REPAIR is\nalso valid for CSV tables. See\nhttp://dev.mysql.com/doc/refman/5.1/en/myisam-storage-engine.html, and\nhttp://dev.mysql.com/doc/refman/5.1/en/archive-storage-engine.html, and\nhttp://dev.mysql.com/doc/refman/5.1/en/csv-storage-engine.html\n\nThis statement requires SELECT and INSERT privileges for the table.\n\nBeginning with MySQL 5.1.27, REPAIR TABLE is also supported for\npartitioned tables. However, the USE_FRM option cannot be used with\nthis statement on a partitioned table.\n\nAlso beginning with MySQL 5.1.27, you can use ALTER TABLE ... REPAIR\nPARTITION to repair one or more partitions; for more information, see\n[HELP ALTER TABLE], and\nhttp://dev.mysql.com/doc/refman/5.1/en/partitioning-maintenance.html.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/repair-table.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/repair-table.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (463,37,'MERGE','The MERGE storage engine, also known as the MRG_MyISAM engine, is a\ncollection of identical MyISAM tables that can be used as one.\n"Identical" means that all tables have identical column and index\ninformation. You cannot merge MyISAM tables in which the columns are\nlisted in a different order, do not have exactly the same columns, or\nhave the indexes in different order. However, any or all of the MyISAM\ntables can be compressed with myisampack. See\nhttp://dev.mysql.com/doc/refman/5.1/en/myisampack.html. Differences in\ntable options such as AVG_ROW_LENGTH, MAX_ROWS, or PACK_KEYS do not\nmatter.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/merge-storage-engine.html\n\n','mysql> CREATE TABLE t1 (\n -> a INT NOT NULL AUTO_INCREMENT PRIMARY KEY,\n -> message CHAR(20)) ENGINE=MyISAM;\nmysql> CREATE TABLE t2 (\n -> a INT NOT NULL AUTO_INCREMENT PRIMARY KEY,\n -> message CHAR(20)) ENGINE=MyISAM;\nmysql> INSERT INTO t1 (message) VALUES (\'Testing\'),(\'table\'),(\'t1\');\nmysql> INSERT INTO t2 (message) VALUES (\'Testing\'),(\'table\'),(\'t2\');\nmysql> CREATE TABLE total (\n -> a INT NOT NULL AUTO_INCREMENT,\n -> message CHAR(20), INDEX(a))\n -> ENGINE=MERGE UNION=(t1,t2) INSERT_METHOD=LAST;\n','http://dev.mysql.com/doc/refman/5.1/en/merge-storage-engine.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (464,37,'CREATE TABLE','Syntax:\nCREATE [TEMPORARY] TABLE [IF NOT EXISTS] tbl_name\n (create_definition,...)\n [table_options]\n [partition_options]\n\nOr:\n\nCREATE [TEMPORARY] TABLE [IF NOT EXISTS] tbl_name\n [(create_definition,...)]\n [table_options]\n [partition_options]\n select_statement\n\nOr:\n\nCREATE [TEMPORARY] TABLE [IF NOT EXISTS] tbl_name\n { LIKE old_tbl_name | (LIKE old_tbl_name) }\n\ncreate_definition:\n col_name column_definition\n | [CONSTRAINT [symbol]] PRIMARY KEY [index_type] (index_col_name,...)\n [index_option] ...\n | {INDEX|KEY} [index_name] [index_type] (index_col_name,...)\n [index_option] ...\n | [CONSTRAINT [symbol]] UNIQUE [INDEX|KEY]\n [index_name] [index_type] (index_col_name,...)\n [index_option] ...\n | {FULLTEXT|SPATIAL} [INDEX|KEY] [index_name] (index_col_name,...)\n [index_option] ...\n | [CONSTRAINT [symbol]] FOREIGN KEY\n [index_name] (index_col_name,...) reference_definition\n | CHECK (expr)\n\ncolumn_definition:\n data_type [NOT NULL | NULL] [DEFAULT default_value]\n [AUTO_INCREMENT] [UNIQUE [KEY] | [PRIMARY] KEY]\n [COMMENT \'string\']\n [COLUMN_FORMAT {FIXED|DYNAMIC|DEFAULT}]\n [STORAGE {DISK|MEMORY|DEFAULT}]\n [reference_definition]\n\ndata_type:\n BIT[(length)]\n | TINYINT[(length)] [UNSIGNED] [ZEROFILL]\n | SMALLINT[(length)] [UNSIGNED] [ZEROFILL]\n | MEDIUMINT[(length)] [UNSIGNED] [ZEROFILL]\n | INT[(length)] [UNSIGNED] [ZEROFILL]\n | INTEGER[(length)] [UNSIGNED] [ZEROFILL]\n | BIGINT[(length)] [UNSIGNED] [ZEROFILL]\n | REAL[(length,decimals)] [UNSIGNED] [ZEROFILL]\n | DOUBLE[(length,decimals)] [UNSIGNED] [ZEROFILL]\n | FLOAT[(length,decimals)] [UNSIGNED] [ZEROFILL]\n | DECIMAL[(length[,decimals])] [UNSIGNED] [ZEROFILL]\n | NUMERIC[(length[,decimals])] [UNSIGNED] [ZEROFILL]\n | DATE\n | TIME\n | TIMESTAMP\n | DATETIME\n | YEAR\n | CHAR[(length)]\n [CHARACTER SET charset_name] [COLLATE collation_name]\n | VARCHAR(length)\n [CHARACTER SET charset_name] [COLLATE collation_name]\n | BINARY[(length)]\n | VARBINARY(length)\n | TINYBLOB\n | BLOB\n | MEDIUMBLOB\n | LONGBLOB\n | TINYTEXT [BINARY]\n [CHARACTER SET charset_name] [COLLATE collation_name]\n | TEXT [BINARY]\n [CHARACTER SET charset_name] [COLLATE collation_name]\n | MEDIUMTEXT [BINARY]\n [CHARACTER SET charset_name] [COLLATE collation_name]\n | LONGTEXT [BINARY]\n [CHARACTER SET charset_name] [COLLATE collation_name]\n | ENUM(value1,value2,value3,...)\n [CHARACTER SET charset_name] [COLLATE collation_name]\n | SET(value1,value2,value3,...)\n [CHARACTER SET charset_name] [COLLATE collation_name]\n | spatial_type\n\nindex_col_name:\n col_name [(length)] [ASC | DESC]\n\nindex_type:\n USING {BTREE | HASH | RTREE}\n\nindex_option:\n KEY_BLOCK_SIZE [=] value\n | index_type\n | WITH PARSER parser_name\n\nreference_definition:\n REFERENCES tbl_name (index_col_name,...)\n [MATCH FULL | MATCH PARTIAL | MATCH SIMPLE]\n [ON DELETE reference_option]\n [ON UPDATE reference_option]\n\nreference_option:\n RESTRICT | CASCADE | SET NULL | NO ACTION\n\ntable_options:\n table_option [[,] table_option] ...\n\ntable_option:\n ENGINE [=] engine_name\n | AUTO_INCREMENT [=] value\n | AVG_ROW_LENGTH [=] value\n | [DEFAULT] CHARACTER SET [=] charset_name\n | CHECKSUM [=] {0 | 1}\n | [DEFAULT] COLLATE [=] collation_name\n | COMMENT [=] \'string\'\n | CONNECTION [=] \'connect_string\'\n | DATA DIRECTORY [=] \'absolute path to directory\'\n | DELAY_KEY_WRITE [=] {0 | 1}\n | INDEX DIRECTORY [=] \'absolute path to directory\'\n | INSERT_METHOD [=] { NO | FIRST | LAST }\n | KEY_BLOCK_SIZE [=] value\n | MAX_ROWS [=] value\n | MIN_ROWS [=] value\n | PACK_KEYS [=] {0 | 1 | DEFAULT}\n | PASSWORD [=] \'string\'\n | ROW_FORMAT [=] {DEFAULT|DYNAMIC|FIXED|COMPRESSED|REDUNDANT|COMPACT}\n | TABLESPACE tablespace_name [STORAGE {DISK|MEMORY|DEFAULT}]\n | UNION [=] (tbl_name[,tbl_name]...)\n\npartition_options:\n PARTITION BY\n { [LINEAR] HASH(expr)\n | [LINEAR] KEY(column_list)\n | RANGE(expr)\n | LIST(expr) }\n [PARTITIONS num]\n [SUBPARTITION BY\n { [LINEAR] HASH(expr)\n | [LINEAR] KEY(column_list) }\n [SUBPARTITIONS num]\n ]\n [(partition_definition [, partition_definition] ...)]\n\npartition_definition:\n PARTITION partition_name\n [VALUES {LESS THAN {(expr) | MAXVALUE} | IN (value_list)}]\n [[STORAGE] ENGINE [=] engine_name]\n [COMMENT [=] \'comment_text\' ]\n [DATA DIRECTORY [=] \'data_dir\']\n [INDEX DIRECTORY [=] \'index_dir\']\n [MAX_ROWS [=] max_number_of_rows]\n [MIN_ROWS [=] min_number_of_rows]\n [TABLESPACE [=] tablespace_name]\n [NODEGROUP [=] node_group_id]\n [(subpartition_definition [, subpartition_definition] ...)]\n\nsubpartition_definition:\n SUBPARTITION logical_name\n [[STORAGE] ENGINE [=] engine_name]\n [COMMENT [=] \'comment_text\' ]\n [DATA DIRECTORY [=] \'data_dir\']\n [INDEX DIRECTORY [=] \'index_dir\']\n [MAX_ROWS [=] max_number_of_rows]\n [MIN_ROWS [=] min_number_of_rows]\n [TABLESPACE [=] tablespace_name]\n [NODEGROUP [=] node_group_id]\n\nselect_statement:\n [IGNORE | REPLACE] [AS] SELECT ... (Some legal select statement)\n\nCREATE TABLE creates a table with the given name. You must have the\nCREATE privilege for the table.\n\nRules for allowable table names are given in\nhttp://dev.mysql.com/doc/refman/5.1/en/identifiers.html. By default,\nthe table is created in the default database. An error occurs if the\ntable exists, if there is no default database, or if the database does\nnot exist.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/create-table.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/create-table.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (465,17,'>','Syntax:\n>\n\nGreater than:\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/comparison-operators.html\n\n','mysql> SELECT 2 > 2;\n -> 0\n','http://dev.mysql.com/doc/refman/5.1/en/comparison-operators.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (466,19,'ANALYZE TABLE','Syntax:\nANALYZE [NO_WRITE_TO_BINLOG | LOCAL] TABLE\n tbl_name [, tbl_name] ...\n\nANALYZE TABLE analyzes and stores the key distribution for a table.\nDuring the analysis, the table is locked with a read lock for MyISAM.\nFor InnoDB the table is locked with a write lock. This statement works\nwith MyISAM and InnoDB tables. For MyISAM tables, this statement is\nequivalent to using myisamchk --analyze.\n\nFor more information on how the analysis works within InnoDB, see\nhttp://dev.mysql.com/doc/refman/5.1/en/innodb-restrictions.html.\n\nMySQL uses the stored key distribution to decide the order in which\ntables should be joined when you perform a join on something other than\na constant. In addition, key distributions can be used when deciding\nwhich indexes to use for a specific table within a query.\n\nThis statement requires SELECT and INSERT privileges for the table.\n\nBeginning with MySQL 5.1.27, ANALYZE TABLE is also supported for\npartitioned tables. Also beginning with MySQL 5.1.27, you can use ALTER\nTABLE ... ANALYZE PARTITION to analyze one or more partitions; for more\ninformation, see [HELP ALTER TABLE], and\nhttp://dev.mysql.com/doc/refman/5.1/en/partitioning-maintenance.html.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/analyze-table.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/analyze-table.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (467,30,'MICROSECOND','Syntax:\nMICROSECOND(expr)\n\nReturns the microseconds from the time or datetime expression expr as a\nnumber in the range from 0 to 999999.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html\n\n','mysql> SELECT MICROSECOND(\'12:00:00.123456\');\n -> 123456\nmysql> SELECT MICROSECOND(\'2009-12-31 23:59:59.000010\');\n -> 10\n','http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (468,37,'CONSTRAINT','InnoDB supports foreign key constraints. The syntax for a foreign key\nconstraint definition in InnoDB looks like this:\n\n[CONSTRAINT [symbol]] FOREIGN KEY\n [index_name] (index_col_name, ...)\n REFERENCES tbl_name (index_col_name,...)\n [ON DELETE reference_option]\n [ON UPDATE reference_option]\n\nreference_option:\n RESTRICT | CASCADE | SET NULL | NO ACTION\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/innodb-foreign-key-constraints.html\n\n','CREATE TABLE product (category INT NOT NULL, id INT NOT NULL,\n price DECIMAL,\n PRIMARY KEY(category, id)) ENGINE=INNODB;\nCREATE TABLE customer (id INT NOT NULL,\n PRIMARY KEY (id)) ENGINE=INNODB;\nCREATE TABLE product_order (no INT NOT NULL AUTO_INCREMENT,\n product_category INT NOT NULL,\n product_id INT NOT NULL,\n customer_id INT NOT NULL,\n PRIMARY KEY(no),\n INDEX (product_category, product_id),\n FOREIGN KEY (product_category, product_id)\n REFERENCES product(category, id)\n ON UPDATE CASCADE ON DELETE RESTRICT,\n INDEX (customer_id),\n FOREIGN KEY (customer_id)\n REFERENCES customer(id)) ENGINE=INNODB;\n','http://dev.mysql.com/doc/refman/5.1/en/innodb-foreign-key-constraints.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (469,37,'CREATE SERVER','Syntax:\nCREATE SERVER server_name\n FOREIGN DATA WRAPPER wrapper_name\n OPTIONS (option [, option] ...)\n\noption:\n { HOST character-literal\n | DATABASE character-literal\n | USER character-literal\n | PASSWORD character-literal\n | SOCKET character-literal\n | OWNER character-literal\n | PORT numeric-literal }\n\nThis statement creates the definition of a server for use with the\nFEDERATED storage engine. The CREATE SERVER statement creates a new row\nwithin the servers table within the mysql database. This statement\nrequires the SUPER privilege.\n\nThe server_name should be a unique reference to the server. Server\ndefinitions are global within the scope of the server, it is not\npossible to qualify the server definition to a specific database.\nserver_name has a maximum length of 64 characters (names longer than 64\ncharacters are silently truncated), and is case insensitive. You may\nspecify the name as a quoted string.\n\nThe wrapper_name should be mysql, and may be quoted with single quotes.\nOther values for wrapper_name are not currently supported.\n\nFor each option you must specify either a character literal or numeric\nliteral. Character literals are UTF-8, support a maximum length of 64\ncharacters and default to a blank (empty) string. String literals are\nsilently truncated to 64 characters. Numeric literals must be a number\nbetween 0 and 9999, default value is 0.\n\n*Note*: Note that the OWNER option is currently not applied, and has no\neffect on the ownership or operation of the server connection that is\ncreated.\n\nThe CREATE SERVER statement creates an entry in the mysql.servers table\nthat can later be used with the CREATE TABLE statement when creating a\nFEDERATED table. The options that you specify will be used to populate\nthe columns in the mysql.servers table. The table columns are\nServer_name, Host, Db, Username, Password, Port and Socket.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/create-server.html\n\n','CREATE SERVER s\nFOREIGN DATA WRAPPER mysql\nOPTIONS (USER \'Remote\', HOST \'192.168.1.106\', DATABASE \'test\');\n','http://dev.mysql.com/doc/refman/5.1/en/create-server.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (470,35,'FIELD','Syntax:\nFIELD(str,str1,str2,str3,...)\n\nReturns the index (position) of str in the str1, str2, str3, ... list.\nReturns 0 if str is not found.\n\nIf all arguments to FIELD() are strings, all arguments are compared as\nstrings. If all arguments are numbers, they are compared as numbers.\nOtherwise, the arguments are compared as double.\n\nIf str is NULL, the return value is 0 because NULL fails equality\ncomparison with any value. FIELD() is the complement of ELT().\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/string-functions.html\n\n','mysql> SELECT FIELD(\'ej\', \'Hej\', \'ej\', \'Heja\', \'hej\', \'foo\');\n -> 2\nmysql> SELECT FIELD(\'fo\', \'Hej\', \'ej\', \'Heja\', \'hej\', \'foo\');\n -> 0\n','http://dev.mysql.com/doc/refman/5.1/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (471,30,'MAKETIME','Syntax:\nMAKETIME(hour,minute,second)\n\nReturns a time value calculated from the hour, minute, and second\narguments.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html\n\n','mysql> SELECT MAKETIME(12,15,30);\n -> \'12:15:30\'\n','http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (472,30,'CURDATE','Syntax:\nCURDATE()\n\nReturns the current date as a value in \'YYYY-MM-DD\' or YYYYMMDD format,\ndepending on whether the function is used in a string or numeric\ncontext.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html\n\n','mysql> SELECT CURDATE();\n -> \'2008-06-13\'\nmysql> SELECT CURDATE() + 0;\n -> 20080613\n','http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (473,9,'SET PASSWORD','Syntax:\nSET PASSWORD [FOR user] =\n {\n PASSWORD(\'some password\')\n | OLD_PASSWORD(\'some password\')\n | \'encrypted password\'\n }\n\nThe SET PASSWORD statement assigns a password to an existing MySQL user\naccount.\n\nIf the password is specified using the PASSWORD() or OLD_PASSWORD()\nfunction, the literal text of the password should be given. If the\npassword is specified without using either function, the password\nshould be the already-encrypted password value as returned by\nPASSWORD().\n\nWith no FOR clause, this statement sets the password for the current\nuser. Any client that has connected to the server using a nonanonymous\naccount can change the password for that account.\n\nWith a FOR clause, this statement sets the password for a specific\naccount on the current server host. Only clients that have the UPDATE\nprivilege for the mysql database can do this. The user value should be\ngiven in user_name@host_name format, where user_name and host_name are\nexactly as they are listed in the User and Host columns of the\nmysql.user table entry. For example, if you had an entry with User and\nHost column values of \'bob\' and \'%.loc.gov\', you would write the\nstatement like this:\n\nSET PASSWORD FOR \'bob\'@\'%.loc.gov\' = PASSWORD(\'newpass\');\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/set-password.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/set-password.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (474,37,'ALTER TABLESPACE','Syntax:\nALTER TABLESPACE tablespace_name\n {ADD|DROP} DATAFILE \'file_name\'\n [INITIAL_SIZE [=] size]\n [WAIT]\n ENGINE [=] engine_name\n\nThis statement can be used either to add a new data file, or to drop a\ndata file from a tablespace.\n\nThe ADD DATAFILE variant allows you to specify an initial size using an\nINITIAL_SIZE clause, where size is measured in bytes; the default value\nis 128M (128 megabytes). You may optionally follow this integer value\nwith a one-letter abbreviation for an order of magnitude, similar to\nthose used in my.cnf. Generally, this is one of the letters M (for\nmegabytes) or G (for gigabytes).\n\n*Note*: All MySQL Cluster Disk Data objects share the same namespace.\nThis means that each Disk Data object must be uniquely named (and not\nmerely each Disk Data object of a given type). For example, you cannot\nhave a tablespace and an data file with the same name, or an undo log\nfile and a with the same name.\n\nPrior to MySQL Cluster NDB 6.2.17, 6.3.23, and 6.4.3, path and file\nnames for data files could not be longer than 128 characters.\n(Bug#31770 (http://bugs.mysql.com/bug.php?id=31770))\n\nOn 32-bit systems, the maximum supported value for INITIAL_SIZE is 4G.\n(Bug#29186 (http://bugs.mysql.com/bug.php?id=29186))\n\nINITIAL_SIZE is rounded as for CREATE TABLESPACE. Beginning with MySQL\nCluster NDB 6.2.19, MySQL Cluster NDB 6.3.32, MySQL Cluster NDB 7.0.13,\nand MySQL Cluster NDB 7.1.2, this rounding is done explicitly (also as\nwith CREATE TABLESPACE).\n\nOnce a data file has been created, its size cannot be changed; however,\nyou can add more data files to the tablespace using additional ALTER\nTABLESPACE ... ADD DATAFILE statements.\n\nUsing DROP DATAFILE with ALTER TABLESPACE drops the data file\n\'file_name\' from the tablespace. This file must already have been added\nto the tablespace using CREATE TABLESPACE or ALTER TABLESPACE;\notherwise an error will result.\n\nBoth ALTER TABLESPACE ... ADD DATAFILE and ALTER TABLESPACE ... DROP\nDATAFILE require an ENGINE clause which specifies the storage engine\nused by the tablespace. In MySQL 5.1, the only accepted values for\nengine_name are NDB and NDBCLUSTER.\n\nWAIT is parsed but otherwise ignored, and so has no effect in MySQL\n5.1. It is intended for future expansion.\n\nWhen ALTER TABLESPACE ... ADD DATAFILE is used with ENGINE = NDB, a\ndata file is created on each Cluster data node. You can verify that the\ndata files were created and obtain information about them by querying\nthe INFORMATION_SCHEMA.FILES table. For example, the following query\nshows all data files belonging to the tablespace named newts:\n\nmysql> SELECT LOGFILE_GROUP_NAME, FILE_NAME, EXTRA\n -> FROM INFORMATION_SCHEMA.FILES\n -> WHERE TABLESPACE_NAME = \'newts\' AND FILE_TYPE = \'DATAFILE\';\n+--------------------+--------------+----------------+\n| LOGFILE_GROUP_NAME | FILE_NAME | EXTRA |\n+--------------------+--------------+----------------+\n| lg_3 | newdata.dat | CLUSTER_NODE=3 |\n| lg_3 | newdata.dat | CLUSTER_NODE=4 |\n| lg_3 | newdata2.dat | CLUSTER_NODE=3 |\n| lg_3 | newdata2.dat | CLUSTER_NODE=4 |\n+--------------------+--------------+----------------+\n2 rows in set (0.03 sec)\n\nSee http://dev.mysql.com/doc/refman/5.1/en/files-table.html.\n\nALTER TABLESPACE was added in MySQL 5.1.6. In MySQL 5.1, it is useful\nonly with Disk Data storage for MySQL Cluster. See\nhttp://dev.mysql.com/doc/refman/5.1/en/mysql-cluster-disk-data.html.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/alter-tablespace.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/alter-tablespace.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (475,20,'ENUM','ENUM(\'value1\',\'value2\',...) [CHARACTER SET charset_name] [COLLATE\ncollation_name]\n\nAn enumeration. A string object that can have only one value, chosen\nfrom the list of values \'value1\', \'value2\', ..., NULL or the special \'\'\nerror value. An ENUM column can have a maximum of 65,535 distinct\nvalues. ENUM values are represented internally as integers.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/string-type-overview.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (476,7,'IF FUNCTION','Syntax:\nIF(expr1,expr2,expr3)\n\nIf expr1 is TRUE (expr1 <> 0 and expr1 <> NULL) then IF() returns\nexpr2; otherwise it returns expr3. IF() returns a numeric or string\nvalue, depending on the context in which it is used.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/control-flow-functions.html\n\n','mysql> SELECT IF(1>2,2,3);\n -> 3\nmysql> SELECT IF(1<2,\'yes\',\'no\');\n -> \'yes\'\nmysql> SELECT IF(STRCMP(\'test\',\'test1\'),\'no\',\'yes\');\n -> \'no\'\n','http://dev.mysql.com/doc/refman/5.1/en/control-flow-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (477,15,'DATABASE','Syntax:\nDATABASE()\n\nReturns the default (current) database name as a string in the utf8\ncharacter set. If there is no default database, DATABASE() returns\nNULL. Within a stored routine, the default database is the database\nthat the routine is associated with, which is not necessarily the same\nas the database that is the default in the calling context.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/information-functions.html\n\n','mysql> SELECT DATABASE();\n -> \'test\'\n','http://dev.mysql.com/doc/refman/5.1/en/information-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (478,31,'POINTFROMWKB','PointFromWKB(wkb[,srid])\n\nConstructs a POINT value using its WKB representation and SRID.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/creating-spatial-values.html#gis-wkb-functions\n\n','','http://dev.mysql.com/doc/refman/5.1/en/creating-spatial-values.html#gis-wkb-functions'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (479,4,'POWER','Syntax:\nPOWER(X,Y)\n\nThis is a synonym for POW().\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/mathematical-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/mathematical-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (480,4,'ATAN','Syntax:\nATAN(X)\n\nReturns the arc tangent of X, that is, the value whose tangent is X.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/mathematical-functions.html\n\n','mysql> SELECT ATAN(2);\n -> 1.1071487177941\nmysql> SELECT ATAN(-2);\n -> -1.1071487177941\n','http://dev.mysql.com/doc/refman/5.1/en/mathematical-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (481,35,'STRCMP','Syntax:\nSTRCMP(expr1,expr2)\n\nSTRCMP() returns 0 if the strings are the same, -1 if the first\nargument is smaller than the second according to the current sort\norder, and 1 otherwise.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/string-comparison-functions.html\n\n','mysql> SELECT STRCMP(\'text\', \'text2\');\n -> -1\nmysql> SELECT STRCMP(\'text2\', \'text\');\n -> 1\nmysql> SELECT STRCMP(\'text\', \'text\');\n -> 0\n','http://dev.mysql.com/doc/refman/5.1/en/string-comparison-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (482,26,'INSERT DELAYED','Syntax:\nINSERT DELAYED ...\n\nThe DELAYED option for the INSERT statement is a MySQL extension to\nstandard SQL that is very useful if you have clients that cannot or\nneed not wait for the INSERT to complete. This is a common situation\nwhen you use MySQL for logging and you also periodically run SELECT and\nUPDATE statements that take a long time to complete.\n\nWhen a client uses INSERT DELAYED, it gets an okay from the server at\nonce, and the row is queued to be inserted when the table is not in use\nby any other thread.\n\nAnother major benefit of using INSERT DELAYED is that inserts from many\nclients are bundled together and written in one block. This is much\nfaster than performing many separate inserts.\n\nNote that INSERT DELAYED is slower than a normal INSERT if the table is\nnot otherwise in use. There is also the additional overhead for the\nserver to handle a separate thread for each table for which there are\ndelayed rows. This means that you should use INSERT DELAYED only when\nyou are really sure that you need it.\n\nThe queued rows are held only in memory until they are inserted into\nthe table. This means that if you terminate mysqld forcibly (for\nexample, with kill -9) or if mysqld dies unexpectedly, any queued rows\nthat have not been written to disk are lost.\n\nThere are some constraints on the use of DELAYED:\n\no INSERT DELAYED works only with MyISAM, MEMORY, ARCHIVE, and (as of\n MySQL 5.1.19) BLACKHOLE tables. For engines that do not support\n DELAYED, an error occurs.\n\no An error occurs for INSERT DELAYED if used with a table that has been\n locked with LOCK TABLES because the insert must be handled by a\n separate thread, not by the session that holds the lock.\n\no For MyISAM tables, if there are no free blocks in the middle of the\n data file, concurrent SELECT and INSERT statements are supported.\n Under these circumstances, you very seldom need to use INSERT DELAYED\n with MyISAM.\n\no INSERT DELAYED should be used only for INSERT statements that specify\n value lists. The server ignores DELAYED for INSERT ... SELECT or\n INSERT ... ON DUPLICATE KEY UPDATE statements.\n\no Because the INSERT DELAYED statement returns immediately, before the\n rows are inserted, you cannot use LAST_INSERT_ID() to get the\n AUTO_INCREMENT value that the statement might generate.\n\no DELAYED rows are not visible to SELECT statements until they actually\n have been inserted.\n\no INSERT DELAYED is treated as a normal INSERT if the statement inserts\n multiple rows and binary logging is enabled and the global logging\n format is to use statement-based logging (binlog_format is set to\n STATEMENT). This restriction does not apply to row-based binary\n logging.\n\no DELAYED is ignored on slave replication servers, so that INSERT\n DELAYED is treated as a normal INSERT on slaves. This is because\n DELAYED could cause the slave to have different data than the master.\n\no Pending INSERT DELAYED statements are lost if a table is write locked\n and ALTER TABLE is used to modify the table structure.\n\no INSERT DELAYED is not supported for views.\n\no INSERT DELAYED is not supported for partitioned tables.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/insert-delayed.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/insert-delayed.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (483,25,'SHOW PROFILE','Syntax:\nSHOW PROFILES\n\nThe SHOW PROFILE statement display profiling information that indicates\nresource usage for statements executed during the course of the current\nsession. It is used together with SHOW PROFILES; see [HELP SHOW\nPROFILES].\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/show-profile.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/show-profile.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (484,25,'SHOW PROCEDURE CODE','Syntax:\nSHOW PROCEDURE CODE proc_name\n\nThis statement is a MySQL extension that is available only for servers\nthat have been built with debugging support. It displays a\nrepresentation of the internal implementation of the named stored\nprocedure. A similar statement, SHOW FUNCTION CODE, displays\ninformation about stored functions (see [HELP SHOW FUNCTION CODE]).\n\nBoth statements require that you be the owner of the routine or have\nSELECT access to the mysql.proc table.\n\nIf the named routine is available, each statement produces a result\nset. Each row in the result set corresponds to one "instruction" in the\nroutine. The first column is Pos, which is an ordinal number beginning\nwith 0. The second column is Instruction, which contains an SQL\nstatement (usually changed from the original source), or a directive\nwhich has meaning only to the stored-routine handler.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/show-procedure-code.html\n\n','mysql> DELIMITER //\nmysql> CREATE PROCEDURE p1 ()\n -> BEGIN\n -> DECLARE fanta INT DEFAULT 55;\n -> DROP TABLE t2;\n -> LOOP\n -> INSERT INTO t3 VALUES (fanta);\n -> END LOOP;\n -> END//\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> SHOW PROCEDURE CODE p1//\n+-----+----------------------------------------+\n| Pos | Instruction |\n+-----+----------------------------------------+\n| 0 | set fanta@0 55 |\n| 1 | stmt 9 "DROP TABLE t2" |\n| 2 | stmt 5 "INSERT INTO t3 VALUES (fanta)" |\n| 3 | jump 2 |\n+-----+----------------------------------------+\n4 rows in set (0.00 sec)\n','http://dev.mysql.com/doc/refman/5.1/en/show-procedure-code.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (485,20,'MEDIUMTEXT','MEDIUMTEXT [CHARACTER SET charset_name] [COLLATE collation_name]\n\nA TEXT column with a maximum length of 16,777,215 (224 - 1) characters.\nThe effective maximum length is less if the value contains multi-byte\ncharacters. Each MEDIUMTEXT value is stored using a three-byte length\nprefix that indicates the number of bytes in the value.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/string-type-overview.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (486,4,'LN','Syntax:\nLN(X)\n\nReturns the natural logarithm of X; that is, the base-e logarithm of X.\nIf X is less than or equal to 0, then NULL is returned.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/mathematical-functions.html\n\n','mysql> SELECT LN(2);\n -> 0.69314718055995\nmysql> SELECT LN(-2);\n -> NULL\n','http://dev.mysql.com/doc/refman/5.1/en/mathematical-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (487,22,'RETURN','Syntax:\nRETURN expr\n\nThe RETURN statement terminates execution of a stored function and\nreturns the value expr to the function caller. There must be at least\none RETURN statement in a stored function. There may be more than one\nif the function has multiple exit points.\n\nThis statement is not used in stored procedures, triggers, or events.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/return.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/return.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (488,25,'SHOW COLLATION','Syntax:\nSHOW COLLATION\n [LIKE \'pattern\' | WHERE expr]\n\nThis statement lists collations supported by the server. By default,\nthe output from SHOW COLLATION includes all available collations. The\nLIKE clause, if present, indicates which collation names to match. The\nWHERE clause can be given to select rows using more general conditions,\nas discussed in\nhttp://dev.mysql.com/doc/refman/5.1/en/extended-show.html. For example:\n\nmysql> SHOW COLLATION LIKE \'latin1%\';\n+-------------------+---------+----+---------+----------+---------+\n| Collation | Charset | Id | Default | Compiled | Sortlen |\n+-------------------+---------+----+---------+----------+---------+\n| latin1_german1_ci | latin1 | 5 | | | 0 |\n| latin1_swedish_ci | latin1 | 8 | Yes | Yes | 0 |\n| latin1_danish_ci | latin1 | 15 | | | 0 |\n| latin1_german2_ci | latin1 | 31 | | Yes | 2 |\n| latin1_bin | latin1 | 47 | | Yes | 0 |\n| latin1_general_ci | latin1 | 48 | | | 0 |\n| latin1_general_cs | latin1 | 49 | | | 0 |\n| latin1_spanish_ci | latin1 | 94 | | | 0 |\n+-------------------+---------+----+---------+----------+---------+\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/show-collation.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/show-collation.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (489,4,'LOG','Syntax:\nLOG(X), LOG(B,X)\n\nIf called with one parameter, this function returns the natural\nlogarithm of X. If X is less than or equal to 0, then NULL is returned.\n\nThe inverse of this function (when called with a single argument) is\nthe EXP() function.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/mathematical-functions.html\n\n','mysql> SELECT LOG(2);\n -> 0.69314718055995\nmysql> SELECT LOG(-2);\n -> NULL\n','http://dev.mysql.com/doc/refman/5.1/en/mathematical-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (490,25,'SET SQL_LOG_BIN','Syntax:\nSET sql_log_bin = {0|1}\n\nDisables or enables binary logging for the current session (sql_log_bin\nis a session variable) if the client has the SUPER privilege. The\nstatement fails with an error if the client does not have that\nprivilege.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/set-sql-log-bin.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/set-sql-log-bin.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (491,17,'!=','Syntax:\n<>, !=\n\nNot equal:\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/comparison-operators.html\n\n','mysql> SELECT \'.01\' <> \'0.01\';\n -> 1\nmysql> SELECT .01 <> \'0.01\';\n -> 0\nmysql> SELECT \'zapp\' <> \'zappp\';\n -> 1\n','http://dev.mysql.com/doc/refman/5.1/en/comparison-operators.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (492,22,'WHILE','Syntax:\n[begin_label:] WHILE search_condition DO\n statement_list\nEND WHILE [end_label]\n\nThe statement list within a WHILE statement is repeated as long as the\nsearch_condition is true. statement_list consists of one or more\nstatements.\n\nA WHILE statement can be labeled. See [HELP BEGIN END] for the rules\nregarding label use.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/while-statement.html\n\n','CREATE PROCEDURE dowhile()\nBEGIN\n DECLARE v1 INT DEFAULT 5;\n\n WHILE v1 > 0 DO\n ...\n SET v1 = v1 - 1;\n END WHILE;\nEND\n','http://dev.mysql.com/doc/refman/5.1/en/while-statement.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (493,11,'AES_DECRYPT','Syntax:\nAES_DECRYPT(crypt_str,key_str)\n\nThis function allows decryption of data using the official AES\n(Advanced Encryption Standard) algorithm. For more information, see the\ndescription of AES_ENCRYPT().\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/encryption-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/encryption-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (494,30,'DAYNAME','Syntax:\nDAYNAME(date)\n\nReturns the name of the weekday for date. As of MySQL 5.1.12, the\nlanguage used for the name is controlled by the value of the\nlc_time_names system variable\n(http://dev.mysql.com/doc/refman/5.1/en/locale-support.html).\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html\n\n','mysql> SELECT DAYNAME(\'2007-02-03\');\n -> \'Saturday\'\n','http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (495,15,'COERCIBILITY','Syntax:\nCOERCIBILITY(str)\n\nReturns the collation coercibility value of the string argument.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/information-functions.html\n\n','mysql> SELECT COERCIBILITY(\'abc\' COLLATE latin1_swedish_ci);\n -> 0\nmysql> SELECT COERCIBILITY(USER());\n -> 3\nmysql> SELECT COERCIBILITY(\'abc\');\n -> 4\n','http://dev.mysql.com/doc/refman/5.1/en/information-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (496,20,'INT','INT[(M)] [UNSIGNED] [ZEROFILL]\n\nA normal-size integer. The signed range is -2147483648 to 2147483647.\nThe unsigned range is 0 to 4294967295.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.1/en/numeric-type-overview.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (497,12,'GLENGTH','GLength(ls)\n\nReturns as a double-precision number the length of the LineString value\nls in its associated spatial reference.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/geometry-property-functions.html#linestring-property-functions\n\n','mysql> SET @ls = \'LineString(1 1,2 2,3 3)\';\nmysql> SELECT GLength(GeomFromText(@ls));\n+----------------------------+\n| GLength(GeomFromText(@ls)) |\n+----------------------------+\n| 2.8284271247462 |\n+----------------------------+\n','http://dev.mysql.com/doc/refman/5.1/en/geometry-property-functions.html#linestring-property-functions'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (498,4,'RADIANS','Syntax:\nRADIANS(X)\n\nReturns the argument X, converted from degrees to radians. (Note that\nπ radians equals 180 degrees.)\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/mathematical-functions.html\n\n','mysql> SELECT RADIANS(90);\n -> 1.5707963267949\n','http://dev.mysql.com/doc/refman/5.1/en/mathematical-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (499,15,'COLLATION','Syntax:\nCOLLATION(str)\n\nReturns the collation of the string argument.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/information-functions.html\n\n','mysql> SELECT COLLATION(\'abc\');\n -> \'latin1_swedish_ci\'\nmysql> SELECT COLLATION(_utf8\'abc\');\n -> \'utf8_general_ci\'\n','http://dev.mysql.com/doc/refman/5.1/en/information-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (500,17,'COALESCE','Syntax:\nCOALESCE(value,...)\n\nReturns the first non-NULL value in the list, or NULL if there are no\nnon-NULL values.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/comparison-operators.html\n\n','mysql> SELECT COALESCE(NULL,1);\n -> 1\nmysql> SELECT COALESCE(NULL,NULL,NULL);\n -> NULL\n','http://dev.mysql.com/doc/refman/5.1/en/comparison-operators.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (501,15,'VERSION','Syntax:\nVERSION()\n\nReturns a string that indicates the MySQL server version. The string\nuses the utf8 character set.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/information-functions.html\n\n','mysql> SELECT VERSION();\n -> \'5.1.46-standard\'\n','http://dev.mysql.com/doc/refman/5.1/en/information-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (502,35,'MAKE_SET','Syntax:\nMAKE_SET(bits,str1,str2,...)\n\nReturns a set value (a string containing substrings separated by ","\ncharacters) consisting of the strings that have the corresponding bit\nin bits set. str1 corresponds to bit 0, str2 to bit 1, and so on. NULL\nvalues in str1, str2, ... are not appended to the result.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/string-functions.html\n\n','mysql> SELECT MAKE_SET(1,\'a\',\'b\',\'c\');\n -> \'a\'\nmysql> SELECT MAKE_SET(1 | 4,\'hello\',\'nice\',\'world\');\n -> \'hello,world\'\nmysql> SELECT MAKE_SET(1 | 4,\'hello\',\'nice\',NULL,\'world\');\n -> \'hello\'\nmysql> SELECT MAKE_SET(0,\'a\',\'b\',\'c\');\n -> \'\'\n','http://dev.mysql.com/doc/refman/5.1/en/string-functions.html'); -insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (503,35,'FIND_IN_SET','Syntax:\nFIND_IN_SET(str,strlist)\n\nReturns a value in the range of 1 to N if the string str is in the\nstring list strlist consisting of N substrings. A string list is a\nstring composed of substrings separated by "," characters. If the first\nargument is a constant string and the second is a column of type SET,\nthe FIND_IN_SET() function is optimized to use bit arithmetic. Returns\n0 if str is not in strlist or if strlist is the empty string. Returns\nNULL if either argument is NULL. This function does not work properly\nif the first argument contains a comma (",") character.\n\nURL: http://dev.mysql.com/doc/refman/5.1/en/string-functions.html\n\n','mysql> SELECT FIND_IN_SET(\'b\',\'a,b,c,d\');\n -> 2\n','http://dev.mysql.com/doc/refman/5.1/en/string-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (0,16,'MIN','Syntax:\nMIN([DISTINCT] expr)\n\nReturns the minimum value of expr. MIN() may take a string argument; in\nsuch cases, it returns the minimum string value. See\nhttp://dev.mysql.com/doc/refman/5.5/en/mysql-indexes.html. The DISTINCT\nkeyword can be used to find the minimum of the distinct values of expr,\nhowever, this produces the same result as omitting DISTINCT.\n\nMIN() returns NULL if there were no matching rows.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/group-by-functions.html\n\n','mysql> SELECT student_name, MIN(test_score), MAX(test_score)\n -> FROM student\n -> GROUP BY student_name;\n','http://dev.mysql.com/doc/refman/5.5/en/group-by-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (1,27,'JOIN','MySQL supports the following JOIN syntaxes for the table_references\npart of SELECT statements and multiple-table DELETE and UPDATE\nstatements:\n\ntable_references:\n table_reference [, table_reference] ...\n\ntable_reference:\n table_factor\n | join_table\n\ntable_factor:\n tbl_name [[AS] alias] [index_hint_list]\n | table_subquery [AS] alias\n | ( table_references )\n | { OJ table_reference LEFT OUTER JOIN table_reference\n ON conditional_expr }\n\njoin_table:\n table_reference [INNER | CROSS] JOIN table_factor [join_condition]\n | table_reference STRAIGHT_JOIN table_factor\n | table_reference STRAIGHT_JOIN table_factor ON conditional_expr\n | table_reference {LEFT|RIGHT} [OUTER] JOIN table_reference join_condition\n | table_reference NATURAL [{LEFT|RIGHT} [OUTER]] JOIN table_factor\n\njoin_condition:\n ON conditional_expr\n | USING (column_list)\n\nindex_hint_list:\n index_hint [, index_hint] ...\n\nindex_hint:\n USE {INDEX|KEY}\n [FOR {JOIN|ORDER BY|GROUP BY}] ([index_list])\n | IGNORE {INDEX|KEY}\n [FOR {JOIN|ORDER BY|GROUP BY}] (index_list)\n | FORCE {INDEX|KEY}\n [FOR {JOIN|ORDER BY|GROUP BY}] (index_list)\n\nindex_list:\n index_name [, index_name] ...\n\nA table reference is also known as a join expression.\n\nThe syntax of table_factor is extended in comparison with the SQL\nStandard. The latter accepts only table_reference, not a list of them\ninside a pair of parentheses.\n\nThis is a conservative extension if we consider each comma in a list of\ntable_reference items as equivalent to an inner join. For example:\n\nSELECT * FROM t1 LEFT JOIN (t2, t3, t4)\n ON (t2.a=t1.a AND t3.b=t1.b AND t4.c=t1.c)\n\nis equivalent to:\n\nSELECT * FROM t1 LEFT JOIN (t2 CROSS JOIN t3 CROSS JOIN t4)\n ON (t2.a=t1.a AND t3.b=t1.b AND t4.c=t1.c)\n\nIn MySQL, JOIN, CROSS JOIN, and INNER JOIN are syntactic equivalents\n(they can replace each other). In standard SQL, they are not\nequivalent. INNER JOIN is used with an ON clause, CROSS JOIN is used\notherwise.\n\nIn general, parentheses can be ignored in join expressions containing\nonly inner join operations. MySQL also supports nested joins (see\nhttp://dev.mysql.com/doc/refman/5.5/en/nested-join-optimization.html).\n\nIndex hints can be specified to affect how the MySQL optimizer makes\nuse of indexes. For more information, see\nhttp://dev.mysql.com/doc/refman/5.5/en/index-hints.html.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/join.html\n\n','SELECT left_tbl.*\n FROM left_tbl LEFT JOIN right_tbl ON left_tbl.id = right_tbl.id\n WHERE right_tbl.id IS NULL;\n','http://dev.mysql.com/doc/refman/5.5/en/join.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (2,37,'HEX','Syntax:\nHEX(str), HEX(N)\n\nFor a string argument str, HEX() returns a hexadecimal string\nrepresentation of str where each character in str is converted to two\nhexadecimal digits. The inverse of this operation is performed by the\nUNHEX() function.\n\nFor a numeric argument N, HEX() returns a hexadecimal string\nrepresentation of the value of N treated as a longlong (BIGINT) number.\nThis is equivalent to CONV(N,10,16). The inverse of this operation is\nperformed by CONV(HEX(N),16,10).\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/string-functions.html\n\n','mysql> SELECT 0x616263, HEX(\'abc\'), UNHEX(HEX(\'abc\'));\n -> \'abc\', 616263, \'abc\'\nmysql> SELECT HEX(255), CONV(HEX(255),16,10);\n -> \'FF\', 255\n','http://dev.mysql.com/doc/refman/5.5/en/string-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (3,27,'REPLACE','Syntax:\nREPLACE [LOW_PRIORITY | DELAYED]\n [INTO] tbl_name [(col_name,...)]\n {VALUES | VALUE} ({expr | DEFAULT},...),(...),...\n\nOr:\n\nREPLACE [LOW_PRIORITY | DELAYED]\n [INTO] tbl_name\n SET col_name={expr | DEFAULT}, ...\n\nOr:\n\nREPLACE [LOW_PRIORITY | DELAYED]\n [INTO] tbl_name [(col_name,...)]\n SELECT ...\n\nREPLACE works exactly like INSERT, except that if an old row in the\ntable has the same value as a new row for a PRIMARY KEY or a UNIQUE\nindex, the old row is deleted before the new row is inserted. See [HELP\nINSERT].\n\nREPLACE is a MySQL extension to the SQL standard. It either inserts, or\ndeletes and inserts. For another MySQL extension to standard SQL---that\neither inserts or updates---see\nhttp://dev.mysql.com/doc/refman/5.5/en/insert-on-duplicate.html.\n\nNote that unless the table has a PRIMARY KEY or UNIQUE index, using a\nREPLACE statement makes no sense. It becomes equivalent to INSERT,\nbecause there is no index to be used to determine whether a new row\nduplicates another.\n\nValues for all columns are taken from the values specified in the\nREPLACE statement. Any missing columns are set to their default values,\njust as happens for INSERT. You cannot refer to values from the current\nrow and use them in the new row. If you use an assignment such as SET\ncol_name = col_name + 1, the reference to the column name on the right\nhand side is treated as DEFAULT(col_name), so the assignment is\nequivalent to SET col_name = DEFAULT(col_name) + 1.\n\nTo use REPLACE, you must have both the INSERT and DELETE privileges for\nthe table.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/replace.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/replace.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (4,30,'CONTAINS','Contains(g1,g2)\n\nReturns 1 or 0 to indicate whether g1 completely contains g2. This\ntests the opposite relationship as Within().\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/functions-for-testing-spatial-relations-between-geometric-objects.html#functions-that-test-spatial-relationships-between-geometries\n\n','','http://dev.mysql.com/doc/refman/5.5/en/functions-for-testing-spatial-relations-between-geometric-objects.html#functions-that-test-spatial-relationships-between-geometries'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (5,36,'SRID','SRID(g)\n\nReturns an integer indicating the Spatial Reference System ID for the\ngeometry value g.\n\nIn MySQL, the SRID value is just an integer associated with the\ngeometry value. All calculations are done assuming Euclidean (planar)\ngeometry.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/geometry-property-functions.html#general-geometry-property-functions\n\n','mysql> SELECT SRID(GeomFromText(\'LineString(1 1,2 2)\',101));\n+-----------------------------------------------+\n| SRID(GeomFromText(\'LineString(1 1,2 2)\',101)) |\n+-----------------------------------------------+\n| 101 |\n+-----------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.5/en/geometry-property-functions.html#general-geometry-property-functions'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (6,31,'CURRENT_TIMESTAMP','Syntax:\nCURRENT_TIMESTAMP, CURRENT_TIMESTAMP()\n\nCURRENT_TIMESTAMP and CURRENT_TIMESTAMP() are synonyms for NOW().\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (7,26,'SHOW CONTRIBUTORS','Syntax:\nSHOW CONTRIBUTORS\n\nThe SHOW CONTRIBUTORS statement displays information about the people\nwho contribute to MySQL source or to causes that we support. For each\ncontributor, it displays Name, Location, and Comment values.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/show-contributors.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/show-contributors.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (8,16,'VARIANCE','Syntax:\nVARIANCE(expr)\n\nReturns the population standard variance of expr. This is an extension\nto standard SQL. The standard SQL function VAR_POP() can be used\ninstead.\n\nVARIANCE() returns NULL if there were no matching rows.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/group-by-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/group-by-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (9,39,'DROP SERVER','Syntax:\nDROP SERVER [ IF EXISTS ] server_name\n\nDrops the server definition for the server named server_name. The\ncorresponding row within the mysql.servers table will be deleted. This\nstatement requires the SUPER privilege.\n\nDropping a server for a table does not affect any FEDERATED tables that\nused this connection information when they were created. See [HELP\nCREATE SERVER].\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/drop-server.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/drop-server.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (10,26,'SHOW AUTHORS','Syntax:\nSHOW AUTHORS\n\nThe SHOW AUTHORS statement displays information about the people who\nwork on MySQL. For each author, it displays Name, Location, and Comment\nvalues.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/show-authors.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/show-authors.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (11,16,'VAR_SAMP','Syntax:\nVAR_SAMP(expr)\n\nReturns the sample variance of expr. That is, the denominator is the\nnumber of rows minus one.\n\nVAR_SAMP() returns NULL if there were no matching rows.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/group-by-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/group-by-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (12,37,'CONCAT','Syntax:\nCONCAT(str1,str2,...)\n\nReturns the string that results from concatenating the arguments. May\nhave one or more arguments. If all arguments are nonbinary strings, the\nresult is a nonbinary string. If the arguments include any binary\nstrings, the result is a binary string. A numeric argument is converted\nto its equivalent string form. This is a nonbinary string as of MySQL\n5.5.3. Before 5.5.3, it is a binary string; to to avoid that and\nproduce a nonbinary string, you can use an explicit type cast, as in\nthis example:\n\nSELECT CONCAT(CAST(int_col AS CHAR), char_col);\n\nCONCAT() returns NULL if any argument is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/string-functions.html\n\n','mysql> SELECT CONCAT(\'My\', \'S\', \'QL\');\n -> \'MySQL\'\nmysql> SELECT CONCAT(\'My\', NULL, \'QL\');\n -> NULL\nmysql> SELECT CONCAT(14.3);\n -> \'14.3\'\n','http://dev.mysql.com/doc/refman/5.5/en/string-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (13,34,'GEOMETRY HIERARCHY','Geometry is the base class. It is an abstract class. The instantiable\nsubclasses of Geometry are restricted to zero-, one-, and\ntwo-dimensional geometric objects that exist in two-dimensional\ncoordinate space. All instantiable geometry classes are defined so that\nvalid instances of a geometry class are topologically closed (that is,\nall defined geometries include their boundary).\n\nThe base Geometry class has subclasses for Point, Curve, Surface, and\nGeometryCollection:\n\no Point represents zero-dimensional objects.\n\no Curve represents one-dimensional objects, and has subclass\n LineString, with sub-subclasses Line and LinearRing.\n\no Surface is designed for two-dimensional objects and has subclass\n Polygon.\n\no GeometryCollection has specialized zero-, one-, and two-dimensional\n collection classes named MultiPoint, MultiLineString, and\n MultiPolygon for modeling geometries corresponding to collections of\n Points, LineStrings, and Polygons, respectively. MultiCurve and\n MultiSurface are introduced as abstract superclasses that generalize\n the collection interfaces to handle Curves and Surfaces.\n\nGeometry, Curve, Surface, MultiCurve, and MultiSurface are defined as\nnoninstantiable classes. They define a common set of methods for their\nsubclasses and are included for extensibility.\n\nPoint, LineString, Polygon, GeometryCollection, MultiPoint,\nMultiLineString, and MultiPolygon are instantiable classes.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/gis-geometry-class-hierarchy.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/gis-geometry-class-hierarchy.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (14,37,'CHAR FUNCTION','Syntax:\nCHAR(N,... [USING charset_name])\n\nCHAR() interprets each argument N as an integer and returns a string\nconsisting of the characters given by the code values of those\nintegers. NULL values are skipped.\nBy default, CHAR() returns a binary string. To produce a string in a\ngiven character set, use the optional USING clause:\n\nmysql> SELECT CHARSET(CHAR(0x65)), CHARSET(CHAR(0x65 USING utf8));\n+---------------------+--------------------------------+\n| CHARSET(CHAR(0x65)) | CHARSET(CHAR(0x65 USING utf8)) |\n+---------------------+--------------------------------+\n| binary | utf8 |\n+---------------------+--------------------------------+\n\nIf USING is given and the result string is illegal for the given\ncharacter set, a warning is issued. Also, if strict SQL mode is\nenabled, the result from CHAR() becomes NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/string-functions.html\n\n','mysql> SELECT CHAR(77,121,83,81,\'76\');\n -> \'MySQL\'\nmysql> SELECT CHAR(77,77.3,\'77.3\');\n -> \'MMM\'\n','http://dev.mysql.com/doc/refman/5.5/en/string-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (15,22,'DATETIME','DATETIME\n\nA date and time combination. The supported range is \'1000-01-01\n00:00:00\' to \'9999-12-31 23:59:59\'. MySQL displays DATETIME values in\n\'YYYY-MM-DD HH:MM:SS\' format, but permits assignment of values to\nDATETIME columns using either strings or numbers.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/date-and-time-type-overview.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (16,26,'SHOW CREATE TRIGGER','Syntax:\nSHOW CREATE TRIGGER trigger_name\n\nThis statement shows a CREATE TRIGGER statement that creates the given\ntrigger.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/show-create-trigger.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/show-create-trigger.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (17,26,'SHOW CREATE PROCEDURE','Syntax:\nSHOW CREATE PROCEDURE proc_name\n\nThis statement is a MySQL extension. It returns the exact string that\ncan be used to re-create the named stored procedure. A similar\nstatement, SHOW CREATE FUNCTION, displays information about stored\nfunctions (see [HELP SHOW CREATE FUNCTION]).\n\nBoth statements require that you be the owner of the routine or have\nSELECT access to the mysql.proc table. If you do not have privileges\nfor the routine itself, the value displayed for the Create Procedure or\nCreate Function field will be NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/show-create-procedure.html\n\n','mysql> SHOW CREATE PROCEDURE test.simpleproc\\G\n*************************** 1. row ***************************\n Procedure: simpleproc\n sql_mode:\n Create Procedure: CREATE PROCEDURE `simpleproc`(OUT param1 INT)\n BEGIN\n SELECT COUNT(*) INTO param1 FROM t;\n END\ncharacter_set_client: latin1\ncollation_connection: latin1_swedish_ci\n Database Collation: latin1_swedish_ci\n\nmysql> SHOW CREATE FUNCTION test.hello\\G\n*************************** 1. row ***************************\n Function: hello\n sql_mode:\n Create Function: CREATE FUNCTION `hello`(s CHAR(20))\n RETURNS CHAR(50)\n RETURN CONCAT(\'Hello, \',s,\'!\')\ncharacter_set_client: latin1\ncollation_connection: latin1_swedish_ci\n Database Collation: latin1_swedish_ci\n','http://dev.mysql.com/doc/refman/5.5/en/show-create-procedure.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (18,23,'OPEN','Syntax:\nOPEN cursor_name\n\nThis statement opens a previously declared cursor. For an example, see\nhttp://dev.mysql.com/doc/refman/5.5/en/cursors.html.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/open.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/open.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (19,22,'INTEGER','INTEGER[(M)] [UNSIGNED] [ZEROFILL]\n\nThis type is a synonym for INT.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/numeric-type-overview.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (20,37,'LOWER','Syntax:\nLOWER(str)\n\nReturns the string str with all characters changed to lowercase\naccording to the current character set mapping. The default is latin1\n(cp1252 West European).\n\nmysql> SELECT LOWER(\'QUADRATICALLY\');\n -> \'quadratically\'\n\nLOWER() (and UPPER()) are ineffective when applied to binary strings\n(BINARY, VARBINARY, BLOB). To perform lettercase conversion, convert\nthe string to a nonbinary string:\n\nmysql> SET @str = BINARY \'New York\';\nmysql> SELECT LOWER(@str), LOWER(CONVERT(@str USING latin1));\n+-------------+-----------------------------------+\n| LOWER(@str) | LOWER(CONVERT(@str USING latin1)) |\n+-------------+-----------------------------------+\n| New York | new york |\n+-------------+-----------------------------------+\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/string-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/string-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (21,26,'SHOW COLUMNS','Syntax:\nSHOW [FULL] COLUMNS {FROM | IN} tbl_name [{FROM | IN} db_name]\n [LIKE \'pattern\' | WHERE expr]\n\nSHOW COLUMNS displays information about the columns in a given table.\nIt also works for views. The LIKE clause, if present, indicates which\ncolumn names to match. The WHERE clause can be given to select rows\nusing more general conditions, as discussed in\nhttp://dev.mysql.com/doc/refman/5.5/en/extended-show.html.\n\nSHOW COLUMNS displays information only for those columns for which you\nhave some privilege.\n\nmysql> SHOW COLUMNS FROM City;\n+------------+----------+------+-----+---------+----------------+\n| Field | Type | Null | Key | Default | Extra |\n+------------+----------+------+-----+---------+----------------+\n| Id | int(11) | NO | PRI | NULL | auto_increment |\n| Name | char(35) | NO | | | |\n| Country | char(3) | NO | UNI | | |\n| District | char(20) | YES | MUL | | |\n| Population | int(11) | NO | | 0 | |\n+------------+----------+------+-----+---------+----------------+\n5 rows in set (0.00 sec)\n\nIf the data types differ from what you expect them to be based on a\nCREATE TABLE statement, note that MySQL sometimes changes data types\nwhen you create or alter a table. The conditions under which this\noccurs are described in\nhttp://dev.mysql.com/doc/refman/5.5/en/silent-column-changes.html.\n\nThe FULL keyword causes the output to include the column collation and\ncomments, as well as the privileges you have for each column.\n\nYou can use db_name.tbl_name as an alternative to the tbl_name FROM\ndb_name syntax. In other words, these two statements are equivalent:\n\nmysql> SHOW COLUMNS FROM mytable FROM mydb;\nmysql> SHOW COLUMNS FROM mydb.mytable;\n\nSHOW COLUMNS displays the following values for each table column:\n\nField indicates the column name.\n\nType indicates the column data type.\n\nCollation indicates the collation for nonbinary string columns, or NULL\nfor other columns. This value is displayed only if you use the FULL\nkeyword.\n\nThe Null field contains YES if NULL values can be stored in the column,\nNO if not.\n\nThe Key field indicates whether the column is indexed:\n\no If Key is empty, the column either is not indexed or is indexed only\n as a secondary column in a multiple-column, nonunique index.\n\no If Key is PRI, the column is a PRIMARY KEY or is one of the columns\n in a multiple-column PRIMARY KEY.\n\no If Key is UNI, the column is the first column of a UNIQUE index. (A\n UNIQUE index permits multiple NULL values, but you can tell whether\n the column permits NULL by checking the Null field.)\n\no If Key is MUL, the column is the first column of a nonunique index in\n which multiple occurrences of a given value are permitted within the\n column.\n\nIf more than one of the Key values applies to a given column of a\ntable, Key displays the one with the highest priority, in the order\nPRI, UNI, MUL.\n\nA UNIQUE index may be displayed as PRI if it cannot contain NULL values\nand there is no PRIMARY KEY in the table. A UNIQUE index may display as\nMUL if several columns form a composite UNIQUE index; although the\ncombination of the columns is unique, each column can still hold\nmultiple occurrences of a given value.\n\nThe Default field indicates the default value that is assigned to the\ncolumn. This is NULL if the column has an explicit default of NULL, or\nif the column definition has no DEFAULT clause.\n\nThe Extra field contains any additional information that is available\nabout a given column. The value is nonempty in these cases:\nauto_increment for columns that have the AUTO_INCREMENT attribute; on\nupdate CURRENT_TIMESTAMP for TIMESTAMP columns that have the ON UPDATE\nCURRENT_TIMESTAMP attribute.\n\nPrivileges indicates the privileges you have for the column. This value\nis displayed only if you use the FULL keyword.\n\nComment indicates any comment the column has. This value is displayed\nonly if you use the FULL keyword.\n\nSHOW FIELDS is a synonym for SHOW COLUMNS. You can also list a table\'s\ncolumns with the mysqlshow db_name tbl_name command.\n\nThe DESCRIBE statement provides information similar to SHOW COLUMNS.\nSee [HELP DESCRIBE].\n\nThe SHOW CREATE TABLE, SHOW TABLE STATUS, and SHOW INDEX statements\nalso provide information about tables. See [HELP SHOW].\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/show-columns.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/show-columns.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (22,39,'CREATE TRIGGER','Syntax:\nCREATE\n [DEFINER = { user | CURRENT_USER }]\n TRIGGER trigger_name trigger_time trigger_event\n ON tbl_name FOR EACH ROW trigger_body\n\nThis statement creates a new trigger. A trigger is a named database\nobject that is associated with a table, and that activates when a\nparticular event occurs for the table. The trigger becomes associated\nwith the table named tbl_name, which must refer to a permanent table.\nYou cannot associate a trigger with a TEMPORARY table or a view.\n\nCREATE TRIGGER requires the TRIGGER privilege for the table associated\nwith the trigger. The statement might also require the SUPER privilege,\ndepending on the DEFINER value, as described later in this section. If\nbinary logging is enabled, CREATE TRIGGER might require the SUPER\nprivilege, as described in\nhttp://dev.mysql.com/doc/refman/5.5/en/stored-programs-logging.html.\n\nThe DEFINER clause determines the security context to be used when\nchecking access privileges at trigger activation time. See later in\nthis section for more information.\n\ntrigger_time is the trigger action time. It can be BEFORE or AFTER to\nindicate that the trigger activates before or after each row to be\nmodified.\n\ntrigger_event indicates the kind of statement that activates the\ntrigger. The trigger_event can be one of the following:\n\no INSERT: The trigger is activated whenever a new row is inserted into\n the table; for example, through INSERT, LOAD DATA, and REPLACE\n statements.\n\no UPDATE: The trigger is activated whenever a row is modified; for\n example, through UPDATE statements.\n\no DELETE: The trigger is activated whenever a row is deleted from the\n table; for example, through DELETE and REPLACE statements. However,\n DROP TABLE and TRUNCATE TABLE statements on the table do not activate\n this trigger, because they do not use DELETE. Dropping a partition\n does not activate DELETE triggers, either. See [HELP TRUNCATE TABLE].\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/create-trigger.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/create-trigger.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (23,31,'MONTH','Syntax:\nMONTH(date)\n\nReturns the month for date, in the range 1 to 12 for January to\nDecember, or 0 for dates such as \'0000-00-00\' or \'2008-00-00\' that have\na zero month part.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html\n\n','mysql> SELECT MONTH(\'2008-02-03\');\n -> 2\n','http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (24,22,'TINYINT','TINYINT[(M)] [UNSIGNED] [ZEROFILL]\n\nA very small integer. The signed range is -128 to 127. The unsigned\nrange is 0 to 255.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/numeric-type-overview.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (25,26,'SHOW TRIGGERS','Syntax:\nSHOW TRIGGERS [{FROM | IN} db_name]\n [LIKE \'pattern\' | WHERE expr]\n\nSHOW TRIGGERS lists the triggers currently defined for tables in a\ndatabase (the default database unless a FROM clause is given). This\nstatement returns results only for databases and tables for which you\nhave the TRIGGER privilege. The LIKE clause, if present, indicates\nwhich table names to match and causes the statement to display triggers\nfor those tables. The WHERE clause can be given to select rows using\nmore general conditions, as discussed in\nhttp://dev.mysql.com/doc/refman/5.5/en/extended-show.html.\n\nFor the trigger ins_sum as defined in\nhttp://dev.mysql.com/doc/refman/5.5/en/triggers.html, the output of\nthis statement is as shown here:\n\nmysql> SHOW TRIGGERS LIKE \'acc%\'\\G\n*************************** 1. row ***************************\n Trigger: ins_sum\n Event: INSERT\n Table: account\n Statement: SET @sum = @sum + NEW.amount\n Timing: BEFORE\n Created: NULL\n sql_mode:\n Definer: myname@localhost\ncharacter_set_client: latin1\ncollation_connection: latin1_swedish_ci\n Database Collation: latin1_swedish_ci\n\ncharacter_set_client is the session value of the character_set_client\nsystem variable when the trigger was created. collation_connection is\nthe session value of the collation_connection system variable when the\ntrigger was created. Database Collation is the collation of the\ndatabase with which the trigger is associated.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/show-triggers.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/show-triggers.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (26,14,'MASTER_POS_WAIT','Syntax:\nMASTER_POS_WAIT(log_name,log_pos[,timeout])\n\nThis function is useful for control of master/slave synchronization. It\nblocks until the slave has read and applied all updates up to the\nspecified position in the master log. The return value is the number of\nlog events the slave had to wait for to advance to the specified\nposition. The function returns NULL if the slave SQL thread is not\nstarted, the slave\'s master information is not initialized, the\narguments are incorrect, or an error occurs. It returns -1 if the\ntimeout has been exceeded. If the slave SQL thread stops while\nMASTER_POS_WAIT() is waiting, the function returns NULL. If the slave\nis past the specified position, the function returns immediately.\n\nIf a timeout value is specified, MASTER_POS_WAIT() stops waiting when\ntimeout seconds have elapsed. timeout must be greater than 0; a zero or\nnegative timeout means no timeout.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/miscellaneous-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/miscellaneous-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (27,37,'REGEXP','Syntax:\nexpr REGEXP pat, expr RLIKE pat\n\nPerforms a pattern match of a string expression expr against a pattern\npat. The pattern can be an extended regular expression. The syntax for\nregular expressions is discussed in\nhttp://dev.mysql.com/doc/refman/5.5/en/regexp.html. Returns 1 if expr\nmatches pat; otherwise it returns 0. If either expr or pat is NULL, the\nresult is NULL. RLIKE is a synonym for REGEXP, provided for mSQL\ncompatibility.\n\nThe pattern need not be a literal string. For example, it can be\nspecified as a string expression or table column.\n\n*Note*: Because MySQL uses the C escape syntax in strings (for example,\n"\\n" to represent the newline character), you must double any "\\" that\nyou use in your REGEXP strings.\n\nREGEXP is not case sensitive, except when used with binary strings.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/regexp.html\n\n','mysql> SELECT \'Monty!\' REGEXP \'.*\';\n -> 1\nmysql> SELECT \'new*\\n*line\' REGEXP \'new\\\\*.\\\\*line\';\n -> 1\nmysql> SELECT \'a\' REGEXP \'A\', \'a\' REGEXP BINARY \'A\';\n -> 1 0\nmysql> SELECT \'a\' REGEXP \'^[a-d]\';\n -> 1\n','http://dev.mysql.com/doc/refman/5.5/en/regexp.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (28,23,'IF STATEMENT','Syntax:\nIF search_condition THEN statement_list\n [ELSEIF search_condition THEN statement_list] ...\n [ELSE statement_list]\nEND IF\n\nThe IF statement for stored programs implements a basic conditional\nconstruct.\n\n*Note*: There is also an IF() function, which differs from the IF\nstatement described here. See\nhttp://dev.mysql.com/doc/refman/5.5/en/control-flow-functions.html. The\nIF statement can have THEN, ELSE, and ELSEIF clauses, and it is\nterminated with END IF.\n\nIf the search_condition evaluates to true, the corresponding THEN or\nELSEIF clause statement_list executes. If no search_condition matches,\nthe ELSE clause statement_list executes.\n\nEach statement_list consists of one or more SQL statements; an empty\nstatement_list is not permitted.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/if.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/if.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (29,19,'^','Syntax:\n^\n\nBitwise XOR:\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/bit-functions.html\n\n','mysql> SELECT 1 ^ 1;\n -> 0\nmysql> SELECT 1 ^ 0;\n -> 1\nmysql> SELECT 11 ^ 3;\n -> 8\n','http://dev.mysql.com/doc/refman/5.5/en/bit-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (30,39,'DROP VIEW','Syntax:\nDROP VIEW [IF EXISTS]\n view_name [, view_name] ...\n [RESTRICT | CASCADE]\n\nDROP VIEW removes one or more views. You must have the DROP privilege\nfor each view. If any of the views named in the argument list do not\nexist, MySQL returns an error indicating by name which nonexisting\nviews it was unable to drop, but it also drops all of the views in the\nlist that do exist.\n\nThe IF EXISTS clause prevents an error from occurring for views that\ndon\'t exist. When this clause is given, a NOTE is generated for each\nnonexistent view. See [HELP SHOW WARNINGS].\n\nRESTRICT and CASCADE, if given, are parsed and ignored.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/drop-view.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/drop-view.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (31,30,'WITHIN','Within(g1,g2)\n\nReturns 1 or 0 to indicate whether g1 is spatially within g2. This\ntests the opposite relationship as Contains().\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/functions-for-testing-spatial-relations-between-geometric-objects.html#functions-that-test-spatial-relationships-between-geometries\n\n','','http://dev.mysql.com/doc/refman/5.5/en/functions-for-testing-spatial-relations-between-geometric-objects.html#functions-that-test-spatial-relationships-between-geometries'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (32,31,'WEEK','Syntax:\nWEEK(date[,mode])\n\nThis function returns the week number for date. The two-argument form\nof WEEK() enables you to specify whether the week starts on Sunday or\nMonday and whether the return value should be in the range from 0 to 53\nor from 1 to 53. If the mode argument is omitted, the value of the\ndefault_week_format system variable is used. See\nhttp://dev.mysql.com/doc/refman/5.5/en/server-system-variables.html.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html\n\n','mysql> SELECT WEEK(\'2008-02-20\');\n -> 7\nmysql> SELECT WEEK(\'2008-02-20\',0);\n -> 7\nmysql> SELECT WEEK(\'2008-02-20\',1);\n -> 8\nmysql> SELECT WEEK(\'2008-12-31\',1);\n -> 53\n','http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (33,26,'SHOW PLUGINS','Syntax:\nSHOW PLUGINS\n\nSHOW PLUGINS displays information about server plugins. Plugin\ninformation is also available in the INFORMATION_SCHEMA.PLUGINS table.\nSee http://dev.mysql.com/doc/refman/5.5/en/plugins-table.html.\n\nExample of SHOW PLUGINS output:\n\nmysql> SHOW PLUGINS\\G\n*************************** 1. row ***************************\n Name: binlog\n Status: ACTIVE\n Type: STORAGE ENGINE\nLibrary: NULL\nLicense: GPL\n*************************** 2. row ***************************\n Name: CSV\n Status: ACTIVE\n Type: STORAGE ENGINE\nLibrary: NULL\nLicense: GPL\n*************************** 3. row ***************************\n Name: MEMORY\n Status: ACTIVE\n Type: STORAGE ENGINE\nLibrary: NULL\nLicense: GPL\n*************************** 4. row ***************************\n Name: MyISAM\n Status: ACTIVE\n Type: STORAGE ENGINE\nLibrary: NULL\nLicense: GPL\n...\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/show-plugins.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/show-plugins.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (34,21,'DROP FUNCTION UDF','Syntax:\nDROP FUNCTION function_name\n\nThis statement drops the user-defined function (UDF) named\nfunction_name.\n\nTo drop a function, you must have the DELETE privilege for the mysql\ndatabase. This is because DROP FUNCTION removes a row from the\nmysql.func system table that records the function\'s name, type, and\nshared library name.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/drop-function-udf.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/drop-function-udf.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (35,8,'PREPARE','Syntax:\nPREPARE stmt_name FROM preparable_stmt\n\nThe PREPARE statement prepares a statement and assigns it a name,\nstmt_name, by which to refer to the statement later. Statement names\nare not case sensitive. preparable_stmt is either a string literal or a\nuser variable that contains the text of the statement. The text must\nrepresent a single SQL statement, not multiple statements. Within the\nstatement, "?" characters can be used as parameter markers to indicate\nwhere data values are to be bound to the query later when you execute\nit. The "?" characters should not be enclosed within quotation marks,\neven if you intend to bind them to string values. Parameter markers can\nbe used only where data values should appear, not for SQL keywords,\nidentifiers, and so forth.\n\nIf a prepared statement with the given name already exists, it is\ndeallocated implicitly before the new statement is prepared. This means\nthat if the new statement contains an error and cannot be prepared, an\nerror is returned and no statement with the given name exists.\n\nA prepared statement is executed with EXECUTE and released with\nDEALLOCATE PREPARE.\n\nThe scope of a prepared statement is the session within which it is\ncreated. Other sessions cannot see it.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/prepare.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/prepare.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (36,8,'LOCK','Syntax:\nLOCK TABLES\n tbl_name [[AS] alias] lock_type\n [, tbl_name [[AS] alias] lock_type] ...\n\nlock_type:\n READ [LOCAL]\n | [LOW_PRIORITY] WRITE\n\nUNLOCK TABLES\n\nMySQL enables client sessions to acquire table locks explicitly for the\npurpose of cooperating with other sessions for access to tables, or to\nprevent other sessions from modifying tables during periods when a\nsession requires exclusive access to them. A session can acquire or\nrelease locks only for itself. One session cannot acquire locks for\nanother session or release locks held by another session.\n\nLocks may be used to emulate transactions or to get more speed when\nupdating tables. This is explained in more detail later in this\nsection.\n\nLOCK TABLES explicitly acquires table locks for the current client\nsession. Table locks can be acquired for base tables or views. You must\nhave the LOCK TABLES privilege, and the SELECT privilege for each\nobject to be locked.\n\nFor view locking, LOCK TABLES adds all base tables used in the view to\nthe set of tables to be locked and locks them automatically. If you\nlock a table explicitly with LOCK TABLES, any tables used in triggers\nare also locked implicitly, as described in\nhttp://dev.mysql.com/doc/refman/5.5/en/lock-tables-and-triggers.html.\n\nUNLOCK TABLES explicitly releases any table locks held by the current\nsession. LOCK TABLES implicitly releases any table locks held by the\ncurrent session before acquiring new locks.\n\nAnother use for UNLOCK TABLES is to release the global read lock\nacquired with the FLUSH TABLES WITH READ LOCK statement, which enables\nyou to lock all tables in all databases. See [HELP FLUSH]. (This is a\nvery convenient way to get backups if you have a file system such as\nVeritas that can take snapshots in time.)\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/lock-tables.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/lock-tables.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (37,37,'UPDATEXML','Syntax:\nUpdateXML(xml_target, xpath_expr, new_xml)\n\nThis function replaces a single portion of a given fragment of XML\nmarkup xml_target with a new XML fragment new_xml, and then returns the\nchanged XML. The portion of xml_target that is replaced matches an\nXPath expression xpath_expr supplied by the user. In MySQL 5.5, the\nXPath expression can contain at most 127 characters. (This limitation\nis lifted in MySQL 5.6.)\n\nIf no expression matching xpath_expr is found, or if multiple matches\nare found, the function returns the original xml_target XML fragment.\nAll three arguments should be strings.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/xml-functions.html\n\n','mysql> SELECT\n -> UpdateXML(\'<a><b>ccc</b><d></d></a>\', \'/a\', \'<e>fff</e>\') AS val1,\n -> UpdateXML(\'<a><b>ccc</b><d></d></a>\', \'/b\', \'<e>fff</e>\') AS val2,\n -> UpdateXML(\'<a><b>ccc</b><d></d></a>\', \'//b\', \'<e>fff</e>\') AS val3,\n -> UpdateXML(\'<a><b>ccc</b><d></d></a>\', \'/a/d\', \'<e>fff</e>\') AS val4,\n -> UpdateXML(\'<a><d></d><b>ccc</b><d></d></a>\', \'/a/d\', \'<e>fff</e>\') AS val5\n -> \\G\n\n*************************** 1. row ***************************\nval1: <e>fff</e>\nval2: <a><b>ccc</b><d></d></a>\nval3: <a><e>fff</e><d></d></a>\nval4: <a><b>ccc</b><e>fff</e></a>\nval5: <a><d></d><b>ccc</b><d></d></a>\n','http://dev.mysql.com/doc/refman/5.5/en/xml-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (38,8,'RESET SLAVE','Syntax:\nRESET SLAVE [ALL]\n\nRESET SLAVE makes the slave forget its replication position in the\nmaster\'s binary log. This statement is meant to be used for a clean\nstart: It deletes the master.info and relay-log.info files, all the\nrelay log files, and starts a new relay log file. To use RESET SLAVE,\nthe slave replication threads must be stopped (use STOP SLAVE if\nnecessary).\n\n*Note*: All relay log files are deleted, even if they have not been\ncompletely executed by the slave SQL thread. (This is a condition\nlikely to exist on a replication slave if you have issued a STOP SLAVE\nstatement or if the slave is highly loaded.)\n\nIn MySQL 5.5 (unlike the case in MySQL 5.1 and earlier), RESET SLAVE\ndoes not change any replication connection parameters such as master\nhost, master port, master user, or master password, which are retained\nin memory. This means that START SLAVE can be issued without requiring\na CHANGE MASTER TO statement following RESET SLAVE.\n\nIn MySQL 5.5.16 and later, you can use RESET SLAVE ALL to reset these\nconnection parameters (Bug #11809016). Connection parameters are also\nreset if the slave mysqld is shut down.\n\nIf the slave SQL thread was in the middle of replicating temporary\ntables when it was stopped, and RESET SLAVE is issued, these replicated\ntemporary tables are deleted on the slave.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/reset-slave.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/reset-slave.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (39,26,'SHOW BINARY LOGS','Syntax:\nSHOW BINARY LOGS\nSHOW MASTER LOGS\n\nLists the binary log files on the server. This statement is used as\npart of the procedure described in [HELP PURGE BINARY LOGS], that shows\nhow to determine which logs can be purged.\n\nmysql> SHOW BINARY LOGS;\n+---------------+-----------+\n| Log_name | File_size |\n+---------------+-----------+\n| binlog.000015 | 724935 |\n| binlog.000016 | 733481 |\n+---------------+-----------+\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/show-binary-logs.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/show-binary-logs.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (40,24,'POLYGON','Polygon(ls1,ls2,...)\n\nConstructs a Polygon value from a number of LineString or WKB\nLineString arguments. If any argument does not represent a LinearRing\n(that is, not a closed and simple LineString), the return value is\nNULL.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/creating-spatial-values.html#gis-mysql-specific-functions\n\n','','http://dev.mysql.com/doc/refman/5.5/en/creating-spatial-values.html#gis-mysql-specific-functions'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (41,31,'MINUTE','Syntax:\nMINUTE(time)\n\nReturns the minute for time, in the range 0 to 59.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html\n\n','mysql> SELECT MINUTE(\'2008-02-03 10:05:03\');\n -> 5\n','http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (42,31,'DAY','Syntax:\nDAY(date)\n\nDAY() is a synonym for DAYOFMONTH().\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (43,37,'MID','Syntax:\nMID(str,pos,len)\n\nMID(str,pos,len) is a synonym for SUBSTRING(str,pos,len).\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/string-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/string-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (44,14,'UUID','Syntax:\nUUID()\n\nReturns a Universal Unique Identifier (UUID) generated according to\n"DCE 1.1: Remote Procedure Call" (Appendix A) CAE (Common Applications\nEnvironment) Specifications published by The Open Group in October 1997\n(Document Number C706,\nhttp://www.opengroup.org/public/pubs/catalog/c706.htm).\n\nA UUID is designed as a number that is globally unique in space and\ntime. Two calls to UUID() are expected to generate two different\nvalues, even if these calls are performed on two separate computers\nthat are not connected to each other.\n\nA UUID is a 128-bit number represented by a utf8 string of five\nhexadecimal numbers in aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee format:\n\no The first three numbers are generated from a timestamp.\n\no The fourth number preserves temporal uniqueness in case the timestamp\n value loses monotonicity (for example, due to daylight saving time).\n\no The fifth number is an IEEE 802 node number that provides spatial\n uniqueness. A random number is substituted if the latter is not\n available (for example, because the host computer has no Ethernet\n card, or we do not know how to find the hardware address of an\n interface on your operating system). In this case, spatial uniqueness\n cannot be guaranteed. Nevertheless, a collision should have very low\n probability.\n\n Currently, the MAC address of an interface is taken into account only\n on FreeBSD and Linux. On other operating systems, MySQL uses a\n randomly generated 48-bit number.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/miscellaneous-functions.html\n\n','mysql> SELECT UUID();\n -> \'6ccd780c-baba-1026-9564-0040f4311e29\'\n','http://dev.mysql.com/doc/refman/5.5/en/miscellaneous-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (45,24,'LINESTRING','LineString(pt1,pt2,...)\n\nConstructs a LineString value from a number of Point or WKB Point\narguments. If the number of arguments is less than two, the return\nvalue is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/creating-spatial-values.html#gis-mysql-specific-functions\n\n','','http://dev.mysql.com/doc/refman/5.5/en/creating-spatial-values.html#gis-mysql-specific-functions'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (46,14,'SLEEP','Syntax:\nSLEEP(duration)\n\nSleeps (pauses) for the number of seconds given by the duration\nargument, then returns 0. If SLEEP() is interrupted, it returns 1. The\nduration may have a fractional part given in microseconds.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/miscellaneous-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/miscellaneous-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (47,17,'CONNECTION_ID','Syntax:\nCONNECTION_ID()\n\nReturns the connection ID (thread ID) for the connection. Every\nconnection has an ID that is unique among the set of currently\nconnected clients.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/information-functions.html\n\n','mysql> SELECT CONNECTION_ID();\n -> 23786\n','http://dev.mysql.com/doc/refman/5.5/en/information-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (48,27,'DELETE','Syntax:\nSingle-table syntax:\n\nDELETE [LOW_PRIORITY] [QUICK] [IGNORE] FROM tbl_name\n [WHERE where_condition]\n [ORDER BY ...]\n [LIMIT row_count]\n\nMultiple-table syntax:\n\nDELETE [LOW_PRIORITY] [QUICK] [IGNORE]\n tbl_name[.*] [, tbl_name[.*]] ...\n FROM table_references\n [WHERE where_condition]\n\nOr:\n\nDELETE [LOW_PRIORITY] [QUICK] [IGNORE]\n FROM tbl_name[.*] [, tbl_name[.*]] ...\n USING table_references\n [WHERE where_condition]\n\nFor the single-table syntax, the DELETE statement deletes rows from\ntbl_name and returns a count of the number of deleted rows. This count\ncan be obtained by calling the ROW_COUNT() function (see\nhttp://dev.mysql.com/doc/refman/5.5/en/information-functions.html). The\nWHERE clause, if given, specifies the conditions that identify which\nrows to delete. With no WHERE clause, all rows are deleted. If the\nORDER BY clause is specified, the rows are deleted in the order that is\nspecified. The LIMIT clause places a limit on the number of rows that\ncan be deleted.\n\nFor the multiple-table syntax, DELETE deletes from each tbl_name the\nrows that satisfy the conditions. In this case, ORDER BY and LIMIT\ncannot be used.\n\nwhere_condition is an expression that evaluates to true for each row to\nbe deleted. It is specified as described in\nhttp://dev.mysql.com/doc/refman/5.5/en/select.html.\n\nCurrently, you cannot delete from a table and select from the same\ntable in a subquery.\n\nYou need the DELETE privilege on a table to delete rows from it. You\nneed only the SELECT privilege for any columns that are only read, such\nas those named in the WHERE clause.\n\nAs stated, a DELETE statement with no WHERE clause deletes all rows. A\nfaster way to do this, when you do not need to know the number of\ndeleted rows, is to use TRUNCATE TABLE. However, within a transaction\nor if you have a lock on the table, TRUNCATE TABLE cannot be used\nwhereas DELETE can. See [HELP TRUNCATE TABLE], and [HELP LOCK].\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/delete.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/delete.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (49,4,'ROUND','Syntax:\nROUND(X), ROUND(X,D)\n\nRounds the argument X to D decimal places. The rounding algorithm\ndepends on the data type of X. D defaults to 0 if not specified. D can\nbe negative to cause D digits left of the decimal point of the value X\nto become zero.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/mathematical-functions.html\n\n','mysql> SELECT ROUND(-1.23);\n -> -1\nmysql> SELECT ROUND(-1.58);\n -> -2\nmysql> SELECT ROUND(1.58);\n -> 2\nmysql> SELECT ROUND(1.298, 1);\n -> 1.3\nmysql> SELECT ROUND(1.298, 0);\n -> 1\nmysql> SELECT ROUND(23.298, -1);\n -> 20\n','http://dev.mysql.com/doc/refman/5.5/en/mathematical-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (50,7,'NULLIF','Syntax:\nNULLIF(expr1,expr2)\n\nReturns NULL if expr1 = expr2 is true, otherwise returns expr1. This is\nthe same as CASE WHEN expr1 = expr2 THEN NULL ELSE expr1 END.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/control-flow-functions.html\n\n','mysql> SELECT NULLIF(1,1);\n -> NULL\nmysql> SELECT NULLIF(1,2);\n -> 1\n','http://dev.mysql.com/doc/refman/5.5/en/control-flow-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (51,23,'CLOSE','Syntax:\nCLOSE cursor_name\n\nThis statement closes a previously opened cursor. For an example, see\nhttp://dev.mysql.com/doc/refman/5.5/en/cursors.html.\n\nAn error occurs if the cursor is not open.\n\nIf not closed explicitly, a cursor is closed at the end of the BEGIN\n... END block in which it was declared.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/close.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/close.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (52,8,'STOP SLAVE','Syntax:\nSTOP SLAVE [thread_types]\n\nthread_types:\n [thread_type [, thread_type] ... ]\n\nthread_type: IO_THREAD | SQL_THREAD\n\nStops the slave threads. STOP SLAVE requires the SUPER privilege.\nRecommended best practice is to execute STOP SLAVE on the slave before\nstopping the slave server (see\nhttp://dev.mysql.com/doc/refman/5.5/en/server-shutdown.html, for more\ninformation).\n\nWhen using the row-based logging format: You should execute STOP SLAVE\non the slave prior to shutting down the slave server if you are\nreplicating any tables that use a nontransactional storage engine (see\nthe Note later in this section). In MySQL 5.5.9 and later, you can also\nuse STOP SLAVE SQL_THREAD for this purpose.\n\nLike START SLAVE, this statement may be used with the IO_THREAD and\nSQL_THREAD options to name the thread or threads to be stopped.\n\n*Note*: In MySQL 5.5, STOP SLAVE waits until the current replication\nevent group affecting one or more non-transactional tables has finished\nexecuting (if there is any such replication group), or until the user\nissues a KILL QUERY or KILL CONNECTION statement. (Bug #319, Bug\n#38205)\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/stop-slave.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/stop-slave.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (53,31,'TIMEDIFF','Syntax:\nTIMEDIFF(expr1,expr2)\n\nTIMEDIFF() returns expr1 - expr2 expressed as a time value. expr1 and\nexpr2 are time or date-and-time expressions, but both must be of the\nsame type.\n\nThe result returned by TIMEDIFF() is limited to the range allowed for\nTIME values. Alternatively, you can use either of the functions\nTIMESTAMPDIFF() and UNIX_TIMESTAMP(), both of which return integers.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html\n\n','mysql> SELECT TIMEDIFF(\'2000:01:01 00:00:00\',\n -> \'2000:01:01 00:00:00.000001\');\n -> \'-00:00:00.000001\'\nmysql> SELECT TIMEDIFF(\'2008-12-31 23:59:59.000001\',\n -> \'2008-12-30 01:01:01.000002\');\n -> \'46:58:57.999999\'\n','http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (54,37,'REPLACE FUNCTION','Syntax:\nREPLACE(str,from_str,to_str)\n\nReturns the string str with all occurrences of the string from_str\nreplaced by the string to_str. REPLACE() performs a case-sensitive\nmatch when searching for from_str.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/string-functions.html\n\n','mysql> SELECT REPLACE(\'www.mysql.com\', \'w\', \'Ww\');\n -> \'WwWwWw.mysql.com\'\n','http://dev.mysql.com/doc/refman/5.5/en/string-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (55,28,'USE','Syntax:\nUSE db_name\n\nThe USE db_name statement tells MySQL to use the db_name database as\nthe default (current) database for subsequent statements. The database\nremains the default until the end of the session or another USE\nstatement is issued:\n\nUSE db1;\nSELECT COUNT(*) FROM mytable; # selects from db1.mytable\nUSE db2;\nSELECT COUNT(*) FROM mytable; # selects from db2.mytable\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/use.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/use.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (56,3,'LINEFROMTEXT','LineFromText(wkt[,srid]), LineStringFromText(wkt[,srid])\n\nConstructs a LINESTRING value using its WKT representation and SRID.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/creating-spatial-values.html#gis-wkt-functions\n\n','','http://dev.mysql.com/doc/refman/5.5/en/creating-spatial-values.html#gis-wkt-functions'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (57,7,'CASE OPERATOR','Syntax:\nCASE value WHEN [compare_value] THEN result [WHEN [compare_value] THEN\nresult ...] [ELSE result] END\n\nCASE WHEN [condition] THEN result [WHEN [condition] THEN result ...]\n[ELSE result] END\n\nThe first version returns the result where value=compare_value. The\nsecond version returns the result for the first condition that is true.\nIf there was no matching result value, the result after ELSE is\nreturned, or NULL if there is no ELSE part.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/control-flow-functions.html\n\n','mysql> SELECT CASE 1 WHEN 1 THEN \'one\'\n -> WHEN 2 THEN \'two\' ELSE \'more\' END;\n -> \'one\'\nmysql> SELECT CASE WHEN 1>0 THEN \'true\' ELSE \'false\' END;\n -> \'true\'\nmysql> SELECT CASE BINARY \'B\'\n -> WHEN \'a\' THEN 1 WHEN \'b\' THEN 2 END;\n -> NULL\n','http://dev.mysql.com/doc/refman/5.5/en/control-flow-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (58,26,'SHOW MASTER STATUS','Syntax:\nSHOW MASTER STATUS\n\nThis statement provides status information about the binary log files\nof the master. It requires either the SUPER or REPLICATION CLIENT\nprivilege.\n\nExample:\n\nmysql> SHOW MASTER STATUS;\n+---------------+----------+--------------+------------------+\n| File | Position | Binlog_Do_DB | Binlog_Ignore_DB |\n+---------------+----------+--------------+------------------+\n| mysql-bin.003 | 73 | test | manual,mysql |\n+---------------+----------+--------------+------------------+\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/show-master-status.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/show-master-status.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (59,31,'ADDTIME','Syntax:\nADDTIME(expr1,expr2)\n\nADDTIME() adds expr2 to expr1 and returns the result. expr1 is a time\nor datetime expression, and expr2 is a time expression.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html\n\n','mysql> SELECT ADDTIME(\'2007-12-31 23:59:59.999999\', \'1 1:1:1.000002\');\n -> \'2008-01-02 01:01:01.000001\'\nmysql> SELECT ADDTIME(\'01:00:00.999999\', \'02:00:00.999998\');\n -> \'03:00:01.999997\'\n','http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (60,34,'SPATIAL','For MyISAM tables, MySQL can create spatial indexes using syntax\nsimilar to that for creating regular indexes, but extended with the\nSPATIAL keyword. Currently, columns in spatial indexes must be declared\nNOT NULL. The following examples demonstrate how to create spatial\nindexes:\n\no With CREATE TABLE:\n\nCREATE TABLE geom (g GEOMETRY NOT NULL, SPATIAL INDEX(g)) ENGINE=MyISAM;\n\no With ALTER TABLE:\n\nALTER TABLE geom ADD SPATIAL INDEX(g);\n\no With CREATE INDEX:\n\nCREATE SPATIAL INDEX sp_index ON geom (g);\n\nFor MyISAM tables, SPATIAL INDEX creates an R-tree index. For storage\nengines that support nonspatial indexing of spatial columns, the engine\ncreates a B-tree index. A B-tree index on spatial values will be useful\nfor exact-value lookups, but not for range scans.\n\nFor more information on indexing spatial columns, see [HELP CREATE\nINDEX].\n\nTo drop spatial indexes, use ALTER TABLE or DROP INDEX:\n\no With ALTER TABLE:\n\nALTER TABLE geom DROP INDEX g;\n\no With DROP INDEX:\n\nDROP INDEX sp_index ON geom;\n\nExample: Suppose that a table geom contains more than 32,000\ngeometries, which are stored in the column g of type GEOMETRY. The\ntable also has an AUTO_INCREMENT column fid for storing object ID\nvalues.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/creating-spatial-indexes.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/creating-spatial-indexes.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (61,31,'TO_SECONDS','Syntax:\nTO_SECONDS(expr)\n\nGiven a date or datetime expr, returns a the number of seconds since\nthe year 0. If expr is not a valid date or datetime value, returns\nNULL.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html\n\n','mysql> SELECT TO_SECONDS(950501);\n -> 62966505600\nmysql> SELECT TO_SECONDS(\'2009-11-29\');\n -> 63426672000\nmysql> SELECT TO_SECONDS(\'2009-11-29 13:43:32\');\n -> 63426721412\nmysql> SELECT TO_SECONDS( NOW() );\n -> 63426721458\n','http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (62,31,'TIMESTAMPDIFF','Syntax:\nTIMESTAMPDIFF(unit,datetime_expr1,datetime_expr2)\n\nReturns datetime_expr2 - datetime_expr1, where datetime_expr1 and\ndatetime_expr2 are date or datetime expressions. One expression may be\na date and the other a datetime; a date value is treated as a datetime\nhaving the time part \'00:00:00\' where necessary. The unit for the\nresult (an integer) is given by the unit argument. The legal values for\nunit are the same as those listed in the description of the\nTIMESTAMPADD() function.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html\n\n','mysql> SELECT TIMESTAMPDIFF(MONTH,\'2003-02-01\',\'2003-05-01\');\n -> 3\nmysql> SELECT TIMESTAMPDIFF(YEAR,\'2002-05-01\',\'2001-01-01\');\n -> -1\nmysql> SELECT TIMESTAMPDIFF(MINUTE,\'2003-02-01\',\'2003-05-01 12:05:55\');\n -> 128885\n','http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (63,37,'UPPER','Syntax:\nUPPER(str)\n\nReturns the string str with all characters changed to uppercase\naccording to the current character set mapping. The default is latin1\n(cp1252 West European).\n\nmysql> SELECT UPPER(\'Hej\');\n -> \'HEJ\'\n\nSee the description of LOWER() for information that also applies to\nUPPER(), such as information about how to perform lettercase conversion\nof binary strings (BINARY, VARBINARY, BLOB) for which these functions\nare ineffective.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/string-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/string-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (64,31,'FROM_UNIXTIME','Syntax:\nFROM_UNIXTIME(unix_timestamp), FROM_UNIXTIME(unix_timestamp,format)\n\nReturns a representation of the unix_timestamp argument as a value in\n\'YYYY-MM-DD HH:MM:SS\' or YYYYMMDDHHMMSS.uuuuuu format, depending on\nwhether the function is used in a string or numeric context. The value\nis expressed in the current time zone. unix_timestamp is an internal\ntimestamp value such as is produced by the UNIX_TIMESTAMP() function.\n\nIf format is given, the result is formatted according to the format\nstring, which is used the same way as listed in the entry for the\nDATE_FORMAT() function.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html\n\n','mysql> SELECT FROM_UNIXTIME(1196440219);\n -> \'2007-11-30 10:30:19\'\nmysql> SELECT FROM_UNIXTIME(1196440219) + 0;\n -> 20071130103019.000000\nmysql> SELECT FROM_UNIXTIME(UNIX_TIMESTAMP(),\n -> \'%Y %D %M %h:%i:%s %x\');\n -> \'2007 30th November 10:30:59 2007\'\n','http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (65,22,'MEDIUMBLOB','MEDIUMBLOB\n\nA BLOB column with a maximum length of 16,777,215 (224 - 1) bytes. Each\nMEDIUMBLOB value is stored using a 3-byte length prefix that indicates\nthe number of bytes in the value.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/string-type-overview.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (66,12,'SHA2','Syntax:\nSHA2(str, hash_length)\n\nCalculates the SHA-2 family of hash functions (SHA-224, SHA-256,\nSHA-384, and SHA-512). The first argument is the cleartext string to be\nhashed. The second argument indicates the desired bit length of the\nresult, which must have a value of 224, 256, 384, 512, or 0 (which is\nequivalent to 256). If either argument is NULL or the hash length is\nnot one of the permitted values, the return value is NULL. Otherwise,\nthe function result is a hash value containing the desired number of\nbits. See the notes at the beginning of this section about storing hash\nvalues efficiently.\n\nAs of MySQL 5.5.6, the return value is a nonbinary string in the\nconnection character set. Before 5.5.6, the return value is a binary\nstring; see the notes at the beginning of this section about using the\nvalue as a nonbinary string.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/encryption-functions.html\n\n','mysql> SELECT SHA2(\'abc\', 224);\n -> \'23097d223405d8228642a477bda255b32aadbce4bda0b3f7e36c9da7\'\n','http://dev.mysql.com/doc/refman/5.5/en/encryption-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (67,7,'IFNULL','Syntax:\nIFNULL(expr1,expr2)\n\nIf expr1 is not NULL, IFNULL() returns expr1; otherwise it returns\nexpr2. IFNULL() returns a numeric or string value, depending on the\ncontext in which it is used.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/control-flow-functions.html\n\n','mysql> SELECT IFNULL(1,0);\n -> 1\nmysql> SELECT IFNULL(NULL,10);\n -> 10\nmysql> SELECT IFNULL(1/0,10);\n -> 10\nmysql> SELECT IFNULL(1/0,\'yes\');\n -> \'yes\'\n','http://dev.mysql.com/doc/refman/5.5/en/control-flow-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (68,26,'SHOW FUNCTION CODE','Syntax:\nSHOW FUNCTION CODE func_name\n\nThis statement is similar to SHOW PROCEDURE CODE but for stored\nfunctions. See [HELP SHOW PROCEDURE CODE].\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/show-function-code.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/show-function-code.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (69,26,'SHOW ERRORS','Syntax:\nSHOW ERRORS [LIMIT [offset,] row_count]\nSHOW COUNT(*) ERRORS\n\nThis statement is similar to SHOW WARNINGS, except that it displays\ninformation only for errors, rather than for errors, warnings, and\nnotes.\n\nThe LIMIT clause has the same syntax as for the SELECT statement. See\nhttp://dev.mysql.com/doc/refman/5.5/en/select.html.\n\nThe SHOW COUNT(*) ERRORS statement displays the number of errors. You\ncan also retrieve this number from the error_count variable:\n\nSHOW COUNT(*) ERRORS;\nSELECT @@error_count;\n\nSHOW ERRORS and error_count apply only to errors, not warnings or\nnotes. In other respects, they are similar to SHOW WARNINGS and\nwarning_count. In particular, SHOW ERRORS cannot display information\nfor more than max_error_count messages, and error_count can exceed the\nvalue of max_error_count if the number of errors exceeds\nmax_error_count.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/show-errors.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/show-errors.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (70,18,'LEAST','Syntax:\nLEAST(value1,value2,...)\n\nWith two or more arguments, returns the smallest (minimum-valued)\nargument. The arguments are compared using the following rules:\n\no If any argument is NULL, the result is NULL. No comparison is needed.\n\no If the return value is used in an INTEGER context or all arguments\n are integer-valued, they are compared as integers.\n\no If the return value is used in a REAL context or all arguments are\n real-valued, they are compared as reals.\n\no If the arguments comprise a mix of numbers and strings, they are\n compared as numbers.\n\no If any argument is a nonbinary (character) string, the arguments are\n compared as nonbinary strings.\n\no In all other cases, the arguments are compared as binary strings.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/comparison-operators.html\n\n','mysql> SELECT LEAST(2,0);\n -> 0\nmysql> SELECT LEAST(34.0,3.0,5.0,767.0);\n -> 3.0\nmysql> SELECT LEAST(\'B\',\'A\',\'C\');\n -> \'A\'\n','http://dev.mysql.com/doc/refman/5.5/en/comparison-operators.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (71,18,'=','=\n\nEqual:\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/comparison-operators.html\n\n','mysql> SELECT 1 = 0;\n -> 0\nmysql> SELECT \'0\' = 0;\n -> 1\nmysql> SELECT \'0.0\' = 0;\n -> 1\nmysql> SELECT \'0.01\' = 0;\n -> 0\nmysql> SELECT \'.01\' = 0.01;\n -> 1\n','http://dev.mysql.com/doc/refman/5.5/en/comparison-operators.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (72,37,'REVERSE','Syntax:\nREVERSE(str)\n\nReturns the string str with the order of the characters reversed.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/string-functions.html\n\n','mysql> SELECT REVERSE(\'abc\');\n -> \'cba\'\n','http://dev.mysql.com/doc/refman/5.5/en/string-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (73,18,'ISNULL','Syntax:\nISNULL(expr)\n\nIf expr is NULL, ISNULL() returns 1, otherwise it returns 0.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/comparison-operators.html\n\n','mysql> SELECT ISNULL(1+1);\n -> 0\nmysql> SELECT ISNULL(1/0);\n -> 1\n','http://dev.mysql.com/doc/refman/5.5/en/comparison-operators.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (74,22,'BINARY','BINARY(M)\n\nThe BINARY type is similar to the CHAR type, but stores binary byte\nstrings rather than nonbinary character strings. M represents the\ncolumn length in bytes.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/string-type-overview.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (75,22,'BLOB DATA TYPE','A BLOB is a binary large object that can hold a variable amount of\ndata. The four BLOB types are TINYBLOB, BLOB, MEDIUMBLOB, and LONGBLOB.\nThese differ only in the maximum length of the values they can hold.\nThe four TEXT types are TINYTEXT, TEXT, MEDIUMTEXT, and LONGTEXT. These\ncorrespond to the four BLOB types and have the same maximum lengths and\nstorage requirements. See\nhttp://dev.mysql.com/doc/refman/5.5/en/storage-requirements.html.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/blob.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/blob.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (76,36,'BOUNDARY','Boundary(g)\n\nReturns a geometry that is the closure of the combinatorial boundary of\nthe geometry value g.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/geometry-property-functions.html#general-geometry-property-functions\n\n','','http://dev.mysql.com/doc/refman/5.5/en/geometry-property-functions.html#general-geometry-property-functions'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (77,10,'CREATE USER','Syntax:\nCREATE USER user_specification\n [, user_specification] ...\n\nuser_specification:\n user\n [\n IDENTIFIED BY [PASSWORD] \'password\'\n | IDENTIFIED WITH auth_plugin [AS \'auth_string\']\n ]\n\nThe CREATE USER statement creates new MySQL accounts. To use it, you\nmust have the global CREATE USER privilege or the INSERT privilege for\nthe mysql database. For each account, CREATE USER creates a new row in\nthe mysql.user table and assigns the account no privileges. An error\noccurs if the account already exists.\n\nEach account name uses the format described in\nhttp://dev.mysql.com/doc/refman/5.5/en/account-names.html. For example:\n\nCREATE USER \'jeffrey\'@\'localhost\' IDENTIFIED BY \'mypass\';\n\nIf you specify only the user name part of the account name, a host name\npart of \'%\' is used.\n\nThe user specification may indicate how the user should authenticate\nwhen connecting to the server:\n\no To enable the user to connect with no password (which is insecure),\n include no IDENTIFIED BY clause:\n\nCREATE USER \'jeffrey\'@\'localhost\';\n\n In this case, the account uses built-in authentication and clients\n must provide no password.\n\no To assign a password, use IDENTIFIED BY with the literal plaintext\n password value:\n\nCREATE USER \'jeffrey\'@\'localhost\' IDENTIFIED BY \'mypass\';\n\n The account uses built-in authentication and clients must match the\n given password.\n\no To avoid specifying the plaintext password if you know its hash value\n (the value that PASSWORD() would return for the password), specify\n the hash value preceded by the keyword PASSWORD:\n\nCREATE USER \'jeffrey\'@\'localhost\'\nIDENTIFIED BY PASSWORD \'*90E462C37378CED12064BB3388827D2BA3A9B689\';\n\n The account uses built-in authentication and clients must match the\n given password.\n\no To authenticate the account using a specific authentication plugin,\n use IDENTIFIED WITH, where auth_plugin is the plugin name. It can be\n an unquoted name or a quoted string literal. \'auth_string\' is an\n optional quoted string literal to pass to the plugin. The plugin\n interprets the meaning of the string, so its format is plugin\n specific. Consult the documentation for a given plugin for\n information about the authentication string values it accepts.\n\nCREATE USER \'jeffrey\'@\'localhost\'\nIDENTIFIED WITH my_auth_plugin;\n\n For connections that use this account, the server invokes the named\n plugin and clients must provide credentials as required for the\n authentication method that the plugin implements. If the server\n cannot find the plugin, either at account-creation time or connect\n time, an error occurs. IDENTIFIED WITH can be used as of MySQL 5.5.7.\n\nThe IDENTIFIED BY and IDENTIFIED WITH clauses are mutually exclusive,\nso at most one of them can be specified for a given user.\n\nFor additional information about setting passwords, see\nhttp://dev.mysql.com/doc/refman/5.5/en/assigning-passwords.html.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/create-user.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/create-user.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (78,24,'POINT','Point(x,y)\n\nConstructs a Point using its coordinates.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/creating-spatial-values.html#gis-mysql-specific-functions\n\n','','http://dev.mysql.com/doc/refman/5.5/en/creating-spatial-values.html#gis-mysql-specific-functions'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (79,17,'CURRENT_USER','Syntax:\nCURRENT_USER, CURRENT_USER()\n\nReturns the user name and host name combination for the MySQL account\nthat the server used to authenticate the current client. This account\ndetermines your access privileges. The return value is a string in the\nutf8 character set.\n\nThe value of CURRENT_USER() can differ from the value of USER().\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/information-functions.html\n\n','mysql> SELECT USER();\n -> \'davida@localhost\'\nmysql> SELECT * FROM mysql.user;\nERROR 1044: Access denied for user \'\'@\'localhost\' to\ndatabase \'mysql\'\nmysql> SELECT CURRENT_USER();\n -> \'@localhost\'\n','http://dev.mysql.com/doc/refman/5.5/en/information-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (80,37,'LCASE','Syntax:\nLCASE(str)\n\nLCASE() is a synonym for LOWER().\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/string-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/string-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (81,18,'<=','Syntax:\n<=\n\nLess than or equal:\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/comparison-operators.html\n\n','mysql> SELECT 0.1 <= 2;\n -> 1\n','http://dev.mysql.com/doc/refman/5.5/en/comparison-operators.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (82,26,'SHOW PROFILES','Syntax:\nSHOW PROFILES\n\nThe SHOW PROFILES statement, together with SHOW PROFILE, displays\nprofiling information that indicates resource usage for statements\nexecuted during the course of the current session. For more\ninformation, see [HELP SHOW PROFILE].\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/show-profiles.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/show-profiles.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (83,27,'UPDATE','Syntax:\nSingle-table syntax:\n\nUPDATE [LOW_PRIORITY] [IGNORE] table_reference\n SET col_name1={expr1|DEFAULT} [, col_name2={expr2|DEFAULT}] ...\n [WHERE where_condition]\n [ORDER BY ...]\n [LIMIT row_count]\n\nMultiple-table syntax:\n\nUPDATE [LOW_PRIORITY] [IGNORE] table_references\n SET col_name1={expr1|DEFAULT} [, col_name2={expr2|DEFAULT}] ...\n [WHERE where_condition]\n\nFor the single-table syntax, the UPDATE statement updates columns of\nexisting rows in the named table with new values. The SET clause\nindicates which columns to modify and the values they should be given.\nEach value can be given as an expression, or the keyword DEFAULT to set\na column explicitly to its default value. The WHERE clause, if given,\nspecifies the conditions that identify which rows to update. With no\nWHERE clause, all rows are updated. If the ORDER BY clause is\nspecified, the rows are updated in the order that is specified. The\nLIMIT clause places a limit on the number of rows that can be updated.\n\nFor the multiple-table syntax, UPDATE updates rows in each table named\nin table_references that satisfy the conditions. In this case, ORDER BY\nand LIMIT cannot be used.\n\nwhere_condition is an expression that evaluates to true for each row to\nbe updated. For expression syntax, see\nhttp://dev.mysql.com/doc/refman/5.5/en/expressions.html.\n\ntable_references and where_condition are is specified as described in\nhttp://dev.mysql.com/doc/refman/5.5/en/select.html.\n\nYou need the UPDATE privilege only for columns referenced in an UPDATE\nthat are actually updated. You need only the SELECT privilege for any\ncolumns that are read but not modified.\n\nThe UPDATE statement supports the following modifiers:\n\no With the LOW_PRIORITY keyword, execution of the UPDATE is delayed\n until no other clients are reading from the table. This affects only\n storage engines that use only table-level locking (such as MyISAM,\n MEMORY, and MERGE).\n\no With the IGNORE keyword, the update statement does not abort even if\n errors occur during the update. Rows for which duplicate-key\n conflicts occur are not updated. Rows for which columns are updated\n to values that would cause data conversion errors are updated to the\n closest valid values instead.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/update.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/update.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (84,18,'IS NOT NULL','Syntax:\nIS NOT NULL\n\nTests whether a value is not NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/comparison-operators.html\n\n','mysql> SELECT 1 IS NOT NULL, 0 IS NOT NULL, NULL IS NOT NULL;\n -> 1, 1, 0\n','http://dev.mysql.com/doc/refman/5.5/en/comparison-operators.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (85,23,'CASE STATEMENT','Syntax:\nCASE case_value\n WHEN when_value THEN statement_list\n [WHEN when_value THEN statement_list] ...\n [ELSE statement_list]\nEND CASE\n\nOr:\n\nCASE\n WHEN search_condition THEN statement_list\n [WHEN search_condition THEN statement_list] ...\n [ELSE statement_list]\nEND CASE\n\nThe CASE statement for stored programs implements a complex conditional\nconstruct.\n\n*Note*: There is also a CASE expression, which differs from the CASE\nstatement described here. See\nhttp://dev.mysql.com/doc/refman/5.5/en/control-flow-functions.html. The\nCASE statement cannot have an ELSE NULL clause, and it is terminated\nwith END CASE instead of END.\n\nFor the first syntax, case_value is an expression. This value is\ncompared to the when_value expression in each WHEN clause until one of\nthem is equal. When an equal when_value is found, the corresponding\nTHEN clause statement_list executes. If no when_value is equal, the\nELSE clause statement_list executes, if there is one.\n\nThis syntax cannot be used to test for equality with NULL because NULL\n= NULL is false. See\nhttp://dev.mysql.com/doc/refman/5.5/en/working-with-null.html.\n\nFor the second syntax, each WHEN clause search_condition expression is\nevaluated until one is true, at which point its corresponding THEN\nclause statement_list executes. If no search_condition is equal, the\nELSE clause statement_list executes, if there is one.\n\nIf no when_value or search_condition matches the value tested and the\nCASE statement contains no ELSE clause, a Case not found for CASE\nstatement error results.\n\nEach statement_list consists of one or more SQL statements; an empty\nstatement_list is not permitted.\n\nTo handle situations where no value is matched by any WHEN clause, use\nan ELSE containing an empty BEGIN ... END block, as shown in this\nexample. (The indentation used here in the ELSE clause is for purposes\nof clarity only, and is not otherwise significant.)\n\nDELIMITER |\n\nCREATE PROCEDURE p()\n BEGIN\n DECLARE v INT DEFAULT 1;\n\n CASE v\n WHEN 2 THEN SELECT v;\n WHEN 3 THEN SELECT 0;\n ELSE\n BEGIN\n END;\n END CASE;\n END;\n |\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/case.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/case.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (86,8,'EXECUTE STATEMENT','Syntax:\nEXECUTE stmt_name\n [USING @var_name [, @var_name] ...]\n\nAfter preparing a statement with PREPARE, you execute it with an\nEXECUTE statement that refers to the prepared statement name. If the\nprepared statement contains any parameter markers, you must supply a\nUSING clause that lists user variables containing the values to be\nbound to the parameters. Parameter values can be supplied only by user\nvariables, and the USING clause must name exactly as many variables as\nthe number of parameter markers in the statement.\n\nYou can execute a given prepared statement multiple times, passing\ndifferent variables to it or setting the variables to different values\nbefore each execution.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/execute.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/execute.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (87,39,'DROP INDEX','Syntax:\nDROP [ONLINE|OFFLINE] INDEX index_name ON tbl_name\n\nDROP INDEX drops the index named index_name from the table tbl_name.\nThis statement is mapped to an ALTER TABLE statement to drop the index.\nSee [HELP ALTER TABLE].\n\nTo drop a primary key, the index name is always PRIMARY, which must be\nspecified as a quoted identifier because PRIMARY is a reserved word:\n\nDROP INDEX `PRIMARY` ON t;\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/drop-index.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/drop-index.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (88,37,'MATCH AGAINST','Syntax:\nMATCH (col1,col2,...) AGAINST (expr [search_modifier])\n\nMySQL has support for full-text indexing and searching:\n\no A full-text index in MySQL is an index of type FULLTEXT.\n\no Full-text indexes can be used only with MyISAM tables, and can be\n created only for CHAR, VARCHAR, or TEXT columns.\n\no A FULLTEXT index definition can be given in the CREATE TABLE\n statement when a table is created, or added later using ALTER TABLE\n or CREATE INDEX.\n\no For large data sets, it is much faster to load your data into a table\n that has no FULLTEXT index and then create the index after that, than\n to load data into a table that has an existing FULLTEXT index.\n\nFull-text searching is performed using MATCH() ... AGAINST syntax.\nMATCH() takes a comma-separated list that names the columns to be\nsearched. AGAINST takes a string to search for, and an optional\nmodifier that indicates what type of search to perform. The search\nstring must be a literal string, not a variable or a column name. There\nare three types of full-text searches:\n\no A natural language search interprets the search string as a phrase in\n natural human language (a phrase in free text). There are no special\n operators. The stopword list applies. In addition, words that are\n present in 50% or more of the rows are considered common and do not\n match.\n\n Full-text searches are natural language searches if the IN NATURAL\n LANGUAGE MODE modifier is given or if no modifier is given. For more\n information, see\n http://dev.mysql.com/doc/refman/5.5/en/fulltext-natural-language.html\n .\n\no A boolean search interprets the search string using the rules of a\n special query language. The string contains the words to search for.\n It can also contain operators that specify requirements such that a\n word must be present or absent in matching rows, or that it should be\n weighted higher or lower than usual. Common words such as "some" or\n "then" are stopwords and do not match if present in the search\n string. The IN BOOLEAN MODE modifier specifies a boolean search. For\n more information, see\n http://dev.mysql.com/doc/refman/5.5/en/fulltext-boolean.html.\n\no A query expansion search is a modification of a natural language\n search. The search string is used to perform a natural language\n search. Then words from the most relevant rows returned by the search\n are added to the search string and the search is done again. The\n query returns the rows from the second search. The IN NATURAL\n LANGUAGE MODE WITH QUERY EXPANSION or WITH QUERY EXPANSION modifier\n specifies a query expansion search. For more information, see\n http://dev.mysql.com/doc/refman/5.5/en/fulltext-query-expansion.html.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/fulltext-search.html\n\n','mysql> SELECT id, body, MATCH (title,body) AGAINST\n -> (\'Security implications of running MySQL as root\'\n -> IN NATURAL LANGUAGE MODE) AS score\n -> FROM articles WHERE MATCH (title,body) AGAINST\n -> (\'Security implications of running MySQL as root\'\n -> IN NATURAL LANGUAGE MODE);\n+----+-------------------------------------+-----------------+\n| id | body | score |\n+----+-------------------------------------+-----------------+\n| 4 | 1. Never run mysqld as root. 2. ... | 1.5219271183014 |\n| 6 | When configured properly, MySQL ... | 1.3114095926285 |\n+----+-------------------------------------+-----------------+\n2 rows in set (0.00 sec)\n','http://dev.mysql.com/doc/refman/5.5/en/fulltext-search.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (89,39,'CREATE EVENT','Syntax:\nCREATE\n [DEFINER = { user | CURRENT_USER }]\n EVENT\n [IF NOT EXISTS]\n event_name\n ON SCHEDULE schedule\n [ON COMPLETION [NOT] PRESERVE]\n [ENABLE | DISABLE | DISABLE ON SLAVE]\n [COMMENT \'comment\']\n DO event_body;\n\nschedule:\n AT timestamp [+ INTERVAL interval] ...\n | EVERY interval\n [STARTS timestamp [+ INTERVAL interval] ...]\n [ENDS timestamp [+ INTERVAL interval] ...]\n\ninterval:\n quantity {YEAR | QUARTER | MONTH | DAY | HOUR | MINUTE |\n WEEK | SECOND | YEAR_MONTH | DAY_HOUR | DAY_MINUTE |\n DAY_SECOND | HOUR_MINUTE | HOUR_SECOND | MINUTE_SECOND}\n\nThis statement creates and schedules a new event. The event will not\nrun unless the Event Scheduler is enabled. For information about\nchecking Event Scheduler status and enabling it if necessary, see\nhttp://dev.mysql.com/doc/refman/5.5/en/events-configuration.html.\n\nCREATE EVENT requires the EVENT privilege for the schema in which the\nevent is to be created. It might also require the SUPER privilege,\ndepending on the DEFINER value, as described later in this section.\n\nThe minimum requirements for a valid CREATE EVENT statement are as\nfollows:\n\no The keywords CREATE EVENT plus an event name, which uniquely\n identifies the event in a database schema.\n\no An ON SCHEDULE clause, which determines when and how often the event\n executes.\n\no A DO clause, which contains the SQL statement to be executed by an\n event.\n\nThis is an example of a minimal CREATE EVENT statement:\n\nCREATE EVENT myevent\n ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR\n DO\n UPDATE myschema.mytable SET mycol = mycol + 1;\n\nThe previous statement creates an event named myevent. This event\nexecutes once---one hour following its creation---by running an SQL\nstatement that increments the value of the myschema.mytable table\'s\nmycol column by 1.\n\nThe event_name must be a valid MySQL identifier with a maximum length\nof 64 characters. Event names are not case sensitive, so you cannot\nhave two events named myevent and MyEvent in the same schema. In\ngeneral, the rules governing event names are the same as those for\nnames of stored routines. See\nhttp://dev.mysql.com/doc/refman/5.5/en/identifiers.html.\n\nAn event is associated with a schema. If no schema is indicated as part\nof event_name, the default (current) schema is assumed. To create an\nevent in a specific schema, qualify the event name with a schema using\nschema_name.event_name syntax.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/create-event.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/create-event.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (90,4,'ABS','Syntax:\nABS(X)\n\nReturns the absolute value of X.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/mathematical-functions.html\n\n','mysql> SELECT ABS(2);\n -> 2\nmysql> SELECT ABS(-32);\n -> 32\n','http://dev.mysql.com/doc/refman/5.5/en/mathematical-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (91,32,'POLYFROMWKB','PolyFromWKB(wkb[,srid]), PolygonFromWKB(wkb[,srid])\n\nConstructs a POLYGON value using its WKB representation and SRID.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/creating-spatial-values.html#gis-wkb-functions\n\n','','http://dev.mysql.com/doc/refman/5.5/en/creating-spatial-values.html#gis-wkb-functions'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (92,37,'NOT LIKE','Syntax:\nexpr NOT LIKE pat [ESCAPE \'escape_char\']\n\nThis is the same as NOT (expr LIKE pat [ESCAPE \'escape_char\']).\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/string-comparison-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/string-comparison-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (93,37,'SPACE','Syntax:\nSPACE(N)\n\nReturns a string consisting of N space characters.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/string-functions.html\n\n','mysql> SELECT SPACE(6);\n -> \' \'\n','http://dev.mysql.com/doc/refman/5.5/en/string-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (94,6,'MBR DEFINITION','Its MBR (Minimum Bounding Rectangle), or Envelope. This is the bounding\ngeometry, formed by the minimum and maximum (X,Y) coordinates:\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/gis-class-geometry.html\n\n','((MINX MINY, MAXX MINY, MAXX MAXY, MINX MAXY, MINX MINY))\n','http://dev.mysql.com/doc/refman/5.5/en/gis-class-geometry.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (95,24,'GEOMETRYCOLLECTION','GeometryCollection(g1,g2,...)\n\nConstructs a GeometryCollection.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/creating-spatial-values.html#gis-mysql-specific-functions\n\n','','http://dev.mysql.com/doc/refman/5.5/en/creating-spatial-values.html#gis-mysql-specific-functions'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (96,16,'MAX','Syntax:\nMAX([DISTINCT] expr)\n\nReturns the maximum value of expr. MAX() may take a string argument; in\nsuch cases, it returns the maximum string value. See\nhttp://dev.mysql.com/doc/refman/5.5/en/mysql-indexes.html. The DISTINCT\nkeyword can be used to find the maximum of the distinct values of expr,\nhowever, this produces the same result as omitting DISTINCT.\n\nMAX() returns NULL if there were no matching rows.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/group-by-functions.html\n\n','mysql> SELECT student_name, MIN(test_score), MAX(test_score)\n -> FROM student\n -> GROUP BY student_name;\n','http://dev.mysql.com/doc/refman/5.5/en/group-by-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (97,21,'CREATE FUNCTION UDF','Syntax:\nCREATE [AGGREGATE] FUNCTION function_name RETURNS {STRING|INTEGER|REAL|DECIMAL}\n SONAME shared_library_name\n\nA user-defined function (UDF) is a way to extend MySQL with a new\nfunction that works like a native (built-in) MySQL function such as\nABS() or CONCAT().\n\nfunction_name is the name that should be used in SQL statements to\ninvoke the function. The RETURNS clause indicates the type of the\nfunction\'s return value. DECIMAL is a legal value after RETURNS, but\ncurrently DECIMAL functions return string values and should be written\nlike STRING functions.\n\nshared_library_name is the basename of the shared object file that\ncontains the code that implements the function. The file must be\nlocated in the plugin directory. This directory is given by the value\nof the plugin_dir system variable. For more information, see\nhttp://dev.mysql.com/doc/refman/5.5/en/udf-compiling.html.\n\nTo create a function, you must have the INSERT privilege for the mysql\ndatabase. This is necessary because CREATE FUNCTION adds a row to the\nmysql.func system table that records the function\'s name, type, and\nshared library name. If you do not have this table, you should run the\nmysql_upgrade command to create it. See\nhttp://dev.mysql.com/doc/refman/5.5/en/mysql-upgrade.html.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/create-function-udf.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/create-function-udf.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (98,4,'*','Syntax:\n*\n\nMultiplication:\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/arithmetic-functions.html\n\n','mysql> SELECT 3*5;\n -> 15\nmysql> SELECT 18014398509481984*18014398509481984.0;\n -> 324518553658426726783156020576256.0\nmysql> SELECT 18014398509481984*18014398509481984;\n -> 0\n','http://dev.mysql.com/doc/refman/5.5/en/arithmetic-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (99,22,'TIMESTAMP','TIMESTAMP\n\nA timestamp. The range is \'1970-01-01 00:00:01\' UTC to \'2038-01-19\n03:14:07\' UTC. TIMESTAMP values are stored as the number of seconds\nsince the epoch (\'1970-01-01 00:00:00\' UTC). A TIMESTAMP cannot\nrepresent the value \'1970-01-01 00:00:00\' because that is equivalent to\n0 seconds from the epoch and the value 0 is reserved for representing\n\'0000-00-00 00:00:00\', the "zero" TIMESTAMP value.\n\nUnless specified otherwise, the first TIMESTAMP column in a table is\ndefined to be automatically set to the date and time of the most recent\nmodification if not explicitly assigned a value. This makes TIMESTAMP\nuseful for recording the timestamp of an INSERT or UPDATE operation.\nYou can also set any TIMESTAMP column to the current date and time by\nassigning it a NULL value, unless it has been defined with the NULL\nattribute to permit NULL values. The automatic initialization and\nupdating to the current date and time can be specified using DEFAULT\nCURRENT_TIMESTAMP and ON UPDATE CURRENT_TIMESTAMP clauses, as described\nin\nhttp://dev.mysql.com/doc/refman/5.5/en/timestamp-initialization.html.\n\n*Note*: The TIMESTAMP format that was used prior to MySQL 4.1 is not\nsupported in MySQL 5.5; see MySQL 3.23, 4.0, 4.1 Reference Manual for\ninformation regarding the old format.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/date-and-time-type-overview.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (100,12,'DES_DECRYPT','Syntax:\nDES_DECRYPT(crypt_str[,key_str])\n\nDecrypts a string encrypted with DES_ENCRYPT(). If an error occurs,\nthis function returns NULL.\n\nThis function works only if MySQL has been configured with SSL support.\nSee http://dev.mysql.com/doc/refman/5.5/en/ssl-connections.html.\n\nIf no key_str argument is given, DES_DECRYPT() examines the first byte\nof the encrypted string to determine the DES key number that was used\nto encrypt the original string, and then reads the key from the DES key\nfile to decrypt the message. For this to work, the user must have the\nSUPER privilege. The key file can be specified with the --des-key-file\nserver option.\n\nIf you pass this function a key_str argument, that string is used as\nthe key for decrypting the message.\n\nIf the crypt_str argument does not appear to be an encrypted string,\nMySQL returns the given crypt_str.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/encryption-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/encryption-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (101,26,'CACHE INDEX','Syntax:\nCACHE INDEX\n tbl_index_list [, tbl_index_list] ...\n [PARTITION (partition_list | ALL)]\n IN key_cache_name\n\ntbl_index_list:\n tbl_name [[INDEX|KEY] (index_name[, index_name] ...)]\n\npartition_list:\n partition_name[, partition_name][, ...]\n\nThe CACHE INDEX statement assigns table indexes to a specific key\ncache. It is used only for MyISAM tables. After the indexes have been\nassigned, they can be preloaded into the cache if desired with LOAD\nINDEX INTO CACHE.\n\nThe following statement assigns indexes from the tables t1, t2, and t3\nto the key cache named hot_cache:\n\nmysql> CACHE INDEX t1, t2, t3 IN hot_cache;\n+---------+--------------------+----------+----------+\n| Table | Op | Msg_type | Msg_text |\n+---------+--------------------+----------+----------+\n| test.t1 | assign_to_keycache | status | OK |\n| test.t2 | assign_to_keycache | status | OK |\n| test.t3 | assign_to_keycache | status | OK |\n+---------+--------------------+----------+----------+\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/cache-index.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/cache-index.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (102,13,'ENDPOINT','EndPoint(ls)\n\nReturns the Point that is the endpoint of the LineString value ls.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/geometry-property-functions.html#linestring-property-functions\n\n','mysql> SET @ls = \'LineString(1 1,2 2,3 3)\';\nmysql> SELECT AsText(EndPoint(GeomFromText(@ls)));\n+-------------------------------------+\n| AsText(EndPoint(GeomFromText(@ls))) |\n+-------------------------------------+\n| POINT(3 3) |\n+-------------------------------------+\n','http://dev.mysql.com/doc/refman/5.5/en/geometry-property-functions.html#linestring-property-functions'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (103,12,'COMPRESS','Syntax:\nCOMPRESS(string_to_compress)\n\nCompresses a string and returns the result as a binary string. This\nfunction requires MySQL to have been compiled with a compression\nlibrary such as zlib. Otherwise, the return value is always NULL. The\ncompressed string can be uncompressed with UNCOMPRESS().\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/encryption-functions.html\n\n','mysql> SELECT LENGTH(COMPRESS(REPEAT(\'a\',1000)));\n -> 21\nmysql> SELECT LENGTH(COMPRESS(\'\'));\n -> 0\nmysql> SELECT LENGTH(COMPRESS(\'a\'));\n -> 13\nmysql> SELECT LENGTH(COMPRESS(REPEAT(\'a\',16)));\n -> 15\n','http://dev.mysql.com/doc/refman/5.5/en/encryption-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (104,27,'INSERT','Syntax:\nINSERT [LOW_PRIORITY | DELAYED | HIGH_PRIORITY] [IGNORE]\n [INTO] tbl_name [(col_name,...)]\n {VALUES | VALUE} ({expr | DEFAULT},...),(...),...\n [ ON DUPLICATE KEY UPDATE\n col_name=expr\n [, col_name=expr] ... ]\n\nOr:\n\nINSERT [LOW_PRIORITY | DELAYED | HIGH_PRIORITY] [IGNORE]\n [INTO] tbl_name\n SET col_name={expr | DEFAULT}, ...\n [ ON DUPLICATE KEY UPDATE\n col_name=expr\n [, col_name=expr] ... ]\n\nOr:\n\nINSERT [LOW_PRIORITY | HIGH_PRIORITY] [IGNORE]\n [INTO] tbl_name [(col_name,...)]\n SELECT ...\n [ ON DUPLICATE KEY UPDATE\n col_name=expr\n [, col_name=expr] ... ]\n\nINSERT inserts new rows into an existing table. The INSERT ... VALUES\nand INSERT ... SET forms of the statement insert rows based on\nexplicitly specified values. The INSERT ... SELECT form inserts rows\nselected from another table or tables. INSERT ... SELECT is discussed\nfurther in [HELP INSERT SELECT].\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/insert.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/insert.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (105,16,'COUNT','Syntax:\nCOUNT(expr)\n\nReturns a count of the number of non-NULL values of expr in the rows\nretrieved by a SELECT statement. The result is a BIGINT value.\n\nCOUNT() returns 0 if there were no matching rows.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/group-by-functions.html\n\n','mysql> SELECT student.student_name,COUNT(*)\n -> FROM student,course\n -> WHERE student.student_id=course.student_id\n -> GROUP BY student_name;\n','http://dev.mysql.com/doc/refman/5.5/en/group-by-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (106,27,'HANDLER','Syntax:\nHANDLER tbl_name OPEN [ [AS] alias]\n\nHANDLER tbl_name READ index_name { = | <= | >= | < | > } (value1,value2,...)\n [ WHERE where_condition ] [LIMIT ... ]\nHANDLER tbl_name READ index_name { FIRST | NEXT | PREV | LAST }\n [ WHERE where_condition ] [LIMIT ... ]\nHANDLER tbl_name READ { FIRST | NEXT }\n [ WHERE where_condition ] [LIMIT ... ]\n\nHANDLER tbl_name CLOSE\n\nThe HANDLER statement provides direct access to table storage engine\ninterfaces. It is available for MyISAM and InnoDB tables.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/handler.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/handler.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (107,3,'MLINEFROMTEXT','MLineFromText(wkt[,srid]), MultiLineStringFromText(wkt[,srid])\n\nConstructs a MULTILINESTRING value using its WKT representation and\nSRID.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/creating-spatial-values.html#gis-wkt-functions\n\n','','http://dev.mysql.com/doc/refman/5.5/en/creating-spatial-values.html#gis-wkt-functions'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (108,32,'GEOMCOLLFROMWKB','GeomCollFromWKB(wkb[,srid]), GeometryCollectionFromWKB(wkb[,srid])\n\nConstructs a GEOMETRYCOLLECTION value using its WKB representation and\nSRID.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/creating-spatial-values.html#gis-wkb-functions\n\n','','http://dev.mysql.com/doc/refman/5.5/en/creating-spatial-values.html#gis-wkb-functions'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (109,9,'HELP_DATE','This help information was generated from the MySQL 5.5 Reference Manual\non: 2012-08-25\n','',''); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (110,39,'RENAME TABLE','Syntax:\nRENAME TABLE tbl_name TO new_tbl_name\n [, tbl_name2 TO new_tbl_name2] ...\n\nThis statement renames one or more tables.\n\nThe rename operation is done atomically, which means that no other\nsession can access any of the tables while the rename is running. For\nexample, if you have an existing table old_table, you can create\nanother table new_table that has the same structure but is empty, and\nthen replace the existing table with the empty one as follows (assuming\nthat backup_table does not already exist):\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/rename-table.html\n\n','CREATE TABLE new_table (...);\nRENAME TABLE old_table TO backup_table, new_table TO old_table;\n','http://dev.mysql.com/doc/refman/5.5/en/rename-table.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (111,22,'BOOLEAN','BOOL, BOOLEAN\n\nThese types are synonyms for TINYINT(1). A value of zero is considered\nfalse. Nonzero values are considered true:\n\nmysql> SELECT IF(0, \'true\', \'false\');\n+------------------------+\n| IF(0, \'true\', \'false\') |\n+------------------------+\n| false |\n+------------------------+\n\nmysql> SELECT IF(1, \'true\', \'false\');\n+------------------------+\n| IF(1, \'true\', \'false\') |\n+------------------------+\n| true |\n+------------------------+\n\nmysql> SELECT IF(2, \'true\', \'false\');\n+------------------------+\n| IF(2, \'true\', \'false\') |\n+------------------------+\n| true |\n+------------------------+\n\nHowever, the values TRUE and FALSE are merely aliases for 1 and 0,\nrespectively, as shown here:\n\nmysql> SELECT IF(0 = FALSE, \'true\', \'false\');\n+--------------------------------+\n| IF(0 = FALSE, \'true\', \'false\') |\n+--------------------------------+\n| true |\n+--------------------------------+\n\nmysql> SELECT IF(1 = TRUE, \'true\', \'false\');\n+-------------------------------+\n| IF(1 = TRUE, \'true\', \'false\') |\n+-------------------------------+\n| true |\n+-------------------------------+\n\nmysql> SELECT IF(2 = TRUE, \'true\', \'false\');\n+-------------------------------+\n| IF(2 = TRUE, \'true\', \'false\') |\n+-------------------------------+\n| false |\n+-------------------------------+\n\nmysql> SELECT IF(2 = FALSE, \'true\', \'false\');\n+--------------------------------+\n| IF(2 = FALSE, \'true\', \'false\') |\n+--------------------------------+\n| false |\n+--------------------------------+\n\nThe last two statements display the results shown because 2 is equal to\nneither 1 nor 0.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/numeric-type-overview.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (112,14,'DEFAULT','Syntax:\nDEFAULT(col_name)\n\nReturns the default value for a table column. An error results if the\ncolumn has no default value.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/miscellaneous-functions.html\n\n','mysql> UPDATE t SET i = DEFAULT(i)+1 WHERE id < 100;\n','http://dev.mysql.com/doc/refman/5.5/en/miscellaneous-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (113,4,'MOD','Syntax:\nMOD(N,M), N % M, N MOD M\n\nModulo operation. Returns the remainder of N divided by M.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/mathematical-functions.html\n\n','mysql> SELECT MOD(234, 10);\n -> 4\nmysql> SELECT 253 % 7;\n -> 1\nmysql> SELECT MOD(29,9);\n -> 2\nmysql> SELECT 29 MOD 9;\n -> 2\n','http://dev.mysql.com/doc/refman/5.5/en/mathematical-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (114,22,'TINYTEXT','TINYTEXT [CHARACTER SET charset_name] [COLLATE collation_name]\n\nA TEXT column with a maximum length of 255 (28 - 1) characters. The\neffective maximum length is less if the value contains multi-byte\ncharacters. Each TINYTEXT value is stored using a 1-byte length prefix\nthat indicates the number of bytes in the value.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/string-type-overview.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (115,20,'OPTIMIZE TABLE','Syntax:\nOPTIMIZE [NO_WRITE_TO_BINLOG | LOCAL] TABLE\n tbl_name [, tbl_name] ...\n\nOPTIMIZE TABLE should be used if you have deleted a large part of a\ntable or if you have made many changes to a table with variable-length\nrows (tables that have VARCHAR, VARBINARY, BLOB, or TEXT columns).\nDeleted rows are maintained in a linked list and subsequent INSERT\noperations reuse old row positions. You can use OPTIMIZE TABLE to\nreclaim the unused space and to defragment the data file. After\nextensive changes to a table, this statement may also improve\nperformance of statements that use the table, sometimes significantly.\n\nThis statement requires SELECT and INSERT privileges for the table.\n\nOPTIMIZE TABLE is supported for partitioned tables, and you can use\nALTER TABLE ... OPTIMIZE PARTITION to optimize one or more partitions;\nfor more information, see [HELP ALTER TABLE], and\nhttp://dev.mysql.com/doc/refman/5.5/en/partitioning-maintenance.html.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/optimize-table.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/optimize-table.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (116,12,'DECODE','Syntax:\nDECODE(crypt_str,pass_str)\n\nDecrypts the encrypted string crypt_str using pass_str as the password.\ncrypt_str should be a string returned from ENCODE().\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/encryption-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/encryption-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (117,18,'<=>','Syntax:\n<=>\n\nNULL-safe equal. This operator performs an equality comparison like the\n= operator, but returns 1 rather than NULL if both operands are NULL,\nand 0 rather than NULL if one operand is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/comparison-operators.html\n\n','mysql> SELECT 1 <=> 1, NULL <=> NULL, 1 <=> NULL;\n -> 1, 1, 0\nmysql> SELECT 1 = 1, NULL = NULL, 1 = NULL;\n -> 1, NULL, NULL\n','http://dev.mysql.com/doc/refman/5.5/en/comparison-operators.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (118,28,'HELP STATEMENT','Syntax:\nHELP \'search_string\'\n\nThe HELP statement returns online information from the MySQL Reference\nmanual. Its proper operation requires that the help tables in the mysql\ndatabase be initialized with help topic information (see\nhttp://dev.mysql.com/doc/refman/5.5/en/server-side-help-support.html).\n\nThe HELP statement searches the help tables for the given search string\nand displays the result of the search. The search string is not case\nsensitive.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/help.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/help.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (119,26,'RESET','Syntax:\nRESET reset_option [, reset_option] ...\n\nThe RESET statement is used to clear the state of various server\noperations. You must have the RELOAD privilege to execute RESET.\n\nRESET acts as a stronger version of the FLUSH statement. See [HELP\nFLUSH].\n\nThe RESET statement causes an implicit commit. See\nhttp://dev.mysql.com/doc/refman/5.5/en/implicit-commit.html.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/reset.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/reset.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (120,14,'GET_LOCK','Syntax:\nGET_LOCK(str,timeout)\n\nTries to obtain a lock with a name given by the string str, using a\ntimeout of timeout seconds. Returns 1 if the lock was obtained\nsuccessfully, 0 if the attempt timed out (for example, because another\nclient has previously locked the name), or NULL if an error occurred\n(such as running out of memory or the thread was killed with mysqladmin\nkill). If you have a lock obtained with GET_LOCK(), it is released when\nyou execute RELEASE_LOCK(), execute a new GET_LOCK(), or your\nconnection terminates (either normally or abnormally). Locks obtained\nwith GET_LOCK() do not interact with transactions. That is, committing\na transaction does not release any such locks obtained during the\ntransaction.\n\nThis function can be used to implement application locks or to simulate\nrecord locks. Names are locked on a server-wide basis. If a name has\nbeen locked by one client, GET_LOCK() blocks any request by another\nclient for a lock with the same name. This enables clients that agree\non a given lock name to use the name to perform cooperative advisory\nlocking. But be aware that it also enables a client that is not among\nthe set of cooperating clients to lock a name, either inadvertently or\ndeliberately, and thus prevent any of the cooperating clients from\nlocking that name. One way to reduce the likelihood of this is to use\nlock names that are database-specific or application-specific. For\nexample, use lock names of the form db_name.str or app_name.str.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/miscellaneous-functions.html\n\n','mysql> SELECT GET_LOCK(\'lock1\',10);\n -> 1\nmysql> SELECT IS_FREE_LOCK(\'lock2\');\n -> 1\nmysql> SELECT GET_LOCK(\'lock2\',10);\n -> 1\nmysql> SELECT RELEASE_LOCK(\'lock2\');\n -> 1\nmysql> SELECT RELEASE_LOCK(\'lock1\');\n -> NULL\n','http://dev.mysql.com/doc/refman/5.5/en/miscellaneous-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (121,37,'UCASE','Syntax:\nUCASE(str)\n\nUCASE() is a synonym for UPPER().\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/string-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/string-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (122,26,'SHOW BINLOG EVENTS','Syntax:\nSHOW BINLOG EVENTS\n [IN \'log_name\'] [FROM pos] [LIMIT [offset,] row_count]\n\nShows the events in the binary log. If you do not specify \'log_name\',\nthe first binary log is displayed.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/show-binlog-events.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/show-binlog-events.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (123,32,'MPOLYFROMWKB','MPolyFromWKB(wkb[,srid]), MultiPolygonFromWKB(wkb[,srid])\n\nConstructs a MULTIPOLYGON value using its WKB representation and SRID.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/creating-spatial-values.html#gis-wkb-functions\n\n','','http://dev.mysql.com/doc/refman/5.5/en/creating-spatial-values.html#gis-wkb-functions'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (124,23,'ITERATE','Syntax:\nITERATE label\n\nITERATE can appear only within LOOP, REPEAT, and WHILE statements.\nITERATE means "start the loop again."\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/iterate.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/iterate.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (125,27,'DO','Syntax:\nDO expr [, expr] ...\n\nDO executes the expressions but does not return any results. In most\nrespects, DO is shorthand for SELECT expr, ..., but has the advantage\nthat it is slightly faster when you do not care about the result.\n\nDO is useful primarily with functions that have side effects, such as\nRELEASE_LOCK().\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/do.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/do.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (126,31,'CURTIME','Syntax:\nCURTIME()\n\nReturns the current time as a value in \'HH:MM:SS\' or HHMMSS.uuuuuu\nformat, depending on whether the function is used in a string or\nnumeric context. The value is expressed in the current time zone.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html\n\n','mysql> SELECT CURTIME();\n -> \'23:50:26\'\nmysql> SELECT CURTIME() + 0;\n -> 235026.000000\n','http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (127,37,'CHAR_LENGTH','Syntax:\nCHAR_LENGTH(str)\n\nReturns the length of the string str, measured in characters. A\nmulti-byte character counts as a single character. This means that for\na string containing five 2-byte characters, LENGTH() returns 10,\nwhereas CHAR_LENGTH() returns 5.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/string-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/string-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (128,22,'BIGINT','BIGINT[(M)] [UNSIGNED] [ZEROFILL]\n\nA large integer. The signed range is -9223372036854775808 to\n9223372036854775807. The unsigned range is 0 to 18446744073709551615.\n\nSERIAL is an alias for BIGINT UNSIGNED NOT NULL AUTO_INCREMENT UNIQUE.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/numeric-type-overview.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (129,26,'SET','Syntax:\nSET variable_assignment [, variable_assignment] ...\n\nvariable_assignment:\n user_var_name = expr\n | [GLOBAL | SESSION] system_var_name = expr\n | [@@global. | @@session. | @@]system_var_name = expr\n\nThe SET statement assigns values to different types of variables that\naffect the operation of the server or your client. Older versions of\nMySQL employed SET OPTION, but this syntax is deprecated in favor of\nSET without OPTION.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/set-statement.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/set-statement.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (130,27,'LOAD XML','Syntax:\nLOAD XML [LOW_PRIORITY | CONCURRENT] [LOCAL] INFILE \'file_name\'\n [REPLACE | IGNORE]\n INTO TABLE [db_name.]tbl_name\n [CHARACTER SET charset_name]\n [ROWS IDENTIFIED BY \'<tagname>\']\n [IGNORE number {LINES | ROWS}]\n [(column_or_user_var,...)]\n [SET col_name = expr,...]\n\nThe LOAD XML statement reads data from an XML file into a table. The\nfile_name must be given as a literal string. The tagname in the\noptional ROWS IDENTIFIED BY clause must also be given as a literal\nstring, and must be surrounded by angle brackets (< and >).\n\nLOAD XML acts as the complement of running the mysql client in XML\noutput mode (that is, starting the client with the --xml option). To\nwrite data from a table to an XML file, use a command such as the\nfollowing one from the system shell:\n\nshell> mysql --xml -e \'SELECT * FROM mytable\' > file.xml\n\nTo read the file back into a table, use LOAD XML INFILE. By default,\nthe <row> element is considered to be the equivalent of a database\ntable row; this can be changed using the ROWS IDENTIFIED BY clause.\n\nThis statement supports three different XML formats:\n\no Column names as attributes and column values as attribute values:\n\n<row column1="value1" column2="value2" .../>\n\no Column names as tags and column values as the content of these tags:\n\n<row>\n <column1>value1</column1>\n <column2>value2</column2>\n</row>\n\no Column names are the name attributes of <field> tags, and values are\n the contents of these tags:\n\n<row>\n <field name=\'column1\'>value1</field>\n <field name=\'column2\'>value2</field>\n</row>\n\n This is the format used by other MySQL tools, such as mysqldump.\n\nAll 3 formats can be used in the same XML file; the import routine\nautomatically detects the format for each row and interprets it\ncorrectly. Tags are matched based on the tag or attribute name and the\ncolumn name.\n\nThe following clauses work essentially the same way for LOAD XML as\nthey do for LOAD DATA:\n\no LOW_PRIORITY or CONCURRENT\n\no LOCAL\n\no REPLACE or IGNORE\n\no CHARACTER SET\n\no (column_or_user_var,...)\n\no SET\n\nSee [HELP LOAD DATA], for more information about these clauses.\n\nThe IGNORE number LINES or IGNORE number ROWS clause causes the first\nnumber rows in the XML file to be skipped. It is analogous to the LOAD\nDATA statement\'s IGNORE ... LINES clause.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/load-xml.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/load-xml.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (131,4,'CONV','Syntax:\nCONV(N,from_base,to_base)\n\nConverts numbers between different number bases. Returns a string\nrepresentation of the number N, converted from base from_base to base\nto_base. Returns NULL if any argument is NULL. The argument N is\ninterpreted as an integer, but may be specified as an integer or a\nstring. The minimum base is 2 and the maximum base is 36. If to_base is\na negative number, N is regarded as a signed number. Otherwise, N is\ntreated as unsigned. CONV() works with 64-bit precision.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/mathematical-functions.html\n\n','mysql> SELECT CONV(\'a\',16,2);\n -> \'1010\'\nmysql> SELECT CONV(\'6E\',18,8);\n -> \'172\'\nmysql> SELECT CONV(-17,10,-18);\n -> \'-H\'\nmysql> SELECT CONV(10+\'10\'+\'10\'+0xa,10,10);\n -> \'40\'\n','http://dev.mysql.com/doc/refman/5.5/en/mathematical-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (132,22,'DATE','DATE\n\nA date. The supported range is \'1000-01-01\' to \'9999-12-31\'. MySQL\ndisplays DATE values in \'YYYY-MM-DD\' format, but permits assignment of\nvalues to DATE columns using either strings or numbers.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/date-and-time-type-overview.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (133,15,'ASSIGN-VALUE','Syntax:\n:=\n\nAssignment operator. Causes the user variable on the left hand side of\nthe operator to take on the value to its right. The value on the right\nhand side may be a literal value, another variable storing a value, or\nany legal expression that yields a scalar value, including the result\nof a query (provided that this value is a scalar value). You can\nperform multiple assignments in the same SET statement. You can perform\nmultiple assignments in the same statement-\n\nUnlike =, the := operator is never interpreted as a comparison\noperator. This means you can use := in any valid SQL statement (not\njust in SET statements) to assign a value to a variable.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/assignment-operators.html\n\n','mysql> SELECT @var1, @var2;\n -> NULL, NULL\nmysql> SELECT @var1 := 1, @var2;\n -> 1, NULL\nmysql> SELECT @var1, @var2;\n -> 1, NULL\nmysql> SELECT @var1, @var2 := @var1;\n -> 1, 1\nmysql> SELECT @var1, @var2;\n -> 1, 1\n\nmysql> SELECT @var1:=COUNT(*) FROM t1;\n -> 4\nmysql> SELECT @var1;\n -> 4\n','http://dev.mysql.com/doc/refman/5.5/en/assignment-operators.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (134,26,'SHOW OPEN TABLES','Syntax:\nSHOW OPEN TABLES [{FROM | IN} db_name]\n [LIKE \'pattern\' | WHERE expr]\n\nSHOW OPEN TABLES lists the non-TEMPORARY tables that are currently open\nin the table cache. See\nhttp://dev.mysql.com/doc/refman/5.5/en/table-cache.html. The FROM\nclause, if present, restricts the tables shown to those present in the\ndb_name database. The LIKE clause, if present, indicates which table\nnames to match. The WHERE clause can be given to select rows using more\ngeneral conditions, as discussed in\nhttp://dev.mysql.com/doc/refman/5.5/en/extended-show.html.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/show-open-tables.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/show-open-tables.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (135,31,'EXTRACT','Syntax:\nEXTRACT(unit FROM date)\n\nThe EXTRACT() function uses the same kinds of unit specifiers as\nDATE_ADD() or DATE_SUB(), but extracts parts from the date rather than\nperforming date arithmetic.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html\n\n','mysql> SELECT EXTRACT(YEAR FROM \'2009-07-02\');\n -> 2009\nmysql> SELECT EXTRACT(YEAR_MONTH FROM \'2009-07-02 01:02:03\');\n -> 200907\nmysql> SELECT EXTRACT(DAY_MINUTE FROM \'2009-07-02 01:02:03\');\n -> 20102\nmysql> SELECT EXTRACT(MICROSECOND\n -> FROM \'2003-01-02 10:30:00.000123\');\n -> 123\n','http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (136,12,'ENCRYPT','Syntax:\nENCRYPT(str[,salt])\n\nEncrypts str using the Unix crypt() system call and returns a binary\nstring. The salt argument must be a string with at least two characters\nor the result will be NULL. If no salt argument is given, a random\nvalue is used.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/encryption-functions.html\n\n','mysql> SELECT ENCRYPT(\'hello\');\n -> \'VxuFAJXVARROc\'\n','http://dev.mysql.com/doc/refman/5.5/en/encryption-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (137,26,'SHOW STATUS','Syntax:\nSHOW [GLOBAL | SESSION] STATUS\n [LIKE \'pattern\' | WHERE expr]\n\nSHOW STATUS provides server status information. This information also\ncan be obtained using the mysqladmin extended-status command. The LIKE\nclause, if present, indicates which variable names to match. The WHERE\nclause can be given to select rows using more general conditions, as\ndiscussed in http://dev.mysql.com/doc/refman/5.5/en/extended-show.html.\nThis statement does not require any privilege. It requires only the\nability to connect to the server.\nWith a LIKE clause, the statement displays only rows for those\nvariables with names that match the pattern:\n\nmysql> SHOW STATUS LIKE \'Key%\';\n+--------------------+----------+\n| Variable_name | Value |\n+--------------------+----------+\n| Key_blocks_used | 14955 |\n| Key_read_requests | 96854827 |\n| Key_reads | 162040 |\n| Key_write_requests | 7589728 |\n| Key_writes | 3813196 |\n+--------------------+----------+\n\nWith the GLOBAL modifier, SHOW STATUS displays the status values for\nall connections to MySQL. With SESSION, it displays the status values\nfor the current connection. If no modifier is present, the default is\nSESSION. LOCAL is a synonym for SESSION.\n\nSome status variables have only a global value. For these, you get the\nsame value for both GLOBAL and SESSION. The scope for each status\nvariable is listed at\nhttp://dev.mysql.com/doc/refman/5.5/en/server-status-variables.html.\n\nEach invocation of the SHOW STATUS statement uses an internal temporary\ntable and increments the global Created_tmp_tables value.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/show-status.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/show-status.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (138,37,'EXTRACTVALUE','Syntax:\nExtractValue(xml_frag, xpath_expr)\n\nExtractValue() takes two string arguments, a fragment of XML markup\nxml_frag and an XPath expression xpath_expr (also known as a locator);\nit returns the text (CDATA) of the first text node which is a child of\nthe elements or elements matched by the XPath expression. In MySQL 5.5,\nthe XPath expression can contain at most 127 characters. (This\nlimitation is lifted in MySQL 5.6.)\n\nUsing this function is the equivalent of performing a match using the\nxpath_expr after appending /text(). In other words,\nExtractValue(\'<a><b>Sakila</b></a>\', \'/a/b\') and\nExtractValue(\'<a><b>Sakila</b></a>\', \'/a/b/text()\') produce the same\nresult.\n\nIf multiple matches are found, the content of the first child text node\nof each matching element is returned (in the order matched) as a\nsingle, space-delimited string.\n\nIf no matching text node is found for the expression (including the\nimplicit /text())---for whatever reason, as long as xpath_expr is\nvalid, and xml_frag consists of elements which are properly nested and\nclosed---an empty string is returned. No distinction is made between a\nmatch on an empty element and no match at all. This is by design.\n\nIf you need to determine whether no matching element was found in\nxml_frag or such an element was found but contained no child text\nnodes, you should test the result of an expression that uses the XPath\ncount() function. For example, both of these statements return an empty\nstring, as shown here:\n\nmysql> SELECT ExtractValue(\'<a><b/></a>\', \'/a/b\');\n+-------------------------------------+\n| ExtractValue(\'<a><b/></a>\', \'/a/b\') |\n+-------------------------------------+\n| |\n+-------------------------------------+\n1 row in set (0.00 sec)\n\nmysql> SELECT ExtractValue(\'<a><c/></a>\', \'/a/b\');\n+-------------------------------------+\n| ExtractValue(\'<a><c/></a>\', \'/a/b\') |\n+-------------------------------------+\n| |\n+-------------------------------------+\n1 row in set (0.00 sec)\n\nHowever, you can determine whether there was actually a matching\nelement using the following:\n\nmysql> SELECT ExtractValue(\'<a><b/></a>\', \'count(/a/b)\');\n+-------------------------------------+\n| ExtractValue(\'<a><b/></a>\', \'count(/a/b)\') |\n+-------------------------------------+\n| 1 |\n+-------------------------------------+\n1 row in set (0.00 sec)\n\nmysql> SELECT ExtractValue(\'<a><c/></a>\', \'count(/a/b)\');\n+-------------------------------------+\n| ExtractValue(\'<a><c/></a>\', \'count(/a/b)\') |\n+-------------------------------------+\n| 0 |\n+-------------------------------------+\n1 row in set (0.01 sec)\n\n*Important*: ExtractValue() returns only CDATA, and does not return any\ntags that might be contained within a matching tag, nor any of their\ncontent (see the result returned as val1 in the following example).\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/xml-functions.html\n\n','mysql> SELECT\n -> ExtractValue(\'<a>ccc<b>ddd</b></a>\', \'/a\') AS val1,\n -> ExtractValue(\'<a>ccc<b>ddd</b></a>\', \'/a/b\') AS val2,\n -> ExtractValue(\'<a>ccc<b>ddd</b></a>\', \'//b\') AS val3,\n -> ExtractValue(\'<a>ccc<b>ddd</b></a>\', \'/b\') AS val4,\n -> ExtractValue(\'<a>ccc<b>ddd</b><b>eee</b></a>\', \'//b\') AS val5;\n\n+------+------+------+------+---------+\n| val1 | val2 | val3 | val4 | val5 |\n+------+------+------+------+---------+\n| ccc | ddd | ddd | | ddd eee |\n+------+------+------+------+---------+\n','http://dev.mysql.com/doc/refman/5.5/en/xml-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (139,12,'OLD_PASSWORD','Syntax:\nOLD_PASSWORD(str)\n\nOLD_PASSWORD() was added when the implementation of PASSWORD() was\nchanged in MySQL 4.1 to improve security. OLD_PASSWORD() returns the\nvalue of the pre-4.1 implementation of PASSWORD() as a string, and is\nintended to permit you to reset passwords for any pre-4.1 clients that\nneed to connect to your version 5.5 MySQL server without locking them\nout. See http://dev.mysql.com/doc/refman/5.5/en/password-hashing.html.\n\nAs of MySQL 5.5.3, the return value is a nonbinary string in the\nconnection character set. Before 5.5.3, the return value is a binary\nstring.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/encryption-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/encryption-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (140,37,'FORMAT','Syntax:\nFORMAT(X,D[,locale])\n\nFormats the number X to a format like \'#,###,###.##\', rounded to D\ndecimal places, and returns the result as a string. If D is 0, the\nresult has no decimal point or fractional part.\n\nThe optional third parameter enables a locale to be specified to be\nused for the result number\'s decimal point, thousands separator, and\ngrouping between separators. Permissible locale values are the same as\nthe legal values for the lc_time_names system variable (see\nhttp://dev.mysql.com/doc/refman/5.5/en/locale-support.html). If no\nlocale is specified, the default is \'en_US\'.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/string-functions.html\n\n','mysql> SELECT FORMAT(12332.123456, 4);\n -> \'12,332.1235\'\nmysql> SELECT FORMAT(12332.1,4);\n -> \'12,332.1000\'\nmysql> SELECT FORMAT(12332.2,0);\n -> \'12,332\'\nmysql> SELECT FORMAT(12332.2,2,\'de_DE\');\n -> \'12.332,20\'\n','http://dev.mysql.com/doc/refman/5.5/en/string-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (141,15,'||','Syntax:\nOR, ||\n\nLogical OR. When both operands are non-NULL, the result is 1 if any\noperand is nonzero, and 0 otherwise. With a NULL operand, the result is\n1 if the other operand is nonzero, and NULL otherwise. If both operands\nare NULL, the result is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/logical-operators.html\n\n','mysql> SELECT 1 || 1;\n -> 1\nmysql> SELECT 1 || 0;\n -> 1\nmysql> SELECT 0 || 0;\n -> 0\nmysql> SELECT 0 || NULL;\n -> NULL\nmysql> SELECT 1 || NULL;\n -> 1\n','http://dev.mysql.com/doc/refman/5.5/en/logical-operators.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (142,37,'BIT_LENGTH','Syntax:\nBIT_LENGTH(str)\n\nReturns the length of the string str in bits.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/string-functions.html\n\n','mysql> SELECT BIT_LENGTH(\'text\');\n -> 32\n','http://dev.mysql.com/doc/refman/5.5/en/string-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (143,2,'EXTERIORRING','ExteriorRing(poly)\n\nReturns the exterior ring of the Polygon value poly as a LineString.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/geometry-property-functions.html#polygon-property-functions\n\n','mysql> SET @poly =\n -> \'Polygon((0 0,0 3,3 3,3 0,0 0),(1 1,1 2,2 2,2 1,1 1))\';\nmysql> SELECT AsText(ExteriorRing(GeomFromText(@poly)));\n+-------------------------------------------+\n| AsText(ExteriorRing(GeomFromText(@poly))) |\n+-------------------------------------------+\n| LINESTRING(0 0,0 3,3 3,3 0,0 0) |\n+-------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.5/en/geometry-property-functions.html#polygon-property-functions'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (144,32,'GEOMFROMWKB','GeomFromWKB(wkb[,srid]), GeometryFromWKB(wkb[,srid])\n\nConstructs a geometry value of any type using its WKB representation\nand SRID.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/creating-spatial-values.html#gis-wkb-functions\n\n','','http://dev.mysql.com/doc/refman/5.5/en/creating-spatial-values.html#gis-wkb-functions'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (145,26,'SHOW SLAVE HOSTS','Syntax:\nSHOW SLAVE HOSTS\n\nDisplays a list of replication slaves currently registered with the\nmaster. (Before MySQL 5.5.3, only slaves started with the\n--report-host=host_name option are visible in this list.)\n\nThe list is displayed on any server (not just the master server). The\noutput looks like this:\n\nmysql> SHOW SLAVE HOSTS;\n+------------+-----------+------+-----------+\n| Server_id | Host | Port | Master_id |\n+------------+-----------+------+-----------+\n| 192168010 | iconnect2 | 3306 | 192168011 |\n| 1921680101 | athena | 3306 | 192168011 |\n+------------+-----------+------+-----------+\n\no Server_id: The unique server ID of the slave server, as configured in\n the server\'s option file, or on the command line with\n --server-id=value.\n\no Host: The host name of the slave server, as configured in the\n server\'s option file, or on the command line with\n --report-host=host_name. Note that this can differ from the machine\n name as configured in the operating system.\n\no Port: The port the slave server is listening on.\n\n In MySQL 5.5.23 and later, a zero in this column means that the slave\n port (--report-port) was not set. Prior to MySQL 5.5.23, 3306 was\n used as the default in such cases (Bug #13333431).\n\no Master_id: The unique server ID of the master server that the slave\n server is replicating from.\n\nSome MySQL versions report another variable, Rpl_recovery_rank. This\nvariable was never used, and was removed in MySQL 5.5.3. (Bug #13963)\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/show-slave-hosts.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/show-slave-hosts.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (146,8,'START TRANSACTION','Syntax:\nSTART TRANSACTION [WITH CONSISTENT SNAPSHOT]\nBEGIN [WORK]\nCOMMIT [WORK] [AND [NO] CHAIN] [[NO] RELEASE]\nROLLBACK [WORK] [AND [NO] CHAIN] [[NO] RELEASE]\nSET autocommit = {0 | 1}\n\nThese statements provide control over use of transactions:\n\no START TRANSACTION or BEGIN start a new transaction.\n\no COMMIT commits the current transaction, making its changes permanent.\n\no ROLLBACK rolls back the current transaction, canceling its changes.\n\no SET autocommit disables or enables the default autocommit mode for\n the current session.\n\nBy default, MySQL runs with autocommit mode enabled. This means that as\nsoon as you execute a statement that updates (modifies) a table, MySQL\nstores the update on disk to make it permanent. The change cannot be\nrolled back.\n\nTo disable autocommit mode implicitly for a single series of\nstatements, use the START TRANSACTION statement:\n\nSTART TRANSACTION;\nSELECT @A:=SUM(salary) FROM table1 WHERE type=1;\nUPDATE table2 SET summary=@A WHERE type=1;\nCOMMIT;\n\nWith START TRANSACTION, autocommit remains disabled until you end the\ntransaction with COMMIT or ROLLBACK. The autocommit mode then reverts\nto its previous state.\n\nYou can also begin a transaction like this:\n\nSTART TRANSACTION WITH CONSISTENT SNAPSHOT;\n\nThe WITH CONSISTENT SNAPSHOT option starts a consistent read for\nstorage engines that are capable of it. This applies only to InnoDB.\nThe effect is the same as issuing a START TRANSACTION followed by a\nSELECT from any InnoDB table. See\nhttp://dev.mysql.com/doc/refman/5.5/en/innodb-consistent-read.html. The\nWITH CONSISTENT SNAPSHOT option does not change the current transaction\nisolation level, so it provides a consistent snapshot only if the\ncurrent isolation level is one that permits consistent read (REPEATABLE\nREAD or SERIALIZABLE).\n\n*Important*: Many APIs used for writing MySQL client applications (such\nas JDBC) provide their own methods for starting transactions that can\n(and sometimes should) be used instead of sending a START TRANSACTION\nstatement from the client. See\nhttp://dev.mysql.com/doc/refman/5.5/en/connectors-apis.html, or the\ndocumentation for your API, for more information.\n\nTo disable autocommit mode explicitly, use the following statement:\n\nSET autocommit=0;\n\nAfter disabling autocommit mode by setting the autocommit variable to\nzero, changes to transaction-safe tables (such as those for InnoDB or\nNDBCLUSTER) are not made permanent immediately. You must use COMMIT to\nstore your changes to disk or ROLLBACK to ignore the changes.\n\nautocommit is a session variable and must be set for each session. To\ndisable autocommit mode for each new connection, see the description of\nthe autocommit system variable at\nhttp://dev.mysql.com/doc/refman/5.5/en/server-system-variables.html.\n\nBEGIN and BEGIN WORK are supported as aliases of START TRANSACTION for\ninitiating a transaction. START TRANSACTION is standard SQL syntax and\nis the recommended way to start an ad-hoc transaction.\n\nThe BEGIN statement differs from the use of the BEGIN keyword that\nstarts a BEGIN ... END compound statement. The latter does not begin a\ntransaction. See [HELP BEGIN END].\n\n*Note*: Within all stored programs (stored procedures and functions,\ntriggers, and events), the parser treats BEGIN [WORK] as the beginning\nof a BEGIN ... END block. Begin a transaction in this context with\nSTART TRANSACTION instead.\n\nThe optional WORK keyword is supported for COMMIT and ROLLBACK, as are\nthe CHAIN and RELEASE clauses. CHAIN and RELEASE can be used for\nadditional control over transaction completion. The value of the\ncompletion_type system variable determines the default completion\nbehavior. See\nhttp://dev.mysql.com/doc/refman/5.5/en/server-system-variables.html.\n\nThe AND CHAIN clause causes a new transaction to begin as soon as the\ncurrent one ends, and the new transaction has the same isolation level\nas the just-terminated transaction. The RELEASE clause causes the\nserver to disconnect the current client session after terminating the\ncurrent transaction. Including the NO keyword suppresses CHAIN or\nRELEASE completion, which can be useful if the completion_type system\nvariable is set to cause chaining or release completion by default.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/commit.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/commit.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (147,18,'BETWEEN AND','Syntax:\nexpr BETWEEN min AND max\n\nIf expr is greater than or equal to min and expr is less than or equal\nto max, BETWEEN returns 1, otherwise it returns 0. This is equivalent\nto the expression (min <= expr AND expr <= max) if all the arguments\nare of the same type. Otherwise type conversion takes place according\nto the rules described in\nhttp://dev.mysql.com/doc/refman/5.5/en/type-conversion.html, but\napplied to all the three arguments.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/comparison-operators.html\n\n','mysql> SELECT 2 BETWEEN 1 AND 3, 2 BETWEEN 3 and 1;\n -> 1, 0\nmysql> SELECT 1 BETWEEN 2 AND 3;\n -> 0\nmysql> SELECT \'b\' BETWEEN \'a\' AND \'c\';\n -> 1\nmysql> SELECT 2 BETWEEN 2 AND \'3\';\n -> 1\nmysql> SELECT 2 BETWEEN 2 AND \'x-3\';\n -> 0\n','http://dev.mysql.com/doc/refman/5.5/en/comparison-operators.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (148,24,'MULTIPOLYGON','MultiPolygon(poly1,poly2,...)\n\nConstructs a MultiPolygon value from a set of Polygon or WKB Polygon\narguments.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/creating-spatial-values.html#gis-mysql-specific-functions\n\n','','http://dev.mysql.com/doc/refman/5.5/en/creating-spatial-values.html#gis-mysql-specific-functions'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (149,31,'TIME_FORMAT','Syntax:\nTIME_FORMAT(time,format)\n\nThis is used like the DATE_FORMAT() function, but the format string may\ncontain format specifiers only for hours, minutes, seconds, and\nmicroseconds. Other specifiers produce a NULL value or 0.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html\n\n','mysql> SELECT TIME_FORMAT(\'100:00:00\', \'%H %k %h %I %l\');\n -> \'100 100 04 04 4\'\n','http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (150,37,'LEFT','Syntax:\nLEFT(str,len)\n\nReturns the leftmost len characters from the string str, or NULL if any\nargument is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/string-functions.html\n\n','mysql> SELECT LEFT(\'foobarbar\', 5);\n -> \'fooba\'\n','http://dev.mysql.com/doc/refman/5.5/en/string-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (151,26,'FLUSH QUERY CACHE','You can defragment the query cache to better utilize its memory with\nthe FLUSH QUERY CACHE statement. The statement does not remove any\nqueries from the cache.\n\nThe RESET QUERY CACHE statement removes all query results from the\nquery cache. The FLUSH TABLES statement also does this.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/query-cache-status-and-maintenance.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/query-cache-status-and-maintenance.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (152,22,'SET DATA TYPE','SET(\'value1\',\'value2\',...) [CHARACTER SET charset_name] [COLLATE\ncollation_name]\n\nA set. A string object that can have zero or more values, each of which\nmust be chosen from the list of values \'value1\', \'value2\', ... A SET\ncolumn can have a maximum of 64 members. SET values are represented\ninternally as integers.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/string-type-overview.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (153,4,'RAND','Syntax:\nRAND(), RAND(N)\n\nReturns a random floating-point value v in the range 0 <= v < 1.0. If a\nconstant integer argument N is specified, it is used as the seed value,\nwhich produces a repeatable sequence of column values. In the following\nexample, note that the sequences of values produced by RAND(3) is the\nsame both places where it occurs.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/mathematical-functions.html\n\n','mysql> CREATE TABLE t (i INT);\nQuery OK, 0 rows affected (0.42 sec)\n\nmysql> INSERT INTO t VALUES(1),(2),(3);\nQuery OK, 3 rows affected (0.00 sec)\nRecords: 3 Duplicates: 0 Warnings: 0\n\nmysql> SELECT i, RAND() FROM t;\n+------+------------------+\n| i | RAND() |\n+------+------------------+\n| 1 | 0.61914388706828 |\n| 2 | 0.93845168309142 |\n| 3 | 0.83482678498591 |\n+------+------------------+\n3 rows in set (0.00 sec)\n\nmysql> SELECT i, RAND(3) FROM t;\n+------+------------------+\n| i | RAND(3) |\n+------+------------------+\n| 1 | 0.90576975597606 |\n| 2 | 0.37307905813035 |\n| 3 | 0.14808605345719 |\n+------+------------------+\n3 rows in set (0.00 sec)\n\nmysql> SELECT i, RAND() FROM t;\n+------+------------------+\n| i | RAND() |\n+------+------------------+\n| 1 | 0.35877890638893 |\n| 2 | 0.28941420772058 |\n| 3 | 0.37073435016976 |\n+------+------------------+\n3 rows in set (0.00 sec)\n\nmysql> SELECT i, RAND(3) FROM t;\n+------+------------------+\n| i | RAND(3) |\n+------+------------------+\n| 1 | 0.90576975597606 |\n| 2 | 0.37307905813035 |\n| 3 | 0.14808605345719 |\n+------+------------------+\n3 rows in set (0.01 sec)\n','http://dev.mysql.com/doc/refman/5.5/en/mathematical-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (154,37,'RPAD','Syntax:\nRPAD(str,len,padstr)\n\nReturns the string str, right-padded with the string padstr to a length\nof len characters. If str is longer than len, the return value is\nshortened to len characters.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/string-functions.html\n\n','mysql> SELECT RPAD(\'hi\',5,\'?\');\n -> \'hi???\'\nmysql> SELECT RPAD(\'hi\',1,\'?\');\n -> \'h\'\n','http://dev.mysql.com/doc/refman/5.5/en/string-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (155,39,'CREATE DATABASE','Syntax:\nCREATE {DATABASE | SCHEMA} [IF NOT EXISTS] db_name\n [create_specification] ...\n\ncreate_specification:\n [DEFAULT] CHARACTER SET [=] charset_name\n | [DEFAULT] COLLATE [=] collation_name\n\nCREATE DATABASE creates a database with the given name. To use this\nstatement, you need the CREATE privilege for the database. CREATE\nSCHEMA is a synonym for CREATE DATABASE.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/create-database.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/create-database.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (156,22,'DEC','DEC[(M[,D])] [UNSIGNED] [ZEROFILL], NUMERIC[(M[,D])] [UNSIGNED]\n[ZEROFILL], FIXED[(M[,D])] [UNSIGNED] [ZEROFILL]\n\nThese types are synonyms for DECIMAL. The FIXED synonym is available\nfor compatibility with other database systems.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/numeric-type-overview.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (157,16,'VAR_POP','Syntax:\nVAR_POP(expr)\n\nReturns the population standard variance of expr. It considers rows as\nthe whole population, not as a sample, so it has the number of rows as\nthe denominator. You can also use VARIANCE(), which is equivalent but\nis not standard SQL.\n\nVAR_POP() returns NULL if there were no matching rows.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/group-by-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/group-by-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (158,37,'ELT','Syntax:\nELT(N,str1,str2,str3,...)\n\nReturns str1 if N = 1, str2 if N = 2, and so on. Returns NULL if N is\nless than 1 or greater than the number of arguments. ELT() is the\ncomplement of FIELD().\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/string-functions.html\n\n','mysql> SELECT ELT(1, \'ej\', \'Heja\', \'hej\', \'foo\');\n -> \'ej\'\nmysql> SELECT ELT(4, \'ej\', \'Heja\', \'hej\', \'foo\');\n -> \'foo\'\n','http://dev.mysql.com/doc/refman/5.5/en/string-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (159,39,'ALTER VIEW','Syntax:\nALTER\n [ALGORITHM = {UNDEFINED | MERGE | TEMPTABLE}]\n [DEFINER = { user | CURRENT_USER }]\n [SQL SECURITY { DEFINER | INVOKER }]\n VIEW view_name [(column_list)]\n AS select_statement\n [WITH [CASCADED | LOCAL] CHECK OPTION]\n\nThis statement changes the definition of a view, which must exist. The\nsyntax is similar to that for CREATE VIEW and the effect is the same as\nfor CREATE OR REPLACE VIEW. See [HELP CREATE VIEW]. This statement\nrequires the CREATE VIEW and DROP privileges for the view, and some\nprivilege for each column referred to in the SELECT statement. ALTER\nVIEW is permitted only to the definer or users with the SUPER\nprivilege.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/alter-view.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/alter-view.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (160,26,'SHOW DATABASES','Syntax:\nSHOW {DATABASES | SCHEMAS}\n [LIKE \'pattern\' | WHERE expr]\n\nSHOW DATABASES lists the databases on the MySQL server host. SHOW\nSCHEMAS is a synonym for SHOW DATABASES. The LIKE clause, if present,\nindicates which database names to match. The WHERE clause can be given\nto select rows using more general conditions, as discussed in\nhttp://dev.mysql.com/doc/refman/5.5/en/extended-show.html.\n\nYou see only those databases for which you have some kind of privilege,\nunless you have the global SHOW DATABASES privilege. You can also get\nthis list using the mysqlshow command.\n\nIf the server was started with the --skip-show-database option, you\ncannot use this statement at all unless you have the SHOW DATABASES\nprivilege.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/show-databases.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/show-databases.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (161,19,'~','Syntax:\n~\n\nInvert all bits.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/bit-functions.html\n\n','mysql> SELECT 5 & ~1;\n -> 4\n','http://dev.mysql.com/doc/refman/5.5/en/bit-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (162,22,'TEXT','TEXT[(M)] [CHARACTER SET charset_name] [COLLATE collation_name]\n\nA TEXT column with a maximum length of 65,535 (216 - 1) characters. The\neffective maximum length is less if the value contains multi-byte\ncharacters. Each TEXT value is stored using a 2-byte length prefix that\nindicates the number of bytes in the value.\n\nAn optional length M can be given for this type. If this is done, MySQL\ncreates the column as the smallest TEXT type large enough to hold\nvalues M characters long.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/string-type-overview.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (163,37,'CONCAT_WS','Syntax:\nCONCAT_WS(separator,str1,str2,...)\n\nCONCAT_WS() stands for Concatenate With Separator and is a special form\nof CONCAT(). The first argument is the separator for the rest of the\narguments. The separator is added between the strings to be\nconcatenated. The separator can be a string, as can the rest of the\narguments. If the separator is NULL, the result is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/string-functions.html\n\n','mysql> SELECT CONCAT_WS(\',\',\'First name\',\'Second name\',\'Last Name\');\n -> \'First name,Second name,Last Name\'\nmysql> SELECT CONCAT_WS(\',\',\'First name\',NULL,\'Last Name\');\n -> \'First name,Last Name\'\n','http://dev.mysql.com/doc/refman/5.5/en/string-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (164,17,'ROW_COUNT','Syntax:\nROW_COUNT()\n\nBefore MySQL 5.5.5, ROW_COUNT() returns the number of rows changed,\ndeleted, or inserted by the last statement if it was an UPDATE, DELETE,\nor INSERT. For other statements, the value may not be meaningful.\n\nAs of MySQL 5.5.5, ROW_COUNT() returns a value as follows:\n\no DDL statements: 0. This applies to statements such as CREATE TABLE or\n DROP TABLE.\n\no DML statements other than SELECT: The number of affected rows. This\n applies to statements such as UPDATE, INSERT, or DELETE (as before),\n but now also to statements such as ALTER TABLE and LOAD DATA INFILE.\n\no SELECT: -1 if the statement returns a result set, or the number of\n rows "affected" if it does not. For example, for SELECT * FROM t1,\n ROW_COUNT() returns -1. For SELECT * FROM t1 INTO OUTFILE\n \'file_name\', ROW_COUNT() returns the number of rows written to the\n file.\n\no SIGNAL statements: 0.\n\nFor UPDATE statements, the affected-rows value by default is the number\nof rows actually changed. If you specify the CLIENT_FOUND_ROWS flag to\nmysql_real_connect() when connecting to mysqld, the affected-rows value\nis the number of rows "found"; that is, matched by the WHERE clause.\n\nFor REPLACE statements, the affected-rows value is 2 if the new row\nreplaced an old row, because in this case, one row was inserted after\nthe duplicate was deleted.\n\nFor INSERT ... ON DUPLICATE KEY UPDATE statements, the affected-rows\nvalue is 1 if the row is inserted as a new row and 2 if an existing row\nis updated.\n\nThe ROW_COUNT() value is similar to the value from the\nmysql_affected_rows() C API function and the row count that the mysql\nclient displays following statement execution.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/information-functions.html\n\n','mysql> INSERT INTO t VALUES(1),(2),(3);\nQuery OK, 3 rows affected (0.00 sec)\nRecords: 3 Duplicates: 0 Warnings: 0\n\nmysql> SELECT ROW_COUNT();\n+-------------+\n| ROW_COUNT() |\n+-------------+\n| 3 |\n+-------------+\n1 row in set (0.00 sec)\n\nmysql> DELETE FROM t WHERE i IN(1,2);\nQuery OK, 2 rows affected (0.00 sec)\n\nmysql> SELECT ROW_COUNT();\n+-------------+\n| ROW_COUNT() |\n+-------------+\n| 2 |\n+-------------+\n1 row in set (0.00 sec)\n','http://dev.mysql.com/doc/refman/5.5/en/information-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (165,4,'ASIN','Syntax:\nASIN(X)\n\nReturns the arc sine of X, that is, the value whose sine is X. Returns\nNULL if X is not in the range -1 to 1.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/mathematical-functions.html\n\n','mysql> SELECT ASIN(0.2);\n -> 0.20135792079033\nmysql> SELECT ASIN(\'foo\');\n\n+-------------+\n| ASIN(\'foo\') |\n+-------------+\n| 0 |\n+-------------+\n1 row in set, 1 warning (0.00 sec)\n\nmysql> SHOW WARNINGS;\n+---------+------+-----------------------------------------+\n| Level | Code | Message |\n+---------+------+-----------------------------------------+\n| Warning | 1292 | Truncated incorrect DOUBLE value: \'foo\' |\n+---------+------+-----------------------------------------+\n','http://dev.mysql.com/doc/refman/5.5/en/mathematical-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (166,4,'SIGN','Syntax:\nSIGN(X)\n\nReturns the sign of the argument as -1, 0, or 1, depending on whether X\nis negative, zero, or positive.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/mathematical-functions.html\n\n','mysql> SELECT SIGN(-32);\n -> -1\nmysql> SELECT SIGN(0);\n -> 0\nmysql> SELECT SIGN(234);\n -> 1\n','http://dev.mysql.com/doc/refman/5.5/en/mathematical-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (167,31,'SEC_TO_TIME','Syntax:\nSEC_TO_TIME(seconds)\n\nReturns the seconds argument, converted to hours, minutes, and seconds,\nas a TIME value. The range of the result is constrained to that of the\nTIME data type. A warning occurs if the argument corresponds to a value\noutside that range.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html\n\n','mysql> SELECT SEC_TO_TIME(2378);\n -> \'00:39:38\'\nmysql> SELECT SEC_TO_TIME(2378) + 0;\n -> 3938\n','http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (168,22,'FLOAT','FLOAT[(M,D)] [UNSIGNED] [ZEROFILL]\n\nA small (single-precision) floating-point number. Permissible values\nare -3.402823466E+38 to -1.175494351E-38, 0, and 1.175494351E-38 to\n3.402823466E+38. These are the theoretical limits, based on the IEEE\nstandard. The actual range might be slightly smaller depending on your\nhardware or operating system.\n\nM is the total number of digits and D is the number of digits following\nthe decimal point. If M and D are omitted, values are stored to the\nlimits permitted by the hardware. A single-precision floating-point\nnumber is accurate to approximately 7 decimal places.\n\nUNSIGNED, if specified, disallows negative values.\n\nUsing FLOAT might give you some unexpected problems because all\ncalculations in MySQL are done with double precision. See\nhttp://dev.mysql.com/doc/refman/5.5/en/no-matching-rows.html.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/numeric-type-overview.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (169,37,'LOCATE','Syntax:\nLOCATE(substr,str), LOCATE(substr,str,pos)\n\nThe first syntax returns the position of the first occurrence of\nsubstring substr in string str. The second syntax returns the position\nof the first occurrence of substring substr in string str, starting at\nposition pos. Returns 0 if substr is not in str.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/string-functions.html\n\n','mysql> SELECT LOCATE(\'bar\', \'foobarbar\');\n -> 4\nmysql> SELECT LOCATE(\'xbar\', \'foobar\');\n -> 0\nmysql> SELECT LOCATE(\'bar\', \'foobarbar\', 5);\n -> 7\n','http://dev.mysql.com/doc/refman/5.5/en/string-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (170,26,'SHOW EVENTS','Syntax:\nSHOW EVENTS [{FROM | IN} schema_name]\n [LIKE \'pattern\' | WHERE expr]\n\nThis statement displays information about Event Manager events. It\nrequires the EVENT privilege for the database from which the events are\nto be shown.\n\nIn its simplest form, SHOW EVENTS lists all of the events in the\ncurrent schema:\n\nmysql> SELECT CURRENT_USER(), SCHEMA();\n+----------------+----------+\n| CURRENT_USER() | SCHEMA() |\n+----------------+----------+\n| jon@ghidora | myschema |\n+----------------+----------+\n1 row in set (0.00 sec)\n\nmysql> SHOW EVENTS\\G\n*************************** 1. row ***************************\n Db: myschema\n Name: e_daily\n Definer: jon@ghidora\n Time zone: SYSTEM\n Type: RECURRING\n Execute at: NULL\n Interval value: 10\n Interval field: SECOND\n Starts: 2006-02-09 10:41:23\n Ends: NULL\n Status: ENABLED\n Originator: 0\ncharacter_set_client: latin1\ncollation_connection: latin1_swedish_ci\n Database Collation: latin1_swedish_ci\n\nTo see events for a specific schema, use the FROM clause. For example,\nto see events for the test schema, use the following statement:\n\nSHOW EVENTS FROM test;\n\nThe LIKE clause, if present, indicates which event names to match. The\nWHERE clause can be given to select rows using more general conditions,\nas discussed in\nhttp://dev.mysql.com/doc/refman/5.5/en/extended-show.html.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/show-events.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/show-events.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (171,17,'CHARSET','Syntax:\nCHARSET(str)\n\nReturns the character set of the string argument.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/information-functions.html\n\n','mysql> SELECT CHARSET(\'abc\');\n -> \'latin1\'\nmysql> SELECT CHARSET(CONVERT(\'abc\' USING utf8));\n -> \'utf8\'\nmysql> SELECT CHARSET(USER());\n -> \'utf8\'\n','http://dev.mysql.com/doc/refman/5.5/en/information-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (172,31,'SUBDATE','Syntax:\nSUBDATE(date,INTERVAL expr unit), SUBDATE(expr,days)\n\nWhen invoked with the INTERVAL form of the second argument, SUBDATE()\nis a synonym for DATE_SUB(). For information on the INTERVAL unit\nargument, see the discussion for DATE_ADD().\n\nmysql> SELECT DATE_SUB(\'2008-01-02\', INTERVAL 31 DAY);\n -> \'2007-12-02\'\nmysql> SELECT SUBDATE(\'2008-01-02\', INTERVAL 31 DAY);\n -> \'2007-12-02\'\n\nThe second form enables the use of an integer value for days. In such\ncases, it is interpreted as the number of days to be subtracted from\nthe date or datetime expression expr.\n\nmysql> SELECT SUBDATE(\'2008-01-02 12:00:00\', 31);\n -> \'2007-12-02 12:00:00\'\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (173,31,'DAYOFYEAR','Syntax:\nDAYOFYEAR(date)\n\nReturns the day of the year for date, in the range 1 to 366.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html\n\n','mysql> SELECT DAYOFYEAR(\'2007-02-03\');\n -> 34\n','http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (174,4,'%','Syntax:\nN % M, N MOD M\n\nModulo operation. Returns the remainder of N divided by M. For more\ninformation, see the description for the MOD() function in\nhttp://dev.mysql.com/doc/refman/5.5/en/mathematical-functions.html.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/arithmetic-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/arithmetic-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (175,22,'LONGTEXT','LONGTEXT [CHARACTER SET charset_name] [COLLATE collation_name]\n\nA TEXT column with a maximum length of 4,294,967,295 or 4GB (232 - 1)\ncharacters. The effective maximum length is less if the value contains\nmulti-byte characters. The effective maximum length of LONGTEXT columns\nalso depends on the configured maximum packet size in the client/server\nprotocol and available memory. Each LONGTEXT value is stored using a\n4-byte length prefix that indicates the number of bytes in the value.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/string-type-overview.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (176,26,'KILL','Syntax:\nKILL [CONNECTION | QUERY] thread_id\n\nEach connection to mysqld runs in a separate thread. You can see which\nthreads are running with the SHOW PROCESSLIST statement and kill a\nthread with the KILL thread_id statement.\n\nKILL permits an optional CONNECTION or QUERY modifier:\n\no KILL CONNECTION is the same as KILL with no modifier: It terminates\n the connection associated with the given thread_id.\n\no KILL QUERY terminates the statement that the connection is currently\n executing, but leaves the connection itself intact.\n\nIf you have the PROCESS privilege, you can see all threads. If you have\nthe SUPER privilege, you can kill all threads and statements.\nOtherwise, you can see and kill only your own threads and statements.\n\nYou can also use the mysqladmin processlist and mysqladmin kill\ncommands to examine and kill threads.\n\n*Note*: You cannot use KILL with the Embedded MySQL Server library\nbecause the embedded server merely runs inside the threads of the host\napplication. It does not create any connection threads of its own.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/kill.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/kill.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (177,30,'DISJOINT','Disjoint(g1,g2)\n\nReturns 1 or 0 to indicate whether g1 is spatially disjoint from (does\nnot intersect) g2.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/functions-for-testing-spatial-relations-between-geometric-objects.html#functions-that-test-spatial-relationships-between-geometries\n\n','','http://dev.mysql.com/doc/refman/5.5/en/functions-for-testing-spatial-relations-between-geometric-objects.html#functions-that-test-spatial-relationships-between-geometries'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (178,3,'ASTEXT','AsText(g), AsWKT(g)\n\nConverts a value in internal geometry format to its WKT representation\nand returns the string result.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/functions-to-convert-geometries-between-formats.html\n\n','mysql> SET @g = \'LineString(1 1,2 2,3 3)\';\nmysql> SELECT AsText(GeomFromText(@g));\n+--------------------------+\n| AsText(GeomFromText(@g)) |\n+--------------------------+\n| LINESTRING(1 1,2 2,3 3) |\n+--------------------------+\n','http://dev.mysql.com/doc/refman/5.5/en/functions-to-convert-geometries-between-formats.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (179,37,'LPAD','Syntax:\nLPAD(str,len,padstr)\n\nReturns the string str, left-padded with the string padstr to a length\nof len characters. If str is longer than len, the return value is\nshortened to len characters.\n\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/string-functions.html\n\n','mysql> SELECT LPAD(\'hi\',4,\'??\');\n -> \'??hi\'\nmysql> SELECT LPAD(\'hi\',1,\'??\');\n -> \'h\'\n','http://dev.mysql.com/doc/refman/5.5/en/string-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (180,23,'DECLARE CONDITION','Syntax:\nDECLARE condition_name CONDITION FOR condition_value\n\ncondition_value:\n mysql_error_code\n | SQLSTATE [VALUE] sqlstate_value\n\nThe DECLARE ... CONDITION statement declares a named error condition,\nassociating a name with a condition that needs specific handling. The\nname can be referred to in a subsequent DECLARE ... HANDLER statement\n(see [HELP DECLARE HANDLER]).\n\nCondition declarations must appear before cursor or handler\ndeclarations.\n\nThe condition_value for DECLARE ... CONDITION can be a MySQL error code\n(a number) or an SQLSTATE value (a 5-character string literal). You\nshould not use MySQL error code 0 or SQLSTATE values that begin with\n\'00\', because those indicate success rather than an error condition.\nFor a list of MySQL error codes and SQLSTATE values, see\nhttp://dev.mysql.com/doc/refman/5.5/en/error-messages-server.html.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/declare-condition.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/declare-condition.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (181,30,'OVERLAPS','Overlaps(g1,g2)\n\nReturns 1 or 0 to indicate whether g1 spatially overlaps g2. The term\nspatially overlaps is used if two geometries intersect and their\nintersection results in a geometry of the same dimension but not equal\nto either of the given geometries.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/functions-for-testing-spatial-relations-between-geometric-objects.html#functions-that-test-spatial-relationships-between-geometries\n\n','','http://dev.mysql.com/doc/refman/5.5/en/functions-for-testing-spatial-relations-between-geometric-objects.html#functions-that-test-spatial-relationships-between-geometries'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (182,8,'SET GLOBAL SQL_SLAVE_SKIP_COUNTER','Syntax:\nSET GLOBAL sql_slave_skip_counter = N\n\nThis statement skips the next N events from the master. This is useful\nfor recovering from replication stops caused by a statement.\n\nThis statement is valid only when the slave threads are not running.\nOtherwise, it produces an error.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/set-global-sql-slave-skip-counter.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/set-global-sql-slave-skip-counter.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (183,25,'NUMGEOMETRIES','NumGeometries(gc)\n\nReturns the number of geometries in the GeometryCollection value gc.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/geometry-property-functions.html#geometrycollection-property-functions\n\n','mysql> SET @gc = \'GeometryCollection(Point(1 1),LineString(2 2, 3 3))\';\nmysql> SELECT NumGeometries(GeomFromText(@gc));\n+----------------------------------+\n| NumGeometries(GeomFromText(@gc)) |\n+----------------------------------+\n| 2 |\n+----------------------------------+\n','http://dev.mysql.com/doc/refman/5.5/en/geometry-property-functions.html#geometrycollection-property-functions'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (184,31,'MONTHNAME','Syntax:\nMONTHNAME(date)\n\nReturns the full name of the month for date. The language used for the\nname is controlled by the value of the lc_time_names system variable\n(http://dev.mysql.com/doc/refman/5.5/en/locale-support.html).\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html\n\n','mysql> SELECT MONTHNAME(\'2008-02-03\');\n -> \'February\'\n','http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (185,8,'CHANGE MASTER TO','Syntax:\nCHANGE MASTER TO option [, option] ...\n\noption:\n MASTER_BIND = \'interface_name\'\n | MASTER_HOST = \'host_name\'\n | MASTER_USER = \'user_name\'\n | MASTER_PASSWORD = \'password\'\n | MASTER_PORT = port_num\n | MASTER_CONNECT_RETRY = interval\n | MASTER_HEARTBEAT_PERIOD = interval\n | MASTER_LOG_FILE = \'master_log_name\'\n | MASTER_LOG_POS = master_log_pos\n | RELAY_LOG_FILE = \'relay_log_name\'\n | RELAY_LOG_POS = relay_log_pos\n | MASTER_SSL = {0|1}\n | MASTER_SSL_CA = \'ca_file_name\'\n | MASTER_SSL_CAPATH = \'ca_directory_name\'\n | MASTER_SSL_CERT = \'cert_file_name\'\n | MASTER_SSL_KEY = \'key_file_name\'\n | MASTER_SSL_CIPHER = \'cipher_list\'\n | MASTER_SSL_VERIFY_SERVER_CERT = {0|1}\n | IGNORE_SERVER_IDS = (server_id_list)\n\nserver_id_list:\n [server_id [, server_id] ... ]\n\nCHANGE MASTER TO changes the parameters that the slave server uses for\nconnecting to the master server, for reading the master binary log, and\nreading the slave relay log. It also updates the contents of the\nmaster.info and relay-log.info files. To use CHANGE MASTER TO, the\nslave replication threads must be stopped (use STOP SLAVE if\nnecessary).\n\nOptions not specified retain their value, except as indicated in the\nfollowing discussion. Thus, in most cases, there is no need to specify\noptions that do not change. For example, if the password to connect to\nyour MySQL master has changed, you just need to issue these statements\nto tell the slave about the new password:\n\nSTOP SLAVE; -- if replication was running\nCHANGE MASTER TO MASTER_PASSWORD=\'new3cret\';\nSTART SLAVE; -- if you want to restart replication\n\nMASTER_HOST, MASTER_USER, MASTER_PASSWORD, and MASTER_PORT provide\ninformation to the slave about how to connect to its master:\n\no MASTER_HOST and MASTER_PORT are the host name (or IP address) of the\n master host and its TCP/IP port.\n\n *Note*: Replication cannot use Unix socket files. You must be able to\n connect to the master MySQL server using TCP/IP.\n\n If you specify the MASTER_HOST or MASTER_PORT option, the slave\n assumes that the master server is different from before (even if the\n option value is the same as its current value.) In this case, the old\n values for the master binary log file name and position are\n considered no longer applicable, so if you do not specify\n MASTER_LOG_FILE and MASTER_LOG_POS in the statement,\n MASTER_LOG_FILE=\'\' and MASTER_LOG_POS=4 are silently appended to it.\n\n Setting MASTER_HOST=\'\' (that is, setting its value explicitly to an\n empty string) is not the same as not setting MASTER_HOST at all.\n Beginning with MySQL 5.5, trying to set MASTER_HOST to an empty\n string fails with an error. Previously, setting MASTER_HOST to an\n empty string caused START SLAVE subsequently to fail. (Bug #28796)\n\no MASTER_USER and MASTER_PASSWORD are the user name and password of the\n account to use for connecting to the master.\n\n In MySQL 5.5.20 and later, MASTER_USER cannot be made empty; setting\n MASTER_USER = \'\' or leaving it unset when setting a value for for\n MASTER_PASSWORD causes an error (Bug #13427949).\n\n Currently, a password used for a replication slave account is\n effectively limited to 32 characters in length; the password can be\n longer, but any excess characters are truncated. This is not due to\n any limit imposed by the MySQL Server generally, but rather is an\n issue specific to MySQL Replication. (For more information, see Bug\n #43439.)\n\n The text of a running CHANGE MASTER TO statement, including values\n for MASTER_USER and MASTER_PASSWORD, can be seen in the output of a\n concurrent SHOW PROCESSLIST statement.\n\nThe MASTER_SSL_xxx options provide information about using SSL for the\nconnection. They correspond to the --ssl-xxx options described in\nhttp://dev.mysql.com/doc/refman/5.5/en/ssl-options.html, and\nhttp://dev.mysql.com/doc/refman/5.5/en/replication-solutions-ssl.html.\nThese options can be changed even on slaves that are compiled without\nSSL support. They are saved to the master.info file, but are ignored if\nthe slave does not have SSL support enabled.\n\nMASTER_CONNECT_RETRY specifies how many seconds to wait between connect\nretries. The default is 60. The number of reconnection attempts is\nlimited by the --master-retry-count server option; for more\ninformation, see\nhttp://dev.mysql.com/doc/refman/5.5/en/replication-options.html.\n\nThe MASTER_BIND option is available in MySQL Cluster NDB 7.2 and later,\nbut is not supported in mainline MySQL 5.5.\n\nMASTER_BIND is for use on replication slaves having multiple network\ninterfaces, and determines which of the slave\'s network interfaces is\nchosen for connecting to the master.\n\nMASTER_HEARTBEAT_PERIOD sets the interval in seconds between\nreplication heartbeats. Whenever the master\'s binary log is updated\nwith an event, the waiting period for the next heartbeat is reset.\ninterval is a decimal value having the range 0 to 4294967 seconds and a\nresolution in milliseconds; the smallest nonzero value is 0.001.\nHeartbeats are sent by the master only if there are no unsent events in\nthe binary log file for a period longer than interval.\n\nSetting interval to 0 disables heartbeats altogether. The default value\nfor interval is equal to the value of slave_net_timeout divided by 2.\n\nSetting @@global.slave_net_timeout to a value less than that of the\ncurrent heartbeat interval results in a warning being issued. The\neffect of issuing RESET SLAVE on the heartbeat interval is to reset it\nto the default value.\n\nMASTER_LOG_FILE and MASTER_LOG_POS are the coordinates at which the\nslave I/O thread should begin reading from the master the next time the\nthread starts. RELAY_LOG_FILE and RELAY_LOG_POS are the coordinates at\nwhich the slave SQL thread should begin reading from the relay log the\nnext time the thread starts. If you specify either of MASTER_LOG_FILE\nor MASTER_LOG_POS, you cannot specify RELAY_LOG_FILE or RELAY_LOG_POS.\nIf neither of MASTER_LOG_FILE or MASTER_LOG_POS is specified, the slave\nuses the last coordinates of the slave SQL thread before CHANGE MASTER\nTO was issued. This ensures that there is no discontinuity in\nreplication, even if the slave SQL thread was late compared to the\nslave I/O thread, when you merely want to change, say, the password to\nuse.\n\nCHANGE MASTER TO deletes all relay log files and starts a new one,\nunless you specify RELAY_LOG_FILE or RELAY_LOG_POS. In that case, relay\nlog files are kept; the relay_log_purge global variable is set silently\nto 0.\n\nPrior to MySQL 5.5, RELAY_LOG_FILE required an absolute path. In MySQL\n5.5, the path can be relative, in which case the path is assumed to be\nrelative to the slave\'s data directory. (Bug #12190)\n\nIGNORE_SERVER_IDS was added in MySQL 5.5. This option takes a\ncomma-separated list of 0 or more server IDs. Events originating from\nthe corresponding servers are ignored, with the exception of log\nrotation and deletion events, which are still recorded in the relay\nlog.\n\nIn circular replication, the originating server normally acts as the\nterminator of its own events, so that they are not applied more than\nonce. Thus, this option is useful in circular replication when one of\nthe servers in the circle is removed. Suppose that you have a circular\nreplication setup with 4 servers, having server IDs 1, 2, 3, and 4, and\nserver 3 fails. When bridging the gap by starting replication from\nserver 2 to server 4, you can include IGNORE_SERVER_IDS = (3) in the\nCHANGE MASTER TO statement that you issue on server 4 to tell it to use\nserver 2 as its master instead of server 3. Doing so causes it to\nignore and not to propagate any statements that originated with the\nserver that is no longer in use.\n\nIf a CHANGE MASTER TO statement is issued without any IGNORE_SERVER_IDS\noption, any existing list is preserved; RESET SLAVE also has no effect\non the server ID list. To clear the list of ignored servers, it is\nnecessary to use the option with an empty list:\n\nCHANGE MASTER TO IGNORE_SERVER_IDS = ();\n\nIf IGNORE_SERVER_IDS contains the server\'s own ID and the server was\nstarted with the --replicate-same-server-id option enabled, an error\nresults.\n\nAlso beginning with MySQL 5.5, the master.info file and the output of\nSHOW SLAVE STATUS are extended to provide the list of servers that are\ncurrently ignored. For more information, see\nhttp://dev.mysql.com/doc/refman/5.5/en/slave-logs-status.html, and\n[HELP SHOW SLAVE STATUS].\n\nBeginning with MySQL 5.5.5, invoking CHANGE MASTER TO causes the\nprevious values for MASTER_HOST, MASTER_PORT, MASTER_LOG_FILE, and\nMASTER_LOG_POS to be written to the error log, along with other\ninformation about the slave\'s state prior to execution.\n\nCHANGE MASTER TO is useful for setting up a slave when you have the\nsnapshot of the master and have recorded the master binary log\ncoordinates corresponding to the time of the snapshot. After loading\nthe snapshot into the slave to synchronize it to the slave, you can run\nCHANGE MASTER TO MASTER_LOG_FILE=\'log_name\', MASTER_LOG_POS=log_pos on\nthe slave to specify the coordinates at which the slave should begin\nreading the master binary log.\n\nThe following example changes the master server the slave uses and\nestablishes the master binary log coordinates from which the slave\nbegins reading. This is used when you want to set up the slave to\nreplicate the master:\n\nCHANGE MASTER TO\n MASTER_HOST=\'master2.mycompany.com\',\n MASTER_USER=\'replication\',\n MASTER_PASSWORD=\'bigs3cret\',\n MASTER_PORT=3306,\n MASTER_LOG_FILE=\'master2-bin.001\',\n MASTER_LOG_POS=4,\n MASTER_CONNECT_RETRY=10;\n\nThe next example shows an operation that is less frequently employed.\nIt is used when the slave has relay log files that you want it to\nexecute again for some reason. To do this, the master need not be\nreachable. You need only use CHANGE MASTER TO and start the SQL thread\n(START SLAVE SQL_THREAD):\n\nCHANGE MASTER TO\n RELAY_LOG_FILE=\'slave-relay-bin.006\',\n RELAY_LOG_POS=4025;\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/change-master-to.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/change-master-to.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (186,39,'DROP DATABASE','Syntax:\nDROP {DATABASE | SCHEMA} [IF EXISTS] db_name\n\nDROP DATABASE drops all tables in the database and deletes the\ndatabase. Be very careful with this statement! To use DROP DATABASE,\nyou need the DROP privilege on the database. DROP SCHEMA is a synonym\nfor DROP DATABASE.\n\n*Important*: When a database is dropped, user privileges on the\ndatabase are not automatically dropped. See [HELP GRANT].\n\nIF EXISTS is used to prevent an error from occurring if the database\ndoes not exist.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/drop-database.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/drop-database.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (187,6,'MBREQUAL','MBREqual(g1,g2)\n\nReturns 1 or 0 to indicate whether the Minimum Bounding Rectangles of\nthe two geometries g1 and g2 are the same.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/functions-for-testing-spatial-relations-between-geometric-objects.html#relations-on-geometry-mbr\n\n','','http://dev.mysql.com/doc/refman/5.5/en/functions-for-testing-spatial-relations-between-geometric-objects.html#relations-on-geometry-mbr'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (188,31,'TIMESTAMP FUNCTION','Syntax:\nTIMESTAMP(expr), TIMESTAMP(expr1,expr2)\n\nWith a single argument, this function returns the date or datetime\nexpression expr as a datetime value. With two arguments, it adds the\ntime expression expr2 to the date or datetime expression expr1 and\nreturns the result as a datetime value.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html\n\n','mysql> SELECT TIMESTAMP(\'2003-12-31\');\n -> \'2003-12-31 00:00:00\'\nmysql> SELECT TIMESTAMP(\'2003-12-31 12:00:00\',\'12:00:00\');\n -> \'2004-01-01 00:00:00\'\n','http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (189,33,'PROCEDURE ANALYSE','Syntax:\nANALYSE([max_elements[,max_memory]])\n\nANALYSE() examines the result from a query and returns an analysis of\nthe results that suggests optimal data types for each column that may\nhelp reduce table sizes. To obtain this analysis, append PROCEDURE\nANALYSE to the end of a SELECT statement:\n\nSELECT ... FROM ... WHERE ... PROCEDURE ANALYSE([max_elements,[max_memory]])\n\nFor example:\n\nSELECT col1, col2 FROM table1 PROCEDURE ANALYSE(10, 2000);\n\nThe results show some statistics for the values returned by the query,\nand propose an optimal data type for the columns. This can be helpful\nfor checking your existing tables, or after importing new data. You may\nneed to try different settings for the arguments so that PROCEDURE\nANALYSE() does not suggest the ENUM data type when it is not\nappropriate.\n\nThe arguments are optional and are used as follows:\n\no max_elements (default 256) is the maximum number of distinct values\n that ANALYSE() notices per column. This is used by ANALYSE() to check\n whether the optimal data type should be of type ENUM; if there are\n more than max_elements distinct values, then ENUM is not a suggested\n type.\n\no max_memory (default 8192) is the maximum amount of memory that\n ANALYSE() should allocate per column while trying to find all\n distinct values.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/procedure-analyse.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/procedure-analyse.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (190,9,'HELP_VERSION','This help information was generated from the MySQL 5.5 Reference Manual\non: 2012-08-25 (revision: 31914)\n\nThis information applies to MySQL 5.5 through 5.5.29.\n','',''); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (191,37,'CHARACTER_LENGTH','Syntax:\nCHARACTER_LENGTH(str)\n\nCHARACTER_LENGTH() is a synonym for CHAR_LENGTH().\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/string-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/string-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (192,26,'SHOW GRANTS','Syntax:\nSHOW GRANTS [FOR user]\n\nThis statement lists the GRANT statement or statements that must be\nissued to duplicate the privileges that are granted to a MySQL user\naccount. The account is named using the same format as for the GRANT\nstatement; for example, \'jeffrey\'@\'localhost\'. If you specify only the\nuser name part of the account name, a host name part of \'%\' is used.\nFor additional information about specifying account names, see [HELP\nGRANT].\n\nmysql> SHOW GRANTS FOR \'root\'@\'localhost\';\n+---------------------------------------------------------------------+\n| Grants for root@localhost |\n+---------------------------------------------------------------------+\n| GRANT ALL PRIVILEGES ON *.* TO \'root\'@\'localhost\' WITH GRANT OPTION |\n+---------------------------------------------------------------------+\n\nTo list the privileges granted to the account that you are using to\nconnect to the server, you can use any of the following statements:\n\nSHOW GRANTS;\nSHOW GRANTS FOR CURRENT_USER;\nSHOW GRANTS FOR CURRENT_USER();\n\nIf SHOW GRANTS FOR CURRENT_USER (or any of the equivalent syntaxes) is\nused in DEFINER context, such as within a stored procedure that is\ndefined with SQL SECURITY DEFINER), the grants displayed are those of\nthe definer and not the invoker.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/show-grants.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/show-grants.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (193,26,'SHOW PRIVILEGES','Syntax:\nSHOW PRIVILEGES\n\nSHOW PRIVILEGES shows the list of system privileges that the MySQL\nserver supports. The exact list of privileges depends on the version of\nyour server.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/show-privileges.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/show-privileges.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (194,39,'CREATE TABLESPACE','Syntax:\nCREATE TABLESPACE tablespace_name\n ADD DATAFILE \'file_name\'\n USE LOGFILE GROUP logfile_group\n [EXTENT_SIZE [=] extent_size]\n [INITIAL_SIZE [=] initial_size]\n [AUTOEXTEND_SIZE [=] autoextend_size]\n [MAX_SIZE [=] max_size]\n [NODEGROUP [=] nodegroup_id]\n [WAIT]\n [COMMENT [=] comment_text]\n ENGINE [=] engine_name\n\nThis statement is used to create a tablespace, which can contain one or\nmore data files, providing storage space for tables. One data file is\ncreated and added to the tablespace using this statement. Additional\ndata files may be added to the tablespace by using the ALTER TABLESPACE\nstatement (see [HELP ALTER TABLESPACE]). For rules covering the naming\nof tablespaces, see\nhttp://dev.mysql.com/doc/refman/5.5/en/identifiers.html.\n\n*Note*: All MySQL Cluster Disk Data objects share the same namespace.\nThis means that each Disk Data object must be uniquely named (and not\nmerely each Disk Data object of a given type). For example, you cannot\nhave a tablespace and a log file group with the same name, or a\ntablespace and a data file with the same name.\n\nA log file group of one or more UNDO log files must be assigned to the\ntablespace to be created with the USE LOGFILE GROUP clause.\nlogfile_group must be an existing log file group created with CREATE\nLOGFILE GROUP (see\nhttp://dev.mysql.com/doc/refman/5.5/en/create-logfile-group.html).\nMultiple tablespaces may use the same log file group for UNDO logging.\n\nThe EXTENT_SIZE sets the size, in bytes, of the extents used by any\nfiles belonging to the tablespace. The default value is 1M. The minimum\nsize is 32K, and theoretical maximum is 2G, although the practical\nmaximum size depends on a number of factors. In most cases, changing\nthe extent size does not have any measurable effect on performance, and\nthe default value is recommended for all but the most unusual\nsituations.\n\nAn extent is a unit of disk space allocation. One extent is filled with\nas much data as that extent can contain before another extent is used.\nIn theory, up to 65,535 (64K) extents may used per data file; however,\nthe recommended maximum is 32,768 (32K). The recommended maximum size\nfor a single data file is 32G---that is, 32K extents x 1 MB per extent.\nIn addition, once an extent is allocated to a given partition, it\ncannot be used to store data from a different partition; an extent\ncannot store data from more than one partition. This means, for example\nthat a tablespace having a single datafile whose INITIAL_SIZE is 256 MB\nand whose EXTENT_SIZE is 128M has just two extents, and so can be used\nto store data from at most two different disk data table partitions.\n\nYou can see how many extents remain free in a given data file by\nquerying the INFORMATION_SCHEMA.FILES table, and so derive an estimate\nfor how much space remains free in the file. For further discussion and\nexamples, see http://dev.mysql.com/doc/refman/5.5/en/files-table.html.\n\nThe INITIAL_SIZE parameter sets the data file\'s total size in bytes.\nOnce the file has been created, its size cannot be changed; however,\nyou can add more data files to the tablespace using ALTER TABLESPACE\n... ADD DATAFILE. See [HELP ALTER TABLESPACE].\n\nINITIAL_SIZE is optional; its default value is 128M.\n\nOn 32-bit systems, the maximum supported value for INITIAL_SIZE is 4G.\n(Bug #29186)\n\nWhen setting EXTENT_SIZE or INITIAL_SIZE (either or both), you may\noptionally follow the number with a one-letter abbreviation for an\norder of magnitude, similar to those used in my.cnf. Generally, this is\none of the letters M (for megabytes) or G (for gigabytes).\n\nINITIAL_SIZE, EXTENT_SIZE, and UNDO_BUFFER_SIZE are subject to rounding\nas follows:\n\no EXTENT_SIZE and UNDO_BUFFER_SIZE are each rounded up to the nearest\n whole multiple of 32K.\n\no INITIAL_SIZE is rounded down to the nearest whole multiple of 32K.\n\n For data files, INITIAL_SIZE is subject to further rounding; the\n result just obtained is rounded up to the nearest whole multiple of\n EXTENT_SIZE (after any rounding).\n\nThe rounding just described is done explicitly, and a warning is issued\nby the MySQL Server when any such rounding is performed. The rounded\nvalues are also used by the NDB kernel for calculating\nINFORMATION_SCHEMA.FILES column values and other purposes. However, to\navoid an unexpected result, we suggest that you always use whole\nmultiples of 32K in specifying these options.\n\nAUTOEXTEND_SIZE, MAX_SIZE, NODEGROUP, WAIT, and COMMENT are parsed but\nignored, and so currently have no effect. These options are intended\nfor future expansion.\n\nThe ENGINE parameter determines the storage engine which uses this\ntablespace, with engine_name being the name of the storage engine.\nCurrently, engine_name must be one of the values NDB or NDBCLUSTER.\n\nWhen CREATE TABLESPACE is used with ENGINE = NDB, a tablespace and\nassociated data file are created on each Cluster data node. You can\nverify that the data files were created and obtain information about\nthem by querying the INFORMATION_SCHEMA.FILES table. For example:\n\nmysql> SELECT LOGFILE_GROUP_NAME, FILE_NAME, EXTRA\n -> FROM INFORMATION_SCHEMA.FILES\n -> WHERE TABLESPACE_NAME = \'newts\' AND FILE_TYPE = \'DATAFILE\';\n+--------------------+-------------+----------------+\n| LOGFILE_GROUP_NAME | FILE_NAME | EXTRA |\n+--------------------+-------------+----------------+\n| lg_3 | newdata.dat | CLUSTER_NODE=3 |\n| lg_3 | newdata.dat | CLUSTER_NODE=4 |\n+--------------------+-------------+----------------+\n2 rows in set (0.01 sec)\n\n(See http://dev.mysql.com/doc/refman/5.5/en/files-table.html.)\n\nCREATE TABLESPACE is useful only with Disk Data storage for MySQL\nCluster. See\nhttp://dev.mysql.com/doc/refman/5.5/en/mysql-cluster-disk-data.html.\n\nTo drop a primary key, the index name is always PRIMARY, which must be\nspecified as a quoted identifier because PRIMARY is a reserved word:\n\nDROP INDEX `PRIMARY` ON t;\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/create-tablespace.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/create-tablespace.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (195,37,'INSERT FUNCTION','Syntax:\nINSERT(str,pos,len,newstr)\n\nReturns the string str, with the substring beginning at position pos\nand len characters long replaced by the string newstr. Returns the\noriginal string if pos is not within the length of the string. Replaces\nthe rest of the string from position pos if len is not within the\nlength of the rest of the string. Returns NULL if any argument is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/string-functions.html\n\n','mysql> SELECT INSERT(\'Quadratic\', 3, 4, \'What\');\n -> \'QuWhattic\'\nmysql> SELECT INSERT(\'Quadratic\', -1, 4, \'What\');\n -> \'Quadratic\'\nmysql> SELECT INSERT(\'Quadratic\', 3, 100, \'What\');\n -> \'QuWhat\'\n','http://dev.mysql.com/doc/refman/5.5/en/string-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (196,4,'CRC32','Syntax:\nCRC32(expr)\n\nComputes a cyclic redundancy check value and returns a 32-bit unsigned\nvalue. The result is NULL if the argument is NULL. The argument is\nexpected to be a string and (if possible) is treated as one if it is\nnot.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/mathematical-functions.html\n\n','mysql> SELECT CRC32(\'MySQL\');\n -> 3259397556\nmysql> SELECT CRC32(\'mysql\');\n -> 2501908538\n','http://dev.mysql.com/doc/refman/5.5/en/mathematical-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (197,15,'XOR','Syntax:\nXOR\n\nLogical XOR. Returns NULL if either operand is NULL. For non-NULL\noperands, evaluates to 1 if an odd number of operands is nonzero,\notherwise 0 is returned.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/logical-operators.html\n\n','mysql> SELECT 1 XOR 1;\n -> 0\nmysql> SELECT 1 XOR 0;\n -> 1\nmysql> SELECT 1 XOR NULL;\n -> NULL\nmysql> SELECT 1 XOR 1 XOR 1;\n -> 1\n','http://dev.mysql.com/doc/refman/5.5/en/logical-operators.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (198,13,'STARTPOINT','StartPoint(ls)\n\nReturns the Point that is the start point of the LineString value ls.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/geometry-property-functions.html#linestring-property-functions\n\n','mysql> SET @ls = \'LineString(1 1,2 2,3 3)\';\nmysql> SELECT AsText(StartPoint(GeomFromText(@ls)));\n+---------------------------------------+\n| AsText(StartPoint(GeomFromText(@ls))) |\n+---------------------------------------+\n| POINT(1 1) |\n+---------------------------------------+\n','http://dev.mysql.com/doc/refman/5.5/en/geometry-property-functions.html#linestring-property-functions'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (199,10,'GRANT','Syntax:\nGRANT\n priv_type [(column_list)]\n [, priv_type [(column_list)]] ...\n ON [object_type] priv_level\n TO user_specification [, user_specification] ...\n [REQUIRE {NONE | ssl_option [[AND] ssl_option] ...}]\n [WITH with_option ...]\n\nGRANT PROXY ON user_specification\n TO user_specification [, user_specification] ...\n [WITH GRANT OPTION]\n\nobject_type:\n TABLE\n | FUNCTION\n | PROCEDURE\n\npriv_level:\n *\n | *.*\n | db_name.*\n | db_name.tbl_name\n | tbl_name\n | db_name.routine_name\n\nuser_specification:\n user\n [\n IDENTIFIED BY [PASSWORD] \'password\'\n | IDENTIFIED WITH auth_plugin [AS \'auth_string\']\n ]\n\nssl_option:\n SSL\n | X509\n | CIPHER \'cipher\'\n | ISSUER \'issuer\'\n | SUBJECT \'subject\'\n\nwith_option:\n GRANT OPTION\n | MAX_QUERIES_PER_HOUR count\n | MAX_UPDATES_PER_HOUR count\n | MAX_CONNECTIONS_PER_HOUR count\n | MAX_USER_CONNECTIONS count\n\nThe GRANT statement grants privileges to MySQL user accounts. GRANT\nalso serves to specify other account characteristics such as use of\nsecure connections and limits on access to server resources. To use\nGRANT, you must have the GRANT OPTION privilege, and you must have the\nprivileges that you are granting.\n\nNormally, a database administrator first uses CREATE USER to create an\naccount, then GRANT to define its privileges and characteristics. For\nexample:\n\nCREATE USER \'jeffrey\'@\'localhost\' IDENTIFIED BY \'mypass\';\nGRANT ALL ON db1.* TO \'jeffrey\'@\'localhost\';\nGRANT SELECT ON db2.invoice TO \'jeffrey\'@\'localhost\';\nGRANT USAGE ON *.* TO \'jeffrey\'@\'localhost\' WITH MAX_QUERIES_PER_HOUR 90;\n\nHowever, if an account named in a GRANT statement does not already\nexist, GRANT may create it under the conditions described later in the\ndiscussion of the NO_AUTO_CREATE_USER SQL mode.\n\nThe REVOKE statement is related to GRANT and enables administrators to\nremove account privileges. See [HELP REVOKE].\n\nWhen successfully executed from the mysql program, GRANT responds with\nQuery OK, 0 rows affected. To determine what privileges result from the\noperation, use SHOW GRANTS. See [HELP SHOW GRANTS].\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/grant.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/grant.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (200,23,'DECLARE VARIABLE','Syntax:\nDECLARE var_name [, var_name] ... type [DEFAULT value]\n\nThis statement declares local variables within stored programs. To\nprovide a default value for a variable, include a DEFAULT clause. The\nvalue can be specified as an expression; it need not be a constant. If\nthe DEFAULT clause is missing, the initial value is NULL.\n\nLocal variables are treated like stored routine parameters with respect\nto data type and overflow checking. See [HELP CREATE PROCEDURE].\n\nVariable declarations must appear before cursor or handler\ndeclarations.\n\nLocal variable names are not case sensitive. Permissible characters and\nquoting rules are the same as for other identifiers, as described in\nhttp://dev.mysql.com/doc/refman/5.5/en/identifiers.html.\n\nThe scope of a local variable is the BEGIN ... END block within which\nit is declared. The variable can be referred to in blocks nested within\nthe declaring block, except those blocks that declare a variable with\nthe same name.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/declare-local-variable.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/declare-local-variable.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (201,3,'MPOLYFROMTEXT','MPolyFromText(wkt[,srid]), MultiPolygonFromText(wkt[,srid])\n\nConstructs a MULTIPOLYGON value using its WKT representation and SRID.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/creating-spatial-values.html#gis-wkt-functions\n\n','','http://dev.mysql.com/doc/refman/5.5/en/creating-spatial-values.html#gis-wkt-functions'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (202,6,'MBRINTERSECTS','MBRIntersects(g1,g2)\n\nReturns 1 or 0 to indicate whether the Minimum Bounding Rectangles of\nthe two geometries g1 and g2 intersect.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/functions-for-testing-spatial-relations-between-geometric-objects.html#relations-on-geometry-mbr\n\n','','http://dev.mysql.com/doc/refman/5.5/en/functions-for-testing-spatial-relations-between-geometric-objects.html#relations-on-geometry-mbr'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (203,16,'BIT_OR','Syntax:\nBIT_OR(expr)\n\nReturns the bitwise OR of all bits in expr. The calculation is\nperformed with 64-bit (BIGINT) precision.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/group-by-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/group-by-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (204,31,'YEARWEEK','Syntax:\nYEARWEEK(date), YEARWEEK(date,mode)\n\nReturns year and week for a date. The mode argument works exactly like\nthe mode argument to WEEK(). The year in the result may be different\nfrom the year in the date argument for the first and the last week of\nthe year.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html\n\n','mysql> SELECT YEARWEEK(\'1987-01-01\');\n -> 198653\n','http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (205,18,'NOT BETWEEN','Syntax:\nexpr NOT BETWEEN min AND max\n\nThis is the same as NOT (expr BETWEEN min AND max).\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/comparison-operators.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/comparison-operators.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (206,18,'IS NOT','Syntax:\nIS NOT boolean_value\n\nTests a value against a boolean value, where boolean_value can be TRUE,\nFALSE, or UNKNOWN.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/comparison-operators.html\n\n','mysql> SELECT 1 IS NOT UNKNOWN, 0 IS NOT UNKNOWN, NULL IS NOT UNKNOWN;\n -> 1, 1, 0\n','http://dev.mysql.com/doc/refman/5.5/en/comparison-operators.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (207,4,'LOG10','Syntax:\nLOG10(X)\n\nReturns the base-10 logarithm of X.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/mathematical-functions.html\n\n','mysql> SELECT LOG10(2);\n -> 0.30102999566398\nmysql> SELECT LOG10(100);\n -> 2\nmysql> SELECT LOG10(-100);\n -> NULL\n','http://dev.mysql.com/doc/refman/5.5/en/mathematical-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (208,4,'SQRT','Syntax:\nSQRT(X)\n\nReturns the square root of a nonnegative number X.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/mathematical-functions.html\n\n','mysql> SELECT SQRT(4);\n -> 2\nmysql> SELECT SQRT(20);\n -> 4.4721359549996\nmysql> SELECT SQRT(-16);\n -> NULL\n','http://dev.mysql.com/doc/refman/5.5/en/mathematical-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (209,22,'DECIMAL','DECIMAL[(M[,D])] [UNSIGNED] [ZEROFILL]\n\nA packed "exact" fixed-point number. M is the total number of digits\n(the precision) and D is the number of digits after the decimal point\n(the scale). The decimal point and (for negative numbers) the "-" sign\nare not counted in M. If D is 0, values have no decimal point or\nfractional part. The maximum number of digits (M) for DECIMAL is 65.\nThe maximum number of supported decimals (D) is 30. If D is omitted,\nthe default is 0. If M is omitted, the default is 10.\n\nUNSIGNED, if specified, disallows negative values.\n\nAll basic calculations (+, -, *, /) with DECIMAL columns are done with\na precision of 65 digits.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/numeric-type-overview.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (210,39,'CREATE INDEX','Syntax:\nCREATE [ONLINE|OFFLINE] [UNIQUE|FULLTEXT|SPATIAL] INDEX index_name\n [index_type]\n ON tbl_name (index_col_name,...)\n [index_option] ...\n\nindex_col_name:\n col_name [(length)] [ASC | DESC]\n\nindex_type:\n USING {BTREE | HASH}\n\nindex_option:\n KEY_BLOCK_SIZE [=] value\n | index_type\n | WITH PARSER parser_name\n | COMMENT \'string\'\n\nCREATE INDEX is mapped to an ALTER TABLE statement to create indexes.\nSee [HELP ALTER TABLE]. CREATE INDEX cannot be used to create a PRIMARY\nKEY; use ALTER TABLE instead. For more information about indexes, see\nhttp://dev.mysql.com/doc/refman/5.5/en/mysql-indexes.html.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/create-index.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/create-index.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (211,39,'CREATE FUNCTION','The CREATE FUNCTION statement is used to create stored functions and\nuser-defined functions (UDFs):\n\no For information about creating stored functions, see [HELP CREATE\n PROCEDURE].\n\no For information about creating user-defined functions, see [HELP\n CREATE FUNCTION UDF].\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/create-function.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/create-function.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (212,39,'ALTER DATABASE','Syntax:\nALTER {DATABASE | SCHEMA} [db_name]\n alter_specification ...\nALTER {DATABASE | SCHEMA} db_name\n UPGRADE DATA DIRECTORY NAME\n\nalter_specification:\n [DEFAULT] CHARACTER SET [=] charset_name\n | [DEFAULT] COLLATE [=] collation_name\n\nALTER DATABASE enables you to change the overall characteristics of a\ndatabase. These characteristics are stored in the db.opt file in the\ndatabase directory. To use ALTER DATABASE, you need the ALTER privilege\non the database. ALTER SCHEMA is a synonym for ALTER DATABASE.\n\nThe database name can be omitted from the first syntax, in which case\nthe statement applies to the default database.\n\nNational Language Characteristics\n\nThe CHARACTER SET clause changes the default database character set.\nThe COLLATE clause changes the default database collation.\nhttp://dev.mysql.com/doc/refman/5.5/en/charset.html, discusses\ncharacter set and collation names.\n\nYou can see what character sets and collations are available using,\nrespectively, the SHOW CHARACTER SET and SHOW COLLATION statements. See\n[HELP SHOW CHARACTER SET], and [HELP SHOW COLLATION], for more\ninformation.\n\nIf you change the default character set or collation for a database,\nstored routines that use the database defaults must be dropped and\nrecreated so that they use the new defaults. (In a stored routine,\nvariables with character data types use the database defaults if the\ncharacter set or collation are not specified explicitly. See [HELP\nCREATE PROCEDURE].)\n\nUpgrading from Versions Older than MySQL 5.1\n\nThe syntax that includes the UPGRADE DATA DIRECTORY NAME clause updates\nthe name of the directory associated with the database to use the\nencoding implemented in MySQL 5.1 for mapping database names to\ndatabase directory names (see\nhttp://dev.mysql.com/doc/refman/5.5/en/identifier-mapping.html). This\nclause is for use under these conditions:\n\no It is intended when upgrading MySQL to 5.1 or later from older\n versions.\n\no It is intended to update a database directory name to the current\n encoding format if the name contains special characters that need\n encoding.\n\no The statement is used by mysqlcheck (as invoked by mysql_upgrade).\n\nFor example, if a database in MySQL 5.0 has the name a-b-c, the name\ncontains instances of the - (dash) character. In MySQL 5.0, the\ndatabase directory is also named a-b-c, which is not necessarily safe\nfor all file systems. In MySQL 5.1 and later, the same database name is\nencoded as a@002db@002dc to produce a file system-neutral directory\nname.\n\nWhen a MySQL installation is upgraded to MySQL 5.1 or later from an\nolder version,the server displays a name such as a-b-c (which is in the\nold format) as #mysql50#a-b-c, and you must refer to the name using the\n#mysql50# prefix. Use UPGRADE DATA DIRECTORY NAME in this case to\nexplicitly tell the server to re-encode the database directory name to\nthe current encoding format:\n\nALTER DATABASE `#mysql50#a-b-c` UPGRADE DATA DIRECTORY NAME;\n\nAfter executing this statement, you can refer to the database as a-b-c\nwithout the special #mysql50# prefix.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/alter-database.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/alter-database.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (213,25,'GEOMETRYN','GeometryN(gc,N)\n\nReturns the N-th geometry in the GeometryCollection value gc.\nGeometries are numbered beginning with 1.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/geometry-property-functions.html#geometrycollection-property-functions\n\n','mysql> SET @gc = \'GeometryCollection(Point(1 1),LineString(2 2, 3 3))\';\nmysql> SELECT AsText(GeometryN(GeomFromText(@gc),1));\n+----------------------------------------+\n| AsText(GeometryN(GeomFromText(@gc),1)) |\n+----------------------------------------+\n| POINT(1 1) |\n+----------------------------------------+\n','http://dev.mysql.com/doc/refman/5.5/en/geometry-property-functions.html#geometrycollection-property-functions'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (214,19,'<<','Syntax:\n<<\n\nShifts a longlong (BIGINT) number to the left.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/bit-functions.html\n\n','mysql> SELECT 1 << 2;\n -> 4\n','http://dev.mysql.com/doc/refman/5.5/en/bit-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (215,26,'SHOW TABLE STATUS','Syntax:\nSHOW TABLE STATUS [{FROM | IN} db_name]\n [LIKE \'pattern\' | WHERE expr]\n\nSHOW TABLE STATUS works likes SHOW TABLES, but provides a lot of\ninformation about each non-TEMPORARY table. You can also get this list\nusing the mysqlshow --status db_name command. The LIKE clause, if\npresent, indicates which table names to match. The WHERE clause can be\ngiven to select rows using more general conditions, as discussed in\nhttp://dev.mysql.com/doc/refman/5.5/en/extended-show.html.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/show-table-status.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/show-table-status.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (216,12,'MD5','Syntax:\nMD5(str)\n\nCalculates an MD5 128-bit checksum for the string. The value is\nreturned as a string of 32 hex digits, or NULL if the argument was\nNULL. The return value can, for example, be used as a hash key. See the\nnotes at the beginning of this section about storing hash values\nefficiently.\n\nAs of MySQL 5.5.3, the return value is a nonbinary string in the\nconnection character set. Before 5.5.3, the return value is a binary\nstring; see the notes at the beginning of this section about using the\nvalue as a nonbinary string.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/encryption-functions.html\n\n','mysql> SELECT MD5(\'testing\');\n -> \'ae2b1fca515949e5d54fb22b8ed95575\'\n','http://dev.mysql.com/doc/refman/5.5/en/encryption-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (217,18,'<','Syntax:\n<\n\nLess than:\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/comparison-operators.html\n\n','mysql> SELECT 2 < 2;\n -> 0\n','http://dev.mysql.com/doc/refman/5.5/en/comparison-operators.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (218,31,'UNIX_TIMESTAMP','Syntax:\nUNIX_TIMESTAMP(), UNIX_TIMESTAMP(date)\n\nIf called with no argument, returns a Unix timestamp (seconds since\n\'1970-01-01 00:00:00\' UTC) as an unsigned integer. If UNIX_TIMESTAMP()\nis called with a date argument, it returns the value of the argument as\nseconds since \'1970-01-01 00:00:00\' UTC. date may be a DATE string, a\nDATETIME string, a TIMESTAMP, or a number in the format YYMMDD or\nYYYYMMDD. The server interprets date as a value in the current time\nzone and converts it to an internal value in UTC. Clients can set their\ntime zone as described in\nhttp://dev.mysql.com/doc/refman/5.5/en/time-zone-support.html.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html\n\n','mysql> SELECT UNIX_TIMESTAMP();\n -> 1196440210\nmysql> SELECT UNIX_TIMESTAMP(\'2007-11-30 10:30:19\');\n -> 1196440219\n','http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (219,31,'DAYOFMONTH','Syntax:\nDAYOFMONTH(date)\n\nReturns the day of the month for date, in the range 1 to 31, or 0 for\ndates such as \'0000-00-00\' or \'2008-00-00\' that have a zero day part.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html\n\n','mysql> SELECT DAYOFMONTH(\'2007-02-03\');\n -> 3\n','http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (220,37,'ASCII','Syntax:\nASCII(str)\n\nReturns the numeric value of the leftmost character of the string str.\nReturns 0 if str is the empty string. Returns NULL if str is NULL.\nASCII() works for 8-bit characters.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/string-functions.html\n\n','mysql> SELECT ASCII(\'2\');\n -> 50\nmysql> SELECT ASCII(2);\n -> 50\nmysql> SELECT ASCII(\'dx\');\n -> 100\n','http://dev.mysql.com/doc/refman/5.5/en/string-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (221,4,'DIV','Syntax:\nDIV\n\nInteger division. Similar to FLOOR(), but is safe with BIGINT values.\n\nAs of MySQL 5.5.3, if either operand has a noninteger type, the\noperands are converted to DECIMAL and divided using DECIMAL arithmetic\nbefore converting the result to BIGINT. If the result exceeds BIGINT\nrange, an error occurs. Before MySQL 5.5.3, incorrect results may occur\nfor noninteger operands that exceed BIGINT range.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/arithmetic-functions.html\n\n','mysql> SELECT 5 DIV 2;\n -> 2\n','http://dev.mysql.com/doc/refman/5.5/en/arithmetic-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (222,10,'RENAME USER','Syntax:\nRENAME USER old_user TO new_user\n [, old_user TO new_user] ...\n\nThe RENAME USER statement renames existing MySQL accounts. To use it,\nyou must have the global CREATE USER privilege or the UPDATE privilege\nfor the mysql database. An error occurs if any old account does not\nexist or any new account exists. Each account name uses the format\ndescribed in http://dev.mysql.com/doc/refman/5.5/en/account-names.html.\nFor example:\n\nRENAME USER \'jeffrey\'@\'localhost\' TO \'jeff\'@\'127.0.0.1\';\n\nIf you specify only the user name part of the account name, a host name\npart of \'%\' is used.\n\nRENAME USER causes the privileges held by the old user to be those held\nby the new user. However, RENAME USER does not automatically drop or\ninvalidate databases or objects within them that the old user created.\nThis includes stored programs or views for which the DEFINER attribute\nnames the old user. Attempts to access such objects may produce an\nerror if they execute in definer security context. (For information\nabout security context, see\nhttp://dev.mysql.com/doc/refman/5.5/en/stored-programs-security.html.)\n\nThe privilege changes take effect as indicated in\nhttp://dev.mysql.com/doc/refman/5.5/en/privilege-changes.html.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/rename-user.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/rename-user.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (223,26,'SHOW SLAVE STATUS','Syntax:\nSHOW SLAVE STATUS\n\nThis statement provides status information on essential parameters of\nthe slave threads. It requires either the SUPER or REPLICATION CLIENT\nprivilege.\n\nIf you issue this statement using the mysql client, you can use a \\G\nstatement terminator rather than a semicolon to obtain a more readable\nvertical layout:\n\nmysql> SHOW SLAVE STATUS\\G\n*************************** 1. row ***************************\n Slave_IO_State: Waiting for master to send event\n Master_Host: localhost\n Master_User: root\n Master_Port: 3306\n Connect_Retry: 3\n Master_Log_File: gbichot-bin.005\n Read_Master_Log_Pos: 79\n Relay_Log_File: gbichot-relay-bin.005\n Relay_Log_Pos: 548\n Relay_Master_Log_File: gbichot-bin.005\n Slave_IO_Running: Yes\n Slave_SQL_Running: Yes\n Replicate_Do_DB:\n Replicate_Ignore_DB:\n Replicate_Do_Table:\n Replicate_Ignore_Table:\n Replicate_Wild_Do_Table:\n Replicate_Wild_Ignore_Table:\n Last_Errno: 0\n Last_Error:\n Skip_Counter: 0\n Exec_Master_Log_Pos: 79\n Relay_Log_Space: 552\n Until_Condition: None\n Until_Log_File:\n Until_Log_Pos: 0\n Master_SSL_Allowed: No\n Master_SSL_CA_File:\n Master_SSL_CA_Path:\n Master_SSL_Cert:\n Master_SSL_Cipher:\n Master_SSL_Key:\n Seconds_Behind_Master: 8\nMaster_SSL_Verify_Server_Cert: No\n Last_IO_Errno: 0\n Last_IO_Error:\n Last_SQL_Errno: 0\n Last_SQL_Error:\n Replicate_Ignore_Server_Ids: 0\n Master_Server_Id: 1\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/show-slave-status.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/show-slave-status.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (224,34,'GEOMETRY','MySQL provides a standard way of creating spatial columns for geometry\ntypes, for example, with CREATE TABLE or ALTER TABLE. Currently,\nspatial columns are supported for MyISAM, InnoDB, NDB, and ARCHIVE\ntables. See also the annotations about spatial indexes under [HELP\nSPATIAL].\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/creating-spatial-columns.html\n\n','CREATE TABLE geom (g GEOMETRY);\n','http://dev.mysql.com/doc/refman/5.5/en/creating-spatial-columns.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (225,13,'NUMPOINTS','NumPoints(ls)\n\nReturns the number of Point objects in the LineString value ls.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/geometry-property-functions.html#linestring-property-functions\n\n','mysql> SET @ls = \'LineString(1 1,2 2,3 3)\';\nmysql> SELECT NumPoints(GeomFromText(@ls));\n+------------------------------+\n| NumPoints(GeomFromText(@ls)) |\n+------------------------------+\n| 3 |\n+------------------------------+\n','http://dev.mysql.com/doc/refman/5.5/en/geometry-property-functions.html#linestring-property-functions'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (226,39,'ALTER LOGFILE GROUP','Syntax:\nALTER LOGFILE GROUP logfile_group\n ADD UNDOFILE \'file_name\'\n [INITIAL_SIZE [=] size]\n [WAIT]\n ENGINE [=] engine_name\n\nThis statement adds an UNDO file named \'file_name\' to an existing log\nfile group logfile_group. An ALTER LOGFILE GROUP statement has one and\nonly one ADD UNDOFILE clause. No DROP UNDOFILE clause is currently\nsupported.\n\n*Note*: All MySQL Cluster Disk Data objects share the same namespace.\nThis means that each Disk Data object must be uniquely named (and not\nmerely each Disk Data object of a given type). For example, you cannot\nhave a tablespace and an undo log file with the same name, or an undo\nlog file and a data file with the same name.\n\nThe optional INITIAL_SIZE parameter sets the UNDO file\'s initial size\nin bytes; if not specified, the initial size default to 128M (128\nmegabytes). You may optionally follow size with a one-letter\nabbreviation for an order of magnitude, similar to those used in\nmy.cnf. Generally, this is one of the letters M (for megabytes) or G\n(for gigabytes).\n\nOn 32-bit systems, the maximum supported value for INITIAL_SIZE is 4G.\n(Bug #29186)\n\nThe minimum permitted value for INITIAL_SIZE is 1M. (Bug #29574)\n\n*Note*: WAIT is parsed but otherwise ignored. This keyword currently\nhas no effect, and is intended for future expansion.\n\nThe ENGINE parameter (required) determines the storage engine which is\nused by this log file group, with engine_name being the name of the\nstorage engine. Currently, the only accepted values for engine_name are\n"NDBCLUSTER" and "NDB". The two values are equivalent.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/alter-logfile-group.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/alter-logfile-group.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (227,19,'&','Syntax:\n&\n\nBitwise AND:\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/bit-functions.html\n\n','mysql> SELECT 29 & 15;\n -> 13\n','http://dev.mysql.com/doc/refman/5.5/en/bit-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (228,31,'LOCALTIMESTAMP','Syntax:\nLOCALTIMESTAMP, LOCALTIMESTAMP()\n\nLOCALTIMESTAMP and LOCALTIMESTAMP() are synonyms for NOW().\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (229,15,'ASSIGN-EQUAL','Syntax:\n=\n\nThis operator is used to perform value assignments in two cases,\ndescribed in the next two paragraphs.\n\nWithin a SET statement, = is treated as an assignment operator that\ncauses the user variable on the left hand side of the operator to take\non the value to its right. (In other words, when used in a SET\nstatement, = is treated identically to :=.) The value on the right hand\nside may be a literal value, another variable storing a value, or any\nlegal expression that yields a scalar value, including the result of a\nquery (provided that this value is a scalar value). You can perform\nmultiple assignments in the same SET statement.\n\nIn the SET clause of an UPDATE statement, = also acts as an assignment\noperator; in this case, however, it causes the column named on the left\nhand side of the operator to assume the value given to the right,\nprovided any WHERE conditions that are part of the UPDATE are met. You\ncan make multiple assignments in the same SET clause of an UPDATE\nstatement.\n\nIn any other context, = is treated as a comparison operator.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/assignment-operators.html\n\n','mysql> SELECT @var1, @var2;\n -> NULL, NULL\nmysql> SELECT @var1 := 1, @var2;\n -> 1, NULL\nmysql> SELECT @var1, @var2;\n -> 1, NULL\nmysql> SELECT @var1, @var2 := @var1;\n -> 1, 1\nmysql> SELECT @var1, @var2;\n -> 1, 1\n','http://dev.mysql.com/doc/refman/5.5/en/assignment-operators.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (230,37,'CONVERT','Syntax:\nCONVERT(expr,type), CONVERT(expr USING transcoding_name)\n\nThe CONVERT() and CAST() functions take an expression of any type and\nproduce a result value of a specified type.\n\nThe type for the result can be one of the following values:\n\no BINARY[(N)]\n\no CHAR[(N)]\n\no DATE\n\no DATETIME\n\no DECIMAL[(M[,D])]\n\no SIGNED [INTEGER]\n\no TIME\n\no UNSIGNED [INTEGER]\n\nBINARY produces a string with the BINARY data type. See\nhttp://dev.mysql.com/doc/refman/5.5/en/binary-varbinary.html for a\ndescription of how this affects comparisons. If the optional length N\nis given, BINARY(N) causes the cast to use no more than N bytes of the\nargument. Values shorter than N bytes are padded with 0x00 bytes to a\nlength of N.\n\nCHAR(N) causes the cast to use no more than N characters of the\nargument.\n\nCAST() and CONVERT(... USING ...) are standard SQL syntax. The\nnon-USING form of CONVERT() is ODBC syntax.\n\nCONVERT() with USING is used to convert data between different\ncharacter sets. In MySQL, transcoding names are the same as the\ncorresponding character set names. For example, this statement converts\nthe string \'abc\' in the default character set to the corresponding\nstring in the utf8 character set:\n\nSELECT CONVERT(\'abc\' USING utf8);\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/cast-functions.html\n\n','SELECT enum_col FROM tbl_name ORDER BY CAST(enum_col AS CHAR);\n','http://dev.mysql.com/doc/refman/5.5/en/cast-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (231,31,'ADDDATE','Syntax:\nADDDATE(date,INTERVAL expr unit), ADDDATE(expr,days)\n\nWhen invoked with the INTERVAL form of the second argument, ADDDATE()\nis a synonym for DATE_ADD(). The related function SUBDATE() is a\nsynonym for DATE_SUB(). For information on the INTERVAL unit argument,\nsee the discussion for DATE_ADD().\n\nmysql> SELECT DATE_ADD(\'2008-01-02\', INTERVAL 31 DAY);\n -> \'2008-02-02\'\nmysql> SELECT ADDDATE(\'2008-01-02\', INTERVAL 31 DAY);\n -> \'2008-02-02\'\n\nWhen invoked with the days form of the second argument, MySQL treats it\nas an integer number of days to be added to expr.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html\n\n','mysql> SELECT ADDDATE(\'2008-01-02\', 31);\n -> \'2008-02-02\'\n','http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (232,23,'REPEAT LOOP','Syntax:\n[begin_label:] REPEAT\n statement_list\nUNTIL search_condition\nEND REPEAT [end_label]\n\nThe statement list within a REPEAT statement is repeated until the\nsearch_condition expression is true. Thus, a REPEAT always enters the\nloop at least once. statement_list consists of one or more statements,\neach terminated by a semicolon (;) statement delimiter.\n\nA REPEAT statement can be labeled. For the rules regarding label use,\nsee [HELP labels].\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/repeat.html\n\n','mysql> delimiter //\n\nmysql> CREATE PROCEDURE dorepeat(p1 INT)\n -> BEGIN\n -> SET @x = 0;\n -> REPEAT\n -> SET @x = @x + 1;\n -> UNTIL @x > p1 END REPEAT;\n -> END\n -> //\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> CALL dorepeat(1000)//\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> SELECT @x//\n+------+\n| @x |\n+------+\n| 1001 |\n+------+\n1 row in set (0.00 sec)\n','http://dev.mysql.com/doc/refman/5.5/en/repeat.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (233,39,'ALTER FUNCTION','Syntax:\nALTER FUNCTION func_name [characteristic ...]\n\ncharacteristic:\n COMMENT \'string\'\n | LANGUAGE SQL\n | { CONTAINS SQL | NO SQL | READS SQL DATA | MODIFIES SQL DATA }\n | SQL SECURITY { DEFINER | INVOKER }\n\nThis statement can be used to change the characteristics of a stored\nfunction. More than one change may be specified in an ALTER FUNCTION\nstatement. However, you cannot change the parameters or body of a\nstored function using this statement; to make such changes, you must\ndrop and re-create the function using DROP FUNCTION and CREATE\nFUNCTION.\n\nYou must have the ALTER ROUTINE privilege for the function. (That\nprivilege is granted automatically to the function creator.) If binary\nlogging is enabled, the ALTER FUNCTION statement might also require the\nSUPER privilege, as described in\nhttp://dev.mysql.com/doc/refman/5.5/en/stored-programs-logging.html.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/alter-function.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/alter-function.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (234,22,'SMALLINT','SMALLINT[(M)] [UNSIGNED] [ZEROFILL]\n\nA small integer. The signed range is -32768 to 32767. The unsigned\nrange is 0 to 65535.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/numeric-type-overview.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (235,22,'DOUBLE PRECISION','DOUBLE PRECISION[(M,D)] [UNSIGNED] [ZEROFILL], REAL[(M,D)] [UNSIGNED]\n[ZEROFILL]\n\nThese types are synonyms for DOUBLE. Exception: If the REAL_AS_FLOAT\nSQL mode is enabled, REAL is a synonym for FLOAT rather than DOUBLE.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/numeric-type-overview.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (236,37,'ORD','Syntax:\nORD(str)\n\nIf the leftmost character of the string str is a multi-byte character,\nreturns the code for that character, calculated from the numeric values\nof its constituent bytes using this formula:\n\n (1st byte code)\n+ (2nd byte code * 256)\n+ (3rd byte code * 2562) ...\n\nIf the leftmost character is not a multi-byte character, ORD() returns\nthe same value as the ASCII() function.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/string-functions.html\n\n','mysql> SELECT ORD(\'2\');\n -> 50\n','http://dev.mysql.com/doc/refman/5.5/en/string-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (237,8,'DEALLOCATE PREPARE','Syntax:\n{DEALLOCATE | DROP} PREPARE stmt_name\n\nTo deallocate a prepared statement produced with PREPARE, use a\nDEALLOCATE PREPARE statement that refers to the prepared statement\nname. Attempting to execute a prepared statement after deallocating it\nresults in an error.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/deallocate-prepare.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/deallocate-prepare.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (238,36,'ENVELOPE','Envelope(g)\n\nReturns the Minimum Bounding Rectangle (MBR) for the geometry value g.\nThe result is returned as a Polygon value.\n\nThe polygon is defined by the corner points of the bounding box:\n\nPOLYGON((MINX MINY, MAXX MINY, MAXX MAXY, MINX MAXY, MINX MINY))\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/geometry-property-functions.html#general-geometry-property-functions\n\n','mysql> SELECT AsText(Envelope(GeomFromText(\'LineString(1 1,2 2)\')));\n+-------------------------------------------------------+\n| AsText(Envelope(GeomFromText(\'LineString(1 1,2 2)\'))) |\n+-------------------------------------------------------+\n| POLYGON((1 1,2 1,2 2,1 2,1 1)) |\n+-------------------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.5/en/geometry-property-functions.html#general-geometry-property-functions'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (239,14,'IS_FREE_LOCK','Syntax:\nIS_FREE_LOCK(str)\n\nChecks whether the lock named str is free to use (that is, not locked).\nReturns 1 if the lock is free (no one is using the lock), 0 if the lock\nis in use, and NULL if an error occurs (such as an incorrect argument).\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/miscellaneous-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/miscellaneous-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (240,30,'TOUCHES','Touches(g1,g2)\n\nReturns 1 or 0 to indicate whether g1 spatially touches g2. Two\ngeometries spatially touch if the interiors of the geometries do not\nintersect, but the boundary of one of the geometries intersects either\nthe boundary or the interior of the other.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/functions-for-testing-spatial-relations-between-geometric-objects.html#functions-that-test-spatial-relationships-between-geometries\n\n','','http://dev.mysql.com/doc/refman/5.5/en/functions-for-testing-spatial-relations-between-geometric-objects.html#functions-that-test-spatial-relationships-between-geometries'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (241,14,'INET_ATON','Syntax:\nINET_ATON(expr)\n\nGiven the dotted-quad representation of an IPv4 network address as a\nstring, returns an integer that represents the numeric value of the\naddress in network byte order (big endian). INET_ATON() returns NULL if\nit does not understand its argument.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/miscellaneous-functions.html\n\n','mysql> SELECT INET_ATON(\'10.0.5.9\');\n -> 167773449\n','http://dev.mysql.com/doc/refman/5.5/en/miscellaneous-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (242,12,'UNCOMPRESS','Syntax:\nUNCOMPRESS(string_to_uncompress)\n\nUncompresses a string compressed by the COMPRESS() function. If the\nargument is not a compressed value, the result is NULL. This function\nrequires MySQL to have been compiled with a compression library such as\nzlib. Otherwise, the return value is always NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/encryption-functions.html\n\n','mysql> SELECT UNCOMPRESS(COMPRESS(\'any string\'));\n -> \'any string\'\nmysql> SELECT UNCOMPRESS(\'any string\');\n -> NULL\n','http://dev.mysql.com/doc/refman/5.5/en/encryption-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (243,22,'AUTO_INCREMENT','The AUTO_INCREMENT attribute can be used to generate a unique identity\nfor new rows:\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/example-auto-increment.html\n\n','CREATE TABLE animals (\n id MEDIUMINT NOT NULL AUTO_INCREMENT,\n name CHAR(30) NOT NULL,\n PRIMARY KEY (id)\n);\n\nINSERT INTO animals (name) VALUES\n (\'dog\'),(\'cat\'),(\'penguin\'),\n (\'lax\'),(\'whale\'),(\'ostrich\');\n\nSELECT * FROM animals;\n','http://dev.mysql.com/doc/refman/5.5/en/example-auto-increment.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (244,36,'ISSIMPLE','IsSimple(g)\n\nCurrently, this function is a placeholder and should not be used. If\nimplemented, its behavior will be as described in the next paragraph.\n\nReturns 1 if the geometry value g has no anomalous geometric points,\nsuch as self-intersection or self-tangency. IsSimple() returns 0 if the\nargument is not simple, and -1 if it is NULL.\n\nThe description of each instantiable geometric class given earlier in\nthe chapter includes the specific conditions that cause an instance of\nthat class to be classified as not simple. (See [HELP Geometry\nhierarchy].)\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/geometry-property-functions.html#general-geometry-property-functions\n\n','','http://dev.mysql.com/doc/refman/5.5/en/geometry-property-functions.html#general-geometry-property-functions'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (245,4,'- BINARY','Syntax:\n-\n\nSubtraction:\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/arithmetic-functions.html\n\n','mysql> SELECT 3-5;\n -> -2\n','http://dev.mysql.com/doc/refman/5.5/en/arithmetic-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (246,3,'GEOMCOLLFROMTEXT','GeomCollFromText(wkt[,srid]), GeometryCollectionFromText(wkt[,srid])\n\nConstructs a GEOMETRYCOLLECTION value using its WKT representation and\nSRID.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/creating-spatial-values.html#gis-wkt-functions\n\n','','http://dev.mysql.com/doc/refman/5.5/en/creating-spatial-values.html#gis-wkt-functions'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (247,3,'WKT DEFINITION','The Well-Known Text (WKT) representation of Geometry is designed to\nexchange geometry data in ASCII form. For a Backus-Naur grammar that\nspecifies the formal production rules for writing WKT values, see the\nOpenGIS specification document referenced in\nhttp://dev.mysql.com/doc/refman/5.5/en/spatial-extensions.html.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/gis-wkt-format.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/gis-wkt-format.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (248,31,'CURRENT_TIME','Syntax:\nCURRENT_TIME, CURRENT_TIME()\n\nCURRENT_TIME and CURRENT_TIME() are synonyms for CURTIME().\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (249,10,'REVOKE','Syntax:\nREVOKE\n priv_type [(column_list)]\n [, priv_type [(column_list)]] ...\n ON [object_type] priv_level\n FROM user [, user] ...\n\nREVOKE ALL PRIVILEGES, GRANT OPTION\n FROM user [, user] ...\n\nREVOKE PROXY ON user\n FROM user [, user] ...\n\nThe REVOKE statement enables system administrators to revoke privileges\nfrom MySQL accounts. Each account name uses the format described in\nhttp://dev.mysql.com/doc/refman/5.5/en/account-names.html. For example:\n\nREVOKE INSERT ON *.* FROM \'jeffrey\'@\'localhost\';\n\nIf you specify only the user name part of the account name, a host name\npart of \'%\' is used.\n\nFor details on the levels at which privileges exist, the permissible\npriv_type and priv_level values, and the syntax for specifying users\nand passwords, see [HELP GRANT]\n\nTo use the first REVOKE syntax, you must have the GRANT OPTION\nprivilege, and you must have the privileges that you are revoking.\n\nTo revoke all privileges, use the second syntax, which drops all\nglobal, database, table, column, and routine privileges for the named\nuser or users:\n\nREVOKE ALL PRIVILEGES, GRANT OPTION FROM user [, user] ...\n\nTo use this REVOKE syntax, you must have the global CREATE USER\nprivilege or the UPDATE privilege for the mysql database.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/revoke.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/revoke.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (250,17,'LAST_INSERT_ID','Syntax:\nLAST_INSERT_ID(), LAST_INSERT_ID(expr)\n\nLAST_INSERT_ID() (with no argument) returns a BIGINT (64-bit) value\nrepresenting the first automatically generated value successfully\ninserted for an AUTO_INCREMENT column as a result of the most recently\nexecuted INSERT statement. The value of LAST_INSERT_ID() remains\nunchanged if no rows are successfully inserted.\n\nFor example, after inserting a row that generates an AUTO_INCREMENT\nvalue, you can get the value like this:\n\nmysql> SELECT LAST_INSERT_ID();\n -> 195\n\nThe currently executing statement does not affect the value of\nLAST_INSERT_ID(). Suppose that you generate an AUTO_INCREMENT value\nwith one statement, and then refer to LAST_INSERT_ID() in a\nmultiple-row INSERT statement that inserts rows into a table with its\nown AUTO_INCREMENT column. The value of LAST_INSERT_ID() will remain\nstable in the second statement; its value for the second and later rows\nis not affected by the earlier row insertions. (However, if you mix\nreferences to LAST_INSERT_ID() and LAST_INSERT_ID(expr), the effect is\nundefined.)\n\nIf the previous statement returned an error, the value of\nLAST_INSERT_ID() is undefined. For transactional tables, if the\nstatement is rolled back due to an error, the value of LAST_INSERT_ID()\nis left undefined. For manual ROLLBACK, the value of LAST_INSERT_ID()\nis not restored to that before the transaction; it remains as it was at\nthe point of the ROLLBACK.\n\nWithin the body of a stored routine (procedure or function) or a\ntrigger, the value of LAST_INSERT_ID() changes the same way as for\nstatements executed outside the body of these kinds of objects. The\neffect of a stored routine or trigger upon the value of\nLAST_INSERT_ID() that is seen by following statements depends on the\nkind of routine:\n\no If a stored procedure executes statements that change the value of\n LAST_INSERT_ID(), the changed value is seen by statements that follow\n the procedure call.\n\no For stored functions and triggers that change the value, the value is\n restored when the function or trigger ends, so following statements\n will not see a changed value.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/information-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/information-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (251,31,'LAST_DAY','Syntax:\nLAST_DAY(date)\n\nTakes a date or datetime value and returns the corresponding value for\nthe last day of the month. Returns NULL if the argument is invalid.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html\n\n','mysql> SELECT LAST_DAY(\'2003-02-05\');\n -> \'2003-02-28\'\nmysql> SELECT LAST_DAY(\'2004-02-05\');\n -> \'2004-02-29\'\nmysql> SELECT LAST_DAY(\'2004-01-01 01:01:01\');\n -> \'2004-01-31\'\nmysql> SELECT LAST_DAY(\'2003-03-32\');\n -> NULL\n','http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (252,22,'MEDIUMINT','MEDIUMINT[(M)] [UNSIGNED] [ZEROFILL]\n\nA medium-sized integer. The signed range is -8388608 to 8388607. The\nunsigned range is 0 to 16777215.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/numeric-type-overview.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (253,4,'FLOOR','Syntax:\nFLOOR(X)\n\nReturns the largest integer value not greater than X.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/mathematical-functions.html\n\n','mysql> SELECT FLOOR(1.23);\n -> 1\nmysql> SELECT FLOOR(-1.23);\n -> -2\n','http://dev.mysql.com/doc/refman/5.5/en/mathematical-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (254,37,'RTRIM','Syntax:\nRTRIM(str)\n\nReturns the string str with trailing space characters removed.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/string-functions.html\n\n','mysql> SELECT RTRIM(\'barbar \');\n -> \'barbar\'\n','http://dev.mysql.com/doc/refman/5.5/en/string-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (255,28,'EXPLAIN','Syntax:\nEXPLAIN [explain_type] SELECT select_options\n\nexplain_type:\n EXTENDED\n | PARTITIONS\n\nOr:\n\nEXPLAIN tbl_name\n\nThe EXPLAIN statement can be used either as a way to obtain information\nabout how MySQL executes a statement, or as a synonym for DESCRIBE:\n\no When you precede a SELECT statement with the keyword EXPLAIN, MySQL\n displays information from the optimizer about the query execution\n plan. That is, MySQL explains how it would process the statement,\n including information about how tables are joined and in which order.\n EXPLAIN EXTENDED can be used to obtain additional information.\n\n For information about using EXPLAIN and EXPLAIN EXTENDED to obtain\n query execution plan information, see\n http://dev.mysql.com/doc/refman/5.5/en/using-explain.html.\n\no EXPLAIN PARTITIONS is useful only when examining queries involving\n partitioned tables. For details, see\n http://dev.mysql.com/doc/refman/5.5/en/partitioning-info.html.\n\no EXPLAIN tbl_name is synonymous with DESCRIBE tbl_name or SHOW COLUMNS\n FROM tbl_name. For information about DESCRIBE and SHOW COLUMNS, see\n [HELP DESCRIBE], and [HELP SHOW COLUMNS].\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/explain.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/explain.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (256,4,'DEGREES','Syntax:\nDEGREES(X)\n\nReturns the argument X, converted from radians to degrees.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/mathematical-functions.html\n\n','mysql> SELECT DEGREES(PI());\n -> 180\nmysql> SELECT DEGREES(PI() / 2);\n -> 90\n','http://dev.mysql.com/doc/refman/5.5/en/mathematical-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (257,22,'VARCHAR','[NATIONAL] VARCHAR(M) [CHARACTER SET charset_name] [COLLATE\ncollation_name]\n\nA variable-length string. M represents the maximum column length in\ncharacters. The range of M is 0 to 65,535. The effective maximum length\nof a VARCHAR is subject to the maximum row size (65,535 bytes, which is\nshared among all columns) and the character set used. For example, utf8\ncharacters can require up to three bytes per character, so a VARCHAR\ncolumn that uses the utf8 character set can be declared to be a maximum\nof 21,844 characters. See\nhttp://dev.mysql.com/doc/refman/5.5/en/column-count-limit.html.\n\nMySQL stores VARCHAR values as a 1-byte or 2-byte length prefix plus\ndata. The length prefix indicates the number of bytes in the value. A\nVARCHAR column uses one length byte if values require no more than 255\nbytes, two length bytes if values may require more than 255 bytes.\n\n*Note*: MySQL 5.5 follows the standard SQL specification, and does not\nremove trailing spaces from VARCHAR values.\n\nVARCHAR is shorthand for CHARACTER VARYING. NATIONAL VARCHAR is the\nstandard SQL way to define that a VARCHAR column should use some\npredefined character set. MySQL 4.1 and up uses utf8 as this predefined\ncharacter set.\nhttp://dev.mysql.com/doc/refman/5.5/en/charset-national.html. NVARCHAR\nis shorthand for NATIONAL VARCHAR.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/string-type-overview.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (258,37,'UNHEX','Syntax:\n\nUNHEX(str)\n\nFor a string argument str, UNHEX(str) performs the inverse operation of\nHEX(str). That is, it interprets each pair of characters in the\nargument as a hexadecimal number and converts it to the character\nrepresented by the number. The return value is a binary string.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/string-functions.html\n\n','mysql> SELECT UNHEX(\'4D7953514C\');\n -> \'MySQL\'\nmysql> SELECT 0x4D7953514C;\n -> \'MySQL\'\nmysql> SELECT UNHEX(HEX(\'string\'));\n -> \'string\'\nmysql> SELECT HEX(UNHEX(\'1267\'));\n -> \'1267\'\n','http://dev.mysql.com/doc/refman/5.5/en/string-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (259,4,'- UNARY','Syntax:\n-\n\nUnary minus. This operator changes the sign of the operand.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/arithmetic-functions.html\n\n','mysql> SELECT - 2;\n -> -2\n','http://dev.mysql.com/doc/refman/5.5/en/arithmetic-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (260,16,'STD','Syntax:\nSTD(expr)\n\nReturns the population standard deviation of expr. This is an extension\nto standard SQL. The standard SQL function STDDEV_POP() can be used\ninstead.\n\nThis function returns NULL if there were no matching rows.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/group-by-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/group-by-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (261,4,'COS','Syntax:\nCOS(X)\n\nReturns the cosine of X, where X is given in radians.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/mathematical-functions.html\n\n','mysql> SELECT COS(PI());\n -> -1\n','http://dev.mysql.com/doc/refman/5.5/en/mathematical-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (262,31,'DATE FUNCTION','Syntax:\nDATE(expr)\n\nExtracts the date part of the date or datetime expression expr.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html\n\n','mysql> SELECT DATE(\'2003-12-31 01:02:03\');\n -> \'2003-12-31\'\n','http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (263,39,'DROP TRIGGER','Syntax:\nDROP TRIGGER [IF EXISTS] [schema_name.]trigger_name\n\nThis statement drops a trigger. The schema (database) name is optional.\nIf the schema is omitted, the trigger is dropped from the default\nschema. DROP TRIGGER requires the TRIGGER privilege for the table\nassociated with the trigger.\n\nUse IF EXISTS to prevent an error from occurring for a trigger that\ndoes not exist. A NOTE is generated for a nonexistent trigger when\nusing IF EXISTS. See [HELP SHOW WARNINGS].\n\nTriggers for a table are also dropped if you drop the table.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/drop-trigger.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/drop-trigger.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (264,8,'RESET MASTER','Syntax:\nRESET MASTER\n\nDeletes all binary log files listed in the index file, resets the\nbinary log index file to be empty, and creates a new binary log file.\nThis statement is intended to be used only when the master is started\nfor the first time.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/reset-master.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/reset-master.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (265,4,'TAN','Syntax:\nTAN(X)\n\nReturns the tangent of X, where X is given in radians.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/mathematical-functions.html\n\n','mysql> SELECT TAN(PI());\n -> -1.2246063538224e-16\nmysql> SELECT TAN(PI()+1);\n -> 1.5574077246549\n','http://dev.mysql.com/doc/refman/5.5/en/mathematical-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (266,4,'PI','Syntax:\nPI()\n\nReturns the value of π (pi). The default number of decimal places\ndisplayed is seven, but MySQL uses the full double-precision value\ninternally.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/mathematical-functions.html\n\n','mysql> SELECT PI();\n -> 3.141593\nmysql> SELECT PI()+0.000000000000000000;\n -> 3.141592653589793116\n','http://dev.mysql.com/doc/refman/5.5/en/mathematical-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (267,31,'WEEKOFYEAR','Syntax:\nWEEKOFYEAR(date)\n\nReturns the calendar week of the date as a number in the range from 1\nto 53. WEEKOFYEAR() is a compatibility function that is equivalent to\nWEEK(date,3).\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html\n\n','mysql> SELECT WEEKOFYEAR(\'2008-02-20\');\n -> 8\n','http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (268,4,'/','Syntax:\n/\n\nDivision:\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/arithmetic-functions.html\n\n','mysql> SELECT 3/5;\n -> 0.60\n','http://dev.mysql.com/doc/refman/5.5/en/arithmetic-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (269,8,'PURGE BINARY LOGS','Syntax:\nPURGE { BINARY | MASTER } LOGS\n { TO \'log_name\' | BEFORE datetime_expr }\n\nThe binary log is a set of files that contain information about data\nmodifications made by the MySQL server. The log consists of a set of\nbinary log files, plus an index file (see\nhttp://dev.mysql.com/doc/refman/5.5/en/binary-log.html).\n\nThe PURGE BINARY LOGS statement deletes all the binary log files listed\nin the log index file prior to the specified log file name or date.\nBINARY and MASTER are synonyms. Deleted log files also are removed from\nthe list recorded in the index file, so that the given log file becomes\nthe first in the list.\n\nThis statement has no effect if the server was not started with the\n--log-bin option to enable binary logging.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/purge-binary-logs.html\n\n','PURGE BINARY LOGS TO \'mysql-bin.010\';\nPURGE BINARY LOGS BEFORE \'2008-04-02 22:46:26\';\n','http://dev.mysql.com/doc/refman/5.5/en/purge-binary-logs.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (270,16,'STDDEV_SAMP','Syntax:\nSTDDEV_SAMP(expr)\n\nReturns the sample standard deviation of expr (the square root of\nVAR_SAMP().\n\nSTDDEV_SAMP() returns NULL if there were no matching rows.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/group-by-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/group-by-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (271,17,'SCHEMA','Syntax:\nSCHEMA()\n\nThis function is a synonym for DATABASE().\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/information-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/information-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (272,32,'MLINEFROMWKB','MLineFromWKB(wkb[,srid]), MultiLineStringFromWKB(wkb[,srid])\n\nConstructs a MULTILINESTRING value using its WKB representation and\nSRID.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/creating-spatial-values.html#gis-wkb-functions\n\n','','http://dev.mysql.com/doc/refman/5.5/en/creating-spatial-values.html#gis-wkb-functions'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (273,4,'LOG2','Syntax:\nLOG2(X)\n\nReturns the base-2 logarithm of X.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/mathematical-functions.html\n\n','mysql> SELECT LOG2(65536);\n -> 16\nmysql> SELECT LOG2(-100);\n -> NULL\n','http://dev.mysql.com/doc/refman/5.5/en/mathematical-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (274,31,'SUBTIME','Syntax:\nSUBTIME(expr1,expr2)\n\nSUBTIME() returns expr1 - expr2 expressed as a value in the same format\nas expr1. expr1 is a time or datetime expression, and expr2 is a time\nexpression.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html\n\n','mysql> SELECT SUBTIME(\'2007-12-31 23:59:59.999999\',\'1 1:1:1.000002\');\n -> \'2007-12-30 22:58:58.999997\'\nmysql> SELECT SUBTIME(\'01:00:00.999999\', \'02:00:00.999998\');\n -> \'-00:59:59.999999\'\n','http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (275,12,'UNCOMPRESSED_LENGTH','Syntax:\nUNCOMPRESSED_LENGTH(compressed_string)\n\nReturns the length that the compressed string had before being\ncompressed.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/encryption-functions.html\n\n','mysql> SELECT UNCOMPRESSED_LENGTH(COMPRESS(REPEAT(\'a\',30)));\n -> 30\n','http://dev.mysql.com/doc/refman/5.5/en/encryption-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (276,39,'DROP TABLE','Syntax:\nDROP [TEMPORARY] TABLE [IF EXISTS]\n tbl_name [, tbl_name] ...\n [RESTRICT | CASCADE]\n\nDROP TABLE removes one or more tables. You must have the DROP privilege\nfor each table. All table data and the table definition are removed, so\nbe careful with this statement! If any of the tables named in the\nargument list do not exist, MySQL returns an error indicating by name\nwhich nonexisting tables it was unable to drop, but it also drops all\nof the tables in the list that do exist.\n\n*Important*: When a table is dropped, user privileges on the table are\nnot automatically dropped. See [HELP GRANT].\n\nNote that for a partitioned table, DROP TABLE permanently removes the\ntable definition, all of its partitions, and all of the data which was\nstored in those partitions. It also removes the partitioning definition\n(.par) file associated with the dropped table.\n\nUse IF EXISTS to prevent an error from occurring for tables that do not\nexist. A NOTE is generated for each nonexistent table when using IF\nEXISTS. See [HELP SHOW WARNINGS].\n\nRESTRICT and CASCADE are permitted to make porting easier. In MySQL\n5.5, they do nothing.\n\n*Note*: DROP TABLE automatically commits the current active\ntransaction, unless you use the TEMPORARY keyword.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/drop-table.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/drop-table.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (277,4,'POW','Syntax:\nPOW(X,Y)\n\nReturns the value of X raised to the power of Y.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/mathematical-functions.html\n\n','mysql> SELECT POW(2,2);\n -> 4\nmysql> SELECT POW(2,-2);\n -> 0.25\n','http://dev.mysql.com/doc/refman/5.5/en/mathematical-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (278,26,'SHOW CREATE TABLE','Syntax:\nSHOW CREATE TABLE tbl_name\n\nShows the CREATE TABLE statement that creates the given table. To use\nthis statement, you must have some privilege for the table. This\nstatement also works with views.\nSHOW CREATE TABLE quotes table and column names according to the value\nof the sql_quote_show_create option. See\nhttp://dev.mysql.com/doc/refman/5.5/en/server-system-variables.html.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/show-create-table.html\n\n','mysql> SHOW CREATE TABLE t\\G\n*************************** 1. row ***************************\n Table: t\nCreate Table: CREATE TABLE t (\n id INT(11) default NULL auto_increment,\n s char(60) default NULL,\n PRIMARY KEY (id)\n) ENGINE=MyISAM\n','http://dev.mysql.com/doc/refman/5.5/en/show-create-table.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (279,27,'DUAL','You are permitted to specify DUAL as a dummy table name in situations\nwhere no tables are referenced:\n\nmysql> SELECT 1 + 1 FROM DUAL;\n -> 2\n\nDUAL is purely for the convenience of people who require that all\nSELECT statements should have FROM and possibly other clauses. MySQL\nmay ignore the clauses. MySQL does not require FROM DUAL if no tables\nare referenced.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/select.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/select.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (280,37,'INSTR','Syntax:\nINSTR(str,substr)\n\nReturns the position of the first occurrence of substring substr in\nstring str. This is the same as the two-argument form of LOCATE(),\nexcept that the order of the arguments is reversed.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/string-functions.html\n\n','mysql> SELECT INSTR(\'foobarbar\', \'bar\');\n -> 4\nmysql> SELECT INSTR(\'xbar\', \'foobar\');\n -> 0\n','http://dev.mysql.com/doc/refman/5.5/en/string-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (281,31,'NOW','Syntax:\nNOW()\n\nReturns the current date and time as a value in \'YYYY-MM-DD HH:MM:SS\'\nor YYYYMMDDHHMMSS.uuuuuu format, depending on whether the function is\nused in a string or numeric context. The value is expressed in the\ncurrent time zone.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html\n\n','mysql> SELECT NOW();\n -> \'2007-12-15 23:50:26\'\nmysql> SELECT NOW() + 0;\n -> 20071215235026.000000\n','http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (282,26,'SHOW ENGINES','Syntax:\nSHOW [STORAGE] ENGINES\n\nSHOW ENGINES displays status information about the server\'s storage\nengines. This is particularly useful for checking whether a storage\nengine is supported, or to see what the default engine is.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/show-engines.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/show-engines.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (283,18,'>=','Syntax:\n>=\n\nGreater than or equal:\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/comparison-operators.html\n\n','mysql> SELECT 2 >= 2;\n -> 1\n','http://dev.mysql.com/doc/refman/5.5/en/comparison-operators.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (284,4,'EXP','Syntax:\nEXP(X)\n\nReturns the value of e (the base of natural logarithms) raised to the\npower of X. The inverse of this function is LOG() (using a single\nargument only) or LN().\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/mathematical-functions.html\n\n','mysql> SELECT EXP(2);\n -> 7.3890560989307\nmysql> SELECT EXP(-2);\n -> 0.13533528323661\nmysql> SELECT EXP(0);\n -> 1\n','http://dev.mysql.com/doc/refman/5.5/en/mathematical-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (285,22,'LONGBLOB','LONGBLOB\n\nA BLOB column with a maximum length of 4,294,967,295 or 4GB (232 - 1)\nbytes. The effective maximum length of LONGBLOB columns depends on the\nconfigured maximum packet size in the client/server protocol and\navailable memory. Each LONGBLOB value is stored using a 4-byte length\nprefix that indicates the number of bytes in the value.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/string-type-overview.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (286,13,'POINTN','PointN(ls,N)\n\nReturns the N-th Point in the Linestring value ls. Points are numbered\nbeginning with 1.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/geometry-property-functions.html#linestring-property-functions\n\n','mysql> SET @ls = \'LineString(1 1,2 2,3 3)\';\nmysql> SELECT AsText(PointN(GeomFromText(@ls),2));\n+-------------------------------------+\n| AsText(PointN(GeomFromText(@ls),2)) |\n+-------------------------------------+\n| POINT(2 2) |\n+-------------------------------------+\n','http://dev.mysql.com/doc/refman/5.5/en/geometry-property-functions.html#linestring-property-functions'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (287,22,'YEAR DATA TYPE','YEAR[(2|4)]\n\nA year in two-digit or four-digit format. The default is four-digit\nformat. YEAR(2) or YEAR(4) differ in display format, but have the same\nrange of values. In four-digit format, values display as 1901 to 2155,\nand 0000. In two-digit format, values display as 70 to 69, representing\nyears from 1970 to 2069. MySQL displays YEAR values in YYYY or\nYYformat, but permits assignment of values to YEAR columns using either\nstrings or numbers.\n\n*Note*: The YEAR(2) data type has certain issues that you should\nconsider before choosing to use it. As of MySQL 5.5.27, YEAR(2) is\ndeprecated. For more information, see\nhttp://dev.mysql.com/doc/refman/5.5/en/migrating-to-year4.html.\n\nFor additional information about YEAR display format and inerpretation\nof input values, see http://dev.mysql.com/doc/refman/5.5/en/year.html.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/date-and-time-type-overview.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (288,16,'SUM','Syntax:\nSUM([DISTINCT] expr)\n\nReturns the sum of expr. If the return set has no rows, SUM() returns\nNULL. The DISTINCT keyword can be used to sum only the distinct values\nof expr.\n\nSUM() returns NULL if there were no matching rows.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/group-by-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/group-by-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (289,37,'OCT','Syntax:\nOCT(N)\n\nReturns a string representation of the octal value of N, where N is a\nlonglong (BIGINT) number. This is equivalent to CONV(N,10,8). Returns\nNULL if N is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/string-functions.html\n\n','mysql> SELECT OCT(12);\n -> \'14\'\n','http://dev.mysql.com/doc/refman/5.5/en/string-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (290,31,'SYSDATE','Syntax:\nSYSDATE()\n\nReturns the current date and time as a value in \'YYYY-MM-DD HH:MM:SS\'\nor YYYYMMDDHHMMSS.uuuuuu format, depending on whether the function is\nused in a string or numeric context.\n\nSYSDATE() returns the time at which it executes. This differs from the\nbehavior for NOW(), which returns a constant time that indicates the\ntime at which the statement began to execute. (Within a stored function\nor trigger, NOW() returns the time at which the function or triggering\nstatement began to execute.)\n\nmysql> SELECT NOW(), SLEEP(2), NOW();\n+---------------------+----------+---------------------+\n| NOW() | SLEEP(2) | NOW() |\n+---------------------+----------+---------------------+\n| 2006-04-12 13:47:36 | 0 | 2006-04-12 13:47:36 |\n+---------------------+----------+---------------------+\n\nmysql> SELECT SYSDATE(), SLEEP(2), SYSDATE();\n+---------------------+----------+---------------------+\n| SYSDATE() | SLEEP(2) | SYSDATE() |\n+---------------------+----------+---------------------+\n| 2006-04-12 13:47:44 | 0 | 2006-04-12 13:47:46 |\n+---------------------+----------+---------------------+\n\nIn addition, the SET TIMESTAMP statement affects the value returned by\nNOW() but not by SYSDATE(). This means that timestamp settings in the\nbinary log have no effect on invocations of SYSDATE().\n\nBecause SYSDATE() can return different values even within the same\nstatement, and is not affected by SET TIMESTAMP, it is nondeterministic\nand therefore unsafe for replication if statement-based binary logging\nis used. If that is a problem, you can use row-based logging.\n\nAlternatively, you can use the --sysdate-is-now option to cause\nSYSDATE() to be an alias for NOW(). This works if the option is used on\nboth the master and the slave.\n\nThe nondeterministic nature of SYSDATE() also means that indexes cannot\nbe used for evaluating expressions that refer to it.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (291,5,'UNINSTALL PLUGIN','Syntax:\nUNINSTALL PLUGIN plugin_name\n\nThis statement removes an installed server plugin. It requires the\nDELETE privilege for the mysql.plugin table.\n\nplugin_name must be the name of some plugin that is listed in the\nmysql.plugin table. The server executes the plugin\'s deinitialization\nfunction and removes the row for the plugin from the mysql.plugin\ntable, so that subsequent server restarts will not load and initialize\nthe plugin. UNINSTALL PLUGIN does not remove the plugin\'s shared\nlibrary file.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/uninstall-plugin.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/uninstall-plugin.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (292,32,'ASBINARY','AsBinary(g), AsWKB(g)\n\nConverts a value in internal geometry format to its WKB representation\nand returns the binary result.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/functions-to-convert-geometries-between-formats.html\n\n','SELECT AsBinary(g) FROM geom;\n','http://dev.mysql.com/doc/refman/5.5/en/functions-to-convert-geometries-between-formats.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (293,37,'REPEAT FUNCTION','Syntax:\nREPEAT(str,count)\n\nReturns a string consisting of the string str repeated count times. If\ncount is less than 1, returns an empty string. Returns NULL if str or\ncount are NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/string-functions.html\n\n','mysql> SELECT REPEAT(\'MySQL\', 3);\n -> \'MySQLMySQLMySQL\'\n','http://dev.mysql.com/doc/refman/5.5/en/string-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (294,26,'SHOW TABLES','Syntax:\nSHOW [FULL] TABLES [{FROM | IN} db_name]\n [LIKE \'pattern\' | WHERE expr]\n\nSHOW TABLES lists the non-TEMPORARY tables in a given database. You can\nalso get this list using the mysqlshow db_name command. The LIKE\nclause, if present, indicates which table names to match. The WHERE\nclause can be given to select rows using more general conditions, as\ndiscussed in http://dev.mysql.com/doc/refman/5.5/en/extended-show.html.\n\nThis statement also lists any views in the database. The FULL modifier\nis supported such that SHOW FULL TABLES displays a second output\ncolumn. Values for the second column are BASE TABLE for a table and\nVIEW for a view.\n\nIf you have no privileges for a base table or view, it does not show up\nin the output from SHOW TABLES or mysqlshow db_name.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/show-tables.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/show-tables.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (295,31,'MAKEDATE','Syntax:\nMAKEDATE(year,dayofyear)\n\nReturns a date, given year and day-of-year values. dayofyear must be\ngreater than 0 or the result is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html\n\n','mysql> SELECT MAKEDATE(2011,31), MAKEDATE(2011,32);\n -> \'2011-01-31\', \'2011-02-01\'\nmysql> SELECT MAKEDATE(2011,365), MAKEDATE(2014,365);\n -> \'2011-12-31\', \'2014-12-31\'\nmysql> SELECT MAKEDATE(2011,0);\n -> NULL\n','http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (296,37,'BINARY OPERATOR','Syntax:\nBINARY\n\nThe BINARY operator casts the string following it to a binary string.\nThis is an easy way to force a column comparison to be done byte by\nbyte rather than character by character. This causes the comparison to\nbe case sensitive even if the column is not defined as BINARY or BLOB.\nBINARY also causes trailing spaces to be significant.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/cast-functions.html\n\n','mysql> SELECT \'a\' = \'A\';\n -> 1\nmysql> SELECT BINARY \'a\' = \'A\';\n -> 0\nmysql> SELECT \'a\' = \'a \';\n -> 1\nmysql> SELECT BINARY \'a\' = \'a \';\n -> 0\n','http://dev.mysql.com/doc/refman/5.5/en/cast-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (297,6,'MBROVERLAPS','MBROverlaps(g1,g2)\n\nReturns 1 or 0 to indicate whether the Minimum Bounding Rectangles of\nthe two geometries g1 and g2 overlap. The term spatially overlaps is\nused if two geometries intersect and their intersection results in a\ngeometry of the same dimension but not equal to either of the given\ngeometries.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/functions-for-testing-spatial-relations-between-geometric-objects.html#relations-on-geometry-mbr\n\n','','http://dev.mysql.com/doc/refman/5.5/en/functions-for-testing-spatial-relations-between-geometric-objects.html#relations-on-geometry-mbr'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (298,37,'SOUNDEX','Syntax:\nSOUNDEX(str)\n\nReturns a soundex string from str. Two strings that sound almost the\nsame should have identical soundex strings. A standard soundex string\nis four characters long, but the SOUNDEX() function returns an\narbitrarily long string. You can use SUBSTRING() on the result to get a\nstandard soundex string. All nonalphabetic characters in str are\nignored. All international alphabetic characters outside the A-Z range\nare treated as vowels.\n\n*Important*: When using SOUNDEX(), you should be aware of the following\nlimitations:\n\no This function, as currently implemented, is intended to work well\n with strings that are in the English language only. Strings in other\n languages may not produce reliable results.\n\no This function is not guaranteed to provide consistent results with\n strings that use multi-byte character sets, including utf-8.\n\n We hope to remove these limitations in a future release. See Bug\n #22638 for more information.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/string-functions.html\n\n','mysql> SELECT SOUNDEX(\'Hello\');\n -> \'H400\'\nmysql> SELECT SOUNDEX(\'Quadratically\');\n -> \'Q36324\'\n','http://dev.mysql.com/doc/refman/5.5/en/string-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (299,6,'MBRTOUCHES','MBRTouches(g1,g2)\n\nReturns 1 or 0 to indicate whether the Minimum Bounding Rectangles of\nthe two geometries g1 and g2 touch. Two geometries spatially touch if\nthe interiors of the geometries do not intersect, but the boundary of\none of the geometries intersects either the boundary or the interior of\nthe other.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/functions-for-testing-spatial-relations-between-geometric-objects.html#relations-on-geometry-mbr\n\n','','http://dev.mysql.com/doc/refman/5.5/en/functions-for-testing-spatial-relations-between-geometric-objects.html#relations-on-geometry-mbr'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (300,39,'DROP EVENT','Syntax:\nDROP EVENT [IF EXISTS] event_name\n\nThis statement drops the event named event_name. The event immediately\nceases being active, and is deleted completely from the server.\n\nIf the event does not exist, the error ERROR 1517 (HY000): Unknown\nevent \'event_name\' results. You can override this and cause the\nstatement to generate a warning for nonexistent events instead using IF\nEXISTS.\n\nThis statement requires the EVENT privilege for the schema to which the\nevent to be dropped belongs.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/drop-event.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/drop-event.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (301,27,'INSERT SELECT','Syntax:\nINSERT [LOW_PRIORITY | HIGH_PRIORITY] [IGNORE]\n [INTO] tbl_name [(col_name,...)]\n SELECT ...\n [ ON DUPLICATE KEY UPDATE col_name=expr, ... ]\n\nWith INSERT ... SELECT, you can quickly insert many rows into a table\nfrom one or many tables. For example:\n\nINSERT INTO tbl_temp2 (fld_id)\n SELECT tbl_temp1.fld_order_id\n FROM tbl_temp1 WHERE tbl_temp1.fld_order_id > 100;\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/insert-select.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/insert-select.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (302,39,'CREATE PROCEDURE','Syntax:\nCREATE\n [DEFINER = { user | CURRENT_USER }]\n PROCEDURE sp_name ([proc_parameter[,...]])\n [characteristic ...] routine_body\n\nCREATE\n [DEFINER = { user | CURRENT_USER }]\n FUNCTION sp_name ([func_parameter[,...]])\n RETURNS type\n [characteristic ...] routine_body\n\nproc_parameter:\n [ IN | OUT | INOUT ] param_name type\n\nfunc_parameter:\n param_name type\n\ntype:\n Any valid MySQL data type\n\ncharacteristic:\n COMMENT \'string\'\n | LANGUAGE SQL\n | [NOT] DETERMINISTIC\n | { CONTAINS SQL | NO SQL | READS SQL DATA | MODIFIES SQL DATA }\n | SQL SECURITY { DEFINER | INVOKER }\n\nroutine_body:\n Valid SQL routine statement\n\nThese statements create stored routines. By default, a routine is\nassociated with the default database. To associate the routine\nexplicitly with a given database, specify the name as db_name.sp_name\nwhen you create it.\n\nThe CREATE FUNCTION statement is also used in MySQL to support UDFs\n(user-defined functions). See\nhttp://dev.mysql.com/doc/refman/5.5/en/adding-functions.html. A UDF can\nbe regarded as an external stored function. Stored functions share\ntheir namespace with UDFs. See\nhttp://dev.mysql.com/doc/refman/5.5/en/function-resolution.html, for\nthe rules describing how the server interprets references to different\nkinds of functions.\n\nTo invoke a stored procedure, use the CALL statement (see [HELP CALL]).\nTo invoke a stored function, refer to it in an expression. The function\nreturns a value during expression evaluation.\n\nCREATE PROCEDURE and CREATE FUNCTION require the CREATE ROUTINE\nprivilege. They might also require the SUPER privilege, depending on\nthe DEFINER value, as described later in this section. If binary\nlogging is enabled, CREATE FUNCTION might require the SUPER privilege,\nas described in\nhttp://dev.mysql.com/doc/refman/5.5/en/stored-programs-logging.html.\n\nBy default, MySQL automatically grants the ALTER ROUTINE and EXECUTE\nprivileges to the routine creator. This behavior can be changed by\ndisabling the automatic_sp_privileges system variable. See\nhttp://dev.mysql.com/doc/refman/5.5/en/stored-routines-privileges.html.\n\nThe DEFINER and SQL SECURITY clauses specify the security context to be\nused when checking access privileges at routine execution time, as\ndescribed later in this section.\n\nIf the routine name is the same as the name of a built-in SQL function,\na syntax error occurs unless you use a space between the name and the\nfollowing parenthesis when defining the routine or invoking it later.\nFor this reason, avoid using the names of existing SQL functions for\nyour own stored routines.\n\nThe IGNORE_SPACE SQL mode applies to built-in functions, not to stored\nroutines. It is always permissible to have spaces after a stored\nroutine name, regardless of whether IGNORE_SPACE is enabled.\n\nThe parameter list enclosed within parentheses must always be present.\nIf there are no parameters, an empty parameter list of () should be\nused. Parameter names are not case sensitive.\n\nEach parameter is an IN parameter by default. To specify otherwise for\na parameter, use the keyword OUT or INOUT before the parameter name.\n\n*Note*: Specifying a parameter as IN, OUT, or INOUT is valid only for a\nPROCEDURE. For a FUNCTION, parameters are always regarded as IN\nparameters.\n\nAn IN parameter passes a value into a procedure. The procedure might\nmodify the value, but the modification is not visible to the caller\nwhen the procedure returns. An OUT parameter passes a value from the\nprocedure back to the caller. Its initial value is NULL within the\nprocedure, and its value is visible to the caller when the procedure\nreturns. An INOUT parameter is initialized by the caller, can be\nmodified by the procedure, and any change made by the procedure is\nvisible to the caller when the procedure returns.\n\nFor each OUT or INOUT parameter, pass a user-defined variable in the\nCALL statement that invokes the procedure so that you can obtain its\nvalue when the procedure returns. If you are calling the procedure from\nwithin another stored procedure or function, you can also pass a\nroutine parameter or local routine variable as an IN or INOUT\nparameter.\n\nThe following example shows a simple stored procedure that uses an OUT\nparameter:\n\nmysql> delimiter //\n\nmysql> CREATE PROCEDURE simpleproc (OUT param1 INT)\n -> BEGIN\n -> SELECT COUNT(*) INTO param1 FROM t;\n -> END//\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> delimiter ;\n\nmysql> CALL simpleproc(@a);\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> SELECT @a;\n+------+\n| @a |\n+------+\n| 3 |\n+------+\n1 row in set (0.00 sec)\n\nThe example uses the mysql client delimiter command to change the\nstatement delimiter from ; to // while the procedure is being defined.\nThis enables the ; delimiter used in the procedure body to be passed\nthrough to the server rather than being interpreted by mysql itself.\nSee\nhttp://dev.mysql.com/doc/refman/5.5/en/stored-programs-defining.html.\n\nThe RETURNS clause may be specified only for a FUNCTION, for which it\nis mandatory. It indicates the return type of the function, and the\nfunction body must contain a RETURN value statement. If the RETURN\nstatement returns a value of a different type, the value is coerced to\nthe proper type. For example, if a function specifies an ENUM or SET\nvalue in the RETURNS clause, but the RETURN statement returns an\ninteger, the value returned from the function is the string for the\ncorresponding ENUM member of set of SET members.\n\nThe following example function takes a parameter, performs an operation\nusing an SQL function, and returns the result. In this case, it is\nunnecessary to use delimiter because the function definition contains\nno internal ; statement delimiters:\n\nmysql> CREATE FUNCTION hello (s CHAR(20))\nmysql> RETURNS CHAR(50) DETERMINISTIC\n -> RETURN CONCAT(\'Hello, \',s,\'!\');\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> SELECT hello(\'world\');\n+----------------+\n| hello(\'world\') |\n+----------------+\n| Hello, world! |\n+----------------+\n1 row in set (0.00 sec)\n\nParameter types and function return types can be declared to use any\nvalid data type, except that the COLLATE attribute cannot be used prior\nto MySQL 5.5.3. As of 5.5.3, COLLATE can be used if preceded by the\nCHARACTER SET attribute.\n\nThe routine_body consists of a valid SQL routine statement. This can be\na simple statement such as SELECT or INSERT, or a compound statement\nwritten using BEGIN and END. Compound statements can contain\ndeclarations, loops, and other control structure statements. The syntax\nfor these statements is described in\nhttp://dev.mysql.com/doc/refman/5.5/en/sql-syntax-compound-statements.h\ntml.\n\nMySQL permits routines to contain DDL statements, such as CREATE and\nDROP. MySQL also permits stored procedures (but not stored functions)\nto contain SQL transaction statements such as COMMIT. Stored functions\nmay not contain statements that perform explicit or implicit commit or\nrollback. Support for these statements is not required by the SQL\nstandard, which states that each DBMS vendor may decide whether to\npermit them.\n\nStatements that return a result set can be used within a stored\nprocedure but not within a stored function. This prohibition includes\nSELECT statements that do not have an INTO var_list clause and other\nstatements such as SHOW, EXPLAIN, and CHECK TABLE. For statements that\ncan be determined at function definition time to return a result set, a\nNot allowed to return a result set from a function error occurs\n(ER_SP_NO_RETSET). For statements that can be determined only at\nruntime to return a result set, a PROCEDURE %s can\'t return a result\nset in the given context error occurs (ER_SP_BADSELECT).\n\nUSE statements within stored routines are not permitted. When a routine\nis invoked, an implicit USE db_name is performed (and undone when the\nroutine terminates). The causes the routine to have the given default\ndatabase while it executes. References to objects in databases other\nthan the routine default database should be qualified with the\nappropriate database name.\n\nFor additional information about statements that are not permitted in\nstored routines, see\nhttp://dev.mysql.com/doc/refman/5.5/en/stored-program-restrictions.html\n.\n\nFor information about invoking stored procedures from within programs\nwritten in a language that has a MySQL interface, see [HELP CALL].\n\nMySQL stores the sql_mode system variable setting that is in effect at\nthe time a routine is created, and always executes the routine with\nthis setting in force, regardless of the server SQL mode in effect when\nthe routine is invoked.\n\nThe switch from the SQL mode of the invoker to that of the routine\noccurs after evaluation of arguments and assignment of the resulting\nvalues to routine parameters. If you define a routine in strict SQL\nmode but invoke it in nonstrict mode, assignment of arguments to\nroutine parameters does not take place in strict mode. If you require\nthat expressions passed to a routine be assigned in strict SQL mode,\nyou should invoke the routine with strict mode in effect.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/create-procedure.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/create-procedure.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (303,22,'VARBINARY','VARBINARY(M)\n\nThe VARBINARY type is similar to the VARCHAR type, but stores binary\nbyte strings rather than nonbinary character strings. M represents the\nmaximum column length in bytes.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/string-type-overview.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (304,26,'LOAD INDEX','Syntax:\nLOAD INDEX INTO CACHE\n tbl_index_list [, tbl_index_list] ...\n\ntbl_index_list:\n tbl_name\n [PARTITION (partition_list | ALL)]\n [[INDEX|KEY] (index_name[, index_name] ...)]\n [IGNORE LEAVES]\n\npartition_list:\n partition_name[, partition_name][, ...]\n\nThe LOAD INDEX INTO CACHE statement preloads a table index into the key\ncache to which it has been assigned by an explicit CACHE INDEX\nstatement, or into the default key cache otherwise.\n\nLOAD INDEX INTO CACHE is used only for MyISAM tables. In MySQL 5.5, it\nis also supported for partitioned MyISAM tables; in addition, indexes\non partitioned tables can be preloaded for one, several, or all\npartitions.\n\nThe IGNORE LEAVES modifier causes only blocks for the nonleaf nodes of\nthe index to be preloaded.\n\nIGNORE LEAVES is also supported for partitioned MyISAM tables.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/load-index.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/load-index.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (305,27,'UNION','Syntax:\nSELECT ...\nUNION [ALL | DISTINCT] SELECT ...\n[UNION [ALL | DISTINCT] SELECT ...]\n\nUNION is used to combine the result from multiple SELECT statements\ninto a single result set.\n\nThe column names from the first SELECT statement are used as the column\nnames for the results returned. Selected columns listed in\ncorresponding positions of each SELECT statement should have the same\ndata type. (For example, the first column selected by the first\nstatement should have the same type as the first column selected by the\nother statements.)\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/union.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/union.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (306,31,'TO_DAYS','Syntax:\nTO_DAYS(date)\n\nGiven a date date, returns a day number (the number of days since year\n0).\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html\n\n','mysql> SELECT TO_DAYS(950501);\n -> 728779\nmysql> SELECT TO_DAYS(\'2007-10-07\');\n -> 733321\n','http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (307,37,'NOT REGEXP','Syntax:\nexpr NOT REGEXP pat, expr NOT RLIKE pat\n\nThis is the same as NOT (expr REGEXP pat).\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/regexp.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/regexp.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (308,26,'SHOW INDEX','Syntax:\nSHOW {INDEX | INDEXES | KEYS}\n {FROM | IN} tbl_name\n [{FROM | IN} db_name]\n [WHERE expr]\n\nSHOW INDEX returns table index information. The format resembles that\nof the SQLStatistics call in ODBC. This statement requires some\nprivilege for any column in the table.\nYou can use db_name.tbl_name as an alternative to the tbl_name FROM\ndb_name syntax. These two statements are equivalent:\n\nSHOW INDEX FROM mytable FROM mydb;\nSHOW INDEX FROM mydb.mytable;\n\nThe WHERE clause can be given to select rows using more general\nconditions, as discussed in\nhttp://dev.mysql.com/doc/refman/5.5/en/extended-show.html.\n\nYou can also list a table\'s indexes with the mysqlshow -k db_name\ntbl_name command.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/show-index.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/show-index.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (309,26,'SHOW CREATE DATABASE','Syntax:\nSHOW CREATE {DATABASE | SCHEMA} [IF NOT EXISTS] db_name\n\nShows the CREATE DATABASE statement that creates the given database. If\nthe SHOW statement includes an IF NOT EXISTS clause, the output too\nincludes such a clause. SHOW CREATE SCHEMA is a synonym for SHOW CREATE\nDATABASE.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/show-create-database.html\n\n','mysql> SHOW CREATE DATABASE test\\G\n*************************** 1. row ***************************\n Database: test\nCreate Database: CREATE DATABASE `test`\n /*!40100 DEFAULT CHARACTER SET latin1 */\n\nmysql> SHOW CREATE SCHEMA test\\G\n*************************** 1. row ***************************\n Database: test\nCreate Database: CREATE DATABASE `test`\n /*!40100 DEFAULT CHARACTER SET latin1 */\n','http://dev.mysql.com/doc/refman/5.5/en/show-create-database.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (310,23,'LEAVE','Syntax:\nLEAVE label\n\nThis statement is used to exit the flow control construct that has the\ngiven label. If the label is for the outermost stored program block,\nLEAVE exits the program.\n\nLEAVE can be used within BEGIN ... END or loop constructs (LOOP,\nREPEAT, WHILE).\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/leave.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/leave.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (311,18,'NOT IN','Syntax:\nexpr NOT IN (value,...)\n\nThis is the same as NOT (expr IN (value,...)).\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/comparison-operators.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/comparison-operators.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (312,15,'!','Syntax:\nNOT, !\n\nLogical NOT. Evaluates to 1 if the operand is 0, to 0 if the operand is\nnonzero, and NOT NULL returns NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/logical-operators.html\n\n','mysql> SELECT NOT 10;\n -> 0\nmysql> SELECT NOT 0;\n -> 1\nmysql> SELECT NOT NULL;\n -> NULL\nmysql> SELECT ! (1+1);\n -> 0\nmysql> SELECT ! 1+1;\n -> 1\n','http://dev.mysql.com/doc/refman/5.5/en/logical-operators.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (313,23,'DECLARE HANDLER','Syntax:\nDECLARE handler_action HANDLER\n FOR condition_value [, condition_value] ...\n statement\n\nhandler_action:\n CONTINUE\n | EXIT\n | UNDO\n\ncondition_value:\n mysql_error_code\n | SQLSTATE [VALUE] sqlstate_value\n | condition_name\n | SQLWARNING\n | NOT FOUND\n | SQLEXCEPTION\n\nThe DECLARE ... HANDLER statement specifies a handler that deals with\none or more conditions. If one of these conditions occurs, the\nspecified statement executes. statement can be a simple statement such\nas SET var_name = value, or a compound statement written using BEGIN\nand END (see [HELP BEGIN END]).\n\nHandler declarations must appear after variable or condition\ndeclarations.\n\nThe handler_action value indicates what action the handler takes after\nexecution of the handler statement:\n\no CONTINUE: Execution of the current program continues.\n\no EXIT: Execution terminates for the BEGIN ... END compound statement\n in which the handler is declared. This is true even if the condition\n occurs in an inner block.\n\no UNDO: Not supported.\n\nThe condition_value for DECLARE ... HANDLER indicates the specific\ncondition or class of conditions that activates the handler:\n\no A MySQL error code (a number) or an SQLSTATE value (a 5-character\n string literal). You should not use MySQL error code 0 or SQLSTATE\n values that begin with \'00\', because those indicate success rather\n than an error condition. For a list of MySQL error codes and SQLSTATE\n values, see\n http://dev.mysql.com/doc/refman/5.5/en/error-messages-server.html.\n\no A condition name previously specified with DECLARE ... CONDITION. A\n condition name can be associated with a MySQL error code or SQLSTATE\n value. See [HELP DECLARE CONDITION].\n\no SQLWARNING is shorthand for the class of SQLSTATE values that begin\n with \'01\'.\n\no NOT FOUND is shorthand for the class of SQLSTATE values that begin\n with \'02\'. This is relevant within the context of cursors and is used\n to control what happens when a cursor reaches the end of a data set.\n If no more rows are available, a No Data condition occurs with\n SQLSTATE value \'02000\'. To detect this condition, you can set up a\n handler for it (or for a NOT FOUND condition). For an example, see\n http://dev.mysql.com/doc/refman/5.5/en/cursors.html. This condition\n also occurs for SELECT ... INTO var_list statements that retrieve no\n rows.\n\no SQLEXCEPTION is shorthand for the class of SQLSTATE values that do\n not begin with \'00\', \'01\', or \'02\'.\n\nIf a condition occurs for which no handler has been declared, the\naction taken depends on the condition class:\n\no For SQLEXCEPTION conditions, the stored program terminates at the\n statement that raised the condition, as if there were an EXIT\n handler. If the program was called by another stored program, the\n calling program handles the condition using the handler selection\n rules applied to its own handlers.\n\no For SQLWARNING conditions, the program continues executing, as if\n there were a CONTINUE handler.\n\no For NOT FOUND conditions, if the condition was raised normally, the\n action is CONTINUE. If it was raised by SIGNAL or RESIGNAL, the\n action is EXIT.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/declare-handler.html\n\n','mysql> CREATE TABLE test.t (s1 INT, PRIMARY KEY (s1));\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> delimiter //\n\nmysql> CREATE PROCEDURE handlerdemo ()\n -> BEGIN\n -> DECLARE CONTINUE HANDLER FOR SQLSTATE \'23000\' SET @x2 = 1;\n -> SET @x = 1;\n -> INSERT INTO test.t VALUES (1);\n -> SET @x = 2;\n -> INSERT INTO test.t VALUES (1);\n -> SET @x = 3;\n -> END;\n -> //\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> CALL handlerdemo()//\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> SELECT @x//\n +------+\n | @x |\n +------+\n | 3 |\n +------+\n 1 row in set (0.00 sec)\n','http://dev.mysql.com/doc/refman/5.5/en/declare-handler.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (314,22,'DOUBLE','DOUBLE[(M,D)] [UNSIGNED] [ZEROFILL]\n\nA normal-size (double-precision) floating-point number. Permissible\nvalues are -1.7976931348623157E+308 to -2.2250738585072014E-308, 0, and\n2.2250738585072014E-308 to 1.7976931348623157E+308. These are the\ntheoretical limits, based on the IEEE standard. The actual range might\nbe slightly smaller depending on your hardware or operating system.\n\nM is the total number of digits and D is the number of digits following\nthe decimal point. If M and D are omitted, values are stored to the\nlimits permitted by the hardware. A double-precision floating-point\nnumber is accurate to approximately 15 decimal places.\n\nUNSIGNED, if specified, disallows negative values.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/numeric-type-overview.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (315,22,'TIME','TIME\n\nA time. The range is \'-838:59:59\' to \'838:59:59\'. MySQL displays TIME\nvalues in \'HH:MM:SS\' format, but permits assignment of values to TIME\ncolumns using either strings or numbers.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/date-and-time-type-overview.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (316,15,'&&','Syntax:\nAND, &&\n\nLogical AND. Evaluates to 1 if all operands are nonzero and not NULL,\nto 0 if one or more operands are 0, otherwise NULL is returned.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/logical-operators.html\n\n','mysql> SELECT 1 && 1;\n -> 1\nmysql> SELECT 1 && 0;\n -> 0\nmysql> SELECT 1 && NULL;\n -> NULL\nmysql> SELECT 0 && NULL;\n -> 0\nmysql> SELECT NULL && 0;\n -> 0\n','http://dev.mysql.com/doc/refman/5.5/en/logical-operators.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (317,11,'X','X(p)\n\nReturns the X-coordinate value for the Point object p as a\ndouble-precision number.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/geometry-property-functions.html#point-property-functions\n\n','mysql> SELECT X(POINT(56.7, 53.34));\n+-----------------------+\n| X(POINT(56.7, 53.34)) |\n+-----------------------+\n| 56.7 |\n+-----------------------+\n','http://dev.mysql.com/doc/refman/5.5/en/geometry-property-functions.html#point-property-functions'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (318,17,'SYSTEM_USER','Syntax:\nSYSTEM_USER()\n\nSYSTEM_USER() is a synonym for USER().\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/information-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/information-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (319,17,'FOUND_ROWS','Syntax:\nFOUND_ROWS()\n\nA SELECT statement may include a LIMIT clause to restrict the number of\nrows the server returns to the client. In some cases, it is desirable\nto know how many rows the statement would have returned without the\nLIMIT, but without running the statement again. To obtain this row\ncount, include a SQL_CALC_FOUND_ROWS option in the SELECT statement,\nand then invoke FOUND_ROWS() afterward:\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/information-functions.html\n\n','mysql> SELECT SQL_CALC_FOUND_ROWS * FROM tbl_name\n -> WHERE id > 100 LIMIT 10;\nmysql> SELECT FOUND_ROWS();\n','http://dev.mysql.com/doc/refman/5.5/en/information-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (320,30,'CROSSES','Crosses(g1,g2)\n\nReturns 1 if g1 spatially crosses g2. Returns NULL if g1 is a Polygon\nor a MultiPolygon, or if g2 is a Point or a MultiPoint. Otherwise,\nreturns 0.\n\nThe term spatially crosses denotes a spatial relation between two given\ngeometries that has the following properties:\n\no The two geometries intersect\n\no Their intersection results in a geometry that has a dimension that is\n one less than the maximum dimension of the two given geometries\n\no Their intersection is not equal to either of the two given geometries\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/functions-for-testing-spatial-relations-between-geometric-objects.html#functions-that-test-spatial-relationships-between-geometries\n\n','','http://dev.mysql.com/doc/refman/5.5/en/functions-for-testing-spatial-relations-between-geometric-objects.html#functions-that-test-spatial-relationships-between-geometries'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (321,39,'TRUNCATE TABLE','Syntax:\nTRUNCATE [TABLE] tbl_name\n\nTRUNCATE TABLE empties a table completely. It requires the DROP\nprivilege.\n\nLogically, TRUNCATE TABLE is similar to a DELETE statement that deletes\nall rows, or a sequence of DROP TABLE and CREATE TABLE statements. To\nachieve high performance, it bypasses the DML method of deleting data.\nThus, it cannot be rolled back, it does not cause ON DELETE triggers to\nfire, and it cannot be performed for InnoDB tables with parent-child\nforeign key relationships.\n\nAlthough TRUNCATE TABLE is similar to DELETE, it is classified as a DDL\nstatement rather than a DML statement. It differs from DELETE in the\nfollowing ways in MySQL 5.5:\n\no Truncate operations drop and re-create the table, which is much\n faster than deleting rows one by one, particularly for large tables.\n\no Truncate operations cause an implicit commit, and so cannot be rolled\n back.\n\no Truncation operations cannot be performed if the session holds an\n active table lock.\n\no TRUNCATE TABLE fails for an InnoDB table if there are any FOREIGN KEY\n constraints from other tables that reference the table. Foreign key\n constraints between columns of the same table are permitted.\n\no Truncation operations do not return a meaningful value for the number\n of deleted rows. The usual result is "0 rows affected," which should\n be interpreted as "no information."\n\no As long as the table format file tbl_name.frm is valid, the table can\n be re-created as an empty table with TRUNCATE TABLE, even if the data\n or index files have become corrupted.\n\no Any AUTO_INCREMENT value is reset to its start value. This is true\n even for MyISAM and InnoDB, which normally do not reuse sequence\n values.\n\no When used with partitioned tables, TRUNCATE TABLE preserves the\n partitioning; that is, the data and index files are dropped and\n re-created, while the partition definitions (.par) file is\n unaffected.\n\no The TRUNCATE TABLE statement does not invoke ON DELETE triggers.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/truncate-table.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/truncate-table.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (322,16,'BIT_XOR','Syntax:\nBIT_XOR(expr)\n\nReturns the bitwise XOR of all bits in expr. The calculation is\nperformed with 64-bit (BIGINT) precision.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/group-by-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/group-by-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (323,31,'CURRENT_DATE','Syntax:\nCURRENT_DATE, CURRENT_DATE()\n\nCURRENT_DATE and CURRENT_DATE() are synonyms for CURDATE().\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (324,8,'START SLAVE','Syntax:\nSTART SLAVE [thread_types]\n\nSTART SLAVE [SQL_THREAD] UNTIL\n MASTER_LOG_FILE = \'log_name\', MASTER_LOG_POS = log_pos\n\nSTART SLAVE [SQL_THREAD] UNTIL\n RELAY_LOG_FILE = \'log_name\', RELAY_LOG_POS = log_pos\n\nthread_types:\n [thread_type [, thread_type] ... ]\n\nthread_type: IO_THREAD | SQL_THREAD\n\nSTART SLAVE with no thread_type options starts both of the slave\nthreads. The I/O thread reads events from the master server and stores\nthem in the relay log. The SQL thread reads events from the relay log\nand executes them. START SLAVE requires the SUPER privilege.\n\nIf START SLAVE succeeds in starting the slave threads, it returns\nwithout any error. However, even in that case, it might be that the\nslave threads start and then later stop (for example, because they do\nnot manage to connect to the master or read its binary log, or some\nother problem). START SLAVE does not warn you about this. You must\ncheck the slave\'s error log for error messages generated by the slave\nthreads, or check that they are running satisfactorily with SHOW SLAVE\nSTATUS.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/start-slave.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/start-slave.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (325,2,'AREA','Area(poly)\n\nReturns as a double-precision number the area of the Polygon value\npoly, as measured in its spatial reference system.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/geometry-property-functions.html#polygon-property-functions\n\n','mysql> SET @poly = \'Polygon((0 0,0 3,3 0,0 0),(1 1,1 2,2 1,1 1))\';\nmysql> SELECT Area(GeomFromText(@poly));\n+---------------------------+\n| Area(GeomFromText(@poly)) |\n+---------------------------+\n| 4 |\n+---------------------------+\n','http://dev.mysql.com/doc/refman/5.5/en/geometry-property-functions.html#polygon-property-functions'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (326,26,'FLUSH','Syntax:\nFLUSH [NO_WRITE_TO_BINLOG | LOCAL]\n flush_option [, flush_option] ...\n\nThe FLUSH statement has several variant forms that clear or reload\nvarious internal caches, flush tables, or acquire locks. To execute\nFLUSH, you must have the RELOAD privilege. Specific flush options might\nrequire additional privileges, as described later.\n\nBy default, the server writes FLUSH statements to the binary log so\nthat they replicate to replication slaves. To suppress logging, use the\noptional NO_WRITE_TO_BINLOG keyword or its alias LOCAL.\n\n*Note*: FLUSH LOGS, FLUSH MASTER, FLUSH SLAVE, and FLUSH TABLES WITH\nREAD LOCK (with or without a table list) are not written to the binary\nlog in any case because they would cause problems if replicated to a\nslave.\n\nThe FLUSH statement causes an implicit commit. See\nhttp://dev.mysql.com/doc/refman/5.5/en/implicit-commit.html.\n\nThe RESET statement is similar to FLUSH. See [HELP RESET], for\ninformation about using the RESET statement with replication.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/flush.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/flush.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (327,23,'BEGIN END','Syntax:\n[begin_label:] BEGIN\n [statement_list]\nEND [end_label]\n\nBEGIN ... END syntax is used for writing compound statements, which can\nappear within stored programs (stored procedures and functions,\ntriggers, and events). A compound statement can contain multiple\nstatements, enclosed by the BEGIN and END keywords. statement_list\nrepresents a list of one or more statements, each terminated by a\nsemicolon (;) statement delimiter. The statement_list itself is\noptional, so the empty compound statement (BEGIN END) is legal.\n\nBEGIN ... END blocks can be nested.\n\nUse of multiple statements requires that a client is able to send\nstatement strings containing the ; statement delimiter. In the mysql\ncommand-line client, this is handled with the delimiter command.\nChanging the ; end-of-statement delimiter (for example, to //) permit ;\nto be used in a program body. For an example, see\nhttp://dev.mysql.com/doc/refman/5.5/en/stored-programs-defining.html.\n\nA BEGIN ... END block can be labeled. See [HELP labels].\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/begin-end.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/begin-end.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (328,26,'SHOW PROCEDURE STATUS','Syntax:\nSHOW PROCEDURE STATUS\n [LIKE \'pattern\' | WHERE expr]\n\nThis statement is a MySQL extension. It returns characteristics of a\nstored procedure, such as the database, name, type, creator, creation\nand modification dates, and character set information. A similar\nstatement, SHOW FUNCTION STATUS, displays information about stored\nfunctions (see [HELP SHOW FUNCTION STATUS]).\n\nThe LIKE clause, if present, indicates which procedure or function\nnames to match. The WHERE clause can be given to select rows using more\ngeneral conditions, as discussed in\nhttp://dev.mysql.com/doc/refman/5.5/en/extended-show.html.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/show-procedure-status.html\n\n','mysql> SHOW PROCEDURE STATUS LIKE \'sp1\'\\G\n*************************** 1. row ***************************\n Db: test\n Name: sp1\n Type: PROCEDURE\n Definer: testuser@localhost\n Modified: 2004-08-03 15:29:37\n Created: 2004-08-03 15:29:37\n Security_type: DEFINER\n Comment:\ncharacter_set_client: latin1\ncollation_connection: latin1_swedish_ci\n Database Collation: latin1_swedish_ci\n','http://dev.mysql.com/doc/refman/5.5/en/show-procedure-status.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (329,28,'DESCRIBE','Syntax:\n{DESCRIBE | DESC} tbl_name [col_name | wild]\n\nDESCRIBE provides information about the columns in a table. It is a\nshortcut for SHOW COLUMNS FROM. These statements also display\ninformation for views. (See [HELP SHOW COLUMNS].)\n\ncol_name can be a column name, or a string containing the SQL "%" and\n"_" wildcard characters to obtain output only for the columns with\nnames matching the string. There is no need to enclose the string\nwithin quotation marks unless it contains spaces or other special\ncharacters.\n\nmysql> DESCRIBE City;\n+------------+----------+------+-----+---------+----------------+\n| Field | Type | Null | Key | Default | Extra |\n+------------+----------+------+-----+---------+----------------+\n| Id | int(11) | NO | PRI | NULL | auto_increment |\n| Name | char(35) | NO | | | |\n| Country | char(3) | NO | UNI | | |\n| District | char(20) | YES | MUL | | |\n| Population | int(11) | NO | | 0 | |\n+------------+----------+------+-----+---------+----------------+\n5 rows in set (0.00 sec)\n\nThe description for SHOW COLUMNS provides more information about the\noutput columns (see [HELP SHOW COLUMNS]).\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/describe.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/describe.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (330,26,'SHOW WARNINGS','Syntax:\nSHOW WARNINGS [LIMIT [offset,] row_count]\nSHOW COUNT(*) WARNINGS\n\nSHOW WARNINGS shows information about the conditions (errors, warnings,\nand notes) that resulted from the last statement in the current session\nthat generated messages. It shows nothing if the last statement used a\ntable and generated no messages. (That is, a statement that uses a\ntable but generates no messages clears the message list.) Statements\nthat do not use tables and do not generate messages have no effect on\nthe message list.\n\nWarnings are generated for DML statements such as INSERT, UPDATE, and\nLOAD DATA INFILE as well as DDL statements such as CREATE TABLE and\nALTER TABLE.\n\nSHOW WARNINGS is also used following EXPLAIN EXTENDED, to display the\nextra information generated by EXPLAIN when the EXTENDED keyword is\nused. See http://dev.mysql.com/doc/refman/5.5/en/explain-extended.html.\n\nThe LIMIT clause has the same syntax as for the SELECT statement. See\nhttp://dev.mysql.com/doc/refman/5.5/en/select.html.\n\nA related statement, SHOW ERRORS, shows only the error conditions (it\nexcludes warnings and notes). See [HELP SHOW ERRORS].\n\nThe SHOW COUNT(*) WARNINGS statement displays the total number of\nerrors, warnings, and notes. You can also retrieve this number from the\nwarning_count system variable:\n\nSHOW COUNT(*) WARNINGS;\nSELECT @@warning_count;\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/show-warnings.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/show-warnings.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (331,10,'DROP USER','Syntax:\nDROP USER user [, user] ...\n\nThe DROP USER statement removes one or more MySQL accounts and their\nprivileges. It removes privilege rows for the account from all grant\ntables. To use this statement, you must have the global CREATE USER\nprivilege or the DELETE privilege for the mysql database. Each account\nname uses the format described in\nhttp://dev.mysql.com/doc/refman/5.5/en/account-names.html. For example:\n\nDROP USER \'jeffrey\'@\'localhost\';\n\nIf you specify only the user name part of the account name, a host name\npart of \'%\' is used.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/drop-user.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/drop-user.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (332,16,'STDDEV_POP','Syntax:\nSTDDEV_POP(expr)\n\nReturns the population standard deviation of expr (the square root of\nVAR_POP()). You can also use STD() or STDDEV(), which are equivalent\nbut not standard SQL.\n\nSTDDEV_POP() returns NULL if there were no matching rows.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/group-by-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/group-by-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (333,26,'SHOW CHARACTER SET','Syntax:\nSHOW CHARACTER SET\n [LIKE \'pattern\' | WHERE expr]\n\nThe SHOW CHARACTER SET statement shows all available character sets.\nThe LIKE clause, if present, indicates which character set names to\nmatch. The WHERE clause can be given to select rows using more general\nconditions, as discussed in\nhttp://dev.mysql.com/doc/refman/5.5/en/extended-show.html. For example:\n\nmysql> SHOW CHARACTER SET LIKE \'latin%\';\n+---------+-----------------------------+-------------------+--------+\n| Charset | Description | Default collation | Maxlen |\n+---------+-----------------------------+-------------------+--------+\n| latin1 | cp1252 West European | latin1_swedish_ci | 1 |\n| latin2 | ISO 8859-2 Central European | latin2_general_ci | 1 |\n| latin5 | ISO 8859-9 Turkish | latin5_turkish_ci | 1 |\n| latin7 | ISO 8859-13 Baltic | latin7_general_ci | 1 |\n+---------+-----------------------------+-------------------+--------+\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/show-character-set.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/show-character-set.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (334,37,'SUBSTRING','Syntax:\nSUBSTRING(str,pos), SUBSTRING(str FROM pos), SUBSTRING(str,pos,len),\nSUBSTRING(str FROM pos FOR len)\n\nThe forms without a len argument return a substring from string str\nstarting at position pos. The forms with a len argument return a\nsubstring len characters long from string str, starting at position\npos. The forms that use FROM are standard SQL syntax. It is also\npossible to use a negative value for pos. In this case, the beginning\nof the substring is pos characters from the end of the string, rather\nthan the beginning. A negative value may be used for pos in any of the\nforms of this function.\n\nFor all forms of SUBSTRING(), the position of the first character in\nthe string from which the substring is to be extracted is reckoned as\n1.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/string-functions.html\n\n','mysql> SELECT SUBSTRING(\'Quadratically\',5);\n -> \'ratically\'\nmysql> SELECT SUBSTRING(\'foobarbar\' FROM 4);\n -> \'barbar\'\nmysql> SELECT SUBSTRING(\'Quadratically\',5,6);\n -> \'ratica\'\nmysql> SELECT SUBSTRING(\'Sakila\', -3);\n -> \'ila\'\nmysql> SELECT SUBSTRING(\'Sakila\', -5, 3);\n -> \'aki\'\nmysql> SELECT SUBSTRING(\'Sakila\' FROM -4 FOR 2);\n -> \'ki\'\n','http://dev.mysql.com/doc/refman/5.5/en/string-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (335,36,'ISEMPTY','IsEmpty(g)\n\nReturns 1 if the geometry value g is the empty geometry, 0 if it is not\nempty, and -1 if the argument is NULL. If the geometry is empty, it\nrepresents the empty point set.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/geometry-property-functions.html#general-geometry-property-functions\n\n','','http://dev.mysql.com/doc/refman/5.5/en/geometry-property-functions.html#general-geometry-property-functions'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (336,26,'SHOW FUNCTION STATUS','Syntax:\nSHOW FUNCTION STATUS\n [LIKE \'pattern\' | WHERE expr]\n\nThis statement is similar to SHOW PROCEDURE STATUS but for stored\nfunctions. See [HELP SHOW PROCEDURE STATUS].\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/show-function-status.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/show-function-status.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (337,37,'LTRIM','Syntax:\nLTRIM(str)\n\nReturns the string str with leading space characters removed.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/string-functions.html\n\n','mysql> SELECT LTRIM(\' barbar\');\n -> \'barbar\'\n','http://dev.mysql.com/doc/refman/5.5/en/string-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (338,30,'INTERSECTS','Intersects(g1,g2)\n\nReturns 1 or 0 to indicate whether g1 spatially intersects g2.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/functions-for-testing-spatial-relations-between-geometric-objects.html#functions-that-test-spatial-relationships-between-geometries\n\n','','http://dev.mysql.com/doc/refman/5.5/en/functions-for-testing-spatial-relations-between-geometric-objects.html#functions-that-test-spatial-relationships-between-geometries'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (339,27,'CALL','Syntax:\nCALL sp_name([parameter[,...]])\nCALL sp_name[()]\n\nThe CALL statement invokes a stored procedure that was defined\npreviously with CREATE PROCEDURE.\n\nStored procedures that take no arguments can be invoked without\nparentheses. That is, CALL p() and CALL p are equivalent.\n\nCALL can pass back values to its caller using parameters that are\ndeclared as OUT or INOUT parameters. When the procedure returns, a\nclient program can also obtain the number of rows affected for the\nfinal statement executed within the routine: At the SQL level, call the\nROW_COUNT() function; from the C API, call the mysql_affected_rows()\nfunction.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/call.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/call.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (340,6,'MBRDISJOINT','MBRDisjoint(g1,g2)\n\nReturns 1 or 0 to indicate whether the Minimum Bounding Rectangles of\nthe two geometries g1 and g2 are disjoint (do not intersect).\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/functions-for-testing-spatial-relations-between-geometric-objects.html#relations-on-geometry-mbr\n\n','','http://dev.mysql.com/doc/refman/5.5/en/functions-for-testing-spatial-relations-between-geometric-objects.html#relations-on-geometry-mbr'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (341,14,'VALUES','Syntax:\nVALUES(col_name)\n\nIn an INSERT ... ON DUPLICATE KEY UPDATE statement, you can use the\nVALUES(col_name) function in the UPDATE clause to refer to column\nvalues from the INSERT portion of the statement. In other words,\nVALUES(col_name) in the UPDATE clause refers to the value of col_name\nthat would be inserted, had no duplicate-key conflict occurred. This\nfunction is especially useful in multiple-row inserts. The VALUES()\nfunction is meaningful only in the ON DUPLICATE KEY UPDATE clause of\nINSERT statements and returns NULL otherwise. See\nhttp://dev.mysql.com/doc/refman/5.5/en/insert-on-duplicate.html.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/miscellaneous-functions.html\n\n','mysql> INSERT INTO table (a,b,c) VALUES (1,2,3),(4,5,6)\n -> ON DUPLICATE KEY UPDATE c=VALUES(a)+VALUES(b);\n','http://dev.mysql.com/doc/refman/5.5/en/miscellaneous-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (342,37,'SUBSTRING_INDEX','Syntax:\nSUBSTRING_INDEX(str,delim,count)\n\nReturns the substring from string str before count occurrences of the\ndelimiter delim. If count is positive, everything to the left of the\nfinal delimiter (counting from the left) is returned. If count is\nnegative, everything to the right of the final delimiter (counting from\nthe right) is returned. SUBSTRING_INDEX() performs a case-sensitive\nmatch when searching for delim.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/string-functions.html\n\n','mysql> SELECT SUBSTRING_INDEX(\'www.mysql.com\', \'.\', 2);\n -> \'www.mysql\'\nmysql> SELECT SUBSTRING_INDEX(\'www.mysql.com\', \'.\', -2);\n -> \'mysql.com\'\n','http://dev.mysql.com/doc/refman/5.5/en/string-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (343,12,'ENCODE','Syntax:\nENCODE(str,pass_str)\n\nEncrypt str using pass_str as the password. To decrypt the result, use\nDECODE().\n\nThe result is a binary string of the same length as str.\n\nThe strength of the encryption is based on how good the random\ngenerator is. It should suffice for short strings.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/encryption-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/encryption-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (344,23,'LOOP','Syntax:\n[begin_label:] LOOP\n statement_list\nEND LOOP [end_label]\n\nLOOP implements a simple loop construct, enabling repeated execution of\nthe statement list, which consists of one or more statements, each\nterminated by a semicolon (;) statement delimiter. The statements\nwithin the loop are repeated until the loop is terminated. Usually,\nthis is accomplished with a LEAVE statement. Within a stored function,\nRETURN can also be used, which exits the function entirely.\n\nNeglecting to include a loop-termination statement results in an\ninfinite loop.\n\nA LOOP statement can be labeled. For the rules regarding label use, see\n[HELP labels].\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/loop.html\n\n','CREATE PROCEDURE doiterate(p1 INT)\nBEGIN\n label1: LOOP\n SET p1 = p1 + 1;\n IF p1 < 10 THEN\n ITERATE label1;\n END IF;\n LEAVE label1;\n END LOOP label1;\n SET @x = p1;\nEND;\n','http://dev.mysql.com/doc/refman/5.5/en/loop.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (345,4,'TRUNCATE','Syntax:\nTRUNCATE(X,D)\n\nReturns the number X, truncated to D decimal places. If D is 0, the\nresult has no decimal point or fractional part. D can be negative to\ncause D digits left of the decimal point of the value X to become zero.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/mathematical-functions.html\n\n','mysql> SELECT TRUNCATE(1.223,1);\n -> 1.2\nmysql> SELECT TRUNCATE(1.999,1);\n -> 1.9\nmysql> SELECT TRUNCATE(1.999,0);\n -> 1\nmysql> SELECT TRUNCATE(-1.999,1);\n -> -1.9\nmysql> SELECT TRUNCATE(122,-2);\n -> 100\nmysql> SELECT TRUNCATE(10.28*100,0);\n -> 1028\n','http://dev.mysql.com/doc/refman/5.5/en/mathematical-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (346,31,'TIMESTAMPADD','Syntax:\nTIMESTAMPADD(unit,interval,datetime_expr)\n\nAdds the integer expression interval to the date or datetime expression\ndatetime_expr. The unit for interval is given by the unit argument,\nwhich should be one of the following values: MICROSECOND\n(microseconds), SECOND, MINUTE, HOUR, DAY, WEEK, MONTH, QUARTER, or\nYEAR.\n\nIt is possible to use FRAC_SECOND in place of MICROSECOND, but\nFRAC_SECOND is deprecated. FRAC_SECOND was removed in MySQL 5.5.3.\n\nThe unit value may be specified using one of keywords as shown, or with\na prefix of SQL_TSI_. For example, DAY and SQL_TSI_DAY both are legal.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html\n\n','mysql> SELECT TIMESTAMPADD(MINUTE,1,\'2003-01-02\');\n -> \'2003-01-02 00:01:00\'\nmysql> SELECT TIMESTAMPADD(WEEK,1,\'2003-01-02\');\n -> \'2003-01-09\'\n','http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (347,26,'SHOW','SHOW has many forms that provide information about databases, tables,\ncolumns, or status information about the server. This section describes\nthose following:\n\nSHOW AUTHORS\nSHOW {BINARY | MASTER} LOGS\nSHOW BINLOG EVENTS [IN \'log_name\'] [FROM pos] [LIMIT [offset,] row_count]\nSHOW CHARACTER SET [like_or_where]\nSHOW COLLATION [like_or_where]\nSHOW [FULL] COLUMNS FROM tbl_name [FROM db_name] [like_or_where]\nSHOW CONTRIBUTORS\nSHOW CREATE DATABASE db_name\nSHOW CREATE EVENT event_name\nSHOW CREATE FUNCTION func_name\nSHOW CREATE PROCEDURE proc_name\nSHOW CREATE TABLE tbl_name\nSHOW CREATE TRIGGER trigger_name\nSHOW CREATE VIEW view_name\nSHOW DATABASES [like_or_where]\nSHOW ENGINE engine_name {STATUS | MUTEX}\nSHOW [STORAGE] ENGINES\nSHOW ERRORS [LIMIT [offset,] row_count]\nSHOW EVENTS\nSHOW FUNCTION CODE func_name\nSHOW FUNCTION STATUS [like_or_where]\nSHOW GRANTS FOR user\nSHOW INDEX FROM tbl_name [FROM db_name]\nSHOW MASTER STATUS\nSHOW OPEN TABLES [FROM db_name] [like_or_where]\nSHOW PLUGINS\nSHOW PROCEDURE CODE proc_name\nSHOW PROCEDURE STATUS [like_or_where]\nSHOW PRIVILEGES\nSHOW [FULL] PROCESSLIST\nSHOW PROFILE [types] [FOR QUERY n] [OFFSET n] [LIMIT n]\nSHOW PROFILES\nSHOW SLAVE HOSTS\nSHOW SLAVE STATUS\nSHOW [GLOBAL | SESSION] STATUS [like_or_where]\nSHOW TABLE STATUS [FROM db_name] [like_or_where]\nSHOW [FULL] TABLES [FROM db_name] [like_or_where]\nSHOW TRIGGERS [FROM db_name] [like_or_where]\nSHOW [GLOBAL | SESSION] VARIABLES [like_or_where]\nSHOW WARNINGS [LIMIT [offset,] row_count]\n\nlike_or_where:\n LIKE \'pattern\'\n | WHERE expr\n\nIf the syntax for a given SHOW statement includes a LIKE \'pattern\'\npart, \'pattern\' is a string that can contain the SQL "%" and "_"\nwildcard characters. The pattern is useful for restricting statement\noutput to matching values.\n\nSeveral SHOW statements also accept a WHERE clause that provides more\nflexibility in specifying which rows to display. See\nhttp://dev.mysql.com/doc/refman/5.5/en/extended-show.html.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/show.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/show.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (348,18,'GREATEST','Syntax:\nGREATEST(value1,value2,...)\n\nWith two or more arguments, returns the largest (maximum-valued)\nargument. The arguments are compared using the same rules as for\nLEAST().\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/comparison-operators.html\n\n','mysql> SELECT GREATEST(2,0);\n -> 2\nmysql> SELECT GREATEST(34.0,3.0,5.0,767.0);\n -> 767.0\nmysql> SELECT GREATEST(\'B\',\'A\',\'C\');\n -> \'C\'\n','http://dev.mysql.com/doc/refman/5.5/en/comparison-operators.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (349,26,'SHOW VARIABLES','Syntax:\nSHOW [GLOBAL | SESSION] VARIABLES\n [LIKE \'pattern\' | WHERE expr]\n\nSHOW VARIABLES shows the values of MySQL system variables. This\ninformation also can be obtained using the mysqladmin variables\ncommand. The LIKE clause, if present, indicates which variable names to\nmatch. The WHERE clause can be given to select rows using more general\nconditions, as discussed in\nhttp://dev.mysql.com/doc/refman/5.5/en/extended-show.html. This\nstatement does not require any privilege. It requires only the ability\nto connect to the server.\n\nWith the GLOBAL modifier, SHOW VARIABLES displays the values that are\nused for new connections to MySQL. As of MySQL 5.5.3, if a variable has\nno global value, no value is displayed. Before 5.5.3, the session value\nis displayed. With SESSION, SHOW VARIABLES displays the values that are\nin effect for the current connection. If no modifier is present, the\ndefault is SESSION. LOCAL is a synonym for SESSION.\nWith a LIKE clause, the statement displays only rows for those\nvariables with names that match the pattern. To obtain the row for a\nspecific variable, use a LIKE clause as shown:\n\nSHOW VARIABLES LIKE \'max_join_size\';\nSHOW SESSION VARIABLES LIKE \'max_join_size\';\n\nTo get a list of variables whose name match a pattern, use the "%"\nwildcard character in a LIKE clause:\n\nSHOW VARIABLES LIKE \'%size%\';\nSHOW GLOBAL VARIABLES LIKE \'%size%\';\n\nWildcard characters can be used in any position within the pattern to\nbe matched. Strictly speaking, because "_" is a wildcard that matches\nany single character, you should escape it as "\\_" to match it\nliterally. In practice, this is rarely necessary.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/show-variables.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/show-variables.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (350,26,'BINLOG','Syntax:\nBINLOG \'str\'\n\nBINLOG is an internal-use statement. It is generated by the mysqlbinlog\nprogram as the printable representation of certain events in binary log\nfiles. (See http://dev.mysql.com/doc/refman/5.5/en/mysqlbinlog.html.)\nThe \'str\' value is a base 64-encoded string the that server decodes to\ndetermine the data change indicated by the corresponding event. This\nstatement requires the SUPER privilege.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/binlog.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/binlog.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (351,16,'BIT_AND','Syntax:\nBIT_AND(expr)\n\nReturns the bitwise AND of all bits in expr. The calculation is\nperformed with 64-bit (BIGINT) precision.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/group-by-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/group-by-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (352,31,'SECOND','Syntax:\nSECOND(time)\n\nReturns the second for time, in the range 0 to 59.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html\n\n','mysql> SELECT SECOND(\'10:05:03\');\n -> 3\n','http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (353,4,'ATAN2','Syntax:\nATAN(Y,X), ATAN2(Y,X)\n\nReturns the arc tangent of the two variables X and Y. It is similar to\ncalculating the arc tangent of Y / X, except that the signs of both\narguments are used to determine the quadrant of the result.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/mathematical-functions.html\n\n','mysql> SELECT ATAN(-2,2);\n -> -0.78539816339745\nmysql> SELECT ATAN2(PI(),0);\n -> 1.5707963267949\n','http://dev.mysql.com/doc/refman/5.5/en/mathematical-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (354,6,'MBRCONTAINS','MBRContains(g1,g2)\n\nReturns 1 or 0 to indicate whether the Minimum Bounding Rectangle of g1\ncontains the Minimum Bounding Rectangle of g2. This tests the opposite\nrelationship as MBRWithin().\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/functions-for-testing-spatial-relations-between-geometric-objects.html#relations-on-geometry-mbr\n\n','mysql> SET @g1 = GeomFromText(\'Polygon((0 0,0 3,3 3,3 0,0 0))\');\nmysql> SET @g2 = GeomFromText(\'Point(1 1)\');\nmysql> SELECT MBRContains(@g1,@g2), MBRContains(@g2,@g1);\n----------------------+----------------------+\n| MBRContains(@g1,@g2) | MBRContains(@g2,@g1) |\n+----------------------+----------------------+\n| 1 | 0 |\n+----------------------+----------------------+\n','http://dev.mysql.com/doc/refman/5.5/en/functions-for-testing-spatial-relations-between-geometric-objects.html#relations-on-geometry-mbr'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (355,31,'HOUR','Syntax:\nHOUR(time)\n\nReturns the hour for time. The range of the return value is 0 to 23 for\ntime-of-day values. However, the range of TIME values actually is much\nlarger, so HOUR can return values greater than 23.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html\n\n','mysql> SELECT HOUR(\'10:05:03\');\n -> 10\nmysql> SELECT HOUR(\'272:59:59\');\n -> 272\n','http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (356,27,'SELECT','Syntax:\nSELECT\n [ALL | DISTINCT | DISTINCTROW ]\n [HIGH_PRIORITY]\n [STRAIGHT_JOIN]\n [SQL_SMALL_RESULT] [SQL_BIG_RESULT] [SQL_BUFFER_RESULT]\n [SQL_CACHE | SQL_NO_CACHE] [SQL_CALC_FOUND_ROWS]\n select_expr [, select_expr ...]\n [FROM table_references\n [WHERE where_condition]\n [GROUP BY {col_name | expr | position}\n [ASC | DESC], ... [WITH ROLLUP]]\n [HAVING where_condition]\n [ORDER BY {col_name | expr | position}\n [ASC | DESC], ...]\n [LIMIT {[offset,] row_count | row_count OFFSET offset}]\n [PROCEDURE procedure_name(argument_list)]\n [INTO OUTFILE \'file_name\'\n [CHARACTER SET charset_name]\n export_options\n | INTO DUMPFILE \'file_name\'\n | INTO var_name [, var_name]]\n [FOR UPDATE | LOCK IN SHARE MODE]]\n\nSELECT is used to retrieve rows selected from one or more tables, and\ncan include UNION statements and subqueries. See [HELP UNION], and\nhttp://dev.mysql.com/doc/refman/5.5/en/subqueries.html.\n\nThe most commonly used clauses of SELECT statements are these:\n\no Each select_expr indicates a column that you want to retrieve. There\n must be at least one select_expr.\n\no table_references indicates the table or tables from which to retrieve\n rows. Its syntax is described in [HELP JOIN].\n\no The WHERE clause, if given, indicates the condition or conditions\n that rows must satisfy to be selected. where_condition is an\n expression that evaluates to true for each row to be selected. The\n statement selects all rows if there is no WHERE clause.\n\n In the WHERE expression, you can use any of the functions and\n operators that MySQL supports, except for aggregate (summary)\n functions. See\n http://dev.mysql.com/doc/refman/5.5/en/expressions.html, and\n http://dev.mysql.com/doc/refman/5.5/en/functions.html.\n\nSELECT can also be used to retrieve rows computed without reference to\nany table.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/select.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/select.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (357,4,'COT','Syntax:\nCOT(X)\n\nReturns the cotangent of X.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/mathematical-functions.html\n\n','mysql> SELECT COT(12);\n -> -1.5726734063977\nmysql> SELECT COT(0);\n -> NULL\n','http://dev.mysql.com/doc/refman/5.5/en/mathematical-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (358,26,'SHOW CREATE EVENT','Syntax:\nSHOW CREATE EVENT event_name\n\nThis statement displays the CREATE EVENT statement needed to re-create\na given event. It requires the EVENT privilege for the database from\nwhich the event is to be shown. For example (using the same event\ne_daily defined and then altered in [HELP SHOW EVENTS]):\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/show-create-event.html\n\n','mysql> SHOW CREATE EVENT test.e_daily\\G\n*************************** 1. row ***************************\n Event: e_daily\n sql_mode:\n time_zone: SYSTEM\n Create Event: CREATE EVENT `e_daily`\n ON SCHEDULE EVERY 1 DAY\n STARTS CURRENT_TIMESTAMP + INTERVAL 6 HOUR\n ON COMPLETION NOT PRESERVE\n ENABLE\n COMMENT \'Saves total number of sessions then\n clears the table each day\'\n DO BEGIN\n INSERT INTO site_activity.totals (time, total)\n SELECT CURRENT_TIMESTAMP, COUNT(*)\n FROM site_activity.sessions;\n DELETE FROM site_activity.sessions;\n END\ncharacter_set_client: latin1\ncollation_connection: latin1_swedish_ci\n Database Collation: latin1_swedish_ci\n','http://dev.mysql.com/doc/refman/5.5/en/show-create-event.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (359,37,'LOAD_FILE','Syntax:\nLOAD_FILE(file_name)\n\nReads the file and returns the file contents as a string. To use this\nfunction, the file must be located on the server host, you must specify\nthe full path name to the file, and you must have the FILE privilege.\nThe file must be readable by all and its size less than\nmax_allowed_packet bytes. If the secure_file_priv system variable is\nset to a nonempty directory name, the file to be loaded must be located\nin that directory.\n\nIf the file does not exist or cannot be read because one of the\npreceding conditions is not satisfied, the function returns NULL.\n\nThe character_set_filesystem system variable controls interpretation of\nfile names that are given as literal strings.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/string-functions.html\n\n','mysql> UPDATE t\n SET blob_col=LOAD_FILE(\'/tmp/picture\')\n WHERE id=1;\n','http://dev.mysql.com/doc/refman/5.5/en/string-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (360,3,'POINTFROMTEXT','PointFromText(wkt[,srid])\n\nConstructs a POINT value using its WKT representation and SRID.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/creating-spatial-values.html#gis-wkt-functions\n\n','','http://dev.mysql.com/doc/refman/5.5/en/creating-spatial-values.html#gis-wkt-functions'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (361,16,'GROUP_CONCAT','Syntax:\nGROUP_CONCAT(expr)\n\nThis function returns a string result with the concatenated non-NULL\nvalues from a group. It returns NULL if there are no non-NULL values.\nThe full syntax is as follows:\n\nGROUP_CONCAT([DISTINCT] expr [,expr ...]\n [ORDER BY {unsigned_integer | col_name | expr}\n [ASC | DESC] [,col_name ...]]\n [SEPARATOR str_val])\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/group-by-functions.html\n\n','mysql> SELECT student_name,\n -> GROUP_CONCAT(test_score)\n -> FROM student\n -> GROUP BY student_name;\n','http://dev.mysql.com/doc/refman/5.5/en/group-by-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (362,31,'DATE_FORMAT','Syntax:\nDATE_FORMAT(date,format)\n\nFormats the date value according to the format string.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html\n\n','mysql> SELECT DATE_FORMAT(\'2009-10-04 22:23:00\', \'%W %M %Y\');\n -> \'Sunday October 2009\'\nmysql> SELECT DATE_FORMAT(\'2007-10-04 22:23:00\', \'%H:%i:%s\');\n -> \'22:23:00\'\nmysql> SELECT DATE_FORMAT(\'1900-10-04 22:23:00\',\n -> \'%D %y %a %d %m %b %j\');\n -> \'4th 00 Thu 04 10 Oct 277\'\nmysql> SELECT DATE_FORMAT(\'1997-10-04 22:23:00\',\n -> \'%H %k %I %r %T %S %w\');\n -> \'22 22 10 10:23:00 PM 22:23:00 00 6\'\nmysql> SELECT DATE_FORMAT(\'1999-01-01\', \'%X %V\');\n -> \'1998 52\'\nmysql> SELECT DATE_FORMAT(\'2006-06-00\', \'%d\');\n -> \'00\'\n','http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (363,17,'BENCHMARK','Syntax:\nBENCHMARK(count,expr)\n\nThe BENCHMARK() function executes the expression expr repeatedly count\ntimes. It may be used to time how quickly MySQL processes the\nexpression. The result value is always 0. The intended use is from\nwithin the mysql client, which reports query execution times:\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/information-functions.html\n\n','mysql> SELECT BENCHMARK(1000000,ENCODE(\'hello\',\'goodbye\'));\n+----------------------------------------------+\n| BENCHMARK(1000000,ENCODE(\'hello\',\'goodbye\')) |\n+----------------------------------------------+\n| 0 |\n+----------------------------------------------+\n1 row in set (4.74 sec)\n','http://dev.mysql.com/doc/refman/5.5/en/information-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (364,31,'YEAR','Syntax:\nYEAR(date)\n\nReturns the year for date, in the range 1000 to 9999, or 0 for the\n"zero" date.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html\n\n','mysql> SELECT YEAR(\'1987-01-01\');\n -> 1987\n','http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (365,26,'SHOW ENGINE','Syntax:\nSHOW ENGINE engine_name {STATUS | MUTEX}\n\nSHOW ENGINE displays operational information about a storage engine.\nThe following statements currently are supported:\n\nSHOW ENGINE INNODB STATUS\nSHOW ENGINE INNODB MUTEX\nSHOW ENGINE {NDB | NDBCLUSTER} STATUS\nSHOW ENGINE PERFORMANCE_SCHEMA STATUS\n\nSHOW ENGINE INNODB STATUS displays extensive information from the\nstandard InnoDB Monitor about the state of the InnoDB storage engine.\nFor information about the standard monitor and other InnoDB Monitors\nthat provide information about InnoDB processing, see\nhttp://dev.mysql.com/doc/refman/5.5/en/innodb-monitors.html.\n\nSHOW ENGINE INNODB MUTEX displays InnoDB mutex statistics. The\nstatement displays the following fields:\n\no Type\n\n Always InnoDB.\n\no Name\n\n The source file where the mutex is implemented, and the line number\n in the file where the mutex is created. The line number may change\n depending on your version of MySQL.\n\no Status\n\n The mutex status. This field displays several values if UNIV_DEBUG\n was defined at MySQL compilation time (for example, in include/univ.i\n in the InnoDB part of the MySQL source tree). If UNIV_DEBUG was not\n defined, the statement displays only the os_waits value. In the\n latter case (without UNIV_DEBUG), the information on which the output\n is based is insufficient to distinguish regular mutexes and mutexes\n that protect rw-locks (which permit multiple readers or a single\n writer). Consequently, the output may appear to contain multiple rows\n for the same mutex.\n\n o count indicates how many times the mutex was requested.\n\n o spin_waits indicates how many times the spinlock had to run.\n\n o spin_rounds indicates the number of spinlock rounds. (spin_rounds\n divided by spin_waits provides the average round count.)\n\n o os_waits indicates the number of operating system waits. This\n occurs when the spinlock did not work (the mutex was not locked\n during the spinlock and it was necessary to yield to the operating\n system and wait).\n\n o os_yields indicates the number of times a the thread trying to lock\n a mutex gave up its timeslice and yielded to the operating system\n (on the presumption that permitting other threads to run will free\n the mutex so that it can be locked).\n\n o os_wait_times indicates the amount of time (in ms) spent in\n operating system waits, if the timed_mutexes system variable is 1\n (ON). If timed_mutexes is 0 (OFF), timing is disabled, so\n os_wait_times is 0. timed_mutexes is off by default.\n\nInformation from this statement can be used to diagnose system\nproblems. For example, large values of spin_waits and spin_rounds may\nindicate scalability problems.\n\nUse SHOW ENGINE PERFORMANCE_SCHEMA STATUS to inspect the internal\noperation of the Performance Schema code:\n\nmysql> SHOW ENGINE PERFORMANCE_SCHEMA STATUS\\G\n...\n*************************** 3. row ***************************\n Type: performance_schema\n Name: events_waits_history.row_size\nStatus: 76\n*************************** 4. row ***************************\n Type: performance_schema\n Name: events_waits_history.row_count\nStatus: 10000\n*************************** 5. row ***************************\n Type: performance_schema\n Name: events_waits_history.memory\nStatus: 760000\n...\n*************************** 57. row ***************************\n Type: performance_schema\n Name: performance_schema.memory\nStatus: 26459600\n...\n\nThe intent of this statement is to help the DBA to understand the\neffects that different options have on memory requirements.\n\nName values consist of two parts, which name an internal buffer and an\nattribute of the buffer, respectively:\n\no Internal buffers that are exposed as a table in the\n performance_schema database are named after the table. Examples:\n events_waits_history.row_size, mutex_instances.row_count.\n\no Internal buffers that are not exposed as a table are named within\n parentheses. Examples: (pfs_cond_class).row_size,\n (pfs_mutex_class).memory.\n\no Values that apply to the Performance Schema as a whole begin with\n performance_schema. Example: performance_schema.memory.\n\nAttributes have these meanings:\n\no row_size cannot be changed. It is the size of the internal record\n used by the implementation.\n\no row_count can be changed depending on the configuration options.\n\no For a table, tbl_name.memory is the product of row_size multiplied by\n row_count. For the Performance Schema as a whole,\n performance_schema.memory is the sum of all the memory used (the sum\n of all other memory values).\n\nIn some cases, there is a direct relationship between a configuration\nparameter and a SHOW ENGINE value. For example,\nevents_waits_history_long.row_count corresponds to\nperformance_schema_events_waits_history_long_size. In other cases, the\nrelationship is more complex. For example,\nevents_waits_history.row_count corresponds to\nperformance_schema_events_waits_history_size (the number of rows per\nthread) multiplied by performance_schema_max_thread_instances ( the\nnumber of threads).\n\nIf the server has the NDBCLUSTER storage engine enabled, SHOW ENGINE\nNDB STATUS displays cluster status information such as the number of\nconnected data nodes, the cluster connectstring, and cluster binlog\nepochs, as well as counts of various Cluster API objects created by the\nMySQL Server when connected to the cluster. Sample output from this\nstatement is shown here:\n\nmysql> SHOW ENGINE NDB STATUS;\n+------------+-----------------------+--------------------------------------------------+\n| Type | Name | Status |\n+------------+-----------------------+--------------------------------------------------+\n| ndbcluster | connection | cluster_node_id=7,\n connected_host=192.168.0.103, connected_port=1186, number_of_data_nodes=4,\n number_of_ready_data_nodes=3, connect_count=0 |\n| ndbcluster | NdbTransaction | created=6, free=0, sizeof=212 |\n| ndbcluster | NdbOperation | created=8, free=8, sizeof=660 |\n| ndbcluster | NdbIndexScanOperation | created=1, free=1, sizeof=744 |\n| ndbcluster | NdbIndexOperation | created=0, free=0, sizeof=664 |\n| ndbcluster | NdbRecAttr | created=1285, free=1285, sizeof=60 |\n| ndbcluster | NdbApiSignal | created=16, free=16, sizeof=136 |\n| ndbcluster | NdbLabel | created=0, free=0, sizeof=196 |\n| ndbcluster | NdbBranch | created=0, free=0, sizeof=24 |\n| ndbcluster | NdbSubroutine | created=0, free=0, sizeof=68 |\n| ndbcluster | NdbCall | created=0, free=0, sizeof=16 |\n| ndbcluster | NdbBlob | created=1, free=1, sizeof=264 |\n| ndbcluster | NdbReceiver | created=4, free=0, sizeof=68 |\n| ndbcluster | binlog | latest_epoch=155467, latest_trans_epoch=148126,\n latest_received_binlog_epoch=0, latest_handled_binlog_epoch=0,\n latest_applied_binlog_epoch=0 |\n+------------+-----------------------+--------------------------------------------------+\n\nThe rows with connection and binlog in the Name column were added to\nthe output of this statement in MySQL 5.1. The Status column in each of\nthese rows provides information about the MySQL server\'s connection to\nthe cluster and about the cluster binary log\'s status, respectively.\nThe Status information is in the form of comma-delimited set of\nname/value pairs.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/show-engine.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/show-engine.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (366,14,'NAME_CONST','Syntax:\nNAME_CONST(name,value)\n\nReturns the given value. When used to produce a result set column,\nNAME_CONST() causes the column to have the given name. The arguments\nshould be constants.\n\nmysql> SELECT NAME_CONST(\'myname\', 14);\n+--------+\n| myname |\n+--------+\n| 14 |\n+--------+\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/miscellaneous-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/miscellaneous-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (367,14,'RELEASE_LOCK','Syntax:\nRELEASE_LOCK(str)\n\nReleases the lock named by the string str that was obtained with\nGET_LOCK(). Returns 1 if the lock was released, 0 if the lock was not\nestablished by this thread (in which case the lock is not released),\nand NULL if the named lock did not exist. The lock does not exist if it\nwas never obtained by a call to GET_LOCK() or if it has previously been\nreleased.\n\nThe DO statement is convenient to use with RELEASE_LOCK(). See [HELP\nDO].\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/miscellaneous-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/miscellaneous-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (368,18,'IS NULL','Syntax:\nIS NULL\n\nTests whether a value is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/comparison-operators.html\n\n','mysql> SELECT 1 IS NULL, 0 IS NULL, NULL IS NULL;\n -> 0, 0, 1\n','http://dev.mysql.com/doc/refman/5.5/en/comparison-operators.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (369,31,'CONVERT_TZ','Syntax:\nCONVERT_TZ(dt,from_tz,to_tz)\n\nCONVERT_TZ() converts a datetime value dt from the time zone given by\nfrom_tz to the time zone given by to_tz and returns the resulting\nvalue. Time zones are specified as described in\nhttp://dev.mysql.com/doc/refman/5.5/en/time-zone-support.html. This\nfunction returns NULL if the arguments are invalid.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html\n\n','mysql> SELECT CONVERT_TZ(\'2004-01-01 12:00:00\',\'GMT\',\'MET\');\n -> \'2004-01-01 13:00:00\'\nmysql> SELECT CONVERT_TZ(\'2004-01-01 12:00:00\',\'+00:00\',\'+10:00\');\n -> \'2004-01-01 22:00:00\'\n','http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (370,31,'TIME_TO_SEC','Syntax:\nTIME_TO_SEC(time)\n\nReturns the time argument, converted to seconds.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html\n\n','mysql> SELECT TIME_TO_SEC(\'22:23:00\');\n -> 80580\nmysql> SELECT TIME_TO_SEC(\'00:39:38\');\n -> 2378\n','http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (371,31,'WEEKDAY','Syntax:\nWEEKDAY(date)\n\nReturns the weekday index for date (0 = Monday, 1 = Tuesday, ... 6 =\nSunday).\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html\n\n','mysql> SELECT WEEKDAY(\'2008-02-03 22:23:00\');\n -> 6\nmysql> SELECT WEEKDAY(\'2007-11-06\');\n -> 1\n','http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (372,37,'EXPORT_SET','Syntax:\nEXPORT_SET(bits,on,off[,separator[,number_of_bits]])\n\nReturns a string such that for every bit set in the value bits, you get\nan on string and for every bit not set in the value, you get an off\nstring. Bits in bits are examined from right to left (from low-order to\nhigh-order bits). Strings are added to the result from left to right,\nseparated by the separator string (the default being the comma\ncharacter ","). The number of bits examined is given by number_of_bits,\nwhich has a default of 64 if not specified. number_of_bits is silently\nclipped to 64 if larger than 64. It is treated as an unsigned integer,\nso a value of -1 is effectively the same as 64.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/string-functions.html\n\n','mysql> SELECT EXPORT_SET(5,\'Y\',\'N\',\',\',4);\n -> \'Y,N,Y,N\'\nmysql> SELECT EXPORT_SET(6,\'1\',\'0\',\',\',10);\n -> \'0,1,1,0,0,0,0,0,0,0\'\n','http://dev.mysql.com/doc/refman/5.5/en/string-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (373,39,'ALTER SERVER','Syntax:\nALTER SERVER server_name\n OPTIONS (option [, option] ...)\n\nAlters the server information for server_name, adjusting any of the\noptions permitted in the CREATE SERVER statement. See [HELP CREATE\nSERVER]. The corresponding fields in the mysql.servers table are\nupdated accordingly. This statement requires the SUPER privilege.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/alter-server.html\n\n','ALTER SERVER s OPTIONS (USER \'sally\');\n','http://dev.mysql.com/doc/refman/5.5/en/alter-server.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (374,23,'RESIGNAL','Syntax:\nRESIGNAL [condition_value]\n [SET signal_information_item\n [, signal_information_item] ...]\n\ncondition_value:\n SQLSTATE [VALUE] sqlstate_value\n | condition_name\n\nsignal_information_item:\n condition_information_item_name = simple_value_specification\n\ncondition_information_item_name:\n CLASS_ORIGIN\n | SUBCLASS_ORIGIN\n | MESSAGE_TEXT\n | MYSQL_ERRNO\n | CONSTRAINT_CATALOG\n | CONSTRAINT_SCHEMA\n | CONSTRAINT_NAME\n | CATALOG_NAME\n | SCHEMA_NAME\n | TABLE_NAME\n | COLUMN_NAME\n | CURSOR_NAME\n\ncondition_name, simple_value_specification:\n (see following discussion)\n\nRESIGNAL passes on the error condition information that is available\nduring execution of a condition handler within a compound statement\ninside a stored procedure or function, trigger, or event. RESIGNAL may\nchange some or all information before passing it on. RESIGNAL is\nrelated to SIGNAL, but instead of originating a condition as SIGNAL\ndoes, RESIGNAL relays existing condition information, possibly after\nmodifying it.\n\nRESIGNAL makes it possible to both handle an error and return the error\ninformation. Otherwise, by executing an SQL statement within the\nhandler, information that caused the handler\'s activation is destroyed.\nRESIGNAL also can make some procedures shorter if a given handler can\nhandle part of a situation, then pass the condition "up the line" to\nanother handler.\n\nNo special privileges are required to execute the RESIGNAL statement.\n\nFor condition_value and signal_information_item, the definitions and\nrules are the same for RESIGNAL as for SIGNAL (see [HELP SIGNAL]).\n\nThe RESIGNAL statement takes condition_value and SET clauses, both of\nwhich are optional. This leads to several possible uses:\n\no RESIGNAL alone:\n\nRESIGNAL;\n\no RESIGNAL with new signal information:\n\nRESIGNAL SET signal_information_item [, signal_information_item] ...;\n\no RESIGNAL with a condition value and possibly new signal information:\n\nRESIGNAL condition_value\n [SET signal_information_item [, signal_information_item] ...];\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/resignal.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/resignal.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (375,31,'TIME FUNCTION','Syntax:\nTIME(expr)\n\nExtracts the time part of the time or datetime expression expr and\nreturns it as a string.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html\n\n','mysql> SELECT TIME(\'2003-12-31 01:02:03\');\n -> \'01:02:03\'\nmysql> SELECT TIME(\'2003-12-31 01:02:03.000123\');\n -> \'01:02:03.000123\'\n','http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (376,31,'DATE_ADD','Syntax:\nDATE_ADD(date,INTERVAL expr unit), DATE_SUB(date,INTERVAL expr unit)\n\nThese functions perform date arithmetic. The date argument specifies\nthe starting date or datetime value. expr is an expression specifying\nthe interval value to be added or subtracted from the starting date.\nexpr is a string; it may start with a "-" for negative intervals. unit\nis a keyword indicating the units in which the expression should be\ninterpreted.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html\n\n','mysql> SELECT \'2008-12-31 23:59:59\' + INTERVAL 1 SECOND;\n -> \'2009-01-01 00:00:00\'\nmysql> SELECT INTERVAL 1 DAY + \'2008-12-31\';\n -> \'2009-01-01\'\nmysql> SELECT \'2005-01-01\' - INTERVAL 1 SECOND;\n -> \'2004-12-31 23:59:59\'\nmysql> SELECT DATE_ADD(\'2000-12-31 23:59:59\',\n -> INTERVAL 1 SECOND);\n -> \'2001-01-01 00:00:00\'\nmysql> SELECT DATE_ADD(\'2010-12-31 23:59:59\',\n -> INTERVAL 1 DAY);\n -> \'2011-01-01 23:59:59\'\nmysql> SELECT DATE_ADD(\'2100-12-31 23:59:59\',\n -> INTERVAL \'1:1\' MINUTE_SECOND);\n -> \'2101-01-01 00:01:00\'\nmysql> SELECT DATE_SUB(\'2005-01-01 00:00:00\',\n -> INTERVAL \'1 1:1:1\' DAY_SECOND);\n -> \'2004-12-30 22:58:59\'\nmysql> SELECT DATE_ADD(\'1900-01-01 00:00:00\',\n -> INTERVAL \'-1 10\' DAY_HOUR);\n -> \'1899-12-30 14:00:00\'\nmysql> SELECT DATE_SUB(\'1998-01-02\', INTERVAL 31 DAY);\n -> \'1997-12-02\'\nmysql> SELECT DATE_ADD(\'1992-12-31 23:59:59.000002\',\n -> INTERVAL \'1.999999\' SECOND_MICROSECOND);\n -> \'1993-01-01 00:00:01.000001\'\n','http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (377,37,'CAST','Syntax:\nCAST(expr AS type)\n\nThe CAST() function takes an expression of any type and produces a\nresult value of a specified type, similar to CONVERT(). See the\ndescription of CONVERT() for more information.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/cast-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/cast-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (378,37,'SOUNDS LIKE','Syntax:\nexpr1 SOUNDS LIKE expr2\n\nThis is the same as SOUNDEX(expr1) = SOUNDEX(expr2).\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/string-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/string-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (379,31,'PERIOD_DIFF','Syntax:\nPERIOD_DIFF(P1,P2)\n\nReturns the number of months between periods P1 and P2. P1 and P2\nshould be in the format YYMM or YYYYMM. Note that the period arguments\nP1 and P2 are not date values.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html\n\n','mysql> SELECT PERIOD_DIFF(200802,200703);\n -> 11\n','http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (380,37,'LIKE','Syntax:\nexpr LIKE pat [ESCAPE \'escape_char\']\n\nPattern matching using SQL simple regular expression comparison.\nReturns 1 (TRUE) or 0 (FALSE). If either expr or pat is NULL, the\nresult is NULL.\n\nThe pattern need not be a literal string. For example, it can be\nspecified as a string expression or table column.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/string-comparison-functions.html\n\n','mysql> SELECT \'David!\' LIKE \'David_\';\n -> 1\nmysql> SELECT \'David!\' LIKE \'%D%v%\';\n -> 1\n','http://dev.mysql.com/doc/refman/5.5/en/string-comparison-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (381,24,'MULTIPOINT','MultiPoint(pt1,pt2,...)\n\nConstructs a MultiPoint value using Point or WKB Point arguments.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/creating-spatial-values.html#gis-mysql-specific-functions\n\n','','http://dev.mysql.com/doc/refman/5.5/en/creating-spatial-values.html#gis-mysql-specific-functions'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (382,19,'>>','Syntax:\n>>\n\nShifts a longlong (BIGINT) number to the right.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/bit-functions.html\n\n','mysql> SELECT 4 >> 2;\n -> 1\n','http://dev.mysql.com/doc/refman/5.5/en/bit-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (383,23,'FETCH','Syntax:\nFETCH [[NEXT] FROM] cursor_name INTO var_name [, var_name] ...\n\nThis statement fetches the next row for the SELECT statement associated\nwith the specified cursor (which must be open), and advances the cursor\npointer. If a row exists, the fetched columns are stored in the named\nvariables. The number of columns retrieved by the SELECT statement must\nmatch the number of output variables specified in the FETCH statement.\n\nIf no more rows are available, a No Data condition occurs with SQLSTATE\nvalue \'02000\'. To detect this condition, you can set up a handler for\nit (or for a NOT FOUND condition). For an example, see\nhttp://dev.mysql.com/doc/refman/5.5/en/cursors.html.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/fetch.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/fetch.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (384,16,'AVG','Syntax:\nAVG([DISTINCT] expr)\n\nReturns the average value of expr. The DISTINCT option can be used to\nreturn the average of the distinct values of expr.\n\nAVG() returns NULL if there were no matching rows.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/group-by-functions.html\n\n','mysql> SELECT student_name, AVG(test_score)\n -> FROM student\n -> GROUP BY student_name;\n','http://dev.mysql.com/doc/refman/5.5/en/group-by-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (385,29,'TRUE FALSE','The constants TRUE and FALSE evaluate to 1 and 0, respectively. The\nconstant names can be written in any lettercase.\n\nmysql> SELECT TRUE, true, FALSE, false;\n -> 1, 1, 0, 0\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/boolean-literals.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/boolean-literals.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (386,6,'MBRWITHIN','MBRWithin(g1,g2)\n\nReturns 1 or 0 to indicate whether the Minimum Bounding Rectangle of g1\nis within the Minimum Bounding Rectangle of g2. This tests the opposite\nrelationship as MBRContains().\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/functions-for-testing-spatial-relations-between-geometric-objects.html#relations-on-geometry-mbr\n\n','mysql> SET @g1 = GeomFromText(\'Polygon((0 0,0 3,3 3,3 0,0 0))\');\nmysql> SET @g2 = GeomFromText(\'Polygon((0 0,0 5,5 5,5 0,0 0))\');\nmysql> SELECT MBRWithin(@g1,@g2), MBRWithin(@g2,@g1);\n+--------------------+--------------------+\n| MBRWithin(@g1,@g2) | MBRWithin(@g2,@g1) |\n+--------------------+--------------------+\n| 1 | 0 |\n+--------------------+--------------------+\n','http://dev.mysql.com/doc/refman/5.5/en/functions-for-testing-spatial-relations-between-geometric-objects.html#relations-on-geometry-mbr'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (387,17,'SESSION_USER','Syntax:\nSESSION_USER()\n\nSESSION_USER() is a synonym for USER().\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/information-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/information-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (388,18,'IN','Syntax:\nexpr IN (value,...)\n\nReturns 1 if expr is equal to any of the values in the IN list, else\nreturns 0. If all values are constants, they are evaluated according to\nthe type of expr and sorted. The search for the item then is done using\na binary search. This means IN is very quick if the IN value list\nconsists entirely of constants. Otherwise, type conversion takes place\naccording to the rules described in\nhttp://dev.mysql.com/doc/refman/5.5/en/type-conversion.html, but\napplied to all the arguments.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/comparison-operators.html\n\n','mysql> SELECT 2 IN (0,3,5,7);\n -> 0\nmysql> SELECT \'wefwf\' IN (\'wee\',\'wefwf\',\'weg\');\n -> 1\n','http://dev.mysql.com/doc/refman/5.5/en/comparison-operators.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (389,37,'QUOTE','Syntax:\nQUOTE(str)\n\nQuotes a string to produce a result that can be used as a properly\nescaped data value in an SQL statement. The string is returned enclosed\nby single quotation marks and with each instance of backslash ("\\"),\nsingle quote ("\'"), ASCII NUL, and Control+Z preceded by a backslash.\nIf the argument is NULL, the return value is the word "NULL" without\nenclosing single quotation marks.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/string-functions.html\n\n','mysql> SELECT QUOTE(\'Don\\\'t!\');\n -> \'Don\\\'t!\'\nmysql> SELECT QUOTE(NULL);\n -> NULL\n','http://dev.mysql.com/doc/refman/5.5/en/string-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (390,26,'HELP COMMAND','Syntax:\nmysql> help search_string\n\nIf you provide an argument to the help command, mysql uses it as a\nsearch string to access server-side help from the contents of the MySQL\nReference Manual. The proper operation of this command requires that\nthe help tables in the mysql database be initialized with help topic\ninformation (see\nhttp://dev.mysql.com/doc/refman/5.5/en/server-side-help-support.html).\n\nIf there is no match for the search string, the search fails:\n\nmysql> help me\n\nNothing found\nPlease try to run \'help contents\' for a list of all accessible topics\n\nUse help contents to see a list of the help categories:\n\nmysql> help contents\nYou asked for help about help category: "Contents"\nFor more information, type \'help <item>\', where <item> is one of the\nfollowing categories:\n Account Management\n Administration\n Data Definition\n Data Manipulation\n Data Types\n Functions\n Functions and Modifiers for Use with GROUP BY\n Geographic Features\n Language Structure\n Plugins\n Storage Engines\n Stored Routines\n Table Maintenance\n Transactions\n Triggers\n\nIf the search string matches multiple items, mysql shows a list of\nmatching topics:\n\nmysql> help logs\nMany help items for your request exist.\nTo make a more specific request, please type \'help <item>\',\nwhere <item> is one of the following topics:\n SHOW\n SHOW BINARY LOGS\n SHOW ENGINE\n SHOW LOGS\n\nUse a topic as the search string to see the help entry for that topic:\n\nmysql> help show binary logs\nName: \'SHOW BINARY LOGS\'\nDescription:\nSyntax:\nSHOW BINARY LOGS\nSHOW MASTER LOGS\n\nLists the binary log files on the server. This statement is used as\npart of the procedure described in [purge-binary-logs], that shows how\nto determine which logs can be purged.\n\nmysql> SHOW BINARY LOGS;\n+---------------+-----------+\n| Log_name | File_size |\n+---------------+-----------+\n| binlog.000015 | 724935 |\n| binlog.000016 | 733481 |\n+---------------+-----------+\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/mysql-server-side-help.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/mysql-server-side-help.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (391,31,'QUARTER','Syntax:\nQUARTER(date)\n\nReturns the quarter of the year for date, in the range 1 to 4.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html\n\n','mysql> SELECT QUARTER(\'2008-04-01\');\n -> 2\n','http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (392,37,'POSITION','Syntax:\nPOSITION(substr IN str)\n\nPOSITION(substr IN str) is a synonym for LOCATE(substr,str).\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/string-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/string-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (393,26,'SHOW CREATE FUNCTION','Syntax:\nSHOW CREATE FUNCTION func_name\n\nThis statement is similar to SHOW CREATE PROCEDURE but for stored\nfunctions. See [HELP SHOW CREATE PROCEDURE].\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/show-create-function.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/show-create-function.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (394,14,'IS_USED_LOCK','Syntax:\nIS_USED_LOCK(str)\n\nChecks whether the lock named str is in use (that is, locked). If so,\nit returns the connection identifier of the client that holds the lock.\nOtherwise, it returns NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/miscellaneous-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/miscellaneous-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (395,3,'POLYFROMTEXT','PolyFromText(wkt[,srid]), PolygonFromText(wkt[,srid])\n\nConstructs a POLYGON value using its WKT representation and SRID.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/creating-spatial-values.html#gis-wkt-functions\n\n','','http://dev.mysql.com/doc/refman/5.5/en/creating-spatial-values.html#gis-wkt-functions'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (396,12,'DES_ENCRYPT','Syntax:\nDES_ENCRYPT(str[,{key_num|key_str}])\n\nEncrypts the string with the given key using the Triple-DES algorithm.\n\nThis function works only if MySQL has been configured with SSL support.\nSee http://dev.mysql.com/doc/refman/5.5/en/ssl-connections.html.\n\nThe encryption key to use is chosen based on the second argument to\nDES_ENCRYPT(), if one was given. With no argument, the first key from\nthe DES key file is used. With a key_num argument, the given key number\n(0 to 9) from the DES key file is used. With a key_str argument, the\ngiven key string is used to encrypt str.\n\nThe key file can be specified with the --des-key-file server option.\n\nThe return string is a binary string where the first character is\nCHAR(128 | key_num). If an error occurs, DES_ENCRYPT() returns NULL.\n\nThe 128 is added to make it easier to recognize an encrypted key. If\nyou use a string key, key_num is 127.\n\nThe string length for the result is given by this formula:\n\nnew_len = orig_len + (8 - (orig_len % 8)) + 1\n\nEach line in the DES key file has the following format:\n\nkey_num des_key_str\n\nEach key_num value must be a number in the range from 0 to 9. Lines in\nthe file may be in any order. des_key_str is the string that is used to\nencrypt the message. There should be at least one space between the\nnumber and the key. The first key is the default key that is used if\nyou do not specify any key argument to DES_ENCRYPT().\n\nYou can tell MySQL to read new key values from the key file with the\nFLUSH DES_KEY_FILE statement. This requires the RELOAD privilege.\n\nOne benefit of having a set of default keys is that it gives\napplications a way to check for the existence of encrypted column\nvalues, without giving the end user the right to decrypt those values.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/encryption-functions.html\n\n','mysql> SELECT customer_address FROM customer_table \n > WHERE crypted_credit_card = DES_ENCRYPT(\'credit_card_number\');\n','http://dev.mysql.com/doc/refman/5.5/en/encryption-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (397,4,'CEIL','Syntax:\nCEIL(X)\n\nCEIL() is a synonym for CEILING().\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/mathematical-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/mathematical-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (398,37,'LENGTH','Syntax:\nLENGTH(str)\n\nReturns the length of the string str, measured in bytes. A multi-byte\ncharacter counts as multiple bytes. This means that for a string\ncontaining five 2-byte characters, LENGTH() returns 10, whereas\nCHAR_LENGTH() returns 5.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/string-functions.html\n\n','mysql> SELECT LENGTH(\'text\');\n -> 4\n','http://dev.mysql.com/doc/refman/5.5/en/string-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (399,31,'STR_TO_DATE','Syntax:\nSTR_TO_DATE(str,format)\n\nThis is the inverse of the DATE_FORMAT() function. It takes a string\nstr and a format string format. STR_TO_DATE() returns a DATETIME value\nif the format string contains both date and time parts, or a DATE or\nTIME value if the string contains only date or time parts. If the date,\ntime, or datetime value extracted from str is illegal, STR_TO_DATE()\nreturns NULL and produces a warning.\n\nThe server scans str attempting to match format to it. The format\nstring can contain literal characters and format specifiers beginning\nwith %. Literal characters in format must match literally in str.\nFormat specifiers in format must match a date or time part in str. For\nthe specifiers that can be used in format, see the DATE_FORMAT()\nfunction description.\n\nmysql> SELECT STR_TO_DATE(\'01,5,2013\',\'%d,%m,%Y\');\n -> \'2013-05-01\'\nmysql> SELECT STR_TO_DATE(\'May 1, 2013\',\'%M %d,%Y\');\n -> \'2013-05-01\'\n\nScanning starts at the beginning of str and fails if format is found\nnot to match. Extra characters at the end of str are ignored.\n\nmysql> SELECT STR_TO_DATE(\'a09:30:17\',\'a%h:%i:%s\');\n -> \'09:30:17\'\nmysql> SELECT STR_TO_DATE(\'a09:30:17\',\'%h:%i:%s\');\n -> NULL\nmysql> SELECT STR_TO_DATE(\'09:30:17a\',\'%h:%i:%s\');\n -> \'09:30:17\'\n\nUnspecified date or time parts have a value of 0, so incompletely\nspecified values in str produce a result with some or all parts set to\n0:\n\nmysql> SELECT STR_TO_DATE(\'abc\',\'abc\');\n -> \'0000-00-00\'\nmysql> SELECT STR_TO_DATE(\'9\',\'%m\');\n -> \'0000-09-00\'\nmysql> SELECT STR_TO_DATE(\'9\',\'%s\');\n -> \'00:00:09\'\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (400,11,'Y','Y(p)\n\nReturns the Y-coordinate value for the Point object p as a\ndouble-precision number.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/geometry-property-functions.html#point-property-functions\n\n','mysql> SELECT Y(POINT(56.7, 53.34));\n+-----------------------+\n| Y(POINT(56.7, 53.34)) |\n+-----------------------+\n| 53.34 |\n+-----------------------+\n','http://dev.mysql.com/doc/refman/5.5/en/geometry-property-functions.html#point-property-functions'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (401,20,'CHECKSUM TABLE','Syntax:\nCHECKSUM TABLE tbl_name [, tbl_name] ... [ QUICK | EXTENDED ]\n\nCHECKSUM TABLE reports a table checksum. This statement requires the\nSELECT privilege for the table.\n\nWith QUICK, the live table checksum is reported if it is available, or\nNULL otherwise. This is very fast. A live checksum is enabled by\nspecifying the CHECKSUM=1 table option when you create the table;\ncurrently, this is supported only for MyISAM tables. See [HELP CREATE\nTABLE].\n\nWith EXTENDED, the entire table is read row by row and the checksum is\ncalculated. This can be very slow for large tables.\n\nIf neither QUICK nor EXTENDED is specified, MySQL returns a live\nchecksum if the table storage engine supports it and scans the table\notherwise.\n\nFor a nonexistent table, CHECKSUM TABLE returns NULL and generates a\nwarning.\n\nIn MySQL 5.5, CHECKSUM TABLE returns 0 for partitioned tables unless\nyou include the EXTENDED option. This issue is resolved in MySQL 5.6.\n(Bug #11933226, Bug #60681)\n\nThe checksum value depends on the table row format. If the row format\nchanges, the checksum also changes. For example, the storage format for\nVARCHAR changed between MySQL 4.1 and 5.0, so if a 4.1 table is\nupgraded to MySQL 5.0, the checksum value may change.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/checksum-table.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/checksum-table.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (402,2,'NUMINTERIORRINGS','NumInteriorRings(poly)\n\nReturns the number of interior rings in the Polygon value poly.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/geometry-property-functions.html#polygon-property-functions\n\n','mysql> SET @poly =\n -> \'Polygon((0 0,0 3,3 3,3 0,0 0),(1 1,1 2,2 2,2 1,1 1))\';\nmysql> SELECT NumInteriorRings(GeomFromText(@poly));\n+---------------------------------------+\n| NumInteriorRings(GeomFromText(@poly)) |\n+---------------------------------------+\n| 1 |\n+---------------------------------------+\n','http://dev.mysql.com/doc/refman/5.5/en/geometry-property-functions.html#polygon-property-functions'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (403,2,'INTERIORRINGN','InteriorRingN(poly,N)\n\nReturns the N-th interior ring for the Polygon value poly as a\nLineString. Rings are numbered beginning with 1.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/geometry-property-functions.html#polygon-property-functions\n\n','mysql> SET @poly =\n -> \'Polygon((0 0,0 3,3 3,3 0,0 0),(1 1,1 2,2 2,2 1,1 1))\';\nmysql> SELECT AsText(InteriorRingN(GeomFromText(@poly),1));\n+----------------------------------------------+\n| AsText(InteriorRingN(GeomFromText(@poly),1)) |\n+----------------------------------------------+\n| LINESTRING(1 1,1 2,2 2,2 1,1 1) |\n+----------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.5/en/geometry-property-functions.html#polygon-property-functions'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (404,31,'UTC_TIME','Syntax:\nUTC_TIME, UTC_TIME()\n\nReturns the current UTC time as a value in \'HH:MM:SS\' or HHMMSS.uuuuuu\nformat, depending on whether the function is used in a string or\nnumeric context.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html\n\n','mysql> SELECT UTC_TIME(), UTC_TIME() + 0;\n -> \'18:07:53\', 180753.000000\n','http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (405,39,'DROP FUNCTION','The DROP FUNCTION statement is used to drop stored functions and\nuser-defined functions (UDFs):\n\no For information about dropping stored functions, see [HELP DROP\n PROCEDURE].\n\no For information about dropping user-defined functions, see [HELP DROP\n FUNCTION UDF].\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/drop-function.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/drop-function.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (406,39,'ALTER EVENT','Syntax:\nALTER\n [DEFINER = { user | CURRENT_USER }]\n EVENT event_name\n [ON SCHEDULE schedule]\n [ON COMPLETION [NOT] PRESERVE]\n [RENAME TO new_event_name]\n [ENABLE | DISABLE | DISABLE ON SLAVE]\n [COMMENT \'comment\']\n [DO event_body]\n\nThe ALTER EVENT statement changes one or more of the characteristics of\nan existing event without the need to drop and recreate it. The syntax\nfor each of the DEFINER, ON SCHEDULE, ON COMPLETION, COMMENT, ENABLE /\nDISABLE, and DO clauses is exactly the same as when used with CREATE\nEVENT. (See [HELP CREATE EVENT].)\n\nAny user can alter an event defined on a database for which that user\nhas the EVENT privilege. When a user executes a successful ALTER EVENT\nstatement, that user becomes the definer for the affected event.\n\nALTER EVENT works only with an existing event:\n\nmysql> ALTER EVENT no_such_event \n > ON SCHEDULE \n > EVERY \'2:3\' DAY_HOUR;\nERROR 1517 (HY000): Unknown event \'no_such_event\'\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/alter-event.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/alter-event.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (407,16,'STDDEV','Syntax:\nSTDDEV(expr)\n\nReturns the population standard deviation of expr. This function is\nprovided for compatibility with Oracle. The standard SQL function\nSTDDEV_POP() can be used instead.\n\nThis function returns NULL if there were no matching rows.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/group-by-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/group-by-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (408,31,'DATE_SUB','Syntax:\nDATE_SUB(date,INTERVAL expr unit)\n\nSee the description for DATE_ADD().\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (409,31,'PERIOD_ADD','Syntax:\nPERIOD_ADD(P,N)\n\nAdds N months to period P (in the format YYMM or YYYYMM). Returns a\nvalue in the format YYYYMM. Note that the period argument P is not a\ndate value.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html\n\n','mysql> SELECT PERIOD_ADD(200801,2);\n -> 200803\n','http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (410,19,'|','Syntax:\n|\n\nBitwise OR:\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/bit-functions.html\n\n','mysql> SELECT 29 | 15;\n -> 31\n','http://dev.mysql.com/doc/refman/5.5/en/bit-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (411,3,'GEOMFROMTEXT','GeomFromText(wkt[,srid]), GeometryFromText(wkt[,srid])\n\nConstructs a geometry value of any type using its WKT representation\nand SRID.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/creating-spatial-values.html#gis-wkt-functions\n\n','','http://dev.mysql.com/doc/refman/5.5/en/creating-spatial-values.html#gis-wkt-functions'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (412,14,'UUID_SHORT','Syntax:\nUUID_SHORT()\n\nReturns a "short" universal identifier as a 64-bit unsigned integer\n(rather than a string-form 128-bit identifier as returned by the UUID()\nfunction).\n\nThe value of UUID_SHORT() is guaranteed to be unique if the following\nconditions hold:\n\no The server_id of the current host is unique among your set of master\n and slave servers\n\no server_id is between 0 and 255\n\no You do not set back your system time for your server between mysqld\n restarts\n\no You do not invoke UUID_SHORT() on average more than 16 million times\n per second between mysqld restarts\n\nThe UUID_SHORT() return value is constructed this way:\n\n (server_id & 255) << 56\n+ (server_startup_time_in_seconds << 24)\n+ incremented_variable++;\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/miscellaneous-functions.html\n\n','mysql> SELECT UUID_SHORT();\n -> 92395783831158784\n','http://dev.mysql.com/doc/refman/5.5/en/miscellaneous-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (413,37,'RIGHT','Syntax:\nRIGHT(str,len)\n\nReturns the rightmost len characters from the string str, or NULL if\nany argument is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/string-functions.html\n\n','mysql> SELECT RIGHT(\'foobarbar\', 4);\n -> \'rbar\'\n','http://dev.mysql.com/doc/refman/5.5/en/string-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (414,31,'DATEDIFF','Syntax:\nDATEDIFF(expr1,expr2)\n\nDATEDIFF() returns expr1 - expr2 expressed as a value in days from one\ndate to the other. expr1 and expr2 are date or date-and-time\nexpressions. Only the date parts of the values are used in the\ncalculation.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html\n\n','mysql> SELECT DATEDIFF(\'2007-12-31 23:59:59\',\'2007-12-30\');\n -> 1\nmysql> SELECT DATEDIFF(\'2010-11-30 23:59:59\',\'2010-12-31\');\n -> -31\n','http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (415,39,'DROP TABLESPACE','Syntax:\nDROP TABLESPACE tablespace_name\n ENGINE [=] engine_name\n\nThis statement drops a tablespace that was previously created using\nCREATE TABLESPACE (see [HELP CREATE TABLESPACE]).\n\n*Important*: The tablespace to be dropped must not contain any data\nfiles; in other words, before you can drop a tablespace, you must first\ndrop each of its data files using ALTER TABLESPACE ... DROP DATAFILE\n(see [HELP ALTER TABLESPACE]).\n\nThe ENGINE clause (required) specifies the storage engine used by the\ntablespace. Currently, the only accepted values for engine_name are NDB\nand NDBCLUSTER.\n\nDROP TABLESPACE is useful only with Disk Data storage for MySQL\nCluster. See\nhttp://dev.mysql.com/doc/refman/5.5/en/mysql-cluster-disk-data.html.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/drop-tablespace.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/drop-tablespace.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (416,39,'DROP PROCEDURE','Syntax:\nDROP {PROCEDURE | FUNCTION} [IF EXISTS] sp_name\n\nThis statement is used to drop a stored procedure or function. That is,\nthe specified routine is removed from the server. You must have the\nALTER ROUTINE privilege for the routine. (If the\nautomatic_sp_privileges system variable is enabled, that privilege and\nEXECUTE are granted automatically to the routine creator when the\nroutine is created and dropped from the creator when the routine is\ndropped. See\nhttp://dev.mysql.com/doc/refman/5.5/en/stored-routines-privileges.html.\n)\n\nThe IF EXISTS clause is a MySQL extension. It prevents an error from\noccurring if the procedure or function does not exist. A warning is\nproduced that can be viewed with SHOW WARNINGS.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/drop-procedure.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/drop-procedure.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (417,20,'CHECK TABLE','Syntax:\nCHECK TABLE tbl_name [, tbl_name] ... [option] ...\n\noption = {FOR UPGRADE | QUICK | FAST | MEDIUM | EXTENDED | CHANGED}\n\nCHECK TABLE checks a table or tables for errors. CHECK TABLE works for\nInnoDB, MyISAM, ARCHIVE, and CSV tables. For MyISAM tables, the key\nstatistics are updated as well.\n\nTo check a table, you must have some privilege for it.\n\nCHECK TABLE can also check views for problems, such as tables that are\nreferenced in the view definition that no longer exist.\n\nCHECK TABLE is supported for partitioned tables, and you can use ALTER\nTABLE ... CHECK PARTITION to check one or more partitions; for more\ninformation, see [HELP ALTER TABLE], and\nhttp://dev.mysql.com/doc/refman/5.5/en/partitioning-maintenance.html.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/check-table.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/check-table.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (418,37,'BIN','Syntax:\nBIN(N)\n\nReturns a string representation of the binary value of N, where N is a\nlonglong (BIGINT) number. This is equivalent to CONV(N,10,2). Returns\nNULL if N is NULL.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/string-functions.html\n\n','mysql> SELECT BIN(12);\n -> \'1100\'\n','http://dev.mysql.com/doc/refman/5.5/en/string-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (419,5,'INSTALL PLUGIN','Syntax:\nINSTALL PLUGIN plugin_name SONAME \'shared_library_name\'\n\nThis statement installs a server plugin. It requires the INSERT\nprivilege for the mysql.plugin table.\n\nplugin_name is the name of the plugin as defined in the plugin\ndescriptor structure contained in the library file (see\nhttp://dev.mysql.com/doc/refman/5.5/en/plugin-data-structures.html).\nPlugin names are not case sensitive. For maximal compatibility, plugin\nnames should be limited to ASCII letters, digits, and underscore\nbecause they are used in C source files, shell command lines, M4 and\nBourne shell scripts, and SQL environments.\n\nshared_library_name is the name of the shared library that contains the\nplugin code. The name includes the file name extension (for example,\nlibmyplugin.so, libmyplugin.dll, or libmyplugin.dylib).\n\nThe shared library must be located in the plugin directory (the\ndirectory named by the plugin_dir system variable). The library must be\nin the plugin directory itself, not in a subdirectory. By default,\nplugin_dir is the plugin directory under the directory named by the\npkglibdir configuration variable, but it can be changed by setting the\nvalue of plugin_dir at server startup. For example, set its value in a\nmy.cnf file:\n\n[mysqld]\nplugin_dir=/path/to/plugin/directory\n\nIf the value of plugin_dir is a relative path name, it is taken to be\nrelative to the MySQL base directory (the value of the basedir system\nvariable).\n\nINSTALL PLUGIN loads and initializes the plugin code to make the plugin\navailable for use. A plugin is initialized by executing its\ninitialization function, which handles any setup that the plugin must\nperform before it can be used. When the server shuts down, it executes\nthe deinitialization function for each plugin that is loaded so that\nthe plugin has a change to perform any final cleanup.\n\nINSTALL PLUGIN also registers the plugin by adding a line that\nindicates the plugin name and library file name to the mysql.plugin\ntable. At server startup, the server loads and initializes any plugin\nthat is listed in the mysql.plugin table. This means that a plugin is\ninstalled with INSTALL PLUGIN only once, not every time the server\nstarts. Plugin loading at startup does not occur if the server is\nstarted with the --skip-grant-tables option.\n\nA plugin library can contain multiple plugins. For each of them to be\ninstalled, use a separate INSTALL PLUGIN statement. Each statement\nnames a different plugin, but all of them specify the same library\nname.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/install-plugin.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/install-plugin.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (420,23,'DECLARE CURSOR','Syntax:\nDECLARE cursor_name CURSOR FOR select_statement\n\nThis statement declares a cursor and associates it with a SELECT\nstatement that retrieves the rows to be traversed by the cursor. To\nfetch the rows later, use a FETCH statement. The number of columns\nretrieved by the SELECT statement must match the number of output\nvariables specified in the FETCH statement.\n\nThe SELECT statement cannot have an INTO clause.\n\nCursor declarations must appear before handler declarations and after\nvariable and condition declarations.\n\nA stored program may contain multiple cursor declarations, but each\ncursor declared in a given block must have a unique name. For an\nexample, see http://dev.mysql.com/doc/refman/5.5/en/cursors.html.\n\nFor information available through SHOW statements, it is possible in\nmany cases to obtain equivalent information by using a cursor with an\nINFORMATION_SCHEMA table.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/declare-cursor.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/declare-cursor.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (421,27,'LOAD DATA','Syntax:\nLOAD DATA [LOW_PRIORITY | CONCURRENT] [LOCAL] INFILE \'file_name\'\n [REPLACE | IGNORE]\n INTO TABLE tbl_name\n [CHARACTER SET charset_name]\n [{FIELDS | COLUMNS}\n [TERMINATED BY \'string\']\n [[OPTIONALLY] ENCLOSED BY \'char\']\n [ESCAPED BY \'char\']\n ]\n [LINES\n [STARTING BY \'string\']\n [TERMINATED BY \'string\']\n ]\n [IGNORE number {LINES | ROWS}]\n [(col_name_or_user_var,...)]\n [SET col_name = expr,...]\n\nThe LOAD DATA INFILE statement reads rows from a text file into a table\nat a very high speed. The file name must be given as a literal string.\n\nLOAD DATA INFILE is the complement of SELECT ... INTO OUTFILE. (See\nhttp://dev.mysql.com/doc/refman/5.5/en/select-into.html.) To write data\nfrom a table to a file, use SELECT ... INTO OUTFILE. To read the file\nback into a table, use LOAD DATA INFILE. The syntax of the FIELDS and\nLINES clauses is the same for both statements. Both clauses are\noptional, but FIELDS must precede LINES if both are specified.\n\nFor more information about the efficiency of INSERT versus LOAD DATA\nINFILE and speeding up LOAD DATA INFILE, see\nhttp://dev.mysql.com/doc/refman/5.5/en/insert-speed.html.\n\nThe character set indicated by the character_set_database system\nvariable is used to interpret the information in the file. SET NAMES\nand the setting of character_set_client do not affect interpretation of\ninput. If the contents of the input file use a character set that\ndiffers from the default, it is usually preferable to specify the\ncharacter set of the file by using the CHARACTER SET clause. A\ncharacter set of binary specifies "no conversion."\n\nLOAD DATA INFILE interprets all fields in the file as having the same\ncharacter set, regardless of the data types of the columns into which\nfield values are loaded. For proper interpretation of file contents,\nyou must ensure that it was written with the correct character set. For\nexample, if you write a data file with mysqldump -T or by issuing a\nSELECT ... INTO OUTFILE statement in mysql, be sure to use a\n--default-character-set option with mysqldump or mysql so that output\nis written in the character set to be used when the file is loaded with\nLOAD DATA INFILE.\n\n*Note*: It is not possible to load data files that use the ucs2, utf16,\nor utf32 character set.\n\nThe character_set_filesystem system variable controls the\ninterpretation of the file name.\n\nYou can also load data files by using the mysqlimport utility; it\noperates by sending a LOAD DATA INFILE statement to the server. The\n--local option causes mysqlimport to read data files from the client\nhost. You can specify the --compress option to get better performance\nover slow networks if the client and server support the compressed\nprotocol. See http://dev.mysql.com/doc/refman/5.5/en/mysqlimport.html.\n\nIf you use LOW_PRIORITY, execution of the LOAD DATA statement is\ndelayed until no other clients are reading from the table. This affects\nonly storage engines that use only table-level locking (such as MyISAM,\nMEMORY, and MERGE).\n\nIf you specify CONCURRENT with a MyISAM table that satisfies the\ncondition for concurrent inserts (that is, it contains no free blocks\nin the middle), other threads can retrieve data from the table while\nLOAD DATA is executing. Using this option affects the performance of\nLOAD DATA a bit, even if no other thread is using the table at the same\ntime.\n\nPrior to MySQL 5.5.1, CONCURRENT was not replicated when using\nstatement-based replication (see Bug #34628). However, it is replicated\nwhen using row-based replication, regardless of the version. See\nhttp://dev.mysql.com/doc/refman/5.5/en/replication-features-load-data.h\ntml, for more information.\n\nThe LOCAL keyword, if specified, is interpreted with respect to the\nclient end of the connection:\n\no If LOCAL is specified, the file is read by the client program on the\n client host and sent to the server. The file can be given as a full\n path name to specify its exact location. If given as a relative path\n name, the name is interpreted relative to the directory in which the\n client program was started.\n\n When using LOCAL with LOAD DATA, a copy of the file is created in the\n server\'s temporary directory. This is not the directory determined by\n the value of tmpdir or slave_load_tmpdir, but rather the operating\n system\'s temporary directory, and is not configurable in the MySQL\n Server. (Typically the system temporary directory is /tmp on Linux\n systems and C:\\WINDOWS\\TEMP on Windows.) Lack of sufficient space for\n the copy in this directory can cause the LOAD DATA LOCAL statement to\n fail.\n\no If LOCAL is not specified, the file must be located on the server\n host and is read directly by the server. The server uses the\n following rules to locate the file:\n\n o If the file name is an absolute path name, the server uses it as\n given.\n\n o If the file name is a relative path name with one or more leading\n components, the server searches for the file relative to the\n server\'s data directory.\n\n o If a file name with no leading components is given, the server\n looks for the file in the database directory of the default\n database.\n\nNote that, in the non-LOCAL case, these rules mean that a file named as\n./myfile.txt is read from the server\'s data directory, whereas the file\nnamed as myfile.txt is read from the database directory of the default\ndatabase. For example, if db1 is the default database, the following\nLOAD DATA statement reads the file data.txt from the database directory\nfor db1, even though the statement explicitly loads the file into a\ntable in the db2 database:\n\nLOAD DATA INFILE \'data.txt\' INTO TABLE db2.my_table;\n\nWindows path names are specified using forward slashes rather than\nbackslashes. If you do use backslashes, you must double them.\n\nFor security reasons, when reading text files located on the server,\nthe files must either reside in the database directory or be readable\nby all. Also, to use LOAD DATA INFILE on server files, you must have\nthe FILE privilege. See\nhttp://dev.mysql.com/doc/refman/5.5/en/privileges-provided.html. For\nnon-LOCAL load operations, if the secure_file_priv system variable is\nset to a nonempty directory name, the file to be loaded must be located\nin that directory.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/load-data.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/load-data.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (422,24,'MULTILINESTRING','MultiLineString(ls1,ls2,...)\n\nConstructs a MultiLineString value using LineString or WKB LineString\narguments.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/creating-spatial-values.html#gis-mysql-specific-functions\n\n','','http://dev.mysql.com/doc/refman/5.5/en/creating-spatial-values.html#gis-mysql-specific-functions'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (423,31,'LOCALTIME','Syntax:\nLOCALTIME, LOCALTIME()\n\nLOCALTIME and LOCALTIME() are synonyms for NOW().\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (424,26,'SHOW RELAYLOG EVENTS','Syntax:\nSHOW RELAYLOG EVENTS\n [IN \'log_name\'] [FROM pos] [LIMIT [offset,] row_count]\n\nShows the events in the relay log of a replication slave. If you do not\nspecify \'log_name\', the first relay log is displayed. This statement\nhas no effect on the master.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/show-relaylog-events.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/show-relaylog-events.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (425,3,'MPOINTFROMTEXT','MPointFromText(wkt[,srid]), MultiPointFromText(wkt[,srid])\n\nConstructs a MULTIPOINT value using its WKT representation and SRID.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/creating-spatial-values.html#gis-wkt-functions\n\n','','http://dev.mysql.com/doc/refman/5.5/en/creating-spatial-values.html#gis-wkt-functions'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (426,22,'BLOB','BLOB[(M)]\n\nA BLOB column with a maximum length of 65,535 (216 - 1) bytes. Each\nBLOB value is stored using a 2-byte length prefix that indicates the\nnumber of bytes in the value.\n\nAn optional length M can be given for this type. If this is done, MySQL\ncreates the column as the smallest BLOB type large enough to hold\nvalues M bytes long.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/string-type-overview.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (427,12,'SHA1','Syntax:\nSHA1(str), SHA(str)\n\nCalculates an SHA-1 160-bit checksum for the string, as described in\nRFC 3174 (Secure Hash Algorithm). The value is returned as a string of\n40 hex digits, or NULL if the argument was NULL. One of the possible\nuses for this function is as a hash key. See the notes at the beginning\nof this section about storing hash values efficiently. You can also use\nSHA1() as a cryptographic function for storing passwords. SHA() is\nsynonymous with SHA1().\n\nAs of MySQL 5.5.3, the return value is a nonbinary string in the\nconnection character set. Before 5.5.3, the return value is a binary\nstring; see the notes at the beginning of this section about using the\nvalue as a nonbinary string.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/encryption-functions.html\n\n','mysql> SELECT SHA1(\'abc\');\n -> \'a9993e364706816aba3e25717850c26c9cd0d89d\'\n','http://dev.mysql.com/doc/refman/5.5/en/encryption-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (428,37,'SUBSTR','Syntax:\nSUBSTR(str,pos), SUBSTR(str FROM pos), SUBSTR(str,pos,len), SUBSTR(str\nFROM pos FOR len)\n\nSUBSTR() is a synonym for SUBSTRING().\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/string-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/string-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (429,12,'PASSWORD','Syntax:\nPASSWORD(str)\n\nCalculates and returns a hashed password string from the plaintext\npassword str and returns a nonbinary string in the connection character\nset (a binary string before MySQL 5.5.3), or NULL if the argument is\nNULL. This function is the SQL interface to the algorithm used by the\nserver to encrypt MySQL passwords for storage in the mysql.user grant\ntable.\n\nThe password hashing method used by PASSWORD() depends on the value of\nthe old_passwords system variable:\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/encryption-functions.html\n\n','mysql> SET old_passwords = 0;\nmysql> SELECT PASSWORD(\'mypass\');\n+-------------------------------------------+\n| PASSWORD(\'mypass\') |\n+-------------------------------------------+\n| *6C8989366EAF75BB670AD8EA7A7FC1176A95CEF4 |\n+-------------------------------------------+\n\nmysql> SET old_passwords = 1;\nmysql> SELECT PASSWORD(\'mypass\');\n+--------------------+\n| PASSWORD(\'mypass\') |\n+--------------------+\n| 6f8c114b58f2ce9e |\n+--------------------+\n','http://dev.mysql.com/doc/refman/5.5/en/encryption-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (430,22,'CHAR','[NATIONAL] CHAR[(M)] [CHARACTER SET charset_name] [COLLATE\ncollation_name]\n\nA fixed-length string that is always right-padded with spaces to the\nspecified length when stored. M represents the column length in\ncharacters. The range of M is 0 to 255. If M is omitted, the length is\n1.\n\n*Note*: Trailing spaces are removed when CHAR values are retrieved\nunless the PAD_CHAR_TO_FULL_LENGTH SQL mode is enabled.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/string-type-overview.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (431,31,'UTC_DATE','Syntax:\nUTC_DATE, UTC_DATE()\n\nReturns the current UTC date as a value in \'YYYY-MM-DD\' or YYYYMMDD\nformat, depending on whether the function is used in a string or\nnumeric context.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html\n\n','mysql> SELECT UTC_DATE(), UTC_DATE() + 0;\n -> \'2003-08-14\', 20030814\n','http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (432,36,'DIMENSION','Dimension(g)\n\nReturns the inherent dimension of the geometry value g. The result can\nbe -1, 0, 1, or 2. The meaning of these values is given in\nhttp://dev.mysql.com/doc/refman/5.5/en/gis-class-geometry.html.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/geometry-property-functions.html#general-geometry-property-functions\n\n','mysql> SELECT Dimension(GeomFromText(\'LineString(1 1,2 2)\'));\n+------------------------------------------------+\n| Dimension(GeomFromText(\'LineString(1 1,2 2)\')) |\n+------------------------------------------------+\n| 1 |\n+------------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.5/en/geometry-property-functions.html#general-geometry-property-functions'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (433,16,'COUNT DISTINCT','Syntax:\nCOUNT(DISTINCT expr,[expr...])\n\nReturns a count of the number of rows with different non-NULL expr\nvalues.\n\nCOUNT(DISTINCT) returns 0 if there were no matching rows.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/group-by-functions.html\n\n','mysql> SELECT COUNT(DISTINCT results) FROM student;\n','http://dev.mysql.com/doc/refman/5.5/en/group-by-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (434,22,'BIT','BIT[(M)]\n\nA bit-field type. M indicates the number of bits per value, from 1 to\n64. The default is 1 if M is omitted.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/numeric-type-overview.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (435,30,'EQUALS','Equals(g1,g2)\n\nReturns 1 or 0 to indicate whether g1 is spatially equal to g2.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/functions-for-testing-spatial-relations-between-geometric-objects.html#functions-that-test-spatial-relationships-between-geometries\n\n','','http://dev.mysql.com/doc/refman/5.5/en/functions-for-testing-spatial-relations-between-geometric-objects.html#functions-that-test-spatial-relationships-between-geometries'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (436,26,'SHOW CREATE VIEW','Syntax:\nSHOW CREATE VIEW view_name\n\nThis statement shows a CREATE VIEW statement that creates the given\nview.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/show-create-view.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/show-create-view.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (437,18,'INTERVAL','Syntax:\nINTERVAL(N,N1,N2,N3,...)\n\nReturns 0 if N < N1, 1 if N < N2 and so on or -1 if N is NULL. All\narguments are treated as integers. It is required that N1 < N2 < N3 <\n... < Nn for this function to work correctly. This is because a binary\nsearch is used (very fast).\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/comparison-operators.html\n\n','mysql> SELECT INTERVAL(23, 1, 15, 17, 30, 44, 200);\n -> 3\nmysql> SELECT INTERVAL(10, 1, 10, 100, 1000);\n -> 2\nmysql> SELECT INTERVAL(22, 23, 30, 44, 200);\n -> 0\n','http://dev.mysql.com/doc/refman/5.5/en/comparison-operators.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (438,31,'FROM_DAYS','Syntax:\nFROM_DAYS(N)\n\nGiven a day number N, returns a DATE value.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html\n\n','mysql> SELECT FROM_DAYS(730669);\n -> \'2007-07-03\'\n','http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (439,39,'ALTER PROCEDURE','Syntax:\nALTER PROCEDURE proc_name [characteristic ...]\n\ncharacteristic:\n COMMENT \'string\'\n | LANGUAGE SQL\n | { CONTAINS SQL | NO SQL | READS SQL DATA | MODIFIES SQL DATA }\n | SQL SECURITY { DEFINER | INVOKER }\n\nThis statement can be used to change the characteristics of a stored\nprocedure. More than one change may be specified in an ALTER PROCEDURE\nstatement. However, you cannot change the parameters or body of a\nstored procedure using this statement; to make such changes, you must\ndrop and re-create the procedure using DROP PROCEDURE and CREATE\nPROCEDURE.\n\nYou must have the ALTER ROUTINE privilege for the procedure. By\ndefault, that privilege is granted automatically to the procedure\ncreator. This behavior can be changed by disabling the\nautomatic_sp_privileges system variable. See\nhttp://dev.mysql.com/doc/refman/5.5/en/stored-routines-privileges.html.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/alter-procedure.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/alter-procedure.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (440,19,'BIT_COUNT','Syntax:\nBIT_COUNT(N)\n\nReturns the number of bits that are set in the argument N.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/bit-functions.html\n\n','mysql> SELECT BIT_COUNT(29), BIT_COUNT(b\'101010\');\n -> 4, 3\n','http://dev.mysql.com/doc/refman/5.5/en/bit-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (441,37,'OCTET_LENGTH','Syntax:\nOCTET_LENGTH(str)\n\nOCTET_LENGTH() is a synonym for LENGTH().\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/string-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/string-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (442,31,'UTC_TIMESTAMP','Syntax:\nUTC_TIMESTAMP, UTC_TIMESTAMP()\n\nReturns the current UTC date and time as a value in \'YYYY-MM-DD\nHH:MM:SS\' or YYYYMMDDHHMMSS.uuuuuu format, depending on whether the\nfunction is used in a string or numeric context.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html\n\n','mysql> SELECT UTC_TIMESTAMP(), UTC_TIMESTAMP() + 0;\n -> \'2003-08-14 18:08:04\', 20030814180804.000000\n','http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (443,12,'AES_ENCRYPT','Syntax:\nAES_ENCRYPT(str,key_str)\n\nAES_ENCRYPT() and AES_DECRYPT() enable encryption and decryption of\ndata using the official AES (Advanced Encryption Standard) algorithm,\npreviously known as "Rijndael." Encoding with a 128-bit key length is\nused, but you can extend it up to 256 bits by modifying the source. We\nchose 128 bits because it is much faster and it is secure enough for\nmost purposes.\n\nAES_ENCRYPT() encrypts a string and returns a binary string.\nAES_DECRYPT() decrypts the encrypted string and returns the original\nstring. The input arguments may be any length. If either argument is\nNULL, the result of this function is also NULL.\n\nBecause AES is a block-level algorithm, padding is used to encode\nuneven length strings and so the result string length may be calculated\nusing this formula:\n\n16 * (trunc(string_length / 16) + 1)\n\nIf AES_DECRYPT() detects invalid data or incorrect padding, it returns\nNULL. However, it is possible for AES_DECRYPT() to return a non-NULL\nvalue (possibly garbage) if the input data or the key is invalid.\n\nYou can use the AES functions to store data in an encrypted form by\nmodifying your queries:\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/encryption-functions.html\n\n','INSERT INTO t VALUES (1,AES_ENCRYPT(\'text\',\'password\'));\n','http://dev.mysql.com/doc/refman/5.5/en/encryption-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (444,4,'+','Syntax:\n+\n\nAddition:\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/arithmetic-functions.html\n\n','mysql> SELECT 3+5;\n -> 8\n','http://dev.mysql.com/doc/refman/5.5/en/arithmetic-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (445,14,'INET_NTOA','Syntax:\nINET_NTOA(expr)\n\nGiven a numeric IPv4 network address in network byte order, returns the\ndotted-quad representation of the address as a string. INET_NTOA()\nreturns NULL if it does not understand its argument.\n\nAs of MySQL 5.5.3, the return value is a nonbinary string in the\nconnection character set. Before 5.5.3, the return value is a binary\nstring.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/miscellaneous-functions.html\n\n','mysql> SELECT INET_NTOA(167773449);\n -> \'10.0.5.9\'\n','http://dev.mysql.com/doc/refman/5.5/en/miscellaneous-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (446,4,'ACOS','Syntax:\nACOS(X)\n\nReturns the arc cosine of X, that is, the value whose cosine is X.\nReturns NULL if X is not in the range -1 to 1.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/mathematical-functions.html\n\n','mysql> SELECT ACOS(1);\n -> 0\nmysql> SELECT ACOS(1.0001);\n -> NULL\nmysql> SELECT ACOS(0);\n -> 1.5707963267949\n','http://dev.mysql.com/doc/refman/5.5/en/mathematical-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (447,8,'ISOLATION','Syntax:\nSET [GLOBAL | SESSION] TRANSACTION ISOLATION LEVEL\n {\n REPEATABLE READ\n | READ COMMITTED\n | READ UNCOMMITTED\n | SERIALIZABLE\n }\n\nThis statement sets the transaction isolation level, used for\noperations on InnoDB tables.\n\nScope of the Isolation Level\n\nYou can set the isolation level globally, for the current session, or\nfor the next transaction:\n\no With the GLOBAL keyword, the statement sets the default transaction\n level globally for all subsequent sessions. Existing sessions are\n unaffected.\n\no With the SESSION keyword, the statement sets the default transaction\n level for all subsequent transactions performed within the current\n session.\n\no Without any SESSION or GLOBAL keyword, the statement sets the\n isolation level for the next (not started) transaction performed\n within the current session.\n\nA change to the global default isolation level requires the SUPER\nprivilege. Any session is free to change its session isolation level\n(even in the middle of a transaction), or the isolation level for its\nnext transaction.\n\nSET TRANSACTION ISOLATION LEVEL without GLOBAL or SESSION is not\npermitted while there is an active transaction:\n\nmysql> START TRANSACTION;\nQuery OK, 0 rows affected (0.02 sec)\n\nmysql> SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;\nERROR 1568 (25001): Transaction isolation level can\'t be changed\nwhile a transaction is in progress\n\nTo set the global default isolation level at server startup, use the\n--transaction-isolation=level option to mysqld on the command line or\nin an option file. Values of level for this option use dashes rather\nthan spaces, so the permissible values are READ-UNCOMMITTED,\nREAD-COMMITTED, REPEATABLE-READ, or SERIALIZABLE. For example, to set\nthe default isolation level to REPEATABLE READ, use these lines in the\n[mysqld] section of an option file:\n\n[mysqld]\ntransaction-isolation = REPEATABLE-READ\n\nIt is possible to check or set the global and session transaction\nisolation levels at runtime by using the tx_isolation system variable:\n\nSELECT @@GLOBAL.tx_isolation, @@tx_isolation;\nSET GLOBAL tx_isolation=\'REPEATABLE-READ\';\nSET SESSION tx_isolation=\'SERIALIZABLE\';\n\nDetails and Usage of Isolation Levels\n\nInnoDB supports each of the transaction isolation levels described here\nusing different locking strategies. You can enforce a high degree of\nconsistency with the default REPEATABLE READ level, for operations on\ncrucial data where ACID compliance is important. Or you can relax the\nconsistency rules with READ COMMITTED or even READ UNCOMMITTED, in\nsituations such as bulk reporting where precise consistency and\nrepeatable results are less important than minimizing the amount of\noverhead for locking. SERIALIZABLE enforces even stricter rules than\nREPEATABLE READ, and is used mainly in specialized situations, such as\nwith XA transactions and for troubleshooting issues with concurrency\nand deadlocks.\n\nFor full information about how these isolation levels work with InnoDB\ntransactions, see\nhttp://dev.mysql.com/doc/refman/5.5/en/innodb-transaction-model.html.\nIn particular, for additional information about InnoDB record-level\nlocks and how it uses them to execute various types of statements, see\nhttp://dev.mysql.com/doc/refman/5.5/en/innodb-record-level-locks.html\nand http://dev.mysql.com/doc/refman/5.5/en/innodb-locks-set.html.\n\nThe following list describes how MySQL supports the different\ntransaction levels. The list goes from the most commonly used level to\nthe least used.\n\no REPEATABLE READ\n\n This is the default isolation level for InnoDB. For consistent reads,\n there is an important difference from the READ COMMITTED isolation\n level: All consistent reads within the same transaction read the\n snapshot established by the first read. This convention means that if\n you issue several plain (nonlocking) SELECT statements within the\n same transaction, these SELECT statements are consistent also with\n respect to each other. See\n http://dev.mysql.com/doc/refman/5.5/en/innodb-consistent-read.html.\n\n For locking reads (SELECT with FOR UPDATE or LOCK IN SHARE MODE),\n UPDATE, and DELETE statements, locking depends on whether the\n statement uses a unique index with a unique search condition, or a\n range-type search condition. For a unique index with a unique search\n condition, InnoDB locks only the index record found, not the gap\n before it. For other search conditions, InnoDB locks the index range\n scanned, using gap locks or next-key (gap plus index-record) locks to\n block insertions by other sessions into the gaps covered by the\n range.\n\no READ COMMITTED\n\n A somewhat Oracle-like isolation level with respect to consistent\n (nonlocking) reads: Each consistent read, even within the same\n transaction, sets and reads its own fresh snapshot. See\n http://dev.mysql.com/doc/refman/5.5/en/innodb-consistent-read.html.\n\n For locking reads (SELECT with FOR UPDATE or LOCK IN SHARE MODE),\n InnoDB locks only index records, not the gaps before them, and thus\n permits the free insertion of new records next to locked records. For\n UPDATE and DELETE statements, locking depends on whether the\n statement uses a unique index with a unique search condition (such as\n WHERE id = 100), or a range-type search condition (such as WHERE id >\n 100). For a unique index with a unique search condition, InnoDB locks\n only the index record found, not the gap before it. For range-type\n searches, InnoDB locks the index range scanned, using gap locks or\n next-key (gap plus index-record) locks to block insertions by other\n sessions into the gaps covered by the range. This is necessary\n because "phantom rows" must be blocked for MySQL replication and\n recovery to work.\n\n *Note*: In MySQL 5.5, if the READ COMMITTED isolation level is used\n or the innodb_locks_unsafe_for_binlog system variable is enabled,\n there is no InnoDB gap locking except for foreign-key constraint\n checking and duplicate-key checking. Also, record locks for\n nonmatching rows are released after MySQL has evaluated the WHERE\n condition. If you use READ COMMITTED or enable\n innodb_locks_unsafe_for_binlog, you must use row-based binary\n logging.\n\no READ UNCOMMITTED\n\n SELECT statements are performed in a nonlocking fashion, but a\n possible earlier version of a row might be used. Thus, using this\n isolation level, such reads are not consistent. This is also called a\n "dirty read." Otherwise, this isolation level works like READ\n COMMITTED.\n\no SERIALIZABLE\n\n This level is like REPEATABLE READ, but InnoDB implicitly converts\n all plain SELECT statements to SELECT ... LOCK IN SHARE MODE if\n autocommit is disabled. If autocommit is enabled, the SELECT is its\n own transaction. It therefore is known to be read only and can be\n serialized if performed as a consistent (nonlocking) read and need\n not block for other transactions. (To force a plain SELECT to block\n if other transactions have modified the selected rows, disable\n autocommit.)\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/set-transaction.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/set-transaction.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (448,4,'CEILING','Syntax:\nCEILING(X)\n\nReturns the smallest integer value not less than X.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/mathematical-functions.html\n\n','mysql> SELECT CEILING(1.23);\n -> 2\nmysql> SELECT CEILING(-1.23);\n -> -1\n','http://dev.mysql.com/doc/refman/5.5/en/mathematical-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (449,4,'SIN','Syntax:\nSIN(X)\n\nReturns the sine of X, where X is given in radians.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/mathematical-functions.html\n\n','mysql> SELECT SIN(PI());\n -> 1.2246063538224e-16\nmysql> SELECT ROUND(SIN(PI()));\n -> 0\n','http://dev.mysql.com/doc/refman/5.5/en/mathematical-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (450,31,'DAYOFWEEK','Syntax:\nDAYOFWEEK(date)\n\nReturns the weekday index for date (1 = Sunday, 2 = Monday, ..., 7 =\nSaturday). These index values correspond to the ODBC standard.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html\n\n','mysql> SELECT DAYOFWEEK(\'2007-02-03\');\n -> 7\n','http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (451,26,'SHOW PROCESSLIST','Syntax:\nSHOW [FULL] PROCESSLIST\n\nSHOW PROCESSLIST shows you which threads are running. You can also get\nthis information from the INFORMATION_SCHEMA PROCESSLIST table or the\nmysqladmin processlist command. If you have the PROCESS privilege, you\ncan see all threads. Otherwise, you can see only your own threads (that\nis, threads associated with the MySQL account that you are using). If\nyou do not use the FULL keyword, only the first 100 characters of each\nstatement are shown in the Info field.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/show-processlist.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/show-processlist.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (452,32,'LINEFROMWKB','LineFromWKB(wkb[,srid]), LineStringFromWKB(wkb[,srid])\n\nConstructs a LINESTRING value using its WKB representation and SRID.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/creating-spatial-values.html#gis-wkb-functions\n\n','','http://dev.mysql.com/doc/refman/5.5/en/creating-spatial-values.html#gis-wkb-functions'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (453,36,'GEOMETRYTYPE','GeometryType(g)\n\nReturns as a binary string the name of the geometry type of which the\ngeometry instance g is a member. The name corresponds to one of the\ninstantiable Geometry subclasses.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/geometry-property-functions.html#general-geometry-property-functions\n\n','mysql> SELECT GeometryType(GeomFromText(\'POINT(1 1)\'));\n+------------------------------------------+\n| GeometryType(GeomFromText(\'POINT(1 1)\')) |\n+------------------------------------------+\n| POINT |\n+------------------------------------------+\n','http://dev.mysql.com/doc/refman/5.5/en/geometry-property-functions.html#general-geometry-property-functions'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (454,39,'CREATE VIEW','Syntax:\nCREATE\n [OR REPLACE]\n [ALGORITHM = {UNDEFINED | MERGE | TEMPTABLE}]\n [DEFINER = { user | CURRENT_USER }]\n [SQL SECURITY { DEFINER | INVOKER }]\n VIEW view_name [(column_list)]\n AS select_statement\n [WITH [CASCADED | LOCAL] CHECK OPTION]\n\nThe CREATE VIEW statement creates a new view, or replaces an existing\none if the OR REPLACE clause is given. If the view does not exist,\nCREATE OR REPLACE VIEW is the same as CREATE VIEW. If the view does\nexist, CREATE OR REPLACE VIEW is the same as ALTER VIEW.\n\nThe select_statement is a SELECT statement that provides the definition\nof the view. (When you select from the view, you select in effect using\nthe SELECT statement.) select_statement can select from base tables or\nother views.\n\nThe view definition is "frozen" at creation time, so changes to the\nunderlying tables afterward do not affect the view definition. For\nexample, if a view is defined as SELECT * on a table, new columns added\nto the table later do not become part of the view.\n\nThe ALGORITHM clause affects how MySQL processes the view. The DEFINER\nand SQL SECURITY clauses specify the security context to be used when\nchecking access privileges at view invocation time. The WITH CHECK\nOPTION clause can be given to constrain inserts or updates to rows in\ntables referenced by the view. These clauses are described later in\nthis section.\n\nThe CREATE VIEW statement requires the CREATE VIEW privilege for the\nview, and some privilege for each column selected by the SELECT\nstatement. For columns used elsewhere in the SELECT statement you must\nhave the SELECT privilege. If the OR REPLACE clause is present, you\nmust also have the DROP privilege for the view. CREATE VIEW might also\nrequire the SUPER privilege, depending on the DEFINER value, as\ndescribed later in this section.\n\nWhen a view is referenced, privilege checking occurs as described later\nin this section.\n\nA view belongs to a database. By default, a new view is created in the\ndefault database. To create the view explicitly in a given database,\nspecify the name as db_name.view_name when you create it:\n\nmysql> CREATE VIEW test.v AS SELECT * FROM t;\n\nWithin a database, base tables and views share the same namespace, so a\nbase table and a view cannot have the same name.\n\nColumns retrieved by the SELECT statement can be simple references to\ntable columns. They can also be expressions that use functions,\nconstant values, operators, and so forth.\n\nViews must have unique column names with no duplicates, just like base\ntables. By default, the names of the columns retrieved by the SELECT\nstatement are used for the view column names. To define explicit names\nfor the view columns, the optional column_list clause can be given as a\nlist of comma-separated identifiers. The number of names in column_list\nmust be the same as the number of columns retrieved by the SELECT\nstatement.\n\nUnqualified table or view names in the SELECT statement are interpreted\nwith respect to the default database. A view can refer to tables or\nviews in other databases by qualifying the table or view name with the\nproper database name.\n\nA view can be created from many kinds of SELECT statements. It can\nrefer to base tables or other views. It can use joins, UNION, and\nsubqueries. The SELECT need not even refer to any tables. The following\nexample defines a view that selects two columns from another table, as\nwell as an expression calculated from those columns:\n\nmysql> CREATE TABLE t (qty INT, price INT);\nmysql> INSERT INTO t VALUES(3, 50);\nmysql> CREATE VIEW v AS SELECT qty, price, qty*price AS value FROM t;\nmysql> SELECT * FROM v;\n+------+-------+-------+\n| qty | price | value |\n+------+-------+-------+\n| 3 | 50 | 150 |\n+------+-------+-------+\n\nA view definition is subject to the following restrictions:\n\no The SELECT statement cannot contain a subquery in the FROM clause.\n\no The SELECT statement cannot refer to system or user variables.\n\no Within a stored program, the definition cannot refer to program\n parameters or local variables.\n\no The SELECT statement cannot refer to prepared statement parameters.\n\no Any table or view referred to in the definition must exist. However,\n after a view has been created, it is possible to drop a table or view\n that the definition refers to. In this case, use of the view results\n in an error. To check a view definition for problems of this kind,\n use the CHECK TABLE statement.\n\no The definition cannot refer to a TEMPORARY table, and you cannot\n create a TEMPORARY view.\n\no Any tables named in the view definition must exist at definition\n time.\n\no You cannot associate a trigger with a view.\n\no Aliases for column names in the SELECT statement are checked against\n the maximum column length of 64 characters (not the maximum alias\n length of 256 characters).\n\nORDER BY is permitted in a view definition, but it is ignored if you\nselect from a view using a statement that has its own ORDER BY.\n\nFor other options or clauses in the definition, they are added to the\noptions or clauses of the statement that references the view, but the\neffect is undefined. For example, if a view definition includes a LIMIT\nclause, and you select from the view using a statement that has its own\nLIMIT clause, it is undefined which limit applies. This same principle\napplies to options such as ALL, DISTINCT, or SQL_SMALL_RESULT that\nfollow the SELECT keyword, and to clauses such as INTO, FOR UPDATE,\nLOCK IN SHARE MODE, and PROCEDURE.\n\nIf you create a view and then change the query processing environment\nby changing system variables, that may affect the results that you get\nfrom the view:\n\nmysql> CREATE VIEW v (mycol) AS SELECT \'abc\';\nQuery OK, 0 rows affected (0.01 sec)\n\nmysql> SET sql_mode = \'\';\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> SELECT "mycol" FROM v;\n+-------+\n| mycol |\n+-------+\n| mycol |\n+-------+\n1 row in set (0.01 sec)\n\nmysql> SET sql_mode = \'ANSI_QUOTES\';\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> SELECT "mycol" FROM v;\n+-------+\n| mycol |\n+-------+\n| abc |\n+-------+\n1 row in set (0.00 sec)\n\nThe DEFINER and SQL SECURITY clauses determine which MySQL account to\nuse when checking access privileges for the view when a statement is\nexecuted that references the view. The valid SQL SECURITY\ncharacteristic values are DEFINER and INVOKER. These indicate that the\nrequired privileges must be held by the user who defined or invoked the\nview, respectively. The default SQL SECURITY value is DEFINER.\n\nIf a user value is given for the DEFINER clause, it should be a MySQL\naccount specified as \'user_name\'@\'host_name\' (the same format used in\nthe GRANT statement), CURRENT_USER, or CURRENT_USER(). The default\nDEFINER value is the user who executes the CREATE VIEW statement. This\nis the same as specifying DEFINER = CURRENT_USER explicitly.\n\nIf you specify the DEFINER clause, these rules determine the valid\nDEFINER user values:\n\no If you do not have the SUPER privilege, the only valid user value is\n your own account, either specified literally or by using\n CURRENT_USER. You cannot set the definer to some other account.\n\no If you have the SUPER privilege, you can specify any syntactically\n valid account name. If the account does not actually exist, a warning\n is generated.\n\no Although it is possible to create a view with a nonexistent DEFINER\n account, an error occurs when the view is referenced if the SQL\n SECURITY value is DEFINER but the definer account does not exist.\n\nFor more information about view security, see\nhttp://dev.mysql.com/doc/refman/5.5/en/stored-programs-security.html.\n\nWithin a view definition, CURRENT_USER returns the view\'s DEFINER value\nby default. For views defined with the SQL SECURITY INVOKER\ncharacteristic, CURRENT_USER returns the account for the view\'s\ninvoker. For information about user auditing within views, see\nhttp://dev.mysql.com/doc/refman/5.5/en/account-activity-auditing.html.\n\nWithin a stored routine that is defined with the SQL SECURITY DEFINER\ncharacteristic, CURRENT_USER returns the routine\'s DEFINER value. This\nalso affects a view defined within such a routine, if the view\ndefinition contains a DEFINER value of CURRENT_USER.\n\nView privileges are checked like this:\n\no At view definition time, the view creator must have the privileges\n needed to use the top-level objects accessed by the view. For\n example, if the view definition refers to table columns, the creator\n must have some privilege for each column in the select list of the\n definition, and the SELECT privilege for each column used elsewhere\n in the definition. If the definition refers to a stored function,\n only the privileges needed to invoke the function can be checked. The\n privileges required at function invocation time can be checked only\n as it executes: For different invocations, different execution paths\n within the function might be taken.\n\no The user who references a view must have appropriate privileges to\n access it (SELECT to select from it, INSERT to insert into it, and so\n forth.)\n\no When a view has been referenced, privileges for objects accessed by\n the view are checked against the privileges held by the view DEFINER\n account or invoker, depending on whether the SQL SECURITY\n characteristic is DEFINER or INVOKER, respectively.\n\no If reference to a view causes execution of a stored function,\n privilege checking for statements executed within the function depend\n on whether the function SQL SECURITY characteristic is DEFINER or\n INVOKER. If the security characteristic is DEFINER, the function runs\n with the privileges of the DEFINER account. If the characteristic is\n INVOKER, the function runs with the privileges determined by the\n view\'s SQL SECURITY characteristic.\n\nExample: A view might depend on a stored function, and that function\nmight invoke other stored routines. For example, the following view\ninvokes a stored function f():\n\nCREATE VIEW v AS SELECT * FROM t WHERE t.id = f(t.name);\n\nSuppose that f() contains a statement such as this:\n\nIF name IS NULL then\n CALL p1();\nELSE\n CALL p2();\nEND IF;\n\nThe privileges required for executing statements within f() need to be\nchecked when f() executes. This might mean that privileges are needed\nfor p1() or p2(), depending on the execution path within f(). Those\nprivileges must be checked at runtime, and the user who must possess\nthe privileges is determined by the SQL SECURITY values of the view v\nand the function f().\n\nThe DEFINER and SQL SECURITY clauses for views are extensions to\nstandard SQL. In standard SQL, views are handled using the rules for\nSQL SECURITY DEFINER. The standard says that the definer of the view,\nwhich is the same as the owner of the view\'s schema, gets applicable\nprivileges on the view (for example, SELECT) and may grant them. MySQL\nhas no concept of a schema "owner", so MySQL adds a clause to identify\nthe definer. The DEFINER clause is an extension where the intent is to\nhave what the standard has; that is, a permanent record of who defined\nthe view. This is why the default DEFINER value is the account of the\nview creator.\n\nThe optional ALGORITHM clause is a MySQL extension to standard SQL. It\naffects how MySQL processes the view. ALGORITHM takes three values:\nMERGE, TEMPTABLE, or UNDEFINED. The default algorithm is UNDEFINED if\nno ALGORITHM clause is present. For more information, see\nhttp://dev.mysql.com/doc/refman/5.5/en/view-algorithms.html.\n\nSome views are updatable. That is, you can use them in statements such\nas UPDATE, DELETE, or INSERT to update the contents of the underlying\ntable. For a view to be updatable, there must be a one-to-one\nrelationship between the rows in the view and the rows in the\nunderlying table. There are also certain other constructs that make a\nview nonupdatable.\n\nThe WITH CHECK OPTION clause can be given for an updatable view to\nprevent inserts or updates to rows except those for which the WHERE\nclause in the select_statement is true.\n\nIn a WITH CHECK OPTION clause for an updatable view, the LOCAL and\nCASCADED keywords determine the scope of check testing when the view is\ndefined in terms of another view. The LOCAL keyword restricts the CHECK\nOPTION only to the view being defined. CASCADED causes the checks for\nunderlying views to be evaluated as well. When neither keyword is\ngiven, the default is CASCADED.\n\nFor more information about updatable views and the WITH CHECK OPTION\nclause, see\nhttp://dev.mysql.com/doc/refman/5.5/en/view-updatability.html.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/create-view.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/create-view.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (455,37,'TRIM','Syntax:\nTRIM([{BOTH | LEADING | TRAILING} [remstr] FROM] str), TRIM([remstr\nFROM] str)\n\nReturns the string str with all remstr prefixes or suffixes removed. If\nnone of the specifiers BOTH, LEADING, or TRAILING is given, BOTH is\nassumed. remstr is optional and, if not specified, spaces are removed.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/string-functions.html\n\n','mysql> SELECT TRIM(\' bar \');\n -> \'bar\'\nmysql> SELECT TRIM(LEADING \'x\' FROM \'xxxbarxxx\');\n -> \'barxxx\'\nmysql> SELECT TRIM(BOTH \'x\' FROM \'xxxbarxxx\');\n -> \'bar\'\nmysql> SELECT TRIM(TRAILING \'xyz\' FROM \'barxxyz\');\n -> \'barx\'\n','http://dev.mysql.com/doc/refman/5.5/en/string-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (456,18,'IS','Syntax:\nIS boolean_value\n\nTests a value against a boolean value, where boolean_value can be TRUE,\nFALSE, or UNKNOWN.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/comparison-operators.html\n\n','mysql> SELECT 1 IS TRUE, 0 IS FALSE, NULL IS UNKNOWN;\n -> 1, 1, 1\n','http://dev.mysql.com/doc/refman/5.5/en/comparison-operators.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (457,31,'GET_FORMAT','Syntax:\nGET_FORMAT({DATE|TIME|DATETIME}, {\'EUR\'|\'USA\'|\'JIS\'|\'ISO\'|\'INTERNAL\'})\n\nReturns a format string. This function is useful in combination with\nthe DATE_FORMAT() and the STR_TO_DATE() functions.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html\n\n','mysql> SELECT DATE_FORMAT(\'2003-10-03\',GET_FORMAT(DATE,\'EUR\'));\n -> \'03.10.2003\'\nmysql> SELECT STR_TO_DATE(\'10.31.2003\',GET_FORMAT(DATE,\'USA\'));\n -> \'2003-10-31\'\n','http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (458,22,'TINYBLOB','TINYBLOB\n\nA BLOB column with a maximum length of 255 (28 - 1) bytes. Each\nTINYBLOB value is stored using a 1-byte length prefix that indicates\nthe number of bytes in the value.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/string-type-overview.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (459,23,'SIGNAL','Syntax:\nSIGNAL condition_value\n [SET signal_information_item\n [, signal_information_item] ...]\n\ncondition_value:\n SQLSTATE [VALUE] sqlstate_value\n | condition_name\n\nsignal_information_item:\n condition_information_item_name = simple_value_specification\n\ncondition_information_item_name:\n CLASS_ORIGIN\n | SUBCLASS_ORIGIN\n | MESSAGE_TEXT\n | MYSQL_ERRNO\n | CONSTRAINT_CATALOG\n | CONSTRAINT_SCHEMA\n | CONSTRAINT_NAME\n | CATALOG_NAME\n | SCHEMA_NAME\n | TABLE_NAME\n | COLUMN_NAME\n | CURSOR_NAME\n\ncondition_name, simple_value_specification:\n (see following discussion)\n\nSIGNAL is the way to "return" an error. SIGNAL provides error\ninformation to a handler, to an outer portion of the application, or to\nthe client. Also, it provides control over the error\'s characteristics\n(error number, SQLSTATE value, message). Without SIGNAL, it is\nnecessary to resort to workarounds such as deliberately referring to a\nnonexistent table to cause a routine to return an error.\n\nNo special privileges are required to execute the SIGNAL statement.\n\nThe condition_value in a SIGNAL statement indicates the error value to\nbe returned. It can be an SQLSTATE value (a 5-character string literal)\nor a condition_name that refers to a named condition previously defined\nwith DECLARE ... CONDITION (see [HELP DECLARE CONDITION]).\n\nAn SQLSTATE value can indicate errors, warnings, or "not found." The\nfirst two characters of the value indicate its error class, as\ndiscussed in\nhttp://dev.mysql.com/doc/refman/5.5/en/signal.html#signal-condition-inf\normation-items. Some signal values cause statement termination; see\nhttp://dev.mysql.com/doc/refman/5.5/en/signal.html#signal-effects.\n\nThe SQLSTATE value for a SIGNAL statement should not start with \'00\'\nbecause such values indicate success and are not valid for signaling an\nerror. This is true whether the SQLSTATE value is specified directly in\nthe SIGNAL statement or in a named condition referred to in the\nstatement. If the value is invalid, a Bad SQLSTATE error occurs.\n\nTo signal a generic SQLSTATE value, use \'45000\', which means "unhandled\nuser-defined exception."\n\nThe SIGNAL statement optionally includes a SET clause that contains\nmultiple signal items, in a comma-separated list of\ncondition_information_item_name = simple_value_specification\nassignments.\n\nEach condition_information_item_name may be specified only once in the\nSET clause. Otherwise, a Duplicate condition information item error\noccurs.\n\nValid simple_value_specification designators can be specified using\nstored procedure or function parameters, stored program local variables\ndeclared with DECLARE, user-defined variables, system variables, or\nliterals. A character literal may include a _charset introducer.\n\nFor information about permissible condition_information_item_name\nvalues, see\nhttp://dev.mysql.com/doc/refman/5.5/en/signal.html#signal-condition-inf\normation-items.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/signal.html\n\n','CREATE PROCEDURE p (pval INT)\nBEGIN\n DECLARE specialty CONDITION FOR SQLSTATE \'45000\';\n IF pval = 0 THEN\n SIGNAL SQLSTATE \'01000\';\n ELSEIF pval = 1 THEN\n SIGNAL SQLSTATE \'45000\'\n SET MESSAGE_TEXT = \'An error occurred\';\n ELSEIF pval = 2 THEN\n SIGNAL specialty\n SET MESSAGE_TEXT = \'An error occurred\';\n ELSE\n SIGNAL SQLSTATE \'01000\'\n SET MESSAGE_TEXT = \'A warning occurred\', MYSQL_ERRNO = 1000;\n SIGNAL SQLSTATE \'45000\'\n SET MESSAGE_TEXT = \'An error occurred\', MYSQL_ERRNO = 1001;\n END IF;\nEND;\n','http://dev.mysql.com/doc/refman/5.5/en/signal.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (460,8,'SAVEPOINT','Syntax:\nSAVEPOINT identifier\nROLLBACK [WORK] TO [SAVEPOINT] identifier\nRELEASE SAVEPOINT identifier\n\nInnoDB supports the SQL statements SAVEPOINT, ROLLBACK TO SAVEPOINT,\nRELEASE SAVEPOINT and the optional WORK keyword for ROLLBACK.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/savepoint.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/savepoint.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (461,17,'USER','Syntax:\nUSER()\n\nReturns the current MySQL user name and host name as a string in the\nutf8 character set.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/information-functions.html\n\n','mysql> SELECT USER();\n -> \'davida@localhost\'\n','http://dev.mysql.com/doc/refman/5.5/en/information-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (462,23,'LABELS','Syntax:\n[begin_label:] BEGIN\n [statement_list]\nEND [end_label]\n\n[begin_label:] LOOP\n statement_list\nEND LOOP [end_label]\n\n[begin_label:] REPEAT\n statement_list\nUNTIL search_condition\nEND REPEAT [end_label]\n\n[begin_label:] WHILE search_condition DO\n statement_list\nEND WHILE [end_label]\n\nLabels are permitted for BEGIN ... END blocks and for the LOOP, REPEAT,\nand WHILE statements. Label use for those statements follows these\nrules:\n\no begin_label must be followed by a colon.\n\no begin_label can be given without end_label. If end_label is present,\n it must be the same as begin_label.\n\no end_label cannot be given without begin_label.\n\no Labels at the same nesting level must be distinct.\n\no Labels can be up to 16 characters long.\n\nTo refer to a label within the labeled construct, use an ITERATE or\nLEAVE statement. The following example uses those statements to\ncontinue iterating or terminate the loop:\n\nCREATE PROCEDURE doiterate(p1 INT)\nBEGIN\n label1: LOOP\n SET p1 = p1 + 1;\n IF p1 < 10 THEN ITERATE label1; END IF;\n LEAVE label1;\n END LOOP label1;\nEND;\n\nThe scope of a block label does not include the code for handlers\ndeclared within the block. For details, see [HELP DECLARE HANDLER].\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/statement-labels.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/statement-labels.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (463,39,'ALTER TABLE','Syntax:\nALTER [ONLINE | OFFLINE] [IGNORE] TABLE tbl_name\n [alter_specification [, alter_specification] ...]\n [partition_options]\n\nalter_specification:\n table_options\n | ADD [COLUMN] col_name column_definition\n [FIRST | AFTER col_name ]\n | ADD [COLUMN] (col_name column_definition,...)\n | ADD {INDEX|KEY} [index_name]\n [index_type] (index_col_name,...) [index_option] ...\n | ADD [CONSTRAINT [symbol]] PRIMARY KEY\n [index_type] (index_col_name,...) [index_option] ...\n | ADD [CONSTRAINT [symbol]]\n UNIQUE [INDEX|KEY] [index_name]\n [index_type] (index_col_name,...) [index_option] ...\n | ADD FULLTEXT [INDEX|KEY] [index_name]\n (index_col_name,...) [index_option] ...\n | ADD SPATIAL [INDEX|KEY] [index_name]\n (index_col_name,...) [index_option] ...\n | ADD [CONSTRAINT [symbol]]\n FOREIGN KEY [index_name] (index_col_name,...)\n reference_definition\n | ALTER [COLUMN] col_name {SET DEFAULT literal | DROP DEFAULT}\n | CHANGE [COLUMN] old_col_name new_col_name column_definition\n [FIRST|AFTER col_name]\n | MODIFY [COLUMN] col_name column_definition\n [FIRST | AFTER col_name]\n | DROP [COLUMN] col_name\n | DROP PRIMARY KEY\n | DROP {INDEX|KEY} index_name\n | DROP FOREIGN KEY fk_symbol\n | MAX_ROWS = rows\n | DISABLE KEYS\n | ENABLE KEYS\n | RENAME [TO|AS] new_tbl_name\n | ORDER BY col_name [, col_name] ...\n | CONVERT TO CHARACTER SET charset_name [COLLATE collation_name]\n | [DEFAULT] CHARACTER SET [=] charset_name [COLLATE [=] collation_name]\n | DISCARD TABLESPACE\n | IMPORT TABLESPACE\n | FORCE\n | ADD PARTITION (partition_definition)\n | DROP PARTITION partition_names\n | TRUNCATE PARTITION {partition_names | ALL}\n | COALESCE PARTITION number\n | REORGANIZE PARTITION [partition_names INTO (partition_definitions)]\n | ANALYZE PARTITION {partition_names | ALL}\n | CHECK PARTITION {partition_names | ALL}\n | OPTIMIZE PARTITION {partition_names | ALL}\n | REBUILD PARTITION {partition_names | ALL}\n | REPAIR PARTITION {partition_names | ALL}\n | PARTITION BY partitioning_expression\n | REMOVE PARTITIONING\n\nindex_col_name:\n col_name [(length)] [ASC | DESC]\n\nindex_type:\n USING {BTREE | HASH}\n\nindex_option:\n KEY_BLOCK_SIZE [=] value\n | index_type\n | WITH PARSER parser_name\n | COMMENT \'string\'\n\ntable_options:\n table_option [[,] table_option] ... (see CREATE TABLE options)\n\npartition_options:\n (see CREATE TABLE options)\n\nALTER TABLE changes the structure of a table. For example, you can add\nor delete columns, create or destroy indexes, change the type of\nexisting columns, or rename columns or the table itself. You can also\nchange characteristics such as the storage engine used for the table or\nthe table comment.\n\nPartitioning-related clauses for ALTER TABLE can be used with\npartitioned tables for repartitioning, for adding, dropping, merging,\nand splitting partitions, and for performing partitioning maintenance.\nFor more information, see\nhttp://dev.mysql.com/doc/refman/5.5/en/alter-table-partition-operations\n.html.\n\nFollowing the table name, specify the alterations to be made. If none\nare given, ALTER TABLE does nothing.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/alter-table.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/alter-table.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (464,32,'MPOINTFROMWKB','MPointFromWKB(wkb[,srid]), MultiPointFromWKB(wkb[,srid])\n\nConstructs a MULTIPOINT value using its WKB representation and SRID.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/creating-spatial-values.html#gis-wkb-functions\n\n','','http://dev.mysql.com/doc/refman/5.5/en/creating-spatial-values.html#gis-wkb-functions'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (465,22,'CHAR BYTE','The CHAR BYTE data type is an alias for the BINARY data type. This is a\ncompatibility feature.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/string-type-overview.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (466,20,'REPAIR TABLE','Syntax:\nREPAIR [NO_WRITE_TO_BINLOG | LOCAL] TABLE\n tbl_name [, tbl_name] ...\n [QUICK] [EXTENDED] [USE_FRM]\n\nREPAIR TABLE repairs a possibly corrupted table. By default, it has the\nsame effect as myisamchk --recover tbl_name. REPAIR TABLE works for\nMyISAM, ARCHIVE, and CSV tables. See\nhttp://dev.mysql.com/doc/refman/5.5/en/myisam-storage-engine.html, and\nhttp://dev.mysql.com/doc/refman/5.5/en/archive-storage-engine.html, and\nhttp://dev.mysql.com/doc/refman/5.5/en/csv-storage-engine.html\n\nThis statement requires SELECT and INSERT privileges for the table.\n\nREPAIR TABLE is supported for partitioned tables. However, the USE_FRM\noption cannot be used with this statement on a partitioned table.\n\nYou can use ALTER TABLE ... REPAIR PARTITION to repair one or more\npartitions; for more information, see [HELP ALTER TABLE], and\nhttp://dev.mysql.com/doc/refman/5.5/en/partitioning-maintenance.html.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/repair-table.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/repair-table.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (467,39,'MERGE','The MERGE storage engine, also known as the MRG_MyISAM engine, is a\ncollection of identical MyISAM tables that can be used as one.\n"Identical" means that all tables have identical column and index\ninformation. You cannot merge MyISAM tables in which the columns are\nlisted in a different order, do not have exactly the same columns, or\nhave the indexes in different order. However, any or all of the MyISAM\ntables can be compressed with myisampack. See\nhttp://dev.mysql.com/doc/refman/5.5/en/myisampack.html. Differences in\ntable options such as AVG_ROW_LENGTH, MAX_ROWS, or PACK_KEYS do not\nmatter.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/merge-storage-engine.html\n\n','mysql> CREATE TABLE t1 (\n -> a INT NOT NULL AUTO_INCREMENT PRIMARY KEY,\n -> message CHAR(20)) ENGINE=MyISAM;\nmysql> CREATE TABLE t2 (\n -> a INT NOT NULL AUTO_INCREMENT PRIMARY KEY,\n -> message CHAR(20)) ENGINE=MyISAM;\nmysql> INSERT INTO t1 (message) VALUES (\'Testing\'),(\'table\'),(\'t1\');\nmysql> INSERT INTO t2 (message) VALUES (\'Testing\'),(\'table\'),(\'t2\');\nmysql> CREATE TABLE total (\n -> a INT NOT NULL AUTO_INCREMENT,\n -> message CHAR(20), INDEX(a))\n -> ENGINE=MERGE UNION=(t1,t2) INSERT_METHOD=LAST;\n','http://dev.mysql.com/doc/refman/5.5/en/merge-storage-engine.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (468,39,'CREATE TABLE','Syntax:\nCREATE [TEMPORARY] TABLE [IF NOT EXISTS] tbl_name\n (create_definition,...)\n [table_options]\n [partition_options]\n\nOr:\n\nCREATE [TEMPORARY] TABLE [IF NOT EXISTS] tbl_name\n [(create_definition,...)]\n [table_options]\n [partition_options]\n select_statement\n\nOr:\n\nCREATE [TEMPORARY] TABLE [IF NOT EXISTS] tbl_name\n { LIKE old_tbl_name | (LIKE old_tbl_name) }\n\ncreate_definition:\n col_name column_definition\n | [CONSTRAINT [symbol]] PRIMARY KEY [index_type] (index_col_name,...)\n [index_option] ...\n | {INDEX|KEY} [index_name] [index_type] (index_col_name,...)\n [index_option] ...\n | [CONSTRAINT [symbol]] UNIQUE [INDEX|KEY]\n [index_name] [index_type] (index_col_name,...)\n [index_option] ...\n | {FULLTEXT|SPATIAL} [INDEX|KEY] [index_name] (index_col_name,...)\n [index_option] ...\n | [CONSTRAINT [symbol]] FOREIGN KEY\n [index_name] (index_col_name,...) reference_definition\n | CHECK (expr)\n\ncolumn_definition:\n data_type [NOT NULL | NULL] [DEFAULT default_value]\n [AUTO_INCREMENT] [UNIQUE [KEY] | [PRIMARY] KEY]\n [COMMENT \'string\']\n [COLUMN_FORMAT {FIXED|DYNAMIC|DEFAULT}]\n [STORAGE {DISK|MEMORY|DEFAULT}]\n [reference_definition]\n\ndata_type:\n BIT[(length)]\n | TINYINT[(length)] [UNSIGNED] [ZEROFILL]\n | SMALLINT[(length)] [UNSIGNED] [ZEROFILL]\n | MEDIUMINT[(length)] [UNSIGNED] [ZEROFILL]\n | INT[(length)] [UNSIGNED] [ZEROFILL]\n | INTEGER[(length)] [UNSIGNED] [ZEROFILL]\n | BIGINT[(length)] [UNSIGNED] [ZEROFILL]\n | REAL[(length,decimals)] [UNSIGNED] [ZEROFILL]\n | DOUBLE[(length,decimals)] [UNSIGNED] [ZEROFILL]\n | FLOAT[(length,decimals)] [UNSIGNED] [ZEROFILL]\n | DECIMAL[(length[,decimals])] [UNSIGNED] [ZEROFILL]\n | NUMERIC[(length[,decimals])] [UNSIGNED] [ZEROFILL]\n | DATE\n | TIME\n | TIMESTAMP\n | DATETIME\n | YEAR\n | CHAR[(length)]\n [CHARACTER SET charset_name] [COLLATE collation_name]\n | VARCHAR(length)\n [CHARACTER SET charset_name] [COLLATE collation_name]\n | BINARY[(length)]\n | VARBINARY(length)\n | TINYBLOB\n | BLOB\n | MEDIUMBLOB\n | LONGBLOB\n | TINYTEXT [BINARY]\n [CHARACTER SET charset_name] [COLLATE collation_name]\n | TEXT [BINARY]\n [CHARACTER SET charset_name] [COLLATE collation_name]\n | MEDIUMTEXT [BINARY]\n [CHARACTER SET charset_name] [COLLATE collation_name]\n | LONGTEXT [BINARY]\n [CHARACTER SET charset_name] [COLLATE collation_name]\n | ENUM(value1,value2,value3,...)\n [CHARACTER SET charset_name] [COLLATE collation_name]\n | SET(value1,value2,value3,...)\n [CHARACTER SET charset_name] [COLLATE collation_name]\n | spatial_type\n\nindex_col_name:\n col_name [(length)] [ASC | DESC]\n\nindex_type:\n USING {BTREE | HASH}\n\nindex_option:\n KEY_BLOCK_SIZE [=] value\n | index_type\n | WITH PARSER parser_name\n | COMMENT \'string\'\n\nreference_definition:\n REFERENCES tbl_name (index_col_name,...)\n [MATCH FULL | MATCH PARTIAL | MATCH SIMPLE]\n [ON DELETE reference_option]\n [ON UPDATE reference_option]\n\nreference_option:\n RESTRICT | CASCADE | SET NULL | NO ACTION\n\ntable_options:\n table_option [[,] table_option] ...\n\ntable_option:\n ENGINE [=] engine_name\n | AUTO_INCREMENT [=] value\n | AVG_ROW_LENGTH [=] value\n | [DEFAULT] CHARACTER SET [=] charset_name\n | CHECKSUM [=] {0 | 1}\n | [DEFAULT] COLLATE [=] collation_name\n | COMMENT [=] \'string\'\n | CONNECTION [=] \'connect_string\'\n | DATA DIRECTORY [=] \'absolute path to directory\'\n | DELAY_KEY_WRITE [=] {0 | 1}\n | INDEX DIRECTORY [=] \'absolute path to directory\'\n | INSERT_METHOD [=] { NO | FIRST | LAST }\n | KEY_BLOCK_SIZE [=] value\n | MAX_ROWS [=] value\n | MIN_ROWS [=] value\n | PACK_KEYS [=] {0 | 1 | DEFAULT}\n | PASSWORD [=] \'string\'\n | ROW_FORMAT [=] {DEFAULT|DYNAMIC|FIXED|COMPRESSED|REDUNDANT|COMPACT}\n | TABLESPACE tablespace_name [STORAGE {DISK|MEMORY|DEFAULT}]\n | UNION [=] (tbl_name[,tbl_name]...)\n\npartition_options:\n PARTITION BY\n { [LINEAR] HASH(expr)\n | [LINEAR] KEY(column_list)\n | RANGE{(expr) | COLUMNS(column_list)}\n | LIST{(expr) | COLUMNS(column_list)} }\n [PARTITIONS num]\n [SUBPARTITION BY\n { [LINEAR] HASH(expr)\n | [LINEAR] KEY(column_list) }\n [SUBPARTITIONS num]\n ]\n [(partition_definition [, partition_definition] ...)]\n\npartition_definition:\n PARTITION partition_name\n [VALUES \n {LESS THAN {(expr | value_list) | MAXVALUE} \n | \n IN (value_list)}]\n [[STORAGE] ENGINE [=] engine_name]\n [COMMENT [=] \'comment_text\' ]\n [DATA DIRECTORY [=] \'data_dir\']\n [INDEX DIRECTORY [=] \'index_dir\']\n [MAX_ROWS [=] max_number_of_rows]\n [MIN_ROWS [=] min_number_of_rows]\n [TABLESPACE [=] tablespace_name]\n [NODEGROUP [=] node_group_id]\n [(subpartition_definition [, subpartition_definition] ...)]\n\nsubpartition_definition:\n SUBPARTITION logical_name\n [[STORAGE] ENGINE [=] engine_name]\n [COMMENT [=] \'comment_text\' ]\n [DATA DIRECTORY [=] \'data_dir\']\n [INDEX DIRECTORY [=] \'index_dir\']\n [MAX_ROWS [=] max_number_of_rows]\n [MIN_ROWS [=] min_number_of_rows]\n [TABLESPACE [=] tablespace_name]\n [NODEGROUP [=] node_group_id]\n\nselect_statement:\n [IGNORE | REPLACE] [AS] SELECT ... (Some valid select statement)\n\nCREATE TABLE creates a table with the given name. You must have the\nCREATE privilege for the table.\n\nRules for permissible table names are given in\nhttp://dev.mysql.com/doc/refman/5.5/en/identifiers.html. By default,\nthe table is created in the default database, using the InnoDB storage\nengine. An error occurs if the table exists, if there is no default\ndatabase, or if the database does not exist.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/create-table.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/create-table.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (469,18,'>','Syntax:\n>\n\nGreater than:\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/comparison-operators.html\n\n','mysql> SELECT 2 > 2;\n -> 0\n','http://dev.mysql.com/doc/refman/5.5/en/comparison-operators.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (470,20,'ANALYZE TABLE','Syntax:\nANALYZE [NO_WRITE_TO_BINLOG | LOCAL] TABLE\n tbl_name [, tbl_name] ...\n\nANALYZE TABLE analyzes and stores the key distribution for a table.\nDuring the analysis, the table is locked with a read lock for InnoDB\nand MyISAM. This statement works with InnoDB, NDB, and MyISAM tables.\nFor MyISAM tables, this statement is equivalent to using myisamchk\n--analyze.\n\nFor more information on how the analysis works within InnoDB, see\nhttp://dev.mysql.com/doc/refman/5.5/en/innodb-restrictions.html.\n\nMySQL uses the stored key distribution to decide the order in which\ntables should be joined when you perform a join on something other than\na constant. In addition, key distributions can be used when deciding\nwhich indexes to use for a specific table within a query.\n\nThis statement requires SELECT and INSERT privileges for the table.\n\nANALYZE TABLE is supported for partitioned tables, and you can use\nALTER TABLE ... ANALYZE PARTITION to analyze one or more partitions;\nfor more information, see [HELP ALTER TABLE], and\nhttp://dev.mysql.com/doc/refman/5.5/en/partitioning-maintenance.html.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/analyze-table.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/analyze-table.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (471,31,'MICROSECOND','Syntax:\nMICROSECOND(expr)\n\nReturns the microseconds from the time or datetime expression expr as a\nnumber in the range from 0 to 999999.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html\n\n','mysql> SELECT MICROSECOND(\'12:00:00.123456\');\n -> 123456\nmysql> SELECT MICROSECOND(\'2009-12-31 23:59:59.000010\');\n -> 10\n','http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (472,39,'CONSTRAINT','InnoDB supports foreign keys, which let you cross-reference related\ndata across tables, and foreign key constraints, which help keep this\nspread-out data consistent. The syntax for an InnoDB foreign key\nconstraint definition in the CREATE TABLE or ALTER TABLE statement\nlooks like this:\n\n[CONSTRAINT [symbol]] FOREIGN KEY\n [index_name] (index_col_name, ...)\n REFERENCES tbl_name (index_col_name,...)\n [ON DELETE reference_option]\n [ON UPDATE reference_option]\n\nreference_option:\n RESTRICT | CASCADE | SET NULL | NO ACTION\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/innodb-foreign-key-constraints.html\n\n','CREATE TABLE product (category INT NOT NULL, id INT NOT NULL,\n price DECIMAL,\n PRIMARY KEY(category, id)) ENGINE=INNODB;\nCREATE TABLE customer (id INT NOT NULL,\n PRIMARY KEY (id)) ENGINE=INNODB;\nCREATE TABLE product_order (no INT NOT NULL AUTO_INCREMENT,\n product_category INT NOT NULL,\n product_id INT NOT NULL,\n customer_id INT NOT NULL,\n PRIMARY KEY(no),\n INDEX (product_category, product_id),\n FOREIGN KEY (product_category, product_id)\n REFERENCES product(category, id)\n ON UPDATE CASCADE ON DELETE RESTRICT,\n INDEX (customer_id),\n FOREIGN KEY (customer_id)\n REFERENCES customer(id)) ENGINE=INNODB;\n','http://dev.mysql.com/doc/refman/5.5/en/innodb-foreign-key-constraints.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (473,39,'CREATE SERVER','Syntax:\nCREATE SERVER server_name\n FOREIGN DATA WRAPPER wrapper_name\n OPTIONS (option [, option] ...)\n\noption:\n { HOST character-literal\n | DATABASE character-literal\n | USER character-literal\n | PASSWORD character-literal\n | SOCKET character-literal\n | OWNER character-literal\n | PORT numeric-literal }\n\nThis statement creates the definition of a server for use with the\nFEDERATED storage engine. The CREATE SERVER statement creates a new row\nwithin the servers table within the mysql database. This statement\nrequires the SUPER privilege.\n\nThe server_name should be a unique reference to the server. Server\ndefinitions are global within the scope of the server, it is not\npossible to qualify the server definition to a specific database.\nserver_name has a maximum length of 64 characters (names longer than 64\ncharacters are silently truncated), and is case insensitive. You may\nspecify the name as a quoted string.\n\nThe wrapper_name should be mysql, and may be quoted with single\nquotation marks. Other values for wrapper_name are not currently\nsupported.\n\nFor each option you must specify either a character literal or numeric\nliteral. Character literals are UTF-8, support a maximum length of 64\ncharacters and default to a blank (empty) string. String literals are\nsilently truncated to 64 characters. Numeric literals must be a number\nbetween 0 and 9999, default value is 0.\n\n*Note*: Note that the OWNER option is currently not applied, and has no\neffect on the ownership or operation of the server connection that is\ncreated.\n\nThe CREATE SERVER statement creates an entry in the mysql.servers table\nthat can later be used with the CREATE TABLE statement when creating a\nFEDERATED table. The options that you specify will be used to populate\nthe columns in the mysql.servers table. The table columns are\nServer_name, Host, Db, Username, Password, Port and Socket.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/create-server.html\n\n','CREATE SERVER s\nFOREIGN DATA WRAPPER mysql\nOPTIONS (USER \'Remote\', HOST \'192.168.1.106\', DATABASE \'test\');\n','http://dev.mysql.com/doc/refman/5.5/en/create-server.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (474,37,'FIELD','Syntax:\nFIELD(str,str1,str2,str3,...)\n\nReturns the index (position) of str in the str1, str2, str3, ... list.\nReturns 0 if str is not found.\n\nIf all arguments to FIELD() are strings, all arguments are compared as\nstrings. If all arguments are numbers, they are compared as numbers.\nOtherwise, the arguments are compared as double.\n\nIf str is NULL, the return value is 0 because NULL fails equality\ncomparison with any value. FIELD() is the complement of ELT().\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/string-functions.html\n\n','mysql> SELECT FIELD(\'ej\', \'Hej\', \'ej\', \'Heja\', \'hej\', \'foo\');\n -> 2\nmysql> SELECT FIELD(\'fo\', \'Hej\', \'ej\', \'Heja\', \'hej\', \'foo\');\n -> 0\n','http://dev.mysql.com/doc/refman/5.5/en/string-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (475,31,'MAKETIME','Syntax:\nMAKETIME(hour,minute,second)\n\nReturns a time value calculated from the hour, minute, and second\narguments.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html\n\n','mysql> SELECT MAKETIME(12,15,30);\n -> \'12:15:30\'\n','http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (476,31,'CURDATE','Syntax:\nCURDATE()\n\nReturns the current date as a value in \'YYYY-MM-DD\' or YYYYMMDD format,\ndepending on whether the function is used in a string or numeric\ncontext.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html\n\n','mysql> SELECT CURDATE();\n -> \'2008-06-13\'\nmysql> SELECT CURDATE() + 0;\n -> 20080613\n','http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (477,10,'SET PASSWORD','Syntax:\nSET PASSWORD [FOR user] =\n {\n PASSWORD(\'cleartext password\')\n | OLD_PASSWORD(\'cleartext password\')\n | \'encrypted password\'\n }\n\nThe SET PASSWORD statement assigns a password to an existing MySQL user\naccount. When the read_only system variable is enabled, the SUPER\nprivilege is required to use SET PASSWORD, in addition to whatever\nother privileges might be required.\n\nIf the password is specified using the PASSWORD() or OLD_PASSWORD()\nfunction, the cleartext (unencrypted) password should be given as the\nargument to the function, which hashes the password and returns the\nencrypted password string. If the password is specified without using\neither function, it should be the already encrypted password value as a\nliteral string. In all cases, the encrypted password string must be in\nthe format required by the authentication method used for the account.\n\nThe old_passwords system variable value determines the hashing method\nused by PASSWORD(). If you specify the password using that function and\nSET PASSWORD rejects the password as not being in the correct format,\nit may be necessary to set old_passwords to change the hashing method.\nFor descriptions of the permitted values, see\nhttp://dev.mysql.com/doc/refman/5.5/en/server-system-variables.html.\n\nWith no FOR user clause, this statement sets the password for the\ncurrent user. (To see which account the server authenticated you as,\ninvoke the CURRENT_USER() function.) Any client who successfully\nconnects to the server using a nonanonymous account can change the\npassword for that account.\n\nWith a FOR user clause, this statement sets the password for the named\nuser. You must have the UPDATE privilege for the mysql database to do\nthis. The user account name uses the format described in\nhttp://dev.mysql.com/doc/refman/5.5/en/account-names.html. The user\nvalue should be given as \'user_name\'@\'host_name\', where \'user_name\' and\n\'host_name\' are exactly as listed in the User and Host columns of the\nmysql.user table row. (If you specify only a user name, a host name of\n\'%\' is used.) For example, to set the password for an account with User\nand Host column values of \'bob\' and \'%.example.org\', write the\nstatement like this:\n\nSET PASSWORD FOR \'bob\'@\'%.example.org\' = PASSWORD(\'cleartext password\');\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/set-password.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/set-password.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (478,39,'ALTER TABLESPACE','Syntax:\nALTER TABLESPACE tablespace_name\n {ADD|DROP} DATAFILE \'file_name\'\n [INITIAL_SIZE [=] size]\n [WAIT]\n ENGINE [=] engine_name\n\nThis statement can be used either to add a new data file, or to drop a\ndata file from a tablespace.\n\nThe ADD DATAFILE variant enables you to specify an initial size using\nan INITIAL_SIZE clause, where size is measured in bytes; the default\nvalue is 128M (128 megabytes). You may optionally follow this integer\nvalue with a one-letter abbreviation for an order of magnitude, similar\nto those used in my.cnf. Generally, this is one of the letters M (for\nmegabytes) or G (for gigabytes).\n\n*Note*: All MySQL Cluster Disk Data objects share the same namespace.\nThis means that each Disk Data object must be uniquely named (and not\nmerely each Disk Data object of a given type). For example, you cannot\nhave a tablespace and an data file with the same name, or an undo log\nfile and a tablespace with the same name.\n\nOn 32-bit systems, the maximum supported value for INITIAL_SIZE is 4G.\n(Bug #29186)\n\nINITIAL_SIZE is rounded, explicitly, as for CREATE TABLESPACE.\n\nOnce a data file has been created, its size cannot be changed; however,\nyou can add more data files to the tablespace using additional ALTER\nTABLESPACE ... ADD DATAFILE statements.\n\nUsing DROP DATAFILE with ALTER TABLESPACE drops the data file\n\'file_name\' from the tablespace. You cannot drop a data file from a\ntablespace which is in use by any table; in other words, the data file\nmust be empty (no extents used). See\nhttp://dev.mysql.com/doc/refman/5.5/en/mysql-cluster-disk-data-objects.\nhtml. In addition, any data file to be dropped must previously have\nbeen added to the tablespace with CREATE TABLESPACE or ALTER\nTABLESPACE.\n\nBoth ALTER TABLESPACE ... ADD DATAFILE and ALTER TABLESPACE ... DROP\nDATAFILE require an ENGINE clause which specifies the storage engine\nused by the tablespace. Currently, the only accepted values for\nengine_name are NDB and NDBCLUSTER.\n\nWAIT is parsed but otherwise ignored, and so has no effect in MySQL\n5.5. It is intended for future expansion.\n\nWhen ALTER TABLESPACE ... ADD DATAFILE is used with ENGINE = NDB, a\ndata file is created on each Cluster data node. You can verify that the\ndata files were created and obtain information about them by querying\nthe INFORMATION_SCHEMA.FILES table. For example, the following query\nshows all data files belonging to the tablespace named newts:\n\nmysql> SELECT LOGFILE_GROUP_NAME, FILE_NAME, EXTRA\n -> FROM INFORMATION_SCHEMA.FILES\n -> WHERE TABLESPACE_NAME = \'newts\' AND FILE_TYPE = \'DATAFILE\';\n+--------------------+--------------+----------------+\n| LOGFILE_GROUP_NAME | FILE_NAME | EXTRA |\n+--------------------+--------------+----------------+\n| lg_3 | newdata.dat | CLUSTER_NODE=3 |\n| lg_3 | newdata.dat | CLUSTER_NODE=4 |\n| lg_3 | newdata2.dat | CLUSTER_NODE=3 |\n| lg_3 | newdata2.dat | CLUSTER_NODE=4 |\n+--------------------+--------------+----------------+\n2 rows in set (0.03 sec)\n\nSee http://dev.mysql.com/doc/refman/5.5/en/files-table.html.\n\nALTER TABLESPACE is useful only with Disk Data storage for MySQL\nCluster. See\nhttp://dev.mysql.com/doc/refman/5.5/en/mysql-cluster-disk-data.html.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/alter-tablespace.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/alter-tablespace.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (479,7,'IF FUNCTION','Syntax:\nIF(expr1,expr2,expr3)\n\nIf expr1 is TRUE (expr1 <> 0 and expr1 <> NULL) then IF() returns\nexpr2; otherwise it returns expr3. IF() returns a numeric or string\nvalue, depending on the context in which it is used.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/control-flow-functions.html\n\n','mysql> SELECT IF(1>2,2,3);\n -> 3\nmysql> SELECT IF(1<2,\'yes\',\'no\');\n -> \'yes\'\nmysql> SELECT IF(STRCMP(\'test\',\'test1\'),\'no\',\'yes\');\n -> \'no\'\n','http://dev.mysql.com/doc/refman/5.5/en/control-flow-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (480,22,'ENUM','ENUM(\'value1\',\'value2\',...) [CHARACTER SET charset_name] [COLLATE\ncollation_name]\n\nAn enumeration. A string object that can have only one value, chosen\nfrom the list of values \'value1\', \'value2\', ..., NULL or the special \'\'\nerror value. An ENUM column can have a maximum of 65,535 distinct\nvalues. ENUM values are represented internally as integers.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/string-type-overview.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (481,17,'DATABASE','Syntax:\nDATABASE()\n\nReturns the default (current) database name as a string in the utf8\ncharacter set. If there is no default database, DATABASE() returns\nNULL. Within a stored routine, the default database is the database\nthat the routine is associated with, which is not necessarily the same\nas the database that is the default in the calling context.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/information-functions.html\n\n','mysql> SELECT DATABASE();\n -> \'test\'\n','http://dev.mysql.com/doc/refman/5.5/en/information-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (482,32,'POINTFROMWKB','PointFromWKB(wkb[,srid])\n\nConstructs a POINT value using its WKB representation and SRID.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/creating-spatial-values.html#gis-wkb-functions\n\n','','http://dev.mysql.com/doc/refman/5.5/en/creating-spatial-values.html#gis-wkb-functions'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (483,4,'POWER','Syntax:\nPOWER(X,Y)\n\nThis is a synonym for POW().\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/mathematical-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/mathematical-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (484,4,'ATAN','Syntax:\nATAN(X)\n\nReturns the arc tangent of X, that is, the value whose tangent is X.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/mathematical-functions.html\n\n','mysql> SELECT ATAN(2);\n -> 1.1071487177941\nmysql> SELECT ATAN(-2);\n -> -1.1071487177941\n','http://dev.mysql.com/doc/refman/5.5/en/mathematical-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (485,37,'STRCMP','Syntax:\nSTRCMP(expr1,expr2)\n\nSTRCMP() returns 0 if the strings are the same, -1 if the first\nargument is smaller than the second according to the current sort\norder, and 1 otherwise.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/string-comparison-functions.html\n\n','mysql> SELECT STRCMP(\'text\', \'text2\');\n -> -1\nmysql> SELECT STRCMP(\'text2\', \'text\');\n -> 1\nmysql> SELECT STRCMP(\'text\', \'text\');\n -> 0\n','http://dev.mysql.com/doc/refman/5.5/en/string-comparison-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (486,27,'INSERT DELAYED','Syntax:\nINSERT DELAYED ...\n\nThe DELAYED option for the INSERT statement is a MySQL extension to\nstandard SQL that is very useful if you have clients that cannot or\nneed not wait for the INSERT to complete. This is a common situation\nwhen you use MySQL for logging and you also periodically run SELECT and\nUPDATE statements that take a long time to complete.\n\nWhen a client uses INSERT DELAYED, it gets an okay from the server at\nonce, and the row is queued to be inserted when the table is not in use\nby any other thread.\n\nAnother major benefit of using INSERT DELAYED is that inserts from many\nclients are bundled together and written in one block. This is much\nfaster than performing many separate inserts.\n\nNote that INSERT DELAYED is slower than a normal INSERT if the table is\nnot otherwise in use. There is also the additional overhead for the\nserver to handle a separate thread for each table for which there are\ndelayed rows. This means that you should use INSERT DELAYED only when\nyou are really sure that you need it.\n\nThe queued rows are held only in memory until they are inserted into\nthe table. This means that if you terminate mysqld forcibly (for\nexample, with kill -9) or if mysqld dies unexpectedly, any queued rows\nthat have not been written to disk are lost.\n\nThere are some constraints on the use of DELAYED:\n\no INSERT DELAYED works only with MyISAM, MEMORY, ARCHIVE, and BLACKHOLE\n tables. For engines that do not support DELAYED, an error occurs.\n\no An error occurs for INSERT DELAYED if used with a table that has been\n locked with LOCK TABLES because the insert must be handled by a\n separate thread, not by the session that holds the lock.\n\no For MyISAM tables, if there are no free blocks in the middle of the\n data file, concurrent SELECT and INSERT statements are supported.\n Under these circumstances, you very seldom need to use INSERT DELAYED\n with MyISAM.\n\no INSERT DELAYED should be used only for INSERT statements that specify\n value lists. The server ignores DELAYED for INSERT ... SELECT or\n INSERT ... ON DUPLICATE KEY UPDATE statements.\n\no Because the INSERT DELAYED statement returns immediately, before the\n rows are inserted, you cannot use LAST_INSERT_ID() to get the\n AUTO_INCREMENT value that the statement might generate.\n\no DELAYED rows are not visible to SELECT statements until they actually\n have been inserted.\n\no Prior to MySQL 5.5.7, INSERT DELAYED was treated as a normal INSERT\n if the statement inserted multiple rows, binary logging was enabled,\n and the global logging format was statement-based (that is, whenever\n binlog_format was set to STATEMENT). Beginning with MySQL 5.5.7,\n INSERT DELAYED is always handled as a simple INSERT (that is, without\n the DELAYED option) whenever the value of binlog_format is STATEMENT\n or MIXED. (In the latter case, the statement no longer triggers a\n switch to row-based logging, and so is logged using the\n statement-based format.)\n\n This does not apply when using row-based binary logging mode\n (binlog_format set to ROW), in which INSERT DELAYED statements are\n always executed using the DELAYED option as specified, and logged as\n row-update events.\n\no DELAYED is ignored on slave replication servers, so that INSERT\n DELAYED is treated as a normal INSERT on slaves. This is because\n DELAYED could cause the slave to have different data than the master.\n\no Pending INSERT DELAYED statements are lost if a table is write locked\n and ALTER TABLE is used to modify the table structure.\n\no INSERT DELAYED is not supported for views.\n\no INSERT DELAYED is not supported for partitioned tables.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/insert-delayed.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/insert-delayed.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (487,26,'SHOW PROFILE','Syntax:\nSHOW PROFILE [type [, type] ... ]\n [FOR QUERY n]\n [LIMIT row_count [OFFSET offset]]\n\ntype:\n ALL\n | BLOCK IO\n | CONTEXT SWITCHES\n | CPU\n | IPC\n | MEMORY\n | PAGE FAULTS\n | SOURCE\n | SWAPS\n\nThe SHOW PROFILE and SHOW PROFILES statements display profiling\ninformation that indicates resource usage for statements executed\nduring the course of the current session.\n\nProfiling is controlled by the profiling session variable, which has a\ndefault value of 0 (OFF). Profiling is enabled by setting profiling to\n1 or ON:\n\nmysql> SET profiling = 1;\n\nSHOW PROFILES displays a list of the most recent statements sent to the\nserver. The size of the list is controlled by the\nprofiling_history_size session variable, which has a default value of\n15. The maximum value is 100. Setting the value to 0 has the practical\neffect of disabling profiling.\n\nAll statements are profiled except SHOW PROFILE and SHOW PROFILES, so\nyou will find neither of those statements in the profile list.\nMalformed statements are profiled. For example, SHOW PROFILING is an\nillegal statement, and a syntax error occurs if you try to execute it,\nbut it will show up in the profiling list.\n\nSHOW PROFILE displays detailed information about a single statement.\nWithout the FOR QUERY n clause, the output pertains to the most\nrecently executed statement. If FOR QUERY n is included, SHOW PROFILE\ndisplays information for statement n. The values of n correspond to the\nQuery_ID values displayed by SHOW PROFILES.\n\nThe LIMIT row_count clause may be given to limit the output to\nrow_count rows. If LIMIT is given, OFFSET offset may be added to begin\nthe output offset rows into the full set of rows.\n\nBy default, SHOW PROFILE displays Status and Duration columns. The\nStatus values are like the State values displayed by SHOW PROCESSLIST,\nalthough there might be some minor differences in interpretion for the\ntwo statements for some status values (see\nhttp://dev.mysql.com/doc/refman/5.5/en/thread-information.html).\n\nOptional type values may be specified to display specific additional\ntypes of information:\n\no ALL displays all information\n\no BLOCK IO displays counts for block input and output operations\n\no CONTEXT SWITCHES displays counts for voluntary and involuntary\n context switches\n\no CPU displays user and system CPU usage times\n\no IPC displays counts for messages sent and received\n\no MEMORY is not currently implemented\n\no PAGE FAULTS displays counts for major and minor page faults\n\no SOURCE displays the names of functions from the source code, together\n with the name and line number of the file in which the function\n occurs\n\no SWAPS displays swap counts\n\nProfiling is enabled per session. When a session ends, its profiling\ninformation is lost.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/show-profile.html\n\n','mysql> SELECT @@profiling;\n+-------------+\n| @@profiling |\n+-------------+\n| 0 |\n+-------------+\n1 row in set (0.00 sec)\n\nmysql> SET profiling = 1;\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> DROP TABLE IF EXISTS t1;\nQuery OK, 0 rows affected, 1 warning (0.00 sec)\n\nmysql> CREATE TABLE T1 (id INT);\nQuery OK, 0 rows affected (0.01 sec)\n\nmysql> SHOW PROFILES;\n+----------+----------+--------------------------+\n| Query_ID | Duration | Query |\n+----------+----------+--------------------------+\n| 0 | 0.000088 | SET PROFILING = 1 |\n| 1 | 0.000136 | DROP TABLE IF EXISTS t1 |\n| 2 | 0.011947 | CREATE TABLE t1 (id INT) |\n+----------+----------+--------------------------+\n3 rows in set (0.00 sec)\n\nmysql> SHOW PROFILE;\n+----------------------+----------+\n| Status | Duration |\n+----------------------+----------+\n| checking permissions | 0.000040 |\n| creating table | 0.000056 |\n| After create | 0.011363 |\n| query end | 0.000375 |\n| freeing items | 0.000089 |\n| logging slow query | 0.000019 |\n| cleaning up | 0.000005 |\n+----------------------+----------+\n7 rows in set (0.00 sec)\n\nmysql> SHOW PROFILE FOR QUERY 1;\n+--------------------+----------+\n| Status | Duration |\n+--------------------+----------+\n| query end | 0.000107 |\n| freeing items | 0.000008 |\n| logging slow query | 0.000015 |\n| cleaning up | 0.000006 |\n+--------------------+----------+\n4 rows in set (0.00 sec)\n\nmysql> SHOW PROFILE CPU FOR QUERY 2;\n+----------------------+----------+----------+------------+\n| Status | Duration | CPU_user | CPU_system |\n+----------------------+----------+----------+------------+\n| checking permissions | 0.000040 | 0.000038 | 0.000002 |\n| creating table | 0.000056 | 0.000028 | 0.000028 |\n| After create | 0.011363 | 0.000217 | 0.001571 |\n| query end | 0.000375 | 0.000013 | 0.000028 |\n| freeing items | 0.000089 | 0.000010 | 0.000014 |\n| logging slow query | 0.000019 | 0.000009 | 0.000010 |\n| cleaning up | 0.000005 | 0.000003 | 0.000002 |\n+----------------------+----------+----------+------------+\n7 rows in set (0.00 sec)\n','http://dev.mysql.com/doc/refman/5.5/en/show-profile.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (488,26,'SHOW PROCEDURE CODE','Syntax:\nSHOW PROCEDURE CODE proc_name\n\nThis statement is a MySQL extension that is available only for servers\nthat have been built with debugging support. It displays a\nrepresentation of the internal implementation of the named stored\nprocedure. A similar statement, SHOW FUNCTION CODE, displays\ninformation about stored functions (see [HELP SHOW FUNCTION CODE]).\n\nBoth statements require that you be the owner of the routine or have\nSELECT access to the mysql.proc table.\n\nIf the named routine is available, each statement produces a result\nset. Each row in the result set corresponds to one "instruction" in the\nroutine. The first column is Pos, which is an ordinal number beginning\nwith 0. The second column is Instruction, which contains an SQL\nstatement (usually changed from the original source), or a directive\nwhich has meaning only to the stored-routine handler.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/show-procedure-code.html\n\n','mysql> DELIMITER //\nmysql> CREATE PROCEDURE p1 ()\n -> BEGIN\n -> DECLARE fanta INT DEFAULT 55;\n -> DROP TABLE t2;\n -> LOOP\n -> INSERT INTO t3 VALUES (fanta);\n -> END LOOP;\n -> END//\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql> SHOW PROCEDURE CODE p1//\n+-----+----------------------------------------+\n| Pos | Instruction |\n+-----+----------------------------------------+\n| 0 | set fanta@0 55 |\n| 1 | stmt 9 "DROP TABLE t2" |\n| 2 | stmt 5 "INSERT INTO t3 VALUES (fanta)" |\n| 3 | jump 2 |\n+-----+----------------------------------------+\n4 rows in set (0.00 sec)\n','http://dev.mysql.com/doc/refman/5.5/en/show-procedure-code.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (489,22,'MEDIUMTEXT','MEDIUMTEXT [CHARACTER SET charset_name] [COLLATE collation_name]\n\nA TEXT column with a maximum length of 16,777,215 (224 - 1) characters.\nThe effective maximum length is less if the value contains multi-byte\ncharacters. Each MEDIUMTEXT value is stored using a 3-byte length\nprefix that indicates the number of bytes in the value.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/string-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/string-type-overview.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (490,4,'LN','Syntax:\nLN(X)\n\nReturns the natural logarithm of X; that is, the base-e logarithm of X.\nIf X is less than or equal to 0, then NULL is returned.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/mathematical-functions.html\n\n','mysql> SELECT LN(2);\n -> 0.69314718055995\nmysql> SELECT LN(-2);\n -> NULL\n','http://dev.mysql.com/doc/refman/5.5/en/mathematical-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (491,23,'RETURN','Syntax:\nRETURN expr\n\nThe RETURN statement terminates execution of a stored function and\nreturns the value expr to the function caller. There must be at least\none RETURN statement in a stored function. There may be more than one\nif the function has multiple exit points.\n\nThis statement is not used in stored procedures, triggers, or events.\nThe LEAVE statement can be used to exit a stored program of those\ntypes.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/return.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/return.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (492,26,'SHOW COLLATION','Syntax:\nSHOW COLLATION\n [LIKE \'pattern\' | WHERE expr]\n\nThis statement lists collations supported by the server. By default,\nthe output from SHOW COLLATION includes all available collations. The\nLIKE clause, if present, indicates which collation names to match. The\nWHERE clause can be given to select rows using more general conditions,\nas discussed in\nhttp://dev.mysql.com/doc/refman/5.5/en/extended-show.html. For example:\n\nmysql> SHOW COLLATION LIKE \'latin1%\';\n+-------------------+---------+----+---------+----------+---------+\n| Collation | Charset | Id | Default | Compiled | Sortlen |\n+-------------------+---------+----+---------+----------+---------+\n| latin1_german1_ci | latin1 | 5 | | | 0 |\n| latin1_swedish_ci | latin1 | 8 | Yes | Yes | 0 |\n| latin1_danish_ci | latin1 | 15 | | | 0 |\n| latin1_german2_ci | latin1 | 31 | | Yes | 2 |\n| latin1_bin | latin1 | 47 | | Yes | 0 |\n| latin1_general_ci | latin1 | 48 | | | 0 |\n| latin1_general_cs | latin1 | 49 | | | 0 |\n| latin1_spanish_ci | latin1 | 94 | | | 0 |\n+-------------------+---------+----+---------+----------+---------+\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/show-collation.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/show-collation.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (493,4,'LOG','Syntax:\nLOG(X), LOG(B,X)\n\nIf called with one parameter, this function returns the natural\nlogarithm of X. If X is less than or equal to 0, then NULL is returned.\n\nThe inverse of this function (when called with a single argument) is\nthe EXP() function.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/mathematical-functions.html\n\n','mysql> SELECT LOG(2);\n -> 0.69314718055995\nmysql> SELECT LOG(-2);\n -> NULL\n','http://dev.mysql.com/doc/refman/5.5/en/mathematical-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (494,8,'SET SQL_LOG_BIN','Syntax:\nSET sql_log_bin = {0|1}\n\nThe sql_log_bin variable controls whether logging to the binary log is\ndone. The default value is 1 (do logging). To change logging for the\ncurrent session, change the session value of this variable. The session\nuser must have the SUPER privilege to set this variable.\n\nBeginning with MySQL 5.5.5, it is no longer possible to set\n@@session.sql_log_bin within a transaction or subquery. (Bug #53437)\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/set-sql-log-bin.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/set-sql-log-bin.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (495,18,'!=','Syntax:\n<>, !=\n\nNot equal:\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/comparison-operators.html\n\n','mysql> SELECT \'.01\' <> \'0.01\';\n -> 1\nmysql> SELECT .01 <> \'0.01\';\n -> 0\nmysql> SELECT \'zapp\' <> \'zappp\';\n -> 1\n','http://dev.mysql.com/doc/refman/5.5/en/comparison-operators.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (496,23,'WHILE','Syntax:\n[begin_label:] WHILE search_condition DO\n statement_list\nEND WHILE [end_label]\n\nThe statement list within a WHILE statement is repeated as long as the\nsearch_condition expression is true. statement_list consists of one or\nmore SQL statements, each terminated by a semicolon (;) statement\ndelimiter.\n\nA WHILE statement can be labeled. For the rules regarding label use,\nsee [HELP labels].\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/while.html\n\n','CREATE PROCEDURE dowhile()\nBEGIN\n DECLARE v1 INT DEFAULT 5;\n\n WHILE v1 > 0 DO\n ...\n SET v1 = v1 - 1;\n END WHILE;\nEND;\n','http://dev.mysql.com/doc/refman/5.5/en/while.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (497,12,'AES_DECRYPT','Syntax:\nAES_DECRYPT(crypt_str,key_str)\n\nThis function decrypts data using the official AES (Advanced Encryption\nStandard) algorithm. For more information, see the description of\nAES_ENCRYPT().\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/encryption-functions.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/encryption-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (498,31,'DAYNAME','Syntax:\nDAYNAME(date)\n\nReturns the name of the weekday for date. The language used for the\nname is controlled by the value of the lc_time_names system variable\n(http://dev.mysql.com/doc/refman/5.5/en/locale-support.html).\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html\n\n','mysql> SELECT DAYNAME(\'2007-02-03\');\n -> \'Saturday\'\n','http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (499,17,'COERCIBILITY','Syntax:\nCOERCIBILITY(str)\n\nReturns the collation coercibility value of the string argument.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/information-functions.html\n\n','mysql> SELECT COERCIBILITY(\'abc\' COLLATE latin1_swedish_ci);\n -> 0\nmysql> SELECT COERCIBILITY(USER());\n -> 3\nmysql> SELECT COERCIBILITY(\'abc\');\n -> 4\n','http://dev.mysql.com/doc/refman/5.5/en/information-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (500,22,'INT','INT[(M)] [UNSIGNED] [ZEROFILL]\n\nA normal-size integer. The signed range is -2147483648 to 2147483647.\nThe unsigned range is 0 to 4294967295.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/numeric-type-overview.html\n\n','','http://dev.mysql.com/doc/refman/5.5/en/numeric-type-overview.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (501,13,'GLENGTH','GLength(ls)\n\nReturns as a double-precision number the length of the LineString value\nls in its associated spatial reference.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/geometry-property-functions.html#linestring-property-functions\n\n','mysql> SET @ls = \'LineString(1 1,2 2,3 3)\';\nmysql> SELECT GLength(GeomFromText(@ls));\n+----------------------------+\n| GLength(GeomFromText(@ls)) |\n+----------------------------+\n| 2.8284271247462 |\n+----------------------------+\n','http://dev.mysql.com/doc/refman/5.5/en/geometry-property-functions.html#linestring-property-functions'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (502,4,'RADIANS','Syntax:\nRADIANS(X)\n\nReturns the argument X, converted from degrees to radians. (Note that\nπ radians equals 180 degrees.)\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/mathematical-functions.html\n\n','mysql> SELECT RADIANS(90);\n -> 1.5707963267949\n','http://dev.mysql.com/doc/refman/5.5/en/mathematical-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (503,17,'COLLATION','Syntax:\nCOLLATION(str)\n\nReturns the collation of the string argument.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/information-functions.html\n\n','mysql> SELECT COLLATION(\'abc\');\n -> \'latin1_swedish_ci\'\nmysql> SELECT COLLATION(_utf8\'abc\');\n -> \'utf8_general_ci\'\n','http://dev.mysql.com/doc/refman/5.5/en/information-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (504,18,'COALESCE','Syntax:\nCOALESCE(value,...)\n\nReturns the first non-NULL value in the list, or NULL if there are no\nnon-NULL values.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/comparison-operators.html\n\n','mysql> SELECT COALESCE(NULL,1);\n -> 1\nmysql> SELECT COALESCE(NULL,NULL,NULL);\n -> NULL\n','http://dev.mysql.com/doc/refman/5.5/en/comparison-operators.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (505,17,'VERSION','Syntax:\nVERSION()\n\nReturns a string that indicates the MySQL server version. The string\nuses the utf8 character set. The value might have a suffix in addition\nto the version number. See the description of the version system\nvariable in\nhttp://dev.mysql.com/doc/refman/5.5/en/server-system-variables.html.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/information-functions.html\n\n','mysql> SELECT VERSION();\n -> \'5.5.29-standard\'\n','http://dev.mysql.com/doc/refman/5.5/en/information-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (506,37,'MAKE_SET','Syntax:\nMAKE_SET(bits,str1,str2,...)\n\nReturns a set value (a string containing substrings separated by ","\ncharacters) consisting of the strings that have the corresponding bit\nin bits set. str1 corresponds to bit 0, str2 to bit 1, and so on. NULL\nvalues in str1, str2, ... are not appended to the result.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/string-functions.html\n\n','mysql> SELECT MAKE_SET(1,\'a\',\'b\',\'c\');\n -> \'a\'\nmysql> SELECT MAKE_SET(1 | 4,\'hello\',\'nice\',\'world\');\n -> \'hello,world\'\nmysql> SELECT MAKE_SET(1 | 4,\'hello\',\'nice\',NULL,\'world\');\n -> \'hello\'\nmysql> SELECT MAKE_SET(0,\'a\',\'b\',\'c\');\n -> \'\'\n','http://dev.mysql.com/doc/refman/5.5/en/string-functions.html'); +insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (507,37,'FIND_IN_SET','Syntax:\nFIND_IN_SET(str,strlist)\n\nReturns a value in the range of 1 to N if the string str is in the\nstring list strlist consisting of N substrings. A string list is a\nstring composed of substrings separated by "," characters. If the first\nargument is a constant string and the second is a column of type SET,\nthe FIND_IN_SET() function is optimized to use bit arithmetic. Returns\n0 if str is not in strlist or if strlist is the empty string. Returns\nNULL if either argument is NULL. This function does not work properly\nif the first argument contains a comma (",") character.\n\nURL: http://dev.mysql.com/doc/refman/5.5/en/string-functions.html\n\n','mysql> SELECT FIND_IN_SET(\'b\',\'a,b,c,d\');\n -> 2\n','http://dev.mysql.com/doc/refman/5.5/en/string-functions.html'); insert into help_keyword (help_keyword_id,name) values (0,'JOIN'); insert into help_keyword (help_keyword_id,name) values (1,'HOST'); @@ -596,1418 +603,1471 @@ insert into help_keyword (help_keyword_id,name) values (22,'DROP'); insert into help_keyword (help_keyword_id,name) values (23,'GEOMETRYCOLLECTIONFROMWKB'); insert into help_keyword (help_keyword_id,name) values (24,'EVENTS'); insert into help_keyword (help_keyword_id,name) values (25,'MONTH'); -insert into help_keyword (help_keyword_id,name) values (26,'INFO'); -insert into help_keyword (help_keyword_id,name) values (27,'PROFILES'); -insert into help_keyword (help_keyword_id,name) values (28,'DUPLICATE'); -insert into help_keyword (help_keyword_id,name) values (29,'REPLICATION'); -insert into help_keyword (help_keyword_id,name) values (30,'UNLOCK'); -insert into help_keyword (help_keyword_id,name) values (31,'INNODB'); -insert into help_keyword (help_keyword_id,name) values (32,'YEAR_MONTH'); -insert into help_keyword (help_keyword_id,name) values (33,'SUBJECT'); -insert into help_keyword (help_keyword_id,name) values (34,'PREPARE'); -insert into help_keyword (help_keyword_id,name) values (35,'LOCK'); -insert into help_keyword (help_keyword_id,name) values (36,'NDB'); -insert into help_keyword (help_keyword_id,name) values (37,'CHECK'); -insert into help_keyword (help_keyword_id,name) values (38,'FULL'); -insert into help_keyword (help_keyword_id,name) values (39,'INT4'); -insert into help_keyword (help_keyword_id,name) values (40,'BY'); -insert into help_keyword (help_keyword_id,name) values (41,'NO'); -insert into help_keyword (help_keyword_id,name) values (42,'MINUTE'); -insert into help_keyword (help_keyword_id,name) values (43,'PARTITION'); -insert into help_keyword (help_keyword_id,name) values (44,'DATA'); -insert into help_keyword (help_keyword_id,name) values (45,'DAY'); -insert into help_keyword (help_keyword_id,name) values (46,'SHARE'); -insert into help_keyword (help_keyword_id,name) values (47,'REAL'); -insert into help_keyword (help_keyword_id,name) values (48,'SEPARATOR'); +insert into help_keyword (help_keyword_id,name) values (26,'PROFILES'); +insert into help_keyword (help_keyword_id,name) values (27,'DUPLICATE'); +insert into help_keyword (help_keyword_id,name) values (28,'REPLICATION'); +insert into help_keyword (help_keyword_id,name) values (29,'UNLOCK'); +insert into help_keyword (help_keyword_id,name) values (30,'INNODB'); +insert into help_keyword (help_keyword_id,name) values (31,'YEAR_MONTH'); +insert into help_keyword (help_keyword_id,name) values (32,'SUBJECT'); +insert into help_keyword (help_keyword_id,name) values (33,'PREPARE'); +insert into help_keyword (help_keyword_id,name) values (34,'LOCK'); +insert into help_keyword (help_keyword_id,name) values (35,'NDB'); +insert into help_keyword (help_keyword_id,name) values (36,'CHECK'); +insert into help_keyword (help_keyword_id,name) values (37,'FULL'); +insert into help_keyword (help_keyword_id,name) values (38,'INT4'); +insert into help_keyword (help_keyword_id,name) values (39,'BY'); +insert into help_keyword (help_keyword_id,name) values (40,'NO'); +insert into help_keyword (help_keyword_id,name) values (41,'MINUTE'); +insert into help_keyword (help_keyword_id,name) values (42,'PARTITION'); +insert into help_keyword (help_keyword_id,name) values (43,'DATA'); +insert into help_keyword (help_keyword_id,name) values (44,'DAY'); +insert into help_keyword (help_keyword_id,name) values (45,'SHARE'); +insert into help_keyword (help_keyword_id,name) values (46,'REAL'); +insert into help_keyword (help_keyword_id,name) values (47,'SEPARATOR'); +insert into help_keyword (help_keyword_id,name) values (48,'MESSAGE_TEXT'); insert into help_keyword (help_keyword_id,name) values (49,'MASTER_HEARTBEAT_PERIOD'); insert into help_keyword (help_keyword_id,name) values (50,'DELETE'); insert into help_keyword (help_keyword_id,name) values (51,'ON'); -insert into help_keyword (help_keyword_id,name) values (52,'CONNECTION'); -insert into help_keyword (help_keyword_id,name) values (53,'CLOSE'); -insert into help_keyword (help_keyword_id,name) values (54,'X509'); -insert into help_keyword (help_keyword_id,name) values (55,'USE'); -insert into help_keyword (help_keyword_id,name) values (56,'WHERE'); -insert into help_keyword (help_keyword_id,name) values (57,'PRIVILEGES'); -insert into help_keyword (help_keyword_id,name) values (58,'SPATIAL'); -insert into help_keyword (help_keyword_id,name) values (59,'EVENT'); -insert into help_keyword (help_keyword_id,name) values (60,'SUPER'); -insert into help_keyword (help_keyword_id,name) values (61,'SQL_BUFFER_RESULT'); -insert into help_keyword (help_keyword_id,name) values (62,'IGNORE'); -insert into help_keyword (help_keyword_id,name) values (63,'QUICK'); -insert into help_keyword (help_keyword_id,name) values (64,'SIGNED'); -insert into help_keyword (help_keyword_id,name) values (65,'OFFLINE'); -insert into help_keyword (help_keyword_id,name) values (66,'SECURITY'); -insert into help_keyword (help_keyword_id,name) values (67,'AUTOEXTEND_SIZE'); -insert into help_keyword (help_keyword_id,name) values (68,'NDBCLUSTER'); -insert into help_keyword (help_keyword_id,name) values (69,'POLYGONFROMWKB'); -insert into help_keyword (help_keyword_id,name) values (70,'FALSE'); -insert into help_keyword (help_keyword_id,name) values (71,'LEVEL'); -insert into help_keyword (help_keyword_id,name) values (72,'FORCE'); -insert into help_keyword (help_keyword_id,name) values (73,'BINARY'); -insert into help_keyword (help_keyword_id,name) values (74,'TO'); -insert into help_keyword (help_keyword_id,name) values (75,'CHANGE'); -insert into help_keyword (help_keyword_id,name) values (76,'CURRENT_USER'); -insert into help_keyword (help_keyword_id,name) values (77,'HOUR_MINUTE'); -insert into help_keyword (help_keyword_id,name) values (78,'UPDATE'); -insert into help_keyword (help_keyword_id,name) values (79,'PRESERVE'); -insert into help_keyword (help_keyword_id,name) values (80,'INTO'); -insert into help_keyword (help_keyword_id,name) values (81,'FEDERATED'); -insert into help_keyword (help_keyword_id,name) values (82,'VARYING'); -insert into help_keyword (help_keyword_id,name) values (83,'MAX_SIZE'); -insert into help_keyword (help_keyword_id,name) values (84,'HOUR_SECOND'); -insert into help_keyword (help_keyword_id,name) values (85,'VARIABLE'); -insert into help_keyword (help_keyword_id,name) values (86,'ROLLBACK'); -insert into help_keyword (help_keyword_id,name) values (87,'RTREE'); -insert into help_keyword (help_keyword_id,name) values (88,'PROCEDURE'); -insert into help_keyword (help_keyword_id,name) values (89,'TIMESTAMP'); -insert into help_keyword (help_keyword_id,name) values (90,'IMPORT'); -insert into help_keyword (help_keyword_id,name) values (91,'AGAINST'); -insert into help_keyword (help_keyword_id,name) values (92,'CHECKSUM'); -insert into help_keyword (help_keyword_id,name) values (93,'COUNT'); -insert into help_keyword (help_keyword_id,name) values (94,'LONGBINARY'); -insert into help_keyword (help_keyword_id,name) values (95,'THEN'); -insert into help_keyword (help_keyword_id,name) values (96,'INSERT'); -insert into help_keyword (help_keyword_id,name) values (97,'ENGINES'); -insert into help_keyword (help_keyword_id,name) values (98,'HANDLER'); -insert into help_keyword (help_keyword_id,name) values (99,'PORT'); -insert into help_keyword (help_keyword_id,name) values (100,'DAY_SECOND'); -insert into help_keyword (help_keyword_id,name) values (101,'EXISTS'); -insert into help_keyword (help_keyword_id,name) values (102,'MUTEX'); -insert into help_keyword (help_keyword_id,name) values (103,'RELEASE'); -insert into help_keyword (help_keyword_id,name) values (104,'BOOLEAN'); -insert into help_keyword (help_keyword_id,name) values (105,'MOD'); -insert into help_keyword (help_keyword_id,name) values (106,'DEFAULT'); -insert into help_keyword (help_keyword_id,name) values (107,'TYPE'); -insert into help_keyword (help_keyword_id,name) values (108,'NO_WRITE_TO_BINLOG'); -insert into help_keyword (help_keyword_id,name) values (109,'OPTIMIZE'); -insert into help_keyword (help_keyword_id,name) values (110,'RESET'); -insert into help_keyword (help_keyword_id,name) values (111,'ITERATE'); -insert into help_keyword (help_keyword_id,name) values (112,'INSTALL'); -insert into help_keyword (help_keyword_id,name) values (113,'DO'); -insert into help_keyword (help_keyword_id,name) values (114,'BIGINT'); -insert into help_keyword (help_keyword_id,name) values (115,'SET'); -insert into help_keyword (help_keyword_id,name) values (116,'ISSUER'); -insert into help_keyword (help_keyword_id,name) values (117,'DATE'); -insert into help_keyword (help_keyword_id,name) values (118,'STATUS'); -insert into help_keyword (help_keyword_id,name) values (119,'FULLTEXT'); -insert into help_keyword (help_keyword_id,name) values (120,'COMMENT'); -insert into help_keyword (help_keyword_id,name) values (121,'MASTER_CONNECT_RETRY'); -insert into help_keyword (help_keyword_id,name) values (122,'INNER'); -insert into help_keyword (help_keyword_id,name) values (123,'STOP'); -insert into help_keyword (help_keyword_id,name) values (124,'MASTER_LOG_FILE'); -insert into help_keyword (help_keyword_id,name) values (125,'MRG_MYISAM'); -insert into help_keyword (help_keyword_id,name) values (126,'PRECISION'); -insert into help_keyword (help_keyword_id,name) values (127,'REQUIRE'); -insert into help_keyword (help_keyword_id,name) values (128,'TRAILING'); -insert into help_keyword (help_keyword_id,name) values (129,'PARTITIONS'); -insert into help_keyword (help_keyword_id,name) values (130,'LONG'); -insert into help_keyword (help_keyword_id,name) values (131,'OPTION'); -insert into help_keyword (help_keyword_id,name) values (132,'REORGANIZE'); -insert into help_keyword (help_keyword_id,name) values (133,'ELSE'); -insert into help_keyword (help_keyword_id,name) values (134,'DEALLOCATE'); -insert into help_keyword (help_keyword_id,name) values (135,'IO_THREAD'); -insert into help_keyword (help_keyword_id,name) values (136,'CASE'); -insert into help_keyword (help_keyword_id,name) values (137,'CIPHER'); -insert into help_keyword (help_keyword_id,name) values (138,'CONTINUE'); -insert into help_keyword (help_keyword_id,name) values (139,'FROM'); -insert into help_keyword (help_keyword_id,name) values (140,'READ'); -insert into help_keyword (help_keyword_id,name) values (141,'LEFT'); -insert into help_keyword (help_keyword_id,name) values (142,'ELSEIF'); -insert into help_keyword (help_keyword_id,name) values (143,'MINUTE_SECOND'); -insert into help_keyword (help_keyword_id,name) values (144,'COMPACT'); -insert into help_keyword (help_keyword_id,name) values (145,'RESTORE'); -insert into help_keyword (help_keyword_id,name) values (146,'DEC'); -insert into help_keyword (help_keyword_id,name) values (147,'FOR'); -insert into help_keyword (help_keyword_id,name) values (148,'WARNINGS'); -insert into help_keyword (help_keyword_id,name) values (149,'MIN_ROWS'); -insert into help_keyword (help_keyword_id,name) values (150,'CONDITION'); -insert into help_keyword (help_keyword_id,name) values (151,'STRING'); -insert into help_keyword (help_keyword_id,name) values (152,'ENCLOSED'); -insert into help_keyword (help_keyword_id,name) values (153,'FUNCTION'); -insert into help_keyword (help_keyword_id,name) values (154,'AGGREGATE'); -insert into help_keyword (help_keyword_id,name) values (155,'FIELDS'); -insert into help_keyword (help_keyword_id,name) values (156,'INT3'); -insert into help_keyword (help_keyword_id,name) values (157,'ARCHIVE'); -insert into help_keyword (help_keyword_id,name) values (158,'AVG_ROW_LENGTH'); -insert into help_keyword (help_keyword_id,name) values (159,'ADD'); -insert into help_keyword (help_keyword_id,name) values (160,'KILL'); -insert into help_keyword (help_keyword_id,name) values (161,'FLOAT4'); -insert into help_keyword (help_keyword_id,name) values (162,'TABLESPACE'); -insert into help_keyword (help_keyword_id,name) values (163,'VIEW'); -insert into help_keyword (help_keyword_id,name) values (164,'REPEATABLE'); -insert into help_keyword (help_keyword_id,name) values (165,'INFILE'); -insert into help_keyword (help_keyword_id,name) values (166,'ORDER'); -insert into help_keyword (help_keyword_id,name) values (167,'USING'); -insert into help_keyword (help_keyword_id,name) values (168,'MIDDLEINT'); -insert into help_keyword (help_keyword_id,name) values (169,'GRANT'); -insert into help_keyword (help_keyword_id,name) values (170,'UNSIGNED'); -insert into help_keyword (help_keyword_id,name) values (171,'DECIMAL'); -insert into help_keyword (help_keyword_id,name) values (172,'GEOMETRYFROMTEXT'); -insert into help_keyword (help_keyword_id,name) values (173,'INDEXES'); -insert into help_keyword (help_keyword_id,name) values (174,'FOREIGN'); -insert into help_keyword (help_keyword_id,name) values (175,'CACHE'); -insert into help_keyword (help_keyword_id,name) values (176,'HOSTS'); -insert into help_keyword (help_keyword_id,name) values (177,'COMMIT'); -insert into help_keyword (help_keyword_id,name) values (178,'SCHEMAS'); -insert into help_keyword (help_keyword_id,name) values (179,'LEADING'); -insert into help_keyword (help_keyword_id,name) values (180,'SNAPSHOT'); -insert into help_keyword (help_keyword_id,name) values (181,'DECLARE'); -insert into help_keyword (help_keyword_id,name) values (182,'LOAD'); -insert into help_keyword (help_keyword_id,name) values (183,'SQL_CACHE'); -insert into help_keyword (help_keyword_id,name) values (184,'CONVERT'); -insert into help_keyword (help_keyword_id,name) values (185,'DYNAMIC'); -insert into help_keyword (help_keyword_id,name) values (186,'COLLATE'); -insert into help_keyword (help_keyword_id,name) values (187,'POLYGONFROMTEXT'); -insert into help_keyword (help_keyword_id,name) values (188,'BYTE'); -insert into help_keyword (help_keyword_id,name) values (189,'GLOBAL'); -insert into help_keyword (help_keyword_id,name) values (190,'LINESTRINGFROMWKB'); -insert into help_keyword (help_keyword_id,name) values (191,'WHEN'); -insert into help_keyword (help_keyword_id,name) values (192,'COLUMN_FORMAT'); -insert into help_keyword (help_keyword_id,name) values (193,'HAVING'); -insert into help_keyword (help_keyword_id,name) values (194,'AS'); -insert into help_keyword (help_keyword_id,name) values (195,'STARTING'); -insert into help_keyword (help_keyword_id,name) values (196,'RELOAD'); -insert into help_keyword (help_keyword_id,name) values (197,'AUTOCOMMIT'); -insert into help_keyword (help_keyword_id,name) values (198,'REVOKE'); -insert into help_keyword (help_keyword_id,name) values (199,'GRANTS'); -insert into help_keyword (help_keyword_id,name) values (200,'OUTER'); -insert into help_keyword (help_keyword_id,name) values (201,'FLOOR'); -insert into help_keyword (help_keyword_id,name) values (202,'EXPLAIN'); -insert into help_keyword (help_keyword_id,name) values (203,'WITH'); -insert into help_keyword (help_keyword_id,name) values (204,'AFTER'); -insert into help_keyword (help_keyword_id,name) values (205,'STD'); -insert into help_keyword (help_keyword_id,name) values (206,'CSV'); -insert into help_keyword (help_keyword_id,name) values (207,'DISABLE'); -insert into help_keyword (help_keyword_id,name) values (208,'UNINSTALL'); -insert into help_keyword (help_keyword_id,name) values (209,'OUTFILE'); -insert into help_keyword (help_keyword_id,name) values (210,'LOW_PRIORITY'); -insert into help_keyword (help_keyword_id,name) values (211,'FILE'); -insert into help_keyword (help_keyword_id,name) values (212,'NODEGROUP'); -insert into help_keyword (help_keyword_id,name) values (213,'SCHEMA'); -insert into help_keyword (help_keyword_id,name) values (214,'SONAME'); -insert into help_keyword (help_keyword_id,name) values (215,'POW'); -insert into help_keyword (help_keyword_id,name) values (216,'DUAL'); -insert into help_keyword (help_keyword_id,name) values (217,'MULTIPOINTFROMWKB'); -insert into help_keyword (help_keyword_id,name) values (218,'INDEX'); -insert into help_keyword (help_keyword_id,name) values (219,'BACKUP'); -insert into help_keyword (help_keyword_id,name) values (220,'MULTIPOINTFROMTEXT'); -insert into help_keyword (help_keyword_id,name) values (221,'DEFINER'); -insert into help_keyword (help_keyword_id,name) values (222,'MASTER_BIND'); -insert into help_keyword (help_keyword_id,name) values (223,'REMOVE'); -insert into help_keyword (help_keyword_id,name) values (224,'EXTENDED'); -insert into help_keyword (help_keyword_id,name) values (225,'MULTILINESTRINGFROMWKB'); -insert into help_keyword (help_keyword_id,name) values (226,'CROSS'); -insert into help_keyword (help_keyword_id,name) values (227,'CONTRIBUTORS'); -insert into help_keyword (help_keyword_id,name) values (228,'NATIONAL'); -insert into help_keyword (help_keyword_id,name) values (229,'GROUP'); -insert into help_keyword (help_keyword_id,name) values (230,'SHA'); -insert into help_keyword (help_keyword_id,name) values (231,'ONLINE'); -insert into help_keyword (help_keyword_id,name) values (232,'UNDO'); -insert into help_keyword (help_keyword_id,name) values (233,'ZEROFILL'); -insert into help_keyword (help_keyword_id,name) values (234,'CLIENT'); -insert into help_keyword (help_keyword_id,name) values (235,'MASTER_PASSWORD'); -insert into help_keyword (help_keyword_id,name) values (236,'OWNER'); -insert into help_keyword (help_keyword_id,name) values (237,'RELAY_LOG_FILE'); -insert into help_keyword (help_keyword_id,name) values (238,'TRUE'); -insert into help_keyword (help_keyword_id,name) values (239,'CHARACTER'); -insert into help_keyword (help_keyword_id,name) values (240,'MASTER_USER'); -insert into help_keyword (help_keyword_id,name) values (241,'TABLE'); -insert into help_keyword (help_keyword_id,name) values (242,'ENGINE'); -insert into help_keyword (help_keyword_id,name) values (243,'INSERT_METHOD'); -insert into help_keyword (help_keyword_id,name) values (244,'CASCADE'); -insert into help_keyword (help_keyword_id,name) values (245,'RELAY_LOG_POS'); -insert into help_keyword (help_keyword_id,name) values (246,'SQL_CALC_FOUND_ROWS'); -insert into help_keyword (help_keyword_id,name) values (247,'UNION'); -insert into help_keyword (help_keyword_id,name) values (248,'MYISAM'); -insert into help_keyword (help_keyword_id,name) values (249,'LEAVE'); -insert into help_keyword (help_keyword_id,name) values (250,'MODIFY'); -insert into help_keyword (help_keyword_id,name) values (251,'MATCH'); -insert into help_keyword (help_keyword_id,name) values (252,'MASTER_LOG_POS'); -insert into help_keyword (help_keyword_id,name) values (253,'DISTINCTROW'); -insert into help_keyword (help_keyword_id,name) values (254,'DESC'); -insert into help_keyword (help_keyword_id,name) values (255,'TIME'); -insert into help_keyword (help_keyword_id,name) values (256,'NUMERIC'); -insert into help_keyword (help_keyword_id,name) values (257,'EXPANSION'); -insert into help_keyword (help_keyword_id,name) values (258,'CURSOR'); -insert into help_keyword (help_keyword_id,name) values (259,'CODE'); -insert into help_keyword (help_keyword_id,name) values (260,'GEOMETRYCOLLECTIONFROMTEXT'); -insert into help_keyword (help_keyword_id,name) values (261,'CHAIN'); -insert into help_keyword (help_keyword_id,name) values (262,'LOGFILE'); -insert into help_keyword (help_keyword_id,name) values (263,'FLUSH'); -insert into help_keyword (help_keyword_id,name) values (264,'CREATE'); -insert into help_keyword (help_keyword_id,name) values (265,'DESCRIBE'); -insert into help_keyword (help_keyword_id,name) values (266,'EXTENT_SIZE'); -insert into help_keyword (help_keyword_id,name) values (267,'MAX_UPDATES_PER_HOUR'); -insert into help_keyword (help_keyword_id,name) values (268,'INT2'); -insert into help_keyword (help_keyword_id,name) values (269,'PROCESSLIST'); -insert into help_keyword (help_keyword_id,name) values (270,'ENDS'); -insert into help_keyword (help_keyword_id,name) values (271,'LOGS'); -insert into help_keyword (help_keyword_id,name) values (272,'DISCARD'); -insert into help_keyword (help_keyword_id,name) values (273,'HEAP'); -insert into help_keyword (help_keyword_id,name) values (274,'SOUNDS'); -insert into help_keyword (help_keyword_id,name) values (275,'BETWEEN'); -insert into help_keyword (help_keyword_id,name) values (276,'MULTILINESTRINGFROMTEXT'); -insert into help_keyword (help_keyword_id,name) values (277,'REPAIR'); -insert into help_keyword (help_keyword_id,name) values (278,'PACK_KEYS'); -insert into help_keyword (help_keyword_id,name) values (279,'FAST'); -insert into help_keyword (help_keyword_id,name) values (280,'VALUES'); -insert into help_keyword (help_keyword_id,name) values (281,'CALL'); -insert into help_keyword (help_keyword_id,name) values (282,'LOOP'); -insert into help_keyword (help_keyword_id,name) values (283,'VARCHARACTER'); -insert into help_keyword (help_keyword_id,name) values (284,'BEFORE'); -insert into help_keyword (help_keyword_id,name) values (285,'TRUNCATE'); -insert into help_keyword (help_keyword_id,name) values (286,'SHOW'); -insert into help_keyword (help_keyword_id,name) values (287,'ALL'); -insert into help_keyword (help_keyword_id,name) values (288,'REDUNDANT'); -insert into help_keyword (help_keyword_id,name) values (289,'USER_RESOURCES'); -insert into help_keyword (help_keyword_id,name) values (290,'PARTIAL'); -insert into help_keyword (help_keyword_id,name) values (291,'BINLOG'); -insert into help_keyword (help_keyword_id,name) values (292,'END'); -insert into help_keyword (help_keyword_id,name) values (293,'SECOND'); -insert into help_keyword (help_keyword_id,name) values (294,'AND'); -insert into help_keyword (help_keyword_id,name) values (295,'FLOAT8'); -insert into help_keyword (help_keyword_id,name) values (296,'PREV'); -insert into help_keyword (help_keyword_id,name) values (297,'HOUR'); -insert into help_keyword (help_keyword_id,name) values (298,'SELECT'); -insert into help_keyword (help_keyword_id,name) values (299,'DATABASES'); -insert into help_keyword (help_keyword_id,name) values (300,'OR'); -insert into help_keyword (help_keyword_id,name) values (301,'IDENTIFIED'); -insert into help_keyword (help_keyword_id,name) values (302,'WRAPPER'); -insert into help_keyword (help_keyword_id,name) values (303,'MASTER_SSL_CIPHER'); -insert into help_keyword (help_keyword_id,name) values (304,'SQL_SLAVE_SKIP_COUNTER'); -insert into help_keyword (help_keyword_id,name) values (305,'BOTH'); -insert into help_keyword (help_keyword_id,name) values (306,'BOOL'); -insert into help_keyword (help_keyword_id,name) values (307,'YEAR'); -insert into help_keyword (help_keyword_id,name) values (308,'MASTER_PORT'); -insert into help_keyword (help_keyword_id,name) values (309,'CONCURRENT'); -insert into help_keyword (help_keyword_id,name) values (310,'HELP'); -insert into help_keyword (help_keyword_id,name) values (311,'UNIQUE'); -insert into help_keyword (help_keyword_id,name) values (312,'TRIGGERS'); -insert into help_keyword (help_keyword_id,name) values (313,'PROCESS'); -insert into help_keyword (help_keyword_id,name) values (314,'OPTIONS'); -insert into help_keyword (help_keyword_id,name) values (315,'CONSISTENT'); -insert into help_keyword (help_keyword_id,name) values (316,'MASTER_SSL'); -insert into help_keyword (help_keyword_id,name) values (317,'DATE_ADD'); -insert into help_keyword (help_keyword_id,name) values (318,'MAX_CONNECTIONS_PER_HOUR'); -insert into help_keyword (help_keyword_id,name) values (319,'LIKE'); -insert into help_keyword (help_keyword_id,name) values (320,'PLUGIN'); -insert into help_keyword (help_keyword_id,name) values (321,'FETCH'); -insert into help_keyword (help_keyword_id,name) values (322,'IN'); -insert into help_keyword (help_keyword_id,name) values (323,'COLUMN'); -insert into help_keyword (help_keyword_id,name) values (324,'DUMPFILE'); -insert into help_keyword (help_keyword_id,name) values (325,'USAGE'); -insert into help_keyword (help_keyword_id,name) values (326,'EXECUTE'); -insert into help_keyword (help_keyword_id,name) values (327,'MEMORY'); -insert into help_keyword (help_keyword_id,name) values (328,'CEIL'); -insert into help_keyword (help_keyword_id,name) values (329,'QUERY'); -insert into help_keyword (help_keyword_id,name) values (330,'MASTER_HOST'); -insert into help_keyword (help_keyword_id,name) values (331,'LINES'); -insert into help_keyword (help_keyword_id,name) values (332,'SQL_THREAD'); -insert into help_keyword (help_keyword_id,name) values (333,'SERVER'); -insert into help_keyword (help_keyword_id,name) values (334,'MAX_QUERIES_PER_HOUR'); -insert into help_keyword (help_keyword_id,name) values (335,'MASTER_SSL_CERT'); -insert into help_keyword (help_keyword_id,name) values (336,'MULTIPOLYGONFROMWKB'); -insert into help_keyword (help_keyword_id,name) values (337,'TRANSACTION'); -insert into help_keyword (help_keyword_id,name) values (338,'DAY_MINUTE'); -insert into help_keyword (help_keyword_id,name) values (339,'STDDEV'); -insert into help_keyword (help_keyword_id,name) values (340,'DATE_SUB'); -insert into help_keyword (help_keyword_id,name) values (341,'REBUILD'); -insert into help_keyword (help_keyword_id,name) values (342,'GEOMETRYFROMWKB'); -insert into help_keyword (help_keyword_id,name) values (343,'INT1'); -insert into help_keyword (help_keyword_id,name) values (344,'RENAME'); -insert into help_keyword (help_keyword_id,name) values (345,'PARSER'); -insert into help_keyword (help_keyword_id,name) values (346,'RIGHT'); -insert into help_keyword (help_keyword_id,name) values (347,'ALTER'); -insert into help_keyword (help_keyword_id,name) values (348,'MAX_ROWS'); -insert into help_keyword (help_keyword_id,name) values (349,'SOCKET'); -insert into help_keyword (help_keyword_id,name) values (350,'STRAIGHT_JOIN'); -insert into help_keyword (help_keyword_id,name) values (351,'NATURAL'); -insert into help_keyword (help_keyword_id,name) values (352,'VARIABLES'); -insert into help_keyword (help_keyword_id,name) values (353,'ESCAPED'); -insert into help_keyword (help_keyword_id,name) values (354,'SHA1'); -insert into help_keyword (help_keyword_id,name) values (355,'KEY_BLOCK_SIZE'); -insert into help_keyword (help_keyword_id,name) values (356,'PASSWORD'); -insert into help_keyword (help_keyword_id,name) values (357,'OFFSET'); -insert into help_keyword (help_keyword_id,name) values (358,'CHAR'); -insert into help_keyword (help_keyword_id,name) values (359,'NEXT'); -insert into help_keyword (help_keyword_id,name) values (360,'SQL_LOG_BIN'); -insert into help_keyword (help_keyword_id,name) values (361,'ERRORS'); -insert into help_keyword (help_keyword_id,name) values (362,'TEMPORARY'); -insert into help_keyword (help_keyword_id,name) values (363,'COMMITTED'); -insert into help_keyword (help_keyword_id,name) values (364,'SQL_SMALL_RESULT'); -insert into help_keyword (help_keyword_id,name) values (365,'UPGRADE'); -insert into help_keyword (help_keyword_id,name) values (366,'BEGIN'); -insert into help_keyword (help_keyword_id,name) values (367,'DELAY_KEY_WRITE'); -insert into help_keyword (help_keyword_id,name) values (368,'PROFILE'); -insert into help_keyword (help_keyword_id,name) values (369,'MEDIUM'); -insert into help_keyword (help_keyword_id,name) values (370,'INTERVAL'); -insert into help_keyword (help_keyword_id,name) values (371,'SSL'); -insert into help_keyword (help_keyword_id,name) values (372,'DAY_HOUR'); -insert into help_keyword (help_keyword_id,name) values (373,'NAME'); -insert into help_keyword (help_keyword_id,name) values (374,'REFERENCES'); -insert into help_keyword (help_keyword_id,name) values (375,'AES_ENCRYPT'); -insert into help_keyword (help_keyword_id,name) values (376,'STORAGE'); -insert into help_keyword (help_keyword_id,name) values (377,'ISOLATION'); -insert into help_keyword (help_keyword_id,name) values (378,'CEILING'); -insert into help_keyword (help_keyword_id,name) values (379,'EVERY'); -insert into help_keyword (help_keyword_id,name) values (380,'INT8'); -insert into help_keyword (help_keyword_id,name) values (381,'AUTHORS'); -insert into help_keyword (help_keyword_id,name) values (382,'RESTRICT'); -insert into help_keyword (help_keyword_id,name) values (383,'UNCOMMITTED'); -insert into help_keyword (help_keyword_id,name) values (384,'LINESTRINGFROMTEXT'); -insert into help_keyword (help_keyword_id,name) values (385,'IS'); -insert into help_keyword (help_keyword_id,name) values (386,'NOT'); -insert into help_keyword (help_keyword_id,name) values (387,'ANALYSE'); -insert into help_keyword (help_keyword_id,name) values (388,'DATAFILE'); -insert into help_keyword (help_keyword_id,name) values (389,'DES_KEY_FILE'); -insert into help_keyword (help_keyword_id,name) values (390,'COMPRESSED'); -insert into help_keyword (help_keyword_id,name) values (391,'START'); -insert into help_keyword (help_keyword_id,name) values (392,'PLUGINS'); -insert into help_keyword (help_keyword_id,name) values (393,'SAVEPOINT'); -insert into help_keyword (help_keyword_id,name) values (394,'IF'); -insert into help_keyword (help_keyword_id,name) values (395,'PRIMARY'); -insert into help_keyword (help_keyword_id,name) values (396,'PURGE'); -insert into help_keyword (help_keyword_id,name) values (397,'LAST'); -insert into help_keyword (help_keyword_id,name) values (398,'USER'); -insert into help_keyword (help_keyword_id,name) values (399,'INNOBASE'); -insert into help_keyword (help_keyword_id,name) values (400,'EXIT'); -insert into help_keyword (help_keyword_id,name) values (401,'KEYS'); -insert into help_keyword (help_keyword_id,name) values (402,'LIMIT'); -insert into help_keyword (help_keyword_id,name) values (403,'KEY'); -insert into help_keyword (help_keyword_id,name) values (404,'MERGE'); -insert into help_keyword (help_keyword_id,name) values (405,'UNTIL'); -insert into help_keyword (help_keyword_id,name) values (406,'SQL_NO_CACHE'); -insert into help_keyword (help_keyword_id,name) values (407,'DELAYED'); -insert into help_keyword (help_keyword_id,name) values (408,'ANALYZE'); -insert into help_keyword (help_keyword_id,name) values (409,'CONSTRAINT'); -insert into help_keyword (help_keyword_id,name) values (410,'SERIAL'); -insert into help_keyword (help_keyword_id,name) values (411,'ACTION'); -insert into help_keyword (help_keyword_id,name) values (412,'WRITE'); -insert into help_keyword (help_keyword_id,name) values (413,'INITIAL_SIZE'); -insert into help_keyword (help_keyword_id,name) values (414,'SESSION'); -insert into help_keyword (help_keyword_id,name) values (415,'DATABASE'); -insert into help_keyword (help_keyword_id,name) values (416,'NULL'); -insert into help_keyword (help_keyword_id,name) values (417,'POWER'); -insert into help_keyword (help_keyword_id,name) values (418,'USE_FRM'); -insert into help_keyword (help_keyword_id,name) values (419,'TERMINATED'); -insert into help_keyword (help_keyword_id,name) values (420,'SLAVE'); -insert into help_keyword (help_keyword_id,name) values (421,'NVARCHAR'); -insert into help_keyword (help_keyword_id,name) values (422,'ASC'); -insert into help_keyword (help_keyword_id,name) values (423,'RETURN'); -insert into help_keyword (help_keyword_id,name) values (424,'OPTIONALLY'); -insert into help_keyword (help_keyword_id,name) values (425,'ENABLE'); -insert into help_keyword (help_keyword_id,name) values (426,'DIRECTORY'); -insert into help_keyword (help_keyword_id,name) values (427,'WHILE'); -insert into help_keyword (help_keyword_id,name) values (428,'MAX_USER_CONNECTIONS'); -insert into help_keyword (help_keyword_id,name) values (429,'LOCAL'); -insert into help_keyword (help_keyword_id,name) values (430,'DISTINCT'); -insert into help_keyword (help_keyword_id,name) values (431,'AES_DECRYPT'); -insert into help_keyword (help_keyword_id,name) values (432,'MASTER_SSL_KEY'); -insert into help_keyword (help_keyword_id,name) values (433,'NONE'); -insert into help_keyword (help_keyword_id,name) values (434,'TABLES'); -insert into help_keyword (help_keyword_id,name) values (435,'<>'); -insert into help_keyword (help_keyword_id,name) values (436,'RLIKE'); -insert into help_keyword (help_keyword_id,name) values (437,'TRIGGER'); -insert into help_keyword (help_keyword_id,name) values (438,'COLLATION'); -insert into help_keyword (help_keyword_id,name) values (439,'SHUTDOWN'); -insert into help_keyword (help_keyword_id,name) values (440,'HIGH_PRIORITY'); -insert into help_keyword (help_keyword_id,name) values (441,'BTREE'); -insert into help_keyword (help_keyword_id,name) values (442,'FIRST'); -insert into help_keyword (help_keyword_id,name) values (443,'COALESCE'); -insert into help_keyword (help_keyword_id,name) values (444,'WAIT'); -insert into help_keyword (help_keyword_id,name) values (445,'TYPES'); -insert into help_keyword (help_keyword_id,name) values (446,'MASTER'); -insert into help_keyword (help_keyword_id,name) values (447,'FIXED'); -insert into help_keyword (help_keyword_id,name) values (448,'MULTIPOLYGONFROMTEXT'); -insert into help_keyword (help_keyword_id,name) values (449,'ROW_FORMAT'); +insert into help_keyword (help_keyword_id,name) values (52,'COLUMN_NAME'); +insert into help_keyword (help_keyword_id,name) values (53,'CONNECTION'); +insert into help_keyword (help_keyword_id,name) values (54,'CLOSE'); +insert into help_keyword (help_keyword_id,name) values (55,'X509'); +insert into help_keyword (help_keyword_id,name) values (56,'USE'); +insert into help_keyword (help_keyword_id,name) values (57,'SUBCLASS_ORIGIN'); +insert into help_keyword (help_keyword_id,name) values (58,'WHERE'); +insert into help_keyword (help_keyword_id,name) values (59,'PRIVILEGES'); +insert into help_keyword (help_keyword_id,name) values (60,'SPATIAL'); +insert into help_keyword (help_keyword_id,name) values (61,'EVENT'); +insert into help_keyword (help_keyword_id,name) values (62,'SUPER'); +insert into help_keyword (help_keyword_id,name) values (63,'SQL_BUFFER_RESULT'); +insert into help_keyword (help_keyword_id,name) values (64,'IGNORE'); +insert into help_keyword (help_keyword_id,name) values (65,'SHA2'); +insert into help_keyword (help_keyword_id,name) values (66,'QUICK'); +insert into help_keyword (help_keyword_id,name) values (67,'SIGNED'); +insert into help_keyword (help_keyword_id,name) values (68,'OFFLINE'); +insert into help_keyword (help_keyword_id,name) values (69,'SECURITY'); +insert into help_keyword (help_keyword_id,name) values (70,'AUTOEXTEND_SIZE'); +insert into help_keyword (help_keyword_id,name) values (71,'NDBCLUSTER'); +insert into help_keyword (help_keyword_id,name) values (72,'POLYGONFROMWKB'); +insert into help_keyword (help_keyword_id,name) values (73,'FALSE'); +insert into help_keyword (help_keyword_id,name) values (74,'LEVEL'); +insert into help_keyword (help_keyword_id,name) values (75,'FORCE'); +insert into help_keyword (help_keyword_id,name) values (76,'BINARY'); +insert into help_keyword (help_keyword_id,name) values (77,'TO'); +insert into help_keyword (help_keyword_id,name) values (78,'CHANGE'); +insert into help_keyword (help_keyword_id,name) values (79,'CURRENT_USER'); +insert into help_keyword (help_keyword_id,name) values (80,'HOUR_MINUTE'); +insert into help_keyword (help_keyword_id,name) values (81,'UPDATE'); +insert into help_keyword (help_keyword_id,name) values (82,'PRESERVE'); +insert into help_keyword (help_keyword_id,name) values (83,'TABLE_NAME'); +insert into help_keyword (help_keyword_id,name) values (84,'INTO'); +insert into help_keyword (help_keyword_id,name) values (85,'FEDERATED'); +insert into help_keyword (help_keyword_id,name) values (86,'VARYING'); +insert into help_keyword (help_keyword_id,name) values (87,'MAX_SIZE'); +insert into help_keyword (help_keyword_id,name) values (88,'HOUR_SECOND'); +insert into help_keyword (help_keyword_id,name) values (89,'VARIABLE'); +insert into help_keyword (help_keyword_id,name) values (90,'ROLLBACK'); +insert into help_keyword (help_keyword_id,name) values (91,'PROCEDURE'); +insert into help_keyword (help_keyword_id,name) values (92,'TIMESTAMP'); +insert into help_keyword (help_keyword_id,name) values (93,'IMPORT'); +insert into help_keyword (help_keyword_id,name) values (94,'AGAINST'); +insert into help_keyword (help_keyword_id,name) values (95,'CHECKSUM'); +insert into help_keyword (help_keyword_id,name) values (96,'COUNT'); +insert into help_keyword (help_keyword_id,name) values (97,'LONGBINARY'); +insert into help_keyword (help_keyword_id,name) values (98,'THEN'); +insert into help_keyword (help_keyword_id,name) values (99,'INSERT'); +insert into help_keyword (help_keyword_id,name) values (100,'ENGINES'); +insert into help_keyword (help_keyword_id,name) values (101,'HANDLER'); +insert into help_keyword (help_keyword_id,name) values (102,'PORT'); +insert into help_keyword (help_keyword_id,name) values (103,'DAY_SECOND'); +insert into help_keyword (help_keyword_id,name) values (104,'EXISTS'); +insert into help_keyword (help_keyword_id,name) values (105,'MUTEX'); +insert into help_keyword (help_keyword_id,name) values (106,'HELP_DATE'); +insert into help_keyword (help_keyword_id,name) values (107,'RELEASE'); +insert into help_keyword (help_keyword_id,name) values (108,'BOOLEAN'); +insert into help_keyword (help_keyword_id,name) values (109,'MOD'); +insert into help_keyword (help_keyword_id,name) values (110,'DEFAULT'); +insert into help_keyword (help_keyword_id,name) values (111,'TYPE'); +insert into help_keyword (help_keyword_id,name) values (112,'NO_WRITE_TO_BINLOG'); +insert into help_keyword (help_keyword_id,name) values (113,'OPTIMIZE'); +insert into help_keyword (help_keyword_id,name) values (114,'SQLSTATE'); +insert into help_keyword (help_keyword_id,name) values (115,'RESET'); +insert into help_keyword (help_keyword_id,name) values (116,'CLASS_ORIGIN'); +insert into help_keyword (help_keyword_id,name) values (117,'INSTALL'); +insert into help_keyword (help_keyword_id,name) values (118,'ITERATE'); +insert into help_keyword (help_keyword_id,name) values (119,'DO'); +insert into help_keyword (help_keyword_id,name) values (120,'BIGINT'); +insert into help_keyword (help_keyword_id,name) values (121,'SET'); +insert into help_keyword (help_keyword_id,name) values (122,'ISSUER'); +insert into help_keyword (help_keyword_id,name) values (123,'DATE'); +insert into help_keyword (help_keyword_id,name) values (124,'STATUS'); +insert into help_keyword (help_keyword_id,name) values (125,'FULLTEXT'); +insert into help_keyword (help_keyword_id,name) values (126,'COMMENT'); +insert into help_keyword (help_keyword_id,name) values (127,'MASTER_CONNECT_RETRY'); +insert into help_keyword (help_keyword_id,name) values (128,'INNER'); +insert into help_keyword (help_keyword_id,name) values (129,'RELAYLOG'); +insert into help_keyword (help_keyword_id,name) values (130,'STOP'); +insert into help_keyword (help_keyword_id,name) values (131,'MASTER_LOG_FILE'); +insert into help_keyword (help_keyword_id,name) values (132,'MRG_MYISAM'); +insert into help_keyword (help_keyword_id,name) values (133,'PRECISION'); +insert into help_keyword (help_keyword_id,name) values (134,'REQUIRE'); +insert into help_keyword (help_keyword_id,name) values (135,'TRAILING'); +insert into help_keyword (help_keyword_id,name) values (136,'PARTITIONS'); +insert into help_keyword (help_keyword_id,name) values (137,'LONG'); +insert into help_keyword (help_keyword_id,name) values (138,'OPTION'); +insert into help_keyword (help_keyword_id,name) values (139,'REORGANIZE'); +insert into help_keyword (help_keyword_id,name) values (140,'ELSE'); +insert into help_keyword (help_keyword_id,name) values (141,'DEALLOCATE'); +insert into help_keyword (help_keyword_id,name) values (142,'IO_THREAD'); +insert into help_keyword (help_keyword_id,name) values (143,'CASE'); +insert into help_keyword (help_keyword_id,name) values (144,'CIPHER'); +insert into help_keyword (help_keyword_id,name) values (145,'CONTINUE'); +insert into help_keyword (help_keyword_id,name) values (146,'FROM'); +insert into help_keyword (help_keyword_id,name) values (147,'READ'); +insert into help_keyword (help_keyword_id,name) values (148,'LEFT'); +insert into help_keyword (help_keyword_id,name) values (149,'ELSEIF'); +insert into help_keyword (help_keyword_id,name) values (150,'MINUTE_SECOND'); +insert into help_keyword (help_keyword_id,name) values (151,'COMPACT'); +insert into help_keyword (help_keyword_id,name) values (152,'DEC'); +insert into help_keyword (help_keyword_id,name) values (153,'FOR'); +insert into help_keyword (help_keyword_id,name) values (154,'WARNINGS'); +insert into help_keyword (help_keyword_id,name) values (155,'MIN_ROWS'); +insert into help_keyword (help_keyword_id,name) values (156,'STRING'); +insert into help_keyword (help_keyword_id,name) values (157,'CONDITION'); +insert into help_keyword (help_keyword_id,name) values (158,'ENCLOSED'); +insert into help_keyword (help_keyword_id,name) values (159,'FUNCTION'); +insert into help_keyword (help_keyword_id,name) values (160,'AGGREGATE'); +insert into help_keyword (help_keyword_id,name) values (161,'FIELDS'); +insert into help_keyword (help_keyword_id,name) values (162,'INT3'); +insert into help_keyword (help_keyword_id,name) values (163,'ARCHIVE'); +insert into help_keyword (help_keyword_id,name) values (164,'AVG_ROW_LENGTH'); +insert into help_keyword (help_keyword_id,name) values (165,'ADD'); +insert into help_keyword (help_keyword_id,name) values (166,'KILL'); +insert into help_keyword (help_keyword_id,name) values (167,'FLOAT4'); +insert into help_keyword (help_keyword_id,name) values (168,'TABLESPACE'); +insert into help_keyword (help_keyword_id,name) values (169,'VIEW'); +insert into help_keyword (help_keyword_id,name) values (170,'REPEATABLE'); +insert into help_keyword (help_keyword_id,name) values (171,'INFILE'); +insert into help_keyword (help_keyword_id,name) values (172,'HELP_VERSION'); +insert into help_keyword (help_keyword_id,name) values (173,'ORDER'); +insert into help_keyword (help_keyword_id,name) values (174,'USING'); +insert into help_keyword (help_keyword_id,name) values (175,'CONSTRAINT_CATALOG'); +insert into help_keyword (help_keyword_id,name) values (176,'MIDDLEINT'); +insert into help_keyword (help_keyword_id,name) values (177,'GRANT'); +insert into help_keyword (help_keyword_id,name) values (178,'UNSIGNED'); +insert into help_keyword (help_keyword_id,name) values (179,'DECIMAL'); +insert into help_keyword (help_keyword_id,name) values (180,'GEOMETRYFROMTEXT'); +insert into help_keyword (help_keyword_id,name) values (181,'INDEXES'); +insert into help_keyword (help_keyword_id,name) values (182,'FOREIGN'); +insert into help_keyword (help_keyword_id,name) values (183,'CACHE'); +insert into help_keyword (help_keyword_id,name) values (184,'HOSTS'); +insert into help_keyword (help_keyword_id,name) values (185,'MYSQL_ERRNO'); +insert into help_keyword (help_keyword_id,name) values (186,'COMMIT'); +insert into help_keyword (help_keyword_id,name) values (187,'SCHEMAS'); +insert into help_keyword (help_keyword_id,name) values (188,'LEADING'); +insert into help_keyword (help_keyword_id,name) values (189,'SNAPSHOT'); +insert into help_keyword (help_keyword_id,name) values (190,'CONSTRAINT_NAME'); +insert into help_keyword (help_keyword_id,name) values (191,'DECLARE'); +insert into help_keyword (help_keyword_id,name) values (192,'LOAD'); +insert into help_keyword (help_keyword_id,name) values (193,'SQL_CACHE'); +insert into help_keyword (help_keyword_id,name) values (194,'CONVERT'); +insert into help_keyword (help_keyword_id,name) values (195,'DYNAMIC'); +insert into help_keyword (help_keyword_id,name) values (196,'COLLATE'); +insert into help_keyword (help_keyword_id,name) values (197,'POLYGONFROMTEXT'); +insert into help_keyword (help_keyword_id,name) values (198,'BYTE'); +insert into help_keyword (help_keyword_id,name) values (199,'GLOBAL'); +insert into help_keyword (help_keyword_id,name) values (200,'LINESTRINGFROMWKB'); +insert into help_keyword (help_keyword_id,name) values (201,'WHEN'); +insert into help_keyword (help_keyword_id,name) values (202,'HAVING'); +insert into help_keyword (help_keyword_id,name) values (203,'AS'); +insert into help_keyword (help_keyword_id,name) values (204,'STARTING'); +insert into help_keyword (help_keyword_id,name) values (205,'RELOAD'); +insert into help_keyword (help_keyword_id,name) values (206,'AUTOCOMMIT'); +insert into help_keyword (help_keyword_id,name) values (207,'REVOKE'); +insert into help_keyword (help_keyword_id,name) values (208,'GRANTS'); +insert into help_keyword (help_keyword_id,name) values (209,'OUTER'); +insert into help_keyword (help_keyword_id,name) values (210,'CURSOR_NAME'); +insert into help_keyword (help_keyword_id,name) values (211,'FLOOR'); +insert into help_keyword (help_keyword_id,name) values (212,'EXPLAIN'); +insert into help_keyword (help_keyword_id,name) values (213,'WITH'); +insert into help_keyword (help_keyword_id,name) values (214,'AFTER'); +insert into help_keyword (help_keyword_id,name) values (215,'STD'); +insert into help_keyword (help_keyword_id,name) values (216,'CSV'); +insert into help_keyword (help_keyword_id,name) values (217,'DISABLE'); +insert into help_keyword (help_keyword_id,name) values (218,'UNINSTALL'); +insert into help_keyword (help_keyword_id,name) values (219,'OUTFILE'); +insert into help_keyword (help_keyword_id,name) values (220,'LOW_PRIORITY'); +insert into help_keyword (help_keyword_id,name) values (221,'FILE'); +insert into help_keyword (help_keyword_id,name) values (222,'NODEGROUP'); +insert into help_keyword (help_keyword_id,name) values (223,'SCHEMA'); +insert into help_keyword (help_keyword_id,name) values (224,'SONAME'); +insert into help_keyword (help_keyword_id,name) values (225,'POW'); +insert into help_keyword (help_keyword_id,name) values (226,'DUAL'); +insert into help_keyword (help_keyword_id,name) values (227,'MULTIPOINTFROMWKB'); +insert into help_keyword (help_keyword_id,name) values (228,'INDEX'); +insert into help_keyword (help_keyword_id,name) values (229,'MULTIPOINTFROMTEXT'); +insert into help_keyword (help_keyword_id,name) values (230,'DEFINER'); +insert into help_keyword (help_keyword_id,name) values (231,'MASTER_BIND'); +insert into help_keyword (help_keyword_id,name) values (232,'REMOVE'); +insert into help_keyword (help_keyword_id,name) values (233,'EXTENDED'); +insert into help_keyword (help_keyword_id,name) values (234,'MULTILINESTRINGFROMWKB'); +insert into help_keyword (help_keyword_id,name) values (235,'CROSS'); +insert into help_keyword (help_keyword_id,name) values (236,'CONTRIBUTORS'); +insert into help_keyword (help_keyword_id,name) values (237,'NATIONAL'); +insert into help_keyword (help_keyword_id,name) values (238,'GROUP'); +insert into help_keyword (help_keyword_id,name) values (239,'SHA'); +insert into help_keyword (help_keyword_id,name) values (240,'ONLINE'); +insert into help_keyword (help_keyword_id,name) values (241,'UNDO'); +insert into help_keyword (help_keyword_id,name) values (242,'IGNORE_SERVER_IDS'); +insert into help_keyword (help_keyword_id,name) values (243,'ZEROFILL'); +insert into help_keyword (help_keyword_id,name) values (244,'CLIENT'); +insert into help_keyword (help_keyword_id,name) values (245,'MASTER_PASSWORD'); +insert into help_keyword (help_keyword_id,name) values (246,'OWNER'); +insert into help_keyword (help_keyword_id,name) values (247,'RELAY_LOG_FILE'); +insert into help_keyword (help_keyword_id,name) values (248,'TRUE'); +insert into help_keyword (help_keyword_id,name) values (249,'CHARACTER'); +insert into help_keyword (help_keyword_id,name) values (250,'MASTER_USER'); +insert into help_keyword (help_keyword_id,name) values (251,'SCHEMA_NAME'); +insert into help_keyword (help_keyword_id,name) values (252,'TABLE'); +insert into help_keyword (help_keyword_id,name) values (253,'ENGINE'); +insert into help_keyword (help_keyword_id,name) values (254,'INSERT_METHOD'); +insert into help_keyword (help_keyword_id,name) values (255,'CASCADE'); +insert into help_keyword (help_keyword_id,name) values (256,'RELAY_LOG_POS'); +insert into help_keyword (help_keyword_id,name) values (257,'SQL_CALC_FOUND_ROWS'); +insert into help_keyword (help_keyword_id,name) values (258,'UNION'); +insert into help_keyword (help_keyword_id,name) values (259,'MYISAM'); +insert into help_keyword (help_keyword_id,name) values (260,'LEAVE'); +insert into help_keyword (help_keyword_id,name) values (261,'MODIFY'); +insert into help_keyword (help_keyword_id,name) values (262,'MATCH'); +insert into help_keyword (help_keyword_id,name) values (263,'MASTER_LOG_POS'); +insert into help_keyword (help_keyword_id,name) values (264,'DISTINCTROW'); +insert into help_keyword (help_keyword_id,name) values (265,'DESC'); +insert into help_keyword (help_keyword_id,name) values (266,'TIME'); +insert into help_keyword (help_keyword_id,name) values (267,'NUMERIC'); +insert into help_keyword (help_keyword_id,name) values (268,'EXPANSION'); +insert into help_keyword (help_keyword_id,name) values (269,'CODE'); +insert into help_keyword (help_keyword_id,name) values (270,'CURSOR'); +insert into help_keyword (help_keyword_id,name) values (271,'GEOMETRYCOLLECTIONFROMTEXT'); +insert into help_keyword (help_keyword_id,name) values (272,'CHAIN'); +insert into help_keyword (help_keyword_id,name) values (273,'LOGFILE'); +insert into help_keyword (help_keyword_id,name) values (274,'FLUSH'); +insert into help_keyword (help_keyword_id,name) values (275,'CREATE'); +insert into help_keyword (help_keyword_id,name) values (276,'DESCRIBE'); +insert into help_keyword (help_keyword_id,name) values (277,'EXTENT_SIZE'); +insert into help_keyword (help_keyword_id,name) values (278,'MAX_UPDATES_PER_HOUR'); +insert into help_keyword (help_keyword_id,name) values (279,'INT2'); +insert into help_keyword (help_keyword_id,name) values (280,'PROCESSLIST'); +insert into help_keyword (help_keyword_id,name) values (281,'ENDS'); +insert into help_keyword (help_keyword_id,name) values (282,'LOGS'); +insert into help_keyword (help_keyword_id,name) values (283,'DISCARD'); +insert into help_keyword (help_keyword_id,name) values (284,'HEAP'); +insert into help_keyword (help_keyword_id,name) values (285,'SOUNDS'); +insert into help_keyword (help_keyword_id,name) values (286,'BETWEEN'); +insert into help_keyword (help_keyword_id,name) values (287,'MULTILINESTRINGFROMTEXT'); +insert into help_keyword (help_keyword_id,name) values (288,'REPAIR'); +insert into help_keyword (help_keyword_id,name) values (289,'PACK_KEYS'); +insert into help_keyword (help_keyword_id,name) values (290,'FAST'); +insert into help_keyword (help_keyword_id,name) values (291,'VALUES'); +insert into help_keyword (help_keyword_id,name) values (292,'CALL'); +insert into help_keyword (help_keyword_id,name) values (293,'LOOP'); +insert into help_keyword (help_keyword_id,name) values (294,'VARCHARACTER'); +insert into help_keyword (help_keyword_id,name) values (295,'BEFORE'); +insert into help_keyword (help_keyword_id,name) values (296,'TRUNCATE'); +insert into help_keyword (help_keyword_id,name) values (297,'SHOW'); +insert into help_keyword (help_keyword_id,name) values (298,'ALL'); +insert into help_keyword (help_keyword_id,name) values (299,'REDUNDANT'); +insert into help_keyword (help_keyword_id,name) values (300,'USER_RESOURCES'); +insert into help_keyword (help_keyword_id,name) values (301,'PARTIAL'); +insert into help_keyword (help_keyword_id,name) values (302,'BINLOG'); +insert into help_keyword (help_keyword_id,name) values (303,'END'); +insert into help_keyword (help_keyword_id,name) values (304,'SECOND'); +insert into help_keyword (help_keyword_id,name) values (305,'AND'); +insert into help_keyword (help_keyword_id,name) values (306,'FLOAT8'); +insert into help_keyword (help_keyword_id,name) values (307,'PREV'); +insert into help_keyword (help_keyword_id,name) values (308,'HOUR'); +insert into help_keyword (help_keyword_id,name) values (309,'SELECT'); +insert into help_keyword (help_keyword_id,name) values (310,'DATABASES'); +insert into help_keyword (help_keyword_id,name) values (311,'OR'); +insert into help_keyword (help_keyword_id,name) values (312,'IDENTIFIED'); +insert into help_keyword (help_keyword_id,name) values (313,'WRAPPER'); +insert into help_keyword (help_keyword_id,name) values (314,'MASTER_SSL_CIPHER'); +insert into help_keyword (help_keyword_id,name) values (315,'SQL_SLAVE_SKIP_COUNTER'); +insert into help_keyword (help_keyword_id,name) values (316,'BOTH'); +insert into help_keyword (help_keyword_id,name) values (317,'BOOL'); +insert into help_keyword (help_keyword_id,name) values (318,'YEAR'); +insert into help_keyword (help_keyword_id,name) values (319,'MASTER_PORT'); +insert into help_keyword (help_keyword_id,name) values (320,'CONCURRENT'); +insert into help_keyword (help_keyword_id,name) values (321,'HELP'); +insert into help_keyword (help_keyword_id,name) values (322,'UNIQUE'); +insert into help_keyword (help_keyword_id,name) values (323,'TRIGGERS'); +insert into help_keyword (help_keyword_id,name) values (324,'PROCESS'); +insert into help_keyword (help_keyword_id,name) values (325,'OPTIONS'); +insert into help_keyword (help_keyword_id,name) values (326,'RESIGNAL'); +insert into help_keyword (help_keyword_id,name) values (327,'CONSISTENT'); +insert into help_keyword (help_keyword_id,name) values (328,'MASTER_SSL'); +insert into help_keyword (help_keyword_id,name) values (329,'DATE_ADD'); +insert into help_keyword (help_keyword_id,name) values (330,'MAX_CONNECTIONS_PER_HOUR'); +insert into help_keyword (help_keyword_id,name) values (331,'LIKE'); +insert into help_keyword (help_keyword_id,name) values (332,'PLUGIN'); +insert into help_keyword (help_keyword_id,name) values (333,'FETCH'); +insert into help_keyword (help_keyword_id,name) values (334,'IN'); +insert into help_keyword (help_keyword_id,name) values (335,'COLUMN'); +insert into help_keyword (help_keyword_id,name) values (336,'DUMPFILE'); +insert into help_keyword (help_keyword_id,name) values (337,'USAGE'); +insert into help_keyword (help_keyword_id,name) values (338,'EXECUTE'); +insert into help_keyword (help_keyword_id,name) values (339,'MEMORY'); +insert into help_keyword (help_keyword_id,name) values (340,'CEIL'); +insert into help_keyword (help_keyword_id,name) values (341,'QUERY'); +insert into help_keyword (help_keyword_id,name) values (342,'MASTER_HOST'); +insert into help_keyword (help_keyword_id,name) values (343,'LINES'); +insert into help_keyword (help_keyword_id,name) values (344,'SQL_THREAD'); +insert into help_keyword (help_keyword_id,name) values (345,'SERVER'); +insert into help_keyword (help_keyword_id,name) values (346,'MAX_QUERIES_PER_HOUR'); +insert into help_keyword (help_keyword_id,name) values (347,'MASTER_SSL_CERT'); +insert into help_keyword (help_keyword_id,name) values (348,'MULTIPOLYGONFROMWKB'); +insert into help_keyword (help_keyword_id,name) values (349,'TRANSACTION'); +insert into help_keyword (help_keyword_id,name) values (350,'DAY_MINUTE'); +insert into help_keyword (help_keyword_id,name) values (351,'STDDEV'); +insert into help_keyword (help_keyword_id,name) values (352,'DATE_SUB'); +insert into help_keyword (help_keyword_id,name) values (353,'REBUILD'); +insert into help_keyword (help_keyword_id,name) values (354,'GEOMETRYFROMWKB'); +insert into help_keyword (help_keyword_id,name) values (355,'INT1'); +insert into help_keyword (help_keyword_id,name) values (356,'RENAME'); +insert into help_keyword (help_keyword_id,name) values (357,'PARSER'); +insert into help_keyword (help_keyword_id,name) values (358,'RIGHT'); +insert into help_keyword (help_keyword_id,name) values (359,'ALTER'); +insert into help_keyword (help_keyword_id,name) values (360,'MAX_ROWS'); +insert into help_keyword (help_keyword_id,name) values (361,'SOCKET'); +insert into help_keyword (help_keyword_id,name) values (362,'STRAIGHT_JOIN'); +insert into help_keyword (help_keyword_id,name) values (363,'NATURAL'); +insert into help_keyword (help_keyword_id,name) values (364,'VARIABLES'); +insert into help_keyword (help_keyword_id,name) values (365,'ESCAPED'); +insert into help_keyword (help_keyword_id,name) values (366,'SHA1'); +insert into help_keyword (help_keyword_id,name) values (367,'KEY_BLOCK_SIZE'); +insert into help_keyword (help_keyword_id,name) values (368,'PASSWORD'); +insert into help_keyword (help_keyword_id,name) values (369,'OFFSET'); +insert into help_keyword (help_keyword_id,name) values (370,'CHAR'); +insert into help_keyword (help_keyword_id,name) values (371,'NEXT'); +insert into help_keyword (help_keyword_id,name) values (372,'ERRORS'); +insert into help_keyword (help_keyword_id,name) values (373,'SQL_LOG_BIN'); +insert into help_keyword (help_keyword_id,name) values (374,'TEMPORARY'); +insert into help_keyword (help_keyword_id,name) values (375,'COMMITTED'); +insert into help_keyword (help_keyword_id,name) values (376,'SQL_SMALL_RESULT'); +insert into help_keyword (help_keyword_id,name) values (377,'UPGRADE'); +insert into help_keyword (help_keyword_id,name) values (378,'BEGIN'); +insert into help_keyword (help_keyword_id,name) values (379,'DELAY_KEY_WRITE'); +insert into help_keyword (help_keyword_id,name) values (380,'PROFILE'); +insert into help_keyword (help_keyword_id,name) values (381,'MEDIUM'); +insert into help_keyword (help_keyword_id,name) values (382,'INTERVAL'); +insert into help_keyword (help_keyword_id,name) values (383,'SSL'); +insert into help_keyword (help_keyword_id,name) values (384,'DAY_HOUR'); +insert into help_keyword (help_keyword_id,name) values (385,'NAME'); +insert into help_keyword (help_keyword_id,name) values (386,'REFERENCES'); +insert into help_keyword (help_keyword_id,name) values (387,'AES_ENCRYPT'); +insert into help_keyword (help_keyword_id,name) values (388,'STORAGE'); +insert into help_keyword (help_keyword_id,name) values (389,'ISOLATION'); +insert into help_keyword (help_keyword_id,name) values (390,'CEILING'); +insert into help_keyword (help_keyword_id,name) values (391,'EVERY'); +insert into help_keyword (help_keyword_id,name) values (392,'INT8'); +insert into help_keyword (help_keyword_id,name) values (393,'AUTHORS'); +insert into help_keyword (help_keyword_id,name) values (394,'RESTRICT'); +insert into help_keyword (help_keyword_id,name) values (395,'UNCOMMITTED'); +insert into help_keyword (help_keyword_id,name) values (396,'LINESTRINGFROMTEXT'); +insert into help_keyword (help_keyword_id,name) values (397,'IS'); +insert into help_keyword (help_keyword_id,name) values (398,'NOT'); +insert into help_keyword (help_keyword_id,name) values (399,'ANALYSE'); +insert into help_keyword (help_keyword_id,name) values (400,'DATAFILE'); +insert into help_keyword (help_keyword_id,name) values (401,'DES_KEY_FILE'); +insert into help_keyword (help_keyword_id,name) values (402,'SIGNAL'); +insert into help_keyword (help_keyword_id,name) values (403,'COMPRESSED'); +insert into help_keyword (help_keyword_id,name) values (404,'START'); +insert into help_keyword (help_keyword_id,name) values (405,'PLUGINS'); +insert into help_keyword (help_keyword_id,name) values (406,'SAVEPOINT'); +insert into help_keyword (help_keyword_id,name) values (407,'IF'); +insert into help_keyword (help_keyword_id,name) values (408,'ROWS'); +insert into help_keyword (help_keyword_id,name) values (409,'PRIMARY'); +insert into help_keyword (help_keyword_id,name) values (410,'PURGE'); +insert into help_keyword (help_keyword_id,name) values (411,'LAST'); +insert into help_keyword (help_keyword_id,name) values (412,'USER'); +insert into help_keyword (help_keyword_id,name) values (413,'EXIT'); +insert into help_keyword (help_keyword_id,name) values (414,'KEYS'); +insert into help_keyword (help_keyword_id,name) values (415,'LIMIT'); +insert into help_keyword (help_keyword_id,name) values (416,'KEY'); +insert into help_keyword (help_keyword_id,name) values (417,'MERGE'); +insert into help_keyword (help_keyword_id,name) values (418,'UNTIL'); +insert into help_keyword (help_keyword_id,name) values (419,'SQL_NO_CACHE'); +insert into help_keyword (help_keyword_id,name) values (420,'DELAYED'); +insert into help_keyword (help_keyword_id,name) values (421,'CONSTRAINT_SCHEMA'); +insert into help_keyword (help_keyword_id,name) values (422,'ANALYZE'); +insert into help_keyword (help_keyword_id,name) values (423,'CONSTRAINT'); +insert into help_keyword (help_keyword_id,name) values (424,'SERIAL'); +insert into help_keyword (help_keyword_id,name) values (425,'ACTION'); +insert into help_keyword (help_keyword_id,name) values (426,'WRITE'); +insert into help_keyword (help_keyword_id,name) values (427,'INITIAL_SIZE'); +insert into help_keyword (help_keyword_id,name) values (428,'SESSION'); +insert into help_keyword (help_keyword_id,name) values (429,'DATABASE'); +insert into help_keyword (help_keyword_id,name) values (430,'NULL'); +insert into help_keyword (help_keyword_id,name) values (431,'POWER'); +insert into help_keyword (help_keyword_id,name) values (432,'USE_FRM'); +insert into help_keyword (help_keyword_id,name) values (433,'TERMINATED'); +insert into help_keyword (help_keyword_id,name) values (434,'SLAVE'); +insert into help_keyword (help_keyword_id,name) values (435,'NVARCHAR'); +insert into help_keyword (help_keyword_id,name) values (436,'ASC'); +insert into help_keyword (help_keyword_id,name) values (437,'RETURN'); +insert into help_keyword (help_keyword_id,name) values (438,'OPTIONALLY'); +insert into help_keyword (help_keyword_id,name) values (439,'ENABLE'); +insert into help_keyword (help_keyword_id,name) values (440,'DIRECTORY'); +insert into help_keyword (help_keyword_id,name) values (441,'MAX_USER_CONNECTIONS'); +insert into help_keyword (help_keyword_id,name) values (442,'WHILE'); +insert into help_keyword (help_keyword_id,name) values (443,'LOCAL'); +insert into help_keyword (help_keyword_id,name) values (444,'DISTINCT'); +insert into help_keyword (help_keyword_id,name) values (445,'AES_DECRYPT'); +insert into help_keyword (help_keyword_id,name) values (446,'MASTER_SSL_KEY'); +insert into help_keyword (help_keyword_id,name) values (447,'NONE'); +insert into help_keyword (help_keyword_id,name) values (448,'TABLES'); +insert into help_keyword (help_keyword_id,name) values (449,'<>'); +insert into help_keyword (help_keyword_id,name) values (450,'RLIKE'); +insert into help_keyword (help_keyword_id,name) values (451,'TRIGGER'); +insert into help_keyword (help_keyword_id,name) values (452,'COLLATION'); +insert into help_keyword (help_keyword_id,name) values (453,'SHUTDOWN'); +insert into help_keyword (help_keyword_id,name) values (454,'HIGH_PRIORITY'); +insert into help_keyword (help_keyword_id,name) values (455,'BTREE'); +insert into help_keyword (help_keyword_id,name) values (456,'FIRST'); +insert into help_keyword (help_keyword_id,name) values (457,'COALESCE'); +insert into help_keyword (help_keyword_id,name) values (458,'WAIT'); +insert into help_keyword (help_keyword_id,name) values (459,'CATALOG_NAME'); +insert into help_keyword (help_keyword_id,name) values (460,'MASTER'); +insert into help_keyword (help_keyword_id,name) values (461,'FIXED'); +insert into help_keyword (help_keyword_id,name) values (462,'MULTIPOLYGONFROMTEXT'); +insert into help_keyword (help_keyword_id,name) values (463,'ROW_FORMAT'); insert into help_relation (help_topic_id,help_keyword_id) values (1,0); -insert into help_relation (help_topic_id,help_keyword_id) values (353,0); -insert into help_relation (help_topic_id,help_keyword_id) values (469,1); -insert into help_relation (help_topic_id,help_keyword_id) values (228,2); -insert into help_relation (help_topic_id,help_keyword_id) values (445,3); +insert into help_relation (help_topic_id,help_keyword_id) values (356,0); +insert into help_relation (help_topic_id,help_keyword_id) values (473,1); +insert into help_relation (help_topic_id,help_keyword_id) values (232,2); +insert into help_relation (help_topic_id,help_keyword_id) values (447,3); insert into help_relation (help_topic_id,help_keyword_id) values (3,4); -insert into help_relation (help_topic_id,help_keyword_id) values (420,4); -insert into help_relation (help_topic_id,help_keyword_id) values (87,5); -insert into help_relation (help_topic_id,help_keyword_id) values (405,6); -insert into help_relation (help_topic_id,help_keyword_id) values (87,6); -insert into help_relation (help_topic_id,help_keyword_id) values (95,7); -insert into help_relation (help_topic_id,help_keyword_id) values (87,8); -insert into help_relation (help_topic_id,help_keyword_id) values (184,9); -insert into help_relation (help_topic_id,help_keyword_id) values (428,10); -insert into help_relation (help_topic_id,help_keyword_id) values (344,11); +insert into help_relation (help_topic_id,help_keyword_id) values (130,4); +insert into help_relation (help_topic_id,help_keyword_id) values (421,4); +insert into help_relation (help_topic_id,help_keyword_id) values (89,5); +insert into help_relation (help_topic_id,help_keyword_id) values (406,6); +insert into help_relation (help_topic_id,help_keyword_id) values (89,6); +insert into help_relation (help_topic_id,help_keyword_id) values (97,7); +insert into help_relation (help_topic_id,help_keyword_id) values (89,8); +insert into help_relation (help_topic_id,help_keyword_id) values (185,9); +insert into help_relation (help_topic_id,help_keyword_id) values (430,10); +insert into help_relation (help_topic_id,help_keyword_id) values (347,11); insert into help_relation (help_topic_id,help_keyword_id) values (21,11); -insert into help_relation (help_topic_id,help_keyword_id) values (420,11); -insert into help_relation (help_topic_id,help_keyword_id) values (405,12); -insert into help_relation (help_topic_id,help_keyword_id) values (87,12); -insert into help_relation (help_topic_id,help_keyword_id) values (143,13); -insert into help_relation (help_topic_id,help_keyword_id) values (226,14); -insert into help_relation (help_topic_id,help_keyword_id) values (86,15); -insert into help_relation (help_topic_id,help_keyword_id) values (353,15); -insert into help_relation (help_topic_id,help_keyword_id) values (16,16); -insert into help_relation (help_topic_id,help_keyword_id) values (130,16); -insert into help_relation (help_topic_id,help_keyword_id) values (344,16); -insert into help_relation (help_topic_id,help_keyword_id) values (104,16); -insert into help_relation (help_topic_id,help_keyword_id) values (496,17); -insert into help_relation (help_topic_id,help_keyword_id) values (95,17); -insert into help_relation (help_topic_id,help_keyword_id) values (378,18); +insert into help_relation (help_topic_id,help_keyword_id) values (468,11); +insert into help_relation (help_topic_id,help_keyword_id) values (421,11); +insert into help_relation (help_topic_id,help_keyword_id) values (463,11); +insert into help_relation (help_topic_id,help_keyword_id) values (406,12); +insert into help_relation (help_topic_id,help_keyword_id) values (89,12); +insert into help_relation (help_topic_id,help_keyword_id) values (146,13); +insert into help_relation (help_topic_id,help_keyword_id) values (230,14); +insert into help_relation (help_topic_id,help_keyword_id) values (88,15); +insert into help_relation (help_topic_id,help_keyword_id) values (356,15); +insert into help_relation (help_topic_id,help_keyword_id) values (18,16); +insert into help_relation (help_topic_id,help_keyword_id) values (134,16); +insert into help_relation (help_topic_id,help_keyword_id) values (347,16); +insert into help_relation (help_topic_id,help_keyword_id) values (106,16); +insert into help_relation (help_topic_id,help_keyword_id) values (500,17); +insert into help_relation (help_topic_id,help_keyword_id) values (97,17); +insert into help_relation (help_topic_id,help_keyword_id) values (380,18); +insert into help_relation (help_topic_id,help_keyword_id) values (459,19); insert into help_relation (help_topic_id,help_keyword_id) values (3,19); -insert into help_relation (help_topic_id,help_keyword_id) values (102,19); -insert into help_relation (help_topic_id,help_keyword_id) values (239,19); -insert into help_relation (help_topic_id,help_keyword_id) values (184,20); -insert into help_relation (help_topic_id,help_keyword_id) values (353,21); -insert into help_relation (help_topic_id,help_keyword_id) values (474,22); +insert into help_relation (help_topic_id,help_keyword_id) values (374,19); +insert into help_relation (help_topic_id,help_keyword_id) values (104,19); +insert into help_relation (help_topic_id,help_keyword_id) values (243,19); +insert into help_relation (help_topic_id,help_keyword_id) values (185,20); +insert into help_relation (help_topic_id,help_keyword_id) values (356,21); +insert into help_relation (help_topic_id,help_keyword_id) values (478,22); insert into help_relation (help_topic_id,help_keyword_id) values (34,22); -insert into help_relation (help_topic_id,help_keyword_id) values (233,22); -insert into help_relation (help_topic_id,help_keyword_id) values (297,22); +insert into help_relation (help_topic_id,help_keyword_id) values (237,22); +insert into help_relation (help_topic_id,help_keyword_id) values (300,22); insert into help_relation (help_topic_id,help_keyword_id) values (9,22); -insert into help_relation (help_topic_id,help_keyword_id) values (414,22); -insert into help_relation (help_topic_id,help_keyword_id) values (273,22); insert into help_relation (help_topic_id,help_keyword_id) values (415,22); +insert into help_relation (help_topic_id,help_keyword_id) values (276,22); +insert into help_relation (help_topic_id,help_keyword_id) values (416,22); insert into help_relation (help_topic_id,help_keyword_id) values (30,22); -insert into help_relation (help_topic_id,help_keyword_id) values (85,22); -insert into help_relation (help_topic_id,help_keyword_id) values (260,22); -insert into help_relation (help_topic_id,help_keyword_id) values (185,22); -insert into help_relation (help_topic_id,help_keyword_id) values (404,22); -insert into help_relation (help_topic_id,help_keyword_id) values (328,22); -insert into help_relation (help_topic_id,help_keyword_id) values (459,22); -insert into help_relation (help_topic_id,help_keyword_id) values (106,23); -insert into help_relation (help_topic_id,help_keyword_id) values (120,24); -insert into help_relation (help_topic_id,help_keyword_id) values (167,24); -insert into help_relation (help_topic_id,help_keyword_id) values (374,25); -insert into help_relation (help_topic_id,help_keyword_id) values (256,26); -insert into help_relation (help_topic_id,help_keyword_id) values (80,27); -insert into help_relation (help_topic_id,help_keyword_id) values (102,28); -insert into help_relation (help_topic_id,help_keyword_id) values (197,29); -insert into help_relation (help_topic_id,help_keyword_id) values (36,30); -insert into help_relation (help_topic_id,help_keyword_id) values (399,31); -insert into help_relation (help_topic_id,help_keyword_id) values (344,31); -insert into help_relation (help_topic_id,help_keyword_id) values (464,31); -insert into help_relation (help_topic_id,help_keyword_id) values (374,32); -insert into help_relation (help_topic_id,help_keyword_id) values (197,33); -insert into help_relation (help_topic_id,help_keyword_id) values (35,34); -insert into help_relation (help_topic_id,help_keyword_id) values (233,34); -insert into help_relation (help_topic_id,help_keyword_id) values (36,35); -insert into help_relation (help_topic_id,help_keyword_id) values (353,35); -insert into help_relation (help_topic_id,help_keyword_id) values (464,36); -insert into help_relation (help_topic_id,help_keyword_id) values (416,37); -insert into help_relation (help_topic_id,help_keyword_id) values (464,37); -insert into help_relation (help_topic_id,help_keyword_id) values (459,37); -insert into help_relation (help_topic_id,help_keyword_id) values (344,38); -insert into help_relation (help_topic_id,help_keyword_id) values (21,38); -insert into help_relation (help_topic_id,help_keyword_id) values (291,38); -insert into help_relation (help_topic_id,help_keyword_id) values (464,38); -insert into help_relation (help_topic_id,help_keyword_id) values (449,38); -insert into help_relation (help_topic_id,help_keyword_id) values (496,39); -insert into help_relation (help_topic_id,help_keyword_id) values (48,40); -insert into help_relation (help_topic_id,help_keyword_id) values (464,40); -insert into help_relation (help_topic_id,help_keyword_id) values (81,40); -insert into help_relation (help_topic_id,help_keyword_id) values (197,40); -insert into help_relation (help_topic_id,help_keyword_id) values (353,40); -insert into help_relation (help_topic_id,help_keyword_id) values (420,40); -insert into help_relation (help_topic_id,help_keyword_id) values (360,40); -insert into help_relation (help_topic_id,help_keyword_id) values (459,40); -insert into help_relation (help_topic_id,help_keyword_id) values (75,40); -insert into help_relation (help_topic_id,help_keyword_id) values (468,41); -insert into help_relation (help_topic_id,help_keyword_id) values (464,41); -insert into help_relation (help_topic_id,help_keyword_id) values (374,42); -insert into help_relation (help_topic_id,help_keyword_id) values (464,43); -insert into help_relation (help_topic_id,help_keyword_id) values (459,43); -insert into help_relation (help_topic_id,help_keyword_id) values (469,44); -insert into help_relation (help_topic_id,help_keyword_id) values (116,44); -insert into help_relation (help_topic_id,help_keyword_id) values (464,44); -insert into help_relation (help_topic_id,help_keyword_id) values (209,44); -insert into help_relation (help_topic_id,help_keyword_id) values (420,44); -insert into help_relation (help_topic_id,help_keyword_id) values (374,45); -insert into help_relation (help_topic_id,help_keyword_id) values (353,46); -insert into help_relation (help_topic_id,help_keyword_id) values (311,47); -insert into help_relation (help_topic_id,help_keyword_id) values (95,47); -insert into help_relation (help_topic_id,help_keyword_id) values (360,48); -insert into help_relation (help_topic_id,help_keyword_id) values (184,49); -insert into help_relation (help_topic_id,help_keyword_id) values (468,50); +insert into help_relation (help_topic_id,help_keyword_id) values (87,22); +insert into help_relation (help_topic_id,help_keyword_id) values (263,22); +insert into help_relation (help_topic_id,help_keyword_id) values (186,22); +insert into help_relation (help_topic_id,help_keyword_id) values (405,22); +insert into help_relation (help_topic_id,help_keyword_id) values (331,22); +insert into help_relation (help_topic_id,help_keyword_id) values (463,22); +insert into help_relation (help_topic_id,help_keyword_id) values (108,23); +insert into help_relation (help_topic_id,help_keyword_id) values (424,24); +insert into help_relation (help_topic_id,help_keyword_id) values (122,24); +insert into help_relation (help_topic_id,help_keyword_id) values (170,24); +insert into help_relation (help_topic_id,help_keyword_id) values (376,25); +insert into help_relation (help_topic_id,help_keyword_id) values (82,26); +insert into help_relation (help_topic_id,help_keyword_id) values (104,27); +insert into help_relation (help_topic_id,help_keyword_id) values (199,28); +insert into help_relation (help_topic_id,help_keyword_id) values (36,29); +insert into help_relation (help_topic_id,help_keyword_id) values (347,30); +insert into help_relation (help_topic_id,help_keyword_id) values (468,30); +insert into help_relation (help_topic_id,help_keyword_id) values (376,31); +insert into help_relation (help_topic_id,help_keyword_id) values (199,32); +insert into help_relation (help_topic_id,help_keyword_id) values (35,33); +insert into help_relation (help_topic_id,help_keyword_id) values (237,33); +insert into help_relation (help_topic_id,help_keyword_id) values (36,34); +insert into help_relation (help_topic_id,help_keyword_id) values (356,34); +insert into help_relation (help_topic_id,help_keyword_id) values (468,35); +insert into help_relation (help_topic_id,help_keyword_id) values (417,36); +insert into help_relation (help_topic_id,help_keyword_id) values (468,36); +insert into help_relation (help_topic_id,help_keyword_id) values (463,36); +insert into help_relation (help_topic_id,help_keyword_id) values (347,37); +insert into help_relation (help_topic_id,help_keyword_id) values (21,37); +insert into help_relation (help_topic_id,help_keyword_id) values (294,37); +insert into help_relation (help_topic_id,help_keyword_id) values (468,37); +insert into help_relation (help_topic_id,help_keyword_id) values (451,37); +insert into help_relation (help_topic_id,help_keyword_id) values (500,38); +insert into help_relation (help_topic_id,help_keyword_id) values (130,39); +insert into help_relation (help_topic_id,help_keyword_id) values (48,39); +insert into help_relation (help_topic_id,help_keyword_id) values (468,39); +insert into help_relation (help_topic_id,help_keyword_id) values (83,39); +insert into help_relation (help_topic_id,help_keyword_id) values (199,39); +insert into help_relation (help_topic_id,help_keyword_id) values (356,39); +insert into help_relation (help_topic_id,help_keyword_id) values (421,39); +insert into help_relation (help_topic_id,help_keyword_id) values (77,39); +insert into help_relation (help_topic_id,help_keyword_id) values (361,39); +insert into help_relation (help_topic_id,help_keyword_id) values (463,39); +insert into help_relation (help_topic_id,help_keyword_id) values (472,40); +insert into help_relation (help_topic_id,help_keyword_id) values (468,40); +insert into help_relation (help_topic_id,help_keyword_id) values (376,41); +insert into help_relation (help_topic_id,help_keyword_id) values (468,42); +insert into help_relation (help_topic_id,help_keyword_id) values (463,42); +insert into help_relation (help_topic_id,help_keyword_id) values (473,43); +insert into help_relation (help_topic_id,help_keyword_id) values (468,43); +insert into help_relation (help_topic_id,help_keyword_id) values (212,43); +insert into help_relation (help_topic_id,help_keyword_id) values (421,43); +insert into help_relation (help_topic_id,help_keyword_id) values (376,44); +insert into help_relation (help_topic_id,help_keyword_id) values (356,45); +insert into help_relation (help_topic_id,help_keyword_id) values (314,46); +insert into help_relation (help_topic_id,help_keyword_id) values (97,46); +insert into help_relation (help_topic_id,help_keyword_id) values (361,47); +insert into help_relation (help_topic_id,help_keyword_id) values (459,48); +insert into help_relation (help_topic_id,help_keyword_id) values (374,48); +insert into help_relation (help_topic_id,help_keyword_id) values (185,49); +insert into help_relation (help_topic_id,help_keyword_id) values (472,50); insert into help_relation (help_topic_id,help_keyword_id) values (48,50); -insert into help_relation (help_topic_id,help_keyword_id) values (464,50); -insert into help_relation (help_topic_id,help_keyword_id) values (405,51); -insert into help_relation (help_topic_id,help_keyword_id) values (468,51); +insert into help_relation (help_topic_id,help_keyword_id) values (468,50); +insert into help_relation (help_topic_id,help_keyword_id) values (406,51); +insert into help_relation (help_topic_id,help_keyword_id) values (472,51); insert into help_relation (help_topic_id,help_keyword_id) values (1,51); -insert into help_relation (help_topic_id,help_keyword_id) values (87,51); -insert into help_relation (help_topic_id,help_keyword_id) values (173,52); -insert into help_relation (help_topic_id,help_keyword_id) values (464,52); -insert into help_relation (help_topic_id,help_keyword_id) values (51,53); -insert into help_relation (help_topic_id,help_keyword_id) values (104,53); -insert into help_relation (help_topic_id,help_keyword_id) values (197,54); -insert into help_relation (help_topic_id,help_keyword_id) values (191,55); -insert into help_relation (help_topic_id,help_keyword_id) values (55,55); -insert into help_relation (help_topic_id,help_keyword_id) values (1,55); -insert into help_relation (help_topic_id,help_keyword_id) values (48,56); -insert into help_relation (help_topic_id,help_keyword_id) values (81,56); -insert into help_relation (help_topic_id,help_keyword_id) values (104,56); -insert into help_relation (help_topic_id,help_keyword_id) values (190,57); -insert into help_relation (help_topic_id,help_keyword_id) values (245,57); -insert into help_relation (help_topic_id,help_keyword_id) values (197,57); -insert into help_relation (help_topic_id,help_keyword_id) values (207,58); -insert into help_relation (help_topic_id,help_keyword_id) values (459,58); -insert into help_relation (help_topic_id,help_keyword_id) values (405,59); -insert into help_relation (help_topic_id,help_keyword_id) values (87,59); -insert into help_relation (help_topic_id,help_keyword_id) values (297,59); -insert into help_relation (help_topic_id,help_keyword_id) values (355,59); -insert into help_relation (help_topic_id,help_keyword_id) values (197,60); -insert into help_relation (help_topic_id,help_keyword_id) values (353,61); -insert into help_relation (help_topic_id,help_keyword_id) values (1,62); -insert into help_relation (help_topic_id,help_keyword_id) values (353,62); -insert into help_relation (help_topic_id,help_keyword_id) values (102,62); -insert into help_relation (help_topic_id,help_keyword_id) values (81,62); -insert into help_relation (help_topic_id,help_keyword_id) values (420,62); -insert into help_relation (help_topic_id,help_keyword_id) values (459,62); -insert into help_relation (help_topic_id,help_keyword_id) values (462,63); -insert into help_relation (help_topic_id,help_keyword_id) values (416,63); -insert into help_relation (help_topic_id,help_keyword_id) values (48,63); -insert into help_relation (help_topic_id,help_keyword_id) values (226,64); -insert into help_relation (help_topic_id,help_keyword_id) values (85,65); -insert into help_relation (help_topic_id,help_keyword_id) values (207,65); -insert into help_relation (help_topic_id,help_keyword_id) values (459,65); -insert into help_relation (help_topic_id,help_keyword_id) values (197,66); -insert into help_relation (help_topic_id,help_keyword_id) values (191,67); -insert into help_relation (help_topic_id,help_keyword_id) values (464,68); -insert into help_relation (help_topic_id,help_keyword_id) values (89,69); -insert into help_relation (help_topic_id,help_keyword_id) values (478,69); -insert into help_relation (help_topic_id,help_keyword_id) values (383,70); -insert into help_relation (help_topic_id,help_keyword_id) values (445,71); -insert into help_relation (help_topic_id,help_keyword_id) values (1,72); -insert into help_relation (help_topic_id,help_keyword_id) values (39,73); -insert into help_relation (help_topic_id,help_keyword_id) values (266,73); -insert into help_relation (help_topic_id,help_keyword_id) values (226,73); -insert into help_relation (help_topic_id,help_keyword_id) values (266,74); -insert into help_relation (help_topic_id,help_keyword_id) values (457,74); -insert into help_relation (help_topic_id,help_keyword_id) values (184,74); -insert into help_relation (help_topic_id,help_keyword_id) values (184,75); -insert into help_relation (help_topic_id,help_keyword_id) values (459,75); -insert into help_relation (help_topic_id,help_keyword_id) values (405,76); -insert into help_relation (help_topic_id,help_keyword_id) values (87,76); -insert into help_relation (help_topic_id,help_keyword_id) values (374,77); -insert into help_relation (help_topic_id,help_keyword_id) values (468,78); -insert into help_relation (help_topic_id,help_keyword_id) values (353,78); -insert into help_relation (help_topic_id,help_keyword_id) values (102,78); -insert into help_relation (help_topic_id,help_keyword_id) values (81,78); -insert into help_relation (help_topic_id,help_keyword_id) values (405,79); -insert into help_relation (help_topic_id,help_keyword_id) values (87,79); -insert into help_relation (help_topic_id,help_keyword_id) values (301,80); -insert into help_relation (help_topic_id,help_keyword_id) values (3,80); -insert into help_relation (help_topic_id,help_keyword_id) values (353,80); -insert into help_relation (help_topic_id,help_keyword_id) values (102,80); -insert into help_relation (help_topic_id,help_keyword_id) values (464,81); -insert into help_relation (help_topic_id,help_keyword_id) values (253,82); -insert into help_relation (help_topic_id,help_keyword_id) values (191,83); -insert into help_relation (help_topic_id,help_keyword_id) values (374,84); -insert into help_relation (help_topic_id,help_keyword_id) values (127,85); -insert into help_relation (help_topic_id,help_keyword_id) values (143,86); -insert into help_relation (help_topic_id,help_keyword_id) values (457,86); -insert into help_relation (help_topic_id,help_keyword_id) values (207,87); -insert into help_relation (help_topic_id,help_keyword_id) values (18,88); -insert into help_relation (help_topic_id,help_keyword_id) values (344,88); -insert into help_relation (help_topic_id,help_keyword_id) values (437,88); -insert into help_relation (help_topic_id,help_keyword_id) values (299,88); -insert into help_relation (help_topic_id,help_keyword_id) values (484,88); -insert into help_relation (help_topic_id,help_keyword_id) values (415,88); -insert into help_relation (help_topic_id,help_keyword_id) values (325,88); -insert into help_relation (help_topic_id,help_keyword_id) values (353,88); -insert into help_relation (help_topic_id,help_keyword_id) values (183,88); -insert into help_relation (help_topic_id,help_keyword_id) values (187,89); -insert into help_relation (help_topic_id,help_keyword_id) values (97,89); -insert into help_relation (help_topic_id,help_keyword_id) values (420,90); -insert into help_relation (help_topic_id,help_keyword_id) values (459,90); -insert into help_relation (help_topic_id,help_keyword_id) values (86,91); -insert into help_relation (help_topic_id,help_keyword_id) values (400,92); -insert into help_relation (help_topic_id,help_keyword_id) values (464,92); -insert into help_relation (help_topic_id,help_keyword_id) values (67,93); -insert into help_relation (help_topic_id,help_keyword_id) values (431,93); -insert into help_relation (help_topic_id,help_keyword_id) values (327,93); -insert into help_relation (help_topic_id,help_keyword_id) values (282,94); -insert into help_relation (help_topic_id,help_keyword_id) values (83,95); -insert into help_relation (help_topic_id,help_keyword_id) values (57,95); -insert into help_relation (help_topic_id,help_keyword_id) values (28,95); -insert into help_relation (help_topic_id,help_keyword_id) values (192,96); -insert into help_relation (help_topic_id,help_keyword_id) values (102,96); -insert into help_relation (help_topic_id,help_keyword_id) values (482,96); -insert into help_relation (help_topic_id,help_keyword_id) values (298,96); -insert into help_relation (help_topic_id,help_keyword_id) values (344,97); -insert into help_relation (help_topic_id,help_keyword_id) values (279,97); -insert into help_relation (help_topic_id,help_keyword_id) values (310,98); -insert into help_relation (help_topic_id,help_keyword_id) values (104,98); -insert into help_relation (help_topic_id,help_keyword_id) values (469,99); -insert into help_relation (help_topic_id,help_keyword_id) values (374,100); -insert into help_relation (help_topic_id,help_keyword_id) values (152,101); -insert into help_relation (help_topic_id,help_keyword_id) values (30,101); -insert into help_relation (help_topic_id,help_keyword_id) values (87,101); -insert into help_relation (help_topic_id,help_keyword_id) values (297,101); -insert into help_relation (help_topic_id,help_keyword_id) values (185,101); -insert into help_relation (help_topic_id,help_keyword_id) values (9,101); -insert into help_relation (help_topic_id,help_keyword_id) values (273,101); -insert into help_relation (help_topic_id,help_keyword_id) values (344,102); -insert into help_relation (help_topic_id,help_keyword_id) values (364,102); -insert into help_relation (help_topic_id,help_keyword_id) values (143,103); -insert into help_relation (help_topic_id,help_keyword_id) values (457,103); -insert into help_relation (help_topic_id,help_keyword_id) values (86,104); -insert into help_relation (help_topic_id,help_keyword_id) values (24,104); -insert into help_relation (help_topic_id,help_keyword_id) values (110,105); -insert into help_relation (help_topic_id,help_keyword_id) values (172,105); -insert into help_relation (help_topic_id,help_keyword_id) values (3,106); -insert into help_relation (help_topic_id,help_keyword_id) values (152,106); -insert into help_relation (help_topic_id,help_keyword_id) values (464,106); -insert into help_relation (help_topic_id,help_keyword_id) values (196,106); -insert into help_relation (help_topic_id,help_keyword_id) values (209,106); -insert into help_relation (help_topic_id,help_keyword_id) values (102,106); -insert into help_relation (help_topic_id,help_keyword_id) values (239,106); -insert into help_relation (help_topic_id,help_keyword_id) values (459,106); -insert into help_relation (help_topic_id,help_keyword_id) values (459,107); -insert into help_relation (help_topic_id,help_keyword_id) values (462,108); -insert into help_relation (help_topic_id,help_keyword_id) values (324,108); -insert into help_relation (help_topic_id,help_keyword_id) values (112,108); -insert into help_relation (help_topic_id,help_keyword_id) values (466,108); -insert into help_relation (help_topic_id,help_keyword_id) values (112,109); -insert into help_relation (help_topic_id,help_keyword_id) values (459,109); -insert into help_relation (help_topic_id,help_keyword_id) values (38,110); -insert into help_relation (help_topic_id,help_keyword_id) values (117,110); -insert into help_relation (help_topic_id,help_keyword_id) values (261,110); -insert into help_relation (help_topic_id,help_keyword_id) values (148,110); -insert into help_relation (help_topic_id,help_keyword_id) values (122,111); -insert into help_relation (help_topic_id,help_keyword_id) values (418,112); -insert into help_relation (help_topic_id,help_keyword_id) values (405,113); -insert into help_relation (help_topic_id,help_keyword_id) values (87,113); -insert into help_relation (help_topic_id,help_keyword_id) values (123,113); -insert into help_relation (help_topic_id,help_keyword_id) values (492,113); -insert into help_relation (help_topic_id,help_keyword_id) values (218,114); -insert into help_relation (help_topic_id,help_keyword_id) values (330,115); -insert into help_relation (help_topic_id,help_keyword_id) values (127,115); -insert into help_relation (help_topic_id,help_keyword_id) values (3,115); -insert into help_relation (help_topic_id,help_keyword_id) values (152,115); -insert into help_relation (help_topic_id,help_keyword_id) values (490,115); -insert into help_relation (help_topic_id,help_keyword_id) values (209,115); -insert into help_relation (help_topic_id,help_keyword_id) values (102,115); -insert into help_relation (help_topic_id,help_keyword_id) values (459,115); -insert into help_relation (help_topic_id,help_keyword_id) values (136,115); -insert into help_relation (help_topic_id,help_keyword_id) values (344,115); -insert into help_relation (help_topic_id,help_keyword_id) values (464,115); -insert into help_relation (help_topic_id,help_keyword_id) values (81,115); -insert into help_relation (help_topic_id,help_keyword_id) values (143,115); -insert into help_relation (help_topic_id,help_keyword_id) values (468,115); -insert into help_relation (help_topic_id,help_keyword_id) values (180,115); -insert into help_relation (help_topic_id,help_keyword_id) values (353,115); -insert into help_relation (help_topic_id,help_keyword_id) values (420,115); -insert into help_relation (help_topic_id,help_keyword_id) values (473,115); -insert into help_relation (help_topic_id,help_keyword_id) values (197,116); -insert into help_relation (help_topic_id,help_keyword_id) values (259,117); -insert into help_relation (help_topic_id,help_keyword_id) values (129,117); -insert into help_relation (help_topic_id,help_keyword_id) values (226,117); -insert into help_relation (help_topic_id,help_keyword_id) values (374,117); -insert into help_relation (help_topic_id,help_keyword_id) values (344,118); -insert into help_relation (help_topic_id,help_keyword_id) values (333,118); -insert into help_relation (help_topic_id,help_keyword_id) values (364,118); -insert into help_relation (help_topic_id,help_keyword_id) values (220,118); -insert into help_relation (help_topic_id,help_keyword_id) values (399,118); -insert into help_relation (help_topic_id,help_keyword_id) values (58,118); -insert into help_relation (help_topic_id,help_keyword_id) values (325,118); -insert into help_relation (help_topic_id,help_keyword_id) values (133,118); -insert into help_relation (help_topic_id,help_keyword_id) values (212,118); -insert into help_relation (help_topic_id,help_keyword_id) values (464,119); -insert into help_relation (help_topic_id,help_keyword_id) values (207,119); -insert into help_relation (help_topic_id,help_keyword_id) values (459,119); -insert into help_relation (help_topic_id,help_keyword_id) values (191,120); -insert into help_relation (help_topic_id,help_keyword_id) values (405,120); -insert into help_relation (help_topic_id,help_keyword_id) values (87,120); -insert into help_relation (help_topic_id,help_keyword_id) values (464,120); -insert into help_relation (help_topic_id,help_keyword_id) values (184,121); -insert into help_relation (help_topic_id,help_keyword_id) values (1,122); -insert into help_relation (help_topic_id,help_keyword_id) values (52,123); -insert into help_relation (help_topic_id,help_keyword_id) values (184,124); -insert into help_relation (help_topic_id,help_keyword_id) values (464,125); -insert into help_relation (help_topic_id,help_keyword_id) values (311,126); -insert into help_relation (help_topic_id,help_keyword_id) values (197,127); -insert into help_relation (help_topic_id,help_keyword_id) values (453,128); -insert into help_relation (help_topic_id,help_keyword_id) values (251,129); -insert into help_relation (help_topic_id,help_keyword_id) values (282,130); -insert into help_relation (help_topic_id,help_keyword_id) values (245,131); -insert into help_relation (help_topic_id,help_keyword_id) values (197,131); -insert into help_relation (help_topic_id,help_keyword_id) values (459,132); -insert into help_relation (help_topic_id,help_keyword_id) values (83,133); -insert into help_relation (help_topic_id,help_keyword_id) values (57,133); -insert into help_relation (help_topic_id,help_keyword_id) values (233,134); -insert into help_relation (help_topic_id,help_keyword_id) values (52,135); -insert into help_relation (help_topic_id,help_keyword_id) values (321,135); -insert into help_relation (help_topic_id,help_keyword_id) values (83,136); -insert into help_relation (help_topic_id,help_keyword_id) values (57,136); -insert into help_relation (help_topic_id,help_keyword_id) values (197,137); -insert into help_relation (help_topic_id,help_keyword_id) values (310,138); -insert into help_relation (help_topic_id,help_keyword_id) values (344,139); -insert into help_relation (help_topic_id,help_keyword_id) values (116,139); -insert into help_relation (help_topic_id,help_keyword_id) values (453,139); -insert into help_relation (help_topic_id,help_keyword_id) values (48,139); -insert into help_relation (help_topic_id,help_keyword_id) values (120,139); -insert into help_relation (help_topic_id,help_keyword_id) values (353,139); -insert into help_relation (help_topic_id,help_keyword_id) values (358,139); -insert into help_relation (help_topic_id,help_keyword_id) values (445,140); -insert into help_relation (help_topic_id,help_keyword_id) values (36,140); -insert into help_relation (help_topic_id,help_keyword_id) values (104,140); -insert into help_relation (help_topic_id,help_keyword_id) values (1,141); -insert into help_relation (help_topic_id,help_keyword_id) values (28,142); -insert into help_relation (help_topic_id,help_keyword_id) values (374,143); -insert into help_relation (help_topic_id,help_keyword_id) values (464,144); -insert into help_relation (help_topic_id,help_keyword_id) values (177,145); -insert into help_relation (help_topic_id,help_keyword_id) values (206,146); -insert into help_relation (help_topic_id,help_keyword_id) values (310,147); -insert into help_relation (help_topic_id,help_keyword_id) values (344,147); -insert into help_relation (help_topic_id,help_keyword_id) values (178,147); -insert into help_relation (help_topic_id,help_keyword_id) values (353,147); -insert into help_relation (help_topic_id,help_keyword_id) values (419,147); -insert into help_relation (help_topic_id,help_keyword_id) values (344,148); -insert into help_relation (help_topic_id,help_keyword_id) values (327,148); -insert into help_relation (help_topic_id,help_keyword_id) values (464,149); -insert into help_relation (help_topic_id,help_keyword_id) values (178,150); -insert into help_relation (help_topic_id,help_keyword_id) values (95,151); -insert into help_relation (help_topic_id,help_keyword_id) values (420,152); -insert into help_relation (help_topic_id,help_keyword_id) values (66,153); -insert into help_relation (help_topic_id,help_keyword_id) values (344,153); -insert into help_relation (help_topic_id,help_keyword_id) values (333,153); -insert into help_relation (help_topic_id,help_keyword_id) values (34,153); -insert into help_relation (help_topic_id,help_keyword_id) values (95,153); -insert into help_relation (help_topic_id,help_keyword_id) values (299,153); -insert into help_relation (help_topic_id,help_keyword_id) values (415,153); -insert into help_relation (help_topic_id,help_keyword_id) values (391,153); -insert into help_relation (help_topic_id,help_keyword_id) values (208,153); -insert into help_relation (help_topic_id,help_keyword_id) values (404,153); -insert into help_relation (help_topic_id,help_keyword_id) values (229,153); -insert into help_relation (help_topic_id,help_keyword_id) values (95,154); -insert into help_relation (help_topic_id,help_keyword_id) values (344,155); -insert into help_relation (help_topic_id,help_keyword_id) values (420,155); -insert into help_relation (help_topic_id,help_keyword_id) values (248,156); -insert into help_relation (help_topic_id,help_keyword_id) values (464,157); -insert into help_relation (help_topic_id,help_keyword_id) values (464,158); -insert into help_relation (help_topic_id,help_keyword_id) values (459,158); -insert into help_relation (help_topic_id,help_keyword_id) values (191,159); -insert into help_relation (help_topic_id,help_keyword_id) values (474,159); -insert into help_relation (help_topic_id,help_keyword_id) values (60,159); -insert into help_relation (help_topic_id,help_keyword_id) values (459,159); -insert into help_relation (help_topic_id,help_keyword_id) values (173,160); -insert into help_relation (help_topic_id,help_keyword_id) values (165,161); -insert into help_relation (help_topic_id,help_keyword_id) values (191,162); -insert into help_relation (help_topic_id,help_keyword_id) values (474,162); -insert into help_relation (help_topic_id,help_keyword_id) values (414,162); -insert into help_relation (help_topic_id,help_keyword_id) values (459,162); -insert into help_relation (help_topic_id,help_keyword_id) values (452,163); -insert into help_relation (help_topic_id,help_keyword_id) values (30,163); -insert into help_relation (help_topic_id,help_keyword_id) values (156,163); -insert into help_relation (help_topic_id,help_keyword_id) values (445,164); -insert into help_relation (help_topic_id,help_keyword_id) values (420,165); -insert into help_relation (help_topic_id,help_keyword_id) values (48,166); -insert into help_relation (help_topic_id,help_keyword_id) values (353,166); -insert into help_relation (help_topic_id,help_keyword_id) values (81,166); -insert into help_relation (help_topic_id,help_keyword_id) values (459,166); -insert into help_relation (help_topic_id,help_keyword_id) values (360,166); -insert into help_relation (help_topic_id,help_keyword_id) values (1,167); -insert into help_relation (help_topic_id,help_keyword_id) values (84,167); -insert into help_relation (help_topic_id,help_keyword_id) values (48,167); -insert into help_relation (help_topic_id,help_keyword_id) values (248,168); -insert into help_relation (help_topic_id,help_keyword_id) values (245,169); -insert into help_relation (help_topic_id,help_keyword_id) values (197,169); -insert into help_relation (help_topic_id,help_keyword_id) values (311,170); -insert into help_relation (help_topic_id,help_keyword_id) values (496,170); -insert into help_relation (help_topic_id,help_keyword_id) values (206,170); -insert into help_relation (help_topic_id,help_keyword_id) values (226,170); -insert into help_relation (help_topic_id,help_keyword_id) values (24,170); -insert into help_relation (help_topic_id,help_keyword_id) values (165,170); -insert into help_relation (help_topic_id,help_keyword_id) values (126,170); -insert into help_relation (help_topic_id,help_keyword_id) values (153,171); -insert into help_relation (help_topic_id,help_keyword_id) values (95,171); -insert into help_relation (help_topic_id,help_keyword_id) values (226,171); -insert into help_relation (help_topic_id,help_keyword_id) values (410,172); -insert into help_relation (help_topic_id,help_keyword_id) values (344,173); -insert into help_relation (help_topic_id,help_keyword_id) values (468,174); -insert into help_relation (help_topic_id,help_keyword_id) values (469,174); -insert into help_relation (help_topic_id,help_keyword_id) values (464,174); -insert into help_relation (help_topic_id,help_keyword_id) values (459,174); -insert into help_relation (help_topic_id,help_keyword_id) values (301,175); -insert into help_relation (help_topic_id,help_keyword_id) values (99,175); -insert into help_relation (help_topic_id,help_keyword_id) values (148,175); -insert into help_relation (help_topic_id,help_keyword_id) values (142,176); -insert into help_relation (help_topic_id,help_keyword_id) values (344,176); -insert into help_relation (help_topic_id,help_keyword_id) values (143,177); -insert into help_relation (help_topic_id,help_keyword_id) values (344,178); -insert into help_relation (help_topic_id,help_keyword_id) values (157,178); -insert into help_relation (help_topic_id,help_keyword_id) values (453,179); -insert into help_relation (help_topic_id,help_keyword_id) values (143,180); -insert into help_relation (help_topic_id,help_keyword_id) values (310,181); -insert into help_relation (help_topic_id,help_keyword_id) values (178,181); -insert into help_relation (help_topic_id,help_keyword_id) values (419,181); -insert into help_relation (help_topic_id,help_keyword_id) values (196,181); -insert into help_relation (help_topic_id,help_keyword_id) values (301,182); -insert into help_relation (help_topic_id,help_keyword_id) values (116,182); -insert into help_relation (help_topic_id,help_keyword_id) values (420,182); -insert into help_relation (help_topic_id,help_keyword_id) values (358,182); -insert into help_relation (help_topic_id,help_keyword_id) values (353,183); -insert into help_relation (help_topic_id,help_keyword_id) values (226,184); -insert into help_relation (help_topic_id,help_keyword_id) values (375,184); -insert into help_relation (help_topic_id,help_keyword_id) values (464,185); -insert into help_relation (help_topic_id,help_keyword_id) values (152,186); -insert into help_relation (help_topic_id,help_keyword_id) values (464,186); -insert into help_relation (help_topic_id,help_keyword_id) values (209,186); -insert into help_relation (help_topic_id,help_keyword_id) values (393,187); -insert into help_relation (help_topic_id,help_keyword_id) values (461,188); -insert into help_relation (help_topic_id,help_keyword_id) values (127,189); -insert into help_relation (help_topic_id,help_keyword_id) values (445,189); -insert into help_relation (help_topic_id,help_keyword_id) values (180,189); -insert into help_relation (help_topic_id,help_keyword_id) values (346,189); -insert into help_relation (help_topic_id,help_keyword_id) values (133,189); -insert into help_relation (help_topic_id,help_keyword_id) values (450,190); -insert into help_relation (help_topic_id,help_keyword_id) values (83,191); -insert into help_relation (help_topic_id,help_keyword_id) values (57,191); -insert into help_relation (help_topic_id,help_keyword_id) values (464,192); -insert into help_relation (help_topic_id,help_keyword_id) values (353,193); -insert into help_relation (help_topic_id,help_keyword_id) values (1,194); -insert into help_relation (help_topic_id,help_keyword_id) values (36,194); -insert into help_relation (help_topic_id,help_keyword_id) values (353,194); -insert into help_relation (help_topic_id,help_keyword_id) values (420,195); -insert into help_relation (help_topic_id,help_keyword_id) values (197,196); -insert into help_relation (help_topic_id,help_keyword_id) values (143,197); -insert into help_relation (help_topic_id,help_keyword_id) values (245,198); -insert into help_relation (help_topic_id,help_keyword_id) values (344,199); -insert into help_relation (help_topic_id,help_keyword_id) values (189,199); -insert into help_relation (help_topic_id,help_keyword_id) values (1,200); -insert into help_relation (help_topic_id,help_keyword_id) values (218,201); -insert into help_relation (help_topic_id,help_keyword_id) values (251,202); -insert into help_relation (help_topic_id,help_keyword_id) values (86,203); -insert into help_relation (help_topic_id,help_keyword_id) values (464,203); -insert into help_relation (help_topic_id,help_keyword_id) values (207,203); -insert into help_relation (help_topic_id,help_keyword_id) values (197,203); -insert into help_relation (help_topic_id,help_keyword_id) values (459,203); -insert into help_relation (help_topic_id,help_keyword_id) values (459,204); -insert into help_relation (help_topic_id,help_keyword_id) values (257,205); -insert into help_relation (help_topic_id,help_keyword_id) values (464,206); -insert into help_relation (help_topic_id,help_keyword_id) values (420,206); -insert into help_relation (help_topic_id,help_keyword_id) values (405,207); -insert into help_relation (help_topic_id,help_keyword_id) values (87,207); -insert into help_relation (help_topic_id,help_keyword_id) values (459,207); -insert into help_relation (help_topic_id,help_keyword_id) values (288,208); -insert into help_relation (help_topic_id,help_keyword_id) values (353,209); -insert into help_relation (help_topic_id,help_keyword_id) values (3,210); -insert into help_relation (help_topic_id,help_keyword_id) values (36,210); -insert into help_relation (help_topic_id,help_keyword_id) values (48,210); -insert into help_relation (help_topic_id,help_keyword_id) values (102,210); -insert into help_relation (help_topic_id,help_keyword_id) values (81,210); -insert into help_relation (help_topic_id,help_keyword_id) values (420,210); -insert into help_relation (help_topic_id,help_keyword_id) values (197,211); -insert into help_relation (help_topic_id,help_keyword_id) values (191,212); -insert into help_relation (help_topic_id,help_keyword_id) values (344,213); -insert into help_relation (help_topic_id,help_keyword_id) values (152,213); -insert into help_relation (help_topic_id,help_keyword_id) values (306,213); -insert into help_relation (help_topic_id,help_keyword_id) values (185,213); -insert into help_relation (help_topic_id,help_keyword_id) values (209,213); -insert into help_relation (help_topic_id,help_keyword_id) values (95,214); -insert into help_relation (help_topic_id,help_keyword_id) values (274,215); -insert into help_relation (help_topic_id,help_keyword_id) values (276,216); -insert into help_relation (help_topic_id,help_keyword_id) values (460,217); -insert into help_relation (help_topic_id,help_keyword_id) values (344,218); -insert into help_relation (help_topic_id,help_keyword_id) values (1,218); -insert into help_relation (help_topic_id,help_keyword_id) values (464,218); -insert into help_relation (help_topic_id,help_keyword_id) values (301,218); -insert into help_relation (help_topic_id,help_keyword_id) values (85,218); -insert into help_relation (help_topic_id,help_keyword_id) values (99,218); -insert into help_relation (help_topic_id,help_keyword_id) values (60,218); -insert into help_relation (help_topic_id,help_keyword_id) values (305,218); -insert into help_relation (help_topic_id,help_keyword_id) values (207,218); -insert into help_relation (help_topic_id,help_keyword_id) values (459,218); +insert into help_relation (help_topic_id,help_keyword_id) values (89,51); +insert into help_relation (help_topic_id,help_keyword_id) values (459,52); +insert into help_relation (help_topic_id,help_keyword_id) values (374,52); +insert into help_relation (help_topic_id,help_keyword_id) values (176,53); +insert into help_relation (help_topic_id,help_keyword_id) values (468,53); +insert into help_relation (help_topic_id,help_keyword_id) values (51,54); +insert into help_relation (help_topic_id,help_keyword_id) values (106,54); +insert into help_relation (help_topic_id,help_keyword_id) values (199,55); +insert into help_relation (help_topic_id,help_keyword_id) values (194,56); +insert into help_relation (help_topic_id,help_keyword_id) values (55,56); +insert into help_relation (help_topic_id,help_keyword_id) values (1,56); +insert into help_relation (help_topic_id,help_keyword_id) values (459,57); +insert into help_relation (help_topic_id,help_keyword_id) values (374,57); +insert into help_relation (help_topic_id,help_keyword_id) values (48,58); +insert into help_relation (help_topic_id,help_keyword_id) values (83,58); +insert into help_relation (help_topic_id,help_keyword_id) values (106,58); +insert into help_relation (help_topic_id,help_keyword_id) values (193,59); +insert into help_relation (help_topic_id,help_keyword_id) values (249,59); +insert into help_relation (help_topic_id,help_keyword_id) values (199,59); +insert into help_relation (help_topic_id,help_keyword_id) values (210,60); +insert into help_relation (help_topic_id,help_keyword_id) values (463,60); +insert into help_relation (help_topic_id,help_keyword_id) values (406,61); +insert into help_relation (help_topic_id,help_keyword_id) values (89,61); +insert into help_relation (help_topic_id,help_keyword_id) values (300,61); +insert into help_relation (help_topic_id,help_keyword_id) values (358,61); +insert into help_relation (help_topic_id,help_keyword_id) values (199,62); +insert into help_relation (help_topic_id,help_keyword_id) values (356,63); +insert into help_relation (help_topic_id,help_keyword_id) values (1,64); +insert into help_relation (help_topic_id,help_keyword_id) values (130,64); +insert into help_relation (help_topic_id,help_keyword_id) values (356,64); +insert into help_relation (help_topic_id,help_keyword_id) values (104,64); +insert into help_relation (help_topic_id,help_keyword_id) values (83,64); +insert into help_relation (help_topic_id,help_keyword_id) values (421,64); +insert into help_relation (help_topic_id,help_keyword_id) values (463,64); +insert into help_relation (help_topic_id,help_keyword_id) values (66,65); +insert into help_relation (help_topic_id,help_keyword_id) values (466,66); +insert into help_relation (help_topic_id,help_keyword_id) values (417,66); +insert into help_relation (help_topic_id,help_keyword_id) values (48,66); +insert into help_relation (help_topic_id,help_keyword_id) values (230,67); +insert into help_relation (help_topic_id,help_keyword_id) values (87,68); +insert into help_relation (help_topic_id,help_keyword_id) values (210,68); +insert into help_relation (help_topic_id,help_keyword_id) values (463,68); +insert into help_relation (help_topic_id,help_keyword_id) values (199,69); +insert into help_relation (help_topic_id,help_keyword_id) values (194,70); +insert into help_relation (help_topic_id,help_keyword_id) values (468,71); +insert into help_relation (help_topic_id,help_keyword_id) values (91,72); +insert into help_relation (help_topic_id,help_keyword_id) values (482,72); +insert into help_relation (help_topic_id,help_keyword_id) values (385,73); +insert into help_relation (help_topic_id,help_keyword_id) values (447,74); +insert into help_relation (help_topic_id,help_keyword_id) values (1,75); +insert into help_relation (help_topic_id,help_keyword_id) values (39,76); +insert into help_relation (help_topic_id,help_keyword_id) values (269,76); +insert into help_relation (help_topic_id,help_keyword_id) values (230,76); +insert into help_relation (help_topic_id,help_keyword_id) values (269,77); +insert into help_relation (help_topic_id,help_keyword_id) values (460,77); +insert into help_relation (help_topic_id,help_keyword_id) values (185,77); +insert into help_relation (help_topic_id,help_keyword_id) values (185,78); +insert into help_relation (help_topic_id,help_keyword_id) values (463,78); +insert into help_relation (help_topic_id,help_keyword_id) values (406,79); +insert into help_relation (help_topic_id,help_keyword_id) values (89,79); +insert into help_relation (help_topic_id,help_keyword_id) values (376,80); +insert into help_relation (help_topic_id,help_keyword_id) values (472,81); +insert into help_relation (help_topic_id,help_keyword_id) values (356,81); +insert into help_relation (help_topic_id,help_keyword_id) values (104,81); +insert into help_relation (help_topic_id,help_keyword_id) values (83,81); +insert into help_relation (help_topic_id,help_keyword_id) values (406,82); +insert into help_relation (help_topic_id,help_keyword_id) values (89,82); +insert into help_relation (help_topic_id,help_keyword_id) values (459,83); +insert into help_relation (help_topic_id,help_keyword_id) values (374,83); +insert into help_relation (help_topic_id,help_keyword_id) values (304,84); +insert into help_relation (help_topic_id,help_keyword_id) values (3,84); +insert into help_relation (help_topic_id,help_keyword_id) values (356,84); +insert into help_relation (help_topic_id,help_keyword_id) values (104,84); +insert into help_relation (help_topic_id,help_keyword_id) values (468,85); +insert into help_relation (help_topic_id,help_keyword_id) values (257,86); +insert into help_relation (help_topic_id,help_keyword_id) values (194,87); +insert into help_relation (help_topic_id,help_keyword_id) values (376,88); +insert into help_relation (help_topic_id,help_keyword_id) values (129,89); +insert into help_relation (help_topic_id,help_keyword_id) values (146,90); +insert into help_relation (help_topic_id,help_keyword_id) values (460,90); +insert into help_relation (help_topic_id,help_keyword_id) values (17,91); +insert into help_relation (help_topic_id,help_keyword_id) values (416,91); +insert into help_relation (help_topic_id,help_keyword_id) values (347,91); +insert into help_relation (help_topic_id,help_keyword_id) values (439,91); +insert into help_relation (help_topic_id,help_keyword_id) values (328,91); +insert into help_relation (help_topic_id,help_keyword_id) values (356,91); +insert into help_relation (help_topic_id,help_keyword_id) values (189,91); +insert into help_relation (help_topic_id,help_keyword_id) values (302,91); +insert into help_relation (help_topic_id,help_keyword_id) values (488,91); +insert into help_relation (help_topic_id,help_keyword_id) values (188,92); +insert into help_relation (help_topic_id,help_keyword_id) values (99,92); +insert into help_relation (help_topic_id,help_keyword_id) values (421,93); +insert into help_relation (help_topic_id,help_keyword_id) values (463,93); +insert into help_relation (help_topic_id,help_keyword_id) values (88,94); +insert into help_relation (help_topic_id,help_keyword_id) values (401,95); +insert into help_relation (help_topic_id,help_keyword_id) values (468,95); +insert into help_relation (help_topic_id,help_keyword_id) values (69,96); +insert into help_relation (help_topic_id,help_keyword_id) values (433,96); +insert into help_relation (help_topic_id,help_keyword_id) values (330,96); +insert into help_relation (help_topic_id,help_keyword_id) values (285,97); +insert into help_relation (help_topic_id,help_keyword_id) values (85,98); +insert into help_relation (help_topic_id,help_keyword_id) values (57,98); +insert into help_relation (help_topic_id,help_keyword_id) values (28,98); +insert into help_relation (help_topic_id,help_keyword_id) values (195,99); +insert into help_relation (help_topic_id,help_keyword_id) values (104,99); +insert into help_relation (help_topic_id,help_keyword_id) values (486,99); +insert into help_relation (help_topic_id,help_keyword_id) values (301,99); +insert into help_relation (help_topic_id,help_keyword_id) values (347,100); +insert into help_relation (help_topic_id,help_keyword_id) values (282,100); +insert into help_relation (help_topic_id,help_keyword_id) values (313,101); +insert into help_relation (help_topic_id,help_keyword_id) values (106,101); +insert into help_relation (help_topic_id,help_keyword_id) values (473,102); +insert into help_relation (help_topic_id,help_keyword_id) values (376,103); +insert into help_relation (help_topic_id,help_keyword_id) values (155,104); +insert into help_relation (help_topic_id,help_keyword_id) values (30,104); +insert into help_relation (help_topic_id,help_keyword_id) values (89,104); +insert into help_relation (help_topic_id,help_keyword_id) values (300,104); +insert into help_relation (help_topic_id,help_keyword_id) values (186,104); +insert into help_relation (help_topic_id,help_keyword_id) values (9,104); +insert into help_relation (help_topic_id,help_keyword_id) values (276,104); +insert into help_relation (help_topic_id,help_keyword_id) values (347,105); +insert into help_relation (help_topic_id,help_keyword_id) values (365,105); +insert into help_relation (help_topic_id,help_keyword_id) values (109,106); +insert into help_relation (help_topic_id,help_keyword_id) values (146,107); +insert into help_relation (help_topic_id,help_keyword_id) values (460,107); +insert into help_relation (help_topic_id,help_keyword_id) values (88,108); +insert into help_relation (help_topic_id,help_keyword_id) values (24,108); +insert into help_relation (help_topic_id,help_keyword_id) values (113,109); +insert into help_relation (help_topic_id,help_keyword_id) values (174,109); +insert into help_relation (help_topic_id,help_keyword_id) values (3,110); +insert into help_relation (help_topic_id,help_keyword_id) values (155,110); +insert into help_relation (help_topic_id,help_keyword_id) values (468,110); +insert into help_relation (help_topic_id,help_keyword_id) values (200,110); +insert into help_relation (help_topic_id,help_keyword_id) values (212,110); +insert into help_relation (help_topic_id,help_keyword_id) values (104,110); +insert into help_relation (help_topic_id,help_keyword_id) values (243,110); +insert into help_relation (help_topic_id,help_keyword_id) values (463,110); +insert into help_relation (help_topic_id,help_keyword_id) values (463,111); +insert into help_relation (help_topic_id,help_keyword_id) values (466,112); +insert into help_relation (help_topic_id,help_keyword_id) values (326,112); +insert into help_relation (help_topic_id,help_keyword_id) values (115,112); +insert into help_relation (help_topic_id,help_keyword_id) values (470,112); +insert into help_relation (help_topic_id,help_keyword_id) values (115,113); +insert into help_relation (help_topic_id,help_keyword_id) values (463,113); +insert into help_relation (help_topic_id,help_keyword_id) values (459,114); +insert into help_relation (help_topic_id,help_keyword_id) values (374,114); +insert into help_relation (help_topic_id,help_keyword_id) values (38,115); +insert into help_relation (help_topic_id,help_keyword_id) values (119,115); +insert into help_relation (help_topic_id,help_keyword_id) values (264,115); +insert into help_relation (help_topic_id,help_keyword_id) values (151,115); +insert into help_relation (help_topic_id,help_keyword_id) values (459,116); +insert into help_relation (help_topic_id,help_keyword_id) values (374,116); +insert into help_relation (help_topic_id,help_keyword_id) values (419,117); +insert into help_relation (help_topic_id,help_keyword_id) values (124,118); +insert into help_relation (help_topic_id,help_keyword_id) values (406,119); +insert into help_relation (help_topic_id,help_keyword_id) values (89,119); +insert into help_relation (help_topic_id,help_keyword_id) values (125,119); +insert into help_relation (help_topic_id,help_keyword_id) values (496,119); +insert into help_relation (help_topic_id,help_keyword_id) values (221,120); +insert into help_relation (help_topic_id,help_keyword_id) values (333,121); +insert into help_relation (help_topic_id,help_keyword_id) values (129,121); +insert into help_relation (help_topic_id,help_keyword_id) values (3,121); +insert into help_relation (help_topic_id,help_keyword_id) values (155,121); +insert into help_relation (help_topic_id,help_keyword_id) values (130,121); +insert into help_relation (help_topic_id,help_keyword_id) values (459,121); +insert into help_relation (help_topic_id,help_keyword_id) values (374,121); +insert into help_relation (help_topic_id,help_keyword_id) values (494,121); +insert into help_relation (help_topic_id,help_keyword_id) values (212,121); +insert into help_relation (help_topic_id,help_keyword_id) values (104,121); +insert into help_relation (help_topic_id,help_keyword_id) values (463,121); +insert into help_relation (help_topic_id,help_keyword_id) values (347,121); +insert into help_relation (help_topic_id,help_keyword_id) values (468,121); +insert into help_relation (help_topic_id,help_keyword_id) values (83,121); +insert into help_relation (help_topic_id,help_keyword_id) values (146,121); +insert into help_relation (help_topic_id,help_keyword_id) values (472,121); +insert into help_relation (help_topic_id,help_keyword_id) values (182,121); +insert into help_relation (help_topic_id,help_keyword_id) values (356,121); +insert into help_relation (help_topic_id,help_keyword_id) values (421,121); +insert into help_relation (help_topic_id,help_keyword_id) values (477,121); +insert into help_relation (help_topic_id,help_keyword_id) values (199,122); +insert into help_relation (help_topic_id,help_keyword_id) values (262,123); +insert into help_relation (help_topic_id,help_keyword_id) values (132,123); +insert into help_relation (help_topic_id,help_keyword_id) values (230,123); +insert into help_relation (help_topic_id,help_keyword_id) values (376,123); +insert into help_relation (help_topic_id,help_keyword_id) values (347,124); +insert into help_relation (help_topic_id,help_keyword_id) values (336,124); +insert into help_relation (help_topic_id,help_keyword_id) values (365,124); +insert into help_relation (help_topic_id,help_keyword_id) values (223,124); +insert into help_relation (help_topic_id,help_keyword_id) values (58,124); +insert into help_relation (help_topic_id,help_keyword_id) values (328,124); +insert into help_relation (help_topic_id,help_keyword_id) values (137,124); +insert into help_relation (help_topic_id,help_keyword_id) values (215,124); +insert into help_relation (help_topic_id,help_keyword_id) values (468,125); +insert into help_relation (help_topic_id,help_keyword_id) values (210,125); +insert into help_relation (help_topic_id,help_keyword_id) values (463,125); +insert into help_relation (help_topic_id,help_keyword_id) values (194,126); +insert into help_relation (help_topic_id,help_keyword_id) values (406,126); +insert into help_relation (help_topic_id,help_keyword_id) values (89,126); +insert into help_relation (help_topic_id,help_keyword_id) values (468,126); +insert into help_relation (help_topic_id,help_keyword_id) values (210,126); +insert into help_relation (help_topic_id,help_keyword_id) values (185,127); +insert into help_relation (help_topic_id,help_keyword_id) values (1,128); +insert into help_relation (help_topic_id,help_keyword_id) values (424,129); +insert into help_relation (help_topic_id,help_keyword_id) values (52,130); +insert into help_relation (help_topic_id,help_keyword_id) values (185,131); +insert into help_relation (help_topic_id,help_keyword_id) values (468,132); +insert into help_relation (help_topic_id,help_keyword_id) values (314,133); +insert into help_relation (help_topic_id,help_keyword_id) values (199,134); +insert into help_relation (help_topic_id,help_keyword_id) values (455,135); +insert into help_relation (help_topic_id,help_keyword_id) values (255,136); +insert into help_relation (help_topic_id,help_keyword_id) values (285,137); +insert into help_relation (help_topic_id,help_keyword_id) values (249,138); +insert into help_relation (help_topic_id,help_keyword_id) values (199,138); +insert into help_relation (help_topic_id,help_keyword_id) values (463,139); +insert into help_relation (help_topic_id,help_keyword_id) values (85,140); +insert into help_relation (help_topic_id,help_keyword_id) values (57,140); +insert into help_relation (help_topic_id,help_keyword_id) values (237,141); +insert into help_relation (help_topic_id,help_keyword_id) values (52,142); +insert into help_relation (help_topic_id,help_keyword_id) values (324,142); +insert into help_relation (help_topic_id,help_keyword_id) values (85,143); +insert into help_relation (help_topic_id,help_keyword_id) values (57,143); +insert into help_relation (help_topic_id,help_keyword_id) values (199,144); +insert into help_relation (help_topic_id,help_keyword_id) values (313,145); +insert into help_relation (help_topic_id,help_keyword_id) values (424,146); +insert into help_relation (help_topic_id,help_keyword_id) values (347,146); +insert into help_relation (help_topic_id,help_keyword_id) values (455,146); +insert into help_relation (help_topic_id,help_keyword_id) values (48,146); +insert into help_relation (help_topic_id,help_keyword_id) values (122,146); +insert into help_relation (help_topic_id,help_keyword_id) values (356,146); +insert into help_relation (help_topic_id,help_keyword_id) values (447,147); +insert into help_relation (help_topic_id,help_keyword_id) values (36,147); +insert into help_relation (help_topic_id,help_keyword_id) values (106,147); +insert into help_relation (help_topic_id,help_keyword_id) values (1,148); +insert into help_relation (help_topic_id,help_keyword_id) values (28,149); +insert into help_relation (help_topic_id,help_keyword_id) values (376,150); +insert into help_relation (help_topic_id,help_keyword_id) values (468,151); +insert into help_relation (help_topic_id,help_keyword_id) values (209,152); +insert into help_relation (help_topic_id,help_keyword_id) values (347,153); +insert into help_relation (help_topic_id,help_keyword_id) values (313,153); +insert into help_relation (help_topic_id,help_keyword_id) values (180,153); +insert into help_relation (help_topic_id,help_keyword_id) values (356,153); +insert into help_relation (help_topic_id,help_keyword_id) values (420,153); +insert into help_relation (help_topic_id,help_keyword_id) values (347,154); +insert into help_relation (help_topic_id,help_keyword_id) values (330,154); +insert into help_relation (help_topic_id,help_keyword_id) values (468,155); +insert into help_relation (help_topic_id,help_keyword_id) values (97,156); +insert into help_relation (help_topic_id,help_keyword_id) values (180,157); +insert into help_relation (help_topic_id,help_keyword_id) values (421,158); +insert into help_relation (help_topic_id,help_keyword_id) values (68,159); +insert into help_relation (help_topic_id,help_keyword_id) values (347,159); +insert into help_relation (help_topic_id,help_keyword_id) values (336,159); +insert into help_relation (help_topic_id,help_keyword_id) values (34,159); +insert into help_relation (help_topic_id,help_keyword_id) values (97,159); +insert into help_relation (help_topic_id,help_keyword_id) values (302,159); +insert into help_relation (help_topic_id,help_keyword_id) values (416,159); +insert into help_relation (help_topic_id,help_keyword_id) values (393,159); +insert into help_relation (help_topic_id,help_keyword_id) values (211,159); +insert into help_relation (help_topic_id,help_keyword_id) values (405,159); +insert into help_relation (help_topic_id,help_keyword_id) values (233,159); +insert into help_relation (help_topic_id,help_keyword_id) values (97,160); +insert into help_relation (help_topic_id,help_keyword_id) values (347,161); +insert into help_relation (help_topic_id,help_keyword_id) values (421,161); +insert into help_relation (help_topic_id,help_keyword_id) values (252,162); +insert into help_relation (help_topic_id,help_keyword_id) values (468,163); +insert into help_relation (help_topic_id,help_keyword_id) values (468,164); +insert into help_relation (help_topic_id,help_keyword_id) values (463,164); +insert into help_relation (help_topic_id,help_keyword_id) values (194,165); +insert into help_relation (help_topic_id,help_keyword_id) values (478,165); +insert into help_relation (help_topic_id,help_keyword_id) values (60,165); +insert into help_relation (help_topic_id,help_keyword_id) values (463,165); +insert into help_relation (help_topic_id,help_keyword_id) values (176,166); +insert into help_relation (help_topic_id,help_keyword_id) values (168,167); +insert into help_relation (help_topic_id,help_keyword_id) values (194,168); +insert into help_relation (help_topic_id,help_keyword_id) values (478,168); +insert into help_relation (help_topic_id,help_keyword_id) values (415,168); +insert into help_relation (help_topic_id,help_keyword_id) values (463,168); +insert into help_relation (help_topic_id,help_keyword_id) values (454,169); +insert into help_relation (help_topic_id,help_keyword_id) values (30,169); +insert into help_relation (help_topic_id,help_keyword_id) values (159,169); +insert into help_relation (help_topic_id,help_keyword_id) values (447,170); +insert into help_relation (help_topic_id,help_keyword_id) values (130,171); +insert into help_relation (help_topic_id,help_keyword_id) values (421,171); +insert into help_relation (help_topic_id,help_keyword_id) values (190,172); +insert into help_relation (help_topic_id,help_keyword_id) values (48,173); +insert into help_relation (help_topic_id,help_keyword_id) values (356,173); +insert into help_relation (help_topic_id,help_keyword_id) values (83,173); +insert into help_relation (help_topic_id,help_keyword_id) values (463,173); +insert into help_relation (help_topic_id,help_keyword_id) values (361,173); +insert into help_relation (help_topic_id,help_keyword_id) values (1,174); +insert into help_relation (help_topic_id,help_keyword_id) values (86,174); +insert into help_relation (help_topic_id,help_keyword_id) values (48,174); +insert into help_relation (help_topic_id,help_keyword_id) values (459,175); +insert into help_relation (help_topic_id,help_keyword_id) values (374,175); +insert into help_relation (help_topic_id,help_keyword_id) values (252,176); +insert into help_relation (help_topic_id,help_keyword_id) values (249,177); +insert into help_relation (help_topic_id,help_keyword_id) values (199,177); +insert into help_relation (help_topic_id,help_keyword_id) values (314,178); +insert into help_relation (help_topic_id,help_keyword_id) values (500,178); +insert into help_relation (help_topic_id,help_keyword_id) values (209,178); +insert into help_relation (help_topic_id,help_keyword_id) values (230,178); +insert into help_relation (help_topic_id,help_keyword_id) values (24,178); +insert into help_relation (help_topic_id,help_keyword_id) values (168,178); +insert into help_relation (help_topic_id,help_keyword_id) values (128,178); +insert into help_relation (help_topic_id,help_keyword_id) values (156,179); +insert into help_relation (help_topic_id,help_keyword_id) values (97,179); +insert into help_relation (help_topic_id,help_keyword_id) values (230,179); +insert into help_relation (help_topic_id,help_keyword_id) values (411,180); +insert into help_relation (help_topic_id,help_keyword_id) values (347,181); +insert into help_relation (help_topic_id,help_keyword_id) values (472,182); +insert into help_relation (help_topic_id,help_keyword_id) values (473,182); +insert into help_relation (help_topic_id,help_keyword_id) values (468,182); +insert into help_relation (help_topic_id,help_keyword_id) values (463,182); +insert into help_relation (help_topic_id,help_keyword_id) values (304,183); +insert into help_relation (help_topic_id,help_keyword_id) values (101,183); +insert into help_relation (help_topic_id,help_keyword_id) values (151,183); +insert into help_relation (help_topic_id,help_keyword_id) values (145,184); +insert into help_relation (help_topic_id,help_keyword_id) values (347,184); +insert into help_relation (help_topic_id,help_keyword_id) values (459,185); +insert into help_relation (help_topic_id,help_keyword_id) values (374,185); +insert into help_relation (help_topic_id,help_keyword_id) values (146,186); +insert into help_relation (help_topic_id,help_keyword_id) values (347,187); +insert into help_relation (help_topic_id,help_keyword_id) values (160,187); +insert into help_relation (help_topic_id,help_keyword_id) values (455,188); +insert into help_relation (help_topic_id,help_keyword_id) values (146,189); +insert into help_relation (help_topic_id,help_keyword_id) values (459,190); +insert into help_relation (help_topic_id,help_keyword_id) values (374,190); +insert into help_relation (help_topic_id,help_keyword_id) values (313,191); +insert into help_relation (help_topic_id,help_keyword_id) values (180,191); +insert into help_relation (help_topic_id,help_keyword_id) values (420,191); +insert into help_relation (help_topic_id,help_keyword_id) values (200,191); +insert into help_relation (help_topic_id,help_keyword_id) values (304,192); +insert into help_relation (help_topic_id,help_keyword_id) values (421,192); +insert into help_relation (help_topic_id,help_keyword_id) values (356,193); +insert into help_relation (help_topic_id,help_keyword_id) values (230,194); +insert into help_relation (help_topic_id,help_keyword_id) values (377,194); +insert into help_relation (help_topic_id,help_keyword_id) values (468,195); +insert into help_relation (help_topic_id,help_keyword_id) values (155,196); +insert into help_relation (help_topic_id,help_keyword_id) values (468,196); +insert into help_relation (help_topic_id,help_keyword_id) values (212,196); +insert into help_relation (help_topic_id,help_keyword_id) values (395,197); +insert into help_relation (help_topic_id,help_keyword_id) values (465,198); +insert into help_relation (help_topic_id,help_keyword_id) values (129,199); +insert into help_relation (help_topic_id,help_keyword_id) values (447,199); +insert into help_relation (help_topic_id,help_keyword_id) values (182,199); +insert into help_relation (help_topic_id,help_keyword_id) values (349,199); +insert into help_relation (help_topic_id,help_keyword_id) values (137,199); +insert into help_relation (help_topic_id,help_keyword_id) values (452,200); +insert into help_relation (help_topic_id,help_keyword_id) values (85,201); +insert into help_relation (help_topic_id,help_keyword_id) values (57,201); +insert into help_relation (help_topic_id,help_keyword_id) values (356,202); +insert into help_relation (help_topic_id,help_keyword_id) values (1,203); +insert into help_relation (help_topic_id,help_keyword_id) values (36,203); +insert into help_relation (help_topic_id,help_keyword_id) values (356,203); +insert into help_relation (help_topic_id,help_keyword_id) values (421,204); +insert into help_relation (help_topic_id,help_keyword_id) values (199,205); +insert into help_relation (help_topic_id,help_keyword_id) values (146,206); +insert into help_relation (help_topic_id,help_keyword_id) values (249,207); +insert into help_relation (help_topic_id,help_keyword_id) values (347,208); +insert into help_relation (help_topic_id,help_keyword_id) values (192,208); +insert into help_relation (help_topic_id,help_keyword_id) values (1,209); +insert into help_relation (help_topic_id,help_keyword_id) values (459,210); +insert into help_relation (help_topic_id,help_keyword_id) values (374,210); +insert into help_relation (help_topic_id,help_keyword_id) values (221,211); +insert into help_relation (help_topic_id,help_keyword_id) values (255,212); +insert into help_relation (help_topic_id,help_keyword_id) values (88,213); +insert into help_relation (help_topic_id,help_keyword_id) values (468,213); +insert into help_relation (help_topic_id,help_keyword_id) values (210,213); +insert into help_relation (help_topic_id,help_keyword_id) values (199,213); +insert into help_relation (help_topic_id,help_keyword_id) values (463,213); +insert into help_relation (help_topic_id,help_keyword_id) values (463,214); +insert into help_relation (help_topic_id,help_keyword_id) values (260,215); +insert into help_relation (help_topic_id,help_keyword_id) values (468,216); +insert into help_relation (help_topic_id,help_keyword_id) values (421,216); +insert into help_relation (help_topic_id,help_keyword_id) values (406,217); +insert into help_relation (help_topic_id,help_keyword_id) values (89,217); +insert into help_relation (help_topic_id,help_keyword_id) values (463,217); +insert into help_relation (help_topic_id,help_keyword_id) values (291,218); insert into help_relation (help_topic_id,help_keyword_id) values (356,219); -insert into help_relation (help_topic_id,help_keyword_id) values (423,220); -insert into help_relation (help_topic_id,help_keyword_id) values (405,221); -insert into help_relation (help_topic_id,help_keyword_id) values (87,221); -insert into help_relation (help_topic_id,help_keyword_id) values (184,222); -insert into help_relation (help_topic_id,help_keyword_id) values (459,223); -insert into help_relation (help_topic_id,help_keyword_id) values (462,224); -insert into help_relation (help_topic_id,help_keyword_id) values (251,224); -insert into help_relation (help_topic_id,help_keyword_id) values (269,225); -insert into help_relation (help_topic_id,help_keyword_id) values (1,226); -insert into help_relation (help_topic_id,help_keyword_id) values (344,227); -insert into help_relation (help_topic_id,help_keyword_id) values (7,227); -insert into help_relation (help_topic_id,help_keyword_id) values (253,228); -insert into help_relation (help_topic_id,help_keyword_id) values (428,228); -insert into help_relation (help_topic_id,help_keyword_id) values (191,229); -insert into help_relation (help_topic_id,help_keyword_id) values (223,229); -insert into help_relation (help_topic_id,help_keyword_id) values (353,229); -insert into help_relation (help_topic_id,help_keyword_id) values (425,230); -insert into help_relation (help_topic_id,help_keyword_id) values (85,231); -insert into help_relation (help_topic_id,help_keyword_id) values (207,231); -insert into help_relation (help_topic_id,help_keyword_id) values (459,231); -insert into help_relation (help_topic_id,help_keyword_id) values (310,232); -insert into help_relation (help_topic_id,help_keyword_id) values (311,233); -insert into help_relation (help_topic_id,help_keyword_id) values (496,233); -insert into help_relation (help_topic_id,help_keyword_id) values (206,233); -insert into help_relation (help_topic_id,help_keyword_id) values (24,233); -insert into help_relation (help_topic_id,help_keyword_id) values (165,233); -insert into help_relation (help_topic_id,help_keyword_id) values (126,233); -insert into help_relation (help_topic_id,help_keyword_id) values (197,234); -insert into help_relation (help_topic_id,help_keyword_id) values (184,235); -insert into help_relation (help_topic_id,help_keyword_id) values (469,236); -insert into help_relation (help_topic_id,help_keyword_id) values (184,237); -insert into help_relation (help_topic_id,help_keyword_id) values (383,238); -insert into help_relation (help_topic_id,help_keyword_id) values (330,239); -insert into help_relation (help_topic_id,help_keyword_id) values (344,239); -insert into help_relation (help_topic_id,help_keyword_id) values (152,239); -insert into help_relation (help_topic_id,help_keyword_id) values (428,239); -insert into help_relation (help_topic_id,help_keyword_id) values (464,239); -insert into help_relation (help_topic_id,help_keyword_id) values (253,239); -insert into help_relation (help_topic_id,help_keyword_id) values (209,239); -insert into help_relation (help_topic_id,help_keyword_id) values (353,239); -insert into help_relation (help_topic_id,help_keyword_id) values (420,239); -insert into help_relation (help_topic_id,help_keyword_id) values (184,240); -insert into help_relation (help_topic_id,help_keyword_id) values (273,241); -insert into help_relation (help_topic_id,help_keyword_id) values (275,241); -insert into help_relation (help_topic_id,help_keyword_id) values (400,241); -insert into help_relation (help_topic_id,help_keyword_id) values (212,241); -insert into help_relation (help_topic_id,help_keyword_id) values (459,241); -insert into help_relation (help_topic_id,help_keyword_id) values (462,241); -insert into help_relation (help_topic_id,help_keyword_id) values (344,241); -insert into help_relation (help_topic_id,help_keyword_id) values (107,241); -insert into help_relation (help_topic_id,help_keyword_id) values (464,241); -insert into help_relation (help_topic_id,help_keyword_id) values (318,241); -insert into help_relation (help_topic_id,help_keyword_id) values (112,241); -insert into help_relation (help_topic_id,help_keyword_id) values (466,241); -insert into help_relation (help_topic_id,help_keyword_id) values (177,241); -insert into help_relation (help_topic_id,help_keyword_id) values (416,241); -insert into help_relation (help_topic_id,help_keyword_id) values (60,241); -insert into help_relation (help_topic_id,help_keyword_id) values (356,241); -insert into help_relation (help_topic_id,help_keyword_id) values (358,241); -insert into help_relation (help_topic_id,help_keyword_id) values (191,242); -insert into help_relation (help_topic_id,help_keyword_id) values (474,242); -insert into help_relation (help_topic_id,help_keyword_id) values (344,242); -insert into help_relation (help_topic_id,help_keyword_id) values (364,242); -insert into help_relation (help_topic_id,help_keyword_id) values (464,242); -insert into help_relation (help_topic_id,help_keyword_id) values (414,242); -insert into help_relation (help_topic_id,help_keyword_id) values (459,242); -insert into help_relation (help_topic_id,help_keyword_id) values (464,243); -insert into help_relation (help_topic_id,help_keyword_id) values (468,244); -insert into help_relation (help_topic_id,help_keyword_id) values (30,244); -insert into help_relation (help_topic_id,help_keyword_id) values (464,244); -insert into help_relation (help_topic_id,help_keyword_id) values (273,244); -insert into help_relation (help_topic_id,help_keyword_id) values (184,245); -insert into help_relation (help_topic_id,help_keyword_id) values (353,246); -insert into help_relation (help_topic_id,help_keyword_id) values (302,247); -insert into help_relation (help_topic_id,help_keyword_id) values (464,248); -insert into help_relation (help_topic_id,help_keyword_id) values (307,249); -insert into help_relation (help_topic_id,help_keyword_id) values (459,250); -insert into help_relation (help_topic_id,help_keyword_id) values (86,251); -insert into help_relation (help_topic_id,help_keyword_id) values (184,252); -insert into help_relation (help_topic_id,help_keyword_id) values (353,253); -insert into help_relation (help_topic_id,help_keyword_id) values (326,254); -insert into help_relation (help_topic_id,help_keyword_id) values (353,254); -insert into help_relation (help_topic_id,help_keyword_id) values (360,254); -insert into help_relation (help_topic_id,help_keyword_id) values (312,255); -insert into help_relation (help_topic_id,help_keyword_id) values (373,255); -insert into help_relation (help_topic_id,help_keyword_id) values (226,255); -insert into help_relation (help_topic_id,help_keyword_id) values (206,256); -insert into help_relation (help_topic_id,help_keyword_id) values (86,257); -insert into help_relation (help_topic_id,help_keyword_id) values (419,258); -insert into help_relation (help_topic_id,help_keyword_id) values (66,259); -insert into help_relation (help_topic_id,help_keyword_id) values (484,259); -insert into help_relation (help_topic_id,help_keyword_id) values (242,260); -insert into help_relation (help_topic_id,help_keyword_id) values (143,261); -insert into help_relation (help_topic_id,help_keyword_id) values (191,262); -insert into help_relation (help_topic_id,help_keyword_id) values (223,262); -insert into help_relation (help_topic_id,help_keyword_id) values (324,263); -insert into help_relation (help_topic_id,help_keyword_id) values (148,263); -insert into help_relation (help_topic_id,help_keyword_id) values (452,264); -insert into help_relation (help_topic_id,help_keyword_id) values (191,264); -insert into help_relation (help_topic_id,help_keyword_id) values (152,264); -insert into help_relation (help_topic_id,help_keyword_id) values (95,264); -insert into help_relation (help_topic_id,help_keyword_id) values (299,264); -insert into help_relation (help_topic_id,help_keyword_id) values (275,264); -insert into help_relation (help_topic_id,help_keyword_id) values (306,264); -insert into help_relation (help_topic_id,help_keyword_id) values (208,264); -insert into help_relation (help_topic_id,help_keyword_id) values (207,264); -insert into help_relation (help_topic_id,help_keyword_id) values (75,264); -insert into help_relation (help_topic_id,help_keyword_id) values (18,264); -insert into help_relation (help_topic_id,help_keyword_id) values (344,264); -insert into help_relation (help_topic_id,help_keyword_id) values (22,264); -insert into help_relation (help_topic_id,help_keyword_id) values (464,264); -insert into help_relation (help_topic_id,help_keyword_id) values (469,264); -insert into help_relation (help_topic_id,help_keyword_id) values (391,264); -insert into help_relation (help_topic_id,help_keyword_id) values (87,264); -insert into help_relation (help_topic_id,help_keyword_id) values (60,264); -insert into help_relation (help_topic_id,help_keyword_id) values (355,264); -insert into help_relation (help_topic_id,help_keyword_id) values (326,265); -insert into help_relation (help_topic_id,help_keyword_id) values (191,266); -insert into help_relation (help_topic_id,help_keyword_id) values (197,267); -insert into help_relation (help_topic_id,help_keyword_id) values (230,268); -insert into help_relation (help_topic_id,help_keyword_id) values (344,269); -insert into help_relation (help_topic_id,help_keyword_id) values (449,269); -insert into help_relation (help_topic_id,help_keyword_id) values (87,270); -insert into help_relation (help_topic_id,help_keyword_id) values (39,271); -insert into help_relation (help_topic_id,help_keyword_id) values (344,271); -insert into help_relation (help_topic_id,help_keyword_id) values (266,271); -insert into help_relation (help_topic_id,help_keyword_id) values (459,272); -insert into help_relation (help_topic_id,help_keyword_id) values (464,273); -insert into help_relation (help_topic_id,help_keyword_id) values (376,274); -insert into help_relation (help_topic_id,help_keyword_id) values (144,275); -insert into help_relation (help_topic_id,help_keyword_id) values (105,276); -insert into help_relation (help_topic_id,help_keyword_id) values (462,277); -insert into help_relation (help_topic_id,help_keyword_id) values (459,277); -insert into help_relation (help_topic_id,help_keyword_id) values (464,278); -insert into help_relation (help_topic_id,help_keyword_id) values (416,279); -insert into help_relation (help_topic_id,help_keyword_id) values (3,280); -insert into help_relation (help_topic_id,help_keyword_id) values (102,280); -insert into help_relation (help_topic_id,help_keyword_id) values (336,281); -insert into help_relation (help_topic_id,help_keyword_id) values (341,282); -insert into help_relation (help_topic_id,help_keyword_id) values (253,283); -insert into help_relation (help_topic_id,help_keyword_id) values (266,284); -insert into help_relation (help_topic_id,help_keyword_id) values (318,285); -insert into help_relation (help_topic_id,help_keyword_id) values (190,286); -insert into help_relation (help_topic_id,help_keyword_id) values (66,286); -insert into help_relation (help_topic_id,help_keyword_id) values (330,286); -insert into help_relation (help_topic_id,help_keyword_id) values (67,286); -insert into help_relation (help_topic_id,help_keyword_id) values (333,286); -insert into help_relation (help_topic_id,help_keyword_id) values (7,286); -insert into help_relation (help_topic_id,help_keyword_id) values (130,286); -insert into help_relation (help_topic_id,help_keyword_id) values (399,286); -insert into help_relation (help_topic_id,help_keyword_id) values (275,286); -insert into help_relation (help_topic_id,help_keyword_id) values (10,286); -insert into help_relation (help_topic_id,help_keyword_id) values (279,286); -insert into help_relation (help_topic_id,help_keyword_id) values (133,286); -insert into help_relation (help_topic_id,help_keyword_id) values (212,286); -insert into help_relation (help_topic_id,help_keyword_id) values (18,286); -insert into help_relation (help_topic_id,help_keyword_id) values (344,286); -insert into help_relation (help_topic_id,help_keyword_id) values (21,286); -insert into help_relation (help_topic_id,help_keyword_id) values (346,286); -insert into help_relation (help_topic_id,help_keyword_id) values (80,286); -insert into help_relation (help_topic_id,help_keyword_id) values (220,286); -insert into help_relation (help_topic_id,help_keyword_id) values (25,286); -insert into help_relation (help_topic_id,help_keyword_id) values (142,286); -insert into help_relation (help_topic_id,help_keyword_id) values (291,286); -insert into help_relation (help_topic_id,help_keyword_id) values (355,286); -insert into help_relation (help_topic_id,help_keyword_id) values (33,286); -insert into help_relation (help_topic_id,help_keyword_id) values (364,286); -insert into help_relation (help_topic_id,help_keyword_id) values (157,286); -insert into help_relation (help_topic_id,help_keyword_id) values (484,286); -insert into help_relation (help_topic_id,help_keyword_id) values (483,286); -insert into help_relation (help_topic_id,help_keyword_id) values (39,286); -insert into help_relation (help_topic_id,help_keyword_id) values (306,286); -insert into help_relation (help_topic_id,help_keyword_id) values (488,286); -insert into help_relation (help_topic_id,help_keyword_id) values (305,286); -insert into help_relation (help_topic_id,help_keyword_id) values (167,286); -insert into help_relation (help_topic_id,help_keyword_id) values (58,286); -insert into help_relation (help_topic_id,help_keyword_id) values (391,286); -insert into help_relation (help_topic_id,help_keyword_id) values (325,286); -insert into help_relation (help_topic_id,help_keyword_id) values (327,286); -insert into help_relation (help_topic_id,help_keyword_id) values (120,286); -insert into help_relation (help_topic_id,help_keyword_id) values (189,286); -insert into help_relation (help_topic_id,help_keyword_id) values (449,286); -insert into help_relation (help_topic_id,help_keyword_id) values (302,287); -insert into help_relation (help_topic_id,help_keyword_id) values (245,287); -insert into help_relation (help_topic_id,help_keyword_id) values (353,287); -insert into help_relation (help_topic_id,help_keyword_id) values (197,287); -insert into help_relation (help_topic_id,help_keyword_id) values (464,288); -insert into help_relation (help_topic_id,help_keyword_id) values (324,289); -insert into help_relation (help_topic_id,help_keyword_id) values (464,290); -insert into help_relation (help_topic_id,help_keyword_id) values (120,291); -insert into help_relation (help_topic_id,help_keyword_id) values (347,291); -insert into help_relation (help_topic_id,help_keyword_id) values (83,292); -insert into help_relation (help_topic_id,help_keyword_id) values (57,292); -insert into help_relation (help_topic_id,help_keyword_id) values (28,292); -insert into help_relation (help_topic_id,help_keyword_id) values (323,292); -insert into help_relation (help_topic_id,help_keyword_id) values (341,292); -insert into help_relation (help_topic_id,help_keyword_id) values (492,292); -insert into help_relation (help_topic_id,help_keyword_id) values (228,292); -insert into help_relation (help_topic_id,help_keyword_id) values (374,293); -insert into help_relation (help_topic_id,help_keyword_id) values (144,294); -insert into help_relation (help_topic_id,help_keyword_id) values (313,294); -insert into help_relation (help_topic_id,help_keyword_id) values (311,295); -insert into help_relation (help_topic_id,help_keyword_id) values (104,296); -insert into help_relation (help_topic_id,help_keyword_id) values (374,297); -insert into help_relation (help_topic_id,help_keyword_id) values (256,298); -insert into help_relation (help_topic_id,help_keyword_id) values (3,298); -insert into help_relation (help_topic_id,help_keyword_id) values (353,298); -insert into help_relation (help_topic_id,help_keyword_id) values (102,298); -insert into help_relation (help_topic_id,help_keyword_id) values (298,298); -insert into help_relation (help_topic_id,help_keyword_id) values (251,298); -insert into help_relation (help_topic_id,help_keyword_id) values (344,299); -insert into help_relation (help_topic_id,help_keyword_id) values (157,299); -insert into help_relation (help_topic_id,help_keyword_id) values (138,300); -insert into help_relation (help_topic_id,help_keyword_id) values (197,301); -insert into help_relation (help_topic_id,help_keyword_id) values (75,301); -insert into help_relation (help_topic_id,help_keyword_id) values (469,302); -insert into help_relation (help_topic_id,help_keyword_id) values (184,303); -insert into help_relation (help_topic_id,help_keyword_id) values (180,304); -insert into help_relation (help_topic_id,help_keyword_id) values (453,305); -insert into help_relation (help_topic_id,help_keyword_id) values (108,306); -insert into help_relation (help_topic_id,help_keyword_id) values (24,306); -insert into help_relation (help_topic_id,help_keyword_id) values (374,307); -insert into help_relation (help_topic_id,help_keyword_id) values (184,308); -insert into help_relation (help_topic_id,help_keyword_id) values (420,309); -insert into help_relation (help_topic_id,help_keyword_id) values (388,310); -insert into help_relation (help_topic_id,help_keyword_id) values (115,310); -insert into help_relation (help_topic_id,help_keyword_id) values (459,311); -insert into help_relation (help_topic_id,help_keyword_id) values (25,312); -insert into help_relation (help_topic_id,help_keyword_id) values (344,312); -insert into help_relation (help_topic_id,help_keyword_id) values (197,313); -insert into help_relation (help_topic_id,help_keyword_id) values (372,314); -insert into help_relation (help_topic_id,help_keyword_id) values (469,314); -insert into help_relation (help_topic_id,help_keyword_id) values (143,315); -insert into help_relation (help_topic_id,help_keyword_id) values (184,316); -insert into help_relation (help_topic_id,help_keyword_id) values (374,317); -insert into help_relation (help_topic_id,help_keyword_id) values (197,318); -insert into help_relation (help_topic_id,help_keyword_id) values (344,319); -insert into help_relation (help_topic_id,help_keyword_id) values (376,319); -insert into help_relation (help_topic_id,help_keyword_id) values (344,320); -insert into help_relation (help_topic_id,help_keyword_id) values (288,320); -insert into help_relation (help_topic_id,help_keyword_id) values (418,320); -insert into help_relation (help_topic_id,help_keyword_id) values (381,321); -insert into help_relation (help_topic_id,help_keyword_id) values (86,322); -insert into help_relation (help_topic_id,help_keyword_id) values (120,322); -insert into help_relation (help_topic_id,help_keyword_id) values (353,322); -insert into help_relation (help_topic_id,help_keyword_id) values (459,323); -insert into help_relation (help_topic_id,help_keyword_id) values (353,324); -insert into help_relation (help_topic_id,help_keyword_id) values (197,325); -insert into help_relation (help_topic_id,help_keyword_id) values (84,326); -insert into help_relation (help_topic_id,help_keyword_id) values (197,326); -insert into help_relation (help_topic_id,help_keyword_id) values (353,327); -insert into help_relation (help_topic_id,help_keyword_id) values (395,328); -insert into help_relation (help_topic_id,help_keyword_id) values (86,329); -insert into help_relation (help_topic_id,help_keyword_id) values (173,329); -insert into help_relation (help_topic_id,help_keyword_id) values (148,329); -insert into help_relation (help_topic_id,help_keyword_id) values (184,330); -insert into help_relation (help_topic_id,help_keyword_id) values (420,331); -insert into help_relation (help_topic_id,help_keyword_id) values (52,332); -insert into help_relation (help_topic_id,help_keyword_id) values (321,332); -insert into help_relation (help_topic_id,help_keyword_id) values (372,333); -insert into help_relation (help_topic_id,help_keyword_id) values (469,333); -insert into help_relation (help_topic_id,help_keyword_id) values (9,333); -insert into help_relation (help_topic_id,help_keyword_id) values (197,334); -insert into help_relation (help_topic_id,help_keyword_id) values (184,335); -insert into help_relation (help_topic_id,help_keyword_id) values (121,336); -insert into help_relation (help_topic_id,help_keyword_id) values (143,337); -insert into help_relation (help_topic_id,help_keyword_id) values (445,337); -insert into help_relation (help_topic_id,help_keyword_id) values (374,338); -insert into help_relation (help_topic_id,help_keyword_id) values (406,339); -insert into help_relation (help_topic_id,help_keyword_id) values (374,340); -insert into help_relation (help_topic_id,help_keyword_id) values (459,341); -insert into help_relation (help_topic_id,help_keyword_id) values (141,342); -insert into help_relation (help_topic_id,help_keyword_id) values (24,343); -insert into help_relation (help_topic_id,help_keyword_id) values (405,344); -insert into help_relation (help_topic_id,help_keyword_id) values (107,344); -insert into help_relation (help_topic_id,help_keyword_id) values (219,344); -insert into help_relation (help_topic_id,help_keyword_id) values (459,344); -insert into help_relation (help_topic_id,help_keyword_id) values (464,345); -insert into help_relation (help_topic_id,help_keyword_id) values (207,345); -insert into help_relation (help_topic_id,help_keyword_id) values (459,345); -insert into help_relation (help_topic_id,help_keyword_id) values (1,346); -insert into help_relation (help_topic_id,help_keyword_id) values (474,347); -insert into help_relation (help_topic_id,help_keyword_id) values (405,347); -insert into help_relation (help_topic_id,help_keyword_id) values (437,347); -insert into help_relation (help_topic_id,help_keyword_id) values (156,347); -insert into help_relation (help_topic_id,help_keyword_id) values (197,347); -insert into help_relation (help_topic_id,help_keyword_id) values (372,347); -insert into help_relation (help_topic_id,help_keyword_id) values (223,347); -insert into help_relation (help_topic_id,help_keyword_id) values (60,347); -insert into help_relation (help_topic_id,help_keyword_id) values (209,347); -insert into help_relation (help_topic_id,help_keyword_id) values (229,347); -insert into help_relation (help_topic_id,help_keyword_id) values (459,347); -insert into help_relation (help_topic_id,help_keyword_id) values (464,348); -insert into help_relation (help_topic_id,help_keyword_id) values (469,349); -insert into help_relation (help_topic_id,help_keyword_id) values (1,350); -insert into help_relation (help_topic_id,help_keyword_id) values (353,350); -insert into help_relation (help_topic_id,help_keyword_id) values (1,351); -insert into help_relation (help_topic_id,help_keyword_id) values (344,352); -insert into help_relation (help_topic_id,help_keyword_id) values (346,352); -insert into help_relation (help_topic_id,help_keyword_id) values (420,353); -insert into help_relation (help_topic_id,help_keyword_id) values (425,354); -insert into help_relation (help_topic_id,help_keyword_id) values (464,355); -insert into help_relation (help_topic_id,help_keyword_id) values (469,356); -insert into help_relation (help_topic_id,help_keyword_id) values (473,356); -insert into help_relation (help_topic_id,help_keyword_id) values (197,356); -insert into help_relation (help_topic_id,help_keyword_id) values (75,356); -insert into help_relation (help_topic_id,help_keyword_id) values (353,357); -insert into help_relation (help_topic_id,help_keyword_id) values (461,358); -insert into help_relation (help_topic_id,help_keyword_id) values (226,358); -insert into help_relation (help_topic_id,help_keyword_id) values (104,359); -insert into help_relation (help_topic_id,help_keyword_id) values (490,360); -insert into help_relation (help_topic_id,help_keyword_id) values (67,361); -insert into help_relation (help_topic_id,help_keyword_id) values (344,361); -insert into help_relation (help_topic_id,help_keyword_id) values (273,362); -insert into help_relation (help_topic_id,help_keyword_id) values (445,363); -insert into help_relation (help_topic_id,help_keyword_id) values (353,364); -insert into help_relation (help_topic_id,help_keyword_id) values (416,365); -insert into help_relation (help_topic_id,help_keyword_id) values (209,365); -insert into help_relation (help_topic_id,help_keyword_id) values (143,366); -insert into help_relation (help_topic_id,help_keyword_id) values (323,366); -insert into help_relation (help_topic_id,help_keyword_id) values (464,367); -insert into help_relation (help_topic_id,help_keyword_id) values (483,368); -insert into help_relation (help_topic_id,help_keyword_id) values (416,369); -insert into help_relation (help_topic_id,help_keyword_id) values (87,370); -insert into help_relation (help_topic_id,help_keyword_id) values (374,370); -insert into help_relation (help_topic_id,help_keyword_id) values (197,371); -insert into help_relation (help_topic_id,help_keyword_id) values (374,372); -insert into help_relation (help_topic_id,help_keyword_id) values (209,373); -insert into help_relation (help_topic_id,help_keyword_id) values (468,374); -insert into help_relation (help_topic_id,help_keyword_id) values (464,374); -insert into help_relation (help_topic_id,help_keyword_id) values (197,374); -insert into help_relation (help_topic_id,help_keyword_id) values (441,375); -insert into help_relation (help_topic_id,help_keyword_id) values (279,376); -insert into help_relation (help_topic_id,help_keyword_id) values (445,377); -insert into help_relation (help_topic_id,help_keyword_id) values (446,378); -insert into help_relation (help_topic_id,help_keyword_id) values (87,379); -insert into help_relation (help_topic_id,help_keyword_id) values (126,380); -insert into help_relation (help_topic_id,help_keyword_id) values (10,381); -insert into help_relation (help_topic_id,help_keyword_id) values (344,381); -insert into help_relation (help_topic_id,help_keyword_id) values (468,382); -insert into help_relation (help_topic_id,help_keyword_id) values (30,382); -insert into help_relation (help_topic_id,help_keyword_id) values (273,382); -insert into help_relation (help_topic_id,help_keyword_id) values (445,383); -insert into help_relation (help_topic_id,help_keyword_id) values (56,384); -insert into help_relation (help_topic_id,help_keyword_id) values (82,385); -insert into help_relation (help_topic_id,help_keyword_id) values (203,385); -insert into help_relation (help_topic_id,help_keyword_id) values (454,385); -insert into help_relation (help_topic_id,help_keyword_id) values (367,385); -insert into help_relation (help_topic_id,help_keyword_id) values (82,386); -insert into help_relation (help_topic_id,help_keyword_id) values (203,386); -insert into help_relation (help_topic_id,help_keyword_id) values (152,386); -insert into help_relation (help_topic_id,help_keyword_id) values (87,386); -insert into help_relation (help_topic_id,help_keyword_id) values (309,386); -insert into help_relation (help_topic_id,help_keyword_id) values (183,387); -insert into help_relation (help_topic_id,help_keyword_id) values (191,388); -insert into help_relation (help_topic_id,help_keyword_id) values (474,388); -insert into help_relation (help_topic_id,help_keyword_id) values (324,389); -insert into help_relation (help_topic_id,help_keyword_id) values (464,390); -insert into help_relation (help_topic_id,help_keyword_id) values (143,391); -insert into help_relation (help_topic_id,help_keyword_id) values (321,391); -insert into help_relation (help_topic_id,help_keyword_id) values (33,392); -insert into help_relation (help_topic_id,help_keyword_id) values (457,393); -insert into help_relation (help_topic_id,help_keyword_id) values (476,394); -insert into help_relation (help_topic_id,help_keyword_id) values (152,394); -insert into help_relation (help_topic_id,help_keyword_id) values (297,394); -insert into help_relation (help_topic_id,help_keyword_id) values (9,394); -insert into help_relation (help_topic_id,help_keyword_id) values (273,394); -insert into help_relation (help_topic_id,help_keyword_id) values (28,394); +insert into help_relation (help_topic_id,help_keyword_id) values (3,220); +insert into help_relation (help_topic_id,help_keyword_id) values (36,220); +insert into help_relation (help_topic_id,help_keyword_id) values (130,220); +insert into help_relation (help_topic_id,help_keyword_id) values (48,220); +insert into help_relation (help_topic_id,help_keyword_id) values (104,220); +insert into help_relation (help_topic_id,help_keyword_id) values (83,220); +insert into help_relation (help_topic_id,help_keyword_id) values (421,220); +insert into help_relation (help_topic_id,help_keyword_id) values (199,221); +insert into help_relation (help_topic_id,help_keyword_id) values (194,222); +insert into help_relation (help_topic_id,help_keyword_id) values (347,223); +insert into help_relation (help_topic_id,help_keyword_id) values (155,223); +insert into help_relation (help_topic_id,help_keyword_id) values (309,223); +insert into help_relation (help_topic_id,help_keyword_id) values (186,223); +insert into help_relation (help_topic_id,help_keyword_id) values (212,223); +insert into help_relation (help_topic_id,help_keyword_id) values (97,224); +insert into help_relation (help_topic_id,help_keyword_id) values (277,225); +insert into help_relation (help_topic_id,help_keyword_id) values (279,226); +insert into help_relation (help_topic_id,help_keyword_id) values (464,227); +insert into help_relation (help_topic_id,help_keyword_id) values (347,228); +insert into help_relation (help_topic_id,help_keyword_id) values (1,228); +insert into help_relation (help_topic_id,help_keyword_id) values (468,228); +insert into help_relation (help_topic_id,help_keyword_id) values (304,228); +insert into help_relation (help_topic_id,help_keyword_id) values (87,228); +insert into help_relation (help_topic_id,help_keyword_id) values (101,228); +insert into help_relation (help_topic_id,help_keyword_id) values (60,228); +insert into help_relation (help_topic_id,help_keyword_id) values (308,228); +insert into help_relation (help_topic_id,help_keyword_id) values (210,228); +insert into help_relation (help_topic_id,help_keyword_id) values (463,228); +insert into help_relation (help_topic_id,help_keyword_id) values (425,229); +insert into help_relation (help_topic_id,help_keyword_id) values (406,230); +insert into help_relation (help_topic_id,help_keyword_id) values (89,230); +insert into help_relation (help_topic_id,help_keyword_id) values (185,231); +insert into help_relation (help_topic_id,help_keyword_id) values (463,232); +insert into help_relation (help_topic_id,help_keyword_id) values (466,233); +insert into help_relation (help_topic_id,help_keyword_id) values (255,233); +insert into help_relation (help_topic_id,help_keyword_id) values (272,234); +insert into help_relation (help_topic_id,help_keyword_id) values (1,235); +insert into help_relation (help_topic_id,help_keyword_id) values (347,236); +insert into help_relation (help_topic_id,help_keyword_id) values (7,236); +insert into help_relation (help_topic_id,help_keyword_id) values (257,237); +insert into help_relation (help_topic_id,help_keyword_id) values (430,237); +insert into help_relation (help_topic_id,help_keyword_id) values (194,238); +insert into help_relation (help_topic_id,help_keyword_id) values (226,238); +insert into help_relation (help_topic_id,help_keyword_id) values (356,238); +insert into help_relation (help_topic_id,help_keyword_id) values (427,239); +insert into help_relation (help_topic_id,help_keyword_id) values (87,240); +insert into help_relation (help_topic_id,help_keyword_id) values (210,240); +insert into help_relation (help_topic_id,help_keyword_id) values (463,240); +insert into help_relation (help_topic_id,help_keyword_id) values (313,241); +insert into help_relation (help_topic_id,help_keyword_id) values (185,242); +insert into help_relation (help_topic_id,help_keyword_id) values (314,243); +insert into help_relation (help_topic_id,help_keyword_id) values (500,243); +insert into help_relation (help_topic_id,help_keyword_id) values (209,243); +insert into help_relation (help_topic_id,help_keyword_id) values (24,243); +insert into help_relation (help_topic_id,help_keyword_id) values (168,243); +insert into help_relation (help_topic_id,help_keyword_id) values (128,243); +insert into help_relation (help_topic_id,help_keyword_id) values (199,244); +insert into help_relation (help_topic_id,help_keyword_id) values (185,245); +insert into help_relation (help_topic_id,help_keyword_id) values (473,246); +insert into help_relation (help_topic_id,help_keyword_id) values (185,247); +insert into help_relation (help_topic_id,help_keyword_id) values (385,248); +insert into help_relation (help_topic_id,help_keyword_id) values (333,249); +insert into help_relation (help_topic_id,help_keyword_id) values (347,249); +insert into help_relation (help_topic_id,help_keyword_id) values (155,249); +insert into help_relation (help_topic_id,help_keyword_id) values (430,249); +insert into help_relation (help_topic_id,help_keyword_id) values (130,249); +insert into help_relation (help_topic_id,help_keyword_id) values (468,249); +insert into help_relation (help_topic_id,help_keyword_id) values (257,249); +insert into help_relation (help_topic_id,help_keyword_id) values (212,249); +insert into help_relation (help_topic_id,help_keyword_id) values (356,249); +insert into help_relation (help_topic_id,help_keyword_id) values (421,249); +insert into help_relation (help_topic_id,help_keyword_id) values (185,250); +insert into help_relation (help_topic_id,help_keyword_id) values (459,251); +insert into help_relation (help_topic_id,help_keyword_id) values (374,251); +insert into help_relation (help_topic_id,help_keyword_id) values (347,252); +insert into help_relation (help_topic_id,help_keyword_id) values (466,252); +insert into help_relation (help_topic_id,help_keyword_id) values (110,252); +insert into help_relation (help_topic_id,help_keyword_id) values (468,252); +insert into help_relation (help_topic_id,help_keyword_id) values (115,252); +insert into help_relation (help_topic_id,help_keyword_id) values (321,252); +insert into help_relation (help_topic_id,help_keyword_id) values (470,252); +insert into help_relation (help_topic_id,help_keyword_id) values (276,252); +insert into help_relation (help_topic_id,help_keyword_id) values (278,252); +insert into help_relation (help_topic_id,help_keyword_id) values (417,252); +insert into help_relation (help_topic_id,help_keyword_id) values (401,252); +insert into help_relation (help_topic_id,help_keyword_id) values (60,252); +insert into help_relation (help_topic_id,help_keyword_id) values (215,252); +insert into help_relation (help_topic_id,help_keyword_id) values (463,252); +insert into help_relation (help_topic_id,help_keyword_id) values (194,253); +insert into help_relation (help_topic_id,help_keyword_id) values (478,253); +insert into help_relation (help_topic_id,help_keyword_id) values (347,253); +insert into help_relation (help_topic_id,help_keyword_id) values (365,253); +insert into help_relation (help_topic_id,help_keyword_id) values (468,253); +insert into help_relation (help_topic_id,help_keyword_id) values (415,253); +insert into help_relation (help_topic_id,help_keyword_id) values (463,253); +insert into help_relation (help_topic_id,help_keyword_id) values (468,254); +insert into help_relation (help_topic_id,help_keyword_id) values (472,255); +insert into help_relation (help_topic_id,help_keyword_id) values (30,255); +insert into help_relation (help_topic_id,help_keyword_id) values (468,255); +insert into help_relation (help_topic_id,help_keyword_id) values (276,255); +insert into help_relation (help_topic_id,help_keyword_id) values (185,256); +insert into help_relation (help_topic_id,help_keyword_id) values (356,257); +insert into help_relation (help_topic_id,help_keyword_id) values (305,258); +insert into help_relation (help_topic_id,help_keyword_id) values (468,259); +insert into help_relation (help_topic_id,help_keyword_id) values (310,260); +insert into help_relation (help_topic_id,help_keyword_id) values (463,261); +insert into help_relation (help_topic_id,help_keyword_id) values (88,262); +insert into help_relation (help_topic_id,help_keyword_id) values (185,263); +insert into help_relation (help_topic_id,help_keyword_id) values (356,264); +insert into help_relation (help_topic_id,help_keyword_id) values (329,265); +insert into help_relation (help_topic_id,help_keyword_id) values (356,265); +insert into help_relation (help_topic_id,help_keyword_id) values (361,265); +insert into help_relation (help_topic_id,help_keyword_id) values (315,266); +insert into help_relation (help_topic_id,help_keyword_id) values (375,266); +insert into help_relation (help_topic_id,help_keyword_id) values (230,266); +insert into help_relation (help_topic_id,help_keyword_id) values (209,267); +insert into help_relation (help_topic_id,help_keyword_id) values (88,268); +insert into help_relation (help_topic_id,help_keyword_id) values (68,269); +insert into help_relation (help_topic_id,help_keyword_id) values (488,269); +insert into help_relation (help_topic_id,help_keyword_id) values (420,270); +insert into help_relation (help_topic_id,help_keyword_id) values (246,271); +insert into help_relation (help_topic_id,help_keyword_id) values (146,272); +insert into help_relation (help_topic_id,help_keyword_id) values (194,273); +insert into help_relation (help_topic_id,help_keyword_id) values (226,273); +insert into help_relation (help_topic_id,help_keyword_id) values (326,274); +insert into help_relation (help_topic_id,help_keyword_id) values (151,274); +insert into help_relation (help_topic_id,help_keyword_id) values (454,275); +insert into help_relation (help_topic_id,help_keyword_id) values (194,275); +insert into help_relation (help_topic_id,help_keyword_id) values (155,275); +insert into help_relation (help_topic_id,help_keyword_id) values (97,275); +insert into help_relation (help_topic_id,help_keyword_id) values (302,275); +insert into help_relation (help_topic_id,help_keyword_id) values (278,275); +insert into help_relation (help_topic_id,help_keyword_id) values (309,275); +insert into help_relation (help_topic_id,help_keyword_id) values (211,275); +insert into help_relation (help_topic_id,help_keyword_id) values (210,275); +insert into help_relation (help_topic_id,help_keyword_id) values (77,275); +insert into help_relation (help_topic_id,help_keyword_id) values (17,275); +insert into help_relation (help_topic_id,help_keyword_id) values (347,275); +insert into help_relation (help_topic_id,help_keyword_id) values (22,275); +insert into help_relation (help_topic_id,help_keyword_id) values (468,275); +insert into help_relation (help_topic_id,help_keyword_id) values (473,275); +insert into help_relation (help_topic_id,help_keyword_id) values (393,275); +insert into help_relation (help_topic_id,help_keyword_id) values (89,275); +insert into help_relation (help_topic_id,help_keyword_id) values (60,275); +insert into help_relation (help_topic_id,help_keyword_id) values (358,275); +insert into help_relation (help_topic_id,help_keyword_id) values (329,276); +insert into help_relation (help_topic_id,help_keyword_id) values (194,277); +insert into help_relation (help_topic_id,help_keyword_id) values (199,278); +insert into help_relation (help_topic_id,help_keyword_id) values (234,279); +insert into help_relation (help_topic_id,help_keyword_id) values (347,280); +insert into help_relation (help_topic_id,help_keyword_id) values (451,280); +insert into help_relation (help_topic_id,help_keyword_id) values (89,281); +insert into help_relation (help_topic_id,help_keyword_id) values (39,282); +insert into help_relation (help_topic_id,help_keyword_id) values (347,282); +insert into help_relation (help_topic_id,help_keyword_id) values (269,282); +insert into help_relation (help_topic_id,help_keyword_id) values (463,283); +insert into help_relation (help_topic_id,help_keyword_id) values (468,284); +insert into help_relation (help_topic_id,help_keyword_id) values (378,285); +insert into help_relation (help_topic_id,help_keyword_id) values (147,286); +insert into help_relation (help_topic_id,help_keyword_id) values (107,287); +insert into help_relation (help_topic_id,help_keyword_id) values (466,288); +insert into help_relation (help_topic_id,help_keyword_id) values (463,288); +insert into help_relation (help_topic_id,help_keyword_id) values (468,289); +insert into help_relation (help_topic_id,help_keyword_id) values (417,290); +insert into help_relation (help_topic_id,help_keyword_id) values (3,291); +insert into help_relation (help_topic_id,help_keyword_id) values (104,291); +insert into help_relation (help_topic_id,help_keyword_id) values (339,292); +insert into help_relation (help_topic_id,help_keyword_id) values (344,293); +insert into help_relation (help_topic_id,help_keyword_id) values (257,294); +insert into help_relation (help_topic_id,help_keyword_id) values (269,295); +insert into help_relation (help_topic_id,help_keyword_id) values (321,296); +insert into help_relation (help_topic_id,help_keyword_id) values (463,296); +insert into help_relation (help_topic_id,help_keyword_id) values (193,297); +insert into help_relation (help_topic_id,help_keyword_id) values (68,297); +insert into help_relation (help_topic_id,help_keyword_id) values (333,297); +insert into help_relation (help_topic_id,help_keyword_id) values (69,297); +insert into help_relation (help_topic_id,help_keyword_id) values (336,297); +insert into help_relation (help_topic_id,help_keyword_id) values (7,297); +insert into help_relation (help_topic_id,help_keyword_id) values (134,297); +insert into help_relation (help_topic_id,help_keyword_id) values (278,297); +insert into help_relation (help_topic_id,help_keyword_id) values (10,297); +insert into help_relation (help_topic_id,help_keyword_id) values (282,297); +insert into help_relation (help_topic_id,help_keyword_id) values (137,297); +insert into help_relation (help_topic_id,help_keyword_id) values (215,297); +insert into help_relation (help_topic_id,help_keyword_id) values (17,297); +insert into help_relation (help_topic_id,help_keyword_id) values (347,297); +insert into help_relation (help_topic_id,help_keyword_id) values (21,297); +insert into help_relation (help_topic_id,help_keyword_id) values (349,297); +insert into help_relation (help_topic_id,help_keyword_id) values (82,297); +insert into help_relation (help_topic_id,help_keyword_id) values (223,297); +insert into help_relation (help_topic_id,help_keyword_id) values (25,297); +insert into help_relation (help_topic_id,help_keyword_id) values (145,297); +insert into help_relation (help_topic_id,help_keyword_id) values (294,297); +insert into help_relation (help_topic_id,help_keyword_id) values (358,297); +insert into help_relation (help_topic_id,help_keyword_id) values (424,297); +insert into help_relation (help_topic_id,help_keyword_id) values (33,297); +insert into help_relation (help_topic_id,help_keyword_id) values (365,297); +insert into help_relation (help_topic_id,help_keyword_id) values (160,297); +insert into help_relation (help_topic_id,help_keyword_id) values (488,297); +insert into help_relation (help_topic_id,help_keyword_id) values (487,297); +insert into help_relation (help_topic_id,help_keyword_id) values (39,297); +insert into help_relation (help_topic_id,help_keyword_id) values (309,297); +insert into help_relation (help_topic_id,help_keyword_id) values (492,297); +insert into help_relation (help_topic_id,help_keyword_id) values (308,297); +insert into help_relation (help_topic_id,help_keyword_id) values (170,297); +insert into help_relation (help_topic_id,help_keyword_id) values (58,297); +insert into help_relation (help_topic_id,help_keyword_id) values (393,297); +insert into help_relation (help_topic_id,help_keyword_id) values (328,297); +insert into help_relation (help_topic_id,help_keyword_id) values (330,297); +insert into help_relation (help_topic_id,help_keyword_id) values (122,297); +insert into help_relation (help_topic_id,help_keyword_id) values (192,297); +insert into help_relation (help_topic_id,help_keyword_id) values (451,297); +insert into help_relation (help_topic_id,help_keyword_id) values (38,298); +insert into help_relation (help_topic_id,help_keyword_id) values (305,298); +insert into help_relation (help_topic_id,help_keyword_id) values (249,298); +insert into help_relation (help_topic_id,help_keyword_id) values (356,298); +insert into help_relation (help_topic_id,help_keyword_id) values (199,298); +insert into help_relation (help_topic_id,help_keyword_id) values (468,299); +insert into help_relation (help_topic_id,help_keyword_id) values (326,300); +insert into help_relation (help_topic_id,help_keyword_id) values (468,301); +insert into help_relation (help_topic_id,help_keyword_id) values (122,302); +insert into help_relation (help_topic_id,help_keyword_id) values (350,302); +insert into help_relation (help_topic_id,help_keyword_id) values (85,303); +insert into help_relation (help_topic_id,help_keyword_id) values (57,303); +insert into help_relation (help_topic_id,help_keyword_id) values (28,303); +insert into help_relation (help_topic_id,help_keyword_id) values (327,303); +insert into help_relation (help_topic_id,help_keyword_id) values (344,303); +insert into help_relation (help_topic_id,help_keyword_id) values (496,303); +insert into help_relation (help_topic_id,help_keyword_id) values (232,303); +insert into help_relation (help_topic_id,help_keyword_id) values (376,304); +insert into help_relation (help_topic_id,help_keyword_id) values (147,305); +insert into help_relation (help_topic_id,help_keyword_id) values (316,305); +insert into help_relation (help_topic_id,help_keyword_id) values (314,306); +insert into help_relation (help_topic_id,help_keyword_id) values (106,307); +insert into help_relation (help_topic_id,help_keyword_id) values (376,308); +insert into help_relation (help_topic_id,help_keyword_id) values (3,309); +insert into help_relation (help_topic_id,help_keyword_id) values (356,309); +insert into help_relation (help_topic_id,help_keyword_id) values (104,309); +insert into help_relation (help_topic_id,help_keyword_id) values (301,309); +insert into help_relation (help_topic_id,help_keyword_id) values (255,309); +insert into help_relation (help_topic_id,help_keyword_id) values (347,310); +insert into help_relation (help_topic_id,help_keyword_id) values (160,310); +insert into help_relation (help_topic_id,help_keyword_id) values (141,311); +insert into help_relation (help_topic_id,help_keyword_id) values (130,312); +insert into help_relation (help_topic_id,help_keyword_id) values (199,312); +insert into help_relation (help_topic_id,help_keyword_id) values (77,312); +insert into help_relation (help_topic_id,help_keyword_id) values (473,313); +insert into help_relation (help_topic_id,help_keyword_id) values (185,314); +insert into help_relation (help_topic_id,help_keyword_id) values (182,315); +insert into help_relation (help_topic_id,help_keyword_id) values (455,316); +insert into help_relation (help_topic_id,help_keyword_id) values (111,317); +insert into help_relation (help_topic_id,help_keyword_id) values (24,317); +insert into help_relation (help_topic_id,help_keyword_id) values (376,318); +insert into help_relation (help_topic_id,help_keyword_id) values (185,319); +insert into help_relation (help_topic_id,help_keyword_id) values (130,320); +insert into help_relation (help_topic_id,help_keyword_id) values (421,320); +insert into help_relation (help_topic_id,help_keyword_id) values (390,321); +insert into help_relation (help_topic_id,help_keyword_id) values (118,321); +insert into help_relation (help_topic_id,help_keyword_id) values (463,322); +insert into help_relation (help_topic_id,help_keyword_id) values (25,323); +insert into help_relation (help_topic_id,help_keyword_id) values (347,323); +insert into help_relation (help_topic_id,help_keyword_id) values (199,324); +insert into help_relation (help_topic_id,help_keyword_id) values (373,325); +insert into help_relation (help_topic_id,help_keyword_id) values (473,325); +insert into help_relation (help_topic_id,help_keyword_id) values (374,326); +insert into help_relation (help_topic_id,help_keyword_id) values (146,327); +insert into help_relation (help_topic_id,help_keyword_id) values (185,328); +insert into help_relation (help_topic_id,help_keyword_id) values (376,329); +insert into help_relation (help_topic_id,help_keyword_id) values (199,330); +insert into help_relation (help_topic_id,help_keyword_id) values (347,331); +insert into help_relation (help_topic_id,help_keyword_id) values (378,331); +insert into help_relation (help_topic_id,help_keyword_id) values (347,332); +insert into help_relation (help_topic_id,help_keyword_id) values (291,332); +insert into help_relation (help_topic_id,help_keyword_id) values (419,332); +insert into help_relation (help_topic_id,help_keyword_id) values (383,333); +insert into help_relation (help_topic_id,help_keyword_id) values (424,334); +insert into help_relation (help_topic_id,help_keyword_id) values (88,334); +insert into help_relation (help_topic_id,help_keyword_id) values (122,334); +insert into help_relation (help_topic_id,help_keyword_id) values (356,334); +insert into help_relation (help_topic_id,help_keyword_id) values (463,335); +insert into help_relation (help_topic_id,help_keyword_id) values (356,336); +insert into help_relation (help_topic_id,help_keyword_id) values (199,337); +insert into help_relation (help_topic_id,help_keyword_id) values (86,338); +insert into help_relation (help_topic_id,help_keyword_id) values (199,338); +insert into help_relation (help_topic_id,help_keyword_id) values (356,339); +insert into help_relation (help_topic_id,help_keyword_id) values (397,340); +insert into help_relation (help_topic_id,help_keyword_id) values (88,341); +insert into help_relation (help_topic_id,help_keyword_id) values (176,341); +insert into help_relation (help_topic_id,help_keyword_id) values (151,341); +insert into help_relation (help_topic_id,help_keyword_id) values (185,342); +insert into help_relation (help_topic_id,help_keyword_id) values (130,343); +insert into help_relation (help_topic_id,help_keyword_id) values (421,343); +insert into help_relation (help_topic_id,help_keyword_id) values (52,344); +insert into help_relation (help_topic_id,help_keyword_id) values (324,344); +insert into help_relation (help_topic_id,help_keyword_id) values (373,345); +insert into help_relation (help_topic_id,help_keyword_id) values (473,345); +insert into help_relation (help_topic_id,help_keyword_id) values (9,345); +insert into help_relation (help_topic_id,help_keyword_id) values (199,346); +insert into help_relation (help_topic_id,help_keyword_id) values (185,347); +insert into help_relation (help_topic_id,help_keyword_id) values (123,348); +insert into help_relation (help_topic_id,help_keyword_id) values (146,349); +insert into help_relation (help_topic_id,help_keyword_id) values (447,349); +insert into help_relation (help_topic_id,help_keyword_id) values (376,350); +insert into help_relation (help_topic_id,help_keyword_id) values (407,351); +insert into help_relation (help_topic_id,help_keyword_id) values (376,352); +insert into help_relation (help_topic_id,help_keyword_id) values (463,353); +insert into help_relation (help_topic_id,help_keyword_id) values (144,354); +insert into help_relation (help_topic_id,help_keyword_id) values (24,355); +insert into help_relation (help_topic_id,help_keyword_id) values (406,356); +insert into help_relation (help_topic_id,help_keyword_id) values (110,356); +insert into help_relation (help_topic_id,help_keyword_id) values (222,356); +insert into help_relation (help_topic_id,help_keyword_id) values (463,356); +insert into help_relation (help_topic_id,help_keyword_id) values (468,357); +insert into help_relation (help_topic_id,help_keyword_id) values (210,357); +insert into help_relation (help_topic_id,help_keyword_id) values (463,357); +insert into help_relation (help_topic_id,help_keyword_id) values (1,358); +insert into help_relation (help_topic_id,help_keyword_id) values (478,359); +insert into help_relation (help_topic_id,help_keyword_id) values (406,359); +insert into help_relation (help_topic_id,help_keyword_id) values (439,359); +insert into help_relation (help_topic_id,help_keyword_id) values (159,359); +insert into help_relation (help_topic_id,help_keyword_id) values (199,359); +insert into help_relation (help_topic_id,help_keyword_id) values (373,359); +insert into help_relation (help_topic_id,help_keyword_id) values (226,359); +insert into help_relation (help_topic_id,help_keyword_id) values (60,359); +insert into help_relation (help_topic_id,help_keyword_id) values (212,359); +insert into help_relation (help_topic_id,help_keyword_id) values (233,359); +insert into help_relation (help_topic_id,help_keyword_id) values (463,359); +insert into help_relation (help_topic_id,help_keyword_id) values (468,360); +insert into help_relation (help_topic_id,help_keyword_id) values (463,360); +insert into help_relation (help_topic_id,help_keyword_id) values (473,361); +insert into help_relation (help_topic_id,help_keyword_id) values (1,362); +insert into help_relation (help_topic_id,help_keyword_id) values (356,362); +insert into help_relation (help_topic_id,help_keyword_id) values (1,363); +insert into help_relation (help_topic_id,help_keyword_id) values (347,364); +insert into help_relation (help_topic_id,help_keyword_id) values (349,364); +insert into help_relation (help_topic_id,help_keyword_id) values (421,365); +insert into help_relation (help_topic_id,help_keyword_id) values (427,366); +insert into help_relation (help_topic_id,help_keyword_id) values (468,367); +insert into help_relation (help_topic_id,help_keyword_id) values (473,368); +insert into help_relation (help_topic_id,help_keyword_id) values (477,368); +insert into help_relation (help_topic_id,help_keyword_id) values (199,368); +insert into help_relation (help_topic_id,help_keyword_id) values (77,368); +insert into help_relation (help_topic_id,help_keyword_id) values (356,369); +insert into help_relation (help_topic_id,help_keyword_id) values (465,370); +insert into help_relation (help_topic_id,help_keyword_id) values (230,370); +insert into help_relation (help_topic_id,help_keyword_id) values (106,371); +insert into help_relation (help_topic_id,help_keyword_id) values (69,372); +insert into help_relation (help_topic_id,help_keyword_id) values (347,372); +insert into help_relation (help_topic_id,help_keyword_id) values (494,373); +insert into help_relation (help_topic_id,help_keyword_id) values (276,374); +insert into help_relation (help_topic_id,help_keyword_id) values (447,375); +insert into help_relation (help_topic_id,help_keyword_id) values (356,376); +insert into help_relation (help_topic_id,help_keyword_id) values (417,377); +insert into help_relation (help_topic_id,help_keyword_id) values (212,377); +insert into help_relation (help_topic_id,help_keyword_id) values (146,378); +insert into help_relation (help_topic_id,help_keyword_id) values (327,378); +insert into help_relation (help_topic_id,help_keyword_id) values (468,379); +insert into help_relation (help_topic_id,help_keyword_id) values (487,380); +insert into help_relation (help_topic_id,help_keyword_id) values (417,381); +insert into help_relation (help_topic_id,help_keyword_id) values (89,382); +insert into help_relation (help_topic_id,help_keyword_id) values (376,382); +insert into help_relation (help_topic_id,help_keyword_id) values (199,383); +insert into help_relation (help_topic_id,help_keyword_id) values (376,384); +insert into help_relation (help_topic_id,help_keyword_id) values (212,385); +insert into help_relation (help_topic_id,help_keyword_id) values (472,386); +insert into help_relation (help_topic_id,help_keyword_id) values (468,386); +insert into help_relation (help_topic_id,help_keyword_id) values (199,386); +insert into help_relation (help_topic_id,help_keyword_id) values (443,387); +insert into help_relation (help_topic_id,help_keyword_id) values (282,388); +insert into help_relation (help_topic_id,help_keyword_id) values (447,389); +insert into help_relation (help_topic_id,help_keyword_id) values (448,390); +insert into help_relation (help_topic_id,help_keyword_id) values (89,391); +insert into help_relation (help_topic_id,help_keyword_id) values (128,392); +insert into help_relation (help_topic_id,help_keyword_id) values (10,393); +insert into help_relation (help_topic_id,help_keyword_id) values (347,393); +insert into help_relation (help_topic_id,help_keyword_id) values (472,394); insert into help_relation (help_topic_id,help_keyword_id) values (30,394); -insert into help_relation (help_topic_id,help_keyword_id) values (87,394); -insert into help_relation (help_topic_id,help_keyword_id) values (185,394); -insert into help_relation (help_topic_id,help_keyword_id) values (459,395); -insert into help_relation (help_topic_id,help_keyword_id) values (266,396); -insert into help_relation (help_topic_id,help_keyword_id) values (104,397); -insert into help_relation (help_topic_id,help_keyword_id) values (469,398); -insert into help_relation (help_topic_id,help_keyword_id) values (219,398); -insert into help_relation (help_topic_id,help_keyword_id) values (328,398); -insert into help_relation (help_topic_id,help_keyword_id) values (75,398); -insert into help_relation (help_topic_id,help_keyword_id) values (464,399); -insert into help_relation (help_topic_id,help_keyword_id) values (310,400); -insert into help_relation (help_topic_id,help_keyword_id) values (344,401); -insert into help_relation (help_topic_id,help_keyword_id) values (305,401); -insert into help_relation (help_topic_id,help_keyword_id) values (459,401); -insert into help_relation (help_topic_id,help_keyword_id) values (48,402); -insert into help_relation (help_topic_id,help_keyword_id) values (120,402); -insert into help_relation (help_topic_id,help_keyword_id) values (353,402); -insert into help_relation (help_topic_id,help_keyword_id) values (81,402); -insert into help_relation (help_topic_id,help_keyword_id) values (104,402); +insert into help_relation (help_topic_id,help_keyword_id) values (276,394); +insert into help_relation (help_topic_id,help_keyword_id) values (447,395); +insert into help_relation (help_topic_id,help_keyword_id) values (56,396); +insert into help_relation (help_topic_id,help_keyword_id) values (84,397); +insert into help_relation (help_topic_id,help_keyword_id) values (206,397); +insert into help_relation (help_topic_id,help_keyword_id) values (456,397); +insert into help_relation (help_topic_id,help_keyword_id) values (368,397); +insert into help_relation (help_topic_id,help_keyword_id) values (84,398); +insert into help_relation (help_topic_id,help_keyword_id) values (206,398); +insert into help_relation (help_topic_id,help_keyword_id) values (155,398); +insert into help_relation (help_topic_id,help_keyword_id) values (89,398); +insert into help_relation (help_topic_id,help_keyword_id) values (312,398); +insert into help_relation (help_topic_id,help_keyword_id) values (189,399); +insert into help_relation (help_topic_id,help_keyword_id) values (194,400); +insert into help_relation (help_topic_id,help_keyword_id) values (478,400); +insert into help_relation (help_topic_id,help_keyword_id) values (326,401); +insert into help_relation (help_topic_id,help_keyword_id) values (459,402); insert into help_relation (help_topic_id,help_keyword_id) values (468,403); -insert into help_relation (help_topic_id,help_keyword_id) values (60,403); -insert into help_relation (help_topic_id,help_keyword_id) values (102,403); -insert into help_relation (help_topic_id,help_keyword_id) values (464,403); -insert into help_relation (help_topic_id,help_keyword_id) values (459,403); -insert into help_relation (help_topic_id,help_keyword_id) values (464,404); -insert into help_relation (help_topic_id,help_keyword_id) values (228,405); -insert into help_relation (help_topic_id,help_keyword_id) values (353,406); -insert into help_relation (help_topic_id,help_keyword_id) values (3,407); -insert into help_relation (help_topic_id,help_keyword_id) values (102,407); -insert into help_relation (help_topic_id,help_keyword_id) values (482,407); -insert into help_relation (help_topic_id,help_keyword_id) values (466,408); -insert into help_relation (help_topic_id,help_keyword_id) values (459,408); -insert into help_relation (help_topic_id,help_keyword_id) values (464,409); -insert into help_relation (help_topic_id,help_keyword_id) values (459,409); -insert into help_relation (help_topic_id,help_keyword_id) values (464,410); -insert into help_relation (help_topic_id,help_keyword_id) values (239,410); -insert into help_relation (help_topic_id,help_keyword_id) values (468,411); -insert into help_relation (help_topic_id,help_keyword_id) values (464,411); -insert into help_relation (help_topic_id,help_keyword_id) values (36,412); -insert into help_relation (help_topic_id,help_keyword_id) values (191,413); -insert into help_relation (help_topic_id,help_keyword_id) values (474,413); -insert into help_relation (help_topic_id,help_keyword_id) values (127,414); -insert into help_relation (help_topic_id,help_keyword_id) values (445,414); -insert into help_relation (help_topic_id,help_keyword_id) values (346,414); -insert into help_relation (help_topic_id,help_keyword_id) values (133,414); -insert into help_relation (help_topic_id,help_keyword_id) values (344,415); -insert into help_relation (help_topic_id,help_keyword_id) values (469,415); -insert into help_relation (help_topic_id,help_keyword_id) values (152,415); -insert into help_relation (help_topic_id,help_keyword_id) values (306,415); -insert into help_relation (help_topic_id,help_keyword_id) values (185,415); -insert into help_relation (help_topic_id,help_keyword_id) values (209,415); -insert into help_relation (help_topic_id,help_keyword_id) values (82,416); +insert into help_relation (help_topic_id,help_keyword_id) values (146,404); +insert into help_relation (help_topic_id,help_keyword_id) values (324,404); +insert into help_relation (help_topic_id,help_keyword_id) values (33,405); +insert into help_relation (help_topic_id,help_keyword_id) values (460,406); +insert into help_relation (help_topic_id,help_keyword_id) values (479,407); +insert into help_relation (help_topic_id,help_keyword_id) values (155,407); +insert into help_relation (help_topic_id,help_keyword_id) values (300,407); +insert into help_relation (help_topic_id,help_keyword_id) values (9,407); +insert into help_relation (help_topic_id,help_keyword_id) values (276,407); +insert into help_relation (help_topic_id,help_keyword_id) values (28,407); +insert into help_relation (help_topic_id,help_keyword_id) values (30,407); +insert into help_relation (help_topic_id,help_keyword_id) values (89,407); +insert into help_relation (help_topic_id,help_keyword_id) values (186,407); +insert into help_relation (help_topic_id,help_keyword_id) values (130,408); +insert into help_relation (help_topic_id,help_keyword_id) values (463,409); +insert into help_relation (help_topic_id,help_keyword_id) values (269,410); +insert into help_relation (help_topic_id,help_keyword_id) values (106,411); +insert into help_relation (help_topic_id,help_keyword_id) values (473,412); +insert into help_relation (help_topic_id,help_keyword_id) values (222,412); +insert into help_relation (help_topic_id,help_keyword_id) values (331,412); +insert into help_relation (help_topic_id,help_keyword_id) values (77,412); +insert into help_relation (help_topic_id,help_keyword_id) values (313,413); +insert into help_relation (help_topic_id,help_keyword_id) values (347,414); +insert into help_relation (help_topic_id,help_keyword_id) values (308,414); +insert into help_relation (help_topic_id,help_keyword_id) values (463,414); +insert into help_relation (help_topic_id,help_keyword_id) values (424,415); +insert into help_relation (help_topic_id,help_keyword_id) values (48,415); +insert into help_relation (help_topic_id,help_keyword_id) values (122,415); +insert into help_relation (help_topic_id,help_keyword_id) values (356,415); +insert into help_relation (help_topic_id,help_keyword_id) values (83,415); +insert into help_relation (help_topic_id,help_keyword_id) values (106,415); +insert into help_relation (help_topic_id,help_keyword_id) values (472,416); +insert into help_relation (help_topic_id,help_keyword_id) values (60,416); +insert into help_relation (help_topic_id,help_keyword_id) values (104,416); insert into help_relation (help_topic_id,help_keyword_id) values (468,416); -insert into help_relation (help_topic_id,help_keyword_id) values (367,416); -insert into help_relation (help_topic_id,help_keyword_id) values (479,417); -insert into help_relation (help_topic_id,help_keyword_id) values (462,418); -insert into help_relation (help_topic_id,help_keyword_id) values (420,419); -insert into help_relation (help_topic_id,help_keyword_id) values (38,420); -insert into help_relation (help_topic_id,help_keyword_id) values (142,420); -insert into help_relation (help_topic_id,help_keyword_id) values (405,420); -insert into help_relation (help_topic_id,help_keyword_id) values (87,420); -insert into help_relation (help_topic_id,help_keyword_id) values (220,420); -insert into help_relation (help_topic_id,help_keyword_id) values (52,420); -insert into help_relation (help_topic_id,help_keyword_id) values (321,420); -insert into help_relation (help_topic_id,help_keyword_id) values (253,421); -insert into help_relation (help_topic_id,help_keyword_id) values (353,422); -insert into help_relation (help_topic_id,help_keyword_id) values (360,422); -insert into help_relation (help_topic_id,help_keyword_id) values (487,423); -insert into help_relation (help_topic_id,help_keyword_id) values (420,424); -insert into help_relation (help_topic_id,help_keyword_id) values (405,425); -insert into help_relation (help_topic_id,help_keyword_id) values (87,425); -insert into help_relation (help_topic_id,help_keyword_id) values (459,425); -insert into help_relation (help_topic_id,help_keyword_id) values (464,426); -insert into help_relation (help_topic_id,help_keyword_id) values (209,426); -insert into help_relation (help_topic_id,help_keyword_id) values (492,427); -insert into help_relation (help_topic_id,help_keyword_id) values (197,428); -insert into help_relation (help_topic_id,help_keyword_id) values (462,429); -insert into help_relation (help_topic_id,help_keyword_id) values (324,429); -insert into help_relation (help_topic_id,help_keyword_id) values (36,429); -insert into help_relation (help_topic_id,help_keyword_id) values (112,429); -insert into help_relation (help_topic_id,help_keyword_id) values (420,429); -insert into help_relation (help_topic_id,help_keyword_id) values (466,429); -insert into help_relation (help_topic_id,help_keyword_id) values (0,430); -insert into help_relation (help_topic_id,help_keyword_id) values (94,430); -insert into help_relation (help_topic_id,help_keyword_id) values (382,430); -insert into help_relation (help_topic_id,help_keyword_id) values (285,430); -insert into help_relation (help_topic_id,help_keyword_id) values (431,430); -insert into help_relation (help_topic_id,help_keyword_id) values (302,430); -insert into help_relation (help_topic_id,help_keyword_id) values (353,430); -insert into help_relation (help_topic_id,help_keyword_id) values (360,430); -insert into help_relation (help_topic_id,help_keyword_id) values (493,431); -insert into help_relation (help_topic_id,help_keyword_id) values (184,432); -insert into help_relation (help_topic_id,help_keyword_id) values (197,433); -insert into help_relation (help_topic_id,help_keyword_id) values (130,434); -insert into help_relation (help_topic_id,help_keyword_id) values (344,434); -insert into help_relation (help_topic_id,help_keyword_id) values (291,434); -insert into help_relation (help_topic_id,help_keyword_id) values (36,434); -insert into help_relation (help_topic_id,help_keyword_id) values (491,435); -insert into help_relation (help_topic_id,help_keyword_id) values (27,436); -insert into help_relation (help_topic_id,help_keyword_id) values (344,437); -insert into help_relation (help_topic_id,help_keyword_id) values (22,437); -insert into help_relation (help_topic_id,help_keyword_id) values (260,437); -insert into help_relation (help_topic_id,help_keyword_id) values (344,438); -insert into help_relation (help_topic_id,help_keyword_id) values (488,438); -insert into help_relation (help_topic_id,help_keyword_id) values (197,439); -insert into help_relation (help_topic_id,help_keyword_id) values (353,440); -insert into help_relation (help_topic_id,help_keyword_id) values (102,440); -insert into help_relation (help_topic_id,help_keyword_id) values (207,441); -insert into help_relation (help_topic_id,help_keyword_id) values (464,442); -insert into help_relation (help_topic_id,help_keyword_id) values (104,442); -insert into help_relation (help_topic_id,help_keyword_id) values (459,442); -insert into help_relation (help_topic_id,help_keyword_id) values (459,443); -insert into help_relation (help_topic_id,help_keyword_id) values (191,444); -insert into help_relation (help_topic_id,help_keyword_id) values (474,444); -insert into help_relation (help_topic_id,help_keyword_id) values (344,445); -insert into help_relation (help_topic_id,help_keyword_id) values (39,446); -insert into help_relation (help_topic_id,help_keyword_id) values (116,446); -insert into help_relation (help_topic_id,help_keyword_id) values (266,446); -insert into help_relation (help_topic_id,help_keyword_id) values (58,446); -insert into help_relation (help_topic_id,help_keyword_id) values (184,446); -insert into help_relation (help_topic_id,help_keyword_id) values (261,446); -insert into help_relation (help_topic_id,help_keyword_id) values (358,446); -insert into help_relation (help_topic_id,help_keyword_id) values (206,447); -insert into help_relation (help_topic_id,help_keyword_id) values (464,447); -insert into help_relation (help_topic_id,help_keyword_id) values (198,448); -insert into help_relation (help_topic_id,help_keyword_id) values (464,449); +insert into help_relation (help_topic_id,help_keyword_id) values (463,416); +insert into help_relation (help_topic_id,help_keyword_id) values (468,417); +insert into help_relation (help_topic_id,help_keyword_id) values (232,418); +insert into help_relation (help_topic_id,help_keyword_id) values (356,419); +insert into help_relation (help_topic_id,help_keyword_id) values (3,420); +insert into help_relation (help_topic_id,help_keyword_id) values (104,420); +insert into help_relation (help_topic_id,help_keyword_id) values (486,420); +insert into help_relation (help_topic_id,help_keyword_id) values (459,421); +insert into help_relation (help_topic_id,help_keyword_id) values (374,421); +insert into help_relation (help_topic_id,help_keyword_id) values (470,422); +insert into help_relation (help_topic_id,help_keyword_id) values (463,422); +insert into help_relation (help_topic_id,help_keyword_id) values (468,423); +insert into help_relation (help_topic_id,help_keyword_id) values (463,423); +insert into help_relation (help_topic_id,help_keyword_id) values (468,424); +insert into help_relation (help_topic_id,help_keyword_id) values (243,424); +insert into help_relation (help_topic_id,help_keyword_id) values (472,425); +insert into help_relation (help_topic_id,help_keyword_id) values (468,425); +insert into help_relation (help_topic_id,help_keyword_id) values (36,426); +insert into help_relation (help_topic_id,help_keyword_id) values (194,427); +insert into help_relation (help_topic_id,help_keyword_id) values (478,427); +insert into help_relation (help_topic_id,help_keyword_id) values (129,428); +insert into help_relation (help_topic_id,help_keyword_id) values (447,428); +insert into help_relation (help_topic_id,help_keyword_id) values (349,428); +insert into help_relation (help_topic_id,help_keyword_id) values (137,428); +insert into help_relation (help_topic_id,help_keyword_id) values (347,429); +insert into help_relation (help_topic_id,help_keyword_id) values (473,429); +insert into help_relation (help_topic_id,help_keyword_id) values (155,429); +insert into help_relation (help_topic_id,help_keyword_id) values (309,429); +insert into help_relation (help_topic_id,help_keyword_id) values (186,429); +insert into help_relation (help_topic_id,help_keyword_id) values (212,429); +insert into help_relation (help_topic_id,help_keyword_id) values (84,430); +insert into help_relation (help_topic_id,help_keyword_id) values (472,430); +insert into help_relation (help_topic_id,help_keyword_id) values (368,430); +insert into help_relation (help_topic_id,help_keyword_id) values (483,431); +insert into help_relation (help_topic_id,help_keyword_id) values (466,432); +insert into help_relation (help_topic_id,help_keyword_id) values (421,433); +insert into help_relation (help_topic_id,help_keyword_id) values (145,434); +insert into help_relation (help_topic_id,help_keyword_id) values (38,434); +insert into help_relation (help_topic_id,help_keyword_id) values (406,434); +insert into help_relation (help_topic_id,help_keyword_id) values (89,434); +insert into help_relation (help_topic_id,help_keyword_id) values (223,434); +insert into help_relation (help_topic_id,help_keyword_id) values (52,434); +insert into help_relation (help_topic_id,help_keyword_id) values (324,434); +insert into help_relation (help_topic_id,help_keyword_id) values (257,435); +insert into help_relation (help_topic_id,help_keyword_id) values (356,436); +insert into help_relation (help_topic_id,help_keyword_id) values (361,436); +insert into help_relation (help_topic_id,help_keyword_id) values (491,437); +insert into help_relation (help_topic_id,help_keyword_id) values (421,438); +insert into help_relation (help_topic_id,help_keyword_id) values (406,439); +insert into help_relation (help_topic_id,help_keyword_id) values (89,439); +insert into help_relation (help_topic_id,help_keyword_id) values (463,439); +insert into help_relation (help_topic_id,help_keyword_id) values (468,440); +insert into help_relation (help_topic_id,help_keyword_id) values (212,440); +insert into help_relation (help_topic_id,help_keyword_id) values (199,441); +insert into help_relation (help_topic_id,help_keyword_id) values (496,442); +insert into help_relation (help_topic_id,help_keyword_id) values (466,443); +insert into help_relation (help_topic_id,help_keyword_id) values (326,443); +insert into help_relation (help_topic_id,help_keyword_id) values (36,443); +insert into help_relation (help_topic_id,help_keyword_id) values (130,443); +insert into help_relation (help_topic_id,help_keyword_id) values (115,443); +insert into help_relation (help_topic_id,help_keyword_id) values (421,443); +insert into help_relation (help_topic_id,help_keyword_id) values (470,443); +insert into help_relation (help_topic_id,help_keyword_id) values (0,444); +insert into help_relation (help_topic_id,help_keyword_id) values (96,444); +insert into help_relation (help_topic_id,help_keyword_id) values (384,444); +insert into help_relation (help_topic_id,help_keyword_id) values (288,444); +insert into help_relation (help_topic_id,help_keyword_id) values (433,444); +insert into help_relation (help_topic_id,help_keyword_id) values (305,444); +insert into help_relation (help_topic_id,help_keyword_id) values (356,444); +insert into help_relation (help_topic_id,help_keyword_id) values (361,444); +insert into help_relation (help_topic_id,help_keyword_id) values (497,445); +insert into help_relation (help_topic_id,help_keyword_id) values (185,446); +insert into help_relation (help_topic_id,help_keyword_id) values (199,447); +insert into help_relation (help_topic_id,help_keyword_id) values (134,448); +insert into help_relation (help_topic_id,help_keyword_id) values (347,448); +insert into help_relation (help_topic_id,help_keyword_id) values (294,448); +insert into help_relation (help_topic_id,help_keyword_id) values (36,448); +insert into help_relation (help_topic_id,help_keyword_id) values (495,449); +insert into help_relation (help_topic_id,help_keyword_id) values (27,450); +insert into help_relation (help_topic_id,help_keyword_id) values (347,451); +insert into help_relation (help_topic_id,help_keyword_id) values (22,451); +insert into help_relation (help_topic_id,help_keyword_id) values (263,451); +insert into help_relation (help_topic_id,help_keyword_id) values (347,452); +insert into help_relation (help_topic_id,help_keyword_id) values (492,452); +insert into help_relation (help_topic_id,help_keyword_id) values (199,453); +insert into help_relation (help_topic_id,help_keyword_id) values (356,454); +insert into help_relation (help_topic_id,help_keyword_id) values (104,454); +insert into help_relation (help_topic_id,help_keyword_id) values (210,455); +insert into help_relation (help_topic_id,help_keyword_id) values (468,456); +insert into help_relation (help_topic_id,help_keyword_id) values (106,456); +insert into help_relation (help_topic_id,help_keyword_id) values (463,456); +insert into help_relation (help_topic_id,help_keyword_id) values (463,457); +insert into help_relation (help_topic_id,help_keyword_id) values (194,458); +insert into help_relation (help_topic_id,help_keyword_id) values (478,458); +insert into help_relation (help_topic_id,help_keyword_id) values (459,459); +insert into help_relation (help_topic_id,help_keyword_id) values (374,459); +insert into help_relation (help_topic_id,help_keyword_id) values (39,460); +insert into help_relation (help_topic_id,help_keyword_id) values (58,460); +insert into help_relation (help_topic_id,help_keyword_id) values (269,460); +insert into help_relation (help_topic_id,help_keyword_id) values (185,460); +insert into help_relation (help_topic_id,help_keyword_id) values (264,460); +insert into help_relation (help_topic_id,help_keyword_id) values (209,461); +insert into help_relation (help_topic_id,help_keyword_id) values (468,461); +insert into help_relation (help_topic_id,help_keyword_id) values (201,462); +insert into help_relation (help_topic_id,help_keyword_id) values (468,463); + diff --git a/sql-common/client.c b/sql-common/client.c index 337e5b7458c..d0f1a8d078c 100644 --- a/sql-common/client.c +++ b/sql-common/client.c @@ -1,5 +1,5 @@ -/* - Copyright (c) 2003, 2011, Oracle and/or its affiliates. +/* Copyright (c) 2003, 2012, Oracle and/or its affiliates. + Copyright (c) 2009, 2012, Monty Program Ab This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -1439,7 +1439,7 @@ static void cli_fetch_lengths(ulong *to, MYSQL_ROW column, ***************************************************************************/ MYSQL_FIELD * -unpack_fields(MYSQL_DATA *data,MEM_ROOT *alloc,uint fields, +unpack_fields(MYSQL *mysql, MYSQL_DATA *data,MEM_ROOT *alloc,uint fields, my_bool default_value, uint server_capabilities) { MYSQL_ROWS *row; @@ -1452,6 +1452,7 @@ unpack_fields(MYSQL_DATA *data,MEM_ROOT *alloc,uint fields, if (!result) { free_rows(data); /* Free old data */ + set_mysql_error(mysql, CR_OUT_OF_MEMORY, unknown_sqlstate); DBUG_RETURN(0); } bzero((char*) field, (uint) sizeof(MYSQL_FIELD)*fields); @@ -1479,6 +1480,14 @@ unpack_fields(MYSQL_DATA *data,MEM_ROOT *alloc,uint fields, field->org_name_length= lengths[5]; /* Unpack fixed length parts */ + if (lengths[6] != 12) + { + /* malformed packet. signal an error. */ + free_rows(data); /* Free old data */ + set_mysql_error(mysql, CR_MALFORMED_PACKET, unknown_sqlstate); + DBUG_RETURN(0); + } + pos= (uchar*) row->data[6]; field->charsetnr= uint2korr(pos); field->length= (uint) uint4korr(pos+2); @@ -3361,6 +3370,12 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user, mysql->server_status=uint2korr(end+3); mysql->server_capabilities|= uint2korr(end+5) << 16; pkt_scramble_len= end[7]; + if (pkt_scramble_len < 0) + { + set_mysql_error(mysql, CR_MALFORMED_PACKET, + unknown_sqlstate); /* purecov: inspected */ + goto error; + } } end+= 18; @@ -3896,7 +3911,7 @@ get_info: if (!(fields=cli_read_rows(mysql,(MYSQL_FIELD*)0, protocol_41(mysql) ? 7:5))) DBUG_RETURN(1); - if (!(mysql->fields=unpack_fields(fields,&mysql->field_alloc, + if (!(mysql->fields=unpack_fields(mysql, fields,&mysql->field_alloc, (uint) field_count,0, mysql->server_capabilities))) DBUG_RETURN(1); diff --git a/sql/create_options.cc b/sql/create_options.cc index 9a6f6b5cf7c..e4881388688 100644 --- a/sql/create_options.cc +++ b/sql/create_options.cc @@ -137,7 +137,10 @@ static bool set_one_value(ha_create_table_option *opt, my_option optp= { opt->name, 1, 0, (uchar **)val, 0, 0, GET_ULL, - REQUIRED_ARG, opt->def_value, opt->min_value, opt->max_value, + REQUIRED_ARG, + (longlong) opt->def_value, + (longlong) opt->min_value, + opt->max_value, 0, (long) opt->block_size, 0}; ulonglong orig_val= strtoull(value->str, NULL, 10); diff --git a/sql/field.cc b/sql/field.cc index 2084c661602..f20d9ba87fc 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -9567,6 +9567,17 @@ Create_field::Create_field(Field *old_field,Field *orig_field) geom_type= ((Field_geom*)old_field)->geom_type; break; #endif + case MYSQL_TYPE_YEAR: + if (length != 4) + { + char buff[sizeof("YEAR()") + MY_INT64_NUM_DECIMAL_DIGITS + 1]; + my_snprintf(buff, sizeof(buff), "YEAR(%lu)", length); + push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_NOTE, + ER_WARN_DEPRECATED_SYNTAX, + ER(ER_WARN_DEPRECATED_SYNTAX), + buff, "YEAR(4)"); + } + break; default: break; } diff --git a/sql/filesort.cc b/sql/filesort.cc index 03379f2738a..04b223b7db0 100644 --- a/sql/filesort.cc +++ b/sql/filesort.cc @@ -103,6 +103,7 @@ ha_rows filesort(THD *thd, TABLE *table, SORT_FIELD *sortorder, uint s_length, int error; ulong memory_available= thd->variables.sortbuff_size; ulong min_sort_memory; + ulong sort_buff_sz; uint maxbuffer; BUFFPEK *buffpek; ha_rows num_rows= HA_POS_ERROR; @@ -193,19 +194,21 @@ ha_rows filesort(THD *thd, TABLE *table, SORT_FIELD *sortorder, uint s_length, goto err; min_sort_memory= max(MIN_SORT_MEMORY, param.sort_length * MERGEBUFF2); + set_if_bigger(min_sort_memory, sizeof(BUFFPEK*)*MERGEBUFF2); if (!table_sort.sort_keys) { while (memory_available >= min_sort_memory) { ulong keys= memory_available / (param.rec_length + sizeof(char*)); table_sort.keys= (uint) min(num_rows, keys); + sort_buff_sz= table_sort.keys*(param.rec_length+sizeof(char*)); + set_if_bigger(sort_buff_sz, param.rec_length * MERGEBUFF2); DBUG_EXECUTE_IF("make_sort_keys_alloc_fail", DBUG_SET("+d,simulate_out_of_memory");); if ((table_sort.sort_keys= - (uchar**) my_malloc(table_sort.keys*(param.rec_length+sizeof(char*)), - MYF(0)))) + (uchar**) my_malloc(sort_buff_sz, MYF(0)))) break; ulong old_memory_available= memory_available; memory_available= memory_available/4*3; @@ -1259,9 +1262,8 @@ int merge_buffers(SORTPARAM *param, IO_CACHE *from_file, to_start_filepos= my_b_tell(to_file); strpos= sort_buffer; org_max_rows=max_rows= param->max_rows; - - /* The following will fire if there is not enough space in sort_buffer */ - DBUG_ASSERT(maxcount!=0); + + set_if_bigger(maxcount, 1); if (unique_buff) { diff --git a/sql/ha_ndbcluster_binlog.cc b/sql/ha_ndbcluster_binlog.cc index f91e19df08e..59b9d6eab6b 100644 --- a/sql/ha_ndbcluster_binlog.cc +++ b/sql/ha_ndbcluster_binlog.cc @@ -1295,7 +1295,9 @@ int ndbcluster_log_schema_op(THD *thd, NDB_SHARE *share, DBUG_RETURN(0); } - char tmp_buf2[FN_REFLEN]; + char tmp_buf2_mem[FN_REFLEN]; + String tmp_buf2(tmp_buf2_mem, sizeof(tmp_buf2_mem), system_charset_info); + tmp_buf2.length(0); const char *type_str; switch (type) { @@ -1304,17 +1306,24 @@ int ndbcluster_log_schema_op(THD *thd, NDB_SHARE *share, if (thd->lex->sql_command == SQLCOM_DROP_DB) DBUG_RETURN(0); /* redo the drop table query as is may contain several tables */ - query= tmp_buf2; - query_length= (uint) (strxmov(tmp_buf2, "drop table `", - table_name, "`", NullS) - tmp_buf2); + tmp_buf2.append(STRING_WITH_LEN("drop table ")); + append_identifier(thd, &tmp_buf2, table_name, strlen(table_name)); + query= tmp_buf2.c_ptr_safe(); + query_length= tmp_buf2.length(); type_str= "drop table"; break; case SOT_RENAME_TABLE: /* redo the rename table query as is may contain several tables */ - query= tmp_buf2; - query_length= (uint) (strxmov(tmp_buf2, "rename table `", - db, ".", table_name, "` to `", - new_db, ".", new_table_name, "`", NullS) - tmp_buf2); + tmp_buf2.append(STRING_WITH_LEN("rename table ")); + append_identifier(thd, &tmp_buf2, db, strlen(db)); + tmp_buf2.append(STRING_WITH_LEN(".")); + append_identifier(thd, &tmp_buf2, table_name, strlen(table_name)); + tmp_buf2.append(STRING_WITH_LEN(" to ")); + append_identifier(thd, &tmp_buf2, new_db, strlen(new_db)); + tmp_buf2.append(STRING_WITH_LEN(".")); + append_identifier(thd, &tmp_buf2, new_table_name, strlen(new_table_name)); + query= tmp_buf2.c_ptr_safe(); + query_length= tmp_buf2.length(); type_str= "rename table"; break; case SOT_CREATE_TABLE: diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index 5118818fa54..b3f97d35033 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -2076,6 +2076,133 @@ partition_element *ha_partition::find_partition_element(uint part_id) return NULL; } +uint ha_partition::count_query_cache_dependant_tables(uint8 *tables_type) +{ + DBUG_ENTER("ha_partition::count_query_cache_dependant_tables"); + /* Here we rely on the fact that all tables are of the same type */ + uint8 type= m_file[0]->table_cache_type(); + (*tables_type)|= type; + DBUG_PRINT("info", ("cnt: %u", (uint)m_tot_parts)); + /* + We need save underlying tables only for HA_CACHE_TBL_ASKTRANSACT: + HA_CACHE_TBL_NONTRANSACT - because all changes goes through partition table + HA_CACHE_TBL_NOCACHE - because will not be cached + HA_CACHE_TBL_TRANSACT - QC need to know that such type present + */ + DBUG_RETURN(type == HA_CACHE_TBL_ASKTRANSACT ? m_tot_parts : 0); +} + +my_bool ha_partition::reg_query_cache_dependant_table(THD *thd, + char *key, uint key_len, + uint8 type, + Query_cache *cache, + Query_cache_block_table **block_table, + handler *file, + uint *n) +{ + DBUG_ENTER("ha_partition::reg_query_cache_dependant_table"); + qc_engine_callback engine_callback; + ulonglong engine_data; + /* ask undelying engine */ + if (!file->register_query_cache_table(thd, key, + key_len, + &engine_callback, + &engine_data)) + { + DBUG_PRINT("qcache", ("Handler does not allow caching for %s.%s", + key, + key + table_share->db.length + 1)); + /* + As this can change from call to call, don't reset set + thd->lex->safe_to_cache_query + */ + thd->query_cache_is_applicable= 0; // Query can't be cached + DBUG_RETURN(TRUE); + } + (++(*block_table))->n= ++(*n); + if (!cache->insert_table(key_len, + key, (*block_table), + table_share->db.length, + type, + engine_callback, engine_data, + FALSE)) + DBUG_RETURN(TRUE); + DBUG_RETURN(FALSE); +} + + +my_bool ha_partition::register_query_cache_dependant_tables(THD *thd, + Query_cache *cache, + Query_cache_block_table **block_table, + uint *n) +{ + char *name; + uint prefix_length= table_share->table_cache_key.length + 3; + uint num_parts= m_part_info->num_parts; + uint num_subparts= m_part_info->num_subparts; + uint i= 0; + List_iterator<partition_element> part_it(m_part_info->partitions); + char key[FN_REFLEN]; + + DBUG_ENTER("ha_partition::register_query_cache_dependant_tables"); + + /* see ha_partition::count_query_cache_dependant_tables */ + if (m_file[0]->table_cache_type() != HA_CACHE_TBL_ASKTRANSACT) + DBUG_RETURN(FALSE); // nothing to register + + /* prepare static part of the key */ + memmove(key, table_share->table_cache_key.str, + table_share->table_cache_key.length); + + name= key + table_share->table_cache_key.length - 1; + name[0]= name[2]= '#'; + name[1]= 'P'; + name+= 3; + + do + { + partition_element *part_elem= part_it++; + uint part_len= strmov(name, part_elem->partition_name) - name; + if (m_is_sub_partitioned) + { + List_iterator<partition_element> subpart_it(part_elem->subpartitions); + partition_element *sub_elem; + char *sname= name + part_len; + uint j= 0, part; + sname[0]= sname[3]= '#'; + sname[1]= 'S'; + sname[2]= 'P'; + sname += 4; + do + { + sub_elem= subpart_it++; + part= i * num_subparts + j; + uint spart_len= strmov(sname, sub_elem->partition_name) - name + 1; + if (reg_query_cache_dependant_table(thd, key, + prefix_length + part_len + 4 + + spart_len, + m_file[part]->table_cache_type(), + cache, + block_table, m_file[part], + n)) + DBUG_RETURN(TRUE); + } while (++j < num_subparts); + } + else + { + if (reg_query_cache_dependant_table(thd, key, + prefix_length + part_len + 1, + m_file[i]->table_cache_type(), + cache, + block_table, m_file[i], + n)) + DBUG_RETURN(TRUE); + } + } while (++i < num_parts); + DBUG_PRINT("info", ("cnt: %u", (uint)m_tot_parts)); + DBUG_RETURN(FALSE); +} + /* Set up table share object before calling create on underlying handler @@ -3710,7 +3837,7 @@ int ha_partition::truncate_partition(Alter_info *alter_info, bool *binlog_stmt) { List_iterator<partition_element> subpart_it(part_elem->subpartitions); - partition_element __attribute__((unused)) *sub_elem; + partition_element *sub_elem __attribute__((unused)); uint j= 0, part; do { @@ -6363,7 +6490,17 @@ ha_rows ha_partition::min_rows_for_estimate() DBUG_ENTER("ha_partition::min_rows_for_estimate"); tot_used_partitions= bitmap_bits_set(&m_part_info->used_partitions); - DBUG_ASSERT(tot_used_partitions); + + /* + All partitions might have been left as unused during partition pruning + due to, for example, an impossible WHERE condition. Nonetheless, the + optimizer might still attempt to perform (e.g. range) analysis where an + estimate of the the number of rows is calculated using records_in_range. + Hence, to handle this and other possible cases, use zero as the minimum + number of rows to base the estimate on if no partition is being used. + */ + if (!tot_used_partitions) + DBUG_RETURN(0); /* Allow O(log2(tot_partitions)) increase in number of used partitions. diff --git a/sql/ha_partition.h b/sql/ha_partition.h index aa9179f9f69..0f922394ec5 100644 --- a/sql/ha_partition.h +++ b/sql/ha_partition.h @@ -544,22 +544,20 @@ public: virtual int extra(enum ha_extra_function operation); virtual int extra_opt(enum ha_extra_function operation, ulong cachesize); virtual int reset(void); - /* - Do not allow caching of partitioned tables, since we cannot return - a callback or engine_data that would work for a generic engine. - */ - virtual my_bool register_query_cache_table(THD *thd, char *table_key, - uint key_length, - qc_engine_callback - *engine_callback, - ulonglong *engine_data) - { - *engine_callback= NULL; - *engine_data= 0; - return FALSE; - } + virtual uint count_query_cache_dependant_tables(uint8 *tables_type); + virtual my_bool + register_query_cache_dependant_tables(THD *thd, + Query_cache *cache, + Query_cache_block_table **block, + uint *n); private: + my_bool reg_query_cache_dependant_table(THD *thd, + char *key, uint key_len, uint8 type, + Query_cache *cache, + Query_cache_block_table + **block_table, + handler *file, uint *n); static const uint NO_CURRENT_PART_ID; int loop_extra(enum ha_extra_function operation); void late_extra_cache(uint partition_id); diff --git a/sql/handler.cc b/sql/handler.cc index b7d545a75dc..58d37532796 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -504,10 +504,6 @@ int ha_initialize_handlerton(st_plugin_int *plugin) "Assigning value %d.", plugin->plugin->name, idx); hton->db_type= (enum legacy_db_type) idx; } - installed_htons[hton->db_type]= hton; - tmp= hton->savepoint_offset; - hton->savepoint_offset= savepoint_alloc_size; - savepoint_alloc_size+= tmp; /* In case a plugin is uninstalled and re-installed later, it should @@ -2558,8 +2554,19 @@ int handler::update_auto_increment() reservation means potentially losing unused values). Note that in prelocked mode no estimation is given. */ + if ((auto_inc_intervals_count == 0) && (estimation_rows_to_insert > 0)) nb_desired_values= estimation_rows_to_insert; + else if ((auto_inc_intervals_count == 0) && + (thd->lex->many_values.elements > 0)) + { + /* + For multi-row inserts, if the bulk inserts cannot be started, the + handler::estimation_rows_to_insert will not be set. But we still + want to reserve the autoinc values. + */ + nb_desired_values= thd->lex->many_values.elements; + } else /* go with the increasing defaults */ { /* avoid overflow in formula, with this if() */ @@ -3002,7 +3009,7 @@ void handler::print_error(int error, myf errflag) textno=ER_TABLE_DEF_CHANGED; break; case HA_ERR_NO_SUCH_TABLE: - my_error(ER_NO_SUCH_TABLE, errflag, table_share->db.str, + my_error(ER_NO_SUCH_TABLE_IN_ENGINE, errflag, table_share->db.str, table_share->table_name.str); DBUG_VOID_RETURN; case HA_ERR_RBR_LOGGING_FAILED: @@ -4793,10 +4800,14 @@ bool ha_show_status(THD *thd, handlerton *db_type, enum ha_stat_type stat) db_type->show_status(db_type, thd, stat_print, stat) ? 1 : 0; } - if (!result) + /* + We also check thd->is_error() as Innodb may return 0 even if + there was an error. + */ + if (!result && !thd->is_error()) my_eof(thd); else if (!thd->is_error()) - my_error(ER_GET_ERRNO, MYF(0), 0); + my_error(ER_GET_ERRNO, MYF(0), errno); return result; } @@ -5075,6 +5086,8 @@ int handler::ha_write_row(uchar *buf) rows_changed++; if (unlikely(error= binlog_log_row(table, 0, buf, log_func))) DBUG_RETURN(error); /* purecov: inspected */ + + DEBUG_SYNC_C("ha_write_row_end"); DBUG_RETURN(0); } diff --git a/sql/handler.h b/sql/handler.h index ee1731af563..9c0850e157a 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -1689,6 +1689,8 @@ public: virtual ~handler_add_index() {} }; +class Query_cache; +struct Query_cache_block_table; /** The handler class is the interface for dynamically loadable storage engines. Do not add ifdefs and take care when adding or @@ -2522,6 +2524,46 @@ public: return TRUE; } + /* + Count tables invisible from all tables list on which current one built + (like myisammrg and partitioned tables) + + tables_type mask for the tables should be added herdde + + returns number of such tables + */ + + virtual uint count_query_cache_dependant_tables(uint8 *tables_type + __attribute__((unused))) + { + return 0; + } + + /* + register tables invisible from all tables list on which current one built + (like myisammrg and partitioned tables). + + @note they should be counted by method above + + cache Query cache pointer + block Query cache block to write the table + n Number of the table + + @retval FALSE - OK + @retval TRUE - Error + */ + + virtual my_bool + register_query_cache_dependant_tables(THD *thd + __attribute__((unused)), + Query_cache *cache + __attribute__((unused)), + Query_cache_block_table **block + __attribute__((unused)), + uint *n __attribute__((unused))) + { + return FALSE; + } /* Check if the primary key (if there is one) is a clustered and a diff --git a/sql/item.cc b/sql/item.cc index 3031e90c9b2..ac54e1925b7 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -992,15 +992,31 @@ void Item::set_name(const char *str, uint length, CHARSET_INFO *cs) if (!my_charset_same(cs, system_charset_info)) { size_t res_length; - name= sql_strmake_with_convert(str, name_length= length, cs, + name= sql_strmake_with_convert(str, length, cs, MAX_ALIAS_NAME, system_charset_info, &res_length); + name_length= res_length; } else name= sql_strmake(str, (name_length= min(length,MAX_ALIAS_NAME))); } +void Item::set_name_no_truncate(const char *str, uint length, CHARSET_INFO *cs) +{ + if (!my_charset_same(cs, system_charset_info)) + { + size_t res_length; + name= sql_strmake_with_convert(str, length, cs, + UINT_MAX, system_charset_info, + &res_length); + name_length= res_length; + } + else + name= sql_strmake(str, (name_length= length)); +} + + void Item::set_name_for_rollback(THD *thd, const char *str, uint length, CHARSET_INFO *cs) { @@ -6823,7 +6839,7 @@ bool Item_ref::fix_fields(THD *thd, Item **reference) if (from_field != not_found_field) { Item_field* fld; - if (!(fld= new Item_field(from_field))) + if (!(fld= new Item_field(thd, last_checked_context, from_field))) goto error; thd->change_item_tree(reference, fld); mark_as_dependent(thd, last_checked_context->select_lex, diff --git a/sql/item.h b/sql/item.h index f7f3edda384..8855996b76c 100644 --- a/sql/item.h +++ b/sql/item.h @@ -656,6 +656,7 @@ public: #endif } /*lint -e1509 */ void set_name(const char *str, uint length, CHARSET_INFO *cs); + void set_name_no_truncate(const char *str, uint length, CHARSET_INFO *cs); void set_name_for_rollback(THD *thd, const char *str, uint length, CHARSET_INFO *cs); void rename(char *new_name); diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 2a0ca19a4e9..d950c0c1443 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -3089,6 +3089,15 @@ void Item_func_case::fix_length_and_dec() return; } } + /* + Set cmp_context of all WHEN arguments. This prevents + Item_field::equal_fields_propagator() from transforming a + zerofill argument into a string constant. Such a change would + require rebuilding cmp_items. + */ + for (i= 0; i < ncases; i+= 2) + args[i]->cmp_context= item_cmp_type(left_result_type, + args[i]->result_type()); } if (else_expr_num == -1 || args[else_expr_num]->maybe_null) @@ -4069,6 +4078,16 @@ void Item_func_in::fix_length_and_dec() } } } + /* + Set cmp_context of all arguments. This prevents + Item_field::equal_fields_propagator() from transforming a zerofill integer + argument into a string constant. Such a change would require rebuilding + cmp_itmes. + */ + for (arg= args + 1, arg_end= args + arg_count; arg != arg_end ; arg++) + { + arg[0]->cmp_context= item_cmp_type(left_result_type, arg[0]->result_type()); + } max_length= 1; } @@ -4866,8 +4885,8 @@ bool Item_func_like::fix_fields(THD *thd, Item **ref) } if (canDoTurboBM) { - pattern = first + 1; pattern_len = (int) len - 2; + pattern = thd->strmake(first + 1, pattern_len); DBUG_PRINT("info", ("Initializing pattern: '%s'", first)); int *suff = (int*) thd->alloc((int) (sizeof(int)* ((pattern_len + 1)*2+ diff --git a/sql/item_func.cc b/sql/item_func.cc index d65f13931e2..7a7cdd4ba02 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -5443,10 +5443,10 @@ my_decimal* Item_user_var_as_out_param::val_decimal(my_decimal *decimal_buffer) } -void Item_user_var_as_out_param::print(String *str, enum_query_type query_type) +void Item_user_var_as_out_param::print_for_load(THD *thd, String *str) { str->append('@'); - str->append(name.str,name.length); + append_identifier(thd, str, name.str, name.length); } diff --git a/sql/item_func.h b/sql/item_func.h index cb9c1929d7d..111479c8e52 100644 --- a/sql/item_func.h +++ b/sql/item_func.h @@ -1670,7 +1670,7 @@ public: my_decimal *val_decimal(my_decimal *decimal_buffer); /* fix_fields() binds variable name with its entry structure */ bool fix_fields(THD *thd, Item **ref); - virtual void print(String *str, enum_query_type query_type); + void print_for_load(THD *thd, String *str); void set_null_value(CHARSET_INFO* cs); void set_value(const char *str, uint length, CHARSET_INFO* cs); }; diff --git a/sql/item_geofunc.cc b/sql/item_geofunc.cc index fdd3cab8273..3648b10af3f 100644 --- a/sql/item_geofunc.cc +++ b/sql/item_geofunc.cc @@ -135,6 +135,7 @@ String *Item_func_as_wkt::val_str_ascii(String *str) return 0; str->length(0); + str->set_charset(&my_charset_latin1); if ((null_value= geom->as_wkt(str, &dummy))) return 0; @@ -182,7 +183,7 @@ String *Item_func_geometry_type::val_str_ascii(String *str) /* String will not move */ str->copy(geom->get_class_info()->m_name.str, geom->get_class_info()->m_name.length, - default_charset()); + &my_charset_latin1); return str; } diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index c7a3ca445d6..c10b75c154b 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -287,7 +287,7 @@ bool Item_subselect::fix_fields(THD *thd_param, Item **ref) else goto end; - if ((uncacheable= engine->uncacheable())) + if ((uncacheable= engine->uncacheable() & ~UNCACHEABLE_EXPLAIN)) { const_item_cache= 0; if (uncacheable & UNCACHEABLE_RAND) @@ -819,7 +819,9 @@ table_map Item_subselect::used_tables() const bool Item_subselect::const_item() const { - return thd->lex->context_analysis_only ? FALSE : const_item_cache; + return (thd->lex->context_analysis_only ? + FALSE : + forced_const || const_item_cache); } Item *Item_subselect::get_tmp_table_item(THD *thd_arg) @@ -1272,7 +1274,7 @@ bool Item_singlerow_subselect::get_date(MYSQL_TIME *ltime,ulonglong fuzzydate) else { reset(); - return 0; + return 1; } } @@ -1538,6 +1540,10 @@ double Item_in_subselect::val_real() */ DBUG_ASSERT(0); DBUG_ASSERT(fixed == 1); + if (forced_const) + return value; + DBUG_ASSERT((engine->uncacheable() & ~UNCACHEABLE_EXPLAIN) || + ! engine->is_executed()); null_value= was_null= FALSE; if (exec()) { @@ -1558,6 +1564,10 @@ longlong Item_in_subselect::val_int() */ DBUG_ASSERT(0); DBUG_ASSERT(fixed == 1); + if (forced_const) + return value; + DBUG_ASSERT((engine->uncacheable() & ~UNCACHEABLE_EXPLAIN) || + ! engine->is_executed()); null_value= was_null= FALSE; if (exec()) { @@ -1578,6 +1588,10 @@ String *Item_in_subselect::val_str(String *str) */ DBUG_ASSERT(0); DBUG_ASSERT(fixed == 1); + if (forced_const) + goto value_is_ready; + DBUG_ASSERT((engine->uncacheable() & ~UNCACHEABLE_EXPLAIN) || + ! engine->is_executed()); null_value= was_null= FALSE; if (exec()) { @@ -1589,6 +1603,7 @@ String *Item_in_subselect::val_str(String *str) null_value= TRUE; return 0; } +value_is_ready: str->set((ulonglong)value, &my_charset_bin); return str; } @@ -1599,6 +1614,8 @@ bool Item_in_subselect::val_bool() DBUG_ASSERT(fixed == 1); if (forced_const) return value; + DBUG_ASSERT((engine->uncacheable() & ~UNCACHEABLE_EXPLAIN) || + ! engine->is_executed()); null_value= was_null= FALSE; if (exec()) { @@ -1617,6 +1634,10 @@ my_decimal *Item_in_subselect::val_decimal(my_decimal *decimal_value) method should not be used */ DBUG_ASSERT(0); + if (forced_const) + goto value_is_ready; + DBUG_ASSERT((engine->uncacheable() & ~UNCACHEABLE_EXPLAIN) || + ! engine->is_executed()); null_value= was_null= FALSE; DBUG_ASSERT(fixed == 1); if (exec()) @@ -1626,6 +1647,7 @@ my_decimal *Item_in_subselect::val_decimal(my_decimal *decimal_value) } if (was_null && !value) null_value= TRUE; +value_is_ready: int2my_decimal(E_DEC_FATAL_ERROR, value, 0, decimal_value); return decimal_value; } @@ -3176,6 +3198,8 @@ int subselect_single_select_engine::exec() tab->read_record.read_record= tab->save_read_record; } executed= 1; + if (!(uncacheable() & ~UNCACHEABLE_EXPLAIN)) + item->make_const(); thd->where= save_where; thd->lex->current_select= save_select; DBUG_RETURN(join->error || thd->is_fatal_error || thd->is_error()); @@ -5168,10 +5192,20 @@ Ordered_key::cmp_keys_by_row_data(ha_rows a, ha_rows b) rowid_a= row_num_to_rowid + a * rowid_length; rowid_b= row_num_to_rowid + b * rowid_length; /* Fetch the rows for comparison. */ - error= tbl->file->ha_rnd_pos(tbl->record[0], rowid_a); - DBUG_ASSERT(!error); - error= tbl->file->ha_rnd_pos(tbl->record[1], rowid_b); - DBUG_ASSERT(!error); + if ((error= tbl->file->ha_rnd_pos(tbl->record[0], rowid_a))) + { + /* purecov: begin inspected */ + tbl->file->print_error(error, MYF(ME_FATALERROR)); // Sets fatal_error + return 0; + /* purecov: end */ + } + if ((error= tbl->file->ha_rnd_pos(tbl->record[1], rowid_b))) + { + /* purecov: begin inspected */ + tbl->file->print_error(error, MYF(ME_FATALERROR)); // Sets fatal_error + return 0; + /* purecov: end */ + } /* Compare the two rows by the corresponding values of the indexed columns. @@ -5247,8 +5281,13 @@ int Ordered_key::cmp_key_with_search_key(rownum_t row_num) int __attribute__((unused)) error; int cmp_res; - error= tbl->file->ha_rnd_pos(tbl->record[0], cur_rowid); - DBUG_ASSERT(!error); + if ((error= tbl->file->ha_rnd_pos(tbl->record[0], cur_rowid))) + { + /* purecov: begin inspected */ + tbl->file->print_error(error, MYF(ME_FATALERROR)); // Sets fatal_error + return 0; + /* purecov: end */ + } for (uint i= 0; i < key_column_count; i++) { diff --git a/sql/log.cc b/sql/log.cc index 801d945f3f0..56c07f81c9e 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -52,6 +52,7 @@ #include "sql_plugin.h" #include "rpl_handler.h" #include "debug_sync.h" +#include "sql_show.h" /* max size of the log message */ #define MAX_LOG_BUFFER_SIZE 1024 @@ -2073,9 +2074,8 @@ static int binlog_savepoint_set(handlerton *hton, THD *thd, void *sv) String log_query; if (log_query.append(STRING_WITH_LEN("SAVEPOINT ")) || - log_query.append("`") || - log_query.append(thd->lex->ident.str, thd->lex->ident.length) || - log_query.append("`")) + append_identifier(thd, &log_query, + thd->lex->ident.str, thd->lex->ident.length)) DBUG_RETURN(1); int errcode= query_error_code(thd, thd->killed == NOT_KILLED); Query_log_event qinfo(thd, log_query.ptr(), log_query.length(), @@ -2097,9 +2097,8 @@ static int binlog_savepoint_rollback(handlerton *hton, THD *thd, void *sv) { String log_query; if (log_query.append(STRING_WITH_LEN("ROLLBACK TO ")) || - log_query.append("`") || - log_query.append(thd->lex->ident.str, thd->lex->ident.length) || - log_query.append("`")) + append_identifier(thd, &log_query, + thd->lex->ident.str, thd->lex->ident.length)) DBUG_RETURN(1); int errcode= query_error_code(thd, thd->killed == NOT_KILLED); Query_log_event qinfo(thd, log_query.ptr(), log_query.length(), @@ -2836,7 +2835,10 @@ bool MYSQL_QUERY_LOG::write(THD *thd, time_t current_time, { end= strxmov(buff, "# administrator command: ", NullS); buff_len= (ulong) (end - buff); - my_b_write(&log_file, (uchar*) buff, buff_len); + DBUG_EXECUTE_IF("simulate_slow_log_write_error", + {DBUG_SET("+d,simulate_file_write_error");}); + if(my_b_write(&log_file, (uchar*) buff, buff_len)) + tmp_errno= errno; } if (my_b_write(&log_file, (uchar*) sql_text, sql_text_len) || my_b_write(&log_file, (uchar*) ";\n",2) || @@ -2890,7 +2892,7 @@ MYSQL_BIN_LOG::MYSQL_BIN_LOG(uint *sync_period) need_start_event(TRUE), group_commit_queue(0), group_commit_queue_busy(FALSE), num_commits(0), num_group_commits(0), - sync_period_ptr(sync_period), + sync_period_ptr(sync_period), sync_counter(0), is_relay_log(0), signal_cnt(0), checksum_alg_reset(BINLOG_CHECKSUM_ALG_UNDEF), relay_log_checksum_alg(BINLOG_CHECKSUM_ALG_UNDEF), diff --git a/sql/log.h b/sql/log.h index b350f3882fa..9b9bed1262a 100644 --- a/sql/log.h +++ b/sql/log.h @@ -1,5 +1,5 @@ -/* - Copyright (c) 2005, 2011, Oracle and/or its affiliates. +/* Copyright (c) 2005, 2012, Oracle and/or its affiliates. + Copyright (c) 2009, 2012, Monty Program Ab This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -477,8 +477,8 @@ class MYSQL_BIN_LOG: public TC_LOG, private MYSQL_LOG void mark_xids_active(uint xid_count); public: - MYSQL_LOG::generate_name; - MYSQL_LOG::is_open; + using MYSQL_LOG::generate_name; + using MYSQL_LOG::is_open; /* This is relay log */ bool is_relay_log; @@ -863,7 +863,7 @@ int query_error_code(THD *thd, bool not_killed); uint purge_log_get_error_code(int res); int vprint_msg_to_log(enum loglevel level, const char *format, va_list args); -void sql_print_error(const char *format, ...) ATTRIBUTE_FORMAT(printf, 1, 2); +void sql_print_error(const char *format, ...); void sql_print_warning(const char *format, ...) ATTRIBUTE_FORMAT(printf, 1, 2); void sql_print_information(const char *format, ...) ATTRIBUTE_FORMAT(printf, 1, 2); diff --git a/sql/log_event.cc b/sql/log_event.cc index 60e074deaca..dca9091e03d 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -46,6 +46,7 @@ #include "rpl_record.h" #include "transaction.h" #include <my_dir.h> +#include "sql_show.h" #endif /* MYSQL_CLIENT */ @@ -471,29 +472,28 @@ inline bool unexpected_error_code(int unexpected_error) pretty_print_str() */ -static char *pretty_print_str(char *packet, const char *str, int len) +static void +pretty_print_str(String *packet, const char *str, int len) { const char *end= str + len; - char *pos= packet; - *pos++= '\''; + packet->append(STRING_WITH_LEN("'")); while (str < end) { char c; switch ((c=*str++)) { - case '\n': *pos++= '\\'; *pos++= 'n'; break; - case '\r': *pos++= '\\'; *pos++= 'r'; break; - case '\\': *pos++= '\\'; *pos++= '\\'; break; - case '\b': *pos++= '\\'; *pos++= 'b'; break; - case '\t': *pos++= '\\'; *pos++= 't'; break; - case '\'': *pos++= '\\'; *pos++= '\''; break; - case 0 : *pos++= '\\'; *pos++= '0'; break; + case '\n': packet->append(STRING_WITH_LEN("\\n")); break; + case '\r': packet->append(STRING_WITH_LEN("\\r")); break; + case '\\': packet->append(STRING_WITH_LEN("\\\\")); break; + case '\b': packet->append(STRING_WITH_LEN("\\b")); break; + case '\t': packet->append(STRING_WITH_LEN("\\t")); break; + case '\'': packet->append(STRING_WITH_LEN("\\'")); break; + case 0 : packet->append(STRING_WITH_LEN("\\0")); break; default: - *pos++= c; + packet->append(&c, 1); break; } } - *pos++= '\''; - return pos; + packet->append(STRING_WITH_LEN("'")); } #endif /* !MYSQL_CLIENT */ @@ -926,7 +926,7 @@ Log_event::do_shall_skip(Relay_log_info *rli) Log_event::pack_info() */ -void Log_event::pack_info(Protocol *protocol) +void Log_event::pack_info(THD *thd, Protocol *protocol) { protocol->store("", &my_charset_bin); } @@ -935,7 +935,8 @@ void Log_event::pack_info(Protocol *protocol) /** Only called by SHOW BINLOG EVENTS */ -int Log_event::net_send(Protocol *protocol, const char* log_name, my_off_t pos) +int Log_event::net_send(THD *thd, Protocol *protocol, const char* log_name, + my_off_t pos) { const char *p= strrchr(log_name, FN_LIBCHAR); const char *event_type; @@ -949,7 +950,7 @@ int Log_event::net_send(Protocol *protocol, const char* log_name, my_off_t pos) protocol->store(event_type, strlen(event_type), &my_charset_bin); protocol->store((uint32) server_id); protocol->store((ulonglong) log_pos); - pack_info(protocol); + pack_info(thd, protocol); return protocol->write(); } #endif /* HAVE_REPLICATION */ @@ -1348,7 +1349,7 @@ failed my_b_read")); Log_event *res= 0; #ifndef max_allowed_packet THD *thd=current_thd; - uint max_allowed_packet= thd ? thd->variables.max_allowed_packet : ~(ulong)0; + uint max_allowed_packet= thd ? slave_max_allowed_packet:~(ulong)0; #endif if (data_len > max_allowed_packet) @@ -2448,27 +2449,22 @@ Log_event::continue_group(Relay_log_info *rli) show the catalog ?? */ -void Query_log_event::pack_info(Protocol *protocol) +void Query_log_event::pack_info(THD *thd, Protocol *protocol) { // TODO: show the catalog ?? - char *buf, *pos; - if (!(buf= (char*) my_malloc(9 + db_len + q_len, MYF(MY_WME)))) - return; - pos= buf; + char buf_mem[1024]; + String buf(buf_mem, sizeof(buf_mem), system_charset_info); + buf.real_alloc(9 + db_len + q_len); if (!(flags & LOG_EVENT_SUPPRESS_USE_F) && db && db_len) { - pos= strmov(buf, "use `"); - memcpy(pos, db, db_len); - pos= strmov(pos+db_len, "`; "); + buf.append(STRING_WITH_LEN("use ")); + append_identifier(thd, &buf, db, db_len); + buf.append("; "); } if (query && q_len) - { - memcpy(pos, query, q_len); - pos+= q_len; - } - protocol->store(buf, pos-buf, &my_charset_bin); - my_free(buf); + buf.append(query, q_len); + protocol->store(&buf); } #endif @@ -3218,24 +3214,41 @@ Query_log_event::Query_log_event(const char* buf, uint event_len, pos= (const uchar*) end; // Break loop } } - + + /** + Layout for the data buffer is as follows + +--------+-----------+------+------+---------+----+-------+ + | catlog | time_zone | user | host | db name | \0 | Query | + +--------+-----------+------+------+---------+----+-------+ + + To support the query cache we append the following buffer to the above + +-------+----------------------------------------+-------+ + |db len | uninitiatlized space of size of db len | FLAGS | + +-------+----------------------------------------+-------+ + + The area of buffer starting from Query field all the way to the end belongs + to the Query buffer and its structure is described in alloc_query() in + sql_parse.cc + */ + #if !defined(MYSQL_CLIENT) && defined(HAVE_QUERY_CACHE) - if (!(start= data_buf = (Log_event::Byte*) my_malloc(catalog_len + 1 + - time_zone_len + 1 + - data_len + 1 + - QUERY_CACHE_DB_LENGTH_SIZE + - QUERY_CACHE_FLAGS_SIZE + - user.length + 1 + - host.length + 1 + - db_len + 1, - MYF(MY_WME)))) + if (!(start= data_buf = (Log_event::Byte*) my_malloc(catalog_len + 1 + + time_zone_len + 1 + + user.length + 1 + + host.length + 1 + + data_len + 1 + + sizeof(size_t)//for db_len + + db_len + 1 + + QUERY_CACHE_DB_LENGTH_SIZE + + QUERY_CACHE_FLAGS_SIZE, + MYF(MY_WME)))) #else - if (!(start= data_buf = (Log_event::Byte*) my_malloc(catalog_len + 1 + - time_zone_len + 1 + - data_len + 1 + - user.length + 1 + - host.length + 1, - MYF(MY_WME)))) + if (!(start= data_buf = (Log_event::Byte*) my_malloc(catalog_len + 1 + + time_zone_len + 1 + + user.length + 1 + + host.length + 1 + + data_len + 1, + MYF(MY_WME)))) #endif DBUG_VOID_RETURN; if (catalog_len) // If catalog is given @@ -3275,6 +3288,14 @@ Query_log_event::Query_log_event(const char* buf, uint event_len, db= (char *)start; query= (char *)(start + db_len + 1); q_len= data_len - db_len -1; + /** + Append the db length at the end of the buffer. This will be used by + Query_cache::send_result_to_client() in case the query cache is On. + */ +#if !defined(MYSQL_CLIENT) && defined(HAVE_QUERY_CACHE) + size_t db_length= (size_t)db_len; + memcpy(start + data_len + 1, &db_length, sizeof(size_t)); +#endif DBUG_VOID_RETURN; } @@ -3309,11 +3330,17 @@ void Query_log_event::print_query_header(IO_CACHE* file, } else if (db) { + /* Room for expand ` to `` + initial/final ` + \0 */ + char buf[FN_REFLEN*2+3]; + different_db= memcmp(print_event_info->db, db, db_len + 1); if (different_db) memcpy(print_event_info->db, db, db_len + 1); if (db[0] && different_db) - my_b_printf(file, "use %s%s\n", db, print_event_info->delimiter); + { + my_snprintf(buf, sizeof(buf), "%`s", db); + my_b_printf(file, "use %s%s\n", buf, print_event_info->delimiter); + } } end=int10_to_str((long) when, strmov(buff,"SET TIMESTAMP="),10); @@ -3461,6 +3488,12 @@ void Query_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info) { Write_on_release_cache cache(&print_event_info->head_cache, file); + /** + reduce the size of io cache so that the write function is called + for every call to my_b_write(). + */ + DBUG_EXECUTE_IF ("simulate_file_write_error", + {(&cache)->write_pos= (&cache)->write_end- 500;}); print_query_header(&cache, print_event_info); my_b_write(&cache, (uchar*) query, q_len); my_b_printf(&cache, "\n%s\n", print_event_info->delimiter); @@ -3503,6 +3536,7 @@ int Query_log_event::do_apply_event(Relay_log_info const *rli, LEX_STRING new_db; int expected_error,actual_error= 0; HA_CREATE_INFO db_options; + DBUG_ENTER("Query_log_event::do_apply_event"); /* Colleagues: please never free(thd->catalog) in MySQL. This would @@ -3898,7 +3932,7 @@ end: thd->first_successful_insert_id_in_prev_stmt= 0; thd->stmt_depends_on_first_successful_insert_id_in_prev_stmt= 0; free_root(thd->mem_root,MYF(MY_KEEP_PREALLOC)); - return thd->is_slave_error; + DBUG_RETURN(thd->is_slave_error); } int Query_log_event::do_update_pos(Relay_log_info *rli) @@ -3971,7 +4005,7 @@ Start_log_event_v3::Start_log_event_v3() */ #if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT) -void Start_log_event_v3::pack_info(Protocol *protocol) +void Start_log_event_v3::pack_info(THD *thd, Protocol *protocol) { char buf[12 + ST_SERVER_VER_LEN + 14 + 22], *pos; pos= strmov(buf, "Server ver: "); @@ -4747,131 +4781,113 @@ uint8 get_checksum_alg(const char* buf, ulong len) */ #if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT) -uint Load_log_event::get_query_buffer_length() -{ - return - 5 + db_len + 3 + // "use DB; " - 18 + fname_len + 2 + // "LOAD DATA INFILE 'file''" - 11 + // "CONCURRENT " - 7 + // LOCAL - 9 + // " REPLACE or IGNORE " - 13 + table_name_len*2 + // "INTO TABLE `table`" - 21 + sql_ex.field_term_len*4 + 2 + // " FIELDS TERMINATED BY 'str'" - 23 + sql_ex.enclosed_len*4 + 2 + // " OPTIONALLY ENCLOSED BY 'str'" - 12 + sql_ex.escaped_len*4 + 2 + // " ESCAPED BY 'str'" - 21 + sql_ex.line_term_len*4 + 2 + // " LINES TERMINATED BY 'str'" - 19 + sql_ex.line_start_len*4 + 2 + // " LINES STARTING BY 'str'" - 15 + 22 + // " IGNORE xxx LINES" - 3 + (num_fields-1)*2 + field_block_len; // " (field1, field2, ...)" -} - - -void Load_log_event::print_query(bool need_db, const char *cs, char *buf, - char **end, char **fn_start, char **fn_end) +void Load_log_event::print_query(THD *thd, bool need_db, const char *cs, + String *buf, my_off_t *fn_start, + my_off_t *fn_end, const char *qualify_db) { - char *pos= buf; - if (need_db && db && db_len) { - pos= strmov(pos, "use `"); - memcpy(pos, db, db_len); - pos= strmov(pos+db_len, "`; "); + buf->append(STRING_WITH_LEN("use ")); + append_identifier(thd, buf, db, db_len); + buf->append(STRING_WITH_LEN("; ")); } - pos= strmov(pos, "LOAD DATA "); + buf->append(STRING_WITH_LEN("LOAD DATA ")); if (is_concurrent) - pos= strmov(pos, "CONCURRENT "); + buf->append(STRING_WITH_LEN("CONCURRENT ")); if (fn_start) - *fn_start= pos; + *fn_start= buf->length(); if (check_fname_outside_temp_buf()) - pos= strmov(pos, "LOCAL "); - pos= strmov(pos, "INFILE '"); - memcpy(pos, fname, fname_len); - pos= strmov(pos+fname_len, "' "); + buf->append(STRING_WITH_LEN("LOCAL ")); + buf->append(STRING_WITH_LEN("INFILE '")); + buf->append_for_single_quote(fname, fname_len); + buf->append(STRING_WITH_LEN("' ")); if (sql_ex.opt_flags & REPLACE_FLAG) - pos= strmov(pos, "REPLACE "); + buf->append(STRING_WITH_LEN("REPLACE ")); else if (sql_ex.opt_flags & IGNORE_FLAG) - pos= strmov(pos, "IGNORE "); + buf->append(STRING_WITH_LEN("IGNORE ")); - pos= strmov(pos ,"INTO"); + buf->append(STRING_WITH_LEN("INTO")); if (fn_end) - *fn_end= pos; + *fn_end= buf->length(); - pos= strmov(pos ," TABLE `"); - memcpy(pos, table_name, table_name_len); - pos+= table_name_len; + buf->append(STRING_WITH_LEN(" TABLE ")); + if (qualify_db) + { + append_identifier(thd, buf, qualify_db, strlen(qualify_db)); + buf->append(STRING_WITH_LEN(".")); + } + append_identifier(thd, buf, table_name, table_name_len); if (cs != NULL) { - pos= strmov(pos ,"` CHARACTER SET "); - pos= strmov(pos , cs); + buf->append(STRING_WITH_LEN(" CHARACTER SET ")); + buf->append(cs, strlen(cs)); } - else - pos= strmov(pos, "`"); /* We have to create all optional fields as the default is not empty */ - pos= strmov(pos, " FIELDS TERMINATED BY "); - pos= pretty_print_str(pos, sql_ex.field_term, sql_ex.field_term_len); + buf->append(STRING_WITH_LEN(" FIELDS TERMINATED BY ")); + pretty_print_str(buf, sql_ex.field_term, sql_ex.field_term_len); if (sql_ex.opt_flags & OPT_ENCLOSED_FLAG) - pos= strmov(pos, " OPTIONALLY "); - pos= strmov(pos, " ENCLOSED BY "); - pos= pretty_print_str(pos, sql_ex.enclosed, sql_ex.enclosed_len); + buf->append(STRING_WITH_LEN(" OPTIONALLY ")); + buf->append(STRING_WITH_LEN(" ENCLOSED BY ")); + pretty_print_str(buf, sql_ex.enclosed, sql_ex.enclosed_len); - pos= strmov(pos, " ESCAPED BY "); - pos= pretty_print_str(pos, sql_ex.escaped, sql_ex.escaped_len); + buf->append(STRING_WITH_LEN(" ESCAPED BY ")); + pretty_print_str(buf, sql_ex.escaped, sql_ex.escaped_len); - pos= strmov(pos, " LINES TERMINATED BY "); - pos= pretty_print_str(pos, sql_ex.line_term, sql_ex.line_term_len); + buf->append(STRING_WITH_LEN(" LINES TERMINATED BY ")); + pretty_print_str(buf, sql_ex.line_term, sql_ex.line_term_len); if (sql_ex.line_start_len) { - pos= strmov(pos, " STARTING BY "); - pos= pretty_print_str(pos, sql_ex.line_start, sql_ex.line_start_len); + buf->append(STRING_WITH_LEN(" STARTING BY ")); + pretty_print_str(buf, sql_ex.line_start, sql_ex.line_start_len); } if ((long) skip_lines > 0) { - pos= strmov(pos, " IGNORE "); - pos= longlong10_to_str((longlong) skip_lines, pos, 10); - pos= strmov(pos," LINES "); + buf->append(STRING_WITH_LEN(" IGNORE ")); + buf->append_ulonglong(skip_lines); + buf->append(STRING_WITH_LEN(" LINES ")); } if (num_fields) { uint i; const char *field= fields; - pos= strmov(pos, " ("); + buf->append(STRING_WITH_LEN(" (")); for (i = 0; i < num_fields; i++) { if (i) { - *pos++= ' '; - *pos++= ','; + /* + Yes, the space and comma is reversed here. But this is mostly dead + code, at most used when reading really old binlogs from old servers, + so better just leave it as is... + */ + buf->append(STRING_WITH_LEN(" ,")); } - memcpy(pos, field, field_lens[i]); - pos+= field_lens[i]; + append_identifier(thd, buf, field, field_lens[i]); field+= field_lens[i] + 1; } - *pos++= ')'; + buf->append(STRING_WITH_LEN(")")); } - - *end= pos; } -void Load_log_event::pack_info(Protocol *protocol) +void Load_log_event::pack_info(THD *thd, Protocol *protocol) { - char *buf, *end; + char query_buffer[1024]; + String query_str(query_buffer, sizeof(query_buffer), system_charset_info); - if (!(buf= (char*) my_malloc(get_query_buffer_length(), MYF(MY_WME)))) - return; - print_query(TRUE, NULL, buf, &end, 0, 0); - protocol->store(buf, end-buf, &my_charset_bin); - my_free(buf); + query_str.length(0); + print_query(thd, TRUE, NULL, &query_str, 0, 0, NULL); + protocol->store(query_str.ptr(), query_str.length(), &my_charset_bin); } #endif /* defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT) */ @@ -5253,6 +5269,8 @@ int Load_log_event::do_apply_event(NET* net, Relay_log_info const *rli, bool use_rli_only_for_errors) { LEX_STRING new_db; + DBUG_ENTER("Load_log_event::do_apply_event"); + new_db.length= db_len; new_db.str= (char *) rpl_filter->get_rewrite_db(db, &new_db.length); thd->set_db(new_db.str, new_db.length); @@ -5327,16 +5345,20 @@ int Load_log_event::do_apply_event(NET* net, Relay_log_info const *rli, else { char llbuff[22]; - char *end; enum enum_duplicates handle_dup; bool ignore= 0; + char query_buffer[1024]; + String query_str(query_buffer, sizeof(query_buffer), system_charset_info); char *load_data_query; + query_str.length(0); /* Forge LOAD DATA INFILE query which will be used in SHOW PROCESS LIST and written to slave's binlog if binlogging is on. */ - if (!(load_data_query= (char *)thd->alloc(get_query_buffer_length() + 1))) + print_query(thd, FALSE, NULL, &query_str, NULL, NULL, NULL); + if (!(load_data_query= (char *)thd->strmake(query_str.ptr(), + query_str.length()))) { /* This will set thd->fatal_error in case of OOM. So we surely will notice @@ -5345,9 +5367,7 @@ int Load_log_event::do_apply_event(NET* net, Relay_log_info const *rli, goto error; } - print_query(FALSE, NULL, load_data_query, &end, NULL, NULL); - *end= 0; - thd->set_query(load_data_query, (uint) (end - load_data_query)); + thd->set_query(load_data_query, (uint) (query_str.length())); if (sql_ex.opt_flags & REPLACE_FLAG) handle_dup= DUP_REPLACE; @@ -5493,7 +5513,7 @@ error: Error '%s' running LOAD DATA INFILE on table '%s'. Default database: '%s'", err, (char*)table_name, print_slave_db_safe(remember_db)); free_root(thd->mem_root,MYF(MY_KEEP_PREALLOC)); - return 1; + DBUG_RETURN(1); } free_root(thd->mem_root,MYF(MY_KEEP_PREALLOC)); @@ -5508,10 +5528,10 @@ Error '%s' running LOAD DATA INFILE on table '%s'. Default database: '%s'", rli->report(ERROR_LEVEL, ER_SLAVE_FATAL_ERROR, ER(ER_SLAVE_FATAL_ERROR), buf); - return 1; + DBUG_RETURN(1); } - return ( use_rli_only_for_errors ? 0 : Log_event::do_apply_event(rli) ); + DBUG_RETURN( use_rli_only_for_errors ? 0 : Log_event::do_apply_event(rli) ); } #endif @@ -5525,7 +5545,7 @@ Error '%s' running LOAD DATA INFILE on table '%s'. Default database: '%s'", */ #if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT) -void Rotate_log_event::pack_info(Protocol *protocol) +void Rotate_log_event::pack_info(THD *thd, Protocol *protocol) { char buf1[256], buf[22]; String tmp(buf1, sizeof(buf1), log_cs); @@ -5743,7 +5763,7 @@ Rotate_log_event::do_shall_skip(Relay_log_info *rli) */ #if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT) -void Intvar_log_event::pack_info(Protocol *protocol) +void Intvar_log_event::pack_info(THD *thd, Protocol *protocol) { char buf[256], *pos; pos= strmake(buf, get_var_type_name(), sizeof(buf)-23); @@ -5897,7 +5917,7 @@ Intvar_log_event::do_shall_skip(Relay_log_info *rli) **************************************************************************/ #if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT) -void Rand_log_event::pack_info(Protocol *protocol) +void Rand_log_event::pack_info(THD *thd, Protocol *protocol) { char buf1[256], *pos; pos= strmov(buf1,"rand_seed1="); @@ -6022,7 +6042,7 @@ bool slave_execute_deferred_events(THD *thd) **************************************************************************/ #if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT) -void Xid_log_event::pack_info(Protocol *protocol) +void Xid_log_event::pack_info(THD *thd, Protocol *protocol) { char buf[128], *pos; pos= strmov(buf, "COMMIT /* xid="); @@ -6119,84 +6139,117 @@ Xid_log_event::do_shall_skip(Relay_log_info *rli) **************************************************************************/ #if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT) -void User_var_log_event::pack_info(Protocol* protocol) +static bool +user_var_append_name_part(THD *thd, String *buf, + const char *name, size_t name_len) { - char *buf= 0; - uint val_offset= 4 + name_len; - uint event_len= val_offset; + return buf->append("@") || + append_identifier(thd, buf, name, name_len) || + buf->append("="); +} +void User_var_log_event::pack_info(THD *thd, Protocol* protocol) +{ if (is_null) { - if (!(buf= (char*) my_malloc(val_offset + 5, MYF(MY_WME)))) + char buf_mem[FN_REFLEN+7]; + String buf(buf_mem, sizeof(buf_mem), system_charset_info); + buf.length(0); + if (user_var_append_name_part(thd, &buf, name, name_len) || + buf.append("NULL")) return; - strmov(buf + val_offset, "NULL"); - event_len= val_offset + 4; + protocol->store(buf.ptr(), buf.length(), &my_charset_bin); } else { switch (type) { case REAL_RESULT: + { double real_val; + char buf2[MY_GCVT_MAX_FIELD_WIDTH+1]; + char buf_mem[FN_REFLEN + MY_GCVT_MAX_FIELD_WIDTH + 1]; + String buf(buf_mem, sizeof(buf_mem), system_charset_info); float8get(real_val, val); - if (!(buf= (char*) my_malloc(val_offset + MY_GCVT_MAX_FIELD_WIDTH + 1, - MYF(MY_WME)))) + buf.length(0); + if (user_var_append_name_part(thd, &buf, name, name_len) || + buf.append(buf2, my_gcvt(real_val, MY_GCVT_ARG_DOUBLE, + MY_GCVT_MAX_FIELD_WIDTH, buf2, NULL))) return; - event_len+= my_gcvt(real_val, MY_GCVT_ARG_DOUBLE, MY_GCVT_MAX_FIELD_WIDTH, - buf + val_offset, NULL); + protocol->store(buf.ptr(), buf.length(), &my_charset_bin); break; + } case INT_RESULT: - if (!(buf= (char*) my_malloc(val_offset + 22, MYF(MY_WME)))) + { + char buf2[22]; + char buf_mem[FN_REFLEN + 22]; + String buf(buf_mem, sizeof(buf_mem), system_charset_info); + buf.length(0); + if (user_var_append_name_part(thd, &buf, name, name_len) || + buf.append(buf2, + longlong10_to_str(uint8korr(val), buf2, + ((flags & User_var_log_event::UNSIGNED_F) ? 10 : -10))-buf2)) return; - event_len= longlong10_to_str(uint8korr(val), buf + val_offset, - ((flags & User_var_log_event::UNSIGNED_F) ? - 10 : -10))-buf; + protocol->store(buf.ptr(), buf.length(), &my_charset_bin); break; + } case DECIMAL_RESULT: { - if (!(buf= (char*) my_malloc(val_offset + DECIMAL_MAX_STR_LENGTH, - MYF(MY_WME)))) - return; - String str(buf+val_offset, DECIMAL_MAX_STR_LENGTH, &my_charset_bin); + char buf_mem[FN_REFLEN + DECIMAL_MAX_STR_LENGTH]; + String buf(buf_mem, sizeof(buf_mem), system_charset_info); + char buf2[DECIMAL_MAX_STR_LENGTH+1]; + String str(buf2, sizeof(buf2), &my_charset_bin); my_decimal dec; + buf.length(0); binary2my_decimal(E_DEC_FATAL_ERROR, (uchar*) (val+2), &dec, val[0], val[1]); my_decimal2string(E_DEC_FATAL_ERROR, &dec, 0, 0, 0, &str); - event_len= str.length() + val_offset; + if (user_var_append_name_part(thd, &buf, name, name_len) || + buf.append(buf2)) + return; + protocol->store(buf.ptr(), buf.length(), &my_charset_bin); break; - } + } case STRING_RESULT: + { /* 15 is for 'COLLATE' and other chars */ - buf= (char*) my_malloc(event_len+val_len*2+1+2*MY_CS_NAME_SIZE+15, - MYF(MY_WME)); + char buf_mem[FN_REFLEN + 512 + 1 + 2*MY_CS_NAME_SIZE+15]; + String buf(buf_mem, sizeof(buf_mem), system_charset_info); CHARSET_INFO *cs; - if (!buf) - return; + buf.length(0); if (!(cs= get_charset(charset_number, MYF(0)))) { - strmov(buf+val_offset, "???"); - event_len+= 3; + if (buf.append("???")) + return; } else { - char *p= strxmov(buf + val_offset, "_", cs->csname, " ", NullS); - p= str_to_hex(p, val, val_len); - p= strxmov(p, " COLLATE ", cs->name, NullS); - event_len= p-buf; + size_t old_len; + char *beg, *end; + if (user_var_append_name_part(thd, &buf, name, name_len) || + buf.append("_") || + buf.append(cs->csname) || + buf.append(" ")) + return; + old_len= buf.length(); + if (buf.reserve(old_len + val_len*2 + 2 + sizeof(" COLLATE ") + + MY_CS_NAME_SIZE)) + return; + beg= const_cast<char *>(buf.ptr()) + old_len; + end= str_to_hex(beg, val, val_len); + buf.length(old_len + (end - beg)); + if (buf.append(" COLLATE ") || + buf.append(cs->name)) + return; } + protocol->store(buf.ptr(), buf.length(), &my_charset_bin); break; + } case ROW_RESULT: default: DBUG_ASSERT(0); return; } } - buf[0]= '@'; - buf[1]= '`'; - memcpy(buf+2, name, name_len); - buf[2+name_len]= '`'; - buf[3+name_len]= '='; - protocol->store(buf, event_len, &my_charset_bin); - my_free(buf); } #endif /* !MYSQL_CLIENT */ @@ -6205,6 +6258,9 @@ User_var_log_event:: User_var_log_event(const char* buf, const Format_description_log_event* description_event) :Log_event(buf, description_event) +#ifndef MYSQL_CLIENT + , deferred(false) +#endif { /* The Post-Header is empty. The Variable Data part begins immediately. */ const char *start= buf; @@ -6351,9 +6407,8 @@ void User_var_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info) my_b_printf(&cache, "\tUser_var\n"); } - my_b_printf(&cache, "SET @`"); - my_b_write(&cache, (uchar*) name, (uint) (name_len)); - my_b_printf(&cache, "`"); + my_b_printf(&cache, "SET @"); + my_b_write_backtick_quote(&cache, name, name_len); if (is_null) { @@ -6452,12 +6507,16 @@ int User_var_log_event::do_apply_event(Relay_log_info const *rli) { Item *it= 0; CHARSET_INFO *charset; + DBUG_ENTER("User_var_log_event::do_apply_event"); if (rli->deferred_events_collecting) - return rli->deferred_events->add(this); + { + set_deferred(); + DBUG_RETURN(rli->deferred_events->add(this)); + } if (!(charset= get_charset(charset_number, MYF(MY_WME)))) - return 1; + DBUG_RETURN(1); LEX_STRING user_var_name; user_var_name.str= name; user_var_name.length= name_len; @@ -6503,10 +6562,11 @@ int User_var_log_event::do_apply_event(Relay_log_info const *rli) case ROW_RESULT: default: DBUG_ASSERT(0); - return 0; + DBUG_RETURN(0); } } - Item_func_set_user_var e(user_var_name, it); + + Item_func_set_user_var *e= new Item_func_set_user_var(user_var_name, it); /* Item_func_set_user_var can't substitute something else on its place => 0 can be passed as last argument (reference on item) @@ -6515,19 +6575,20 @@ int User_var_log_event::do_apply_event(Relay_log_info const *rli) crash the server, so if fix fields fails, we just return with an error. */ - if (e.fix_fields(thd, 0)) - return 1; + if (e->fix_fields(thd, 0)) + DBUG_RETURN(1); /* A variable can just be considered as a table with a single record and with a single column. Thus, like a column value, it could always have IMPLICIT derivation. */ - e.update_hash(val, val_len, type, charset, DERIVATION_IMPLICIT, - (flags & User_var_log_event::UNSIGNED_F)); - free_root(thd->mem_root,0); + e->update_hash(val, val_len, type, charset, DERIVATION_IMPLICIT, + (flags & User_var_log_event::UNSIGNED_F)); + if (!is_deferred()) + free_root(thd->mem_root, 0); - return 0; + DBUG_RETURN(0); } int User_var_log_event::do_update_pos(Relay_log_info *rli) @@ -6570,7 +6631,7 @@ void Unknown_log_event::print(FILE* file_arg, PRINT_EVENT_INFO* print_event_info #endif #ifndef MYSQL_CLIENT -void Slave_log_event::pack_info(Protocol *protocol) +void Slave_log_event::pack_info(THD *thd, Protocol *protocol) { char buf[256+HOSTNAME_LENGTH], *pos; pos= strmov(buf, "host="); @@ -6922,11 +6983,18 @@ void Create_file_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info { Load_log_event::print(file, print_event_info, !check_fname_outside_temp_buf()); - /* - That one is for "file_id: etc" below: in mysqlbinlog we want the #, in - SHOW BINLOG EVENTS we don't. - */ - my_b_printf(&cache, "#"); + /** + reduce the size of io cache so that the write function is called + for every call to my_b_printf(). + */ + DBUG_EXECUTE_IF ("simulate_create_event_write_error", + {(&cache)->write_pos= (&cache)->write_end; + DBUG_SET("+d,simulate_file_write_error");}); + /* + That one is for "file_id: etc" below: in mysqlbinlog we want the #, in + SHOW BINLOG EVENTS we don't. + */ + my_b_printf(&cache, "#"); } my_b_printf(&cache, " file_id: %d block_len: %d\n", file_id, block_len); @@ -6945,7 +7013,7 @@ void Create_file_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info */ #if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT) -void Create_file_log_event::pack_info(Protocol *protocol) +void Create_file_log_event::pack_info(THD *thd, Protocol *protocol) { char buf[SAFE_NAME_LEN*2 + 30 + 21*2], *pos; pos= strmov(buf, "db="); @@ -7131,7 +7199,7 @@ void Append_block_log_event::print(FILE* file, */ #if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT) -void Append_block_log_event::pack_info(Protocol *protocol) +void Append_block_log_event::pack_info(THD *thd, Protocol *protocol) { char buf[256]; uint length; @@ -7288,7 +7356,7 @@ void Delete_file_log_event::print(FILE* file, */ #if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT) -void Delete_file_log_event::pack_info(Protocol *protocol) +void Delete_file_log_event::pack_info(THD *thd, Protocol *protocol) { char buf[64]; uint length; @@ -7387,7 +7455,7 @@ void Execute_load_log_event::print(FILE* file, */ #if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT) -void Execute_load_log_event::pack_info(Protocol *protocol) +void Execute_load_log_event::pack_info(THD *thd, Protocol *protocol) { char buf[64]; uint length; @@ -7616,6 +7684,13 @@ void Execute_load_query_log_event::print(FILE* file, Write_on_release_cache cache(&print_event_info->head_cache, file); print_query_header(&cache, print_event_info); + /** + reduce the size of io cache so that the write function is called + for every call to my_b_printf(). + */ + DBUG_EXECUTE_IF ("simulate_execute_event_write_error", + {(&cache)->write_pos= (&cache)->write_end; + DBUG_SET("+d,simulate_file_write_error");}); if (local_fname) { @@ -7642,27 +7717,24 @@ void Execute_load_query_log_event::print(FILE* file, #if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT) -void Execute_load_query_log_event::pack_info(Protocol *protocol) +void Execute_load_query_log_event::pack_info(THD *thd, Protocol *protocol) { - char *buf, *pos; - if (!(buf= (char*) my_malloc(9 + db_len + q_len + 10 + 21, MYF(MY_WME)))) - return; - pos= buf; + char buf_mem[1024]; + String buf(buf_mem, sizeof(buf_mem), system_charset_info); + buf.real_alloc(9 + db_len + q_len + 10 + 21); if (db && db_len) { - pos= strmov(buf, "use `"); - memcpy(pos, db, db_len); - pos= strmov(pos+db_len, "`; "); - } - if (query && q_len) - { - memcpy(pos, query, q_len); - pos+= q_len; + if (buf.append("use ") || + append_identifier(thd, &buf, db, db_len) || + buf.append("; ")) + return; } - pos= strmov(pos, " ;file_id="); - pos= int10_to_str((long) file_id, pos, 10); - protocol->store(buf, pos-buf, &my_charset_bin); - my_free(buf); + if (query && q_len && buf.append(query, q_len)) + return; + if (buf.append(" ;file_id=") || + buf.append_ulonglong(file_id)) + return; + protocol->store(buf.ptr(), buf.length(), &my_charset_bin); } @@ -8625,7 +8697,7 @@ bool Rows_log_event::write_data_body(IO_CACHE*file) #endif #if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT) -void Rows_log_event::pack_info(Protocol *protocol) +void Rows_log_event::pack_info(THD *thd, Protocol *protocol) { char buf[256]; char const *const flagstr= @@ -8729,7 +8801,7 @@ bool Annotate_rows_log_event::write_data_body(IO_CACHE *file) #endif #if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) -void Annotate_rows_log_event::pack_info(Protocol* protocol) +void Annotate_rows_log_event::pack_info(THD *thd, Protocol* protocol) { if (m_query_txt && m_query_len) protocol->store(m_query_txt, m_query_len, &my_charset_bin); @@ -9473,7 +9545,7 @@ bool Table_map_log_event::write_data_body(IO_CACHE *file) */ #if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT) -void Table_map_log_event::pack_info(Protocol *protocol) +void Table_map_log_event::pack_info(THD *thd, Protocol *protocol) { char buf[256]; size_t bytes= my_snprintf(buf, sizeof(buf), @@ -9494,7 +9566,7 @@ void Table_map_log_event::print(FILE *, PRINT_EVENT_INFO *print_event_info) { print_header(&print_event_info->head_cache, print_event_info, TRUE); my_b_printf(&print_event_info->head_cache, - "\tTable_map: `%s`.`%s` mapped to number %lu\n", + "\tTable_map: %`s.%`s mapped to number %lu\n", m_dbnam, m_tblnam, m_table_id); print_base64(&print_event_info->body_cache, print_event_info, TRUE); } @@ -10827,7 +10899,7 @@ Incident_log_event::description() const #ifndef MYSQL_CLIENT -void Incident_log_event::pack_info(Protocol *protocol) +void Incident_log_event::pack_info(THD *thd, Protocol *protocol) { char buf[256]; size_t bytes; diff --git a/sql/log_event.h b/sql/log_event.h index cccab93e0d5..bf45dd0cc93 100644 --- a/sql/log_event.h +++ b/sql/log_event.h @@ -284,6 +284,13 @@ struct sql_ex_info MAX_SIZE_LOG_EVENT_STATUS + /* status */ \ NAME_LEN + 1) +/* + The new option is added to handle large packets that are sent from the master + to the slave. It is used to increase the thd(max_allowed) for both the + DUMP thread on the master and the SQL/IO thread on the slave. +*/ +#define MAX_MAX_ALLOWED_PACKET 1024*1024*1024 + /* Event header offsets; these point to places inside the fixed header. @@ -1058,14 +1065,15 @@ public: */ static void init_show_field_list(List<Item>* field_list); #ifdef HAVE_REPLICATION - int net_send(Protocol *protocol, const char* log_name, my_off_t pos); + int net_send(THD *thd, Protocol *protocol, const char* log_name, + my_off_t pos); /* pack_info() is used by SHOW BINLOG EVENTS; as print() it prepares and sends a string to display to the user, so it resembles print(). */ - virtual void pack_info(Protocol *protocol); + virtual void pack_info(THD *thd, Protocol *protocol); #endif /* HAVE_REPLICATION */ virtual const char* get_db() @@ -1802,7 +1810,7 @@ public: bool using_trans, bool direct, bool suppress_use, int error); const char* get_db() { return db; } #ifdef HAVE_REPLICATION - void pack_info(Protocol* protocol); + void pack_info(THD *thd, Protocol* protocol); #endif /* HAVE_REPLICATION */ #else void print_query_header(IO_CACHE* file, PRINT_EVENT_INFO* print_event_info); @@ -1932,7 +1940,7 @@ public: #ifdef MYSQL_SERVER Slave_log_event(THD* thd_arg, Relay_log_info* rli); - void pack_info(Protocol* protocol); + void pack_info(THD *thd, Protocol* protocol); #else void print(FILE* file, PRINT_EVENT_INFO* print_event_info); #endif @@ -2165,9 +2173,9 @@ protected: const Format_description_log_event* description_event); public: - uint get_query_buffer_length(); - void print_query(bool need_db, const char *cs, char *buf, char **end, - char **fn_start, char **fn_end); + void print_query(THD *thd, bool need_db, const char *cs, String *buf, + my_off_t *fn_start, my_off_t *fn_end, + const char *qualify_db); ulong thread_id; ulong slave_proxy_id; uint32 table_name_len; @@ -2228,7 +2236,7 @@ public: Name_resolution_context *context); const char* get_db() { return db; } #ifdef HAVE_REPLICATION - void pack_info(Protocol* protocol); + void pack_info(THD *thd, Protocol* protocol); #endif /* HAVE_REPLICATION */ #else void print(FILE* file, PRINT_EVENT_INFO* print_event_info); @@ -2325,7 +2333,7 @@ public: #ifdef MYSQL_SERVER Start_log_event_v3(); #ifdef HAVE_REPLICATION - void pack_info(Protocol* protocol); + void pack_info(THD *thd, Protocol* protocol); #endif /* HAVE_REPLICATION */ #else Start_log_event_v3() {} @@ -2489,7 +2497,7 @@ Intvar_log_event(THD* thd_arg,uchar type_arg, ulonglong val_arg, cache_type= Log_event::EVENT_NO_CACHE; } #ifdef HAVE_REPLICATION - void pack_info(Protocol* protocol); + void pack_info(THD *thd, Protocol* protocol); #endif /* HAVE_REPLICATION */ #else void print(FILE* file, PRINT_EVENT_INFO* print_event_info); @@ -2569,7 +2577,7 @@ class Rand_log_event: public Log_event cache_type= Log_event::EVENT_NO_CACHE; } #ifdef HAVE_REPLICATION - void pack_info(Protocol* protocol); + void pack_info(THD *thd, Protocol* protocol); #endif /* HAVE_REPLICATION */ #else void print(FILE* file, PRINT_EVENT_INFO* print_event_info); @@ -2618,7 +2626,7 @@ class Xid_log_event: public Log_event cache_type= Log_event::EVENT_NO_CACHE; } #ifdef HAVE_REPLICATION - void pack_info(Protocol* protocol); + void pack_info(THD *thd, Protocol* protocol); #endif /* HAVE_REPLICATION */ #else void print(FILE* file, PRINT_EVENT_INFO* print_event_info); @@ -2666,6 +2674,7 @@ public: bool is_null; uchar flags; #ifdef MYSQL_SERVER + bool deferred; User_var_log_event(THD* thd_arg, char *name_arg, uint name_len_arg, char *val_arg, ulong val_len_arg, Item_result type_arg, uint charset_number_arg, uchar flags_arg, @@ -2673,13 +2682,13 @@ public: :Log_event(thd_arg, 0, using_trans), name(name_arg), name_len(name_len_arg), val(val_arg), val_len(val_len_arg), type(type_arg), charset_number(charset_number_arg), - flags(flags_arg) + flags(flags_arg), deferred(false) { is_null= !val; if (direct) cache_type= Log_event::EVENT_NO_CACHE; } - void pack_info(Protocol* protocol); + void pack_info(THD *thd, Protocol* protocol); #else void print(FILE* file, PRINT_EVENT_INFO* print_event_info); #endif @@ -2690,6 +2699,13 @@ public: Log_event_type get_type_code() { return USER_VAR_EVENT;} #ifdef MYSQL_SERVER bool write(IO_CACHE* file); + /* + Getter and setter for deferred User-event. + Returns true if the event is not applied directly + and which case the applier adjusts execution path. + */ + bool is_deferred() { return deferred; } + void set_deferred() { deferred= val; } #endif bool is_valid() const { return 1; } @@ -2810,7 +2826,7 @@ public: uint ident_len_arg, ulonglong pos_arg, uint flags); #ifdef HAVE_REPLICATION - void pack_info(Protocol* protocol); + void pack_info(THD *thd, Protocol* protocol); #endif /* HAVE_REPLICATION */ #else void print(FILE* file, PRINT_EVENT_INFO* print_event_info); @@ -2871,7 +2887,7 @@ public: uchar* block_arg, uint block_len_arg, bool using_trans); #ifdef HAVE_REPLICATION - void pack_info(Protocol* protocol); + void pack_info(THD *thd, Protocol* protocol); #endif /* HAVE_REPLICATION */ #else void print(FILE* file, PRINT_EVENT_INFO* print_event_info); @@ -2943,7 +2959,7 @@ public: Append_block_log_event(THD* thd, const char* db_arg, uchar* block_arg, uint block_len_arg, bool using_trans); #ifdef HAVE_REPLICATION - void pack_info(Protocol* protocol); + void pack_info(THD *thd, Protocol* protocol); virtual int get_create_or_append() const; #endif /* HAVE_REPLICATION */ #else @@ -2984,7 +3000,7 @@ public: #ifdef MYSQL_SERVER Delete_file_log_event(THD* thd, const char* db_arg, bool using_trans); #ifdef HAVE_REPLICATION - void pack_info(Protocol* protocol); + void pack_info(THD *thd, Protocol* protocol); #endif /* HAVE_REPLICATION */ #else void print(FILE* file, PRINT_EVENT_INFO* print_event_info); @@ -3025,7 +3041,7 @@ public: #ifdef MYSQL_SERVER Execute_load_log_event(THD* thd, const char* db_arg, bool using_trans); #ifdef HAVE_REPLICATION - void pack_info(Protocol* protocol); + void pack_info(THD *thd, Protocol* protocol); #endif /* HAVE_REPLICATION */ #else void print(FILE* file, PRINT_EVENT_INFO* print_event_info); @@ -3121,7 +3137,7 @@ public: bool using_trans, bool direct, bool suppress_use, int errcode); #ifdef HAVE_REPLICATION - void pack_info(Protocol* protocol); + void pack_info(THD *thd, Protocol* protocol); #endif /* HAVE_REPLICATION */ #else void print(FILE* file, PRINT_EVENT_INFO* print_event_info); @@ -3207,7 +3223,7 @@ public: #endif #if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) - virtual void pack_info(Protocol*); + virtual void pack_info(THD *thd, Protocol*); #endif #ifdef MYSQL_CLIENT @@ -3621,7 +3637,7 @@ public: #endif #if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION) - virtual void pack_info(Protocol *protocol); + virtual void pack_info(THD *thd, Protocol *protocol); #endif #ifdef MYSQL_CLIENT @@ -3733,7 +3749,7 @@ public: flag_set get_flags(flag_set flags_arg) const { return m_flags & flags_arg; } #if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION) - virtual void pack_info(Protocol *protocol); + virtual void pack_info(THD *thd, Protocol *protocol); #endif #ifdef MYSQL_CLIENT @@ -4180,7 +4196,7 @@ public: #endif #ifdef MYSQL_SERVER - void pack_info(Protocol*); + void pack_info(THD *thd, Protocol*); #endif Incident_log_event(const char *buf, uint event_len, @@ -4279,6 +4295,16 @@ bool event_checksum_test(uchar *buf, ulong event_len, uint8 alg); uint8 get_checksum_alg(const char* buf, ulong len); extern TYPELIB binlog_checksum_typelib; +#ifndef MYSQL_CLIENT +/** + The function is called by slave applier in case there are + active table filtering rules to force gathering events associated + with Query-log-event into an array to execute + them once the fate of the Query is determined for execution. +*/ +bool slave_execute_deferred_events(THD *thd); +#endif + /** @} (end of group Replication) */ diff --git a/sql/log_event_old.cc b/sql/log_event_old.cc index 8f2c515e11c..d7c66af769a 100644 --- a/sql/log_event_old.cc +++ b/sql/log_event_old.cc @@ -1935,7 +1935,7 @@ bool Old_rows_log_event::write_data_body(IO_CACHE*file) #if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT) -void Old_rows_log_event::pack_info(Protocol *protocol) +void Old_rows_log_event::pack_info(THD *thd, Protocol *protocol) { char buf[256]; char const *const flagstr= diff --git a/sql/log_event_old.h b/sql/log_event_old.h index 8fe2e9e0a75..3e1efd8e2c0 100644 --- a/sql/log_event_old.h +++ b/sql/log_event_old.h @@ -108,7 +108,7 @@ public: flag_set get_flags(flag_set flags_arg) const { return m_flags & flags_arg; } #if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) - virtual void pack_info(Protocol *protocol); + virtual void pack_info(THD *thd, Protocol *protocol); #endif #ifdef MYSQL_CLIENT diff --git a/sql/multi_range_read.cc b/sql/multi_range_read.cc index 5b040c1fce3..800602fe9e1 100644 --- a/sql/multi_range_read.cc +++ b/sql/multi_range_read.cc @@ -1404,7 +1404,7 @@ ha_rows DsMrr_impl::dsmrr_info(uint keyno, uint n_ranges, uint rows, uint key_parts, uint *bufsz, uint *flags, COST_VECT *cost) { - ha_rows __attribute__((unused)) res; + ha_rows res __attribute__((unused)); uint def_flags= *flags; uint def_bufsz= *bufsz; diff --git a/sql/mysql_install_db.cc b/sql/mysql_install_db.cc index bde81d915b2..6e2c6ec07f3 100644 --- a/sql/mysql_install_db.cc +++ b/sql/mysql_install_db.cc @@ -247,7 +247,7 @@ static char *init_bootstrap_command_line(char *cmdline, size_t size) "\"\"%s\" --no-defaults --bootstrap" " \"--language=%s\\share\\english\"" " --basedir=. --datadir=. --default-storage-engine=myisam" - " --max_allowed_packet=9M --loose-skip-innodb --loose-skip-pbxt" + " --max_allowed_packet=9M --loose-skip-innodb" " --net-buffer-length=16k\"", mysqld_path, basedir); return cmdline; } diff --git a/sql/mysqld.cc b/sql/mysqld.cc index f81c4127fde..91bc2bfe226 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -106,7 +106,7 @@ /* We have HAVE_valgrind below as this speeds up the shutdown of MySQL */ -#if defined(HAVE_DEC_3_2_THREADS) || defined(SIGNALS_DONT_BREAK_READ) || defined(HAVE_valgrind) && defined(__linux__) +#if defined(SIGNALS_DONT_BREAK_READ) || defined(HAVE_valgrind) && defined(__linux__) #define HAVE_CLOSE_SERVER_SOCK 1 #endif @@ -477,6 +477,7 @@ ulonglong slave_type_conversions_options; ulong thread_cache_size=0; ulonglong binlog_cache_size=0; ulonglong max_binlog_cache_size=0; +ulong slave_max_allowed_packet= 0; ulonglong binlog_stmt_cache_size=0; ulonglong max_binlog_stmt_cache_size=0; ulonglong query_cache_size=0; @@ -2927,11 +2928,9 @@ static void start_signal_handler(void) DBUG_ENTER("start_signal_handler"); (void) pthread_attr_init(&thr_attr); -#if !defined(HAVE_DEC_3_2_THREADS) pthread_attr_setscope(&thr_attr,PTHREAD_SCOPE_SYSTEM); (void) pthread_attr_setdetachstate(&thr_attr,PTHREAD_CREATE_DETACHED); (void) my_setstacksize(&thr_attr,my_thread_stack_size); -#endif mysql_mutex_lock(&LOCK_thread_count); if ((error= mysql_thread_create(key_thread_signal_hand, @@ -6373,7 +6372,7 @@ struct my_option my_long_options[]= "will not do updates to tables in databases that start with foo and whose " "table names start with bar.", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"safe-mode", OPT_SAFE, "Skip some optimize stages (for testing).", + {"safe-mode", OPT_SAFE, "Skip some optimize stages (for testing). Deprecated.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"safe-user-create", 0, "Don't allow new user creation by the user who has no write privileges to the mysql.user table.", @@ -7614,6 +7613,8 @@ mysqld_get_one_option(int optid, #ifdef HAVE_QUERY_CACHE query_cache_size=0; #endif + sql_print_warning("The syntax '--safe-mode' is deprecated and will be " + "removed in a future release."); break; case (int) OPT_SKIP_PRIOR: opt_specialflag|= SPECIAL_NO_PRIOR; diff --git a/sql/mysqld.h b/sql/mysqld.h index f32b92633b7..56419acdcd4 100644 --- a/sql/mysqld.h +++ b/sql/mysqld.h @@ -170,6 +170,7 @@ extern ulong open_files_limit; extern ulonglong binlog_cache_size, binlog_stmt_cache_size; extern ulonglong max_binlog_cache_size, max_binlog_stmt_cache_size; extern ulong max_binlog_size, max_relay_log_size; +extern ulong slave_max_allowed_packet; extern ulong opt_binlog_rows_event_max_size; extern ulong rpl_recovery_rank, thread_cache_size; extern ulong stored_program_cache_size; diff --git a/sql/opt_range.cc b/sql/opt_range.cc index 0390ac1101e..dba72d76bb4 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -2001,14 +2001,14 @@ int QUICK_RANGE_SELECT::init_ror_merged_scan(bool reuse_handler) { handler *save_file= file, *org_file; my_bool org_key_read; - THD *thd; + THD *thd= head->in_use; DBUG_ENTER("QUICK_RANGE_SELECT::init_ror_merged_scan"); in_ror_merged_scan= 1; if (reuse_handler) { DBUG_PRINT("info", ("Reusing handler 0x%lx", (long) file)); - if (init() || reset()) + if (init()) { DBUG_RETURN(1); } @@ -2023,7 +2023,6 @@ int QUICK_RANGE_SELECT::init_ror_merged_scan(bool reuse_handler) DBUG_RETURN(0); } - thd= head->in_use; if (!(file= head->file->clone(head->s->normalized_path.str, thd->mem_root))) { /* @@ -2043,7 +2042,7 @@ int QUICK_RANGE_SELECT::init_ror_merged_scan(bool reuse_handler) if (file->ha_external_lock(thd, F_RDLCK)) goto failure; - if (init() || reset()) + if (init()) { file->ha_external_lock(thd, F_UNLCK); file->ha_close(); @@ -2090,7 +2089,18 @@ end: head->key_read= org_key_read; bitmap_copy(&column_bitmap, head->read_set); head->column_bitmaps_set(&column_bitmap, &column_bitmap); - + + if (reset()) + { + if (!reuse_handler) + { + file->ha_external_lock(thd, F_UNLCK); + file->ha_close(); + goto failure; + } + else + DBUG_RETURN(1); + } DBUG_RETURN(0); failure: @@ -11793,9 +11803,10 @@ get_best_group_min_max(PARAM *param, SEL_TREE *tree, double read_time) have_min= TRUE; else if (min_max_item->sum_func() == Item_sum::MAX_FUNC) have_max= TRUE; - else if (min_max_item->sum_func() == Item_sum::COUNT_DISTINCT_FUNC || - min_max_item->sum_func() == Item_sum::SUM_DISTINCT_FUNC || - min_max_item->sum_func() == Item_sum::AVG_DISTINCT_FUNC) + else if (is_agg_distinct && + (min_max_item->sum_func() == Item_sum::COUNT_DISTINCT_FUNC || + min_max_item->sum_func() == Item_sum::SUM_DISTINCT_FUNC || + min_max_item->sum_func() == Item_sum::AVG_DISTINCT_FUNC)) continue; else DBUG_RETURN(NULL); diff --git a/sql/opt_subselect.cc b/sql/opt_subselect.cc index 8d1cbeba5f4..e70e5a784ba 100644 --- a/sql/opt_subselect.cc +++ b/sql/opt_subselect.cc @@ -160,18 +160,18 @@ 3.2.1 Non-merged semi-joins and join optimization ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ For join optimization purposes, non-merged semi-join nests are similar to - base tables - they've got one JOIN_TAB, which can be accessed with one of - two methods: + base tables. Each such nest is represented by one one JOIN_TAB, which has + two possible access strategies: - full table scan (representing SJ-Materialization-Scan strategy) - eq_ref-like table lookup (representing SJ-Materialization-Lookup) Unlike regular base tables, non-merged semi-joins have: - non-zero JOIN_TAB::startup_cost, and - join_tab->table->is_filled_at_execution()==TRUE, which means one - cannot do const table detection or range analysis or other table data- - dependent inferences - // instead, get_delayed_table_estimates() runs optimization on the nest so that - // we get an idea about temptable size + cannot do const table detection, range analysis or other dataset-dependent + optimizations. + Instead, get_delayed_table_estimates() will run optimization for the + subquery and produce an E(materialized table size). 3.2.2 Merged semi-joins and join optimization ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/sql/protocol.cc b/sql/protocol.cc index 10c85939986..3af7dc88b88 100644 --- a/sql/protocol.cc +++ b/sql/protocol.cc @@ -1,5 +1,5 @@ -/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. - Copyright (c) 2008, 2011, Monty Program Ab +/* Copyright (c) 2000, 2012, Oracle and/or its affiliates. + Copyright (c) 2008, 2012, Monty Program Ab This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -775,6 +775,8 @@ bool Protocol::send_result_set_metadata(List<Item> *list, uint flags) /* Store fixed length fields */ pos= (char*) local_packet->ptr()+local_packet->length(); *pos++= 12; // Length of packed fields + /* inject a NULL to test the client */ + DBUG_EXECUTE_IF("poison_rs_fields", pos[-1]= 0xfb;); if (item->charset_for_protocol() == &my_charset_bin || thd_charset == NULL) { /* No conversion */ diff --git a/sql/repl_failsafe.cc b/sql/repl_failsafe.cc index abc22a00695..89fb1bb27de 100644 --- a/sql/repl_failsafe.cc +++ b/sql/repl_failsafe.cc @@ -35,7 +35,6 @@ #include "rpl_mi.h" #include "rpl_filter.h" #include "log_event.h" -#include "sql_db.h" // mysql_create_db #include <mysql.h> #define SLAVE_LIST_CHUNK 128 diff --git a/sql/rpl_record.cc b/sql/rpl_record.cc index a49f10db440..99bf8a82004 100644 --- a/sql/rpl_record.cc +++ b/sql/rpl_record.cc @@ -314,7 +314,7 @@ unpack_row(Relay_log_info const *rli, if (!pack_ptr) { rli->report(ERROR_LEVEL, ER_SLAVE_CORRUPT_EVENT, - "Could not read field `%s` of table `%s`.`%s`", + "Could not read field '%s' of table '%s.%s'", f->field_name, table->s->db.str, table->s->table_name.str); DBUG_RETURN(ER_SLAVE_CORRUPT_EVENT); diff --git a/sql/rpl_utility.cc b/sql/rpl_utility.cc index 388a6c9f9bb..069fac1c3ec 100644 --- a/sql/rpl_utility.cc +++ b/sql/rpl_utility.cc @@ -15,11 +15,10 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "rpl_utility.h" +#include "log_event.h" -#ifndef MYSQL_CLIENT -#include "unireg.h" // REQUIRED by later includes +#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) #include "rpl_rli.h" -#include "log_event.h" #include "sql_select.h" /** @@ -954,7 +953,6 @@ TABLE *table_def::create_conversion_table(THD *thd, Relay_log_info *rli, TABLE * target_table->s->table_name.str); DBUG_RETURN(conv_table); } - #endif /* MYSQL_CLIENT */ table_def::table_def(unsigned char *types, ulong size, @@ -1115,7 +1113,6 @@ bool event_checksum_test(uchar *event_buf, ulong event_len, uint8 alg) return DBUG_EVALUATE_IF("simulate_checksum_test_failure", TRUE, res); } - #if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION) Deferred_log_events::Deferred_log_events(Relay_log_info *rli) : last_added(NULL) diff --git a/sql/rpl_utility.h b/sql/rpl_utility.h index 9046891e27f..79f4517c492 100644 --- a/sql/rpl_utility.h +++ b/sql/rpl_utility.h @@ -272,7 +272,7 @@ private: public: Deferred_log_events(Relay_log_info *rli); ~Deferred_log_events(); - /* queue for exection at Query-log-event time prior the Query */; + /* queue for exection at Query-log-event time prior the Query */ int add(Log_event *ev); bool is_empty(); bool execute(Relay_log_info *rli); diff --git a/sql/share/errmsg-utf8.txt b/sql/share/errmsg-utf8.txt index a762a06cfc1..2e8b2231948 100644 --- a/sql/share/errmsg-utf8.txt +++ b/sql/share/errmsg-utf8.txt @@ -6585,3 +6585,6 @@ ER_STORED_FUNCTION_PREVENTS_SWITCH_SKIP_REPLICATION eng "Cannot modify @@session.skip_replication inside a stored function or trigger" ER_QUERY_EXCEEDED_ROWS_EXAMINED_LIMIT eng "Query execution was interrupted. The query examined at least %llu rows, which exceeds LIMIT ROWS EXAMINED (%llu). The query result may be incomplete." +ER_NO_SUCH_TABLE_IN_ENGINE 42S02 + eng "Table '%-.192s.%-.192s' doesn't exist in engine" + swe "Det finns ingen tabell som heter '%-.192s.%-.192s' i handlern" diff --git a/sql/signal_handler.cc b/sql/signal_handler.cc index 37f28844a7c..edc33c4d63b 100644 --- a/sql/signal_handler.cc +++ b/sql/signal_handler.cc @@ -138,23 +138,6 @@ extern "C" sig_handler handle_fatal_signal(int sig) my_safe_printf_stderr("%s", "Hope that's ok; if not, decrease some variables in the equation.\n\n"); -#if defined(HAVE_LINUXTHREADS) -#define UNSAFE_DEFAULT_LINUX_THREADS 200 - if (sizeof(char*) == 4 && thread_count > UNSAFE_DEFAULT_LINUX_THREADS) - { - my_safe_printf_stderr( - "You seem to be running 32-bit Linux and have " - "%d concurrent connections.\n" - "If you have not changed STACK_SIZE in LinuxThreads " - "and built the binary \n" - "yourself, LinuxThreads is quite likely to steal " - "a part of the global heap for\n" - "the thread stack. Please read " - "http://dev.mysql.com/doc/mysql/en/linux-installation.html\n\n" - thread_count); - } -#endif /* HAVE_LINUXTHREADS */ - #ifdef HAVE_STACKTRACE thd= current_thd; diff --git a/sql/slave.cc b/sql/slave.cc index ec57f01c6ed..ac42e72978d 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -2287,8 +2287,7 @@ static int init_slave_thread(THD* thd, SLAVE_THD_TYPE thd_type) slave threads, since a replication event can become this much larger than the corresponding packet (query) sent from client to master. */ - thd->variables.max_allowed_packet= global_system_variables.max_allowed_packet - + MAX_LOG_EVENT_HEADER; /* note, incr over the global not session var */ + thd->variables.max_allowed_packet= slave_max_allowed_packet; thd->slave_thread = 1; thd->enable_slow_log= opt_log_slow_slave_statements; thd->variables.log_slow_filter= global_system_variables.log_slow_filter; @@ -3012,6 +3011,8 @@ pthread_handler_t handle_slave_io(void *arg) mysql= NULL ; retry_count= 0; + thd= new THD; // note that contructor of THD uses DBUG_ ! + mysql_mutex_lock(&mi->run_lock); /* Inform waiting threads that slave has started */ mi->slave_run_id++; @@ -3020,7 +3021,6 @@ pthread_handler_t handle_slave_io(void *arg) mi->events_till_disconnect = disconnect_slave_event_count; #endif - thd= new THD; // note that contructor of THD uses DBUG_ ! THD_CHECK_SENTRY(thd); mi->io_thd = thd; @@ -3076,6 +3076,7 @@ pthread_handler_t handle_slave_io(void *arg) thread, since a replication event can become this much larger than the corresponding packet (query) sent from client to master. */ + thd->net.max_packet_size= slave_max_allowed_packet; mysql->net.max_packet_size= thd->net.max_packet_size+= MAX_LOG_EVENT_HEADER; } else @@ -3208,12 +3209,12 @@ reading event")) switch (mysql_error_number) { case CR_NET_PACKET_TOO_LARGE: sql_print_error("\ -Log entry on master is longer than max_allowed_packet (%ld) on \ +Log entry on master is longer than slave_max_allowed_packet (%lu) on \ slave. If the entry is correct, restart the server with a higher value of \ -max_allowed_packet", - thd->variables.max_allowed_packet); +slave_max_allowed_packet", + slave_max_allowed_packet); mi->report(ERROR_LEVEL, ER_NET_PACKET_TOO_LARGE, - "%s", ER(ER_NET_PACKET_TOO_LARGE)); + "%s", "Got a packet bigger than 'slave_max_allowed_packet' bytes"); goto err; case ER_MASTER_FATAL_ERROR_READING_BINLOG: mi->report(ERROR_LEVEL, ER_MASTER_FATAL_ERROR_READING_BINLOG, diff --git a/sql/sp.cc b/sql/sp.cc index 29195234a5a..93cd64b4104 100644 --- a/sql/sp.cc +++ b/sql/sp.cc @@ -1429,6 +1429,7 @@ public: MYSQL_ERROR ** cond_hdl) { if (sql_errno == ER_NO_SUCH_TABLE || + sql_errno == ER_NO_SUCH_TABLE_IN_ENGINE || sql_errno == ER_CANNOT_LOAD_FROM_TABLE || sql_errno == ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE || sql_errno == ER_COL_COUNT_DOESNT_MATCH_CORRUPTED) diff --git a/sql/sp_head.cc b/sql/sp_head.cc index 9a356cb3321..f3ba0073c69 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -3032,6 +3032,7 @@ sp_lex_keeper::reset_lex_and_exec_core(THD *thd, uint *nextp, if (!res || !thd->is_error() || (thd->stmt_da->sql_errno() != ER_CANT_REOPEN_TABLE && thd->stmt_da->sql_errno() != ER_NO_SUCH_TABLE && + thd->stmt_da->sql_errno() != ER_NO_SUCH_TABLE_IN_ENGINE && thd->stmt_da->sql_errno() != ER_UPDATE_TABLE_USED)) thd->stmt_arena->state= Query_arena::STMT_EXECUTED; diff --git a/sql/spatial.h b/sql/spatial.h index 0d0560656f0..07675d59040 100644 --- a/sql/spatial.h +++ b/sql/spatial.h @@ -554,5 +554,5 @@ public: struct Geometry_buffer : public my_aligned_storage<sizeof(Gis_point), MY_ALIGNOF(Gis_point)> {}; -#endif /*HAVE_SPATAIAL*/ +#endif /*HAVE_SPATIAL*/ #endif diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 41c04b9c413..8f27c45247e 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -8044,6 +8044,7 @@ static bool send_server_handshake_packet(MPVIO_EXT *mpvio, int2store(end+3, mpvio->thd->server_status); int2store(end+5, thd->client_capabilities >> 16); end[7]= data_len; + DBUG_EXECUTE_IF("poison_srv_handshake_scramble_len", end[7]= -100;); bzero(end + 8, 10); end+= 18; /* write scramble tail */ diff --git a/sql/sql_admin.cc b/sql/sql_admin.cc index 8d0f2e5634f..c65e56edbe0 100644 --- a/sql/sql_admin.cc +++ b/sql/sql_admin.cc @@ -285,6 +285,7 @@ end: static inline bool table_not_corrupt_error(uint sql_errno) { return (sql_errno == ER_NO_SUCH_TABLE || + sql_errno == ER_NO_SUCH_TABLE_IN_ENGINE || sql_errno == ER_FILE_NOT_FOUND || sql_errno == ER_LOCK_WAIT_TIMEOUT || sql_errno == ER_LOCK_DEADLOCK || diff --git a/sql/sql_base.cc b/sql/sql_base.cc index acd330dd4d2..52569f193aa 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -70,7 +70,7 @@ No_such_table_error_handler::handle_condition(THD *, MYSQL_ERROR ** cond_hdl) { *cond_hdl= NULL; - if (sql_errno == ER_NO_SUCH_TABLE) + if (sql_errno == ER_NO_SUCH_TABLE || sql_errno == ER_NO_SUCH_TABLE_IN_ENGINE) { m_handled_errors++; return TRUE; @@ -144,7 +144,9 @@ Repair_mrg_table_error_handler::handle_condition(THD *, MYSQL_ERROR ** cond_hdl) { *cond_hdl= NULL; - if (sql_errno == ER_NO_SUCH_TABLE || sql_errno == ER_WRONG_MRG_TABLE) + if (sql_errno == ER_NO_SUCH_TABLE || + sql_errno == ER_NO_SUCH_TABLE_IN_ENGINE || + sql_errno == ER_WRONG_MRG_TABLE) { m_handled_errors= true; return TRUE; @@ -717,7 +719,9 @@ get_table_share_with_discover(THD *thd, TABLE_LIST *table_list, @todo Rework alternative ways to deal with ER_NO_SUCH TABLE. */ - if (share || (thd->is_error() && thd->stmt_da->sql_errno() != ER_NO_SUCH_TABLE)) + if (share || + (thd->is_error() && thd->stmt_da->sql_errno() != ER_NO_SUCH_TABLE && + thd->stmt_da->sql_errno() != ER_NO_SUCH_TABLE_IN_ENGINE)) DBUG_RETURN(share); *error= 0; @@ -3887,22 +3891,22 @@ static bool open_table_entry_fini(THD *thd, TABLE_SHARE *share, TABLE *entry) entry->file->implicit_emptied= 0; if (mysql_bin_log.is_open()) { - char *query, *end; - uint query_buf_size= 20 + share->db.length + share->table_name.length +1; - if ((query= (char*) my_malloc(query_buf_size,MYF(MY_WME)))) + char query_buf[2*FN_REFLEN + 21]; + String query(query_buf, sizeof(query_buf), system_charset_info); + query.length(0); + if (query.ptr()) { /* this DELETE FROM is needed even with row-based binlogging */ - end = strxmov(strmov(query, "DELETE FROM `"), - share->db.str,"`.`",share->table_name.str,"`", NullS); + query.append("DELETE FROM "); + append_identifier(thd, &query, share->db.str, share->db.length); + query.append("."); + append_identifier(thd, &query, share->table_name.str, + share->table_name.length); int errcode= query_error_code(thd, TRUE); if (thd->binlog_query(THD::STMT_QUERY_TYPE, - query, (ulong)(end-query), + query.ptr(), query.length(), FALSE, FALSE, FALSE, errcode)) - { - my_free(query); return TRUE; - } - my_free(query); } else { @@ -3912,7 +3916,7 @@ static bool open_table_entry_fini(THD *thd, TABLE_SHARE *share, TABLE *entry) because of MYF(MY_WME) in my_malloc() above). */ sql_print_error("When opening HEAP table, could not allocate memory " - "to write 'DELETE FROM `%s`.`%s`' to the binary log", + "to write 'DELETE FROM %`s.%`s' to the binary log", share->db.str, share->table_name.str); delete entry->triggers; return TRUE; diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc index 96814562757..191cc4e01c8 100644 --- a/sql/sql_cache.cc +++ b/sql/sql_cache.cc @@ -1533,7 +1533,7 @@ def_week_frmt: %lu, in_trans: %d, autocommit: %d", unlock(); goto end; } - if (!register_all_tables(query_block, tables_used, local_tables)) + if (!register_all_tables(thd, query_block, tables_used, local_tables)) { refused++; DBUG_PRINT("warning", ("tables list including failed")); @@ -1813,7 +1813,10 @@ Query_cache::send_result_to_client(THD *thd, char *org_sql, uint query_length) goto err; if (query_cache_size == 0) + { + thd->query_cache_is_applicable= 0; // Query can't be cached goto err_unlock; + } Query_cache_block *query_block; if (thd->variables.query_cache_strip_comments) @@ -3203,6 +3206,7 @@ Query_cache::invalidate_query_block_list(THD *thd, SYNOPSIS Query_cache::register_tables_from_list + thd thread handle tables_used given table list counter number current position in table of tables of block block_table pointer to current position in tables table of block @@ -3213,24 +3217,24 @@ Query_cache::invalidate_query_block_list(THD *thd, */ TABLE_COUNTER_TYPE -Query_cache::register_tables_from_list(TABLE_LIST *tables_used, +Query_cache::register_tables_from_list(THD *thd, TABLE_LIST *tables_used, TABLE_COUNTER_TYPE counter, - Query_cache_block_table *block_table) + Query_cache_block_table **block_table) { TABLE_COUNTER_TYPE n; DBUG_ENTER("Query_cache::register_tables_from_list"); for (n= counter; tables_used; - tables_used= tables_used->next_global, n++, block_table++) + tables_used= tables_used->next_global, n++, (*block_table)++) { if (tables_used->is_anonymous_derived_table()) { DBUG_PRINT("qcache", ("derived table skipped")); n--; - block_table--; + (*block_table)--; continue; } - block_table->n= n; + (*block_table)->n= n; if (tables_used->view) { char key[MAX_DBKEY_LENGTH]; @@ -3243,9 +3247,9 @@ Query_cache::register_tables_from_list(TABLE_LIST *tables_used, /* There are not callback function for for VIEWs */ - if (!insert_table(key_length, key, block_table, + if (!insert_table(key_length, key, (*block_table), tables_used->view_db.length + 1, - HA_CACHE_TBL_NONTRANSACT, 0, 0)) + HA_CACHE_TBL_NONTRANSACT, 0, 0, TRUE)) DBUG_RETURN(0); /* We do not need to register view tables here because they are already @@ -3264,42 +3268,17 @@ Query_cache::register_tables_from_list(TABLE_LIST *tables_used, if (!insert_table(tables_used->table->s->table_cache_key.length, tables_used->table->s->table_cache_key.str, - block_table, + (*block_table), tables_used->db_length, tables_used->table->file->table_cache_type(), tables_used->callback_func, - tables_used->engine_data)) + tables_used->engine_data, + TRUE)) DBUG_RETURN(0); -#ifdef WITH_MYISAMMRG_STORAGE_ENGINE - /* - XXX FIXME: Some generic mechanism is required here instead of this - MYISAMMRG-specific implementation. - */ - if (tables_used->table->s->db_type()->db_type == DB_TYPE_MRG_MYISAM) - { - ha_myisammrg *handler = (ha_myisammrg *) tables_used->table->file; - MYRG_INFO *file = handler->myrg_info(); - for (MYRG_TABLE *table = file->open_tables; - table != file->end_table ; - table++) - { - char key[MAX_DBKEY_LENGTH]; - uint32 db_length; - uint key_length= filename_2_table_key(key, table->table->filename, - &db_length); - (++block_table)->n= ++n; - /* - There are not callback function for for MyISAM, and engine data - */ - if (!insert_table(key_length, key, block_table, - db_length, - tables_used->table->file->table_cache_type(), - 0, 0)) - DBUG_RETURN(0); - } - } -#endif + if (tables_used->table->file-> + register_query_cache_dependant_tables(thd, this, block_table, &n)) + DBUG_RETURN(0); } } DBUG_RETURN(n - counter); @@ -3310,12 +3289,14 @@ Query_cache::register_tables_from_list(TABLE_LIST *tables_used, SYNOPSIS register_all_tables() + thd Thread handle block Store tables in this block tables_used List if used tables tables_arg Not used ? */ -my_bool Query_cache::register_all_tables(Query_cache_block *block, +my_bool Query_cache::register_all_tables(THD *thd, + Query_cache_block *block, TABLE_LIST *tables_used, TABLE_COUNTER_TYPE tables_arg) { @@ -3326,7 +3307,7 @@ my_bool Query_cache::register_all_tables(Query_cache_block *block, Query_cache_block_table *block_table = block->table(0); - n= register_tables_from_list(tables_used, 0, block_table); + n= register_tables_from_list(thd, tables_used, 0, &block_table); if (n==0) { @@ -3335,6 +3316,8 @@ my_bool Query_cache::register_all_tables(Query_cache_block *block, tmp != block_table; tmp++) unlink_table(tmp); + if (block_table->parent) + unlink_table(block_table); } return test(n); } @@ -3353,7 +3336,8 @@ Query_cache::insert_table(uint key_len, char *key, Query_cache_block_table *node, uint32 db_length, uint8 cache_type, qc_engine_callback callback, - ulonglong engine_data) + ulonglong engine_data, + my_bool hash) { DBUG_ENTER("Query_cache::insert_table"); DBUG_PRINT("qcache", ("insert table node 0x%lx, len %d", @@ -3361,8 +3345,10 @@ Query_cache::insert_table(uint key_len, char *key, THD *thd= current_thd; - Query_cache_block *table_block= - (Query_cache_block *) my_hash_search(&tables, (uchar*) key, key_len); + Query_cache_block *table_block= + (hash ? + (Query_cache_block *) my_hash_search(&tables, (uchar*) key, key_len) : + NULL); if (table_block && table_block->table()->engine_data() != engine_data) @@ -3412,7 +3398,8 @@ Query_cache::insert_table(uint key_len, char *key, */ list_root->next= list_root->prev= list_root; - if (my_hash_insert(&tables, (const uchar *) table_block)) + if (hash && + my_hash_insert(&tables, (const uchar *) table_block)) { DBUG_PRINT("qcache", ("Can't insert table to hash")); // write_block_data return locked block @@ -3425,6 +3412,7 @@ Query_cache::insert_table(uint key_len, char *key, header->type(cache_type); header->callback(callback); header->engine_data(engine_data); + header->set_hashed(hash); /* We insert this table without the assumption that it isn't refrenenced by @@ -3478,7 +3466,9 @@ void Query_cache::unlink_table(Query_cache_block_table *node) Query_cache_block *table_block= neighbour->block(); double_linked_list_exclude(table_block, &tables_blocks); - my_hash_delete(&tables,(uchar *) table_block); + Query_cache_table *header= table_block->table(); + if (header->is_hashed()) + my_hash_delete(&tables,(uchar *) table_block); free_memory_block(table_block); } DBUG_VOID_RETURN; @@ -3951,6 +3941,9 @@ Query_cache::process_and_count_tables(THD *thd, TABLE_LIST *tables_used, table_alias_charset used here because it depends of lower_case_table_names variable */ + table_count+= tables_used->table->file-> + count_query_cache_dependant_tables(tables_type); + if (tables_used->table->s->tmp_table != NO_TMP_TABLE || (*tables_type & HA_CACHE_TBL_NOCACHE) || (tables_used->db_length == 5 && @@ -3963,18 +3956,6 @@ Query_cache::process_and_count_tables(THD *thd, TABLE_LIST *tables_used, "other non-cacheable table(s)")); DBUG_RETURN(0); } -#ifdef WITH_MYISAMMRG_STORAGE_ENGINE - /* - XXX FIXME: Some generic mechanism is required here instead of this - MYISAMMRG-specific implementation. - */ - if (tables_used->table->s->db_type()->db_type == DB_TYPE_MRG_MYISAM) - { - ha_myisammrg *handler = (ha_myisammrg *)tables_used->table->file; - MYRG_INFO *file = handler->myrg_info(); - table_count+= (file->end_table - file->open_tables); - } -#endif } } DBUG_RETURN(table_count); diff --git a/sql/sql_cache.h b/sql/sql_cache.h index 87291e80a85..7444d444cf9 100644 --- a/sql/sql_cache.h +++ b/sql/sql_cache.h @@ -200,6 +200,10 @@ struct Query_cache_table The number of queries depending of this table. */ int32 m_cached_query_count; + /** + If table included in the table hash to be found by other queries + */ + my_bool hashed; inline char *db() { return (char *) data(); } inline char *table() { return tbl; } @@ -212,6 +216,8 @@ struct Query_cache_table inline void callback(qc_engine_callback fn){ callback_func= fn; } inline ulonglong engine_data() { return engine_data_buff; } inline void engine_data(ulonglong data_arg){ engine_data_buff= data_arg; } + inline my_bool is_hashed() { return hashed; } + inline void set_hashed(my_bool hash) { hashed= hash; } inline uchar* data() { return (uchar*)(((uchar*)this)+ @@ -343,10 +349,6 @@ protected: static void double_linked_list_join(Query_cache_block *head_tail, Query_cache_block *tail_head); - /* Table key generation */ - static uint filename_2_table_key (char *key, const char *filename, - uint32 *db_langth); - /* The following functions require that structure_guard_mutex is locked */ void flush_cache(); my_bool free_old_query(); @@ -363,17 +365,12 @@ protected: Query_cache_block_table *list_root); TABLE_COUNTER_TYPE - register_tables_from_list(TABLE_LIST *tables_used, + register_tables_from_list(THD *thd, TABLE_LIST *tables_used, TABLE_COUNTER_TYPE counter, - Query_cache_block_table *block_table); - my_bool register_all_tables(Query_cache_block *block, + Query_cache_block_table **block_table); + my_bool register_all_tables(THD *thd, Query_cache_block *block, TABLE_LIST *tables_used, TABLE_COUNTER_TYPE tables); - my_bool insert_table(uint key_len, char *key, - Query_cache_block_table *node, - uint32 db_length, uint8 cache_type, - qc_engine_callback callback, - ulonglong engine_data); void unlink_table(Query_cache_block_table *node); Query_cache_block *get_free_block (ulong len, my_bool not_less, ulong min); @@ -491,6 +488,12 @@ protected: const char *packet, ulong length, unsigned pkt_nr); + my_bool insert_table(uint key_len, char *key, + Query_cache_block_table *node, + uint32 db_length, uint8 cache_type, + qc_engine_callback callback, + ulonglong engine_data, + my_bool hash); void end_of_result(THD *thd); void abort(Query_cache_tls *query_cache_tls); @@ -513,6 +516,10 @@ protected: const char *name); my_bool in_blocks(Query_cache_block * point); + /* Table key generation */ + static uint filename_2_table_key (char *key, const char *filename, + uint32 *db_langth); + enum Cache_try_lock_mode {WAIT, TIMEOUT, TRY}; bool try_lock(THD *thd, Cache_try_lock_mode mode= WAIT); void lock(THD *thd); diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 0165aa9f6e5..f77ef114d2d 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -5186,6 +5186,134 @@ show_query_type(THD::enum_binlog_query_type qtype) } #endif +/* + Constants required for the limit unsafe warnings suppression +*/ +//seconds after which the limit unsafe warnings suppression will be activated +#define LIMIT_UNSAFE_WARNING_ACTIVATION_TIMEOUT 50 +//number of limit unsafe warnings after which the suppression will be activated +#define LIMIT_UNSAFE_WARNING_ACTIVATION_THRESHOLD_COUNT 50 + +static ulonglong limit_unsafe_suppression_start_time= 0; +static bool unsafe_warning_suppression_is_activated= false; +static int limit_unsafe_warning_count= 0; + +/** + Auxiliary function to reset the limit unsafety warning suppression. +*/ +static void reset_binlog_unsafe_suppression() +{ + DBUG_ENTER("reset_binlog_unsafe_suppression"); + unsafe_warning_suppression_is_activated= false; + limit_unsafe_warning_count= 0; + limit_unsafe_suppression_start_time= my_interval_timer()/10000000; + DBUG_VOID_RETURN; +} + +/** + Auxiliary function to print warning in the error log. +*/ +static void print_unsafe_warning_to_log(int unsafe_type, char* buf, + char* query) +{ + DBUG_ENTER("print_unsafe_warning_in_log"); + sprintf(buf, ER(ER_BINLOG_UNSAFE_STATEMENT), + ER(LEX::binlog_stmt_unsafe_errcode[unsafe_type])); + sql_print_warning(ER(ER_MESSAGE_AND_STATEMENT), buf, query); + DBUG_VOID_RETURN; +} + +/** + Auxiliary function to check if the warning for limit unsafety should be + thrown or suppressed. Details of the implementation can be found in the + comments inline. + SYNOPSIS: + @params + buf - buffer to hold the warning message text + unsafe_type - The type of unsafety. + query - The actual query statement. + + TODO: Remove this function and implement a general service for all warnings + that would prevent flooding the error log. +*/ +static void do_unsafe_limit_checkout(char* buf, int unsafe_type, char* query) +{ + ulonglong now= 0; + DBUG_ENTER("do_unsafe_limit_checkout"); + DBUG_ASSERT(unsafe_type == LEX::BINLOG_STMT_UNSAFE_LIMIT); + limit_unsafe_warning_count++; + /* + INITIALIZING: + If this is the first time this function is called with log warning + enabled, the monitoring the unsafe warnings should start. + */ + if (limit_unsafe_suppression_start_time == 0) + { + limit_unsafe_suppression_start_time= my_interval_timer()/10000000; + print_unsafe_warning_to_log(unsafe_type, buf, query); + } + else + { + if (!unsafe_warning_suppression_is_activated) + print_unsafe_warning_to_log(unsafe_type, buf, query); + + if (limit_unsafe_warning_count >= + LIMIT_UNSAFE_WARNING_ACTIVATION_THRESHOLD_COUNT) + { + now= my_interval_timer()/10000000; + if (!unsafe_warning_suppression_is_activated) + { + /* + ACTIVATION: + We got LIMIT_UNSAFE_WARNING_ACTIVATION_THRESHOLD_COUNT warnings in + less than LIMIT_UNSAFE_WARNING_ACTIVATION_TIMEOUT we activate the + suppression. + */ + if ((now-limit_unsafe_suppression_start_time) <= + LIMIT_UNSAFE_WARNING_ACTIVATION_TIMEOUT) + { + unsafe_warning_suppression_is_activated= true; + DBUG_PRINT("info",("A warning flood has been detected and the limit \ +unsafety warning suppression has been activated.")); + } + else + { + /* + there is no flooding till now, therefore we restart the monitoring + */ + limit_unsafe_suppression_start_time= my_interval_timer()/10000000; + limit_unsafe_warning_count= 0; + } + } + else + { + /* + Print the suppression note and the unsafe warning. + */ + sql_print_information("The following warning was suppressed %d times \ +during the last %d seconds in the error log", + limit_unsafe_warning_count, + (int) + (now-limit_unsafe_suppression_start_time)); + print_unsafe_warning_to_log(unsafe_type, buf, query); + /* + DEACTIVATION: We got LIMIT_UNSAFE_WARNING_ACTIVATION_THRESHOLD_COUNT + warnings in more than LIMIT_UNSAFE_WARNING_ACTIVATION_TIMEOUT, the + suppression should be deactivated. + */ + if ((now - limit_unsafe_suppression_start_time) > + LIMIT_UNSAFE_WARNING_ACTIVATION_TIMEOUT) + { + reset_binlog_unsafe_suppression(); + DBUG_PRINT("info",("The limit unsafety warning supression has been \ +deactivated")); + } + } + limit_unsafe_warning_count= 0; + } + } + DBUG_VOID_RETURN; +} /** Auxiliary method used by @c binlog_query() to raise warnings. @@ -5195,6 +5323,7 @@ show_query_type(THD::enum_binlog_query_type qtype) */ void THD::issue_unsafe_warnings() { + char buf[MYSQL_ERRMSG_SIZE * 2]; DBUG_ENTER("issue_unsafe_warnings"); /* Ensure that binlog_unsafe_warning_flags is big enough to hold all @@ -5220,17 +5349,16 @@ void THD::issue_unsafe_warnings() ER(LEX::binlog_stmt_unsafe_errcode[unsafe_type])); if (global_system_variables.log_warnings) { - char buf[MYSQL_ERRMSG_SIZE * 2]; - sprintf(buf, ER(ER_BINLOG_UNSAFE_STATEMENT), - ER(LEX::binlog_stmt_unsafe_errcode[unsafe_type])); - sql_print_warning(ER(ER_MESSAGE_AND_STATEMENT), buf, query()); + if (unsafe_type == LEX::BINLOG_STMT_UNSAFE_LIMIT) + do_unsafe_limit_checkout( buf, unsafe_type, query()); + else //cases other than LIMIT unsafety + print_unsafe_warning_to_log(unsafe_type, buf, query()); } } } DBUG_VOID_RETURN; } - /** Log the current query. @@ -5406,3 +5534,4 @@ bool Discrete_intervals_list::append(Discrete_interval *new_interval) } #endif /* !defined(MYSQL_CLIENT) */ + diff --git a/sql/sql_class.h b/sql/sql_class.h index 5b53f806ddb..845c2115922 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -1844,6 +1844,7 @@ public: MEM_ROOT mem_root; // Transaction-life memory allocation pool void cleanup() { + DBUG_ENTER("thd::cleanup"); changed_tables= 0; savepoints= 0; /* @@ -1855,6 +1856,7 @@ public: if (!xid_state.rm_error) xid_state.xid.null(); free_root(&mem_root,MYF(MY_KEEP_PREALLOC)); + DBUG_VOID_RETURN; } my_bool is_active() { @@ -3028,7 +3030,7 @@ public: if (global_system_variables.log_warnings > threshold) { Security_context *sctx= &main_security_ctx; - sql_print_warning(ER(ER_NEW_ABORTING_CONNECTION), + sql_print_warning(ER_THD(this, ER_NEW_ABORTING_CONNECTION), thread_id, (db ? db : "unconnected"), sctx->user ? sctx->user : "unauthenticated", sctx->host_or_ip, reason); diff --git a/sql/sql_cursor.cc b/sql/sql_cursor.cc index c50cded7470..b8b979a282b 100644 --- a/sql/sql_cursor.cc +++ b/sql/sql_cursor.cc @@ -115,6 +115,8 @@ int mysql_open_cursor(THD *thd, select_result *result, &thd->security_ctx->priv_user[0], (char *) thd->security_ctx->host_or_ip, 2); + /* Mark that we can't use query cache with cursors */ + thd->query_cache_is_applicable= 0; rc= mysql_execute_command(thd); MYSQL_QUERY_EXEC_DONE(rc); diff --git a/sql/sql_db.cc b/sql/sql_db.cc index 052616f6965..5704b6d51b6 100644 --- a/sql/sql_db.cc +++ b/sql/sql_db.cc @@ -544,7 +544,6 @@ int mysql_create_db(THD *thd, char *db, HA_CREATE_INFO *create_info, bool silent) { char path[FN_REFLEN+16]; - char tmp_query[FN_REFLEN+16]; long result= 1; int error= 0; MY_STAT stat_info; @@ -622,17 +621,9 @@ not_silent: char *query; uint query_length; - if (!thd->query()) // Only in replication - { - query= tmp_query; - query_length= (uint) (strxmov(tmp_query,"create database `", - db, "`", NullS) - tmp_query); - } - else - { - query= thd->query(); - query_length= thd->query_length(); - } + query= thd->query(); + query_length= thd->query_length(); + DBUG_ASSERT(query); ha_binlog_log_query(thd, 0, LOGCOM_CREATE_DB, query, query_length, @@ -885,18 +876,11 @@ update_binlog: { const char *query; ulong query_length; - if (!thd->query()) - { - /* The client used the old obsolete mysql_drop_db() call */ - query= path; - query_length= (uint) (strxmov(path, "drop database `", db, "`", - NullS) - path); - } - else - { - query= thd->query(); - query_length= thd->query_length(); - } + + query= thd->query(); + query_length= thd->query_length(); + DBUG_ASSERT(query); + if (mysql_bin_log.is_open()) { int errcode= query_error_code(thd, TRUE); @@ -940,6 +924,7 @@ update_binlog: { uint tbl_name_len; bool exists; + char quoted_name[FN_REFLEN+3]; // Only write drop table to the binlog for tables that no longer exist. if (check_if_table_exists(thd, tbl, &exists)) @@ -950,8 +935,8 @@ update_binlog: if (exists) continue; - /* 3 for the quotes and the comma*/ - tbl_name_len= strlen(tbl->table_name) + 3; + my_snprintf(quoted_name, sizeof(quoted_name), "%`s", tbl->table_name); + tbl_name_len= strlen(quoted_name) + 1; /* +1 for the comma */ if (query_pos + tbl_name_len + 1 >= query_end) { /* @@ -966,9 +951,7 @@ update_binlog: query_pos= query_data_start; } - *query_pos++ = '`'; - query_pos= strmov(query_pos,tbl->table_name); - *query_pos++ = '`'; + query_pos= strmov(query_pos, quoted_name); *query_pos++ = ','; } diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc index 5128b1284dd..81e3dca50ae 100644 --- a/sql/sql_delete.cc +++ b/sql/sql_delete.cc @@ -368,8 +368,14 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds, } } } - else + /* + Don't try unlocking the row if skip_record reported an error since in + this case the transaction might have been rolled back already. + */ + else if (!thd->is_error()) table->file->unlock_row(); // Row failed selection, release lock on it + else + break; } killed_status= thd->killed; if (killed_status != NOT_KILLED || thd->is_error()) diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 54f94ce78c1..e0d0d4c4223 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -2781,9 +2781,6 @@ pthread_handler_t handle_delayed_insert(void *arg) { int error; mysql_audit_release(thd); -#if defined(HAVE_BROKEN_COND_TIMEDWAIT) - error= mysql_cond_wait(&di->cond, &di->mutex); -#else error= mysql_cond_timedwait(&di->cond, &di->mutex, &abstime); #ifdef EXTRA_DEBUG if (error && error != EINTR && error != ETIMEDOUT) @@ -2793,7 +2790,6 @@ pthread_handler_t handle_delayed_insert(void *arg) error)); } #endif -#endif if (error == ETIMEDOUT || error == ETIME) thd->killed= KILL_CONNECTION; } diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index cf0a8674316..240aeb223d4 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -4167,7 +4167,6 @@ bool LEX::is_partition_management() const alter_info.flags == ALTER_REORGANIZE_PARTITION)); } - #ifdef MYSQL_SERVER uint binlog_unsafe_map[256]; diff --git a/sql/sql_load.cc b/sql/sql_load.cc index 33d1741b5ec..98031c96225 100644 --- a/sql/sql_load.cc +++ b/sql/sql_load.cc @@ -39,6 +39,7 @@ #include "sp_head.h" #include "sql_trigger.h" #include "sql_derived.h" +#include "sql_show.h" class XML_TAG { public: @@ -675,24 +676,28 @@ static bool write_execute_load_query_log_event(THD *thd, sql_exchange* ex, bool transactional_table, int errcode) { - char *load_data_query, - *end, - *fname_start, - *fname_end, - *p= NULL; - size_t pl= 0; + char *load_data_query; + my_off_t fname_start, + fname_end; List<Item> fv; Item *item, *val; int n; - const char *tbl= table_name_arg; const char *tdb= (thd->db != NULL ? thd->db : db_arg); - char name_buffer[SAFE_NAME_LEN*2]; + const char *qualify_db= NULL; char command_buffer[1024]; - String string_buf(name_buffer, sizeof(name_buffer), - system_charset_info); - String pfields(command_buffer, sizeof(command_buffer), + String query_str(command_buffer, sizeof(command_buffer), system_charset_info); + Load_log_event lle(thd, ex, tdb, table_name_arg, fv, is_concurrent, + duplicates, ignore, transactional_table); + + /* + force in a LOCAL if there was one in the original. + */ + if (thd->lex->local_file) + lle.set_fname_outside_temp_buf(ex->file_name, strlen(ex->file_name)); + + query_str.length(0); if (!thd->db || strcmp(db_arg, thd->db)) { /* @@ -700,49 +705,35 @@ static bool write_execute_load_query_log_event(THD *thd, sql_exchange* ex, prefix table name with database name so that it becomes a FQ name. */ - string_buf.length(0); - string_buf.append(db_arg); - string_buf.append("`"); - string_buf.append("."); - string_buf.append("`"); - string_buf.append(table_name_arg); - tbl= string_buf.c_ptr_safe(); + qualify_db= db_arg; } - - Load_log_event lle(thd, ex, tdb, tbl, fv, is_concurrent, - duplicates, ignore, transactional_table); - - /* - force in a LOCAL if there was one in the original. - */ - if (thd->lex->local_file) - lle.set_fname_outside_temp_buf(ex->file_name, strlen(ex->file_name)); + lle.print_query(thd, FALSE, (const char *) ex->cs?ex->cs->csname:NULL, + &query_str, &fname_start, &fname_end, qualify_db); /* prepare fields-list and SET if needed; print_query won't do that for us. */ - pfields.length(0); if (!thd->lex->field_list.is_empty()) { List_iterator<Item> li(thd->lex->field_list); - pfields.append(" ("); + query_str.append(" ("); n= 0; while ((item= li++)) { if (n++) - pfields.append(", "); + query_str.append(", "); if (item->type() == Item::FIELD_ITEM) + append_identifier(thd, &query_str, item->name, strlen(item->name)); + else { - pfields.append("`"); - pfields.append(item->name); - pfields.append("`"); + /* Actually Item_user_var_as_out_param despite claiming STRING_ITEM. */ + DBUG_ASSERT(item->type() == Item::STRING_ITEM); + ((Item_user_var_as_out_param *)item)->print_for_load(thd, &query_str); } - else - item->print(&pfields, QT_ORDINARY); } - pfields.append(")"); + query_str.append(")"); } if (!thd->lex->update_list.is_empty()) @@ -750,38 +741,25 @@ static bool write_execute_load_query_log_event(THD *thd, sql_exchange* ex, List_iterator<Item> lu(thd->lex->update_list); List_iterator<Item> lv(thd->lex->value_list); - pfields.append(" SET "); + query_str.append(" SET "); n= 0; while ((item= lu++)) { val= lv++; if (n++) - pfields.append(", "); - pfields.append("`"); - pfields.append(item->name); - pfields.append("`"); - pfields.append(val->name); + query_str.append(", "); + append_identifier(thd, &query_str, item->name, strlen(item->name)); + query_str.append(val->name); } } - p= pfields.c_ptr_safe(); - pl= pfields.length(); - - if (!(load_data_query= (char *)thd->alloc(lle.get_query_buffer_length() + 1 + pl))) + if (!(load_data_query= (char *)thd->strmake(query_str.ptr(), query_str.length()))) return TRUE; - lle.print_query(FALSE, (const char *) ex->cs?ex->cs->csname:NULL, - load_data_query, &end, - (char **)&fname_start, (char **)&fname_end); - - strcpy(end, p); - end += pl; - Execute_load_query_log_event - e(thd, load_data_query, end-load_data_query, - (uint) ((char*) fname_start - load_data_query - 1), - (uint) ((char*) fname_end - load_data_query), + e(thd, load_data_query, query_str.length(), + (uint) (fname_start - 1), (uint) fname_end, (duplicates == DUP_REPLACE) ? LOAD_DUP_REPLACE : (ignore ? LOAD_DUP_IGNORE : LOAD_DUP_ERROR), transactional_table, FALSE, FALSE, errcode); diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index e77ae68a5de..6f157c89ee2 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -1325,7 +1325,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd, { STATUS_VAR *current_global_status_var; // Big; Don't allocate on stack ulong uptime; - uint __attribute__((unused)) length; + uint length __attribute__((unused)); ulonglong queries_per_second1000; char buff[250]; uint buff_len= sizeof(buff); diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc index a9c79589faa..2bec12e4f66 100644 --- a/sql/sql_partition.cc +++ b/sql/sql_partition.cc @@ -5500,10 +5500,12 @@ static bool mysql_change_partitions(ALTER_PARTITION_PARAM_TYPE *lpt) build_table_filename(path, sizeof(path) - 1, lpt->db, lpt->table_name, "", 0); - if(mysql_trans_prepare_alter_copy_data(thd)) + /* First lock the original tables */ + if (file->ha_external_lock(thd, F_WRLCK)) DBUG_RETURN(TRUE); - if (file->ha_external_lock(thd, F_WRLCK)) + /* Disable transactions for all new tables */ + if (mysql_trans_prepare_alter_copy_data(thd)) DBUG_RETURN(TRUE); /* TODO: test if bulk_insert would increase the performance */ diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc index 1059103086a..f19b8ca26ef 100644 --- a/sql/sql_plugin.cc +++ b/sql/sql_plugin.cc @@ -907,7 +907,7 @@ bool plugin_is_ready(const LEX_STRING *name, int type) } -SHOW_COMP_OPTION plugin_status(const char *name, int len, size_t type) +SHOW_COMP_OPTION plugin_status(const char *name, size_t len, int type) { LEX_STRING plugin_name= { (char *) name, len }; return plugin_status(&plugin_name, type); diff --git a/sql/sql_plugin.h b/sql/sql_plugin.h index eaa368f3515..be1cfcdcc4f 100644 --- a/sql/sql_plugin.h +++ b/sql/sql_plugin.h @@ -1,5 +1,5 @@ -/* - Copyright (c) 2005, 2010, Oracle and/or its affiliates. +/* Copyright (c) 2005, 2012, Oracle and/or its affiliates. + Copyright (c) 2009, 2012, Monty Program Ab This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -165,7 +165,7 @@ extern bool mysql_uninstall_plugin(THD *thd, const LEX_STRING *name, extern bool plugin_register_builtin(struct st_mysql_plugin *plugin); extern void plugin_thdvar_init(THD *thd); extern void plugin_thdvar_cleanup(THD *thd); -extern SHOW_COMP_OPTION plugin_status(const char *name, int len, size_t type); +extern SHOW_COMP_OPTION plugin_status(const char *name, size_t len, int type); extern bool check_valid_path(const char *path, size_t length); typedef my_bool (plugin_foreach_func)(THD *thd, diff --git a/sql/sql_profile.cc b/sql/sql_profile.cc index b3348698a35..2d00a19870b 100644 --- a/sql/sql_profile.cc +++ b/sql/sql_profile.cc @@ -1,5 +1,5 @@ -/* Copyright (c) 2007, 2011, Oracle and/or its affiliates. - Copyright (c) 2008, 2011, Monty Program Ab +/* Copyright (c) 2007, 2012, Oracle and/or its affiliates. + Copyright (c) 2008, 2012, Monty Program Ab This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -88,8 +88,8 @@ ST_FIELD_INFO query_profile_statistics_info[]= int make_profile_table_for_show(THD *thd, ST_SCHEMA_TABLE *schema_table) { - int profile_options = thd->lex->profile_options; - int fields_include_condition_truth_values[]= { + uint profile_options = thd->lex->profile_options; + uint fields_include_condition_truth_values[]= { FALSE, /* Query_id */ FALSE, /* Seq */ TRUE, /* Status */ diff --git a/sql/sql_profile.h b/sql/sql_profile.h index 2e93912fb25..7705f6ca476 100644 --- a/sql/sql_profile.h +++ b/sql/sql_profile.h @@ -287,5 +287,5 @@ public: int fill_statistics_info(THD *thd, TABLE_LIST *tables, Item *cond); }; -# endif /* HAVE_PROFILING */ +# endif /* ENABLED_PROFILING */ #endif /* _SQL_PROFILE_H */ diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc index fafa7a4389e..53ac103dda1 100644 --- a/sql/sql_repl.cc +++ b/sql/sql_repl.cc @@ -1,5 +1,5 @@ /* Copyright (c) 2000, 2012, Oracle and/or its affiliates. - Copyright (c) 2008, 2011, Monty Program Ab + Copyright (c) 2008, 2012, Monty Program Ab This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -653,7 +653,8 @@ void mysql_binlog_send(THD* thd, char* log_ident, my_off_t pos, heartbeat_ts= &heartbeat_buf; set_timespec_nsec(*heartbeat_ts, 0); } - sql_print_information("Start binlog_dump to slave_server(%d), pos(%s, %lu)", + if (global_system_variables.log_warnings > 1) + sql_print_information("Start binlog_dump to slave_server(%d), pos(%s, %lu)", thd->server_id, log_ident, (ulong)pos); if (RUN_HOOK(binlog_transmit, transmit_start, (thd, flags, log_ident, pos))) { @@ -765,7 +766,7 @@ impossible position"; this larger than the corresponding packet (query) sent from client to master. */ - thd->variables.max_allowed_packet+= MAX_LOG_EVENT_HEADER; + thd->variables.max_allowed_packet= MAX_MAX_ALLOWED_PACKET; /* We can set log_lock now, it does not move (it's a member of @@ -1999,7 +2000,7 @@ bool mysql_show_binlog_events(THD* thd) description_event->checksum_alg= ev->checksum_alg; if (event_count >= limit_start && - ev->net_send(protocol, linfo.log_file_name, pos)) + ev->net_send(thd, protocol, linfo.log_file_name, pos)) { errmsg = "Net error"; delete ev; diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 0c1fb07d761..22a680b6eab 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -271,8 +271,11 @@ Item_equal *find_item_equal(COND_EQUAL *cond_equal, Field *field, bool *inherited_fl); JOIN_TAB *first_depth_first_tab(JOIN* join); JOIN_TAB *next_depth_first_tab(JOIN* join, JOIN_TAB* tab); -JOIN_TAB *first_breadth_first_tab(JOIN *join); -JOIN_TAB *next_breadth_first_tab(JOIN *join, JOIN_TAB *tab); + +enum enum_exec_or_opt {WALK_OPTIMIZATION_TABS , WALK_EXECUTION_TABS}; +JOIN_TAB *first_breadth_first_tab(JOIN *join, enum enum_exec_or_opt tabs_kind); +JOIN_TAB *next_breadth_first_tab(JOIN *join, enum enum_exec_or_opt tabs_kind, + JOIN_TAB *tab); /** This handles SELECT with and without UNION. @@ -715,6 +718,8 @@ JOIN::prepare(Item ***rref_pointer_array, if (having) { + Query_arena backup, *arena; + arena= thd->activate_stmt_arena_if_needed(&backup); nesting_map save_allow_sum_func= thd->lex->allow_sum_func; thd->where="having clause"; thd->lex->allow_sum_func|= 1 << select_lex_arg->nest_level; @@ -730,6 +735,10 @@ JOIN::prepare(Item ***rref_pointer_array, (having->fix_fields(thd, &having) || having->check_cols(1))); select_lex->having_fix_field= 0; + select_lex->having= having; + if (arena) + thd->restore_active_arena(arena, &backup); + if (having_fix_rc || thd->is_error()) DBUG_RETURN(-1); /* purecov: inspected */ thd->lex->allow_sum_func= save_allow_sum_func; @@ -6403,8 +6412,7 @@ greedy_search(JOIN *join, POSITION best_pos; JOIN_TAB *best_table; // the next plan node to be added to the curr QEP // ==join->tables or # tables in the sj-mat nest we're optimizing - uint __attribute__((unused)) n_tables; - + uint n_tables __attribute__((unused)); DBUG_ENTER("greedy_search"); /* number of tables that remain to be optimized */ @@ -6643,12 +6651,12 @@ double JOIN::get_examined_rows() { ha_rows examined_rows; double prev_fanout= 1; - JOIN_TAB *tab= first_breadth_first_tab(this); + JOIN_TAB *tab= first_breadth_first_tab(this, WALK_OPTIMIZATION_TABS); JOIN_TAB *prev_tab= tab; examined_rows= tab->get_examined_rows(); - while ((tab= next_breadth_first_tab(this, tab))) + while ((tab= next_breadth_first_tab(this, WALK_OPTIMIZATION_TABS, tab))) { prev_fanout *= prev_tab->records_read; examined_rows+= (ha_rows) (tab->get_examined_rows() * prev_fanout); @@ -7263,23 +7271,30 @@ prev_record_reads(POSITION *positions, uint idx, table_map found_ref) Enumerate join tabs in breadth-first fashion, including const tables. */ -JOIN_TAB *first_breadth_first_tab(JOIN *join) +JOIN_TAB *first_breadth_first_tab(JOIN *join, enum enum_exec_or_opt tabs_kind) { - return join->join_tab; /* There's always one (i.e. first) table */ + /* There's always one (i.e. first) table */ + return (tabs_kind == WALK_EXECUTION_TABS)? join->join_tab: + join->table_access_tabs; } -JOIN_TAB *next_breadth_first_tab(JOIN *join, JOIN_TAB *tab) +JOIN_TAB *next_breadth_first_tab(JOIN *join, enum enum_exec_or_opt tabs_kind, + JOIN_TAB *tab) { + JOIN_TAB* const first_top_tab= first_breadth_first_tab(join, tabs_kind); + const uint n_top_tabs_count= (tabs_kind == WALK_EXECUTION_TABS)? + join->top_join_tab_count: + join->top_table_access_tabs_count; if (!tab->bush_root_tab) { /* We're at top level. Get the next top-level tab */ tab++; - if (tab < join->join_tab + join->top_join_tab_count) + if (tab < first_top_tab + n_top_tabs_count) return tab; /* No more top-level tabs. Switch to enumerating SJM nest children */ - tab= join->join_tab; + tab= first_top_tab; } else { @@ -7303,7 +7318,7 @@ JOIN_TAB *next_breadth_first_tab(JOIN *join, JOIN_TAB *tab) Ok, "tab" points to a top-level table, and we need to find the next SJM nest and enter it. */ - for (; tab < join->join_tab + join->top_join_tab_count; tab++) + for (; tab < first_top_tab + n_top_tabs_count; tab++) { if (tab->bush_children) return tab->bush_children->start; @@ -7327,7 +7342,7 @@ JOIN_TAB *first_top_level_tab(JOIN *join, enum enum_with_const_tables with_const JOIN_TAB *next_top_level_tab(JOIN *join, JOIN_TAB *tab) { - tab= next_breadth_first_tab(join, tab); + tab= next_breadth_first_tab(join, WALK_EXECUTION_TABS, tab); if (tab && tab->bush_root_tab) tab= NULL; return tab; @@ -7627,6 +7642,12 @@ get_best_combination(JOIN *join) join->top_join_tab_count= join->join_tab_ranges.head()->end - join->join_tab_ranges.head()->start; + /* + Save pointers to select join tabs for SHOW EXPLAIN + */ + join->table_access_tabs= join->join_tab; + join->top_table_access_tabs_count= join->top_join_tab_count; + update_depend_map(join); DBUG_RETURN(0); } @@ -10521,7 +10542,7 @@ void JOIN::join_free() Optimization: if not EXPLAIN and we are done with the JOIN, free all tables. */ - bool full= !(select_lex->uncacheable); + bool full= !(select_lex->uncacheable) && !(thd->lex->describe); bool can_unlock= full; DBUG_ENTER("JOIN::join_free"); @@ -11882,9 +11903,9 @@ static int compare_fields_by_table_order(Item *field1, bool outer_ref= 0; Item_field *f1= (Item_field *) (field1->real_item()); Item_field *f2= (Item_field *) (field2->real_item()); - if (f1->const_item()) + if (field1->const_item() || f1->const_item()) return 1; - if (f2->const_item()) + if (field2->const_item() || f2->const_item()) return -1; if (f2->used_tables() & OUTER_REF_TABLE_BIT) { @@ -16455,10 +16476,11 @@ int report_error(TABLE *table, int error) Locking reads can legally return also these errors, do not print them to the .err log */ - if (error != HA_ERR_LOCK_DEADLOCK && error != HA_ERR_LOCK_WAIT_TIMEOUT) + if (error != HA_ERR_LOCK_DEADLOCK && error != HA_ERR_LOCK_WAIT_TIMEOUT + && !table->in_use->killed) { push_warning_printf(table->in_use, MYSQL_ERROR::WARN_LEVEL_WARN, error, - "Got error %d when reading table `%s`.`%s`", + "Got error %d when reading table %`s.%`s", error, table->s->db.str, table->s->table_name.str); sql_print_error("Got error %d when reading table '%s'", error, table->s->path.str); @@ -18862,6 +18884,14 @@ create_sort_index(THD *thd, JOIN *join, ORDER *order, /* Currently ORDER BY ... LIMIT is not supported in subqueries. */ DBUG_ASSERT(join->group_list || !join->is_in_subquery()); + /* + If we have a select->quick object that is created outside of + create_sort_index() and this is part of a subquery that + potentially can be executed multiple times then we should not + delete the quick object on exit from this function. + */ + bool keep_quick= select && select->quick && join->join_tab_save; + /* When there is SQL_BIG_RESULT do not sort using index for GROUP BY, and thus force sorting on disk unless a group min-max optimization @@ -18913,6 +18943,7 @@ create_sort_index(THD *thd, JOIN *join, ORDER *order, get_quick_select_for_ref(thd, table, &tab->ref, tab->found_records)))) goto err; + DBUG_ASSERT(!keep_quick); } } @@ -18945,9 +18976,26 @@ create_sort_index(THD *thd, JOIN *join, ORDER *order, tablesort_result_cache= table->sort.io_cache; table->sort.io_cache= NULL; - select->cleanup(); // filesort did select - table->quick_keys.clear_all(); // as far as we cleanup select->quick - table->intersect_keys.clear_all(); + /* + If a quick object was created outside of create_sort_index() + that might be reused, then do not call select->cleanup() since + it will delete the quick object. + */ + if (!keep_quick) + { + select->cleanup(); + /* + The select object should now be ready for the next use. If it + is re-used then there exists a backup copy of this join tab + which has the pointer to it. The join tab will be restored in + JOIN::reset(). So here we just delete the pointer to it. + */ + tab->select= NULL; + // If we deleted the quick select object we need to clear quick_keys + table->quick_keys.clear_all(); + table->intersect_keys.clear_all(); + } + // Restore the output resultset table->sort.io_cache= tablesort_result_cache; } tab->set_select_cond(NULL, __LINE__); @@ -21356,8 +21404,8 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order, bool printing_materialize_nest= FALSE; uint select_id= join->select_lex->select_number; - for (JOIN_TAB *tab= first_breadth_first_tab(join); tab; - tab= next_breadth_first_tab(join, tab)) + for (JOIN_TAB *tab= first_breadth_first_tab(join, WALK_OPTIMIZATION_TABS); tab; + tab= next_breadth_first_tab(join, WALK_OPTIMIZATION_TABS, tab)) { if (tab->bush_root_tab) { @@ -21440,16 +21488,8 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order, else { TABLE_LIST *real_table= table->pos_in_table_list; - /* - Internal temporary tables have no corresponding table reference - object. Such a table may appear in EXPLAIN when a subquery that needs - a temporary table has been executed, and JOIN::exec replaced the - original JOIN with a plan to access the data in the temp table - (made by JOIN::make_simple_join). - */ - const char *tab_name= real_table ? real_table->alias : - "internal_tmp_table"; - item_list.push_back(new Item_string(tab_name, strlen(tab_name), cs)); + item_list.push_back(new Item_string(real_table->alias, + strlen(real_table->alias), cs)); } /* "partitions" column */ if (join->thd->lex->describe & DESCRIBE_PARTITIONS) @@ -21539,11 +21579,6 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order, length= (longlong10_to_str(key_len, keylen_str_buf, 10) - keylen_str_buf); tmp3.append(keylen_str_buf, length, cs); -/*<<<<<<< TREE - } - if ((is_hj || tab->type==JT_RANGE || tab->type == JT_INDEX_MERGE) && - tab->select && tab->select->quick) -=======*/ } if (tab->type != JT_CONST && tab->select && tab->select->quick) tab->select->quick->add_keys_and_lengths(&tmp2, &tmp3); diff --git a/sql/sql_select.h b/sql/sql_select.h index 0ed976ac36a..be5f523a7e2 100644 --- a/sql/sql_select.h +++ b/sql/sql_select.h @@ -897,6 +897,19 @@ protected: public: JOIN_TAB *join_tab, **best_ref; + + /* + For "Using temporary+Using filesort" queries, JOIN::join_tab can point to + either: + 1. array of join tabs describing how to run the select, or + 2. array of single join tab describing read from the temporary table. + + SHOW EXPLAIN code needs to read/show #1. This is why two next members are + there for saving it. + */ + JOIN_TAB *table_access_tabs; + uint top_table_access_tabs_count; + JOIN_TAB **map2table; ///< mapping between table indexes and JOIN_TABs JOIN_TAB *join_tab_save; ///< saved join_tab for subquery reexecution diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 1e2ed90e1b7..8a106b8ec6f 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -660,6 +660,7 @@ public: break; case ER_NO_SUCH_TABLE: + case ER_NO_SUCH_TABLE_IN_ENGINE: /* Established behavior: warn if underlying tables are missing. */ push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN, ER_VIEW_INVALID, @@ -992,9 +993,13 @@ static const char *require_quotes(const char *name, uint name_length) packet target string name the identifier to be appended name_length length of the appending identifier + + RETURN VALUES + true Error + false Ok */ -void +bool append_identifier(THD *thd, String *packet, const char *name, uint length) { const char *name_end; @@ -1002,10 +1007,7 @@ append_identifier(THD *thd, String *packet, const char *name, uint length) int q= get_quote_char_for_identifier(thd, name, length); if (q == EOF) - { - packet->append(name, length, packet->charset()); - return; - } + return packet->append(name, length, packet->charset()); /* The identifier must be quoted as it includes a quote character or @@ -1014,7 +1016,8 @@ append_identifier(THD *thd, String *packet, const char *name, uint length) (void) packet->reserve(length*2 + 2); quote_char= (char) q; - packet->append("e_char, 1, system_charset_info); + if (packet->append("e_char, 1, system_charset_info)) + return true; for (name_end= name+length ; name < name_end ; name+= length) { @@ -1029,11 +1032,13 @@ append_identifier(THD *thd, String *packet, const char *name, uint length) */ if (!length) length= 1; - if (length == 1 && chr == (uchar) quote_char) - packet->append("e_char, 1, system_charset_info); - packet->append(name, length, system_charset_info); + if (length == 1 && chr == (uchar) quote_char && + packet->append("e_char, 1, system_charset_info)) + return true; + if (packet->append(name, length, system_charset_info)) + return true; } - packet->append("e_char, 1, system_charset_info); + return packet->append("e_char, 1, system_charset_info); } @@ -3225,9 +3230,12 @@ int make_db_list(THD *thd, List<LEX_STRING> *files, /* If we have db lookup vaule we just add it to list and - exit from the function + exit from the function. + We don't do this for database names longer than the maximum + path length. */ - if (lookup_field_vals->db_value.str) + if (lookup_field_vals->db_value.str && + lookup_field_vals->db_value.length < FN_REFLEN) { if (is_infoschema_db(lookup_field_vals->db_value.str, lookup_field_vals->db_value.length)) diff --git a/sql/sql_show.h b/sql/sql_show.h index 8ad9327c08c..611e3a64c73 100644 --- a/sql/sql_show.h +++ b/sql/sql_show.h @@ -90,7 +90,7 @@ int view_store_create_info(THD *thd, TABLE_LIST *table, String *buff); int copy_event_to_schema_table(THD *thd, TABLE *sch_table, TABLE *event_table); -void append_identifier(THD *thd, String *packet, const char *name, +bool append_identifier(THD *thd, String *packet, const char *name, uint length); void mysqld_list_fields(THD *thd,TABLE_LIST *table, const char *wild); int mysqld_dump_create_info(THD *thd, TABLE_LIST *table_list, int fd); diff --git a/sql/sql_string.cc b/sql/sql_string.cc index c4f5f315b08..75029a03790 100644 --- a/sql/sql_string.cc +++ b/sql/sql_string.cc @@ -1121,39 +1121,47 @@ outp: - -void String::print(String *str) +/* + Append characters to a single-quoted string '...', escaping special + characters as necessary. + Does not add the enclosing quotes, this is left up to caller. +*/ +void String::append_for_single_quote(const char *st, uint len) { - char *st= (char*)Ptr, *end= st+str_length; + const char *end= st+len; for (; st < end; st++) { uchar c= *st; switch (c) { case '\\': - str->append(STRING_WITH_LEN("\\\\")); + append(STRING_WITH_LEN("\\\\")); break; case '\0': - str->append(STRING_WITH_LEN("\\0")); + append(STRING_WITH_LEN("\\0")); break; case '\'': - str->append(STRING_WITH_LEN("\\'")); + append(STRING_WITH_LEN("\\'")); break; case '\n': - str->append(STRING_WITH_LEN("\\n")); + append(STRING_WITH_LEN("\\n")); break; case '\r': - str->append(STRING_WITH_LEN("\\r")); + append(STRING_WITH_LEN("\\r")); break; case '\032': // Ctrl-Z - str->append(STRING_WITH_LEN("\\Z")); + append(STRING_WITH_LEN("\\Z")); break; default: - str->append(c); + append(c); } } } +void String::print(String *str) +{ + str->append_for_single_quote(Ptr, str_length); +} /* Exchange state of this object and argument. diff --git a/sql/sql_string.h b/sql/sql_string.h index 86af507918c..2f0cd9103dc 100644 --- a/sql/sql_string.h +++ b/sql/sql_string.h @@ -459,6 +459,7 @@ public: return FALSE; } void print(String *print); + void append_for_single_quote(const char *st, uint len); /* Swap two string objects. Efficient way to exchange data without memcpy. */ void swap(String &s); diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 031932b4c06..f01c367fd55 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -163,6 +163,13 @@ static char* add_identifier(THD* thd, char *to_p, const char * end_p, diagnostic, error etc. when it would be useful to know what a particular file [and directory] means. Such as SHOW ENGINE STATUS, error messages etc. + Examples: + + t1#P#p1 table t1 partition p1 + t1#P#p1#SP#sp1 table t1 partition p1 subpartition sp1 + t1#P#p1#SP#sp1#TMP# table t1 partition p1 subpartition sp1 temporary + t1#P#p1#SP#sp1#REN# table t1 partition p1 subpartition sp1 renamed + @param thd Thread handle @param from Path name in my_charset_filename Null terminated in my_charset_filename, normalized @@ -201,7 +208,7 @@ uint explain_filename(THD* thd, int part_name_len= 0; const char *subpart_name= NULL; int subpart_name_len= 0; - enum enum_file_name_type {NORMAL, TEMP, RENAMED} name_type= NORMAL; + uint name_variant= NORMAL_PART_NAME; const char *tmp_p; DBUG_ENTER("explain_filename"); DBUG_PRINT("enter", ("from '%s'", from)); @@ -244,7 +251,6 @@ uint explain_filename(THD* thd, (tmp_p[2] == 'L' || tmp_p[2] == 'l') && tmp_p[3] == '-') { - name_type= TEMP; tmp_p+= 4; /* sql- prefix found */ } else @@ -255,7 +261,7 @@ uint explain_filename(THD* thd, if ((tmp_p[1] == 'M' || tmp_p[1] == 'm') && (tmp_p[2] == 'P' || tmp_p[2] == 'p') && tmp_p[3] == '#' && !tmp_p[4]) - name_type= TEMP; + name_variant= TEMP_PART_NAME; else res= 3; tmp_p+= 4; @@ -265,7 +271,7 @@ uint explain_filename(THD* thd, if ((tmp_p[1] == 'E' || tmp_p[1] == 'e') && (tmp_p[2] == 'N' || tmp_p[2] == 'n') && tmp_p[3] == '#' && !tmp_p[4]) - name_type= RENAMED; + name_variant= RENAMED_PART_NAME; else res= 4; tmp_p+= 4; @@ -290,7 +296,7 @@ uint explain_filename(THD* thd, subpart_name_len= strlen(subpart_name); else part_name_len= strlen(part_name); - if (name_type != NORMAL) + if (name_variant != NORMAL_PART_NAME) { if (subpart_name) subpart_name_len-= 5; @@ -332,9 +338,9 @@ uint explain_filename(THD* thd, to_p= strnmov(to_p, " ", end_p - to_p); else to_p= strnmov(to_p, ", ", end_p - to_p); - if (name_type != NORMAL) + if (name_variant != NORMAL_PART_NAME) { - if (name_type == TEMP) + if (name_variant == TEMP_PART_NAME) to_p= strnmov(to_p, ER_THD_OR_DEFAULT(thd, ER_TEMPORARY_NAME), end_p - to_p); else @@ -1944,6 +1950,50 @@ bool mysql_rm_table(THD *thd,TABLE_LIST *tables, my_bool if_exists, /** + Find the comment in the query. + That's auxiliary function to be used handling DROP TABLE [comment]. + + @param thd Thread handler + @param comment_pos How many characters to skip before the comment. + Can be either 9 for DROP TABLE or + 17 for DROP TABLE IF EXISTS + @param comment_start returns the beginning of the comment if found. + + @retval 0 no comment found + @retval >0 the lenght of the comment found + +*/ +static uint32 comment_length(THD *thd, uint32 comment_pos, + const char **comment_start) +{ + /* We use uchar * here to make array indexing portable */ + const uchar *query= (uchar*) thd->query(); + const uchar *query_end= (uchar*) query + thd->query_length(); + const uchar *const state_map= thd->charset()->state_map; + + for (; query < query_end; query++) + { + if (state_map[static_cast<uchar>(*query)] == MY_LEX_SKIP) + continue; + if (comment_pos-- == 0) + break; + } + if (query > query_end - 3 /* comment can't be shorter than 4 */ || + state_map[static_cast<uchar>(*query)] != MY_LEX_LONG_COMMENT || query[1] != '*') + return 0; + + *comment_start= (char*) query; + + for (query+= 3; query < query_end; query++) + { + if (query[-1] == '*' && query[0] == '/') + return (char*) query - *comment_start + 1; + } + return 0; +} + + +/** Execute the drop of a normal or temporary table. @param thd Thread handler @@ -2018,11 +2068,20 @@ int mysql_rm_table_no_locks(THD *thd, TABLE_LIST *tables, bool if_exists, { if (!drop_temporary) { + const char *comment_start; + uint32 comment_len; + built_query.set_charset(system_charset_info); if (if_exists) built_query.append("DROP TABLE IF EXISTS "); else built_query.append("DROP TABLE "); + + if ((comment_len= comment_length(thd, if_exists ? 17:9, &comment_start))) + { + built_query.append(comment_start, comment_len); + built_query.append(" "); + } } if (thd->is_current_stmt_binlog_format_row() || if_exists) @@ -2045,6 +2104,7 @@ int mysql_rm_table_no_locks(THD *thd, TABLE_LIST *tables, bool if_exists, { bool is_trans; char *db=table->db; + size_t db_length= table->db_length; handlerton *table_type; enum legacy_db_type frm_db_type= DB_TYPE_UNKNOWN; @@ -2106,14 +2166,14 @@ int mysql_rm_table_no_locks(THD *thd, TABLE_LIST *tables, bool if_exists, Don't write the database name if it is the current one (or if thd->db is NULL). */ - built_ptr_query->append("`"); if (thd->db == NULL || strcmp(db,thd->db) != 0) { - built_ptr_query->append(db); - built_ptr_query->append("`.`"); + append_identifier(thd, built_ptr_query, db, db_length); + built_ptr_query->append("."); } - built_ptr_query->append(table->table_name); - built_ptr_query->append("`,"); + append_identifier(thd, built_ptr_query, table->table_name, + table->table_name_length); + built_ptr_query->append(","); } /* This means that a temporary table was droped and as such there @@ -2128,7 +2188,7 @@ int mysql_rm_table_no_locks(THD *thd, TABLE_LIST *tables, bool if_exists, if (thd->locked_tables_mode) { - if (wait_while_table_is_used(thd, table->table, HA_EXTRA_FORCE_REOPEN)) + if (wait_while_table_is_used(thd, table->table, HA_EXTRA_NOT_USED)) { error= -1; goto err; @@ -2169,15 +2229,15 @@ int mysql_rm_table_no_locks(THD *thd, TABLE_LIST *tables, bool if_exists, Don't write the database name if it is the current one (or if thd->db is NULL). */ - built_query.append("`"); if (thd->db == NULL || strcmp(db,thd->db) != 0) { - built_query.append(db); - built_query.append("`.`"); + append_identifier(thd, &built_query, db, db_length); + built_query.append("."); } - built_query.append(table->table_name); - built_query.append("`,"); + append_identifier(thd, &built_query, table->table_name, + table->table_name_length); + built_query.append(","); } } DEBUG_SYNC(thd, "rm_table_no_locks_before_delete_table"); @@ -6044,8 +6104,26 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name, } else { + MDL_request_list mdl_requests; + MDL_request target_db_mdl_request; + target_mdl_request.init(MDL_key::TABLE, new_db, new_name, MDL_EXCLUSIVE, MDL_TRANSACTION); + mdl_requests.push_front(&target_mdl_request); + + /* + If we are moving the table to a different database, we also + need IX lock on the database name so that the target database + is protected by MDL while the table is moved. + */ + if (new_db != db) + { + target_db_mdl_request.init(MDL_key::SCHEMA, new_db, "", + MDL_INTENTION_EXCLUSIVE, + MDL_TRANSACTION); + mdl_requests.push_front(&target_db_mdl_request); + } + /* Global intention exclusive lock must have been already acquired when table to be altered was open, so there is no need to do it here. @@ -6054,14 +6132,10 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name, "", "", MDL_INTENTION_EXCLUSIVE)); - if (thd->mdl_context.try_acquire_lock(&target_mdl_request)) + if (thd->mdl_context.acquire_locks(&mdl_requests, + thd->variables.lock_wait_timeout)) DBUG_RETURN(TRUE); - if (target_mdl_request.ticket == NULL) - { - /* Table exists and is locked by some thread. */ - my_error(ER_TABLE_EXISTS_ERROR, MYF(0), new_alias); - DBUG_RETURN(TRUE); - } + DEBUG_SYNC(thd, "locked_table_name"); /* Table maybe does not exist, but we got an exclusive lock @@ -6487,11 +6561,23 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name, the primary key is not added and dropped in the same statement. Otherwise we have to recreate the table. need_copy_table is no-zero at this place. + + Also, in-place is not possible if we add a primary key + and drop another key in the same statement. If the drop fails, + we will not be able to revert adding of primary key. */ if ( pk_changed < 2 ) { - if ((alter_flags & needed_inplace_with_read_flags) == - needed_inplace_with_read_flags) + if ((needed_inplace_with_read_flags & HA_INPLACE_ADD_PK_INDEX_NO_WRITE) && + index_drop_count > 0) + { + /* + Do copy, not in-place ALTER. + Avoid setting ALTER_TABLE_METADATA_ONLY. + */ + } + else if ((alter_flags & needed_inplace_with_read_flags) == + needed_inplace_with_read_flags) { /* All required in-place flags to allow concurrent reads are present. */ need_copy_table= ALTER_TABLE_METADATA_ONLY; @@ -6769,17 +6855,38 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name, Tell the handler to prepare for drop indexes. This re-numbers the indexes to get rid of gaps. */ - if ((error= table->file->prepare_drop_index(table, key_numbers, - index_drop_count))) + error= table->file->prepare_drop_index(table, key_numbers, + index_drop_count); + if (!error) { - table->file->print_error(error, MYF(0)); - goto err_new_table_cleanup; + /* Tell the handler to finally drop the indexes. */ + error= table->file->final_drop_index(table); } - /* Tell the handler to finally drop the indexes. */ - if ((error= table->file->final_drop_index(table))) + if (error) { table->file->print_error(error, MYF(0)); + if (index_add_count) // Drop any new indexes added. + { + /* + Temporarily set table-key_info to include information about the + indexes added above that we now need to drop. + */ + KEY *save_key_info= table->key_info; + table->key_info= key_info_buffer; + if ((error= table->file->prepare_drop_index(table, index_add_buffer, + index_add_count))) + table->file->print_error(error, MYF(0)); + else if ((error= table->file->final_drop_index(table))) + table->file->print_error(error, MYF(0)); + table->key_info= save_key_info; + } + + /* + Mark this TABLE instance as stale to avoid + out-of-sync index information. + */ + table->m_needs_reopen= true; goto err_new_table_cleanup; } } @@ -7141,7 +7248,7 @@ err_with_mdl: bool mysql_trans_prepare_alter_copy_data(THD *thd) { - DBUG_ENTER("mysql_prepare_alter_copy_data"); + DBUG_ENTER("mysql_trans_prepare_alter_copy_data"); /* Turn off recovery logging since rollback of an alter table is to delete the new table so there is no need to log the changes to it. @@ -7161,7 +7268,7 @@ bool mysql_trans_prepare_alter_copy_data(THD *thd) bool mysql_trans_commit_alter_copy_data(THD *thd) { bool error= FALSE; - DBUG_ENTER("mysql_commit_alter_copy_data"); + DBUG_ENTER("mysql_trans_commit_alter_copy_data"); if (ha_enable_transaction(thd, TRUE)) DBUG_RETURN(TRUE); diff --git a/sql/sql_truncate.cc b/sql/sql_truncate.cc index 3c1b231d3f2..9d4ca5e1373 100644 --- a/sql/sql_truncate.cc +++ b/sql/sql_truncate.cc @@ -24,6 +24,7 @@ #include "sql_acl.h" // DROP_ACL #include "sql_parse.h" // check_one_table_access() #include "sql_truncate.h" +#include "sql_show.h" /** @@ -35,7 +36,8 @@ @return TRUE on failure, FALSE otherwise. */ -static bool fk_info_append_fields(String *str, List<LEX_STRING> *fields) +static bool fk_info_append_fields(THD *thd, String *str, + List<LEX_STRING> *fields) { bool res= FALSE; LEX_STRING *field; @@ -43,9 +45,8 @@ static bool fk_info_append_fields(String *str, List<LEX_STRING> *fields) while ((field= it++)) { - res|= str->append("`"); - res|= str->append(field); - res|= str->append("`, "); + res|= append_identifier(thd, str, field->str, field->length); + res|= str->append(", "); } str->chop(); @@ -76,20 +77,24 @@ static const char *fk_info_str(THD *thd, FOREIGN_KEY_INFO *fk_info) `db`.`tbl`, CONSTRAINT `id` FOREIGN KEY (`fk`) REFERENCES `db`.`tbl` (`fk`) */ - res|= str.append('`'); - res|= str.append(fk_info->foreign_db); - res|= str.append("`.`"); - res|= str.append(fk_info->foreign_table); - res|= str.append("`, CONSTRAINT `"); - res|= str.append(fk_info->foreign_id); - res|= str.append("` FOREIGN KEY ("); - res|= fk_info_append_fields(&str, &fk_info->foreign_fields); - res|= str.append(") REFERENCES `"); - res|= str.append(fk_info->referenced_db); - res|= str.append("`.`"); - res|= str.append(fk_info->referenced_table); - res|= str.append("` ("); - res|= fk_info_append_fields(&str, &fk_info->referenced_fields); + res|= append_identifier(thd, &str, fk_info->foreign_db->str, + fk_info->foreign_db->length); + res|= str.append("."); + res|= append_identifier(thd, &str, fk_info->foreign_table->str, + fk_info->foreign_table->length); + res|= str.append(", CONSTRAINT "); + res|= append_identifier(thd, &str, fk_info->foreign_id->str, + fk_info->foreign_id->length); + res|= str.append(" FOREIGN KEY ("); + res|= fk_info_append_fields(thd, &str, &fk_info->foreign_fields); + res|= str.append(") REFERENCES "); + res|= append_identifier(thd, &str, fk_info->referenced_db->str, + fk_info->referenced_db->length); + res|= str.append("."); + res|= append_identifier(thd, &str, fk_info->referenced_table->str, + fk_info->referenced_table->length); + res|= str.append(" ("); + res|= fk_info_append_fields(thd, &str, &fk_info->referenced_fields); res|= str.append(')'); return res ? NULL : thd->strmake(str.ptr(), str.length()); diff --git a/sql/sql_union.cc b/sql/sql_union.cc index 021267b53bd..8dcae907926 100644 --- a/sql/sql_union.cc +++ b/sql/sql_union.cc @@ -621,6 +621,8 @@ bool st_select_lex_unit::exec() if (executed && !uncacheable && !describe) DBUG_RETURN(FALSE); executed= 1; + if (!(uncacheable & ~UNCACHEABLE_EXPLAIN) && item) + item->make_const(); saved_error= optimize(); diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 4e3629080be..8ef59fafb98 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -5644,7 +5644,23 @@ type: $$= MYSQL_TYPE_VARCHAR; } | YEAR_SYM opt_field_length field_options - { $$=MYSQL_TYPE_YEAR; } + { + if (Lex->length) + { + errno= 0; + ulong length= strtoul(Lex->length, NULL, 10); + if (errno == 0 && length <= MAX_FIELD_BLOBLENGTH && length != 4) + { + char buff[sizeof("YEAR()") + MY_INT64_NUM_DECIMAL_DIGITS + 1]; + my_snprintf(buff, sizeof(buff), "YEAR(%lu)", length); + push_warning_printf(YYTHD, MYSQL_ERROR::WARN_LEVEL_NOTE, + ER_WARN_DEPRECATED_SYNTAX, + ER(ER_WARN_DEPRECATED_SYNTAX), + buff, "YEAR(4)"); + } + } + $$=MYSQL_TYPE_YEAR; + } | DATE_SYM { $$=MYSQL_TYPE_DATE; } | TIME_SYM opt_field_length @@ -12128,7 +12144,7 @@ load_data_set_elem: if (lex->update_list.push_back($1) || lex->value_list.push_back($4)) MYSQL_YYABORT; - $4->set_name($3, (uint) ($5 - $3), YYTHD->charset()); + $4->set_name_no_truncate($3, (uint) ($5 - $3), YYTHD->charset()); } ; diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc index 4df3773e5ce..fe48f953c28 100644 --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc @@ -47,7 +47,9 @@ #include "sql_base.h" // close_cached_tables #include <myisam.h> #include "log_slow.h" +#include "debug_sync.h" // DEBUG_SYNC +#include "log_event.h" #ifdef WITH_PERFSCHEMA_STORAGE_ENGINE #include "../storage/perfschema/pfs_server.h" #endif /* WITH_PERFSCHEMA_STORAGE_ENGINE */ @@ -1052,6 +1054,14 @@ static Sys_var_ulong Sys_max_allowed_packet( BLOCK_SIZE(1024), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(check_max_allowed_packet)); +static Sys_var_ulong Sys_slave_max_allowed_packet( + "slave_max_allowed_packet", + "The maximum packet length to sent successfully from the master to slave.", + GLOBAL_VAR(slave_max_allowed_packet), CMD_LINE(REQUIRED_ARG), + VALID_RANGE(1024, MAX_MAX_ALLOWED_PACKET), + DEFAULT(MAX_MAX_ALLOWED_PACKET), + BLOCK_SIZE(1024)); + static Sys_var_ulonglong Sys_max_binlog_cache_size( "max_binlog_cache_size", "Sets the total size of the transactional cache", @@ -3247,6 +3257,13 @@ bool Sys_var_rpl_filter::do_check(THD *thd, set_var *var) { bool status; + /* + We must not be holding LOCK_global_system_variables here, otherwise we can + deadlock with THD::init() which is invoked from within the slave threads + with opposite locking order. + */ + mysql_mutex_assert_not_owner(&LOCK_global_system_variables); + mysql_mutex_lock(&LOCK_active_mi); mysql_mutex_lock(&active_mi->rli.run_lock); @@ -3263,22 +3280,43 @@ bool Sys_var_rpl_filter::do_check(THD *thd, set_var *var) return status; } -bool Sys_var_rpl_filter::global_update(THD *thd, set_var *var) +void Sys_var_rpl_filter::lock(void) { - bool slave_running, status= false; + /* + Starting a slave thread causes the new thread to attempt to + acquire LOCK_global_system_variables (in THD::init) while + LOCK_active_mi is being held by the thread that initiated + the process. In order to not violate the lock order, unlock + LOCK_global_system_variables before grabbing LOCK_active_mi. + */ + mysql_mutex_unlock(&LOCK_global_system_variables); mysql_mutex_lock(&LOCK_active_mi); mysql_mutex_lock(&active_mi->rli.run_lock); +} - if (! (slave_running= active_mi->rli.slave_running)) - status= set_filter_value(var->save_result.string_value.str); - +void Sys_var_rpl_filter::unlock(void) +{ mysql_mutex_unlock(&active_mi->rli.run_lock); mysql_mutex_unlock(&LOCK_active_mi); + mysql_mutex_lock(&LOCK_global_system_variables); +} + +bool Sys_var_rpl_filter::global_update(THD *thd, set_var *var) +{ + bool slave_running, status= false; + + lock(); + + if (! (slave_running= active_mi->rli.slave_running)) + status= set_filter_value(var->save_result.string_value.str); + if (slave_running) my_error(ER_SLAVE_MUST_STOP, MYF(0)); + unlock(); + return slave_running || status; } @@ -3317,8 +3355,7 @@ uchar *Sys_var_rpl_filter::global_value_ptr(THD *thd, LEX_STRING *base) tmp.length(0); - mysql_mutex_lock(&LOCK_active_mi); - mysql_mutex_lock(&active_mi->rli.run_lock); + lock(); switch (opt_id) { case OPT_REPLICATE_DO_DB: @@ -3341,8 +3378,7 @@ uchar *Sys_var_rpl_filter::global_value_ptr(THD *thd, LEX_STRING *base) break; } - mysql_mutex_unlock(&active_mi->rli.run_lock); - mysql_mutex_unlock(&LOCK_active_mi); + unlock(); return (uchar *) thd->strmake(tmp.ptr(), tmp.length()); } @@ -3395,6 +3431,9 @@ static Sys_var_charptr Sys_slave_load_tmpdir( static bool fix_slave_net_timeout(sys_var *self, THD *thd, enum_var_type type) { + DEBUG_SYNC(thd, "fix_slave_net_timeout"); + + mysql_mutex_unlock(&LOCK_global_system_variables); mysql_mutex_lock(&LOCK_active_mi); DBUG_PRINT("info", ("slave_net_timeout=%u mi->heartbeat_period=%.3f", slave_net_timeout, @@ -3404,6 +3443,7 @@ static bool fix_slave_net_timeout(sys_var *self, THD *thd, enum_var_type type) ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MAX, ER(ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MAX)); mysql_mutex_unlock(&LOCK_active_mi); + mysql_mutex_lock(&LOCK_global_system_variables); return false; } static Sys_var_uint Sys_slave_net_timeout( @@ -3430,6 +3470,7 @@ static bool check_slave_skip_counter(sys_var *self, THD *thd, set_var *var) } static bool fix_slave_skip_counter(sys_var *self, THD *thd, enum_var_type type) { + mysql_mutex_unlock(&LOCK_global_system_variables); mysql_mutex_lock(&LOCK_active_mi); mysql_mutex_lock(&active_mi->rli.run_lock); /* @@ -3445,6 +3486,7 @@ static bool fix_slave_skip_counter(sys_var *self, THD *thd, enum_var_type type) } mysql_mutex_unlock(&active_mi->rli.run_lock); mysql_mutex_unlock(&LOCK_active_mi); + mysql_mutex_lock(&LOCK_global_system_variables); return 0; } static Sys_var_uint Sys_slave_skip_counter( diff --git a/sql/sys_vars.h b/sql/sys_vars.h index c680ce6ab51..21bebcd762c 100644 --- a/sql/sys_vars.h +++ b/sql/sys_vars.h @@ -588,6 +588,8 @@ public: protected: uchar *global_value_ptr(THD *thd, LEX_STRING *base); bool set_filter_value(const char *value); + void lock(void); + void unlock(void); }; /** @@ -957,7 +959,7 @@ public: Sys_var_max_user_conn(const char *name_arg, const char *comment, int flag_args, ptrdiff_t off, size_t size, CMD_LINE getopt, - int min_val, int max_val, uint def_val, + int min_val, int max_val, int def_val, uint block_size, PolyLock *lock=0, enum binlog_status_enum binlog_status_arg=VARIABLE_NOT_IN_BINLOG, on_check_function on_check_func=0, diff --git a/sql/table.cc b/sql/table.cc index 2a11098caed..d733c5ada62 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -4393,7 +4393,7 @@ bool TABLE_LIST::prep_check_option(THD *thd, uint8 check_opt_type) There are currently two mechanisms at work that handle errors for views, this one and a more general mechanism based on an Internal_error_handler, see Show_create_error_handler. The latter handles errors encountered during - execution of SHOW CREATE VIEW, while the machanism using this method is + execution of SHOW CREATE VIEW, while the mechanism using this method is handles SELECT from views. The two methods should not clash. @param[in,out] thd thread handler @@ -4544,7 +4544,14 @@ bool TABLE_LIST::check_single_table(TABLE_LIST **table_arg, tbl; tbl= tbl->next_local) { - if (tbl->table) + /* + Merged view has also temporary table attached (in 5.2 if it has table + then it was real table), so we have filter such temporary tables out + by checking that it is not merged view + */ + if (tbl->table && + !(tbl->is_view() && + tbl->is_merged_derived())) { if (tbl->table->map & map) { diff --git a/storage/archive/azio.c b/storage/archive/azio.c index 8fc85965cf0..92d7ad70344 100644 --- a/storage/archive/azio.c +++ b/storage/archive/azio.c @@ -39,6 +39,10 @@ void putLong(File file, uLong x); uLong getLong(azio_stream *s); void read_header(azio_stream *s, unsigned char *buffer); +#ifdef HAVE_PSI_INTERFACE +extern PSI_file_key arch_key_file_data; +#endif + /* =========================================================================== Opens a gzip (.gz) file for reading or writing. The mode parameter is as in fopen ("rb" or "wb"). The file is given either by file descriptor @@ -115,7 +119,7 @@ int az_open (azio_stream *s, const char *path, int Flags, File fd) s->stream.avail_out = AZ_BUFSIZE_WRITE; errno = 0; - s->file = fd < 0 ? my_open(path, Flags, MYF(0)) : fd; + s->file = fd < 0 ? mysql_file_open(arch_key_file_data, path, Flags, MYF(0)) : fd; DBUG_EXECUTE_IF("simulate_archive_open_failure", { if (s->file >= 0) @@ -248,8 +252,8 @@ int get_byte(s) if (s->stream.avail_in == 0) { errno = 0; - s->stream.avail_in= (uInt) my_read(s->file, (uchar *)s->inbuf, - AZ_BUFSIZE_READ, MYF(0)); + s->stream.avail_in= (uInt) mysql_file_read(s->file, (uchar *)s->inbuf, + AZ_BUFSIZE_READ, MYF(0)); if (s->stream.avail_in == 0) { s->z_eof = 1; @@ -290,7 +294,8 @@ void check_header(azio_stream *s) if (len < 2) { if (len) s->inbuf[0] = s->stream.next_in[0]; errno = 0; - len = (uInt)my_read(s->file, (uchar *)s->inbuf + len, AZ_BUFSIZE_READ >> len, MYF(0)); + len = (uInt)mysql_file_read(s->file, (uchar *)s->inbuf + len, + AZ_BUFSIZE_READ >> len, MYF(0)); if (len == (uInt)-1) s->z_err = Z_ERRNO; s->stream.avail_in += len; s->stream.next_in = s->inbuf; @@ -481,7 +486,8 @@ unsigned int ZEXPORT azread ( azio_stream *s, voidp buf, size_t len, int *error) if (s->stream.avail_out > 0) { s->stream.avail_out -= - (uInt)my_read(s->file, (uchar *)next_out, s->stream.avail_out, MYF(0)); + (uInt)mysql_file_read(s->file, (uchar *)next_out, + s->stream.avail_out, MYF(0)); } len -= s->stream.avail_out; s->in += len; @@ -494,7 +500,8 @@ unsigned int ZEXPORT azread ( azio_stream *s, voidp buf, size_t len, int *error) if (s->stream.avail_in == 0 && !s->z_eof) { errno = 0; - s->stream.avail_in = (uInt)my_read(s->file, (uchar *)s->inbuf, AZ_BUFSIZE_READ, MYF(0)); + s->stream.avail_in = (uInt)mysql_file_read(s->file, (uchar *)s->inbuf, + AZ_BUFSIZE_READ, MYF(0)); if (s->stream.avail_in == 0) { s->z_eof = 1; @@ -561,8 +568,8 @@ unsigned int azwrite (azio_stream *s, const voidp buf, unsigned int len) { s->stream.next_out = s->outbuf; - if (my_write(s->file, (uchar *)s->outbuf, AZ_BUFSIZE_WRITE, - MYF(0)) != AZ_BUFSIZE_WRITE) + if (mysql_file_write(s->file, (uchar *)s->outbuf, AZ_BUFSIZE_WRITE, + MYF(0)) != AZ_BUFSIZE_WRITE) { s->z_err = Z_ERRNO; break; @@ -609,7 +616,7 @@ int do_flush (azio_stream *s, int flush) if (len != 0) { s->check_point= my_tell(s->file, MYF(0)); - if ((uInt)my_write(s->file, (uchar *)s->outbuf, len, MYF(0)) != len) + if ((uInt)mysql_file_write(s->file, (uchar *)s->outbuf, len, MYF(0)) != len) { s->z_err = Z_ERRNO; return Z_ERRNO; @@ -796,7 +803,7 @@ void putLong (File file, uLong x) for (n = 0; n < 4; n++) { buffer[0]= (int)(x & 0xff); - my_write(file, buffer, 1, MYF(0)); + mysql_file_write(file, buffer, 1, MYF(0)); x >>= 8; } } diff --git a/storage/archive/ha_archive.cc b/storage/archive/ha_archive.cc index 6b29c6d9d53..b21e0561322 100644 --- a/storage/archive/ha_archive.cc +++ b/storage/archive/ha_archive.cc @@ -112,6 +112,10 @@ static HASH archive_open_tables; #define DATA_BUFFER_SIZE 2 // Size of the data used in the data file #define ARCHIVE_CHECK_HEADER 254 // The number we use to determine corruption +#ifdef HAVE_PSI_INTERFACE +extern "C" PSI_file_key arch_key_file_data; +#endif + /* Static declarations for handerton */ static handler *archive_create_handler(handlerton *hton, TABLE_SHARE *table, @@ -157,6 +161,14 @@ static PSI_mutex_info all_archive_mutexes[]= { &az_key_mutex_ARCHIVE_SHARE_mutex, "ARCHIVE_SHARE::mutex", 0} }; +PSI_file_key arch_key_file_metadata, arch_key_file_data, arch_key_file_frm; +static PSI_file_info all_archive_files[]= +{ + { &arch_key_file_metadata, "metadata", 0}, + { &arch_key_file_data, "data", 0}, + { &arch_key_file_frm, "FRM", 0} +}; + static void init_archive_psi_keys(void) { const char* category= "archive"; @@ -167,6 +179,9 @@ static void init_archive_psi_keys(void) count= array_elements(all_archive_mutexes); PSI_server->register_mutex(category, all_archive_mutexes, count); + + count= array_elements(all_archive_files); + PSI_server->register_file(category, all_archive_files, count); } #endif /* HAVE_PSI_INTERFACE */ @@ -260,7 +275,7 @@ int archive_discover(handlerton *hton, THD* thd, const char *db, build_table_filename(az_file, sizeof(az_file) - 1, db, name, ARZ, 0); - if (!(my_stat(az_file, &file_stat, MYF(0)))) + if (!(mysql_file_stat(arch_key_file_data, az_file, &file_stat, MYF(0)))) goto err; if (!(azopen(&frm_stream, az_file, O_RDONLY|O_BINARY))) @@ -723,7 +738,7 @@ int ha_archive::create(const char *name, TABLE *table_arg, There is a chance that the file was "discovered". In this case just use whatever file is there. */ - if (!(my_stat(name_buff, &file_stat, MYF(0)))) + if (!(mysql_file_stat(arch_key_file_data, name_buff, &file_stat, MYF(0)))) { my_errno= 0; if (!(azopen(&create_stream, name_buff, O_CREAT|O_RDWR|O_BINARY))) @@ -740,19 +755,19 @@ int ha_archive::create(const char *name, TABLE *table_arg, /* Here is where we open up the frm and pass it to archive to store */ - if ((frm_file= my_open(name_buff, O_RDONLY, MYF(0))) > 0) + if ((frm_file= mysql_file_open(arch_key_file_frm, name_buff, O_RDONLY, MYF(0))) >= 0) { if (!mysql_file_fstat(frm_file, &file_stat, MYF(MY_WME))) { frm_ptr= (uchar *)my_malloc(sizeof(uchar) * (size_t)file_stat.st_size, MYF(0)); if (frm_ptr) { - my_read(frm_file, frm_ptr, (size_t)file_stat.st_size, MYF(0)); + mysql_file_read(frm_file, frm_ptr, (size_t)file_stat.st_size, MYF(0)); azwrite_frm(&create_stream, (char *)frm_ptr, (size_t)file_stat.st_size); my_free(frm_ptr); } } - my_close(frm_file, MYF(0)); + mysql_file_close(frm_file, MYF(0)); } if (create_info->comment.str) @@ -1615,7 +1630,7 @@ int ha_archive::info(uint flag) { MY_STAT file_stat; // Stat information for the data file - (void) my_stat(share->data_file_name, &file_stat, MYF(MY_WME)); + (void) mysql_file_stat(arch_key_file_data, share->data_file_name, &file_stat, MYF(MY_WME)); if (flag & HA_STATUS_TIME) stats.update_time= (ulong) file_stat.st_mtime; diff --git a/storage/example/mysql-test/mtr/suite.pm b/storage/example/mysql-test/mtr/suite.pm new file mode 100644 index 00000000000..f7ff42241fe --- /dev/null +++ b/storage/example/mysql-test/mtr/suite.pm @@ -0,0 +1,8 @@ +package My::Suite::MTR::Example; + +@ISA = qw(My::Suite); + +sub skip_combinations {( + 't/combs.combinations' => [ 'c1' ], +)} +bless { }; diff --git a/storage/heap/hp_block.c b/storage/heap/hp_block.c index 90efeeb7924..01978e2b4e8 100644 --- a/storage/heap/hp_block.c +++ b/storage/heap/hp_block.c @@ -64,18 +64,19 @@ int hp_get_new_block(HP_BLOCK *block, size_t *alloc_length) break; /* - Allocate space for leaf block plus space for upper level blocks up to - first level that has a free slot to put the pointer. - In some cases we actually allocate more then we need: - Consider e.g. a situation where we have one level 1 block and one level 0 - block, the level 0 block is full and this function is called. We only - need a leaf block in this case. Nevertheless, we will get here with i=1 - and will also allocate sizeof(HP_PTRS) for non-leaf block and will never - use this space. - This doesn't add much overhead - with current values of sizeof(HP_PTRS) - and my_default_record_cache_size we get about 1/128 unused memory. + Allocate space for leaf block (data) plus space for upper level blocks + up to first level that has a free slot to put the pointer. + If this is a new level, we have to allocate pointers to all future + lower levels. + + For example, for level 0, we allocate data for X rows. + When level 0 is full, we allocate data for HPTRS_IN_NODE + X rows. + Next time we allocate data for X rows. + When level 1 is full, we allocate data for HPTRS_IN_NODE at level 2 and 1 + + X rows at level 0. */ - *alloc_length=sizeof(HP_PTRS)*i+block->records_in_block* block->recbuffer; + *alloc_length= (sizeof(HP_PTRS)* ((i == block->levels) ? i : i - 1) + + block->records_in_block* block->recbuffer); if (!(root=(HP_PTRS*) my_malloc(*alloc_length,MYF(MY_WME)))) return 1; diff --git a/storage/heap/hp_create.c b/storage/heap/hp_create.c index 22ab9b54a85..d170d1abc65 100644 --- a/storage/heap/hp_create.c +++ b/storage/heap/hp_create.c @@ -245,21 +245,32 @@ static void init_block(HP_BLOCK *block, uint reclength, ulong min_records, { uint i,recbuffer,records_in_block; - max_records= max(min_records,max_records); + /* + If not min_records and max_records are given, optimize for 1000 rows + */ + if (!min_records) + min_records= min(1000, max_records); if (!max_records) - max_records= 1000; /* As good as quess as anything */ - recbuffer= (uint) (reclength + sizeof(uchar**) - 1) & ~(sizeof(uchar**) - 1); - records_in_block= max_records / 10; + max_records= max(min_records, 1000); /* We don't want too few records_in_block as otherwise the overhead of of the HP_PTRS block will be too notable */ - records_in_block= min(1000, max_records); + records_in_block= max(1000, min_records); + records_in_block= min(records_in_block, max_records); + /* If big max_records is given, allocate bigger blocks */ + records_in_block= max(records_in_block, max_records / 10); + /* We don't want too few blocks per row either */ if (records_in_block < 10) records_in_block= 10; - /* The + 1 is there to ensure that we get at least 1 row per level */ + recbuffer= (uint) (reclength + sizeof(uchar**) - 1) & ~(sizeof(uchar**) - 1); + /* + Don't allocate more than my_default_record_cache_size per level. + The + 1 is there to ensure that we get at least 1 row per level (for + the exceptional case of very long rows) + */ if (records_in_block*recbuffer > (my_default_record_cache_size-sizeof(HP_PTRS)*HP_MAX_LEVELS)) records_in_block= (my_default_record_cache_size - sizeof(HP_PTRS) * diff --git a/storage/innobase/btr/btr0btr.c b/storage/innobase/btr/btr0btr.c index fc3cdaf3cf1..b714219e304 100644 --- a/storage/innobase/btr/btr0btr.c +++ b/storage/innobase/btr/btr0btr.c @@ -42,6 +42,7 @@ Created 6/2/1994 Heikki Tuuri #include "ibuf0ibuf.h" #include "trx0trx.h" +#endif /* UNIV_HOTBACKUP */ /**************************************************************//** Report that an index page is corrupted. */ UNIV_INTERN @@ -64,6 +65,7 @@ btr_corruption_report( buf_page_print(buf_block_get_frame(block), 0, 0); } +#ifndef UNIV_HOTBACKUP #ifdef UNIV_BLOB_DEBUG # include "srv0srv.h" # include "ut0rbt.h" @@ -1575,7 +1577,9 @@ btr_page_reorganize_low( dict_index_t* index, /*!< in: record descriptor */ mtr_t* mtr) /*!< in: mtr */ { +#ifndef UNIV_HOTBACKUP buf_pool_t* buf_pool = buf_pool_from_bpage(&block->page); +#endif /* !UNIV_HOTBACKUP */ page_t* page = buf_block_get_frame(block); page_zip_des_t* page_zip = buf_block_get_page_zip(block); buf_block_t* temp_block; diff --git a/storage/innobase/buf/buf0buf.c b/storage/innobase/buf/buf0buf.c index 1672057d552..32d376136e6 100644 --- a/storage/innobase/buf/buf0buf.c +++ b/storage/innobase/buf/buf0buf.c @@ -302,7 +302,6 @@ struct buf_chunk_struct{ was allocated for the frames */ buf_block_t* blocks; /*!< array of buffer control blocks */ }; -#endif /* !UNIV_HOTBACKUP */ /********************************************************************//** Gets the smallest oldest_modification lsn for any page in the pool. Returns @@ -438,6 +437,7 @@ buf_block_alloc( return(block); } +#endif /* !UNIV_HOTBACKUP */ /********************************************************************//** Calculates a page checksum which is stored to the page when it is written @@ -3470,9 +3470,10 @@ buf_mark_space_corrupt( /********************************************************************//** Completes an asynchronous read or write request of a file page to or from -the buffer pool. */ +the buffer pool. +@return TRUE if successful */ UNIV_INTERN -void +ibool buf_page_io_complete( /*=================*/ buf_page_t* bpage) /*!< in: pointer to the block in question */ @@ -3599,7 +3600,7 @@ corrupt: table as corrupted instead of crashing server */ if (bpage->space > TRX_SYS_SPACE && buf_mark_space_corrupt(bpage)) { - return; + return(FALSE); } else { fputs("InnoDB: Ending processing" " because of" @@ -3689,6 +3690,8 @@ corrupt: mutex_exit(buf_page_get_mutex(bpage)); buf_pool_mutex_exit(buf_pool); + + return(TRUE); } /*********************************************************************//** diff --git a/storage/innobase/buf/buf0lru.c b/storage/innobase/buf/buf0lru.c index 8e787fdba17..7c8100df58e 100644 --- a/storage/innobase/buf/buf0lru.c +++ b/storage/innobase/buf/buf0lru.c @@ -2164,9 +2164,23 @@ buf_LRU_free_one_page( be in a state where it can be freed; there may or may not be a hash index to the page */ { +#ifdef UNIV_DEBUG + buf_pool_t* buf_pool = buf_pool_from_bpage(bpage); +#endif + mutex_t* block_mutex = buf_page_get_mutex(bpage); + + ut_ad(buf_pool_mutex_own(buf_pool)); + ut_ad(mutex_own(block_mutex)); + if (buf_LRU_block_remove_hashed_page(bpage, TRUE) != BUF_BLOCK_ZIP_FREE) { buf_LRU_block_free_hashed_page((buf_block_t*) bpage); + } else { + /* The block_mutex should have been released by + buf_LRU_block_remove_hashed_page() when it returns + BUF_BLOCK_ZIP_FREE. */ + ut_ad(block_mutex == &buf_pool->zip_mutex); + mutex_enter(block_mutex); } } diff --git a/storage/innobase/buf/buf0rea.c b/storage/innobase/buf/buf0rea.c index da804a66b29..40550186191 100644 --- a/storage/innobase/buf/buf0rea.c +++ b/storage/innobase/buf/buf0rea.c @@ -51,6 +51,44 @@ i/o-fixed buffer blocks */ #define BUF_READ_AHEAD_PEND_LIMIT 2 /********************************************************************//** +Unfixes the pages, unlatches the page, +removes it from page_hash and removes it from LRU. */ +static +void +buf_read_page_handle_error( +/*=======================*/ + buf_page_t* bpage) /*!< in: pointer to the block */ +{ + buf_pool_t* buf_pool = buf_pool_from_bpage(bpage); + const ibool uncompressed = (buf_page_get_state(bpage) + == BUF_BLOCK_FILE_PAGE); + + /* First unfix and release lock on the bpage */ + buf_pool_mutex_enter(buf_pool); + mutex_enter(buf_page_get_mutex(bpage)); + ut_ad(buf_page_get_io_fix(bpage) == BUF_IO_READ); + ut_ad(bpage->buf_fix_count == 0); + + /* Set BUF_IO_NONE before we remove the block from LRU list */ + buf_page_set_io_fix(bpage, BUF_IO_NONE); + + if (uncompressed) { + rw_lock_x_unlock_gen( + &((buf_block_t*) bpage)->lock, + BUF_IO_READ); + } + + /* remove the block from LRU list */ + buf_LRU_free_one_page(bpage); + + ut_ad(buf_pool->n_pend_reads > 0); + buf_pool->n_pend_reads--; + + mutex_exit(buf_page_get_mutex(bpage)); + buf_pool_mutex_exit(buf_pool); +} + +/********************************************************************//** Low-level function which reads a page asynchronously from a file to the buffer buf_pool if it is not already there, in which case does nothing. Sets the io_fix flag and sets an exclusive lock on the buffer frame. The @@ -152,12 +190,20 @@ buf_read_page_low( ((buf_block_t*) bpage)->frame, bpage); } thd_wait_end(NULL); + + if (*err == DB_TABLESPACE_DELETED) { + buf_read_page_handle_error(bpage); + return(0); + } + ut_a(*err == DB_SUCCESS); if (sync) { /* The i/o is already completed when we arrive from fil_read */ - buf_page_io_complete(bpage); + if (!buf_page_io_complete(bpage)) { + return(0); + } } return(1); diff --git a/storage/innobase/dict/dict0dict.c b/storage/innobase/dict/dict0dict.c index 5be94a10374..6f2c2caffaf 100644 --- a/storage/innobase/dict/dict0dict.c +++ b/storage/innobase/dict/dict0dict.c @@ -169,6 +169,7 @@ void dict_field_print_low( /*=================*/ const dict_field_t* field); /*!< in: field */ +#ifndef UNIV_HOTBACKUP /*********************************************************************//** Frees a foreign key struct. */ static @@ -182,7 +183,7 @@ and unique key errors */ UNIV_INTERN FILE* dict_foreign_err_file = NULL; /* mutex protecting the foreign and unique error buffers */ UNIV_INTERN mutex_t dict_foreign_err_mutex; - +#endif /* !UNIV_HOTBACKUP */ /******************************************************************//** Makes all characters in a NUL-terminated UTF-8 string lower case. */ UNIV_INTERN @@ -2247,6 +2248,7 @@ dict_index_build_internal_non_clust( return(new_index); } +#ifndef UNIV_HOTBACKUP /*====================== FOREIGN KEY PROCESSING ========================*/ /*********************************************************************//** @@ -2511,6 +2513,7 @@ dict_foreign_find_equiv_index( FALSE/* allow columns to be NULL */)); } +#endif /* !UNIV_HOTBACKUP */ /**********************************************************************//** Returns an index object by matching on the name and column names and if more than one index matches return the index with the max id @@ -2570,6 +2573,7 @@ dict_table_get_index_by_max_id( return(found); } +#ifndef UNIV_HOTBACKUP /**********************************************************************//** Report an error in a foreign key definition. */ static @@ -2735,6 +2739,7 @@ dict_foreign_add_to_cache( return(DB_SUCCESS); } +#endif /* !UNIV_HOTBACKUP */ /*********************************************************************//** Scans from pointer onwards. Stops if is at the start of a copy of 'string' where characters are compared without case sensitivity, and @@ -3214,6 +3219,7 @@ end_of_string: } } +#ifndef UNIV_HOTBACKUP /*********************************************************************//** Finds the highest [number] for foreign key constraints of the table. Looks only at the >= 4.0.18-format id's, which are of the form @@ -4050,7 +4056,7 @@ syntax_error: } /*==================== END OF FOREIGN KEY PROCESSING ====================*/ - +#endif /* !UNIV_HOTBACKUP */ /**********************************************************************//** Returns an index object if it is found in the dictionary cache. Assumes that dict_sys->mutex is already being held. @@ -4411,6 +4417,7 @@ fake_statistics: dict_table_stats_unlock(table, RW_X_LATCH); } +#ifndef UNIV_HOTBACKUP /**********************************************************************//** Prints info of a foreign key constraint. */ static @@ -4441,6 +4448,7 @@ dict_foreign_print_low( fputs(" )\n", stderr); } +#endif /* !UNIV_HOTBACKUP */ /**********************************************************************//** Prints a table data. */ UNIV_INTERN @@ -4622,6 +4630,7 @@ dict_field_print_low( } } +#ifndef UNIV_HOTBACKUP /**********************************************************************//** Outputs info on a foreign key of a table in a format suitable for CREATE TABLE. */ @@ -4810,6 +4819,7 @@ dict_print_info_on_foreign_keys( mutex_exit(&(dict_sys->mutex)); } +#endif /* !UNIV_HOTBACKUP */ /********************************************************************//** Displays the names of the index and the table. */ UNIV_INTERN @@ -4940,6 +4950,28 @@ dict_table_replace_index_in_foreign_list( foreign->foreign_index = new_index; } } + + + for (foreign = UT_LIST_GET_FIRST(table->referenced_list); + foreign; + foreign = UT_LIST_GET_NEXT(referenced_list, foreign)) { + + dict_index_t* new_index; + + if (foreign->referenced_index == index) { + ut_ad(foreign->referenced_table == index->table); + + new_index = dict_foreign_find_index( + foreign->referenced_table, + foreign->referenced_col_names, + foreign->n_fields, index, + /*check_charsets=*/TRUE, /*check_null=*/FALSE); + ut_ad(new_index || !trx->check_foreigns); + ut_ad(!new_index || new_index->table == index->table); + + foreign->referenced_index = new_index; + } + } } /**********************************************************************//** diff --git a/storage/innobase/dict/dict0mem.c b/storage/innobase/dict/dict0mem.c index 982cca5a796..a8ff501a700 100644 --- a/storage/innobase/dict/dict0mem.c +++ b/storage/innobase/dict/dict0mem.c @@ -33,8 +33,8 @@ Created 1/8/1996 Heikki Tuuri #include "data0type.h" #include "mach0data.h" #include "dict0dict.h" -#include "ha_prototypes.h" /* innobase_casedn_str()*/ #ifndef UNIV_HOTBACKUP +# include "ha_prototypes.h" /* innobase_casedn_str()*/ # include "lock0lock.h" #endif /* !UNIV_HOTBACKUP */ #ifdef UNIV_BLOB_DEBUG @@ -272,6 +272,7 @@ dict_mem_index_create( return(index); } +#ifndef UNIV_HOTBACKUP /**********************************************************************//** Creates and initializes a foreign constraint memory object. @return own: foreign constraint struct */ @@ -346,6 +347,7 @@ dict_mem_referenced_table_name_lookup_set( } } +#endif /* !UNIV_HOTBACKUP */ /**********************************************************************//** Adds a field definition to an index. NOTE: does not take a copy of the column name if the field is a column. The memory occupied diff --git a/storage/innobase/fil/fil0fil.c b/storage/innobase/fil/fil0fil.c index 0a467d40345..23fe76f2281 100644 --- a/storage/innobase/fil/fil0fil.c +++ b/storage/innobase/fil/fil0fil.c @@ -857,8 +857,10 @@ fil_node_close_file( ut_a(node->open); ut_a(node->n_pending == 0); ut_a(node->n_pending_flushes == 0); +#ifndef UNIV_HOTBACKUP ut_a(node->modification_counter == node->flush_counter || srv_fast_shutdown == 2); +#endif /* !UNIV_HOTBACKUP */ ret = os_file_close(node->handle); ut_a(ret); diff --git a/storage/innobase/ha/ha0ha.c b/storage/innobase/ha/ha0ha.c index 594a10dc431..35f2293577f 100644 --- a/storage/innobase/ha/ha0ha.c +++ b/storage/innobase/ha/ha0ha.c @@ -28,6 +28,7 @@ Created 8/22/1994 Heikki Tuuri #include "ha0ha.ic" #endif +#ifndef UNIV_HOTBACKUP #ifdef UNIV_DEBUG # include "buf0buf.h" #endif /* UNIV_DEBUG */ @@ -51,17 +52,13 @@ ha_create_func( hash table: must be a power of 2, or 0 */ { hash_table_t* table; -#ifndef UNIV_HOTBACKUP ulint i; -#endif /* !UNIV_HOTBACKUP */ ut_ad(ut_is_2pow(n_mutexes)); table = hash_create(n); #if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG -# ifndef UNIV_HOTBACKUP table->adaptive = TRUE; -# endif /* !UNIV_HOTBACKUP */ #endif /* UNIV_AHI_DEBUG || UNIV_DEBUG */ /* Creating MEM_HEAP_BTR_SEARCH type heaps can potentially fail, but in practise it never should in this case, hence the asserts. */ @@ -74,7 +71,6 @@ ha_create_func( return(table); } -#ifndef UNIV_HOTBACKUP hash_create_mutexes(table, n_mutexes, mutex_level); table->heaps = mem_alloc(n_mutexes * sizeof(void*)); @@ -83,7 +79,6 @@ ha_create_func( table->heaps[i] = mem_heap_create_in_btr_search(4096); ut_a(table->heaps[i]); } -#endif /* !UNIV_HOTBACKUP */ return(table); } @@ -134,7 +129,6 @@ ha_insert_for_fold_func( while (prev_node != NULL) { if (prev_node->fold == fold) { #if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG -# ifndef UNIV_HOTBACKUP if (table->adaptive) { buf_block_t* prev_block = prev_node->block; ut_a(prev_block->frame @@ -143,7 +137,6 @@ ha_insert_for_fold_func( prev_block->n_pointers--; block->n_pointers++; } -# endif /* !UNIV_HOTBACKUP */ prev_node->block = block; #endif /* UNIV_AHI_DEBUG || UNIV_DEBUG */ @@ -171,11 +164,9 @@ ha_insert_for_fold_func( ha_node_set_data(node, block, data); #if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG -# ifndef UNIV_HOTBACKUP if (table->adaptive) { block->n_pointers++; } -# endif /* !UNIV_HOTBACKUP */ #endif /* UNIV_AHI_DEBUG || UNIV_DEBUG */ node->fold = fold; @@ -217,13 +208,11 @@ ha_delete_hash_node( #endif /* UNIV_SYNC_DEBUG */ ut_ad(btr_search_enabled); #if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG -# ifndef UNIV_HOTBACKUP if (table->adaptive) { ut_a(del_node->block->frame = page_align(del_node->data)); ut_a(del_node->block->n_pointers > 0); del_node->block->n_pointers--; } -# endif /* !UNIV_HOTBACKUP */ #endif /* UNIV_AHI_DEBUG || UNIV_DEBUG */ HASH_DELETE_AND_COMPACT(ha_node_t, next, table, del_node); @@ -264,13 +253,11 @@ ha_search_and_update_if_found_func( if (node) { #if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG -# ifndef UNIV_HOTBACKUP if (table->adaptive) { ut_a(node->block->n_pointers > 0); node->block->n_pointers--; new_block->n_pointers++; } -# endif /* !UNIV_HOTBACKUP */ node->block = new_block; #endif /* UNIV_AHI_DEBUG || UNIV_DEBUG */ @@ -278,7 +265,6 @@ ha_search_and_update_if_found_func( } } -#ifndef UNIV_HOTBACKUP /*****************************************************************//** Removes from the chain determined by fold all nodes whose data pointer points to the page given. */ diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index b97869e74ee..81bb4a1c3eb 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -47,6 +47,7 @@ this program; if not, write to the Free Software Foundation, Inc., #include <sql_acl.h> // PROCESS_ACL #include <m_ctype.h> +#include <debug_sync.h> // DEBUG_SYNC #include <mysys_err.h> #include <mysql/plugin.h> #include <innodb_priv.h> @@ -5905,6 +5906,7 @@ ha_innobase::index_read( ulint ret; DBUG_ENTER("index_read"); + DEBUG_SYNC_C("ha_innobase_index_read_begin"); ut_a(prebuilt->trx == thd_to_trx(user_thd)); ut_ad(key_len != 0 || find_flag != HA_READ_KEY_EXACT); @@ -7718,6 +7720,8 @@ ha_innobase::rename_table( error = innobase_rename_table(trx, from, to, TRUE); + DEBUG_SYNC(thd, "after_innobase_rename_table"); + /* Tell the InnoDB server that there might be work for utility threads: */ @@ -8035,10 +8039,15 @@ innobase_get_mysql_key_number_for_index( } } - /* Print an error message if we cannot find the index - ** in the "index translation table". */ - sql_print_error("Cannot find index %s in InnoDB index " - "translation table.", index->name); + /* If index_count in translation table is set to 0, it + is possible we are in the process of rebuilding table, + do not spit error in this case */ + if (share->idx_trans_tbl.index_count) { + /* Print an error message if we cannot find the index + ** in the "index translation table". */ + sql_print_error("Cannot find index %s in InnoDB index " + "translation table.", index->name); + } } /* If we do not have an "index translation table", or not able @@ -8409,9 +8418,10 @@ ha_innobase::info_low( } else if (rec_per_key > 1) { rec_per_key = - (ha_rows) (k_rec_per_key * - (double)rec_per_key / - n_rows); + (ha_rows) + (k_rec_per_key * + (double)rec_per_key / + n_rows); } key_info->rec_per_key[k++]= @@ -9566,6 +9576,7 @@ innodb_show_status( const long MAX_STATUS_SIZE = 1048576; ulint trx_list_start = ULINT_UNDEFINED; ulint trx_list_end = ULINT_UNDEFINED; + bool res; DBUG_ENTER("innodb_show_status"); DBUG_ASSERT(hton == innodb_hton_ptr); @@ -9629,12 +9640,13 @@ innodb_show_status( mutex_exit(&srv_monitor_file_mutex); - stat_print(thd, innobase_hton_name, (uint) strlen(innobase_hton_name), - STRING_WITH_LEN(""), str, flen); + res= stat_print(thd, innobase_hton_name, + (uint) strlen(innobase_hton_name), + STRING_WITH_LEN(""), str, flen); my_free(str); - DBUG_RETURN(FALSE); + DBUG_RETURN(res); } /************************************************************************//** @@ -11382,7 +11394,7 @@ static MYSQL_SYSVAR_BOOL(doublewrite, innobase_use_doublewrite, static MYSQL_SYSVAR_ULONG(io_capacity, srv_io_capacity, PLUGIN_VAR_RQCMDARG, "Number of IOPs the server can do. Tunes the background IO rate", - NULL, NULL, 200, 100, ~0L, 0); + NULL, NULL, 200, 100, ~0UL, 0); static MYSQL_SYSVAR_ULONG(purge_batch_size, srv_purge_batch_size, PLUGIN_VAR_OPCMDARG, @@ -11499,7 +11511,7 @@ static MYSQL_SYSVAR_BOOL(adaptive_flushing, srv_adaptive_flushing, static MYSQL_SYSVAR_ULONG(max_purge_lag, srv_max_purge_lag, PLUGIN_VAR_RQCMDARG, "Desired maximum length of the purge queue (0 = no limit)", - NULL, NULL, 0, 0, ~0L, 0); + NULL, NULL, 0, 0, ~0UL, 0); static MYSQL_SYSVAR_BOOL(rollback_on_timeout, innobase_rollback_on_timeout, PLUGIN_VAR_OPCMDARG | PLUGIN_VAR_READONLY, @@ -11561,7 +11573,7 @@ static MYSQL_SYSVAR_ULONG(commit_concurrency, innobase_commit_concurrency, static MYSQL_SYSVAR_ULONG(concurrency_tickets, srv_n_free_tickets_to_enter, PLUGIN_VAR_RQCMDARG, "Number of times a thread is allowed to enter InnoDB within the same SQL query after it has once got the ticket", - NULL, NULL, 500L, 1L, ~0L, 0); + NULL, NULL, 500L, 1L, ~0UL, 0); static MYSQL_SYSVAR_LONG(file_io_threads, innobase_file_io_threads, PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY | PLUGIN_VAR_NOSYSVAR, @@ -11623,12 +11635,12 @@ static MYSQL_SYSVAR_LONG(open_files, innobase_open_files, static MYSQL_SYSVAR_ULONG(sync_spin_loops, srv_n_spin_wait_rounds, PLUGIN_VAR_RQCMDARG, "Count of spin-loop rounds in InnoDB mutexes (30 by default)", - NULL, NULL, 30L, 0L, ~0L, 0); + NULL, NULL, 30L, 0L, ~0UL, 0); static MYSQL_SYSVAR_ULONG(spin_wait_delay, srv_spin_wait_delay, PLUGIN_VAR_OPCMDARG, "Maximum delay between polling for a spin lock (6 by default)", - NULL, NULL, 6L, 0L, ~0L, 0); + NULL, NULL, 6L, 0L, ~0UL, 0); static MYSQL_SYSVAR_ULONG(thread_concurrency, srv_thread_concurrency, PLUGIN_VAR_RQCMDARG, @@ -11638,7 +11650,7 @@ static MYSQL_SYSVAR_ULONG(thread_concurrency, srv_thread_concurrency, static MYSQL_SYSVAR_ULONG(thread_sleep_delay, srv_thread_sleep_delay, PLUGIN_VAR_RQCMDARG, "Time of innodb thread sleeping before joining InnoDB queue (usec). Value 0 disable a sleep", - NULL, NULL, 10000L, 0L, ~0L, 0); + NULL, NULL, 10000L, 0L, ~0UL, 0); static MYSQL_SYSVAR_STR(data_file_path, innobase_data_file_path, PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, diff --git a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc index 7bb370a8dc4..dc65fb3ff1a 100644 --- a/storage/innobase/handler/handler0alter.cc +++ b/storage/innobase/handler/handler0alter.cc @@ -708,6 +708,10 @@ ha_innobase::add_index( ut_a(indexed_table == prebuilt->table); + if (indexed_table->tablespace_discarded) { + DBUG_RETURN(-1); + } + /* Check that index keys are sensible */ error = innobase_check_index_keys(key_info, num_of_keys, prebuilt->table); @@ -769,7 +773,7 @@ ha_innobase::add_index( row_mysql_lock_data_dictionary(trx); dict_locked = TRUE; - ut_d(dict_table_check_for_dup_indexes(prebuilt->table, FALSE)); + ut_d(dict_table_check_for_dup_indexes(prebuilt->table, TRUE)); /* If a new primary key is defined for the table we need to drop the original table and rebuild all indexes. */ @@ -805,7 +809,7 @@ ha_innobase::add_index( } ut_d(dict_table_check_for_dup_indexes(prebuilt->table, - FALSE)); + TRUE)); mem_heap_free(heap); trx_general_rollback_for_mysql(trx, NULL); row_mysql_unlock_data_dictionary(trx); @@ -1057,7 +1061,7 @@ ha_innobase::final_add_index( trx_commit_for_mysql(prebuilt->trx); } - ut_d(dict_table_check_for_dup_indexes(prebuilt->table, FALSE)); + ut_d(dict_table_check_for_dup_indexes(prebuilt->table, TRUE)); row_mysql_unlock_data_dictionary(trx); trx_free_for_mysql(trx); @@ -1100,7 +1104,7 @@ ha_innobase::prepare_drop_index( /* Test and mark all the indexes to be dropped */ row_mysql_lock_data_dictionary(trx); - ut_d(dict_table_check_for_dup_indexes(prebuilt->table, FALSE)); + ut_d(dict_table_check_for_dup_indexes(prebuilt->table, TRUE)); /* Check that none of the indexes have previously been flagged for deletion. */ @@ -1271,7 +1275,7 @@ func_exit: } while (index); } - ut_d(dict_table_check_for_dup_indexes(prebuilt->table, FALSE)); + ut_d(dict_table_check_for_dup_indexes(prebuilt->table, TRUE)); row_mysql_unlock_data_dictionary(trx); DBUG_RETURN(err); @@ -1318,7 +1322,7 @@ ha_innobase::final_drop_index( prebuilt->table->flags, user_thd); row_mysql_lock_data_dictionary(trx); - ut_d(dict_table_check_for_dup_indexes(prebuilt->table, FALSE)); + ut_d(dict_table_check_for_dup_indexes(prebuilt->table, TRUE)); if (UNIV_UNLIKELY(err)) { @@ -1362,7 +1366,7 @@ ha_innobase::final_drop_index( share->idx_trans_tbl.index_count = 0; func_exit: - ut_d(dict_table_check_for_dup_indexes(prebuilt->table, FALSE)); + ut_d(dict_table_check_for_dup_indexes(prebuilt->table, TRUE)); trx_commit_for_mysql(trx); trx_commit_for_mysql(prebuilt->trx); row_mysql_unlock_data_dictionary(trx); diff --git a/storage/innobase/include/btr0btr.h b/storage/innobase/include/btr0btr.h index f531b785786..5592995d4b2 100644 --- a/storage/innobase/include/btr0btr.h +++ b/storage/innobase/include/btr0btr.h @@ -92,6 +92,8 @@ insert/delete buffer when the record is not in the buffer pool. */ buffer when the record is not in the buffer pool. */ #define BTR_DELETE 8192 +#endif /* UNIV_HOTBACKUP */ + /**************************************************************//** Report that an index page is corrupted. */ UNIV_INTERN @@ -112,6 +114,7 @@ btr_corruption_report( ut_error; \ } +#ifndef UNIV_HOTBACKUP #ifdef UNIV_BLOB_DEBUG # include "ut0rbt.h" /** An index->blobs entry for keeping track of off-page column references */ diff --git a/storage/innobase/include/btr0types.h b/storage/innobase/include/btr0types.h index 5adc858b931..ef329af1aac 100644 --- a/storage/innobase/include/btr0types.h +++ b/storage/innobase/include/btr0types.h @@ -39,6 +39,8 @@ typedef struct btr_cur_struct btr_cur_t; /** B-tree search information for the adaptive hash index */ typedef struct btr_search_struct btr_search_t; +#ifndef UNIV_HOTBACKUP + /** @brief The latch protecting the adaptive search system This latch protects the @@ -54,6 +56,8 @@ Bear in mind (3) and (4) when using the hash index. */ extern rw_lock_t* btr_search_latch_temp; +#endif /* UNIV_HOTBACKUP */ + /** The latch protecting the adaptive search system */ #define btr_search_latch (*btr_search_latch_temp) diff --git a/storage/innobase/include/buf0buf.h b/storage/innobase/include/buf0buf.h index d9e6801eb86..a39592943d8 100644 --- a/storage/innobase/include/buf0buf.h +++ b/storage/innobase/include/buf0buf.h @@ -593,34 +593,34 @@ ib_uint64_t buf_block_get_modify_clock( /*=======================*/ buf_block_t* block); /*!< in: block */ -#else /* !UNIV_HOTBACKUP */ -# define buf_block_modify_clock_inc(block) ((void) 0) -#endif /* !UNIV_HOTBACKUP */ /*******************************************************************//** Increments the bufferfix count. */ UNIV_INLINE void buf_block_buf_fix_inc_func( /*=======================*/ -#ifdef UNIV_SYNC_DEBUG +# ifdef UNIV_SYNC_DEBUG const char* file, /*!< in: file name */ ulint line, /*!< in: line */ -#endif /* UNIV_SYNC_DEBUG */ +# endif /* UNIV_SYNC_DEBUG */ buf_block_t* block) /*!< in/out: block to bufferfix */ __attribute__((nonnull)); -#ifdef UNIV_SYNC_DEBUG +# ifdef UNIV_SYNC_DEBUG /** Increments the bufferfix count. @param b in/out: block to bufferfix @param f in: file name where requested @param l in: line number where requested */ # define buf_block_buf_fix_inc(b,f,l) buf_block_buf_fix_inc_func(f,l,b) -#else /* UNIV_SYNC_DEBUG */ +# else /* UNIV_SYNC_DEBUG */ /** Increments the bufferfix count. @param b in/out: block to bufferfix @param f in: file name where requested @param l in: line number where requested */ # define buf_block_buf_fix_inc(b,f,l) buf_block_buf_fix_inc_func(b) -#endif /* UNIV_SYNC_DEBUG */ +# endif /* UNIV_SYNC_DEBUG */ +#else /* !UNIV_HOTBACKUP */ +# define buf_block_modify_clock_inc(block) ((void) 0) +#endif /* !UNIV_HOTBACKUP */ /********************************************************************//** Calculates a page checksum which is stored to the page when it is written to a file. Note that we must be careful to calculate the same value @@ -1162,9 +1162,10 @@ buf_page_init_for_read( ulint offset);/*!< in: page number */ /********************************************************************//** Completes an asynchronous read or write request of a file page to or from -the buffer pool. */ +the buffer pool. +@return TRUE if successful */ UNIV_INTERN -void +ibool buf_page_io_complete( /*=================*/ buf_page_t* bpage); /*!< in: pointer to the block in question */ diff --git a/storage/innobase/include/buf0buf.ic b/storage/innobase/include/buf0buf.ic index 917ee5dda84..0d9687e6b2a 100644 --- a/storage/innobase/include/buf0buf.ic +++ b/storage/innobase/include/buf0buf.ic @@ -31,6 +31,7 @@ Created 11/5/1995 Heikki Tuuri *******************************************************/ #include "mtr0mtr.h" +#ifndef UNIV_HOTBACKUP #include "buf0flu.h" #include "buf0lru.h" #include "buf0rea.h" @@ -180,6 +181,7 @@ buf_page_peek_if_too_old( return(!buf_page_peek_if_young(bpage)); } } +#endif /* !UNIV_HOTBACKUP */ /*********************************************************************//** Gets the state of a block. diff --git a/storage/innobase/include/dict0dict.h b/storage/innobase/include/dict0dict.h index 89d6fc66635..b609bce9d41 100644 --- a/storage/innobase/include/dict0dict.h +++ b/storage/innobase/include/dict0dict.h @@ -750,6 +750,7 @@ ulint dict_table_zip_size( /*================*/ const dict_table_t* table); /*!< in: table */ +#ifndef UNIV_HOTBACKUP /*********************************************************************//** Obtain exclusive locks on all index trees of the table. This is to prevent accessing index trees while InnoDB is updating internal metadata for @@ -766,6 +767,7 @@ void dict_table_x_unlock_indexes( /*========================*/ dict_table_t* table); /*!< in: table */ +#endif /* !UNIV_HOTBACKUP */ /********************************************************************//** Checks if a column is in the ordering columns of the clustered index of a table. Column prefixes are treated like whole columns. @@ -1251,7 +1253,7 @@ UNIV_INTERN void dict_close(void); /*============*/ - +#ifndef UNIV_HOTBACKUP /**********************************************************************//** Check whether the table is corrupted. @return nonzero for corrupted table, zero for valid tables */ @@ -1272,6 +1274,7 @@ dict_index_is_corrupted( const dict_index_t* index) /*!< in: index */ __attribute__((nonnull, pure, warn_unused_result)); +#endif /* !UNIV_HOTBACKUP */ /**********************************************************************//** Flags an index and table corrupted both in the data dictionary cache and in the system table SYS_INDEXES. */ diff --git a/storage/innobase/include/dict0dict.ic b/storage/innobase/include/dict0dict.ic index 7533ce01401..faa28959c59 100644 --- a/storage/innobase/include/dict0dict.ic +++ b/storage/innobase/include/dict0dict.ic @@ -491,6 +491,7 @@ dict_table_zip_size( return(dict_table_flags_to_zip_size(table->flags)); } +#ifndef UNIV_HOTBACKUP /*********************************************************************//** Obtain exclusive locks on all index trees of the table. This is to prevent accessing index trees while InnoDB is updating internal metadata for @@ -533,6 +534,7 @@ dict_table_x_unlock_indexes( rw_lock_x_unlock(dict_index_get_lock(index)); } } +#endif /* !UNIV_HOTBACKUP */ /********************************************************************//** Gets the number of fields in the internal representation of an index, including fields added by the dictionary system. diff --git a/storage/innobase/include/log0log.h b/storage/innobase/include/log0log.h index f2ab6a9898d..30250d4fd27 100644 --- a/storage/innobase/include/log0log.h +++ b/storage/innobase/include/log0log.h @@ -762,7 +762,6 @@ struct log_struct{ buffer */ #ifndef UNIV_HOTBACKUP mutex_t mutex; /*!< mutex protecting the log */ -#endif /* !UNIV_HOTBACKUP */ mutex_t log_flush_order_mutex;/*!< mutex to serialize access to the flush list when we are putting @@ -772,6 +771,7 @@ struct log_struct{ mtr_commit and still ensure that insertions in the flush_list happen in the LSN order. */ +#endif /* !UNIV_HOTBACKUP */ byte* buf_ptr; /* unaligned log buffer */ byte* buf; /*!< log buffer */ ulint buf_size; /*!< log buffer size in bytes */ diff --git a/storage/innobase/include/os0file.h b/storage/innobase/include/os0file.h index fb13120a481..8ef0906ff5f 100644 --- a/storage/innobase/include/os0file.h +++ b/storage/innobase/include/os0file.h @@ -309,7 +309,7 @@ to original un-instrumented file I/O APIs */ os_file_create_func(name, create, purpose, type, success) # define os_file_create_simple(key, name, create, access, success) \ - os_file_create_simple_func(name, create_mode, access, success) + os_file_create_simple_func(name, create, access, success) # define os_file_create_simple_no_error_handling( \ key, name, create_mode, access, success) \ diff --git a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h index ed2f4672a99..5290ef5fe11 100644 --- a/storage/innobase/include/srv0srv.h +++ b/storage/innobase/include/srv0srv.h @@ -111,13 +111,13 @@ extern ulint srv_max_file_format_at_startup; /** Place locks to records only i.e. do not use next-key locking except on duplicate key checking and foreign key checking */ extern ibool srv_locks_unsafe_for_binlog; -#endif /* !UNIV_HOTBACKUP */ /* If this flag is TRUE, then we will use the native aio of the OS (provided we compiled Innobase with it in), otherwise we will use simulated aio we build below with threads. Currently we support native aio on windows and linux */ extern my_bool srv_use_native_aio; +#endif /* !UNIV_HOTBACKUP */ #ifdef __WIN__ extern ibool srv_use_native_conditions; #endif diff --git a/storage/innobase/include/trx0sys.h b/storage/innobase/include/trx0sys.h index 3913792d594..635e7ec30b6 100644 --- a/storage/innobase/include/trx0sys.h +++ b/storage/innobase/include/trx0sys.h @@ -222,7 +222,6 @@ UNIV_INLINE trx_id_t trx_sys_get_new_trx_id(void); /*========================*/ -#endif /* !UNIV_HOTBACKUP */ #ifdef UNIV_DEBUG /* Flag to control TRX_RSEG_N_SLOTS behavior debugging. */ @@ -239,7 +238,6 @@ trx_write_trx_id( /*=============*/ byte* ptr, /*!< in: pointer to memory where written */ trx_id_t id); /*!< in: id */ -#ifndef UNIV_HOTBACKUP /*****************************************************************//** Reads a trx id from an index page. In case that the id size changes in some future version, this function should be used instead of @@ -572,7 +570,6 @@ FIL_PAGE_ARCH_LOG_NO_OR_SPACE_NO. */ #define TRX_SYS_DOUBLEWRITE_BLOCK_SIZE FSP_EXTENT_SIZE /* @} */ -#ifndef UNIV_HOTBACKUP /** File format tag */ /* @{ */ /** The offset of the file format tag on the trx system header page @@ -591,6 +588,7 @@ identifier is added to this 64-bit constant. */ | TRX_SYS_FILE_FORMAT_TAG_MAGIC_N_LOW) /* @} */ +#ifndef UNIV_HOTBACKUP /** Doublewrite control struct */ struct trx_doublewrite_struct{ mutex_t mutex; /*!< mutex protecting the first_free field and diff --git a/storage/innobase/log/log0recv.c b/storage/innobase/log/log0recv.c index f9e0fecb6c6..6c55a1badc5 100644 --- a/storage/innobase/log/log0recv.c +++ b/storage/innobase/log/log0recv.c @@ -2900,7 +2900,7 @@ recv_recovery_from_checkpoint_start_func( ib_uint64_t checkpoint_lsn; ib_uint64_t checkpoint_no; ib_uint64_t old_scanned_lsn; - ib_uint64_t group_scanned_lsn; + ib_uint64_t group_scanned_lsn= 0; ib_uint64_t contiguous_lsn; #ifdef UNIV_LOG_ARCHIVE ib_uint64_t archived_lsn; diff --git a/storage/innobase/mem/mem0dbg.c b/storage/innobase/mem/mem0dbg.c index ae43d6097a6..0909b7c9a64 100644 --- a/storage/innobase/mem/mem0dbg.c +++ b/storage/innobase/mem/mem0dbg.c @@ -24,7 +24,9 @@ but is included in mem0mem.* ! Created 6/9/1994 Heikki Tuuri *************************************************************************/ -#include "ha_prototypes.h" +#ifndef UNIV_HOTBACKUP +# include "ha_prototypes.h" +#endif /* !UNIV_HOTBACKUP */ #ifdef UNIV_MEM_DEBUG # ifndef UNIV_HOTBACKUP diff --git a/storage/innobase/mysql-test/storage_engine/alter_tablespace.opt b/storage/innobase/mysql-test/storage_engine/alter_tablespace.opt new file mode 100644 index 00000000000..cf4b117e1b1 --- /dev/null +++ b/storage/innobase/mysql-test/storage_engine/alter_tablespace.opt @@ -0,0 +1,2 @@ +--innodb-file-per-table=1 + diff --git a/storage/innobase/mysql-test/storage_engine/autoinc_secondary.rdiff b/storage/innobase/mysql-test/storage_engine/autoinc_secondary.rdiff new file mode 100644 index 00000000000..c24594c5024 --- /dev/null +++ b/storage/innobase/mysql-test/storage_engine/autoinc_secondary.rdiff @@ -0,0 +1,30 @@ +--- suite/storage_engine/autoinc_secondary.result 2012-07-12 04:34:18.153885986 +0400 ++++ suite/storage_engine/autoinc_secondary.reject 2012-07-15 17:47:03.937703666 +0400 +@@ -13,18 +13,15 @@ + 5 a + DROP TABLE t1; + CREATE TABLE t1 (a <CHAR_COLUMN>, b <INT_COLUMN> AUTO_INCREMENT, PRIMARY KEY (a,b)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +-INSERT INTO t1 (a) VALUES ('a'),('b'),('b'),('c'),('a'); +-SELECT LAST_INSERT_ID(); +-LAST_INSERT_ID() +-1 +-SELECT * FROM t1; +-a b +-a 1 +-a 2 +-b 1 +-b 2 +-c 1 +-DROP TABLE t1; ++ERROR 42000: Incorrect table definition; there can be only one auto column and it must be defined as a key ++# ERROR: Statement ended with errno 1075, errname ER_WRONG_AUTO_KEY (expected to succeed) ++# ------------ UNEXPECTED RESULT ------------ ++# The statement|command finished with ER_WRONG_AUTO_KEY. ++# Multi-part keys or PK or AUTO_INCREMENT (on a secondary column) or the mix could be unsupported|malfunctioning, or the problem was caused by previous errors. ++# You can change the engine code, or create an rdiff, or disable the test by adding it to disabled.def. ++# Further in this test, the message might sometimes be suppressed; a part of the test might be skipped. ++# Also, this problem may cause a chain effect (more errors of different kinds in the test). ++# ------------------------------------------- + CREATE TABLE t1 (a <CHAR_COLUMN>, b <INT_COLUMN> AUTO_INCREMENT, PRIMARY KEY (a,b), <CUSTOM_INDEX>(b)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; + INSERT INTO t1 (a) VALUES ('a'),('b'),('b'),('c'),('a'); + SELECT LAST_INSERT_ID(); diff --git a/storage/innobase/mysql-test/storage_engine/cache_index.rdiff b/storage/innobase/mysql-test/storage_engine/cache_index.rdiff new file mode 100644 index 00000000000..e04df87aa34 --- /dev/null +++ b/storage/innobase/mysql-test/storage_engine/cache_index.rdiff @@ -0,0 +1,71 @@ +--- suite/storage_engine/cache_index.result 2012-07-15 00:22:19.822493731 +0400 ++++ suite/storage_engine/cache_index.reject 2012-07-15 17:47:18.321522834 +0400 +@@ -12,31 +12,31 @@ + SET GLOBAL <CACHE_NAME>.key_buffer_size=128*1024; + CACHE INDEX t1 INDEX (a), t2 IN <CACHE_NAME>; + Table Op Msg_type Msg_text +-test.t1 assign_to_keycache status OK +-test.t2 assign_to_keycache status OK ++test.t1 assign_to_keycache note The storage engine for the table doesn't support assign_to_keycache ++test.t2 assign_to_keycache note The storage engine for the table doesn't support assign_to_keycache + LOAD INDEX INTO CACHE t1, t2; + Table Op Msg_type Msg_text +-test.t1 preload_keys status OK +-test.t2 preload_keys status OK ++test.t1 preload_keys note The storage engine for the table doesn't support preload_keys ++test.t2 preload_keys note The storage engine for the table doesn't support preload_keys + INSERT INTO t1 (a,b) VALUES (3,'c'),(4,'d'); + SET GLOBAL <CACHE_NAME>.key_buffer_size=8*1024; + LOAD INDEX INTO CACHE t1, t2 IGNORE LEAVES; + Table Op Msg_type Msg_text +-test.t1 preload_keys status OK +-test.t2 preload_keys status OK ++test.t1 preload_keys note The storage engine for the table doesn't support preload_keys ++test.t2 preload_keys note The storage engine for the table doesn't support preload_keys + SET GLOBAL <CACHE_NAME>.key_cache_age_threshold = 100, <CACHE_NAME>.key_cache_block_size = 512, <CACHE_NAME>.key_cache_division_limit = 1, <CACHE_NAME>.key_cache_segments=2; + INSERT INTO t1 (a,b) VALUES (5,'e'),(6,'f'); + LOAD INDEX INTO CACHE t1; + Table Op Msg_type Msg_text +-test.t1 preload_keys status OK ++test.t1 preload_keys note The storage engine for the table doesn't support preload_keys + SET GLOBAL new_<CACHE_NAME>.key_buffer_size=128*1024; + CACHE INDEX t1 IN new_<CACHE_NAME>; + Table Op Msg_type Msg_text +-test.t1 assign_to_keycache status OK ++test.t1 assign_to_keycache note The storage engine for the table doesn't support assign_to_keycache + INSERT INTO t1 (a,b) VALUES (7,'g'),(8,'h'); + LOAD INDEX INTO CACHE t1 IGNORE LEAVES; + Table Op Msg_type Msg_text +-test.t1 preload_keys status OK ++test.t1 preload_keys note The storage engine for the table doesn't support preload_keys + INSERT INTO t1 (a,b) VALUES (9,'i'); + DROP TABLE t2; + DROP TABLE t1; +@@ -47,11 +47,11 @@ + ) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; + CACHE INDEX t1 IN <CACHE_NAME>; + Table Op Msg_type Msg_text +-test.t1 assign_to_keycache status OK ++test.t1 assign_to_keycache note The storage engine for the table doesn't support assign_to_keycache + INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); + LOAD INDEX INTO CACHE t1; + Table Op Msg_type Msg_text +-test.t1 preload_keys status OK ++test.t1 preload_keys note The storage engine for the table doesn't support preload_keys + DROP TABLE t1; + CREATE TABLE t1 (a <INT_COLUMN>, + b <CHAR_COLUMN>, +@@ -59,11 +59,11 @@ + ) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; + CACHE INDEX t1 IN <CACHE_NAME>; + Table Op Msg_type Msg_text +-test.t1 assign_to_keycache status OK ++test.t1 assign_to_keycache note The storage engine for the table doesn't support assign_to_keycache + INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); + LOAD INDEX INTO CACHE t1; + Table Op Msg_type Msg_text +-test.t1 preload_keys status OK ++test.t1 preload_keys note The storage engine for the table doesn't support preload_keys + DROP TABLE t1; + SET GLOBAL <CACHE_NAME>.key_buffer_size=0; + SET GLOBAL new_<CACHE_NAME>.key_buffer_size=0; diff --git a/storage/innobase/mysql-test/storage_engine/checksum_table_live.rdiff b/storage/innobase/mysql-test/storage_engine/checksum_table_live.rdiff new file mode 100644 index 00000000000..71c782848a6 --- /dev/null +++ b/storage/innobase/mysql-test/storage_engine/checksum_table_live.rdiff @@ -0,0 +1,13 @@ +--- suite/storage_engine/checksum_table_live.result 2012-07-12 21:05:44.497062968 +0400 ++++ suite/storage_engine/checksum_table_live.reject 2012-07-15 17:47:28.105399836 +0400 +@@ -11,8 +11,8 @@ + test.t1 4272806499 + CHECKSUM TABLE t1, t2 QUICK; + Table Checksum +-test.t1 4272806499 +-test.t2 0 ++test.t1 NULL ++test.t2 NULL + CHECKSUM TABLE t1, t2 EXTENDED; + Table Checksum + test.t1 4272806499 diff --git a/storage/innobase/mysql-test/storage_engine/define_engine.inc b/storage/innobase/mysql-test/storage_engine/define_engine.inc new file mode 100644 index 00000000000..7d7b0c7407a --- /dev/null +++ b/storage/innobase/mysql-test/storage_engine/define_engine.inc @@ -0,0 +1,45 @@ +########################################### +# +# This is a template of the include file define_engine.inc which +# should be placed in storage/<engine>/mysql-test/storage_engine folder. +# +################################ +# +# The name of the engine under test must be defined in $ENGINE variable. +# You can set it either here (uncomment and edit) or in your environment. +# +let $ENGINE = InnoDB; +# +################################ +# +# The following three variables define specific options for columns and tables. +# Normally there should be none needed, but for some engines it can be different. +# If the engine requires specific column option for all or indexed columns, +# set them inside the comment, e.g. /*!NOT NULL*/. +# Do the same for table options if needed, e.g. /*!INSERT_METHOD=LAST*/ + +let $default_col_opts = /*!*/; +let $default_col_indexed_opts = /*!*/; +let $default_tbl_opts = /*!*/; + +# INDEX, UNIQUE INDEX, PRIMARY KEY, special index type - choose the fist that the engine allows, +# or set it to /*!*/ if none is supported + +let $default_index = /*!INDEX*/; + +# If the engine does not support the following types, replace them with the closest possible + +let $default_int_type = INT(11); +let $default_char_type = CHAR(8); + +################################ + +--disable_query_log +--disable_result_log + +# Here you can place your custom MTR code which needs to be executed before each test, +# e.g. creation of an additional schema or table, etc. +# The cleanup part should be defined in cleanup_engine.inc + +--enable_query_log +--enable_result_log diff --git a/storage/innobase/mysql-test/storage_engine/disabled.def b/storage/innobase/mysql-test/storage_engine/disabled.def new file mode 100644 index 00000000000..3849170a7b8 --- /dev/null +++ b/storage/innobase/mysql-test/storage_engine/disabled.def @@ -0,0 +1,9 @@ +alter_table_online : MDEV-397 (Changing a column name via ALTER ONLINE does not work for InnoDB) +autoinc_vars : MySQL:65225 (InnoDB miscalculates auto-increment) +tbl_opt_ai : MySQL:65901 (AUTO_INCREMENT option on InnoDB table is ignored if added before autoinc column) +delete_low_prio : InnoDB does not use table-level locking +insert_high_prio : InnoDB does not use table-level locking +insert_low_prio : InnoDB does not use table-level locking +select_high_prio : InnoDB does not use table-level locking +update_low_prio : InnoDB does not use table-level locking + diff --git a/storage/innobase/mysql-test/storage_engine/fulltext_search.rdiff b/storage/innobase/mysql-test/storage_engine/fulltext_search.rdiff new file mode 100644 index 00000000000..f668e44109c --- /dev/null +++ b/storage/innobase/mysql-test/storage_engine/fulltext_search.rdiff @@ -0,0 +1,150 @@ +--- suite/storage_engine/fulltext_search.result 2012-07-12 20:03:26.664053893 +0400 ++++ suite/storage_engine/fulltext_search.reject 2012-07-15 17:49:03.616199102 +0400 +@@ -4,129 +4,27 @@ + v2 TEXT <CUSTOM_COL_OPTIONS>, + FULLTEXT v1 (v1) + ) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +-SHOW INDEXES IN t1; +-Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +-t1 1 v1 1 v1 # # NULL NULL YES FULLTEXT +-INSERT INTO t1 (v0,v1,v2) VALUES ('text1','Here is a list of recommended books on MariaDB and MySQL. We\'ve provided links to Amazon.com here for convenience, but they can be found at many other bookstores, both online and off. +-If you want to have your favorite MySQL / MariaDB book listed here, please leave a comment. +-For developers who want to code on MariaDB or MySQL +-* Understanding MySQL Internals by Sasha Pachev, former MySQL developer at MySQL AB. +-o This is the only book we know about that describes the internals of MariaDB / MySQL. A must have for anyone who wants to understand and develop on MariaDB! +-o Not all topics are covered and some parts are slightly outdated, but still the best book on this topic. +-* MySQL 5.1 Plugin Development by Sergei Golubchik and Andrew Hutchings +-o A must read for anyone wanting to write a plugin for MariaDB, written by the Sergei who designed the plugin interface for MySQL and MariaDB! +-For MariaDB / MySQL end users +-* MariaDB Crash Course by Ben Forta +-o First MariaDB book! +-o For people who want to learn SQL and the basics of MariaDB. +-o Now shipping. Purchase at Amazon.com or your favorite bookseller. +-* SQL-99 Complete, Really by Peter Gulutzan & Trudy Pelzer. +-o Everything you wanted to know about the SQL 99 standard. Excellent reference book! +-o Free to read in the Knowledgebase! +-* MySQL (4th Edition) by Paul DuBois +-o The \'default\' book to read if you wont to learn to use MySQL / MariaDB. +-* MySQL Cookbook by Paul DuBois +-o A lot of examples of how to use MySQL. As with all of Paul\'s books, it\'s worth its weight in gold and even enjoyable reading for such a \'dry\' subject. +-* High Performance MySQL, Second Edition, By Baron Schwartz, Peter Zaitsev, Vadim Tkachenko, Jeremy D. Zawodny, Arjen Lentz, Derek J. Balling, et al. +-o \"High Performance MySQL is the definitive guide to building fast, reliable systems with MySQL. Written by noted experts with years of real-world experience building very large systems, this book covers every aspect of MySQL performance in detail, and focuses on robustness, security, and data integrity. Learn advanced techniques in depth so you can bring out MySQL\'s full power.\" (From the book description at O\'Reilly) +- +- * MySQL Admin Cookbook +- o A quick step-by-step guide for MySQL users and database administrators to tackle real-world challenges with MySQL configuration and administration +- +- * MySQL 5.0 Certification Study Guide, By Paul DuBois, Stefan Hinz, Carsten Pedersen +- o This is the official guide to cover the passing of the two MySQL Certification examinations. It is valid till version 5.0 of the server, so while it misses all the features available in MySQL 5.1 and greater (including MariaDB 5.1 and greater), it provides a good basic understanding of MySQL for the end-user. ', +-'There are several reasons why contributing code is one of the easiest and most rewarding ways to contribute to MariaDB: +- +- 1. We are very responsive toward reviews of submitted code and as soon as the review is done, the submitted code is merged into an existing MariaDB tree and made available to everyone, not just select customers. +- 2. Code reviews are performed by the MariaDB core development team and the quality, detail, and timeliness of our reviews are better than you will find elsewhere. +- 3. With MariaDB everyone has access to the latest code. +- 4. If a patch is very safe and/or very useful we are willing to push it into the stable code (as long as it can\'t break any existing applications). We are willing to do this to ensure the freedom to add small, needed fixes on a stable release so users don\'t have to wait a year for something to be added which is critical to their business. +- 5. If you are an active contributor, you can become a member of maria-captains, even if you aren\'t working for Monty Program Ab. All captains have the same rights as any other captain to accept and reject patches. Our development model is truly open for everyone. +-The Contributing Code page details many of the actual steps involved in working with the MariaDB source code. It\'s important that you use the same tools and submit patches in the same way as other developers to keep development running smoothly.' +- ), ('text2','test1','test2'); +-SELECT v0 FROM t1 WHERE MATCH(v1) AGAINST ('contributing' IN NATURAL LANGUAGE MODE); +-v0 +-INSERT INTO t1 (v0,v1,v2) VALUES ('text3','test','test'); +-SELECT v0, MATCH(v1) AGAINST('contributing' IN NATURAL LANGUAGE MODE) AS rating FROM t1 WHERE MATCH(v1) AGAINST ('contributing' IN NATURAL LANGUAGE MODE); +-v0 rating +-INSERT INTO t1 (v0,v1,v2) VALUES ('text4','Contributing more...','...is a good idea'),('text5','test','test'); +-SELECT v0, MATCH(v1) AGAINST('contributing') AS rating FROM t1 WHERE MATCH(v1) AGAINST ('contributing'); +-v0 rating +-text4 1.3705332279205322 +-SELECT v0 FROM t1 WHERE MATCH(v1,v2) AGAINST ('-test1 +critical +Cook*' IN BOOLEAN MODE); +-v0 +-text1 +-SELECT v0 FROM t1 WHERE MATCH(v1,v2) AGAINST ('-patch +critical +Cook*' IN BOOLEAN MODE); +-v0 +-SELECT v0, MATCH(v1) AGAINST('database' WITH QUERY EXPANSION) AS rating FROM t1 WHERE MATCH(v1) AGAINST ('database' WITH QUERY EXPANSION); +-v0 rating +-text1 178.11756896972656 +-DROP TABLE t1; ++ERROR HY000: The used table type doesn't support FULLTEXT indexes ++# ERROR: Statement ended with errno 1214, errname ER_TABLE_CANT_HANDLE_FT (expected to succeed) ++# ------------ UNEXPECTED RESULT ------------ ++# The statement|command finished with ER_TABLE_CANT_HANDLE_FT. ++# FULLTEXT indexes or VARCHAR|TEXT data types or the mix could be unsupported|malfunctioning, or the problem was caused by previous errors. ++# You can change the engine code, or create an rdiff, or disable the test by adding it to disabled.def. ++# Further in this test, the message might sometimes be suppressed; a part of the test might be skipped. ++# Also, this problem may cause a chain effect (more errors of different kinds in the test). ++# ------------------------------------------- + CREATE TABLE t1 (v0 VARCHAR(64) <CUSTOM_COL_OPTIONS>, + v1 VARCHAR(16384) <CUSTOM_COL_OPTIONS>, + v2 TEXT <CUSTOM_COL_OPTIONS>, + FULLTEXT v1 (v1), + FULLTEXT v1_v2 (v1,v2) + ) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +-SHOW INDEXES IN t1; +-Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +-t1 1 v1 1 v1 # # NULL NULL YES FULLTEXT +-t1 1 v1_v2 1 v1 # # NULL NULL YES FULLTEXT +-t1 1 v1_v2 2 v2 # # NULL NULL YES FULLTEXT +-INSERT INTO t1 (v0,v1,v2) VALUES ('text1','Here is a list of recommended books on MariaDB and MySQL. We\'ve provided links to Amazon.com here for convenience, but they can be found at many other bookstores, both online and off. +-If you want to have your favorite MySQL / MariaDB book listed here, please leave a comment. +-For developers who want to code on MariaDB or MySQL +-* Understanding MySQL Internals by Sasha Pachev, former MySQL developer at MySQL AB. +-o This is the only book we know about that describes the internals of MariaDB / MySQL. A must have for anyone who wants to understand and develop on MariaDB! +-o Not all topics are covered and some parts are slightly outdated, but still the best book on this topic. +-* MySQL 5.1 Plugin Development by Sergei Golubchik and Andrew Hutchings +-o A must read for anyone wanting to write a plugin for MariaDB, written by the Sergei who designed the plugin interface for MySQL and MariaDB! +-For MariaDB / MySQL end users +-* MariaDB Crash Course by Ben Forta +-o First MariaDB book! +-o For people who want to learn SQL and the basics of MariaDB. +-o Now shipping. Purchase at Amazon.com or your favorite bookseller. +-* SQL-99 Complete, Really by Peter Gulutzan & Trudy Pelzer. +-o Everything you wanted to know about the SQL 99 standard. Excellent reference book! +-o Free to read in the Knowledgebase! +-* MySQL (4th Edition) by Paul DuBois +-o The \'default\' book to read if you wont to learn to use MySQL / MariaDB. +-* MySQL Cookbook by Paul DuBois +-o A lot of examples of how to use MySQL. As with all of Paul\'s books, it\'s worth its weight in gold and even enjoyable reading for such a \'dry\' subject. +-* High Performance MySQL, Second Edition, By Baron Schwartz, Peter Zaitsev, Vadim Tkachenko, Jeremy D. Zawodny, Arjen Lentz, Derek J. Balling, et al. +-o \"High Performance MySQL is the definitive guide to building fast, reliable systems with MySQL. Written by noted experts with years of real-world experience building very large systems, this book covers every aspect of MySQL performance in detail, and focuses on robustness, security, and data integrity. Learn advanced techniques in depth so you can bring out MySQL\'s full power.\" (From the book description at O\'Reilly) +- +- * MySQL Admin Cookbook +- o A quick step-by-step guide for MySQL users and database administrators to tackle real-world challenges with MySQL configuration and administration +- +- * MySQL 5.0 Certification Study Guide, By Paul DuBois, Stefan Hinz, Carsten Pedersen +- o This is the official guide to cover the passing of the two MySQL Certification examinations. It is valid till version 5.0 of the server, so while it misses all the features available in MySQL 5.1 and greater (including MariaDB 5.1 and greater), it provides a good basic understanding of MySQL for the end-user. ', +-'There are several reasons why contributing code is one of the easiest and most rewarding ways to contribute to MariaDB: +- +- 1. We are very responsive toward reviews of submitted code and as soon as the review is done, the submitted code is merged into an existing MariaDB tree and made available to everyone, not just select customers. +- 2. Code reviews are performed by the MariaDB core development team and the quality, detail, and timeliness of our reviews are better than you will find elsewhere. +- 3. With MariaDB everyone has access to the latest code. +- 4. If a patch is very safe and/or very useful we are willing to push it into the stable code (as long as it can\'t break any existing applications). We are willing to do this to ensure the freedom to add small, needed fixes on a stable release so users don\'t have to wait a year for something to be added which is critical to their business. +- 5. If you are an active contributor, you can become a member of maria-captains, even if you aren\'t working for Monty Program Ab. All captains have the same rights as any other captain to accept and reject patches. Our development model is truly open for everyone. +-The Contributing Code page details many of the actual steps involved in working with the MariaDB source code. It\'s important that you use the same tools and submit patches in the same way as other developers to keep development running smoothly.' +- ), ('text2','test1','test2'); +-SELECT v0 FROM t1 WHERE MATCH(v1,v2) AGAINST ('contributing' IN NATURAL LANGUAGE MODE); +-v0 +-INSERT INTO t1 (v0,v1,v2) VALUES ('text3','test','test'); +-SELECT v0, MATCH(v1,v2) AGAINST('contributing' IN NATURAL LANGUAGE MODE) AS rating FROM t1 WHERE MATCH(v1,v2) AGAINST ('contributing' IN NATURAL LANGUAGE MODE); +-v0 rating +-text1 0.2809644043445587 +-INSERT INTO t1 (v0,v1,v2) VALUES ('text4','Contributing more...','...is a good idea'),('text5','test','test'); +-SELECT v0, MATCH(v1) AGAINST('contributing') AS rating FROM t1 WHERE MATCH(v1) AGAINST ('contributing'); +-v0 rating +-text4 1.3705332279205322 +-SELECT v0 FROM t1 WHERE MATCH(v1,v2) AGAINST ('-test1 +critical +Cook*' IN BOOLEAN MODE); +-v0 +-text1 +-SELECT v0 FROM t1 WHERE MATCH(v1,v2) AGAINST ('-patch +critical +Cook*' IN BOOLEAN MODE); +-v0 +-SELECT v0, MATCH(v1,v2) AGAINST('database' WITH QUERY EXPANSION) AS rating FROM t1 WHERE MATCH(v1,v2) AGAINST ('database' WITH QUERY EXPANSION); +-v0 rating +-text1 190.56150817871094 +-text4 1.1758291721343994 +-DROP TABLE t1; ++ERROR HY000: The used table type doesn't support FULLTEXT indexes ++# ERROR: Statement ended with errno 1214, errname ER_TABLE_CANT_HANDLE_FT (expected to succeed) ++# ------------ UNEXPECTED RESULT ------------ ++# The statement|command finished with ER_TABLE_CANT_HANDLE_FT. ++# FULLTEXT indexes or multiple keys or VARCHAR|TEXT data types or the mix could be unsupported|malfunctioning, or the problem was caused by previous errors. ++# You can change the engine code, or create an rdiff, or disable the test by adding it to disabled.def. ++# Further in this test, the message might sometimes be suppressed; a part of the test might be skipped. ++# Also, this problem may cause a chain effect (more errors of different kinds in the test). ++# ------------------------------------------- diff --git a/storage/innobase/mysql-test/storage_engine/index_enable_disable.rdiff b/storage/innobase/mysql-test/storage_engine/index_enable_disable.rdiff new file mode 100644 index 00000000000..23aa66d2568 --- /dev/null +++ b/storage/innobase/mysql-test/storage_engine/index_enable_disable.rdiff @@ -0,0 +1,33 @@ +--- suite/storage_engine/index_enable_disable.result 2012-07-15 00:30:05.296641931 +0400 ++++ suite/storage_engine/index_enable_disable.reject 2012-07-15 17:49:12.988081281 +0400 +@@ -11,15 +11,19 @@ + Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment + t1 1 a 1 a # # NULL NULL YES BTREE + ALTER TABLE t1 DISABLE KEYS; ++Warnings: ++Note 1031 Table storage engine for 't1' doesn't have this option + SHOW INDEX IN t1; + Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +-t1 1 a 1 a # # NULL NULL YES BTREE disabled ++t1 1 a 1 a # # NULL NULL YES BTREE + EXPLAIN SELECT a FROM t1 ORDER BY a; + id select_type table type possible_keys key key_len ref rows Extra +-1 SIMPLE t1 ALL NULL NULL NULL NULL 19 Using filesort ++1 SIMPLE t1 index NULL a 5 NULL 19 Using index + INSERT INTO t1 (a) VALUES + (11),(12),(13),(14),(15),(16),(17),(18),(19),(20); + ALTER TABLE t1 ENABLE KEYS; ++Warnings: ++Note 1031 Table storage engine for 't1' doesn't have this option + SHOW INDEX IN t1; + Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment + t1 1 a 1 a # # NULL NULL YES BTREE +@@ -32,6 +36,8 @@ + (1),(2),(3),(4),(5),(6),(7),(8),(9), + (21),(22),(23),(24),(25),(26),(27),(28),(29); + ALTER TABLE t1 DISABLE KEYS; ++Warnings: ++Note 1031 Table storage engine for 't1' doesn't have this option + INSERT INTO t1 (a) VALUES (29); + ERROR 23000: Duplicate entry '29' for key 'a' + # Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY). diff --git a/storage/innobase/mysql-test/storage_engine/index_type_hash.rdiff b/storage/innobase/mysql-test/storage_engine/index_type_hash.rdiff new file mode 100644 index 00000000000..02f9d93588f --- /dev/null +++ b/storage/innobase/mysql-test/storage_engine/index_type_hash.rdiff @@ -0,0 +1,60 @@ +--- suite/storage_engine/index_type_hash.result 2012-07-15 01:10:17.919128889 +0400 ++++ suite/storage_engine/index_type_hash.reject 2012-07-15 17:49:26.135915989 +0400 +@@ -4,7 +4,7 @@ + ) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; + SHOW KEYS IN t1; + Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +-t1 1 a 1 a # # NULL NULL # HASH ++t1 1 a 1 a # # NULL NULL # BTREE + DROP TABLE t1; + CREATE TABLE t1 (a <INT_COLUMN>, + b <CHAR_COLUMN>, +@@ -12,8 +12,8 @@ + ) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; + SHOW KEYS IN t1; + Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +-t1 1 a_b 1 a # # NULL NULL # HASH a_b index +-t1 1 a_b 2 b # # NULL NULL # HASH a_b index ++t1 1 a_b 1 a # # NULL NULL # BTREE a_b index ++t1 1 a_b 2 b # # NULL NULL # BTREE a_b index + DROP TABLE t1; + CREATE TABLE t1 (a <INT_COLUMN>, + b <CHAR_COLUMN>, +@@ -22,8 +22,8 @@ + ) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; + SHOW KEYS IN t1; + Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +-t1 1 a 1 a # # NULL NULL # HASH +-t1 1 b 1 b # # NULL NULL # HASH ++t1 1 a 1 a # # NULL NULL # BTREE ++t1 1 b 1 b # # NULL NULL # BTREE + DROP TABLE t1; + CREATE TABLE t1 (a <INT_COLUMN>, + b <CHAR_COLUMN>, +@@ -31,7 +31,7 @@ + ) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; + SHOW KEYS IN t1; + Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +-t1 0 a 1 a # # NULL NULL # HASH ++t1 0 a 1 a # # NULL NULL # BTREE + INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); + INSERT INTO t1 (a,b) VALUES (1,'c'); + ERROR 23000: Duplicate entry '1' for key 'a' +@@ -43,7 +43,7 @@ + ALTER TABLE t1 ADD <CUSTOM_INDEX> (a) USING HASH COMMENT 'simple index on a'; + SHOW INDEX FROM t1; + Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +-t1 1 a 1 a # # NULL NULL # HASH simple index on a ++t1 1 a 1 a # # NULL NULL # BTREE simple index on a + ALTER TABLE t1 DROP KEY a; + DROP TABLE t1; + CREATE TABLE t1 (a <INT_COLUMN>, +@@ -52,7 +52,7 @@ + ) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; + SHOW KEYS IN t1; + Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +-t1 0 a 1 a # # NULL NULL # HASH ++t1 0 a 1 a # # NULL NULL # BTREE + INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); + INSERT INTO t1 (a,b) VALUES (1,'c'); + ERROR 23000: Duplicate entry '1' for key 'a' diff --git a/storage/innobase/mysql-test/storage_engine/insert_delayed.rdiff b/storage/innobase/mysql-test/storage_engine/insert_delayed.rdiff new file mode 100644 index 00000000000..62895fa928f --- /dev/null +++ b/storage/innobase/mysql-test/storage_engine/insert_delayed.rdiff @@ -0,0 +1,26 @@ +--- suite/storage_engine/insert_delayed.result 2012-07-12 20:04:07.143544998 +0400 ++++ suite/storage_engine/insert_delayed.reject 2012-07-15 17:49:34.551810189 +0400 +@@ -5,7 +5,16 @@ + connect con0,localhost,root,,; + SET lock_wait_timeout = 1; + INSERT DELAYED INTO t1 (a,b) VALUES (3,'c'); ++ERROR HY000: DELAYED option not supported for table 't1' ++# ------------ UNEXPECTED RESULT ------------ ++# The statement|command finished with ER_DELAYED_NOT_SUPPORTED. ++# INSERT DELAYED or the mix could be unsupported|malfunctioning, or the problem was caused by previous errors. ++# You can change the engine code, or create an rdiff, or disable the test by adding it to disabled.def. ++# Further in this test, the message might sometimes be suppressed; a part of the test might be skipped. ++# Also, this problem may cause a chain effect (more errors of different kinds in the test). ++# ------------------------------------------- + INSERT DELAYED INTO t1 SET a=4, b='d'; ++ERROR HY000: DELAYED option not supported for table 't1' + INSERT DELAYED INTO t1 SELECT 5, 'e'; + ERROR HY000: Lock wait timeout exceeded; try restarting transaction + disconnect con0; +@@ -20,6 +29,4 @@ + a b + 1 f + 2 b +-3 c +-4 d + DROP TABLE t1; diff --git a/storage/innobase/mysql-test/storage_engine/lock_concurrent.rdiff b/storage/innobase/mysql-test/storage_engine/lock_concurrent.rdiff new file mode 100644 index 00000000000..fe4a0087fa9 --- /dev/null +++ b/storage/innobase/mysql-test/storage_engine/lock_concurrent.rdiff @@ -0,0 +1,22 @@ +--- suite/storage_engine/lock_concurrent.result 2012-06-24 23:55:19.539380000 +0400 ++++ suite/storage_engine/lock_concurrent.reject 2012-07-15 17:50:21.279222746 +0400 +@@ -3,10 +3,19 @@ + LOCK TABLES t1 WRITE CONCURRENT, t1 AS t2 READ; + SET lock_wait_timeout = 1; + LOCK TABLES t1 READ LOCAL; ++ERROR HY000: Lock wait timeout exceeded; try restarting transaction ++# ------------ UNEXPECTED RESULT ------------ ++# The statement|command finished with ER_LOCK_WAIT_TIMEOUT. ++# LOCK .. WRITE CONCURRENT or the mix could be unsupported|malfunctioning, or the problem was caused by previous errors. ++# You can change the engine code, or create an rdiff, or disable the test by adding it to disabled.def. ++# Further in this test, the message might sometimes be suppressed; a part of the test might be skipped. ++# Also, this problem may cause a chain effect (more errors of different kinds in the test). ++# ------------------------------------------- + UNLOCK TABLES; + UNLOCK TABLES; + LOCK TABLES t1 READ LOCAL; + LOCK TABLES t1 WRITE CONCURRENT, t1 AS t2 READ; ++ERROR HY000: Lock wait timeout exceeded; try restarting transaction + UNLOCK TABLES; + UNLOCK TABLES; + DROP TABLE t1; diff --git a/storage/innobase/mysql-test/storage_engine/optimize_table.rdiff b/storage/innobase/mysql-test/storage_engine/optimize_table.rdiff new file mode 100644 index 00000000000..54d1f600516 --- /dev/null +++ b/storage/innobase/mysql-test/storage_engine/optimize_table.rdiff @@ -0,0 +1,37 @@ +--- suite/storage_engine/optimize_table.result 2012-07-12 19:13:53.741428591 +0400 ++++ suite/storage_engine/optimize_table.reject 2012-07-15 17:50:30.843102510 +0400 +@@ -5,25 +5,32 @@ + INSERT INTO t1 (a,b) VALUES (3,'c'),(4,'d'); + OPTIMIZE TABLE t1; + Table Op Msg_type Msg_text ++test.t1 optimize note Table does not support optimize, doing recreate + analyze instead + test.t1 optimize status OK + INSERT INTO t2 (a,b) VALUES (4,'d'); + OPTIMIZE NO_WRITE_TO_BINLOG TABLE t2; + Table Op Msg_type Msg_text ++test.t2 optimize note Table does not support optimize, doing recreate + analyze instead + test.t2 optimize status OK + INSERT INTO t2 (a,b) VALUES (5,'e'); + INSERT INTO t1 (a,b) VALUES (6,'f'); + OPTIMIZE LOCAL TABLE t1, t2; + Table Op Msg_type Msg_text ++test.t1 optimize note Table does not support optimize, doing recreate + analyze instead + test.t1 optimize status OK ++test.t2 optimize note Table does not support optimize, doing recreate + analyze instead + test.t2 optimize status OK + OPTIMIZE TABLE t1, t2; + Table Op Msg_type Msg_text +-test.t1 optimize status Table is already up to date +-test.t2 optimize status Table is already up to date ++test.t1 optimize note Table does not support optimize, doing recreate + analyze instead ++test.t1 optimize status OK ++test.t2 optimize note Table does not support optimize, doing recreate + analyze instead ++test.t2 optimize status OK + DROP TABLE t1, t2; + CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>, <CUSTOM_INDEX> (a)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; + INSERT INTO t1 (a,b) VALUES (1,'a'),(100,'b'),(2,'c'),(3,'d'); + OPTIMIZE TABLE t1; + Table Op Msg_type Msg_text ++test.t1 optimize note Table does not support optimize, doing recreate + analyze instead + test.t1 optimize status OK + DROP TABLE t1; diff --git a/storage/innobase/mysql-test/storage_engine/parts/checksum_table.rdiff b/storage/innobase/mysql-test/storage_engine/parts/checksum_table.rdiff new file mode 100644 index 00000000000..3d4d2a683d9 --- /dev/null +++ b/storage/innobase/mysql-test/storage_engine/parts/checksum_table.rdiff @@ -0,0 +1,22 @@ +--- suite/storage_engine/parts/checksum_table.result 2012-07-12 21:41:00.754458011 +0400 ++++ suite/storage_engine/parts/checksum_table.reject 2012-07-15 20:04:35.881962676 +0400 +@@ -24,15 +24,15 @@ + CREATE TABLE t2 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> CHECKSUM=1 PARTITION BY HASH(a) PARTITIONS 2; + CHECKSUM TABLE t1; + Table Checksum +-test.t1 0 ++test.t1 4272806499 + CHECKSUM TABLE t2, t1; + Table Checksum + test.t2 0 +-test.t1 0 ++test.t1 4272806499 + CHECKSUM TABLE t1, t2 QUICK; + Table Checksum +-test.t1 0 +-test.t2 0 ++test.t1 NULL ++test.t2 NULL + CHECKSUM TABLE t1, t2 EXTENDED; + Table Checksum + test.t1 4272806499 diff --git a/storage/innobase/mysql-test/storage_engine/parts/create_table.rdiff b/storage/innobase/mysql-test/storage_engine/parts/create_table.rdiff new file mode 100644 index 00000000000..0df91c6fc6e --- /dev/null +++ b/storage/innobase/mysql-test/storage_engine/parts/create_table.rdiff @@ -0,0 +1,20 @@ +--- suite/storage_engine/parts/create_table.result 2012-07-12 21:56:38.618667460 +0400 ++++ suite/storage_engine/parts/create_table.reject 2012-07-15 20:06:43.496358345 +0400 +@@ -65,7 +65,7 @@ + 1 SIMPLE t1 abc,def # # # # # # # + EXPLAIN PARTITIONS SELECT a FROM t1 WHERE a = 100; + id select_type table partitions type possible_keys key key_len ref rows Extra +-1 SIMPLE NULL NULL # # # # # # # ++1 SIMPLE t1 def # # # # # # # + INSERT INTO t1 (a) VALUES (50); + ERROR HY000: Table has no partition for value 50 + DROP TABLE t1; +@@ -81,7 +81,7 @@ + 1 SIMPLE t1 abc_abcsp0,def_defsp0 # # # # # # # + EXPLAIN PARTITIONS SELECT a FROM t1 WHERE a = 100; + id select_type table partitions type possible_keys key key_len ref rows Extra +-1 SIMPLE NULL NULL # # # # # # # ++1 SIMPLE t1 def_defsp0 # # # # # # # + SELECT TABLE_SCHEMA, TABLE_NAME, PARTITION_NAME, SUBPARTITION_NAME, PARTITION_METHOD, SUBPARTITION_METHOD + FROM INFORMATION_SCHEMA.PARTITIONS WHERE TABLE_NAME = 't1'; + TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_METHOD SUBPARTITION_METHOD diff --git a/storage/innobase/mysql-test/storage_engine/parts/optimize_table.rdiff b/storage/innobase/mysql-test/storage_engine/parts/optimize_table.rdiff new file mode 100644 index 00000000000..77ee7e2eb31 --- /dev/null +++ b/storage/innobase/mysql-test/storage_engine/parts/optimize_table.rdiff @@ -0,0 +1,58 @@ +--- suite/storage_engine/parts/optimize_table.result 2012-07-12 22:16:39.343572304 +0400 ++++ suite/storage_engine/parts/optimize_table.reject 2012-07-15 20:07:01.632130348 +0400 +@@ -9,18 +9,22 @@ + INSERT INTO t1 (a,b) VALUES (3,'c'),(4,'d'); + ALTER TABLE t1 OPTIMIZE PARTITION p1; + Table Op Msg_type Msg_text ++test.t1 optimize note Table does not support optimize, doing recreate + analyze instead + test.t1 optimize status OK + INSERT INTO t2 (a,b) VALUES (4,'d'); + ALTER TABLE t2 OPTIMIZE PARTITION p0 NO_WRITE_TO_BINLOG; + Table Op Msg_type Msg_text ++test.t2 optimize note Table does not support optimize, doing recreate + analyze instead + test.t2 optimize status OK + INSERT INTO t1 (a,b) VALUES (6,'f'); + ALTER TABLE t1 OPTIMIZE PARTITION ALL LOCAL; + Table Op Msg_type Msg_text ++test.t1 optimize note Table does not support optimize, doing recreate + analyze instead + test.t1 optimize status OK + INSERT INTO t2 (a,b) VALUES (5,'e'); + ALTER TABLE t2 OPTIMIZE PARTITION p1,p0; + Table Op Msg_type Msg_text ++test.t2 optimize note Table does not support optimize, doing recreate + analyze instead + test.t2 optimize status OK + DROP TABLE t1, t2; + DROP TABLE IF EXISTS t1,t2; +@@ -30,25 +34,32 @@ + INSERT INTO t1 (a,b) VALUES (3,'c'),(4,'d'); + OPTIMIZE TABLE t1; + Table Op Msg_type Msg_text ++test.t1 optimize note Table does not support optimize, doing recreate + analyze instead + test.t1 optimize status OK + INSERT INTO t2 (a,b) VALUES (4,'d'); + OPTIMIZE NO_WRITE_TO_BINLOG TABLE t2; + Table Op Msg_type Msg_text ++test.t2 optimize note Table does not support optimize, doing recreate + analyze instead + test.t2 optimize status OK + INSERT INTO t2 (a,b) VALUES (5,'e'); + INSERT INTO t1 (a,b) VALUES (6,'f'); + OPTIMIZE LOCAL TABLE t1, t2; + Table Op Msg_type Msg_text ++test.t1 optimize note Table does not support optimize, doing recreate + analyze instead + test.t1 optimize status OK ++test.t2 optimize note Table does not support optimize, doing recreate + analyze instead + test.t2 optimize status OK + OPTIMIZE TABLE t1, t2; + Table Op Msg_type Msg_text ++test.t1 optimize note Table does not support optimize, doing recreate + analyze instead + test.t1 optimize status OK ++test.t2 optimize note Table does not support optimize, doing recreate + analyze instead + test.t2 optimize status OK + DROP TABLE t1, t2; + CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>, <CUSTOM_INDEX> (a)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> PARTITION BY HASH(a) PARTITIONS 2; + INSERT INTO t1 (a,b) VALUES (1,'a'),(100,'b'),(2,'c'),(3,'d'); + OPTIMIZE TABLE t1; + Table Op Msg_type Msg_text ++test.t1 optimize note Table does not support optimize, doing recreate + analyze instead + test.t1 optimize status OK + DROP TABLE t1; diff --git a/storage/innobase/mysql-test/storage_engine/parts/repair_table.rdiff b/storage/innobase/mysql-test/storage_engine/parts/repair_table.rdiff new file mode 100644 index 00000000000..aab866fde83 --- /dev/null +++ b/storage/innobase/mysql-test/storage_engine/parts/repair_table.rdiff @@ -0,0 +1,228 @@ +--- suite/storage_engine/parts/repair_table.result 2012-07-15 01:22:58.861853325 +0400 ++++ suite/storage_engine/parts/repair_table.reject 2012-07-15 20:07:11.268009209 +0400 +@@ -9,27 +9,27 @@ + INSERT INTO t2 (a,b) SELECT a, b FROM t1; + ALTER TABLE t1 REPAIR PARTITION p0; + Table Op Msg_type Msg_text +-test.t1 repair status OK ++test.t1 repair note The storage engine for the table doesn't support repair + INSERT INTO t1 VALUES (3,'c'); + ALTER TABLE t1 REPAIR PARTITION NO_WRITE_TO_BINLOG p0, p1; + Table Op Msg_type Msg_text +-test.t1 repair status OK ++test.t1 repair note The storage engine for the table doesn't support repair + INSERT INTO t2 (a,b) VALUES (5,'e'),(6,'f'); + ALTER TABLE t2 REPAIR PARTITION LOCAL p1; + Table Op Msg_type Msg_text +-test.t2 repair status OK ++test.t2 repair note The storage engine for the table doesn't support repair + INSERT INTO t1 (a,b) VALUES (7,'g'),(8,'h'); + ALTER TABLE t1 REPAIR PARTITION LOCAL ALL EXTENDED; + Table Op Msg_type Msg_text +-test.t1 repair status OK ++test.t1 repair note The storage engine for the table doesn't support repair + INSERT INTO t1 VALUES (10,'j'); + ALTER TABLE t1 REPAIR PARTITION p1 QUICK USE_FRM; + Table Op Msg_type Msg_text +-test.t1 repair status OK ++test.t1 repair note The storage engine for the table doesn't support repair + INSERT INTO t2 (a,b) VALUES (12,'l'); + ALTER TABLE t2 REPAIR PARTITION NO_WRITE_TO_BINLOG ALL QUICK EXTENDED USE_FRM; + Table Op Msg_type Msg_text +-test.t2 repair status OK ++test.t2 repair note The storage engine for the table doesn't support repair + DROP TABLE t1, t2; + DROP TABLE IF EXISTS t1,t2; + CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> PARTITION BY HASH(a) PARTITIONS 2; +@@ -37,35 +37,35 @@ + CREATE TABLE t2 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> PARTITION BY HASH(a) PARTITIONS 2; + REPAIR TABLE t1; + Table Op Msg_type Msg_text +-test.t1 repair status OK ++test.t1 repair note The storage engine for the table doesn't support repair + INSERT INTO t1 (a,b) VALUES (3,'c'); + INSERT INTO t2 (a,b) VALUES (4,'d'); + REPAIR NO_WRITE_TO_BINLOG TABLE t1, t2; + Table Op Msg_type Msg_text +-test.t1 repair status OK +-test.t2 repair status OK ++test.t1 repair note The storage engine for the table doesn't support repair ++test.t2 repair note The storage engine for the table doesn't support repair + INSERT INTO t2 (a,b) VALUES (5,'e'),(6,'f'); + REPAIR LOCAL TABLE t2; + Table Op Msg_type Msg_text +-test.t2 repair status OK ++test.t2 repair note The storage engine for the table doesn't support repair + INSERT INTO t1 (a,b) VALUES (7,'g'),(8,'h'); + INSERT INTO t2 (a,b) VALUES (9,'i'); + REPAIR LOCAL TABLE t2, t1 EXTENDED; + Table Op Msg_type Msg_text +-test.t2 repair status OK +-test.t1 repair status OK ++test.t2 repair note The storage engine for the table doesn't support repair ++test.t1 repair note The storage engine for the table doesn't support repair + INSERT INTO t1 (a,b) VALUES (10,'j'); + INSERT INTO t2 (a,b) VALUES (11,'k'); + REPAIR TABLE t1, t2 QUICK USE_FRM; + Table Op Msg_type Msg_text +-test.t1 repair status OK +-test.t2 repair status OK ++test.t1 repair note The storage engine for the table doesn't support repair ++test.t2 repair note The storage engine for the table doesn't support repair + INSERT INTO t1 (a,b) VALUES (12,'l'); + INSERT INTO t2 (a,b) VALUES (13,'m'); + REPAIR NO_WRITE_TO_BINLOG TABLE t1, t2 QUICK EXTENDED USE_FRM; + Table Op Msg_type Msg_text +-test.t1 repair status OK +-test.t2 repair status OK ++test.t1 repair note The storage engine for the table doesn't support repair ++test.t2 repair note The storage engine for the table doesn't support repair + FLUSH TABLE t1; + INSERT INTO t1 (a,b) VALUES (14,'n'); + ERROR HY000: Failed to read from the .par file +@@ -93,127 +93,21 @@ + CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>, <CUSTOM_INDEX> (a)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> PARTITION BY HASH(a) PARTITIONS 2; + REPAIR TABLE t1; + Table Op Msg_type Msg_text +-test.t1 repair status OK ++test.t1 repair note The storage engine for the table doesn't support repair + INSERT INTO t1 (a,b) VALUES (7,'g'),(8,'h'); + REPAIR TABLE t1 EXTENDED; + Table Op Msg_type Msg_text +-test.t1 repair status OK ++test.t1 repair note The storage engine for the table doesn't support repair + INSERT INTO t1 (a,b) VALUES (10,'j'); + REPAIR TABLE t1 USE_FRM; + Table Op Msg_type Msg_text +-test.t1 repair status OK +-t1#P#p0.MYD +-t1#P#p0.MYI +-t1#P#p1.MYD +-t1#P#p1.MYI ++test.t1 repair note The storage engine for the table doesn't support repair + t1.frm + t1.par + INSERT INTO t1 (a,b) VALUES (14,'n'),(15,'o'); + # Statement ended with one of expected results (0,144). + # If you got a difference in error message, just add it to rdiff file + FLUSH TABLE t1; +-Restoring <DATADIR>/test/t1#P#p0.MYD +-CHECK TABLE t1; +-Table Op Msg_type Msg_text +-test.t1 check error Size of datafile is: 26 Should be: 39 +-test.t1 check error Partition p0 returned error +-test.t1 check error Corrupt +-SELECT * FROM t1; +-a b +-8 h +-10 j +-7 g +-15 o +-Warnings: +-Error 145 Table './test/t1#P#p0' is marked as crashed and should be repaired +-Error 1194 Table 't1' is marked as crashed and should be repaired +-Error 1034 Number of rows changed from 3 to 2 +-# Statement ended with one of expected results (0,ER_NOT_KEYFILE,144). +-# If you got a difference in error message, just add it to rdiff file +-INSERT INTO t1 (a,b) VALUES (14,'n'),(15,'o'); +-# Statement ended with one of expected results (0,144). +-# If you got a difference in error message, just add it to rdiff file +-FLUSH TABLE t1; +-Restoring <DATADIR>/test/t1#P#p0.MYI +-CHECK TABLE t1; +-Table Op Msg_type Msg_text +-test.t1 check warning Size of datafile is: 39 Should be: 26 +-test.t1 check error Record-count is not ok; is 3 Should be: 2 +-test.t1 check warning Found 3 key parts. Should be: 2 +-test.t1 check error Partition p0 returned error +-test.t1 check error Corrupt +-SELECT * FROM t1; +-a b +-8 h +-10 j +-14 n +-7 g +-15 o +-15 o +-Warnings: +-Error 145 Table './test/t1#P#p0' is marked as crashed and should be repaired +-Error 1194 Table 't1' is marked as crashed and should be repaired +-Error 1034 Number of rows changed from 2 to 3 +-# Statement ended with one of expected results (0,ER_NOT_KEYFILE,144). +-# If you got a difference in error message, just add it to rdiff file +-INSERT INTO t1 (a,b) VALUES (14,'n'),(15,'o'); +-# Statement ended with one of expected results (0,144). +-# If you got a difference in error message, just add it to rdiff file +-FLUSH TABLE t1; +-Restoring <DATADIR>/test/t1#P#p1.MYD +-CHECK TABLE t1; +-Table Op Msg_type Msg_text +-test.t1 check error Size of datafile is: 39 Should be: 52 +-test.t1 check error Partition p1 returned error +-test.t1 check error Corrupt +-SELECT * FROM t1; +-a b +-8 h +-10 j +-14 n +-14 n +-7 g +-15 o +-15 o +-Warnings: +-Error 145 Table './test/t1#P#p1' is marked as crashed and should be repaired +-Error 1194 Table 't1' is marked as crashed and should be repaired +-Error 1034 Number of rows changed from 4 to 3 +-# Statement ended with one of expected results (0,ER_NOT_KEYFILE,144). +-# If you got a difference in error message, just add it to rdiff file +-INSERT INTO t1 (a,b) VALUES (14,'n'),(15,'o'); +-# Statement ended with one of expected results (0,144). +-# If you got a difference in error message, just add it to rdiff file +-FLUSH TABLE t1; +-Restoring <DATADIR>/test/t1#P#p1.MYI +-CHECK TABLE t1; +-Table Op Msg_type Msg_text +-test.t1 check warning Size of datafile is: 52 Should be: 39 +-test.t1 check error Record-count is not ok; is 4 Should be: 3 +-test.t1 check warning Found 4 key parts. Should be: 3 +-test.t1 check error Partition p1 returned error +-test.t1 check error Corrupt +-SELECT * FROM t1; +-a b +-8 h +-10 j +-14 n +-14 n +-14 n +-7 g +-15 o +-15 o +-15 o +-Warnings: +-Error 145 Table './test/t1#P#p1' is marked as crashed and should be repaired +-Error 1194 Table 't1' is marked as crashed and should be repaired +-Error 1034 Number of rows changed from 3 to 4 +-# Statement ended with one of expected results (0,ER_NOT_KEYFILE,144). +-# If you got a difference in error message, just add it to rdiff file +-INSERT INTO t1 (a,b) VALUES (14,'n'),(15,'o'); +-# Statement ended with one of expected results (0,144). +-# If you got a difference in error message, just add it to rdiff file +-FLUSH TABLE t1; + Restoring <DATADIR>/test/t1.par + CHECK TABLE t1; + Table Op Msg_type Msg_text +@@ -223,14 +117,8 @@ + 8 h + 10 j + 14 n +-14 n +-14 n +-14 n + 7 g + 15 o +-15 o +-15 o +-15 o + # Statement ended with one of expected results (0,ER_NOT_KEYFILE,144). + # If you got a difference in error message, just add it to rdiff file + DROP TABLE t1; diff --git a/storage/innobase/mysql-test/storage_engine/parts/suite.opt b/storage/innobase/mysql-test/storage_engine/parts/suite.opt new file mode 100644 index 00000000000..28ae8786144 --- /dev/null +++ b/storage/innobase/mysql-test/storage_engine/parts/suite.opt @@ -0,0 +1,4 @@ +--ignore-builtin-innodb +--plugin-load=ha_innodb +--innodb + diff --git a/storage/innobase/mysql-test/storage_engine/repair_table.rdiff b/storage/innobase/mysql-test/storage_engine/repair_table.rdiff new file mode 100644 index 00000000000..9c51fea47ff --- /dev/null +++ b/storage/innobase/mysql-test/storage_engine/repair_table.rdiff @@ -0,0 +1,129 @@ +--- suite/storage_engine/repair_table.result 2012-07-15 01:26:44.347708000 +0400 ++++ suite/storage_engine/repair_table.reject 2012-07-15 17:50:37.927013454 +0400 +@@ -4,56 +4,57 @@ + CREATE TABLE t2 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; + REPAIR TABLE t1; + Table Op Msg_type Msg_text +-test.t1 repair status OK ++test.t1 repair note The storage engine for the table doesn't support repair + INSERT INTO t1 (a,b) VALUES (3,'c'); + INSERT INTO t2 (a,b) VALUES (4,'d'); + REPAIR NO_WRITE_TO_BINLOG TABLE t1, t2; + Table Op Msg_type Msg_text +-test.t1 repair status OK +-test.t2 repair status OK ++test.t1 repair note The storage engine for the table doesn't support repair ++test.t2 repair note The storage engine for the table doesn't support repair + INSERT INTO t2 (a,b) VALUES (5,'e'),(6,'f'); + REPAIR LOCAL TABLE t2; + Table Op Msg_type Msg_text +-test.t2 repair status OK ++test.t2 repair note The storage engine for the table doesn't support repair + INSERT INTO t1 (a,b) VALUES (7,'g'),(8,'h'); + INSERT INTO t2 (a,b) VALUES (9,'i'); + REPAIR LOCAL TABLE t2, t1 EXTENDED; + Table Op Msg_type Msg_text +-test.t2 repair status OK +-test.t1 repair status OK ++test.t2 repair note The storage engine for the table doesn't support repair ++test.t1 repair note The storage engine for the table doesn't support repair + INSERT INTO t1 (a,b) VALUES (10,'j'); + INSERT INTO t2 (a,b) VALUES (11,'k'); + REPAIR TABLE t1, t2 QUICK USE_FRM; + Table Op Msg_type Msg_text +-test.t1 repair warning Number of rows changed from 0 to 6 +-test.t1 repair status OK +-test.t2 repair warning Number of rows changed from 0 to 5 +-test.t2 repair status OK ++test.t1 repair note The storage engine for the table doesn't support repair ++test.t2 repair note The storage engine for the table doesn't support repair + INSERT INTO t1 (a,b) VALUES (12,'l'); + INSERT INTO t2 (a,b) VALUES (13,'m'); + REPAIR NO_WRITE_TO_BINLOG TABLE t1, t2 QUICK EXTENDED USE_FRM; + Table Op Msg_type Msg_text +-test.t1 repair warning Number of rows changed from 0 to 7 +-test.t1 repair status OK +-test.t2 repair warning Number of rows changed from 0 to 6 +-test.t2 repair status OK ++test.t1 repair note The storage engine for the table doesn't support repair ++test.t2 repair note The storage engine for the table doesn't support repair + FLUSH TABLE t1; + INSERT INTO t1 (a,b) VALUES (14,'n'); +-ERROR HY000: Incorrect file format 't1' + # Statement ended with one of expected results (0,130,ER_FAILED_READ_FROM_PAR_FILE,ER_OPEN_AS_READONLY). + # If you got a difference in error message, just add it to rdiff file + CHECK TABLE t1; + Table Op Msg_type Msg_text +-test.t1 check Error Incorrect file format 't1' +-test.t1 check error Corrupt ++test.t1 check status OK + SELECT * FROM t1; +-ERROR HY000: Incorrect file format 't1' ++a b ++1 a ++2 b ++3 c ++7 g ++8 h ++10 j ++12 l ++14 n + # Statement ended with one of expected results (0,130,ER_FAILED_READ_FROM_PAR_FILE,ER_OPEN_AS_READONLY). + # If you got a difference in error message, just add it to rdiff file + REPAIR TABLE t1; + Table Op Msg_type Msg_text +-test.t1 repair Error Incorrect file format 't1' +-test.t1 repair error Corrupt ++test.t1 repair note The storage engine for the table doesn't support repair + DROP TABLE t1, t2; + call mtr.add_suppression("Got an error from thread_id=.*"); + call mtr.add_suppression("MySQL thread id .*, query id .* localhost.*root Checking table"); +@@ -62,45 +63,14 @@ + CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>, <CUSTOM_INDEX> (a)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; + REPAIR TABLE t1; + Table Op Msg_type Msg_text +-test.t1 repair status OK ++test.t1 repair note The storage engine for the table doesn't support repair + INSERT INTO t1 (a,b) VALUES (7,'g'),(8,'h'); + REPAIR TABLE t1 EXTENDED; + Table Op Msg_type Msg_text +-test.t1 repair status OK ++test.t1 repair note The storage engine for the table doesn't support repair + INSERT INTO t1 (a,b) VALUES (10,'j'); + REPAIR TABLE t1 USE_FRM; + Table Op Msg_type Msg_text +-test.t1 repair warning Number of rows changed from 0 to 3 +-test.t1 repair status OK +-t1.MYD +-t1.MYI ++test.t1 repair note The storage engine for the table doesn't support repair + t1.frm +-INSERT INTO t1 (a,b) VALUES (14,'n'),(15,'o'); +-# Statement ended with one of expected results (0,144). +-# If you got a difference in error message, just add it to rdiff file +-FLUSH TABLE t1; +-Restoring <DATADIR>/test/t1.MYD +-CHECK TABLE t1; +-Table Op Msg_type Msg_text +-test.t1 check error Size of datafile is: 39 Should be: 65 +-test.t1 check error Corrupt +-SELECT * FROM t1; +-ERROR HY000: Incorrect key file for table 't1'; try to repair it +-# Statement ended with one of expected results (0,ER_NOT_KEYFILE,144). +-# If you got a difference in error message, just add it to rdiff file +-INSERT INTO t1 (a,b) VALUES (14,'n'),(15,'o'); +-ERROR HY000: Table './test/t1' is marked as crashed and last (automatic?) repair failed +-# Statement ended with one of expected results (0,144). +-# If you got a difference in error message, just add it to rdiff file +-FLUSH TABLE t1; +-Restoring <DATADIR>/test/t1.MYI +-CHECK TABLE t1; +-Table Op Msg_type Msg_text +-test.t1 check warning Table is marked as crashed and last repair failed +-test.t1 check error Size of datafile is: 39 Should be: 65 +-test.t1 check error Corrupt +-SELECT * FROM t1; +-ERROR HY000: Table './test/t1' is marked as crashed and last (automatic?) repair failed +-# Statement ended with one of expected results (0,ER_NOT_KEYFILE,144). +-# If you got a difference in error message, just add it to rdiff file + DROP TABLE t1; diff --git a/storage/innobase/mysql-test/storage_engine/suite.opt b/storage/innobase/mysql-test/storage_engine/suite.opt new file mode 100644 index 00000000000..28ae8786144 --- /dev/null +++ b/storage/innobase/mysql-test/storage_engine/suite.opt @@ -0,0 +1,4 @@ +--ignore-builtin-innodb +--plugin-load=ha_innodb +--innodb + diff --git a/storage/innobase/mysql-test/storage_engine/tbl_opt_data_index_dir.rdiff b/storage/innobase/mysql-test/storage_engine/tbl_opt_data_index_dir.rdiff new file mode 100644 index 00000000000..47f624c73d9 --- /dev/null +++ b/storage/innobase/mysql-test/storage_engine/tbl_opt_data_index_dir.rdiff @@ -0,0 +1,18 @@ +--- suite/storage_engine/tbl_opt_data_index_dir.result 2012-06-24 23:55:19.539380000 +0400 ++++ suite/storage_engine/tbl_opt_data_index_dir.reject 2012-07-15 17:51:04.070684784 +0400 +@@ -4,7 +4,7 @@ + t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` char(8) DEFAULT NULL +-) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 DATA DIRECTORY='<DATA_DIR>' INDEX DIRECTORY='<INDEX_DIR>' ++) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 + Warnings: + Warning 1618 <INDEX DIRECTORY> option ignored + SHOW CREATE TABLE t1; +@@ -12,5 +12,5 @@ + t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` char(8) DEFAULT NULL +-) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 DATA DIRECTORY='<DATA_DIR>' INDEX DIRECTORY='<INDEX_DIR>' ++) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 + DROP TABLE t1; diff --git a/storage/innobase/mysql-test/storage_engine/tbl_opt_insert_method.rdiff b/storage/innobase/mysql-test/storage_engine/tbl_opt_insert_method.rdiff new file mode 100644 index 00000000000..468b82926f0 --- /dev/null +++ b/storage/innobase/mysql-test/storage_engine/tbl_opt_insert_method.rdiff @@ -0,0 +1,11 @@ +--- suite/storage_engine/tbl_opt_insert_method.result 2012-06-24 23:55:19.539380000 +0400 ++++ suite/storage_engine/tbl_opt_insert_method.reject 2012-07-15 17:51:09.978610512 +0400 +@@ -5,7 +5,7 @@ + t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` char(8) DEFAULT NULL +-) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 INSERT_METHOD=FIRST ++) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 + ALTER TABLE t1 INSERT_METHOD=NO; + SHOW CREATE TABLE t1; + Table Create Table diff --git a/storage/innobase/mysql-test/storage_engine/tbl_opt_key_block_size.opt b/storage/innobase/mysql-test/storage_engine/tbl_opt_key_block_size.opt new file mode 100644 index 00000000000..7cd737b2b87 --- /dev/null +++ b/storage/innobase/mysql-test/storage_engine/tbl_opt_key_block_size.opt @@ -0,0 +1,3 @@ +--innodb-file-per-table=1 +--innodb-file-format=Barracuda + diff --git a/storage/innobase/mysql-test/storage_engine/tbl_opt_row_format.opt b/storage/innobase/mysql-test/storage_engine/tbl_opt_row_format.opt new file mode 100644 index 00000000000..7cd737b2b87 --- /dev/null +++ b/storage/innobase/mysql-test/storage_engine/tbl_opt_row_format.opt @@ -0,0 +1,3 @@ +--innodb-file-per-table=1 +--innodb-file-format=Barracuda + diff --git a/storage/innobase/mysql-test/storage_engine/tbl_opt_row_format.rdiff b/storage/innobase/mysql-test/storage_engine/tbl_opt_row_format.rdiff new file mode 100644 index 00000000000..4c0e0c375f5 --- /dev/null +++ b/storage/innobase/mysql-test/storage_engine/tbl_opt_row_format.rdiff @@ -0,0 +1,10 @@ +--- suite/storage_engine/tbl_opt_row_format.result 2012-06-24 23:55:19.539380000 +0400 ++++ suite/storage_engine/tbl_opt_row_format.reject 2012-07-15 19:26:02.235049157 +0400 +@@ -1,5 +1,7 @@ + DROP TABLE IF EXISTS t1; + CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> ROW_FORMAT=FIXED; ++Warnings: ++Warning 1478 InnoDB: assuming ROW_FORMAT=COMPACT. + SHOW CREATE TABLE t1; + Table Create Table + t1 CREATE TABLE `t1` ( diff --git a/storage/innobase/mysql-test/storage_engine/tbl_opt_union.rdiff b/storage/innobase/mysql-test/storage_engine/tbl_opt_union.rdiff new file mode 100644 index 00000000000..cbdf5818022 --- /dev/null +++ b/storage/innobase/mysql-test/storage_engine/tbl_opt_union.rdiff @@ -0,0 +1,16 @@ +--- suite/storage_engine/tbl_opt_union.result 2012-06-24 23:55:19.539380000 +0400 ++++ suite/storage_engine/tbl_opt_union.reject 2012-07-15 17:51:31.014346053 +0400 +@@ -4,11 +4,11 @@ + Table Create Table + t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +-) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 UNION=(`child1`) ++) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 + ALTER TABLE t1 UNION = (child1,child2); + SHOW CREATE TABLE t1; + Table Create Table + t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +-) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 UNION=(`child1`,`child2`) ++) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 + DROP TABLE t1, child1, child2; diff --git a/storage/innobase/mysql-test/storage_engine/trx/disabled.def b/storage/innobase/mysql-test/storage_engine/trx/disabled.def new file mode 100644 index 00000000000..7b8a16d0b7a --- /dev/null +++ b/storage/innobase/mysql-test/storage_engine/trx/disabled.def @@ -0,0 +1,2 @@ +cons_snapshot_serializable : MySQL:65146 (CONSISTENT SNAPSHOT does not work with SERIALIZABLE) + diff --git a/storage/innobase/mysql-test/storage_engine/trx/suite.opt b/storage/innobase/mysql-test/storage_engine/trx/suite.opt new file mode 100644 index 00000000000..2bf66f067f6 --- /dev/null +++ b/storage/innobase/mysql-test/storage_engine/trx/suite.opt @@ -0,0 +1,5 @@ +--ignore-builtin-innodb +--plugin-load=ha_innodb +--innodb +--innodb-lock-wait-timeout=1 + diff --git a/storage/innobase/mysql-test/storage_engine/type_char_indexes.rdiff b/storage/innobase/mysql-test/storage_engine/type_char_indexes.rdiff new file mode 100644 index 00000000000..7fce0a108e9 --- /dev/null +++ b/storage/innobase/mysql-test/storage_engine/type_char_indexes.rdiff @@ -0,0 +1,20 @@ +--- suite/storage_engine/type_char_indexes.result 2012-07-12 19:27:42.191013570 +0400 ++++ suite/storage_engine/type_char_indexes.reject 2012-07-15 17:51:55.810034331 +0400 +@@ -98,7 +98,7 @@ + SET SESSION optimizer_switch = 'engine_condition_pushdown=on'; + EXPLAIN SELECT * FROM t1 WHERE c > 'a'; + id select_type table type possible_keys key key_len ref rows Extra +-# # # range c_v c_v # # # Using index condition ++# # # range c_v c_v # # # Using where + SELECT * FROM t1 WHERE c > 'a'; + c c20 v16 v128 + b char3 varchar1a varchar1b +@@ -135,7 +135,7 @@ + r3a + EXPLAIN SELECT * FROM t1 WHERE v16 = 'varchar1a' OR v16 = 'varchar3a' ORDER BY v16; + id select_type table type possible_keys key key_len ref rows Extra +-# # # range # v16 # # # # ++# # # ALL # NULL # # # # + SELECT * FROM t1 WHERE v16 = 'varchar1a' OR v16 = 'varchar3a' ORDER BY v16; + c c20 v16 v128 + a char1 varchar1a varchar1b diff --git a/storage/innobase/mysql-test/storage_engine/type_float_indexes.rdiff b/storage/innobase/mysql-test/storage_engine/type_float_indexes.rdiff new file mode 100644 index 00000000000..6ebfd61d876 --- /dev/null +++ b/storage/innobase/mysql-test/storage_engine/type_float_indexes.rdiff @@ -0,0 +1,11 @@ +--- suite/storage_engine/type_float_indexes.result 2012-07-12 19:37:27.031661128 +0400 ++++ suite/storage_engine/type_float_indexes.reject 2012-07-15 17:52:12.189828410 +0400 +@@ -60,7 +60,7 @@ + ALTER TABLE t1 ADD UNIQUE KEY(d); + EXPLAIN SELECT d FROM t1 WHERE r > 0 and d > 0 ORDER BY d; + id select_type table type possible_keys key key_len ref rows Extra +-# # # # # d # # # # ++# # # # # NULL # # # # + SELECT d FROM t1 WHERE r > 0 and d > 0 ORDER BY d; + d + 1.2345 diff --git a/storage/innobase/mysql-test/storage_engine/type_spatial_indexes.rdiff b/storage/innobase/mysql-test/storage_engine/type_spatial_indexes.rdiff new file mode 100644 index 00000000000..9a9566deafb --- /dev/null +++ b/storage/innobase/mysql-test/storage_engine/type_spatial_indexes.rdiff @@ -0,0 +1,712 @@ +--- suite/storage_engine/type_spatial_indexes.result 2012-07-12 04:52:40.840023344 +0400 ++++ suite/storage_engine/type_spatial_indexes.reject 2012-07-15 19:27:32.761911079 +0400 +@@ -702,699 +702,15 @@ + DROP DATABASE IF EXISTS gis_ogs; + CREATE DATABASE gis_ogs; + CREATE TABLE gis_point (fid <INT_COLUMN>, g POINT NOT NULL, SPATIAL INDEX(g)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +-CREATE TABLE gis_line (fid <INT_COLUMN>, g LINESTRING NOT NULL, SPATIAL INDEX(g)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +-CREATE TABLE gis_polygon (fid <INT_COLUMN>, g POLYGON NOT NULL, SPATIAL INDEX(g)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +-CREATE TABLE gis_multi_point (fid <INT_COLUMN>, g MULTIPOINT NOT NULL, SPATIAL INDEX(g)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +-CREATE TABLE gis_multi_line (fid <INT_COLUMN>, g MULTILINESTRING NOT NULL, SPATIAL INDEX(g)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +-CREATE TABLE gis_multi_polygon (fid <INT_COLUMN>, g MULTIPOLYGON NOT NULL, SPATIAL INDEX(g)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +-CREATE TABLE gis_geometrycollection (fid <INT_COLUMN>, g GEOMETRYCOLLECTION NOT NULL, SPATIAL INDEX(g)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +-CREATE TABLE gis_geometry (fid <INT_COLUMN>, g GEOMETRY NOT NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +-USE gis_ogs; +-CREATE TABLE lakes (fid INT <CUSTOM_COL_OPTIONS>, +-name CHAR(64) <CUSTOM_COL_OPTIONS>, +-shore POLYGON NOT NULL, SPATIAL INDEX s(shore)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +-CREATE TABLE road_segments (fid INT <CUSTOM_COL_OPTIONS>, +-name CHAR(64) <CUSTOM_COL_OPTIONS>, +-aliases CHAR(64) <CUSTOM_COL_OPTIONS>, +-num_lanes INT <CUSTOM_COL_OPTIONS>, +-centerline LINESTRING NOT NULL, SPATIAL INDEX c(centerline)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +-CREATE TABLE divided_routes (fid INT <CUSTOM_COL_OPTIONS>, +-name CHAR(64) <CUSTOM_COL_OPTIONS>, +-num_lanes INT <CUSTOM_COL_OPTIONS>, +-centerlines MULTILINESTRING NOT NULL, SPATIAL INDEX c(centerlines)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +-CREATE TABLE forests (fid INT <CUSTOM_COL_OPTIONS>, +-name CHAR(64) <CUSTOM_COL_OPTIONS>, +-boundary MULTIPOLYGON NOT NULL, SPATIAL INDEX b(boundary)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +-CREATE TABLE bridges (fid INT <CUSTOM_COL_OPTIONS>, +-name CHAR(64) <CUSTOM_COL_OPTIONS>, +-position POINT NOT NULL, SPATIAL INDEX p(position)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +-CREATE TABLE streams (fid INT <CUSTOM_COL_OPTIONS>, +-name CHAR(64) <CUSTOM_COL_OPTIONS>, +-centerline LINESTRING NOT NULL, SPATIAL INDEX c(centerline)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +-CREATE TABLE buildings (fid INT <CUSTOM_COL_OPTIONS>, +-name CHAR(64) <CUSTOM_COL_OPTIONS>, +-position POINT NOT NULL, +-footprint POLYGON NOT NULL, SPATIAL INDEX p(position), SPATIAL INDEX f(footprint)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +-CREATE TABLE ponds (fid INT <CUSTOM_COL_OPTIONS>, +-name CHAR(64) <CUSTOM_COL_OPTIONS>, +-type CHAR(64) <CUSTOM_COL_OPTIONS>, +-shores MULTIPOLYGON NOT NULL, SPATIAL INDEX s(shores)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +-CREATE TABLE named_places (fid INT <CUSTOM_COL_OPTIONS>, +-name CHAR(64) <CUSTOM_COL_OPTIONS>, +-boundary POLYGON NOT NULL, SPATIAL INDEX b(boundary)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +-CREATE TABLE map_neatlines (fid INT <CUSTOM_COL_OPTIONS>, +-neatline POLYGON NOT NULL, SPATIAL INDEX n(neatline)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +-USE test; +-SHOW FIELDS FROM gis_point; +-Field Type Null Key Default Extra +-fid int(11) YES NULL +-g point NO MUL NULL +-SHOW FIELDS FROM gis_line; +-Field Type Null Key Default Extra +-fid int(11) YES NULL +-g linestring NO MUL NULL +-SHOW FIELDS FROM gis_polygon; +-Field Type Null Key Default Extra +-fid int(11) YES NULL +-g polygon NO MUL NULL +-SHOW FIELDS FROM gis_multi_point; +-Field Type Null Key Default Extra +-fid int(11) YES NULL +-g multipoint NO MUL NULL +-SHOW FIELDS FROM gis_multi_line; +-Field Type Null Key Default Extra +-fid int(11) YES NULL +-g multilinestring NO MUL NULL +-SHOW FIELDS FROM gis_multi_polygon; +-Field Type Null Key Default Extra +-fid int(11) YES NULL +-g multipolygon NO MUL NULL +-SHOW FIELDS FROM gis_geometrycollection; +-Field Type Null Key Default Extra +-fid int(11) YES NULL +-g geometrycollection NO MUL NULL +-SHOW FIELDS FROM gis_geometry; +-Field Type Null Key Default Extra +-fid int(11) YES NULL +-g geometry NO NULL +-INSERT INTO gis_point VALUES +-(101, PointFromText('POINT(10 10)')), +-(102, PointFromText('POINT(20 10)')), +-(103, PointFromText('POINT(20 20)')), +-(104, PointFromWKB(AsWKB(PointFromText('POINT(10 20)')))); +-INSERT INTO gis_line VALUES +-(105, LineFromText('LINESTRING(0 0,0 10,10 0)')), +-(106, LineStringFromText('LINESTRING(10 10,20 10,20 20,10 20,10 10)')), +-(107, LineStringFromWKB(AsWKB(LineString(Point(10, 10), Point(40, 10))))); +-INSERT INTO gis_polygon VALUES +-(108, PolygonFromText('POLYGON((10 10,20 10,20 20,10 20,10 10))')), +-(109, PolyFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))')), +-(110, PolyFromWKB(AsWKB(Polygon(LineString(Point(0, 0), Point(30, 0), Point(30, 30), Point(0, 0)))))); +-INSERT INTO gis_multi_point VALUES +-(111, MultiPointFromText('MULTIPOINT(0 0,10 10,10 20,20 20)')), +-(112, MPointFromText('MULTIPOINT(1 1,11 11,11 21,21 21)')), +-(113, MPointFromWKB(AsWKB(MultiPoint(Point(3, 6), Point(4, 10))))); +-INSERT INTO gis_multi_line VALUES +-(114, MultiLineStringFromText('MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48))')), +-(115, MLineFromText('MULTILINESTRING((10 48,10 21,10 0))')), +-(116, MLineFromWKB(AsWKB(MultiLineString(LineString(Point(1, 2), Point(3, 5)), LineString(Point(2, 5), Point(5, 8), Point(21, 7)))))); +-INSERT INTO gis_multi_polygon VALUES +-(117, MultiPolygonFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')), +-(118, MPolyFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')), +-(119, MPolyFromWKB(AsWKB(MultiPolygon(Polygon(LineString(Point(0, 3), Point(3, 3), Point(3, 0), Point(0, 3))))))); +-INSERT INTO gis_geometrycollection VALUES +-(120, GeomCollFromText('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(0 0,10 10))')), +-(121, GeometryFromWKB(AsWKB(GeometryCollection(Point(44, 6), LineString(Point(3, 6), Point(7, 9)))))), +-(122, GeomFromText('GeometryCollection()')), +-(123, GeomFromText('GeometryCollection EMPTY')); +-INSERT into gis_geometry SELECT * FROM gis_point; +-INSERT into gis_geometry SELECT * FROM gis_line; +-INSERT into gis_geometry SELECT * FROM gis_polygon; +-INSERT into gis_geometry SELECT * FROM gis_multi_point; +-INSERT into gis_geometry SELECT * FROM gis_multi_line; +-INSERT into gis_geometry SELECT * FROM gis_multi_polygon; +-INSERT into gis_geometry SELECT * FROM gis_geometrycollection; +-SELECT fid, AsText(g) FROM gis_point; +-fid AsText(g) +-101 POINT(10 10) +-102 POINT(20 10) +-103 POINT(20 20) +-104 POINT(10 20) +-SELECT fid, AsText(g) FROM gis_line; +-fid AsText(g) +-105 LINESTRING(0 0,0 10,10 0) +-106 LINESTRING(10 10,20 10,20 20,10 20,10 10) +-107 LINESTRING(10 10,40 10) +-SELECT fid, AsText(g) FROM gis_polygon; +-fid AsText(g) +-108 POLYGON((10 10,20 10,20 20,10 20,10 10)) +-109 POLYGON((0 0,50 0,50 50,0 50,0 0),(10 10,20 10,20 20,10 20,10 10)) +-110 POLYGON((0 0,30 0,30 30,0 0)) +-SELECT fid, AsText(g) FROM gis_multi_point; +-fid AsText(g) +-111 MULTIPOINT(0 0,10 10,10 20,20 20) +-112 MULTIPOINT(1 1,11 11,11 21,21 21) +-113 MULTIPOINT(3 6,4 10) +-SELECT fid, AsText(g) FROM gis_multi_line; +-fid AsText(g) +-114 MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48)) +-115 MULTILINESTRING((10 48,10 21,10 0)) +-116 MULTILINESTRING((1 2,3 5),(2 5,5 8,21 7)) +-SELECT fid, AsText(g) FROM gis_multi_polygon; +-fid AsText(g) +-117 MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18))) +-118 MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18))) +-119 MULTIPOLYGON(((0 3,3 3,3 0,0 3))) +-SELECT fid, AsText(g) FROM gis_geometrycollection; +-fid AsText(g) +-120 GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(0 0,10 10)) +-121 GEOMETRYCOLLECTION(POINT(44 6),LINESTRING(3 6,7 9)) +-122 GEOMETRYCOLLECTION EMPTY +-123 GEOMETRYCOLLECTION EMPTY +-SELECT fid, AsText(g) FROM gis_geometry; +-fid AsText(g) +-101 POINT(10 10) +-102 POINT(20 10) +-103 POINT(20 20) +-104 POINT(10 20) +-105 LINESTRING(0 0,0 10,10 0) +-106 LINESTRING(10 10,20 10,20 20,10 20,10 10) +-107 LINESTRING(10 10,40 10) +-108 POLYGON((10 10,20 10,20 20,10 20,10 10)) +-109 POLYGON((0 0,50 0,50 50,0 50,0 0),(10 10,20 10,20 20,10 20,10 10)) +-110 POLYGON((0 0,30 0,30 30,0 0)) +-111 MULTIPOINT(0 0,10 10,10 20,20 20) +-112 MULTIPOINT(1 1,11 11,11 21,21 21) +-113 MULTIPOINT(3 6,4 10) +-114 MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48)) +-115 MULTILINESTRING((10 48,10 21,10 0)) +-116 MULTILINESTRING((1 2,3 5),(2 5,5 8,21 7)) +-117 MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18))) +-118 MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18))) +-119 MULTIPOLYGON(((0 3,3 3,3 0,0 3))) +-120 GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(0 0,10 10)) +-121 GEOMETRYCOLLECTION(POINT(44 6),LINESTRING(3 6,7 9)) +-122 GEOMETRYCOLLECTION EMPTY +-123 GEOMETRYCOLLECTION EMPTY +-SELECT fid, Dimension(g) FROM gis_geometry; +-fid Dimension(g) +-101 0 +-102 0 +-103 0 +-104 0 +-105 1 +-106 1 +-107 1 +-108 2 +-109 2 +-110 2 +-111 0 +-112 0 +-113 0 +-114 1 +-115 1 +-116 1 +-117 2 +-118 2 +-119 2 +-120 1 +-121 1 +-122 0 +-123 0 +-SELECT fid, GeometryType(g) FROM gis_geometry; +-fid GeometryType(g) +-101 POINT +-102 POINT +-103 POINT +-104 POINT +-105 LINESTRING +-106 LINESTRING +-107 LINESTRING +-108 POLYGON +-109 POLYGON +-110 POLYGON +-111 MULTIPOINT +-112 MULTIPOINT +-113 MULTIPOINT +-114 MULTILINESTRING +-115 MULTILINESTRING +-116 MULTILINESTRING +-117 MULTIPOLYGON +-118 MULTIPOLYGON +-119 MULTIPOLYGON +-120 GEOMETRYCOLLECTION +-121 GEOMETRYCOLLECTION +-122 GEOMETRYCOLLECTION +-123 GEOMETRYCOLLECTION +-SELECT fid, IsEmpty(g) FROM gis_geometry; +-fid IsEmpty(g) +-101 0 +-102 0 +-103 0 +-104 0 +-105 0 +-106 0 +-107 0 +-108 0 +-109 0 +-110 0 +-111 0 +-112 0 +-113 0 +-114 0 +-115 0 +-116 0 +-117 0 +-118 0 +-119 0 +-120 0 +-121 0 +-122 0 +-123 0 +-SELECT fid, AsText(Envelope(g)) FROM gis_geometry; +-fid AsText(Envelope(g)) +-101 POLYGON((10 10,10 10,10 10,10 10,10 10)) +-102 POLYGON((20 10,20 10,20 10,20 10,20 10)) +-103 POLYGON((20 20,20 20,20 20,20 20,20 20)) +-104 POLYGON((10 20,10 20,10 20,10 20,10 20)) +-105 POLYGON((0 0,10 0,10 10,0 10,0 0)) +-106 POLYGON((10 10,20 10,20 20,10 20,10 10)) +-107 POLYGON((10 10,40 10,40 10,10 10,10 10)) +-108 POLYGON((10 10,20 10,20 20,10 20,10 10)) +-109 POLYGON((0 0,50 0,50 50,0 50,0 0)) +-110 POLYGON((0 0,30 0,30 30,0 30,0 0)) +-111 POLYGON((0 0,20 0,20 20,0 20,0 0)) +-112 POLYGON((1 1,21 1,21 21,1 21,1 1)) +-113 POLYGON((3 6,4 6,4 10,3 10,3 6)) +-114 POLYGON((10 0,16 0,16 48,10 48,10 0)) +-115 POLYGON((10 0,10 0,10 48,10 48,10 0)) +-116 POLYGON((1 2,21 2,21 8,1 8,1 2)) +-117 POLYGON((28 0,84 0,84 42,28 42,28 0)) +-118 POLYGON((28 0,84 0,84 42,28 42,28 0)) +-119 POLYGON((0 0,3 0,3 3,0 3,0 0)) +-120 POLYGON((0 0,10 0,10 10,0 10,0 0)) +-121 POLYGON((3 6,44 6,44 9,3 9,3 6)) +-122 GEOMETRYCOLLECTION EMPTY +-123 GEOMETRYCOLLECTION EMPTY +-SELECT fid, X(g) FROM gis_point; +-fid X(g) +-101 10 +-102 20 +-103 20 +-104 10 +-SELECT fid, Y(g) FROM gis_point; +-fid Y(g) +-101 10 +-102 10 +-103 20 +-104 20 +-SELECT fid, AsText(StartPoint(g)) FROM gis_line; +-fid AsText(StartPoint(g)) +-105 POINT(0 0) +-106 POINT(10 10) +-107 POINT(10 10) +-SELECT fid, AsText(EndPoint(g)) FROM gis_line; +-fid AsText(EndPoint(g)) +-105 POINT(10 0) +-106 POINT(10 10) +-107 POINT(40 10) +-SELECT fid, GLength(g) FROM gis_line; +-fid GLength(g) +-105 24.14213562373095 +-106 40 +-107 30 +-SELECT fid, NumPoints(g) FROM gis_line; +-fid NumPoints(g) +-105 3 +-106 5 +-107 2 +-SELECT fid, AsText(PointN(g, 2)) FROM gis_line; +-fid AsText(PointN(g, 2)) +-105 POINT(0 10) +-106 POINT(20 10) +-107 POINT(40 10) +-SELECT fid, IsClosed(g) FROM gis_line; +-fid IsClosed(g) +-105 0 +-106 1 +-107 0 +-SELECT fid, AsText(Centroid(g)) FROM gis_polygon; +-fid AsText(Centroid(g)) +-108 POINT(15 15) +-109 POINT(25.416666666666668 25.416666666666668) +-110 POINT(20 10) +-SELECT fid, Area(g) FROM gis_polygon; +-fid Area(g) +-108 100 +-109 2400 +-110 450 +-SELECT fid, AsText(ExteriorRing(g)) FROM gis_polygon; +-fid AsText(ExteriorRing(g)) +-108 LINESTRING(10 10,20 10,20 20,10 20,10 10) +-109 LINESTRING(0 0,50 0,50 50,0 50,0 0) +-110 LINESTRING(0 0,30 0,30 30,0 0) +-SELECT fid, NumInteriorRings(g) FROM gis_polygon; +-fid NumInteriorRings(g) +-108 0 +-109 1 +-110 0 +-SELECT fid, AsText(InteriorRingN(g, 1)) FROM gis_polygon; +-fid AsText(InteriorRingN(g, 1)) +-108 NULL +-109 LINESTRING(10 10,20 10,20 20,10 20,10 10) +-110 NULL +-SELECT fid, IsClosed(g) FROM gis_multi_line; +-fid IsClosed(g) +-114 0 +-115 0 +-116 0 +-SELECT fid, AsText(Centroid(g)) FROM gis_multi_polygon; +-fid AsText(Centroid(g)) +-117 POINT(55.58852775304245 17.426536064113982) +-118 POINT(55.58852775304245 17.426536064113982) +-119 POINT(2 2) +-SELECT fid, Area(g) FROM gis_multi_polygon; +-fid Area(g) +-117 1684.5 +-118 1684.5 +-119 4.5 +-SELECT fid, NumGeometries(g) from gis_multi_point; +-fid NumGeometries(g) +-111 4 +-112 4 +-113 2 +-SELECT fid, NumGeometries(g) from gis_multi_line; +-fid NumGeometries(g) +-114 2 +-115 1 +-116 2 +-SELECT fid, NumGeometries(g) from gis_multi_polygon; +-fid NumGeometries(g) +-117 2 +-118 2 +-119 1 +-SELECT fid, NumGeometries(g) from gis_geometrycollection; +-fid NumGeometries(g) +-120 2 +-121 2 +-122 0 +-123 0 +-SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_point; +-fid AsText(GeometryN(g, 2)) +-111 POINT(10 10) +-112 POINT(11 11) +-113 POINT(4 10) +-SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_line; +-fid AsText(GeometryN(g, 2)) +-114 LINESTRING(16 0,16 23,16 48) +-115 NULL +-116 LINESTRING(2 5,5 8,21 7) +-SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_polygon; +-fid AsText(GeometryN(g, 2)) +-117 POLYGON((59 18,67 18,67 13,59 13,59 18)) +-118 POLYGON((59 18,67 18,67 13,59 13,59 18)) +-119 NULL +-SELECT fid, AsText(GeometryN(g, 2)) from gis_geometrycollection; +-fid AsText(GeometryN(g, 2)) +-120 LINESTRING(0 0,10 10) +-121 LINESTRING(3 6,7 9) +-122 NULL +-123 NULL +-SELECT fid, AsText(GeometryN(g, 1)) from gis_geometrycollection; +-fid AsText(GeometryN(g, 1)) +-120 POINT(0 0) +-121 POINT(44 6) +-122 NULL +-123 NULL +-SELECT g1.fid as first, g2.fid as second, +-Within(g1.g, g2.g) as w, Contains(g1.g, g2.g) as c, Overlaps(g1.g, g2.g) as o, +-Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t, +-Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r +-FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second; +-first second w c o e d t i r +-120 120 1 1 0 1 0 1 1 0 +-120 121 0 0 1 0 0 0 1 0 +-120 122 0 1 NULL 0 NULL 0 NULL 0 +-120 123 0 1 NULL 0 NULL 0 NULL 0 +-121 120 0 0 1 0 0 0 1 0 +-121 121 1 1 0 1 0 1 1 0 +-121 122 0 1 NULL 0 NULL 0 NULL 0 +-121 123 0 1 NULL 0 NULL 0 NULL 0 +-122 120 1 0 NULL 0 NULL 0 NULL 0 +-122 121 1 0 NULL 0 NULL 0 NULL 0 +-122 122 1 1 NULL 1 NULL 0 NULL 0 +-122 123 1 1 NULL 1 NULL 0 NULL 0 +-123 120 1 0 NULL 0 NULL 0 NULL 0 +-123 121 1 0 NULL 0 NULL 0 NULL 0 +-123 122 1 1 NULL 1 NULL 0 NULL 0 +-123 123 1 1 NULL 1 NULL 0 NULL 0 +-DROP TABLE gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry; +-USE gis_ogs; +-# Lakes +-INSERT INTO lakes VALUES ( +-101, 'BLUE LAKE', +-PolyFromText( +-'POLYGON( +- (52 18,66 23,73 9,48 6,52 18), +- (59 18,67 18,67 13,59 13,59 18) +- )', +-101)); +-# Road Segments +-INSERT INTO road_segments VALUES(102, 'Route 5', NULL, 2, +-LineFromText( +-'LINESTRING( 0 18, 10 21, 16 23, 28 26, 44 31 )' ,101)); +-INSERT INTO road_segments VALUES(103, 'Route 5', 'Main Street', 4, +-LineFromText( +-'LINESTRING( 44 31, 56 34, 70 38 )' ,101)); +-INSERT INTO road_segments VALUES(104, 'Route 5', NULL, 2, +-LineFromText( +-'LINESTRING( 70 38, 72 48 )' ,101)); +-INSERT INTO road_segments VALUES(105, 'Main Street', NULL, 4, +-LineFromText( +-'LINESTRING( 70 38, 84 42 )' ,101)); +-INSERT INTO road_segments VALUES(106, 'Dirt Road by Green Forest', NULL, +-1, +-LineFromText( +-'LINESTRING( 28 26, 28 0 )',101)); +-# DividedRoutes +-INSERT INTO divided_routes VALUES(119, 'Route 75', 4, +-MLineFromText( +-'MULTILINESTRING((10 48,10 21,10 0), +- (16 0,16 23,16 48))', 101)); +-# Forests +-INSERT INTO forests VALUES(109, 'Green Forest', +-MPolyFromText( +-'MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26), +- (52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))', +-101)); +-# Bridges +-INSERT INTO bridges VALUES(110, 'Cam Bridge', PointFromText( +-'POINT( 44 31 )', 101)); +-# Streams +-INSERT INTO streams VALUES(111, 'Cam Stream', +-LineFromText( +-'LINESTRING( 38 48, 44 41, 41 36, 44 31, 52 18 )', 101)); +-INSERT INTO streams VALUES(112, NULL, +-LineFromText( +-'LINESTRING( 76 0, 78 4, 73 9 )', 101)); +-# Buildings +-INSERT INTO buildings VALUES(113, '123 Main Street', +-PointFromText( +-'POINT( 52 30 )', 101), +-PolyFromText( +-'POLYGON( ( 50 31, 54 31, 54 29, 50 29, 50 31) )', 101)); +-INSERT INTO buildings VALUES(114, '215 Main Street', +-PointFromText( +-'POINT( 64 33 )', 101), +-PolyFromText( +-'POLYGON( ( 66 34, 62 34, 62 32, 66 32, 66 34) )', 101)); +-# Ponds +-INSERT INTO ponds VALUES(120, NULL, 'Stock Pond', +-MPolyFromText( +-'MULTIPOLYGON( ( ( 24 44, 22 42, 24 40, 24 44) ), +- ( ( 26 44, 26 40, 28 42, 26 44) ) )', 101)); +-# Named Places +-INSERT INTO named_places VALUES(117, 'Ashton', +-PolyFromText( +-'POLYGON( ( 62 48, 84 48, 84 30, 56 30, 56 34, 62 48) )', 101)); +-INSERT INTO named_places VALUES(118, 'Goose Island', +-PolyFromText( +-'POLYGON( ( 67 13, 67 18, 59 18, 59 13, 67 13) )', 101)); +-# Map Neatlines +-INSERT INTO map_neatlines VALUES(115, +-PolyFromText( +-'POLYGON( ( 0 0, 0 48, 84 48, 84 0, 0 0 ) )', 101)); +-SELECT Dimension(shore) +-FROM lakes +-WHERE name = 'Blue Lake'; +-Dimension(shore) +-2 +-SELECT GeometryType(centerlines) +-FROM divided_routes +-WHERE name = 'Route 75'; +-GeometryType(centerlines) +-MULTILINESTRING +-SELECT AsText(boundary) +-FROM named_places +-WHERE name = 'Goose Island'; +-AsText(boundary) +-POLYGON((67 13,67 18,59 18,59 13,67 13)) +-SELECT AsText(PolyFromWKB(AsBinary(boundary),101)) +-FROM named_places +-WHERE name = 'Goose Island'; +-AsText(PolyFromWKB(AsBinary(boundary),101)) +-POLYGON((67 13,67 18,59 18,59 13,67 13)) +-SELECT SRID(boundary) +-FROM named_places +-WHERE name = 'Goose Island'; +-SRID(boundary) +-101 +-SELECT IsEmpty(centerline) +-FROM road_segments +-WHERE name = 'Route 5' +-AND aliases = 'Main Street'; +-IsEmpty(centerline) +-0 +-SELECT AsText(Envelope(boundary)) +-FROM named_places +-WHERE name = 'Goose Island'; +-AsText(Envelope(boundary)) +-POLYGON((59 13,67 13,67 18,59 18,59 13)) +-SELECT X(position) +-FROM bridges +-WHERE name = 'Cam Bridge'; +-X(position) +-44 +-SELECT Y(position) +-FROM bridges +-WHERE name = 'Cam Bridge'; +-Y(position) +-31 +-SELECT AsText(StartPoint(centerline)) +-FROM road_segments +-WHERE fid = 102; +-AsText(StartPoint(centerline)) +-POINT(0 18) +-SELECT AsText(EndPoint(centerline)) +-FROM road_segments +-WHERE fid = 102; +-AsText(EndPoint(centerline)) +-POINT(44 31) +-SELECT GLength(centerline) +-FROM road_segments +-WHERE fid = 106; +-GLength(centerline) +-26 +-SELECT NumPoints(centerline) +-FROM road_segments +-WHERE fid = 102; +-NumPoints(centerline) +-5 +-SELECT AsText(PointN(centerline, 1)) +-FROM road_segments +-WHERE fid = 102; +-AsText(PointN(centerline, 1)) +-POINT(0 18) +-SELECT AsText(Centroid(boundary)) +-FROM named_places +-WHERE name = 'Goose Island'; +-AsText(Centroid(boundary)) +-POINT(63 15.5) +-SELECT Area(boundary) +-FROM named_places +-WHERE name = 'Goose Island'; +-Area(boundary) +-40 +-SELECT AsText(ExteriorRing(shore)) +-FROM lakes +-WHERE name = 'Blue Lake'; +-AsText(ExteriorRing(shore)) +-LINESTRING(52 18,66 23,73 9,48 6,52 18) +-SELECT NumInteriorRings(shore) +-FROM lakes +-WHERE name = 'Blue Lake'; +-NumInteriorRings(shore) +-1 +-SELECT AsText(InteriorRingN(shore, 1)) +-FROM lakes +-WHERE name = 'Blue Lake'; +-AsText(InteriorRingN(shore, 1)) +-LINESTRING(59 18,67 18,67 13,59 13,59 18) +-SELECT NumGeometries(centerlines) +-FROM divided_routes +-WHERE name = 'Route 75'; +-NumGeometries(centerlines) +-2 +-SELECT AsText(GeometryN(centerlines, 2)) +-FROM divided_routes +-WHERE name = 'Route 75'; +-AsText(GeometryN(centerlines, 2)) +-LINESTRING(16 0,16 23,16 48) +-SELECT IsClosed(centerlines) +-FROM divided_routes +-WHERE name = 'Route 75'; +-IsClosed(centerlines) +-0 +-SELECT GLength(centerlines) +-FROM divided_routes +-WHERE name = 'Route 75'; +-GLength(centerlines) +-96 +-SELECT AsText(Centroid(shores)) +-FROM ponds +-WHERE fid = 120; +-AsText(Centroid(shores)) +-POINT(25 42) +-SELECT Area(shores) +-FROM ponds +-WHERE fid = 120; +-Area(shores) +-8 +-SELECT ST_Equals(boundary, +-PolyFromText('POLYGON( ( 67 13, 67 18, 59 18, 59 13, 67 13) )',1)) +-FROM named_places +-WHERE name = 'Goose Island'; +-ST_Equals(boundary, +-PolyFromText('POLYGON( ( 67 13, 67 18, 59 18, 59 13, 67 13) )',1)) +-1 +-SELECT ST_Disjoint(centerlines, boundary) +-FROM divided_routes, named_places +-WHERE divided_routes.name = 'Route 75' +-AND named_places.name = 'Ashton'; +-ST_Disjoint(centerlines, boundary) +-1 +-SELECT ST_Touches(centerline, shore) +-FROM streams, lakes +-WHERE streams.name = 'Cam Stream' +-AND lakes.name = 'Blue Lake'; +-ST_Touches(centerline, shore) +-1 +-SELECT Crosses(road_segments.centerline, divided_routes.centerlines) +-FROM road_segments, divided_routes +-WHERE road_segments.fid = 102 +-AND divided_routes.name = 'Route 75'; +-Crosses(road_segments.centerline, divided_routes.centerlines) +-1 +-SELECT ST_Intersects(road_segments.centerline, divided_routes.centerlines) +-FROM road_segments, divided_routes +-WHERE road_segments.fid = 102 +-AND divided_routes.name = 'Route 75'; +-ST_Intersects(road_segments.centerline, divided_routes.centerlines) +-1 +-SELECT ST_Contains(forests.boundary, named_places.boundary) +-FROM forests, named_places +-WHERE forests.name = 'Green Forest' +-AND named_places.name = 'Ashton'; +-ST_Contains(forests.boundary, named_places.boundary) +-0 +-SELECT ST_Distance(position, boundary) +-FROM bridges, named_places +-WHERE bridges.name = 'Cam Bridge' +-AND named_places.name = 'Ashton'; +-ST_Distance(position, boundary) +-12 +-SELECT AsText(ST_Difference(named_places.boundary, forests.boundary)) +-FROM named_places, forests +-WHERE named_places.name = 'Ashton' +-AND forests.name = 'Green Forest'; +-AsText(ST_Difference(named_places.boundary, forests.boundary)) +-POLYGON((56 34,62 48,84 48,84 42,56 34)) +-SELECT AsText(ST_Union(shore, boundary)) +-FROM lakes, named_places +-WHERE lakes.name = 'Blue Lake' +-AND named_places.name = 'Goose Island'; +-AsText(ST_Union(shore, boundary)) +-POLYGON((48 6,52 18,66 23,73 9,48 6)) +-SELECT AsText(ST_SymDifference(shore, boundary)) +-FROM lakes, named_places +-WHERE lakes.name = 'Blue Lake' +-AND named_places.name = 'Ashton'; +-AsText(ST_SymDifference(shore, boundary)) +-MULTIPOLYGON(((48 6,52 18,66 23,73 9,48 6),(59 13,59 18,67 18,67 13,59 13)),((56 30,56 34,62 48,84 48,84 30,56 30))) +-SELECT count(*) +-FROM buildings, bridges +-WHERE ST_Contains(ST_Buffer(bridges.position, 15.0), buildings.footprint) = 1; +-count(*) +-1 ++ERROR HY000: The used table type doesn't support SPATIAL indexes ++# ERROR: Statement ended with errno 1464, errname ER_TABLE_CANT_HANDLE_SPKEYS (expected to succeed) ++# ------------ UNEXPECTED RESULT ------------ ++# [ CREATE TABLE gis_point (fid INT(11) /*!*/ /*Custom column options*/, g POINT NOT NULL, SPATIAL INDEX(g)) ENGINE=InnoDB /*!*/ /*Custom table options*/ ] ++# The statement|command finished with ER_TABLE_CANT_HANDLE_SPKEYS. ++# Geometry types or spatial indexes or the mix could be unsupported|malfunctioning, or the problem was caused by previous errors. ++# You can change the engine code, or create an rdiff, or disable the test by adding it to disabled.def. ++# Further in this test, the message might sometimes be suppressed; a part of the test might be skipped. ++# Also, this problem may cause a chain effect (more errors of different kinds in the test). ++# ------------------------------------------- + DROP DATABASE gis_ogs; + USE test; diff --git a/storage/innobase/mysql-test/storage_engine/vcol.rdiff b/storage/innobase/mysql-test/storage_engine/vcol.rdiff new file mode 100644 index 00000000000..2226062834e --- /dev/null +++ b/storage/innobase/mysql-test/storage_engine/vcol.rdiff @@ -0,0 +1,82 @@ +--- suite/storage_engine/vcol.result 2012-07-12 20:24:16.628339715 +0400 ++++ suite/storage_engine/vcol.reject 2012-07-15 17:53:17.457007891 +0400 +@@ -1,69 +1,12 @@ + DROP TABLE IF EXISTS t1; + CREATE TABLE t1 (a <INT_COLUMN>, b <INT_COLUMN> GENERATED ALWAYS AS (a+1)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +-SHOW COLUMNS IN t1; +-Field Type Null Key Default Extra +-a int(11) # # +-b int(11) # # VIRTUAL +-INSERT INTO t1 (a) VALUES (1),(2); +-INSERT INTO t1 (a,b) VALUES (3,3),(4,4); +-Warnings: +-Warning 1906 The value specified for computed column 'b' in table 't1' ignored +-Warning 1906 The value specified for computed column 'b' in table 't1' ignored +-SELECT * FROM t1; +-a b +-1 2 +-2 3 +-3 4 +-4 5 +-DROP TABLE t1; +-CREATE TABLE t1 (a <INT_COLUMN>, b <INT_COLUMN> GENERATED ALWAYS AS (a+1) PERSISTENT) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +-SHOW COLUMNS IN t1; +-Field Type Null Key Default Extra +-a int(11) # # +-b int(11) # # PERSISTENT +-INSERT INTO t1 (a) VALUES (1),(2); +-INSERT INTO t1 (a,b) VALUES (3,3),(4,4); +-Warnings: +-Warning 1906 The value specified for computed column 'b' in table 't1' ignored +-Warning 1906 The value specified for computed column 'b' in table 't1' ignored +-SELECT * FROM t1; +-a b +-1 2 +-2 3 +-3 4 +-4 5 +-DROP TABLE t1; +-CREATE TABLE t1 (a <INT_COLUMN>, b <INT_COLUMN> GENERATED ALWAYS AS (a+1) VIRTUAL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +-SHOW COLUMNS IN t1; +-Field Type Null Key Default Extra +-a int(11) # # +-b int(11) # # VIRTUAL +-INSERT INTO t1 (a) VALUES (1),(2); +-INSERT INTO t1 (a,b) VALUES (3,3),(4,4); +-Warnings: +-Warning 1906 The value specified for computed column 'b' in table 't1' ignored +-Warning 1906 The value specified for computed column 'b' in table 't1' ignored +-SELECT * FROM t1; +-a b +-1 2 +-2 3 +-3 4 +-4 5 +-DROP TABLE t1; +-CREATE TABLE t1 (a <INT_COLUMN>, b <INT_COLUMN> AS (a+1) PERSISTENT) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +-SHOW COLUMNS IN t1; +-Field Type Null Key Default Extra +-a int(11) # # +-b int(11) # # PERSISTENT +-INSERT INTO t1 (a) VALUES (1),(2); +-INSERT INTO t1 (a,b) VALUES (3,3),(4,4); +-Warnings: +-Warning 1906 The value specified for computed column 'b' in table 't1' ignored +-Warning 1906 The value specified for computed column 'b' in table 't1' ignored +-SELECT * FROM t1; +-a b +-1 2 +-2 3 +-3 4 +-4 5 +-DROP TABLE t1; ++ERROR HY000: InnoDB storage engine does not support computed columns ++# ERROR: Statement ended with errno 1910, errname ER_UNSUPPORTED_ENGINE_FOR_VIRTUAL_COLUMNS (expected to succeed) ++# ------------ UNEXPECTED RESULT ------------ ++# [ CREATE TABLE t1 (a INT(11) /*!*/ /*Custom column options*/, b INT(11) /*!*/ /*Custom column options*/ GENERATED ALWAYS AS (a+1)) ENGINE=InnoDB /*!*/ /*Custom table options*/ ] ++# The statement|command finished with ER_UNSUPPORTED_ENGINE_FOR_VIRTUAL_COLUMNS. ++# Virtual columns or the mix could be unsupported|malfunctioning, or the problem was caused by previous errors. ++# You can change the engine code, or create an rdiff, or disable the test by adding it to disabled.def. ++# Further in this test, the message might sometimes be suppressed; a part of the test might be skipped. ++# Also, this problem may cause a chain effect (more errors of different kinds in the test). ++# ------------------------------------------- diff --git a/storage/innobase/os/os0file.c b/storage/innobase/os/os0file.c index 15e66167f26..1068c033871 100644 --- a/storage/innobase/os/os0file.c +++ b/storage/innobase/os/os0file.c @@ -303,6 +303,7 @@ UNIV_INTERN ulint os_n_pending_writes = 0; UNIV_INTERN ulint os_n_pending_reads = 0; #ifdef UNIV_DEBUG +# ifndef UNIV_HOTBACKUP /**********************************************************************//** Validates the consistency the aio system some of the time. @return TRUE if ok or the check was skipped */ @@ -329,6 +330,7 @@ os_aio_validate_skip(void) os_aio_validate_count = OS_AIO_VALIDATE_SKIP; return(os_aio_validate()); } +# endif /* !UNIV_HOTBACKUP */ #endif /* UNIV_DEBUG */ #ifdef __WIN__ diff --git a/storage/innobase/page/page0zip.c b/storage/innobase/page/page0zip.c index fb618beac7e..ca3836689d3 100644 --- a/storage/innobase/page/page0zip.c +++ b/storage/innobase/page/page0zip.c @@ -4433,7 +4433,9 @@ page_zip_reorganize( dict_index_t* index, /*!< in: index of the B-tree node */ mtr_t* mtr) /*!< in: mini-transaction */ { +#ifndef UNIV_HOTBACKUP buf_pool_t* buf_pool = buf_pool_from_block(block); +#endif /* !UNIV_HOTBACKUP */ page_zip_des_t* page_zip = buf_block_get_page_zip(block); page_t* page = buf_block_get_frame(block); buf_block_t* temp_block; diff --git a/storage/innobase/row/row0ins.c b/storage/innobase/row/row0ins.c index 2b77c6f929d..60a66ea3945 100644 --- a/storage/innobase/row/row0ins.c +++ b/storage/innobase/row/row0ins.c @@ -1281,7 +1281,8 @@ run_again: check_index = foreign->foreign_index; } - if (check_table == NULL || check_table->ibd_file_missing) { + if (check_table == NULL || check_table->ibd_file_missing + || check_index == NULL) { if (check_ref) { FILE* ef = dict_foreign_err_file; @@ -1316,9 +1317,6 @@ run_again: goto exit_func; } - ut_a(check_table); - ut_a(check_index); - if (check_table != table) { /* We already have a LOCK_IX on table, but not necessarily on check_table */ diff --git a/storage/innobase/row/row0vers.c b/storage/innobase/row/row0vers.c index 5fd7d082194..6d83dbaf8ee 100644 --- a/storage/innobase/row/row0vers.c +++ b/storage/innobase/row/row0vers.c @@ -209,17 +209,6 @@ row_vers_impl_x_locked_off_kernel( prev_trx_id = row_get_rec_trx_id(prev_version, clust_index, clust_offsets); - /* If the trx_id and prev_trx_id are different and if - the prev_version is marked deleted then the - prev_trx_id must have already committed for the trx_id - to be able to modify the row. Therefore, prev_trx_id - cannot hold any implicit lock. */ - if (vers_del && trx_id != prev_trx_id) { - - mutex_enter(&kernel_mutex); - break; - } - /* The stack of versions is locked by mtr. Thus, it is safe to fetch the prefixes for externally stored columns. */ diff --git a/storage/innobase/trx/trx0sys.c b/storage/innobase/trx/trx0sys.c index 90091c00228..0c5e367ac30 100644 --- a/storage/innobase/trx/trx0sys.c +++ b/storage/innobase/trx/trx0sys.c @@ -134,12 +134,12 @@ UNIV_INTERN mysql_pfs_key_t trx_doublewrite_mutex_key; UNIV_INTERN mysql_pfs_key_t file_format_max_mutex_key; #endif /* UNIV_PFS_MUTEX */ +#ifndef UNIV_HOTBACKUP #ifdef UNIV_DEBUG /* Flag to control TRX_RSEG_N_SLOTS behavior debugging. */ uint trx_rseg_n_slots_debug = 0; #endif -#ifndef UNIV_HOTBACKUP /** This is used to track the maximum file format id known to InnoDB. It's updated via SET GLOBAL innodb_file_format_max = 'x' or when we open or create a table. */ diff --git a/storage/innobase/ut/ut0dbg.c b/storage/innobase/ut/ut0dbg.c index 64fadd76d1c..53ed4a53044 100644 --- a/storage/innobase/ut/ut0dbg.c +++ b/storage/innobase/ut/ut0dbg.c @@ -25,7 +25,9 @@ Created 1/30/1994 Heikki Tuuri #include "univ.i" #include "ut0dbg.h" -#include "ha_prototypes.h" +#ifndef UNIV_HOTBACKUP +# include "ha_prototypes.h" +#endif /* !UNIV_HOTBACKUP */ #if defined(__GNUC__) && (__GNUC__ > 2) #else @@ -56,7 +58,7 @@ ut_dbg_assertion_failed( ut_print_timestamp(stderr); #ifdef UNIV_HOTBACKUP fprintf(stderr, " InnoDB: Assertion failure in file %s line %lu\n", - innobase_basename(file), line); + file, line); #else /* UNIV_HOTBACKUP */ fprintf(stderr, " InnoDB: Assertion failure in thread %lu" diff --git a/storage/innobase/ut/ut0ut.c b/storage/innobase/ut/ut0ut.c index 117a777cb98..2fe45aad2a7 100644 --- a/storage/innobase/ut/ut0ut.c +++ b/storage/innobase/ut/ut0ut.c @@ -245,7 +245,9 @@ ut_print_timestamp( (int)cal_tm.wMinute, (int)cal_tm.wSecond); #else +#ifdef HAVE_LOCALTIME_R struct tm cal_tm; +#endif struct tm* cal_tm_ptr; time_t tm; @@ -288,7 +290,9 @@ ut_sprintf_timestamp( (int)cal_tm.wMinute, (int)cal_tm.wSecond); #else +#ifdef HAVE_LOCALTIME_R struct tm cal_tm; +#endif struct tm* cal_tm_ptr; time_t tm; @@ -333,7 +337,9 @@ ut_sprintf_timestamp_without_extra_chars( (int)cal_tm.wMinute, (int)cal_tm.wSecond); #else +#ifdef HAVE_LOCALTIME_R struct tm cal_tm; +#endif struct tm* cal_tm_ptr; time_t tm; @@ -374,7 +380,9 @@ ut_get_year_month_day( *month = (ulint)cal_tm.wMonth; *day = (ulint)cal_tm.wDay; #else +#ifdef HAVE_LOCALTIME_R struct tm cal_tm; +#endif struct tm* cal_tm_ptr; time_t tm; diff --git a/storage/maria/ha_maria.cc b/storage/maria/ha_maria.cc index 2b67f29f9f8..785fe5d8226 100644 --- a/storage/maria/ha_maria.cc +++ b/storage/maria/ha_maria.cc @@ -235,7 +235,7 @@ static MYSQL_SYSVAR_ULONG(pagecache_age_threshold, "until it is considered aged enough to be downgraded to a warm block. " "This specifies the percentage ratio of that number of hits to the " "total number of blocks in the page cache.", 0, 0, - 300, 100, ~0L, 100); + 300, 100, ~ (ulong) 0L, 100); static MYSQL_SYSVAR_ULONGLONG(pagecache_buffer_size, pagecache_buffer_size, PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, @@ -1008,6 +1008,28 @@ const char *ha_maria::index_type(uint key_number) } +ulong ha_maria::index_flags(uint inx, uint part, bool all_parts) const +{ + ulong flags; + if (table_share->key_info[inx].algorithm == HA_KEY_ALG_FULLTEXT) + flags= 0; + else + if ((table_share->key_info[inx].flags & HA_SPATIAL || + table_share->key_info[inx].algorithm == HA_KEY_ALG_RTREE)) + { + /* All GIS scans are non-ROR scans. We also disable IndexConditionPushdown */ + flags= HA_READ_NEXT | HA_READ_PREV | HA_READ_RANGE | + HA_READ_ORDER | HA_KEYREAD_ONLY | HA_KEY_SCAN_NOT_ROR; + } + else + { + flags= HA_READ_NEXT | HA_READ_PREV | HA_READ_RANGE | + HA_READ_ORDER | HA_KEYREAD_ONLY | HA_DO_INDEX_COND_PUSHDOWN; + } + return flags; +} + + double ha_maria::scan_time() { if (file->s->data_file_type == BLOCK_RECORD) diff --git a/storage/maria/ha_maria.h b/storage/maria/ha_maria.h index 35c98cc52d7..545daca12fe 100644 --- a/storage/maria/ha_maria.h +++ b/storage/maria/ha_maria.h @@ -65,12 +65,7 @@ public: const char **bas_ext() const; ulonglong table_flags() const { return int_table_flags; } - ulong index_flags(uint inx, uint part, bool all_parts) const - { - return ((table_share->key_info[inx].algorithm == HA_KEY_ALG_FULLTEXT) ? - 0 : HA_READ_NEXT | HA_READ_PREV | HA_READ_RANGE | - HA_READ_ORDER | HA_KEYREAD_ONLY | HA_DO_INDEX_COND_PUSHDOWN); - } + ulong index_flags(uint inx, uint part, bool all_parts) const; uint max_supported_keys() const { return MARIA_MAX_KEY; } uint max_supported_key_length() const; diff --git a/storage/maria/ma_blockrec.c b/storage/maria/ma_blockrec.c index 02cb01b581c..8e0407c9d7a 100644 --- a/storage/maria/ma_blockrec.c +++ b/storage/maria/ma_blockrec.c @@ -4677,6 +4677,8 @@ int _ma_read_block_record2(MARIA_HA *info, uchar *record, MARIA_ROW *cur_row= &info->cur_row; DBUG_ENTER("_ma_read_block_record2"); + LINT_INIT(blob_buffer); + start_of_data= data; flag= (uint) (uchar) data[0]; cur_null_bytes= share->base.original_null_bytes; diff --git a/storage/maria/ma_ft_nlq_search.c b/storage/maria/ma_ft_nlq_search.c index e57cc135ca1..5c1ab85ef8a 100644 --- a/storage/maria/ma_ft_nlq_search.c +++ b/storage/maria/ma_ft_nlq_search.c @@ -83,6 +83,8 @@ static int walk_and_match(FT_WORD *word, uint32 count, ALL_IN_ONE *aio) #endif DBUG_ENTER("walk_and_match"); + LINT_INIT_STRUCT(subkeys); + word->weight=LWS_FOR_QUERY; _ma_ft_make_key(info, &key, aio->keynr, keybuff, word, 0); diff --git a/storage/maria/ma_key_recover.c b/storage/maria/ma_key_recover.c index 8b2dc4a1e07..502ac2b8809 100644 --- a/storage/maria/ma_key_recover.c +++ b/storage/maria/ma_key_recover.c @@ -946,7 +946,9 @@ uint _ma_apply_redo_index(MARIA_HA *info, uint page_offset= 0, org_page_length; uint page_length, keypage_header, keynr; uint max_page_size= share->max_index_block_size; - uint __attribute__((unused)) new_page_length= 0; +#ifndef DBUG_OFF + uint new_page_length= 0; +#endif int result; MARIA_PAGE page; DBUG_ENTER("_ma_apply_redo_index"); @@ -1108,7 +1110,9 @@ uint _ma_apply_redo_index(MARIA_HA *info, DBUG_PRINT("redo", ("org_page_length: %u new_page_length: %u", uint2korr(header), uint2korr(header+2))); DBUG_ASSERT(uint2korr(header) == page_length); +#ifndef DBUG_OFF new_page_length= min(uint2korr(header+2), max_page_size); +#endif header+= 4; break; case KEY_OP_MAX_PAGELENGTH: diff --git a/storage/maria/ma_pagecache.c b/storage/maria/ma_pagecache.c index 2618d6a5b50..6aaccea219f 100644 --- a/storage/maria/ma_pagecache.c +++ b/storage/maria/ma_pagecache.c @@ -3372,6 +3372,7 @@ restart: PAGECACHE_BLOCK_LINK *block; uint status; int page_st; + LINT_INIT(page_st); pagecache_pthread_mutex_lock(&pagecache->cache_lock); if (!pagecache->can_be_used) diff --git a/storage/maria/ma_search.c b/storage/maria/ma_search.c index 3b774fb4283..ccb4bf77717 100644 --- a/storage/maria/ma_search.c +++ b/storage/maria/ma_search.c @@ -439,6 +439,10 @@ int _ma_prefix_search(const MARIA_KEY *key, const MARIA_PAGE *ma_page, const uchar *sort_order= keyinfo->seg->charset->sort_order; DBUG_ENTER("_ma_prefix_search"); + LINT_INIT(seg_len_pack); + LINT_INIT(prefix_len); + LINT_INIT(length); + t_buff[0]=0; /* Avoid bugs */ page_flag= ma_page->flag; nod_flag= ma_page->node; diff --git a/storage/maria/maria_chk.c b/storage/maria/maria_chk.c index 27653ae5574..62225a7a4b0 100644 --- a/storage/maria/maria_chk.c +++ b/storage/maria/maria_chk.c @@ -21,9 +21,6 @@ #include <m_ctype.h> #include <stdarg.h> #include <my_getopt.h> -#ifdef HAVE_SYS_VADVICE_H -#include <sys/vadvise.h> -#endif #ifdef HAVE_SYS_MMAN_H #include <sys/mman.h> #endif diff --git a/storage/myisam/ft_boolean_search.c b/storage/myisam/ft_boolean_search.c index f419ac3d689..8b61e1dc4f2 100644 --- a/storage/myisam/ft_boolean_search.c +++ b/storage/myisam/ft_boolean_search.c @@ -352,7 +352,7 @@ static int _ftb_no_dupes_cmp(void* not_used __attribute__((unused)), returns 1 if the search was finished (must-word wasn't found) */ -static int _ft2_search(FTB *ftb, FTB_WORD *ftbw, my_bool init_search) +static int _ft2_search_no_lock(FTB *ftb, FTB_WORD *ftbw, my_bool init_search) { int r; int subkeys=1; @@ -452,7 +452,7 @@ static int _ft2_search(FTB *ftb, FTB_WORD *ftbw, my_bool init_search) ftbw->key_root=info->s->state.key_root[ftb->keynr]; ftbw->keyinfo=info->s->keyinfo+ftb->keynr; ftbw->off=0; - return _ft2_search(ftb, ftbw, 0); + return _ft2_search_no_lock(ftb, ftbw, 0); } /* matching key found */ @@ -480,6 +480,18 @@ static int _ft2_search(FTB *ftb, FTB_WORD *ftbw, my_bool init_search) return 0; } +static int _ft2_search(FTB *ftb, FTB_WORD *ftbw, my_bool init_search) +{ + int r; + MYISAM_SHARE *share= ftb->info->s; + if (share->concurrent_insert) + mysql_rwlock_rdlock(&share->key_root_lock[ftb->keynr]); + r= _ft2_search_no_lock(ftb, ftbw, init_search); + if (share->concurrent_insert) + mysql_rwlock_unlock(&share->key_root_lock[ftb->keynr]); + return r; +} + static void _ftb_init_index_search(FT_INFO *ftb) { int i; diff --git a/storage/myisam/ft_nlq_search.c b/storage/myisam/ft_nlq_search.c index e31075e55d1..bafa7064e28 100644 --- a/storage/myisam/ft_nlq_search.c +++ b/storage/myisam/ft_nlq_search.c @@ -70,9 +70,10 @@ static int walk_and_match(FT_WORD *word, uint32 count, ALL_IN_ONE *aio) TREE_ELEMENT *selem; double gweight=1; MI_INFO *info=aio->info; + MYISAM_SHARE *share= info->s; uchar *keybuff=aio->keybuff; MI_KEYDEF *keyinfo=info->s->keyinfo+aio->keynr; - my_off_t key_root=info->s->state.key_root[aio->keynr]; + my_off_t key_root; uint extra= HA_FT_WLEN + info->s->rec_reflength; #if HA_FT_WTYPE == HA_KEYTYPE_FLOAT float tmp_weight; @@ -80,6 +81,7 @@ static int walk_and_match(FT_WORD *word, uint32 count, ALL_IN_ONE *aio) #error #endif DBUG_ENTER("walk_and_match"); + LINT_INIT_STRUCT(subkeys); word->weight=LWS_FOR_QUERY; @@ -87,6 +89,11 @@ static int walk_and_match(FT_WORD *word, uint32 count, ALL_IN_ONE *aio) keylen-=HA_FT_WLEN; doc_cnt=0; + if (share->concurrent_insert) + mysql_rwlock_rdlock(&share->key_root_lock[aio->keynr]); + + key_root= share->state.key_root[aio->keynr]; + /* Skip rows inserted by current inserted */ for (r=_mi_search(info, keyinfo, keybuff, keylen, SEARCH_FIND, key_root) ; !r && @@ -96,6 +103,9 @@ static int walk_and_match(FT_WORD *word, uint32 count, ALL_IN_ONE *aio) info->lastkey_length, SEARCH_BIGGER, key_root)) ; + if (share->concurrent_insert) + mysql_rwlock_unlock(&share->key_root_lock[aio->keynr]); + info->update|= HA_STATE_AKTIV; /* for _mi_test_if_changed() */ /* The following should be safe, even if we compare doubles */ @@ -119,6 +129,8 @@ static int walk_and_match(FT_WORD *word, uint32 count, ALL_IN_ONE *aio) keyinfo=& info->s->ft2_keyinfo; key_root=info->lastpos; keylen=0; + if (share->concurrent_insert) + mysql_rwlock_rdlock(&share->key_root_lock[aio->keynr]); r=_mi_search_first(info, keyinfo, key_root); goto do_skip; } @@ -154,6 +166,9 @@ static int walk_and_match(FT_WORD *word, uint32 count, ALL_IN_ONE *aio) if (gweight < 0 || doc_cnt > 2000000) gweight=0; + if (share->concurrent_insert) + mysql_rwlock_rdlock(&share->key_root_lock[aio->keynr]); + if (_mi_test_if_changed(info) == 0) r=_mi_search_next(info, keyinfo, info->lastkey, info->lastkey_length, SEARCH_BIGGER, key_root); @@ -166,6 +181,8 @@ do_skip: r= _mi_search_next(info, keyinfo, info->lastkey, info->lastkey_length, SEARCH_BIGGER, key_root); + if (share->concurrent_insert) + mysql_rwlock_unlock(&share->key_root_lock[aio->keynr]); } word->weight=gweight; diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc index 4fbd94a1a3b..73e0fadd530 100644 --- a/storage/myisam/ha_myisam.cc +++ b/storage/myisam/ha_myisam.cc @@ -689,6 +689,28 @@ const char *ha_myisam::index_type(uint key_number) } +ulong ha_myisam::index_flags(uint inx, uint part, bool all_parts) const +{ + ulong flags; + if (table_share->key_info[inx].algorithm == HA_KEY_ALG_FULLTEXT) + flags= 0; + else + if ((table_share->key_info[inx].flags & HA_SPATIAL || + table_share->key_info[inx].algorithm == HA_KEY_ALG_RTREE)) + { + /* All GIS scans are non-ROR scans. We also disable IndexConditionPushdown */ + flags= HA_READ_NEXT | HA_READ_PREV | HA_READ_RANGE | + HA_READ_ORDER | HA_KEYREAD_ONLY | HA_KEY_SCAN_NOT_ROR; + } + else + { + flags= HA_READ_NEXT | HA_READ_PREV | HA_READ_RANGE | + HA_READ_ORDER | HA_KEYREAD_ONLY | HA_DO_INDEX_COND_PUSHDOWN; + } + return flags; +} + + /* Name is here without an extension */ int ha_myisam::open(const char *name, int mode, uint test_if_locked) { diff --git a/storage/myisam/ha_myisam.h b/storage/myisam/ha_myisam.h index 579ef061af4..79324f64370 100644 --- a/storage/myisam/ha_myisam.h +++ b/storage/myisam/ha_myisam.h @@ -64,12 +64,7 @@ class ha_myisam: public handler int index_end(); int rnd_end(); - ulong index_flags(uint inx, uint part, bool all_parts) const - { - return ((table_share->key_info[inx].algorithm == HA_KEY_ALG_FULLTEXT) ? - 0 : HA_READ_NEXT | HA_READ_PREV | HA_READ_RANGE | - HA_READ_ORDER | HA_KEYREAD_ONLY | HA_DO_INDEX_COND_PUSHDOWN); - } + ulong index_flags(uint inx, uint part, bool all_parts) const; uint max_supported_keys() const { return MI_MAX_KEY; } uint max_supported_key_parts() const { return HA_MAX_KEY_SEG; } uint max_supported_key_length() const { return HA_MAX_KEY_LENGTH; } diff --git a/storage/myisam/mi_extra.c b/storage/myisam/mi_extra.c index 92d7459dfc5..dab1f66ed6d 100644 --- a/storage/myisam/mi_extra.c +++ b/storage/myisam/mi_extra.c @@ -330,9 +330,7 @@ int mi_extra(MI_INFO *info, enum ha_extra_function function, void *extra_arg) if (!share->temporary) flush_key_blocks(share->key_cache, share->kfile, &share->dirty_part_map, FLUSH_KEEP); -#ifdef HAVE_PWRITE _mi_decrement_open_count(info); -#endif if (share->not_flushed) { share->not_flushed=0; diff --git a/storage/myisam/myisamchk.c b/storage/myisam/myisamchk.c index fa8cc679997..7d8b577e8b0 100644 --- a/storage/myisam/myisamchk.c +++ b/storage/myisam/myisamchk.c @@ -20,9 +20,6 @@ #include <stdarg.h> #include <my_getopt.h> #include <my_bit.h> -#ifdef HAVE_SYS_VADVICE_H -#include <sys/vadvise.h> -#endif #ifdef HAVE_SYS_MMAN_H #include <sys/mman.h> #endif diff --git a/storage/myisam/mysql-test/mtr2/suite.pm b/storage/myisam/mysql-test/mtr2/suite.pm new file mode 100644 index 00000000000..0f287e4a8ba --- /dev/null +++ b/storage/myisam/mysql-test/mtr2/suite.pm @@ -0,0 +1,9 @@ +package My::Suite::MTR2::MyISAM; + +@ISA = qw(My::Suite); + +sub skip_combinations {( + 'combinations' => [ '1st' ], +)} +bless { }; + diff --git a/storage/myisam/mysql-test/storage_engine/alter_tablespace.rdiff b/storage/myisam/mysql-test/storage_engine/alter_tablespace.rdiff new file mode 100644 index 00000000000..3caf2ad6c3a --- /dev/null +++ b/storage/myisam/mysql-test/storage_engine/alter_tablespace.rdiff @@ -0,0 +1,32 @@ +--- suite/storage_engine/alter_tablespace.result 2012-07-12 19:53:40.775419511 +0400 ++++ suite/storage_engine/alter_tablespace.reject 2012-07-15 16:21:14.910435703 +0400 +@@ -1,19 +1,14 @@ + DROP TABLE IF EXISTS t1, t2; + CREATE TABLE t1 (a <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; + ALTER TABLE t1 DISCARD TABLESPACE; +-DROP TABLE t1; +-CREATE TABLE t1 (a <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +-INSERT INTO t1 (a) VALUES (1),(2); +-SELECT * FROM t1; +-a +-1 +-2 +-ALTER TABLE t1 DISCARD TABLESPACE; +-SELECT * FROM t1; +-ERROR HY000: Got error -1 from storage engine +-ALTER TABLE t1 IMPORT TABLESPACE; +-SELECT * FROM t1; +-a +-1 +-2 ++ERROR HY000: Table storage engine for 't1' doesn't have this option ++# ERROR: Statement ended with errno 1031, errname ER_ILLEGAL_HA (expected to succeed) ++# ------------ UNEXPECTED RESULT ------------ ++# [ ALTER TABLE t1 DISCARD TABLESPACE ] ++# The statement|command finished with ER_ILLEGAL_HA. ++# Tablespace operations or the syntax or the mix could be unsupported. ++# You can change the engine code, or create an rdiff, or disable the test by adding it to disabled.def. ++# Further in this test, the message might sometimes be suppressed; a part of the test might be skipped. ++# Also, this problem may cause a chain effect (more errors of different kinds in the test). ++# ------------------------------------------- + DROP TABLE t1; diff --git a/storage/myisam/mysql-test/storage_engine/check_table.rdiff b/storage/myisam/mysql-test/storage_engine/check_table.rdiff new file mode 100644 index 00000000000..48e8fc2e770 --- /dev/null +++ b/storage/myisam/mysql-test/storage_engine/check_table.rdiff @@ -0,0 +1,20 @@ +--- suite/storage_engine/check_table.result 2012-07-15 04:19:07.782936394 +0400 ++++ suite/storage_engine/check_table.reject 2012-07-15 16:21:16.734412773 +0400 +@@ -18,7 +18,7 @@ + INSERT INTO t1 (a,b) VALUES (6,'f'); + CHECK TABLE t1 FAST; + Table Op Msg_type Msg_text +-test.t1 check status OK ++test.t1 check status Table is already up to date + INSERT INTO t1 (a,b) VALUES (7,'g'); + INSERT INTO t2 (a,b) VALUES (8,'h'); + CHECK TABLE t2, t1 MEDIUM; +@@ -52,7 +52,7 @@ + INSERT INTO t1 (a) VALUES (17),(120),(132); + CHECK TABLE t1 FAST; + Table Op Msg_type Msg_text +-test.t1 check status OK ++test.t1 check status Table is already up to date + INSERT INTO t1 (a) VALUES (801),(900),(7714); + CHECK TABLE t1 MEDIUM; + Table Op Msg_type Msg_text diff --git a/storage/myisam/mysql-test/storage_engine/define_engine.inc b/storage/myisam/mysql-test/storage_engine/define_engine.inc new file mode 100644 index 00000000000..d5e741629de --- /dev/null +++ b/storage/myisam/mysql-test/storage_engine/define_engine.inc @@ -0,0 +1,45 @@ +########################################### +# +# This is a template of the include file define_engine.inc which +# should be placed in storage/<engine>/mysql-test/storage_engine folder. +# +################################ +# +# The name of the engine under test must be defined in $ENGINE variable. +# You can set it either here (uncomment and edit) or in your environment. +# +let $ENGINE = MyISAM; +# +################################ +# +# The following three variables define specific options for columns and tables. +# Normally there should be none needed, but for some engines it can be different. +# If the engine requires specific column option for all or indexed columns, +# set them inside the comment, e.g. /*!NOT NULL*/. +# Do the same for table options if needed, e.g. /*!INSERT_METHOD=LAST*/ + +let $default_col_opts = /*!*/; +let $default_col_indexed_opts = /*!*/; +let $default_tbl_opts = /*!*/; + +# INDEX, UNIQUE INDEX, PRIMARY KEY, special index type - choose the fist that the engine allows, +# or set it to /*!*/ if none is supported + +let $default_index = /*!INDEX*/; + +# If the engine does not support the following types, replace them with the closest possible + +let $default_int_type = INT(11); +let $default_char_type = CHAR(8); + +################################ + +--disable_query_log +--disable_result_log + +# Here you can place your custom MTR code which needs to be executed before each test, +# e.g. creation of an additional schema or table, etc. +# The cleanup part should be defined in cleanup_engine.inc + +--enable_query_log +--enable_result_log diff --git a/storage/myisam/mysql-test/storage_engine/foreign_keys.rdiff b/storage/myisam/mysql-test/storage_engine/foreign_keys.rdiff new file mode 100644 index 00000000000..67157754c04 --- /dev/null +++ b/storage/myisam/mysql-test/storage_engine/foreign_keys.rdiff @@ -0,0 +1,145 @@ +--- suite/storage_engine/foreign_keys.result 2012-07-12 18:56:19.782678645 +0400 ++++ suite/storage_engine/foreign_keys.reject 2012-07-15 16:21:30.414240794 +0400 +@@ -12,29 +12,57 @@ + t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` char(8) DEFAULT NULL, +- KEY `a` (`a`), +- CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`a`) REFERENCES `t1` (`a`) ++ KEY `a` (`a`) + ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 + INSERT INTO t2 (a,b) VALUES (1,'a'),(2,'b'); +-ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`a`) REFERENCES `t1` (`a`)) ++# ERROR: Statement succeeded (expected results: ER_NO_REFERENCED_ROW_2) ++# ------------ UNEXPECTED RESULT ------------ ++# The statement|command succeeded unexpectedly. ++# Foreign keys or the mix could be unsupported|malfunctioning, or the problem was caused by previous errors. ++# You can change the engine code, or create an rdiff, or disable the test by adding it to disabled.def. ++# Further in this test, the message might sometimes be suppressed; a part of the test might be skipped. ++# Also, this problem may cause a chain effect (more errors of different kinds in the test). ++# ------------------------------------------- + INSERT INTO t1 (a,b) VALUES (1,'c'),(2,'d'); + INSERT INTO t2 (a,b) VALUES (1,'a'),(2,'b'); + UPDATE t2 SET a=a+1; +-ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`a`) REFERENCES `t1` (`a`)) ++# ERROR: Statement succeeded (expected results: ER_NO_REFERENCED_ROW_2) ++# ------------ UNEXPECTED RESULT ------------ ++# The statement|command succeeded unexpectedly. ++# Foreign keys or the mix could be unsupported|malfunctioning, or the problem was caused by previous errors. ++# You can change the engine code, or create an rdiff, or disable the test by adding it to disabled.def. ++# Further in this test, the message might sometimes be suppressed; a part of the test might be skipped. ++# Also, this problem may cause a chain effect (more errors of different kinds in the test). ++# ------------------------------------------- + UPDATE t1 SET a=3 WHERE a=2; +-ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`a`) REFERENCES `t1` (`a`)) ++# ERROR: Statement succeeded (expected results: ER_ROW_IS_REFERENCED_2) + DELETE FROM t1 WHERE a=2; +-ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`a`) REFERENCES `t1` (`a`)) ++# ERROR: Statement succeeded (expected results: ER_ROW_IS_REFERENCED_2) ++# ------------ UNEXPECTED RESULT ------------ ++# The statement|command succeeded unexpectedly. ++# Foreign keys or the mix could be unsupported|malfunctioning, or the problem was caused by previous errors. ++# You can change the engine code, or create an rdiff, or disable the test by adding it to disabled.def. ++# Further in this test, the message might sometimes be suppressed; a part of the test might be skipped. ++# Also, this problem may cause a chain effect (more errors of different kinds in the test). ++# ------------------------------------------- + DELETE FROM t2 WHERE a=2; + SELECT * FROM t1; + a b + 1 c +-2 d ++3 d + SELECT * FROM t2; + a b +-1 a ++3 b ++3 b + DROP TABLE t1; +-ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails ++# ERROR: Statement succeeded (expected results: ER_ROW_IS_REFERENCED) ++# ------------ UNEXPECTED RESULT ------------ ++# The statement|command succeeded unexpectedly. ++# Foreign keys or the mix could be unsupported|malfunctioning, or the problem was caused by previous errors. ++# You can change the engine code, or create an rdiff, or disable the test by adding it to disabled.def. ++# Further in this test, the message might sometimes be suppressed; a part of the test might be skipped. ++# Also, this problem may cause a chain effect (more errors of different kinds in the test). ++# ------------------------------------------- + DROP TABLE t2; + CREATE TABLE t2 (a <INT_COLUMN>, + b <CHAR_COLUMN>, +@@ -46,26 +74,65 @@ + t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` char(8) DEFAULT NULL, +- KEY `a` (`a`), +- CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`a`) REFERENCES `t1` (`a`) ON DELETE CASCADE ON UPDATE CASCADE ++ KEY `a` (`a`) + ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 + INSERT INTO t2 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'); +-ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`a`) REFERENCES `t1` (`a`) ON DELETE CASCADE ON UPDATE CASCADE) ++# ERROR: Statement succeeded (expected results: ER_NO_REFERENCED_ROW_2) + INSERT INTO t1 (a,b) VALUES (3,'a'),(4,'a'); ++ERROR 42S02: Table 'test.t1' doesn't exist + INSERT INTO t2 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(4,'e'),(3,'a'); + UPDATE t1 SET a=a+1; ++ERROR 42S02: Table 'test.t1' doesn't exist ++# ------------ UNEXPECTED RESULT ------------ ++# The statement|command finished with ER_NO_SUCH_TABLE. ++# UPDATE or the mix could be unsupported|malfunctioning, or the problem was caused by previous errors. ++# You can change the engine code, or create an rdiff, or disable the test by adding it to disabled.def. ++# Further in this test, the message might sometimes be suppressed; a part of the test might be skipped. ++# Also, this problem may cause a chain effect (more errors of different kinds in the test). ++# ------------------------------------------- + SELECT * FROM t2; + a b +-5 a +-5 a +-5 b +-5 c +-5 d +-5 e ++1 a ++1 a ++2 b ++2 b ++3 a ++3 c ++3 c ++4 d ++4 d ++4 e + DELETE FROM t1 WHERE b='a' LIMIT 2; ++ERROR 42S02: Table 'test.t1' doesn't exist ++# ------------ UNEXPECTED RESULT ------------ ++# The statement|command finished with ER_NO_SUCH_TABLE. ++# DELETE or the mix could be unsupported|malfunctioning, or the problem was caused by previous errors. ++# You can change the engine code, or create an rdiff, or disable the test by adding it to disabled.def. ++# Further in this test, the message might sometimes be suppressed; a part of the test might be skipped. ++# Also, this problem may cause a chain effect (more errors of different kinds in the test). ++# ------------------------------------------- + SELECT * FROM t2; + a b ++1 a ++1 a ++2 b ++2 b ++3 a ++3 c ++3 c ++4 d ++4 d ++4 e + TRUNCATE TABLE t1; +-ERROR 42000: Cannot truncate a table referenced in a foreign key constraint (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`a`) REFERENCES `test`.`t1` (`a`)) ++ERROR 42S02: Table 'test.t1' doesn't exist ++# ERROR: Statement ended with errno 1146, errname ER_NO_SUCH_TABLE (expected results: ER_TRUNCATE_ILLEGAL_FK) ++# ------------ UNEXPECTED RESULT ------------ ++# The statement|command finished with ER_NO_SUCH_TABLE. ++# Foreign keys or the mix could be unsupported|malfunctioning, or the problem was caused by previous errors. ++# You can change the engine code, or create an rdiff, or disable the test by adding it to disabled.def. ++# Further in this test, the message might sometimes be suppressed; a part of the test might be skipped. ++# Also, this problem may cause a chain effect (more errors of different kinds in the test). ++# ------------------------------------------- + DROP TABLE t2; + DROP TABLE t1; ++ERROR 42S02: Unknown table 't1' diff --git a/storage/myisam/mysql-test/storage_engine/index_type_hash.rdiff b/storage/myisam/mysql-test/storage_engine/index_type_hash.rdiff new file mode 100644 index 00000000000..e7fa0013fa9 --- /dev/null +++ b/storage/myisam/mysql-test/storage_engine/index_type_hash.rdiff @@ -0,0 +1,60 @@ +--- suite/storage_engine/index_type_hash.result 2012-07-15 01:10:17.919128889 +0400 ++++ suite/storage_engine/index_type_hash.reject 2012-07-15 16:21:32.806210722 +0400 +@@ -4,7 +4,7 @@ + ) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; + SHOW KEYS IN t1; + Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +-t1 1 a 1 a # # NULL NULL # HASH ++t1 1 a 1 a # # NULL NULL # BTREE + DROP TABLE t1; + CREATE TABLE t1 (a <INT_COLUMN>, + b <CHAR_COLUMN>, +@@ -12,8 +12,8 @@ + ) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; + SHOW KEYS IN t1; + Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +-t1 1 a_b 1 a # # NULL NULL # HASH a_b index +-t1 1 a_b 2 b # # NULL NULL # HASH a_b index ++t1 1 a_b 1 a # # NULL NULL # BTREE a_b index ++t1 1 a_b 2 b # # NULL NULL # BTREE a_b index + DROP TABLE t1; + CREATE TABLE t1 (a <INT_COLUMN>, + b <CHAR_COLUMN>, +@@ -22,8 +22,8 @@ + ) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; + SHOW KEYS IN t1; + Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +-t1 1 a 1 a # # NULL NULL # HASH +-t1 1 b 1 b # # NULL NULL # HASH ++t1 1 a 1 a # # NULL NULL # BTREE ++t1 1 b 1 b # # NULL NULL # BTREE + DROP TABLE t1; + CREATE TABLE t1 (a <INT_COLUMN>, + b <CHAR_COLUMN>, +@@ -31,7 +31,7 @@ + ) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; + SHOW KEYS IN t1; + Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +-t1 0 a 1 a # # NULL NULL # HASH ++t1 0 a 1 a # # NULL NULL # BTREE + INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); + INSERT INTO t1 (a,b) VALUES (1,'c'); + ERROR 23000: Duplicate entry '1' for key 'a' +@@ -43,7 +43,7 @@ + ALTER TABLE t1 ADD <CUSTOM_INDEX> (a) USING HASH COMMENT 'simple index on a'; + SHOW INDEX FROM t1; + Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +-t1 1 a 1 a # # NULL NULL # HASH simple index on a ++t1 1 a 1 a # # NULL NULL # BTREE simple index on a + ALTER TABLE t1 DROP KEY a; + DROP TABLE t1; + CREATE TABLE t1 (a <INT_COLUMN>, +@@ -52,7 +52,7 @@ + ) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; + SHOW KEYS IN t1; + Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +-t1 0 a 1 a # # NULL NULL # HASH ++t1 0 a 1 a # # NULL NULL # BTREE + INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); + INSERT INTO t1 (a,b) VALUES (1,'c'); + ERROR 23000: Duplicate entry '1' for key 'a' diff --git a/storage/myisam/mysql-test/storage_engine/show_engine.rdiff b/storage/myisam/mysql-test/storage_engine/show_engine.rdiff new file mode 100644 index 00000000000..4e6624653ea --- /dev/null +++ b/storage/myisam/mysql-test/storage_engine/show_engine.rdiff @@ -0,0 +1,10 @@ +--- suite/storage_engine/show_engine.result 2012-06-24 23:55:19.539380000 +0400 ++++ suite/storage_engine/show_engine.reject 2012-07-15 16:21:54.401939228 +0400 +@@ -4,7 +4,6 @@ + # volatile data (timestamps, memory info, etc.) + SHOW ENGINE <STORAGE_ENGINE> STATUS; + Type Name Status +-<STORAGE_ENGINE> ### Engine status, can be long and changeable ### + # For SHOW MUTEX even the number of lines is volatile, so the result logging is disabled, + # the test only checks that the command does not produce any errors + SHOW ENGINE <STORAGE_ENGINE> MUTEX; diff --git a/storage/myisam/mysql-test/storage_engine/tbl_opt_insert_method.rdiff b/storage/myisam/mysql-test/storage_engine/tbl_opt_insert_method.rdiff new file mode 100644 index 00000000000..a8df852515a --- /dev/null +++ b/storage/myisam/mysql-test/storage_engine/tbl_opt_insert_method.rdiff @@ -0,0 +1,11 @@ +--- suite/storage_engine/tbl_opt_insert_method.result 2012-06-24 23:55:19.539380000 +0400 ++++ suite/storage_engine/tbl_opt_insert_method.reject 2012-07-15 16:21:56.381914337 +0400 +@@ -5,7 +5,7 @@ + t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` char(8) DEFAULT NULL +-) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 INSERT_METHOD=FIRST ++) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 + ALTER TABLE t1 INSERT_METHOD=NO; + SHOW CREATE TABLE t1; + Table Create Table diff --git a/storage/myisam/mysql-test/storage_engine/tbl_opt_union.rdiff b/storage/myisam/mysql-test/storage_engine/tbl_opt_union.rdiff new file mode 100644 index 00000000000..4fa164523db --- /dev/null +++ b/storage/myisam/mysql-test/storage_engine/tbl_opt_union.rdiff @@ -0,0 +1,16 @@ +--- suite/storage_engine/tbl_opt_union.result 2012-06-24 23:55:19.539380000 +0400 ++++ suite/storage_engine/tbl_opt_union.reject 2012-07-15 16:21:58.121892463 +0400 +@@ -4,11 +4,11 @@ + Table Create Table + t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +-) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 UNION=(`child1`) ++) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 + ALTER TABLE t1 UNION = (child1,child2); + SHOW CREATE TABLE t1; + Table Create Table + t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +-) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 UNION=(`child1`,`child2`) ++) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 + DROP TABLE t1, child1, child2; diff --git a/storage/myisam/mysql-test/storage_engine/trx/cons_snapshot_repeatable_read.rdiff b/storage/myisam/mysql-test/storage_engine/trx/cons_snapshot_repeatable_read.rdiff new file mode 100644 index 00000000000..8d1434ad2fe --- /dev/null +++ b/storage/myisam/mysql-test/storage_engine/trx/cons_snapshot_repeatable_read.rdiff @@ -0,0 +1,9 @@ +0a1,6 +> # -- WARNING ---------------------------------------------------------------- +> # According to I_S.ENGINES, MyISAM does not support transactions. +> # If it is true, the test will most likely fail; you can +> # either create an rdiff file, or add the test to disabled.def. +> # If transactions should be supported, check the data in Information Schema. +> # --------------------------------------------------------------------------- +13a20 +> 1 diff --git a/storage/myisam/mysql-test/storage_engine/trx/cons_snapshot_serializable.rdiff b/storage/myisam/mysql-test/storage_engine/trx/cons_snapshot_serializable.rdiff new file mode 100644 index 00000000000..8d1434ad2fe --- /dev/null +++ b/storage/myisam/mysql-test/storage_engine/trx/cons_snapshot_serializable.rdiff @@ -0,0 +1,9 @@ +0a1,6 +> # -- WARNING ---------------------------------------------------------------- +> # According to I_S.ENGINES, MyISAM does not support transactions. +> # If it is true, the test will most likely fail; you can +> # either create an rdiff file, or add the test to disabled.def. +> # If transactions should be supported, check the data in Information Schema. +> # --------------------------------------------------------------------------- +13a20 +> 1 diff --git a/storage/myisam/mysql-test/storage_engine/trx/delete.rdiff b/storage/myisam/mysql-test/storage_engine/trx/delete.rdiff new file mode 100644 index 00000000000..491b4636796 --- /dev/null +++ b/storage/myisam/mysql-test/storage_engine/trx/delete.rdiff @@ -0,0 +1,50 @@ +--- suite/storage_engine/trx/delete.result 2012-07-12 23:06:18.946113626 +0400 ++++ suite/storage_engine/trx/delete.reject 2012-07-15 16:55:46.108397219 +0400 +@@ -1,3 +1,15 @@ ++# -- WARNING ---------------------------------------------------------------- ++# According to I_S.ENGINES, MyISAM does not support transactions. ++# If it is true, the test will most likely fail; you can ++# either create an rdiff file, or add the test to disabled.def. ++# If transactions should be supported, check the data in Information Schema. ++# --------------------------------------------------------------------------- ++# -- WARNING ---------------------------------------------------------------- ++# According to I_S.ENGINES, MyISAM does not support savepoints. ++# If it is true, the test will most likely fail; you can ++# either create an rdiff file (recommended), or add the test to disabled.def. ++# If savepoints should be supported, check the data in Information Schema. ++# --------------------------------------------------------------------------- + DROP TABLE IF EXISTS t1; + CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; + INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(6,'f'),(7,'g'),(8,'h'),(10000,'foobar'); +@@ -46,27 +58,17 @@ + DELETE FROM t1; + RELEASE SAVEPOINT spt1; + ROLLBACK; ++Warnings: ++Warning 1196 Some non-transactional changed tables couldn't be rolled back + SELECT * FROM t1; + a b +-10000 foobar +-10000 foobar +-2 b +-2 b +-4 d +-4 d +-5 e +-5 e +-6 f +-6 f +-7 g +-7 g +-8 h +-8 h + BEGIN; + DELETE FROM t1 WHERE a <= 4 ORDER BY b DESC LIMIT 1; + SAVEPOINT spt1; + DELETE FROM t1; + INSERT INTO t1 (a,b) VALUES (1,'a'); + ROLLBACK TO SAVEPOINT spt1; ++Warnings: ++Warning 1196 Some non-transactional changed tables couldn't be rolled back + COMMIT; + DROP TABLE t1; diff --git a/storage/myisam/mysql-test/storage_engine/trx/insert.rdiff b/storage/myisam/mysql-test/storage_engine/trx/insert.rdiff new file mode 100644 index 00000000000..4619db1d095 --- /dev/null +++ b/storage/myisam/mysql-test/storage_engine/trx/insert.rdiff @@ -0,0 +1,65 @@ +--- suite/storage_engine/trx/insert.result 2012-07-12 23:09:44.663527407 +0400 ++++ suite/storage_engine/trx/insert.reject 2012-07-15 16:55:46.676390078 +0400 +@@ -1,3 +1,15 @@ ++# -- WARNING ---------------------------------------------------------------- ++# According to I_S.ENGINES, MyISAM does not support transactions. ++# If it is true, the test will most likely fail; you can ++# either create an rdiff file, or add the test to disabled.def. ++# If transactions should be supported, check the data in Information Schema. ++# --------------------------------------------------------------------------- ++# -- WARNING ---------------------------------------------------------------- ++# According to I_S.ENGINES, MyISAM does not support savepoints. ++# If it is true, the test will most likely fail; you can ++# either create an rdiff file (recommended), or add the test to disabled.def. ++# If savepoints should be supported, check the data in Information Schema. ++# --------------------------------------------------------------------------- + DROP TABLE IF EXISTS t1; + CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; + BEGIN; +@@ -21,8 +33,11 @@ + RELEASE SAVEPOINT spt1; + INSERT INTO t1 (a,b) VALUES (DEFAULT,DEFAULT); + ROLLBACK; ++Warnings: ++Warning 1196 Some non-transactional changed tables couldn't be rolled back + SELECT * FROM t1; + a b ++0 test + 1 a + 10 foo + 100 foo +@@ -31,25 +46,34 @@ + 3 c + 4 d + 5 e ++NULL NULL ++NULL NULL + BEGIN; + INSERT t1 (a) VALUE (10),(20); + SAVEPOINT spt1; + INSERT INTO t1 SET a = 11, b = 'f'; + INSERT t1 SET b = DEFAULT; + ROLLBACK TO SAVEPOINT spt1; ++Warnings: ++Warning 1196 Some non-transactional changed tables couldn't be rolled back + INSERT INTO t1 (b,a) VALUES ('test1',10); + COMMIT; + SELECT * FROM t1; + a b ++0 test + 1 a + 10 NULL + 10 foo + 10 test1 + 100 foo + 11 abc ++11 f + 2 b + 20 NULL + 3 c + 4 d + 5 e ++NULL NULL ++NULL NULL ++NULL NULL + DROP TABLE t1; diff --git a/storage/myisam/mysql-test/storage_engine/trx/level_read_committed.rdiff b/storage/myisam/mysql-test/storage_engine/trx/level_read_committed.rdiff new file mode 100644 index 00000000000..c0cc9ff9351 --- /dev/null +++ b/storage/myisam/mysql-test/storage_engine/trx/level_read_committed.rdiff @@ -0,0 +1,44 @@ +0a1,6 +> # -- WARNING ---------------------------------------------------------------- +> # According to I_S.ENGINES, MyISAM does not support transactions. +> # If it is true, the test will most likely fail; you can +> # either create an rdiff file, or add the test to disabled.def. +> # If transactions should be supported, check the data in Information Schema. +> # --------------------------------------------------------------------------- +18a25 +> 1 +25a33,34 +> 1 +> 2 +30a40,43 +> 1 +> 101 +> 102 +> 2 +34a48,49 +> 101 +> 102 +39a55,56 +> 101 +> 102 +44a62,63 +> 101 +> 102 +51a71,72 +> 101 +> 102 +54a76,77 +> 301 +> 302 +58a82,83 +> 101 +> 102 +61a87,88 +> 301 +> 302 +65a93,94 +> 101 +> 102 +68a98,99 +> 301 +> 302 diff --git a/storage/myisam/mysql-test/storage_engine/trx/level_read_uncommitted.rdiff b/storage/myisam/mysql-test/storage_engine/trx/level_read_uncommitted.rdiff new file mode 100644 index 00000000000..2a7ddd33c8c --- /dev/null +++ b/storage/myisam/mysql-test/storage_engine/trx/level_read_uncommitted.rdiff @@ -0,0 +1,7 @@ +0a1,6 +> # -- WARNING ---------------------------------------------------------------- +> # According to I_S.ENGINES, MyISAM does not support transactions. +> # If it is true, the test will most likely fail; you can +> # either create an rdiff file, or add the test to disabled.def. +> # If transactions should be supported, check the data in Information Schema. +> # --------------------------------------------------------------------------- diff --git a/storage/myisam/mysql-test/storage_engine/trx/level_repeatable_read.rdiff b/storage/myisam/mysql-test/storage_engine/trx/level_repeatable_read.rdiff new file mode 100644 index 00000000000..8b8df802275 --- /dev/null +++ b/storage/myisam/mysql-test/storage_engine/trx/level_repeatable_read.rdiff @@ -0,0 +1,53 @@ +0a1,6 +> # -- WARNING ---------------------------------------------------------------- +> # According to I_S.ENGINES, MyISAM does not support transactions. +> # If it is true, the test will most likely fail; you can +> # either create an rdiff file, or add the test to disabled.def. +> # If transactions should be supported, check the data in Information Schema. +> # --------------------------------------------------------------------------- +18a25 +> 1 +25a33,34 +> 1 +> 2 +27,28c36 +< ERROR HY000: Lock wait timeout exceeded; try restarting transaction +< # WARNING: Statement ended with errno 1205, errname 'ER_LOCK_WAIT_TIMEOUT'. +--- +> # WARNING: Statement ended with errno 0, errname ''. +31a40,43 +> 1 +> 101 +> 102 +> 2 +35a48,49 +> 101 +> 102 +40a55,56 +> 101 +> 102 +44a61,64 +> 1 +> 101 +> 102 +> 2 +49a70,73 +> 1 +> 101 +> 102 +> 2 +51a76,77 +> 301 +> 302 +55a82,83 +> 101 +> 102 +58a87,88 +> 301 +> 302 +62a93,94 +> 101 +> 102 +65a98,99 +> 301 +> 302 diff --git a/storage/myisam/mysql-test/storage_engine/trx/level_serializable.rdiff b/storage/myisam/mysql-test/storage_engine/trx/level_serializable.rdiff new file mode 100644 index 00000000000..bbcb8ac1838 --- /dev/null +++ b/storage/myisam/mysql-test/storage_engine/trx/level_serializable.rdiff @@ -0,0 +1,69 @@ +0a1,6 +> # -- WARNING ---------------------------------------------------------------- +> # According to I_S.ENGINES, MyISAM does not support transactions. +> # If it is true, the test will most likely fail; you can +> # either create an rdiff file, or add the test to disabled.def. +> # If transactions should be supported, check the data in Information Schema. +> # --------------------------------------------------------------------------- +14,15c20 +< ERROR HY000: Lock wait timeout exceeded; try restarting transaction +< # WARNING: Statement ended with errno 1205, errname 'ER_LOCK_WAIT_TIMEOUT'. +--- +> # WARNING: Statement ended with errno 0, errname ''. +19a25 +> 1 +22,23c28 +< ERROR HY000: Lock wait timeout exceeded; try restarting transaction +< # WARNING: Statement ended with errno 1205, errname 'ER_LOCK_WAIT_TIMEOUT'. +--- +> # WARNING: Statement ended with errno 0, errname ''. +27a33,34 +> 1 +> 2 +32a40,43 +> 1 +> 101 +> 102 +> 2 +35a47,50 +> 1 +> 101 +> 102 +> 2 +38a54,57 +> 1 +> 101 +> 102 +> 2 +41a61,64 +> 1 +> 101 +> 102 +> 2 +46a70,77 +> 1 +> 101 +> 102 +> 2 +> 201 +> 202 +> 301 +> 302 +49a81,88 +> 1 +> 101 +> 102 +> 2 +> 201 +> 202 +> 301 +> 302 +52a92,99 +> 1 +> 101 +> 102 +> 2 +> 201 +> 202 +> 301 +> 302 diff --git a/storage/myisam/mysql-test/storage_engine/trx/select_for_update.rdiff b/storage/myisam/mysql-test/storage_engine/trx/select_for_update.rdiff new file mode 100644 index 00000000000..08e0802a28f --- /dev/null +++ b/storage/myisam/mysql-test/storage_engine/trx/select_for_update.rdiff @@ -0,0 +1,50 @@ +--- suite/storage_engine/trx/select_for_update.result 2012-07-13 01:26:07.612653808 +0400 ++++ suite/storage_engine/trx/select_for_update.reject 2012-07-15 16:55:49.784351006 +0400 +@@ -1,3 +1,9 @@ ++# -- WARNING ---------------------------------------------------------------- ++# According to I_S.ENGINES, MyISAM does not support transactions. ++# If it is true, the test will most likely fail; you can ++# either create an rdiff file, or add the test to disabled.def. ++# If transactions should be supported, check the data in Information Schema. ++# --------------------------------------------------------------------------- + DROP TABLE IF EXISTS t1; + CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; + INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'a'); +@@ -14,16 +20,33 @@ + 1 a + 3 a + SELECT * FROM t1 WHERE b='a' LOCK IN SHARE MODE; +-ERROR HY000: Lock wait timeout exceeded; try restarting transaction ++a b ++1 a ++3 a ++# ERROR: Statement succeeded (expected results: ER_LOCK_WAIT_TIMEOUT) ++# ------------ UNEXPECTED RESULT ------------ ++# The statement|command succeeded unexpectedly. ++# SELECT .. FOR UPDATE or LOCK IN SHARE MODE or the mix could be unsupported|malfunctioning, or the problem was caused by previous errors. ++# You can change the engine code, or create an rdiff, or disable the test by adding it to disabled.def. ++# Further in this test, the message might sometimes be suppressed; a part of the test might be skipped. ++# Also, this problem may cause a chain effect (more errors of different kinds in the test). ++# ------------------------------------------- + UPDATE t1 SET b='c' WHERE b='a'; +-ERROR HY000: Lock wait timeout exceeded; try restarting transaction ++# ERROR: Statement succeeded (expected results: ER_LOCK_WAIT_TIMEOUT) ++# ------------ UNEXPECTED RESULT ------------ ++# The statement|command succeeded unexpectedly. ++# UPDATE or SELECT .. FOR UPDATE or the mix could be unsupported|malfunctioning, or the problem was caused by previous errors. ++# You can change the engine code, or create an rdiff, or disable the test by adding it to disabled.def. ++# Further in this test, the message might sometimes be suppressed; a part of the test might be skipped. ++# Also, this problem may cause a chain effect (more errors of different kinds in the test). ++# ------------------------------------------- + connection con1; + COMMIT; + SELECT * FROM t1; + a b +-1 a ++1 c + 2 b +-3 a ++3 c + disconnect con1; + connection default; + UPDATE t1 SET b='c' WHERE b='a'; diff --git a/storage/myisam/mysql-test/storage_engine/trx/select_lock_in_share_mode.rdiff b/storage/myisam/mysql-test/storage_engine/trx/select_lock_in_share_mode.rdiff new file mode 100644 index 00000000000..97941bbdb13 --- /dev/null +++ b/storage/myisam/mysql-test/storage_engine/trx/select_lock_in_share_mode.rdiff @@ -0,0 +1,37 @@ +--- suite/storage_engine/trx/select_lock_in_share_mode.result 2012-07-13 01:30:17.505512229 +0400 ++++ suite/storage_engine/trx/select_lock_in_share_mode.reject 2012-07-15 16:55:50.444342708 +0400 +@@ -1,3 +1,9 @@ ++# -- WARNING ---------------------------------------------------------------- ++# According to I_S.ENGINES, MyISAM does not support transactions. ++# If it is true, the test will most likely fail; you can ++# either create an rdiff file, or add the test to disabled.def. ++# If transactions should be supported, check the data in Information Schema. ++# --------------------------------------------------------------------------- + DROP TABLE IF EXISTS t1; + CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; + INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'a'); +@@ -18,14 +24,21 @@ + 1 a + 3 a + UPDATE t1 SET b='c' WHERE b='a'; +-ERROR HY000: Lock wait timeout exceeded; try restarting transaction ++# ERROR: Statement succeeded (expected results: ER_LOCK_WAIT_TIMEOUT) ++# ------------ UNEXPECTED RESULT ------------ ++# The statement|command succeeded unexpectedly. ++# LOCK IN SHARE MODE or UPDATE or the mix could be unsupported|malfunctioning, or the problem was caused by previous errors. ++# You can change the engine code, or create an rdiff, or disable the test by adding it to disabled.def. ++# Further in this test, the message might sometimes be suppressed; a part of the test might be skipped. ++# Also, this problem may cause a chain effect (more errors of different kinds in the test). ++# ------------------------------------------- + connection con1; + COMMIT; + SELECT * FROM t1; + a b +-1 a ++1 c + 2 b +-3 a ++3 c + disconnect con1; + connection default; + UPDATE t1 SET b='c' WHERE b='a'; diff --git a/storage/myisam/mysql-test/storage_engine/trx/update.rdiff b/storage/myisam/mysql-test/storage_engine/trx/update.rdiff new file mode 100644 index 00000000000..131286d613c --- /dev/null +++ b/storage/myisam/mysql-test/storage_engine/trx/update.rdiff @@ -0,0 +1,58 @@ +--- suite/storage_engine/trx/update.result 2012-07-13 01:43:50.355293322 +0400 ++++ suite/storage_engine/trx/update.reject 2012-07-15 16:55:51.016335518 +0400 +@@ -1,3 +1,15 @@ ++# -- WARNING ---------------------------------------------------------------- ++# According to I_S.ENGINES, MyISAM does not support transactions. ++# If it is true, the test will most likely fail; you can ++# either create an rdiff file, or add the test to disabled.def. ++# If transactions should be supported, check the data in Information Schema. ++# --------------------------------------------------------------------------- ++# -- WARNING ---------------------------------------------------------------- ++# According to I_S.ENGINES, MyISAM does not support savepoints. ++# If it is true, the test will most likely fail; you can ++# either create an rdiff file (recommended), or add the test to disabled.def. ++# If savepoints should be supported, check the data in Information Schema. ++# --------------------------------------------------------------------------- + DROP TABLE IF EXISTS t1; + CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; + INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(10000,'foobar'); +@@ -24,25 +36,29 @@ + UPDATE t1 SET b = 'update' WHERE a <= 4 ORDER BY a DESC, b ASC LIMIT 3; + UPDATE t1 SET b = ''; + ROLLBACK; ++Warnings: ++Warning 1196 Some non-transactional changed tables couldn't be rolled back + BEGIN; + UPDATE t1 SET b = 'update2' WHERE a <= 100; + SAVEPOINT spt1; + UPDATE t1 SET b = ''; + ROLLBACK TO SAVEPOINT spt1; ++Warnings: ++Warning 1196 Some non-transactional changed tables couldn't be rolled back + UPDATE t1 SET b = 'upd' WHERE a = 10050; + COMMIT; + SELECT * FROM t1; + a b + 10050 upd + 10050 upd +-51 update2 +-51 update2 +-52 update2 +-52 update2 +-53 update2 +-53 update2 +-54 update2 +-54 update2 +-55 update2 +-55 update2 ++51 ++51 ++52 ++52 ++53 ++53 ++54 ++54 ++55 ++55 + DROP TABLE t1; diff --git a/storage/myisam/mysql-test/storage_engine/trx/xa.rdiff b/storage/myisam/mysql-test/storage_engine/trx/xa.rdiff new file mode 100644 index 00000000000..f445ad909f3 --- /dev/null +++ b/storage/myisam/mysql-test/storage_engine/trx/xa.rdiff @@ -0,0 +1,89 @@ +--- suite/storage_engine/trx/xa.result 2012-07-13 01:47:00.788899248 +0400 ++++ suite/storage_engine/trx/xa.reject 2012-07-15 16:55:51.604328125 +0400 +@@ -1,3 +1,9 @@ ++# -- WARNING ---------------------------------------------------------------- ++# According to I_S.ENGINES, MyISAM does not support XA. ++# If it is true, the test will most likely fail; you can ++# either create an rdiff file, or add the test to disabled.def. ++# If XA should be supported, check the data in Information Schema. ++# --------------------------------------------------------------------------- + DROP TABLE IF EXISTS t1; + connect con1,localhost,root,,; + connect con2,localhost,root,,; +@@ -9,17 +15,22 @@ + connection con1; + SELECT * FROM t1; + a ++1 + connection con2; + INSERT INTO t1 (a) VALUES (2); + XA END 'xa1'; + connection con1; + SELECT * FROM t1; + a ++1 ++2 + connection con2; + XA PREPARE 'xa1'; + connection con1; + SELECT * FROM t1; + a ++1 ++2 + connection con2; + XA RECOVER; + formatID gtrid_length bqual_length data +@@ -38,6 +49,7 @@ + a + 1 + 2 ++3 + connection con2; + INSERT INTO t1 (a) VALUES (4); + XA END 'xa2'; +@@ -46,6 +58,8 @@ + a + 1 + 2 ++3 ++4 + connection con2; + XA COMMIT 'xa2' ONE PHASE; + connection con1; +@@ -65,6 +79,7 @@ + 2 + 3 + 4 ++5 + connection con2; + INSERT INTO t1 (a) VALUES (6); + XA END 'xa3'; +@@ -75,6 +90,8 @@ + 2 + 3 + 4 ++5 ++6 + connection con2; + XA PREPARE 'xa3'; + connection con1; +@@ -84,8 +101,12 @@ + 2 + 3 + 4 ++5 ++6 + connection con2; + XA ROLLBACK 'xa3'; ++Warnings: ++Warning 1196 Some non-transactional changed tables couldn't be rolled back + connection con1; + SELECT * FROM t1; + a +@@ -93,4 +114,6 @@ + 2 + 3 + 4 ++5 ++6 + DROP TABLE t1; diff --git a/storage/myisam/mysql-test/storage_engine/trx/xa_recovery.rdiff b/storage/myisam/mysql-test/storage_engine/trx/xa_recovery.rdiff new file mode 100644 index 00000000000..f4629fb19a0 --- /dev/null +++ b/storage/myisam/mysql-test/storage_engine/trx/xa_recovery.rdiff @@ -0,0 +1,33 @@ +--- suite/storage_engine/trx/xa_recovery.result 2012-07-13 01:48:46.859565758 +0400 ++++ suite/storage_engine/trx/xa_recovery.reject 2012-07-15 16:55:53.740301272 +0400 +@@ -1,3 +1,9 @@ ++# -- WARNING ---------------------------------------------------------------- ++# According to I_S.ENGINES, MyISAM does not support XA. ++# If it is true, the test will most likely fail; you can ++# either create an rdiff file, or add the test to disabled.def. ++# If XA should be supported, check the data in Information Schema. ++# --------------------------------------------------------------------------- + call mtr.add_suppression("Found 2 prepared XA transactions"); + FLUSH TABLES; + DROP TABLE IF EXISTS t1; +@@ -18,12 +24,18 @@ + connection default; + XA RECOVER; + formatID gtrid_length bqual_length data +-1 3 0 xa1 +-1 3 0 xa2 + XA ROLLBACK 'xa1'; ++ERROR XAE04: XAER_NOTA: Unknown XID + XA COMMIT 'xa2'; ++ERROR XAE04: XAER_NOTA: Unknown XID + SELECT * FROM t1; + a ++1 ++2 + 3 + 4 ++Warnings: ++Error 145 Table './test/t1' is marked as crashed and should be repaired ++Error 1194 Table 't1' is marked as crashed and should be repaired ++Error 1034 1 client is using or hasn't closed the table properly + DROP TABLE t1; diff --git a/storage/myisammrg/ha_myisammrg.cc b/storage/myisammrg/ha_myisammrg.cc index e6bece5b7ff..47a3abb78d2 100644 --- a/storage/myisammrg/ha_myisammrg.cc +++ b/storage/myisammrg/ha_myisammrg.cc @@ -1652,6 +1652,47 @@ ha_rows ha_myisammrg::records() return myrg_records(file); } +uint ha_myisammrg::count_query_cache_dependant_tables(uint8 *tables_type) +{ + MYRG_INFO *file = myrg_info(); + /* + Here should be following statement + (*tables_type)|= HA_CACHE_TBL_NONTRANSACT; + but it has no effect because HA_CACHE_TBL_NONTRANSACT is 0 + */ + return (file->end_table - file->open_tables); +} + + +my_bool ha_myisammrg::register_query_cache_dependant_tables(THD *thd + __attribute__((unused)), + Query_cache *cache, + Query_cache_block_table **block_table, + uint *n) +{ + MYRG_INFO *file =myrg_info(); + DBUG_ENTER("ha_myisammrg::register_query_cache_dependant_tables"); + + for (MYRG_TABLE *table =file->open_tables; + table != file->end_table ; + table++) + { + char key[MAX_DBKEY_LENGTH]; + uint32 db_length; + uint key_length= cache->filename_2_table_key(key, table->table->filename, + &db_length); + (++(*block_table))->n= ++(*n); + /* + There are not callback function for for MyISAM, and engine data + */ + if (!cache->insert_table(key_length, key, (*block_table), + db_length, + table_cache_type(), + 0, 0, TRUE)) + DBUG_RETURN(TRUE); + } + DBUG_RETURN(FALSE); +} extern int myrg_panic(enum ha_panic_function flag); int myisammrg_panic(handlerton *hton, ha_panic_function flag) diff --git a/storage/myisammrg/ha_myisammrg.h b/storage/myisammrg/ha_myisammrg.h index e0dc6e07542..f5ba2ffef38 100644 --- a/storage/myisammrg/ha_myisammrg.h +++ b/storage/myisammrg/ha_myisammrg.h @@ -149,4 +149,10 @@ public: bool check_if_incompatible_data(HA_CREATE_INFO *info, uint table_changes); int check(THD* thd, HA_CHECK_OPT* check_opt); ha_rows records(); + virtual uint count_query_cache_dependant_tables(uint8 *tables_type); + virtual my_bool + register_query_cache_dependant_tables(THD *thd, + Query_cache *cache, + Query_cache_block_table **block, + uint *n); }; diff --git a/storage/myisammrg/mysql-test/storage_engine/alter_table.inc b/storage/myisammrg/mysql-test/storage_engine/alter_table.inc new file mode 100644 index 00000000000..a978ade4f75 --- /dev/null +++ b/storage/myisammrg/mysql-test/storage_engine/alter_table.inc @@ -0,0 +1,116 @@ +################################## +# +# This include file will be used for all ALTER TABLE statements in the suite. +# If you need to add additional steps or change the logic, copy the file +# to storage/<engine>/mysql-test/storage_engine/ folder and modify it there. +# +################## +# +# Parameters: +# +# --let $alter_definition = <alter definition> # mandatory, everything that goes after the table name in ALTER statement +# --let $table_name = <table name> # optional, default t1 +# --let $error_codes = <expected error codes, as in --error> # optional, default 0 +# --let $online = [0|1] # optional, default 0 (1 adds ONLINE) +# --let $rename_to = <new table name> # optional, default empty. +# # If set, means we are running RENAME TO, then alter definition is ignored +# +# Usage examples: +# +# --let $alter_definition = ADD COLUMN b $char_col DEFAULT '' +# + +--let $child_alter_definition = $alter_definition + +if ($rename_to) +{ + --let $alter_definition = RENAME TO $rename_to + --let $child_alter_definition = RENAME TO mrg.$rename_to +} + +if (!$alter_definition) +{ + --die # The ALTER statement is empty +} + +--let $alter_statement = ALTER + +if ($online) +{ + --let $alter_statement = $alter_statement ONLINE +} + +if (!$table_name) +{ + --let $table_name = t1 +} + +--let $alter_statement = $alter_statement TABLE $table_name $alter_definition +# We don't want to do ONLINE on underlying tables, we are not testing MyISAM +--let $child_statement = ALTER TABLE mrg.$table_name $child_alter_definition + + + +# We now have the complete ALTER statement in $alter_statement. +# If your ALTER statement should be composed differently, +# modify the logic above. + +##################### +# Here you can add logic needed BEFORE the main statement +# (e.g. base tables need to be altered, etc.). +# Surround it by --disable_query_log/--enable_query_log +# if you don't want it to appear in the result output. +##################### + +--source obfuscate.inc + +eval $alter_statement; +--source check_errors.inc + +# Make sure you don't add any statements between the main ALTER (above) +# and saving mysql_errno and mysql_errname (below) +# They are saved in case you want to add more logic after the main ALTER, +# because we need the result code of the statement. +# Also, do not change $alter_statement after it is executed! + +--let $my_errno = $mysql_errno +--let $my_errname = $mysql_errname + +##################### +# Here you can add logic needed AFTER the main statement. +# Surround it by --disable_query_log/--enable_query_log +# if you don't want it to appear in the result output. +##################### +--disable_query_log +--disable_warnings +--disable_result_log +# We will only try to alter the underlying table if the main alter was successful +if (!$my_errno) +{ + if ($rename_to) + { + eval ALTER TABLE $rename_to UNION(mrg.$rename_to); + } + # In the same section, the manual says that FLUSH TABLES should be performed before altering + # the underlying table, and later also says that it should be done after. We'll do both + FLUSH TABLES; + eval $child_statement; + FLUSH TABLES; +} +--enable_result_log +--enable_warnings +--enable_query_log + +# Unset the parameters, we don't want them to be accidentally reused later +--let $alter_definition = +--let $table_name = +--let $error_codes = +--let $online = 0 +--let $rename_to = + +# Restore the error codes of the main statement +--let $mysql_errno = $my_errno +--let $mysql_errname = $my_errname +# Make sure you don't add any SQL statements after restoring +# mysql_errno and mysql_errname (above) + diff --git a/storage/myisammrg/mysql-test/storage_engine/alter_table.rdiff b/storage/myisammrg/mysql-test/storage_engine/alter_table.rdiff new file mode 100644 index 00000000000..447a38a5b2b --- /dev/null +++ b/storage/myisammrg/mysql-test/storage_engine/alter_table.rdiff @@ -0,0 +1,68 @@ +11c11 +< ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +--- +> ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 INSERT_METHOD=LAST UNION=(`mrg`.`t1`) +19c19 +< ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +--- +> ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 INSERT_METHOD=LAST UNION=(`mrg`.`t1`) +27c27 +< ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +--- +> ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 INSERT_METHOD=LAST UNION=(`mrg`.`t1`) +35c35 +< ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +--- +> ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 INSERT_METHOD=LAST UNION=(`mrg`.`t1`) +43c43 +< ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +--- +> ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 INSERT_METHOD=LAST UNION=(`mrg`.`t1`) +51c51 +< ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +--- +> ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 INSERT_METHOD=LAST UNION=(`mrg`.`t1`) +59c59 +< ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +--- +> ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 INSERT_METHOD=LAST UNION=(`mrg`.`t1`) +67c67 +< ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +--- +> ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 INSERT_METHOD=LAST UNION=(`mrg`.`t1`) +75c75 +< ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +--- +> ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 INSERT_METHOD=LAST UNION=(`mrg`.`t1`) +82c82 +< ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +--- +> ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 INSERT_METHOD=LAST UNION=(`mrg`.`t1`) +91c91 +< ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +--- +> ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 INSERT_METHOD=LAST UNION=(`mrg`.`t2`) +100c100 +< ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +--- +> ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 INSERT_METHOD=LAST UNION=(`mrg`.`t1`) +107c107 +< ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +--- +> ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 INSERT_METHOD=LAST UNION=(`mrg`.`t1`) +122c122 +< ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs +--- +> ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs INSERT_METHOD=LAST UNION=(`mrg`.`t1`) +130c130 +< ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=utf8 +--- +> ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=utf8 INSERT_METHOD=LAST UNION=(`mrg`.`t1`) +138c138 +< ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci +--- +> ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci INSERT_METHOD=LAST UNION=(`mrg`.`t1`) +146c146 +< ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci +--- +> ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci INSERT_METHOD=LAST UNION=(`mrg`.`t1`) diff --git a/storage/myisammrg/mysql-test/storage_engine/alter_tablespace.rdiff b/storage/myisammrg/mysql-test/storage_engine/alter_tablespace.rdiff new file mode 100644 index 00000000000..cfc821582ed --- /dev/null +++ b/storage/myisammrg/mysql-test/storage_engine/alter_tablespace.rdiff @@ -0,0 +1,27 @@ +4,18c4,13 +< DROP TABLE t1; +< CREATE TABLE t1 (a <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +< INSERT INTO t1 (a) VALUES (1),(2); +< SELECT * FROM t1; +< a +< 1 +< 2 +< ALTER TABLE t1 DISCARD TABLESPACE; +< SELECT * FROM t1; +< ERROR HY000: Got error -1 from storage engine +< ALTER TABLE t1 IMPORT TABLESPACE; +< SELECT * FROM t1; +< a +< 1 +< 2 +--- +> ERROR HY000: 'test.t1' is not BASE TABLE +> # ERROR: Statement ended with errno 1347, errname ER_WRONG_OBJECT (expected to succeed) +> # ------------ UNEXPECTED RESULT ------------ +> # [ ALTER TABLE t1 DISCARD TABLESPACE ] +> # The statement|command finished with ER_WRONG_OBJECT. +> # Tablespace operations or the mix could be unsupported|malfunctioning, or the problem was caused by previous errors. +> # You can change the engine code, or create an rdiff, or disable the test by adding it to disabled.def. +> # Further in this test, the message might sometimes be suppressed; a part of the test might be skipped. +> # Also, this problem may cause a chain effect (more errors of different kinds in the test). +> # ------------------------------------------- diff --git a/storage/myisammrg/mysql-test/storage_engine/analyze_table.rdiff b/storage/myisammrg/mysql-test/storage_engine/analyze_table.rdiff new file mode 100644 index 00000000000..139bcc00a81 --- /dev/null +++ b/storage/myisammrg/mysql-test/storage_engine/analyze_table.rdiff @@ -0,0 +1,22 @@ +8c8 +< test.t1 analyze status OK +--- +> test.t1 analyze note The storage engine for the table doesn't support analyze +12c12 +< test.t2 analyze status OK +--- +> test.t2 analyze note The storage engine for the table doesn't support analyze +17,18c17,18 +< test.t1 analyze status OK +< test.t2 analyze status OK +--- +> test.t1 analyze note The storage engine for the table doesn't support analyze +> test.t2 analyze note The storage engine for the table doesn't support analyze +24c24 +< test.t1 analyze status OK +--- +> test.t1 analyze note The storage engine for the table doesn't support analyze +28c28 +< test.t1 analyze status OK +--- +> test.t1 analyze note The storage engine for the table doesn't support analyze diff --git a/storage/myisammrg/mysql-test/storage_engine/autoincrement.rdiff b/storage/myisammrg/mysql-test/storage_engine/autoincrement.rdiff new file mode 100644 index 00000000000..e9095aa3944 --- /dev/null +++ b/storage/myisammrg/mysql-test/storage_engine/autoincrement.rdiff @@ -0,0 +1,34 @@ +9c9 +< ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +--- +> ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 INSERT_METHOD=LAST UNION=(`mrg`.`t1`) +55c55 +< t1 <STORAGE_ENGINE> # # # # # # # # 6 # # # # # # # +--- +> t1 <STORAGE_ENGINE> # # # # # # # # 0 # # # # # # # +62c62 +< t1 # # # # # # # # # 8 # # # # # # # +--- +> t1 # # # # # # # # # 0 # # # # # # # +81c81 +< t1 # # # # # # # # # 10 # # # # # # # +--- +> t1 # # # # # # # # # 0 # # # # # # # +85c85 +< t1 # # # # # # # # # 21 # # # # # # # +--- +> t1 # # # # # # # # # 0 # # # # # # # +106c106 +< t1 # # # # # # # # # 22 # # # # # # # +--- +> t1 # # # # # # # # # 0 # # # # # # # +128,129c128,129 +< 100 a +< 101 b +--- +> 1 a +> 2 b +132c132 +< 100 +--- +> 1 diff --git a/storage/myisammrg/mysql-test/storage_engine/cache_index.rdiff b/storage/myisammrg/mysql-test/storage_engine/cache_index.rdiff new file mode 100644 index 00000000000..e10b22a8e66 --- /dev/null +++ b/storage/myisammrg/mysql-test/storage_engine/cache_index.rdiff @@ -0,0 +1,46 @@ +15,16c15,16 +< test.t1 assign_to_keycache status OK +< test.t2 assign_to_keycache status OK +--- +> test.t1 assign_to_keycache note The storage engine for the table doesn't support assign_to_keycache +> test.t2 assign_to_keycache note The storage engine for the table doesn't support assign_to_keycache +19,20c19,20 +< test.t1 preload_keys status OK +< test.t2 preload_keys status OK +--- +> test.t1 preload_keys note The storage engine for the table doesn't support preload_keys +> test.t2 preload_keys note The storage engine for the table doesn't support preload_keys +25,26c25,26 +< test.t1 preload_keys status OK +< test.t2 preload_keys status OK +--- +> test.t1 preload_keys note The storage engine for the table doesn't support preload_keys +> test.t2 preload_keys note The storage engine for the table doesn't support preload_keys +31c31 +< test.t1 preload_keys status OK +--- +> test.t1 preload_keys note The storage engine for the table doesn't support preload_keys +35c35 +< test.t1 assign_to_keycache status OK +--- +> test.t1 assign_to_keycache note The storage engine for the table doesn't support assign_to_keycache +39c39 +< test.t1 preload_keys status OK +--- +> test.t1 preload_keys note The storage engine for the table doesn't support preload_keys +50c50 +< test.t1 assign_to_keycache status OK +--- +> test.t1 assign_to_keycache note The storage engine for the table doesn't support assign_to_keycache +54c54 +< test.t1 preload_keys status OK +--- +> test.t1 preload_keys note The storage engine for the table doesn't support preload_keys +62c62 +< test.t1 assign_to_keycache status OK +--- +> test.t1 assign_to_keycache note The storage engine for the table doesn't support assign_to_keycache +66c66 +< test.t1 preload_keys status OK +--- +> test.t1 preload_keys note The storage engine for the table doesn't support preload_keys diff --git a/storage/myisammrg/mysql-test/storage_engine/char_indexes.rdiff b/storage/myisammrg/mysql-test/storage_engine/char_indexes.rdiff new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/storage/myisammrg/mysql-test/storage_engine/char_indexes.rdiff diff --git a/storage/myisammrg/mysql-test/storage_engine/checksum_table_live.rdiff b/storage/myisammrg/mysql-test/storage_engine/checksum_table_live.rdiff new file mode 100644 index 00000000000..1710cc18fea --- /dev/null +++ b/storage/myisammrg/mysql-test/storage_engine/checksum_table_live.rdiff @@ -0,0 +1,6 @@ +14,15c14,15 +< test.t1 4272806499 +< test.t2 0 +--- +> test.t1 NULL +> test.t2 NULL diff --git a/storage/myisammrg/mysql-test/storage_engine/cleanup_engine.inc b/storage/myisammrg/mysql-test/storage_engine/cleanup_engine.inc new file mode 100644 index 00000000000..b8f84110c76 --- /dev/null +++ b/storage/myisammrg/mysql-test/storage_engine/cleanup_engine.inc @@ -0,0 +1,16 @@ +########################################### +# +# This is a stub of the include file cleanup_engine.inc which +# should be placed in storage/<engine>/mysql-test/storage_engine folder. +# +################################ +# +# Here you can add whatever is needed to cleanup +# in case your define_engine.inc created any artefacts, +# e.g. an additional schema and/or tables. +--disable_query_log +--disable_warnings +DROP DATABASE IF EXISTS mrg; +--enable_warnings +--enable_query_log + diff --git a/storage/myisammrg/mysql-test/storage_engine/create_table.inc b/storage/myisammrg/mysql-test/storage_engine/create_table.inc new file mode 100644 index 00000000000..c74460d42fb --- /dev/null +++ b/storage/myisammrg/mysql-test/storage_engine/create_table.inc @@ -0,0 +1,208 @@ +################################## +# +# This include file will be used for all CREATE TABLE statements in the suite. +# If you need to add additional steps or change the logic, copy the file +# to storage/<engine>/mysql-test/storage_engine/ folder and modify it there. +# +################## +# +# Parameters: +# +# --let $create_definition = <column names, types, indexes) # optional, default a $int_col, b $char_col (based on defaults) +# --let $table_name = <table name> # optional, default t1 +# --let $table_options = <table options> # optional, default based on define_engine.inc +# --let $partition_options = <partitioning definition> # optional, default none +# --let $as_select = <SELECT statement> # optional, default empty +# --let $error_codes = <expected error codes, as in --error> # optional, default 0 +# --let $if_not_exists = [0|1] # optional, default 0 (1 adds IF NOT EXISTS clause) +# --let $default_engine = [0|1] # optional, default 0 (with 1 will rely on default engine, no ENGINE=) +# --let $temporary = [0|1] # optional, default 0 (1 adds TEMPORARY) +# --let $disable_query_log = [0|1] # optional, default 0 (1 disables logging of CREATE) +# +# Usage examples: +# +# --source create_table.inc -- creates a default table +# +# --let $create_definition = a INT NOT NULL, b CHAR(1) PRIMARY KEY, INDEX(a) +# --let $table_options = AUTO_INCREMENT = 100 +# --let $partition_options = PARTITION BY HASH(a) PARTITIONS 2 +# --let $as_select = SELECT 1, 'a' +# --source create_table.inc +# +# Additionally, a test can define $extra_tbl_options. The difference with $table_options +# is that its value is persistent and will be used until it is unset explicitly, or +# until the test ends. The purpose of it is to allow one test to call another test, +# when the called test does not know about specific options the calling test might require, +# and thus cannot set them on per-create basis. + +--let $create_statement = CREATE + +if ($temporary) +{ + --let $create_statement = $create_statement TEMPORARY +} + +--let $create_statement = $create_statement TABLE + +if ($if_not_exists) +{ + --let $create_statement = $create_statement IF NOT EXISTS +} + +if (!$table_name) +{ + --let $table_name = t1 +} + +# Child statement is a statement that will create an underlying table. +# From this point, it will deviate from the main statement, that's why +# we start creating it here in parallel with the main one. +# For underlying tables, we will create a table in mrg schema, e.g. +# for table t1 the underlying table will be mrg.t1, etc. +# Since we will only create one child here, it should be enough. If we want more, +# we can always add a suffix, e.g. mrg.t1_child1, mrg.t1_child2, etc. + +--let $child_statement = $create_statement mrg.$table_name +--let $create_statement = $create_statement $table_name + +if (!$create_definition) +{ + # If $create_definition is not defined, and AS SELECT is requested, + # we should not set $create_definition to the default value, + # because it might be inconsistent with the SELECT. + if (!$as_select) + { + --let $create_definition = a $int_col, b $char_col + } +} + +if ($create_definition) +{ + --let $create_statement = $create_statement ($create_definition) + # Table definition for the underlying table should be the same + # as for the MERGE table + --let $child_statement = $child_statement ($create_definition) +} + +# If $default_engine is set, we will rely on the default storage engine + +if (!$default_engine) +{ + --let $create_statement = $create_statement ENGINE=$storage_engine +} +# Engine for an underlying table differs +--let $child_statement = $child_statement ENGINE=MyISAM + +# Save default table options, we will want to restore them later +--let $default_tbl_opts_saved = $default_tbl_opts +--let $default_tbl_opts = $default_tbl_opts UNION(mrg.$table_name) INSERT_METHOD=LAST + +# Default table options from define_engine.inc +--let $create_statement = $create_statement $default_tbl_opts + +# The calling script could request additional table options +if ($table_options) +{ + --let $create_statement = $create_statement $table_options + --let $child_statement = $child_statement $table_options +} + +# The difference between $extra_tbl_opts and $table_options +# is that its $extra_tbl_opts is persistent -- it will not be unset at the end of this file, +# and will be used until it is unset explicitly by the calling test, +# or until the test ends. The purpose of it is to allow one test to call another test, +# when the called test does not know about specific options the calling test might require, +# and thus cannot set them on per-create basis. + +if ($extra_tbl_opts) +{ + --let $create_statement = $create_statement $extra_tbl_opts + --let $child_statement = $child_statement $extra_tbl_opts +} + +if ($as_select) +{ + --let $create_statement = $create_statement AS $as_select + --let $child_statement = $child_statement AS $as_select +} + +if ($partition_options) +{ + --let $create_statement = $create_statement $partition_options + --let $child_statement = $child_statement $partition_options +} + +# We now have the complete CREATE statement in $create_statement. +# If your CREATE statement should be composed differently, +# modify the logic above. + +##################### +# Here you can add logic needed BEFORE the main table creation +# (e.g. the table needs a base table, a reference table, etc.). +# Surround it by --disable_query_log/--enable_query_log +# if you don't want it to appear in the result output. +##################### +--disable_warnings +--disable_query_log +--disable_result_log +eval DROP TABLE IF EXISTS mrg.$table_name; +eval $child_statement; +--enable_result_log +--enable_query_log +--enable_warnings + +if ($disable_query_log) +{ + --disable_query_log +} + +--source obfuscate.inc + +eval $create_statement; +--source strict_check_errors.inc + +# Make sure you don't add any statements between the main CREATE (above) +# and saving mysql_errno and mysql_errname (below) +# They are saved in case you want to add more logic after the main CREATE, +# because we need the result code of the table creation. +# Also, do not change $create_statement after it is executed! + +--let $my_errno = $mysql_errno +--let $my_errname = $mysql_errname + + +if ($disable_query_log) +{ + --enable_query_log +} + +##################### +# Here you can add logic needed AFTER the main table creation, +# e.g. triggers creation. +# Surround it by --disable_query_log/--enable_query_log +# if you don't want it to appear in the result output. +##################### + + +# Unset the parameters, we don't want them to be accidentally reused later +--let $create_definition = +--let $table_name = t1 +--let $table_options = +--let $partition_options = +--let $as_select = 0 +--let $error_codes = +--let $if_not_exists = 0 +--let $default_engine = 0 +--let $temporary = 0 +--let $disable_query_log = 0 + +# Restore default table options now +--let $default_tbl_opts = $default_tbl_opts_saved + + +# Restore the error codes of the main statement +--let $mysql_errno = $my_errno +--let $mysql_errname = $my_errname +# Make sure you don't add any SQL statements after restoring +# mysql_errno and mysql_errname (above) + diff --git a/storage/myisammrg/mysql-test/storage_engine/create_table.rdiff b/storage/myisammrg/mysql-test/storage_engine/create_table.rdiff new file mode 100644 index 00000000000..5d3578ad3cd --- /dev/null +++ b/storage/myisammrg/mysql-test/storage_engine/create_table.rdiff @@ -0,0 +1,37 @@ +7c7 +< ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +--- +> ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 INSERT_METHOD=LAST UNION=(`mrg`.`t1`) +16c16 +< ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +--- +> ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 INSERT_METHOD=LAST UNION=(`mrg`.`t1`) +22c22 +< ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +--- +> ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 INSERT_METHOD=LAST UNION=(`mrg`.`t1`) +27,36c27,35 +< SHOW CREATE TABLE t1; +< Table Create Table +< t1 CREATE TABLE `t1` ( +< `1` bigint(20) NOT NULL DEFAULT '0' +< ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +< SELECT * FROM t1; +< 1 +< 1 +< 2 +< DROP TABLE t1; +--- +> ERROR HY000: 'test.t1' is not BASE TABLE +> # ERROR: Statement ended with errno 1347, errname ER_WRONG_OBJECT (expected to succeed) +> # ------------ UNEXPECTED RESULT ------------ +> # The statement|command finished with ER_WRONG_OBJECT. +> # CREATE TABLE .. AS SELECT or the mix could be unsupported|malfunctioning, or the problem was caused by previous errors. +> # You can change the engine code, or create an rdiff, or disable the test by adding it to disabled.def. +> # Further in this test, the message might sometimes be suppressed; a part of the test might be skipped. +> # Also, this problem may cause a chain effect (more errors of different kinds in the test). +> # ------------------------------------------- +43c42 +< ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +--- +> ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 INSERT_METHOD=LAST UNION=(`mrg`.`t1`) diff --git a/storage/myisammrg/mysql-test/storage_engine/define_engine.inc b/storage/myisammrg/mysql-test/storage_engine/define_engine.inc new file mode 100644 index 00000000000..aabd1747737 --- /dev/null +++ b/storage/myisammrg/mysql-test/storage_engine/define_engine.inc @@ -0,0 +1,49 @@ +########################################### +# +# This is a template of the include file define_engine.inc which +# should be placed in storage/<engine>/mysql-test/storage_engine folder. +# +################################ +# +# The name of the engine under test must be defined in $ENGINE variable. +# You can set it either here (uncomment and edit) or in your environment. +# +let $ENGINE = MRG_MYISAM; +# +################################ +# +# The following three variables define specific options for columns and tables. +# Normally there should be none needed, but for some engines it can be different. +# If the engine requires specific column option for all or indexed columns, +# set them inside the comment, e.g. /*!NOT NULL*/. +# Do the same for table options if needed, e.g. /*!INSERT_METHOD=LAST*/ + +let $default_col_opts = /*!*/; +let $default_col_indexed_opts = /*!*/; +let $default_tbl_opts = /*!*/; + +# INDEX, UNIQUE INDEX, PRIMARY KEY, special index type - choose the fist that the engine allows, +# or set it to /*!*/ if none is supported + +let $default_index = /*!INDEX*/; + +# If the engine does not support the following types, replace them with the closest possible + +let $default_int_type = INT(11); +let $default_char_type = CHAR(8); + +################################ + +--disable_query_log +--disable_result_log + +# Here you can place your custom MTR code which needs to be executed before each test, +# e.g. creation of an additional schema or table, etc. +# The cleanup part should be defined in cleanup_engine.inc +--disable_warnings +DROP DATABASE IF EXISTS mrg; +--enable_warnings +CREATE DATABASE mrg; + +--enable_query_log +--enable_result_log diff --git a/storage/myisammrg/mysql-test/storage_engine/disabled.def b/storage/myisammrg/mysql-test/storage_engine/disabled.def new file mode 100644 index 00000000000..9f7569a2d24 --- /dev/null +++ b/storage/myisammrg/mysql-test/storage_engine/disabled.def @@ -0,0 +1,2 @@ +alter_table_online : MySQL:57657 (Temporary MERGE table with temporary underlying is broken by ALTER) + diff --git a/storage/myisammrg/mysql-test/storage_engine/foreign_keys.rdiff b/storage/myisammrg/mysql-test/storage_engine/foreign_keys.rdiff new file mode 100644 index 00000000000..7362bd282a5 --- /dev/null +++ b/storage/myisammrg/mysql-test/storage_engine/foreign_keys.rdiff @@ -0,0 +1,138 @@ +15,17c15,16 +< KEY `a` (`a`), +< CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`a`) REFERENCES `t1` (`a`) +< ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +--- +> KEY `a` (`a`) +> ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 INSERT_METHOD=LAST UNION=(`mrg`.`t2`) +19c18,25 +< ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`a`) REFERENCES `t1` (`a`)) +--- +> # ERROR: Statement succeeded (expected results: ER_NO_REFERENCED_ROW_2) +> # ------------ UNEXPECTED RESULT ------------ +> # The statement|command succeeded unexpectedly. +> # Foreign keys or the mix could be unsupported|malfunctioning, or the problem was caused by previous errors. +> # You can change the engine code, or create an rdiff, or disable the test by adding it to disabled.def. +> # Further in this test, the message might sometimes be suppressed; a part of the test might be skipped. +> # Also, this problem may cause a chain effect (more errors of different kinds in the test). +> # ------------------------------------------- +23c29,36 +< ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`a`) REFERENCES `t1` (`a`)) +--- +> # ERROR: Statement succeeded (expected results: ER_NO_REFERENCED_ROW_2) +> # ------------ UNEXPECTED RESULT ------------ +> # The statement|command succeeded unexpectedly. +> # Foreign keys or the mix could be unsupported|malfunctioning, or the problem was caused by previous errors. +> # You can change the engine code, or create an rdiff, or disable the test by adding it to disabled.def. +> # Further in this test, the message might sometimes be suppressed; a part of the test might be skipped. +> # Also, this problem may cause a chain effect (more errors of different kinds in the test). +> # ------------------------------------------- +25c38 +< ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`a`) REFERENCES `t1` (`a`)) +--- +> # ERROR: Statement succeeded (expected results: ER_ROW_IS_REFERENCED_2) +27c40,47 +< ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`a`) REFERENCES `t1` (`a`)) +--- +> # ERROR: Statement succeeded (expected results: ER_ROW_IS_REFERENCED_2) +> # ------------ UNEXPECTED RESULT ------------ +> # The statement|command succeeded unexpectedly. +> # Foreign keys or the mix could be unsupported|malfunctioning, or the problem was caused by previous errors. +> # You can change the engine code, or create an rdiff, or disable the test by adding it to disabled.def. +> # Further in this test, the message might sometimes be suppressed; a part of the test might be skipped. +> # Also, this problem may cause a chain effect (more errors of different kinds in the test). +> # ------------------------------------------- +32c52 +< 2 d +--- +> 3 d +35c55,56 +< 1 a +--- +> 3 b +> 3 b +37c58,65 +< ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails +--- +> # ERROR: Statement succeeded (expected results: ER_ROW_IS_REFERENCED) +> # ------------ UNEXPECTED RESULT ------------ +> # The statement|command succeeded unexpectedly. +> # Foreign keys or the mix could be unsupported|malfunctioning, or the problem was caused by previous errors. +> # You can change the engine code, or create an rdiff, or disable the test by adding it to disabled.def. +> # Further in this test, the message might sometimes be suppressed; a part of the test might be skipped. +> # Also, this problem may cause a chain effect (more errors of different kinds in the test). +> # ------------------------------------------- +49,51c77,78 +< KEY `a` (`a`), +< CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`a`) REFERENCES `t1` (`a`) ON DELETE CASCADE ON UPDATE CASCADE +< ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +--- +> KEY `a` (`a`) +> ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 INSERT_METHOD=LAST UNION=(`mrg`.`t2`) +53c80 +< ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`a`) REFERENCES `t1` (`a`) ON DELETE CASCADE ON UPDATE CASCADE) +--- +> # ERROR: Statement succeeded (expected results: ER_NO_REFERENCED_ROW_2) +54a82 +> ERROR 42S02: Table 'test.t1' doesn't exist +56a85,92 +> ERROR 42S02: Table 'test.t1' doesn't exist +> # ------------ UNEXPECTED RESULT ------------ +> # The statement|command finished with ER_NO_SUCH_TABLE. +> # UPDATE or the mix could be unsupported|malfunctioning, or the problem was caused by previous errors. +> # You can change the engine code, or create an rdiff, or disable the test by adding it to disabled.def. +> # Further in this test, the message might sometimes be suppressed; a part of the test might be skipped. +> # Also, this problem may cause a chain effect (more errors of different kinds in the test). +> # ------------------------------------------- +59,64c95,104 +< 5 a +< 5 a +< 5 b +< 5 c +< 5 d +< 5 e +--- +> 1 a +> 1 a +> 2 b +> 2 b +> 3 a +> 3 c +> 3 c +> 4 d +> 4 d +> 4 e +65a106,113 +> ERROR 42S02: Table 'test.t1' doesn't exist +> # ------------ UNEXPECTED RESULT ------------ +> # The statement|command finished with ER_NO_SUCH_TABLE. +> # DELETE or the mix could be unsupported|malfunctioning, or the problem was caused by previous errors. +> # You can change the engine code, or create an rdiff, or disable the test by adding it to disabled.def. +> # Further in this test, the message might sometimes be suppressed; a part of the test might be skipped. +> # Also, this problem may cause a chain effect (more errors of different kinds in the test). +> # ------------------------------------------- +67a116,125 +> 1 a +> 1 a +> 2 b +> 2 b +> 3 a +> 3 c +> 3 c +> 4 d +> 4 d +> 4 e +69c127,135 +< ERROR 42000: Cannot truncate a table referenced in a foreign key constraint (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`a`) REFERENCES `test`.`t1` (`a`)) +--- +> ERROR 42S02: Table 'test.t1' doesn't exist +> # ERROR: Statement ended with errno 1146, errname ER_NO_SUCH_TABLE (expected results: ER_TRUNCATE_ILLEGAL_FK) +> # ------------ UNEXPECTED RESULT ------------ +> # The statement|command finished with ER_NO_SUCH_TABLE. +> # Foreign keys or the mix could be unsupported|malfunctioning, or the problem was caused by previous errors. +> # You can change the engine code, or create an rdiff, or disable the test by adding it to disabled.def. +> # Further in this test, the message might sometimes be suppressed; a part of the test might be skipped. +> # Also, this problem may cause a chain effect (more errors of different kinds in the test). +> # ------------------------------------------- +71a138 +> ERROR 42S02: Unknown table 't1' diff --git a/storage/myisammrg/mysql-test/storage_engine/fulltext_search.rdiff b/storage/myisammrg/mysql-test/storage_engine/fulltext_search.rdiff new file mode 100644 index 00000000000..262370f01ed --- /dev/null +++ b/storage/myisammrg/mysql-test/storage_engine/fulltext_search.rdiff @@ -0,0 +1,142 @@ +7,64c7,15 +< SHOW INDEXES IN t1; +< Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +< t1 1 v1 1 v1 # # NULL NULL YES FULLTEXT +< INSERT INTO t1 (v0,v1,v2) VALUES ('text1','Here is a list of recommended books on MariaDB and MySQL. We\'ve provided links to Amazon.com here for convenience, but they can be found at many other bookstores, both online and off. +< If you want to have your favorite MySQL / MariaDB book listed here, please leave a comment. +< For developers who want to code on MariaDB or MySQL +< * Understanding MySQL Internals by Sasha Pachev, former MySQL developer at MySQL AB. +< o This is the only book we know about that describes the internals of MariaDB / MySQL. A must have for anyone who wants to understand and develop on MariaDB! +< o Not all topics are covered and some parts are slightly outdated, but still the best book on this topic. +< * MySQL 5.1 Plugin Development by Sergei Golubchik and Andrew Hutchings +< o A must read for anyone wanting to write a plugin for MariaDB, written by the Sergei who designed the plugin interface for MySQL and MariaDB! +< For MariaDB / MySQL end users +< * MariaDB Crash Course by Ben Forta +< o First MariaDB book! +< o For people who want to learn SQL and the basics of MariaDB. +< o Now shipping. Purchase at Amazon.com or your favorite bookseller. +< * SQL-99 Complete, Really by Peter Gulutzan & Trudy Pelzer. +< o Everything you wanted to know about the SQL 99 standard. Excellent reference book! +< o Free to read in the Knowledgebase! +< * MySQL (4th Edition) by Paul DuBois +< o The \'default\' book to read if you wont to learn to use MySQL / MariaDB. +< * MySQL Cookbook by Paul DuBois +< o A lot of examples of how to use MySQL. As with all of Paul\'s books, it\'s worth its weight in gold and even enjoyable reading for such a \'dry\' subject. +< * High Performance MySQL, Second Edition, By Baron Schwartz, Peter Zaitsev, Vadim Tkachenko, Jeremy D. Zawodny, Arjen Lentz, Derek J. Balling, et al. +< o \"High Performance MySQL is the definitive guide to building fast, reliable systems with MySQL. Written by noted experts with years of real-world experience building very large systems, this book covers every aspect of MySQL performance in detail, and focuses on robustness, security, and data integrity. Learn advanced techniques in depth so you can bring out MySQL\'s full power.\" (From the book description at O\'Reilly) +< +< * MySQL Admin Cookbook +< o A quick step-by-step guide for MySQL users and database administrators to tackle real-world challenges with MySQL configuration and administration +< +< * MySQL 5.0 Certification Study Guide, By Paul DuBois, Stefan Hinz, Carsten Pedersen +< o This is the official guide to cover the passing of the two MySQL Certification examinations. It is valid till version 5.0 of the server, so while it misses all the features available in MySQL 5.1 and greater (including MariaDB 5.1 and greater), it provides a good basic understanding of MySQL for the end-user. ', +< 'There are several reasons why contributing code is one of the easiest and most rewarding ways to contribute to MariaDB: +< +< 1. We are very responsive toward reviews of submitted code and as soon as the review is done, the submitted code is merged into an existing MariaDB tree and made available to everyone, not just select customers. +< 2. Code reviews are performed by the MariaDB core development team and the quality, detail, and timeliness of our reviews are better than you will find elsewhere. +< 3. With MariaDB everyone has access to the latest code. +< 4. If a patch is very safe and/or very useful we are willing to push it into the stable code (as long as it can\'t break any existing applications). We are willing to do this to ensure the freedom to add small, needed fixes on a stable release so users don\'t have to wait a year for something to be added which is critical to their business. +< 5. If you are an active contributor, you can become a member of maria-captains, even if you aren\'t working for Monty Program Ab. All captains have the same rights as any other captain to accept and reject patches. Our development model is truly open for everyone. +< The Contributing Code page details many of the actual steps involved in working with the MariaDB source code. It\'s important that you use the same tools and submit patches in the same way as other developers to keep development running smoothly.' +< ), ('text2','test1','test2'); +< SELECT v0 FROM t1 WHERE MATCH(v1) AGAINST ('contributing' IN NATURAL LANGUAGE MODE); +< v0 +< INSERT INTO t1 (v0,v1,v2) VALUES ('text3','test','test'); +< SELECT v0, MATCH(v1) AGAINST('contributing' IN NATURAL LANGUAGE MODE) AS rating FROM t1 WHERE MATCH(v1) AGAINST ('contributing' IN NATURAL LANGUAGE MODE); +< v0 rating +< INSERT INTO t1 (v0,v1,v2) VALUES ('text4','Contributing more...','...is a good idea'),('text5','test','test'); +< SELECT v0, MATCH(v1) AGAINST('contributing') AS rating FROM t1 WHERE MATCH(v1) AGAINST ('contributing'); +< v0 rating +< text4 1.3705332279205322 +< SELECT v0 FROM t1 WHERE MATCH(v1,v2) AGAINST ('-test1 +critical +Cook*' IN BOOLEAN MODE); +< v0 +< text1 +< SELECT v0 FROM t1 WHERE MATCH(v1,v2) AGAINST ('-patch +critical +Cook*' IN BOOLEAN MODE); +< v0 +< SELECT v0, MATCH(v1) AGAINST('database' WITH QUERY EXPANSION) AS rating FROM t1 WHERE MATCH(v1) AGAINST ('database' WITH QUERY EXPANSION); +< v0 rating +< text1 178.11756896972656 +< DROP TABLE t1; +--- +> ERROR HY000: The used table type doesn't support FULLTEXT indexes +> # ERROR: Statement ended with errno 1214, errname ER_TABLE_CANT_HANDLE_FT (expected to succeed) +> # ------------ UNEXPECTED RESULT ------------ +> # The statement|command finished with ER_TABLE_CANT_HANDLE_FT. +> # FULLTEXT indexes or VARCHAR|TEXT data types or the mix could be unsupported|malfunctioning, or the problem was caused by previous errors. +> # You can change the engine code, or create an rdiff, or disable the test by adding it to disabled.def. +> # Further in this test, the message might sometimes be suppressed; a part of the test might be skipped. +> # Also, this problem may cause a chain effect (more errors of different kinds in the test). +> # ------------------------------------------- +71,132c22,30 +< SHOW INDEXES IN t1; +< Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +< t1 1 v1 1 v1 # # NULL NULL YES FULLTEXT +< t1 1 v1_v2 1 v1 # # NULL NULL YES FULLTEXT +< t1 1 v1_v2 2 v2 # # NULL NULL YES FULLTEXT +< INSERT INTO t1 (v0,v1,v2) VALUES ('text1','Here is a list of recommended books on MariaDB and MySQL. We\'ve provided links to Amazon.com here for convenience, but they can be found at many other bookstores, both online and off. +< If you want to have your favorite MySQL / MariaDB book listed here, please leave a comment. +< For developers who want to code on MariaDB or MySQL +< * Understanding MySQL Internals by Sasha Pachev, former MySQL developer at MySQL AB. +< o This is the only book we know about that describes the internals of MariaDB / MySQL. A must have for anyone who wants to understand and develop on MariaDB! +< o Not all topics are covered and some parts are slightly outdated, but still the best book on this topic. +< * MySQL 5.1 Plugin Development by Sergei Golubchik and Andrew Hutchings +< o A must read for anyone wanting to write a plugin for MariaDB, written by the Sergei who designed the plugin interface for MySQL and MariaDB! +< For MariaDB / MySQL end users +< * MariaDB Crash Course by Ben Forta +< o First MariaDB book! +< o For people who want to learn SQL and the basics of MariaDB. +< o Now shipping. Purchase at Amazon.com or your favorite bookseller. +< * SQL-99 Complete, Really by Peter Gulutzan & Trudy Pelzer. +< o Everything you wanted to know about the SQL 99 standard. Excellent reference book! +< o Free to read in the Knowledgebase! +< * MySQL (4th Edition) by Paul DuBois +< o The \'default\' book to read if you wont to learn to use MySQL / MariaDB. +< * MySQL Cookbook by Paul DuBois +< o A lot of examples of how to use MySQL. As with all of Paul\'s books, it\'s worth its weight in gold and even enjoyable reading for such a \'dry\' subject. +< * High Performance MySQL, Second Edition, By Baron Schwartz, Peter Zaitsev, Vadim Tkachenko, Jeremy D. Zawodny, Arjen Lentz, Derek J. Balling, et al. +< o \"High Performance MySQL is the definitive guide to building fast, reliable systems with MySQL. Written by noted experts with years of real-world experience building very large systems, this book covers every aspect of MySQL performance in detail, and focuses on robustness, security, and data integrity. Learn advanced techniques in depth so you can bring out MySQL\'s full power.\" (From the book description at O\'Reilly) +< +< * MySQL Admin Cookbook +< o A quick step-by-step guide for MySQL users and database administrators to tackle real-world challenges with MySQL configuration and administration +< +< * MySQL 5.0 Certification Study Guide, By Paul DuBois, Stefan Hinz, Carsten Pedersen +< o This is the official guide to cover the passing of the two MySQL Certification examinations. It is valid till version 5.0 of the server, so while it misses all the features available in MySQL 5.1 and greater (including MariaDB 5.1 and greater), it provides a good basic understanding of MySQL for the end-user. ', +< 'There are several reasons why contributing code is one of the easiest and most rewarding ways to contribute to MariaDB: +< +< 1. We are very responsive toward reviews of submitted code and as soon as the review is done, the submitted code is merged into an existing MariaDB tree and made available to everyone, not just select customers. +< 2. Code reviews are performed by the MariaDB core development team and the quality, detail, and timeliness of our reviews are better than you will find elsewhere. +< 3. With MariaDB everyone has access to the latest code. +< 4. If a patch is very safe and/or very useful we are willing to push it into the stable code (as long as it can\'t break any existing applications). We are willing to do this to ensure the freedom to add small, needed fixes on a stable release so users don\'t have to wait a year for something to be added which is critical to their business. +< 5. If you are an active contributor, you can become a member of maria-captains, even if you aren\'t working for Monty Program Ab. All captains have the same rights as any other captain to accept and reject patches. Our development model is truly open for everyone. +< The Contributing Code page details many of the actual steps involved in working with the MariaDB source code. It\'s important that you use the same tools and submit patches in the same way as other developers to keep development running smoothly.' +< ), ('text2','test1','test2'); +< SELECT v0 FROM t1 WHERE MATCH(v1,v2) AGAINST ('contributing' IN NATURAL LANGUAGE MODE); +< v0 +< INSERT INTO t1 (v0,v1,v2) VALUES ('text3','test','test'); +< SELECT v0, MATCH(v1,v2) AGAINST('contributing' IN NATURAL LANGUAGE MODE) AS rating FROM t1 WHERE MATCH(v1,v2) AGAINST ('contributing' IN NATURAL LANGUAGE MODE); +< v0 rating +< text1 0.2809644043445587 +< INSERT INTO t1 (v0,v1,v2) VALUES ('text4','Contributing more...','...is a good idea'),('text5','test','test'); +< SELECT v0, MATCH(v1) AGAINST('contributing') AS rating FROM t1 WHERE MATCH(v1) AGAINST ('contributing'); +< v0 rating +< text4 1.3705332279205322 +< SELECT v0 FROM t1 WHERE MATCH(v1,v2) AGAINST ('-test1 +critical +Cook*' IN BOOLEAN MODE); +< v0 +< text1 +< SELECT v0 FROM t1 WHERE MATCH(v1,v2) AGAINST ('-patch +critical +Cook*' IN BOOLEAN MODE); +< v0 +< SELECT v0, MATCH(v1,v2) AGAINST('database' WITH QUERY EXPANSION) AS rating FROM t1 WHERE MATCH(v1,v2) AGAINST ('database' WITH QUERY EXPANSION); +< v0 rating +< text1 190.56150817871094 +< text4 1.1758291721343994 +< DROP TABLE t1; +--- +> ERROR HY000: The used table type doesn't support FULLTEXT indexes +> # ERROR: Statement ended with errno 1214, errname ER_TABLE_CANT_HANDLE_FT (expected to succeed) +> # ------------ UNEXPECTED RESULT ------------ +> # The statement|command finished with ER_TABLE_CANT_HANDLE_FT. +> # FULLTEXT indexes or multiple keys or VARCHAR|TEXT data types or the mix could be unsupported|malfunctioning, or the problem was caused by previous errors. +> # You can change the engine code, or create an rdiff, or disable the test by adding it to disabled.def. +> # Further in this test, the message might sometimes be suppressed; a part of the test might be skipped. +> # Also, this problem may cause a chain effect (more errors of different kinds in the test). +> # ------------------------------------------- diff --git a/storage/myisammrg/mysql-test/storage_engine/handler.rdiff b/storage/myisammrg/mysql-test/storage_engine/handler.rdiff new file mode 100644 index 00000000000..f0c01085ad9 --- /dev/null +++ b/storage/myisammrg/mysql-test/storage_engine/handler.rdiff @@ -0,0 +1,79 @@ +5,47c5,12 +< HANDLER t1 READ FIRST; +< ERROR 42S02: Unknown table 't1' in HANDLER +< HANDLER h1 READ FIRST; +< a b +< foobar 1000 +< HANDLER h1 READ NEXT; +< a b +< a 1 +< HANDLER h1 READ FIRST WHERE a < 'foo'; +< a b +< a 1 +< HANDLER h1 READ NEXT; +< a b +< bar 200 +< HANDLER h1 READ NEXT; +< a b +< foo 100 +< HANDLER h1 READ NEXT; +< a b +< HANDLER h1 READ FIRST LIMIT 2; +< a b +< foobar 1000 +< a 1 +< HANDLER h1 READ NEXT; +< a b +< bar 200 +< HANDLER h1 READ NEXT WHERE b>500 LIMIT 2; +< a b +< HANDLER t1 OPEN; +< HANDLER h1 READ FIRST WHERE b>500 LIMIT 5; +< a b +< foobar 1000 +< HANDLER t1 READ NEXT; +< a b +< foobar 1000 +< HANDLER h1 READ NEXT WHERE b<100; +< a b +< HANDLER t1 CLOSE; +< HANDLER h1 READ FIRST; +< a b +< foobar 1000 +< HANDLER t1 CLOSE; +< ERROR 42S02: Unknown table 't1' in HANDLER +--- +> ERROR HY000: Table storage engine for 'h1' doesn't have this option +> # ------------ UNEXPECTED RESULT ------------ +> # The statement|command finished with ER_ILLEGAL_HA. +> # Functionality or the syntax or the mix could be unsupported. +> # You can change the engine code, or create an rdiff, or disable the test by adding it to disabled.def. +> # Further in this test, the message might sometimes be suppressed; a part of the test might be skipped. +> # Also, this problem may cause a chain effect (more errors of different kinds in the test). +> # ------------------------------------------- +54,76c19 +< HANDLER h1 READ a = (100); +< a b +< 100 f +< HANDLER h1 READ a <= (100) WHERE b < 'f'; +< a b +< 2 c +< HANDLER h1 READ a > (2) WHERE b IS NOT NULL LIMIT 2; +< a b +< 100 f +< 101 b +< HANDLER h1 READ a FIRST; +< a b +< 1 a +< HANDLER h1 READ a LAST; +< a b +< 200 b +< HANDLER h1 READ a PREV; +< a b +< 101 b +< HANDLER h1 READ a NEXT; +< a b +< 200 b +< HANDLER h1 CLOSE; +--- +> ERROR HY000: Table storage engine for 'h1' doesn't have this option diff --git a/storage/myisammrg/mysql-test/storage_engine/index.rdiff b/storage/myisammrg/mysql-test/storage_engine/index.rdiff new file mode 100644 index 00000000000..6e6f18e39bc --- /dev/null +++ b/storage/myisammrg/mysql-test/storage_engine/index.rdiff @@ -0,0 +1,6 @@ +64,66c64 +< ERROR 23000: Duplicate entry '1' for key 'a' +< # Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY). +< # If you got a difference in error message, just add it to rdiff file +--- +> # ERROR: Statement succeeded (expected results: ER_DUP_ENTRY,ER_DUP_KEY) diff --git a/storage/myisammrg/mysql-test/storage_engine/index_enable_disable.rdiff b/storage/myisammrg/mysql-test/storage_engine/index_enable_disable.rdiff new file mode 100644 index 00000000000..8913f17a2a6 --- /dev/null +++ b/storage/myisammrg/mysql-test/storage_engine/index_enable_disable.rdiff @@ -0,0 +1,17 @@ +13a14,15 +> Warnings: +> Note 1031 Table storage engine for 't1' doesn't have this option +16c18 +< t1 1 a 1 a # # NULL NULL YES BTREE disabled +--- +> t1 1 a 1 a # # NULL NULL YES BTREE +19c21 +< 1 SIMPLE t1 ALL NULL NULL NULL NULL 19 Using filesort +--- +> 1 SIMPLE t1 index NULL a 5 NULL 19 Using index +22a25,26 +> Warnings: +> Note 1031 Table storage engine for 't1' doesn't have this option +34a39,40 +> Warnings: +> Note 1031 Table storage engine for 't1' doesn't have this option diff --git a/storage/myisammrg/mysql-test/storage_engine/index_type_btree.rdiff b/storage/myisammrg/mysql-test/storage_engine/index_type_btree.rdiff new file mode 100644 index 00000000000..6e6f18e39bc --- /dev/null +++ b/storage/myisammrg/mysql-test/storage_engine/index_type_btree.rdiff @@ -0,0 +1,6 @@ +64,66c64 +< ERROR 23000: Duplicate entry '1' for key 'a' +< # Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY). +< # If you got a difference in error message, just add it to rdiff file +--- +> # ERROR: Statement succeeded (expected results: ER_DUP_ENTRY,ER_DUP_KEY) diff --git a/storage/myisammrg/mysql-test/storage_engine/index_type_hash.rdiff b/storage/myisammrg/mysql-test/storage_engine/index_type_hash.rdiff new file mode 100644 index 00000000000..1b57afe5b64 --- /dev/null +++ b/storage/myisammrg/mysql-test/storage_engine/index_type_hash.rdiff @@ -0,0 +1,34 @@ +7c7 +< t1 1 a 1 a # # NULL NULL # HASH +--- +> t1 1 a 1 a # # NULL NULL # BTREE +15,16c15,16 +< t1 1 a_b 1 a # # NULL NULL # HASH a_b index +< t1 1 a_b 2 b # # NULL NULL # HASH a_b index +--- +> t1 1 a_b 1 a # # NULL NULL # BTREE a_b index +> t1 1 a_b 2 b # # NULL NULL # BTREE a_b index +25,26c25,26 +< t1 1 a 1 a # # NULL NULL # HASH +< t1 1 b 1 b # # NULL NULL # HASH +--- +> t1 1 a 1 a # # NULL NULL # BTREE +> t1 1 b 1 b # # NULL NULL # BTREE +34c34 +< t1 0 a 1 a # # NULL NULL # HASH +--- +> t1 0 a 1 a # # NULL NULL # BTREE +46c46 +< t1 1 a 1 a # # NULL NULL # HASH simple index on a +--- +> t1 1 a 1 a # # NULL NULL # BTREE simple index on a +55c55 +< t1 0 a 1 a # # NULL NULL # HASH +--- +> t1 0 a 1 a # # NULL NULL # BTREE +64,66c64 +< ERROR 23000: Duplicate entry '1' for key 'a' +< # Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY). +< # If you got a difference in error message, just add it to rdiff file +--- +> # ERROR: Statement succeeded (expected results: ER_DUP_ENTRY,ER_DUP_KEY) diff --git a/storage/myisammrg/mysql-test/storage_engine/insert_delayed.rdiff b/storage/myisammrg/mysql-test/storage_engine/insert_delayed.rdiff new file mode 100644 index 00000000000..e0d0eefabe4 --- /dev/null +++ b/storage/myisammrg/mysql-test/storage_engine/insert_delayed.rdiff @@ -0,0 +1,14 @@ +7a8,15 +> ERROR HY000: DELAYED option not supported for table 't1' +> # ------------ UNEXPECTED RESULT ------------ +> # The statement|command finished with ER_DELAYED_NOT_SUPPORTED. +> # INSERT DELAYED or the mix could be unsupported|malfunctioning, or the problem was caused by previous errors. +> # You can change the engine code, or create an rdiff, or disable the test by adding it to disabled.def. +> # Further in this test, the message might sometimes be suppressed; a part of the test might be skipped. +> # Also, this problem may cause a chain effect (more errors of different kinds in the test). +> # ------------------------------------------- +8a17 +> ERROR HY000: DELAYED option not supported for table 't1' +23,24d31 +< 3 c +< 4 d diff --git a/storage/myisammrg/mysql-test/storage_engine/lock.rdiff b/storage/myisammrg/mysql-test/storage_engine/lock.rdiff new file mode 100644 index 00000000000..d035648551a --- /dev/null +++ b/storage/myisammrg/mysql-test/storage_engine/lock.rdiff @@ -0,0 +1,62 @@ +44a45,46 +> ERROR HY000: Table 't1' was not locked with LOCK TABLES +> # ERROR: Statement ended with errno 1100, errname ER_TABLE_NOT_LOCKED (expected to succeed) +45a48,49 +> ERROR HY000: Table 't2' was not locked with LOCK TABLES +> # ERROR: Statement ended with errno 1100, errname ER_TABLE_NOT_LOCKED (expected to succeed) +46a51 +> ERROR HY000: Table 't2' was not locked with LOCK TABLES +47a53 +> ERROR HY000: Table 't2' was not locked with LOCK TABLES +48a55 +> ERROR 42S02: Table 'test.t1' doesn't exist +49a57 +> ERROR 42S02: Table 'test.t1' doesn't exist +50a59 +> ERROR 42S02: Table 'test.t1' doesn't exist +52a62 +> ERROR 42S02: Table 'test.t1' doesn't exist +54c64,65 +< ERROR HY000: Table 't1' was not locked with LOCK TABLES +--- +> ERROR 42S02: Table 'test.t1' doesn't exist +> # ERROR: Statement ended with errno 1146, errname ER_NO_SUCH_TABLE (expected results: ER_TABLE_NOT_LOCKED) +56a68 +> ERROR 42S02: Table 'test.t1' doesn't exist +57a70 +> ERROR 42S02: Table 'test.t1' doesn't exist +59c72,73 +< ERROR HY000: Table 't2' was not locked with LOCK TABLES +--- +> ERROR 42S02: Unknown table 't1,t2' +> # ERROR: Statement ended with errno 1051, errname ER_BAD_TABLE_ERROR (expected results: ER_TABLE_NOT_LOCKED) +61a76 +> ERROR 42S02: Unknown table 't1,t2' +67a83,84 +> ERROR HY000: Table 't1' was not locked with LOCK TABLES +> # ERROR: Statement ended with errno 1100, errname ER_TABLE_NOT_LOCKED (expected to succeed) +68a86,87 +> ERROR HY000: Table 't2' was not locked with LOCK TABLES +> # ERROR: Statement ended with errno 1100, errname ER_TABLE_NOT_LOCKED (expected to succeed) +69a89,90 +> ERROR HY000: Table 't3' was not locked with LOCK TABLES +> # ERROR: Statement ended with errno 1100, errname ER_TABLE_NOT_LOCKED (expected to succeed) +70a92 +> ERROR 42S02: Table 'test.t1' doesn't exist +71a94,103 +> ERROR 42S02: Table 'test.t2' doesn't exist +> # ERROR: Statement ended with errno 1146, errname ER_NO_SUCH_TABLE (expected to succeed) +> # ------------ UNEXPECTED RESULT ------------ +> # [ ALTER TABLE t2 ADD COLUMN c2 INT(11) /*!*/ /*Custom column options*/ ] +> # The statement|command finished with ER_NO_SUCH_TABLE. +> # ALTER TABLE or the mix could be unsupported|malfunctioning, or the problem was caused by previous errors. +> # You can change the engine code, or create an rdiff, or disable the test by adding it to disabled.def. +> # Further in this test, the message might sometimes be suppressed; a part of the test might be skipped. +> # Also, this problem may cause a chain effect (more errors of different kinds in the test). +> # ------------------------------------------- +72a105 +> ERROR 42S02: Unknown table 't1,t2,t3' +109c142 +< a b +--- +> ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist diff --git a/storage/myisammrg/mysql-test/storage_engine/optimize_table.rdiff b/storage/myisammrg/mysql-test/storage_engine/optimize_table.rdiff new file mode 100644 index 00000000000..f74c49cedea --- /dev/null +++ b/storage/myisammrg/mysql-test/storage_engine/optimize_table.rdiff @@ -0,0 +1,24 @@ +8c8 +< test.t1 optimize status OK +--- +> test.t1 optimize note The storage engine for the table doesn't support optimize +12c12 +< test.t2 optimize status OK +--- +> test.t2 optimize note The storage engine for the table doesn't support optimize +17,18c17,18 +< test.t1 optimize status OK +< test.t2 optimize status OK +--- +> test.t1 optimize note The storage engine for the table doesn't support optimize +> test.t2 optimize note The storage engine for the table doesn't support optimize +21,22c21,22 +< test.t1 optimize status Table is already up to date +< test.t2 optimize status Table is already up to date +--- +> test.t1 optimize note The storage engine for the table doesn't support optimize +> test.t2 optimize note The storage engine for the table doesn't support optimize +28c28 +< test.t1 optimize status OK +--- +> test.t1 optimize note The storage engine for the table doesn't support optimize diff --git a/storage/myisammrg/mysql-test/storage_engine/parts/alter_table.rdiff b/storage/myisammrg/mysql-test/storage_engine/parts/alter_table.rdiff new file mode 100644 index 00000000000..a2cb0c1dcb1 --- /dev/null +++ b/storage/myisammrg/mysql-test/storage_engine/parts/alter_table.rdiff @@ -0,0 +1,63 @@ +3,36c3,12 +< INSERT INTO t1 (a) VALUES (1),(2),(2),(3),(4); +< ALTER TABLE t1 ADD PARTITION PARTITIONS 2; +< EXPLAIN PARTiTIONS SELECT a FROM t1 WHERE a = 3; +< id select_type table partitions type possible_keys key key_len ref rows Extra +< 1 SIMPLE t1 p3 # # # # # # # +< ALTER TABLE t1 COALESCE PARTITION 1; +< EXPLAIN PARTiTIONS SELECT a FROM t1 WHERE a = 3; +< id select_type table partitions type possible_keys key key_len ref rows Extra +< 1 SIMPLE t1 p0 # # # # # # # +< ALTER TABLE t1 REORGANIZE PARTITION; +< EXPLAIN PARTiTIONS SELECT a FROM t1 WHERE a = 2; +< id select_type table partitions type possible_keys key key_len ref rows Extra +< 1 SIMPLE t1 p0 # # # # # # # +< ALTER TABLE t1 REBUILD PARTITION p0; +< EXPLAIN PARTiTIONS SELECT a FROM t1; +< id select_type table partitions type possible_keys key key_len ref rows Extra +< 1 SIMPLE t1 p0 # # # # # # # +< ALTER TABLE t1 REMOVE PARTITIONING; +< EXPLAIN PARTiTIONS SELECT a FROM t1; +< id select_type table partitions type possible_keys key key_len ref rows Extra +< 1 SIMPLE t1 NULL # # # # # # # +< ALTER TABLE t1 PARTITION BY LIST(a) (PARTITION p0 VALUES IN (1,2,3), PARTITION p1 VALUES IN (101,102)); +< ERROR HY000: Table has no partition for value 4 +< ALTER TABLE t1 PARTITION BY LIST(a) (PARTITION p0 VALUES IN (1,2,3,4), PARTITION p1 VALUES IN (101,102)); +< INSERT INTO t1 (a) VALUES (50); +< ERROR HY000: Table has no partition for value 50 +< ALTER TABLE t1 ADD PARTITION (PARTITION p2 VALUES IN (50,51)); +< INSERT INTO t1 (a) VALUES (50); +< ALTER TABLE t1 DROP PARTITION p1; +< ALTER TABLE t1 REORGANIZE PARTITION p0, p2 INTO (PARTITION p0 VALUES IN (1,2,3), PARTITION p1 VALUES IN (4), PARTITION p2 VALUES IN (50,51), PARTITION p3 VALUES IN (101,102)); +< EXPLAIN PARTiTIONS SELECT a FROM t1 WHERE a = 2; +< id select_type table partitions type possible_keys key key_len ref rows Extra +< 1 SIMPLE t1 p0 # # # # # # # +< DROP TABLE t1; +--- +> ERROR HY000: Engine cannot be used in partitioned tables +> # ERROR: Statement ended with errno 1572, errname ER_PARTITION_MERGE_ERROR (expected to succeed) +> # ------------ UNEXPECTED RESULT ------------ +> # [ CREATE TABLE t1 (a INT(11) /*!*/ /*Custom column options*/) ENGINE=MRG_MYISAM /*!*/ /*Custom table options*/ UNION(mrg.t1) INSERT_METHOD=LAST PARTITION BY HASH(a) PARTITIONS 2 ] +> # The statement|command finished with ER_PARTITION_MERGE_ERROR. +> # Partitions or the mix could be unsupported|malfunctioning, or the problem was caused by previous errors. +> # You can change the engine code, or create an rdiff, or disable the test by adding it to disabled.def. +> # Further in this test, the message might sometimes be suppressed; a part of the test might be skipped. +> # Also, this problem may cause a chain effect (more errors of different kinds in the test). +> # ------------------------------------------- +41,42c17,29 +< ALTER TABLE t1 DROP PARTITION abc; +< DROP TABLE t1; +--- +> ERROR HY000: Engine cannot be used in partitioned tables +> # ERROR: Statement ended with errno 1572, errname ER_PARTITION_MERGE_ERROR (expected to succeed) +> # ------------ UNEXPECTED RESULT ------------ +> # [ CREATE TABLE t1 (a INT(11) /*!*/ /*Custom column options*/, b INT(11) /*!*/ /*Custom column options*/) ENGINE=MRG_MYISAM /*!*/ /*Custom table options*/ UNION(mrg.t1) INSERT_METHOD=LAST PARTITION BY LIST(a) SUBPARTITION by HASH(b) ( +> PARTITION abc VALUES IN (1,2,3), +> PARTITION def VALUES IN (100,101,102) +> ) ] +> # The statement|command finished with ER_PARTITION_MERGE_ERROR. +> # Partitions or subpartitions or the mix could be unsupported|malfunctioning, or the problem was caused by previous errors. +> # You can change the engine code, or create an rdiff, or disable the test by adding it to disabled.def. +> # Further in this test, the message might sometimes be suppressed; a part of the test might be skipped. +> # Also, this problem may cause a chain effect (more errors of different kinds in the test). +> # ------------------------------------------- diff --git a/storage/myisammrg/mysql-test/storage_engine/parts/analyze_table.rdiff b/storage/myisammrg/mysql-test/storage_engine/parts/analyze_table.rdiff new file mode 100644 index 00000000000..ce29f3dcf52 --- /dev/null +++ b/storage/myisammrg/mysql-test/storage_engine/parts/analyze_table.rdiff @@ -0,0 +1,83 @@ +3,18c3,12 +< INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(2,'d'),(4,'e'),(100,'f'),(101,'g'); +< CREATE TABLE t2 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +< INSERT INTO t2 (a,b) SELECT a,b FROM t1; +< INSERT INTO t1 (a,b) VALUES (3,'c'); +< ALTER TABLE t1 ANALYZE PARTITION p0; +< Table Op Msg_type Msg_text +< test.t1 analyze status OK +< INSERT INTO t2 (a,b) VALUES (4,'d'), (1000,'e'); +< ALTER TABLE t1 ANALYZE PARTITION LOCAL ALL; +< Table Op Msg_type Msg_text +< test.t1 analyze status OK +< INSERT INTO t1 (a,b) VALUES (5,'f'),(50,'g'); +< ALTER TABLE t1 ANALYZE PARTITION NO_WRITE_TO_BINLOG p1,p0; +< Table Op Msg_type Msg_text +< test.t1 analyze status OK +< DROP TABLE t1, t2; +--- +> ERROR HY000: Engine cannot be used in partitioned tables +> # ERROR: Statement ended with errno 1572, errname ER_PARTITION_MERGE_ERROR (expected to succeed) +> # ------------ UNEXPECTED RESULT ------------ +> # [ CREATE TABLE t1 (a INT(11) /*!*/ /*Custom column options*/, b CHAR(8) /*!*/ /*Custom column options*/) ENGINE=MRG_MYISAM /*!*/ /*Custom table options*/ UNION(mrg.t1) INSERT_METHOD=LAST PARTITION BY HASH(a) PARTITIONS 2 ] +> # The statement|command finished with ER_PARTITION_MERGE_ERROR. +> # Partitions or the mix could be unsupported|malfunctioning, or the problem was caused by previous errors. +> # You can change the engine code, or create an rdiff, or disable the test by adding it to disabled.def. +> # Further in this test, the message might sometimes be suppressed; a part of the test might be skipped. +> # Also, this problem may cause a chain effect (more errors of different kinds in the test). +> # ------------------------------------------- +20a15,16 +> ERROR HY000: Engine cannot be used in partitioned tables +> # ERROR: Statement ended with errno 1572, errname ER_PARTITION_MERGE_ERROR (expected to succeed) +21a18 +> ERROR 42S02: Table 'test.t1' doesn't exist +22a20,21 +> ERROR HY000: Engine cannot be used in partitioned tables +> # ERROR: Statement ended with errno 1572, errname ER_PARTITION_MERGE_ERROR (expected to succeed) +23a23 +> ERROR 42S02: Table 'test.t1' doesn't exist +26c26,27 +< test.t1 analyze status OK +--- +> test.t1 analyze Error Table 'test.t1' doesn't exist +> test.t1 analyze status Operation failed +27a29 +> ERROR 42S02: Table 'test.t2' doesn't exist +30c32,33 +< test.t2 analyze status OK +--- +> test.t2 analyze Error Table 'test.t2' doesn't exist +> test.t2 analyze status Operation failed +31a35 +> ERROR 42S02: Table 'test.t1' doesn't exist +32a37 +> ERROR 42S02: Table 'test.t2' doesn't exist +35,36c40,43 +< test.t1 analyze status OK +< test.t2 analyze status OK +--- +> test.t1 analyze Error Table 'test.t1' doesn't exist +> test.t1 analyze status Operation failed +> test.t2 analyze Error Table 'test.t2' doesn't exist +> test.t2 analyze status Operation failed +37a45 +> ERROR 42S02: Unknown table 't1,t2' +38a47,48 +> ERROR HY000: Engine cannot be used in partitioned tables +> # ERROR: Statement ended with errno 1572, errname ER_PARTITION_MERGE_ERROR (expected to succeed) +39a50 +> ERROR 42S02: Table 'test.t1' doesn't exist +42c53,54 +< test.t1 analyze status OK +--- +> test.t1 analyze Error Table 'test.t1' doesn't exist +> test.t1 analyze status Operation failed +43a56 +> ERROR 42S02: Table 'test.t1' doesn't exist +46c59,60 +< test.t1 analyze status OK +--- +> test.t1 analyze Error Table 'test.t1' doesn't exist +> test.t1 analyze status Operation failed +47a62 +> ERROR 42S02: Unknown table 't1' diff --git a/storage/myisammrg/mysql-test/storage_engine/parts/check_table.rdiff b/storage/myisammrg/mysql-test/storage_engine/parts/check_table.rdiff new file mode 100644 index 00000000000..3f3db85a23e --- /dev/null +++ b/storage/myisammrg/mysql-test/storage_engine/parts/check_table.rdiff @@ -0,0 +1,172 @@ +3,36c3,12 +< INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(2,'d'),(4,'e'),(100,'f'),(101,'g'); +< CREATE TABLE t2 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> PARTITION BY RANGE(a) ( +< PARTITION p0 VALUES LESS THAN (100), +< PARTITION p1 VALUES LESS THAN MAXVALUE +< ); +< INSERT INTO t2 (a,b) SELECT a, b FROM t1; +< ALTER TABLE t1 CHECK PARTITION p0; +< Table Op Msg_type Msg_text +< test.t1 check status OK +< INSERT INTO t1 (a,b) VALUES (3,'c'); +< ALTER TABLE t1 CHECK PARTITION p0, p1 FOR UPGRADE; +< Table Op Msg_type Msg_text +< test.t1 check status OK +< INSERT INTO t2 (a,b) VALUES (10000,'e'); +< ALTER TABLE t2 CHECK PARTITION p0 QUICK; +< Table Op Msg_type Msg_text +< test.t2 check status OK +< INSERT INTO t1 (a,b) VALUES (6,'f'); +< ALTER TABLE t1 CHECK PARTITION p1 FAST; +< Table Op Msg_type Msg_text +< test.t1 check status OK +< INSERT INTO t2 (a,b) VALUES (8,'h'); +< ALTER TABLE t2 CHECK PARTITION p1 MEDIUM; +< Table Op Msg_type Msg_text +< test.t2 check status OK +< INSERT INTO t1 (a,b) VALUES (9,'i'); +< ALTER TABLE t1 CHECK PARTITION ALL EXTENDED; +< Table Op Msg_type Msg_text +< test.t1 check status OK +< INSERT INTO t1 (a,b) VALUES (11,'k'); +< ALTER TABLE t1 CHECK PARTITION p0 CHANGED; +< Table Op Msg_type Msg_text +< test.t1 check status OK +< DROP TABLE t1, t2; +--- +> ERROR HY000: Engine cannot be used in partitioned tables +> # ERROR: Statement ended with errno 1572, errname ER_PARTITION_MERGE_ERROR (expected to succeed) +> # ------------ UNEXPECTED RESULT ------------ +> # [ CREATE TABLE t1 (a INT(11) /*!*/ /*Custom column options*/, b CHAR(8) /*!*/ /*Custom column options*/) ENGINE=MRG_MYISAM /*!*/ /*Custom table options*/ UNION(mrg.t1) INSERT_METHOD=LAST PARTITION BY HASH(a) PARTITIONS 2 ] +> # The statement|command finished with ER_PARTITION_MERGE_ERROR. +> # Partitions or the mix could be unsupported|malfunctioning, or the problem was caused by previous errors. +> # You can change the engine code, or create an rdiff, or disable the test by adding it to disabled.def. +> # Further in this test, the message might sometimes be suppressed; a part of the test might be skipped. +> # Also, this problem may cause a chain effect (more errors of different kinds in the test). +> # ------------------------------------------- +38a15,16 +> ERROR HY000: Engine cannot be used in partitioned tables +> # ERROR: Statement ended with errno 1572, errname ER_PARTITION_MERGE_ERROR (expected to succeed) +39a18 +> ERROR 42S02: Table 'test.t1' doesn't exist +40a20,21 +> ERROR HY000: Engine cannot be used in partitioned tables +> # ERROR: Statement ended with errno 1572, errname ER_PARTITION_MERGE_ERROR (expected to succeed) +43c24,25 +< test.t1 check status OK +--- +> test.t1 check Error Table 'test.t1' doesn't exist +> test.t1 check status Operation failed +44a27 +> ERROR 42S02: Table 'test.t1' doesn't exist +45a29 +> ERROR 42S02: Table 'test.t2' doesn't exist +48,49c32,35 +< test.t1 check status OK +< test.t2 check status OK +--- +> test.t1 check Error Table 'test.t1' doesn't exist +> test.t1 check status Operation failed +> test.t2 check Error Table 'test.t2' doesn't exist +> test.t2 check status Operation failed +50a37 +> ERROR 42S02: Table 'test.t2' doesn't exist +53c40,41 +< test.t2 check status OK +--- +> test.t2 check Error Table 'test.t2' doesn't exist +> test.t2 check status Operation failed +54a43 +> ERROR 42S02: Table 'test.t1' doesn't exist +57c46,47 +< test.t1 check status OK +--- +> test.t1 check Error Table 'test.t1' doesn't exist +> test.t1 check status Operation failed +58a49 +> ERROR 42S02: Table 'test.t1' doesn't exist +59a51 +> ERROR 42S02: Table 'test.t2' doesn't exist +62,63c54,57 +< test.t2 check status OK +< test.t1 check status OK +--- +> test.t2 check Error Table 'test.t2' doesn't exist +> test.t2 check status Operation failed +> test.t1 check Error Table 'test.t1' doesn't exist +> test.t1 check status Operation failed +64a59 +> ERROR 42S02: Table 'test.t1' doesn't exist +65a61 +> ERROR 42S02: Table 'test.t2' doesn't exist +68,69c64,67 +< test.t1 check status OK +< test.t2 check status OK +--- +> test.t1 check Error Table 'test.t1' doesn't exist +> test.t1 check status Operation failed +> test.t2 check Error Table 'test.t2' doesn't exist +> test.t2 check status Operation failed +70a69 +> ERROR 42S02: Table 'test.t1' doesn't exist +73c72,73 +< test.t1 check status OK +--- +> test.t1 check Error Table 'test.t1' doesn't exist +> test.t1 check status Operation failed +74a75 +> ERROR 42S02: Unknown table 't1,t2' +75a77,78 +> ERROR HY000: Engine cannot be used in partitioned tables +> # ERROR: Statement ended with errno 1572, errname ER_PARTITION_MERGE_ERROR (expected to succeed) +76a80 +> ERROR 42S02: Table 'test.t1' doesn't exist +79c83,84 +< test.t1 check status OK +--- +> test.t1 check Error Table 'test.t1' doesn't exist +> test.t1 check status Operation failed +80a86 +> ERROR 42S02: Table 'test.t1' doesn't exist +83c89,90 +< test.t1 check status OK +--- +> test.t1 check Error Table 'test.t1' doesn't exist +> test.t1 check status Operation failed +84a92 +> ERROR 42S02: Table 'test.t1' doesn't exist +87c95,96 +< test.t1 check status OK +--- +> test.t1 check Error Table 'test.t1' doesn't exist +> test.t1 check status Operation failed +88a98 +> ERROR 42S02: Table 'test.t1' doesn't exist +91c101,102 +< test.t1 check status OK +--- +> test.t1 check Error Table 'test.t1' doesn't exist +> test.t1 check status Operation failed +92a104 +> ERROR 42S02: Table 'test.t1' doesn't exist +95c107,108 +< test.t1 check status OK +--- +> test.t1 check Error Table 'test.t1' doesn't exist +> test.t1 check status Operation failed +96a110 +> ERROR 42S02: Table 'test.t1' doesn't exist +99c113,114 +< test.t1 check status OK +--- +> test.t1 check Error Table 'test.t1' doesn't exist +> test.t1 check status Operation failed +100a116 +> ERROR 42S02: Table 'test.t1' doesn't exist +103c119,120 +< test.t1 check status OK +--- +> test.t1 check Error Table 'test.t1' doesn't exist +> test.t1 check status Operation failed +104a122 +> ERROR 42S02: Unknown table 't1' diff --git a/storage/myisammrg/mysql-test/storage_engine/parts/checksum_table.rdiff b/storage/myisammrg/mysql-test/storage_engine/parts/checksum_table.rdiff new file mode 100644 index 00000000000..bc5b07686bf --- /dev/null +++ b/storage/myisammrg/mysql-test/storage_engine/parts/checksum_table.rdiff @@ -0,0 +1,81 @@ +2a3,4 +> ERROR HY000: Engine cannot be used in partitioned tables +> # ERROR: Statement ended with errno 1572, errname ER_PARTITION_MERGE_ERROR (expected to succeed) +3a6 +> ERROR 42S02: Table 'test.t1' doesn't exist +4a8,9 +> ERROR HY000: Engine cannot be used in partitioned tables +> # ERROR: Statement ended with errno 1572, errname ER_PARTITION_MERGE_ERROR (expected to succeed) +7c12,14 +< test.t1 4272806499 +--- +> test.t1 NULL +> Warnings: +> Error 1146 Table 'test.t1' doesn't exist +10,11c17,21 +< test.t2 0 +< test.t1 4272806499 +--- +> test.t2 NULL +> test.t1 NULL +> Warnings: +> Error 1146 Table 'test.t2' doesn't exist +> Error 1146 Table 'test.t1' doesn't exist +15a26,28 +> Warnings: +> Error 1146 Table 'test.t1' doesn't exist +> Error 1146 Table 'test.t2' doesn't exist +18,19c31,35 +< test.t1 4272806499 +< test.t2 0 +--- +> test.t1 NULL +> test.t2 NULL +> Warnings: +> Error 1146 Table 'test.t1' doesn't exist +> Error 1146 Table 'test.t2' doesn't exist +20a37 +> ERROR 42S02: Unknown table 't1,t2' +22a40,41 +> ERROR HY000: Engine cannot be used in partitioned tables +> # ERROR: Statement ended with errno 1572, errname ER_PARTITION_MERGE_ERROR (expected to succeed) +23a43 +> ERROR 42S02: Table 'test.t1' doesn't exist +24a45,46 +> ERROR HY000: Engine cannot be used in partitioned tables +> # ERROR: Statement ended with errno 1572, errname ER_PARTITION_MERGE_ERROR (expected to succeed) +27c49,51 +< test.t1 0 +--- +> test.t1 NULL +> Warnings: +> Error 1146 Table 'test.t1' doesn't exist +30,31c54,58 +< test.t2 0 +< test.t1 0 +--- +> test.t2 NULL +> test.t1 NULL +> Warnings: +> Error 1146 Table 'test.t2' doesn't exist +> Error 1146 Table 'test.t1' doesn't exist +34,35c61,65 +< test.t1 0 +< test.t2 0 +--- +> test.t1 NULL +> test.t2 NULL +> Warnings: +> Error 1146 Table 'test.t1' doesn't exist +> Error 1146 Table 'test.t2' doesn't exist +38,39c68,72 +< test.t1 4272806499 +< test.t2 0 +--- +> test.t1 NULL +> test.t2 NULL +> Warnings: +> Error 1146 Table 'test.t1' doesn't exist +> Error 1146 Table 'test.t2' doesn't exist +40a74 +> ERROR 42S02: Unknown table 't1,t2' diff --git a/storage/myisammrg/mysql-test/storage_engine/parts/create_table.rdiff b/storage/myisammrg/mysql-test/storage_engine/parts/create_table.rdiff new file mode 100644 index 00000000000..11fbc4812dc --- /dev/null +++ b/storage/myisammrg/mysql-test/storage_engine/parts/create_table.rdiff @@ -0,0 +1,156 @@ +3,10c3,12 +< INSERT INTO t1 (a) VALUES (1),(2),(3),(2); +< EXPLAIN PARTITIONS SELECT a FROM t1; +< id select_type table partitions type possible_keys key key_len ref rows Extra +< 1 SIMPLE t1 p0,p1 # # # # # # # +< EXPLAIN PARTITIONS SELECT a FROM t1 WHERE a=2; +< id select_type table partitions type possible_keys key key_len ref rows Extra +< 1 SIMPLE t1 p0 # # # # # # # +< DROP TABLE t1; +--- +> ERROR HY000: Engine cannot be used in partitioned tables +> # ERROR: Statement ended with errno 1572, errname ER_PARTITION_MERGE_ERROR (expected to succeed) +> # ------------ UNEXPECTED RESULT ------------ +> # [ CREATE TABLE t1 (a INT(11) /*!*/ /*Custom column options*/) ENGINE=MRG_MYISAM /*!*/ /*Custom table options*/ UNION(mrg.t1) INSERT_METHOD=LAST PARTITION BY HASH(a) PARTITIONS 2 ] +> # The statement|command finished with ER_PARTITION_MERGE_ERROR. +> # Partitions or the mix could be unsupported|malfunctioning, or the problem was caused by previous errors. +> # You can change the engine code, or create an rdiff, or disable the test by adding it to disabled.def. +> # Further in this test, the message might sometimes be suppressed; a part of the test might be skipped. +> # Also, this problem may cause a chain effect (more errors of different kinds in the test). +> # ------------------------------------------- +12,19c14,23 +< INSERT INTO t1 (a) VALUES ('a'),('b'),('c'); +< EXPLAIN PARTITIONS SELECT a FROM t1; +< id select_type table partitions type possible_keys key key_len ref rows Extra +< 1 SIMPLE t1 p0,p1 # # # # # # # +< EXPLAIN PARTITIONS SELECT a FROM t1 WHERE a = 'b'; +< id select_type table partitions type possible_keys key key_len ref rows Extra +< 1 SIMPLE t1 p1 # # # # # # # +< DROP TABLE t1; +--- +> ERROR HY000: Engine cannot be used in partitioned tables +> # ERROR: Statement ended with errno 1572, errname ER_PARTITION_MERGE_ERROR (expected to succeed) +> # ------------ UNEXPECTED RESULT ------------ +> # [ CREATE TABLE t1 (a CHAR(8) /*!*/ /*Custom column options*/) ENGINE=MRG_MYISAM /*!*/ /*Custom table options*/ UNION(mrg.t1) INSERT_METHOD=LAST PARTITION BY KEY(a) PARTITIONS 2 ] +> # The statement|command finished with ER_PARTITION_MERGE_ERROR. +> # Partitions or CHAR types or the mix could be unsupported|malfunctioning, or the problem was caused by previous errors. +> # You can change the engine code, or create an rdiff, or disable the test by adding it to disabled.def. +> # Further in this test, the message might sometimes be suppressed; a part of the test might be skipped. +> # Also, this problem may cause a chain effect (more errors of different kinds in the test). +> # ------------------------------------------- +21,31c25,34 +< SHOW INDEX IN t1; +< Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +< t1 1 a 1 a # # NULL NULL # # +< INSERT INTO t1 (a) VALUES (1),(2),(3),(5); +< EXPLAIN PARTITIONS SELECT a FROM t1; +< id select_type table partitions type possible_keys key key_len ref rows Extra +< 1 SIMPLE t1 p0,p1 # # # # # # # +< EXPLAIN PARTITIONS SELECT a FROM t1 WHERE a IN (1,3); +< id select_type table partitions type possible_keys key key_len ref rows Extra +< 1 SIMPLE t1 p0 # # # # # # # +< DROP TABLE t1; +--- +> ERROR HY000: Engine cannot be used in partitioned tables +> # ERROR: Statement ended with errno 1572, errname ER_PARTITION_MERGE_ERROR (expected to succeed) +> # ------------ UNEXPECTED RESULT ------------ +> # [ CREATE TABLE t1 (a INT(11) /*!*/ /*Custom indexed column options*/, /*!INDEX*/ /*Custom index*/ (a)) ENGINE=MRG_MYISAM /*!*/ /*Custom table options*/ UNION(mrg.t1) INSERT_METHOD=LAST PARTITION BY KEY(a) PARTITIONS 2 ] +> # The statement|command finished with ER_PARTITION_MERGE_ERROR. +> # Partitions or indexes or the mix could be unsupported|malfunctioning, or the problem was caused by previous errors. +> # You can change the engine code, or create an rdiff, or disable the test by adding it to disabled.def. +> # Further in this test, the message might sometimes be suppressed; a part of the test might be skipped. +> # Also, this problem may cause a chain effect (more errors of different kinds in the test). +> # ------------------------------------------- +33,43c36,45 +< SHOW INDEX IN t1; +< Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +< t1 0 PRIMARY 1 a # # NULL NULL # # +< INSERT INTO t1 (a) VALUES (1),(200),(3),(2); +< EXPLAIN PARTITIONS SELECT a FROM t1; +< id select_type table partitions type possible_keys key key_len ref rows Extra +< 1 SIMPLE t1 p0,p1 # # # # # # # +< EXPLAIN PARTITIONS SELECT a FROM t1 WHERE a=2; +< id select_type table partitions type possible_keys key key_len ref rows Extra +< 1 SIMPLE t1 p1 # # # # # # # +< DROP TABLE t1; +--- +> ERROR HY000: Engine cannot be used in partitioned tables +> # ERROR: Statement ended with errno 1572, errname ER_PARTITION_MERGE_ERROR (expected to succeed) +> # ------------ UNEXPECTED RESULT ------------ +> # [ CREATE TABLE t1 (a INT(11) /*!*/ /*Custom indexed column options*/ PRIMARY KEY) ENGINE=MRG_MYISAM /*!*/ /*Custom table options*/ UNION(mrg.t1) INSERT_METHOD=LAST PARTITION BY KEY() PARTITIONS 2 ] +> # The statement|command finished with ER_PARTITION_MERGE_ERROR. +> # PK or the mix could be unsupported|malfunctioning, or the problem was caused by previous errors. +> # You can change the engine code, or create an rdiff, or disable the test by adding it to disabled.def. +> # Further in this test, the message might sometimes be suppressed; a part of the test might be skipped. +> # Also, this problem may cause a chain effect (more errors of different kinds in the test). +> # ------------------------------------------- +48,58c50,63 +< INSERT INTO t1 (a) VALUES (1),(2),(400); +< EXPLAIN PARTITIONS SELECT a FROM t1; +< id select_type table partitions type possible_keys key key_len ref rows Extra +< 1 SIMPLE t1 p0,p1 # # # # # # # +< EXPLAIN PARTITIONS SELECT a FROM t1 WHERE a = 2; +< id select_type table partitions type possible_keys key key_len ref rows Extra +< 1 SIMPLE t1 p0 # # # # # # # +< INSERT INTO t1 (a) VALUES (10000); +< ERROR HY000: Table has no partition for value 10000 +< DROP TABLE t1; +< CREATE TABLE t1 (a <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> PARTITION BY LIST(a) ( +--- +> ERROR HY000: Engine cannot be used in partitioned tables +> # ERROR: Statement ended with errno 1572, errname ER_PARTITION_MERGE_ERROR (expected to succeed) +> # ------------ UNEXPECTED RESULT ------------ +> # [ CREATE TABLE t1 (a INT(11) /*!*/ /*Custom column options*/) ENGINE=MRG_MYISAM /*!*/ /*Custom table options*/ UNION(mrg.t1) INSERT_METHOD=LAST PARTITION BY RANGE(a) ( +> PARTITION p0 VALUES LESS THAN (10), +> PARTITION p1 VALUES LESS THAN (1000) +> ) ] +> # The statement|command finished with ER_PARTITION_MERGE_ERROR. +> # Partitions or the mix could be unsupported|malfunctioning, or the problem was caused by previous errors. +> # You can change the engine code, or create an rdiff, or disable the test by adding it to disabled.def. +> # Further in this test, the message might sometimes be suppressed; a part of the test might be skipped. +> # Also, this problem may cause a chain effect (more errors of different kinds in the test). +> # ------------------------------------------- +> CREATE TABLE t1 (a <INT_COLUMN>, b <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> PARTITION BY LIST(a) SUBPARTITION by HASH(b) ( +62,72c67,70 +< INSERT INTO t1 (a) VALUES (1),(101),(1); +< EXPLAIN PARTITIONS SELECT a FROM t1; +< id select_type table partitions type possible_keys key key_len ref rows Extra +< 1 SIMPLE t1 abc,def # # # # # # # +< EXPLAIN PARTITIONS SELECT a FROM t1 WHERE a = 100; +< id select_type table partitions type possible_keys key key_len ref rows Extra +< 1 SIMPLE NULL NULL # # # # # # # +< INSERT INTO t1 (a) VALUES (50); +< ERROR HY000: Table has no partition for value 50 +< DROP TABLE t1; +< CREATE TABLE t1 (a <INT_COLUMN>, b <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> PARTITION BY LIST(a) SUBPARTITION by HASH(b) ( +--- +> ERROR HY000: Engine cannot be used in partitioned tables +> # ERROR: Statement ended with errno 1572, errname ER_PARTITION_MERGE_ERROR (expected to succeed) +> # ------------ UNEXPECTED RESULT ------------ +> # [ CREATE TABLE t1 (a INT(11) /*!*/ /*Custom column options*/, b INT(11) /*!*/ /*Custom column options*/) ENGINE=MRG_MYISAM /*!*/ /*Custom table options*/ UNION(mrg.t1) INSERT_METHOD=LAST PARTITION BY LIST(a) SUBPARTITION by HASH(b) ( +75,91c73,79 +< ); +< SHOW INDEX IN t1; +< Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +< INSERT INTO t1 (a,b) VALUES (1,1),(101,2),(1,3); +< EXPLAIN PARTITIONS SELECT a FROM t1; +< id select_type table partitions type possible_keys key key_len ref rows Extra +< 1 SIMPLE t1 abc_abcsp0,def_defsp0 # # # # # # # +< EXPLAIN PARTITIONS SELECT a FROM t1 WHERE a = 100; +< id select_type table partitions type possible_keys key key_len ref rows Extra +< 1 SIMPLE NULL NULL # # # # # # # +< SELECT TABLE_SCHEMA, TABLE_NAME, PARTITION_NAME, SUBPARTITION_NAME, PARTITION_METHOD, SUBPARTITION_METHOD +< FROM INFORMATION_SCHEMA.PARTITIONS WHERE TABLE_NAME = 't1'; +< TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_METHOD SUBPARTITION_METHOD +< test t1 abc abcsp0 LIST HASH +< test t1 def defsp0 LIST HASH +< SELECT * FROM INFORMATION_SCHEMA.PARTITIONS; +< DROP TABLE t1; +--- +> ) ] +> # The statement|command finished with ER_PARTITION_MERGE_ERROR. +> # Partitions or subpartitions or the mix could be unsupported|malfunctioning, or the problem was caused by previous errors. +> # You can change the engine code, or create an rdiff, or disable the test by adding it to disabled.def. +> # Further in this test, the message might sometimes be suppressed; a part of the test might be skipped. +> # Also, this problem may cause a chain effect (more errors of different kinds in the test). +> # ------------------------------------------- diff --git a/storage/myisammrg/mysql-test/storage_engine/parts/optimize_table.rdiff b/storage/myisammrg/mysql-test/storage_engine/parts/optimize_table.rdiff new file mode 100644 index 00000000000..350d93fe91f --- /dev/null +++ b/storage/myisammrg/mysql-test/storage_engine/parts/optimize_table.rdiff @@ -0,0 +1,91 @@ +3,25c3,12 +< INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(2,'d'),(4,'e'),(100,'f'),(101,'g'); +< CREATE TABLE t2 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> PARTITION BY RANGE(a) ( +< PARTITION p0 VALUES LESS THAN (100), +< PARTITION p1 VALUES LESS THAN MAXVALUE +< ); +< INSERT INTO t2 (a,b) SELECT a, b FROM t1; +< INSERT INTO t1 (a,b) VALUES (3,'c'),(4,'d'); +< ALTER TABLE t1 OPTIMIZE PARTITION p1; +< Table Op Msg_type Msg_text +< test.t1 optimize status OK +< INSERT INTO t2 (a,b) VALUES (4,'d'); +< ALTER TABLE t2 OPTIMIZE PARTITION p0 NO_WRITE_TO_BINLOG; +< Table Op Msg_type Msg_text +< test.t2 optimize status OK +< INSERT INTO t1 (a,b) VALUES (6,'f'); +< ALTER TABLE t1 OPTIMIZE PARTITION ALL LOCAL; +< Table Op Msg_type Msg_text +< test.t1 optimize status OK +< INSERT INTO t2 (a,b) VALUES (5,'e'); +< ALTER TABLE t2 OPTIMIZE PARTITION p1,p0; +< Table Op Msg_type Msg_text +< test.t2 optimize status OK +< DROP TABLE t1, t2; +--- +> ERROR HY000: Engine cannot be used in partitioned tables +> # ERROR: Statement ended with errno 1572, errname ER_PARTITION_MERGE_ERROR (expected to succeed) +> # ------------ UNEXPECTED RESULT ------------ +> # [ CREATE TABLE t1 (a INT(11) /*!*/ /*Custom column options*/, b CHAR(8) /*!*/ /*Custom column options*/) ENGINE=MRG_MYISAM /*!*/ /*Custom table options*/ UNION(mrg.t1) INSERT_METHOD=LAST PARTITION BY HASH(a) PARTITIONS 2 ] +> # The statement|command finished with ER_PARTITION_MERGE_ERROR. +> # Partitions or the mix could be unsupported|malfunctioning, or the problem was caused by previous errors. +> # You can change the engine code, or create an rdiff, or disable the test by adding it to disabled.def. +> # Further in this test, the message might sometimes be suppressed; a part of the test might be skipped. +> # Also, this problem may cause a chain effect (more errors of different kinds in the test). +> # ------------------------------------------- +27a15,16 +> ERROR HY000: Engine cannot be used in partitioned tables +> # ERROR: Statement ended with errno 1572, errname ER_PARTITION_MERGE_ERROR (expected to succeed) +28a18 +> ERROR 42S02: Table 'test.t1' doesn't exist +29a20,21 +> ERROR HY000: Engine cannot be used in partitioned tables +> # ERROR: Statement ended with errno 1572, errname ER_PARTITION_MERGE_ERROR (expected to succeed) +30a23 +> ERROR 42S02: Table 'test.t1' doesn't exist +33c26,27 +< test.t1 optimize status OK +--- +> test.t1 optimize Error Table 'test.t1' doesn't exist +> test.t1 optimize status Operation failed +34a29 +> ERROR 42S02: Table 'test.t2' doesn't exist +37c32,33 +< test.t2 optimize status OK +--- +> test.t2 optimize Error Table 'test.t2' doesn't exist +> test.t2 optimize status Operation failed +38a35 +> ERROR 42S02: Table 'test.t2' doesn't exist +39a37 +> ERROR 42S02: Table 'test.t1' doesn't exist +42,43c40,43 +< test.t1 optimize status OK +< test.t2 optimize status OK +--- +> test.t1 optimize Error Table 'test.t1' doesn't exist +> test.t1 optimize status Operation failed +> test.t2 optimize Error Table 'test.t2' doesn't exist +> test.t2 optimize status Operation failed +46,47c46,49 +< test.t1 optimize status OK +< test.t2 optimize status OK +--- +> test.t1 optimize Error Table 'test.t1' doesn't exist +> test.t1 optimize status Operation failed +> test.t2 optimize Error Table 'test.t2' doesn't exist +> test.t2 optimize status Operation failed +48a51 +> ERROR 42S02: Unknown table 't1,t2' +49a53,54 +> ERROR HY000: Engine cannot be used in partitioned tables +> # ERROR: Statement ended with errno 1572, errname ER_PARTITION_MERGE_ERROR (expected to succeed) +50a56 +> ERROR 42S02: Table 'test.t1' doesn't exist +53c59,60 +< test.t1 optimize status OK +--- +> test.t1 optimize Error Table 'test.t1' doesn't exist +> test.t1 optimize status Operation failed +54a62 +> ERROR 42S02: Unknown table 't1' diff --git a/storage/myisammrg/mysql-test/storage_engine/parts/repair_table.rdiff b/storage/myisammrg/mysql-test/storage_engine/parts/repair_table.rdiff new file mode 100644 index 00000000000..4c39421261c --- /dev/null +++ b/storage/myisammrg/mysql-test/storage_engine/parts/repair_table.rdiff @@ -0,0 +1,295 @@ +4,33c4,13 +< INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(2,'d'),(4,'e'),(100,'f'),(101,'g'); +< CREATE TABLE t2 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> PARTITION BY RANGE(a) ( +< PARTITION p0 VALUES LESS THAN (100), +< PARTITION p1 VALUES LESS THAN MAXVALUE +< ); +< INSERT INTO t2 (a,b) SELECT a, b FROM t1; +< ALTER TABLE t1 REPAIR PARTITION p0; +< Table Op Msg_type Msg_text +< test.t1 repair status OK +< INSERT INTO t1 VALUES (3,'c'); +< ALTER TABLE t1 REPAIR PARTITION NO_WRITE_TO_BINLOG p0, p1; +< Table Op Msg_type Msg_text +< test.t1 repair status OK +< INSERT INTO t2 (a,b) VALUES (5,'e'),(6,'f'); +< ALTER TABLE t2 REPAIR PARTITION LOCAL p1; +< Table Op Msg_type Msg_text +< test.t2 repair status OK +< INSERT INTO t1 (a,b) VALUES (7,'g'),(8,'h'); +< ALTER TABLE t1 REPAIR PARTITION LOCAL ALL EXTENDED; +< Table Op Msg_type Msg_text +< test.t1 repair status OK +< INSERT INTO t1 VALUES (10,'j'); +< ALTER TABLE t1 REPAIR PARTITION p1 QUICK USE_FRM; +< Table Op Msg_type Msg_text +< test.t1 repair status OK +< INSERT INTO t2 (a,b) VALUES (12,'l'); +< ALTER TABLE t2 REPAIR PARTITION NO_WRITE_TO_BINLOG ALL QUICK EXTENDED USE_FRM; +< Table Op Msg_type Msg_text +< test.t2 repair status OK +< DROP TABLE t1, t2; +--- +> ERROR HY000: Engine cannot be used in partitioned tables +> # ERROR: Statement ended with errno 1572, errname ER_PARTITION_MERGE_ERROR (expected to succeed) +> # ------------ UNEXPECTED RESULT ------------ +> # [ CREATE TABLE t1 (a INT(11) /*!*/ /*Custom column options*/, b CHAR(8) /*!*/ /*Custom column options*/) ENGINE=MRG_MYISAM /*!*/ /*Custom table options*/ UNION(mrg.t1) INSERT_METHOD=LAST PARTITION BY HASH(a) PARTITIONS 2 ] +> # The statement|command finished with ER_PARTITION_MERGE_ERROR. +> # Partitions or the mix could be unsupported|malfunctioning, or the problem was caused by previous errors. +> # You can change the engine code, or create an rdiff, or disable the test by adding it to disabled.def. +> # Further in this test, the message might sometimes be suppressed; a part of the test might be skipped. +> # Also, this problem may cause a chain effect (more errors of different kinds in the test). +> # ------------------------------------------- +35a16,17 +> ERROR HY000: Engine cannot be used in partitioned tables +> # ERROR: Statement ended with errno 1572, errname ER_PARTITION_MERGE_ERROR (expected to succeed) +36a19 +> ERROR 42S02: Table 'test.t1' doesn't exist +37a21,22 +> ERROR HY000: Engine cannot be used in partitioned tables +> # ERROR: Statement ended with errno 1572, errname ER_PARTITION_MERGE_ERROR (expected to succeed) +40c25,26 +< test.t1 repair status OK +--- +> test.t1 repair Error Table 'test.t1' doesn't exist +> test.t1 repair status Operation failed +41a28 +> ERROR 42S02: Table 'test.t1' doesn't exist +42a30 +> ERROR 42S02: Table 'test.t2' doesn't exist +45,46c33,36 +< test.t1 repair status OK +< test.t2 repair status OK +--- +> test.t1 repair Error Table 'test.t1' doesn't exist +> test.t1 repair status Operation failed +> test.t2 repair Error Table 'test.t2' doesn't exist +> test.t2 repair status Operation failed +47a38 +> ERROR 42S02: Table 'test.t2' doesn't exist +50c41,42 +< test.t2 repair status OK +--- +> test.t2 repair Error Table 'test.t2' doesn't exist +> test.t2 repair status Operation failed +51a44 +> ERROR 42S02: Table 'test.t1' doesn't exist +52a46 +> ERROR 42S02: Table 'test.t2' doesn't exist +55,56c49,52 +< test.t2 repair status OK +< test.t1 repair status OK +--- +> test.t2 repair Error Table 'test.t2' doesn't exist +> test.t2 repair status Operation failed +> test.t1 repair Error Table 'test.t1' doesn't exist +> test.t1 repair status Operation failed +57a54 +> ERROR 42S02: Table 'test.t1' doesn't exist +58a56 +> ERROR 42S02: Table 'test.t2' doesn't exist +61,62c59,62 +< test.t1 repair status OK +< test.t2 repair status OK +--- +> test.t1 repair Error Table 'test.t1' doesn't exist +> test.t1 repair status Operation failed +> test.t2 repair Error Table 'test.t2' doesn't exist +> test.t2 repair status Operation failed +63a64 +> ERROR 42S02: Table 'test.t1' doesn't exist +64a66 +> ERROR 42S02: Table 'test.t2' doesn't exist +67,68c69,72 +< test.t1 repair status OK +< test.t2 repair status OK +--- +> test.t1 repair Error Table 'test.t1' doesn't exist +> test.t1 repair status Operation failed +> test.t2 repair Error Table 'test.t2' doesn't exist +> test.t2 repair status Operation failed +71,73c75,76 +< ERROR HY000: Failed to read from the .par file +< # Statement ended with one of expected results (0,130,ER_FAILED_READ_FROM_PAR_FILE,ER_OPEN_AS_READONLY). +< # If you got a difference in error message, just add it to rdiff file +--- +> ERROR 42S02: Table 'test.t1' doesn't exist +> # ERROR: Statement ended with errno 1146, errname ER_NO_SUCH_TABLE (expected results: 0,130,ER_FAILED_READ_FROM_PAR_FILE,ER_OPEN_AS_READONLY) +76,78c79,80 +< test.t1 check Error Failed to read from the .par file +< test.t1 check Error Incorrect information in file: './test/t1.frm' +< test.t1 check error Corrupt +--- +> test.t1 check Error Table 'test.t1' doesn't exist +> test.t1 check status Operation failed +80,82c82,83 +< ERROR HY000: Failed to read from the .par file +< # Statement ended with one of expected results (0,130,ER_FAILED_READ_FROM_PAR_FILE,ER_OPEN_AS_READONLY). +< # If you got a difference in error message, just add it to rdiff file +--- +> ERROR 42S02: Table 'test.t1' doesn't exist +> # ERROR: Statement ended with errno 1146, errname ER_NO_SUCH_TABLE (expected results: 0,130,ER_FAILED_READ_FROM_PAR_FILE,ER_OPEN_AS_READONLY) +85,87c86,87 +< test.t1 repair Error Failed to read from the .par file +< test.t1 repair Error Incorrect information in file: './test/t1.frm' +< test.t1 repair error Corrupt +--- +> test.t1 repair Error Table 'test.t1' doesn't exist +> test.t1 repair status Operation failed +88a89 +> ERROR 42S02: Unknown table 't1,t2' +93a95,96 +> ERROR HY000: Engine cannot be used in partitioned tables +> # ERROR: Statement ended with errno 1572, errname ER_PARTITION_MERGE_ERROR (expected to succeed) +96c99,100 +< test.t1 repair status OK +--- +> test.t1 repair Error Table 'test.t1' doesn't exist +> test.t1 repair status Operation failed +97a102 +> ERROR 42S02: Table 'test.t1' doesn't exist +100c105,106 +< test.t1 repair status OK +--- +> test.t1 repair Error Table 'test.t1' doesn't exist +> test.t1 repair status Operation failed +101a108 +> ERROR 42S02: Table 'test.t1' doesn't exist +104,235c111,112 +< test.t1 repair status OK +< t1#P#p0.MYD +< t1#P#p0.MYI +< t1#P#p1.MYD +< t1#P#p1.MYI +< t1.frm +< t1.par +< INSERT INTO t1 (a,b) VALUES (14,'n'),(15,'o'); +< # Statement ended with one of expected results (0,144). +< # If you got a difference in error message, just add it to rdiff file +< FLUSH TABLE t1; +< Restoring <DATADIR>/test/t1#P#p0.MYD +< CHECK TABLE t1; +< Table Op Msg_type Msg_text +< test.t1 check error Size of datafile is: 26 Should be: 39 +< test.t1 check error Partition p0 returned error +< test.t1 check error Corrupt +< SELECT * FROM t1; +< a b +< 8 h +< 10 j +< 7 g +< 15 o +< Warnings: +< Error 145 Table './test/t1#P#p0' is marked as crashed and should be repaired +< Error 1194 Table 't1' is marked as crashed and should be repaired +< Error 1034 Number of rows changed from 3 to 2 +< # Statement ended with one of expected results (0,ER_NOT_KEYFILE,144). +< # If you got a difference in error message, just add it to rdiff file +< INSERT INTO t1 (a,b) VALUES (14,'n'),(15,'o'); +< # Statement ended with one of expected results (0,144). +< # If you got a difference in error message, just add it to rdiff file +< FLUSH TABLE t1; +< Restoring <DATADIR>/test/t1#P#p0.MYI +< CHECK TABLE t1; +< Table Op Msg_type Msg_text +< test.t1 check warning Size of datafile is: 39 Should be: 26 +< test.t1 check error Record-count is not ok; is 3 Should be: 2 +< test.t1 check warning Found 3 key parts. Should be: 2 +< test.t1 check error Partition p0 returned error +< test.t1 check error Corrupt +< SELECT * FROM t1; +< a b +< 8 h +< 10 j +< 14 n +< 7 g +< 15 o +< 15 o +< Warnings: +< Error 145 Table './test/t1#P#p0' is marked as crashed and should be repaired +< Error 1194 Table 't1' is marked as crashed and should be repaired +< Error 1034 Number of rows changed from 2 to 3 +< # Statement ended with one of expected results (0,ER_NOT_KEYFILE,144). +< # If you got a difference in error message, just add it to rdiff file +< INSERT INTO t1 (a,b) VALUES (14,'n'),(15,'o'); +< # Statement ended with one of expected results (0,144). +< # If you got a difference in error message, just add it to rdiff file +< FLUSH TABLE t1; +< Restoring <DATADIR>/test/t1#P#p1.MYD +< CHECK TABLE t1; +< Table Op Msg_type Msg_text +< test.t1 check error Size of datafile is: 39 Should be: 52 +< test.t1 check error Partition p1 returned error +< test.t1 check error Corrupt +< SELECT * FROM t1; +< a b +< 8 h +< 10 j +< 14 n +< 14 n +< 7 g +< 15 o +< 15 o +< Warnings: +< Error 145 Table './test/t1#P#p1' is marked as crashed and should be repaired +< Error 1194 Table 't1' is marked as crashed and should be repaired +< Error 1034 Number of rows changed from 4 to 3 +< # Statement ended with one of expected results (0,ER_NOT_KEYFILE,144). +< # If you got a difference in error message, just add it to rdiff file +< INSERT INTO t1 (a,b) VALUES (14,'n'),(15,'o'); +< # Statement ended with one of expected results (0,144). +< # If you got a difference in error message, just add it to rdiff file +< FLUSH TABLE t1; +< Restoring <DATADIR>/test/t1#P#p1.MYI +< CHECK TABLE t1; +< Table Op Msg_type Msg_text +< test.t1 check warning Size of datafile is: 52 Should be: 39 +< test.t1 check error Record-count is not ok; is 4 Should be: 3 +< test.t1 check warning Found 4 key parts. Should be: 3 +< test.t1 check error Partition p1 returned error +< test.t1 check error Corrupt +< SELECT * FROM t1; +< a b +< 8 h +< 10 j +< 14 n +< 14 n +< 14 n +< 7 g +< 15 o +< 15 o +< 15 o +< Warnings: +< Error 145 Table './test/t1#P#p1' is marked as crashed and should be repaired +< Error 1194 Table 't1' is marked as crashed and should be repaired +< Error 1034 Number of rows changed from 3 to 4 +< # Statement ended with one of expected results (0,ER_NOT_KEYFILE,144). +< # If you got a difference in error message, just add it to rdiff file +< INSERT INTO t1 (a,b) VALUES (14,'n'),(15,'o'); +< # Statement ended with one of expected results (0,144). +< # If you got a difference in error message, just add it to rdiff file +< FLUSH TABLE t1; +< Restoring <DATADIR>/test/t1.par +< CHECK TABLE t1; +< Table Op Msg_type Msg_text +< test.t1 check status OK +< SELECT * FROM t1; +< a b +< 8 h +< 10 j +< 14 n +< 14 n +< 14 n +< 14 n +< 7 g +< 15 o +< 15 o +< 15 o +< 15 o +< # Statement ended with one of expected results (0,ER_NOT_KEYFILE,144). +< # If you got a difference in error message, just add it to rdiff file +--- +> test.t1 repair Error Table 'test.t1' doesn't exist +> test.t1 repair status Operation failed +236a114 +> ERROR 42S02: Unknown table 't1' diff --git a/storage/myisammrg/mysql-test/storage_engine/parts/truncate_table.rdiff b/storage/myisammrg/mysql-test/storage_engine/parts/truncate_table.rdiff new file mode 100644 index 00000000000..2c1364d52e1 --- /dev/null +++ b/storage/myisammrg/mysql-test/storage_engine/parts/truncate_table.rdiff @@ -0,0 +1,100 @@ +3,8c3,12 +< TRUNCATE TABLE t1; +< INSERT INTO t1 (a,b) VALUES (1,'a'), (2,'b'), (3,'c'); +< TRUNCATE TABLE t1; +< SELECT * FROM t1; +< a b +< DROP TABLE t1; +--- +> ERROR HY000: Engine cannot be used in partitioned tables +> # ERROR: Statement ended with errno 1572, errname ER_PARTITION_MERGE_ERROR (expected to succeed) +> # ------------ UNEXPECTED RESULT ------------ +> # [ CREATE TABLE t1 (a INT(11) /*!*/ /*Custom column options*/, b CHAR(8) /*!*/ /*Custom column options*/) ENGINE=MRG_MYISAM /*!*/ /*Custom table options*/ UNION(mrg.t1) INSERT_METHOD=LAST PARTITION BY HASH(a) PARTITIONS 2 ] +> # The statement|command finished with ER_PARTITION_MERGE_ERROR. +> # Partitions or the mix could be unsupported|malfunctioning, or the problem was caused by previous errors. +> # You can change the engine code, or create an rdiff, or disable the test by adding it to disabled.def. +> # Further in this test, the message might sometimes be suppressed; a part of the test might be skipped. +> # Also, this problem may cause a chain effect (more errors of different kinds in the test). +> # ------------------------------------------- +10,52c14,23 +< SHOW CREATE TABLE t1; +< Table Create Table +< t1 CREATE TABLE `t1` ( +< `a` int(11) NOT NULL AUTO_INCREMENT, +< `c` char(8) DEFAULT NULL, +< PRIMARY KEY (`a`) +< ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +< /*!50100 PARTITION BY HASH (a) +< PARTITIONS 2 */ +< INSERT INTO t1 (c) VALUES ('a'),('b'),('c'); +< SHOW CREATE TABLE t1; +< Table Create Table +< t1 CREATE TABLE `t1` ( +< `a` int(11) NOT NULL AUTO_INCREMENT, +< `c` char(8) DEFAULT NULL, +< PRIMARY KEY (`a`) +< ) ENGINE=<STORAGE_ENGINE> AUTO_INCREMENT=4 DEFAULT CHARSET=latin1 +< /*!50100 PARTITION BY HASH (a) +< PARTITIONS 2 */ +< TRUNCATE TABLE t1; +< SHOW CREATE TABLE t1; +< Table Create Table +< t1 CREATE TABLE `t1` ( +< `a` int(11) NOT NULL AUTO_INCREMENT, +< `c` char(8) DEFAULT NULL, +< PRIMARY KEY (`a`) +< ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +< /*!50100 PARTITION BY HASH (a) +< PARTITIONS 2 */ +< INSERT INTO t1 (c) VALUES ('d'); +< SHOW CREATE TABLE t1; +< Table Create Table +< t1 CREATE TABLE `t1` ( +< `a` int(11) NOT NULL AUTO_INCREMENT, +< `c` char(8) DEFAULT NULL, +< PRIMARY KEY (`a`) +< ) ENGINE=<STORAGE_ENGINE> AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 +< /*!50100 PARTITION BY HASH (a) +< PARTITIONS 2 */ +< SELECT * FROM t1; +< a c +< 1 d +< DROP TABLE t1; +--- +> ERROR HY000: Engine cannot be used in partitioned tables +> # ERROR: Statement ended with errno 1572, errname ER_PARTITION_MERGE_ERROR (expected to succeed) +> # ------------ UNEXPECTED RESULT ------------ +> # [ CREATE TABLE t1 (a INT(11) /*!*/ /*Custom indexed column options*/ KEY AUTO_INCREMENT, c CHAR(8) /*!*/ /*Custom column options*/) ENGINE=MRG_MYISAM /*!*/ /*Custom table options*/ UNION(mrg.t1) INSERT_METHOD=LAST PARTITION BY HASH(a) PARTITIONS 2 ] +> # The statement|command finished with ER_PARTITION_MERGE_ERROR. +> # Partitions or PK or auto-increment or the mix could be unsupported|malfunctioning, or the problem was caused by previous errors. +> # You can change the engine code, or create an rdiff, or disable the test by adding it to disabled.def. +> # Further in this test, the message might sometimes be suppressed; a part of the test might be skipped. +> # Also, this problem may cause a chain effect (more errors of different kinds in the test). +> # ------------------------------------------- +54,68c25,34 +< INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(2,'d'),(4,'e'),(100,'f'),(101,'g'); +< ALTER TABLE t1 TRUNCATE PARTITION p0; +< SELECT * FROM t1; +< a b +< 1 a +< 101 g +< 3 c +< EXPLAIN PARTITIONS SELECT * FROM t1; +< id select_type table partitions type possible_keys key key_len ref rows Extra +< 1 SIMPLE t1 p0,p1 # # # # # # +< INSERT INTO t1 (a,b) VALUES (1,'a'), (2,'b'), (3,'c'); +< ALTER TABLE t1 TRUNCATE PARTITION ALL; +< SELECT * FROM t1; +< a b +< DROP TABLE t1; +--- +> ERROR HY000: Engine cannot be used in partitioned tables +> # ERROR: Statement ended with errno 1572, errname ER_PARTITION_MERGE_ERROR (expected to succeed) +> # ------------ UNEXPECTED RESULT ------------ +> # [ CREATE TABLE t1 (a INT(11) /*!*/ /*Custom column options*/, b CHAR(8) /*!*/ /*Custom column options*/) ENGINE=MRG_MYISAM /*!*/ /*Custom table options*/ UNION(mrg.t1) INSERT_METHOD=LAST PARTITION BY HASH(a) PARTITIONS 2 ] +> # The statement|command finished with ER_PARTITION_MERGE_ERROR. +> # Partitions or the mix could be unsupported|malfunctioning, or the problem was caused by previous errors. +> # You can change the engine code, or create an rdiff, or disable the test by adding it to disabled.def. +> # Further in this test, the message might sometimes be suppressed; a part of the test might be skipped. +> # Also, this problem may cause a chain effect (more errors of different kinds in the test). +> # ------------------------------------------- diff --git a/storage/myisammrg/mysql-test/storage_engine/repair_table.rdiff b/storage/myisammrg/mysql-test/storage_engine/repair_table.rdiff new file mode 100644 index 00000000000..180647323bc --- /dev/null +++ b/storage/myisammrg/mysql-test/storage_engine/repair_table.rdiff @@ -0,0 +1,103 @@ +7c7 +< test.t1 repair status OK +--- +> test.t1 repair note The storage engine for the table doesn't support repair +12,13c12,13 +< test.t1 repair status OK +< test.t2 repair status OK +--- +> test.t1 repair note The storage engine for the table doesn't support repair +> test.t2 repair note The storage engine for the table doesn't support repair +17c17 +< test.t2 repair status OK +--- +> test.t2 repair note The storage engine for the table doesn't support repair +22,23c22,23 +< test.t2 repair status OK +< test.t1 repair status OK +--- +> test.t2 repair note The storage engine for the table doesn't support repair +> test.t1 repair note The storage engine for the table doesn't support repair +28,31c28,29 +< test.t1 repair warning Number of rows changed from 0 to 6 +< test.t1 repair status OK +< test.t2 repair warning Number of rows changed from 0 to 5 +< test.t2 repair status OK +--- +> test.t1 repair note The storage engine for the table doesn't support repair +> test.t2 repair note The storage engine for the table doesn't support repair +36,39c34,35 +< test.t1 repair warning Number of rows changed from 0 to 7 +< test.t1 repair status OK +< test.t2 repair warning Number of rows changed from 0 to 6 +< test.t2 repair status OK +--- +> test.t1 repair note The storage engine for the table doesn't support repair +> test.t2 repair note The storage engine for the table doesn't support repair +42c38 +< ERROR HY000: Incorrect file format 't1' +--- +> ERROR HY000: Table 't1' is read only +47,48c43 +< test.t1 check Error Incorrect file format 't1' +< test.t1 check error Corrupt +--- +> test.t1 check status OK +50c45 +< ERROR HY000: Incorrect file format 't1' +--- +> a b +55,56c50 +< test.t1 repair Error Incorrect file format 't1' +< test.t1 repair error Corrupt +--- +> test.t1 repair note The storage engine for the table doesn't support repair +65c59 +< test.t1 repair status OK +--- +> test.t1 repair note The storage engine for the table doesn't support repair +69c63 +< test.t1 repair status OK +--- +> test.t1 repair note The storage engine for the table doesn't support repair +73,76c67,68 +< test.t1 repair warning Number of rows changed from 0 to 3 +< test.t1 repair status OK +< t1.MYD +< t1.MYI +--- +> test.t1 repair note The storage engine for the table doesn't support repair +> t1.MRG +82c74 +< Restoring <DATADIR>/test/t1.MYD +--- +> Restoring <DATADIR>/test/t1.MRG +85,86c77 +< test.t1 check error Size of datafile is: 39 Should be: 65 +< test.t1 check error Corrupt +--- +> test.t1 check status OK +88,103c79,84 +< ERROR HY000: Incorrect key file for table 't1'; try to repair it +< # Statement ended with one of expected results (0,ER_NOT_KEYFILE,144). +< # If you got a difference in error message, just add it to rdiff file +< INSERT INTO t1 (a,b) VALUES (14,'n'),(15,'o'); +< ERROR HY000: Table './test/t1' is marked as crashed and last (automatic?) repair failed +< # Statement ended with one of expected results (0,144). +< # If you got a difference in error message, just add it to rdiff file +< FLUSH TABLE t1; +< Restoring <DATADIR>/test/t1.MYI +< CHECK TABLE t1; +< Table Op Msg_type Msg_text +< test.t1 check warning Table is marked as crashed and last repair failed +< test.t1 check error Size of datafile is: 39 Should be: 65 +< test.t1 check error Corrupt +< SELECT * FROM t1; +< ERROR HY000: Table './test/t1' is marked as crashed and last (automatic?) repair failed +--- +> a b +> 7 g +> 8 h +> 10 j +> 14 n +> 15 o diff --git a/storage/myisammrg/mysql-test/storage_engine/show_engine.rdiff b/storage/myisammrg/mysql-test/storage_engine/show_engine.rdiff new file mode 100644 index 00000000000..e7c9b0176b6 --- /dev/null +++ b/storage/myisammrg/mysql-test/storage_engine/show_engine.rdiff @@ -0,0 +1,2 @@ +7d6 +< <STORAGE_ENGINE> ### Engine status, can be long and changeable ### diff --git a/storage/myisammrg/mysql-test/storage_engine/tbl_opt_ai.rdiff b/storage/myisammrg/mysql-test/storage_engine/tbl_opt_ai.rdiff new file mode 100644 index 00000000000..bca6fa60d13 --- /dev/null +++ b/storage/myisammrg/mysql-test/storage_engine/tbl_opt_ai.rdiff @@ -0,0 +1,8 @@ +7c7 +< ) ENGINE=<STORAGE_ENGINE> AUTO_INCREMENT=10 DEFAULT CHARSET=latin1 +--- +> ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 INSERT_METHOD=LAST UNION=(`mrg`.`t1`) +13c13 +< ) ENGINE=<STORAGE_ENGINE> AUTO_INCREMENT=100 DEFAULT CHARSET=latin1 +--- +> ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 INSERT_METHOD=LAST UNION=(`mrg`.`t1`) diff --git a/storage/myisammrg/mysql-test/storage_engine/tbl_opt_avg_row_length.rdiff b/storage/myisammrg/mysql-test/storage_engine/tbl_opt_avg_row_length.rdiff new file mode 100644 index 00000000000..7a3ac54fd3e --- /dev/null +++ b/storage/myisammrg/mysql-test/storage_engine/tbl_opt_avg_row_length.rdiff @@ -0,0 +1,8 @@ +8c8 +< ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 AVG_ROW_LENGTH=300 +--- +> ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 AVG_ROW_LENGTH=300 INSERT_METHOD=LAST UNION=(`mrg`.`t1`) +15c15 +< ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 AVG_ROW_LENGTH=30000000 +--- +> ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 AVG_ROW_LENGTH=30000000 INSERT_METHOD=LAST UNION=(`mrg`.`t1`) diff --git a/storage/myisammrg/mysql-test/storage_engine/tbl_opt_checksum.rdiff b/storage/myisammrg/mysql-test/storage_engine/tbl_opt_checksum.rdiff new file mode 100644 index 00000000000..ecb3fadb479 --- /dev/null +++ b/storage/myisammrg/mysql-test/storage_engine/tbl_opt_checksum.rdiff @@ -0,0 +1,8 @@ +8c8 +< ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 CHECKSUM=1 +--- +> ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 CHECKSUM=1 INSERT_METHOD=LAST UNION=(`mrg`.`t1`) +15c15 +< ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +--- +> ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 INSERT_METHOD=LAST UNION=(`mrg`.`t1`) diff --git a/storage/myisammrg/mysql-test/storage_engine/tbl_opt_connection.rdiff b/storage/myisammrg/mysql-test/storage_engine/tbl_opt_connection.rdiff new file mode 100644 index 00000000000..d3ebd87ad1e --- /dev/null +++ b/storage/myisammrg/mysql-test/storage_engine/tbl_opt_connection.rdiff @@ -0,0 +1,8 @@ +13c13 +< ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 CONNECTION='test_connection' +--- +> ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 INSERT_METHOD=LAST UNION=(`mrg`.`t1`) CONNECTION='test_connection' +20c20 +< ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 CONNECTION='test_connection2' +--- +> ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 INSERT_METHOD=LAST UNION=(`mrg`.`t1`) CONNECTION='test_connection2' diff --git a/storage/myisammrg/mysql-test/storage_engine/tbl_opt_data_index_dir.rdiff b/storage/myisammrg/mysql-test/storage_engine/tbl_opt_data_index_dir.rdiff new file mode 100644 index 00000000000..3c15e10d1f1 --- /dev/null +++ b/storage/myisammrg/mysql-test/storage_engine/tbl_opt_data_index_dir.rdiff @@ -0,0 +1,8 @@ +7c7 +< ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 DATA DIRECTORY='<DATA_DIR>' INDEX DIRECTORY='<INDEX_DIR>' +--- +> ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 INSERT_METHOD=LAST UNION=(`mrg`.`t1`) +15c15 +< ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 DATA DIRECTORY='<DATA_DIR>' INDEX DIRECTORY='<INDEX_DIR>' +--- +> ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 INSERT_METHOD=LAST UNION=(`mrg`.`t1`) diff --git a/storage/myisammrg/mysql-test/storage_engine/tbl_opt_delay_key_write.rdiff b/storage/myisammrg/mysql-test/storage_engine/tbl_opt_delay_key_write.rdiff new file mode 100644 index 00000000000..5723e425b4d --- /dev/null +++ b/storage/myisammrg/mysql-test/storage_engine/tbl_opt_delay_key_write.rdiff @@ -0,0 +1,8 @@ +8c8 +< ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 DELAY_KEY_WRITE=1 +--- +> ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 DELAY_KEY_WRITE=1 INSERT_METHOD=LAST UNION=(`mrg`.`t1`) +15c15 +< ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +--- +> ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 INSERT_METHOD=LAST UNION=(`mrg`.`t1`) diff --git a/storage/myisammrg/mysql-test/storage_engine/tbl_opt_insert_method.rdiff b/storage/myisammrg/mysql-test/storage_engine/tbl_opt_insert_method.rdiff new file mode 100644 index 00000000000..2ced7647483 --- /dev/null +++ b/storage/myisammrg/mysql-test/storage_engine/tbl_opt_insert_method.rdiff @@ -0,0 +1,8 @@ +8c8 +< ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 INSERT_METHOD=FIRST +--- +> ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 INSERT_METHOD=FIRST UNION=(`mrg`.`t1`) +15c15 +< ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +--- +> ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 UNION=(`mrg`.`t1`) diff --git a/storage/myisammrg/mysql-test/storage_engine/tbl_opt_key_block_size.rdiff b/storage/myisammrg/mysql-test/storage_engine/tbl_opt_key_block_size.rdiff new file mode 100644 index 00000000000..8378f04ebcb --- /dev/null +++ b/storage/myisammrg/mysql-test/storage_engine/tbl_opt_key_block_size.rdiff @@ -0,0 +1,8 @@ +8c8 +< ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=8 +--- +> ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=8 INSERT_METHOD=LAST UNION=(`mrg`.`t1`) +15c15 +< ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=1 +--- +> ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=1 INSERT_METHOD=LAST UNION=(`mrg`.`t1`) diff --git a/storage/myisammrg/mysql-test/storage_engine/tbl_opt_max_rows.rdiff b/storage/myisammrg/mysql-test/storage_engine/tbl_opt_max_rows.rdiff new file mode 100644 index 00000000000..f89147826c6 --- /dev/null +++ b/storage/myisammrg/mysql-test/storage_engine/tbl_opt_max_rows.rdiff @@ -0,0 +1,8 @@ +8c8 +< ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 MAX_ROWS=10000000 +--- +> ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 MAX_ROWS=10000000 INSERT_METHOD=LAST UNION=(`mrg`.`t1`) +15c15 +< ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 MAX_ROWS=30000000 +--- +> ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 MAX_ROWS=30000000 INSERT_METHOD=LAST UNION=(`mrg`.`t1`) diff --git a/storage/myisammrg/mysql-test/storage_engine/tbl_opt_min_rows.rdiff b/storage/myisammrg/mysql-test/storage_engine/tbl_opt_min_rows.rdiff new file mode 100644 index 00000000000..3ce28480dcf --- /dev/null +++ b/storage/myisammrg/mysql-test/storage_engine/tbl_opt_min_rows.rdiff @@ -0,0 +1,8 @@ +8c8 +< ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 MIN_ROWS=1 +--- +> ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 MIN_ROWS=1 INSERT_METHOD=LAST UNION=(`mrg`.`t1`) +15c15 +< ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 MIN_ROWS=10000 +--- +> ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 MIN_ROWS=10000 INSERT_METHOD=LAST UNION=(`mrg`.`t1`) diff --git a/storage/myisammrg/mysql-test/storage_engine/tbl_opt_pack_keys.rdiff b/storage/myisammrg/mysql-test/storage_engine/tbl_opt_pack_keys.rdiff new file mode 100644 index 00000000000..246c7397a96 --- /dev/null +++ b/storage/myisammrg/mysql-test/storage_engine/tbl_opt_pack_keys.rdiff @@ -0,0 +1,8 @@ +8c8 +< ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 PACK_KEYS=1 +--- +> ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 PACK_KEYS=1 INSERT_METHOD=LAST UNION=(`mrg`.`t1`) +15c15 +< ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 PACK_KEYS=0 +--- +> ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 PACK_KEYS=0 INSERT_METHOD=LAST UNION=(`mrg`.`t1`) diff --git a/storage/myisammrg/mysql-test/storage_engine/tbl_opt_password.rdiff b/storage/myisammrg/mysql-test/storage_engine/tbl_opt_password.rdiff new file mode 100644 index 00000000000..b1ef20c6f30 --- /dev/null +++ b/storage/myisammrg/mysql-test/storage_engine/tbl_opt_password.rdiff @@ -0,0 +1,8 @@ +8c8 +< ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +--- +> ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 INSERT_METHOD=LAST UNION=(`mrg`.`t1`) +15c15 +< ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +--- +> ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 INSERT_METHOD=LAST UNION=(`mrg`.`t1`) diff --git a/storage/myisammrg/mysql-test/storage_engine/tbl_opt_row_format.rdiff b/storage/myisammrg/mysql-test/storage_engine/tbl_opt_row_format.rdiff new file mode 100644 index 00000000000..9c72c7c06ba --- /dev/null +++ b/storage/myisammrg/mysql-test/storage_engine/tbl_opt_row_format.rdiff @@ -0,0 +1,8 @@ +8c8 +< ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 ROW_FORMAT=FIXED +--- +> ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 ROW_FORMAT=FIXED INSERT_METHOD=LAST UNION=(`mrg`.`t1`) +15c15 +< ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC +--- +> ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC INSERT_METHOD=LAST UNION=(`mrg`.`t1`) diff --git a/storage/myisammrg/mysql-test/storage_engine/tbl_opt_union.rdiff b/storage/myisammrg/mysql-test/storage_engine/tbl_opt_union.rdiff new file mode 100644 index 00000000000..f77753f4d6b --- /dev/null +++ b/storage/myisammrg/mysql-test/storage_engine/tbl_opt_union.rdiff @@ -0,0 +1,8 @@ +7c7 +< ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 UNION=(`child1`) +--- +> ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 INSERT_METHOD=LAST UNION=(`child1`) +13c13 +< ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 UNION=(`child1`,`child2`) +--- +> ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 INSERT_METHOD=LAST UNION=(`child1`,`child2`) diff --git a/storage/myisammrg/mysql-test/storage_engine/tbl_standard_opts.rdiff b/storage/myisammrg/mysql-test/storage_engine/tbl_standard_opts.rdiff new file mode 100644 index 00000000000..9b7ffc6af76 --- /dev/null +++ b/storage/myisammrg/mysql-test/storage_engine/tbl_standard_opts.rdiff @@ -0,0 +1,8 @@ +11c11 +< ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=utf8 COMMENT='standard table options' +--- +> ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=utf8 INSERT_METHOD=LAST UNION=(`mrg`.`t1`) COMMENT='standard table options' +18c18 +< ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=utf8 COMMENT='table altered' +--- +> ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=utf8 INSERT_METHOD=LAST UNION=(`mrg`.`t1`) COMMENT='table altered' diff --git a/storage/myisammrg/mysql-test/storage_engine/tbl_temporary.rdiff b/storage/myisammrg/mysql-test/storage_engine/tbl_temporary.rdiff new file mode 100644 index 00000000000..45a229c98eb --- /dev/null +++ b/storage/myisammrg/mysql-test/storage_engine/tbl_temporary.rdiff @@ -0,0 +1,4 @@ +9c9 +< ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 +--- +> ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 INSERT_METHOD=LAST UNION=(`mrg`.`t1`) diff --git a/storage/myisammrg/mysql-test/storage_engine/truncate_table.rdiff b/storage/myisammrg/mysql-test/storage_engine/truncate_table.rdiff new file mode 100644 index 00000000000..3a89f730540 --- /dev/null +++ b/storage/myisammrg/mysql-test/storage_engine/truncate_table.rdiff @@ -0,0 +1,35 @@ +12c12 +< t1 # # # # # # # # # 1 # # # # # # # +--- +> t1 # # # # # # # # # 0 # # # # # # # +16c16 +< t1 # # # # # # # # # 4 # # # # # # # +--- +> t1 # # # # # # # # # 0 # # # # # # # +20c20 +< t1 # # # # # # # # # 1 # # # # # # # +--- +> t1 # # # # # # # # # 0 # # # # # # # +24c24 +< t1 # # # # # # # # # 2 # # # # # # # +--- +> t1 # # # # # # # # # 0 # # # # # # # +32,40c32,39 +< HANDLER h1 READ FIRST; +< a b +< 1 a +< TRUNCATE TABLE t1; +< HANDLER h1 READ NEXT; +< ERROR 42S02: Unknown table 'h1' in HANDLER +< HANDLER t1 OPEN AS h2; +< HANDLER h2 READ FIRST; +< a b +--- +> ERROR HY000: Table storage engine for 'h1' doesn't have this option +> # ------------ UNEXPECTED RESULT ------------ +> # The statement|command finished with ER_ILLEGAL_HA. +> # HANDLER or the syntax or the mix could be unsupported. +> # You can change the engine code, or create an rdiff, or disable the test by adding it to disabled.def. +> # Further in this test, the message might sometimes be suppressed; a part of the test might be skipped. +> # Also, this problem may cause a chain effect (more errors of different kinds in the test). +> # ------------------------------------------- diff --git a/storage/myisammrg/mysql-test/storage_engine/trx/cons_snapshot_repeatable_read.rdiff b/storage/myisammrg/mysql-test/storage_engine/trx/cons_snapshot_repeatable_read.rdiff new file mode 100644 index 00000000000..018b28bd24c --- /dev/null +++ b/storage/myisammrg/mysql-test/storage_engine/trx/cons_snapshot_repeatable_read.rdiff @@ -0,0 +1,9 @@ +0a1,6 +> # -- WARNING ---------------------------------------------------------------- +> # According to I_S.ENGINES, MRG_MYISAM does not support transactions. +> # If it is true, the test will most likely fail; you can +> # either create an rdiff file, or add the test to disabled.def. +> # If transactions should be supported, check the data in Information Schema. +> # --------------------------------------------------------------------------- +13a20 +> 1 diff --git a/storage/myisammrg/mysql-test/storage_engine/trx/cons_snapshot_serializable.rdiff b/storage/myisammrg/mysql-test/storage_engine/trx/cons_snapshot_serializable.rdiff new file mode 100644 index 00000000000..018b28bd24c --- /dev/null +++ b/storage/myisammrg/mysql-test/storage_engine/trx/cons_snapshot_serializable.rdiff @@ -0,0 +1,9 @@ +0a1,6 +> # -- WARNING ---------------------------------------------------------------- +> # According to I_S.ENGINES, MRG_MYISAM does not support transactions. +> # If it is true, the test will most likely fail; you can +> # either create an rdiff file, or add the test to disabled.def. +> # If transactions should be supported, check the data in Information Schema. +> # --------------------------------------------------------------------------- +13a20 +> 1 diff --git a/storage/myisammrg/mysql-test/storage_engine/trx/delete.rdiff b/storage/myisammrg/mysql-test/storage_engine/trx/delete.rdiff new file mode 100644 index 00000000000..45a3e5fb52d --- /dev/null +++ b/storage/myisammrg/mysql-test/storage_engine/trx/delete.rdiff @@ -0,0 +1,34 @@ +0a1,12 +> # -- WARNING ---------------------------------------------------------------- +> # According to I_S.ENGINES, MRG_MYISAM does not support transactions. +> # If it is true, the test will most likely fail; you can +> # either create an rdiff file, or add the test to disabled.def. +> # If transactions should be supported, check the data in Information Schema. +> # --------------------------------------------------------------------------- +> # -- WARNING ---------------------------------------------------------------- +> # According to I_S.ENGINES, MRG_MYISAM does not support savepoints. +> # If it is true, the test will most likely fail; you can +> # either create an rdiff file (recommended), or add the test to disabled.def. +> # If savepoints should be supported, check the data in Information Schema. +> # --------------------------------------------------------------------------- +48a61,62 +> Warnings: +> Warning 1196 Some non-transactional changed tables couldn't be rolled back +51,64d64 +< 10000 foobar +< 10000 foobar +< 2 b +< 2 b +< 4 d +< 4 d +< 5 e +< 5 e +< 6 f +< 6 f +< 7 g +< 7 g +< 8 h +< 8 h +70a71,72 +> Warnings: +> Warning 1196 Some non-transactional changed tables couldn't be rolled back diff --git a/storage/myisammrg/mysql-test/storage_engine/trx/insert.rdiff b/storage/myisammrg/mysql-test/storage_engine/trx/insert.rdiff new file mode 100644 index 00000000000..69981f90e13 --- /dev/null +++ b/storage/myisammrg/mysql-test/storage_engine/trx/insert.rdiff @@ -0,0 +1,32 @@ +0a1,12 +> # -- WARNING ---------------------------------------------------------------- +> # According to I_S.ENGINES, MRG_MYISAM does not support transactions. +> # If it is true, the test will most likely fail; you can +> # either create an rdiff file, or add the test to disabled.def. +> # If transactions should be supported, check the data in Information Schema. +> # --------------------------------------------------------------------------- +> # -- WARNING ---------------------------------------------------------------- +> # According to I_S.ENGINES, MRG_MYISAM does not support savepoints. +> # If it is true, the test will most likely fail; you can +> # either create an rdiff file (recommended), or add the test to disabled.def. +> # If savepoints should be supported, check the data in Information Schema. +> # --------------------------------------------------------------------------- +23a36,37 +> Warnings: +> Warning 1196 Some non-transactional changed tables couldn't be rolled back +25a40 +> 0 test +33a49,50 +> NULL NULL +> NULL NULL +39a57,58 +> Warnings: +> Warning 1196 Some non-transactional changed tables couldn't be rolled back +43a63 +> 0 test +49a70 +> 11 f +54a76,78 +> NULL NULL +> NULL NULL +> NULL NULL diff --git a/storage/myisammrg/mysql-test/storage_engine/trx/level_read_committed.rdiff b/storage/myisammrg/mysql-test/storage_engine/trx/level_read_committed.rdiff new file mode 100644 index 00000000000..0837c74f5ff --- /dev/null +++ b/storage/myisammrg/mysql-test/storage_engine/trx/level_read_committed.rdiff @@ -0,0 +1,44 @@ +0a1,6 +> # -- WARNING ---------------------------------------------------------------- +> # According to I_S.ENGINES, MRG_MYISAM does not support transactions. +> # If it is true, the test will most likely fail; you can +> # either create an rdiff file, or add the test to disabled.def. +> # If transactions should be supported, check the data in Information Schema. +> # --------------------------------------------------------------------------- +18a25 +> 1 +25a33,34 +> 1 +> 2 +30a40,43 +> 1 +> 101 +> 102 +> 2 +34a48,49 +> 101 +> 102 +39a55,56 +> 101 +> 102 +44a62,63 +> 101 +> 102 +51a71,72 +> 101 +> 102 +54a76,77 +> 301 +> 302 +58a82,83 +> 101 +> 102 +61a87,88 +> 301 +> 302 +65a93,94 +> 101 +> 102 +68a98,99 +> 301 +> 302 diff --git a/storage/myisammrg/mysql-test/storage_engine/trx/level_read_uncommitted.rdiff b/storage/myisammrg/mysql-test/storage_engine/trx/level_read_uncommitted.rdiff new file mode 100644 index 00000000000..bd9569267e5 --- /dev/null +++ b/storage/myisammrg/mysql-test/storage_engine/trx/level_read_uncommitted.rdiff @@ -0,0 +1,7 @@ +0a1,6 +> # -- WARNING ---------------------------------------------------------------- +> # According to I_S.ENGINES, MRG_MYISAM does not support transactions. +> # If it is true, the test will most likely fail; you can +> # either create an rdiff file, or add the test to disabled.def. +> # If transactions should be supported, check the data in Information Schema. +> # --------------------------------------------------------------------------- diff --git a/storage/myisammrg/mysql-test/storage_engine/trx/level_repeatable_read.rdiff b/storage/myisammrg/mysql-test/storage_engine/trx/level_repeatable_read.rdiff new file mode 100644 index 00000000000..82f7c5c5ba6 --- /dev/null +++ b/storage/myisammrg/mysql-test/storage_engine/trx/level_repeatable_read.rdiff @@ -0,0 +1,53 @@ +0a1,6 +> # -- WARNING ---------------------------------------------------------------- +> # According to I_S.ENGINES, MRG_MYISAM does not support transactions. +> # If it is true, the test will most likely fail; you can +> # either create an rdiff file, or add the test to disabled.def. +> # If transactions should be supported, check the data in Information Schema. +> # --------------------------------------------------------------------------- +18a25 +> 1 +25a33,34 +> 1 +> 2 +27,28c36 +< ERROR HY000: Lock wait timeout exceeded; try restarting transaction +< # WARNING: Statement ended with errno 1205, errname 'ER_LOCK_WAIT_TIMEOUT'. +--- +> # WARNING: Statement ended with errno 0, errname ''. +31a40,43 +> 1 +> 101 +> 102 +> 2 +35a48,49 +> 101 +> 102 +40a55,56 +> 101 +> 102 +44a61,64 +> 1 +> 101 +> 102 +> 2 +49a70,73 +> 1 +> 101 +> 102 +> 2 +51a76,77 +> 301 +> 302 +55a82,83 +> 101 +> 102 +58a87,88 +> 301 +> 302 +62a93,94 +> 101 +> 102 +65a98,99 +> 301 +> 302 diff --git a/storage/myisammrg/mysql-test/storage_engine/trx/level_serializable.rdiff b/storage/myisammrg/mysql-test/storage_engine/trx/level_serializable.rdiff new file mode 100644 index 00000000000..3924b3784a9 --- /dev/null +++ b/storage/myisammrg/mysql-test/storage_engine/trx/level_serializable.rdiff @@ -0,0 +1,69 @@ +0a1,6 +> # -- WARNING ---------------------------------------------------------------- +> # According to I_S.ENGINES, MRG_MYISAM does not support transactions. +> # If it is true, the test will most likely fail; you can +> # either create an rdiff file, or add the test to disabled.def. +> # If transactions should be supported, check the data in Information Schema. +> # --------------------------------------------------------------------------- +14,15c20 +< ERROR HY000: Lock wait timeout exceeded; try restarting transaction +< # WARNING: Statement ended with errno 1205, errname 'ER_LOCK_WAIT_TIMEOUT'. +--- +> # WARNING: Statement ended with errno 0, errname ''. +19a25 +> 1 +22,23c28 +< ERROR HY000: Lock wait timeout exceeded; try restarting transaction +< # WARNING: Statement ended with errno 1205, errname 'ER_LOCK_WAIT_TIMEOUT'. +--- +> # WARNING: Statement ended with errno 0, errname ''. +27a33,34 +> 1 +> 2 +32a40,43 +> 1 +> 101 +> 102 +> 2 +35a47,50 +> 1 +> 101 +> 102 +> 2 +38a54,57 +> 1 +> 101 +> 102 +> 2 +41a61,64 +> 1 +> 101 +> 102 +> 2 +46a70,77 +> 1 +> 101 +> 102 +> 2 +> 201 +> 202 +> 301 +> 302 +49a81,88 +> 1 +> 101 +> 102 +> 2 +> 201 +> 202 +> 301 +> 302 +52a92,99 +> 1 +> 101 +> 102 +> 2 +> 201 +> 202 +> 301 +> 302 diff --git a/storage/myisammrg/mysql-test/storage_engine/trx/select_for_update.rdiff b/storage/myisammrg/mysql-test/storage_engine/trx/select_for_update.rdiff new file mode 100644 index 00000000000..f8ffe67586d --- /dev/null +++ b/storage/myisammrg/mysql-test/storage_engine/trx/select_for_update.rdiff @@ -0,0 +1,40 @@ +0a1,6 +> # -- WARNING ---------------------------------------------------------------- +> # According to I_S.ENGINES, MRG_MYISAM does not support transactions. +> # If it is true, the test will most likely fail; you can +> # either create an rdiff file, or add the test to disabled.def. +> # If transactions should be supported, check the data in Information Schema. +> # --------------------------------------------------------------------------- +17c23,33 +< ERROR HY000: Lock wait timeout exceeded; try restarting transaction +--- +> a b +> 1 a +> 3 a +> # ERROR: Statement succeeded (expected results: ER_LOCK_WAIT_TIMEOUT) +> # ------------ UNEXPECTED RESULT ------------ +> # The statement|command succeeded unexpectedly. +> # SELECT .. FOR UPDATE or LOCK IN SHARE MODE or the mix could be unsupported|malfunctioning, or the problem was caused by previous errors. +> # You can change the engine code, or create an rdiff, or disable the test by adding it to disabled.def. +> # Further in this test, the message might sometimes be suppressed; a part of the test might be skipped. +> # Also, this problem may cause a chain effect (more errors of different kinds in the test). +> # ------------------------------------------- +19c35,42 +< ERROR HY000: Lock wait timeout exceeded; try restarting transaction +--- +> # ERROR: Statement succeeded (expected results: ER_LOCK_WAIT_TIMEOUT) +> # ------------ UNEXPECTED RESULT ------------ +> # The statement|command succeeded unexpectedly. +> # UPDATE or SELECT .. FOR UPDATE or the mix could be unsupported|malfunctioning, or the problem was caused by previous errors. +> # You can change the engine code, or create an rdiff, or disable the test by adding it to disabled.def. +> # Further in this test, the message might sometimes be suppressed; a part of the test might be skipped. +> # Also, this problem may cause a chain effect (more errors of different kinds in the test). +> # ------------------------------------------- +24c47 +< 1 a +--- +> 1 c +26c49 +< 3 a +--- +> 3 c diff --git a/storage/myisammrg/mysql-test/storage_engine/trx/select_lock_in_share_mode.rdiff b/storage/myisammrg/mysql-test/storage_engine/trx/select_lock_in_share_mode.rdiff new file mode 100644 index 00000000000..e316993830a --- /dev/null +++ b/storage/myisammrg/mysql-test/storage_engine/trx/select_lock_in_share_mode.rdiff @@ -0,0 +1,26 @@ +0a1,6 +> # -- WARNING ---------------------------------------------------------------- +> # According to I_S.ENGINES, MRG_MYISAM does not support transactions. +> # If it is true, the test will most likely fail; you can +> # either create an rdiff file, or add the test to disabled.def. +> # If transactions should be supported, check the data in Information Schema. +> # --------------------------------------------------------------------------- +21c27,34 +< ERROR HY000: Lock wait timeout exceeded; try restarting transaction +--- +> # ERROR: Statement succeeded (expected results: ER_LOCK_WAIT_TIMEOUT) +> # ------------ UNEXPECTED RESULT ------------ +> # The statement|command succeeded unexpectedly. +> # LOCK IN SHARE MODE or UPDATE or the mix could be unsupported|malfunctioning, or the problem was caused by previous errors. +> # You can change the engine code, or create an rdiff, or disable the test by adding it to disabled.def. +> # Further in this test, the message might sometimes be suppressed; a part of the test might be skipped. +> # Also, this problem may cause a chain effect (more errors of different kinds in the test). +> # ------------------------------------------- +26c39 +< 1 a +--- +> 1 c +28c41 +< 3 a +--- +> 3 c diff --git a/storage/myisammrg/mysql-test/storage_engine/trx/update.rdiff b/storage/myisammrg/mysql-test/storage_engine/trx/update.rdiff new file mode 100644 index 00000000000..7ad463053eb --- /dev/null +++ b/storage/myisammrg/mysql-test/storage_engine/trx/update.rdiff @@ -0,0 +1,41 @@ +0a1,12 +> # -- WARNING ---------------------------------------------------------------- +> # According to I_S.ENGINES, MRG_MYISAM does not support transactions. +> # If it is true, the test will most likely fail; you can +> # either create an rdiff file, or add the test to disabled.def. +> # If transactions should be supported, check the data in Information Schema. +> # --------------------------------------------------------------------------- +> # -- WARNING ---------------------------------------------------------------- +> # According to I_S.ENGINES, MRG_MYISAM does not support savepoints. +> # If it is true, the test will most likely fail; you can +> # either create an rdiff file (recommended), or add the test to disabled.def. +> # If savepoints should be supported, check the data in Information Schema. +> # --------------------------------------------------------------------------- +26a39,40 +> Warnings: +> Warning 1196 Some non-transactional changed tables couldn't be rolled back +31a46,47 +> Warnings: +> Warning 1196 Some non-transactional changed tables couldn't be rolled back +38,47c54,63 +< 51 update2 +< 51 update2 +< 52 update2 +< 52 update2 +< 53 update2 +< 53 update2 +< 54 update2 +< 54 update2 +< 55 update2 +< 55 update2 +--- +> 51 +> 51 +> 52 +> 52 +> 53 +> 53 +> 54 +> 54 +> 55 +> 55 diff --git a/storage/myisammrg/mysql-test/storage_engine/trx/xa.rdiff b/storage/myisammrg/mysql-test/storage_engine/trx/xa.rdiff new file mode 100644 index 00000000000..ee7c2a984be --- /dev/null +++ b/storage/myisammrg/mysql-test/storage_engine/trx/xa.rdiff @@ -0,0 +1,34 @@ +0a1,6 +> # -- WARNING ---------------------------------------------------------------- +> # According to I_S.ENGINES, MRG_MYISAM does not support XA. +> # If it is true, the test will most likely fail; you can +> # either create an rdiff file, or add the test to disabled.def. +> # If XA should be supported, check the data in Information Schema. +> # --------------------------------------------------------------------------- +11a18 +> 1 +17a25,26 +> 1 +> 2 +22a32,33 +> 1 +> 2 +40a52 +> 3 +48a61,62 +> 3 +> 4 +67a82 +> 5 +77a93,94 +> 5 +> 6 +86a104,105 +> 5 +> 6 +88a108,109 +> Warnings: +> Warning 1196 Some non-transactional changed tables couldn't be rolled back +95a117,118 +> 5 +> 6 diff --git a/storage/myisammrg/mysql-test/storage_engine/trx/xa_recovery.rdiff b/storage/myisammrg/mysql-test/storage_engine/trx/xa_recovery.rdiff new file mode 100644 index 00000000000..362e3a8914a --- /dev/null +++ b/storage/myisammrg/mysql-test/storage_engine/trx/xa_recovery.rdiff @@ -0,0 +1,22 @@ +0a1,6 +> # -- WARNING ---------------------------------------------------------------- +> # According to I_S.ENGINES, MRG_MYISAM does not support XA. +> # If it is true, the test will most likely fail; you can +> # either create an rdiff file, or add the test to disabled.def. +> # If XA should be supported, check the data in Information Schema. +> # --------------------------------------------------------------------------- +21,22d26 +< 1 3 0 xa1 +< 1 3 0 xa2 +23a28 +> ERROR XAE04: XAER_NOTA: Unknown XID +24a30 +> ERROR XAE04: XAER_NOTA: Unknown XID +26a33,34 +> 1 +> 2 +28a37,40 +> Warnings: +> Error 145 Table './mrg/t1' is marked as crashed and should be repaired +> Error 1194 Table 't1' is marked as crashed and should be repaired +> Error 1034 1 client is using or hasn't closed the table properly diff --git a/storage/myisammrg/mysql-test/storage_engine/type_char_indexes.rdiff b/storage/myisammrg/mysql-test/storage_engine/type_char_indexes.rdiff new file mode 100644 index 00000000000..a0a418e0bcc --- /dev/null +++ b/storage/myisammrg/mysql-test/storage_engine/type_char_indexes.rdiff @@ -0,0 +1,8 @@ +101c101 +< # # # range c_v c_v # # # Using index condition +--- +> # # # ALL c_v NULL # # # Using where +138c138 +< # # # range # v16 # # # # +--- +> # # # ALL # NULL # # # # diff --git a/storage/myisammrg/mysql-test/storage_engine/type_float_indexes.rdiff b/storage/myisammrg/mysql-test/storage_engine/type_float_indexes.rdiff new file mode 100644 index 00000000000..640e1050a99 --- /dev/null +++ b/storage/myisammrg/mysql-test/storage_engine/type_float_indexes.rdiff @@ -0,0 +1,4 @@ +63c63 +< # # # # # d # # # # +--- +> # # # # # NULL # # # # diff --git a/storage/myisammrg/mysql-test/storage_engine/type_spatial.rdiff b/storage/myisammrg/mysql-test/storage_engine/type_spatial.rdiff new file mode 100644 index 00000000000..a4d7d4390b8 --- /dev/null +++ b/storage/myisammrg/mysql-test/storage_engine/type_spatial.rdiff @@ -0,0 +1,706 @@ +5,698c5,14 +< CREATE TABLE gis_line (fid <INT_COLUMN>, g LINESTRING) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +< CREATE TABLE gis_polygon (fid <INT_COLUMN>, g POLYGON) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +< CREATE TABLE gis_multi_point (fid <INT_COLUMN>, g MULTIPOINT) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +< CREATE TABLE gis_multi_line (fid <INT_COLUMN>, g MULTILINESTRING) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +< CREATE TABLE gis_multi_polygon (fid <INT_COLUMN>, g MULTIPOLYGON) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +< CREATE TABLE gis_geometrycollection (fid <INT_COLUMN>, g GEOMETRYCOLLECTION) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +< CREATE TABLE gis_geometry (fid <INT_COLUMN>, g GEOMETRY) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +< USE gis_ogs; +< CREATE TABLE lakes (fid INT <CUSTOM_COL_OPTIONS>, +< name CHAR(64) <CUSTOM_COL_OPTIONS>, +< shore POLYGON) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +< CREATE TABLE road_segments (fid INT <CUSTOM_COL_OPTIONS>, +< name CHAR(64) <CUSTOM_COL_OPTIONS>, +< aliases CHAR(64) <CUSTOM_COL_OPTIONS>, +< num_lanes INT <CUSTOM_COL_OPTIONS>, +< centerline LINESTRING) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +< CREATE TABLE divided_routes (fid INT <CUSTOM_COL_OPTIONS>, +< name CHAR(64) <CUSTOM_COL_OPTIONS>, +< num_lanes INT <CUSTOM_COL_OPTIONS>, +< centerlines MULTILINESTRING) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +< CREATE TABLE forests (fid INT <CUSTOM_COL_OPTIONS>, +< name CHAR(64) <CUSTOM_COL_OPTIONS>, +< boundary MULTIPOLYGON) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +< CREATE TABLE bridges (fid INT <CUSTOM_COL_OPTIONS>, +< name CHAR(64) <CUSTOM_COL_OPTIONS>, +< position POINT) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +< CREATE TABLE streams (fid INT <CUSTOM_COL_OPTIONS>, +< name CHAR(64) <CUSTOM_COL_OPTIONS>, +< centerline LINESTRING) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +< CREATE TABLE buildings (fid INT <CUSTOM_COL_OPTIONS>, +< name CHAR(64) <CUSTOM_COL_OPTIONS>, +< position POINT, +< footprint POLYGON) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +< CREATE TABLE ponds (fid INT <CUSTOM_COL_OPTIONS>, +< name CHAR(64) <CUSTOM_COL_OPTIONS>, +< type CHAR(64) <CUSTOM_COL_OPTIONS>, +< shores MULTIPOLYGON) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +< CREATE TABLE named_places (fid INT <CUSTOM_COL_OPTIONS>, +< name CHAR(64) <CUSTOM_COL_OPTIONS>, +< boundary POLYGON) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +< CREATE TABLE map_neatlines (fid INT <CUSTOM_COL_OPTIONS>, +< neatline POLYGON) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +< USE test; +< SHOW FIELDS FROM gis_point; +< Field Type Null Key Default Extra +< fid int(11) YES NULL +< g point YES NULL +< SHOW FIELDS FROM gis_line; +< Field Type Null Key Default Extra +< fid int(11) YES NULL +< g linestring YES NULL +< SHOW FIELDS FROM gis_polygon; +< Field Type Null Key Default Extra +< fid int(11) YES NULL +< g polygon YES NULL +< SHOW FIELDS FROM gis_multi_point; +< Field Type Null Key Default Extra +< fid int(11) YES NULL +< g multipoint YES NULL +< SHOW FIELDS FROM gis_multi_line; +< Field Type Null Key Default Extra +< fid int(11) YES NULL +< g multilinestring YES NULL +< SHOW FIELDS FROM gis_multi_polygon; +< Field Type Null Key Default Extra +< fid int(11) YES NULL +< g multipolygon YES NULL +< SHOW FIELDS FROM gis_geometrycollection; +< Field Type Null Key Default Extra +< fid int(11) YES NULL +< g geometrycollection YES NULL +< SHOW FIELDS FROM gis_geometry; +< Field Type Null Key Default Extra +< fid int(11) YES NULL +< g geometry YES NULL +< INSERT INTO gis_point VALUES +< (101, PointFromText('POINT(10 10)')), +< (102, PointFromText('POINT(20 10)')), +< (103, PointFromText('POINT(20 20)')), +< (104, PointFromWKB(AsWKB(PointFromText('POINT(10 20)')))); +< INSERT INTO gis_line VALUES +< (105, LineFromText('LINESTRING(0 0,0 10,10 0)')), +< (106, LineStringFromText('LINESTRING(10 10,20 10,20 20,10 20,10 10)')), +< (107, LineStringFromWKB(AsWKB(LineString(Point(10, 10), Point(40, 10))))); +< INSERT INTO gis_polygon VALUES +< (108, PolygonFromText('POLYGON((10 10,20 10,20 20,10 20,10 10))')), +< (109, PolyFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))')), +< (110, PolyFromWKB(AsWKB(Polygon(LineString(Point(0, 0), Point(30, 0), Point(30, 30), Point(0, 0)))))); +< INSERT INTO gis_multi_point VALUES +< (111, MultiPointFromText('MULTIPOINT(0 0,10 10,10 20,20 20)')), +< (112, MPointFromText('MULTIPOINT(1 1,11 11,11 21,21 21)')), +< (113, MPointFromWKB(AsWKB(MultiPoint(Point(3, 6), Point(4, 10))))); +< INSERT INTO gis_multi_line VALUES +< (114, MultiLineStringFromText('MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48))')), +< (115, MLineFromText('MULTILINESTRING((10 48,10 21,10 0))')), +< (116, MLineFromWKB(AsWKB(MultiLineString(LineString(Point(1, 2), Point(3, 5)), LineString(Point(2, 5), Point(5, 8), Point(21, 7)))))); +< INSERT INTO gis_multi_polygon VALUES +< (117, MultiPolygonFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')), +< (118, MPolyFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')), +< (119, MPolyFromWKB(AsWKB(MultiPolygon(Polygon(LineString(Point(0, 3), Point(3, 3), Point(3, 0), Point(0, 3))))))); +< INSERT INTO gis_geometrycollection VALUES +< (120, GeomCollFromText('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(0 0,10 10))')), +< (121, GeometryFromWKB(AsWKB(GeometryCollection(Point(44, 6), LineString(Point(3, 6), Point(7, 9)))))), +< (122, GeomFromText('GeometryCollection()')), +< (123, GeomFromText('GeometryCollection EMPTY')); +< INSERT into gis_geometry SELECT * FROM gis_point; +< INSERT into gis_geometry SELECT * FROM gis_line; +< INSERT into gis_geometry SELECT * FROM gis_polygon; +< INSERT into gis_geometry SELECT * FROM gis_multi_point; +< INSERT into gis_geometry SELECT * FROM gis_multi_line; +< INSERT into gis_geometry SELECT * FROM gis_multi_polygon; +< INSERT into gis_geometry SELECT * FROM gis_geometrycollection; +< SELECT fid, AsText(g) FROM gis_point; +< fid AsText(g) +< 101 POINT(10 10) +< 102 POINT(20 10) +< 103 POINT(20 20) +< 104 POINT(10 20) +< SELECT fid, AsText(g) FROM gis_line; +< fid AsText(g) +< 105 LINESTRING(0 0,0 10,10 0) +< 106 LINESTRING(10 10,20 10,20 20,10 20,10 10) +< 107 LINESTRING(10 10,40 10) +< SELECT fid, AsText(g) FROM gis_polygon; +< fid AsText(g) +< 108 POLYGON((10 10,20 10,20 20,10 20,10 10)) +< 109 POLYGON((0 0,50 0,50 50,0 50,0 0),(10 10,20 10,20 20,10 20,10 10)) +< 110 POLYGON((0 0,30 0,30 30,0 0)) +< SELECT fid, AsText(g) FROM gis_multi_point; +< fid AsText(g) +< 111 MULTIPOINT(0 0,10 10,10 20,20 20) +< 112 MULTIPOINT(1 1,11 11,11 21,21 21) +< 113 MULTIPOINT(3 6,4 10) +< SELECT fid, AsText(g) FROM gis_multi_line; +< fid AsText(g) +< 114 MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48)) +< 115 MULTILINESTRING((10 48,10 21,10 0)) +< 116 MULTILINESTRING((1 2,3 5),(2 5,5 8,21 7)) +< SELECT fid, AsText(g) FROM gis_multi_polygon; +< fid AsText(g) +< 117 MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18))) +< 118 MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18))) +< 119 MULTIPOLYGON(((0 3,3 3,3 0,0 3))) +< SELECT fid, AsText(g) FROM gis_geometrycollection; +< fid AsText(g) +< 120 GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(0 0,10 10)) +< 121 GEOMETRYCOLLECTION(POINT(44 6),LINESTRING(3 6,7 9)) +< 122 GEOMETRYCOLLECTION EMPTY +< 123 GEOMETRYCOLLECTION EMPTY +< SELECT fid, AsText(g) FROM gis_geometry; +< fid AsText(g) +< 101 POINT(10 10) +< 102 POINT(20 10) +< 103 POINT(20 20) +< 104 POINT(10 20) +< 105 LINESTRING(0 0,0 10,10 0) +< 106 LINESTRING(10 10,20 10,20 20,10 20,10 10) +< 107 LINESTRING(10 10,40 10) +< 108 POLYGON((10 10,20 10,20 20,10 20,10 10)) +< 109 POLYGON((0 0,50 0,50 50,0 50,0 0),(10 10,20 10,20 20,10 20,10 10)) +< 110 POLYGON((0 0,30 0,30 30,0 0)) +< 111 MULTIPOINT(0 0,10 10,10 20,20 20) +< 112 MULTIPOINT(1 1,11 11,11 21,21 21) +< 113 MULTIPOINT(3 6,4 10) +< 114 MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48)) +< 115 MULTILINESTRING((10 48,10 21,10 0)) +< 116 MULTILINESTRING((1 2,3 5),(2 5,5 8,21 7)) +< 117 MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18))) +< 118 MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18))) +< 119 MULTIPOLYGON(((0 3,3 3,3 0,0 3))) +< 120 GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(0 0,10 10)) +< 121 GEOMETRYCOLLECTION(POINT(44 6),LINESTRING(3 6,7 9)) +< 122 GEOMETRYCOLLECTION EMPTY +< 123 GEOMETRYCOLLECTION EMPTY +< SELECT fid, Dimension(g) FROM gis_geometry; +< fid Dimension(g) +< 101 0 +< 102 0 +< 103 0 +< 104 0 +< 105 1 +< 106 1 +< 107 1 +< 108 2 +< 109 2 +< 110 2 +< 111 0 +< 112 0 +< 113 0 +< 114 1 +< 115 1 +< 116 1 +< 117 2 +< 118 2 +< 119 2 +< 120 1 +< 121 1 +< 122 0 +< 123 0 +< SELECT fid, GeometryType(g) FROM gis_geometry; +< fid GeometryType(g) +< 101 POINT +< 102 POINT +< 103 POINT +< 104 POINT +< 105 LINESTRING +< 106 LINESTRING +< 107 LINESTRING +< 108 POLYGON +< 109 POLYGON +< 110 POLYGON +< 111 MULTIPOINT +< 112 MULTIPOINT +< 113 MULTIPOINT +< 114 MULTILINESTRING +< 115 MULTILINESTRING +< 116 MULTILINESTRING +< 117 MULTIPOLYGON +< 118 MULTIPOLYGON +< 119 MULTIPOLYGON +< 120 GEOMETRYCOLLECTION +< 121 GEOMETRYCOLLECTION +< 122 GEOMETRYCOLLECTION +< 123 GEOMETRYCOLLECTION +< SELECT fid, IsEmpty(g) FROM gis_geometry; +< fid IsEmpty(g) +< 101 0 +< 102 0 +< 103 0 +< 104 0 +< 105 0 +< 106 0 +< 107 0 +< 108 0 +< 109 0 +< 110 0 +< 111 0 +< 112 0 +< 113 0 +< 114 0 +< 115 0 +< 116 0 +< 117 0 +< 118 0 +< 119 0 +< 120 0 +< 121 0 +< 122 0 +< 123 0 +< SELECT fid, AsText(Envelope(g)) FROM gis_geometry; +< fid AsText(Envelope(g)) +< 101 POLYGON((10 10,10 10,10 10,10 10,10 10)) +< 102 POLYGON((20 10,20 10,20 10,20 10,20 10)) +< 103 POLYGON((20 20,20 20,20 20,20 20,20 20)) +< 104 POLYGON((10 20,10 20,10 20,10 20,10 20)) +< 105 POLYGON((0 0,10 0,10 10,0 10,0 0)) +< 106 POLYGON((10 10,20 10,20 20,10 20,10 10)) +< 107 POLYGON((10 10,40 10,40 10,10 10,10 10)) +< 108 POLYGON((10 10,20 10,20 20,10 20,10 10)) +< 109 POLYGON((0 0,50 0,50 50,0 50,0 0)) +< 110 POLYGON((0 0,30 0,30 30,0 30,0 0)) +< 111 POLYGON((0 0,20 0,20 20,0 20,0 0)) +< 112 POLYGON((1 1,21 1,21 21,1 21,1 1)) +< 113 POLYGON((3 6,4 6,4 10,3 10,3 6)) +< 114 POLYGON((10 0,16 0,16 48,10 48,10 0)) +< 115 POLYGON((10 0,10 0,10 48,10 48,10 0)) +< 116 POLYGON((1 2,21 2,21 8,1 8,1 2)) +< 117 POLYGON((28 0,84 0,84 42,28 42,28 0)) +< 118 POLYGON((28 0,84 0,84 42,28 42,28 0)) +< 119 POLYGON((0 0,3 0,3 3,0 3,0 0)) +< 120 POLYGON((0 0,10 0,10 10,0 10,0 0)) +< 121 POLYGON((3 6,44 6,44 9,3 9,3 6)) +< 122 GEOMETRYCOLLECTION EMPTY +< 123 GEOMETRYCOLLECTION EMPTY +< SELECT fid, X(g) FROM gis_point; +< fid X(g) +< 101 10 +< 102 20 +< 103 20 +< 104 10 +< SELECT fid, Y(g) FROM gis_point; +< fid Y(g) +< 101 10 +< 102 10 +< 103 20 +< 104 20 +< SELECT fid, AsText(StartPoint(g)) FROM gis_line; +< fid AsText(StartPoint(g)) +< 105 POINT(0 0) +< 106 POINT(10 10) +< 107 POINT(10 10) +< SELECT fid, AsText(EndPoint(g)) FROM gis_line; +< fid AsText(EndPoint(g)) +< 105 POINT(10 0) +< 106 POINT(10 10) +< 107 POINT(40 10) +< SELECT fid, GLength(g) FROM gis_line; +< fid GLength(g) +< 105 24.14213562373095 +< 106 40 +< 107 30 +< SELECT fid, NumPoints(g) FROM gis_line; +< fid NumPoints(g) +< 105 3 +< 106 5 +< 107 2 +< SELECT fid, AsText(PointN(g, 2)) FROM gis_line; +< fid AsText(PointN(g, 2)) +< 105 POINT(0 10) +< 106 POINT(20 10) +< 107 POINT(40 10) +< SELECT fid, IsClosed(g) FROM gis_line; +< fid IsClosed(g) +< 105 0 +< 106 1 +< 107 0 +< SELECT fid, AsText(Centroid(g)) FROM gis_polygon; +< fid AsText(Centroid(g)) +< 108 POINT(15 15) +< 109 POINT(25.416666666666668 25.416666666666668) +< 110 POINT(20 10) +< SELECT fid, Area(g) FROM gis_polygon; +< fid Area(g) +< 108 100 +< 109 2400 +< 110 450 +< SELECT fid, AsText(ExteriorRing(g)) FROM gis_polygon; +< fid AsText(ExteriorRing(g)) +< 108 LINESTRING(10 10,20 10,20 20,10 20,10 10) +< 109 LINESTRING(0 0,50 0,50 50,0 50,0 0) +< 110 LINESTRING(0 0,30 0,30 30,0 0) +< SELECT fid, NumInteriorRings(g) FROM gis_polygon; +< fid NumInteriorRings(g) +< 108 0 +< 109 1 +< 110 0 +< SELECT fid, AsText(InteriorRingN(g, 1)) FROM gis_polygon; +< fid AsText(InteriorRingN(g, 1)) +< 108 NULL +< 109 LINESTRING(10 10,20 10,20 20,10 20,10 10) +< 110 NULL +< SELECT fid, IsClosed(g) FROM gis_multi_line; +< fid IsClosed(g) +< 114 0 +< 115 0 +< 116 0 +< SELECT fid, AsText(Centroid(g)) FROM gis_multi_polygon; +< fid AsText(Centroid(g)) +< 117 POINT(55.58852775304245 17.426536064113982) +< 118 POINT(55.58852775304245 17.426536064113982) +< 119 POINT(2 2) +< SELECT fid, Area(g) FROM gis_multi_polygon; +< fid Area(g) +< 117 1684.5 +< 118 1684.5 +< 119 4.5 +< SELECT fid, NumGeometries(g) from gis_multi_point; +< fid NumGeometries(g) +< 111 4 +< 112 4 +< 113 2 +< SELECT fid, NumGeometries(g) from gis_multi_line; +< fid NumGeometries(g) +< 114 2 +< 115 1 +< 116 2 +< SELECT fid, NumGeometries(g) from gis_multi_polygon; +< fid NumGeometries(g) +< 117 2 +< 118 2 +< 119 1 +< SELECT fid, NumGeometries(g) from gis_geometrycollection; +< fid NumGeometries(g) +< 120 2 +< 121 2 +< 122 0 +< 123 0 +< SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_point; +< fid AsText(GeometryN(g, 2)) +< 111 POINT(10 10) +< 112 POINT(11 11) +< 113 POINT(4 10) +< SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_line; +< fid AsText(GeometryN(g, 2)) +< 114 LINESTRING(16 0,16 23,16 48) +< 115 NULL +< 116 LINESTRING(2 5,5 8,21 7) +< SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_polygon; +< fid AsText(GeometryN(g, 2)) +< 117 POLYGON((59 18,67 18,67 13,59 13,59 18)) +< 118 POLYGON((59 18,67 18,67 13,59 13,59 18)) +< 119 NULL +< SELECT fid, AsText(GeometryN(g, 2)) from gis_geometrycollection; +< fid AsText(GeometryN(g, 2)) +< 120 LINESTRING(0 0,10 10) +< 121 LINESTRING(3 6,7 9) +< 122 NULL +< 123 NULL +< SELECT fid, AsText(GeometryN(g, 1)) from gis_geometrycollection; +< fid AsText(GeometryN(g, 1)) +< 120 POINT(0 0) +< 121 POINT(44 6) +< 122 NULL +< 123 NULL +< SELECT g1.fid as first, g2.fid as second, +< Within(g1.g, g2.g) as w, Contains(g1.g, g2.g) as c, Overlaps(g1.g, g2.g) as o, +< Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t, +< Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r +< FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second; +< first second w c o e d t i r +< 120 120 1 1 0 1 0 1 1 0 +< 120 121 0 0 1 0 0 0 1 0 +< 120 122 0 1 NULL 0 NULL 0 NULL 0 +< 120 123 0 1 NULL 0 NULL 0 NULL 0 +< 121 120 0 0 1 0 0 0 1 0 +< 121 121 1 1 0 1 0 1 1 0 +< 121 122 0 1 NULL 0 NULL 0 NULL 0 +< 121 123 0 1 NULL 0 NULL 0 NULL 0 +< 122 120 1 0 NULL 0 NULL 0 NULL 0 +< 122 121 1 0 NULL 0 NULL 0 NULL 0 +< 122 122 1 1 NULL 1 NULL 0 NULL 0 +< 122 123 1 1 NULL 1 NULL 0 NULL 0 +< 123 120 1 0 NULL 0 NULL 0 NULL 0 +< 123 121 1 0 NULL 0 NULL 0 NULL 0 +< 123 122 1 1 NULL 1 NULL 0 NULL 0 +< 123 123 1 1 NULL 1 NULL 0 NULL 0 +< DROP TABLE gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry; +< USE gis_ogs; +< # Lakes +< INSERT INTO lakes VALUES ( +< 101, 'BLUE LAKE', +< PolyFromText( +< 'POLYGON( +< (52 18,66 23,73 9,48 6,52 18), +< (59 18,67 18,67 13,59 13,59 18) +< )', +< 101)); +< # Road Segments +< INSERT INTO road_segments VALUES(102, 'Route 5', NULL, 2, +< LineFromText( +< 'LINESTRING( 0 18, 10 21, 16 23, 28 26, 44 31 )' ,101)); +< INSERT INTO road_segments VALUES(103, 'Route 5', 'Main Street', 4, +< LineFromText( +< 'LINESTRING( 44 31, 56 34, 70 38 )' ,101)); +< INSERT INTO road_segments VALUES(104, 'Route 5', NULL, 2, +< LineFromText( +< 'LINESTRING( 70 38, 72 48 )' ,101)); +< INSERT INTO road_segments VALUES(105, 'Main Street', NULL, 4, +< LineFromText( +< 'LINESTRING( 70 38, 84 42 )' ,101)); +< INSERT INTO road_segments VALUES(106, 'Dirt Road by Green Forest', NULL, +< 1, +< LineFromText( +< 'LINESTRING( 28 26, 28 0 )',101)); +< # DividedRoutes +< INSERT INTO divided_routes VALUES(119, 'Route 75', 4, +< MLineFromText( +< 'MULTILINESTRING((10 48,10 21,10 0), +< (16 0,16 23,16 48))', 101)); +< # Forests +< INSERT INTO forests VALUES(109, 'Green Forest', +< MPolyFromText( +< 'MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26), +< (52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))', +< 101)); +< # Bridges +< INSERT INTO bridges VALUES(110, 'Cam Bridge', PointFromText( +< 'POINT( 44 31 )', 101)); +< # Streams +< INSERT INTO streams VALUES(111, 'Cam Stream', +< LineFromText( +< 'LINESTRING( 38 48, 44 41, 41 36, 44 31, 52 18 )', 101)); +< INSERT INTO streams VALUES(112, NULL, +< LineFromText( +< 'LINESTRING( 76 0, 78 4, 73 9 )', 101)); +< # Buildings +< INSERT INTO buildings VALUES(113, '123 Main Street', +< PointFromText( +< 'POINT( 52 30 )', 101), +< PolyFromText( +< 'POLYGON( ( 50 31, 54 31, 54 29, 50 29, 50 31) )', 101)); +< INSERT INTO buildings VALUES(114, '215 Main Street', +< PointFromText( +< 'POINT( 64 33 )', 101), +< PolyFromText( +< 'POLYGON( ( 66 34, 62 34, 62 32, 66 32, 66 34) )', 101)); +< # Ponds +< INSERT INTO ponds VALUES(120, NULL, 'Stock Pond', +< MPolyFromText( +< 'MULTIPOLYGON( ( ( 24 44, 22 42, 24 40, 24 44) ), +< ( ( 26 44, 26 40, 28 42, 26 44) ) )', 101)); +< # Named Places +< INSERT INTO named_places VALUES(117, 'Ashton', +< PolyFromText( +< 'POLYGON( ( 62 48, 84 48, 84 30, 56 30, 56 34, 62 48) )', 101)); +< INSERT INTO named_places VALUES(118, 'Goose Island', +< PolyFromText( +< 'POLYGON( ( 67 13, 67 18, 59 18, 59 13, 67 13) )', 101)); +< # Map Neatlines +< INSERT INTO map_neatlines VALUES(115, +< PolyFromText( +< 'POLYGON( ( 0 0, 0 48, 84 48, 84 0, 0 0 ) )', 101)); +< SELECT Dimension(shore) +< FROM lakes +< WHERE name = 'Blue Lake'; +< Dimension(shore) +< 2 +< SELECT GeometryType(centerlines) +< FROM divided_routes +< WHERE name = 'Route 75'; +< GeometryType(centerlines) +< MULTILINESTRING +< SELECT AsText(boundary) +< FROM named_places +< WHERE name = 'Goose Island'; +< AsText(boundary) +< POLYGON((67 13,67 18,59 18,59 13,67 13)) +< SELECT AsText(PolyFromWKB(AsBinary(boundary),101)) +< FROM named_places +< WHERE name = 'Goose Island'; +< AsText(PolyFromWKB(AsBinary(boundary),101)) +< POLYGON((67 13,67 18,59 18,59 13,67 13)) +< SELECT SRID(boundary) +< FROM named_places +< WHERE name = 'Goose Island'; +< SRID(boundary) +< 101 +< SELECT IsEmpty(centerline) +< FROM road_segments +< WHERE name = 'Route 5' +< AND aliases = 'Main Street'; +< IsEmpty(centerline) +< 0 +< SELECT AsText(Envelope(boundary)) +< FROM named_places +< WHERE name = 'Goose Island'; +< AsText(Envelope(boundary)) +< POLYGON((59 13,67 13,67 18,59 18,59 13)) +< SELECT X(position) +< FROM bridges +< WHERE name = 'Cam Bridge'; +< X(position) +< 44 +< SELECT Y(position) +< FROM bridges +< WHERE name = 'Cam Bridge'; +< Y(position) +< 31 +< SELECT AsText(StartPoint(centerline)) +< FROM road_segments +< WHERE fid = 102; +< AsText(StartPoint(centerline)) +< POINT(0 18) +< SELECT AsText(EndPoint(centerline)) +< FROM road_segments +< WHERE fid = 102; +< AsText(EndPoint(centerline)) +< POINT(44 31) +< SELECT GLength(centerline) +< FROM road_segments +< WHERE fid = 106; +< GLength(centerline) +< 26 +< SELECT NumPoints(centerline) +< FROM road_segments +< WHERE fid = 102; +< NumPoints(centerline) +< 5 +< SELECT AsText(PointN(centerline, 1)) +< FROM road_segments +< WHERE fid = 102; +< AsText(PointN(centerline, 1)) +< POINT(0 18) +< SELECT AsText(Centroid(boundary)) +< FROM named_places +< WHERE name = 'Goose Island'; +< AsText(Centroid(boundary)) +< POINT(63 15.5) +< SELECT Area(boundary) +< FROM named_places +< WHERE name = 'Goose Island'; +< Area(boundary) +< 40 +< SELECT AsText(ExteriorRing(shore)) +< FROM lakes +< WHERE name = 'Blue Lake'; +< AsText(ExteriorRing(shore)) +< LINESTRING(52 18,66 23,73 9,48 6,52 18) +< SELECT NumInteriorRings(shore) +< FROM lakes +< WHERE name = 'Blue Lake'; +< NumInteriorRings(shore) +< 1 +< SELECT AsText(InteriorRingN(shore, 1)) +< FROM lakes +< WHERE name = 'Blue Lake'; +< AsText(InteriorRingN(shore, 1)) +< LINESTRING(59 18,67 18,67 13,59 13,59 18) +< SELECT NumGeometries(centerlines) +< FROM divided_routes +< WHERE name = 'Route 75'; +< NumGeometries(centerlines) +< 2 +< SELECT AsText(GeometryN(centerlines, 2)) +< FROM divided_routes +< WHERE name = 'Route 75'; +< AsText(GeometryN(centerlines, 2)) +< LINESTRING(16 0,16 23,16 48) +< SELECT IsClosed(centerlines) +< FROM divided_routes +< WHERE name = 'Route 75'; +< IsClosed(centerlines) +< 0 +< SELECT GLength(centerlines) +< FROM divided_routes +< WHERE name = 'Route 75'; +< GLength(centerlines) +< 96 +< SELECT AsText(Centroid(shores)) +< FROM ponds +< WHERE fid = 120; +< AsText(Centroid(shores)) +< POINT(25 42) +< SELECT Area(shores) +< FROM ponds +< WHERE fid = 120; +< Area(shores) +< 8 +< SELECT ST_Equals(boundary, +< PolyFromText('POLYGON( ( 67 13, 67 18, 59 18, 59 13, 67 13) )',1)) +< FROM named_places +< WHERE name = 'Goose Island'; +< ST_Equals(boundary, +< PolyFromText('POLYGON( ( 67 13, 67 18, 59 18, 59 13, 67 13) )',1)) +< 1 +< SELECT ST_Disjoint(centerlines, boundary) +< FROM divided_routes, named_places +< WHERE divided_routes.name = 'Route 75' +< AND named_places.name = 'Ashton'; +< ST_Disjoint(centerlines, boundary) +< 1 +< SELECT ST_Touches(centerline, shore) +< FROM streams, lakes +< WHERE streams.name = 'Cam Stream' +< AND lakes.name = 'Blue Lake'; +< ST_Touches(centerline, shore) +< 1 +< SELECT Crosses(road_segments.centerline, divided_routes.centerlines) +< FROM road_segments, divided_routes +< WHERE road_segments.fid = 102 +< AND divided_routes.name = 'Route 75'; +< Crosses(road_segments.centerline, divided_routes.centerlines) +< 1 +< SELECT ST_Intersects(road_segments.centerline, divided_routes.centerlines) +< FROM road_segments, divided_routes +< WHERE road_segments.fid = 102 +< AND divided_routes.name = 'Route 75'; +< ST_Intersects(road_segments.centerline, divided_routes.centerlines) +< 1 +< SELECT ST_Contains(forests.boundary, named_places.boundary) +< FROM forests, named_places +< WHERE forests.name = 'Green Forest' +< AND named_places.name = 'Ashton'; +< ST_Contains(forests.boundary, named_places.boundary) +< 0 +< SELECT ST_Distance(position, boundary) +< FROM bridges, named_places +< WHERE bridges.name = 'Cam Bridge' +< AND named_places.name = 'Ashton'; +< ST_Distance(position, boundary) +< 12 +< SELECT AsText(ST_Difference(named_places.boundary, forests.boundary)) +< FROM named_places, forests +< WHERE named_places.name = 'Ashton' +< AND forests.name = 'Green Forest'; +< AsText(ST_Difference(named_places.boundary, forests.boundary)) +< POLYGON((56 34,62 48,84 48,84 42,56 34)) +< SELECT AsText(ST_Union(shore, boundary)) +< FROM lakes, named_places +< WHERE lakes.name = 'Blue Lake' +< AND named_places.name = 'Goose Island'; +< AsText(ST_Union(shore, boundary)) +< POLYGON((48 6,52 18,66 23,73 9,48 6)) +< SELECT AsText(ST_SymDifference(shore, boundary)) +< FROM lakes, named_places +< WHERE lakes.name = 'Blue Lake' +< AND named_places.name = 'Ashton'; +< AsText(ST_SymDifference(shore, boundary)) +< MULTIPOLYGON(((48 6,52 18,66 23,73 9,48 6),(59 13,59 18,67 18,67 13,59 13)),((56 30,56 34,62 48,84 48,84 30,56 30))) +< SELECT count(*) +< FROM buildings, bridges +< WHERE ST_Contains(ST_Buffer(bridges.position, 15.0), buildings.footprint) = 1; +< count(*) +< 1 +--- +> ERROR 42000: The storage engine for the table doesn't support GEOMETRY +> # ERROR: Statement ended with errno 1178, errname ER_CHECK_NOT_IMPLEMENTED (expected to succeed) +> # ------------ UNEXPECTED RESULT ------------ +> # [ CREATE TABLE gis_point (fid INT(11) /*!*/ /*Custom column options*/, g POINT) ENGINE=MRG_MYISAM /*!*/ /*Custom table options*/ UNION(mrg.gis_point) INSERT_METHOD=LAST ] +> # The statement|command finished with ER_CHECK_NOT_IMPLEMENTED. +> # Geometry types or the mix could be unsupported|malfunctioning, or the problem was caused by previous errors. +> # You can change the engine code, or create an rdiff, or disable the test by adding it to disabled.def. +> # Further in this test, the message might sometimes be suppressed; a part of the test might be skipped. +> # Also, this problem may cause a chain effect (more errors of different kinds in the test). +> # ------------------------------------------- diff --git a/storage/myisammrg/mysql-test/storage_engine/type_spatial_indexes.rdiff b/storage/myisammrg/mysql-test/storage_engine/type_spatial_indexes.rdiff new file mode 100644 index 00000000000..89f1100f550 --- /dev/null +++ b/storage/myisammrg/mysql-test/storage_engine/type_spatial_indexes.rdiff @@ -0,0 +1,1412 @@ +5,698c5,14 +< CREATE TABLE gis_line (fid <INT_COLUMN>, g LINESTRING, <CUSTOM_INDEX> g(g(256))) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +< CREATE TABLE gis_polygon (fid <INT_COLUMN>, g POLYGON, <CUSTOM_INDEX> g(g(512))) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +< CREATE TABLE gis_multi_point (fid <INT_COLUMN>, g MULTIPOINT, <CUSTOM_INDEX> g(g(128))) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +< CREATE TABLE gis_multi_line (fid <INT_COLUMN>, g MULTILINESTRING, <CUSTOM_INDEX> g(g(256))) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +< CREATE TABLE gis_multi_polygon (fid <INT_COLUMN>, g MULTIPOLYGON) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +< CREATE TABLE gis_geometrycollection (fid <INT_COLUMN>, g GEOMETRYCOLLECTION) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +< CREATE TABLE gis_geometry (fid <INT_COLUMN>, g GEOMETRY) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +< USE gis_ogs; +< CREATE TABLE lakes (fid INT <CUSTOM_COL_OPTIONS>, +< name CHAR(64) <CUSTOM_COL_OPTIONS>, +< shore POLYGON, <CUSTOM_INDEX> s(shore(64))) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +< CREATE TABLE road_segments (fid INT <CUSTOM_COL_OPTIONS>, +< name CHAR(64) <CUSTOM_COL_OPTIONS>, +< aliases CHAR(64) <CUSTOM_COL_OPTIONS>, +< num_lanes INT <CUSTOM_COL_OPTIONS>, +< centerline LINESTRING, <CUSTOM_INDEX> c(centerline(128))) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +< CREATE TABLE divided_routes (fid INT <CUSTOM_COL_OPTIONS>, +< name CHAR(64) <CUSTOM_COL_OPTIONS>, +< num_lanes INT <CUSTOM_COL_OPTIONS>, +< centerlines MULTILINESTRING, <CUSTOM_INDEX> c(centerlines(512))) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +< CREATE TABLE forests (fid INT <CUSTOM_COL_OPTIONS>, +< name CHAR(64) <CUSTOM_COL_OPTIONS>, +< boundary MULTIPOLYGON, <CUSTOM_INDEX> b(boundary(128))) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +< CREATE TABLE bridges (fid INT <CUSTOM_COL_OPTIONS>, +< name CHAR(64) <CUSTOM_COL_OPTIONS>, +< position POINT, <CUSTOM_INDEX> p(`position`(64))) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +< CREATE TABLE streams (fid INT <CUSTOM_COL_OPTIONS>, +< name CHAR(64) <CUSTOM_COL_OPTIONS>, +< centerline LINESTRING, <CUSTOM_INDEX> c(centerline(256))) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +< CREATE TABLE buildings (fid INT <CUSTOM_COL_OPTIONS>, +< name CHAR(64) <CUSTOM_COL_OPTIONS>, +< position POINT, +< footprint POLYGON, <CUSTOM_INDEX> p(`position`(64)), <CUSTOM_INDEX> f(footprint(128))) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +< CREATE TABLE ponds (fid INT <CUSTOM_COL_OPTIONS>, +< name CHAR(64) <CUSTOM_COL_OPTIONS>, +< type CHAR(64) <CUSTOM_COL_OPTIONS>, +< shores MULTIPOLYGON, <CUSTOM_INDEX> s(shores(256))) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +< CREATE TABLE named_places (fid INT <CUSTOM_COL_OPTIONS>, +< name CHAR(64) <CUSTOM_COL_OPTIONS>, +< boundary POLYGON, <CUSTOM_INDEX> b(boundary(512))) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +< CREATE TABLE map_neatlines (fid INT <CUSTOM_COL_OPTIONS>, +< neatline POLYGON, <CUSTOM_INDEX> n(neatline(700))) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +< USE test; +< SHOW FIELDS FROM gis_point; +< Field Type Null Key Default Extra +< fid int(11) YES NULL +< g point YES MUL NULL +< SHOW FIELDS FROM gis_line; +< Field Type Null Key Default Extra +< fid int(11) YES NULL +< g linestring YES MUL NULL +< SHOW FIELDS FROM gis_polygon; +< Field Type Null Key Default Extra +< fid int(11) YES NULL +< g polygon YES MUL NULL +< SHOW FIELDS FROM gis_multi_point; +< Field Type Null Key Default Extra +< fid int(11) YES NULL +< g multipoint YES MUL NULL +< SHOW FIELDS FROM gis_multi_line; +< Field Type Null Key Default Extra +< fid int(11) YES NULL +< g multilinestring YES MUL NULL +< SHOW FIELDS FROM gis_multi_polygon; +< Field Type Null Key Default Extra +< fid int(11) YES NULL +< g multipolygon YES NULL +< SHOW FIELDS FROM gis_geometrycollection; +< Field Type Null Key Default Extra +< fid int(11) YES NULL +< g geometrycollection YES NULL +< SHOW FIELDS FROM gis_geometry; +< Field Type Null Key Default Extra +< fid int(11) YES NULL +< g geometry YES NULL +< INSERT INTO gis_point VALUES +< (101, PointFromText('POINT(10 10)')), +< (102, PointFromText('POINT(20 10)')), +< (103, PointFromText('POINT(20 20)')), +< (104, PointFromWKB(AsWKB(PointFromText('POINT(10 20)')))); +< INSERT INTO gis_line VALUES +< (105, LineFromText('LINESTRING(0 0,0 10,10 0)')), +< (106, LineStringFromText('LINESTRING(10 10,20 10,20 20,10 20,10 10)')), +< (107, LineStringFromWKB(AsWKB(LineString(Point(10, 10), Point(40, 10))))); +< INSERT INTO gis_polygon VALUES +< (108, PolygonFromText('POLYGON((10 10,20 10,20 20,10 20,10 10))')), +< (109, PolyFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))')), +< (110, PolyFromWKB(AsWKB(Polygon(LineString(Point(0, 0), Point(30, 0), Point(30, 30), Point(0, 0)))))); +< INSERT INTO gis_multi_point VALUES +< (111, MultiPointFromText('MULTIPOINT(0 0,10 10,10 20,20 20)')), +< (112, MPointFromText('MULTIPOINT(1 1,11 11,11 21,21 21)')), +< (113, MPointFromWKB(AsWKB(MultiPoint(Point(3, 6), Point(4, 10))))); +< INSERT INTO gis_multi_line VALUES +< (114, MultiLineStringFromText('MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48))')), +< (115, MLineFromText('MULTILINESTRING((10 48,10 21,10 0))')), +< (116, MLineFromWKB(AsWKB(MultiLineString(LineString(Point(1, 2), Point(3, 5)), LineString(Point(2, 5), Point(5, 8), Point(21, 7)))))); +< INSERT INTO gis_multi_polygon VALUES +< (117, MultiPolygonFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')), +< (118, MPolyFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')), +< (119, MPolyFromWKB(AsWKB(MultiPolygon(Polygon(LineString(Point(0, 3), Point(3, 3), Point(3, 0), Point(0, 3))))))); +< INSERT INTO gis_geometrycollection VALUES +< (120, GeomCollFromText('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(0 0,10 10))')), +< (121, GeometryFromWKB(AsWKB(GeometryCollection(Point(44, 6), LineString(Point(3, 6), Point(7, 9)))))), +< (122, GeomFromText('GeometryCollection()')), +< (123, GeomFromText('GeometryCollection EMPTY')); +< INSERT into gis_geometry SELECT * FROM gis_point; +< INSERT into gis_geometry SELECT * FROM gis_line; +< INSERT into gis_geometry SELECT * FROM gis_polygon; +< INSERT into gis_geometry SELECT * FROM gis_multi_point; +< INSERT into gis_geometry SELECT * FROM gis_multi_line; +< INSERT into gis_geometry SELECT * FROM gis_multi_polygon; +< INSERT into gis_geometry SELECT * FROM gis_geometrycollection; +< SELECT fid, AsText(g) FROM gis_point; +< fid AsText(g) +< 101 POINT(10 10) +< 102 POINT(20 10) +< 103 POINT(20 20) +< 104 POINT(10 20) +< SELECT fid, AsText(g) FROM gis_line; +< fid AsText(g) +< 105 LINESTRING(0 0,0 10,10 0) +< 106 LINESTRING(10 10,20 10,20 20,10 20,10 10) +< 107 LINESTRING(10 10,40 10) +< SELECT fid, AsText(g) FROM gis_polygon; +< fid AsText(g) +< 108 POLYGON((10 10,20 10,20 20,10 20,10 10)) +< 109 POLYGON((0 0,50 0,50 50,0 50,0 0),(10 10,20 10,20 20,10 20,10 10)) +< 110 POLYGON((0 0,30 0,30 30,0 0)) +< SELECT fid, AsText(g) FROM gis_multi_point; +< fid AsText(g) +< 111 MULTIPOINT(0 0,10 10,10 20,20 20) +< 112 MULTIPOINT(1 1,11 11,11 21,21 21) +< 113 MULTIPOINT(3 6,4 10) +< SELECT fid, AsText(g) FROM gis_multi_line; +< fid AsText(g) +< 114 MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48)) +< 115 MULTILINESTRING((10 48,10 21,10 0)) +< 116 MULTILINESTRING((1 2,3 5),(2 5,5 8,21 7)) +< SELECT fid, AsText(g) FROM gis_multi_polygon; +< fid AsText(g) +< 117 MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18))) +< 118 MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18))) +< 119 MULTIPOLYGON(((0 3,3 3,3 0,0 3))) +< SELECT fid, AsText(g) FROM gis_geometrycollection; +< fid AsText(g) +< 120 GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(0 0,10 10)) +< 121 GEOMETRYCOLLECTION(POINT(44 6),LINESTRING(3 6,7 9)) +< 122 GEOMETRYCOLLECTION EMPTY +< 123 GEOMETRYCOLLECTION EMPTY +< SELECT fid, AsText(g) FROM gis_geometry; +< fid AsText(g) +< 101 POINT(10 10) +< 102 POINT(20 10) +< 103 POINT(20 20) +< 104 POINT(10 20) +< 105 LINESTRING(0 0,0 10,10 0) +< 106 LINESTRING(10 10,20 10,20 20,10 20,10 10) +< 107 LINESTRING(10 10,40 10) +< 108 POLYGON((10 10,20 10,20 20,10 20,10 10)) +< 109 POLYGON((0 0,50 0,50 50,0 50,0 0),(10 10,20 10,20 20,10 20,10 10)) +< 110 POLYGON((0 0,30 0,30 30,0 0)) +< 111 MULTIPOINT(0 0,10 10,10 20,20 20) +< 112 MULTIPOINT(1 1,11 11,11 21,21 21) +< 113 MULTIPOINT(3 6,4 10) +< 114 MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48)) +< 115 MULTILINESTRING((10 48,10 21,10 0)) +< 116 MULTILINESTRING((1 2,3 5),(2 5,5 8,21 7)) +< 117 MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18))) +< 118 MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18))) +< 119 MULTIPOLYGON(((0 3,3 3,3 0,0 3))) +< 120 GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(0 0,10 10)) +< 121 GEOMETRYCOLLECTION(POINT(44 6),LINESTRING(3 6,7 9)) +< 122 GEOMETRYCOLLECTION EMPTY +< 123 GEOMETRYCOLLECTION EMPTY +< SELECT fid, Dimension(g) FROM gis_geometry; +< fid Dimension(g) +< 101 0 +< 102 0 +< 103 0 +< 104 0 +< 105 1 +< 106 1 +< 107 1 +< 108 2 +< 109 2 +< 110 2 +< 111 0 +< 112 0 +< 113 0 +< 114 1 +< 115 1 +< 116 1 +< 117 2 +< 118 2 +< 119 2 +< 120 1 +< 121 1 +< 122 0 +< 123 0 +< SELECT fid, GeometryType(g) FROM gis_geometry; +< fid GeometryType(g) +< 101 POINT +< 102 POINT +< 103 POINT +< 104 POINT +< 105 LINESTRING +< 106 LINESTRING +< 107 LINESTRING +< 108 POLYGON +< 109 POLYGON +< 110 POLYGON +< 111 MULTIPOINT +< 112 MULTIPOINT +< 113 MULTIPOINT +< 114 MULTILINESTRING +< 115 MULTILINESTRING +< 116 MULTILINESTRING +< 117 MULTIPOLYGON +< 118 MULTIPOLYGON +< 119 MULTIPOLYGON +< 120 GEOMETRYCOLLECTION +< 121 GEOMETRYCOLLECTION +< 122 GEOMETRYCOLLECTION +< 123 GEOMETRYCOLLECTION +< SELECT fid, IsEmpty(g) FROM gis_geometry; +< fid IsEmpty(g) +< 101 0 +< 102 0 +< 103 0 +< 104 0 +< 105 0 +< 106 0 +< 107 0 +< 108 0 +< 109 0 +< 110 0 +< 111 0 +< 112 0 +< 113 0 +< 114 0 +< 115 0 +< 116 0 +< 117 0 +< 118 0 +< 119 0 +< 120 0 +< 121 0 +< 122 0 +< 123 0 +< SELECT fid, AsText(Envelope(g)) FROM gis_geometry; +< fid AsText(Envelope(g)) +< 101 POLYGON((10 10,10 10,10 10,10 10,10 10)) +< 102 POLYGON((20 10,20 10,20 10,20 10,20 10)) +< 103 POLYGON((20 20,20 20,20 20,20 20,20 20)) +< 104 POLYGON((10 20,10 20,10 20,10 20,10 20)) +< 105 POLYGON((0 0,10 0,10 10,0 10,0 0)) +< 106 POLYGON((10 10,20 10,20 20,10 20,10 10)) +< 107 POLYGON((10 10,40 10,40 10,10 10,10 10)) +< 108 POLYGON((10 10,20 10,20 20,10 20,10 10)) +< 109 POLYGON((0 0,50 0,50 50,0 50,0 0)) +< 110 POLYGON((0 0,30 0,30 30,0 30,0 0)) +< 111 POLYGON((0 0,20 0,20 20,0 20,0 0)) +< 112 POLYGON((1 1,21 1,21 21,1 21,1 1)) +< 113 POLYGON((3 6,4 6,4 10,3 10,3 6)) +< 114 POLYGON((10 0,16 0,16 48,10 48,10 0)) +< 115 POLYGON((10 0,10 0,10 48,10 48,10 0)) +< 116 POLYGON((1 2,21 2,21 8,1 8,1 2)) +< 117 POLYGON((28 0,84 0,84 42,28 42,28 0)) +< 118 POLYGON((28 0,84 0,84 42,28 42,28 0)) +< 119 POLYGON((0 0,3 0,3 3,0 3,0 0)) +< 120 POLYGON((0 0,10 0,10 10,0 10,0 0)) +< 121 POLYGON((3 6,44 6,44 9,3 9,3 6)) +< 122 GEOMETRYCOLLECTION EMPTY +< 123 GEOMETRYCOLLECTION EMPTY +< SELECT fid, X(g) FROM gis_point; +< fid X(g) +< 101 10 +< 102 20 +< 103 20 +< 104 10 +< SELECT fid, Y(g) FROM gis_point; +< fid Y(g) +< 101 10 +< 102 10 +< 103 20 +< 104 20 +< SELECT fid, AsText(StartPoint(g)) FROM gis_line; +< fid AsText(StartPoint(g)) +< 105 POINT(0 0) +< 106 POINT(10 10) +< 107 POINT(10 10) +< SELECT fid, AsText(EndPoint(g)) FROM gis_line; +< fid AsText(EndPoint(g)) +< 105 POINT(10 0) +< 106 POINT(10 10) +< 107 POINT(40 10) +< SELECT fid, GLength(g) FROM gis_line; +< fid GLength(g) +< 105 24.14213562373095 +< 106 40 +< 107 30 +< SELECT fid, NumPoints(g) FROM gis_line; +< fid NumPoints(g) +< 105 3 +< 106 5 +< 107 2 +< SELECT fid, AsText(PointN(g, 2)) FROM gis_line; +< fid AsText(PointN(g, 2)) +< 105 POINT(0 10) +< 106 POINT(20 10) +< 107 POINT(40 10) +< SELECT fid, IsClosed(g) FROM gis_line; +< fid IsClosed(g) +< 105 0 +< 106 1 +< 107 0 +< SELECT fid, AsText(Centroid(g)) FROM gis_polygon; +< fid AsText(Centroid(g)) +< 108 POINT(15 15) +< 109 POINT(25.416666666666668 25.416666666666668) +< 110 POINT(20 10) +< SELECT fid, Area(g) FROM gis_polygon; +< fid Area(g) +< 108 100 +< 109 2400 +< 110 450 +< SELECT fid, AsText(ExteriorRing(g)) FROM gis_polygon; +< fid AsText(ExteriorRing(g)) +< 108 LINESTRING(10 10,20 10,20 20,10 20,10 10) +< 109 LINESTRING(0 0,50 0,50 50,0 50,0 0) +< 110 LINESTRING(0 0,30 0,30 30,0 0) +< SELECT fid, NumInteriorRings(g) FROM gis_polygon; +< fid NumInteriorRings(g) +< 108 0 +< 109 1 +< 110 0 +< SELECT fid, AsText(InteriorRingN(g, 1)) FROM gis_polygon; +< fid AsText(InteriorRingN(g, 1)) +< 108 NULL +< 109 LINESTRING(10 10,20 10,20 20,10 20,10 10) +< 110 NULL +< SELECT fid, IsClosed(g) FROM gis_multi_line; +< fid IsClosed(g) +< 114 0 +< 115 0 +< 116 0 +< SELECT fid, AsText(Centroid(g)) FROM gis_multi_polygon; +< fid AsText(Centroid(g)) +< 117 POINT(55.58852775304245 17.426536064113982) +< 118 POINT(55.58852775304245 17.426536064113982) +< 119 POINT(2 2) +< SELECT fid, Area(g) FROM gis_multi_polygon; +< fid Area(g) +< 117 1684.5 +< 118 1684.5 +< 119 4.5 +< SELECT fid, NumGeometries(g) from gis_multi_point; +< fid NumGeometries(g) +< 111 4 +< 112 4 +< 113 2 +< SELECT fid, NumGeometries(g) from gis_multi_line; +< fid NumGeometries(g) +< 114 2 +< 115 1 +< 116 2 +< SELECT fid, NumGeometries(g) from gis_multi_polygon; +< fid NumGeometries(g) +< 117 2 +< 118 2 +< 119 1 +< SELECT fid, NumGeometries(g) from gis_geometrycollection; +< fid NumGeometries(g) +< 120 2 +< 121 2 +< 122 0 +< 123 0 +< SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_point; +< fid AsText(GeometryN(g, 2)) +< 111 POINT(10 10) +< 112 POINT(11 11) +< 113 POINT(4 10) +< SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_line; +< fid AsText(GeometryN(g, 2)) +< 114 LINESTRING(16 0,16 23,16 48) +< 115 NULL +< 116 LINESTRING(2 5,5 8,21 7) +< SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_polygon; +< fid AsText(GeometryN(g, 2)) +< 117 POLYGON((59 18,67 18,67 13,59 13,59 18)) +< 118 POLYGON((59 18,67 18,67 13,59 13,59 18)) +< 119 NULL +< SELECT fid, AsText(GeometryN(g, 2)) from gis_geometrycollection; +< fid AsText(GeometryN(g, 2)) +< 120 LINESTRING(0 0,10 10) +< 121 LINESTRING(3 6,7 9) +< 122 NULL +< 123 NULL +< SELECT fid, AsText(GeometryN(g, 1)) from gis_geometrycollection; +< fid AsText(GeometryN(g, 1)) +< 120 POINT(0 0) +< 121 POINT(44 6) +< 122 NULL +< 123 NULL +< SELECT g1.fid as first, g2.fid as second, +< Within(g1.g, g2.g) as w, Contains(g1.g, g2.g) as c, Overlaps(g1.g, g2.g) as o, +< Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t, +< Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r +< FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second; +< first second w c o e d t i r +< 120 120 1 1 0 1 0 1 1 0 +< 120 121 0 0 1 0 0 0 1 0 +< 120 122 0 1 NULL 0 NULL 0 NULL 0 +< 120 123 0 1 NULL 0 NULL 0 NULL 0 +< 121 120 0 0 1 0 0 0 1 0 +< 121 121 1 1 0 1 0 1 1 0 +< 121 122 0 1 NULL 0 NULL 0 NULL 0 +< 121 123 0 1 NULL 0 NULL 0 NULL 0 +< 122 120 1 0 NULL 0 NULL 0 NULL 0 +< 122 121 1 0 NULL 0 NULL 0 NULL 0 +< 122 122 1 1 NULL 1 NULL 0 NULL 0 +< 122 123 1 1 NULL 1 NULL 0 NULL 0 +< 123 120 1 0 NULL 0 NULL 0 NULL 0 +< 123 121 1 0 NULL 0 NULL 0 NULL 0 +< 123 122 1 1 NULL 1 NULL 0 NULL 0 +< 123 123 1 1 NULL 1 NULL 0 NULL 0 +< DROP TABLE gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry; +< USE gis_ogs; +< # Lakes +< INSERT INTO lakes VALUES ( +< 101, 'BLUE LAKE', +< PolyFromText( +< 'POLYGON( +< (52 18,66 23,73 9,48 6,52 18), +< (59 18,67 18,67 13,59 13,59 18) +< )', +< 101)); +< # Road Segments +< INSERT INTO road_segments VALUES(102, 'Route 5', NULL, 2, +< LineFromText( +< 'LINESTRING( 0 18, 10 21, 16 23, 28 26, 44 31 )' ,101)); +< INSERT INTO road_segments VALUES(103, 'Route 5', 'Main Street', 4, +< LineFromText( +< 'LINESTRING( 44 31, 56 34, 70 38 )' ,101)); +< INSERT INTO road_segments VALUES(104, 'Route 5', NULL, 2, +< LineFromText( +< 'LINESTRING( 70 38, 72 48 )' ,101)); +< INSERT INTO road_segments VALUES(105, 'Main Street', NULL, 4, +< LineFromText( +< 'LINESTRING( 70 38, 84 42 )' ,101)); +< INSERT INTO road_segments VALUES(106, 'Dirt Road by Green Forest', NULL, +< 1, +< LineFromText( +< 'LINESTRING( 28 26, 28 0 )',101)); +< # DividedRoutes +< INSERT INTO divided_routes VALUES(119, 'Route 75', 4, +< MLineFromText( +< 'MULTILINESTRING((10 48,10 21,10 0), +< (16 0,16 23,16 48))', 101)); +< # Forests +< INSERT INTO forests VALUES(109, 'Green Forest', +< MPolyFromText( +< 'MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26), +< (52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))', +< 101)); +< # Bridges +< INSERT INTO bridges VALUES(110, 'Cam Bridge', PointFromText( +< 'POINT( 44 31 )', 101)); +< # Streams +< INSERT INTO streams VALUES(111, 'Cam Stream', +< LineFromText( +< 'LINESTRING( 38 48, 44 41, 41 36, 44 31, 52 18 )', 101)); +< INSERT INTO streams VALUES(112, NULL, +< LineFromText( +< 'LINESTRING( 76 0, 78 4, 73 9 )', 101)); +< # Buildings +< INSERT INTO buildings VALUES(113, '123 Main Street', +< PointFromText( +< 'POINT( 52 30 )', 101), +< PolyFromText( +< 'POLYGON( ( 50 31, 54 31, 54 29, 50 29, 50 31) )', 101)); +< INSERT INTO buildings VALUES(114, '215 Main Street', +< PointFromText( +< 'POINT( 64 33 )', 101), +< PolyFromText( +< 'POLYGON( ( 66 34, 62 34, 62 32, 66 32, 66 34) )', 101)); +< # Ponds +< INSERT INTO ponds VALUES(120, NULL, 'Stock Pond', +< MPolyFromText( +< 'MULTIPOLYGON( ( ( 24 44, 22 42, 24 40, 24 44) ), +< ( ( 26 44, 26 40, 28 42, 26 44) ) )', 101)); +< # Named Places +< INSERT INTO named_places VALUES(117, 'Ashton', +< PolyFromText( +< 'POLYGON( ( 62 48, 84 48, 84 30, 56 30, 56 34, 62 48) )', 101)); +< INSERT INTO named_places VALUES(118, 'Goose Island', +< PolyFromText( +< 'POLYGON( ( 67 13, 67 18, 59 18, 59 13, 67 13) )', 101)); +< # Map Neatlines +< INSERT INTO map_neatlines VALUES(115, +< PolyFromText( +< 'POLYGON( ( 0 0, 0 48, 84 48, 84 0, 0 0 ) )', 101)); +< SELECT Dimension(shore) +< FROM lakes +< WHERE name = 'Blue Lake'; +< Dimension(shore) +< 2 +< SELECT GeometryType(centerlines) +< FROM divided_routes +< WHERE name = 'Route 75'; +< GeometryType(centerlines) +< MULTILINESTRING +< SELECT AsText(boundary) +< FROM named_places +< WHERE name = 'Goose Island'; +< AsText(boundary) +< POLYGON((67 13,67 18,59 18,59 13,67 13)) +< SELECT AsText(PolyFromWKB(AsBinary(boundary),101)) +< FROM named_places +< WHERE name = 'Goose Island'; +< AsText(PolyFromWKB(AsBinary(boundary),101)) +< POLYGON((67 13,67 18,59 18,59 13,67 13)) +< SELECT SRID(boundary) +< FROM named_places +< WHERE name = 'Goose Island'; +< SRID(boundary) +< 101 +< SELECT IsEmpty(centerline) +< FROM road_segments +< WHERE name = 'Route 5' +< AND aliases = 'Main Street'; +< IsEmpty(centerline) +< 0 +< SELECT AsText(Envelope(boundary)) +< FROM named_places +< WHERE name = 'Goose Island'; +< AsText(Envelope(boundary)) +< POLYGON((59 13,67 13,67 18,59 18,59 13)) +< SELECT X(position) +< FROM bridges +< WHERE name = 'Cam Bridge'; +< X(position) +< 44 +< SELECT Y(position) +< FROM bridges +< WHERE name = 'Cam Bridge'; +< Y(position) +< 31 +< SELECT AsText(StartPoint(centerline)) +< FROM road_segments +< WHERE fid = 102; +< AsText(StartPoint(centerline)) +< POINT(0 18) +< SELECT AsText(EndPoint(centerline)) +< FROM road_segments +< WHERE fid = 102; +< AsText(EndPoint(centerline)) +< POINT(44 31) +< SELECT GLength(centerline) +< FROM road_segments +< WHERE fid = 106; +< GLength(centerline) +< 26 +< SELECT NumPoints(centerline) +< FROM road_segments +< WHERE fid = 102; +< NumPoints(centerline) +< 5 +< SELECT AsText(PointN(centerline, 1)) +< FROM road_segments +< WHERE fid = 102; +< AsText(PointN(centerline, 1)) +< POINT(0 18) +< SELECT AsText(Centroid(boundary)) +< FROM named_places +< WHERE name = 'Goose Island'; +< AsText(Centroid(boundary)) +< POINT(63 15.5) +< SELECT Area(boundary) +< FROM named_places +< WHERE name = 'Goose Island'; +< Area(boundary) +< 40 +< SELECT AsText(ExteriorRing(shore)) +< FROM lakes +< WHERE name = 'Blue Lake'; +< AsText(ExteriorRing(shore)) +< LINESTRING(52 18,66 23,73 9,48 6,52 18) +< SELECT NumInteriorRings(shore) +< FROM lakes +< WHERE name = 'Blue Lake'; +< NumInteriorRings(shore) +< 1 +< SELECT AsText(InteriorRingN(shore, 1)) +< FROM lakes +< WHERE name = 'Blue Lake'; +< AsText(InteriorRingN(shore, 1)) +< LINESTRING(59 18,67 18,67 13,59 13,59 18) +< SELECT NumGeometries(centerlines) +< FROM divided_routes +< WHERE name = 'Route 75'; +< NumGeometries(centerlines) +< 2 +< SELECT AsText(GeometryN(centerlines, 2)) +< FROM divided_routes +< WHERE name = 'Route 75'; +< AsText(GeometryN(centerlines, 2)) +< LINESTRING(16 0,16 23,16 48) +< SELECT IsClosed(centerlines) +< FROM divided_routes +< WHERE name = 'Route 75'; +< IsClosed(centerlines) +< 0 +< SELECT GLength(centerlines) +< FROM divided_routes +< WHERE name = 'Route 75'; +< GLength(centerlines) +< 96 +< SELECT AsText(Centroid(shores)) +< FROM ponds +< WHERE fid = 120; +< AsText(Centroid(shores)) +< POINT(25 42) +< SELECT Area(shores) +< FROM ponds +< WHERE fid = 120; +< Area(shores) +< 8 +< SELECT ST_Equals(boundary, +< PolyFromText('POLYGON( ( 67 13, 67 18, 59 18, 59 13, 67 13) )',1)) +< FROM named_places +< WHERE name = 'Goose Island'; +< ST_Equals(boundary, +< PolyFromText('POLYGON( ( 67 13, 67 18, 59 18, 59 13, 67 13) )',1)) +< 1 +< SELECT ST_Disjoint(centerlines, boundary) +< FROM divided_routes, named_places +< WHERE divided_routes.name = 'Route 75' +< AND named_places.name = 'Ashton'; +< ST_Disjoint(centerlines, boundary) +< 1 +< SELECT ST_Touches(centerline, shore) +< FROM streams, lakes +< WHERE streams.name = 'Cam Stream' +< AND lakes.name = 'Blue Lake'; +< ST_Touches(centerline, shore) +< 1 +< SELECT Crosses(road_segments.centerline, divided_routes.centerlines) +< FROM road_segments, divided_routes +< WHERE road_segments.fid = 102 +< AND divided_routes.name = 'Route 75'; +< Crosses(road_segments.centerline, divided_routes.centerlines) +< 1 +< SELECT ST_Intersects(road_segments.centerline, divided_routes.centerlines) +< FROM road_segments, divided_routes +< WHERE road_segments.fid = 102 +< AND divided_routes.name = 'Route 75'; +< ST_Intersects(road_segments.centerline, divided_routes.centerlines) +< 1 +< SELECT ST_Contains(forests.boundary, named_places.boundary) +< FROM forests, named_places +< WHERE forests.name = 'Green Forest' +< AND named_places.name = 'Ashton'; +< ST_Contains(forests.boundary, named_places.boundary) +< 0 +< SELECT ST_Distance(position, boundary) +< FROM bridges, named_places +< WHERE bridges.name = 'Cam Bridge' +< AND named_places.name = 'Ashton'; +< ST_Distance(position, boundary) +< 12 +< SELECT AsText(ST_Difference(named_places.boundary, forests.boundary)) +< FROM named_places, forests +< WHERE named_places.name = 'Ashton' +< AND forests.name = 'Green Forest'; +< AsText(ST_Difference(named_places.boundary, forests.boundary)) +< POLYGON((56 34,62 48,84 48,84 42,56 34)) +< SELECT AsText(ST_Union(shore, boundary)) +< FROM lakes, named_places +< WHERE lakes.name = 'Blue Lake' +< AND named_places.name = 'Goose Island'; +< AsText(ST_Union(shore, boundary)) +< POLYGON((48 6,52 18,66 23,73 9,48 6)) +< SELECT AsText(ST_SymDifference(shore, boundary)) +< FROM lakes, named_places +< WHERE lakes.name = 'Blue Lake' +< AND named_places.name = 'Ashton'; +< AsText(ST_SymDifference(shore, boundary)) +< MULTIPOLYGON(((48 6,52 18,66 23,73 9,48 6),(59 13,59 18,67 18,67 13,59 13)),((56 30,56 34,62 48,84 48,84 30,56 30))) +< SELECT count(*) +< FROM buildings, bridges +< WHERE ST_Contains(ST_Buffer(bridges.position, 15.0), buildings.footprint) = 1; +< count(*) +< 1 +--- +> ERROR 42000: The storage engine for the table doesn't support GEOMETRY +> # ERROR: Statement ended with errno 1178, errname ER_CHECK_NOT_IMPLEMENTED (expected to succeed) +> # ------------ UNEXPECTED RESULT ------------ +> # [ CREATE TABLE gis_point (fid INT(11) /*!*/ /*Custom column options*/, g POINT, /*!INDEX*/ /*Custom index*/ g(g(128))) ENGINE=MRG_MYISAM /*!*/ /*Custom table options*/ UNION(mrg.gis_point) INSERT_METHOD=LAST ] +> # The statement|command finished with ER_CHECK_NOT_IMPLEMENTED. +> # Geometry types or indexes on them or the mix could be unsupported|malfunctioning, or the problem was caused by previous errors. +> # You can change the engine code, or create an rdiff, or disable the test by adding it to disabled.def. +> # Further in this test, the message might sometimes be suppressed; a part of the test might be skipped. +> # Also, this problem may cause a chain effect (more errors of different kinds in the test). +> # ------------------------------------------- +705,1398c21,30 +< CREATE TABLE gis_line (fid <INT_COLUMN>, g LINESTRING NOT NULL, SPATIAL INDEX(g)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +< CREATE TABLE gis_polygon (fid <INT_COLUMN>, g POLYGON NOT NULL, SPATIAL INDEX(g)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +< CREATE TABLE gis_multi_point (fid <INT_COLUMN>, g MULTIPOINT NOT NULL, SPATIAL INDEX(g)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +< CREATE TABLE gis_multi_line (fid <INT_COLUMN>, g MULTILINESTRING NOT NULL, SPATIAL INDEX(g)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +< CREATE TABLE gis_multi_polygon (fid <INT_COLUMN>, g MULTIPOLYGON NOT NULL, SPATIAL INDEX(g)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +< CREATE TABLE gis_geometrycollection (fid <INT_COLUMN>, g GEOMETRYCOLLECTION NOT NULL, SPATIAL INDEX(g)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +< CREATE TABLE gis_geometry (fid <INT_COLUMN>, g GEOMETRY NOT NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +< USE gis_ogs; +< CREATE TABLE lakes (fid INT <CUSTOM_COL_OPTIONS>, +< name CHAR(64) <CUSTOM_COL_OPTIONS>, +< shore POLYGON NOT NULL, SPATIAL INDEX s(shore)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +< CREATE TABLE road_segments (fid INT <CUSTOM_COL_OPTIONS>, +< name CHAR(64) <CUSTOM_COL_OPTIONS>, +< aliases CHAR(64) <CUSTOM_COL_OPTIONS>, +< num_lanes INT <CUSTOM_COL_OPTIONS>, +< centerline LINESTRING NOT NULL, SPATIAL INDEX c(centerline)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +< CREATE TABLE divided_routes (fid INT <CUSTOM_COL_OPTIONS>, +< name CHAR(64) <CUSTOM_COL_OPTIONS>, +< num_lanes INT <CUSTOM_COL_OPTIONS>, +< centerlines MULTILINESTRING NOT NULL, SPATIAL INDEX c(centerlines)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +< CREATE TABLE forests (fid INT <CUSTOM_COL_OPTIONS>, +< name CHAR(64) <CUSTOM_COL_OPTIONS>, +< boundary MULTIPOLYGON NOT NULL, SPATIAL INDEX b(boundary)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +< CREATE TABLE bridges (fid INT <CUSTOM_COL_OPTIONS>, +< name CHAR(64) <CUSTOM_COL_OPTIONS>, +< position POINT NOT NULL, SPATIAL INDEX p(position)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +< CREATE TABLE streams (fid INT <CUSTOM_COL_OPTIONS>, +< name CHAR(64) <CUSTOM_COL_OPTIONS>, +< centerline LINESTRING NOT NULL, SPATIAL INDEX c(centerline)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +< CREATE TABLE buildings (fid INT <CUSTOM_COL_OPTIONS>, +< name CHAR(64) <CUSTOM_COL_OPTIONS>, +< position POINT NOT NULL, +< footprint POLYGON NOT NULL, SPATIAL INDEX p(position), SPATIAL INDEX f(footprint)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +< CREATE TABLE ponds (fid INT <CUSTOM_COL_OPTIONS>, +< name CHAR(64) <CUSTOM_COL_OPTIONS>, +< type CHAR(64) <CUSTOM_COL_OPTIONS>, +< shores MULTIPOLYGON NOT NULL, SPATIAL INDEX s(shores)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +< CREATE TABLE named_places (fid INT <CUSTOM_COL_OPTIONS>, +< name CHAR(64) <CUSTOM_COL_OPTIONS>, +< boundary POLYGON NOT NULL, SPATIAL INDEX b(boundary)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +< CREATE TABLE map_neatlines (fid INT <CUSTOM_COL_OPTIONS>, +< neatline POLYGON NOT NULL, SPATIAL INDEX n(neatline)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +< USE test; +< SHOW FIELDS FROM gis_point; +< Field Type Null Key Default Extra +< fid int(11) YES NULL +< g point NO MUL NULL +< SHOW FIELDS FROM gis_line; +< Field Type Null Key Default Extra +< fid int(11) YES NULL +< g linestring NO MUL NULL +< SHOW FIELDS FROM gis_polygon; +< Field Type Null Key Default Extra +< fid int(11) YES NULL +< g polygon NO MUL NULL +< SHOW FIELDS FROM gis_multi_point; +< Field Type Null Key Default Extra +< fid int(11) YES NULL +< g multipoint NO MUL NULL +< SHOW FIELDS FROM gis_multi_line; +< Field Type Null Key Default Extra +< fid int(11) YES NULL +< g multilinestring NO MUL NULL +< SHOW FIELDS FROM gis_multi_polygon; +< Field Type Null Key Default Extra +< fid int(11) YES NULL +< g multipolygon NO MUL NULL +< SHOW FIELDS FROM gis_geometrycollection; +< Field Type Null Key Default Extra +< fid int(11) YES NULL +< g geometrycollection NO MUL NULL +< SHOW FIELDS FROM gis_geometry; +< Field Type Null Key Default Extra +< fid int(11) YES NULL +< g geometry NO NULL +< INSERT INTO gis_point VALUES +< (101, PointFromText('POINT(10 10)')), +< (102, PointFromText('POINT(20 10)')), +< (103, PointFromText('POINT(20 20)')), +< (104, PointFromWKB(AsWKB(PointFromText('POINT(10 20)')))); +< INSERT INTO gis_line VALUES +< (105, LineFromText('LINESTRING(0 0,0 10,10 0)')), +< (106, LineStringFromText('LINESTRING(10 10,20 10,20 20,10 20,10 10)')), +< (107, LineStringFromWKB(AsWKB(LineString(Point(10, 10), Point(40, 10))))); +< INSERT INTO gis_polygon VALUES +< (108, PolygonFromText('POLYGON((10 10,20 10,20 20,10 20,10 10))')), +< (109, PolyFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))')), +< (110, PolyFromWKB(AsWKB(Polygon(LineString(Point(0, 0), Point(30, 0), Point(30, 30), Point(0, 0)))))); +< INSERT INTO gis_multi_point VALUES +< (111, MultiPointFromText('MULTIPOINT(0 0,10 10,10 20,20 20)')), +< (112, MPointFromText('MULTIPOINT(1 1,11 11,11 21,21 21)')), +< (113, MPointFromWKB(AsWKB(MultiPoint(Point(3, 6), Point(4, 10))))); +< INSERT INTO gis_multi_line VALUES +< (114, MultiLineStringFromText('MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48))')), +< (115, MLineFromText('MULTILINESTRING((10 48,10 21,10 0))')), +< (116, MLineFromWKB(AsWKB(MultiLineString(LineString(Point(1, 2), Point(3, 5)), LineString(Point(2, 5), Point(5, 8), Point(21, 7)))))); +< INSERT INTO gis_multi_polygon VALUES +< (117, MultiPolygonFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')), +< (118, MPolyFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')), +< (119, MPolyFromWKB(AsWKB(MultiPolygon(Polygon(LineString(Point(0, 3), Point(3, 3), Point(3, 0), Point(0, 3))))))); +< INSERT INTO gis_geometrycollection VALUES +< (120, GeomCollFromText('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(0 0,10 10))')), +< (121, GeometryFromWKB(AsWKB(GeometryCollection(Point(44, 6), LineString(Point(3, 6), Point(7, 9)))))), +< (122, GeomFromText('GeometryCollection()')), +< (123, GeomFromText('GeometryCollection EMPTY')); +< INSERT into gis_geometry SELECT * FROM gis_point; +< INSERT into gis_geometry SELECT * FROM gis_line; +< INSERT into gis_geometry SELECT * FROM gis_polygon; +< INSERT into gis_geometry SELECT * FROM gis_multi_point; +< INSERT into gis_geometry SELECT * FROM gis_multi_line; +< INSERT into gis_geometry SELECT * FROM gis_multi_polygon; +< INSERT into gis_geometry SELECT * FROM gis_geometrycollection; +< SELECT fid, AsText(g) FROM gis_point; +< fid AsText(g) +< 101 POINT(10 10) +< 102 POINT(20 10) +< 103 POINT(20 20) +< 104 POINT(10 20) +< SELECT fid, AsText(g) FROM gis_line; +< fid AsText(g) +< 105 LINESTRING(0 0,0 10,10 0) +< 106 LINESTRING(10 10,20 10,20 20,10 20,10 10) +< 107 LINESTRING(10 10,40 10) +< SELECT fid, AsText(g) FROM gis_polygon; +< fid AsText(g) +< 108 POLYGON((10 10,20 10,20 20,10 20,10 10)) +< 109 POLYGON((0 0,50 0,50 50,0 50,0 0),(10 10,20 10,20 20,10 20,10 10)) +< 110 POLYGON((0 0,30 0,30 30,0 0)) +< SELECT fid, AsText(g) FROM gis_multi_point; +< fid AsText(g) +< 111 MULTIPOINT(0 0,10 10,10 20,20 20) +< 112 MULTIPOINT(1 1,11 11,11 21,21 21) +< 113 MULTIPOINT(3 6,4 10) +< SELECT fid, AsText(g) FROM gis_multi_line; +< fid AsText(g) +< 114 MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48)) +< 115 MULTILINESTRING((10 48,10 21,10 0)) +< 116 MULTILINESTRING((1 2,3 5),(2 5,5 8,21 7)) +< SELECT fid, AsText(g) FROM gis_multi_polygon; +< fid AsText(g) +< 117 MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18))) +< 118 MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18))) +< 119 MULTIPOLYGON(((0 3,3 3,3 0,0 3))) +< SELECT fid, AsText(g) FROM gis_geometrycollection; +< fid AsText(g) +< 120 GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(0 0,10 10)) +< 121 GEOMETRYCOLLECTION(POINT(44 6),LINESTRING(3 6,7 9)) +< 122 GEOMETRYCOLLECTION EMPTY +< 123 GEOMETRYCOLLECTION EMPTY +< SELECT fid, AsText(g) FROM gis_geometry; +< fid AsText(g) +< 101 POINT(10 10) +< 102 POINT(20 10) +< 103 POINT(20 20) +< 104 POINT(10 20) +< 105 LINESTRING(0 0,0 10,10 0) +< 106 LINESTRING(10 10,20 10,20 20,10 20,10 10) +< 107 LINESTRING(10 10,40 10) +< 108 POLYGON((10 10,20 10,20 20,10 20,10 10)) +< 109 POLYGON((0 0,50 0,50 50,0 50,0 0),(10 10,20 10,20 20,10 20,10 10)) +< 110 POLYGON((0 0,30 0,30 30,0 0)) +< 111 MULTIPOINT(0 0,10 10,10 20,20 20) +< 112 MULTIPOINT(1 1,11 11,11 21,21 21) +< 113 MULTIPOINT(3 6,4 10) +< 114 MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48)) +< 115 MULTILINESTRING((10 48,10 21,10 0)) +< 116 MULTILINESTRING((1 2,3 5),(2 5,5 8,21 7)) +< 117 MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18))) +< 118 MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18))) +< 119 MULTIPOLYGON(((0 3,3 3,3 0,0 3))) +< 120 GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(0 0,10 10)) +< 121 GEOMETRYCOLLECTION(POINT(44 6),LINESTRING(3 6,7 9)) +< 122 GEOMETRYCOLLECTION EMPTY +< 123 GEOMETRYCOLLECTION EMPTY +< SELECT fid, Dimension(g) FROM gis_geometry; +< fid Dimension(g) +< 101 0 +< 102 0 +< 103 0 +< 104 0 +< 105 1 +< 106 1 +< 107 1 +< 108 2 +< 109 2 +< 110 2 +< 111 0 +< 112 0 +< 113 0 +< 114 1 +< 115 1 +< 116 1 +< 117 2 +< 118 2 +< 119 2 +< 120 1 +< 121 1 +< 122 0 +< 123 0 +< SELECT fid, GeometryType(g) FROM gis_geometry; +< fid GeometryType(g) +< 101 POINT +< 102 POINT +< 103 POINT +< 104 POINT +< 105 LINESTRING +< 106 LINESTRING +< 107 LINESTRING +< 108 POLYGON +< 109 POLYGON +< 110 POLYGON +< 111 MULTIPOINT +< 112 MULTIPOINT +< 113 MULTIPOINT +< 114 MULTILINESTRING +< 115 MULTILINESTRING +< 116 MULTILINESTRING +< 117 MULTIPOLYGON +< 118 MULTIPOLYGON +< 119 MULTIPOLYGON +< 120 GEOMETRYCOLLECTION +< 121 GEOMETRYCOLLECTION +< 122 GEOMETRYCOLLECTION +< 123 GEOMETRYCOLLECTION +< SELECT fid, IsEmpty(g) FROM gis_geometry; +< fid IsEmpty(g) +< 101 0 +< 102 0 +< 103 0 +< 104 0 +< 105 0 +< 106 0 +< 107 0 +< 108 0 +< 109 0 +< 110 0 +< 111 0 +< 112 0 +< 113 0 +< 114 0 +< 115 0 +< 116 0 +< 117 0 +< 118 0 +< 119 0 +< 120 0 +< 121 0 +< 122 0 +< 123 0 +< SELECT fid, AsText(Envelope(g)) FROM gis_geometry; +< fid AsText(Envelope(g)) +< 101 POLYGON((10 10,10 10,10 10,10 10,10 10)) +< 102 POLYGON((20 10,20 10,20 10,20 10,20 10)) +< 103 POLYGON((20 20,20 20,20 20,20 20,20 20)) +< 104 POLYGON((10 20,10 20,10 20,10 20,10 20)) +< 105 POLYGON((0 0,10 0,10 10,0 10,0 0)) +< 106 POLYGON((10 10,20 10,20 20,10 20,10 10)) +< 107 POLYGON((10 10,40 10,40 10,10 10,10 10)) +< 108 POLYGON((10 10,20 10,20 20,10 20,10 10)) +< 109 POLYGON((0 0,50 0,50 50,0 50,0 0)) +< 110 POLYGON((0 0,30 0,30 30,0 30,0 0)) +< 111 POLYGON((0 0,20 0,20 20,0 20,0 0)) +< 112 POLYGON((1 1,21 1,21 21,1 21,1 1)) +< 113 POLYGON((3 6,4 6,4 10,3 10,3 6)) +< 114 POLYGON((10 0,16 0,16 48,10 48,10 0)) +< 115 POLYGON((10 0,10 0,10 48,10 48,10 0)) +< 116 POLYGON((1 2,21 2,21 8,1 8,1 2)) +< 117 POLYGON((28 0,84 0,84 42,28 42,28 0)) +< 118 POLYGON((28 0,84 0,84 42,28 42,28 0)) +< 119 POLYGON((0 0,3 0,3 3,0 3,0 0)) +< 120 POLYGON((0 0,10 0,10 10,0 10,0 0)) +< 121 POLYGON((3 6,44 6,44 9,3 9,3 6)) +< 122 GEOMETRYCOLLECTION EMPTY +< 123 GEOMETRYCOLLECTION EMPTY +< SELECT fid, X(g) FROM gis_point; +< fid X(g) +< 101 10 +< 102 20 +< 103 20 +< 104 10 +< SELECT fid, Y(g) FROM gis_point; +< fid Y(g) +< 101 10 +< 102 10 +< 103 20 +< 104 20 +< SELECT fid, AsText(StartPoint(g)) FROM gis_line; +< fid AsText(StartPoint(g)) +< 105 POINT(0 0) +< 106 POINT(10 10) +< 107 POINT(10 10) +< SELECT fid, AsText(EndPoint(g)) FROM gis_line; +< fid AsText(EndPoint(g)) +< 105 POINT(10 0) +< 106 POINT(10 10) +< 107 POINT(40 10) +< SELECT fid, GLength(g) FROM gis_line; +< fid GLength(g) +< 105 24.14213562373095 +< 106 40 +< 107 30 +< SELECT fid, NumPoints(g) FROM gis_line; +< fid NumPoints(g) +< 105 3 +< 106 5 +< 107 2 +< SELECT fid, AsText(PointN(g, 2)) FROM gis_line; +< fid AsText(PointN(g, 2)) +< 105 POINT(0 10) +< 106 POINT(20 10) +< 107 POINT(40 10) +< SELECT fid, IsClosed(g) FROM gis_line; +< fid IsClosed(g) +< 105 0 +< 106 1 +< 107 0 +< SELECT fid, AsText(Centroid(g)) FROM gis_polygon; +< fid AsText(Centroid(g)) +< 108 POINT(15 15) +< 109 POINT(25.416666666666668 25.416666666666668) +< 110 POINT(20 10) +< SELECT fid, Area(g) FROM gis_polygon; +< fid Area(g) +< 108 100 +< 109 2400 +< 110 450 +< SELECT fid, AsText(ExteriorRing(g)) FROM gis_polygon; +< fid AsText(ExteriorRing(g)) +< 108 LINESTRING(10 10,20 10,20 20,10 20,10 10) +< 109 LINESTRING(0 0,50 0,50 50,0 50,0 0) +< 110 LINESTRING(0 0,30 0,30 30,0 0) +< SELECT fid, NumInteriorRings(g) FROM gis_polygon; +< fid NumInteriorRings(g) +< 108 0 +< 109 1 +< 110 0 +< SELECT fid, AsText(InteriorRingN(g, 1)) FROM gis_polygon; +< fid AsText(InteriorRingN(g, 1)) +< 108 NULL +< 109 LINESTRING(10 10,20 10,20 20,10 20,10 10) +< 110 NULL +< SELECT fid, IsClosed(g) FROM gis_multi_line; +< fid IsClosed(g) +< 114 0 +< 115 0 +< 116 0 +< SELECT fid, AsText(Centroid(g)) FROM gis_multi_polygon; +< fid AsText(Centroid(g)) +< 117 POINT(55.58852775304245 17.426536064113982) +< 118 POINT(55.58852775304245 17.426536064113982) +< 119 POINT(2 2) +< SELECT fid, Area(g) FROM gis_multi_polygon; +< fid Area(g) +< 117 1684.5 +< 118 1684.5 +< 119 4.5 +< SELECT fid, NumGeometries(g) from gis_multi_point; +< fid NumGeometries(g) +< 111 4 +< 112 4 +< 113 2 +< SELECT fid, NumGeometries(g) from gis_multi_line; +< fid NumGeometries(g) +< 114 2 +< 115 1 +< 116 2 +< SELECT fid, NumGeometries(g) from gis_multi_polygon; +< fid NumGeometries(g) +< 117 2 +< 118 2 +< 119 1 +< SELECT fid, NumGeometries(g) from gis_geometrycollection; +< fid NumGeometries(g) +< 120 2 +< 121 2 +< 122 0 +< 123 0 +< SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_point; +< fid AsText(GeometryN(g, 2)) +< 111 POINT(10 10) +< 112 POINT(11 11) +< 113 POINT(4 10) +< SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_line; +< fid AsText(GeometryN(g, 2)) +< 114 LINESTRING(16 0,16 23,16 48) +< 115 NULL +< 116 LINESTRING(2 5,5 8,21 7) +< SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_polygon; +< fid AsText(GeometryN(g, 2)) +< 117 POLYGON((59 18,67 18,67 13,59 13,59 18)) +< 118 POLYGON((59 18,67 18,67 13,59 13,59 18)) +< 119 NULL +< SELECT fid, AsText(GeometryN(g, 2)) from gis_geometrycollection; +< fid AsText(GeometryN(g, 2)) +< 120 LINESTRING(0 0,10 10) +< 121 LINESTRING(3 6,7 9) +< 122 NULL +< 123 NULL +< SELECT fid, AsText(GeometryN(g, 1)) from gis_geometrycollection; +< fid AsText(GeometryN(g, 1)) +< 120 POINT(0 0) +< 121 POINT(44 6) +< 122 NULL +< 123 NULL +< SELECT g1.fid as first, g2.fid as second, +< Within(g1.g, g2.g) as w, Contains(g1.g, g2.g) as c, Overlaps(g1.g, g2.g) as o, +< Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t, +< Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r +< FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second; +< first second w c o e d t i r +< 120 120 1 1 0 1 0 1 1 0 +< 120 121 0 0 1 0 0 0 1 0 +< 120 122 0 1 NULL 0 NULL 0 NULL 0 +< 120 123 0 1 NULL 0 NULL 0 NULL 0 +< 121 120 0 0 1 0 0 0 1 0 +< 121 121 1 1 0 1 0 1 1 0 +< 121 122 0 1 NULL 0 NULL 0 NULL 0 +< 121 123 0 1 NULL 0 NULL 0 NULL 0 +< 122 120 1 0 NULL 0 NULL 0 NULL 0 +< 122 121 1 0 NULL 0 NULL 0 NULL 0 +< 122 122 1 1 NULL 1 NULL 0 NULL 0 +< 122 123 1 1 NULL 1 NULL 0 NULL 0 +< 123 120 1 0 NULL 0 NULL 0 NULL 0 +< 123 121 1 0 NULL 0 NULL 0 NULL 0 +< 123 122 1 1 NULL 1 NULL 0 NULL 0 +< 123 123 1 1 NULL 1 NULL 0 NULL 0 +< DROP TABLE gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry; +< USE gis_ogs; +< # Lakes +< INSERT INTO lakes VALUES ( +< 101, 'BLUE LAKE', +< PolyFromText( +< 'POLYGON( +< (52 18,66 23,73 9,48 6,52 18), +< (59 18,67 18,67 13,59 13,59 18) +< )', +< 101)); +< # Road Segments +< INSERT INTO road_segments VALUES(102, 'Route 5', NULL, 2, +< LineFromText( +< 'LINESTRING( 0 18, 10 21, 16 23, 28 26, 44 31 )' ,101)); +< INSERT INTO road_segments VALUES(103, 'Route 5', 'Main Street', 4, +< LineFromText( +< 'LINESTRING( 44 31, 56 34, 70 38 )' ,101)); +< INSERT INTO road_segments VALUES(104, 'Route 5', NULL, 2, +< LineFromText( +< 'LINESTRING( 70 38, 72 48 )' ,101)); +< INSERT INTO road_segments VALUES(105, 'Main Street', NULL, 4, +< LineFromText( +< 'LINESTRING( 70 38, 84 42 )' ,101)); +< INSERT INTO road_segments VALUES(106, 'Dirt Road by Green Forest', NULL, +< 1, +< LineFromText( +< 'LINESTRING( 28 26, 28 0 )',101)); +< # DividedRoutes +< INSERT INTO divided_routes VALUES(119, 'Route 75', 4, +< MLineFromText( +< 'MULTILINESTRING((10 48,10 21,10 0), +< (16 0,16 23,16 48))', 101)); +< # Forests +< INSERT INTO forests VALUES(109, 'Green Forest', +< MPolyFromText( +< 'MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26), +< (52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))', +< 101)); +< # Bridges +< INSERT INTO bridges VALUES(110, 'Cam Bridge', PointFromText( +< 'POINT( 44 31 )', 101)); +< # Streams +< INSERT INTO streams VALUES(111, 'Cam Stream', +< LineFromText( +< 'LINESTRING( 38 48, 44 41, 41 36, 44 31, 52 18 )', 101)); +< INSERT INTO streams VALUES(112, NULL, +< LineFromText( +< 'LINESTRING( 76 0, 78 4, 73 9 )', 101)); +< # Buildings +< INSERT INTO buildings VALUES(113, '123 Main Street', +< PointFromText( +< 'POINT( 52 30 )', 101), +< PolyFromText( +< 'POLYGON( ( 50 31, 54 31, 54 29, 50 29, 50 31) )', 101)); +< INSERT INTO buildings VALUES(114, '215 Main Street', +< PointFromText( +< 'POINT( 64 33 )', 101), +< PolyFromText( +< 'POLYGON( ( 66 34, 62 34, 62 32, 66 32, 66 34) )', 101)); +< # Ponds +< INSERT INTO ponds VALUES(120, NULL, 'Stock Pond', +< MPolyFromText( +< 'MULTIPOLYGON( ( ( 24 44, 22 42, 24 40, 24 44) ), +< ( ( 26 44, 26 40, 28 42, 26 44) ) )', 101)); +< # Named Places +< INSERT INTO named_places VALUES(117, 'Ashton', +< PolyFromText( +< 'POLYGON( ( 62 48, 84 48, 84 30, 56 30, 56 34, 62 48) )', 101)); +< INSERT INTO named_places VALUES(118, 'Goose Island', +< PolyFromText( +< 'POLYGON( ( 67 13, 67 18, 59 18, 59 13, 67 13) )', 101)); +< # Map Neatlines +< INSERT INTO map_neatlines VALUES(115, +< PolyFromText( +< 'POLYGON( ( 0 0, 0 48, 84 48, 84 0, 0 0 ) )', 101)); +< SELECT Dimension(shore) +< FROM lakes +< WHERE name = 'Blue Lake'; +< Dimension(shore) +< 2 +< SELECT GeometryType(centerlines) +< FROM divided_routes +< WHERE name = 'Route 75'; +< GeometryType(centerlines) +< MULTILINESTRING +< SELECT AsText(boundary) +< FROM named_places +< WHERE name = 'Goose Island'; +< AsText(boundary) +< POLYGON((67 13,67 18,59 18,59 13,67 13)) +< SELECT AsText(PolyFromWKB(AsBinary(boundary),101)) +< FROM named_places +< WHERE name = 'Goose Island'; +< AsText(PolyFromWKB(AsBinary(boundary),101)) +< POLYGON((67 13,67 18,59 18,59 13,67 13)) +< SELECT SRID(boundary) +< FROM named_places +< WHERE name = 'Goose Island'; +< SRID(boundary) +< 101 +< SELECT IsEmpty(centerline) +< FROM road_segments +< WHERE name = 'Route 5' +< AND aliases = 'Main Street'; +< IsEmpty(centerline) +< 0 +< SELECT AsText(Envelope(boundary)) +< FROM named_places +< WHERE name = 'Goose Island'; +< AsText(Envelope(boundary)) +< POLYGON((59 13,67 13,67 18,59 18,59 13)) +< SELECT X(position) +< FROM bridges +< WHERE name = 'Cam Bridge'; +< X(position) +< 44 +< SELECT Y(position) +< FROM bridges +< WHERE name = 'Cam Bridge'; +< Y(position) +< 31 +< SELECT AsText(StartPoint(centerline)) +< FROM road_segments +< WHERE fid = 102; +< AsText(StartPoint(centerline)) +< POINT(0 18) +< SELECT AsText(EndPoint(centerline)) +< FROM road_segments +< WHERE fid = 102; +< AsText(EndPoint(centerline)) +< POINT(44 31) +< SELECT GLength(centerline) +< FROM road_segments +< WHERE fid = 106; +< GLength(centerline) +< 26 +< SELECT NumPoints(centerline) +< FROM road_segments +< WHERE fid = 102; +< NumPoints(centerline) +< 5 +< SELECT AsText(PointN(centerline, 1)) +< FROM road_segments +< WHERE fid = 102; +< AsText(PointN(centerline, 1)) +< POINT(0 18) +< SELECT AsText(Centroid(boundary)) +< FROM named_places +< WHERE name = 'Goose Island'; +< AsText(Centroid(boundary)) +< POINT(63 15.5) +< SELECT Area(boundary) +< FROM named_places +< WHERE name = 'Goose Island'; +< Area(boundary) +< 40 +< SELECT AsText(ExteriorRing(shore)) +< FROM lakes +< WHERE name = 'Blue Lake'; +< AsText(ExteriorRing(shore)) +< LINESTRING(52 18,66 23,73 9,48 6,52 18) +< SELECT NumInteriorRings(shore) +< FROM lakes +< WHERE name = 'Blue Lake'; +< NumInteriorRings(shore) +< 1 +< SELECT AsText(InteriorRingN(shore, 1)) +< FROM lakes +< WHERE name = 'Blue Lake'; +< AsText(InteriorRingN(shore, 1)) +< LINESTRING(59 18,67 18,67 13,59 13,59 18) +< SELECT NumGeometries(centerlines) +< FROM divided_routes +< WHERE name = 'Route 75'; +< NumGeometries(centerlines) +< 2 +< SELECT AsText(GeometryN(centerlines, 2)) +< FROM divided_routes +< WHERE name = 'Route 75'; +< AsText(GeometryN(centerlines, 2)) +< LINESTRING(16 0,16 23,16 48) +< SELECT IsClosed(centerlines) +< FROM divided_routes +< WHERE name = 'Route 75'; +< IsClosed(centerlines) +< 0 +< SELECT GLength(centerlines) +< FROM divided_routes +< WHERE name = 'Route 75'; +< GLength(centerlines) +< 96 +< SELECT AsText(Centroid(shores)) +< FROM ponds +< WHERE fid = 120; +< AsText(Centroid(shores)) +< POINT(25 42) +< SELECT Area(shores) +< FROM ponds +< WHERE fid = 120; +< Area(shores) +< 8 +< SELECT ST_Equals(boundary, +< PolyFromText('POLYGON( ( 67 13, 67 18, 59 18, 59 13, 67 13) )',1)) +< FROM named_places +< WHERE name = 'Goose Island'; +< ST_Equals(boundary, +< PolyFromText('POLYGON( ( 67 13, 67 18, 59 18, 59 13, 67 13) )',1)) +< 1 +< SELECT ST_Disjoint(centerlines, boundary) +< FROM divided_routes, named_places +< WHERE divided_routes.name = 'Route 75' +< AND named_places.name = 'Ashton'; +< ST_Disjoint(centerlines, boundary) +< 1 +< SELECT ST_Touches(centerline, shore) +< FROM streams, lakes +< WHERE streams.name = 'Cam Stream' +< AND lakes.name = 'Blue Lake'; +< ST_Touches(centerline, shore) +< 1 +< SELECT Crosses(road_segments.centerline, divided_routes.centerlines) +< FROM road_segments, divided_routes +< WHERE road_segments.fid = 102 +< AND divided_routes.name = 'Route 75'; +< Crosses(road_segments.centerline, divided_routes.centerlines) +< 1 +< SELECT ST_Intersects(road_segments.centerline, divided_routes.centerlines) +< FROM road_segments, divided_routes +< WHERE road_segments.fid = 102 +< AND divided_routes.name = 'Route 75'; +< ST_Intersects(road_segments.centerline, divided_routes.centerlines) +< 1 +< SELECT ST_Contains(forests.boundary, named_places.boundary) +< FROM forests, named_places +< WHERE forests.name = 'Green Forest' +< AND named_places.name = 'Ashton'; +< ST_Contains(forests.boundary, named_places.boundary) +< 0 +< SELECT ST_Distance(position, boundary) +< FROM bridges, named_places +< WHERE bridges.name = 'Cam Bridge' +< AND named_places.name = 'Ashton'; +< ST_Distance(position, boundary) +< 12 +< SELECT AsText(ST_Difference(named_places.boundary, forests.boundary)) +< FROM named_places, forests +< WHERE named_places.name = 'Ashton' +< AND forests.name = 'Green Forest'; +< AsText(ST_Difference(named_places.boundary, forests.boundary)) +< POLYGON((56 34,62 48,84 48,84 42,56 34)) +< SELECT AsText(ST_Union(shore, boundary)) +< FROM lakes, named_places +< WHERE lakes.name = 'Blue Lake' +< AND named_places.name = 'Goose Island'; +< AsText(ST_Union(shore, boundary)) +< POLYGON((48 6,52 18,66 23,73 9,48 6)) +< SELECT AsText(ST_SymDifference(shore, boundary)) +< FROM lakes, named_places +< WHERE lakes.name = 'Blue Lake' +< AND named_places.name = 'Ashton'; +< AsText(ST_SymDifference(shore, boundary)) +< MULTIPOLYGON(((48 6,52 18,66 23,73 9,48 6),(59 13,59 18,67 18,67 13,59 13)),((56 30,56 34,62 48,84 48,84 30,56 30))) +< SELECT count(*) +< FROM buildings, bridges +< WHERE ST_Contains(ST_Buffer(bridges.position, 15.0), buildings.footprint) = 1; +< count(*) +< 1 +--- +> ERROR 42000: The storage engine for the table doesn't support GEOMETRY +> # ERROR: Statement ended with errno 1178, errname ER_CHECK_NOT_IMPLEMENTED (expected to succeed) +> # ------------ UNEXPECTED RESULT ------------ +> # [ CREATE TABLE gis_point (fid INT(11) /*!*/ /*Custom column options*/, g POINT NOT NULL, SPATIAL INDEX(g)) ENGINE=MRG_MYISAM /*!*/ /*Custom table options*/ UNION(mrg.gis_point) INSERT_METHOD=LAST ] +> # The statement|command finished with ER_CHECK_NOT_IMPLEMENTED. +> # Geometry types or spatial indexes or the mix could be unsupported|malfunctioning, or the problem was caused by previous errors. +> # You can change the engine code, or create an rdiff, or disable the test by adding it to disabled.def. +> # Further in this test, the message might sometimes be suppressed; a part of the test might be skipped. +> # Also, this problem may cause a chain effect (more errors of different kinds in the test). +> # ------------------------------------------- diff --git a/storage/myisammrg/mysql-test/storage_engine/vcol.rdiff b/storage/myisammrg/mysql-test/storage_engine/vcol.rdiff new file mode 100644 index 00000000000..20431a9c713 --- /dev/null +++ b/storage/myisammrg/mysql-test/storage_engine/vcol.rdiff @@ -0,0 +1,79 @@ +3,69c3,12 +< SHOW COLUMNS IN t1; +< Field Type Null Key Default Extra +< a int(11) # # +< b int(11) # # VIRTUAL +< INSERT INTO t1 (a) VALUES (1),(2); +< INSERT INTO t1 (a,b) VALUES (3,3),(4,4); +< Warnings: +< Warning 1906 The value specified for computed column 'b' in table 't1' ignored +< Warning 1906 The value specified for computed column 'b' in table 't1' ignored +< SELECT * FROM t1; +< a b +< 1 2 +< 2 3 +< 3 4 +< 4 5 +< DROP TABLE t1; +< CREATE TABLE t1 (a <INT_COLUMN>, b <INT_COLUMN> GENERATED ALWAYS AS (a+1) PERSISTENT) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +< SHOW COLUMNS IN t1; +< Field Type Null Key Default Extra +< a int(11) # # +< b int(11) # # PERSISTENT +< INSERT INTO t1 (a) VALUES (1),(2); +< INSERT INTO t1 (a,b) VALUES (3,3),(4,4); +< Warnings: +< Warning 1906 The value specified for computed column 'b' in table 't1' ignored +< Warning 1906 The value specified for computed column 'b' in table 't1' ignored +< SELECT * FROM t1; +< a b +< 1 2 +< 2 3 +< 3 4 +< 4 5 +< DROP TABLE t1; +< CREATE TABLE t1 (a <INT_COLUMN>, b <INT_COLUMN> GENERATED ALWAYS AS (a+1) VIRTUAL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +< SHOW COLUMNS IN t1; +< Field Type Null Key Default Extra +< a int(11) # # +< b int(11) # # VIRTUAL +< INSERT INTO t1 (a) VALUES (1),(2); +< INSERT INTO t1 (a,b) VALUES (3,3),(4,4); +< Warnings: +< Warning 1906 The value specified for computed column 'b' in table 't1' ignored +< Warning 1906 The value specified for computed column 'b' in table 't1' ignored +< SELECT * FROM t1; +< a b +< 1 2 +< 2 3 +< 3 4 +< 4 5 +< DROP TABLE t1; +< CREATE TABLE t1 (a <INT_COLUMN>, b <INT_COLUMN> AS (a+1) PERSISTENT) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; +< SHOW COLUMNS IN t1; +< Field Type Null Key Default Extra +< a int(11) # # +< b int(11) # # PERSISTENT +< INSERT INTO t1 (a) VALUES (1),(2); +< INSERT INTO t1 (a,b) VALUES (3,3),(4,4); +< Warnings: +< Warning 1906 The value specified for computed column 'b' in table 't1' ignored +< Warning 1906 The value specified for computed column 'b' in table 't1' ignored +< SELECT * FROM t1; +< a b +< 1 2 +< 2 3 +< 3 4 +< 4 5 +< DROP TABLE t1; +--- +> ERROR HY000: MRG_MYISAM storage engine does not support computed columns +> # ERROR: Statement ended with errno 1910, errname ER_UNSUPPORTED_ENGINE_FOR_VIRTUAL_COLUMNS (expected to succeed) +> # ------------ UNEXPECTED RESULT ------------ +> # [ CREATE TABLE t1 (a INT(11) /*!*/ /*Custom column options*/, b INT(11) /*!*/ /*Custom column options*/ GENERATED ALWAYS AS (a+1)) ENGINE=MRG_MYISAM /*!*/ /*Custom table options*/ UNION(mrg.t1) INSERT_METHOD=LAST ] +> # The statement|command finished with ER_UNSUPPORTED_ENGINE_FOR_VIRTUAL_COLUMNS. +> # Virtual columns or the mix could be unsupported|malfunctioning, or the problem was caused by previous errors. +> # You can change the engine code, or create an rdiff, or disable the test by adding it to disabled.def. +> # Further in this test, the message might sometimes be suppressed; a part of the test might be skipped. +> # Also, this problem may cause a chain effect (more errors of different kinds in the test). +> # ------------------------------------------- diff --git a/storage/oqgraph/CMakeLists.txt b/storage/oqgraph/CMakeLists.txt index 4b8dac20350..83acb99b2a2 100644 --- a/storage/oqgraph/CMakeLists.txt +++ b/storage/oqgraph/CMakeLists.txt @@ -1,14 +1,24 @@ -FIND_PACKAGE(Boost 1.45.0) # we need at least 1.45 if we want -fno-rtti for the server +FIND_PACKAGE(Boost 1.40.0) IF(NOT Boost_FOUND) RETURN() ENDIF() INCLUDE_DIRECTORIES(BEFORE ${Boost_INCLUDE_DIRS}) -# lp:756966 OQGRAPH on Win64 does not compile -IF(MSVC AND CMAKE_SIZEOF_VOID_P EQUAL 8) - SET(BOOST_OK 0) +IF(MSVC) + # lp:756966 OQGRAPH on Win64 does not compile + IF (CMAKE_SIZEOF_VOID_P EQUAL 8) + SET(BOOST_OK 0) + ELSE() + SET(BOOST_OK 1) + ENDIF() ELSE() - SET(BOOST_OK 1) +# See if that works. On old gcc it'll fail because of -fno-rtti +CHECK_CXX_SOURCE_COMPILES( +" +#include <boost/config.hpp> +#include <boost/property_map/property_map.hpp> +int main() { return 0; } +" BOOST_OK) ENDIF() IF(BOOST_OK) @@ -16,7 +26,7 @@ IF(BOOST_OK) IF(MSVC) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc") ELSE(MSVC) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated -fno-strict-aliasing") STRING(REPLACE "-fno-exceptions" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) STRING(REPLACE "-fno-implicit-templates" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) ENDIF(MSVC) diff --git a/storage/xtradb/btr/btr0btr.c b/storage/xtradb/btr/btr0btr.c index 1fa6df44f7c..d4a0ef5ec60 100644 --- a/storage/xtradb/btr/btr0btr.c +++ b/storage/xtradb/btr/btr0btr.c @@ -61,7 +61,7 @@ btr_corruption_report( buf_block_get_zip_size(block), BUF_PAGE_PRINT_NO_CRASH); } - buf_page_print(buf_block_get_frame(block), 0, 0); + buf_page_print(buf_block_get_frame_fast(block), 0, 0); } #ifdef UNIV_BLOB_DEBUG diff --git a/storage/xtradb/btr/btr0cur.c b/storage/xtradb/btr/btr0cur.c index e093dabebf1..26db7329b7e 100644 --- a/storage/xtradb/btr/btr0cur.c +++ b/storage/xtradb/btr/btr0cur.c @@ -3604,6 +3604,8 @@ btr_estimate_n_rows_in_range( n_rows = n_rows * 2; } + DBUG_EXECUTE_IF("bug14007649", return(n_rows);); + /* Do not estimate the number of rows in the range to over 1 / 2 of the estimated rows in the whole table */ diff --git a/storage/xtradb/buf/buf0flu.c b/storage/xtradb/buf/buf0flu.c index bb921928653..39351cd3678 100644 --- a/storage/xtradb/buf/buf0flu.c +++ b/storage/xtradb/buf/buf0flu.c @@ -1846,8 +1846,6 @@ buf_flush_batch( } #endif /* UNIV_DEBUG */ - srv_buf_pool_flushed += count; - return(count); } @@ -1874,13 +1872,6 @@ buf_flush_common( #endif /* UNIV_DEBUG */ srv_buf_pool_flushed += page_count; - - if (flush_type == BUF_FLUSH_LRU) { - /* We keep track of all flushes happening as part of LRU - flush. When estimating the desired rate at which flush_list - should be flushed we factor in this value. */ - buf_lru_flush_page_count += page_count; - } } /******************************************************************//** diff --git a/storage/xtradb/dict/dict0load.c b/storage/xtradb/dict/dict0load.c index 44492960bb8..0ef74ea8b7c 100644 --- a/storage/xtradb/dict/dict0load.c +++ b/storage/xtradb/dict/dict0load.c @@ -178,7 +178,7 @@ dict_print(void) monitor printout */ mutex_enter(&kernel_mutex); - srv_fatal_semaphore_wait_threshold += 7200; /* 2 hours */ + srv_fatal_semaphore_wait_threshold += SRV_SEMAPHORE_WAIT_EXTENSION; mutex_exit(&kernel_mutex); heap = mem_heap_create(1000); @@ -215,7 +215,7 @@ dict_print(void) /* Restore the fatal semaphore wait timeout */ mutex_enter(&kernel_mutex); - srv_fatal_semaphore_wait_threshold -= 7200; /* 2 hours */ + srv_fatal_semaphore_wait_threshold -= SRV_SEMAPHORE_WAIT_EXTENSION; mutex_exit(&kernel_mutex); } diff --git a/storage/xtradb/fil/fil0fil.c b/storage/xtradb/fil/fil0fil.c index 2b67bdafeb9..3dd00594ee5 100644 --- a/storage/xtradb/fil/fil0fil.c +++ b/storage/xtradb/fil/fil0fil.c @@ -1932,7 +1932,7 @@ fil_inc_pending_ops( if (space == NULL) { fprintf(stderr, - "InnoDB: Error: trying to do ibuf merge to a" + "InnoDB: Error: trying to do an operation on a" " dropped tablespace %lu\n", (ulong) id); } @@ -3440,6 +3440,7 @@ skip_info: for (offset = 0; offset < free_limit_bytes; offset += zip_size ? zip_size : UNIV_PAGE_SIZE) { ibool page_is_corrupt; + ibool is_descr_page = FALSE; success = os_file_read(file, page, (ulint)(offset & 0xFFFFFFFFUL), @@ -3478,6 +3479,7 @@ skip_info: /* store as descr page */ memcpy(descr_page, page, (zip_size ? zip_size : UNIV_PAGE_SIZE)); + is_descr_page = TRUE; } else if (descr_is_corrupt) { /* unknown state of the page */ @@ -3554,7 +3556,8 @@ skip_info: } } - if (fil_page_get_type(page) == FIL_PAGE_INDEX) { + if (fil_page_get_type(page) == + FIL_PAGE_INDEX && !is_descr_page) { index_id_t tmp = mach_read_from_8(page + (PAGE_HEADER + PAGE_INDEX_ID)); for (i = 0; i < n_index; i++) { diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc index 0a33fcdad8f..db0bd40c9b6 100644 --- a/storage/xtradb/handler/ha_innodb.cc +++ b/storage/xtradb/handler/ha_innodb.cc @@ -4701,6 +4701,27 @@ table_opened: } UNIV_INTERN +handler* +ha_innobase::clone( +/*===============*/ + const char* name, /*!< in: table name */ + MEM_ROOT* mem_root) /*!< in: memory context */ +{ + ha_innobase* new_handler; + + DBUG_ENTER("ha_innobase::clone"); + + new_handler = static_cast<ha_innobase*>(handler::clone(name, + mem_root)); + if (new_handler) { + new_handler->prebuilt->select_lock_type + = prebuilt->select_lock_type; + } + + DBUG_RETURN(new_handler); +} + +UNIV_INTERN uint ha_innobase::max_supported_key_part_length() const { @@ -9281,9 +9302,10 @@ ha_innobase::info_low( } else if (rec_per_key > 1) { rec_per_key = - (ha_rows) (k_rec_per_key * - (double)rec_per_key / - n_rows); + (ha_rows) + (k_rec_per_key * + (double)rec_per_key / + n_rows); } key_info->rec_per_key[k++]= @@ -9451,7 +9473,7 @@ ha_innobase::check( /* Enlarge the fatal lock wait timeout during CHECK TABLE. */ mutex_enter(&kernel_mutex); - srv_fatal_semaphore_wait_threshold += 7200; /* 2 hours */ + srv_fatal_semaphore_wait_threshold += SRV_SEMAPHORE_WAIT_EXTENSION; mutex_exit(&kernel_mutex); for (index = dict_table_get_first_index(prebuilt->table); @@ -9592,7 +9614,7 @@ ha_innobase::check( /* Restore the fatal lock wait timeout after CHECK TABLE. */ mutex_enter(&kernel_mutex); - srv_fatal_semaphore_wait_threshold -= 7200; /* 2 hours */ + srv_fatal_semaphore_wait_threshold -= SRV_SEMAPHORE_WAIT_EXTENSION; mutex_exit(&kernel_mutex); prebuilt->trx->op_info = ""; @@ -10474,6 +10496,7 @@ innodb_show_status( const long MAX_STATUS_SIZE = 1048576; ulint trx_list_start = ULINT_UNDEFINED; ulint trx_list_end = ULINT_UNDEFINED; + bool res; DBUG_ENTER("innodb_show_status"); DBUG_ASSERT(hton == innodb_hton_ptr); @@ -10537,12 +10560,13 @@ innodb_show_status( mutex_exit(&srv_monitor_file_mutex); - stat_print(thd, innobase_hton_name, (uint) strlen(innobase_hton_name), - STRING_WITH_LEN(""), str, flen); + res= stat_print(thd, innobase_hton_name, + (uint) strlen(innobase_hton_name), + STRING_WITH_LEN(""), str, flen); my_free(str); - DBUG_RETURN(FALSE); + DBUG_RETURN(res); } /************************************************************************//** @@ -12387,7 +12411,7 @@ static MYSQL_SYSVAR_BOOL(doublewrite, innobase_use_doublewrite, static MYSQL_SYSVAR_ULONG(io_capacity, srv_io_capacity, PLUGIN_VAR_RQCMDARG, "Number of IOPs the server can do. Tunes the background IO rate", - NULL, NULL, 200, 100, ~0L, 0); + NULL, NULL, 200, 100, ~ (ulong) 0L, 0); static MYSQL_SYSVAR_ULONG(purge_batch_size, srv_purge_batch_size, PLUGIN_VAR_OPCMDARG, @@ -12520,7 +12544,7 @@ static MYSQL_SYSVAR_BOOL(adaptive_flushing, srv_adaptive_flushing, static MYSQL_SYSVAR_ULONG(max_purge_lag, srv_max_purge_lag, PLUGIN_VAR_RQCMDARG, "Desired maximum length of the purge queue (0 = no limit)", - NULL, NULL, 0, 0, ~0L, 0); + NULL, NULL, 0, 0, ~(ulong) 0L, 0); static MYSQL_SYSVAR_BOOL(rollback_on_timeout, innobase_rollback_on_timeout, PLUGIN_VAR_OPCMDARG | PLUGIN_VAR_READONLY, @@ -12624,7 +12648,7 @@ static MYSQL_SYSVAR_ULONG(commit_concurrency, innobase_commit_concurrency, static MYSQL_SYSVAR_ULONG(concurrency_tickets, srv_n_free_tickets_to_enter, PLUGIN_VAR_RQCMDARG, "Number of times a thread is allowed to enter InnoDB within the same SQL query after it has once got the ticket", - NULL, NULL, 500L, 1L, ~0L, 0); + NULL, NULL, 500L, 1L, ~(ulong) 0L, 0); #ifdef EXTENDED_FOR_KILLIDLE #define kill_idle_help_text "If non-zero value, the idle session with transaction which is idle over the value in seconds is killed by InnoDB." @@ -12694,12 +12718,12 @@ static MYSQL_SYSVAR_LONG(open_files, innobase_open_files, static MYSQL_SYSVAR_ULONG(sync_spin_loops, srv_n_spin_wait_rounds, PLUGIN_VAR_RQCMDARG, "Count of spin-loop rounds in InnoDB mutexes (30 by default)", - NULL, NULL, 30L, 0L, ~0L, 0); + NULL, NULL, 30L, 0L, ~ (ulong) 0L, 0); static MYSQL_SYSVAR_ULONG(spin_wait_delay, srv_spin_wait_delay, PLUGIN_VAR_OPCMDARG, "Maximum delay between polling for a spin lock (6 by default)", - NULL, NULL, 6L, 0L, ~0L, 0); + NULL, NULL, 6L, 0L, ~ (ulong) 0L, 0); static MYSQL_SYSVAR_BOOL(thread_concurrency_timer_based, innobase_thread_concurrency_timer_based, @@ -12715,7 +12739,7 @@ static MYSQL_SYSVAR_ULONG(thread_concurrency, srv_thread_concurrency, static MYSQL_SYSVAR_ULONG(thread_sleep_delay, srv_thread_sleep_delay, PLUGIN_VAR_RQCMDARG, "Time of innodb thread sleeping before joining InnoDB queue (usec). Value 0 disable a sleep", - NULL, NULL, 10000L, 0L, ~0L, 0); + NULL, NULL, 10000L, 0L, ~ (ulong) 0L, 0); static MYSQL_SYSVAR_STR(data_file_path, innobase_data_file_path, PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, diff --git a/storage/xtradb/handler/ha_innodb.h b/storage/xtradb/handler/ha_innodb.h index b48805ad0a5..933d75cf0d2 100644 --- a/storage/xtradb/handler/ha_innodb.h +++ b/storage/xtradb/handler/ha_innodb.h @@ -134,6 +134,7 @@ class ha_innobase: public handler const key_map* keys_to_use_for_scanning(); int open(const char *name, int mode, uint test_if_locked); + handler* clone(const char *name, MEM_ROOT *mem_root); int close(void); double scan_time(); double read_time(uint index, uint ranges, ha_rows rows); diff --git a/storage/xtradb/handler/i_s.cc b/storage/xtradb/handler/i_s.cc index 1c40b87bbbd..7c60b0f7775 100644 --- a/storage/xtradb/handler/i_s.cc +++ b/storage/xtradb/handler/i_s.cc @@ -1578,6 +1578,8 @@ i_s_sys_tables_fill_table( DBUG_ENTER("i_s_sys_tables_fill_table"); + RETURN_IF_INNODB_NOT_STARTED(tables->schema_table_name); + /* deny access to non-superusers */ if (check_global_access(thd, PROCESS_ACL)) { @@ -1833,6 +1835,8 @@ i_s_sys_tables_fill_table_stats( DBUG_ENTER("i_s_sys_tables_fill_table_stats"); + RETURN_IF_INNODB_NOT_STARTED(tables->schema_table_name); + /* deny access to non-superusers */ if (check_global_access(thd, PROCESS_ACL)) { @@ -2029,6 +2033,8 @@ i_s_sys_indexes_fill_table( DBUG_ENTER("i_s_sys_indexes_fill_table"); + RETURN_IF_INNODB_NOT_STARTED(tables->schema_table_name); + /* deny access to non-superusers */ if (check_global_access(thd, PROCESS_ACL)) { @@ -2218,6 +2224,8 @@ i_s_sys_columns_fill_table( DBUG_ENTER("i_s_sys_columns_fill_table"); + RETURN_IF_INNODB_NOT_STARTED(tables->schema_table_name); + /* deny access to non-superusers */ if (check_global_access(thd, PROCESS_ACL)) { @@ -2372,6 +2380,8 @@ i_s_sys_fields_fill_table( DBUG_ENTER("i_s_sys_fields_fill_table"); + RETURN_IF_INNODB_NOT_STARTED(tables->schema_table_name); + /* deny access to non-superusers */ if (check_global_access(thd, PROCESS_ACL)) { @@ -2553,6 +2563,8 @@ i_s_sys_foreign_fill_table( DBUG_ENTER("i_s_sys_foreign_fill_table"); + RETURN_IF_INNODB_NOT_STARTED(tables->schema_table_name); + /* deny access to non-superusers */ if (check_global_access(thd, PROCESS_ACL)) { @@ -2716,6 +2728,8 @@ i_s_sys_foreign_cols_fill_table( DBUG_ENTER("i_s_sys_foreign_cols_fill_table"); + RETURN_IF_INNODB_NOT_STARTED(tables->schema_table_name); + /* deny access to non-superusers */ if (check_global_access(thd, PROCESS_ACL)) { DBUG_RETURN(0); @@ -2883,6 +2897,8 @@ i_s_sys_stats_fill_table( DBUG_ENTER("i_s_sys_stats_fill_table"); + RETURN_IF_INNODB_NOT_STARTED(tables->schema_table_name); + /* deny access to non-superusers */ if (check_global_access(thd, PROCESS_ACL)) { DBUG_RETURN(0); @@ -3199,6 +3215,8 @@ i_s_innodb_table_stats_fill( DBUG_ENTER("i_s_innodb_table_stats_fill"); + RETURN_IF_INNODB_NOT_STARTED(tables->schema_table_name); + /* deny access to non-superusers */ if (check_global_access(thd, PROCESS_ACL)) { DBUG_RETURN(0); @@ -3262,6 +3280,8 @@ i_s_innodb_index_stats_fill( DBUG_ENTER("i_s_innodb_index_stats_fill"); + RETURN_IF_INNODB_NOT_STARTED(tables->schema_table_name); + /* deny access to non-superusers */ if (check_global_access(thd, PROCESS_ACL)) { DBUG_RETURN(0); @@ -3422,6 +3442,8 @@ i_s_innodb_admin_command_fill( DBUG_ENTER("i_s_innodb_admin_command_fill"); + RETURN_IF_INNODB_NOT_STARTED(tables->schema_table_name); + /* deny access to non-superusers */ if (check_global_access(thd, PROCESS_ACL)) { DBUG_RETURN(0); diff --git a/storage/xtradb/include/buf0buf.h b/storage/xtradb/include/buf0buf.h index 7502942d681..5f8220de18d 100644 --- a/storage/xtradb/include/buf0buf.h +++ b/storage/xtradb/include/buf0buf.h @@ -1063,8 +1063,10 @@ buf_block_get_frame( /*================*/ const buf_block_t* block) /*!< in: pointer to the control block */ __attribute__((pure)); +# define buf_block_get_frame_fast(block) buf_block_get_frame(block) #else /* UNIV_DEBUG */ # define buf_block_get_frame(block) (block ? (block)->frame : 0) +# define buf_block_get_frame_fast(block) (block)->frame #endif /* UNIV_DEBUG */ /*********************************************************************//** Gets the space id of a block. diff --git a/storage/xtradb/include/srv0srv.h b/storage/xtradb/include/srv0srv.h index e6db7fab158..d99fbfb9463 100644 --- a/storage/xtradb/include/srv0srv.h +++ b/storage/xtradb/include/srv0srv.h @@ -301,6 +301,7 @@ extern ibool srv_print_latch_waits; extern ulint srv_activity_count; extern ulint srv_fatal_semaphore_wait_threshold; +#define SRV_SEMAPHORE_WAIT_EXTENSION 7200 extern ulint srv_dml_needed_delay; extern long long srv_kill_idle_transaction; diff --git a/storage/xtradb/include/univ.i b/storage/xtradb/include/univ.i index f4b06ccefa4..d54b467d2c1 100644 --- a/storage/xtradb/include/univ.i +++ b/storage/xtradb/include/univ.i @@ -54,10 +54,7 @@ Created 1/20/1994 Heikki Tuuri #define INNODB_VERSION_BUGFIX 8 #ifndef PERCONA_INNODB_VERSION -/* this is *not* the version of XtraDB as in Percona-Server sources, - but the version of Percona-Server, where this XtraDB was taken from. - Because Percona does not update XtraDB version for every release */ -#define PERCONA_INNODB_VERSION 26.0 +#define PERCONA_INNODB_VERSION 27.0 #endif /* The following is the InnoDB version as shown in diff --git a/storage/xtradb/log/log0recv.c b/storage/xtradb/log/log0recv.c index c4429af5112..a554c576b6d 100644 --- a/storage/xtradb/log/log0recv.c +++ b/storage/xtradb/log/log0recv.c @@ -2980,7 +2980,7 @@ recv_recovery_from_checkpoint_start_func( ib_uint64_t checkpoint_lsn; ib_uint64_t checkpoint_no; ib_uint64_t old_scanned_lsn; - ib_uint64_t group_scanned_lsn; + ib_uint64_t group_scanned_lsn= 0; ib_uint64_t contiguous_lsn; #ifdef UNIV_LOG_ARCHIVE ib_uint64_t archived_lsn; diff --git a/storage/xtradb/srv/srv0start.c b/storage/xtradb/srv/srv0start.c index 75e8097ee0b..d1329f445aa 100644 --- a/storage/xtradb/srv/srv0start.c +++ b/storage/xtradb/srv/srv0start.c @@ -1512,8 +1512,7 @@ innobase_start_or_create_for_mysql(void) if (!os_aio_init(io_limit, srv_n_read_io_threads, srv_n_write_io_threads, - SRV_MAX_N_PENDING_SYNC_IOS)) - { + SRV_MAX_N_PENDING_SYNC_IOS)) { ut_print_timestamp(stderr); fprintf(stderr, " InnoDB: Fatal error: cannot initialize AIO" diff --git a/storage/xtradb/sync/sync0arr.c b/storage/xtradb/sync/sync0arr.c index b47c32f5bbf..5f293ad6a55 100644 --- a/storage/xtradb/sync/sync0arr.c +++ b/storage/xtradb/sync/sync0arr.c @@ -926,6 +926,11 @@ sync_array_print_long_waits( ibool fatal = FALSE; double longest_diff = 0; + /* For huge tables, skip the check during CHECK TABLE etc... */ + if (fatal_timeout > SRV_SEMAPHORE_WAIT_EXTENSION) { + return(FALSE); + } + #ifdef UNIV_DEBUG_VALGRIND /* Increase the timeouts if running under valgrind because it executes extremely slowly. UNIV_DEBUG_VALGRIND does not necessary mean that diff --git a/strings/ctype-ucs2.c b/strings/ctype-ucs2.c index f4ae1306c2e..52eaece5528 100644 --- a/strings/ctype-ucs2.c +++ b/strings/ctype-ucs2.c @@ -2317,13 +2317,18 @@ void my_fill_utf32(CHARSET_INFO *cs, char *s, size_t slen, int fill) { char buf[10]; - uint __attribute__((unused)) buflen; +#ifndef DBUG_OFF + uint buflen; +#endif char *e= s + slen; DBUG_ASSERT((slen % 4) == 0); - buflen= cs->cset->wc_mb(cs, (my_wc_t) fill, (uchar*) buf, - (uchar*) buf + sizeof(buf)); +#ifndef DBUG_OFF + buflen= +#endif + cs->cset->wc_mb(cs, (my_wc_t) fill, (uchar*) buf, + (uchar*) buf + sizeof(buf)); DBUG_ASSERT(buflen == 4); while (s < e) { diff --git a/strings/my_vsnprintf.c b/strings/my_vsnprintf.c index 7ef0ebf7a12..ccd58bcf8f7 100644 --- a/strings/my_vsnprintf.c +++ b/strings/my_vsnprintf.c @@ -730,8 +730,53 @@ size_t my_snprintf(char* to, size_t n, const char* fmt, ...) int my_vfprintf(FILE *stream, const char* format, va_list args) { char cvtbuf[1024]; - (void) my_vsnprintf(cvtbuf, sizeof(cvtbuf), format, args); - return fprintf(stream, "%s\n", cvtbuf); + int alloc= 0; + char *p= cvtbuf; + size_t cur_len= sizeof(cvtbuf); + int ret; + + /* + We do not know how much buffer we need. + So start with a reasonably-sized stack-allocated buffer, and increase + it exponentially until it is big enough. + */ + for (;;) + { + size_t new_len; + size_t actual= my_vsnprintf(p, cur_len, format, args); + if (actual < cur_len - 1) + break; + /* + Not enough space (or just enough with nothing to spare - but we cannot + distinguish this case from the return value). Allocate a bigger buffer + and try again. + */ + if (alloc) + (*my_str_free)(p); + else + alloc= 1; + new_len= cur_len*2; + if (new_len < cur_len) + return 0; /* Overflow */ + cur_len= new_len; + p= (*my_str_malloc)(cur_len); + if (!p) + return 0; + } + ret= fprintf(stream, "%s", p); + if (alloc) + (*my_str_free)(p); + return ret; +} + +int my_fprintf(FILE *stream, const char* format, ...) +{ + int result; + va_list args; + va_start(args, format); + result= my_vfprintf(stream, format, args); + va_end(args); + return result; } diff --git a/support-files/compiler_warnings.supp b/support-files/compiler_warnings.supp index 4d8478828c2..e18c44bf5ed 100644 --- a/support-files/compiler_warnings.supp +++ b/support-files/compiler_warnings.supp @@ -171,6 +171,7 @@ vio/viosslfactories\.c: discards ~const~ qualifier from pointer target type # .*/my_config\.h : _FILE_OFFSET_BITS /usr/include/sys/feature_tests.h : this is the location of the previous definition +.*auth_pam\.c : initialization from incompatible pointer type : 100-200 # # Unexplanable (?) stuff diff --git a/support-files/my-huge.cnf.sh b/support-files/my-huge.cnf.sh index 896b139273b..4e083488285 100644 --- a/support-files/my-huge.cnf.sh +++ b/support-files/my-huge.cnf.sh @@ -121,7 +121,7 @@ server-id = 1 # Uncomment the following if you are using InnoDB tables #innodb_data_home_dir = @localstatedir@ #innodb_data_file_path = ibdata1:2000M;ibdata2:10M:autoextend -o#innodb_log_group_home_dir = @localstatedir@ +#innodb_log_group_home_dir = @localstatedir@ # You can set .._buffer_pool_size up to 50 - 80 % # of RAM but beware of setting memory usage too high #innodb_buffer_pool_size = 384M diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index a3d8554188e..5b9a296d90a 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -176,7 +176,7 @@ %endif %else %if %(test -f /etc/SuSE-release && echo 1 || echo 0) - %define susever %(rpm -qf --qf '%%{version}\\n' /etc/SuSE-release) + %define susever %(rpm -qf --qf '%%{version}\\n' /etc/SuSE-release | cut -d. -f1) %if "%susever" == "10" %define distro_description SUSE Linux Enterprise Server 10 %define distro_releasetag sles10 diff --git a/tests/mysql_client_fw.c b/tests/mysql_client_fw.c new file mode 100644 index 00000000000..979d47cb0b8 --- /dev/null +++ b/tests/mysql_client_fw.c @@ -0,0 +1,1440 @@ +/* Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include <my_global.h> +#include <my_sys.h> +#include <mysql.h> +#include <errmsg.h> +#include <my_compare.h> +#include <my_getopt.h> +#include <m_string.h> +#include <mysqld_error.h> +#include <sql_common.h> +#include <mysql/client_plugin.h> + +/* + If non_blocking_api_enabled is true, we will re-define all the blocking + API functions as wrappers that call the corresponding non-blocking API + and use poll()/select() to wait for them to complete. This way we can get + a good coverage testing of the non-blocking API as well. +*/ +static my_bool non_blocking_api_enabled= 0; +#if !defined(EMBEDDED_LIBRARY) +#define WRAP_NONBLOCK_ENABLED non_blocking_api_enabled +#include "nonblock-wrappers.h" +#endif + +#define VER "2.1" +#define MAX_TEST_QUERY_LENGTH 300 /* MAX QUERY BUFFER LENGTH */ +#define MAX_KEY MAX_INDEXES +#define MAX_SERVER_ARGS 64 + +/* set default options */ +static int opt_testcase __attribute__((unused)) = 0; +static char *opt_db= 0; +static char *opt_user= 0; +static char *opt_password= 0; +static char *opt_host= 0; +static char *opt_unix_socket= 0; +#ifdef HAVE_SMEM +static char *shared_memory_base_name= 0; +#endif +static unsigned int opt_port; +static my_bool tty_password= 0, opt_silent= 0; + +static MYSQL *mysql= 0; +static char current_db[]= "client_test_db"; +static unsigned int test_count= 0; +static unsigned int opt_count= 0; +static unsigned int iter_count= 0; +static my_bool have_innodb= FALSE; +static char *opt_plugin_dir= 0, *opt_default_auth= 0; + +static const char *opt_basedir= "./"; +static const char *opt_vardir= "mysql-test/var"; + +static longlong opt_getopt_ll_test= 0; + +static int embedded_server_arg_count= 0; +static char *embedded_server_args[MAX_SERVER_ARGS]; + +static const char *embedded_server_groups[]= { + "server", + "embedded", + "mysql_client_test_SERVER", + NullS +}; + +static time_t start_time, end_time; +static double total_time; + +const char *default_dbug_option= "d:t:o,/tmp/mysql_client_test.trace"; + +struct my_tests_st +{ + const char *name; + void (*function)(); +}; + +#define myheader(str) \ +DBUG_PRINT("test", ("name: %s", str)); \ + if (opt_silent < 2) \ + { \ + fprintf(stdout, "\n\n#####################################\n"); \ + fprintf(stdout, "%u of (%u/%u): %s", test_count++, iter_count, \ + opt_count, str); \ + fprintf(stdout, " \n#####################################\n"); \ + } + +#define myheader_r(str) \ +DBUG_PRINT("test", ("name: %s", str)); \ + if (!opt_silent) \ + { \ + fprintf(stdout, "\n\n#####################################\n"); \ + fprintf(stdout, "%s", str); \ + fprintf(stdout, " \n#####################################\n"); \ + } + +static void print_error(const char *msg); +static void print_st_error(MYSQL_STMT *stmt, const char *msg); +static void client_disconnect(MYSQL* mysql, my_bool drop_db); + + +/* + Abort unless given experssion is non-zero. + + SYNOPSIS + DIE_UNLESS(expr) + + DESCRIPTION + We can't use any kind of system assert as we need to + preserve tested invariants in release builds as well. +*/ + +#define DIE_UNLESS(expr) \ + ((void) ((expr) ? 0 : (die(__FILE__, __LINE__, #expr), 0))) +#define DIE_IF(expr) \ + ((void) ((expr) ? (die(__FILE__, __LINE__, #expr), 0) : 0)) +#define DIE(expr) \ + die(__FILE__, __LINE__, #expr) + +static void die(const char *file, int line, const char *expr) +{ + fflush(stdout); + fprintf(stderr, "%s:%d: check failed: '%s'\n", file, line, expr); + fflush(stderr); + exit(1); +} + + +#define myerror(msg) print_error(msg) +#define mysterror(stmt, msg) print_st_error(stmt, msg) + +#define myquery(RES) \ +{ \ + int r= (RES); \ + if (r) \ + myerror(NULL); \ + DIE_UNLESS(r == 0); \ +} + +#define myquery_r(r) \ +{ \ + if (r) \ + myerror(NULL); \ + DIE_UNLESS(r != 0); \ +} + +#define check_execute(stmt, r) \ +{ \ + if (r) \ + mysterror(stmt, NULL); \ + DIE_UNLESS(r == 0); \ +} + +#define check_execute_r(stmt, r) \ +{ \ + if (r) \ + mysterror(stmt, NULL); \ + DIE_UNLESS(r != 0); \ +} + +#define check_stmt(stmt) \ +{ \ + if ( stmt == 0) \ + myerror(NULL); \ + DIE_UNLESS(stmt != 0); \ +} + +#define check_stmt_r(stmt) \ +{ \ + if (stmt == 0) \ + myerror(NULL); \ + DIE_UNLESS(stmt == 0); \ +} + +#define mytest(x) if (!(x)) {myerror(NULL);DIE_UNLESS(FALSE);} +#define mytest_r(x) if ((x)) {myerror(NULL);DIE_UNLESS(FALSE);} + + +/* A workaround for Sun Forte 5.6 on Solaris x86 */ + +static int cmp_double(double *a, double *b) +{ + return *a == *b; +} + + +/* Print the error message */ + +static void print_error(const char *msg) +{ + if (!opt_silent) + { + if (mysql && mysql_errno(mysql)) + { + if (mysql->server_version) + fprintf(stdout, "\n [MySQL-%s]", mysql->server_version); + else + fprintf(stdout, "\n [MySQL]"); + fprintf(stdout, "[%d] %s\n", mysql_errno(mysql), mysql_error(mysql)); + } + else if (msg) + fprintf(stderr, " [MySQL] %s\n", msg); + } +} + + +static void print_st_error(MYSQL_STMT *stmt, const char *msg) +{ + if (!opt_silent) + { + if (stmt && mysql_stmt_errno(stmt)) + { + if (stmt->mysql && stmt->mysql->server_version) + fprintf(stdout, "\n [MySQL-%s]", stmt->mysql->server_version); + else + fprintf(stdout, "\n [MySQL]"); + + fprintf(stdout, "[%d] %s\n", mysql_stmt_errno(stmt), + mysql_stmt_error(stmt)); + } + else if (msg) + fprintf(stderr, " [MySQL] %s\n", msg); + } +} + +/* + Enhanced version of mysql_client_init(), which may also set shared memory + base on Windows. +*/ +static MYSQL *mysql_client_init(MYSQL* con) +{ + MYSQL* res = mysql_init(con); +#ifdef HAVE_SMEM + if (res && shared_memory_base_name) + mysql_options(res, MYSQL_SHARED_MEMORY_BASE_NAME, shared_memory_base_name); +#endif + if (res && non_blocking_api_enabled) + mysql_options(res, MYSQL_OPT_NONBLOCK, 0); + if (opt_plugin_dir && *opt_plugin_dir) + mysql_options(res, MYSQL_PLUGIN_DIR, opt_plugin_dir); + + if (opt_default_auth && *opt_default_auth) + mysql_options(res, MYSQL_DEFAULT_AUTH, opt_default_auth); + return res; +} + +/* + Disable direct calls of mysql_init, as it disregards shared memory base. +*/ +#define mysql_init(A) Please use mysql_client_init instead of mysql_init + + +/* Check if the connection has InnoDB tables */ + +static my_bool check_have_innodb(MYSQL *conn) +{ + MYSQL_RES *res; + MYSQL_ROW row; + int rc; + my_bool result; + + rc= mysql_query(conn, "show variables like 'have_innodb'"); + myquery(rc); + res= mysql_use_result(conn); + DIE_UNLESS(res); + + row= mysql_fetch_row(res); + DIE_UNLESS(row); + + result= strcmp(row[1], "YES") == 0; + mysql_free_result(res); + return result; +} + + +/* + This is to be what mysql_query() is for mysql_real_query(), for + mysql_simple_prepare(): a variant without the 'length' parameter. +*/ + +static MYSQL_STMT *STDCALL +mysql_simple_prepare(MYSQL *mysql_arg, const char *query) +{ + MYSQL_STMT *stmt= mysql_stmt_init(mysql_arg); + if (stmt && mysql_stmt_prepare(stmt, query, (uint) strlen(query))) + { + mysql_stmt_close(stmt); + return 0; + } + return stmt; +} + + +/** + Connect to the server with options given by arguments to this application, + stored in global variables opt_host, opt_user, opt_password, opt_db, + opt_port and opt_unix_socket. + + @param flag[in] client_flag passed on to mysql_real_connect + @param protocol[in] MYSQL_PROTOCOL_* to use for this connection + @param auto_reconnect[in] set to 1 for auto reconnect + + @return pointer to initialized and connected MYSQL object +*/ +static MYSQL* client_connect(ulong flag, uint protocol, my_bool auto_reconnect) +{ + MYSQL* mysql; + int rc; + static char query[MAX_TEST_QUERY_LENGTH]; + myheader_r("client_connect"); + + if (!opt_silent) + fprintf(stdout, "\n Establishing a connection to '%s' ...", + opt_host ? opt_host : ""); + + if (!(mysql= mysql_client_init(NULL))) + { + opt_silent= 0; + myerror("mysql_client_init() failed"); + exit(1); + } + /* enable local infile, in non-binary builds often disabled by default */ + mysql_options(mysql, MYSQL_OPT_LOCAL_INFILE, 0); + mysql_options(mysql, MYSQL_OPT_PROTOCOL, &protocol); + if (opt_plugin_dir && *opt_plugin_dir) + mysql_options(mysql, MYSQL_PLUGIN_DIR, opt_plugin_dir); + + if (opt_default_auth && *opt_default_auth) + mysql_options(mysql, MYSQL_DEFAULT_AUTH, opt_default_auth); + + if (!(mysql_real_connect(mysql, opt_host, opt_user, + opt_password, opt_db ? opt_db:"test", opt_port, + opt_unix_socket, flag))) + { + opt_silent= 0; + myerror("connection failed"); + mysql_close(mysql); + fprintf(stdout, "\n Check the connection options using --help or -?\n"); + exit(1); + } + mysql->reconnect= auto_reconnect; + + if (!opt_silent) + fprintf(stdout, "OK"); + + /* set AUTOCOMMIT to ON*/ + mysql_autocommit(mysql, TRUE); + + if (!opt_silent) + { + fprintf(stdout, "\nConnected to MySQL server version: %s (%lu)\n", + mysql_get_server_info(mysql), + (ulong) mysql_get_server_version(mysql)); + fprintf(stdout, "\n Creating a test database '%s' ...", current_db); + } + strxmov(query, "CREATE DATABASE IF NOT EXISTS ", current_db, NullS); + + rc= mysql_query(mysql, query); + myquery(rc); + + strxmov(query, "USE ", current_db, NullS); + rc= mysql_query(mysql, query); + myquery(rc); + have_innodb= check_have_innodb(mysql); + + if (!opt_silent) + fprintf(stdout, "OK\n"); + + return mysql; +} + + +/* Close the connection */ + +static void client_disconnect(MYSQL* mysql, my_bool drop_db) +{ + static char query[MAX_TEST_QUERY_LENGTH]; + + myheader_r("client_disconnect"); + + if (mysql) + { + if (drop_db) + { + if (!opt_silent) + fprintf(stdout, "\n dropping the test database '%s' ...", current_db); + strxmov(query, "DROP DATABASE IF EXISTS ", current_db, NullS); + + mysql_query(mysql, query); + if (!opt_silent) + fprintf(stdout, "OK"); + } + + if (!opt_silent) + fprintf(stdout, "\n closing the connection ..."); + mysql_close(mysql); + if (!opt_silent) + fprintf(stdout, "OK\n"); + } +} + + +/* Print dashes */ + +static void my_print_dashes(MYSQL_RES *result) +{ + MYSQL_FIELD *field; + unsigned int i, j; + + mysql_field_seek(result, 0); + fputc('\t', stdout); + fputc('+', stdout); + + for(i= 0; i< mysql_num_fields(result); i++) + { + field= mysql_fetch_field(result); + for(j= 0; j < field->max_length+2; j++) + fputc('-', stdout); + fputc('+', stdout); + } + fputc('\n', stdout); +} + + +/* Print resultset metadata information */ + +static void my_print_result_metadata(MYSQL_RES *result) +{ + MYSQL_FIELD *field; + unsigned int i, j; + unsigned int field_count; + + mysql_field_seek(result, 0); + if (!opt_silent) + { + fputc('\n', stdout); + fputc('\n', stdout); + } + + field_count= mysql_num_fields(result); + for(i= 0; i< field_count; i++) + { + field= mysql_fetch_field(result); + j= strlen(field->name); + if (j < field->max_length) + j= field->max_length; + if (j < 4 && !IS_NOT_NULL(field->flags)) + j= 4; + field->max_length= j; + } + if (!opt_silent) + { + my_print_dashes(result); + fputc('\t', stdout); + fputc('|', stdout); + } + + mysql_field_seek(result, 0); + for(i= 0; i< field_count; i++) + { + field= mysql_fetch_field(result); + if (!opt_silent) + fprintf(stdout, " %-*s |", (int) field->max_length, field->name); + } + if (!opt_silent) + { + fputc('\n', stdout); + my_print_dashes(result); + } +} + + +/* Process the result set */ + +static int my_process_result_set(MYSQL_RES *result) +{ + MYSQL_ROW row; + MYSQL_FIELD *field; + unsigned int i; + unsigned int row_count= 0; + + if (!result) + return 0; + + my_print_result_metadata(result); + + while ((row= mysql_fetch_row(result)) != NULL) + { + mysql_field_seek(result, 0); + if (!opt_silent) + { + fputc('\t', stdout); + fputc('|', stdout); + } + + for(i= 0; i< mysql_num_fields(result); i++) + { + field= mysql_fetch_field(result); + if (!opt_silent) + { + if (row[i] == NULL) + fprintf(stdout, " %-*s |", (int) field->max_length, "NULL"); + else if (IS_NUM(field->type)) + fprintf(stdout, " %*s |", (int) field->max_length, row[i]); + else + fprintf(stdout, " %-*s |", (int) field->max_length, row[i]); + } + } + if (!opt_silent) + { + fputc('\t', stdout); + fputc('\n', stdout); + } + row_count++; + } + if (!opt_silent) + { + if (row_count) + my_print_dashes(result); + + if (mysql_errno(mysql) != 0) + fprintf(stderr, "\n\tmysql_fetch_row() failed\n"); + else + fprintf(stdout, "\n\t%d %s returned\n", row_count, + row_count == 1 ? "row" : "rows"); + } + return row_count; +} + + +static int my_process_result(MYSQL *mysql_arg) +{ + MYSQL_RES *result; + int row_count; + + if (!(result= mysql_store_result(mysql_arg))) + return 0; + + row_count= my_process_result_set(result); + + mysql_free_result(result); + return row_count; +} + + +/* Process the statement result set */ + +#define MAX_RES_FIELDS 50 +#define MAX_FIELD_DATA_SIZE 255 + +static int my_process_stmt_result(MYSQL_STMT *stmt) +{ + int field_count; + int row_count= 0; + MYSQL_BIND buffer[MAX_RES_FIELDS]; + MYSQL_FIELD *field; + MYSQL_RES *result; + char data[MAX_RES_FIELDS][MAX_FIELD_DATA_SIZE]; + ulong length[MAX_RES_FIELDS]; + my_bool is_null[MAX_RES_FIELDS]; + int rc, i; + + if (!(result= mysql_stmt_result_metadata(stmt))) /* No meta info */ + { + while (!mysql_stmt_fetch(stmt)) + row_count++; + return row_count; + } + + field_count= min(mysql_num_fields(result), MAX_RES_FIELDS); + + bzero((char*) buffer, sizeof(buffer)); + bzero((char*) length, sizeof(length)); + bzero((char*) is_null, sizeof(is_null)); + + for(i= 0; i < field_count; i++) + { + buffer[i].buffer_type= MYSQL_TYPE_STRING; + buffer[i].buffer_length= MAX_FIELD_DATA_SIZE; + buffer[i].length= &length[i]; + buffer[i].buffer= (void *) data[i]; + buffer[i].is_null= &is_null[i]; + } + + rc= mysql_stmt_bind_result(stmt, buffer); + check_execute(stmt, rc); + + rc= 1; + mysql_stmt_attr_set(stmt, STMT_ATTR_UPDATE_MAX_LENGTH, (void*)&rc); + rc= mysql_stmt_store_result(stmt); + check_execute(stmt, rc); + my_print_result_metadata(result); + + mysql_field_seek(result, 0); + while ((rc= mysql_stmt_fetch(stmt)) == 0) + { + if (!opt_silent) + { + fputc('\t', stdout); + fputc('|', stdout); + } + mysql_field_seek(result, 0); + for (i= 0; i < field_count; i++) + { + field= mysql_fetch_field(result); + if (!opt_silent) + { + if (is_null[i]) + fprintf(stdout, " %-*s |", (int) field->max_length, "NULL"); + else if (length[i] == 0) + { + data[i][0]= '\0'; /* unmodified buffer */ + fprintf(stdout, " %*s |", (int) field->max_length, data[i]); + } + else if (IS_NUM(field->type)) + fprintf(stdout, " %*s |", (int) field->max_length, data[i]); + else + fprintf(stdout, " %-*s |", (int) field->max_length, data[i]); + } + } + if (!opt_silent) + { + fputc('\t', stdout); + fputc('\n', stdout); + } + row_count++; + } + DIE_UNLESS(rc == MYSQL_NO_DATA); + if (!opt_silent) + { + if (row_count) + my_print_dashes(result); + fprintf(stdout, "\n\t%d %s returned\n", row_count, + row_count == 1 ? "row" : "rows"); + } + mysql_free_result(result); + return row_count; +} + + +/* Prepare statement, execute, and process result set for given query */ + +int my_stmt_result(const char *buff) +{ + MYSQL_STMT *stmt; + int row_count; + int rc; + + if (!opt_silent) + fprintf(stdout, "\n\n %s", buff); + stmt= mysql_simple_prepare(mysql, buff); + check_stmt(stmt); + + rc= mysql_stmt_execute(stmt); + check_execute(stmt, rc); + + row_count= my_process_stmt_result(stmt); + mysql_stmt_close(stmt); + + return row_count; +} + +/* Print the total number of warnings and the warnings themselves. */ + +void my_process_warnings(MYSQL *conn, unsigned expected_warning_count) +{ + MYSQL_RES *result; + int rc; + + if (!opt_silent) + fprintf(stdout, "\n total warnings: %u (expected: %u)\n", + mysql_warning_count(conn), expected_warning_count); + + DIE_UNLESS(mysql_warning_count(mysql) == expected_warning_count); + + rc= mysql_query(conn, "SHOW WARNINGS"); + DIE_UNLESS(rc == 0); + + result= mysql_store_result(conn); + mytest(result); + + rc= my_process_result_set(result); + mysql_free_result(result); +} + + +/* Utility function to verify a particular column data */ + +static void verify_col_data(const char *table, const char *col, + const char *exp_data) +{ + static char query[MAX_TEST_QUERY_LENGTH]; + MYSQL_RES *result; + MYSQL_ROW row; + int rc, field= 1; + + if (table && col) + { + strxmov(query, "SELECT ", col, " FROM ", table, " LIMIT 1", NullS); + if (!opt_silent) + fprintf(stdout, "\n %s", query); + rc= mysql_query(mysql, query); + myquery(rc); + + field= 0; + } + + result= mysql_use_result(mysql); + mytest(result); + + if (!(row= mysql_fetch_row(result)) || !row[field]) + { + fprintf(stdout, "\n *** ERROR: FAILED TO GET THE RESULT ***"); + exit(1); + } + if (strcmp(row[field], exp_data)) + { + fprintf(stdout, "\n obtained: `%s` (expected: `%s`)", + row[field], exp_data); + DIE_UNLESS(FALSE); + } + mysql_free_result(result); +} + + +/* Utility function to verify the field members */ + +#define verify_prepare_field(result,no,name,org_name,type,table,\ + org_table,db,length,def) \ + do_verify_prepare_field((result),(no),(name),(org_name),(type), \ + (table),(org_table),(db),(length),(def), \ + __FILE__, __LINE__) + +static void do_verify_prepare_field(MYSQL_RES *result, + unsigned int no, const char *name, + const char *org_name, + enum enum_field_types type, + const char *table, + const char *org_table, const char *db, + unsigned long length, const char *def, + const char *file, int line) +{ + MYSQL_FIELD *field; + CHARSET_INFO *cs; + ulonglong expected_field_length; + + if (!(field= mysql_fetch_field_direct(result, no))) + { + fprintf(stdout, "\n *** ERROR: FAILED TO GET THE RESULT ***"); + exit(1); + } + cs= get_charset(field->charsetnr, 0); + DIE_UNLESS(cs); + if ((expected_field_length= length * cs->mbmaxlen) > UINT_MAX32) + expected_field_length= UINT_MAX32; + if (!opt_silent) + { + fprintf(stdout, "\n field[%d]:", no); + fprintf(stdout, "\n name :`%s`\t(expected: `%s`)", field->name, name); + fprintf(stdout, "\n org_name :`%s`\t(expected: `%s`)", + field->org_name, org_name); + fprintf(stdout, "\n type :`%d`\t(expected: `%d`)", field->type, type); + if (table) + fprintf(stdout, "\n table :`%s`\t(expected: `%s`)", + field->table, table); + if (org_table) + fprintf(stdout, "\n org_table:`%s`\t(expected: `%s`)", + field->org_table, org_table); + fprintf(stdout, "\n database :`%s`\t(expected: `%s`)", field->db, db); + fprintf(stdout, "\n length :`%lu`\t(expected: `%llu`)", + field->length, expected_field_length); + fprintf(stdout, "\n maxlength:`%ld`", field->max_length); + fprintf(stdout, "\n charsetnr:`%d`", field->charsetnr); + fprintf(stdout, "\n default :`%s`\t(expected: `%s`)", + field->def ? field->def : "(null)", def ? def: "(null)"); + fprintf(stdout, "\n"); + } + DIE_UNLESS(strcmp(field->name, name) == 0); + DIE_UNLESS(strcmp(field->org_name, org_name) == 0); + /* + XXX: silent column specification change works based on number of + bytes a column occupies. So CHAR -> VARCHAR upgrade is possible even + for CHAR(2) column if its character set is multibyte. + VARCHAR -> CHAR downgrade won't work for VARCHAR(3) as one would + expect. + */ + if (cs->mbmaxlen == 1) + { + if (field->type != type) + { + fprintf(stderr, + "Expected field type: %d, got type: %d in file %s, line %d\n", + (int) type, (int) field->type, file, line); + DIE_UNLESS(field->type == type); + } + } + if (table) + DIE_UNLESS(strcmp(field->table, table) == 0); + if (org_table) + DIE_UNLESS(strcmp(field->org_table, org_table) == 0); + DIE_UNLESS(strcmp(field->db, db) == 0); + /* + Character set should be taken into account for multibyte encodings, such + as utf8. Field length is calculated as number of characters * maximum + number of bytes a character can occupy. + */ + if (length && (field->length != expected_field_length)) + { + fflush(stdout); + fprintf(stderr, "Expected field length: %llu, got length: %lu\n", + expected_field_length, field->length); + fflush(stderr); + DIE_UNLESS(field->length == expected_field_length); + } + if (def) + DIE_UNLESS(strcmp(field->def, def) == 0); +} + + +/* Utility function to verify the parameter count */ + +static void verify_param_count(MYSQL_STMT *stmt, long exp_count) +{ + long param_count= mysql_stmt_param_count(stmt); + if (!opt_silent) + fprintf(stdout, "\n total parameters in stmt: `%ld` (expected: `%ld`)", + param_count, exp_count); + DIE_UNLESS(param_count == exp_count); +} + + +/* Utility function to verify the total affected rows */ + +static void verify_st_affected_rows(MYSQL_STMT *stmt, ulonglong exp_count) +{ + ulonglong affected_rows= mysql_stmt_affected_rows(stmt); + if (!opt_silent) + fprintf(stdout, "\n total affected rows: `%ld` (expected: `%ld`)", + (long) affected_rows, (long) exp_count); + DIE_UNLESS(affected_rows == exp_count); +} + + +/* Utility function to verify the total affected rows */ + +static void verify_affected_rows(ulonglong exp_count) +{ + ulonglong affected_rows= mysql_affected_rows(mysql); + if (!opt_silent) + fprintf(stdout, "\n total affected rows: `%ld` (expected: `%ld`)", + (long) affected_rows, (long) exp_count); + DIE_UNLESS(affected_rows == exp_count); +} + + +/* Utility function to verify the total fields count */ + +static void verify_field_count(MYSQL_RES *result, uint exp_count) +{ + uint field_count= mysql_num_fields(result); + if (!opt_silent) + fprintf(stdout, "\n total fields in the result set: `%d` (expected: `%d`)", + field_count, exp_count); + DIE_UNLESS(field_count == exp_count); +} + + +/* Utility function to execute a query using prepare-execute */ + +#ifndef EMBEDDED_LIBRARY +static void execute_prepare_query(const char *query, ulonglong exp_count) +{ + MYSQL_STMT *stmt; + ulonglong affected_rows; + int rc; + + stmt= mysql_simple_prepare(mysql, query); + check_stmt(stmt); + + rc= mysql_stmt_execute(stmt); + myquery(rc); + + affected_rows= mysql_stmt_affected_rows(stmt); + if (!opt_silent) + fprintf(stdout, "\n total affected rows: `%ld` (expected: `%ld`)", + (long) affected_rows, (long) exp_count); + + DIE_UNLESS(affected_rows == exp_count); + mysql_stmt_close(stmt); +} +#endif + +/* +Accepts arbitrary number of queries and runs them against the database. +Used to fill tables for each test. +*/ + +void fill_tables(const char **query_list, unsigned query_count) +{ + int rc; + const char **query; + DBUG_ENTER("fill_tables"); + for (query= query_list; query < query_list + query_count; + ++query) + { + rc= mysql_query(mysql, *query); + myquery(rc); + } + DBUG_VOID_RETURN; +} + +/* +All state of fetch from one statement: statement handle, out buffers, +fetch position. +See fetch_n for for the only use case. +*/ + +enum { MAX_COLUMN_LENGTH= 255 }; + +typedef struct st_stmt_fetch +{ +const char *query; +unsigned stmt_no; +MYSQL_STMT *handle; +my_bool is_open; +MYSQL_BIND *bind_array; +char **out_data; +unsigned long *out_data_length; +unsigned column_count; +unsigned row_count; +} Stmt_fetch; + + +/* +Create statement handle, prepare it with statement, execute and allocate +fetch buffers. +*/ + +void stmt_fetch_init(Stmt_fetch *fetch, unsigned stmt_no_arg, +const char *query_arg) +{ + unsigned long type= CURSOR_TYPE_READ_ONLY; + int rc; + unsigned i; + MYSQL_RES *metadata; + DBUG_ENTER("stmt_fetch_init"); + + /* Save query and statement number for error messages */ + fetch->stmt_no= stmt_no_arg; + fetch->query= query_arg; + + fetch->handle= mysql_stmt_init(mysql); + + rc= mysql_stmt_prepare(fetch->handle, fetch->query, strlen(fetch->query)); + check_execute(fetch->handle, rc); + + /* + The attribute is sent to server on execute and asks to open read-only + for result set + */ + mysql_stmt_attr_set(fetch->handle, STMT_ATTR_CURSOR_TYPE, + (const void*) &type); + + rc= mysql_stmt_execute(fetch->handle); + check_execute(fetch->handle, rc); + + /* Find out total number of columns in result set */ + metadata= mysql_stmt_result_metadata(fetch->handle); + fetch->column_count= mysql_num_fields(metadata); + mysql_free_result(metadata); + + /* + Now allocate bind handles and buffers for output data: + calloc memory to reduce number of MYSQL_BIND members we need to + set up. + */ + + fetch->bind_array= (MYSQL_BIND *) calloc(1, sizeof(MYSQL_BIND) * + fetch->column_count); + fetch->out_data= (char**) calloc(1, sizeof(char*) * fetch->column_count); + fetch->out_data_length= (ulong*) calloc(1, sizeof(ulong) * + fetch->column_count); + for (i= 0; i < fetch->column_count; ++i) + { + fetch->out_data[i]= (char*) calloc(1, MAX_COLUMN_LENGTH); + fetch->bind_array[i].buffer_type= MYSQL_TYPE_STRING; + fetch->bind_array[i].buffer= fetch->out_data[i]; + fetch->bind_array[i].buffer_length= MAX_COLUMN_LENGTH; + fetch->bind_array[i].length= fetch->out_data_length + i; + } + + mysql_stmt_bind_result(fetch->handle, fetch->bind_array); + + fetch->row_count= 0; + fetch->is_open= TRUE; + + /* Ready for reading rows */ + DBUG_VOID_RETURN; +} + + +/* Fetch and print one row from cursor */ + +int stmt_fetch_fetch_row(Stmt_fetch *fetch) +{ + int rc; + unsigned i; + DBUG_ENTER("stmt_fetch_fetch_row"); + + if ((rc= mysql_stmt_fetch(fetch->handle)) == 0) + { + ++fetch->row_count; + if (!opt_silent) + printf("Stmt %d fetched row %d:\n", fetch->stmt_no, fetch->row_count); + for (i= 0; i < fetch->column_count; ++i) + { + fetch->out_data[i][fetch->out_data_length[i]]= '\0'; + if (!opt_silent) + printf("column %d: %s\n", i+1, fetch->out_data[i]); + } + } + else + fetch->is_open= FALSE; + DBUG_RETURN(rc); +} + + +void stmt_fetch_close(Stmt_fetch *fetch) +{ + unsigned i; + DBUG_ENTER("stmt_fetch_close"); + + for (i= 0; i < fetch->column_count; ++i) + free(fetch->out_data[i]); + free(fetch->out_data); + free(fetch->out_data_length); + free(fetch->bind_array); + mysql_stmt_close(fetch->handle); + DBUG_VOID_RETURN; +} + +/* +For given array of queries, open query_count cursors and fetch +from them in simultaneous manner. +In case there was an error in one of the cursors, continue +reading from the rest. +*/ + +enum fetch_type { USE_ROW_BY_ROW_FETCH= 0, USE_STORE_RESULT= 1 }; + +my_bool fetch_n(const char **query_list, unsigned query_count, +enum fetch_type fetch_type) +{ + unsigned open_statements= query_count; + int rc, error_count= 0; + Stmt_fetch *fetch_array= (Stmt_fetch*) calloc(1, sizeof(Stmt_fetch) * + query_count); + Stmt_fetch *fetch; + DBUG_ENTER("fetch_n"); + + for (fetch= fetch_array; fetch < fetch_array + query_count; ++fetch) + { + /* Init will exit(1) in case of error */ + stmt_fetch_init(fetch, fetch - fetch_array, + query_list[fetch - fetch_array]); + } + + if (fetch_type == USE_STORE_RESULT) + { + for (fetch= fetch_array; fetch < fetch_array + query_count; ++fetch) + { + rc= mysql_stmt_store_result(fetch->handle); + check_execute(fetch->handle, rc); + } + } + + while (open_statements) + { + for (fetch= fetch_array; fetch < fetch_array + query_count; ++fetch) + { + if (fetch->is_open && (rc= stmt_fetch_fetch_row(fetch))) + { + open_statements--; + /* + We try to fetch from the rest of the statements in case of + error + */ + if (rc != MYSQL_NO_DATA) + { + fprintf(stderr, + "Got error reading rows from statement %d,\n" + "query is: %s,\n" + "error message: %s", (int) (fetch - fetch_array), + fetch->query, + mysql_stmt_error(fetch->handle)); + error_count++; + } + } + } + } + if (error_count) + fprintf(stderr, "Fetch FAILED"); + else + { + unsigned total_row_count= 0; + for (fetch= fetch_array; fetch < fetch_array + query_count; ++fetch) + total_row_count+= fetch->row_count; + if (!opt_silent) + printf("Success, total rows fetched: %d\n", total_row_count); + } + for (fetch= fetch_array; fetch < fetch_array + query_count; ++fetch) + stmt_fetch_close(fetch); + free(fetch_array); + DBUG_RETURN(error_count != 0); +} + +/* Separate thread query to test some cases */ + +static my_bool thread_query(const char *query) +{ + MYSQL *l_mysql; + my_bool error; + + error= 0; + if (!opt_silent) + fprintf(stdout, "\n in thread_query(%s)", query); + if (!(l_mysql= mysql_client_init(NULL))) + { + myerror("mysql_client_init() failed"); + return 1; + } + if (!(mysql_real_connect(l_mysql, opt_host, opt_user, + opt_password, current_db, opt_port, + opt_unix_socket, 0))) + { + myerror("connection failed"); + error= 1; + goto end; + } + l_mysql->reconnect= 1; + if (mysql_query(l_mysql, query)) + { + fprintf(stderr, "Query failed (%s)\n", mysql_error(l_mysql)); + error= 1; + goto end; + } + mysql_commit(l_mysql); + end: + mysql_close(l_mysql); + return error; +} + + +/* + Read and parse arguments and MySQL options from my.cnf +*/ + +static const char *client_test_load_default_groups[]= +{ "client", "client-server", "client-mariadb", 0 }; +static char **defaults_argv; + +static struct my_option client_test_long_options[] = +{ + {"basedir", 'b', "Basedir for tests.", (char**) &opt_basedir, + (char**) &opt_basedir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"count", 't', "Number of times test to be executed", &opt_count, + &opt_count, 0, GET_UINT, REQUIRED_ARG, 1, 0, 0, 0, 0, 0}, + {"database", 'D', "Database to use", &opt_db, &opt_db, + 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"debug", '#', "Output debug log", (char**) &default_dbug_option, + (char**) &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, + {"help", '?', "Display this help and exit", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, + 0, 0, 0, 0, 0}, + {"host", 'h', "Connect to host", &opt_host, &opt_host, + 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"password", 'p', + "Password to use when connecting to server. If password is not given it's asked from the tty.", + 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, + {"port", 'P', "Port number to use for connection or 0 for default to, in " + "order of preference, my.cnf, $MYSQL_TCP_PORT, " +#if MYSQL_PORT_DEFAULT == 0 + "/etc/services, " +#endif + "built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").", + &opt_port, &opt_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"server-arg", 'A', "Send embedded server this as a parameter.", + 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"show-tests", 'T', "Show all tests' names", 0, 0, 0, GET_NO_ARG, NO_ARG, + 0, 0, 0, 0, 0, 0}, + {"silent", 's', "Be more silent", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, + 0}, +#ifdef HAVE_SMEM + {"shared-memory-base-name", 'm', "Base name of shared memory.", + &shared_memory_base_name, (uchar**)&shared_memory_base_name, 0, + GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, +#endif + {"socket", 'S', "Socket file to use for connection", + &opt_unix_socket, &opt_unix_socket, 0, GET_STR, + REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"testcase", 'c', + "May disable some code when runs as mysql-test-run testcase.", + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, +#ifndef DONT_ALLOW_USER_CHANGE + {"user", 'u', "User for login if not current user", &opt_user, + &opt_user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, +#endif + {"vardir", 'v', "Data dir for tests.", (char**) &opt_vardir, + (char**) &opt_vardir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"non-blocking-api", 'n', + "Use the non-blocking client API for communication.", + &non_blocking_api_enabled, &non_blocking_api_enabled, 0, + GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"getopt-ll-test", 'g', "Option for testing bug in getopt library", + &opt_getopt_ll_test, &opt_getopt_ll_test, 0, + GET_LL, REQUIRED_ARG, 0, 0, LONGLONG_MAX, 0, 0, 0}, + {"plugin_dir", 0, "Directory for client-side plugins.", + &opt_plugin_dir, &opt_plugin_dir, 0, + GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"default_auth", 0, "Default authentication client-side plugin to use.", + &opt_default_auth, &opt_default_auth, 0, + GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} +}; + + +static void usage(void) +{ + /* show the usage string when the user asks for this */ + putc('\n', stdout); + printf("%s Ver %s Distrib %s, for %s (%s)\n", + my_progname, VER, MYSQL_SERVER_VERSION, SYSTEM_TYPE, MACHINE_TYPE); + puts("By Monty, Venu, Kent and others\n"); + printf("\ +Copyright (C) 2002-2004 MySQL AB\n\ +This software comes with ABSOLUTELY NO WARRANTY. This is free software,\n\ +and you are welcome to modify and redistribute it under the GPL license\n"); + printf("Usage: %s [OPTIONS] [TESTNAME1 TESTNAME2...]\n", my_progname); + my_print_help(client_test_long_options); + print_defaults("my", client_test_load_default_groups); + my_print_variables(client_test_long_options); +} + +static struct my_tests_st *get_my_tests(); /* To be defined in main .c file */ + +static struct my_tests_st *my_testlist= 0; + +static my_bool +get_one_option(int optid, const struct my_option *opt __attribute__((unused)), + char *argument) +{ + switch (optid) { + case '#': + DBUG_PUSH(argument ? argument : default_dbug_option); + break; + case 'c': + opt_testcase = 1; + break; + case 'p': + if (argument) + { + char *start=argument; + my_free(opt_password); + opt_password= my_strdup(argument, MYF(MY_FAE)); + while (*argument) *argument++= 'x'; /* Destroy argument */ + if (*start) + start[1]=0; + } + else + tty_password= 1; + break; + case 's': + if (argument == disabled_my_option) + opt_silent= 0; + else + opt_silent++; + break; + case 'A': + /* + When the embedded server is being tested, the test suite needs to be + able to pass command-line arguments to the embedded server so it can + locate the language files and data directory. The test suite + (mysql-test-run) never uses config files, just command-line options. + */ + if (!embedded_server_arg_count) + { + embedded_server_arg_count= 1; + embedded_server_args[0]= (char*) ""; + } + if (embedded_server_arg_count == MAX_SERVER_ARGS-1 || + !(embedded_server_args[embedded_server_arg_count++]= + my_strdup(argument, MYF(MY_FAE)))) + { + DIE("Can't use server argument"); + } + break; + case 'T': + { + struct my_tests_st *fptr; + + printf("All possible test names:\n\n"); + for (fptr= my_testlist; fptr->name; fptr++) + printf("%s\n", fptr->name); + exit(0); + break; + } + case '?': + case 'I': /* Info */ + usage(); + exit(0); + break; + } + return 0; +} + +static void get_options(int *argc, char ***argv) +{ + int ho_error; + + if ((ho_error= handle_options(argc, argv, client_test_long_options, + get_one_option))) + exit(ho_error); + + if (tty_password) + opt_password= get_tty_password(NullS); + return; +} + +/* + Print the test output on successful execution before exiting +*/ + +static void print_test_output() +{ + if (opt_silent < 3) + { + fprintf(stdout, "\n\n"); + fprintf(stdout, "All '%d' tests were successful (in '%d' iterations)", + test_count-1, opt_count); + fprintf(stdout, "\n Total execution time: %g SECS", total_time); + if (opt_count > 1) + fprintf(stdout, " (Avg: %g SECS)", total_time/opt_count); + + fprintf(stdout, "\n\n!!! SUCCESS !!!\n"); + } +} + +/*************************************************************************** + main routine +***************************************************************************/ + + +int main(int argc, char **argv) +{ + struct my_tests_st *fptr; + my_testlist= get_my_tests(); + + MY_INIT(argv[0]); + + if (load_defaults("my", client_test_load_default_groups, &argc, &argv)) + exit(1); + + defaults_argv= argv; + get_options(&argc, &argv); + + if (mysql_server_init(embedded_server_arg_count, + embedded_server_args, + (char**) embedded_server_groups)) + DIE("Can't initialize MySQL server"); + + /* connect to server with no flags, default protocol, auto reconnect true */ + mysql= client_connect(0, MYSQL_PROTOCOL_DEFAULT, 1); + + total_time= 0; + for (iter_count= 1; iter_count <= opt_count; iter_count++) + { + /* Start of tests */ + test_count= 1; + start_time= time((time_t *)0); + if (!argc) + { + for (fptr= my_testlist; fptr->name; fptr++) + (*fptr->function)(); + } + else + { + for ( ; *argv ; argv++) + { + for (fptr= my_testlist; fptr->name; fptr++) + { + if (!strcmp(fptr->name, *argv)) + { + (*fptr->function)(); + break; + } + } + if (!fptr->name) + { + fprintf(stderr, "\n\nGiven test not found: '%s'\n", *argv); + fprintf(stderr, "See legal test names with %s -T\n\nAborting!\n", + my_progname); + client_disconnect(mysql, 1); + free_defaults(defaults_argv); + exit(1); + } + } + } + + end_time= time((time_t *)0); + total_time+= difftime(end_time, start_time); + + /* End of tests */ + } + + client_disconnect(mysql, 1); /* disconnect from server */ + + free_defaults(defaults_argv); + print_test_output(); + + while (embedded_server_arg_count > 1) + my_free(embedded_server_args[--embedded_server_arg_count]); + + mysql_server_end(); + + my_end(0); + + exit(0); +} diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index 6bee26129e7..a0b18f1f717 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -1,5 +1,5 @@ -/* Copyright (c) 2002, 2011, Oracle and/or its affiliates. - Copyright (c) 2008-2011 Monty Program Ab +/* Copyright (c) 2002, 2012, Oracle and/or its affiliates. + Copyright (c) 2008, 2012, Monty Program Ab This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -27,407 +27,12 @@ */ -#include <my_global.h> -#include <my_sys.h> -#include <mysql.h> -#include <errmsg.h> -#include <my_getopt.h> -#include <m_string.h> -#include <mysqld_error.h> -#include <my_compare.h> -#include <sql_common.h> -#include <mysql/client_plugin.h> - -/* - If non_blocking_api_enabled is true, we will re-define all the blocking - API functions as wrappers that call the corresponding non-blocking API - and use poll()/select() to wait for them to complete. This way we can get - a good coverage testing of the non-blocking API as well. -*/ -static my_bool non_blocking_api_enabled= 0; -#if !defined(EMBEDDED_LIBRARY) -#define WRAP_NONBLOCK_ENABLED non_blocking_api_enabled -#include "nonblock-wrappers.h" -#endif - -#define VER "2.1" -#define MAX_TEST_QUERY_LENGTH 300 /* MAX QUERY BUFFER LENGTH */ -#define MAX_KEY MAX_INDEXES -#define MAX_SERVER_ARGS 64 - -/* set default options */ -#ifdef NOT_USED -static int opt_testcase = 0; -#endif -static char *opt_db= 0; -static char *opt_user= 0; -static char *opt_password= 0; -static char *opt_host= 0; -static char *opt_unix_socket= 0; -#ifdef HAVE_SMEM -static char *shared_memory_base_name= 0; -#endif -static unsigned int opt_port; -static my_bool tty_password= 0, opt_silent= 0; - -static MYSQL *mysql= 0; -static char current_db[]= "client_test_db"; -static unsigned int test_count= 0; -static unsigned int opt_count= 0; -static unsigned int iter_count= 0; -static my_bool have_innodb= FALSE; -static char *opt_plugin_dir= 0, *opt_default_auth= 0; - -static const char *opt_basedir= "./"; -static const char *opt_vardir= "mysql-test/var"; - -static longlong opt_getopt_ll_test= 0; - -static int embedded_server_arg_count= 0; -static char *embedded_server_args[MAX_SERVER_ARGS]; - -static const char *embedded_server_groups[]= { - "server", - "embedded", - "mysql_client_test_SERVER", - NullS -}; - -static time_t start_time, end_time; -static double total_time; - -const char *default_dbug_option= "d:t:o,/tmp/mysql_client_test.trace"; - -struct my_tests_st -{ - const char *name; - void (*function)(); -}; - -#define myheader(str) \ -DBUG_PRINT("test", ("name: %s", str)); \ -if (opt_silent < 2) \ -{ \ - fprintf(stdout, "\n\n#####################################\n"); \ - fprintf(stdout, "%u of (%u/%u): %s", test_count++, iter_count, \ - opt_count, str); \ - fprintf(stdout, " \n#####################################\n"); \ -} - -#define myheader_r(str) \ -DBUG_PRINT("test", ("name: %s", str)); \ -if (!opt_silent) \ -{ \ - fprintf(stdout, "\n\n#####################################\n"); \ - fprintf(stdout, "%s", str); \ - fprintf(stdout, " \n#####################################\n"); \ -} - -static void print_error(const char *msg); -static void print_st_error(MYSQL_STMT *stmt, const char *msg); -static void client_disconnect(MYSQL* mysql, my_bool drop_db); - - /* - Abort unless given experssion is non-zero. - - SYNOPSIS - DIE_UNLESS(expr) - - DESCRIPTION - We can't use any kind of system assert as we need to - preserve tested invariants in release builds as well. + The fw.c file includes all the mysql_client_test framework; this file + contains only the actual tests, plus the list of test functions to call. */ -#define DIE_UNLESS(expr) \ - ((void) ((expr) ? 0 : (die(__FILE__, __LINE__, #expr), 0))) -#define DIE_IF(expr) \ - ((void) ((expr) ? (die(__FILE__, __LINE__, #expr), 0) : 0)) -#define DIE(expr) \ - die(__FILE__, __LINE__, #expr) - -static void die(const char *file, int line, const char *expr) -{ - fflush(stdout); - fprintf(stderr, "%s:%d: check failed: '%s'\n", file, line, expr); - fflush(stderr); - exit(1); -} - - -#define myerror(msg) print_error(msg) -#define mysterror(stmt, msg) print_st_error(stmt, msg) - -#define myquery(RES) \ -{ \ - int r= (RES); \ - if (r) \ - myerror(NULL); \ - DIE_UNLESS(r == 0); \ -} - -#define myquery_r(r) \ -{ \ -if (r) \ - myerror(NULL); \ -DIE_UNLESS(r != 0); \ -} - -#define check_execute(stmt, r) \ -{ \ -if (r) \ - mysterror(stmt, NULL); \ -DIE_UNLESS(r == 0);\ -} - -#define check_execute_r(stmt, r) \ -{ \ -if (r) \ - mysterror(stmt, NULL); \ -DIE_UNLESS(r != 0);\ -} - -#define check_stmt(stmt) \ -{ \ -if ( stmt == 0) \ - myerror(NULL); \ -DIE_UNLESS(stmt != 0); \ -} - -#define check_stmt_r(stmt) \ -{ \ -if (stmt == 0) \ - myerror(NULL);\ -DIE_UNLESS(stmt == 0);\ -} - -#define mytest(x) if (!(x)) {myerror(NULL);DIE_UNLESS(FALSE);} -#define mytest_r(x) if ((x)) {myerror(NULL);DIE_UNLESS(FALSE);} - - -/* A workaround for Sun Forte 5.6 on Solaris x86 */ - -static int cmp_double(double *a, double *b) -{ - return *a == *b; -} - - -/* Print the error message */ - -static void print_error(const char *msg) -{ - if (!opt_silent) - { - if (mysql && mysql_errno(mysql)) - { - if (mysql->server_version) - fprintf(stdout, "\n [MySQL-%s]", mysql->server_version); - else - fprintf(stdout, "\n [MySQL]"); - fprintf(stdout, "[%d] %s\n", mysql_errno(mysql), mysql_error(mysql)); - } - else if (msg) - fprintf(stderr, " [MySQL] %s\n", msg); - } -} - - -static void print_st_error(MYSQL_STMT *stmt, const char *msg) -{ - if (!opt_silent) - { - if (stmt && mysql_stmt_errno(stmt)) - { - if (stmt->mysql && stmt->mysql->server_version) - fprintf(stdout, "\n [MySQL-%s]", stmt->mysql->server_version); - else - fprintf(stdout, "\n [MySQL]"); - - fprintf(stdout, "[%d] %s\n", mysql_stmt_errno(stmt), - mysql_stmt_error(stmt)); - } - else if (msg) - fprintf(stderr, " [MySQL] %s\n", msg); - } -} - -/* - Enhanced version of mysql_client_init(), which may also set shared memory - base on Windows. -*/ -static MYSQL *mysql_client_init(MYSQL* con) -{ - MYSQL* res = mysql_init(con); -#ifdef HAVE_SMEM - if (res && shared_memory_base_name) - mysql_options(res, MYSQL_SHARED_MEMORY_BASE_NAME, shared_memory_base_name); -#endif - if (res && non_blocking_api_enabled) - mysql_options(res, MYSQL_OPT_NONBLOCK, 0); - if (opt_plugin_dir && *opt_plugin_dir) - mysql_options(res, MYSQL_PLUGIN_DIR, opt_plugin_dir); - - if (opt_default_auth && *opt_default_auth) - mysql_options(res, MYSQL_DEFAULT_AUTH, opt_default_auth); - return res; -} - -/* - Disable direct calls of mysql_init, as it disregards shared memory base. -*/ -#define mysql_init(A) Please use mysql_client_init instead of mysql_init - - -/* Check if the connection has InnoDB tables */ - -static my_bool check_have_innodb(MYSQL *conn) -{ - MYSQL_RES *res; - MYSQL_ROW row; - int rc; - my_bool result; - - rc= mysql_query(conn, "show variables like 'have_innodb'"); - myquery(rc); - res= mysql_use_result(conn); - DIE_UNLESS(res); - - row= mysql_fetch_row(res); - DIE_UNLESS(row); - - result= strcmp(row[1], "YES") == 0; - mysql_free_result(res); - return result; -} - - -/* - This is to be what mysql_query() is for mysql_real_query(), for - mysql_simple_prepare(): a variant without the 'length' parameter. -*/ - -static MYSQL_STMT *STDCALL -mysql_simple_prepare(MYSQL *mysql_arg, const char *query) -{ - MYSQL_STMT *stmt= mysql_stmt_init(mysql_arg); - if (stmt && mysql_stmt_prepare(stmt, query, (uint) strlen(query))) - { - mysql_stmt_close(stmt); - return 0; - } - return stmt; -} - - -/** - Connect to the server with options given by arguments to this application, - stored in global variables opt_host, opt_user, opt_password, opt_db, - opt_port and opt_unix_socket. - - @param flag[in] client_flag passed on to mysql_real_connect - @param protocol[in] MYSQL_PROTOCOL_* to use for this connection - @param auto_reconnect[in] set to 1 for auto reconnect - - @return pointer to initialized and connected MYSQL object -*/ -static MYSQL* client_connect(ulong flag, uint protocol, my_bool auto_reconnect) -{ - MYSQL* mysql; - int rc; - static char query[MAX_TEST_QUERY_LENGTH]; - myheader_r("client_connect"); - - if (!opt_silent) - fprintf(stdout, "\n Establishing a connection to '%s' ...", - opt_host ? opt_host : ""); - - if (!(mysql= mysql_client_init(NULL))) - { - opt_silent= 0; - myerror("mysql_client_init() failed"); - exit(1); - } - /* enable local infile, in non-binary builds often disabled by default */ - mysql_options(mysql, MYSQL_OPT_LOCAL_INFILE, 0); - mysql_options(mysql, MYSQL_OPT_PROTOCOL, &protocol); - if (opt_plugin_dir && *opt_plugin_dir) - mysql_options(mysql, MYSQL_PLUGIN_DIR, opt_plugin_dir); - - if (opt_default_auth && *opt_default_auth) - mysql_options(mysql, MYSQL_DEFAULT_AUTH, opt_default_auth); - - if (!(mysql_real_connect(mysql, opt_host, opt_user, - opt_password, opt_db ? opt_db:"test", opt_port, - opt_unix_socket, flag))) - { - opt_silent= 0; - myerror("connection failed"); - mysql_close(mysql); - fprintf(stdout, "\n Check the connection options using --help or -?\n"); - exit(1); - } - mysql->reconnect= auto_reconnect; - - if (!opt_silent) - fprintf(stdout, "OK"); - - /* set AUTOCOMMIT to ON*/ - mysql_autocommit(mysql, TRUE); - - if (!opt_silent) - { - fprintf(stdout, "\nConnected to MySQL server version: %s (%lu)\n", - mysql_get_server_info(mysql), - (ulong) mysql_get_server_version(mysql)); - fprintf(stdout, "\n Creating a test database '%s' ...", current_db); - } - strxmov(query, "CREATE DATABASE IF NOT EXISTS ", current_db, NullS); - - rc= mysql_query(mysql, query); - myquery(rc); - - strxmov(query, "USE ", current_db, NullS); - rc= mysql_query(mysql, query); - myquery(rc); - have_innodb= check_have_innodb(mysql); - - if (!opt_silent) - fprintf(stdout, "OK\n"); - - return mysql; -} - - -/* Close the connection */ - -static void client_disconnect(MYSQL* mysql, my_bool drop_db) -{ - static char query[MAX_TEST_QUERY_LENGTH]; - - myheader_r("client_disconnect"); - - if (mysql) - { - if (drop_db) - { - if (!opt_silent) - fprintf(stdout, "\n dropping the test database '%s' ...", current_db); - strxmov(query, "DROP DATABASE IF EXISTS ", current_db, NullS); - - mysql_query(mysql, query); - if (!opt_silent) - fprintf(stdout, "OK"); - } - - if (!opt_silent) - fprintf(stdout, "\n closing the connection ..."); - mysql_close(mysql); - if (!opt_silent) - fprintf(stdout, "OK\n"); - } -} - +#include "mysql_client_fw.c" /* Query processing */ @@ -474,496 +79,6 @@ static void client_query() } -/* Print dashes */ - -static void my_print_dashes(MYSQL_RES *result) -{ - MYSQL_FIELD *field; - unsigned int i, j; - - mysql_field_seek(result, 0); - fputc('\t', stdout); - fputc('+', stdout); - - for(i= 0; i< mysql_num_fields(result); i++) - { - field= mysql_fetch_field(result); - for(j= 0; j < field->max_length+2; j++) - fputc('-', stdout); - fputc('+', stdout); - } - fputc('\n', stdout); -} - - -/* Print resultset metadata information */ - -static void my_print_result_metadata(MYSQL_RES *result) -{ - MYSQL_FIELD *field; - unsigned int i, j; - unsigned int field_count; - - mysql_field_seek(result, 0); - if (!opt_silent) - { - fputc('\n', stdout); - fputc('\n', stdout); - } - - field_count= mysql_num_fields(result); - for(i= 0; i< field_count; i++) - { - field= mysql_fetch_field(result); - j= strlen(field->name); - if (j < field->max_length) - j= field->max_length; - if (j < 4 && !IS_NOT_NULL(field->flags)) - j= 4; - field->max_length= j; - } - if (!opt_silent) - { - my_print_dashes(result); - fputc('\t', stdout); - fputc('|', stdout); - } - - mysql_field_seek(result, 0); - for(i= 0; i< field_count; i++) - { - field= mysql_fetch_field(result); - if (!opt_silent) - fprintf(stdout, " %-*s |", (int) field->max_length, field->name); - } - if (!opt_silent) - { - fputc('\n', stdout); - my_print_dashes(result); - } -} - - -/* Process the result set */ - -static int my_process_result_set(MYSQL_RES *result) -{ - MYSQL_ROW row; - MYSQL_FIELD *field; - unsigned int i; - unsigned int row_count= 0; - - if (!result) - return 0; - - my_print_result_metadata(result); - - while ((row= mysql_fetch_row(result)) != NULL) - { - mysql_field_seek(result, 0); - if (!opt_silent) - { - fputc('\t', stdout); - fputc('|', stdout); - } - - for(i= 0; i< mysql_num_fields(result); i++) - { - field= mysql_fetch_field(result); - if (!opt_silent) - { - if (row[i] == NULL) - fprintf(stdout, " %-*s |", (int) field->max_length, "NULL"); - else if (IS_NUM(field->type)) - fprintf(stdout, " %*s |", (int) field->max_length, row[i]); - else - fprintf(stdout, " %-*s |", (int) field->max_length, row[i]); - } - } - if (!opt_silent) - { - fputc('\t', stdout); - fputc('\n', stdout); - } - row_count++; - } - if (!opt_silent) - { - if (row_count) - my_print_dashes(result); - - if (mysql_errno(mysql) != 0) - fprintf(stderr, "\n\tmysql_fetch_row() failed\n"); - else - fprintf(stdout, "\n\t%d %s returned\n", row_count, - row_count == 1 ? "row" : "rows"); - } - return row_count; -} - - -static int my_process_result(MYSQL *mysql_arg) -{ - MYSQL_RES *result; - int row_count; - - if (!(result= mysql_store_result(mysql_arg))) - return 0; - - row_count= my_process_result_set(result); - - mysql_free_result(result); - return row_count; -} - - -/* Process the statement result set */ - -#define MAX_RES_FIELDS 50 -#define MAX_FIELD_DATA_SIZE 255 - -static int my_process_stmt_result(MYSQL_STMT *stmt) -{ - int field_count; - int row_count= 0; - MYSQL_BIND buffer[MAX_RES_FIELDS]; - MYSQL_FIELD *field; - MYSQL_RES *result; - char data[MAX_RES_FIELDS][MAX_FIELD_DATA_SIZE]; - ulong length[MAX_RES_FIELDS]; - my_bool is_null[MAX_RES_FIELDS]; - int rc, i; - - if (!(result= mysql_stmt_result_metadata(stmt))) /* No meta info */ - { - while (!mysql_stmt_fetch(stmt)) - row_count++; - return row_count; - } - - field_count= min(mysql_num_fields(result), MAX_RES_FIELDS); - - bzero((char*) buffer, sizeof(buffer)); - bzero((char*) length, sizeof(length)); - bzero((char*) is_null, sizeof(is_null)); - - for(i= 0; i < field_count; i++) - { - buffer[i].buffer_type= MYSQL_TYPE_STRING; - buffer[i].buffer_length= MAX_FIELD_DATA_SIZE; - buffer[i].length= &length[i]; - buffer[i].buffer= (void *) data[i]; - buffer[i].is_null= &is_null[i]; - } - - rc= mysql_stmt_bind_result(stmt, buffer); - check_execute(stmt, rc); - - rc= 1; - mysql_stmt_attr_set(stmt, STMT_ATTR_UPDATE_MAX_LENGTH, (void*)&rc); - rc= mysql_stmt_store_result(stmt); - check_execute(stmt, rc); - my_print_result_metadata(result); - - mysql_field_seek(result, 0); - while ((rc= mysql_stmt_fetch(stmt)) == 0) - { - if (!opt_silent) - { - fputc('\t', stdout); - fputc('|', stdout); - } - mysql_field_seek(result, 0); - for (i= 0; i < field_count; i++) - { - field= mysql_fetch_field(result); - if (!opt_silent) - { - if (is_null[i]) - fprintf(stdout, " %-*s |", (int) field->max_length, "NULL"); - else if (length[i] == 0) - { - data[i][0]= '\0'; /* unmodified buffer */ - fprintf(stdout, " %*s |", (int) field->max_length, data[i]); - } - else if (IS_NUM(field->type)) - fprintf(stdout, " %*s |", (int) field->max_length, data[i]); - else - fprintf(stdout, " %-*s |", (int) field->max_length, data[i]); - } - } - if (!opt_silent) - { - fputc('\t', stdout); - fputc('\n', stdout); - } - row_count++; - } - DIE_UNLESS(rc == MYSQL_NO_DATA); - if (!opt_silent) - { - if (row_count) - my_print_dashes(result); - fprintf(stdout, "\n\t%d %s returned\n", row_count, - row_count == 1 ? "row" : "rows"); - } - mysql_free_result(result); - return row_count; -} - - -/* Prepare statement, execute, and process result set for given query */ - -int my_stmt_result(const char *buff) -{ - MYSQL_STMT *stmt; - int row_count; - int rc; - - if (!opt_silent) - fprintf(stdout, "\n\n %s", buff); - stmt= mysql_simple_prepare(mysql, buff); - check_stmt(stmt); - - rc= mysql_stmt_execute(stmt); - check_execute(stmt, rc); - - row_count= my_process_stmt_result(stmt); - mysql_stmt_close(stmt); - - return row_count; -} - -/* Print the total number of warnings and the warnings themselves. */ - -void my_process_warnings(MYSQL *conn, unsigned expected_warning_count) -{ - MYSQL_RES *result; - int rc; - - if (!opt_silent) - fprintf(stdout, "\n total warnings: %u (expected: %u)\n", - mysql_warning_count(conn), expected_warning_count); - - DIE_UNLESS(mysql_warning_count(mysql) == expected_warning_count); - - rc= mysql_query(conn, "SHOW WARNINGS"); - DIE_UNLESS(rc == 0); - - result= mysql_store_result(conn); - mytest(result); - - rc= my_process_result_set(result); - mysql_free_result(result); -} - - -/* Utility function to verify a particular column data */ - -static void verify_col_data(const char *table, const char *col, - const char *exp_data) -{ - static char query[MAX_TEST_QUERY_LENGTH]; - MYSQL_RES *result; - MYSQL_ROW row; - int rc, field= 1; - - if (table && col) - { - strxmov(query, "SELECT ", col, " FROM ", table, " LIMIT 1", NullS); - if (!opt_silent) - fprintf(stdout, "\n %s", query); - rc= mysql_query(mysql, query); - myquery(rc); - - field= 0; - } - - result= mysql_use_result(mysql); - mytest(result); - - if (!(row= mysql_fetch_row(result)) || !row[field]) - { - fprintf(stdout, "\n *** ERROR: FAILED TO GET THE RESULT ***"); - exit(1); - } - if (strcmp(row[field], exp_data)) - { - fprintf(stdout, "\n obtained: `%s` (expected: `%s`)", - row[field], exp_data); - DIE_UNLESS(FALSE); - } - mysql_free_result(result); -} - - -/* Utility function to verify the field members */ - -#define verify_prepare_field(result,no,name,org_name,type,table,\ - org_table,db,length,def) \ - do_verify_prepare_field((result),(no),(name),(org_name),(type), \ - (table),(org_table),(db),(length),(def), \ - __FILE__, __LINE__) - -static void do_verify_prepare_field(MYSQL_RES *result, - unsigned int no, const char *name, - const char *org_name, - enum enum_field_types type, - const char *table, - const char *org_table, const char *db, - unsigned long length, const char *def, - const char *file, int line) -{ - MYSQL_FIELD *field; - CHARSET_INFO *cs; - ulonglong expected_field_length; - - if (!(field= mysql_fetch_field_direct(result, no))) - { - fprintf(stdout, "\n *** ERROR: FAILED TO GET THE RESULT ***"); - exit(1); - } - cs= get_charset(field->charsetnr, 0); - DIE_UNLESS(cs); - if ((expected_field_length= length * cs->mbmaxlen) > UINT_MAX32) - expected_field_length= UINT_MAX32; - if (!opt_silent) - { - fprintf(stdout, "\n field[%d]:", no); - fprintf(stdout, "\n name :`%s`\t(expected: `%s`)", field->name, name); - fprintf(stdout, "\n org_name :`%s`\t(expected: `%s`)", - field->org_name, org_name); - fprintf(stdout, "\n type :`%d`\t(expected: `%d`)", field->type, type); - if (table) - fprintf(stdout, "\n table :`%s`\t(expected: `%s`)", - field->table, table); - if (org_table) - fprintf(stdout, "\n org_table:`%s`\t(expected: `%s`)", - field->org_table, org_table); - fprintf(stdout, "\n database :`%s`\t(expected: `%s`)", field->db, db); - fprintf(stdout, "\n length :`%lu`\t(expected: `%llu`)", - field->length, expected_field_length); - fprintf(stdout, "\n maxlength:`%ld`", field->max_length); - fprintf(stdout, "\n charsetnr:`%d`", field->charsetnr); - fprintf(stdout, "\n default :`%s`\t(expected: `%s`)", - field->def ? field->def : "(null)", def ? def: "(null)"); - fprintf(stdout, "\n"); - } - DIE_UNLESS(strcmp(field->name, name) == 0); - DIE_UNLESS(strcmp(field->org_name, org_name) == 0); - /* - XXX: silent column specification change works based on number of - bytes a column occupies. So CHAR -> VARCHAR upgrade is possible even - for CHAR(2) column if its character set is multibyte. - VARCHAR -> CHAR downgrade won't work for VARCHAR(3) as one would - expect. - */ - if (cs->mbmaxlen == 1) - { - if (field->type != type) - { - fprintf(stderr, - "Expected field type: %d, got type: %d in file %s, line %d\n", - (int) type, (int) field->type, file, line); - DIE_UNLESS(field->type == type); - } - } - if (table) - DIE_UNLESS(strcmp(field->table, table) == 0); - if (org_table) - DIE_UNLESS(strcmp(field->org_table, org_table) == 0); - DIE_UNLESS(strcmp(field->db, db) == 0); - /* - Character set should be taken into account for multibyte encodings, such - as utf8. Field length is calculated as number of characters * maximum - number of bytes a character can occupy. - */ - if (length && (field->length != expected_field_length)) - { - fflush(stdout); - fprintf(stderr, "Expected field length: %llu, got length: %lu\n", - expected_field_length, field->length); - fflush(stderr); - DIE_UNLESS(field->length == expected_field_length); - } - if (def) - DIE_UNLESS(strcmp(field->def, def) == 0); -} - - -/* Utility function to verify the parameter count */ - -static void verify_param_count(MYSQL_STMT *stmt, long exp_count) -{ - long param_count= mysql_stmt_param_count(stmt); - if (!opt_silent) - fprintf(stdout, "\n total parameters in stmt: `%ld` (expected: `%ld`)", - param_count, exp_count); - DIE_UNLESS(param_count == exp_count); -} - - -/* Utility function to verify the total affected rows */ - -static void verify_st_affected_rows(MYSQL_STMT *stmt, ulonglong exp_count) -{ - ulonglong affected_rows= mysql_stmt_affected_rows(stmt); - if (!opt_silent) - fprintf(stdout, "\n total affected rows: `%ld` (expected: `%ld`)", - (long) affected_rows, (long) exp_count); - DIE_UNLESS(affected_rows == exp_count); -} - - -/* Utility function to verify the total affected rows */ - -static void verify_affected_rows(ulonglong exp_count) -{ - ulonglong affected_rows= mysql_affected_rows(mysql); - if (!opt_silent) - fprintf(stdout, "\n total affected rows: `%ld` (expected: `%ld`)", - (long) affected_rows, (long) exp_count); - DIE_UNLESS(affected_rows == exp_count); -} - - -/* Utility function to verify the total fields count */ - -static void verify_field_count(MYSQL_RES *result, uint exp_count) -{ - uint field_count= mysql_num_fields(result); - if (!opt_silent) - fprintf(stdout, "\n total fields in the result set: `%d` (expected: `%d`)", - field_count, exp_count); - DIE_UNLESS(field_count == exp_count); -} - - -/* Utility function to execute a query using prepare-execute */ - -#ifndef EMBEDDED_LIBRARY -static void execute_prepare_query(const char *query, ulonglong exp_count) -{ - MYSQL_STMT *stmt; - ulonglong affected_rows; - int rc; - - stmt= mysql_simple_prepare(mysql, query); - check_stmt(stmt); - - rc= mysql_stmt_execute(stmt); - myquery(rc); - - affected_rows= mysql_stmt_affected_rows(stmt); - if (!opt_silent) - fprintf(stdout, "\n total affected rows: `%ld` (expected: `%ld`)", - (long) affected_rows, (long) exp_count); - - DIE_UNLESS(affected_rows == exp_count); - mysql_stmt_close(stmt); -} -#endif - /* Store result processing */ static void client_store_result() @@ -1005,267 +120,6 @@ static void client_use_result() } -/* - Accepts arbitrary number of queries and runs them against the database. - Used to fill tables for each test. -*/ - -void fill_tables(const char **query_list, unsigned query_count) -{ - int rc; - const char **query; - DBUG_ENTER("fill_tables"); - for (query= query_list; query < query_list + query_count; - ++query) - { - rc= mysql_query(mysql, *query); - myquery(rc); - } - DBUG_VOID_RETURN; -} - -/* - All state of fetch from one statement: statement handle, out buffers, - fetch position. - See fetch_n for for the only use case. -*/ - -enum { MAX_COLUMN_LENGTH= 255 }; - -typedef struct st_stmt_fetch -{ - const char *query; - unsigned stmt_no; - MYSQL_STMT *handle; - my_bool is_open; - MYSQL_BIND *bind_array; - char **out_data; - unsigned long *out_data_length; - unsigned column_count; - unsigned row_count; -} Stmt_fetch; - - -/* - Create statement handle, prepare it with statement, execute and allocate - fetch buffers. -*/ - -void stmt_fetch_init(Stmt_fetch *fetch, unsigned stmt_no_arg, - const char *query_arg) -{ - unsigned long type= CURSOR_TYPE_READ_ONLY; - int rc; - unsigned i; - MYSQL_RES *metadata; - DBUG_ENTER("stmt_fetch_init"); - - /* Save query and statement number for error messages */ - fetch->stmt_no= stmt_no_arg; - fetch->query= query_arg; - - fetch->handle= mysql_stmt_init(mysql); - - rc= mysql_stmt_prepare(fetch->handle, fetch->query, strlen(fetch->query)); - check_execute(fetch->handle, rc); - - /* - The attribute is sent to server on execute and asks to open read-only - for result set - */ - mysql_stmt_attr_set(fetch->handle, STMT_ATTR_CURSOR_TYPE, - (const void*) &type); - - rc= mysql_stmt_execute(fetch->handle); - check_execute(fetch->handle, rc); - - /* Find out total number of columns in result set */ - metadata= mysql_stmt_result_metadata(fetch->handle); - fetch->column_count= mysql_num_fields(metadata); - mysql_free_result(metadata); - - /* - Now allocate bind handles and buffers for output data: - calloc memory to reduce number of MYSQL_BIND members we need to - set up. - */ - - fetch->bind_array= (MYSQL_BIND *) calloc(1, sizeof(MYSQL_BIND) * - fetch->column_count); - fetch->out_data= (char**) calloc(1, sizeof(char*) * fetch->column_count); - fetch->out_data_length= (ulong*) calloc(1, sizeof(ulong) * - fetch->column_count); - for (i= 0; i < fetch->column_count; ++i) - { - fetch->out_data[i]= (char*) calloc(1, MAX_COLUMN_LENGTH); - fetch->bind_array[i].buffer_type= MYSQL_TYPE_STRING; - fetch->bind_array[i].buffer= fetch->out_data[i]; - fetch->bind_array[i].buffer_length= MAX_COLUMN_LENGTH; - fetch->bind_array[i].length= fetch->out_data_length + i; - } - - mysql_stmt_bind_result(fetch->handle, fetch->bind_array); - - fetch->row_count= 0; - fetch->is_open= TRUE; - - /* Ready for reading rows */ - DBUG_VOID_RETURN; -} - - -/* Fetch and print one row from cursor */ - -int stmt_fetch_fetch_row(Stmt_fetch *fetch) -{ - int rc; - unsigned i; - DBUG_ENTER("stmt_fetch_fetch_row"); - - if ((rc= mysql_stmt_fetch(fetch->handle)) == 0) - { - ++fetch->row_count; - if (!opt_silent) - printf("Stmt %d fetched row %d:\n", fetch->stmt_no, fetch->row_count); - for (i= 0; i < fetch->column_count; ++i) - { - fetch->out_data[i][fetch->out_data_length[i]]= '\0'; - if (!opt_silent) - printf("column %d: %s\n", i+1, fetch->out_data[i]); - } - } - else - fetch->is_open= FALSE; - DBUG_RETURN(rc); -} - - -void stmt_fetch_close(Stmt_fetch *fetch) -{ - unsigned i; - DBUG_ENTER("stmt_fetch_close"); - - for (i= 0; i < fetch->column_count; ++i) - free(fetch->out_data[i]); - free(fetch->out_data); - free(fetch->out_data_length); - free(fetch->bind_array); - mysql_stmt_close(fetch->handle); - DBUG_VOID_RETURN; -} - -/* - For given array of queries, open query_count cursors and fetch - from them in simultaneous manner. - In case there was an error in one of the cursors, continue - reading from the rest. -*/ - -enum fetch_type { USE_ROW_BY_ROW_FETCH= 0, USE_STORE_RESULT= 1 }; - -my_bool fetch_n(const char **query_list, unsigned query_count, - enum fetch_type fetch_type) -{ - unsigned open_statements= query_count; - int rc, error_count= 0; - Stmt_fetch *fetch_array= (Stmt_fetch*) calloc(1, sizeof(Stmt_fetch) * - query_count); - Stmt_fetch *fetch; - DBUG_ENTER("fetch_n"); - - for (fetch= fetch_array; fetch < fetch_array + query_count; ++fetch) - { - /* Init will exit(1) in case of error */ - stmt_fetch_init(fetch, fetch - fetch_array, - query_list[fetch - fetch_array]); - } - - if (fetch_type == USE_STORE_RESULT) - { - for (fetch= fetch_array; fetch < fetch_array + query_count; ++fetch) - { - rc= mysql_stmt_store_result(fetch->handle); - check_execute(fetch->handle, rc); - } - } - - while (open_statements) - { - for (fetch= fetch_array; fetch < fetch_array + query_count; ++fetch) - { - if (fetch->is_open && (rc= stmt_fetch_fetch_row(fetch))) - { - open_statements--; - /* - We try to fetch from the rest of the statements in case of - error - */ - if (rc != MYSQL_NO_DATA) - { - fprintf(stderr, - "Got error reading rows from statement %d,\n" - "query is: %s,\n" - "error message: %s", (int) (fetch - fetch_array), - fetch->query, - mysql_stmt_error(fetch->handle)); - error_count++; - } - } - } - } - if (error_count) - fprintf(stderr, "Fetch FAILED"); - else - { - unsigned total_row_count= 0; - for (fetch= fetch_array; fetch < fetch_array + query_count; ++fetch) - total_row_count+= fetch->row_count; - if (!opt_silent) - printf("Success, total rows fetched: %d\n", total_row_count); - } - for (fetch= fetch_array; fetch < fetch_array + query_count; ++fetch) - stmt_fetch_close(fetch); - free(fetch_array); - DBUG_RETURN(error_count != 0); -} - -/* Separate thread query to test some cases */ - -static my_bool thread_query(const char *query) -{ - MYSQL *l_mysql; - my_bool error; - - error= 0; - if (!opt_silent) - fprintf(stdout, "\n in thread_query(%s)", query); - if (!(l_mysql= mysql_client_init(NULL))) - { - myerror("mysql_client_init() failed"); - return 1; - } - if (!(mysql_real_connect(l_mysql, opt_host, opt_user, - opt_password, current_db, opt_port, - opt_unix_socket, 0))) - { - myerror("connection failed"); - error= 1; - goto end; - } - l_mysql->reconnect= 1; - if (mysql_query(l_mysql, query)) - { - fprintf(stderr, "Query failed (%s)\n", mysql_error(l_mysql)); - error= 1; - goto end; - } - mysql_commit(l_mysql); -end: - mysql_close(l_mysql); - return error; -} - - /* Query processing */ static void test_debug_example() @@ -1503,6 +357,7 @@ static void test_prepare_insert_update() myquery(rc); } + /* Test simple prepares of all DML statements */ static void test_prepare_simple() @@ -3454,6 +2309,7 @@ static void test_ps_query_cache() if (!opt_silent) fprintf(stdout, "OK"); + break; } strmov(query, "select id1, value1 from t1 where id1= ? or " @@ -14170,6 +13026,49 @@ static void test_bug8880() mysql_stmt_close(*stmt); } +/* + Test executing a query with prepared statements while query cache is active +*/ + +static void test_open_cursor_prepared_statement_query_cache() +{ + MYSQL_STMT *stmt; + int rc; + MYSQL_RES *result; + + myheader("test_open_cursor_prepared_statement_query_cache"); + if (! is_query_cache_available()) + { + fprintf(stdout, "Skipping test_open_cursor_prepared_statement_query_cache: Query cache not available.\n"); + return; + } + + rc= mysql_query(mysql, "set global query_cache_size=1000000"); + myquery(rc); + + mysql_query(mysql, "drop table if exists t1"); + mysql_query(mysql, "create table t1 (a int not null primary key, b int)"); + rc= mysql_query(mysql, "insert into t1 values (1,1)"); + myquery(rc); /* one check is enough */ + + /* Store query in query cache */ + rc= mysql_query(mysql, "SELECT * FROM t1"); + myquery(rc); + result= mysql_store_result(mysql); + mytest(result); + (void) my_process_result_set(result); + mysql_free_result(result); + + /* Test using a cursor */ + stmt= open_cursor("select a from t1"); + rc= mysql_stmt_execute(stmt); + check_execute(stmt, rc); + mysql_stmt_close(stmt); + + rc= mysql_query(mysql, "set global query_cache_size=1000000"); + myquery(rc); +} + static void test_bug9159() { @@ -19896,96 +18795,6 @@ static void test_bug13001491() } -/* - Read and parse arguments and MySQL options from my.cnf -*/ - -static const char *client_test_load_default_groups[]= -{ "client", "client-server", "client-mariadb", 0 }; -static char **defaults_argv; - -static struct my_option client_test_long_options[] = -{ - {"basedir", 'b', "Basedir for tests.", (char**) &opt_basedir, - (char**) &opt_basedir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"count", 't', "Number of times test to be executed", &opt_count, - &opt_count, 0, GET_UINT, REQUIRED_ARG, 1, 0, 0, 0, 0, 0}, - {"database", 'D', "Database to use", &opt_db, &opt_db, - 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"debug", '#', "Output debug log", (char**) &default_dbug_option, - (char**) &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, - {"help", '?', "Display this help and exit", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, - 0, 0, 0, 0, 0}, - {"host", 'h', "Connect to host", &opt_host, &opt_host, - 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"password", 'p', - "Password to use when connecting to server. If password is not given it's asked from the tty.", - 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, - {"port", 'P', "Port number to use for connection or 0 for default to, in " - "order of preference, my.cnf, $MYSQL_TCP_PORT, " -#if MYSQL_PORT_DEFAULT == 0 - "/etc/services, " -#endif - "built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").", - &opt_port, &opt_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"server-arg", 'A', "Send embedded server this as a parameter.", - 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"show-tests", 'T', "Show all tests' names", 0, 0, 0, GET_NO_ARG, NO_ARG, - 0, 0, 0, 0, 0, 0}, - {"silent", 's', "Be more silent", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, - 0}, -#ifdef HAVE_SMEM - {"shared-memory-base-name", 'm', "Base name of shared memory.", - &shared_memory_base_name, (uchar**)&shared_memory_base_name, 0, - GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, -#endif - {"socket", 'S', "Socket file to use for connection", - &opt_unix_socket, &opt_unix_socket, 0, GET_STR, - REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"testcase", 'c', - "May disable some code when runs as mysql-test-run testcase.", - 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, -#ifndef DONT_ALLOW_USER_CHANGE - {"user", 'u', "User for login if not current user", &opt_user, - &opt_user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, -#endif - {"vardir", 'v', "Data dir for tests.", (char**) &opt_vardir, - (char**) &opt_vardir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"non-blocking-api", 'n', - "Use the non-blocking client API for communication.", - &non_blocking_api_enabled, &non_blocking_api_enabled, 0, - GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"getopt-ll-test", 'g', "Option for testing bug in getopt library", - &opt_getopt_ll_test, &opt_getopt_ll_test, 0, - GET_LL, REQUIRED_ARG, 0, 0, LONGLONG_MAX, 0, 0, 0}, - {"plugin_dir", 0, "Directory for client-side plugins.", - &opt_plugin_dir, &opt_plugin_dir, 0, - GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"default_auth", 0, "Default authentication client-side plugin to use.", - &opt_default_auth, &opt_default_auth, 0, - GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} -}; - - -static void usage(void) -{ - /* show the usage string when the user asks for this */ - putc('\n', stdout); - printf("%s Ver %s Distrib %s, for %s (%s)\n", - my_progname, VER, MYSQL_SERVER_VERSION, SYSTEM_TYPE, MACHINE_TYPE); - puts("By Monty, Venu, Kent and others\n"); - printf("\ -Copyright (C) 2002-2004 MySQL AB\n\ -This software comes with ABSOLUTELY NO WARRANTY. This is free software,\n\ -and you are welcome to modify and redistribute it under the GPL license\n"); - printf("Usage: %s [OPTIONS] [TESTNAME1 TESTNAME2...]\n", my_progname); - my_print_help(client_test_long_options); - print_defaults("my", client_test_load_default_groups); - my_print_variables(client_test_long_options); -} - - static struct my_tests_st my_tests[]= { { "disable_query_logs", disable_query_logs }, { "test_view_sp_list_fields", test_view_sp_list_fields }, @@ -20153,6 +18962,8 @@ static struct my_tests_st my_tests[]= { { "test_bug8378", test_bug8378 }, { "test_bug8722", test_bug8722 }, { "test_bug8880", test_bug8880 }, + { "test_open_cursor_prepared_statement_query_cache", + test_open_cursor_prepared_statement_query_cache }, { "test_bug9159", test_bug9159 }, { "test_bug9520", test_bug9520 }, { "test_bug9478", test_bug9478 }, @@ -20251,185 +19062,4 @@ static struct my_tests_st my_tests[]= { }; -static my_bool -get_one_option(int optid, const struct my_option *opt __attribute__((unused)), - char *argument) -{ - switch (optid) { - case '#': - DBUG_PUSH(argument ? argument : default_dbug_option); - break; - case 'c': -#ifdef NOT_USED - opt_testcase = 1; -#endif - break; - case 'p': - if (argument) - { - char *start=argument; - my_free(opt_password); - opt_password= my_strdup(argument, MYF(MY_FAE)); - while (*argument) *argument++= 'x'; /* Destroy argument */ - if (*start) - start[1]=0; - } - else - tty_password= 1; - break; - case 's': - if (argument == disabled_my_option) - opt_silent= 0; - else - opt_silent++; - break; - case 'A': - /* - When the embedded server is being tested, the test suite needs to be - able to pass command-line arguments to the embedded server so it can - locate the language files and data directory. The test suite - (mysql-test-run) never uses config files, just command-line options. - */ - if (!embedded_server_arg_count) - { - embedded_server_arg_count= 1; - embedded_server_args[0]= (char*) ""; - } - if (embedded_server_arg_count == MAX_SERVER_ARGS-1 || - !(embedded_server_args[embedded_server_arg_count++]= - my_strdup(argument, MYF(MY_FAE)))) - { - DIE("Can't use server argument"); - } - break; - case 'T': - { - struct my_tests_st *fptr; - - printf("All possible test names:\n\n"); - for (fptr= my_tests; fptr->name; fptr++) - printf("%s\n", fptr->name); - exit(0); - break; - } - case '?': - case 'I': /* Info */ - usage(); - exit(0); - break; - } - return 0; -} - -static void get_options(int *argc, char ***argv) -{ - int ho_error; - - if ((ho_error= handle_options(argc, argv, client_test_long_options, - get_one_option))) - exit(ho_error); - - if (tty_password) - opt_password= get_tty_password(NullS); - return; -} - -/* - Print the test output on successful execution before exiting -*/ - -static void print_test_output() -{ - if (opt_silent < 3) - { - fprintf(stdout, "\n\n"); - fprintf(stdout, "All '%d' tests were successful (in '%d' iterations)", - test_count-1, opt_count); - fprintf(stdout, "\n Total execution time: %g SECS", total_time); - if (opt_count > 1) - fprintf(stdout, " (Avg: %g SECS)", total_time/opt_count); - - fprintf(stdout, "\n\n!!! SUCCESS !!!\n"); - } -} - -/*************************************************************************** - main routine -***************************************************************************/ - - -int main(int argc, char **argv) -{ - struct my_tests_st *fptr; - - MY_INIT(argv[0]); - - if (load_defaults("my", client_test_load_default_groups, &argc, &argv)) - exit(1); - - defaults_argv= argv; - get_options(&argc, &argv); - - if (mysql_server_init(embedded_server_arg_count, - embedded_server_args, - (char**) embedded_server_groups)) - DIE("Can't initialize MySQL server"); - - /* connect to server with no flags, default protocol, auto reconnect true */ - mysql= client_connect(0, MYSQL_PROTOCOL_DEFAULT, 1); - - total_time= 0; - for (iter_count= 1; iter_count <= opt_count; iter_count++) - { - /* Start of tests */ - test_count= 1; - start_time= time((time_t *)0); - if (!argc) - { - for (fptr= my_tests; fptr->name; fptr++) - (*fptr->function)(); - } - else - { - for ( ; *argv ; argv++) - { - for (fptr= my_tests; fptr->name; fptr++) - { - if (!strcmp(fptr->name, *argv)) - { - (*fptr->function)(); - break; - } - } - if (!fptr->name) - { - fprintf(stderr, "\n\nGiven test not found: '%s'\n", *argv); - fprintf(stderr, "See legal test names with %s -T\n\nAborting!\n", - my_progname); - client_disconnect(mysql, 1); - free_defaults(defaults_argv); - exit(1); - } - } - } - - end_time= time((time_t *)0); - total_time+= difftime(end_time, start_time); - - /* End of tests */ - } - - client_disconnect(mysql, 1); /* disconnect from server */ - - free_defaults(defaults_argv); - print_test_output(); - - while (embedded_server_arg_count > 1) - my_free(embedded_server_args[--embedded_server_arg_count]); - - mysql_server_end(); - - my_end(0); - - exit(0); -} +static struct my_tests_st *get_my_tests() { return my_tests; } diff --git a/unittest/mysys/ma_dyncol-t.c b/unittest/mysys/ma_dyncol-t.c index 11731ae81d4..4a9b687bc08 100644 --- a/unittest/mysys/ma_dyncol-t.c +++ b/unittest/mysys/ma_dyncol-t.c @@ -194,7 +194,7 @@ static CHARSET_INFO *charset_list[]= #endif #ifdef HAVE_CHARSET_utf8 &my_charset_utf8_general_ci, -#ifdef HAVE_HAVE_UCA_COLLATIONS +#ifdef HAVE_UCA_COLLATIONS &my_charset_utf8_unicode_ci, #endif &my_charset_utf8_bin, diff --git a/unittest/strings/strings-t.c b/unittest/strings/strings-t.c index 7e61cb8722e..6baef0417a8 100644 --- a/unittest/strings/strings-t.c +++ b/unittest/strings/strings-t.c @@ -87,7 +87,7 @@ static CHARSET_INFO *charset_list[]= #endif #ifdef HAVE_CHARSET_utf8 &my_charset_utf8_general_ci, -#ifdef HAVE_HAVE_UCA_COLLATIONS +#ifdef HAVE_UCA_COLLATIONS &my_charset_utf8_unicode_ci, #endif &my_charset_utf8_bin, diff --git a/vio/viosslfactories.c b/vio/viosslfactories.c index f64869e905d..a1c2010912b 100644 --- a/vio/viosslfactories.c +++ b/vio/viosslfactories.c @@ -164,8 +164,8 @@ static void check_ssl_init() static struct st_VioSSLFd * new_VioSSLFd(const char *key_file, const char *cert_file, const char *ca_file, const char *ca_path, - const char *cipher, SSL_METHOD *method, - enum enum_ssl_init_error *error) + const char *cipher, my_bool is_client_method, + enum enum_ssl_init_error* error) { DH *dh; struct st_VioSSLFd *ssl_fd; @@ -185,7 +185,9 @@ new_VioSSLFd(const char *key_file, const char *cert_file, my_malloc(sizeof(struct st_VioSSLFd),MYF(0))))) DBUG_RETURN(0); - if (!(ssl_fd->ssl_context= SSL_CTX_new(method))) + if (!(ssl_fd->ssl_context= SSL_CTX_new(is_client_method ? + TLSv1_client_method() : + TLSv1_server_method()))) { *error= SSL_INITERR_MEMFAIL; DBUG_PRINT("error", ("%s", sslGetErrString(*error))); @@ -262,7 +264,7 @@ new_VioSSLConnectorFd(const char *key_file, const char *cert_file, verify= SSL_VERIFY_NONE; if (!(ssl_fd= new_VioSSLFd(key_file, cert_file, ca_file, - ca_path, cipher, TLSv1_client_method(), error))) + ca_path, cipher, TRUE, error))) { return 0; } @@ -284,8 +286,7 @@ new_VioSSLAcceptorFd(const char *key_file, const char *cert_file, struct st_VioSSLFd *ssl_fd; int verify= SSL_VERIFY_PEER | SSL_VERIFY_CLIENT_ONCE; if (!(ssl_fd= new_VioSSLFd(key_file, cert_file, ca_file, - ca_path, cipher, - (SSL_METHOD*) TLSv1_server_method(), error))) + ca_path, cipher, FALSE, error))) { return 0; } diff --git a/win/packaging/ca/CMakeLists.txt b/win/packaging/ca/CMakeLists.txt index 940e9e3a7d1..0da1e5d67b1 100644 --- a/win/packaging/ca/CMakeLists.txt +++ b/win/packaging/ca/CMakeLists.txt @@ -33,7 +33,7 @@ IF(MSVC_VERSION EQUAL 1400) ELSEIF(MSVC_VERSION EQUAL 1500) SET(WIX35_MSVC_SUFFIX "_2008") SET(WIX36_MSVC_SUFFIX "VS2008") -ELSEIF(MSVC_VERSION EQUAL 1600) +ELSEIF(MSVC_VERSION EQUAL 1600 OR MSVC_VERSION EQUAL 1700 ) SET(WIX35_MSVC_SUFFIX "_2010") SET(WIX36_MSVC_SUFFIX "VS2010") ELSE() |