diff options
author | Sergei Golubchik <serg@mariadb.org> | 2020-10-29 13:03:08 +0100 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2020-10-29 13:03:08 +0100 |
commit | 0697d75cd052e809b05cc3e812f5e48209c04b4c (patch) | |
tree | 16524035d92e3d78dc27db00dbc30198aa84db78 | |
parent | f6549e95448e5cce52336361f5a59d1edcdac46a (diff) | |
parent | c05e571e7d53ba11a3422490cff0d93e6691ea62 (diff) | |
download | mariadb-git-10.5-merge.tar.gz |
Merge commit 'c05e571e7d53ba11a3422490cff0d93e6691ea62' into HEAD10.5-merge
179 files changed, 20354 insertions, 2529 deletions
diff --git a/.gitignore b/.gitignore index e38b56e5894..21350997aa5 100644 --- a/.gitignore +++ b/.gitignore @@ -101,6 +101,7 @@ packaging/rpm-uln/mysql.10.0.11.spec packaging/solaris/postinstall-solaris extra/pcre2 plugin/auth_pam/auth_pam_tool +plugin/auth_pam/config_auth_pam.h plugin/aws_key_management/aws-sdk-cpp plugin/aws_key_management/aws_sdk_cpp plugin/aws_key_management/aws_sdk_cpp-prefix diff --git a/client/mysqldump.c b/client/mysqldump.c index 4830a6c782b..4f5bb02d0c2 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -39,7 +39,7 @@ ** 10 Jun 2003: SET NAMES and --no-set-names by Alexander Barkov */ -#define DUMP_VERSION "10.17" +#define DUMP_VERSION "10.18" #include <my_global.h> #include <my_sys.h> @@ -83,7 +83,8 @@ #define IGNORE_NONE 0x00 /* no ignore */ #define IGNORE_DATA 0x01 /* don't dump data for this table */ #define IGNORE_INSERT_DELAYED 0x02 /* table doesn't support INSERT DELAYED */ -#define IGNORE_S3_TABLE 0x04 +#define IGNORE_SEQUENCE_TABLE 0x04 /* catch the SEQUENCE*/ +#define IGNORE_S3_TABLE 0x08 /* Chars needed to store LONGLONG, excluding trailing '\0'. */ #define LONGLONG_LEN 20 @@ -2743,7 +2744,68 @@ static inline my_bool general_log_or_slow_log_tables(const char *db, !my_strcasecmp(charset_info, table, "slow_log") || !my_strcasecmp(charset_info, table, "transaction_registry")); } +/* + get_sequence_structure-- retrievs sequence structure, prints out corresponding + CREATE statement + ARGS + seq - sequence name + db - db name +*/ + +static void get_sequence_structure(const char *seq, const char *db) +{ + + char table_buff[NAME_LEN*2+3]; + char *result_seq; + FILE *sql_file= md_result_file; + MYSQL_RES *result; + MYSQL_ROW row; + + DBUG_ENTER("get_sequence_structure"); + DBUG_PRINT("enter", ("db: %s sequence: %s", db, seq)); + + verbose_msg("-- Retrieving sequence structure for %s...\n", seq); + + result_seq= quote_name(seq, table_buff, 1); + // Sequences as tables share same flags + if (!opt_no_create_info) + { + char buff[20+FN_REFLEN]; + my_snprintf(buff, sizeof(buff), "SHOW CREATE SEQUENCE %s", result_seq); + if (mysql_query_with_error_report(mysql, &result, buff)) + { + DBUG_VOID_RETURN; + } + + print_comment(sql_file, 0, + "\n--\n-- Sequence structure for %s\n--\n\n", + fix_for_comment(result_seq)); + if (opt_drop) + { + fprintf(sql_file, "DROP SEQUENCE IF EXISTS %s;\n", result_seq); + check_io(sql_file); + } + + row= mysql_fetch_row(result); + fprintf(sql_file, "%s;\n", row[1]); + mysql_free_result(result); + // Restore next not cached value from sequence + my_snprintf(buff, sizeof(buff), "SELECT next_not_cached_value FROM %s", result_seq); + if (mysql_query_with_error_report(mysql, &result, buff)) + { + DBUG_VOID_RETURN; + } + row= mysql_fetch_row(result); + if (row[0]) + { + fprintf(sql_file, "SELECT SETVAL(%s, %s, 0);\n", result_seq, row[0]); + } + // Sequences will not use inserts, so no need for REPLACE and LOCKS + mysql_free_result(result); + } + DBUG_VOID_RETURN; +} /* get_table_structure -- retrievs database structure, prints out corresponding CREATE statement and fills out insert_pat if the table is the type we will @@ -3746,6 +3808,14 @@ static void dump_table(char *table, char *db, const uchar *hash_key, size_t len) DBUG_ENTER("dump_table"); /* + Check does table has a sequence structure and if has apply different sql queries + */ + if (check_if_ignore_table(table, table_type) & IGNORE_SEQUENCE_TABLE) + { + get_sequence_structure(table, db); + DBUG_VOID_RETURN; + } + /* Make sure you get the create table info before the following check for --no-data flag below. Otherwise, the create table info won't be printed. */ @@ -5730,7 +5800,7 @@ char check_if_ignore_table(const char *table_name, char *table_type) /* Check memory for quote_for_like() */ DBUG_ASSERT(2*sizeof(table_name) < sizeof(show_name_buff)); my_snprintf(buff, sizeof(buff), - "SELECT engine FROM INFORMATION_SCHEMA.TABLES " + "SELECT engine, table_type FROM INFORMATION_SCHEMA.TABLES " "WHERE table_schema = DATABASE() AND table_name = %s", quote_for_equal(table_name, show_name_buff)); if (mysql_query_with_error_report(mysql, &res, buff)) @@ -5770,6 +5840,8 @@ char check_if_ignore_table(const char *table_name, char *table_type) strcmp(table_type,"MEMORY")) result= IGNORE_INSERT_DELAYED; } + if (!strcmp(row[1],"SEQUENCE")) + result|= IGNORE_SEQUENCE_TABLE; if (!strcmp(table_type, "S3")) result|= IGNORE_S3_TABLE; diff --git a/cmake/jemalloc.cmake b/cmake/jemalloc.cmake index 5ad636d0e6c..b94a880cf05 100644 --- a/cmake/jemalloc.cmake +++ b/cmake/jemalloc.cmake @@ -17,7 +17,7 @@ MACRO (CHECK_JEMALLOC) IF(WITH_JEMALLOC STREQUAL "static") SET(libname jemalloc_pic) - SET(CMAKE_REQUIRED_LIBRARIES pthread dl m) + SET(CMAKE_REQUIRED_LIBRARIES pthread ${CMAKE_DL_LIBS} m) SET(what bundled) ELSE() SET(libname jemalloc c) diff --git a/cmake/ssl.cmake b/cmake/ssl.cmake index 7143fce9e09..5f54d77752c 100644 --- a/cmake/ssl.cmake +++ b/cmake/ssl.cmake @@ -126,7 +126,7 @@ MACRO (MYSQL_CHECK_SSL) SET(SSL_LIBRARIES ${SSL_LIBRARIES} ${LIBSOCKET}) ENDIF() IF(CMAKE_SYSTEM_NAME MATCHES "Linux") - SET(SSL_LIBRARIES ${SSL_LIBRARIES} ${LIBDL}) + SET(SSL_LIBRARIES ${SSL_LIBRARIES} ${CMAKE_DL_LIBS}) ENDIF() MESSAGE_ONCE(OPENSSL_INCLUDE_DIR "OPENSSL_INCLUDE_DIR = ${OPENSSL_INCLUDE_DIR}") diff --git a/configure.cmake b/configure.cmake index 8533b8ee0b2..64be91606ae 100644 --- a/configure.cmake +++ b/configure.cmake @@ -130,7 +130,6 @@ IF(UNIX) MY_SEARCH_LIBS(bind "bind;socket" LIBBIND) MY_SEARCH_LIBS(crypt crypt LIBCRYPT) MY_SEARCH_LIBS(setsockopt socket LIBSOCKET) - MY_SEARCH_LIBS(dlopen dl LIBDL) MY_SEARCH_LIBS(sched_yield rt LIBRT) IF(NOT LIBRT) MY_SEARCH_LIBS(clock_gettime rt LIBRT) @@ -138,7 +137,7 @@ IF(UNIX) FIND_PACKAGE(Threads) SET(CMAKE_REQUIRED_LIBRARIES - ${LIBM} ${LIBNSL} ${LIBBIND} ${LIBCRYPT} ${LIBSOCKET} ${LIBDL} ${CMAKE_THREAD_LIBS_INIT} ${LIBRT} ${LIBEXECINFO}) + ${LIBM} ${LIBNSL} ${LIBBIND} ${LIBCRYPT} ${LIBSOCKET} ${CMAKE_DL_LIBS} ${CMAKE_THREAD_LIBS_INIT} ${LIBRT} ${LIBEXECINFO}) # Need explicit pthread for gcc -fsanitize=address IF(CMAKE_USE_PTHREADS_INIT AND CMAKE_C_FLAGS MATCHES "-fsanitize=") SET(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} pthread) diff --git a/extra/aws_sdk/CMakeLists.txt b/extra/aws_sdk/CMakeLists.txt index 85a196dccce..7c4b8d8195c 100644 --- a/extra/aws_sdk/CMakeLists.txt +++ b/extra/aws_sdk/CMakeLists.txt @@ -34,7 +34,7 @@ ENDFOREACH() IF(CMAKE_VERSION LESS "3.0") SET(GIT_TAG "1.0.8") ELSE() - SET(GIT_TAG "1.2.11") + SET(GIT_TAG "1.8.29") ENDIF() IF(MSVC_CRT_TYPE MATCHES "/MD") diff --git a/extra/mariabackup/xtrabackup.cc b/extra/mariabackup/xtrabackup.cc index b63e50474ca..81794d63563 100644 --- a/extra/mariabackup/xtrabackup.cc +++ b/extra/mariabackup/xtrabackup.cc @@ -2461,17 +2461,24 @@ xb_get_copy_action(const char *dflt) return(action); } -/* TODO: We may tune the behavior (e.g. by fil_aio)*/ -static -my_bool -xtrabackup_copy_datafile(fil_node_t* node, uint thread_n, const char *dest_name=0, ulonglong max_size=ULLONG_MAX) +/** Copy innodb data file to the specified destination. + +@param[in] node file node of a tablespace +@param[in] thread_n thread id, used in the text of diagnostic messages +@param[in] dest_name destination file name +@param[in] write_filter write filter to copy data, can be pass-through filter +for full backup, pages filter for incremental backup, etc. + +@return FALSE on success and TRUE on error */ +static my_bool xtrabackup_copy_datafile(fil_node_t *node, uint thread_n, + const char *dest_name, + const xb_write_filt_t &write_filter) { char dst_name[FN_REFLEN]; ds_file_t *dstfile = NULL; xb_fil_cur_t cursor; xb_fil_cur_result_t res; - xb_write_filt_t *write_filter = NULL; xb_write_filt_ctxt_t write_filt_ctxt; const char *action; xb_read_filt_t *read_filter; @@ -2515,7 +2522,7 @@ xtrabackup_copy_datafile(fil_node_t* node, uint thread_n, const char *dest_name= read_filter = &rf_bitmap; } - res = xb_fil_cur_open(&cursor, read_filter, node, thread_n,max_size); + res = xb_fil_cur_open(&cursor, read_filter, node, thread_n, ULLONG_MAX); if (res == XB_FIL_CUR_SKIP) { goto skip; } else if (res == XB_FIL_CUR_ERROR) { @@ -2526,18 +2533,11 @@ xtrabackup_copy_datafile(fil_node_t* node, uint thread_n, const char *dest_name= sizeof dst_name - 1); dst_name[sizeof dst_name - 1] = '\0'; - /* Setup the page write filter */ - if (xtrabackup_incremental) { - write_filter = &wf_incremental; - } else { - write_filter = &wf_write_through; - } - memset(&write_filt_ctxt, 0, sizeof(xb_write_filt_ctxt_t)); - ut_a(write_filter->process != NULL); + ut_a(write_filter.process != NULL); - if (write_filter->init != NULL && - !write_filter->init(&write_filt_ctxt, dst_name, &cursor)) { + if (write_filter.init != NULL && + !write_filter.init(&write_filt_ctxt, dst_name, &cursor)) { msg (thread_n, "mariabackup: error: failed to initialize page write filter."); goto error; } @@ -2558,7 +2558,7 @@ xtrabackup_copy_datafile(fil_node_t* node, uint thread_n, const char *dest_name= /* The main copy loop */ while ((res = xb_fil_cur_read(&cursor)) == XB_FIL_CUR_SUCCESS) { - if (!write_filter->process(&write_filt_ctxt, dstfile)) { + if (!write_filter.process(&write_filt_ctxt, dstfile)) { goto error; } } @@ -2567,8 +2567,8 @@ xtrabackup_copy_datafile(fil_node_t* node, uint thread_n, const char *dest_name= goto error; } - if (write_filter->finalize - && !write_filter->finalize(&write_filt_ctxt, dstfile)) { + if (write_filter.finalize + && !write_filter.finalize(&write_filt_ctxt, dstfile)) { goto error; } @@ -2582,8 +2582,8 @@ xtrabackup_copy_datafile(fil_node_t* node, uint thread_n, const char *dest_name= if (ds_close(dstfile)) { rc = TRUE; } - if (write_filter && write_filter->deinit) { - write_filter->deinit(&write_filt_ctxt); + if (write_filter.deinit) { + write_filter.deinit(&write_filt_ctxt); } return(rc); @@ -2592,8 +2592,8 @@ error: if (dstfile != NULL) { ds_close(dstfile); } - if (write_filter && write_filter->deinit) { - write_filter->deinit(&write_filt_ctxt);; + if (write_filter.deinit) { + write_filter.deinit(&write_filt_ctxt);; } msg(thread_n, "mariabackup: xtrabackup_copy_datafile() failed."); return(TRUE); /*ERROR*/ @@ -2603,8 +2603,8 @@ skip: if (dstfile != NULL) { ds_close(dstfile); } - if (write_filter && write_filter->deinit) { - write_filter->deinit(&write_filt_ctxt); + if (write_filter.deinit) { + write_filter.deinit(&write_filt_ctxt); } msg(thread_n,"Warning: We assume the table was dropped during xtrabackup execution and ignore the tablespace %s", node_name); return(FALSE); @@ -2894,9 +2894,9 @@ DECLARE_THREAD(data_copy_thread_func)( while ((node = datafiles_iter_next(ctxt->it)) != NULL) { DBUG_MARIABACKUP_EVENT("before_copy", node->space->name); /* copy the datafile */ - if(xtrabackup_copy_datafile(node, num)) { + if (xtrabackup_copy_datafile(node, num, NULL, + xtrabackup_incremental ? wf_incremental : wf_write_through)) die("failed to copy datafile."); - } DBUG_MARIABACKUP_EVENT("after_copy", node->space->name); @@ -4406,7 +4406,7 @@ void backup_fix_ddl(void) continue; std::string dest_name(node->space->name); dest_name.append(".new"); - xtrabackup_copy_datafile(node, 0, dest_name.c_str()/*, do_full_copy ? ULONGLONG_MAX:UNIV_PAGE_SIZE */); + xtrabackup_copy_datafile(node, 0, dest_name.c_str(), wf_write_through); } datafiles_iter_free(it); @@ -4979,22 +4979,66 @@ static void rename_force(const char *from, const char *to) { rename_file(from,to); } -/* During prepare phase, rename ".new" files , that were created in backup_fix_ddl(), - to ".ibd".*/ -static ibool prepare_handle_new_files( - const char* data_home_dir, /*!<in: path to datadir */ - const char* db_name, /*!<in: database name */ - const char* file_name, /*!<in: file name with suffix */ - void *) -{ +/** During prepare phase, rename ".new" files, that were created in +backup_fix_ddl() and backup_optimized_ddl_op(), to ".ibd". In the case of +incremental backup, i.e. of arg argument is set, move ".new" files to +destination directory and rename them to ".ibd", remove existing ".ibd.delta" +and ".idb.meta" files in incremental directory to avoid applying delta to +".ibd" file. + +@param[in] data_home_dir path to datadir +@param[in] db_name database name +@param[in] file_name file name with suffix +@param[in] arg destination path, used in incremental backup to notify, that +*.new file must be moved to destibation directory + +@return true */ +static ibool prepare_handle_new_files(const char *data_home_dir, + const char *db_name, + const char *file_name, void *arg) +{ + const char *dest_dir = static_cast<const char *>(arg); std::string src_path = std::string(data_home_dir) + '/' + std::string(db_name) + '/' + file_name; - std::string dest_path = src_path; + /* Copy "*.new" files from incremental to base dir for incremental backup */ + std::string dest_path= + dest_dir ? std::string(dest_dir) + '/' + std::string(db_name) + + '/' + file_name : src_path; size_t index = dest_path.find(".new"); DBUG_ASSERT(index != std::string::npos); - dest_path.replace(index, 4, ".ibd"); + dest_path.replace(index, strlen(".ibd"), ".ibd"); rename_force(src_path.c_str(),dest_path.c_str()); + + if (dest_dir) { + /* remove delta and meta files to avoid delta applying for new file */ + index = src_path.find(".new"); + DBUG_ASSERT(index != std::string::npos); + src_path.replace(index, std::string::npos, ".ibd.delta"); + if (access(src_path.c_str(), R_OK) == 0) { + msg("Removing %s", src_path.c_str()); + if (my_delete(src_path.c_str(), MYF(MY_WME))) + die("Can't remove %s, errno %d", src_path.c_str(), errno); + } + src_path.replace(index, std::string::npos, ".ibd.meta"); + if (access(src_path.c_str(), R_OK) == 0) { + msg("Removing %s", src_path.c_str()); + if (my_delete(src_path.c_str(), MYF(MY_WME))) + die("Can't remove %s, errno %d", src_path.c_str(), errno); + } + + /* add table name to the container to avoid it's deletion at the end of + prepare */ + std::string table_name = std::string(db_name) + '/' + + std::string(file_name, file_name + strlen(file_name) - strlen(".new")); + xb_filter_entry_t *table = static_cast<xb_filter_entry_t *> + (malloc(sizeof(xb_filter_entry_t) + table_name.size() + 1)); + table->name = ((char*)table) + sizeof(xb_filter_entry_t); + strcpy(table->name, table_name.c_str()); + HASH_INSERT(xb_filter_entry_t, name_hash, &inc_dir_tables_hash, + ut_fold_string(table->name), table); + } + return TRUE; } @@ -5031,17 +5075,18 @@ rm_if_not_found( return(TRUE); } -/************************************************************************ -Function enumerates files in datadir (provided by path) which are matched +/** Function enumerates files in datadir (provided by path) which are matched by provided suffix. For each entry callback is called. + +@param[in] path datadir path +@param[in] suffix suffix to match against +@param[in] func callback +@param[in] func_arg arguments for the above callback + @return FALSE if callback for some entry returned FALSE */ -static -ibool -xb_process_datadir( - const char* path, /*!<in: datadir path */ - const char* suffix, /*!<in: suffix to match - against */ - handle_datadir_entry_func_t func) /*!<in: callback */ +static ibool xb_process_datadir(const char *path, const char *suffix, + handle_datadir_entry_func_t func, + void *func_arg = NULL) { ulint ret; char dbpath[OS_FILE_MAX_PATH+2]; @@ -5076,7 +5121,7 @@ xb_process_datadir( suffix)) { if (!func( path, NULL, - fileinfo.name, NULL)) + fileinfo.name, func_arg)) { os_file_closedir(dbdir); return(FALSE); @@ -5140,7 +5185,7 @@ next_file_item_1: if (!func( path, dbinfo.name, - fileinfo.name, NULL)) + fileinfo.name, func_arg)) { os_file_closedir(dbdir); os_file_closedir(dir); @@ -5300,6 +5345,10 @@ static bool xtrabackup_prepare_func(char** argv) fil_path_to_mysql_datadir = "."; + ut_ad(xtrabackup_incremental == xtrabackup_incremental_dir); + if (xtrabackup_incremental) + inc_dir_tables_hash.create(1000); + /* Fix DDL for prepare. Process .del,.ren, and .new files. The order in which files are processed, is important (see MDEV-18185, MDEV-18201) @@ -5311,6 +5360,8 @@ static bool xtrabackup_prepare_func(char** argv) if (xtrabackup_incremental_dir) { xb_process_datadir(xtrabackup_incremental_dir, ".new.meta", prepare_handle_new_files); xb_process_datadir(xtrabackup_incremental_dir, ".new.delta", prepare_handle_new_files); + xb_process_datadir(xtrabackup_incremental_dir, ".new", + prepare_handle_new_files, (void *)"."); } else { xb_process_datadir(".", ".new", prepare_handle_new_files); @@ -5390,8 +5441,6 @@ static bool xtrabackup_prepare_func(char** argv) goto error_cleanup; } - inc_dir_tables_hash.create(1000); - ok = fil_system.sys_space->open(false) && xtrabackup_apply_deltas(); diff --git a/include/my_sys.h b/include/my_sys.h index e39452a376d..a66bfd8217c 100644 --- a/include/my_sys.h +++ b/include/my_sys.h @@ -459,18 +459,19 @@ typedef struct st_io_cache /* Used when caching files */ partial. */ int seek_not_done,error; - /* buffer_length is memory size allocated for buffer or write_buffer */ + /* length of the buffer used for storing un-encrypted data */ size_t buffer_length; /* read_length is the same as buffer_length except when we use async io */ size_t read_length; myf myflags; /* Flags used to my_read/my_write */ /* - alloced_buffer is 1 if the buffer was allocated by init_io_cache() and - 0 if it was supplied by the user. + alloced_buffer is set to the size of the buffer allocated for the IO_CACHE. + Includes the overhead(storing key to ecnrypt and decrypt) for encryption. + Set to 0 if nothing is allocated. Currently READ_NET is the only one that will use a buffer allocated somewhere else */ - my_bool alloced_buffer; + size_t alloced_buffer; } IO_CACHE; typedef int (*qsort2_cmp)(const void *, const void *, const void *); diff --git a/include/mysql_version.h.in b/include/mysql_version.h.in index ad719634335..82a13283e3f 100644 --- a/include/mysql_version.h.in +++ b/include/mysql_version.h.in @@ -18,13 +18,16 @@ #define MYSQL_SERVER_SUFFIX_DEF "@MYSQL_SERVER_SUFFIX@" #define FRM_VER @DOT_FRM_VERSION@ #define MYSQL_VERSION_ID @MYSQL_VERSION_ID@ -#define MYSQL_PORT @MYSQL_TCP_PORT@ +#define MARIADB_PORT @MYSQL_TCP_PORT@ #define MYSQL_PORT_DEFAULT @MYSQL_TCP_PORT_DEFAULT@ -#define MYSQL_UNIX_ADDR "@MYSQL_UNIX_ADDR@" +#define MARIADB_UNIX_ADDR "@MYSQL_UNIX_ADDR@" #define MYSQL_CONFIG_NAME "my" #define MYSQL_COMPILATION_COMMENT "@COMPILATION_COMMENT@" #define SERVER_MATURITY_LEVEL @SERVER_MATURITY_LEVEL@ +#define MYSQL_PORT MARIADB_PORT +#define MYSQL_UNIX_ADDR MARIADB_UNIX_ADDR + #ifdef WITH_WSREP #define WSREP_PATCH_VERSION "@WSREP_PATCH_VERSION@" #endif diff --git a/libmariadb b/libmariadb -Subproject a746c3af449a8754e78ad7971e59e79af7957cd +Subproject 0cdc1656a70c52103b4329debf9ed02ccacfb3c diff --git a/libmysqld/CMakeLists.txt b/libmysqld/CMakeLists.txt index 9dddc8a8990..e370ac80a8d 100644 --- a/libmysqld/CMakeLists.txt +++ b/libmysqld/CMakeLists.txt @@ -159,7 +159,7 @@ ENDIF() SET(LIBS dbug strings mysys mysys_ssl pcre2-8 vio ${ZLIB_LIBRARY} ${SSL_LIBRARIES} - ${LIBWRAP} ${LIBCRYPT} ${LIBDL} + ${LIBWRAP} ${LIBCRYPT} ${CMAKE_DL_LIBS} ${EMBEDDED_PLUGIN_LIBS} sql_embedded ) diff --git a/mysql-test/lib/My/SafeProcess/CMakeLists.txt b/mysql-test/lib/My/SafeProcess/CMakeLists.txt index 44c0e6eb8cb..eac1f1be8bd 100644 --- a/mysql-test/lib/My/SafeProcess/CMakeLists.txt +++ b/mysql-test/lib/My/SafeProcess/CMakeLists.txt @@ -26,7 +26,7 @@ ENDIF() IF(WITH_WSREP) ADD_EXECUTABLE(wsrep_check_version wsrep_check_version.c) - TARGET_LINK_LIBRARIES(wsrep_check_version ${LIBDL}) + TARGET_LINK_LIBRARIES(wsrep_check_version ${CMAKE_DL_LIBS}) ENDIF() IF(NOT INSTALL_MYSQLTESTDIR) diff --git a/mysql-test/main/case.result b/mysql-test/main/case.result index 926ac000eb0..f4f02703c5e 100644 --- a/mysql-test/main/case.result +++ b/mysql-test/main/case.result @@ -517,12 +517,12 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='a' AND CASE 'a' WHEN 'a' THEN a ELSE id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 'a' and (case 'a' when 'a' then `test`.`t1`.`a` else 'a' end) = 'a' +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 'a' and case 'a' when 'a' then `test`.`t1`.`a` else 'a' end = 'a' EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='a' AND CASE 'a' WHEN 'a' THEN 'a' ELSE a END='a'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 'a' and (case 'a' when 'a' then 'a' else `test`.`t1`.`a` end) = 'a' +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 'a' and case 'a' when 'a' then 'a' else `test`.`t1`.`a` end = 'a' ALTER TABLE t1 MODIFY a VARBINARY(10); EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='a' AND CASE a WHEN 'a' THEN 'a' ELSE 'a' END='a'; id select_type table type possible_keys key key_len ref rows filtered Extra @@ -570,7 +570,7 @@ CASE WHEN a THEN b ELSE 1 END=3; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where (case `test`.`t1`.`a` when `test`.`t1`.`b` then 1 end) = 1 and (case when `test`.`t1`.`a` then `test`.`t1`.`b` else 1 end) = 3 +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where case `test`.`t1`.`a` when `test`.`t1`.`b` then 1 end = 1 and case when `test`.`t1`.`a` then `test`.`t1`.`b` else 1 end = 3 DROP TABLE t1; # # End of 10.3 test diff --git a/mysql-test/main/derived_cond_pushdown.result b/mysql-test/main/derived_cond_pushdown.result index 85744451dc0..33e8eab968b 100644 --- a/mysql-test/main/derived_cond_pushdown.result +++ b/mysql-test/main/derived_cond_pushdown.result @@ -10024,11 +10024,11 @@ EXPLAIN "access_type": "ALL", "rows": 3, "filtered": 100, - "attached_condition": "case when (tab2.max_a = 1 or tab2.max_a = 2) then 1 else 0 end = 1", + "attached_condition": "case when tab2.max_a = 1 or tab2.max_a = 2 then 1 else 0 end = 1", "materialized": { "query_block": { "select_id": 3, - "having_condition": "case when (max_a = 1 or max_a = 2) then 1 else 0 end = 1", + "having_condition": "case when max_a = 1 or max_a = 2 then 1 else 0 end = 1", "filesort": { "sort_key": "t1.b", "temporary_table": { @@ -10073,11 +10073,11 @@ EXPLAIN "access_type": "ALL", "rows": 3, "filtered": 100, - "attached_condition": "case when (tab2.max_a = 1 or tab2.max_a > 2 and tab2.max_a < 4) then 1 else 0 end = 1", + "attached_condition": "case when tab2.max_a = 1 or tab2.max_a > 2 and tab2.max_a < 4 then 1 else 0 end = 1", "materialized": { "query_block": { "select_id": 3, - "having_condition": "case when (max_a = 1 or max_a > 2 and max_a < 4) then 1 else 0 end = 1", + "having_condition": "case when max_a = 1 or max_a > 2 and max_a < 4 then 1 else 0 end = 1", "filesort": { "sort_key": "t1.b", "temporary_table": { @@ -10122,11 +10122,11 @@ EXPLAIN "access_type": "ALL", "rows": 3, "filtered": 100, - "attached_condition": "case when (tab2.max_a > 1 and (tab2.max_a = 2 or tab2.max_a > 2)) then 1 else 0 end = 1", + "attached_condition": "case when tab2.max_a > 1 and (tab2.max_a = 2 or tab2.max_a > 2) then 1 else 0 end = 1", "materialized": { "query_block": { "select_id": 3, - "having_condition": "case when (max_a > 1 and (max_a = 2 or max_a > 2)) then 1 else 0 end = 1", + "having_condition": "case when max_a > 1 and (max_a = 2 or max_a > 2) then 1 else 0 end = 1", "filesort": { "sort_key": "t1.b", "temporary_table": { @@ -10171,7 +10171,7 @@ EXPLAIN "access_type": "ALL", "rows": 3, "filtered": 100, - "attached_condition": "case when (tab2.b = 2 or tab2.b = 4) then 1 else 0 end = 1", + "attached_condition": "case when tab2.b = 2 or tab2.b = 4 then 1 else 0 end = 1", "materialized": { "query_block": { "select_id": 3, @@ -10183,7 +10183,7 @@ EXPLAIN "access_type": "ALL", "rows": 3, "filtered": 100, - "attached_condition": "case when (t1.b = 2 or t1.b = 4) then 1 else 0 end = 1" + "attached_condition": "case when t1.b = 2 or t1.b = 4 then 1 else 0 end = 1" } } } diff --git a/mysql-test/main/func_json.result b/mysql-test/main/func_json.result index 1af786c8d3f..14ab6f41bce 100644 --- a/mysql-test/main/func_json.result +++ b/mysql-test/main/func_json.result @@ -898,6 +898,11 @@ NULL SELECT JSON_MERGE_PATCH(NULL, '[1,2,3]'); JSON_MERGE_PATCH(NULL, '[1,2,3]') [1, 2, 3] +SELECT JSON_MERGE_PATCH(NULL, 'a'); +JSON_MERGE_PATCH(NULL, 'a') +NULL +Warnings: +Warning 4038 Syntax error in JSON text in argument 2 to function 'json_merge_patch' at position 1 SELECT JSON_MERGE_PATCH('{"a":"b"}', NULL, '[1,2,3]', '{"c":null,"d":"e"}'); JSON_MERGE_PATCH('{"a":"b"}', NULL, '[1,2,3]', '{"c":null,"d":"e"}') {"d": "e"} diff --git a/mysql-test/main/func_json.test b/mysql-test/main/func_json.test index 04e16c02e6d..a77f7d8bd5b 100644 --- a/mysql-test/main/func_json.test +++ b/mysql-test/main/func_json.test @@ -528,6 +528,7 @@ DROP TABLE merge_t; SELECT JSON_MERGE_PATCH('{"a":"b"}', NULL, '{"c":"d"}'); SELECT JSON_MERGE_PATCH(NULL, '[1,2,3]'); +SELECT JSON_MERGE_PATCH(NULL, 'a'); SELECT JSON_MERGE_PATCH('{"a":"b"}', NULL, '[1,2,3]', '{"c":null,"d":"e"}'); --error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT diff --git a/mysql-test/main/func_math.result b/mysql-test/main/func_math.result index 37188dab623..ec2521bcfd7 100644 --- a/mysql-test/main/func_math.result +++ b/mysql-test/main/func_math.result @@ -1765,11 +1765,6 @@ select 0=0, 0=-0, 0.0= -0.0, 0.0 = -(0.0), 0.0E1=-0.0E1, 0.0E1=-(0.0E1); select CRC32(NULL), CRC32(''), CRC32('MySQL'), CRC32('mysql'), CRC32('01234567'), CRC32('012345678'), CRC32(REPEAT('ABCDEfghij', 20)), CRC32(REPEAT('0123456789', 200)); CRC32(NULL) CRC32('') CRC32('MySQL') CRC32('mysql') CRC32('01234567') CRC32('012345678') CRC32(REPEAT('ABCDEfghij', 20)) CRC32(REPEAT('0123456789', 200)) NULL 0 3259397556 2501908538 763378421 939184570 3823776386 1428305034 -explain extended select (3-2)+1, (3/2)*1, 3-(2+1), 3/(2*1); -id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used -Warnings: -Note 1003 select 3 - 2 + 1 AS `(3-2)+1`,3 / 2 * 1 AS `(3/2)*1`,3 - (2 + 1) AS `3-(2+1)`,3 / (2 * 1) AS `3/(2*1)` # # Start of 10.3 tests # diff --git a/mysql-test/main/func_math.test b/mysql-test/main/func_math.test index 6bce8bdaad6..572e0fd0f6b 100644 --- a/mysql-test/main/func_math.test +++ b/mysql-test/main/func_math.test @@ -793,11 +793,6 @@ select 0=0, 0=-0, 0.0= -0.0, 0.0 = -(0.0), 0.0E1=-0.0E1, 0.0E1=-(0.0E1); select CRC32(NULL), CRC32(''), CRC32('MySQL'), CRC32('mysql'), CRC32('01234567'), CRC32('012345678'), CRC32(REPEAT('ABCDEfghij', 20)), CRC32(REPEAT('0123456789', 200)); -# -# MDEV-13673 Bad result in view -# -explain extended select (3-2)+1, (3/2)*1, 3-(2+1), 3/(2*1); - --echo # --echo # Start of 10.3 tests --echo # diff --git a/mysql-test/main/func_test.result b/mysql-test/main/func_test.result index 4243ed9cfb0..04aee8b5522 100644 --- a/mysql-test/main/func_test.result +++ b/mysql-test/main/func_test.result @@ -89,15 +89,6 @@ id select_type table type possible_keys key key_len ref rows filtered Extra Warnings: Note 1003 select -1 AS `- a` from dual drop table t1; -select 5 between 0 and 10 between 0 and 1,(5 between 0 and 10) between 0 and 1; -5 between 0 and 10 between 0 and 1 (5 between 0 and 10) between 0 and 1 -0 1 -select 1 and 2 between 2 and 10, 2 between 2 and 10 and 1; -1 and 2 between 2 and 10 2 between 2 and 10 and 1 -1 1 -select 1 and 0 or 2, 2 or 1 and 0; -1 and 0 or 2 2 or 1 and 0 -1 1 select _koi8r'a' = _koi8r'A'; _koi8r'a' = _koi8r'A' 1 @@ -273,16 +264,6 @@ NULL select mod(NULL, 2.0) as 'NULL'; NULL NULL -create table t1 (a int, b int); -insert into t1 values (1,2), (2,3), (3,4), (4,5); -select * from t1 where a not between 1 and 2; -a b -3 4 -4 5 -select * from t1 where a not between 1 and 2 and b not between 3 and 4; -a b -4 5 -drop table t1; SELECT GREATEST(1,NULL) FROM DUAL; GREATEST(1,NULL) NULL diff --git a/mysql-test/main/func_test.test b/mysql-test/main/func_test.test index d1c0702da80..570fd0ae87a 100644 --- a/mysql-test/main/func_test.test +++ b/mysql-test/main/func_test.test @@ -36,14 +36,6 @@ explain extended select - a from t1; drop table t1; # -# Wrong usage of functions -# - -select 5 between 0 and 10 between 0 and 1,(5 between 0 and 10) between 0 and 1; -select 1 and 2 between 2 and 10, 2 between 2 and 10 and 1; -select 1 and 0 or 2, 2 or 1 and 0; - -# # Coercibility # select _koi8r'a' = _koi8r'A'; @@ -142,15 +134,6 @@ select mod(NULL, 2.0) as 'NULL'; # -# Bug#6726: NOT BETWEEN parse failure -# -create table t1 (a int, b int); -insert into t1 values (1,2), (2,3), (3,4), (4,5); -select * from t1 where a not between 1 and 2; -select * from t1 where a not between 1 and 2 and b not between 3 and 4; -drop table t1; - -# # Test for bug #12791: one of the arguments of LEAST/GREATEST is NULL # diff --git a/mysql-test/main/grant5.result b/mysql-test/main/grant5.result index 972131a24b7..9f6eb583e91 100644 --- a/mysql-test/main/grant5.result +++ b/mysql-test/main/grant5.result @@ -39,6 +39,42 @@ disconnect u1; drop user u1@localhost; drop database mysqltest1; # +# MDEV-22313: Neither SHOW CREATE USER nor SHOW GRANTS prints a user's default role +# +CREATE ROLE test_role; +CREATE USER test_user; +GRANT test_role TO test_user; +SET DEFAULT ROLE test_role FOR test_user; +SHOW GRANTS FOR test_user; +Grants for test_user@% +GRANT `test_role` TO `test_user`@`%` +GRANT USAGE ON *.* TO `test_user`@`%` +SET DEFAULT ROLE test_role FOR 'test_user'@'%' +SET DEFAULT ROLE NONE for test_user; +SHOW GRANTS FOR test_user; +Grants for test_user@% +GRANT `test_role` TO `test_user`@`%` +GRANT USAGE ON *.* TO `test_user`@`%` +connect test_user, localhost, test_user; +SET ROLE test_role; +SET DEFAULT ROLE test_role; +SHOW GRANTS; +Grants for test_user@% +GRANT `test_role` TO `test_user`@`%` +GRANT USAGE ON *.* TO `test_user`@`%` +GRANT USAGE ON *.* TO `test_role` +SET DEFAULT ROLE test_role FOR 'test_user'@'%' +SET DEFAULT ROLE NONE; +SHOW GRANTS; +Grants for test_user@% +GRANT `test_role` TO `test_user`@`%` +GRANT USAGE ON *.* TO `test_user`@`%` +GRANT USAGE ON *.* TO `test_role` +disconnect test_user; +connection default; +DROP USER test_user; +DROP ROLE test_role; +# # MDEV-20076: SHOW GRANTS does not quote role names properly # create role 'role1'; diff --git a/mysql-test/main/grant5.test b/mysql-test/main/grant5.test index e133108516e..9c3f20396c4 100644 --- a/mysql-test/main/grant5.test +++ b/mysql-test/main/grant5.test @@ -51,6 +51,27 @@ disconnect u1; drop user u1@localhost; drop database mysqltest1; +--echo # +--echo # MDEV-22313: Neither SHOW CREATE USER nor SHOW GRANTS prints a user's default role +--echo # +CREATE ROLE test_role; +CREATE USER test_user; +GRANT test_role TO test_user; +SET DEFAULT ROLE test_role FOR test_user; +SHOW GRANTS FOR test_user; +SET DEFAULT ROLE NONE for test_user; +SHOW GRANTS FOR test_user; +connect test_user, localhost, test_user; +SET ROLE test_role; +SET DEFAULT ROLE test_role; +SHOW GRANTS; +SET DEFAULT ROLE NONE; +SHOW GRANTS; +disconnect test_user; +connection default; +DROP USER test_user; +DROP ROLE test_role; + # # End of 10.1 tests # diff --git a/mysql-test/main/index_intersect_innodb.result b/mysql-test/main/index_intersect_innodb.result index c070b41e54d..34737a97b5a 100644 --- a/mysql-test/main/index_intersect_innodb.result +++ b/mysql-test/main/index_intersect_innodb.result @@ -81,7 +81,7 @@ EXPLAIN SELECT * FROM City WHERE Name LIKE 'M%' AND Population > 300000; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge Population,Name Name,Population 35,4 NULL # Using sort_intersect(Name,Population); Using where +1 SIMPLE City range Population,Name Name 35 NULL # Using index condition; Using where EXPLAIN SELECT * FROM City WHERE Name LIKE 'M%' AND Population > 7000000; @@ -381,7 +381,7 @@ EXPLAIN SELECT * FROM City WHERE Name BETWEEN 'G' AND 'K' AND Population > 500000 AND Country LIKE 'C%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge Population,Name,Country Name,Population,Country # NULL # Using sort_intersect(Name,Population,Country); Using where +1 SIMPLE City range Population,Name,Country Name # NULL # Using index condition; Using where SELECT * FROM City USE INDEX () WHERE Name BETWEEN 'M' AND 'N' AND Population > 1000000 AND Country LIKE 'C%'; ID Name Country Population @@ -494,7 +494,7 @@ SELECT * FROM City WHERE ID BETWEEN 3001 AND 4000 AND Population > 600000 AND Country BETWEEN 'S' AND 'Z' ; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge PRIMARY,Population,Country PRIMARY,Population,Country 4,4,7 NULL # Using sort_intersect(PRIMARY,Population,Country); Using where +1 SIMPLE City range PRIMARY,Population,Country PRIMARY 4 NULL # Using where SELECT * FROM City USE INDEX () WHERE ID BETWEEN 501 AND 1000 AND Population > 700000 AND Country LIKE 'C%'; ID Name Country Population @@ -721,7 +721,11 @@ EXPLAIN SELECT * FROM City WHERE Name BETWEEN 'G' AND 'J' AND Population > 500000 AND Country LIKE 'C%'; id select_type table type possible_keys key key_len ref rows Extra +<<<<<<< HEAD 1 SIMPLE City index_merge Population,Country,Name Name,Population,Country 35,4,3 NULL # Using sort_intersect(Name,Population,Country); Using where +======= +1 SIMPLE City range Population,Country,Name Name 35 NULL # Using index condition; Using where +>>>>>>> c05e571e7d53ba11a3422490cff0d93e6691ea62 EXPLAIN SELECT * FROM City WHERE ID BETWEEN 1 AND 500 AND Population > 700000 AND Country LIKE 'C%'; @@ -732,7 +736,7 @@ SELECT * FROM City WHERE ID BETWEEN 3001 AND 4000 AND Population > 600000 AND Country BETWEEN 'S' AND 'Z'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge PRIMARY,Population,Country PRIMARY,Population,Country 4,4,7 NULL # Using sort_intersect(PRIMARY,Population,Country); Using where +1 SIMPLE City range PRIMARY,Population,Country PRIMARY 4 NULL # Using where SELECT * FROM City WHERE Name LIKE 'C%' AND Population > 1000000; ID Name Country Population diff --git a/mysql-test/main/innodb_ext_key,off.rdiff b/mysql-test/main/innodb_ext_key,off.rdiff index 195456958d8..8940589725c 100644 --- a/mysql-test/main/innodb_ext_key,off.rdiff +++ b/mysql-test/main/innodb_ext_key,off.rdiff @@ -3,7 +3,7 @@ select count(*) from lineitem where l_orderkey=130 and l_shipdate='1992-07-01'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE lineitem ref PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity i_l_shipdate 8 const,const 1 Using index -+1 SIMPLE lineitem ref PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity PRIMARY 4 const 5 Using where ++1 SIMPLE lineitem ref PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity i_l_shipdate 4 const 6 Using where; Using index flush status; select count(*) from lineitem where l_orderkey=130 and l_shipdate='1992-07-01'; count(*) @@ -12,7 +12,7 @@ Handler_read_key 1 Handler_read_last 0 -Handler_read_next 1 -+Handler_read_next 5 ++Handler_read_next 6 Handler_read_prev 0 Handler_read_retry 0 Handler_read_rnd 0 @@ -93,7 +93,7 @@ where l_shipdate='1992-07-01' and l_orderkey=130; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away -+1 SIMPLE lineitem ref PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity PRIMARY 4 const 5 Using where ++1 SIMPLE lineitem ref PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity i_l_shipdate 4 const 6 Using where; Using index flush status; select max(l_linenumber) from lineitem where l_shipdate='1992-07-01' and l_orderkey=130; @@ -102,7 +102,7 @@ Handler_read_key 1 Handler_read_last 0 -Handler_read_next 0 -+Handler_read_next 5 ++Handler_read_next 6 Handler_read_prev 0 Handler_read_retry 0 Handler_read_rnd 0 diff --git a/mysql-test/main/mysqldump.result b/mysql-test/main/mysqldump.result index 3b7d95f80e9..a263b81a28c 100644 --- a/mysql-test/main/mysqldump.result +++ b/mysql-test/main/mysqldump.result @@ -5905,4 +5905,122 @@ invisible int(11) YES NULL a b c & $!@#$%^&*( ) int(11) YES 4 INVISIBLE ds=~!@ \# $% ^ & * ( ) _ - = + int(11) YES 5 INVISIBLE drop database d; +# +# MDEV-21786: +# mysqldump will forget sequence definition details on --no-data dump +# +create database d; +CREATE SEQUENCE d.s1 START WITH 100 INCREMENT BY 10 MINVALUE=100 MAXVALUE=1100 CYCLE; +CREATE SEQUENCE d.s2 START WITH 200 INCREMENT BY 20 MINVALUE=200 MAXVALUE=1200 CYCLE; +CREATE SEQUENCE d.s3 START WITH 300 INCREMENT BY 30 MINVALUE=300 MAXVALUE=1300 CYCLE; +CREATE SEQUENCE d.s4 START WITH 400 INCREMENT BY 40 MINVALUE=400 MAXVALUE=1400 CYCLE; +SELECT NEXTVAL(d.s1),NEXTVAL(d.s2),NEXTVAL(d.s3), NEXTVAL(d.s4); +NEXTVAL(d.s1) NEXTVAL(d.s2) NEXTVAL(d.s3) NEXTVAL(d.s4) +100 200 300 400 +# Show create before dump +show create sequence d.s1; +Table Create Table +s1 CREATE SEQUENCE `s1` start with 100 minvalue 100 maxvalue 1100 increment by 10 cache 1000 cycle ENGINE=MyISAM +show create sequence d.s2; +Table Create Table +s2 CREATE SEQUENCE `s2` start with 200 minvalue 200 maxvalue 1200 increment by 20 cache 1000 cycle ENGINE=MyISAM +show create sequence d.s3; +Table Create Table +s3 CREATE SEQUENCE `s3` start with 300 minvalue 300 maxvalue 1300 increment by 30 cache 1000 cycle ENGINE=MyISAM +show create sequence d.s4; +Table Create Table +s4 CREATE SEQUENCE `s4` start with 400 minvalue 400 maxvalue 1400 increment by 40 cache 1000 cycle ENGINE=MyISAM +# Dump sequence without `--no-data` +# Restore from mysqldump +SETVAL(`s1`, 1101, 0) +1101 +SETVAL(`s2`, 1201, 0) +1201 +SETVAL(`s3`, 1301, 0) +1301 +SETVAL(`s4`, 1401, 0) +1401 +# Show create after restore +show create sequence d.s1; +Table Create Table +s1 CREATE SEQUENCE `s1` start with 100 minvalue 100 maxvalue 1100 increment by 10 cache 1000 cycle ENGINE=MyISAM +show create sequence d.s2; +Table Create Table +s2 CREATE SEQUENCE `s2` start with 200 minvalue 200 maxvalue 1200 increment by 20 cache 1000 cycle ENGINE=MyISAM +show create sequence d.s3; +Table Create Table +s3 CREATE SEQUENCE `s3` start with 300 minvalue 300 maxvalue 1300 increment by 30 cache 1000 cycle ENGINE=MyISAM +show create sequence d.s4; +Table Create Table +s4 CREATE SEQUENCE `s4` start with 400 minvalue 400 maxvalue 1400 increment by 40 cache 1000 cycle ENGINE=MyISAM +SELECT NEXTVAL(d.s1),NEXTVAL(d.s2),NEXTVAL(d.s3), NEXTVAL(d.s4); +NEXTVAL(d.s1) NEXTVAL(d.s2) NEXTVAL(d.s3) NEXTVAL(d.s4) +100 200 300 400 +# Dump sequence with `--no-data` +# Restore from mysqldump +SETVAL(`s1`, 1101, 0) +1101 +SETVAL(`s2`, 1201, 0) +1201 +SETVAL(`s3`, 1301, 0) +1301 +SETVAL(`s4`, 1401, 0) +1401 +# Show create after restore `--no-data` +show create sequence d.s1; +Table Create Table +s1 CREATE SEQUENCE `s1` start with 100 minvalue 100 maxvalue 1100 increment by 10 cache 1000 cycle ENGINE=MyISAM +show create sequence d.s2; +Table Create Table +s2 CREATE SEQUENCE `s2` start with 200 minvalue 200 maxvalue 1200 increment by 20 cache 1000 cycle ENGINE=MyISAM +show create sequence d.s3; +Table Create Table +s3 CREATE SEQUENCE `s3` start with 300 minvalue 300 maxvalue 1300 increment by 30 cache 1000 cycle ENGINE=MyISAM +show create sequence d.s4; +Table Create Table +s4 CREATE SEQUENCE `s4` start with 400 minvalue 400 maxvalue 1400 increment by 40 cache 1000 cycle ENGINE=MyISAM +SELECT NEXTVAL(d.s1),NEXTVAL(d.s2),NEXTVAL(d.s3), NEXTVAL(d.s4); +NEXTVAL(d.s1) NEXTVAL(d.s2) NEXTVAL(d.s3) NEXTVAL(d.s4) +100 200 300 400 +# Restore to different database than original +create database d2; +SETVAL(`s1`, 1101, 0) +1101 +SETVAL(`s2`, 1201, 0) +1201 +SETVAL(`s3`, 1301, 0) +1301 +SETVAL(`s4`, 1401, 0) +1401 +show create sequence d2.s1; +Table Create Table +s1 CREATE SEQUENCE `s1` start with 100 minvalue 100 maxvalue 1100 increment by 10 cache 1000 cycle ENGINE=MyISAM +drop sequence d.s1, d.s2, d.s3, d.s4; +drop database d; +drop database d2; +# +# MDEV-20070 +# mysqldump won't work correct on sequences +# +DROP DATABASE IF EXISTS test1; +Warnings: +Note 1008 Can't drop database 'test1'; database doesn't exist +DROP DATABASE IF EXISTS test2; +Warnings: +Note 1008 Can't drop database 'test2'; database doesn't exist +CREATE DATABASE test1; +CREATE DATABASE test2; +USE test1; +CREATE SEQUENCE seq_t_i INCREMENT 5 START WITH 1; +CREATE TABLE t( +i integer DEFAULT nextval(seq_t_i), +j integer +); +INSERT INTO t VALUES (1,1),(2,2),(3,3),(4,4); +# Dump database 1 +# Restore from database 1 to database 2 +SETVAL(`seq_t_i`, 1, 0) +1 +DROP DATABASE IF EXISTS test1; +DROP DATABASE IF EXISTS test2; # End of 10.3 tests diff --git a/mysql-test/main/mysqldump.test b/mysql-test/main/mysqldump.test index 3f8777b9d48..f328bf32361 100644 --- a/mysql-test/main/mysqldump.test +++ b/mysql-test/main/mysqldump.test @@ -2793,4 +2793,87 @@ select * from t3; desc t3; drop database d; +--echo # +--echo # MDEV-21786: +--echo # mysqldump will forget sequence definition details on --no-data dump +--echo # +create database d; + +CREATE SEQUENCE d.s1 START WITH 100 INCREMENT BY 10 MINVALUE=100 MAXVALUE=1100 CYCLE; +CREATE SEQUENCE d.s2 START WITH 200 INCREMENT BY 20 MINVALUE=200 MAXVALUE=1200 CYCLE; +CREATE SEQUENCE d.s3 START WITH 300 INCREMENT BY 30 MINVALUE=300 MAXVALUE=1300 CYCLE; +CREATE SEQUENCE d.s4 START WITH 400 INCREMENT BY 40 MINVALUE=400 MAXVALUE=1400 CYCLE; +SELECT NEXTVAL(d.s1),NEXTVAL(d.s2),NEXTVAL(d.s3), NEXTVAL(d.s4); + +--echo # Show create before dump +show create sequence d.s1; +show create sequence d.s2; +show create sequence d.s3; +show create sequence d.s4; + +--echo # Dump sequence without `--no-data` +--exec $MYSQL_DUMP --databases d > $MYSQLTEST_VARDIR/tmp/dump1.sql +--echo # Restore from mysqldump +--exec $MYSQL -Dd < $MYSQLTEST_VARDIR/tmp/dump1.sql +--remove_file $MYSQLTEST_VARDIR/tmp/dump1.sql + +--echo # Show create after restore +show create sequence d.s1; +show create sequence d.s2; +show create sequence d.s3; +show create sequence d.s4; +SELECT NEXTVAL(d.s1),NEXTVAL(d.s2),NEXTVAL(d.s3), NEXTVAL(d.s4); + +--echo # Dump sequence with `--no-data` +--exec $MYSQL_DUMP --databases d --no-data > $MYSQLTEST_VARDIR/tmp/dump-no-data.sql +--echo # Restore from mysqldump +--exec $MYSQL -Dd < $MYSQLTEST_VARDIR/tmp/dump-no-data.sql +--remove_file $MYSQLTEST_VARDIR/tmp/dump-no-data.sql + +--echo # Show create after restore `--no-data` +show create sequence d.s1; +show create sequence d.s2; +show create sequence d.s3; +show create sequence d.s4; +SELECT NEXTVAL(d.s1),NEXTVAL(d.s2),NEXTVAL(d.s3), NEXTVAL(d.s4); + +--echo # Restore to different database than original +--exec $MYSQL_DUMP d > $MYSQLTEST_VARDIR/tmp/dumpd.sql +create database d2; +--exec $MYSQL d2 < $MYSQLTEST_VARDIR/tmp/dumpd.sql +--remove_file $MYSQLTEST_VARDIR/tmp/dumpd.sql +show create sequence d2.s1; + +drop sequence d.s1, d.s2, d.s3, d.s4; +drop database d; +drop database d2; + +--echo # +--echo # MDEV-20070 +--echo # mysqldump won't work correct on sequences +--echo # + +DROP DATABASE IF EXISTS test1; +DROP DATABASE IF EXISTS test2; +CREATE DATABASE test1; +CREATE DATABASE test2; +USE test1; +CREATE SEQUENCE seq_t_i INCREMENT 5 START WITH 1; +CREATE TABLE t( +i integer DEFAULT nextval(seq_t_i), +j integer +); +INSERT INTO t VALUES (1,1),(2,2),(3,3),(4,4); + +--echo # Dump database 1 +--exec $MYSQL_DUMP test1 > $MYSQLTEST_VARDIR/tmp/dumptest1.sql +--echo # Restore from database 1 to database 2 + +--error 1 +--exec $MYSQL test2 < $MYSQLTEST_VARDIR/tmp/dumptest1.sql + +--remove_file $MYSQLTEST_VARDIR/tmp/dumptest1.sql +DROP DATABASE IF EXISTS test1; +DROP DATABASE IF EXISTS test2; + --echo # End of 10.3 tests diff --git a/mysql-test/main/opt_trace_index_merge_innodb.result b/mysql-test/main/opt_trace_index_merge_innodb.result index 25e7b187104..e7737d3b32a 100644 --- a/mysql-test/main/opt_trace_index_merge_innodb.result +++ b/mysql-test/main/opt_trace_index_merge_innodb.result @@ -117,7 +117,11 @@ explain select * from t1 where pk1 != 0 and key1 = 1 { "using_mrr": false, "index_only": false, "rows": 1000, +<<<<<<< HEAD "cost": 201.6536043, +======= + "cost": 204.01, +>>>>>>> c05e571e7d53ba11a3422490cff0d93e6691ea62 "chosen": true }, { @@ -135,10 +139,17 @@ explain select * from t1 where pk1 != 0 and key1 = 1 { "intersecting_indexes": [ { "index": "key1", +<<<<<<< HEAD "index_scan_cost": 1.000146475, "cumulated_index_scan_cost": 1.000146475, "disk_sweep_cost": 1.001383604, "cumulative_total_cost": 2.00153008, +======= + "index_scan_cost": 1.0001, + "cumulated_index_scan_cost": 1.0001, + "disk_sweep_cost": 1.0042, + "cumulative_total_cost": 2.0043, +>>>>>>> c05e571e7d53ba11a3422490cff0d93e6691ea62 "usable": true, "matching_rows_now": 1, "intersect_covering_with_this_index": false, diff --git a/mysql-test/main/parser.result b/mysql-test/main/parser.result index 1d3acaf062b..86df20da9d8 100644 --- a/mysql-test/main/parser.result +++ b/mysql-test/main/parser.result @@ -1318,6 +1318,23 @@ t1 CREATE TABLE `t1` ( UNIQUE KEY `id` (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; +create or replace view v1 as select 1 between (2 between 3 and 4) and 5; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 1 between 2 between 3 and 4 and 5 AS `1 between (2 between 3 and 4) and 5` +create or replace view v1 as select 1 between (2 in (3,4)) and 5; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 1 between 2 in (3,4) and 5 AS `1 between (2 in (3,4)) and 5` +create or replace view v1 as select 1 between (2 like 3) and 4; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 1 between 2 like 3 and 4 AS `1 between (2 like 3) and 4` +create or replace view v1 as select 1 not between (2 like 3) and 4; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 1 not between 2 like 3 and 4 AS `1 not between (2 like 3) and 4` +drop view v1; # # MDEV-10343 Providing compatibility for basic SQL data types # @@ -1808,7 +1825,7 @@ EXECUTE IMMEDIATE 'if(`systeminfo /FO LIST'; 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 '`systeminfo /FO LIST' at line 1 EXECUTE IMMEDIATE 'if(`systeminfo'; 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 '`systeminfo' at line 1 -End of 10.3 tests +# End of 10.3 tests # # MDEV-19540: 10.4 allow lock options with SELECT in brackets # which previous version do not diff --git a/mysql-test/main/parser.test b/mysql-test/main/parser.test index 755cbb95c45..49f43600795 100644 --- a/mysql-test/main/parser.test +++ b/mysql-test/main/parser.test @@ -1346,6 +1346,20 @@ create table t1 ( id serial ); show create table t1; drop table t1; +# +# BETWEEN syntax +# +create or replace view v1 as select 1 between (2 between 3 and 4) and 5; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +create or replace view v1 as select 1 between (2 in (3,4)) and 5; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +create or replace view v1 as select 1 between (2 like 3) and 4; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +create or replace view v1 as select 1 not between (2 like 3) and 4; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; + +drop view v1; + --echo # --echo # MDEV-10343 Providing compatibility for basic SQL data types --echo # @@ -1552,7 +1566,7 @@ EXECUTE IMMEDIATE 'if(`systeminfo /FO LIST'; --error ER_PARSE_ERROR EXECUTE IMMEDIATE 'if(`systeminfo'; ---echo End of 10.3 tests +--echo # End of 10.3 tests --echo # --echo # MDEV-19540: 10.4 allow lock options with SELECT in brackets diff --git a/mysql-test/main/parser_precedence.result b/mysql-test/main/parser_precedence.result deleted file mode 100644 index f23295bd61b..00000000000 --- a/mysql-test/main/parser_precedence.result +++ /dev/null @@ -1,748 +0,0 @@ -drop table if exists t1_30237_bool; -set sql_mode=NO_UNSIGNED_SUBTRACTION; -create table t1_30237_bool(A boolean, B boolean, C boolean); -insert into t1_30237_bool values -(FALSE, FALSE, FALSE), -(FALSE, FALSE, NULL), -(FALSE, FALSE, TRUE), -(FALSE, NULL, FALSE), -(FALSE, NULL, NULL), -(FALSE, NULL, TRUE), -(FALSE, TRUE, FALSE), -(FALSE, TRUE, NULL), -(FALSE, TRUE, TRUE), -(NULL, FALSE, FALSE), -(NULL, FALSE, NULL), -(NULL, FALSE, TRUE), -(NULL, NULL, FALSE), -(NULL, NULL, NULL), -(NULL, NULL, TRUE), -(NULL, TRUE, FALSE), -(NULL, TRUE, NULL), -(NULL, TRUE, TRUE), -(TRUE, FALSE, FALSE), -(TRUE, FALSE, NULL), -(TRUE, FALSE, TRUE), -(TRUE, NULL, FALSE), -(TRUE, NULL, NULL), -(TRUE, NULL, TRUE), -(TRUE, TRUE, FALSE), -(TRUE, TRUE, NULL), -(TRUE, TRUE, TRUE) ; -Testing OR, XOR, AND -select A, B, A OR B, A XOR B, A AND B -from t1_30237_bool where C is null order by A, B; -A B A OR B A XOR B A AND B -NULL NULL NULL NULL NULL -NULL 0 NULL NULL 0 -NULL 1 1 NULL NULL -0 NULL NULL NULL 0 -0 0 0 0 0 -0 1 1 1 0 -1 NULL 1 NULL NULL -1 0 1 1 0 -1 1 1 0 1 -Testing that OR is associative -select A, B, C, (A OR B) OR C, A OR (B OR C), A OR B OR C -from t1_30237_bool order by A, B, C; -A B C (A OR B) OR C A OR (B OR C) A OR B OR C -NULL NULL NULL NULL NULL NULL -NULL NULL 0 NULL NULL NULL -NULL NULL 1 1 1 1 -NULL 0 NULL NULL NULL NULL -NULL 0 0 NULL NULL NULL -NULL 0 1 1 1 1 -NULL 1 NULL 1 1 1 -NULL 1 0 1 1 1 -NULL 1 1 1 1 1 -0 NULL NULL NULL NULL NULL -0 NULL 0 NULL NULL NULL -0 NULL 1 1 1 1 -0 0 NULL NULL NULL NULL -0 0 0 0 0 0 -0 0 1 1 1 1 -0 1 NULL 1 1 1 -0 1 0 1 1 1 -0 1 1 1 1 1 -1 NULL NULL 1 1 1 -1 NULL 0 1 1 1 -1 NULL 1 1 1 1 -1 0 NULL 1 1 1 -1 0 0 1 1 1 -1 0 1 1 1 1 -1 1 NULL 1 1 1 -1 1 0 1 1 1 -1 1 1 1 1 1 -select count(*) from t1_30237_bool -where ((A OR B) OR C) != (A OR (B OR C)); -count(*) -0 -Testing that XOR is associative -select A, B, C, (A XOR B) XOR C, A XOR (B XOR C), A XOR B XOR C -from t1_30237_bool order by A, B, C; -A B C (A XOR B) XOR C A XOR (B XOR C) A XOR B XOR C -NULL NULL NULL NULL NULL NULL -NULL NULL 0 NULL NULL NULL -NULL NULL 1 NULL NULL NULL -NULL 0 NULL NULL NULL NULL -NULL 0 0 NULL NULL NULL -NULL 0 1 NULL NULL NULL -NULL 1 NULL NULL NULL NULL -NULL 1 0 NULL NULL NULL -NULL 1 1 NULL NULL NULL -0 NULL NULL NULL NULL NULL -0 NULL 0 NULL NULL NULL -0 NULL 1 NULL NULL NULL -0 0 NULL NULL NULL NULL -0 0 0 0 0 0 -0 0 1 1 1 1 -0 1 NULL NULL NULL NULL -0 1 0 1 1 1 -0 1 1 0 0 0 -1 NULL NULL NULL NULL NULL -1 NULL 0 NULL NULL NULL -1 NULL 1 NULL NULL NULL -1 0 NULL NULL NULL NULL -1 0 0 1 1 1 -1 0 1 0 0 0 -1 1 NULL NULL NULL NULL -1 1 0 0 0 0 -1 1 1 1 1 1 -select count(*) from t1_30237_bool -where ((A XOR B) XOR C) != (A XOR (B XOR C)); -count(*) -0 -Testing that AND is associative -select A, B, C, (A AND B) AND C, A AND (B AND C), A AND B AND C -from t1_30237_bool order by A, B, C; -A B C (A AND B) AND C A AND (B AND C) A AND B AND C -NULL NULL NULL NULL NULL NULL -NULL NULL 0 0 0 0 -NULL NULL 1 NULL NULL NULL -NULL 0 NULL 0 0 0 -NULL 0 0 0 0 0 -NULL 0 1 0 0 0 -NULL 1 NULL NULL NULL NULL -NULL 1 0 0 0 0 -NULL 1 1 NULL NULL NULL -0 NULL NULL 0 0 0 -0 NULL 0 0 0 0 -0 NULL 1 0 0 0 -0 0 NULL 0 0 0 -0 0 0 0 0 0 -0 0 1 0 0 0 -0 1 NULL 0 0 0 -0 1 0 0 0 0 -0 1 1 0 0 0 -1 NULL NULL NULL NULL NULL -1 NULL 0 0 0 0 -1 NULL 1 NULL NULL NULL -1 0 NULL 0 0 0 -1 0 0 0 0 0 -1 0 1 0 0 0 -1 1 NULL NULL NULL NULL -1 1 0 0 0 0 -1 1 1 1 1 1 -select count(*) from t1_30237_bool -where ((A AND B) AND C) != (A AND (B AND C)); -count(*) -0 -Testing that AND has precedence over OR -select A, B, C, (A OR B) AND C, A OR (B AND C), A OR B AND C -from t1_30237_bool order by A, B, C; -A B C (A OR B) AND C A OR (B AND C) A OR B AND C -NULL NULL NULL NULL NULL NULL -NULL NULL 0 0 NULL NULL -NULL NULL 1 NULL NULL NULL -NULL 0 NULL NULL NULL NULL -NULL 0 0 0 NULL NULL -NULL 0 1 NULL NULL NULL -NULL 1 NULL NULL NULL NULL -NULL 1 0 0 NULL NULL -NULL 1 1 1 1 1 -0 NULL NULL NULL NULL NULL -0 NULL 0 0 0 0 -0 NULL 1 NULL NULL NULL -0 0 NULL 0 0 0 -0 0 0 0 0 0 -0 0 1 0 0 0 -0 1 NULL NULL NULL NULL -0 1 0 0 0 0 -0 1 1 1 1 1 -1 NULL NULL NULL 1 1 -1 NULL 0 0 1 1 -1 NULL 1 1 1 1 -1 0 NULL NULL 1 1 -1 0 0 0 1 1 -1 0 1 1 1 1 -1 1 NULL NULL 1 1 -1 1 0 0 1 1 -1 1 1 1 1 1 -select count(*) from t1_30237_bool -where (A OR (B AND C)) != (A OR B AND C); -count(*) -0 -select A, B, C, (A AND B) OR C, A AND (B OR C), A AND B OR C -from t1_30237_bool order by A, B, C; -A B C (A AND B) OR C A AND (B OR C) A AND B OR C -NULL NULL NULL NULL NULL NULL -NULL NULL 0 NULL NULL NULL -NULL NULL 1 1 NULL 1 -NULL 0 NULL NULL NULL NULL -NULL 0 0 0 0 0 -NULL 0 1 1 NULL 1 -NULL 1 NULL NULL NULL NULL -NULL 1 0 NULL NULL NULL -NULL 1 1 1 NULL 1 -0 NULL NULL NULL 0 NULL -0 NULL 0 0 0 0 -0 NULL 1 1 0 1 -0 0 NULL NULL 0 NULL -0 0 0 0 0 0 -0 0 1 1 0 1 -0 1 NULL NULL 0 NULL -0 1 0 0 0 0 -0 1 1 1 0 1 -1 NULL NULL NULL NULL NULL -1 NULL 0 NULL NULL NULL -1 NULL 1 1 1 1 -1 0 NULL NULL NULL NULL -1 0 0 0 0 0 -1 0 1 1 1 1 -1 1 NULL 1 1 1 -1 1 0 1 1 1 -1 1 1 1 1 1 -select count(*) from t1_30237_bool -where ((A AND B) OR C) != (A AND B OR C); -count(*) -0 -Testing that AND has precedence over XOR -select A, B, C, (A XOR B) AND C, A XOR (B AND C), A XOR B AND C -from t1_30237_bool order by A, B, C; -A B C (A XOR B) AND C A XOR (B AND C) A XOR B AND C -NULL NULL NULL NULL NULL NULL -NULL NULL 0 0 NULL NULL -NULL NULL 1 NULL NULL NULL -NULL 0 NULL NULL NULL NULL -NULL 0 0 0 NULL NULL -NULL 0 1 NULL NULL NULL -NULL 1 NULL NULL NULL NULL -NULL 1 0 0 NULL NULL -NULL 1 1 NULL NULL NULL -0 NULL NULL NULL NULL NULL -0 NULL 0 0 0 0 -0 NULL 1 NULL NULL NULL -0 0 NULL 0 0 0 -0 0 0 0 0 0 -0 0 1 0 0 0 -0 1 NULL NULL NULL NULL -0 1 0 0 0 0 -0 1 1 1 1 1 -1 NULL NULL NULL NULL NULL -1 NULL 0 0 1 1 -1 NULL 1 NULL NULL NULL -1 0 NULL NULL 1 1 -1 0 0 0 1 1 -1 0 1 1 1 1 -1 1 NULL 0 NULL NULL -1 1 0 0 1 1 -1 1 1 0 0 0 -select count(*) from t1_30237_bool -where (A XOR (B AND C)) != (A XOR B AND C); -count(*) -0 -select A, B, C, (A AND B) XOR C, A AND (B XOR C), A AND B XOR C -from t1_30237_bool order by A, B, C; -A B C (A AND B) XOR C A AND (B XOR C) A AND B XOR C -NULL NULL NULL NULL NULL NULL -NULL NULL 0 NULL NULL NULL -NULL NULL 1 NULL NULL NULL -NULL 0 NULL NULL NULL NULL -NULL 0 0 0 0 0 -NULL 0 1 1 NULL 1 -NULL 1 NULL NULL NULL NULL -NULL 1 0 NULL NULL NULL -NULL 1 1 NULL 0 NULL -0 NULL NULL NULL 0 NULL -0 NULL 0 0 0 0 -0 NULL 1 1 0 1 -0 0 NULL NULL 0 NULL -0 0 0 0 0 0 -0 0 1 1 0 1 -0 1 NULL NULL 0 NULL -0 1 0 0 0 0 -0 1 1 1 0 1 -1 NULL NULL NULL NULL NULL -1 NULL 0 NULL NULL NULL -1 NULL 1 NULL NULL NULL -1 0 NULL NULL NULL NULL -1 0 0 0 0 0 -1 0 1 1 1 1 -1 1 NULL NULL NULL NULL -1 1 0 1 1 1 -1 1 1 0 0 0 -select count(*) from t1_30237_bool -where ((A AND B) XOR C) != (A AND B XOR C); -count(*) -0 -Testing that XOR has precedence over OR -select A, B, C, (A XOR B) OR C, A XOR (B OR C), A XOR B OR C -from t1_30237_bool order by A, B, C; -A B C (A XOR B) OR C A XOR (B OR C) A XOR B OR C -NULL NULL NULL NULL NULL NULL -NULL NULL 0 NULL NULL NULL -NULL NULL 1 1 NULL 1 -NULL 0 NULL NULL NULL NULL -NULL 0 0 NULL NULL NULL -NULL 0 1 1 NULL 1 -NULL 1 NULL NULL NULL NULL -NULL 1 0 NULL NULL NULL -NULL 1 1 1 NULL 1 -0 NULL NULL NULL NULL NULL -0 NULL 0 NULL NULL NULL -0 NULL 1 1 1 1 -0 0 NULL NULL NULL NULL -0 0 0 0 0 0 -0 0 1 1 1 1 -0 1 NULL 1 1 1 -0 1 0 1 1 1 -0 1 1 1 1 1 -1 NULL NULL NULL NULL NULL -1 NULL 0 NULL NULL NULL -1 NULL 1 1 0 1 -1 0 NULL 1 NULL 1 -1 0 0 1 1 1 -1 0 1 1 0 1 -1 1 NULL NULL 0 NULL -1 1 0 0 0 0 -1 1 1 1 0 1 -select count(*) from t1_30237_bool -where ((A XOR B) OR C) != (A XOR B OR C); -count(*) -0 -select A, B, C, (A OR B) XOR C, A OR (B XOR C), A OR B XOR C -from t1_30237_bool order by A, B, C; -A B C (A OR B) XOR C A OR (B XOR C) A OR B XOR C -NULL NULL NULL NULL NULL NULL -NULL NULL 0 NULL NULL NULL -NULL NULL 1 NULL NULL NULL -NULL 0 NULL NULL NULL NULL -NULL 0 0 NULL NULL NULL -NULL 0 1 NULL 1 1 -NULL 1 NULL NULL NULL NULL -NULL 1 0 1 1 1 -NULL 1 1 0 NULL NULL -0 NULL NULL NULL NULL NULL -0 NULL 0 NULL NULL NULL -0 NULL 1 NULL NULL NULL -0 0 NULL NULL NULL NULL -0 0 0 0 0 0 -0 0 1 1 1 1 -0 1 NULL NULL NULL NULL -0 1 0 1 1 1 -0 1 1 0 0 0 -1 NULL NULL NULL 1 1 -1 NULL 0 1 1 1 -1 NULL 1 0 1 1 -1 0 NULL NULL 1 1 -1 0 0 1 1 1 -1 0 1 0 1 1 -1 1 NULL NULL 1 1 -1 1 0 1 1 1 -1 1 1 0 1 1 -select count(*) from t1_30237_bool -where (A OR (B XOR C)) != (A OR B XOR C); -count(*) -0 -drop table t1_30237_bool; -Testing that NOT has precedence over OR -select (NOT FALSE) OR TRUE, NOT (FALSE OR TRUE), NOT FALSE OR TRUE; -(NOT FALSE) OR TRUE NOT (FALSE OR TRUE) NOT FALSE OR TRUE -1 0 1 -Testing that NOT has precedence over XOR -select (NOT FALSE) XOR FALSE, NOT (FALSE XOR FALSE), NOT FALSE XOR FALSE; -(NOT FALSE) XOR FALSE NOT (FALSE XOR FALSE) NOT FALSE XOR FALSE -1 1 1 -Testing that NOT has precedence over AND -select (NOT FALSE) AND FALSE, NOT (FALSE AND FALSE), NOT FALSE AND FALSE; -(NOT FALSE) AND FALSE NOT (FALSE AND FALSE) NOT FALSE AND FALSE -0 1 0 -Testing that NOT is associative -select NOT NOT TRUE, NOT NOT NOT FALSE; -NOT NOT TRUE NOT NOT NOT FALSE -1 1 -Testing that IS has precedence over NOT -select (NOT NULL) IS TRUE, NOT (NULL IS TRUE), NOT NULL IS TRUE; -(NOT NULL) IS TRUE NOT (NULL IS TRUE) NOT NULL IS TRUE -0 1 1 -select (NOT NULL) IS NOT TRUE, NOT (NULL IS NOT TRUE), NOT NULL IS NOT TRUE; -(NOT NULL) IS NOT TRUE NOT (NULL IS NOT TRUE) NOT NULL IS NOT TRUE -1 0 0 -select (NOT NULL) IS FALSE, NOT (NULL IS FALSE), NOT NULL IS FALSE; -(NOT NULL) IS FALSE NOT (NULL IS FALSE) NOT NULL IS FALSE -0 1 1 -select (NOT NULL) IS NOT FALSE, NOT (NULL IS NOT FALSE), NOT NULL IS NOT FALSE; -(NOT NULL) IS NOT FALSE NOT (NULL IS NOT FALSE) NOT NULL IS NOT FALSE -1 0 0 -select (NOT TRUE) IS UNKNOWN, NOT (TRUE IS UNKNOWN), NOT TRUE IS UNKNOWN; -(NOT TRUE) IS UNKNOWN NOT (TRUE IS UNKNOWN) NOT TRUE IS UNKNOWN -0 1 1 -select (NOT TRUE) IS NOT UNKNOWN, NOT (TRUE IS NOT UNKNOWN), NOT TRUE IS NOT UNKNOWN; -(NOT TRUE) IS NOT UNKNOWN NOT (TRUE IS NOT UNKNOWN) NOT TRUE IS NOT UNKNOWN -1 0 0 -select (NOT TRUE) IS NULL, NOT (TRUE IS NULL), NOT TRUE IS NULL; -(NOT TRUE) IS NULL NOT (TRUE IS NULL) NOT TRUE IS NULL -0 1 1 -select (NOT TRUE) IS NOT NULL, NOT (TRUE IS NOT NULL), NOT TRUE IS NOT NULL; -(NOT TRUE) IS NOT NULL NOT (TRUE IS NOT NULL) NOT TRUE IS NOT NULL -1 0 0 -Testing that IS [NOT] TRUE/FALSE/UNKNOWN predicates are not associative -select TRUE IS TRUE IS TRUE IS TRUE; -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 'IS TRUE IS TRUE' at line 1 -select FALSE IS NOT TRUE IS NOT TRUE IS NOT TRUE; -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 'IS NOT TRUE IS NOT TRUE' at line 1 -select NULL IS FALSE IS FALSE IS FALSE; -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 'IS FALSE IS FALSE' at line 1 -select TRUE IS NOT FALSE IS NOT FALSE IS NOT FALSE; -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 'IS NOT FALSE IS NOT FALSE' at line 1 -select FALSE IS UNKNOWN IS UNKNOWN IS UNKNOWN; -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 'IS UNKNOWN IS UNKNOWN' at line 1 -select TRUE IS NOT UNKNOWN IS NOT UNKNOWN IS NOT UNKNOWN; -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 'IS NOT UNKNOWN IS NOT UNKNOWN' at line 1 -Testing that IS [NOT] NULL predicates are associative -select FALSE IS NULL IS NULL IS NULL; -FALSE IS NULL IS NULL IS NULL -0 -select TRUE IS NOT NULL IS NOT NULL IS NOT NULL; -TRUE IS NOT NULL IS NOT NULL IS NOT NULL -1 -Testing that comparison operators are left associative -select 1 <=> 2 <=> 2, (1 <=> 2) <=> 2, 1 <=> (2 <=> 2); -1 <=> 2 <=> 2 (1 <=> 2) <=> 2 1 <=> (2 <=> 2) -0 0 1 -select 1 = 2 = 2, (1 = 2) = 2, 1 = (2 = 2); -1 = 2 = 2 (1 = 2) = 2 1 = (2 = 2) -0 0 1 -select 1 != 2 != 3, (1 != 2) != 3, 1 != (2 != 3); -1 != 2 != 3 (1 != 2) != 3 1 != (2 != 3) -1 1 0 -select 1 <> 2 <> 3, (1 <> 2) <> 3, 1 <> (2 <> 3); -1 <> 2 <> 3 (1 <> 2) <> 3 1 <> (2 <> 3) -1 1 0 -select 1 < 2 < 3, (1 < 2) < 3, 1 < (2 < 3); -1 < 2 < 3 (1 < 2) < 3 1 < (2 < 3) -1 1 0 -select 3 <= 2 <= 1, (3 <= 2) <= 1, 3 <= (2 <= 1); -3 <= 2 <= 1 (3 <= 2) <= 1 3 <= (2 <= 1) -1 1 0 -select 1 > 2 > 3, (1 > 2) > 3, 1 > (2 > 3); -1 > 2 > 3 (1 > 2) > 3 1 > (2 > 3) -0 0 1 -select 1 >= 2 >= 3, (1 >= 2) >= 3, 1 >= (2 >= 3); -1 >= 2 >= 3 (1 >= 2) >= 3 1 >= (2 >= 3) -0 0 1 -Testing that | is associative -select 0xF0 | 0x0F | 0x55, (0xF0 | 0x0F) | 0x55, 0xF0 | (0x0F | 0x55); -0xF0 | 0x0F | 0x55 (0xF0 | 0x0F) | 0x55 0xF0 | (0x0F | 0x55) -255 255 255 -Testing that & is associative -select 0xF5 & 0x5F & 0x55, (0xF5 & 0x5F) & 0x55, 0xF5 & (0x5F & 0x55); -0xF5 & 0x5F & 0x55 (0xF5 & 0x5F) & 0x55 0xF5 & (0x5F & 0x55) -85 85 85 -Testing that << is left associative -select 4 << 3 << 2, (4 << 3) << 2, 4 << (3 << 2); -4 << 3 << 2 (4 << 3) << 2 4 << (3 << 2) -128 128 16384 -Testing that >> is left associative -select 256 >> 3 >> 2, (256 >> 3) >> 2, 256 >> (3 >> 2); -256 >> 3 >> 2 (256 >> 3) >> 2 256 >> (3 >> 2) -8 8 256 -Testing that & has precedence over | -select 0xF0 & 0x0F | 0x55, (0xF0 & 0x0F) | 0x55, 0xF0 & (0x0F | 0x55); -0xF0 & 0x0F | 0x55 (0xF0 & 0x0F) | 0x55 0xF0 & (0x0F | 0x55) -85 85 80 -select 0x55 | 0xF0 & 0x0F, (0x55 | 0xF0) & 0x0F, 0x55 | (0xF0 & 0x0F); -0x55 | 0xF0 & 0x0F (0x55 | 0xF0) & 0x0F 0x55 | (0xF0 & 0x0F) -85 5 85 -Testing that << has precedence over | -select 0x0F << 4 | 0x0F, (0x0F << 4) | 0x0F, 0x0F << (4 | 0x0F); -0x0F << 4 | 0x0F (0x0F << 4) | 0x0F 0x0F << (4 | 0x0F) -255 255 491520 -select 0x0F | 0x0F << 4, (0x0F | 0x0F) << 4, 0x0F | (0x0F << 4); -0x0F | 0x0F << 4 (0x0F | 0x0F) << 4 0x0F | (0x0F << 4) -255 240 255 -Testing that >> has precedence over | -select 0xF0 >> 4 | 0xFF, (0xF0 >> 4) | 0xFF, 0xF0 >> (4 | 0xFF); -0xF0 >> 4 | 0xFF (0xF0 >> 4) | 0xFF 0xF0 >> (4 | 0xFF) -255 255 0 -select 0xFF | 0xF0 >> 4, (0xFF | 0xF0) >> 4, 0xFF | (0xF0 >> 4); -0xFF | 0xF0 >> 4 (0xFF | 0xF0) >> 4 0xFF | (0xF0 >> 4) -255 15 255 -Testing that << has precedence over & -select 0x0F << 4 & 0xF0, (0x0F << 4) & 0xF0, 0x0F << (4 & 0xF0); -0x0F << 4 & 0xF0 (0x0F << 4) & 0xF0 0x0F << (4 & 0xF0) -240 240 15 -select 0xF0 & 0x0F << 4, (0xF0 & 0x0F) << 4, 0xF0 & (0x0F << 4); -0xF0 & 0x0F << 4 (0xF0 & 0x0F) << 4 0xF0 & (0x0F << 4) -240 0 240 -Testing that >> has precedence over & -select 0xF0 >> 4 & 0x55, (0xF0 >> 4) & 0x55, 0xF0 >> (4 & 0x55); -0xF0 >> 4 & 0x55 (0xF0 >> 4) & 0x55 0xF0 >> (4 & 0x55) -5 5 15 -select 0x0F & 0xF0 >> 4, (0x0F & 0xF0) >> 4, 0x0F & (0xF0 >> 4); -0x0F & 0xF0 >> 4 (0x0F & 0xF0) >> 4 0x0F & (0xF0 >> 4) -15 0 15 -Testing that >> and << have the same precedence -select 0xFF >> 4 << 2, (0xFF >> 4) << 2, 0xFF >> (4 << 2); -0xFF >> 4 << 2 (0xFF >> 4) << 2 0xFF >> (4 << 2) -60 60 0 -select 0x0F << 4 >> 2, (0x0F << 4) >> 2, 0x0F << (4 >> 2); -0x0F << 4 >> 2 (0x0F << 4) >> 2 0x0F << (4 >> 2) -60 60 30 -Testing that binary + is associative -select 1 + 2 + 3, (1 + 2) + 3, 1 + (2 + 3); -1 + 2 + 3 (1 + 2) + 3 1 + (2 + 3) -6 6 6 -Testing that binary - is left associative -select 1 - 2 - 3, (1 - 2) - 3, 1 - (2 - 3); -1 - 2 - 3 (1 - 2) - 3 1 - (2 - 3) --4 -4 2 -Testing that binary + and binary - have the same precedence -select 1 + 2 - 3, (1 + 2) - 3, 1 + (2 - 3); -1 + 2 - 3 (1 + 2) - 3 1 + (2 - 3) -0 0 0 -select 1 - 2 + 3, (1 - 2) + 3, 1 - (2 + 3); -1 - 2 + 3 (1 - 2) + 3 1 - (2 + 3) -2 2 -4 -Testing that binary + has precedence over | -select 0xF0 + 0x0F | 0x55, (0xF0 + 0x0F) | 0x55, 0xF0 + (0x0F | 0x55); -0xF0 + 0x0F | 0x55 (0xF0 + 0x0F) | 0x55 0xF0 + (0x0F | 0x55) -255 255 335 -select 0x55 | 0xF0 + 0x0F, (0x55 | 0xF0) + 0x0F, 0x55 | (0xF0 + 0x0F); -0x55 | 0xF0 + 0x0F (0x55 | 0xF0) + 0x0F 0x55 | (0xF0 + 0x0F) -255 260 255 -Testing that binary + has precedence over & -select 0xF0 + 0x0F & 0x55, (0xF0 + 0x0F) & 0x55, 0xF0 + (0x0F & 0x55); -0xF0 + 0x0F & 0x55 (0xF0 + 0x0F) & 0x55 0xF0 + (0x0F & 0x55) -85 85 245 -select 0x55 & 0xF0 + 0x0F, (0x55 & 0xF0) + 0x0F, 0x55 & (0xF0 + 0x0F); -0x55 & 0xF0 + 0x0F (0x55 & 0xF0) + 0x0F 0x55 & (0xF0 + 0x0F) -85 95 85 -Testing that binary + has precedence over << -select 2 + 3 << 4, (2 + 3) << 4, 2 + (3 << 4); -2 + 3 << 4 (2 + 3) << 4 2 + (3 << 4) -80 80 50 -select 3 << 4 + 2, (3 << 4) + 2, 3 << (4 + 2); -3 << 4 + 2 (3 << 4) + 2 3 << (4 + 2) -192 50 192 -Testing that binary + has precedence over >> -select 4 + 3 >> 2, (4 + 3) >> 2, 4 + (3 >> 2); -4 + 3 >> 2 (4 + 3) >> 2 4 + (3 >> 2) -1 1 4 -select 3 >> 2 + 1, (3 >> 2) + 1, 3 >> (2 + 1); -3 >> 2 + 1 (3 >> 2) + 1 3 >> (2 + 1) -0 1 0 -Testing that binary - has precedence over | -select 0xFF - 0x0F | 0x55, (0xFF - 0x0F) | 0x55, 0xFF - (0x0F | 0x55); -0xFF - 0x0F | 0x55 (0xFF - 0x0F) | 0x55 0xFF - (0x0F | 0x55) -245 245 160 -select 0x55 | 0xFF - 0xF0, (0x55 | 0xFF) - 0xF0, 0x55 | (0xFF - 0xF0); -0x55 | 0xFF - 0xF0 (0x55 | 0xFF) - 0xF0 0x55 | (0xFF - 0xF0) -95 15 95 -Testing that binary - has precedence over & -select 0xFF - 0xF0 & 0x55, (0xFF - 0xF0) & 0x55, 0xFF - (0xF0 & 0x55); -0xFF - 0xF0 & 0x55 (0xFF - 0xF0) & 0x55 0xFF - (0xF0 & 0x55) -5 5 175 -select 0x55 & 0xFF - 0xF0, (0x55 & 0xFF) - 0xF0, 0x55 & (0xFF - 0xF0); -0x55 & 0xFF - 0xF0 (0x55 & 0xFF) - 0xF0 0x55 & (0xFF - 0xF0) -5 -155 5 -Testing that binary - has precedence over << -select 16 - 3 << 2, (16 - 3) << 2, 16 - (3 << 2); -16 - 3 << 2 (16 - 3) << 2 16 - (3 << 2) -52 52 4 -select 4 << 3 - 2, (4 << 3) - 2, 4 << (3 - 2); -4 << 3 - 2 (4 << 3) - 2 4 << (3 - 2) -8 30 8 -Testing that binary - has precedence over >> -select 16 - 3 >> 2, (16 - 3) >> 2, 16 - (3 >> 2); -16 - 3 >> 2 (16 - 3) >> 2 16 - (3 >> 2) -3 3 16 -select 16 >> 3 - 2, (16 >> 3) - 2, 16 >> (3 - 2); -16 >> 3 - 2 (16 >> 3) - 2 16 >> (3 - 2) -8 0 8 -Testing that * is associative -select 2 * 3 * 4, (2 * 3) * 4, 2 * (3 * 4); -2 * 3 * 4 (2 * 3) * 4 2 * (3 * 4) -24 24 24 -Testing that * has precedence over | -select 2 * 0x40 | 0x0F, (2 * 0x40) | 0x0F, 2 * (0x40 | 0x0F); -2 * 0x40 | 0x0F (2 * 0x40) | 0x0F 2 * (0x40 | 0x0F) -143 143 158 -select 0x0F | 2 * 0x40, (0x0F | 2) * 0x40, 0x0F | (2 * 0x40); -0x0F | 2 * 0x40 (0x0F | 2) * 0x40 0x0F | (2 * 0x40) -143 960 143 -Testing that * has precedence over & -select 2 * 0x40 & 0x55, (2 * 0x40) & 0x55, 2 * (0x40 & 0x55); -2 * 0x40 & 0x55 (2 * 0x40) & 0x55 2 * (0x40 & 0x55) -0 0 128 -select 0xF0 & 2 * 0x40, (0xF0 & 2) * 0x40, 0xF0 & (2 * 0x40); -0xF0 & 2 * 0x40 (0xF0 & 2) * 0x40 0xF0 & (2 * 0x40) -128 0 128 -Testing that * has precedence over << -select 5 * 3 << 4, (5 * 3) << 4, 5 * (3 << 4); -5 * 3 << 4 (5 * 3) << 4 5 * (3 << 4) -240 240 240 -select 2 << 3 * 4, (2 << 3) * 4, 2 << (3 * 4); -2 << 3 * 4 (2 << 3) * 4 2 << (3 * 4) -8192 64 8192 -Testing that * has precedence over >> -select 3 * 4 >> 2, (3 * 4) >> 2, 3 * (4 >> 2); -3 * 4 >> 2 (3 * 4) >> 2 3 * (4 >> 2) -3 3 3 -select 4 >> 2 * 3, (4 >> 2) * 3, 4 >> (2 * 3); -4 >> 2 * 3 (4 >> 2) * 3 4 >> (2 * 3) -0 3 0 -Testing that * has precedence over binary + -select 2 * 3 + 4, (2 * 3) + 4, 2 * (3 + 4); -2 * 3 + 4 (2 * 3) + 4 2 * (3 + 4) -10 10 14 -select 2 + 3 * 4, (2 + 3) * 4, 2 + (3 * 4); -2 + 3 * 4 (2 + 3) * 4 2 + (3 * 4) -14 20 14 -Testing that * has precedence over binary - -select 4 * 3 - 2, (4 * 3) - 2, 4 * (3 - 2); -4 * 3 - 2 (4 * 3) - 2 4 * (3 - 2) -10 10 4 -select 4 - 3 * 2, (4 - 3) * 2, 4 - (3 * 2); -4 - 3 * 2 (4 - 3) * 2 4 - (3 * 2) --2 2 -2 -Testing that / is left associative -select 15 / 5 / 3, (15 / 5) / 3, 15 / (5 / 3); -15 / 5 / 3 (15 / 5) / 3 15 / (5 / 3) -1.00000000 1.00000000 8.9998 -Testing that / has precedence over | -select 105 / 5 | 2, (105 / 5) | 2, 105 / (5 | 2); -105 / 5 | 2 (105 / 5) | 2 105 / (5 | 2) -23 23 15.0000 -select 105 | 2 / 5, (105 | 2) / 5, 105 | (2 / 5); -105 | 2 / 5 (105 | 2) / 5 105 | (2 / 5) -105 21.4000 105 -Testing that / has precedence over & -select 105 / 5 & 0x0F, (105 / 5) & 0x0F, 105 / (5 & 0x0F); -105 / 5 & 0x0F (105 / 5) & 0x0F 105 / (5 & 0x0F) -5 5 21.0000 -select 0x0F & 105 / 5, (0x0F & 105) / 5, 0x0F & (105 / 5); -0x0F & 105 / 5 (0x0F & 105) / 5 0x0F & (105 / 5) -5 1.8000 5 -Testing that / has precedence over << -select 0x80 / 4 << 2, (0x80 / 4) << 2, 0x80 / (4 << 2); -0x80 / 4 << 2 (0x80 / 4) << 2 0x80 / (4 << 2) -128 128 8.0000 -select 0x80 << 4 / 2, (0x80 << 4) / 2, 0x80 << (4 / 2); -0x80 << 4 / 2 (0x80 << 4) / 2 0x80 << (4 / 2) -512 1024.0000 512 -Testing that / has precedence over >> -select 0x80 / 4 >> 2, (0x80 / 4) >> 2, 0x80 / (4 >> 2); -0x80 / 4 >> 2 (0x80 / 4) >> 2 0x80 / (4 >> 2) -8 8 128.0000 -select 0x80 >> 4 / 2, (0x80 >> 4) / 2, 0x80 >> (4 / 2); -0x80 >> 4 / 2 (0x80 >> 4) / 2 0x80 >> (4 / 2) -32 4.0000 32 -Testing that / has precedence over binary + -select 0x80 / 2 + 2, (0x80 / 2) + 2, 0x80 / (2 + 2); -0x80 / 2 + 2 (0x80 / 2) + 2 0x80 / (2 + 2) -66.0000 66.0000 32.0000 -select 0x80 + 2 / 2, (0x80 + 2) / 2, 0x80 + (2 / 2); -0x80 + 2 / 2 (0x80 + 2) / 2 0x80 + (2 / 2) -129.0000 65.0000 129.0000 -Testing that / has precedence over binary - -select 0x80 / 4 - 2, (0x80 / 4) - 2, 0x80 / (4 - 2); -0x80 / 4 - 2 (0x80 / 4) - 2 0x80 / (4 - 2) -30.0000 30.0000 64.0000 -select 0x80 - 4 / 2, (0x80 - 4) / 2, 0x80 - (4 / 2); -0x80 - 4 / 2 (0x80 - 4) / 2 0x80 - (4 / 2) -126.0000 62.0000 126.0000 -Testing that ^ is associative -select 0xFF ^ 0xF0 ^ 0x0F, (0xFF ^ 0xF0) ^ 0x0F, 0xFF ^ (0xF0 ^ 0x0F); -0xFF ^ 0xF0 ^ 0x0F (0xFF ^ 0xF0) ^ 0x0F 0xFF ^ (0xF0 ^ 0x0F) -0 0 0 -select 0xFF ^ 0xF0 ^ 0x55, (0xFF ^ 0xF0) ^ 0x55, 0xFF ^ (0xF0 ^ 0x55); -0xFF ^ 0xF0 ^ 0x55 (0xFF ^ 0xF0) ^ 0x55 0xFF ^ (0xF0 ^ 0x55) -90 90 90 -Testing that ^ has precedence over | -select 0xFF ^ 0xF0 | 0x0F, (0xFF ^ 0xF0) | 0x0F, 0xFF ^ (0xF0 | 0x0F); -0xFF ^ 0xF0 | 0x0F (0xFF ^ 0xF0) | 0x0F 0xFF ^ (0xF0 | 0x0F) -15 15 0 -select 0xF0 | 0xFF ^ 0xF0, (0xF0 | 0xFF) ^ 0xF0, 0xF0 | (0xFF ^ 0xF0); -0xF0 | 0xFF ^ 0xF0 (0xF0 | 0xFF) ^ 0xF0 0xF0 | (0xFF ^ 0xF0) -255 15 255 -Testing that ^ has precedence over & -select 0xFF ^ 0xF0 & 0x0F, (0xFF ^ 0xF0) & 0x0F, 0xFF ^ (0xF0 & 0x0F); -0xFF ^ 0xF0 & 0x0F (0xFF ^ 0xF0) & 0x0F 0xFF ^ (0xF0 & 0x0F) -15 15 255 -select 0x0F & 0xFF ^ 0xF0, (0x0F & 0xFF) ^ 0xF0, 0x0F & (0xFF ^ 0xF0); -0x0F & 0xFF ^ 0xF0 (0x0F & 0xFF) ^ 0xF0 0x0F & (0xFF ^ 0xF0) -15 255 15 -Testing that ^ has precedence over << -select 0xFF ^ 0xF0 << 2, (0xFF ^ 0xF0) << 2, 0xFF ^ (0xF0 << 2); -0xFF ^ 0xF0 << 2 (0xFF ^ 0xF0) << 2 0xFF ^ (0xF0 << 2) -60 60 831 -select 0x0F << 2 ^ 0xFF, (0x0F << 2) ^ 0xFF, 0x0F << (2 ^ 0xFF); -0x0F << 2 ^ 0xFF (0x0F << 2) ^ 0xFF 0x0F << (2 ^ 0xFF) -0 195 0 -Testing that ^ has precedence over >> -select 0xFF ^ 0xF0 >> 2, (0xFF ^ 0xF0) >> 2, 0xFF ^ (0xF0 >> 2); -0xFF ^ 0xF0 >> 2 (0xFF ^ 0xF0) >> 2 0xFF ^ (0xF0 >> 2) -3 3 195 -select 0xFF >> 2 ^ 0xF0, (0xFF >> 2) ^ 0xF0, 0xFF >> (2 ^ 0xF0); -0xFF >> 2 ^ 0xF0 (0xFF >> 2) ^ 0xF0 0xFF >> (2 ^ 0xF0) -0 207 0 -Testing that ^ has precedence over binary + -select 0xFF ^ 0xF0 + 0x0F, (0xFF ^ 0xF0) + 0x0F, 0xFF ^ (0xF0 + 0x0F); -0xFF ^ 0xF0 + 0x0F (0xFF ^ 0xF0) + 0x0F 0xFF ^ (0xF0 + 0x0F) -30 30 0 -select 0x0F + 0xFF ^ 0xF0, (0x0F + 0xFF) ^ 0xF0, 0x0F + (0xFF ^ 0xF0); -0x0F + 0xFF ^ 0xF0 (0x0F + 0xFF) ^ 0xF0 0x0F + (0xFF ^ 0xF0) -30 510 30 -Testing that ^ has precedence over binary - -select 0xFF ^ 0xF0 - 1, (0xFF ^ 0xF0) - 1, 0xFF ^ (0xF0 - 1); -0xFF ^ 0xF0 - 1 (0xFF ^ 0xF0) - 1 0xFF ^ (0xF0 - 1) -14 14 16 -select 0x55 - 0x0F ^ 0x55, (0x55 - 0x0F) ^ 0x55, 0x55 - (0x0F ^ 0x55); -0x55 - 0x0F ^ 0x55 (0x55 - 0x0F) ^ 0x55 0x55 - (0x0F ^ 0x55) --5 19 -5 -Testing that ^ has precedence over * -select 0xFF ^ 0xF0 * 2, (0xFF ^ 0xF0) * 2, 0xFF ^ (0xF0 * 2); -0xFF ^ 0xF0 * 2 (0xFF ^ 0xF0) * 2 0xFF ^ (0xF0 * 2) -30 30 287 -select 2 * 0xFF ^ 0xF0, (2 * 0xFF) ^ 0xF0, 2 * (0xFF ^ 0xF0); -2 * 0xFF ^ 0xF0 (2 * 0xFF) ^ 0xF0 2 * (0xFF ^ 0xF0) -30 270 30 -Testing that ^ has precedence over / -select 0xFF ^ 0xF0 / 2, (0xFF ^ 0xF0) / 2, 0xFF ^ (0xF0 / 2); -0xFF ^ 0xF0 / 2 (0xFF ^ 0xF0) / 2 0xFF ^ (0xF0 / 2) -7.5000 7.5000 135 -select 0xF2 / 2 ^ 0xF0, (0xF2 / 2) ^ 0xF0, 0xF2 / (2 ^ 0xF0); -0xF2 / 2 ^ 0xF0 (0xF2 / 2) ^ 0xF0 0xF2 / (2 ^ 0xF0) -1.0000 137 1.0000 -Testing that ^ has precedence over % -select 0xFF ^ 0xF0 % 0x20, (0xFF ^ 0xF0) % 0x20, 0xFF ^ (0xF0 % 0x20); -0xFF ^ 0xF0 % 0x20 (0xFF ^ 0xF0) % 0x20 0xFF ^ (0xF0 % 0x20) -15 15 239 -select 0xFF % 0x20 ^ 0xF0, (0xFF % 0x20) ^ 0xF0, 0xFF % (0x20 ^ 0xF0); -0xFF % 0x20 ^ 0xF0 (0xFF % 0x20) ^ 0xF0 0xFF % (0x20 ^ 0xF0) -47 239 47 -Testing that ^ has precedence over DIV -select 0xFF ^ 0xF0 DIV 2, (0xFF ^ 0xF0) DIV 2, 0xFF ^ (0xF0 DIV 2); -0xFF ^ 0xF0 DIV 2 (0xFF ^ 0xF0) DIV 2 0xFF ^ (0xF0 DIV 2) -7 7 135 -select 0xF2 DIV 2 ^ 0xF0, (0xF2 DIV 2) ^ 0xF0, 0xF2 DIV (2 ^ 0xF0); -0xF2 DIV 2 ^ 0xF0 (0xF2 DIV 2) ^ 0xF0 0xF2 DIV (2 ^ 0xF0) -1 137 1 -Testing that ^ has precedence over MOD -select 0xFF ^ 0xF0 MOD 0x20, (0xFF ^ 0xF0) MOD 0x20, 0xFF ^ (0xF0 MOD 0x20); -0xFF ^ 0xF0 MOD 0x20 (0xFF ^ 0xF0) MOD 0x20 0xFF ^ (0xF0 MOD 0x20) -15 15 239 -select 0xFF MOD 0x20 ^ 0xF0, (0xFF MOD 0x20) ^ 0xF0, 0xFF MOD (0x20 ^ 0xF0); -0xFF MOD 0x20 ^ 0xF0 (0xFF MOD 0x20) ^ 0xF0 0xFF MOD (0x20 ^ 0xF0) -47 239 47 diff --git a/mysql-test/main/parser_precedence.test b/mysql-test/main/parser_precedence.test deleted file mode 100644 index 7b69bc9c6da..00000000000 --- a/mysql-test/main/parser_precedence.test +++ /dev/null @@ -1,335 +0,0 @@ - ---disable_warnings -drop table if exists t1_30237_bool; ---enable_warnings - -set sql_mode=NO_UNSIGNED_SUBTRACTION; - -create table t1_30237_bool(A boolean, B boolean, C boolean); - -insert into t1_30237_bool values -(FALSE, FALSE, FALSE), -(FALSE, FALSE, NULL), -(FALSE, FALSE, TRUE), -(FALSE, NULL, FALSE), -(FALSE, NULL, NULL), -(FALSE, NULL, TRUE), -(FALSE, TRUE, FALSE), -(FALSE, TRUE, NULL), -(FALSE, TRUE, TRUE), -(NULL, FALSE, FALSE), -(NULL, FALSE, NULL), -(NULL, FALSE, TRUE), -(NULL, NULL, FALSE), -(NULL, NULL, NULL), -(NULL, NULL, TRUE), -(NULL, TRUE, FALSE), -(NULL, TRUE, NULL), -(NULL, TRUE, TRUE), -(TRUE, FALSE, FALSE), -(TRUE, FALSE, NULL), -(TRUE, FALSE, TRUE), -(TRUE, NULL, FALSE), -(TRUE, NULL, NULL), -(TRUE, NULL, TRUE), -(TRUE, TRUE, FALSE), -(TRUE, TRUE, NULL), -(TRUE, TRUE, TRUE) ; - ---echo Testing OR, XOR, AND -select A, B, A OR B, A XOR B, A AND B - from t1_30237_bool where C is null order by A, B; - ---echo Testing that OR is associative -select A, B, C, (A OR B) OR C, A OR (B OR C), A OR B OR C - from t1_30237_bool order by A, B, C; - -select count(*) from t1_30237_bool - where ((A OR B) OR C) != (A OR (B OR C)); - ---echo Testing that XOR is associative -select A, B, C, (A XOR B) XOR C, A XOR (B XOR C), A XOR B XOR C - from t1_30237_bool order by A, B, C; - -select count(*) from t1_30237_bool - where ((A XOR B) XOR C) != (A XOR (B XOR C)); - ---echo Testing that AND is associative -select A, B, C, (A AND B) AND C, A AND (B AND C), A AND B AND C - from t1_30237_bool order by A, B, C; - -select count(*) from t1_30237_bool - where ((A AND B) AND C) != (A AND (B AND C)); - ---echo Testing that AND has precedence over OR -select A, B, C, (A OR B) AND C, A OR (B AND C), A OR B AND C - from t1_30237_bool order by A, B, C; -select count(*) from t1_30237_bool - where (A OR (B AND C)) != (A OR B AND C); -select A, B, C, (A AND B) OR C, A AND (B OR C), A AND B OR C - from t1_30237_bool order by A, B, C; -select count(*) from t1_30237_bool - where ((A AND B) OR C) != (A AND B OR C); - ---echo Testing that AND has precedence over XOR -select A, B, C, (A XOR B) AND C, A XOR (B AND C), A XOR B AND C - from t1_30237_bool order by A, B, C; -select count(*) from t1_30237_bool - where (A XOR (B AND C)) != (A XOR B AND C); -select A, B, C, (A AND B) XOR C, A AND (B XOR C), A AND B XOR C - from t1_30237_bool order by A, B, C; -select count(*) from t1_30237_bool - where ((A AND B) XOR C) != (A AND B XOR C); - ---echo Testing that XOR has precedence over OR -select A, B, C, (A XOR B) OR C, A XOR (B OR C), A XOR B OR C - from t1_30237_bool order by A, B, C; -select count(*) from t1_30237_bool - where ((A XOR B) OR C) != (A XOR B OR C); -select A, B, C, (A OR B) XOR C, A OR (B XOR C), A OR B XOR C - from t1_30237_bool order by A, B, C; -select count(*) from t1_30237_bool - where (A OR (B XOR C)) != (A OR B XOR C); - -drop table t1_30237_bool; - ---echo Testing that NOT has precedence over OR -select (NOT FALSE) OR TRUE, NOT (FALSE OR TRUE), NOT FALSE OR TRUE; - ---echo Testing that NOT has precedence over XOR -select (NOT FALSE) XOR FALSE, NOT (FALSE XOR FALSE), NOT FALSE XOR FALSE; - ---echo Testing that NOT has precedence over AND -select (NOT FALSE) AND FALSE, NOT (FALSE AND FALSE), NOT FALSE AND FALSE; - ---echo Testing that NOT is associative -select NOT NOT TRUE, NOT NOT NOT FALSE; - ---echo Testing that IS has precedence over NOT -select (NOT NULL) IS TRUE, NOT (NULL IS TRUE), NOT NULL IS TRUE; -select (NOT NULL) IS NOT TRUE, NOT (NULL IS NOT TRUE), NOT NULL IS NOT TRUE; -select (NOT NULL) IS FALSE, NOT (NULL IS FALSE), NOT NULL IS FALSE; -select (NOT NULL) IS NOT FALSE, NOT (NULL IS NOT FALSE), NOT NULL IS NOT FALSE; -select (NOT TRUE) IS UNKNOWN, NOT (TRUE IS UNKNOWN), NOT TRUE IS UNKNOWN; -select (NOT TRUE) IS NOT UNKNOWN, NOT (TRUE IS NOT UNKNOWN), NOT TRUE IS NOT UNKNOWN; -select (NOT TRUE) IS NULL, NOT (TRUE IS NULL), NOT TRUE IS NULL; -select (NOT TRUE) IS NOT NULL, NOT (TRUE IS NOT NULL), NOT TRUE IS NOT NULL; - ---echo Testing that IS [NOT] TRUE/FALSE/UNKNOWN predicates are not associative -# Documenting existing behavior in 5.0.48 --- error ER_PARSE_ERROR -select TRUE IS TRUE IS TRUE IS TRUE; --- error ER_PARSE_ERROR -select FALSE IS NOT TRUE IS NOT TRUE IS NOT TRUE; --- error ER_PARSE_ERROR -select NULL IS FALSE IS FALSE IS FALSE; --- error ER_PARSE_ERROR -select TRUE IS NOT FALSE IS NOT FALSE IS NOT FALSE; --- error ER_PARSE_ERROR -select FALSE IS UNKNOWN IS UNKNOWN IS UNKNOWN; --- error ER_PARSE_ERROR -select TRUE IS NOT UNKNOWN IS NOT UNKNOWN IS NOT UNKNOWN; - ---echo Testing that IS [NOT] NULL predicates are associative -# Documenting existing behavior in 5.0.48 -select FALSE IS NULL IS NULL IS NULL; -select TRUE IS NOT NULL IS NOT NULL IS NOT NULL; - ---echo Testing that comparison operators are left associative -select 1 <=> 2 <=> 2, (1 <=> 2) <=> 2, 1 <=> (2 <=> 2); -select 1 = 2 = 2, (1 = 2) = 2, 1 = (2 = 2); -select 1 != 2 != 3, (1 != 2) != 3, 1 != (2 != 3); -select 1 <> 2 <> 3, (1 <> 2) <> 3, 1 <> (2 <> 3); -select 1 < 2 < 3, (1 < 2) < 3, 1 < (2 < 3); -select 3 <= 2 <= 1, (3 <= 2) <= 1, 3 <= (2 <= 1); -select 1 > 2 > 3, (1 > 2) > 3, 1 > (2 > 3); -select 1 >= 2 >= 3, (1 >= 2) >= 3, 1 >= (2 >= 3); - --- echo Testing that | is associative -select 0xF0 | 0x0F | 0x55, (0xF0 | 0x0F) | 0x55, 0xF0 | (0x0F | 0x55); - --- echo Testing that & is associative -select 0xF5 & 0x5F & 0x55, (0xF5 & 0x5F) & 0x55, 0xF5 & (0x5F & 0x55); - --- echo Testing that << is left associative -select 4 << 3 << 2, (4 << 3) << 2, 4 << (3 << 2); - --- echo Testing that >> is left associative -select 256 >> 3 >> 2, (256 >> 3) >> 2, 256 >> (3 >> 2); - ---echo Testing that & has precedence over | -select 0xF0 & 0x0F | 0x55, (0xF0 & 0x0F) | 0x55, 0xF0 & (0x0F | 0x55); -select 0x55 | 0xF0 & 0x0F, (0x55 | 0xF0) & 0x0F, 0x55 | (0xF0 & 0x0F); - ---echo Testing that << has precedence over | -select 0x0F << 4 | 0x0F, (0x0F << 4) | 0x0F, 0x0F << (4 | 0x0F); -select 0x0F | 0x0F << 4, (0x0F | 0x0F) << 4, 0x0F | (0x0F << 4); - ---echo Testing that >> has precedence over | -select 0xF0 >> 4 | 0xFF, (0xF0 >> 4) | 0xFF, 0xF0 >> (4 | 0xFF); -select 0xFF | 0xF0 >> 4, (0xFF | 0xF0) >> 4, 0xFF | (0xF0 >> 4); - ---echo Testing that << has precedence over & -select 0x0F << 4 & 0xF0, (0x0F << 4) & 0xF0, 0x0F << (4 & 0xF0); -select 0xF0 & 0x0F << 4, (0xF0 & 0x0F) << 4, 0xF0 & (0x0F << 4); - ---echo Testing that >> has precedence over & -select 0xF0 >> 4 & 0x55, (0xF0 >> 4) & 0x55, 0xF0 >> (4 & 0x55); -select 0x0F & 0xF0 >> 4, (0x0F & 0xF0) >> 4, 0x0F & (0xF0 >> 4); - ---echo Testing that >> and << have the same precedence -select 0xFF >> 4 << 2, (0xFF >> 4) << 2, 0xFF >> (4 << 2); -select 0x0F << 4 >> 2, (0x0F << 4) >> 2, 0x0F << (4 >> 2); - ---echo Testing that binary + is associative -select 1 + 2 + 3, (1 + 2) + 3, 1 + (2 + 3); - ---echo Testing that binary - is left associative -select 1 - 2 - 3, (1 - 2) - 3, 1 - (2 - 3); - ---echo Testing that binary + and binary - have the same precedence -# evaluated left to right -select 1 + 2 - 3, (1 + 2) - 3, 1 + (2 - 3); -select 1 - 2 + 3, (1 - 2) + 3, 1 - (2 + 3); - ---echo Testing that binary + has precedence over | -select 0xF0 + 0x0F | 0x55, (0xF0 + 0x0F) | 0x55, 0xF0 + (0x0F | 0x55); -select 0x55 | 0xF0 + 0x0F, (0x55 | 0xF0) + 0x0F, 0x55 | (0xF0 + 0x0F); - ---echo Testing that binary + has precedence over & -select 0xF0 + 0x0F & 0x55, (0xF0 + 0x0F) & 0x55, 0xF0 + (0x0F & 0x55); -select 0x55 & 0xF0 + 0x0F, (0x55 & 0xF0) + 0x0F, 0x55 & (0xF0 + 0x0F); - ---echo Testing that binary + has precedence over << -select 2 + 3 << 4, (2 + 3) << 4, 2 + (3 << 4); -select 3 << 4 + 2, (3 << 4) + 2, 3 << (4 + 2); - ---echo Testing that binary + has precedence over >> -select 4 + 3 >> 2, (4 + 3) >> 2, 4 + (3 >> 2); -select 3 >> 2 + 1, (3 >> 2) + 1, 3 >> (2 + 1); - ---echo Testing that binary - has precedence over | -select 0xFF - 0x0F | 0x55, (0xFF - 0x0F) | 0x55, 0xFF - (0x0F | 0x55); -select 0x55 | 0xFF - 0xF0, (0x55 | 0xFF) - 0xF0, 0x55 | (0xFF - 0xF0); - ---echo Testing that binary - has precedence over & -select 0xFF - 0xF0 & 0x55, (0xFF - 0xF0) & 0x55, 0xFF - (0xF0 & 0x55); -select 0x55 & 0xFF - 0xF0, (0x55 & 0xFF) - 0xF0, 0x55 & (0xFF - 0xF0); - ---echo Testing that binary - has precedence over << -select 16 - 3 << 2, (16 - 3) << 2, 16 - (3 << 2); -select 4 << 3 - 2, (4 << 3) - 2, 4 << (3 - 2); - ---echo Testing that binary - has precedence over >> -select 16 - 3 >> 2, (16 - 3) >> 2, 16 - (3 >> 2); -select 16 >> 3 - 2, (16 >> 3) - 2, 16 >> (3 - 2); - ---echo Testing that * is associative -select 2 * 3 * 4, (2 * 3) * 4, 2 * (3 * 4); - ---echo Testing that * has precedence over | -select 2 * 0x40 | 0x0F, (2 * 0x40) | 0x0F, 2 * (0x40 | 0x0F); -select 0x0F | 2 * 0x40, (0x0F | 2) * 0x40, 0x0F | (2 * 0x40); - ---echo Testing that * has precedence over & -select 2 * 0x40 & 0x55, (2 * 0x40) & 0x55, 2 * (0x40 & 0x55); -select 0xF0 & 2 * 0x40, (0xF0 & 2) * 0x40, 0xF0 & (2 * 0x40); - ---echo Testing that * has precedence over << -# Actually, can't prove it for the first case, -# since << is a multiplication by a power of 2, -# and * is associative -select 5 * 3 << 4, (5 * 3) << 4, 5 * (3 << 4); -select 2 << 3 * 4, (2 << 3) * 4, 2 << (3 * 4); - ---echo Testing that * has precedence over >> -# >> is a multiplication by a (negative) power of 2, -# see above. -select 3 * 4 >> 2, (3 * 4) >> 2, 3 * (4 >> 2); -select 4 >> 2 * 3, (4 >> 2) * 3, 4 >> (2 * 3); - ---echo Testing that * has precedence over binary + -select 2 * 3 + 4, (2 * 3) + 4, 2 * (3 + 4); -select 2 + 3 * 4, (2 + 3) * 4, 2 + (3 * 4); - ---echo Testing that * has precedence over binary - -select 4 * 3 - 2, (4 * 3) - 2, 4 * (3 - 2); -select 4 - 3 * 2, (4 - 3) * 2, 4 - (3 * 2); - ---echo Testing that / is left associative -select 15 / 5 / 3, (15 / 5) / 3, 15 / (5 / 3); - ---echo Testing that / has precedence over | -select 105 / 5 | 2, (105 / 5) | 2, 105 / (5 | 2); -select 105 | 2 / 5, (105 | 2) / 5, 105 | (2 / 5); - ---echo Testing that / has precedence over & -select 105 / 5 & 0x0F, (105 / 5) & 0x0F, 105 / (5 & 0x0F); -select 0x0F & 105 / 5, (0x0F & 105) / 5, 0x0F & (105 / 5); - ---echo Testing that / has precedence over << -select 0x80 / 4 << 2, (0x80 / 4) << 2, 0x80 / (4 << 2); -select 0x80 << 4 / 2, (0x80 << 4) / 2, 0x80 << (4 / 2); - ---echo Testing that / has precedence over >> -select 0x80 / 4 >> 2, (0x80 / 4) >> 2, 0x80 / (4 >> 2); -select 0x80 >> 4 / 2, (0x80 >> 4) / 2, 0x80 >> (4 / 2); - ---echo Testing that / has precedence over binary + -select 0x80 / 2 + 2, (0x80 / 2) + 2, 0x80 / (2 + 2); -select 0x80 + 2 / 2, (0x80 + 2) / 2, 0x80 + (2 / 2); - ---echo Testing that / has precedence over binary - -select 0x80 / 4 - 2, (0x80 / 4) - 2, 0x80 / (4 - 2); -select 0x80 - 4 / 2, (0x80 - 4) / 2, 0x80 - (4 / 2); - -# TODO: %, DIV, MOD - ---echo Testing that ^ is associative -select 0xFF ^ 0xF0 ^ 0x0F, (0xFF ^ 0xF0) ^ 0x0F, 0xFF ^ (0xF0 ^ 0x0F); -select 0xFF ^ 0xF0 ^ 0x55, (0xFF ^ 0xF0) ^ 0x55, 0xFF ^ (0xF0 ^ 0x55); - ---echo Testing that ^ has precedence over | -select 0xFF ^ 0xF0 | 0x0F, (0xFF ^ 0xF0) | 0x0F, 0xFF ^ (0xF0 | 0x0F); -select 0xF0 | 0xFF ^ 0xF0, (0xF0 | 0xFF) ^ 0xF0, 0xF0 | (0xFF ^ 0xF0); - ---echo Testing that ^ has precedence over & -select 0xFF ^ 0xF0 & 0x0F, (0xFF ^ 0xF0) & 0x0F, 0xFF ^ (0xF0 & 0x0F); -select 0x0F & 0xFF ^ 0xF0, (0x0F & 0xFF) ^ 0xF0, 0x0F & (0xFF ^ 0xF0); - ---echo Testing that ^ has precedence over << -select 0xFF ^ 0xF0 << 2, (0xFF ^ 0xF0) << 2, 0xFF ^ (0xF0 << 2); -select 0x0F << 2 ^ 0xFF, (0x0F << 2) ^ 0xFF, 0x0F << (2 ^ 0xFF); - ---echo Testing that ^ has precedence over >> -select 0xFF ^ 0xF0 >> 2, (0xFF ^ 0xF0) >> 2, 0xFF ^ (0xF0 >> 2); -select 0xFF >> 2 ^ 0xF0, (0xFF >> 2) ^ 0xF0, 0xFF >> (2 ^ 0xF0); - ---echo Testing that ^ has precedence over binary + -select 0xFF ^ 0xF0 + 0x0F, (0xFF ^ 0xF0) + 0x0F, 0xFF ^ (0xF0 + 0x0F); -select 0x0F + 0xFF ^ 0xF0, (0x0F + 0xFF) ^ 0xF0, 0x0F + (0xFF ^ 0xF0); - ---echo Testing that ^ has precedence over binary - -select 0xFF ^ 0xF0 - 1, (0xFF ^ 0xF0) - 1, 0xFF ^ (0xF0 - 1); -select 0x55 - 0x0F ^ 0x55, (0x55 - 0x0F) ^ 0x55, 0x55 - (0x0F ^ 0x55); - ---echo Testing that ^ has precedence over * -select 0xFF ^ 0xF0 * 2, (0xFF ^ 0xF0) * 2, 0xFF ^ (0xF0 * 2); -select 2 * 0xFF ^ 0xF0, (2 * 0xFF) ^ 0xF0, 2 * (0xFF ^ 0xF0); - ---echo Testing that ^ has precedence over / -select 0xFF ^ 0xF0 / 2, (0xFF ^ 0xF0) / 2, 0xFF ^ (0xF0 / 2); -select 0xF2 / 2 ^ 0xF0, (0xF2 / 2) ^ 0xF0, 0xF2 / (2 ^ 0xF0); - ---echo Testing that ^ has precedence over % -select 0xFF ^ 0xF0 % 0x20, (0xFF ^ 0xF0) % 0x20, 0xFF ^ (0xF0 % 0x20); -select 0xFF % 0x20 ^ 0xF0, (0xFF % 0x20) ^ 0xF0, 0xFF % (0x20 ^ 0xF0); - ---echo Testing that ^ has precedence over DIV -select 0xFF ^ 0xF0 DIV 2, (0xFF ^ 0xF0) DIV 2, 0xFF ^ (0xF0 DIV 2); -select 0xF2 DIV 2 ^ 0xF0, (0xF2 DIV 2) ^ 0xF0, 0xF2 DIV (2 ^ 0xF0); - ---echo Testing that ^ has precedence over MOD -select 0xFF ^ 0xF0 MOD 0x20, (0xFF ^ 0xF0) MOD 0x20, 0xFF ^ (0xF0 MOD 0x20); -select 0xFF MOD 0x20 ^ 0xF0, (0xFF MOD 0x20) ^ 0xF0, 0xFF MOD (0x20 ^ 0xF0); - diff --git a/mysql-test/main/precedence.result b/mysql-test/main/precedence.result new file mode 100644 index 00000000000..f56f945c3fc --- /dev/null +++ b/mysql-test/main/precedence.result @@ -0,0 +1,8019 @@ +create or replace view v1 as select NOT NULL IS TRUE, NOT (NULL IS TRUE), (NOT NULL) IS TRUE; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select !(NULL is true) AS `NOT NULL IS TRUE`,!(NULL is true) AS `NOT (NULL IS TRUE)`,!NULL is true AS `(NOT NULL) IS TRUE` +select NOT NULL IS TRUE, NOT (NULL IS TRUE), (NOT NULL) IS TRUE union select * from v1; +NOT NULL IS TRUE NOT (NULL IS TRUE) (NOT NULL) IS TRUE +1 1 0 +create or replace view v1 as select ! NULL IS TRUE, ! (NULL IS TRUE), (! NULL) IS TRUE; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select !NULL is true AS `! NULL IS TRUE`,!(NULL is true) AS `! (NULL IS TRUE)`,!NULL is true AS `(! NULL) IS TRUE` +select ! NULL IS TRUE, ! (NULL IS TRUE), (! NULL) IS TRUE union select * from v1; +! NULL IS TRUE ! (NULL IS TRUE) (! NULL) IS TRUE +0 1 0 +create or replace view v1 as select charset(NOT 2 COLLATE latin1_bin), charset(NOT (2 COLLATE latin1_bin)), charset((NOT 2) COLLATE latin1_bin); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select charset(!2 collate latin1_bin) AS `charset(NOT 2 COLLATE latin1_bin)`,charset(!2 collate latin1_bin) AS `charset(NOT (2 COLLATE latin1_bin))`,charset((!2) collate latin1_bin) AS `charset((NOT 2) COLLATE latin1_bin)` +select charset(NOT 2 COLLATE latin1_bin), charset(NOT (2 COLLATE latin1_bin)), charset((NOT 2) COLLATE latin1_bin) union select * from v1; +charset(NOT 2 COLLATE latin1_bin) charset(NOT (2 COLLATE latin1_bin)) charset((NOT 2) COLLATE latin1_bin) +binary binary latin1 +create or replace view v1 as select NOT 2 IN (0,2), NOT (2 IN (0,2)), (NOT 2) IN (0,2); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 not in (0,2) AS `NOT 2 IN (0,2)`,2 not in (0,2) AS `NOT (2 IN (0,2))`,!2 in (0,2) AS `(NOT 2) IN (0,2)` +select NOT 2 IN (0,2), NOT (2 IN (0,2)), (NOT 2) IN (0,2) union select * from v1; +NOT 2 IN (0,2) NOT (2 IN (0,2)) (NOT 2) IN (0,2) +0 0 1 +create or replace view v1 as select NOT 2 OR 3, NOT (2 OR 3), (NOT 2) OR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select !2 or 3 AS `NOT 2 OR 3`,!2 and !3 AS `NOT (2 OR 3)`,!2 or 3 AS `(NOT 2) OR 3` +select NOT 2 OR 3, NOT (2 OR 3), (NOT 2) OR 3 union select * from v1; +NOT 2 OR 3 NOT (2 OR 3) (NOT 2) OR 3 +1 0 1 +create or replace view v1 as select NOT 2 || 3, NOT (2 || 3), (NOT 2) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select !2 or 3 AS `NOT 2 || 3`,!2 and !3 AS `NOT (2 || 3)`,!2 or 3 AS `(NOT 2) || 3` +select NOT 2 || 3, NOT (2 || 3), (NOT 2) || 3 union select * from v1; +NOT 2 || 3 NOT (2 || 3) (NOT 2) || 3 +1 0 1 +create or replace view v1 as select NOT 2 AND 0, NOT (2 AND 0), (NOT 2) AND 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select !2 and 0 AS `NOT 2 AND 0`,!2 or !0 AS `NOT (2 AND 0)`,!2 and 0 AS `(NOT 2) AND 0` +select NOT 2 AND 0, NOT (2 AND 0), (NOT 2) AND 0 union select * from v1; +NOT 2 AND 0 NOT (2 AND 0) (NOT 2) AND 0 +0 1 0 +create or replace view v1 as select NOT 2 && 0, NOT (2 && 0), (NOT 2) && 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select !2 and 0 AS `NOT 2 && 0`,!2 or !0 AS `NOT (2 && 0)`,!2 and 0 AS `(NOT 2) && 0` +select NOT 2 && 0, NOT (2 && 0), (NOT 2) && 0 union select * from v1; +NOT 2 && 0 NOT (2 && 0) (NOT 2) && 0 +0 1 0 +create or replace view v1 as select NOT 2 = 3, NOT (2 = 3), (NOT 2) = 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <> 3 AS `NOT 2 = 3`,2 <> 3 AS `NOT (2 = 3)`,!2 = 3 AS `(NOT 2) = 3` +select NOT 2 = 3, NOT (2 = 3), (NOT 2) = 3 union select * from v1; +NOT 2 = 3 NOT (2 = 3) (NOT 2) = 3 +1 1 0 +create or replace view v1 as select NOT 2 <=> 3, NOT (2 <=> 3), (NOT 2) <=> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select !(2 <=> 3) AS `NOT 2 <=> 3`,!(2 <=> 3) AS `NOT (2 <=> 3)`,!2 <=> 3 AS `(NOT 2) <=> 3` +select NOT 2 <=> 3, NOT (2 <=> 3), (NOT 2) <=> 3 union select * from v1; +NOT 2 <=> 3 NOT (2 <=> 3) (NOT 2) <=> 3 +1 1 0 +create or replace view v1 as select NOT 2 >= 3, NOT (2 >= 3), (NOT 2) >= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 < 3 AS `NOT 2 >= 3`,2 < 3 AS `NOT (2 >= 3)`,!2 >= 3 AS `(NOT 2) >= 3` +select NOT 2 >= 3, NOT (2 >= 3), (NOT 2) >= 3 union select * from v1; +NOT 2 >= 3 NOT (2 >= 3) (NOT 2) >= 3 +1 1 0 +create or replace view v1 as select NOT 2 <= 3, NOT (2 <= 3), (NOT 2) <= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 > 3 AS `NOT 2 <= 3`,2 > 3 AS `NOT (2 <= 3)`,!2 <= 3 AS `(NOT 2) <= 3` +select NOT 2 <= 3, NOT (2 <= 3), (NOT 2) <= 3 union select * from v1; +NOT 2 <= 3 NOT (2 <= 3) (NOT 2) <= 3 +0 0 1 +create or replace view v1 as select NOT 2 < 3, NOT (2 < 3), (NOT 2) < 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 >= 3 AS `NOT 2 < 3`,2 >= 3 AS `NOT (2 < 3)`,!2 < 3 AS `(NOT 2) < 3` +select NOT 2 < 3, NOT (2 < 3), (NOT 2) < 3 union select * from v1; +NOT 2 < 3 NOT (2 < 3) (NOT 2) < 3 +0 0 1 +create or replace view v1 as select NOT 2 <> 3, NOT (2 <> 3), (NOT 2) <> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 = 3 AS `NOT 2 <> 3`,2 = 3 AS `NOT (2 <> 3)`,!2 <> 3 AS `(NOT 2) <> 3` +select NOT 2 <> 3, NOT (2 <> 3), (NOT 2) <> 3 union select * from v1; +NOT 2 <> 3 NOT (2 <> 3) (NOT 2) <> 3 +0 0 1 +create or replace view v1 as select NOT 2 > 3, NOT (2 > 3), (NOT 2) > 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <= 3 AS `NOT 2 > 3`,2 <= 3 AS `NOT (2 > 3)`,!2 > 3 AS `(NOT 2) > 3` +select NOT 2 > 3, NOT (2 > 3), (NOT 2) > 3 union select * from v1; +NOT 2 > 3 NOT (2 > 3) (NOT 2) > 3 +1 1 0 +create or replace view v1 as select NOT 2 != 3, NOT (2 != 3), (NOT 2) != 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 = 3 AS `NOT 2 != 3`,2 = 3 AS `NOT (2 != 3)`,!2 <> 3 AS `(NOT 2) != 3` +select NOT 2 != 3, NOT (2 != 3), (NOT 2) != 3 union select * from v1; +NOT 2 != 3 NOT (2 != 3) (NOT 2) != 3 +0 0 1 +create or replace view v1 as select NOT 2 LIKE 3, NOT (2 LIKE 3), (NOT 2) LIKE 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 not like 3 AS `NOT 2 LIKE 3`,2 not like 3 AS `NOT (2 LIKE 3)`,!2 like 3 AS `(NOT 2) LIKE 3` +select NOT 2 LIKE 3, NOT (2 LIKE 3), (NOT 2) LIKE 3 union select * from v1; +NOT 2 LIKE 3 NOT (2 LIKE 3) (NOT 2) LIKE 3 +1 1 0 +create or replace view v1 as select NOT 2 REGEXP 3, NOT (2 REGEXP 3), (NOT 2) REGEXP 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select !(2 regexp 3) AS `NOT 2 REGEXP 3`,!(2 regexp 3) AS `NOT (2 REGEXP 3)`,!2 regexp 3 AS `(NOT 2) REGEXP 3` +select NOT 2 REGEXP 3, NOT (2 REGEXP 3), (NOT 2) REGEXP 3 union select * from v1; +NOT 2 REGEXP 3 NOT (2 REGEXP 3) (NOT 2) REGEXP 3 +1 1 0 +create or replace view v1 as select NOT 2 | 3, NOT (2 | 3), (NOT 2) | 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select !(2 | 3) AS `NOT 2 | 3`,!(2 | 3) AS `NOT (2 | 3)`,!2 | 3 AS `(NOT 2) | 3` +select NOT 2 | 3, NOT (2 | 3), (NOT 2) | 3 union select * from v1; +NOT 2 | 3 NOT (2 | 3) (NOT 2) | 3 +0 0 3 +create or replace view v1 as select NOT 0 & 2, NOT (0 & 2), (NOT 0) & 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select !(0 & 2) AS `NOT 0 & 2`,!(0 & 2) AS `NOT (0 & 2)`,!0 & 2 AS `(NOT 0) & 2` +select NOT 0 & 2, NOT (0 & 2), (NOT 0) & 2 union select * from v1; +NOT 0 & 2 NOT (0 & 2) (NOT 0) & 2 +1 1 0 +create or replace view v1 as select NOT 0 << 3, NOT (0 << 3), (NOT 0) << 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select !(0 << 3) AS `NOT 0 << 3`,!(0 << 3) AS `NOT (0 << 3)`,!0 << 3 AS `(NOT 0) << 3` +select NOT 0 << 3, NOT (0 << 3), (NOT 0) << 3 union select * from v1; +NOT 0 << 3 NOT (0 << 3) (NOT 0) << 3 +1 1 8 +create or replace view v1 as select NOT 2 >> 3, NOT (2 >> 3), (NOT 2) >> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select !(2 >> 3) AS `NOT 2 >> 3`,!(2 >> 3) AS `NOT (2 >> 3)`,!2 >> 3 AS `(NOT 2) >> 3` +select NOT 2 >> 3, NOT (2 >> 3), (NOT 2) >> 3 union select * from v1; +NOT 2 >> 3 NOT (2 >> 3) (NOT 2) >> 3 +1 1 0 +create or replace view v1 as select NOT '2000-01-01' +INTERVAL 1 DAY, NOT ('2000-01-01' +INTERVAL 1 DAY), (NOT '2000-01-01') +INTERVAL 1 DAY; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select !('2000-01-01' + interval 1 day) AS `NOT '2000-01-01' +INTERVAL 1 DAY`,!('2000-01-01' + interval 1 day) AS `NOT ('2000-01-01' +INTERVAL 1 DAY)`,!'2000-01-01' + interval 1 day AS `(NOT '2000-01-01') +INTERVAL 1 DAY` +select NOT '2000-01-01' +INTERVAL 1 DAY, NOT ('2000-01-01' +INTERVAL 1 DAY), (NOT '2000-01-01') +INTERVAL 1 DAY union select * from v1; +NOT '2000-01-01' +INTERVAL 1 DAY NOT ('2000-01-01' +INTERVAL 1 DAY) (NOT '2000-01-01') +INTERVAL 1 DAY +0 0 NULL +create or replace view v1 as select NOT 2 + 3, NOT (2 + 3), (NOT 2) + 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select !(2 + 3) AS `NOT 2 + 3`,!(2 + 3) AS `NOT (2 + 3)`,!2 + 3 AS `(NOT 2) + 3` +select NOT 2 + 3, NOT (2 + 3), (NOT 2) + 3 union select * from v1; +NOT 2 + 3 NOT (2 + 3) (NOT 2) + 3 +0 0 3 +create or replace view v1 as select NOT 2 - 3, NOT (2 - 3), (NOT 2) - 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select !(2 - 3) AS `NOT 2 - 3`,!(2 - 3) AS `NOT (2 - 3)`,!2 - 3 AS `(NOT 2) - 3` +select NOT 2 - 3, NOT (2 - 3), (NOT 2) - 3 union select * from v1; +NOT 2 - 3 NOT (2 - 3) (NOT 2) - 3 +0 0 -3 +create or replace view v1 as select NOT 0 * 3, NOT (0 * 3), (NOT 0) * 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select !(0 * 3) AS `NOT 0 * 3`,!(0 * 3) AS `NOT (0 * 3)`,!0 * 3 AS `(NOT 0) * 3` +select NOT 0 * 3, NOT (0 * 3), (NOT 0) * 3 union select * from v1; +NOT 0 * 3 NOT (0 * 3) (NOT 0) * 3 +1 1 3 +create or replace view v1 as select NOT 0 / 3, NOT (0 / 3), (NOT 0) / 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select !(0 / 3) AS `NOT 0 / 3`,!(0 / 3) AS `NOT (0 / 3)`,!0 / 3 AS `(NOT 0) / 3` +select NOT 0 / 3, NOT (0 / 3), (NOT 0) / 3 union select * from v1; +NOT 0 / 3 NOT (0 / 3) (NOT 0) / 3 +1 1 0.3333 +create or replace view v1 as select NOT 2 DIV 3, NOT (2 DIV 3), (NOT 2) DIV 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select !(2 DIV 3) AS `NOT 2 DIV 3`,!(2 DIV 3) AS `NOT (2 DIV 3)`,!2 DIV 3 AS `(NOT 2) DIV 3` +select NOT 2 DIV 3, NOT (2 DIV 3), (NOT 2) DIV 3 union select * from v1; +NOT 2 DIV 3 NOT (2 DIV 3) (NOT 2) DIV 3 +1 1 0 +create or replace view v1 as select NOT 6 MOD 3, NOT (6 MOD 3), (NOT 6) MOD 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select !(6 MOD 3) AS `NOT 6 MOD 3`,!(6 MOD 3) AS `NOT (6 MOD 3)`,!6 MOD 3 AS `(NOT 6) MOD 3` +select NOT 6 MOD 3, NOT (6 MOD 3), (NOT 6) MOD 3 union select * from v1; +NOT 6 MOD 3 NOT (6 MOD 3) (NOT 6) MOD 3 +1 1 0 +create or replace view v1 as select NOT 6 % 3, NOT (6 % 3), (NOT 6) % 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select !(6 MOD 3) AS `NOT 6 % 3`,!(6 MOD 3) AS `NOT (6 % 3)`,!6 MOD 3 AS `(NOT 6) % 3` +select NOT 6 % 3, NOT (6 % 3), (NOT 6) % 3 union select * from v1; +NOT 6 % 3 NOT (6 % 3) (NOT 6) % 3 +1 1 0 +create or replace view v1 as select NOT 2 ^ 3, NOT (2 ^ 3), (NOT 2) ^ 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select !(2 ^ 3) AS `NOT 2 ^ 3`,!(2 ^ 3) AS `NOT (2 ^ 3)`,!2 ^ 3 AS `(NOT 2) ^ 3` +select NOT 2 ^ 3, NOT (2 ^ 3), (NOT 2) ^ 3 union select * from v1; +NOT 2 ^ 3 NOT (2 ^ 3) (NOT 2) ^ 3 +0 0 3 +create or replace view v1 as select NOT 2 BETWEEN 3 AND 4, NOT (2 BETWEEN 3 AND 4), (NOT 2) BETWEEN 3 AND 4; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 not between 3 and 4 AS `NOT 2 BETWEEN 3 AND 4`,2 not between 3 and 4 AS `NOT (2 BETWEEN 3 AND 4)`,!2 between 3 and 4 AS `(NOT 2) BETWEEN 3 AND 4` +select NOT 2 BETWEEN 3 AND 4, NOT (2 BETWEEN 3 AND 4), (NOT 2) BETWEEN 3 AND 4 union select * from v1; +NOT 2 BETWEEN 3 AND 4 NOT (2 BETWEEN 3 AND 4) (NOT 2) BETWEEN 3 AND 4 +1 1 0 +create or replace view v1 as select - 2 IS TRUE, - (2 IS TRUE), (- 2) IS TRUE; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select -2 is true AS `- 2 IS TRUE`,-(2 is true) AS `- (2 IS TRUE)`,-2 is true AS `(- 2) IS TRUE` +select - 2 IS TRUE, - (2 IS TRUE), (- 2) IS TRUE union select * from v1; +- 2 IS TRUE - (2 IS TRUE) (- 2) IS TRUE +1 -1 1 +create or replace view v1 as select charset(- "2" COLLATE latin1_bin), charset(- ("2" COLLATE latin1_bin)), charset((- "2") COLLATE latin1_bin); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select charset(-'2' collate latin1_bin) AS `charset(- "2" COLLATE latin1_bin)`,charset(-'2' collate latin1_bin) AS `charset(- ("2" COLLATE latin1_bin))`,charset((-'2') collate latin1_bin) AS `charset((- "2") COLLATE latin1_bin)` +select charset(- "2" COLLATE latin1_bin), charset(- ("2" COLLATE latin1_bin)), charset((- "2") COLLATE latin1_bin) union select * from v1; +charset(- "2" COLLATE latin1_bin) charset(- ("2" COLLATE latin1_bin)) charset((- "2") COLLATE latin1_bin) +binary binary latin1 +create or replace view v1 as select - 2 IN (2,1), - (2 IN (2,1)), (- 2) IN (2,1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select -2 in (2,1) AS `- 2 IN (2,1)`,-(2 in (2,1)) AS `- (2 IN (2,1))`,-2 in (2,1) AS `(- 2) IN (2,1)` +select - 2 IN (2,1), - (2 IN (2,1)), (- 2) IN (2,1) union select * from v1; +- 2 IN (2,1) - (2 IN (2,1)) (- 2) IN (2,1) +0 -1 0 +create or replace view v1 as select - 2 OR 3, - (2 OR 3), (- 2) OR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select -2 or 3 AS `- 2 OR 3`,-(2 or 3) AS `- (2 OR 3)`,-2 or 3 AS `(- 2) OR 3` +select - 2 OR 3, - (2 OR 3), (- 2) OR 3 union select * from v1; +- 2 OR 3 - (2 OR 3) (- 2) OR 3 +1 -1 1 +create or replace view v1 as select - 2 || 3, - (2 || 3), (- 2) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select -2 or 3 AS `- 2 || 3`,-(2 or 3) AS `- (2 || 3)`,-2 or 3 AS `(- 2) || 3` +select - 2 || 3, - (2 || 3), (- 2) || 3 union select * from v1; +- 2 || 3 - (2 || 3) (- 2) || 3 +1 -1 1 +create or replace view v1 as select - 0 XOR 3, - (0 XOR 3), (- 0) XOR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 0 xor 3 AS `- 0 XOR 3`,-(0 xor 3) AS `- (0 XOR 3)`,0 xor 3 AS `(- 0) XOR 3` +select - 0 XOR 3, - (0 XOR 3), (- 0) XOR 3 union select * from v1; +- 0 XOR 3 - (0 XOR 3) (- 0) XOR 3 +1 -1 1 +create or replace view v1 as select - 2 AND 3, - (2 AND 3), (- 2) AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select -2 and 3 AS `- 2 AND 3`,-(2 and 3) AS `- (2 AND 3)`,-2 and 3 AS `(- 2) AND 3` +select - 2 AND 3, - (2 AND 3), (- 2) AND 3 union select * from v1; +- 2 AND 3 - (2 AND 3) (- 2) AND 3 +1 -1 1 +create or replace view v1 as select - 2 && 3, - (2 && 3), (- 2) && 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select -2 and 3 AS `- 2 && 3`,-(2 and 3) AS `- (2 && 3)`,-2 and 3 AS `(- 2) && 3` +select - 2 && 3, - (2 && 3), (- 2) && 3 union select * from v1; +- 2 && 3 - (2 && 3) (- 2) && 3 +1 -1 1 +create or replace view v1 as select - 2 = 2, - (2 = 2), (- 2) = 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select -2 = 2 AS `- 2 = 2`,-(2 = 2) AS `- (2 = 2)`,-2 = 2 AS `(- 2) = 2` +select - 2 = 2, - (2 = 2), (- 2) = 2 union select * from v1; +- 2 = 2 - (2 = 2) (- 2) = 2 +0 -1 0 +create or replace view v1 as select - 2 <=> 2, - (2 <=> 2), (- 2) <=> 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select -2 <=> 2 AS `- 2 <=> 2`,-(2 <=> 2) AS `- (2 <=> 2)`,-2 <=> 2 AS `(- 2) <=> 2` +select - 2 <=> 2, - (2 <=> 2), (- 2) <=> 2 union select * from v1; +- 2 <=> 2 - (2 <=> 2) (- 2) <=> 2 +0 -1 0 +create or replace view v1 as select - 2 >= 1, - (2 >= 1), (- 2) >= 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select -2 >= 1 AS `- 2 >= 1`,-(2 >= 1) AS `- (2 >= 1)`,-2 >= 1 AS `(- 2) >= 1` +select - 2 >= 1, - (2 >= 1), (- 2) >= 1 union select * from v1; +- 2 >= 1 - (2 >= 1) (- 2) >= 1 +0 -1 0 +create or replace view v1 as select - 2 <= 3, - (2 <= 3), (- 2) <= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select -2 <= 3 AS `- 2 <= 3`,-(2 <= 3) AS `- (2 <= 3)`,-2 <= 3 AS `(- 2) <= 3` +select - 2 <= 3, - (2 <= 3), (- 2) <= 3 union select * from v1; +- 2 <= 3 - (2 <= 3) (- 2) <= 3 +1 -1 1 +create or replace view v1 as select - 2 < 3, - (2 < 3), (- 2) < 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select -2 < 3 AS `- 2 < 3`,-(2 < 3) AS `- (2 < 3)`,-2 < 3 AS `(- 2) < 3` +select - 2 < 3, - (2 < 3), (- 2) < 3 union select * from v1; +- 2 < 3 - (2 < 3) (- 2) < 3 +1 -1 1 +create or replace view v1 as select - 2 <> 3, - (2 <> 3), (- 2) <> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select -2 <> 3 AS `- 2 <> 3`,-(2 <> 3) AS `- (2 <> 3)`,-2 <> 3 AS `(- 2) <> 3` +select - 2 <> 3, - (2 <> 3), (- 2) <> 3 union select * from v1; +- 2 <> 3 - (2 <> 3) (- 2) <> 3 +1 -1 1 +create or replace view v1 as select - 2 > 1, - (2 > 1), (- 2) > 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select -2 > 1 AS `- 2 > 1`,-(2 > 1) AS `- (2 > 1)`,-2 > 1 AS `(- 2) > 1` +select - 2 > 1, - (2 > 1), (- 2) > 1 union select * from v1; +- 2 > 1 - (2 > 1) (- 2) > 1 +0 -1 0 +create or replace view v1 as select - 2 != 3, - (2 != 3), (- 2) != 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select -2 <> 3 AS `- 2 != 3`,-(2 <> 3) AS `- (2 != 3)`,-2 <> 3 AS `(- 2) != 3` +select - 2 != 3, - (2 != 3), (- 2) != 3 union select * from v1; +- 2 != 3 - (2 != 3) (- 2) != 3 +1 -1 1 +create or replace view v1 as select - 2 LIKE 2, - (2 LIKE 2), (- 2) LIKE 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select -2 like 2 AS `- 2 LIKE 2`,-(2 like 2) AS `- (2 LIKE 2)`,-2 like 2 AS `(- 2) LIKE 2` +select - 2 LIKE 2, - (2 LIKE 2), (- 2) LIKE 2 union select * from v1; +- 2 LIKE 2 - (2 LIKE 2) (- 2) LIKE 2 +0 -1 0 +create or replace view v1 as select - 2 REGEXP 2, - (2 REGEXP 2), (- 2) REGEXP 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select -2 regexp 2 AS `- 2 REGEXP 2`,-(2 regexp 2) AS `- (2 REGEXP 2)`,-2 regexp 2 AS `(- 2) REGEXP 2` +select - 2 REGEXP 2, - (2 REGEXP 2), (- 2) REGEXP 2 union select * from v1; +- 2 REGEXP 2 - (2 REGEXP 2) (- 2) REGEXP 2 +1 -1 1 +create or replace view v1 as select - 2 | 3, - (2 | 3), (- 2) | 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select -2 | 3 AS `- 2 | 3`,-(2 | 3) AS `- (2 | 3)`,-2 | 3 AS `(- 2) | 3` +select - 2 | 3, - (2 | 3), (- 2) | 3 union select * from v1; +- 2 | 3 - (2 | 3) (- 2) | 3 +18446744073709551615 -3 18446744073709551615 +create or replace view v1 as select - 2 & 3, - (2 & 3), (- 2) & 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select -2 & 3 AS `- 2 & 3`,-(2 & 3) AS `- (2 & 3)`,-2 & 3 AS `(- 2) & 3` +select - 2 & 3, - (2 & 3), (- 2) & 3 union select * from v1; +- 2 & 3 - (2 & 3) (- 2) & 3 +2 -2 2 +create or replace view v1 as select - 2 << 3, - (2 << 3), (- 2) << 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select -2 << 3 AS `- 2 << 3`,-(2 << 3) AS `- (2 << 3)`,-2 << 3 AS `(- 2) << 3` +select - 2 << 3, - (2 << 3), (- 2) << 3 union select * from v1; +- 2 << 3 - (2 << 3) (- 2) << 3 +18446744073709551600 -16 18446744073709551600 +create or replace view v1 as select - 2 >> 3, - (2 >> 3), (- 2) >> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select -2 >> 3 AS `- 2 >> 3`,-(2 >> 3) AS `- (2 >> 3)`,-2 >> 3 AS `(- 2) >> 3` +select - 2 >> 3, - (2 >> 3), (- 2) >> 3 union select * from v1; +- 2 >> 3 - (2 >> 3) (- 2) >> 3 +2305843009213693951 0 2305843009213693951 +create or replace view v1 as select - '2000-01-01' +INTERVAL 1 DAY, - ('2000-01-01' +INTERVAL 1 DAY), (- '2000-01-01') +INTERVAL 1 DAY; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select -'2000-01-01' + interval 1 day AS `- '2000-01-01' +INTERVAL 1 DAY`,-('2000-01-01' + interval 1 day) AS `- ('2000-01-01' +INTERVAL 1 DAY)`,-'2000-01-01' + interval 1 day AS `(- '2000-01-01') +INTERVAL 1 DAY` +select - '2000-01-01' +INTERVAL 1 DAY, - ('2000-01-01' +INTERVAL 1 DAY), (- '2000-01-01') +INTERVAL 1 DAY union select * from v1; +- '2000-01-01' +INTERVAL 1 DAY - ('2000-01-01' +INTERVAL 1 DAY) (- '2000-01-01') +INTERVAL 1 DAY +NULL -20000102 NULL +create or replace view v1 as select - 2 + 3, - (2 + 3), (- 2) + 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select -2 + 3 AS `- 2 + 3`,-(2 + 3) AS `- (2 + 3)`,-2 + 3 AS `(- 2) + 3` +select - 2 + 3, - (2 + 3), (- 2) + 3 union select * from v1; +- 2 + 3 - (2 + 3) (- 2) + 3 +1 -5 1 +create or replace view v1 as select - 2 - 3, - (2 - 3), (- 2) - 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select -2 - 3 AS `- 2 - 3`,-(2 - 3) AS `- (2 - 3)`,-2 - 3 AS `(- 2) - 3` +select - 2 - 3, - (2 - 3), (- 2) - 3 union select * from v1; +- 2 - 3 - (2 - 3) (- 2) - 3 +-5 1 -5 +create or replace view v1 as select - 2 ^ 3, - (2 ^ 3), (- 2) ^ 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select -2 ^ 3 AS `- 2 ^ 3`,-(2 ^ 3) AS `- (2 ^ 3)`,-2 ^ 3 AS `(- 2) ^ 3` +select - 2 ^ 3, - (2 ^ 3), (- 2) ^ 3 union select * from v1; +- 2 ^ 3 - (2 ^ 3) (- 2) ^ 3 +18446744073709551613 -1 18446744073709551613 +create or replace view v1 as select - 2 BETWEEN 1 AND 3, - (2 BETWEEN 1 AND 3), (- 2) BETWEEN 1 AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select -2 between 1 and 3 AS `- 2 BETWEEN 1 AND 3`,-(2 between 1 and 3) AS `- (2 BETWEEN 1 AND 3)`,-2 between 1 and 3 AS `(- 2) BETWEEN 1 AND 3` +select - 2 BETWEEN 1 AND 3, - (2 BETWEEN 1 AND 3), (- 2) BETWEEN 1 AND 3 union select * from v1; +- 2 BETWEEN 1 AND 3 - (2 BETWEEN 1 AND 3) (- 2) BETWEEN 1 AND 3 +0 -1 0 +create or replace view v1 as select ~ 2 IS TRUE, ~ (2 IS TRUE), (~ 2) IS TRUE; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select ~2 is true AS `~ 2 IS TRUE`,~(2 is true) AS `~ (2 IS TRUE)`,~2 is true AS `(~ 2) IS TRUE` +select ~ 2 IS TRUE, ~ (2 IS TRUE), (~ 2) IS TRUE union select * from v1; +~ 2 IS TRUE ~ (2 IS TRUE) (~ 2) IS TRUE +1 18446744073709551614 1 +create or replace view v1 as select charset(~ 2 COLLATE latin1_bin), charset(~ (2 COLLATE latin1_bin)), charset((~ 2) COLLATE latin1_bin); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select charset(~2 collate latin1_bin) AS `charset(~ 2 COLLATE latin1_bin)`,charset(~2 collate latin1_bin) AS `charset(~ (2 COLLATE latin1_bin))`,charset((~2) collate latin1_bin) AS `charset((~ 2) COLLATE latin1_bin)` +select charset(~ 2 COLLATE latin1_bin), charset(~ (2 COLLATE latin1_bin)), charset((~ 2) COLLATE latin1_bin) union select * from v1; +charset(~ 2 COLLATE latin1_bin) charset(~ (2 COLLATE latin1_bin)) charset((~ 2) COLLATE latin1_bin) +binary binary latin1 +create or replace view v1 as select ~ 2 IN (0,1), ~ (2 IN (0,1)), (~ 2) IN (0,1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select ~2 in (0,1) AS `~ 2 IN (0,1)`,~(2 in (0,1)) AS `~ (2 IN (0,1))`,~2 in (0,1) AS `(~ 2) IN (0,1)` +select ~ 2 IN (0,1), ~ (2 IN (0,1)), (~ 2) IN (0,1) union select * from v1; +~ 2 IN (0,1) ~ (2 IN (0,1)) (~ 2) IN (0,1) +0 18446744073709551615 0 +create or replace view v1 as select ~ 2 OR 3, ~ (2 OR 3), (~ 2) OR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select ~2 or 3 AS `~ 2 OR 3`,~(2 or 3) AS `~ (2 OR 3)`,~2 or 3 AS `(~ 2) OR 3` +select ~ 2 OR 3, ~ (2 OR 3), (~ 2) OR 3 union select * from v1; +~ 2 OR 3 ~ (2 OR 3) (~ 2) OR 3 +1 18446744073709551614 1 +create or replace view v1 as select ~ 2 || 3, ~ (2 || 3), (~ 2) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select ~2 or 3 AS `~ 2 || 3`,~(2 or 3) AS `~ (2 || 3)`,~2 or 3 AS `(~ 2) || 3` +select ~ 2 || 3, ~ (2 || 3), (~ 2) || 3 union select * from v1; +~ 2 || 3 ~ (2 || 3) (~ 2) || 3 +1 18446744073709551614 1 +create or replace view v1 as select ~ 2 XOR 3, ~ (2 XOR 3), (~ 2) XOR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select ~2 xor 3 AS `~ 2 XOR 3`,~(2 xor 3) AS `~ (2 XOR 3)`,~2 xor 3 AS `(~ 2) XOR 3` +select ~ 2 XOR 3, ~ (2 XOR 3), (~ 2) XOR 3 union select * from v1; +~ 2 XOR 3 ~ (2 XOR 3) (~ 2) XOR 3 +0 18446744073709551615 0 +create or replace view v1 as select ~ 2 AND 3, ~ (2 AND 3), (~ 2) AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select ~2 and 3 AS `~ 2 AND 3`,~(2 and 3) AS `~ (2 AND 3)`,~2 and 3 AS `(~ 2) AND 3` +select ~ 2 AND 3, ~ (2 AND 3), (~ 2) AND 3 union select * from v1; +~ 2 AND 3 ~ (2 AND 3) (~ 2) AND 3 +1 18446744073709551614 1 +create or replace view v1 as select ~ 2 && 3, ~ (2 && 3), (~ 2) && 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select ~2 and 3 AS `~ 2 && 3`,~(2 and 3) AS `~ (2 && 3)`,~2 and 3 AS `(~ 2) && 3` +select ~ 2 && 3, ~ (2 && 3), (~ 2) && 3 union select * from v1; +~ 2 && 3 ~ (2 && 3) (~ 2) && 3 +1 18446744073709551614 1 +create or replace view v1 as select ~ 2 = 3, ~ (2 = 3), (~ 2) = 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select ~2 = 3 AS `~ 2 = 3`,~(2 = 3) AS `~ (2 = 3)`,~2 = 3 AS `(~ 2) = 3` +select ~ 2 = 3, ~ (2 = 3), (~ 2) = 3 union select * from v1; +~ 2 = 3 ~ (2 = 3) (~ 2) = 3 +0 18446744073709551615 0 +create or replace view v1 as select ~ 2 <=> 3, ~ (2 <=> 3), (~ 2) <=> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select ~2 <=> 3 AS `~ 2 <=> 3`,~(2 <=> 3) AS `~ (2 <=> 3)`,~2 <=> 3 AS `(~ 2) <=> 3` +select ~ 2 <=> 3, ~ (2 <=> 3), (~ 2) <=> 3 union select * from v1; +~ 2 <=> 3 ~ (2 <=> 3) (~ 2) <=> 3 +0 18446744073709551615 0 +create or replace view v1 as select ~ 2 >= 3, ~ (2 >= 3), (~ 2) >= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select ~2 >= 3 AS `~ 2 >= 3`,~(2 >= 3) AS `~ (2 >= 3)`,~2 >= 3 AS `(~ 2) >= 3` +select ~ 2 >= 3, ~ (2 >= 3), (~ 2) >= 3 union select * from v1; +~ 2 >= 3 ~ (2 >= 3) (~ 2) >= 3 +1 18446744073709551615 1 +create or replace view v1 as select ~ 2 <= 3, ~ (2 <= 3), (~ 2) <= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select ~2 <= 3 AS `~ 2 <= 3`,~(2 <= 3) AS `~ (2 <= 3)`,~2 <= 3 AS `(~ 2) <= 3` +select ~ 2 <= 3, ~ (2 <= 3), (~ 2) <= 3 union select * from v1; +~ 2 <= 3 ~ (2 <= 3) (~ 2) <= 3 +0 18446744073709551614 0 +create or replace view v1 as select ~ 2 < 3, ~ (2 < 3), (~ 2) < 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select ~2 < 3 AS `~ 2 < 3`,~(2 < 3) AS `~ (2 < 3)`,~2 < 3 AS `(~ 2) < 3` +select ~ 2 < 3, ~ (2 < 3), (~ 2) < 3 union select * from v1; +~ 2 < 3 ~ (2 < 3) (~ 2) < 3 +0 18446744073709551614 0 +create or replace view v1 as select ~ 2 <> 3, ~ (2 <> 3), (~ 2) <> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select ~2 <> 3 AS `~ 2 <> 3`,~(2 <> 3) AS `~ (2 <> 3)`,~2 <> 3 AS `(~ 2) <> 3` +select ~ 2 <> 3, ~ (2 <> 3), (~ 2) <> 3 union select * from v1; +~ 2 <> 3 ~ (2 <> 3) (~ 2) <> 3 +1 18446744073709551614 1 +create or replace view v1 as select ~ 2 > 3, ~ (2 > 3), (~ 2) > 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select ~2 > 3 AS `~ 2 > 3`,~(2 > 3) AS `~ (2 > 3)`,~2 > 3 AS `(~ 2) > 3` +select ~ 2 > 3, ~ (2 > 3), (~ 2) > 3 union select * from v1; +~ 2 > 3 ~ (2 > 3) (~ 2) > 3 +1 18446744073709551615 1 +create or replace view v1 as select ~ 2 != 3, ~ (2 != 3), (~ 2) != 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select ~2 <> 3 AS `~ 2 != 3`,~(2 <> 3) AS `~ (2 != 3)`,~2 <> 3 AS `(~ 2) != 3` +select ~ 2 != 3, ~ (2 != 3), (~ 2) != 3 union select * from v1; +~ 2 != 3 ~ (2 != 3) (~ 2) != 3 +1 18446744073709551614 1 +create or replace view v1 as select ~ 2 LIKE 3, ~ (2 LIKE 3), (~ 2) LIKE 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select ~2 like 3 AS `~ 2 LIKE 3`,~(2 like 3) AS `~ (2 LIKE 3)`,~2 like 3 AS `(~ 2) LIKE 3` +select ~ 2 LIKE 3, ~ (2 LIKE 3), (~ 2) LIKE 3 union select * from v1; +~ 2 LIKE 3 ~ (2 LIKE 3) (~ 2) LIKE 3 +0 18446744073709551615 0 +create or replace view v1 as select ~ 2 REGEXP 3, ~ (2 REGEXP 3), (~ 2) REGEXP 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select ~2 regexp 3 AS `~ 2 REGEXP 3`,~(2 regexp 3) AS `~ (2 REGEXP 3)`,~2 regexp 3 AS `(~ 2) REGEXP 3` +select ~ 2 REGEXP 3, ~ (2 REGEXP 3), (~ 2) REGEXP 3 union select * from v1; +~ 2 REGEXP 3 ~ (2 REGEXP 3) (~ 2) REGEXP 3 +1 18446744073709551615 1 +create or replace view v1 as select ~ 2 | 3, ~ (2 | 3), (~ 2) | 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select ~2 | 3 AS `~ 2 | 3`,~(2 | 3) AS `~ (2 | 3)`,~2 | 3 AS `(~ 2) | 3` +select ~ 2 | 3, ~ (2 | 3), (~ 2) | 3 union select * from v1; +~ 2 | 3 ~ (2 | 3) (~ 2) | 3 +18446744073709551615 18446744073709551612 18446744073709551615 +create or replace view v1 as select ~ 2 & 3, ~ (2 & 3), (~ 2) & 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select ~2 & 3 AS `~ 2 & 3`,~(2 & 3) AS `~ (2 & 3)`,~2 & 3 AS `(~ 2) & 3` +select ~ 2 & 3, ~ (2 & 3), (~ 2) & 3 union select * from v1; +~ 2 & 3 ~ (2 & 3) (~ 2) & 3 +1 18446744073709551613 1 +create or replace view v1 as select ~ 2 << 3, ~ (2 << 3), (~ 2) << 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select ~2 << 3 AS `~ 2 << 3`,~(2 << 3) AS `~ (2 << 3)`,~2 << 3 AS `(~ 2) << 3` +select ~ 2 << 3, ~ (2 << 3), (~ 2) << 3 union select * from v1; +~ 2 << 3 ~ (2 << 3) (~ 2) << 3 +18446744073709551592 18446744073709551599 18446744073709551592 +create or replace view v1 as select ~ 2 >> 3, ~ (2 >> 3), (~ 2) >> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select ~2 >> 3 AS `~ 2 >> 3`,~(2 >> 3) AS `~ (2 >> 3)`,~2 >> 3 AS `(~ 2) >> 3` +select ~ 2 >> 3, ~ (2 >> 3), (~ 2) >> 3 union select * from v1; +~ 2 >> 3 ~ (2 >> 3) (~ 2) >> 3 +2305843009213693951 18446744073709551615 2305843009213693951 +create or replace view v1 as select ~ '2000-01-01' +INTERVAL 1 DAY, ~ ('2000-01-01' +INTERVAL 1 DAY), (~ '2000-01-01') +INTERVAL 1 DAY; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select ~'2000-01-01' + interval 1 day AS `~ '2000-01-01' +INTERVAL 1 DAY`,~('2000-01-01' + interval 1 day) AS `~ ('2000-01-01' +INTERVAL 1 DAY)`,~'2000-01-01' + interval 1 day AS `(~ '2000-01-01') +INTERVAL 1 DAY` +select ~ '2000-01-01' +INTERVAL 1 DAY, ~ ('2000-01-01' +INTERVAL 1 DAY), (~ '2000-01-01') +INTERVAL 1 DAY union select * from v1; +~ '2000-01-01' +INTERVAL 1 DAY ~ ('2000-01-01' +INTERVAL 1 DAY) (~ '2000-01-01') +INTERVAL 1 DAY +NULL 18446744073689551513 NULL +create or replace view v1 as select ~ 10000 + 3, ~ (10000 + 3), (~ 10000) + 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select ~10000 + 3 AS `~ 10000 + 3`,~(10000 + 3) AS `~ (10000 + 3)`,~10000 + 3 AS `(~ 10000) + 3` +select ~ 10000 + 3, ~ (10000 + 3), (~ 10000) + 3 union select * from v1; +~ 10000 + 3 ~ (10000 + 3) (~ 10000) + 3 +18446744073709541618 18446744073709541612 18446744073709541618 +create or replace view v1 as select ~ 2 - 3, ~ (2 - 3), (~ 2) - 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select ~2 - 3 AS `~ 2 - 3`,~(2 - 3) AS `~ (2 - 3)`,~2 - 3 AS `(~ 2) - 3` +select ~ 2 - 3, ~ (2 - 3), (~ 2) - 3 union select * from v1; +~ 2 - 3 ~ (2 - 3) (~ 2) - 3 +18446744073709551610 0 18446744073709551610 +create or replace view v1 as select ~ 10000000000000000000 * 2, ~ (100 * 2), (~ 10000000000000000000) * 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select ~10000000000000000000 * 2 AS `~ 10000000000000000000 * 2`,~(100 * 2) AS `~ (100 * 2)`,~10000000000000000000 * 2 AS `(~ 10000000000000000000) * 2` +select ~ 10000000000000000000 * 2, ~ (100 * 2), (~ 10000000000000000000) * 2 union select * from v1; +~ 10000000000000000000 * 2 ~ (100 * 2) (~ 10000000000000000000) * 2 +16893488147419103230 18446744073709551415 16893488147419103230 +create or replace view v1 as select ~ 2 / 3, ~ (2 / 3), (~ 2) / 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select ~2 / 3 AS `~ 2 / 3`,~(2 / 3) AS `~ (2 / 3)`,~2 / 3 AS `(~ 2) / 3` +select ~ 2 / 3, ~ (2 / 3), (~ 2) / 3 union select * from v1; +~ 2 / 3 ~ (2 / 3) (~ 2) / 3 +6148914691236517204.3333 18446744073709551614 6148914691236517204.3333 +create or replace view v1 as select ~ 2 DIV 3, ~ (2 DIV 3), (~ 2) DIV 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select ~2 DIV 3 AS `~ 2 DIV 3`,~(2 DIV 3) AS `~ (2 DIV 3)`,~2 DIV 3 AS `(~ 2) DIV 3` +select ~ 2 DIV 3, ~ (2 DIV 3), (~ 2) DIV 3 union select * from v1; +~ 2 DIV 3 ~ (2 DIV 3) (~ 2) DIV 3 +6148914691236517204 18446744073709551615 6148914691236517204 +create or replace view v1 as select ~ 2 MOD 3, ~ (2 MOD 3), (~ 2) MOD 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select ~2 MOD 3 AS `~ 2 MOD 3`,~(2 MOD 3) AS `~ (2 MOD 3)`,~2 MOD 3 AS `(~ 2) MOD 3` +select ~ 2 MOD 3, ~ (2 MOD 3), (~ 2) MOD 3 union select * from v1; +~ 2 MOD 3 ~ (2 MOD 3) (~ 2) MOD 3 +1 18446744073709551613 1 +create or replace view v1 as select ~ 2 % 3, ~ (2 % 3), (~ 2) % 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select ~2 MOD 3 AS `~ 2 % 3`,~(2 MOD 3) AS `~ (2 % 3)`,~2 MOD 3 AS `(~ 2) % 3` +select ~ 2 % 3, ~ (2 % 3), (~ 2) % 3 union select * from v1; +~ 2 % 3 ~ (2 % 3) (~ 2) % 3 +1 18446744073709551613 1 +create or replace view v1 as select ~ 2 BETWEEN 1 AND 3, ~ (2 BETWEEN 1 AND 3), (~ 2) BETWEEN 1 AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select ~2 between 1 and 3 AS `~ 2 BETWEEN 1 AND 3`,~(2 between 1 and 3) AS `~ (2 BETWEEN 1 AND 3)`,~2 between 1 and 3 AS `(~ 2) BETWEEN 1 AND 3` +select ~ 2 BETWEEN 1 AND 3, ~ (2 BETWEEN 1 AND 3), (~ 2) BETWEEN 1 AND 3 union select * from v1; +~ 2 BETWEEN 1 AND 3 ~ (2 BETWEEN 1 AND 3) (~ 2) BETWEEN 1 AND 3 +0 18446744073709551614 0 +create or replace view v1 as select charset(! 2 COLLATE latin1_bin), charset(! (2 COLLATE latin1_bin)), charset((! 2) COLLATE latin1_bin); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select charset(!2 collate latin1_bin) AS `charset(! 2 COLLATE latin1_bin)`,charset(!2 collate latin1_bin) AS `charset(! (2 COLLATE latin1_bin))`,charset((!2) collate latin1_bin) AS `charset((! 2) COLLATE latin1_bin)` +select charset(! 2 COLLATE latin1_bin), charset(! (2 COLLATE latin1_bin)), charset((! 2) COLLATE latin1_bin) union select * from v1; +charset(! 2 COLLATE latin1_bin) charset(! (2 COLLATE latin1_bin)) charset((! 2) COLLATE latin1_bin) +binary binary latin1 +create or replace view v1 as select ! 2 IN (0,2), ! (2 IN (0,2)), (! 2) IN (0,2); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select !2 in (0,2) AS `! 2 IN (0,2)`,2 not in (0,2) AS `! (2 IN (0,2))`,!2 in (0,2) AS `(! 2) IN (0,2)` +select ! 2 IN (0,2), ! (2 IN (0,2)), (! 2) IN (0,2) union select * from v1; +! 2 IN (0,2) ! (2 IN (0,2)) (! 2) IN (0,2) +1 0 1 +create or replace view v1 as select ! 2 OR 3, ! (2 OR 3), (! 2) OR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select !2 or 3 AS `! 2 OR 3`,!2 and !3 AS `! (2 OR 3)`,!2 or 3 AS `(! 2) OR 3` +select ! 2 OR 3, ! (2 OR 3), (! 2) OR 3 union select * from v1; +! 2 OR 3 ! (2 OR 3) (! 2) OR 3 +1 0 1 +create or replace view v1 as select ! 2 || 3, ! (2 || 3), (! 2) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select !2 or 3 AS `! 2 || 3`,!2 and !3 AS `! (2 || 3)`,!2 or 3 AS `(! 2) || 3` +select ! 2 || 3, ! (2 || 3), (! 2) || 3 union select * from v1; +! 2 || 3 ! (2 || 3) (! 2) || 3 +1 0 1 +create or replace view v1 as select ! 2 AND 0, ! (2 AND 0), (! 2) AND 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select !2 and 0 AS `! 2 AND 0`,!2 or !0 AS `! (2 AND 0)`,!2 and 0 AS `(! 2) AND 0` +select ! 2 AND 0, ! (2 AND 0), (! 2) AND 0 union select * from v1; +! 2 AND 0 ! (2 AND 0) (! 2) AND 0 +0 1 0 +create or replace view v1 as select ! 2 && 0, ! (2 && 0), (! 2) && 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select !2 and 0 AS `! 2 && 0`,!2 or !0 AS `! (2 && 0)`,!2 and 0 AS `(! 2) && 0` +select ! 2 && 0, ! (2 && 0), (! 2) && 0 union select * from v1; +! 2 && 0 ! (2 && 0) (! 2) && 0 +0 1 0 +create or replace view v1 as select ! 2 = 3, ! (2 = 3), (! 2) = 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select !2 = 3 AS `! 2 = 3`,2 <> 3 AS `! (2 = 3)`,!2 = 3 AS `(! 2) = 3` +select ! 2 = 3, ! (2 = 3), (! 2) = 3 union select * from v1; +! 2 = 3 ! (2 = 3) (! 2) = 3 +0 1 0 +create or replace view v1 as select ! 2 <=> 3, ! (2 <=> 3), (! 2) <=> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select !2 <=> 3 AS `! 2 <=> 3`,!(2 <=> 3) AS `! (2 <=> 3)`,!2 <=> 3 AS `(! 2) <=> 3` +select ! 2 <=> 3, ! (2 <=> 3), (! 2) <=> 3 union select * from v1; +! 2 <=> 3 ! (2 <=> 3) (! 2) <=> 3 +0 1 0 +create or replace view v1 as select ! 2 >= 3, ! (2 >= 3), (! 2) >= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select !2 >= 3 AS `! 2 >= 3`,2 < 3 AS `! (2 >= 3)`,!2 >= 3 AS `(! 2) >= 3` +select ! 2 >= 3, ! (2 >= 3), (! 2) >= 3 union select * from v1; +! 2 >= 3 ! (2 >= 3) (! 2) >= 3 +0 1 0 +create or replace view v1 as select ! 2 <= 3, ! (2 <= 3), (! 2) <= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select !2 <= 3 AS `! 2 <= 3`,2 > 3 AS `! (2 <= 3)`,!2 <= 3 AS `(! 2) <= 3` +select ! 2 <= 3, ! (2 <= 3), (! 2) <= 3 union select * from v1; +! 2 <= 3 ! (2 <= 3) (! 2) <= 3 +1 0 1 +create or replace view v1 as select ! 2 < 3, ! (2 < 3), (! 2) < 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select !2 < 3 AS `! 2 < 3`,2 >= 3 AS `! (2 < 3)`,!2 < 3 AS `(! 2) < 3` +select ! 2 < 3, ! (2 < 3), (! 2) < 3 union select * from v1; +! 2 < 3 ! (2 < 3) (! 2) < 3 +1 0 1 +create or replace view v1 as select ! 2 <> 3, ! (2 <> 3), (! 2) <> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select !2 <> 3 AS `! 2 <> 3`,2 = 3 AS `! (2 <> 3)`,!2 <> 3 AS `(! 2) <> 3` +select ! 2 <> 3, ! (2 <> 3), (! 2) <> 3 union select * from v1; +! 2 <> 3 ! (2 <> 3) (! 2) <> 3 +1 0 1 +create or replace view v1 as select ! 2 > 3, ! (2 > 3), (! 2) > 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select !2 > 3 AS `! 2 > 3`,2 <= 3 AS `! (2 > 3)`,!2 > 3 AS `(! 2) > 3` +select ! 2 > 3, ! (2 > 3), (! 2) > 3 union select * from v1; +! 2 > 3 ! (2 > 3) (! 2) > 3 +0 1 0 +create or replace view v1 as select ! 2 != 3, ! (2 != 3), (! 2) != 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select !2 <> 3 AS `! 2 != 3`,2 = 3 AS `! (2 != 3)`,!2 <> 3 AS `(! 2) != 3` +select ! 2 != 3, ! (2 != 3), (! 2) != 3 union select * from v1; +! 2 != 3 ! (2 != 3) (! 2) != 3 +1 0 1 +create or replace view v1 as select ! 2 LIKE 3, ! (2 LIKE 3), (! 2) LIKE 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select !2 like 3 AS `! 2 LIKE 3`,2 not like 3 AS `! (2 LIKE 3)`,!2 like 3 AS `(! 2) LIKE 3` +select ! 2 LIKE 3, ! (2 LIKE 3), (! 2) LIKE 3 union select * from v1; +! 2 LIKE 3 ! (2 LIKE 3) (! 2) LIKE 3 +0 1 0 +create or replace view v1 as select ! 2 REGEXP 3, ! (2 REGEXP 3), (! 2) REGEXP 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select !2 regexp 3 AS `! 2 REGEXP 3`,!(2 regexp 3) AS `! (2 REGEXP 3)`,!2 regexp 3 AS `(! 2) REGEXP 3` +select ! 2 REGEXP 3, ! (2 REGEXP 3), (! 2) REGEXP 3 union select * from v1; +! 2 REGEXP 3 ! (2 REGEXP 3) (! 2) REGEXP 3 +0 1 0 +create or replace view v1 as select ! 2 | 3, ! (2 | 3), (! 2) | 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select !2 | 3 AS `! 2 | 3`,!(2 | 3) AS `! (2 | 3)`,!2 | 3 AS `(! 2) | 3` +select ! 2 | 3, ! (2 | 3), (! 2) | 3 union select * from v1; +! 2 | 3 ! (2 | 3) (! 2) | 3 +3 0 3 +create or replace view v1 as select ! 2 & 0, ! (2 & 0), (! 2) & 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select !2 & 0 AS `! 2 & 0`,!(2 & 0) AS `! (2 & 0)`,!2 & 0 AS `(! 2) & 0` +select ! 2 & 0, ! (2 & 0), (! 2) & 0 union select * from v1; +! 2 & 0 ! (2 & 0) (! 2) & 0 +0 1 0 +create or replace view v1 as select ! 0 << 3, ! (0 << 3), (! 0) << 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select !0 << 3 AS `! 0 << 3`,!(0 << 3) AS `! (0 << 3)`,!0 << 3 AS `(! 0) << 3` +select ! 0 << 3, ! (0 << 3), (! 0) << 3 union select * from v1; +! 0 << 3 ! (0 << 3) (! 0) << 3 +8 1 8 +create or replace view v1 as select ! 2 >> 3, ! (2 >> 3), (! 2) >> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select !2 >> 3 AS `! 2 >> 3`,!(2 >> 3) AS `! (2 >> 3)`,!2 >> 3 AS `(! 2) >> 3` +select ! 2 >> 3, ! (2 >> 3), (! 2) >> 3 union select * from v1; +! 2 >> 3 ! (2 >> 3) (! 2) >> 3 +0 1 0 +create or replace view v1 as select ! '2000-01-01' +INTERVAL 1 DAY, ! ('2000-01-01' +INTERVAL 1 DAY), (! '2000-01-01') +INTERVAL 1 DAY; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select !'2000-01-01' + interval 1 day AS `! '2000-01-01' +INTERVAL 1 DAY`,!('2000-01-01' + interval 1 day) AS `! ('2000-01-01' +INTERVAL 1 DAY)`,!'2000-01-01' + interval 1 day AS `(! '2000-01-01') +INTERVAL 1 DAY` +select ! '2000-01-01' +INTERVAL 1 DAY, ! ('2000-01-01' +INTERVAL 1 DAY), (! '2000-01-01') +INTERVAL 1 DAY union select * from v1; +! '2000-01-01' +INTERVAL 1 DAY ! ('2000-01-01' +INTERVAL 1 DAY) (! '2000-01-01') +INTERVAL 1 DAY +NULL 0 NULL +create or replace view v1 as select ! 2 + 3, ! (2 + 3), (! 2) + 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select !2 + 3 AS `! 2 + 3`,!(2 + 3) AS `! (2 + 3)`,!2 + 3 AS `(! 2) + 3` +select ! 2 + 3, ! (2 + 3), (! 2) + 3 union select * from v1; +! 2 + 3 ! (2 + 3) (! 2) + 3 +3 0 3 +create or replace view v1 as select ! 2 - 3, ! (2 - 3), (! 2) - 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select !2 - 3 AS `! 2 - 3`,!(2 - 3) AS `! (2 - 3)`,!2 - 3 AS `(! 2) - 3` +select ! 2 - 3, ! (2 - 3), (! 2) - 3 union select * from v1; +! 2 - 3 ! (2 - 3) (! 2) - 3 +-3 0 -3 +create or replace view v1 as select ! 0 * 3, ! (0 * 3), (! 0) * 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select !0 * 3 AS `! 0 * 3`,!(0 * 3) AS `! (0 * 3)`,!0 * 3 AS `(! 0) * 3` +select ! 0 * 3, ! (0 * 3), (! 0) * 3 union select * from v1; +! 0 * 3 ! (0 * 3) (! 0) * 3 +3 1 3 +create or replace view v1 as select ! 0 / 3, ! (0 / 3), (! 0) / 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select !0 / 3 AS `! 0 / 3`,!(0 / 3) AS `! (0 / 3)`,!0 / 3 AS `(! 0) / 3` +select ! 0 / 3, ! (0 / 3), (! 0) / 3 union select * from v1; +! 0 / 3 ! (0 / 3) (! 0) / 3 +0.3333 1 0.3333 +create or replace view v1 as select ! 2 DIV 3, ! (2 DIV 3), (! 2) DIV 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select !2 DIV 3 AS `! 2 DIV 3`,!(2 DIV 3) AS `! (2 DIV 3)`,!2 DIV 3 AS `(! 2) DIV 3` +select ! 2 DIV 3, ! (2 DIV 3), (! 2) DIV 3 union select * from v1; +! 2 DIV 3 ! (2 DIV 3) (! 2) DIV 3 +0 1 0 +create or replace view v1 as select ! 6 MOD 3, ! (6 MOD 3), (! 6) MOD 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select !6 MOD 3 AS `! 6 MOD 3`,!(6 MOD 3) AS `! (6 MOD 3)`,!6 MOD 3 AS `(! 6) MOD 3` +select ! 6 MOD 3, ! (6 MOD 3), (! 6) MOD 3 union select * from v1; +! 6 MOD 3 ! (6 MOD 3) (! 6) MOD 3 +0 1 0 +create or replace view v1 as select ! 6 % 3, ! (6 % 3), (! 6) % 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select !6 MOD 3 AS `! 6 % 3`,!(6 MOD 3) AS `! (6 % 3)`,!6 MOD 3 AS `(! 6) % 3` +select ! 6 % 3, ! (6 % 3), (! 6) % 3 union select * from v1; +! 6 % 3 ! (6 % 3) (! 6) % 3 +0 1 0 +create or replace view v1 as select ! 2 ^ 3, ! (2 ^ 3), (! 2) ^ 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select !2 ^ 3 AS `! 2 ^ 3`,!(2 ^ 3) AS `! (2 ^ 3)`,!2 ^ 3 AS `(! 2) ^ 3` +select ! 2 ^ 3, ! (2 ^ 3), (! 2) ^ 3 union select * from v1; +! 2 ^ 3 ! (2 ^ 3) (! 2) ^ 3 +3 0 3 +create or replace view v1 as select ! 2 BETWEEN 3 AND 4, ! (2 BETWEEN 3 AND 4), (! 2) BETWEEN 3 AND 4; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select !2 between 3 and 4 AS `! 2 BETWEEN 3 AND 4`,2 not between 3 and 4 AS `! (2 BETWEEN 3 AND 4)`,!2 between 3 and 4 AS `(! 2) BETWEEN 3 AND 4` +select ! 2 BETWEEN 3 AND 4, ! (2 BETWEEN 3 AND 4), (! 2) BETWEEN 3 AND 4 union select * from v1; +! 2 BETWEEN 3 AND 4 ! (2 BETWEEN 3 AND 4) (! 2) BETWEEN 3 AND 4 +0 1 0 +create or replace view v1 as select CHARSET(BINARY '2' COLLATE latin1_bin), CHARSET(BINARY ('2' COLLATE latin1_bin)), 'error'/*CHARSET((BINARY '2') COLLATE latin1_bin)*/; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select charset(cast('2' collate latin1_bin as char charset binary)) AS `CHARSET(BINARY '2' COLLATE latin1_bin)`,charset(cast('2' collate latin1_bin as char charset binary)) AS `CHARSET(BINARY ('2' COLLATE latin1_bin))`,'error' AS `error` +select CHARSET(BINARY '2' COLLATE latin1_bin), CHARSET(BINARY ('2' COLLATE latin1_bin)), 'error'/*CHARSET((BINARY '2') COLLATE latin1_bin)*/ union select * from v1; +CHARSET(BINARY '2' COLLATE latin1_bin) CHARSET(BINARY ('2' COLLATE latin1_bin)) error +binary binary error +create or replace view v1 as select BINARY 'c' IN ('C','X'), BINARY ('c' IN ('C','X')), (BINARY 'c') IN ('C','X'); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select cast('c' as char charset binary) in ('C','X') AS `BINARY 'c' IN ('C','X')`,cast('c' in ('C','X') as char charset binary) AS `BINARY ('c' IN ('C','X'))`,cast('c' as char charset binary) in ('C','X') AS `(BINARY 'c') IN ('C','X')` +select BINARY 'c' IN ('C','X'), BINARY ('c' IN ('C','X')), (BINARY 'c') IN ('C','X') union select * from v1; +BINARY 'c' IN ('C','X') BINARY ('c' IN ('C','X')) (BINARY 'c') IN ('C','X') +0 1 0 +create or replace view v1 as select BINARY 'c' = 'C', BINARY ('c' = 'C'), (BINARY 'c') = 'C'; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select cast('c' as char charset binary) = 'C' AS `BINARY 'c' = 'C'`,cast('c' = 'C' as char charset binary) AS `BINARY ('c' = 'C')`,cast('c' as char charset binary) = 'C' AS `(BINARY 'c') = 'C'` +select BINARY 'c' = 'C', BINARY ('c' = 'C'), (BINARY 'c') = 'C' union select * from v1; +BINARY 'c' = 'C' BINARY ('c' = 'C') (BINARY 'c') = 'C' +0 1 0 +create or replace view v1 as select BINARY 'c' <=> 'C', BINARY ('c' <=> 'C'), (BINARY 'c') <=> 'C'; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select cast('c' as char charset binary) <=> 'C' AS `BINARY 'c' <=> 'C'`,cast('c' <=> 'C' as char charset binary) AS `BINARY ('c' <=> 'C')`,cast('c' as char charset binary) <=> 'C' AS `(BINARY 'c') <=> 'C'` +select BINARY 'c' <=> 'C', BINARY ('c' <=> 'C'), (BINARY 'c') <=> 'C' union select * from v1; +BINARY 'c' <=> 'C' BINARY ('c' <=> 'C') (BINARY 'c') <=> 'C' +0 1 0 +create or replace view v1 as select BINARY 'c' >= 'D', BINARY ('c' >= 'D'), (BINARY 'c') >= 'D'; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select cast('c' as char charset binary) >= 'D' AS `BINARY 'c' >= 'D'`,cast('c' >= 'D' as char charset binary) AS `BINARY ('c' >= 'D')`,cast('c' as char charset binary) >= 'D' AS `(BINARY 'c') >= 'D'` +select BINARY 'c' >= 'D', BINARY ('c' >= 'D'), (BINARY 'c') >= 'D' union select * from v1; +BINARY 'c' >= 'D' BINARY ('c' >= 'D') (BINARY 'c') >= 'D' +1 0 1 +create or replace view v1 as select BINARY 'c' <= 'C', BINARY ('c' <= 'C'), (BINARY 'c') <= 'C'; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select cast('c' as char charset binary) <= 'C' AS `BINARY 'c' <= 'C'`,cast('c' <= 'C' as char charset binary) AS `BINARY ('c' <= 'C')`,cast('c' as char charset binary) <= 'C' AS `(BINARY 'c') <= 'C'` +select BINARY 'c' <= 'C', BINARY ('c' <= 'C'), (BINARY 'c') <= 'C' union select * from v1; +BINARY 'c' <= 'C' BINARY ('c' <= 'C') (BINARY 'c') <= 'C' +0 1 0 +create or replace view v1 as select BINARY 'c' < 'D', BINARY ('c' < 'D'), (BINARY 'c') < 'D'; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select cast('c' as char charset binary) < 'D' AS `BINARY 'c' < 'D'`,cast('c' < 'D' as char charset binary) AS `BINARY ('c' < 'D')`,cast('c' as char charset binary) < 'D' AS `(BINARY 'c') < 'D'` +select BINARY 'c' < 'D', BINARY ('c' < 'D'), (BINARY 'c') < 'D' union select * from v1; +BINARY 'c' < 'D' BINARY ('c' < 'D') (BINARY 'c') < 'D' +0 1 0 +create or replace view v1 as select BINARY 'c' <> 'C', BINARY ('c' <> 'C'), (BINARY 'c') <> 'C'; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select cast('c' as char charset binary) <> 'C' AS `BINARY 'c' <> 'C'`,cast('c' <> 'C' as char charset binary) AS `BINARY ('c' <> 'C')`,cast('c' as char charset binary) <> 'C' AS `(BINARY 'c') <> 'C'` +select BINARY 'c' <> 'C', BINARY ('c' <> 'C'), (BINARY 'c') <> 'C' union select * from v1; +BINARY 'c' <> 'C' BINARY ('c' <> 'C') (BINARY 'c') <> 'C' +1 0 1 +create or replace view v1 as select BINARY 'c' > 'C', BINARY ('c' > 'C'), (BINARY 'c') > 'C'; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select cast('c' as char charset binary) > 'C' AS `BINARY 'c' > 'C'`,cast('c' > 'C' as char charset binary) AS `BINARY ('c' > 'C')`,cast('c' as char charset binary) > 'C' AS `(BINARY 'c') > 'C'` +select BINARY 'c' > 'C', BINARY ('c' > 'C'), (BINARY 'c') > 'C' union select * from v1; +BINARY 'c' > 'C' BINARY ('c' > 'C') (BINARY 'c') > 'C' +1 0 1 +create or replace view v1 as select BINARY 'c' != 'C', BINARY ('c' != 'C'), (BINARY 'c') != 'C'; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select cast('c' as char charset binary) <> 'C' AS `BINARY 'c' != 'C'`,cast('c' <> 'C' as char charset binary) AS `BINARY ('c' != 'C')`,cast('c' as char charset binary) <> 'C' AS `(BINARY 'c') != 'C'` +select BINARY 'c' != 'C', BINARY ('c' != 'C'), (BINARY 'c') != 'C' union select * from v1; +BINARY 'c' != 'C' BINARY ('c' != 'C') (BINARY 'c') != 'C' +1 0 1 +create or replace view v1 as select BINARY 'c' LIKE 'C', BINARY ('c' LIKE 'C'), (BINARY 'c') LIKE 'C'; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select cast('c' as char charset binary) like 'C' AS `BINARY 'c' LIKE 'C'`,cast('c' like 'C' as char charset binary) AS `BINARY ('c' LIKE 'C')`,cast('c' as char charset binary) like 'C' AS `(BINARY 'c') LIKE 'C'` +select BINARY 'c' LIKE 'C', BINARY ('c' LIKE 'C'), (BINARY 'c') LIKE 'C' union select * from v1; +BINARY 'c' LIKE 'C' BINARY ('c' LIKE 'C') (BINARY 'c') LIKE 'C' +0 1 0 +create or replace view v1 as select BINARY 'c' REGEXP 'C', BINARY ('c' REGEXP 'C'), (BINARY 'c') REGEXP 'C'; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select cast('c' as char charset binary) regexp 'C' AS `BINARY 'c' REGEXP 'C'`,cast('c' regexp 'C' as char charset binary) AS `BINARY ('c' REGEXP 'C')`,cast('c' as char charset binary) regexp 'C' AS `(BINARY 'c') REGEXP 'C'` +select BINARY 'c' REGEXP 'C', BINARY ('c' REGEXP 'C'), (BINARY 'c') REGEXP 'C' union select * from v1; +BINARY 'c' REGEXP 'C' BINARY ('c' REGEXP 'C') (BINARY 'c') REGEXP 'C' +0 1 0 +create or replace view v1 as select BINARY 'c' BETWEEN 'A' AND 'D', BINARY ('c' BETWEEN 'A' AND 'D'), (BINARY 'c') BETWEEN 'A' AND 'D'; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select cast('c' as char charset binary) between 'A' and 'D' AS `BINARY 'c' BETWEEN 'A' AND 'D'`,cast('c' between 'A' and 'D' as char charset binary) AS `BINARY ('c' BETWEEN 'A' AND 'D')`,cast('c' as char charset binary) between 'A' and 'D' AS `(BINARY 'c') BETWEEN 'A' AND 'D'` +select BINARY 'c' BETWEEN 'A' AND 'D', BINARY ('c' BETWEEN 'A' AND 'D'), (BINARY 'c') BETWEEN 'A' AND 'D' union select * from v1; +BINARY 'c' BETWEEN 'A' AND 'D' BINARY ('c' BETWEEN 'A' AND 'D') (BINARY 'c') BETWEEN 'A' AND 'D' +0 1 0 +create or replace view v1 as select 2 OR 3 IS FALSE, 2 OR (3 IS FALSE), (2 OR 3) IS FALSE; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 or 3 is false AS `2 OR 3 IS FALSE`,2 or 3 is false AS `2 OR (3 IS FALSE)`,(2 or 3) is false AS `(2 OR 3) IS FALSE` +select 2 OR 3 IS FALSE, 2 OR (3 IS FALSE), (2 OR 3) IS FALSE union select * from v1; +2 OR 3 IS FALSE 2 OR (3 IS FALSE) (2 OR 3) IS FALSE +1 1 0 +create or replace view v1 as select charset(2 OR 3 COLLATE latin1_bin), charset(2 OR (3 COLLATE latin1_bin)), charset((2 OR 3) COLLATE latin1_bin); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select charset(2 or 3 collate latin1_bin) AS `charset(2 OR 3 COLLATE latin1_bin)`,charset(2 or 3 collate latin1_bin) AS `charset(2 OR (3 COLLATE latin1_bin))`,charset((2 or 3) collate latin1_bin) AS `charset((2 OR 3) COLLATE latin1_bin)` +select charset(2 OR 3 COLLATE latin1_bin), charset(2 OR (3 COLLATE latin1_bin)), charset((2 OR 3) COLLATE latin1_bin) union select * from v1; +charset(2 OR 3 COLLATE latin1_bin) charset(2 OR (3 COLLATE latin1_bin)) charset((2 OR 3) COLLATE latin1_bin) +binary binary latin1 +create or replace view v1 as select 0 OR 3 IN (3,10), 0 OR (3 IN (3,10)), (0 OR 3) IN (3,10); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 0 or 3 in (3,10) AS `0 OR 3 IN (3,10)`,0 or 3 in (3,10) AS `0 OR (3 IN (3,10))`,(0 or 3) in (3,10) AS `(0 OR 3) IN (3,10)` +select 0 OR 3 IN (3,10), 0 OR (3 IN (3,10)), (0 OR 3) IN (3,10) union select * from v1; +0 OR 3 IN (3,10) 0 OR (3 IN (3,10)) (0 OR 3) IN (3,10) +1 1 0 +create or replace view v1 as select 1 OR 0 XOR 1, 1 OR (0 XOR 1), (1 OR 0) XOR 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 1 or 0 xor 1 AS `1 OR 0 XOR 1`,1 or 0 xor 1 AS `1 OR (0 XOR 1)`,(1 or 0) xor 1 AS `(1 OR 0) XOR 1` +select 1 OR 0 XOR 1, 1 OR (0 XOR 1), (1 OR 0) XOR 1 union select * from v1; +1 OR 0 XOR 1 1 OR (0 XOR 1) (1 OR 0) XOR 1 +1 1 0 +create or replace view v1 as select 1 OR 1 AND 0, 1 OR (1 AND 0), (1 OR 1) AND 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 1 or 1 and 0 AS `1 OR 1 AND 0`,1 or 1 and 0 AS `1 OR (1 AND 0)`,(1 or 1) and 0 AS `(1 OR 1) AND 0` +select 1 OR 1 AND 0, 1 OR (1 AND 0), (1 OR 1) AND 0 union select * from v1; +1 OR 1 AND 0 1 OR (1 AND 0) (1 OR 1) AND 0 +1 1 0 +create or replace view v1 as select 1 OR 1 && 0, 1 OR (1 && 0), (1 OR 1) && 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 1 or 1 and 0 AS `1 OR 1 && 0`,1 or 1 and 0 AS `1 OR (1 && 0)`,(1 or 1) and 0 AS `(1 OR 1) && 0` +select 1 OR 1 && 0, 1 OR (1 && 0), (1 OR 1) && 0 union select * from v1; +1 OR 1 && 0 1 OR (1 && 0) (1 OR 1) && 0 +1 1 0 +create or replace view v1 as select 2 OR 3 = 3, 2 OR (3 = 3), (2 OR 3) = 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 or 3 = 3 AS `2 OR 3 = 3`,2 or 3 = 3 AS `2 OR (3 = 3)`,(2 or 3) = 3 AS `(2 OR 3) = 3` +select 2 OR 3 = 3, 2 OR (3 = 3), (2 OR 3) = 3 union select * from v1; +2 OR 3 = 3 2 OR (3 = 3) (2 OR 3) = 3 +1 1 0 +create or replace view v1 as select 2 OR 3 <=> 3, 2 OR (3 <=> 3), (2 OR 3) <=> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 or 3 <=> 3 AS `2 OR 3 <=> 3`,2 or 3 <=> 3 AS `2 OR (3 <=> 3)`,(2 or 3) <=> 3 AS `(2 OR 3) <=> 3` +select 2 OR 3 <=> 3, 2 OR (3 <=> 3), (2 OR 3) <=> 3 union select * from v1; +2 OR 3 <=> 3 2 OR (3 <=> 3) (2 OR 3) <=> 3 +1 1 0 +create or replace view v1 as select 2 OR 3 >= 3, 2 OR (3 >= 3), (2 OR 3) >= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 or 3 >= 3 AS `2 OR 3 >= 3`,2 or 3 >= 3 AS `2 OR (3 >= 3)`,(2 or 3) >= 3 AS `(2 OR 3) >= 3` +select 2 OR 3 >= 3, 2 OR (3 >= 3), (2 OR 3) >= 3 union select * from v1; +2 OR 3 >= 3 2 OR (3 >= 3) (2 OR 3) >= 3 +1 1 0 +create or replace view v1 as select 2 OR 3 <= 0, 2 OR (3 <= 0), (2 OR 3) <= 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 or 3 <= 0 AS `2 OR 3 <= 0`,2 or 3 <= 0 AS `2 OR (3 <= 0)`,(2 or 3) <= 0 AS `(2 OR 3) <= 0` +select 2 OR 3 <= 0, 2 OR (3 <= 0), (2 OR 3) <= 0 union select * from v1; +2 OR 3 <= 0 2 OR (3 <= 0) (2 OR 3) <= 0 +1 1 0 +create or replace view v1 as select 2 OR 3 < 0, 2 OR (3 < 0), (2 OR 3) < 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 or 3 < 0 AS `2 OR 3 < 0`,2 or 3 < 0 AS `2 OR (3 < 0)`,(2 or 3) < 0 AS `(2 OR 3) < 0` +select 2 OR 3 < 0, 2 OR (3 < 0), (2 OR 3) < 0 union select * from v1; +2 OR 3 < 0 2 OR (3 < 0) (2 OR 3) < 0 +1 1 0 +create or replace view v1 as select 0 OR 3 <> 3, 0 OR (3 <> 3), (0 OR 3) <> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 0 or 3 <> 3 AS `0 OR 3 <> 3`,0 or 3 <> 3 AS `0 OR (3 <> 3)`,(0 or 3) <> 3 AS `(0 OR 3) <> 3` +select 0 OR 3 <> 3, 0 OR (3 <> 3), (0 OR 3) <> 3 union select * from v1; +0 OR 3 <> 3 0 OR (3 <> 3) (0 OR 3) <> 3 +0 0 1 +create or replace view v1 as select 2 OR 3 > 3, 2 OR (3 > 3), (2 OR 3) > 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 or 3 > 3 AS `2 OR 3 > 3`,2 or 3 > 3 AS `2 OR (3 > 3)`,(2 or 3) > 3 AS `(2 OR 3) > 3` +select 2 OR 3 > 3, 2 OR (3 > 3), (2 OR 3) > 3 union select * from v1; +2 OR 3 > 3 2 OR (3 > 3) (2 OR 3) > 3 +1 1 0 +create or replace view v1 as select 0 OR 3 != 3, 0 OR (3 != 3), (0 OR 3) != 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 0 or 3 <> 3 AS `0 OR 3 != 3`,0 or 3 <> 3 AS `0 OR (3 != 3)`,(0 or 3) <> 3 AS `(0 OR 3) != 3` +select 0 OR 3 != 3, 0 OR (3 != 3), (0 OR 3) != 3 union select * from v1; +0 OR 3 != 3 0 OR (3 != 3) (0 OR 3) != 3 +0 0 1 +create or replace view v1 as select 2 OR 3 LIKE 3, 2 OR (3 LIKE 3), (2 OR 3) LIKE 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 or 3 like 3 AS `2 OR 3 LIKE 3`,2 or 3 like 3 AS `2 OR (3 LIKE 3)`,(2 or 3) like 3 AS `(2 OR 3) LIKE 3` +select 2 OR 3 LIKE 3, 2 OR (3 LIKE 3), (2 OR 3) LIKE 3 union select * from v1; +2 OR 3 LIKE 3 2 OR (3 LIKE 3) (2 OR 3) LIKE 3 +1 1 0 +create or replace view v1 as select 2 OR 3 REGEXP 3, 2 OR (3 REGEXP 3), (2 OR 3) REGEXP 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 or 3 regexp 3 AS `2 OR 3 REGEXP 3`,2 or 3 regexp 3 AS `2 OR (3 REGEXP 3)`,(2 or 3) regexp 3 AS `(2 OR 3) REGEXP 3` +select 2 OR 3 REGEXP 3, 2 OR (3 REGEXP 3), (2 OR 3) REGEXP 3 union select * from v1; +2 OR 3 REGEXP 3 2 OR (3 REGEXP 3) (2 OR 3) REGEXP 3 +1 1 0 +create or replace view v1 as select 2 OR 3 | 3, 2 OR (3 | 3), (2 OR 3) | 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 or 3 | 3 AS `2 OR 3 | 3`,2 or 3 | 3 AS `2 OR (3 | 3)`,(2 or 3) | 3 AS `(2 OR 3) | 3` +select 2 OR 3 | 3, 2 OR (3 | 3), (2 OR 3) | 3 union select * from v1; +2 OR 3 | 3 2 OR (3 | 3) (2 OR 3) | 3 +1 1 3 +create or replace view v1 as select 0 OR 2 & 2, 0 OR (2 & 2), (0 OR 2) & 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 0 or 2 & 2 AS `0 OR 2 & 2`,0 or 2 & 2 AS `0 OR (2 & 2)`,(0 or 2) & 2 AS `(0 OR 2) & 2` +select 0 OR 2 & 2, 0 OR (2 & 2), (0 OR 2) & 2 union select * from v1; +0 OR 2 & 2 0 OR (2 & 2) (0 OR 2) & 2 +1 1 0 +create or replace view v1 as select 2 OR 3 << 3, 2 OR (3 << 3), (2 OR 3) << 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 or 3 << 3 AS `2 OR 3 << 3`,2 or 3 << 3 AS `2 OR (3 << 3)`,(2 or 3) << 3 AS `(2 OR 3) << 3` +select 2 OR 3 << 3, 2 OR (3 << 3), (2 OR 3) << 3 union select * from v1; +2 OR 3 << 3 2 OR (3 << 3) (2 OR 3) << 3 +1 1 8 +create or replace view v1 as select 2 OR 3 >> 3, 2 OR (3 >> 3), (2 OR 3) >> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 or 3 >> 3 AS `2 OR 3 >> 3`,2 or 3 >> 3 AS `2 OR (3 >> 3)`,(2 or 3) >> 3 AS `(2 OR 3) >> 3` +select 2 OR 3 >> 3, 2 OR (3 >> 3), (2 OR 3) >> 3 union select * from v1; +2 OR 3 >> 3 2 OR (3 >> 3) (2 OR 3) >> 3 +1 1 0 +create or replace view v1 as select 2 OR '2000-01-01' +INTERVAL 1 DAY, 2 OR ('2000-01-01' +INTERVAL 1 DAY), (2 OR '2000-01-01') +INTERVAL 1 DAY; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 or '2000-01-01' + interval 1 day AS `2 OR '2000-01-01' +INTERVAL 1 DAY`,2 or '2000-01-01' + interval 1 day AS `2 OR ('2000-01-01' +INTERVAL 1 DAY)`,(2 or '2000-01-01') + interval 1 day AS `(2 OR '2000-01-01') +INTERVAL 1 DAY` +select 2 OR '2000-01-01' +INTERVAL 1 DAY, 2 OR ('2000-01-01' +INTERVAL 1 DAY), (2 OR '2000-01-01') +INTERVAL 1 DAY union select * from v1; +2 OR '2000-01-01' +INTERVAL 1 DAY 2 OR ('2000-01-01' +INTERVAL 1 DAY) (2 OR '2000-01-01') +INTERVAL 1 DAY +1 1 NULL +create or replace view v1 as select 2 OR 3 + 3, 2 OR (3 + 3), (2 OR 3) + 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 or 3 + 3 AS `2 OR 3 + 3`,2 or 3 + 3 AS `2 OR (3 + 3)`,(2 or 3) + 3 AS `(2 OR 3) + 3` +select 2 OR 3 + 3, 2 OR (3 + 3), (2 OR 3) + 3 union select * from v1; +2 OR 3 + 3 2 OR (3 + 3) (2 OR 3) + 3 +1 1 4 +create or replace view v1 as select 2 OR 3 - 3, 2 OR (3 - 3), (2 OR 3) - 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 or 3 - 3 AS `2 OR 3 - 3`,2 or 3 - 3 AS `2 OR (3 - 3)`,(2 or 3) - 3 AS `(2 OR 3) - 3` +select 2 OR 3 - 3, 2 OR (3 - 3), (2 OR 3) - 3 union select * from v1; +2 OR 3 - 3 2 OR (3 - 3) (2 OR 3) - 3 +1 1 -2 +create or replace view v1 as select 2 OR 3 * 3, 2 OR (3 * 3), (2 OR 3) * 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 or 3 * 3 AS `2 OR 3 * 3`,2 or 3 * 3 AS `2 OR (3 * 3)`,(2 or 3) * 3 AS `(2 OR 3) * 3` +select 2 OR 3 * 3, 2 OR (3 * 3), (2 OR 3) * 3 union select * from v1; +2 OR 3 * 3 2 OR (3 * 3) (2 OR 3) * 3 +1 1 3 +create or replace view v1 as select 2 OR 3 / 3, 2 OR (3 / 3), (2 OR 3) / 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 or 3 / 3 AS `2 OR 3 / 3`,2 or 3 / 3 AS `2 OR (3 / 3)`,(2 or 3) / 3 AS `(2 OR 3) / 3` +select 2 OR 3 / 3, 2 OR (3 / 3), (2 OR 3) / 3 union select * from v1; +2 OR 3 / 3 2 OR (3 / 3) (2 OR 3) / 3 +1 1 0.3333 +create or replace view v1 as select 2 OR 3 DIV 3, 2 OR (3 DIV 3), (2 OR 3) DIV 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 or 3 DIV 3 AS `2 OR 3 DIV 3`,2 or 3 DIV 3 AS `2 OR (3 DIV 3)`,(2 or 3) DIV 3 AS `(2 OR 3) DIV 3` +select 2 OR 3 DIV 3, 2 OR (3 DIV 3), (2 OR 3) DIV 3 union select * from v1; +2 OR 3 DIV 3 2 OR (3 DIV 3) (2 OR 3) DIV 3 +1 1 0 +create or replace view v1 as select 0 OR 3 MOD 3, 0 OR (3 MOD 3), (0 OR 3) MOD 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 0 or 3 MOD 3 AS `0 OR 3 MOD 3`,0 or 3 MOD 3 AS `0 OR (3 MOD 3)`,(0 or 3) MOD 3 AS `(0 OR 3) MOD 3` +select 0 OR 3 MOD 3, 0 OR (3 MOD 3), (0 OR 3) MOD 3 union select * from v1; +0 OR 3 MOD 3 0 OR (3 MOD 3) (0 OR 3) MOD 3 +0 0 1 +create or replace view v1 as select 0 OR 3 % 3, 0 OR (3 % 3), (0 OR 3) % 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 0 or 3 MOD 3 AS `0 OR 3 % 3`,0 or 3 MOD 3 AS `0 OR (3 % 3)`,(0 or 3) MOD 3 AS `(0 OR 3) % 3` +select 0 OR 3 % 3, 0 OR (3 % 3), (0 OR 3) % 3 union select * from v1; +0 OR 3 % 3 0 OR (3 % 3) (0 OR 3) % 3 +0 0 1 +create or replace view v1 as select 2 OR 3 ^ 3, 2 OR (3 ^ 3), (2 OR 3) ^ 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 or 3 ^ 3 AS `2 OR 3 ^ 3`,2 or 3 ^ 3 AS `2 OR (3 ^ 3)`,(2 or 3) ^ 3 AS `(2 OR 3) ^ 3` +select 2 OR 3 ^ 3, 2 OR (3 ^ 3), (2 OR 3) ^ 3 union select * from v1; +2 OR 3 ^ 3 2 OR (3 ^ 3) (2 OR 3) ^ 3 +1 1 2 +create or replace view v1 as select 2 OR 3 BETWEEN 2 AND 3, 2 OR (3 BETWEEN 2 AND 3), (2 OR 3) BETWEEN 2 AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 or 3 between 2 and 3 AS `2 OR 3 BETWEEN 2 AND 3`,2 or 3 between 2 and 3 AS `2 OR (3 BETWEEN 2 AND 3)`,(2 or 3) between 2 and 3 AS `(2 OR 3) BETWEEN 2 AND 3` +select 2 OR 3 BETWEEN 2 AND 3, 2 OR (3 BETWEEN 2 AND 3), (2 OR 3) BETWEEN 2 AND 3 union select * from v1; +2 OR 3 BETWEEN 2 AND 3 2 OR (3 BETWEEN 2 AND 3) (2 OR 3) BETWEEN 2 AND 3 +1 1 0 +create or replace view v1 as select 2 || 3 IS FALSE, 2 || (3 IS FALSE), (2 || 3) IS FALSE; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 or 3 is false AS `2 || 3 IS FALSE`,2 or 3 is false AS `2 || (3 IS FALSE)`,(2 or 3) is false AS `(2 || 3) IS FALSE` +select 2 || 3 IS FALSE, 2 || (3 IS FALSE), (2 || 3) IS FALSE union select * from v1; +2 || 3 IS FALSE 2 || (3 IS FALSE) (2 || 3) IS FALSE +1 1 0 +create or replace view v1 as select charset(2 || 3 COLLATE latin1_bin), charset(2 || (3 COLLATE latin1_bin)), charset((2 || 3) COLLATE latin1_bin); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select charset(2 or 3 collate latin1_bin) AS `charset(2 || 3 COLLATE latin1_bin)`,charset(2 or 3 collate latin1_bin) AS `charset(2 || (3 COLLATE latin1_bin))`,charset((2 or 3) collate latin1_bin) AS `charset((2 || 3) COLLATE latin1_bin)` +select charset(2 || 3 COLLATE latin1_bin), charset(2 || (3 COLLATE latin1_bin)), charset((2 || 3) COLLATE latin1_bin) union select * from v1; +charset(2 || 3 COLLATE latin1_bin) charset(2 || (3 COLLATE latin1_bin)) charset((2 || 3) COLLATE latin1_bin) +binary binary latin1 +create or replace view v1 as select 0 || 3 IN (3,10), 0 || (3 IN (3,10)), (0 || 3) IN (3,10); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 0 or 3 in (3,10) AS `0 || 3 IN (3,10)`,0 or 3 in (3,10) AS `0 || (3 IN (3,10))`,(0 or 3) in (3,10) AS `(0 || 3) IN (3,10)` +select 0 || 3 IN (3,10), 0 || (3 IN (3,10)), (0 || 3) IN (3,10) union select * from v1; +0 || 3 IN (3,10) 0 || (3 IN (3,10)) (0 || 3) IN (3,10) +1 1 0 +create or replace view v1 as select 1 || 0 XOR 1, 1 || (0 XOR 1), (1 || 0) XOR 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 1 or 0 xor 1 AS `1 || 0 XOR 1`,1 or 0 xor 1 AS `1 || (0 XOR 1)`,(1 or 0) xor 1 AS `(1 || 0) XOR 1` +select 1 || 0 XOR 1, 1 || (0 XOR 1), (1 || 0) XOR 1 union select * from v1; +1 || 0 XOR 1 1 || (0 XOR 1) (1 || 0) XOR 1 +1 1 0 +create or replace view v1 as select 1 || 1 AND 0, 1 || (1 AND 0), (1 || 1) AND 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 1 or 1 and 0 AS `1 || 1 AND 0`,1 or 1 and 0 AS `1 || (1 AND 0)`,(1 or 1) and 0 AS `(1 || 1) AND 0` +select 1 || 1 AND 0, 1 || (1 AND 0), (1 || 1) AND 0 union select * from v1; +1 || 1 AND 0 1 || (1 AND 0) (1 || 1) AND 0 +1 1 0 +create or replace view v1 as select 1 || 1 && 0, 1 || (1 && 0), (1 || 1) && 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 1 or 1 and 0 AS `1 || 1 && 0`,1 or 1 and 0 AS `1 || (1 && 0)`,(1 or 1) and 0 AS `(1 || 1) && 0` +select 1 || 1 && 0, 1 || (1 && 0), (1 || 1) && 0 union select * from v1; +1 || 1 && 0 1 || (1 && 0) (1 || 1) && 0 +1 1 0 +create or replace view v1 as select 2 || 3 = 3, 2 || (3 = 3), (2 || 3) = 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 or 3 = 3 AS `2 || 3 = 3`,2 or 3 = 3 AS `2 || (3 = 3)`,(2 or 3) = 3 AS `(2 || 3) = 3` +select 2 || 3 = 3, 2 || (3 = 3), (2 || 3) = 3 union select * from v1; +2 || 3 = 3 2 || (3 = 3) (2 || 3) = 3 +1 1 0 +create or replace view v1 as select 2 || 3 <=> 3, 2 || (3 <=> 3), (2 || 3) <=> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 or 3 <=> 3 AS `2 || 3 <=> 3`,2 or 3 <=> 3 AS `2 || (3 <=> 3)`,(2 or 3) <=> 3 AS `(2 || 3) <=> 3` +select 2 || 3 <=> 3, 2 || (3 <=> 3), (2 || 3) <=> 3 union select * from v1; +2 || 3 <=> 3 2 || (3 <=> 3) (2 || 3) <=> 3 +1 1 0 +create or replace view v1 as select 2 || 3 >= 3, 2 || (3 >= 3), (2 || 3) >= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 or 3 >= 3 AS `2 || 3 >= 3`,2 or 3 >= 3 AS `2 || (3 >= 3)`,(2 or 3) >= 3 AS `(2 || 3) >= 3` +select 2 || 3 >= 3, 2 || (3 >= 3), (2 || 3) >= 3 union select * from v1; +2 || 3 >= 3 2 || (3 >= 3) (2 || 3) >= 3 +1 1 0 +create or replace view v1 as select 2 || 3 <= 0, 2 || (3 <= 0), (2 || 3) <= 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 or 3 <= 0 AS `2 || 3 <= 0`,2 or 3 <= 0 AS `2 || (3 <= 0)`,(2 or 3) <= 0 AS `(2 || 3) <= 0` +select 2 || 3 <= 0, 2 || (3 <= 0), (2 || 3) <= 0 union select * from v1; +2 || 3 <= 0 2 || (3 <= 0) (2 || 3) <= 0 +1 1 0 +create or replace view v1 as select 2 || 3 < 0, 2 || (3 < 0), (2 || 3) < 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 or 3 < 0 AS `2 || 3 < 0`,2 or 3 < 0 AS `2 || (3 < 0)`,(2 or 3) < 0 AS `(2 || 3) < 0` +select 2 || 3 < 0, 2 || (3 < 0), (2 || 3) < 0 union select * from v1; +2 || 3 < 0 2 || (3 < 0) (2 || 3) < 0 +1 1 0 +create or replace view v1 as select 0 || 3 <> 3, 0 || (3 <> 3), (0 || 3) <> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 0 or 3 <> 3 AS `0 || 3 <> 3`,0 or 3 <> 3 AS `0 || (3 <> 3)`,(0 or 3) <> 3 AS `(0 || 3) <> 3` +select 0 || 3 <> 3, 0 || (3 <> 3), (0 || 3) <> 3 union select * from v1; +0 || 3 <> 3 0 || (3 <> 3) (0 || 3) <> 3 +0 0 1 +create or replace view v1 as select 2 || 3 > 3, 2 || (3 > 3), (2 || 3) > 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 or 3 > 3 AS `2 || 3 > 3`,2 or 3 > 3 AS `2 || (3 > 3)`,(2 or 3) > 3 AS `(2 || 3) > 3` +select 2 || 3 > 3, 2 || (3 > 3), (2 || 3) > 3 union select * from v1; +2 || 3 > 3 2 || (3 > 3) (2 || 3) > 3 +1 1 0 +create or replace view v1 as select 0 || 3 != 3, 0 || (3 != 3), (0 || 3) != 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 0 or 3 <> 3 AS `0 || 3 != 3`,0 or 3 <> 3 AS `0 || (3 != 3)`,(0 or 3) <> 3 AS `(0 || 3) != 3` +select 0 || 3 != 3, 0 || (3 != 3), (0 || 3) != 3 union select * from v1; +0 || 3 != 3 0 || (3 != 3) (0 || 3) != 3 +0 0 1 +create or replace view v1 as select 2 || 3 LIKE 3, 2 || (3 LIKE 3), (2 || 3) LIKE 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 or 3 like 3 AS `2 || 3 LIKE 3`,2 or 3 like 3 AS `2 || (3 LIKE 3)`,(2 or 3) like 3 AS `(2 || 3) LIKE 3` +select 2 || 3 LIKE 3, 2 || (3 LIKE 3), (2 || 3) LIKE 3 union select * from v1; +2 || 3 LIKE 3 2 || (3 LIKE 3) (2 || 3) LIKE 3 +1 1 0 +create or replace view v1 as select 2 || 3 REGEXP 3, 2 || (3 REGEXP 3), (2 || 3) REGEXP 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 or 3 regexp 3 AS `2 || 3 REGEXP 3`,2 or 3 regexp 3 AS `2 || (3 REGEXP 3)`,(2 or 3) regexp 3 AS `(2 || 3) REGEXP 3` +select 2 || 3 REGEXP 3, 2 || (3 REGEXP 3), (2 || 3) REGEXP 3 union select * from v1; +2 || 3 REGEXP 3 2 || (3 REGEXP 3) (2 || 3) REGEXP 3 +1 1 0 +create or replace view v1 as select 2 || 3 | 3, 2 || (3 | 3), (2 || 3) | 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 or 3 | 3 AS `2 || 3 | 3`,2 or 3 | 3 AS `2 || (3 | 3)`,(2 or 3) | 3 AS `(2 || 3) | 3` +select 2 || 3 | 3, 2 || (3 | 3), (2 || 3) | 3 union select * from v1; +2 || 3 | 3 2 || (3 | 3) (2 || 3) | 3 +1 1 3 +create or replace view v1 as select 0 || 2 & 2, 0 || (2 & 2), (0 || 2) & 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 0 or 2 & 2 AS `0 || 2 & 2`,0 or 2 & 2 AS `0 || (2 & 2)`,(0 or 2) & 2 AS `(0 || 2) & 2` +select 0 || 2 & 2, 0 || (2 & 2), (0 || 2) & 2 union select * from v1; +0 || 2 & 2 0 || (2 & 2) (0 || 2) & 2 +1 1 0 +create or replace view v1 as select 2 || 3 << 3, 2 || (3 << 3), (2 || 3) << 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 or 3 << 3 AS `2 || 3 << 3`,2 or 3 << 3 AS `2 || (3 << 3)`,(2 or 3) << 3 AS `(2 || 3) << 3` +select 2 || 3 << 3, 2 || (3 << 3), (2 || 3) << 3 union select * from v1; +2 || 3 << 3 2 || (3 << 3) (2 || 3) << 3 +1 1 8 +create or replace view v1 as select 2 || 3 >> 3, 2 || (3 >> 3), (2 || 3) >> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 or 3 >> 3 AS `2 || 3 >> 3`,2 or 3 >> 3 AS `2 || (3 >> 3)`,(2 or 3) >> 3 AS `(2 || 3) >> 3` +select 2 || 3 >> 3, 2 || (3 >> 3), (2 || 3) >> 3 union select * from v1; +2 || 3 >> 3 2 || (3 >> 3) (2 || 3) >> 3 +1 1 0 +create or replace view v1 as select 2 || '2000-01-01' +INTERVAL 1 DAY, 2 || ('2000-01-01' +INTERVAL 1 DAY), (2 || '2000-01-01') +INTERVAL 1 DAY; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 or '2000-01-01' + interval 1 day AS `2 || '2000-01-01' +INTERVAL 1 DAY`,2 or '2000-01-01' + interval 1 day AS `2 || ('2000-01-01' +INTERVAL 1 DAY)`,(2 or '2000-01-01') + interval 1 day AS `(2 || '2000-01-01') +INTERVAL 1 DAY` +select 2 || '2000-01-01' +INTERVAL 1 DAY, 2 || ('2000-01-01' +INTERVAL 1 DAY), (2 || '2000-01-01') +INTERVAL 1 DAY union select * from v1; +2 || '2000-01-01' +INTERVAL 1 DAY 2 || ('2000-01-01' +INTERVAL 1 DAY) (2 || '2000-01-01') +INTERVAL 1 DAY +1 1 NULL +create or replace view v1 as select 2 || 3 + 3, 2 || (3 + 3), (2 || 3) + 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 or 3 + 3 AS `2 || 3 + 3`,2 or 3 + 3 AS `2 || (3 + 3)`,(2 or 3) + 3 AS `(2 || 3) + 3` +select 2 || 3 + 3, 2 || (3 + 3), (2 || 3) + 3 union select * from v1; +2 || 3 + 3 2 || (3 + 3) (2 || 3) + 3 +1 1 4 +create or replace view v1 as select 2 || 3 - 3, 2 || (3 - 3), (2 || 3) - 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 or 3 - 3 AS `2 || 3 - 3`,2 or 3 - 3 AS `2 || (3 - 3)`,(2 or 3) - 3 AS `(2 || 3) - 3` +select 2 || 3 - 3, 2 || (3 - 3), (2 || 3) - 3 union select * from v1; +2 || 3 - 3 2 || (3 - 3) (2 || 3) - 3 +1 1 -2 +create or replace view v1 as select 2 || 3 * 3, 2 || (3 * 3), (2 || 3) * 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 or 3 * 3 AS `2 || 3 * 3`,2 or 3 * 3 AS `2 || (3 * 3)`,(2 or 3) * 3 AS `(2 || 3) * 3` +select 2 || 3 * 3, 2 || (3 * 3), (2 || 3) * 3 union select * from v1; +2 || 3 * 3 2 || (3 * 3) (2 || 3) * 3 +1 1 3 +create or replace view v1 as select 2 || 3 / 3, 2 || (3 / 3), (2 || 3) / 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 or 3 / 3 AS `2 || 3 / 3`,2 or 3 / 3 AS `2 || (3 / 3)`,(2 or 3) / 3 AS `(2 || 3) / 3` +select 2 || 3 / 3, 2 || (3 / 3), (2 || 3) / 3 union select * from v1; +2 || 3 / 3 2 || (3 / 3) (2 || 3) / 3 +1 1 0.3333 +create or replace view v1 as select 2 || 3 DIV 3, 2 || (3 DIV 3), (2 || 3) DIV 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 or 3 DIV 3 AS `2 || 3 DIV 3`,2 or 3 DIV 3 AS `2 || (3 DIV 3)`,(2 or 3) DIV 3 AS `(2 || 3) DIV 3` +select 2 || 3 DIV 3, 2 || (3 DIV 3), (2 || 3) DIV 3 union select * from v1; +2 || 3 DIV 3 2 || (3 DIV 3) (2 || 3) DIV 3 +1 1 0 +create or replace view v1 as select 0 || 3 MOD 3, 0 || (3 MOD 3), (0 || 3) MOD 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 0 or 3 MOD 3 AS `0 || 3 MOD 3`,0 or 3 MOD 3 AS `0 || (3 MOD 3)`,(0 or 3) MOD 3 AS `(0 || 3) MOD 3` +select 0 || 3 MOD 3, 0 || (3 MOD 3), (0 || 3) MOD 3 union select * from v1; +0 || 3 MOD 3 0 || (3 MOD 3) (0 || 3) MOD 3 +0 0 1 +create or replace view v1 as select 0 || 3 % 3, 0 || (3 % 3), (0 || 3) % 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 0 or 3 MOD 3 AS `0 || 3 % 3`,0 or 3 MOD 3 AS `0 || (3 % 3)`,(0 or 3) MOD 3 AS `(0 || 3) % 3` +select 0 || 3 % 3, 0 || (3 % 3), (0 || 3) % 3 union select * from v1; +0 || 3 % 3 0 || (3 % 3) (0 || 3) % 3 +0 0 1 +create or replace view v1 as select 2 || 3 ^ 3, 2 || (3 ^ 3), (2 || 3) ^ 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 or 3 ^ 3 AS `2 || 3 ^ 3`,2 or 3 ^ 3 AS `2 || (3 ^ 3)`,(2 or 3) ^ 3 AS `(2 || 3) ^ 3` +select 2 || 3 ^ 3, 2 || (3 ^ 3), (2 || 3) ^ 3 union select * from v1; +2 || 3 ^ 3 2 || (3 ^ 3) (2 || 3) ^ 3 +1 1 2 +create or replace view v1 as select 2 || 3 BETWEEN 2 AND 3, 2 || (3 BETWEEN 2 AND 3), (2 || 3) BETWEEN 2 AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 or 3 between 2 and 3 AS `2 || 3 BETWEEN 2 AND 3`,2 or 3 between 2 and 3 AS `2 || (3 BETWEEN 2 AND 3)`,(2 or 3) between 2 and 3 AS `(2 || 3) BETWEEN 2 AND 3` +select 2 || 3 BETWEEN 2 AND 3, 2 || (3 BETWEEN 2 AND 3), (2 || 3) BETWEEN 2 AND 3 union select * from v1; +2 || 3 BETWEEN 2 AND 3 2 || (3 BETWEEN 2 AND 3) (2 || 3) BETWEEN 2 AND 3 +1 1 0 +create or replace view v1 as select charset(2 XOR 3 COLLATE latin1_bin), charset(2 XOR (3 COLLATE latin1_bin)), charset((2 XOR 3) COLLATE latin1_bin); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select charset(2 xor 3 collate latin1_bin) AS `charset(2 XOR 3 COLLATE latin1_bin)`,charset(2 xor 3 collate latin1_bin) AS `charset(2 XOR (3 COLLATE latin1_bin))`,charset((2 xor 3) collate latin1_bin) AS `charset((2 XOR 3) COLLATE latin1_bin)` +select charset(2 XOR 3 COLLATE latin1_bin), charset(2 XOR (3 COLLATE latin1_bin)), charset((2 XOR 3) COLLATE latin1_bin) union select * from v1; +charset(2 XOR 3 COLLATE latin1_bin) charset(2 XOR (3 COLLATE latin1_bin)) charset((2 XOR 3) COLLATE latin1_bin) +binary binary latin1 +create or replace view v1 as select 2 XOR 3 IN (4,5), 2 XOR (3 IN (4,5)), (2 XOR 3) IN (4,5); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 xor 3 in (4,5) AS `2 XOR 3 IN (4,5)`,2 xor 3 in (4,5) AS `2 XOR (3 IN (4,5))`,(2 xor 3) in (4,5) AS `(2 XOR 3) IN (4,5)` +select 2 XOR 3 IN (4,5), 2 XOR (3 IN (4,5)), (2 XOR 3) IN (4,5) union select * from v1; +2 XOR 3 IN (4,5) 2 XOR (3 IN (4,5)) (2 XOR 3) IN (4,5) +1 1 0 +create or replace view v1 as select 2 XOR 3 OR 3, 2 XOR (3 OR 3), (2 XOR 3) OR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 xor 3 or 3 AS `2 XOR 3 OR 3`,2 xor (3 or 3) AS `2 XOR (3 OR 3)`,2 xor 3 or 3 AS `(2 XOR 3) OR 3` +select 2 XOR 3 OR 3, 2 XOR (3 OR 3), (2 XOR 3) OR 3 union select * from v1; +2 XOR 3 OR 3 2 XOR (3 OR 3) (2 XOR 3) OR 3 +1 0 1 +create or replace view v1 as select 2 XOR 3 || 3, 2 XOR (3 || 3), (2 XOR 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 xor 3 or 3 AS `2 XOR 3 || 3`,2 xor (3 or 3) AS `2 XOR (3 || 3)`,2 xor 3 or 3 AS `(2 XOR 3) || 3` +select 2 XOR 3 || 3, 2 XOR (3 || 3), (2 XOR 3) || 3 union select * from v1; +2 XOR 3 || 3 2 XOR (3 || 3) (2 XOR 3) || 3 +1 0 1 +create or replace view v1 as select 2 XOR 0 AND 0, 2 XOR (0 AND 0), (2 XOR 0) AND 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 xor 0 and 0 AS `2 XOR 0 AND 0`,2 xor 0 and 0 AS `2 XOR (0 AND 0)`,(2 xor 0) and 0 AS `(2 XOR 0) AND 0` +select 2 XOR 0 AND 0, 2 XOR (0 AND 0), (2 XOR 0) AND 0 union select * from v1; +2 XOR 0 AND 0 2 XOR (0 AND 0) (2 XOR 0) AND 0 +1 1 0 +create or replace view v1 as select 2 XOR 0 && 0, 2 XOR (0 && 0), (2 XOR 0) && 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 xor 0 and 0 AS `2 XOR 0 && 0`,2 xor 0 and 0 AS `2 XOR (0 && 0)`,(2 xor 0) and 0 AS `(2 XOR 0) && 0` +select 2 XOR 0 && 0, 2 XOR (0 && 0), (2 XOR 0) && 0 union select * from v1; +2 XOR 0 && 0 2 XOR (0 && 0) (2 XOR 0) && 0 +1 1 0 +create or replace view v1 as select 2 XOR 2 = 3, 2 XOR (2 = 3), (2 XOR 2) = 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 xor 2 = 3 AS `2 XOR 2 = 3`,2 xor 2 = 3 AS `2 XOR (2 = 3)`,(2 xor 2) = 3 AS `(2 XOR 2) = 3` +select 2 XOR 2 = 3, 2 XOR (2 = 3), (2 XOR 2) = 3 union select * from v1; +2 XOR 2 = 3 2 XOR (2 = 3) (2 XOR 2) = 3 +1 1 0 +create or replace view v1 as select NULL XOR 3 <=> 3, NULL XOR (3 <=> 3), (NULL XOR 3) <=> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select NULL xor 3 <=> 3 AS `NULL XOR 3 <=> 3`,NULL xor 3 <=> 3 AS `NULL XOR (3 <=> 3)`,(NULL xor 3) <=> 3 AS `(NULL XOR 3) <=> 3` +select NULL XOR 3 <=> 3, NULL XOR (3 <=> 3), (NULL XOR 3) <=> 3 union select * from v1; +NULL XOR 3 <=> 3 NULL XOR (3 <=> 3) (NULL XOR 3) <=> 3 +NULL NULL 0 +create or replace view v1 as select 2 XOR 1 >= 3, 2 XOR (1 >= 3), (2 XOR 1) >= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 xor 1 >= 3 AS `2 XOR 1 >= 3`,2 xor 1 >= 3 AS `2 XOR (1 >= 3)`,(2 xor 1) >= 3 AS `(2 XOR 1) >= 3` +select 2 XOR 1 >= 3, 2 XOR (1 >= 3), (2 XOR 1) >= 3 union select * from v1; +2 XOR 1 >= 3 2 XOR (1 >= 3) (2 XOR 1) >= 3 +1 1 0 +create or replace view v1 as select 2 XOR 3 <= 3, 2 XOR (3 <= 3), (2 XOR 3) <= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 xor 3 <= 3 AS `2 XOR 3 <= 3`,2 xor 3 <= 3 AS `2 XOR (3 <= 3)`,(2 xor 3) <= 3 AS `(2 XOR 3) <= 3` +select 2 XOR 3 <= 3, 2 XOR (3 <= 3), (2 XOR 3) <= 3 union select * from v1; +2 XOR 3 <= 3 2 XOR (3 <= 3) (2 XOR 3) <= 3 +0 0 1 +create or replace view v1 as select 2 XOR 1 < 3, 2 XOR (1 < 3), (2 XOR 1) < 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 xor 1 < 3 AS `2 XOR 1 < 3`,2 xor 1 < 3 AS `2 XOR (1 < 3)`,(2 xor 1) < 3 AS `(2 XOR 1) < 3` +select 2 XOR 1 < 3, 2 XOR (1 < 3), (2 XOR 1) < 3 union select * from v1; +2 XOR 1 < 3 2 XOR (1 < 3) (2 XOR 1) < 3 +0 0 1 +create or replace view v1 as select 2 XOR 2 <> 3, 2 XOR (2 <> 3), (2 XOR 2) <> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 xor 2 <> 3 AS `2 XOR 2 <> 3`,2 xor 2 <> 3 AS `2 XOR (2 <> 3)`,(2 xor 2) <> 3 AS `(2 XOR 2) <> 3` +select 2 XOR 2 <> 3, 2 XOR (2 <> 3), (2 XOR 2) <> 3 union select * from v1; +2 XOR 2 <> 3 2 XOR (2 <> 3) (2 XOR 2) <> 3 +0 0 1 +create or replace view v1 as select 2 XOR 3 > 3, 2 XOR (3 > 3), (2 XOR 3) > 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 xor 3 > 3 AS `2 XOR 3 > 3`,2 xor 3 > 3 AS `2 XOR (3 > 3)`,(2 xor 3) > 3 AS `(2 XOR 3) > 3` +select 2 XOR 3 > 3, 2 XOR (3 > 3), (2 XOR 3) > 3 union select * from v1; +2 XOR 3 > 3 2 XOR (3 > 3) (2 XOR 3) > 3 +1 1 0 +create or replace view v1 as select 2 XOR 2 != 3, 2 XOR (2 != 3), (2 XOR 2) != 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 xor 2 <> 3 AS `2 XOR 2 != 3`,2 xor 2 <> 3 AS `2 XOR (2 != 3)`,(2 xor 2) <> 3 AS `(2 XOR 2) != 3` +select 2 XOR 2 != 3, 2 XOR (2 != 3), (2 XOR 2) != 3 union select * from v1; +2 XOR 2 != 3 2 XOR (2 != 3) (2 XOR 2) != 3 +0 0 1 +create or replace view v1 as select 2 XOR 1 LIKE 3, 2 XOR (1 LIKE 3), (2 XOR 1) LIKE 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 xor 1 like 3 AS `2 XOR 1 LIKE 3`,2 xor 1 like 3 AS `2 XOR (1 LIKE 3)`,(2 xor 1) like 3 AS `(2 XOR 1) LIKE 3` +select 2 XOR 1 LIKE 3, 2 XOR (1 LIKE 3), (2 XOR 1) LIKE 3 union select * from v1; +2 XOR 1 LIKE 3 2 XOR (1 LIKE 3) (2 XOR 1) LIKE 3 +1 1 0 +create or replace view v1 as select 2 XOR 1 REGEXP 3, 2 XOR (1 REGEXP 3), (2 XOR 1) REGEXP 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 xor 1 regexp 3 AS `2 XOR 1 REGEXP 3`,2 xor 1 regexp 3 AS `2 XOR (1 REGEXP 3)`,(2 xor 1) regexp 3 AS `(2 XOR 1) REGEXP 3` +select 2 XOR 1 REGEXP 3, 2 XOR (1 REGEXP 3), (2 XOR 1) REGEXP 3 union select * from v1; +2 XOR 1 REGEXP 3 2 XOR (1 REGEXP 3) (2 XOR 1) REGEXP 3 +1 1 0 +create or replace view v1 as select 2 XOR 3 | 3, 2 XOR (3 | 3), (2 XOR 3) | 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 xor 3 | 3 AS `2 XOR 3 | 3`,2 xor 3 | 3 AS `2 XOR (3 | 3)`,(2 xor 3) | 3 AS `(2 XOR 3) | 3` +select 2 XOR 3 | 3, 2 XOR (3 | 3), (2 XOR 3) | 3 union select * from v1; +2 XOR 3 | 3 2 XOR (3 | 3) (2 XOR 3) | 3 +0 0 3 +create or replace view v1 as select 2 XOR 0 & 0, 2 XOR (0 & 0), (2 XOR 0) & 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 xor 0 & 0 AS `2 XOR 0 & 0`,2 xor 0 & 0 AS `2 XOR (0 & 0)`,(2 xor 0) & 0 AS `(2 XOR 0) & 0` +select 2 XOR 0 & 0, 2 XOR (0 & 0), (2 XOR 0) & 0 union select * from v1; +2 XOR 0 & 0 2 XOR (0 & 0) (2 XOR 0) & 0 +1 1 0 +create or replace view v1 as select 0 XOR 3 << 3, 0 XOR (3 << 3), (0 XOR 3) << 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 0 xor 3 << 3 AS `0 XOR 3 << 3`,0 xor 3 << 3 AS `0 XOR (3 << 3)`,(0 xor 3) << 3 AS `(0 XOR 3) << 3` +select 0 XOR 3 << 3, 0 XOR (3 << 3), (0 XOR 3) << 3 union select * from v1; +0 XOR 3 << 3 0 XOR (3 << 3) (0 XOR 3) << 3 +1 1 8 +create or replace view v1 as select 2 XOR 3 >> 3, 2 XOR (3 >> 3), (2 XOR 3) >> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 xor 3 >> 3 AS `2 XOR 3 >> 3`,2 xor 3 >> 3 AS `2 XOR (3 >> 3)`,(2 xor 3) >> 3 AS `(2 XOR 3) >> 3` +select 2 XOR 3 >> 3, 2 XOR (3 >> 3), (2 XOR 3) >> 3 union select * from v1; +2 XOR 3 >> 3 2 XOR (3 >> 3) (2 XOR 3) >> 3 +1 1 0 +create or replace view v1 as select 2 XOR '2000-01-01' +INTERVAL 1 DAY, 2 XOR ('2000-01-01' +INTERVAL 1 DAY), (2 XOR '2000-01-01') +INTERVAL 1 DAY; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 xor '2000-01-01' + interval 1 day AS `2 XOR '2000-01-01' +INTERVAL 1 DAY`,2 xor '2000-01-01' + interval 1 day AS `2 XOR ('2000-01-01' +INTERVAL 1 DAY)`,(2 xor '2000-01-01') + interval 1 day AS `(2 XOR '2000-01-01') +INTERVAL 1 DAY` +select 2 XOR '2000-01-01' +INTERVAL 1 DAY, 2 XOR ('2000-01-01' +INTERVAL 1 DAY), (2 XOR '2000-01-01') +INTERVAL 1 DAY union select * from v1; +2 XOR '2000-01-01' +INTERVAL 1 DAY 2 XOR ('2000-01-01' +INTERVAL 1 DAY) (2 XOR '2000-01-01') +INTERVAL 1 DAY +0 0 NULL +create or replace view v1 as select 2 XOR 3 + 3, 2 XOR (3 + 3), (2 XOR 3) + 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 xor 3 + 3 AS `2 XOR 3 + 3`,2 xor 3 + 3 AS `2 XOR (3 + 3)`,(2 xor 3) + 3 AS `(2 XOR 3) + 3` +select 2 XOR 3 + 3, 2 XOR (3 + 3), (2 XOR 3) + 3 union select * from v1; +2 XOR 3 + 3 2 XOR (3 + 3) (2 XOR 3) + 3 +0 0 3 +create or replace view v1 as select 2 XOR 3 - 3, 2 XOR (3 - 3), (2 XOR 3) - 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 xor 3 - 3 AS `2 XOR 3 - 3`,2 xor 3 - 3 AS `2 XOR (3 - 3)`,(2 xor 3) - 3 AS `(2 XOR 3) - 3` +select 2 XOR 3 - 3, 2 XOR (3 - 3), (2 XOR 3) - 3 union select * from v1; +2 XOR 3 - 3 2 XOR (3 - 3) (2 XOR 3) - 3 +1 1 -3 +create or replace view v1 as select 0 XOR 3 * 3, 0 XOR (3 * 3), (0 XOR 3) * 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 0 xor 3 * 3 AS `0 XOR 3 * 3`,0 xor 3 * 3 AS `0 XOR (3 * 3)`,(0 xor 3) * 3 AS `(0 XOR 3) * 3` +select 0 XOR 3 * 3, 0 XOR (3 * 3), (0 XOR 3) * 3 union select * from v1; +0 XOR 3 * 3 0 XOR (3 * 3) (0 XOR 3) * 3 +1 1 3 +create or replace view v1 as select 0 XOR 3 / 3, 0 XOR (3 / 3), (0 XOR 3) / 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 0 xor 3 / 3 AS `0 XOR 3 / 3`,0 xor 3 / 3 AS `0 XOR (3 / 3)`,(0 xor 3) / 3 AS `(0 XOR 3) / 3` +select 0 XOR 3 / 3, 0 XOR (3 / 3), (0 XOR 3) / 3 union select * from v1; +0 XOR 3 / 3 0 XOR (3 / 3) (0 XOR 3) / 3 +1 1 0.3333 +create or replace view v1 as select 0 XOR 3 DIV 3, 0 XOR (3 DIV 3), (0 XOR 3) DIV 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 0 xor 3 DIV 3 AS `0 XOR 3 DIV 3`,0 xor 3 DIV 3 AS `0 XOR (3 DIV 3)`,(0 xor 3) DIV 3 AS `(0 XOR 3) DIV 3` +select 0 XOR 3 DIV 3, 0 XOR (3 DIV 3), (0 XOR 3) DIV 3 union select * from v1; +0 XOR 3 DIV 3 0 XOR (3 DIV 3) (0 XOR 3) DIV 3 +1 1 0 +create or replace view v1 as select 2 XOR 3 MOD 3, 2 XOR (3 MOD 3), (2 XOR 3) MOD 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 xor 3 MOD 3 AS `2 XOR 3 MOD 3`,2 xor 3 MOD 3 AS `2 XOR (3 MOD 3)`,(2 xor 3) MOD 3 AS `(2 XOR 3) MOD 3` +select 2 XOR 3 MOD 3, 2 XOR (3 MOD 3), (2 XOR 3) MOD 3 union select * from v1; +2 XOR 3 MOD 3 2 XOR (3 MOD 3) (2 XOR 3) MOD 3 +1 1 0 +create or replace view v1 as select 2 XOR 3 % 3, 2 XOR (3 % 3), (2 XOR 3) % 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 xor 3 MOD 3 AS `2 XOR 3 % 3`,2 xor 3 MOD 3 AS `2 XOR (3 % 3)`,(2 xor 3) MOD 3 AS `(2 XOR 3) % 3` +select 2 XOR 3 % 3, 2 XOR (3 % 3), (2 XOR 3) % 3 union select * from v1; +2 XOR 3 % 3 2 XOR (3 % 3) (2 XOR 3) % 3 +1 1 0 +create or replace view v1 as select 2 XOR 3 ^ 3, 2 XOR (3 ^ 3), (2 XOR 3) ^ 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 xor 3 ^ 3 AS `2 XOR 3 ^ 3`,2 xor 3 ^ 3 AS `2 XOR (3 ^ 3)`,(2 xor 3) ^ 3 AS `(2 XOR 3) ^ 3` +select 2 XOR 3 ^ 3, 2 XOR (3 ^ 3), (2 XOR 3) ^ 3 union select * from v1; +2 XOR 3 ^ 3 2 XOR (3 ^ 3) (2 XOR 3) ^ 3 +1 1 3 +create or replace view v1 as select 2 XOR 3 BETWEEN 0 AND 3, 2 XOR (3 BETWEEN 0 AND 3), (2 XOR 3) BETWEEN 0 AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 xor 3 between 0 and 3 AS `2 XOR 3 BETWEEN 0 AND 3`,2 xor 3 between 0 and 3 AS `2 XOR (3 BETWEEN 0 AND 3)`,(2 xor 3) between 0 and 3 AS `(2 XOR 3) BETWEEN 0 AND 3` +select 2 XOR 3 BETWEEN 0 AND 3, 2 XOR (3 BETWEEN 0 AND 3), (2 XOR 3) BETWEEN 0 AND 3 union select * from v1; +2 XOR 3 BETWEEN 0 AND 3 2 XOR (3 BETWEEN 0 AND 3) (2 XOR 3) BETWEEN 0 AND 3 +0 0 1 +create or replace view v1 as select 0 AND 3 IS FALSE, 0 AND (3 IS FALSE), (0 AND 3) IS FALSE; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 0 and 3 is false AS `0 AND 3 IS FALSE`,0 and 3 is false AS `0 AND (3 IS FALSE)`,(0 and 3) is false AS `(0 AND 3) IS FALSE` +select 0 AND 3 IS FALSE, 0 AND (3 IS FALSE), (0 AND 3) IS FALSE union select * from v1; +0 AND 3 IS FALSE 0 AND (3 IS FALSE) (0 AND 3) IS FALSE +0 0 1 +create or replace view v1 as select charset(2 AND 3 COLLATE latin1_bin), charset(2 AND (3 COLLATE latin1_bin)), charset((2 AND 3) COLLATE latin1_bin); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select charset(2 and 3 collate latin1_bin) AS `charset(2 AND 3 COLLATE latin1_bin)`,charset(2 and 3 collate latin1_bin) AS `charset(2 AND (3 COLLATE latin1_bin))`,charset((2 and 3) collate latin1_bin) AS `charset((2 AND 3) COLLATE latin1_bin)` +select charset(2 AND 3 COLLATE latin1_bin), charset(2 AND (3 COLLATE latin1_bin)), charset((2 AND 3) COLLATE latin1_bin) union select * from v1; +charset(2 AND 3 COLLATE latin1_bin) charset(2 AND (3 COLLATE latin1_bin)) charset((2 AND 3) COLLATE latin1_bin) +binary binary latin1 +create or replace view v1 as select 2 AND 3 IN (0,1), 2 AND (3 IN (0,1)), (2 AND 3) IN (0,1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 and 3 in (0,1) AS `2 AND 3 IN (0,1)`,2 and 3 in (0,1) AS `2 AND (3 IN (0,1))`,(2 and 3) in (0,1) AS `(2 AND 3) IN (0,1)` +select 2 AND 3 IN (0,1), 2 AND (3 IN (0,1)), (2 AND 3) IN (0,1) union select * from v1; +2 AND 3 IN (0,1) 2 AND (3 IN (0,1)) (2 AND 3) IN (0,1) +0 0 1 +create or replace view v1 as select 0 AND 3 OR 3, 0 AND (3 OR 3), (0 AND 3) OR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 0 and 3 or 3 AS `0 AND 3 OR 3`,0 and (3 or 3) AS `0 AND (3 OR 3)`,0 and 3 or 3 AS `(0 AND 3) OR 3` +select 0 AND 3 OR 3, 0 AND (3 OR 3), (0 AND 3) OR 3 union select * from v1; +0 AND 3 OR 3 0 AND (3 OR 3) (0 AND 3) OR 3 +1 0 1 +create or replace view v1 as select 0 AND 3 || 3, 0 AND (3 || 3), (0 AND 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 0 and 3 or 3 AS `0 AND 3 || 3`,0 and (3 or 3) AS `0 AND (3 || 3)`,0 and 3 or 3 AS `(0 AND 3) || 3` +select 0 AND 3 || 3, 0 AND (3 || 3), (0 AND 3) || 3 union select * from v1; +0 AND 3 || 3 0 AND (3 || 3) (0 AND 3) || 3 +1 0 1 +create or replace view v1 as select 0 AND 3 XOR 3, 0 AND (3 XOR 3), (0 AND 3) XOR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 0 and 3 xor 3 AS `0 AND 3 XOR 3`,0 and (3 xor 3) AS `0 AND (3 XOR 3)`,0 and 3 xor 3 AS `(0 AND 3) XOR 3` +select 0 AND 3 XOR 3, 0 AND (3 XOR 3), (0 AND 3) XOR 3 union select * from v1; +0 AND 3 XOR 3 0 AND (3 XOR 3) (0 AND 3) XOR 3 +1 0 1 +create or replace view v1 as select 2 AND 3 = 3, 2 AND (3 = 3), (2 AND 3) = 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 and 3 = 3 AS `2 AND 3 = 3`,2 and 3 = 3 AS `2 AND (3 = 3)`,(2 and 3) = 3 AS `(2 AND 3) = 3` +select 2 AND 3 = 3, 2 AND (3 = 3), (2 AND 3) = 3 union select * from v1; +2 AND 3 = 3 2 AND (3 = 3) (2 AND 3) = 3 +1 1 0 +create or replace view v1 as select 2 AND 3 <=> 3, 2 AND (3 <=> 3), (2 AND 3) <=> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 and 3 <=> 3 AS `2 AND 3 <=> 3`,2 and 3 <=> 3 AS `2 AND (3 <=> 3)`,(2 and 3) <=> 3 AS `(2 AND 3) <=> 3` +select 2 AND 3 <=> 3, 2 AND (3 <=> 3), (2 AND 3) <=> 3 union select * from v1; +2 AND 3 <=> 3 2 AND (3 <=> 3) (2 AND 3) <=> 3 +1 1 0 +create or replace view v1 as select 2 AND 3 >= 3, 2 AND (3 >= 3), (2 AND 3) >= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 and 3 >= 3 AS `2 AND 3 >= 3`,2 and 3 >= 3 AS `2 AND (3 >= 3)`,(2 and 3) >= 3 AS `(2 AND 3) >= 3` +select 2 AND 3 >= 3, 2 AND (3 >= 3), (2 AND 3) >= 3 union select * from v1; +2 AND 3 >= 3 2 AND (3 >= 3) (2 AND 3) >= 3 +1 1 0 +create or replace view v1 as select 2 AND 4 <= 3, 2 AND (4 <= 3), (2 AND 4) <= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 and 4 <= 3 AS `2 AND 4 <= 3`,2 and 4 <= 3 AS `2 AND (4 <= 3)`,(2 and 4) <= 3 AS `(2 AND 4) <= 3` +select 2 AND 4 <= 3, 2 AND (4 <= 3), (2 AND 4) <= 3 union select * from v1; +2 AND 4 <= 3 2 AND (4 <= 3) (2 AND 4) <= 3 +0 0 1 +create or replace view v1 as select 2 AND 3 < 3, 2 AND (3 < 3), (2 AND 3) < 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 and 3 < 3 AS `2 AND 3 < 3`,2 and 3 < 3 AS `2 AND (3 < 3)`,(2 and 3) < 3 AS `(2 AND 3) < 3` +select 2 AND 3 < 3, 2 AND (3 < 3), (2 AND 3) < 3 union select * from v1; +2 AND 3 < 3 2 AND (3 < 3) (2 AND 3) < 3 +0 0 1 +create or replace view v1 as select 2 AND 3 <> 3, 2 AND (3 <> 3), (2 AND 3) <> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 and 3 <> 3 AS `2 AND 3 <> 3`,2 and 3 <> 3 AS `2 AND (3 <> 3)`,(2 and 3) <> 3 AS `(2 AND 3) <> 3` +select 2 AND 3 <> 3, 2 AND (3 <> 3), (2 AND 3) <> 3 union select * from v1; +2 AND 3 <> 3 2 AND (3 <> 3) (2 AND 3) <> 3 +0 0 1 +create or replace view v1 as select 2 AND 3 > 1, 2 AND (3 > 1), (2 AND 3) > 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 and 3 > 1 AS `2 AND 3 > 1`,2 and 3 > 1 AS `2 AND (3 > 1)`,(2 and 3) > 1 AS `(2 AND 3) > 1` +select 2 AND 3 > 1, 2 AND (3 > 1), (2 AND 3) > 1 union select * from v1; +2 AND 3 > 1 2 AND (3 > 1) (2 AND 3) > 1 +1 1 0 +create or replace view v1 as select 2 AND 3 != 3, 2 AND (3 != 3), (2 AND 3) != 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 and 3 <> 3 AS `2 AND 3 != 3`,2 and 3 <> 3 AS `2 AND (3 != 3)`,(2 and 3) <> 3 AS `(2 AND 3) != 3` +select 2 AND 3 != 3, 2 AND (3 != 3), (2 AND 3) != 3 union select * from v1; +2 AND 3 != 3 2 AND (3 != 3) (2 AND 3) != 3 +0 0 1 +create or replace view v1 as select 2 AND 3 LIKE 3, 2 AND (3 LIKE 3), (2 AND 3) LIKE 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 and 3 like 3 AS `2 AND 3 LIKE 3`,2 and 3 like 3 AS `2 AND (3 LIKE 3)`,(2 and 3) like 3 AS `(2 AND 3) LIKE 3` +select 2 AND 3 LIKE 3, 2 AND (3 LIKE 3), (2 AND 3) LIKE 3 union select * from v1; +2 AND 3 LIKE 3 2 AND (3 LIKE 3) (2 AND 3) LIKE 3 +1 1 0 +create or replace view v1 as select 2 AND 3 REGEXP 3, 2 AND (3 REGEXP 3), (2 AND 3) REGEXP 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 and 3 regexp 3 AS `2 AND 3 REGEXP 3`,2 and 3 regexp 3 AS `2 AND (3 REGEXP 3)`,(2 and 3) regexp 3 AS `(2 AND 3) REGEXP 3` +select 2 AND 3 REGEXP 3, 2 AND (3 REGEXP 3), (2 AND 3) REGEXP 3 union select * from v1; +2 AND 3 REGEXP 3 2 AND (3 REGEXP 3) (2 AND 3) REGEXP 3 +1 1 0 +create or replace view v1 as select 2 AND 3 | 3, 2 AND (3 | 3), (2 AND 3) | 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 and 3 | 3 AS `2 AND 3 | 3`,2 and 3 | 3 AS `2 AND (3 | 3)`,(2 and 3) | 3 AS `(2 AND 3) | 3` +select 2 AND 3 | 3, 2 AND (3 | 3), (2 AND 3) | 3 union select * from v1; +2 AND 3 | 3 2 AND (3 | 3) (2 AND 3) | 3 +1 1 3 +create or replace view v1 as select 2 AND 2 & 2, 2 AND (2 & 2), (2 AND 2) & 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 and 2 & 2 AS `2 AND 2 & 2`,2 and 2 & 2 AS `2 AND (2 & 2)`,(2 and 2) & 2 AS `(2 AND 2) & 2` +select 2 AND 2 & 2, 2 AND (2 & 2), (2 AND 2) & 2 union select * from v1; +2 AND 2 & 2 2 AND (2 & 2) (2 AND 2) & 2 +1 1 0 +create or replace view v1 as select 2 AND 3 << 3, 2 AND (3 << 3), (2 AND 3) << 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 and 3 << 3 AS `2 AND 3 << 3`,2 and 3 << 3 AS `2 AND (3 << 3)`,(2 and 3) << 3 AS `(2 AND 3) << 3` +select 2 AND 3 << 3, 2 AND (3 << 3), (2 AND 3) << 3 union select * from v1; +2 AND 3 << 3 2 AND (3 << 3) (2 AND 3) << 3 +1 1 8 +create or replace view v1 as select 2 AND 3 >> 1, 2 AND (3 >> 1), (2 AND 3) >> 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 and 3 >> 1 AS `2 AND 3 >> 1`,2 and 3 >> 1 AS `2 AND (3 >> 1)`,(2 and 3) >> 1 AS `(2 AND 3) >> 1` +select 2 AND 3 >> 1, 2 AND (3 >> 1), (2 AND 3) >> 1 union select * from v1; +2 AND 3 >> 1 2 AND (3 >> 1) (2 AND 3) >> 1 +1 1 0 +create or replace view v1 as select 2 AND '2000-01-01' +INTERVAL 1 DAY, 2 AND ('2000-01-01' +INTERVAL 1 DAY), (2 AND '2000-01-01') +INTERVAL 1 DAY; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 and '2000-01-01' + interval 1 day AS `2 AND '2000-01-01' +INTERVAL 1 DAY`,2 and '2000-01-01' + interval 1 day AS `2 AND ('2000-01-01' +INTERVAL 1 DAY)`,(2 and '2000-01-01') + interval 1 day AS `(2 AND '2000-01-01') +INTERVAL 1 DAY` +select 2 AND '2000-01-01' +INTERVAL 1 DAY, 2 AND ('2000-01-01' +INTERVAL 1 DAY), (2 AND '2000-01-01') +INTERVAL 1 DAY union select * from v1; +2 AND '2000-01-01' +INTERVAL 1 DAY 2 AND ('2000-01-01' +INTERVAL 1 DAY) (2 AND '2000-01-01') +INTERVAL 1 DAY +1 1 NULL +create or replace view v1 as select 2 AND 3 + 3, 2 AND (3 + 3), (2 AND 3) + 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 and 3 + 3 AS `2 AND 3 + 3`,2 and 3 + 3 AS `2 AND (3 + 3)`,(2 and 3) + 3 AS `(2 AND 3) + 3` +select 2 AND 3 + 3, 2 AND (3 + 3), (2 AND 3) + 3 union select * from v1; +2 AND 3 + 3 2 AND (3 + 3) (2 AND 3) + 3 +1 1 4 +create or replace view v1 as select 2 AND 3 - 3, 2 AND (3 - 3), (2 AND 3) - 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 and 3 - 3 AS `2 AND 3 - 3`,2 and 3 - 3 AS `2 AND (3 - 3)`,(2 and 3) - 3 AS `(2 AND 3) - 3` +select 2 AND 3 - 3, 2 AND (3 - 3), (2 AND 3) - 3 union select * from v1; +2 AND 3 - 3 2 AND (3 - 3) (2 AND 3) - 3 +0 0 -2 +create or replace view v1 as select 2 AND 3 * 3, 2 AND (3 * 3), (2 AND 3) * 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 and 3 * 3 AS `2 AND 3 * 3`,2 and 3 * 3 AS `2 AND (3 * 3)`,(2 and 3) * 3 AS `(2 AND 3) * 3` +select 2 AND 3 * 3, 2 AND (3 * 3), (2 AND 3) * 3 union select * from v1; +2 AND 3 * 3 2 AND (3 * 3) (2 AND 3) * 3 +1 1 3 +create or replace view v1 as select 2 AND 3 / 3, 2 AND (3 / 3), (2 AND 3) / 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 and 3 / 3 AS `2 AND 3 / 3`,2 and 3 / 3 AS `2 AND (3 / 3)`,(2 and 3) / 3 AS `(2 AND 3) / 3` +select 2 AND 3 / 3, 2 AND (3 / 3), (2 AND 3) / 3 union select * from v1; +2 AND 3 / 3 2 AND (3 / 3) (2 AND 3) / 3 +1 1 0.3333 +create or replace view v1 as select 2 AND 3 DIV 3, 2 AND (3 DIV 3), (2 AND 3) DIV 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 and 3 DIV 3 AS `2 AND 3 DIV 3`,2 and 3 DIV 3 AS `2 AND (3 DIV 3)`,(2 and 3) DIV 3 AS `(2 AND 3) DIV 3` +select 2 AND 3 DIV 3, 2 AND (3 DIV 3), (2 AND 3) DIV 3 union select * from v1; +2 AND 3 DIV 3 2 AND (3 DIV 3) (2 AND 3) DIV 3 +1 1 0 +create or replace view v1 as select 2 AND 3 MOD 3, 2 AND (3 MOD 3), (2 AND 3) MOD 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 and 3 MOD 3 AS `2 AND 3 MOD 3`,2 and 3 MOD 3 AS `2 AND (3 MOD 3)`,(2 and 3) MOD 3 AS `(2 AND 3) MOD 3` +select 2 AND 3 MOD 3, 2 AND (3 MOD 3), (2 AND 3) MOD 3 union select * from v1; +2 AND 3 MOD 3 2 AND (3 MOD 3) (2 AND 3) MOD 3 +0 0 1 +create or replace view v1 as select 2 AND 3 % 3, 2 AND (3 % 3), (2 AND 3) % 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 and 3 MOD 3 AS `2 AND 3 % 3`,2 and 3 MOD 3 AS `2 AND (3 % 3)`,(2 and 3) MOD 3 AS `(2 AND 3) % 3` +select 2 AND 3 % 3, 2 AND (3 % 3), (2 AND 3) % 3 union select * from v1; +2 AND 3 % 3 2 AND (3 % 3) (2 AND 3) % 3 +0 0 1 +create or replace view v1 as select 2 AND 3 ^ 3, 2 AND (3 ^ 3), (2 AND 3) ^ 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 and 3 ^ 3 AS `2 AND 3 ^ 3`,2 and 3 ^ 3 AS `2 AND (3 ^ 3)`,(2 and 3) ^ 3 AS `(2 AND 3) ^ 3` +select 2 AND 3 ^ 3, 2 AND (3 ^ 3), (2 AND 3) ^ 3 union select * from v1; +2 AND 3 ^ 3 2 AND (3 ^ 3) (2 AND 3) ^ 3 +0 0 2 +create or replace view v1 as select 2 AND 3 BETWEEN 2 AND 3, 2 AND (3 BETWEEN 2 AND 3), (2 AND 3) BETWEEN 2 AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 and 3 between 2 and 3 AS `2 AND 3 BETWEEN 2 AND 3`,2 and 3 between 2 and 3 AS `2 AND (3 BETWEEN 2 AND 3)`,(2 and 3) between 2 and 3 AS `(2 AND 3) BETWEEN 2 AND 3` +select 2 AND 3 BETWEEN 2 AND 3, 2 AND (3 BETWEEN 2 AND 3), (2 AND 3) BETWEEN 2 AND 3 union select * from v1; +2 AND 3 BETWEEN 2 AND 3 2 AND (3 BETWEEN 2 AND 3) (2 AND 3) BETWEEN 2 AND 3 +1 1 0 +create or replace view v1 as select 0 && 3 IS FALSE, 0 && (3 IS FALSE), (0 && 3) IS FALSE; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 0 and 3 is false AS `0 && 3 IS FALSE`,0 and 3 is false AS `0 && (3 IS FALSE)`,(0 and 3) is false AS `(0 && 3) IS FALSE` +select 0 && 3 IS FALSE, 0 && (3 IS FALSE), (0 && 3) IS FALSE union select * from v1; +0 && 3 IS FALSE 0 && (3 IS FALSE) (0 && 3) IS FALSE +0 0 1 +create or replace view v1 as select charset(2 && 3 COLLATE latin1_bin), charset(2 && (3 COLLATE latin1_bin)), charset((2 && 3) COLLATE latin1_bin); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select charset(2 and 3 collate latin1_bin) AS `charset(2 && 3 COLLATE latin1_bin)`,charset(2 and 3 collate latin1_bin) AS `charset(2 && (3 COLLATE latin1_bin))`,charset((2 and 3) collate latin1_bin) AS `charset((2 && 3) COLLATE latin1_bin)` +select charset(2 && 3 COLLATE latin1_bin), charset(2 && (3 COLLATE latin1_bin)), charset((2 && 3) COLLATE latin1_bin) union select * from v1; +charset(2 && 3 COLLATE latin1_bin) charset(2 && (3 COLLATE latin1_bin)) charset((2 && 3) COLLATE latin1_bin) +binary binary latin1 +create or replace view v1 as select 2 && 3 IN (0,1), 2 && (3 IN (0,1)), (2 && 3) IN (0,1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 and 3 in (0,1) AS `2 && 3 IN (0,1)`,2 and 3 in (0,1) AS `2 && (3 IN (0,1))`,(2 and 3) in (0,1) AS `(2 && 3) IN (0,1)` +select 2 && 3 IN (0,1), 2 && (3 IN (0,1)), (2 && 3) IN (0,1) union select * from v1; +2 && 3 IN (0,1) 2 && (3 IN (0,1)) (2 && 3) IN (0,1) +0 0 1 +create or replace view v1 as select 0 && 3 OR 3, 0 && (3 OR 3), (0 && 3) OR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 0 and 3 or 3 AS `0 && 3 OR 3`,0 and (3 or 3) AS `0 && (3 OR 3)`,0 and 3 or 3 AS `(0 && 3) OR 3` +select 0 && 3 OR 3, 0 && (3 OR 3), (0 && 3) OR 3 union select * from v1; +0 && 3 OR 3 0 && (3 OR 3) (0 && 3) OR 3 +1 0 1 +create or replace view v1 as select 0 && 3 || 3, 0 && (3 || 3), (0 && 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 0 and 3 or 3 AS `0 && 3 || 3`,0 and (3 or 3) AS `0 && (3 || 3)`,0 and 3 or 3 AS `(0 && 3) || 3` +select 0 && 3 || 3, 0 && (3 || 3), (0 && 3) || 3 union select * from v1; +0 && 3 || 3 0 && (3 || 3) (0 && 3) || 3 +1 0 1 +create or replace view v1 as select 0 && 3 XOR 3, 0 && (3 XOR 3), (0 && 3) XOR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 0 and 3 xor 3 AS `0 && 3 XOR 3`,0 and (3 xor 3) AS `0 && (3 XOR 3)`,0 and 3 xor 3 AS `(0 && 3) XOR 3` +select 0 && 3 XOR 3, 0 && (3 XOR 3), (0 && 3) XOR 3 union select * from v1; +0 && 3 XOR 3 0 && (3 XOR 3) (0 && 3) XOR 3 +1 0 1 +create or replace view v1 as select 2 && 3 = 3, 2 && (3 = 3), (2 && 3) = 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 and 3 = 3 AS `2 && 3 = 3`,2 and 3 = 3 AS `2 && (3 = 3)`,(2 and 3) = 3 AS `(2 && 3) = 3` +select 2 && 3 = 3, 2 && (3 = 3), (2 && 3) = 3 union select * from v1; +2 && 3 = 3 2 && (3 = 3) (2 && 3) = 3 +1 1 0 +create or replace view v1 as select 2 && 3 <=> 3, 2 && (3 <=> 3), (2 && 3) <=> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 and 3 <=> 3 AS `2 && 3 <=> 3`,2 and 3 <=> 3 AS `2 && (3 <=> 3)`,(2 and 3) <=> 3 AS `(2 && 3) <=> 3` +select 2 && 3 <=> 3, 2 && (3 <=> 3), (2 && 3) <=> 3 union select * from v1; +2 && 3 <=> 3 2 && (3 <=> 3) (2 && 3) <=> 3 +1 1 0 +create or replace view v1 as select 2 && 3 >= 3, 2 && (3 >= 3), (2 && 3) >= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 and 3 >= 3 AS `2 && 3 >= 3`,2 and 3 >= 3 AS `2 && (3 >= 3)`,(2 and 3) >= 3 AS `(2 && 3) >= 3` +select 2 && 3 >= 3, 2 && (3 >= 3), (2 && 3) >= 3 union select * from v1; +2 && 3 >= 3 2 && (3 >= 3) (2 && 3) >= 3 +1 1 0 +create or replace view v1 as select 2 && 4 <= 3, 2 && (4 <= 3), (2 && 4) <= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 and 4 <= 3 AS `2 && 4 <= 3`,2 and 4 <= 3 AS `2 && (4 <= 3)`,(2 and 4) <= 3 AS `(2 && 4) <= 3` +select 2 && 4 <= 3, 2 && (4 <= 3), (2 && 4) <= 3 union select * from v1; +2 && 4 <= 3 2 && (4 <= 3) (2 && 4) <= 3 +0 0 1 +create or replace view v1 as select 2 && 3 < 3, 2 && (3 < 3), (2 && 3) < 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 and 3 < 3 AS `2 && 3 < 3`,2 and 3 < 3 AS `2 && (3 < 3)`,(2 and 3) < 3 AS `(2 && 3) < 3` +select 2 && 3 < 3, 2 && (3 < 3), (2 && 3) < 3 union select * from v1; +2 && 3 < 3 2 && (3 < 3) (2 && 3) < 3 +0 0 1 +create or replace view v1 as select 2 && 3 <> 3, 2 && (3 <> 3), (2 && 3) <> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 and 3 <> 3 AS `2 && 3 <> 3`,2 and 3 <> 3 AS `2 && (3 <> 3)`,(2 and 3) <> 3 AS `(2 && 3) <> 3` +select 2 && 3 <> 3, 2 && (3 <> 3), (2 && 3) <> 3 union select * from v1; +2 && 3 <> 3 2 && (3 <> 3) (2 && 3) <> 3 +0 0 1 +create or replace view v1 as select 2 && 3 > 1, 2 && (3 > 1), (2 && 3) > 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 and 3 > 1 AS `2 && 3 > 1`,2 and 3 > 1 AS `2 && (3 > 1)`,(2 and 3) > 1 AS `(2 && 3) > 1` +select 2 && 3 > 1, 2 && (3 > 1), (2 && 3) > 1 union select * from v1; +2 && 3 > 1 2 && (3 > 1) (2 && 3) > 1 +1 1 0 +create or replace view v1 as select 2 && 3 != 3, 2 && (3 != 3), (2 && 3) != 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 and 3 <> 3 AS `2 && 3 != 3`,2 and 3 <> 3 AS `2 && (3 != 3)`,(2 and 3) <> 3 AS `(2 && 3) != 3` +select 2 && 3 != 3, 2 && (3 != 3), (2 && 3) != 3 union select * from v1; +2 && 3 != 3 2 && (3 != 3) (2 && 3) != 3 +0 0 1 +create or replace view v1 as select 2 && 3 LIKE 3, 2 && (3 LIKE 3), (2 && 3) LIKE 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 and 3 like 3 AS `2 && 3 LIKE 3`,2 and 3 like 3 AS `2 && (3 LIKE 3)`,(2 and 3) like 3 AS `(2 && 3) LIKE 3` +select 2 && 3 LIKE 3, 2 && (3 LIKE 3), (2 && 3) LIKE 3 union select * from v1; +2 && 3 LIKE 3 2 && (3 LIKE 3) (2 && 3) LIKE 3 +1 1 0 +create or replace view v1 as select 2 && 3 REGEXP 3, 2 && (3 REGEXP 3), (2 && 3) REGEXP 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 and 3 regexp 3 AS `2 && 3 REGEXP 3`,2 and 3 regexp 3 AS `2 && (3 REGEXP 3)`,(2 and 3) regexp 3 AS `(2 && 3) REGEXP 3` +select 2 && 3 REGEXP 3, 2 && (3 REGEXP 3), (2 && 3) REGEXP 3 union select * from v1; +2 && 3 REGEXP 3 2 && (3 REGEXP 3) (2 && 3) REGEXP 3 +1 1 0 +create or replace view v1 as select 2 && 3 | 3, 2 && (3 | 3), (2 && 3) | 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 and 3 | 3 AS `2 && 3 | 3`,2 and 3 | 3 AS `2 && (3 | 3)`,(2 and 3) | 3 AS `(2 && 3) | 3` +select 2 && 3 | 3, 2 && (3 | 3), (2 && 3) | 3 union select * from v1; +2 && 3 | 3 2 && (3 | 3) (2 && 3) | 3 +1 1 3 +create or replace view v1 as select 2 && 2 & 2, 2 && (2 & 2), (2 && 2) & 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 and 2 & 2 AS `2 && 2 & 2`,2 and 2 & 2 AS `2 && (2 & 2)`,(2 and 2) & 2 AS `(2 && 2) & 2` +select 2 && 2 & 2, 2 && (2 & 2), (2 && 2) & 2 union select * from v1; +2 && 2 & 2 2 && (2 & 2) (2 && 2) & 2 +1 1 0 +create or replace view v1 as select 2 && 3 << 3, 2 && (3 << 3), (2 && 3) << 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 and 3 << 3 AS `2 && 3 << 3`,2 and 3 << 3 AS `2 && (3 << 3)`,(2 and 3) << 3 AS `(2 && 3) << 3` +select 2 && 3 << 3, 2 && (3 << 3), (2 && 3) << 3 union select * from v1; +2 && 3 << 3 2 && (3 << 3) (2 && 3) << 3 +1 1 8 +create or replace view v1 as select 2 && 3 >> 1, 2 && (3 >> 1), (2 && 3) >> 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 and 3 >> 1 AS `2 && 3 >> 1`,2 and 3 >> 1 AS `2 && (3 >> 1)`,(2 and 3) >> 1 AS `(2 && 3) >> 1` +select 2 && 3 >> 1, 2 && (3 >> 1), (2 && 3) >> 1 union select * from v1; +2 && 3 >> 1 2 && (3 >> 1) (2 && 3) >> 1 +1 1 0 +create or replace view v1 as select 2 && '2000-01-01' +INTERVAL 1 DAY, 2 && ('2000-01-01' +INTERVAL 1 DAY), (2 && '2000-01-01') +INTERVAL 1 DAY; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 and '2000-01-01' + interval 1 day AS `2 && '2000-01-01' +INTERVAL 1 DAY`,2 and '2000-01-01' + interval 1 day AS `2 && ('2000-01-01' +INTERVAL 1 DAY)`,(2 and '2000-01-01') + interval 1 day AS `(2 && '2000-01-01') +INTERVAL 1 DAY` +select 2 && '2000-01-01' +INTERVAL 1 DAY, 2 && ('2000-01-01' +INTERVAL 1 DAY), (2 && '2000-01-01') +INTERVAL 1 DAY union select * from v1; +2 && '2000-01-01' +INTERVAL 1 DAY 2 && ('2000-01-01' +INTERVAL 1 DAY) (2 && '2000-01-01') +INTERVAL 1 DAY +1 1 NULL +create or replace view v1 as select 2 && 3 + 3, 2 && (3 + 3), (2 && 3) + 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 and 3 + 3 AS `2 && 3 + 3`,2 and 3 + 3 AS `2 && (3 + 3)`,(2 and 3) + 3 AS `(2 && 3) + 3` +select 2 && 3 + 3, 2 && (3 + 3), (2 && 3) + 3 union select * from v1; +2 && 3 + 3 2 && (3 + 3) (2 && 3) + 3 +1 1 4 +create or replace view v1 as select 2 && 3 - 3, 2 && (3 - 3), (2 && 3) - 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 and 3 - 3 AS `2 && 3 - 3`,2 and 3 - 3 AS `2 && (3 - 3)`,(2 and 3) - 3 AS `(2 && 3) - 3` +select 2 && 3 - 3, 2 && (3 - 3), (2 && 3) - 3 union select * from v1; +2 && 3 - 3 2 && (3 - 3) (2 && 3) - 3 +0 0 -2 +create or replace view v1 as select 2 && 3 * 3, 2 && (3 * 3), (2 && 3) * 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 and 3 * 3 AS `2 && 3 * 3`,2 and 3 * 3 AS `2 && (3 * 3)`,(2 and 3) * 3 AS `(2 && 3) * 3` +select 2 && 3 * 3, 2 && (3 * 3), (2 && 3) * 3 union select * from v1; +2 && 3 * 3 2 && (3 * 3) (2 && 3) * 3 +1 1 3 +create or replace view v1 as select 2 && 3 / 3, 2 && (3 / 3), (2 && 3) / 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 and 3 / 3 AS `2 && 3 / 3`,2 and 3 / 3 AS `2 && (3 / 3)`,(2 and 3) / 3 AS `(2 && 3) / 3` +select 2 && 3 / 3, 2 && (3 / 3), (2 && 3) / 3 union select * from v1; +2 && 3 / 3 2 && (3 / 3) (2 && 3) / 3 +1 1 0.3333 +create or replace view v1 as select 2 && 3 DIV 3, 2 && (3 DIV 3), (2 && 3) DIV 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 and 3 DIV 3 AS `2 && 3 DIV 3`,2 and 3 DIV 3 AS `2 && (3 DIV 3)`,(2 and 3) DIV 3 AS `(2 && 3) DIV 3` +select 2 && 3 DIV 3, 2 && (3 DIV 3), (2 && 3) DIV 3 union select * from v1; +2 && 3 DIV 3 2 && (3 DIV 3) (2 && 3) DIV 3 +1 1 0 +create or replace view v1 as select 2 && 3 MOD 3, 2 && (3 MOD 3), (2 && 3) MOD 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 and 3 MOD 3 AS `2 && 3 MOD 3`,2 and 3 MOD 3 AS `2 && (3 MOD 3)`,(2 and 3) MOD 3 AS `(2 && 3) MOD 3` +select 2 && 3 MOD 3, 2 && (3 MOD 3), (2 && 3) MOD 3 union select * from v1; +2 && 3 MOD 3 2 && (3 MOD 3) (2 && 3) MOD 3 +0 0 1 +create or replace view v1 as select 2 && 3 % 3, 2 && (3 % 3), (2 && 3) % 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 and 3 MOD 3 AS `2 && 3 % 3`,2 and 3 MOD 3 AS `2 && (3 % 3)`,(2 and 3) MOD 3 AS `(2 && 3) % 3` +select 2 && 3 % 3, 2 && (3 % 3), (2 && 3) % 3 union select * from v1; +2 && 3 % 3 2 && (3 % 3) (2 && 3) % 3 +0 0 1 +create or replace view v1 as select 2 && 3 ^ 3, 2 && (3 ^ 3), (2 && 3) ^ 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 and 3 ^ 3 AS `2 && 3 ^ 3`,2 and 3 ^ 3 AS `2 && (3 ^ 3)`,(2 and 3) ^ 3 AS `(2 && 3) ^ 3` +select 2 && 3 ^ 3, 2 && (3 ^ 3), (2 && 3) ^ 3 union select * from v1; +2 && 3 ^ 3 2 && (3 ^ 3) (2 && 3) ^ 3 +0 0 2 +create or replace view v1 as select 2 && 3 BETWEEN 2 AND 3, 2 && (3 BETWEEN 2 AND 3), (2 && 3) BETWEEN 2 AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 and 3 between 2 and 3 AS `2 && 3 BETWEEN 2 AND 3`,2 and 3 between 2 and 3 AS `2 && (3 BETWEEN 2 AND 3)`,(2 and 3) between 2 and 3 AS `(2 && 3) BETWEEN 2 AND 3` +select 2 && 3 BETWEEN 2 AND 3, 2 && (3 BETWEEN 2 AND 3), (2 && 3) BETWEEN 2 AND 3 union select * from v1; +2 && 3 BETWEEN 2 AND 3 2 && (3 BETWEEN 2 AND 3) (2 && 3) BETWEEN 2 AND 3 +1 1 0 +create or replace view v1 as select 2 = 3 IS FALSE, 2 = (3 IS FALSE), (2 = 3) IS FALSE; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 = 3 is false AS `2 = 3 IS FALSE`,2 = (3 is false) AS `2 = (3 IS FALSE)`,2 = 3 is false AS `(2 = 3) IS FALSE` +select 2 = 3 IS FALSE, 2 = (3 IS FALSE), (2 = 3) IS FALSE union select * from v1; +2 = 3 IS FALSE 2 = (3 IS FALSE) (2 = 3) IS FALSE +1 0 1 +create or replace view v1 as select charset(2 = 3 COLLATE latin1_bin), charset(2 = (3 COLLATE latin1_bin)), charset((2 = 3) COLLATE latin1_bin); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select charset(2 = 3 collate latin1_bin) AS `charset(2 = 3 COLLATE latin1_bin)`,charset(2 = 3 collate latin1_bin) AS `charset(2 = (3 COLLATE latin1_bin))`,charset((2 = 3) collate latin1_bin) AS `charset((2 = 3) COLLATE latin1_bin)` +select charset(2 = 3 COLLATE latin1_bin), charset(2 = (3 COLLATE latin1_bin)), charset((2 = 3) COLLATE latin1_bin) union select * from v1; +charset(2 = 3 COLLATE latin1_bin) charset(2 = (3 COLLATE latin1_bin)) charset((2 = 3) COLLATE latin1_bin) +binary binary latin1 +create or replace view v1 as select 2 = 3 IN (0,1), 2 = (3 IN (0,1)), (2 = 3) IN (0,1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 = 3 in (0,1) AS `2 = 3 IN (0,1)`,2 = 3 in (0,1) AS `2 = (3 IN (0,1))`,(2 = 3) in (0,1) AS `(2 = 3) IN (0,1)` +select 2 = 3 IN (0,1), 2 = (3 IN (0,1)), (2 = 3) IN (0,1) union select * from v1; +2 = 3 IN (0,1) 2 = (3 IN (0,1)) (2 = 3) IN (0,1) +0 0 1 +create or replace view v1 as select 2 = 3 OR 3, 2 = (3 OR 3), (2 = 3) OR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 = 3 or 3 AS `2 = 3 OR 3`,2 = (3 or 3) AS `2 = (3 OR 3)`,2 = 3 or 3 AS `(2 = 3) OR 3` +select 2 = 3 OR 3, 2 = (3 OR 3), (2 = 3) OR 3 union select * from v1; +2 = 3 OR 3 2 = (3 OR 3) (2 = 3) OR 3 +1 0 1 +create or replace view v1 as select 2 = 3 || 3, 2 = (3 || 3), (2 = 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 = 3 or 3 AS `2 = 3 || 3`,2 = (3 or 3) AS `2 = (3 || 3)`,2 = 3 or 3 AS `(2 = 3) || 3` +select 2 = 3 || 3, 2 = (3 || 3), (2 = 3) || 3 union select * from v1; +2 = 3 || 3 2 = (3 || 3) (2 = 3) || 3 +1 0 1 +create or replace view v1 as select 2 = 3 XOR 3, 2 = (3 XOR 3), (2 = 3) XOR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 = 3 xor 3 AS `2 = 3 XOR 3`,2 = (3 xor 3) AS `2 = (3 XOR 3)`,2 = 3 xor 3 AS `(2 = 3) XOR 3` +select 2 = 3 XOR 3, 2 = (3 XOR 3), (2 = 3) XOR 3 union select * from v1; +2 = 3 XOR 3 2 = (3 XOR 3) (2 = 3) XOR 3 +1 0 1 +create or replace view v1 as select 2 = 2 AND 2, 2 = (2 AND 2), (2 = 2) AND 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 = 2 and 2 AS `2 = 2 AND 2`,2 = (2 and 2) AS `2 = (2 AND 2)`,2 = 2 and 2 AS `(2 = 2) AND 2` +select 2 = 2 AND 2, 2 = (2 AND 2), (2 = 2) AND 2 union select * from v1; +2 = 2 AND 2 2 = (2 AND 2) (2 = 2) AND 2 +1 0 1 +create or replace view v1 as select 2 = 2 && 2, 2 = (2 && 2), (2 = 2) && 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 = 2 and 2 AS `2 = 2 && 2`,2 = (2 and 2) AS `2 = (2 && 2)`,2 = 2 and 2 AS `(2 = 2) && 2` +select 2 = 2 && 2, 2 = (2 && 2), (2 = 2) && 2 union select * from v1; +2 = 2 && 2 2 = (2 && 2) (2 = 2) && 2 +1 0 1 +create or replace view v1 as select 1 = 3 = 3, 1 = (3 = 3), (1 = 3) = 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 1 = 3 = 3 AS `1 = 3 = 3`,1 = (3 = 3) AS `1 = (3 = 3)`,1 = 3 = 3 AS `(1 = 3) = 3` +select 1 = 3 = 3, 1 = (3 = 3), (1 = 3) = 3 union select * from v1; +1 = 3 = 3 1 = (3 = 3) (1 = 3) = 3 +0 1 0 +create or replace view v1 as select 1 = 3 <=> 3, 1 = (3 <=> 3), (1 = 3) <=> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 1 = 3 <=> 3 AS `1 = 3 <=> 3`,1 = (3 <=> 3) AS `1 = (3 <=> 3)`,1 = 3 <=> 3 AS `(1 = 3) <=> 3` +select 1 = 3 <=> 3, 1 = (3 <=> 3), (1 = 3) <=> 3 union select * from v1; +1 = 3 <=> 3 1 = (3 <=> 3) (1 = 3) <=> 3 +0 1 0 +create or replace view v1 as select 1 = 3 >= 3, 1 = (3 >= 3), (1 = 3) >= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 1 = 3 >= 3 AS `1 = 3 >= 3`,1 = (3 >= 3) AS `1 = (3 >= 3)`,1 = 3 >= 3 AS `(1 = 3) >= 3` +select 1 = 3 >= 3, 1 = (3 >= 3), (1 = 3) >= 3 union select * from v1; +1 = 3 >= 3 1 = (3 >= 3) (1 = 3) >= 3 +0 1 0 +create or replace view v1 as select 2 = 3 <= 3, 2 = (3 <= 3), (2 = 3) <= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 = 3 <= 3 AS `2 = 3 <= 3`,2 = (3 <= 3) AS `2 = (3 <= 3)`,2 = 3 <= 3 AS `(2 = 3) <= 3` +select 2 = 3 <= 3, 2 = (3 <= 3), (2 = 3) <= 3 union select * from v1; +2 = 3 <= 3 2 = (3 <= 3) (2 = 3) <= 3 +1 0 1 +create or replace view v1 as select 2 = 3 < 3, 2 = (3 < 3), (2 = 3) < 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 = 3 < 3 AS `2 = 3 < 3`,2 = (3 < 3) AS `2 = (3 < 3)`,2 = 3 < 3 AS `(2 = 3) < 3` +select 2 = 3 < 3, 2 = (3 < 3), (2 = 3) < 3 union select * from v1; +2 = 3 < 3 2 = (3 < 3) (2 = 3) < 3 +1 0 1 +create or replace view v1 as select 2 = 3 <> 3, 2 = (3 <> 3), (2 = 3) <> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 = 3 <> 3 AS `2 = 3 <> 3`,2 = (3 <> 3) AS `2 = (3 <> 3)`,2 = 3 <> 3 AS `(2 = 3) <> 3` +select 2 = 3 <> 3, 2 = (3 <> 3), (2 = 3) <> 3 union select * from v1; +2 = 3 <> 3 2 = (3 <> 3) (2 = 3) <> 3 +1 0 1 +create or replace view v1 as select 0 = 3 > 3, 0 = (3 > 3), (0 = 3) > 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 0 = 3 > 3 AS `0 = 3 > 3`,0 = (3 > 3) AS `0 = (3 > 3)`,0 = 3 > 3 AS `(0 = 3) > 3` +select 0 = 3 > 3, 0 = (3 > 3), (0 = 3) > 3 union select * from v1; +0 = 3 > 3 0 = (3 > 3) (0 = 3) > 3 +0 1 0 +create or replace view v1 as select 2 = 3 != 3, 2 = (3 != 3), (2 = 3) != 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 = 3 <> 3 AS `2 = 3 != 3`,2 = (3 <> 3) AS `2 = (3 != 3)`,2 = 3 <> 3 AS `(2 = 3) != 3` +select 2 = 3 != 3, 2 = (3 != 3), (2 = 3) != 3 union select * from v1; +2 = 3 != 3 2 = (3 != 3) (2 = 3) != 3 +1 0 1 +create or replace view v1 as select 1 = 3 LIKE 3, 1 = (3 LIKE 3), (1 = 3) LIKE 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 1 = 3 like 3 AS `1 = 3 LIKE 3`,1 = 3 like 3 AS `1 = (3 LIKE 3)`,(1 = 3) like 3 AS `(1 = 3) LIKE 3` +select 1 = 3 LIKE 3, 1 = (3 LIKE 3), (1 = 3) LIKE 3 union select * from v1; +1 = 3 LIKE 3 1 = (3 LIKE 3) (1 = 3) LIKE 3 +1 1 0 +create or replace view v1 as select 1 = 3 REGEXP 3, 1 = (3 REGEXP 3), (1 = 3) REGEXP 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 1 = 3 regexp 3 AS `1 = 3 REGEXP 3`,1 = 3 regexp 3 AS `1 = (3 REGEXP 3)`,(1 = 3) regexp 3 AS `(1 = 3) REGEXP 3` +select 1 = 3 REGEXP 3, 1 = (3 REGEXP 3), (1 = 3) REGEXP 3 union select * from v1; +1 = 3 REGEXP 3 1 = (3 REGEXP 3) (1 = 3) REGEXP 3 +1 1 0 +create or replace view v1 as select 2 = 3 | 3, 2 = (3 | 3), (2 = 3) | 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 = 3 | 3 AS `2 = 3 | 3`,2 = 3 | 3 AS `2 = (3 | 3)`,(2 = 3) | 3 AS `(2 = 3) | 3` +select 2 = 3 | 3, 2 = (3 | 3), (2 = 3) | 3 union select * from v1; +2 = 3 | 3 2 = (3 | 3) (2 = 3) | 3 +0 0 3 +create or replace view v1 as select 2 = 3 & 2, 2 = (3 & 2), (2 = 3) & 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 = 3 & 2 AS `2 = 3 & 2`,2 = 3 & 2 AS `2 = (3 & 2)`,(2 = 3) & 2 AS `(2 = 3) & 2` +select 2 = 3 & 2, 2 = (3 & 2), (2 = 3) & 2 union select * from v1; +2 = 3 & 2 2 = (3 & 2) (2 = 3) & 2 +1 1 0 +create or replace view v1 as select 3 = 3 << 3, 3 = (3 << 3), (3 = 3) << 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 3 = 3 << 3 AS `3 = 3 << 3`,3 = 3 << 3 AS `3 = (3 << 3)`,(3 = 3) << 3 AS `(3 = 3) << 3` +select 3 = 3 << 3, 3 = (3 << 3), (3 = 3) << 3 union select * from v1; +3 = 3 << 3 3 = (3 << 3) (3 = 3) << 3 +0 0 8 +create or replace view v1 as select 1 = 3 >> 1, 1 = (3 >> 1), (1 = 3) >> 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 1 = 3 >> 1 AS `1 = 3 >> 1`,1 = 3 >> 1 AS `1 = (3 >> 1)`,(1 = 3) >> 1 AS `(1 = 3) >> 1` +select 1 = 3 >> 1, 1 = (3 >> 1), (1 = 3) >> 1 union select * from v1; +1 = 3 >> 1 1 = (3 >> 1) (1 = 3) >> 1 +1 1 0 +create or replace view v1 as select 2 = '2000-01-01' +INTERVAL 1 DAY, 2 = ('2000-01-01' +INTERVAL 1 DAY), (2 = '2000-01-01') +INTERVAL 1 DAY; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 = '2000-01-01' + interval 1 day AS `2 = '2000-01-01' +INTERVAL 1 DAY`,2 = '2000-01-01' + interval 1 day AS `2 = ('2000-01-01' +INTERVAL 1 DAY)`,(2 = '2000-01-01') + interval 1 day AS `(2 = '2000-01-01') +INTERVAL 1 DAY` +select 2 = '2000-01-01' +INTERVAL 1 DAY, 2 = ('2000-01-01' +INTERVAL 1 DAY), (2 = '2000-01-01') +INTERVAL 1 DAY union select * from v1; +2 = '2000-01-01' +INTERVAL 1 DAY 2 = ('2000-01-01' +INTERVAL 1 DAY) (2 = '2000-01-01') +INTERVAL 1 DAY +0 0 NULL +create or replace view v1 as select 2 = 3 + 3, 2 = (3 + 3), (2 = 3) + 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 = 3 + 3 AS `2 = 3 + 3`,2 = 3 + 3 AS `2 = (3 + 3)`,(2 = 3) + 3 AS `(2 = 3) + 3` +select 2 = 3 + 3, 2 = (3 + 3), (2 = 3) + 3 union select * from v1; +2 = 3 + 3 2 = (3 + 3) (2 = 3) + 3 +0 0 3 +create or replace view v1 as select 2 = 3 - 3, 2 = (3 - 3), (2 = 3) - 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 = 3 - 3 AS `2 = 3 - 3`,2 = 3 - 3 AS `2 = (3 - 3)`,(2 = 3) - 3 AS `(2 = 3) - 3` +select 2 = 3 - 3, 2 = (3 - 3), (2 = 3) - 3 union select * from v1; +2 = 3 - 3 2 = (3 - 3) (2 = 3) - 3 +0 0 -3 +create or replace view v1 as select 3 = 3 * 3, 3 = (3 * 3), (3 = 3) * 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 3 = 3 * 3 AS `3 = 3 * 3`,3 = 3 * 3 AS `3 = (3 * 3)`,(3 = 3) * 3 AS `(3 = 3) * 3` +select 3 = 3 * 3, 3 = (3 * 3), (3 = 3) * 3 union select * from v1; +3 = 3 * 3 3 = (3 * 3) (3 = 3) * 3 +0 0 3 +create or replace view v1 as select 3 = 9 / 3, 3 = (9 / 3), (3 = 9) / 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 3 = 9 / 3 AS `3 = 9 / 3`,3 = 9 / 3 AS `3 = (9 / 3)`,(3 = 9) / 3 AS `(3 = 9) / 3` +select 3 = 9 / 3, 3 = (9 / 3), (3 = 9) / 3 union select * from v1; +3 = 9 / 3 3 = (9 / 3) (3 = 9) / 3 +1 1 0.0000 +create or replace view v1 as select 3 = 9 DIV 3, 3 = (9 DIV 3), (3 = 9) DIV 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 3 = 9 DIV 3 AS `3 = 9 DIV 3`,3 = 9 DIV 3 AS `3 = (9 DIV 3)`,(3 = 9) DIV 3 AS `(3 = 9) DIV 3` +select 3 = 9 DIV 3, 3 = (9 DIV 3), (3 = 9) DIV 3 union select * from v1; +3 = 9 DIV 3 3 = (9 DIV 3) (3 = 9) DIV 3 +1 1 0 +create or replace view v1 as select 3 = 3 MOD 3, 3 = (3 MOD 3), (3 = 3) MOD 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 3 = 3 MOD 3 AS `3 = 3 MOD 3`,3 = 3 MOD 3 AS `3 = (3 MOD 3)`,(3 = 3) MOD 3 AS `(3 = 3) MOD 3` +select 3 = 3 MOD 3, 3 = (3 MOD 3), (3 = 3) MOD 3 union select * from v1; +3 = 3 MOD 3 3 = (3 MOD 3) (3 = 3) MOD 3 +0 0 1 +create or replace view v1 as select 3 = 3 % 3, 3 = (3 % 3), (3 = 3) % 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 3 = 3 MOD 3 AS `3 = 3 % 3`,3 = 3 MOD 3 AS `3 = (3 % 3)`,(3 = 3) MOD 3 AS `(3 = 3) % 3` +select 3 = 3 % 3, 3 = (3 % 3), (3 = 3) % 3 union select * from v1; +3 = 3 % 3 3 = (3 % 3) (3 = 3) % 3 +0 0 1 +create or replace view v1 as select 2 = 3 ^ 3, 2 = (3 ^ 3), (2 = 3) ^ 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 = 3 ^ 3 AS `2 = 3 ^ 3`,2 = 3 ^ 3 AS `2 = (3 ^ 3)`,(2 = 3) ^ 3 AS `(2 = 3) ^ 3` +select 2 = 3 ^ 3, 2 = (3 ^ 3), (2 = 3) ^ 3 union select * from v1; +2 = 3 ^ 3 2 = (3 ^ 3) (2 = 3) ^ 3 +0 0 3 +create or replace view v1 as select 1 = 3 BETWEEN 1 AND 3, 1 = (3 BETWEEN 1 AND 3), (1 = 3) BETWEEN 1 AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 1 = 3 between 1 and 3 AS `1 = 3 BETWEEN 1 AND 3`,1 = 3 between 1 and 3 AS `1 = (3 BETWEEN 1 AND 3)`,(1 = 3) between 1 and 3 AS `(1 = 3) BETWEEN 1 AND 3` +select 1 = 3 BETWEEN 1 AND 3, 1 = (3 BETWEEN 1 AND 3), (1 = 3) BETWEEN 1 AND 3 union select * from v1; +1 = 3 BETWEEN 1 AND 3 1 = (3 BETWEEN 1 AND 3) (1 = 3) BETWEEN 1 AND 3 +1 1 0 +create or replace view v1 as select 2 <=> 3 IS FALSE, 2 <=> (3 IS FALSE), (2 <=> 3) IS FALSE; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <=> 3 is false AS `2 <=> 3 IS FALSE`,2 <=> (3 is false) AS `2 <=> (3 IS FALSE)`,2 <=> 3 is false AS `(2 <=> 3) IS FALSE` +select 2 <=> 3 IS FALSE, 2 <=> (3 IS FALSE), (2 <=> 3) IS FALSE union select * from v1; +2 <=> 3 IS FALSE 2 <=> (3 IS FALSE) (2 <=> 3) IS FALSE +1 0 1 +create or replace view v1 as select charset(2 <=> 3 COLLATE latin1_bin), charset(2 <=> (3 COLLATE latin1_bin)), charset((2 <=> 3) COLLATE latin1_bin); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select charset(2 <=> 3 collate latin1_bin) AS `charset(2 <=> 3 COLLATE latin1_bin)`,charset(2 <=> 3 collate latin1_bin) AS `charset(2 <=> (3 COLLATE latin1_bin))`,charset((2 <=> 3) collate latin1_bin) AS `charset((2 <=> 3) COLLATE latin1_bin)` +select charset(2 <=> 3 COLLATE latin1_bin), charset(2 <=> (3 COLLATE latin1_bin)), charset((2 <=> 3) COLLATE latin1_bin) union select * from v1; +charset(2 <=> 3 COLLATE latin1_bin) charset(2 <=> (3 COLLATE latin1_bin)) charset((2 <=> 3) COLLATE latin1_bin) +binary binary latin1 +create or replace view v1 as select 2 <=> 3 IN (0,1), 2 <=> (3 IN (0,1)), (2 <=> 3) IN (0,1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <=> 3 in (0,1) AS `2 <=> 3 IN (0,1)`,2 <=> 3 in (0,1) AS `2 <=> (3 IN (0,1))`,(2 <=> 3) in (0,1) AS `(2 <=> 3) IN (0,1)` +select 2 <=> 3 IN (0,1), 2 <=> (3 IN (0,1)), (2 <=> 3) IN (0,1) union select * from v1; +2 <=> 3 IN (0,1) 2 <=> (3 IN (0,1)) (2 <=> 3) IN (0,1) +0 0 1 +create or replace view v1 as select 2 <=> 3 OR 3, 2 <=> (3 OR 3), (2 <=> 3) OR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <=> 3 or 3 AS `2 <=> 3 OR 3`,2 <=> (3 or 3) AS `2 <=> (3 OR 3)`,2 <=> 3 or 3 AS `(2 <=> 3) OR 3` +select 2 <=> 3 OR 3, 2 <=> (3 OR 3), (2 <=> 3) OR 3 union select * from v1; +2 <=> 3 OR 3 2 <=> (3 OR 3) (2 <=> 3) OR 3 +1 0 1 +create or replace view v1 as select 2 <=> 3 || 3, 2 <=> (3 || 3), (2 <=> 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <=> 3 or 3 AS `2 <=> 3 || 3`,2 <=> (3 or 3) AS `2 <=> (3 || 3)`,2 <=> 3 or 3 AS `(2 <=> 3) || 3` +select 2 <=> 3 || 3, 2 <=> (3 || 3), (2 <=> 3) || 3 union select * from v1; +2 <=> 3 || 3 2 <=> (3 || 3) (2 <=> 3) || 3 +1 0 1 +create or replace view v1 as select 2 <=> 3 XOR 3, 2 <=> (3 XOR 3), (2 <=> 3) XOR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <=> 3 xor 3 AS `2 <=> 3 XOR 3`,2 <=> (3 xor 3) AS `2 <=> (3 XOR 3)`,2 <=> 3 xor 3 AS `(2 <=> 3) XOR 3` +select 2 <=> 3 XOR 3, 2 <=> (3 XOR 3), (2 <=> 3) XOR 3 union select * from v1; +2 <=> 3 XOR 3 2 <=> (3 XOR 3) (2 <=> 3) XOR 3 +1 0 1 +create or replace view v1 as select 2 <=> 2 AND 2, 2 <=> (2 AND 2), (2 <=> 2) AND 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <=> 2 and 2 AS `2 <=> 2 AND 2`,2 <=> (2 and 2) AS `2 <=> (2 AND 2)`,2 <=> 2 and 2 AS `(2 <=> 2) AND 2` +select 2 <=> 2 AND 2, 2 <=> (2 AND 2), (2 <=> 2) AND 2 union select * from v1; +2 <=> 2 AND 2 2 <=> (2 AND 2) (2 <=> 2) AND 2 +1 0 1 +create or replace view v1 as select 2 <=> 2 && 2, 2 <=> (2 && 2), (2 <=> 2) && 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <=> 2 and 2 AS `2 <=> 2 && 2`,2 <=> (2 and 2) AS `2 <=> (2 && 2)`,2 <=> 2 and 2 AS `(2 <=> 2) && 2` +select 2 <=> 2 && 2, 2 <=> (2 && 2), (2 <=> 2) && 2 union select * from v1; +2 <=> 2 && 2 2 <=> (2 && 2) (2 <=> 2) && 2 +1 0 1 +create or replace view v1 as select 1 <=> 3 = 3, 1 <=> (3 = 3), (1 <=> 3) = 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 1 <=> 3 = 3 AS `1 <=> 3 = 3`,1 <=> (3 = 3) AS `1 <=> (3 = 3)`,1 <=> 3 = 3 AS `(1 <=> 3) = 3` +select 1 <=> 3 = 3, 1 <=> (3 = 3), (1 <=> 3) = 3 union select * from v1; +1 <=> 3 = 3 1 <=> (3 = 3) (1 <=> 3) = 3 +0 1 0 +create or replace view v1 as select 1 <=> 3 <=> 3, 1 <=> (3 <=> 3), (1 <=> 3) <=> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 1 <=> 3 <=> 3 AS `1 <=> 3 <=> 3`,1 <=> (3 <=> 3) AS `1 <=> (3 <=> 3)`,1 <=> 3 <=> 3 AS `(1 <=> 3) <=> 3` +select 1 <=> 3 <=> 3, 1 <=> (3 <=> 3), (1 <=> 3) <=> 3 union select * from v1; +1 <=> 3 <=> 3 1 <=> (3 <=> 3) (1 <=> 3) <=> 3 +0 1 0 +create or replace view v1 as select 1 <=> 3 >= 3, 1 <=> (3 >= 3), (1 <=> 3) >= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 1 <=> 3 >= 3 AS `1 <=> 3 >= 3`,1 <=> (3 >= 3) AS `1 <=> (3 >= 3)`,1 <=> 3 >= 3 AS `(1 <=> 3) >= 3` +select 1 <=> 3 >= 3, 1 <=> (3 >= 3), (1 <=> 3) >= 3 union select * from v1; +1 <=> 3 >= 3 1 <=> (3 >= 3) (1 <=> 3) >= 3 +0 1 0 +create or replace view v1 as select 2 <=> 3 <= 3, 2 <=> (3 <= 3), (2 <=> 3) <= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <=> 3 <= 3 AS `2 <=> 3 <= 3`,2 <=> (3 <= 3) AS `2 <=> (3 <= 3)`,2 <=> 3 <= 3 AS `(2 <=> 3) <= 3` +select 2 <=> 3 <= 3, 2 <=> (3 <= 3), (2 <=> 3) <= 3 union select * from v1; +2 <=> 3 <= 3 2 <=> (3 <= 3) (2 <=> 3) <= 3 +1 0 1 +create or replace view v1 as select 2 <=> 3 < 3, 2 <=> (3 < 3), (2 <=> 3) < 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <=> 3 < 3 AS `2 <=> 3 < 3`,2 <=> (3 < 3) AS `2 <=> (3 < 3)`,2 <=> 3 < 3 AS `(2 <=> 3) < 3` +select 2 <=> 3 < 3, 2 <=> (3 < 3), (2 <=> 3) < 3 union select * from v1; +2 <=> 3 < 3 2 <=> (3 < 3) (2 <=> 3) < 3 +1 0 1 +create or replace view v1 as select 2 <=> 3 <> 3, 2 <=> (3 <> 3), (2 <=> 3) <> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <=> 3 <> 3 AS `2 <=> 3 <> 3`,2 <=> (3 <> 3) AS `2 <=> (3 <> 3)`,2 <=> 3 <> 3 AS `(2 <=> 3) <> 3` +select 2 <=> 3 <> 3, 2 <=> (3 <> 3), (2 <=> 3) <> 3 union select * from v1; +2 <=> 3 <> 3 2 <=> (3 <> 3) (2 <=> 3) <> 3 +1 0 1 +create or replace view v1 as select 0 <=> 3 > 3, 0 <=> (3 > 3), (0 <=> 3) > 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 0 <=> 3 > 3 AS `0 <=> 3 > 3`,0 <=> (3 > 3) AS `0 <=> (3 > 3)`,0 <=> 3 > 3 AS `(0 <=> 3) > 3` +select 0 <=> 3 > 3, 0 <=> (3 > 3), (0 <=> 3) > 3 union select * from v1; +0 <=> 3 > 3 0 <=> (3 > 3) (0 <=> 3) > 3 +0 1 0 +create or replace view v1 as select 2 <=> 3 != 3, 2 <=> (3 != 3), (2 <=> 3) != 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <=> 3 <> 3 AS `2 <=> 3 != 3`,2 <=> (3 <> 3) AS `2 <=> (3 != 3)`,2 <=> 3 <> 3 AS `(2 <=> 3) != 3` +select 2 <=> 3 != 3, 2 <=> (3 != 3), (2 <=> 3) != 3 union select * from v1; +2 <=> 3 != 3 2 <=> (3 != 3) (2 <=> 3) != 3 +1 0 1 +create or replace view v1 as select 1 <=> 3 LIKE 3, 1 <=> (3 LIKE 3), (1 <=> 3) LIKE 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 1 <=> 3 like 3 AS `1 <=> 3 LIKE 3`,1 <=> 3 like 3 AS `1 <=> (3 LIKE 3)`,(1 <=> 3) like 3 AS `(1 <=> 3) LIKE 3` +select 1 <=> 3 LIKE 3, 1 <=> (3 LIKE 3), (1 <=> 3) LIKE 3 union select * from v1; +1 <=> 3 LIKE 3 1 <=> (3 LIKE 3) (1 <=> 3) LIKE 3 +1 1 0 +create or replace view v1 as select 1 <=> 3 REGEXP 3, 1 <=> (3 REGEXP 3), (1 <=> 3) REGEXP 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 1 <=> 3 regexp 3 AS `1 <=> 3 REGEXP 3`,1 <=> 3 regexp 3 AS `1 <=> (3 REGEXP 3)`,(1 <=> 3) regexp 3 AS `(1 <=> 3) REGEXP 3` +select 1 <=> 3 REGEXP 3, 1 <=> (3 REGEXP 3), (1 <=> 3) REGEXP 3 union select * from v1; +1 <=> 3 REGEXP 3 1 <=> (3 REGEXP 3) (1 <=> 3) REGEXP 3 +1 1 0 +create or replace view v1 as select 2 <=> 3 | 3, 2 <=> (3 | 3), (2 <=> 3) | 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <=> 3 | 3 AS `2 <=> 3 | 3`,2 <=> 3 | 3 AS `2 <=> (3 | 3)`,(2 <=> 3) | 3 AS `(2 <=> 3) | 3` +select 2 <=> 3 | 3, 2 <=> (3 | 3), (2 <=> 3) | 3 union select * from v1; +2 <=> 3 | 3 2 <=> (3 | 3) (2 <=> 3) | 3 +0 0 3 +create or replace view v1 as select 2 <=> 3 & 2, 2 <=> (3 & 2), (2 <=> 3) & 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <=> 3 & 2 AS `2 <=> 3 & 2`,2 <=> 3 & 2 AS `2 <=> (3 & 2)`,(2 <=> 3) & 2 AS `(2 <=> 3) & 2` +select 2 <=> 3 & 2, 2 <=> (3 & 2), (2 <=> 3) & 2 union select * from v1; +2 <=> 3 & 2 2 <=> (3 & 2) (2 <=> 3) & 2 +1 1 0 +create or replace view v1 as select 3 <=> 3 << 3, 3 <=> (3 << 3), (3 <=> 3) << 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 3 <=> 3 << 3 AS `3 <=> 3 << 3`,3 <=> 3 << 3 AS `3 <=> (3 << 3)`,(3 <=> 3) << 3 AS `(3 <=> 3) << 3` +select 3 <=> 3 << 3, 3 <=> (3 << 3), (3 <=> 3) << 3 union select * from v1; +3 <=> 3 << 3 3 <=> (3 << 3) (3 <=> 3) << 3 +0 0 8 +create or replace view v1 as select 1 <=> 3 >> 1, 1 <=> (3 >> 1), (1 <=> 3) >> 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 1 <=> 3 >> 1 AS `1 <=> 3 >> 1`,1 <=> 3 >> 1 AS `1 <=> (3 >> 1)`,(1 <=> 3) >> 1 AS `(1 <=> 3) >> 1` +select 1 <=> 3 >> 1, 1 <=> (3 >> 1), (1 <=> 3) >> 1 union select * from v1; +1 <=> 3 >> 1 1 <=> (3 >> 1) (1 <=> 3) >> 1 +1 1 0 +create or replace view v1 as select 2 <=> '2000-01-01' +INTERVAL 1 DAY, 2 <=> ('2000-01-01' +INTERVAL 1 DAY), (2 <=> '2000-01-01') +INTERVAL 1 DAY; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <=> '2000-01-01' + interval 1 day AS `2 <=> '2000-01-01' +INTERVAL 1 DAY`,2 <=> '2000-01-01' + interval 1 day AS `2 <=> ('2000-01-01' +INTERVAL 1 DAY)`,(2 <=> '2000-01-01') + interval 1 day AS `(2 <=> '2000-01-01') +INTERVAL 1 DAY` +select 2 <=> '2000-01-01' +INTERVAL 1 DAY, 2 <=> ('2000-01-01' +INTERVAL 1 DAY), (2 <=> '2000-01-01') +INTERVAL 1 DAY union select * from v1; +2 <=> '2000-01-01' +INTERVAL 1 DAY 2 <=> ('2000-01-01' +INTERVAL 1 DAY) (2 <=> '2000-01-01') +INTERVAL 1 DAY +0 0 NULL +create or replace view v1 as select 2 <=> 3 + 3, 2 <=> (3 + 3), (2 <=> 3) + 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <=> 3 + 3 AS `2 <=> 3 + 3`,2 <=> 3 + 3 AS `2 <=> (3 + 3)`,(2 <=> 3) + 3 AS `(2 <=> 3) + 3` +select 2 <=> 3 + 3, 2 <=> (3 + 3), (2 <=> 3) + 3 union select * from v1; +2 <=> 3 + 3 2 <=> (3 + 3) (2 <=> 3) + 3 +0 0 3 +create or replace view v1 as select 2 <=> 3 - 3, 2 <=> (3 - 3), (2 <=> 3) - 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <=> 3 - 3 AS `2 <=> 3 - 3`,2 <=> 3 - 3 AS `2 <=> (3 - 3)`,(2 <=> 3) - 3 AS `(2 <=> 3) - 3` +select 2 <=> 3 - 3, 2 <=> (3 - 3), (2 <=> 3) - 3 union select * from v1; +2 <=> 3 - 3 2 <=> (3 - 3) (2 <=> 3) - 3 +0 0 -3 +create or replace view v1 as select 3 <=> 3 * 3, 3 <=> (3 * 3), (3 <=> 3) * 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 3 <=> 3 * 3 AS `3 <=> 3 * 3`,3 <=> 3 * 3 AS `3 <=> (3 * 3)`,(3 <=> 3) * 3 AS `(3 <=> 3) * 3` +select 3 <=> 3 * 3, 3 <=> (3 * 3), (3 <=> 3) * 3 union select * from v1; +3 <=> 3 * 3 3 <=> (3 * 3) (3 <=> 3) * 3 +0 0 3 +create or replace view v1 as select 3 <=> 9 / 3, 3 <=> (9 / 3), (3 <=> 9) / 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 3 <=> 9 / 3 AS `3 <=> 9 / 3`,3 <=> 9 / 3 AS `3 <=> (9 / 3)`,(3 <=> 9) / 3 AS `(3 <=> 9) / 3` +select 3 <=> 9 / 3, 3 <=> (9 / 3), (3 <=> 9) / 3 union select * from v1; +3 <=> 9 / 3 3 <=> (9 / 3) (3 <=> 9) / 3 +1 1 0.0000 +create or replace view v1 as select 3 <=> 9 DIV 3, 3 <=> (9 DIV 3), (3 <=> 9) DIV 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 3 <=> 9 DIV 3 AS `3 <=> 9 DIV 3`,3 <=> 9 DIV 3 AS `3 <=> (9 DIV 3)`,(3 <=> 9) DIV 3 AS `(3 <=> 9) DIV 3` +select 3 <=> 9 DIV 3, 3 <=> (9 DIV 3), (3 <=> 9) DIV 3 union select * from v1; +3 <=> 9 DIV 3 3 <=> (9 DIV 3) (3 <=> 9) DIV 3 +1 1 0 +create or replace view v1 as select 3 <=> 3 MOD 3, 3 <=> (3 MOD 3), (3 <=> 3) MOD 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 3 <=> 3 MOD 3 AS `3 <=> 3 MOD 3`,3 <=> 3 MOD 3 AS `3 <=> (3 MOD 3)`,(3 <=> 3) MOD 3 AS `(3 <=> 3) MOD 3` +select 3 <=> 3 MOD 3, 3 <=> (3 MOD 3), (3 <=> 3) MOD 3 union select * from v1; +3 <=> 3 MOD 3 3 <=> (3 MOD 3) (3 <=> 3) MOD 3 +0 0 1 +create or replace view v1 as select 3 <=> 3 % 3, 3 <=> (3 % 3), (3 <=> 3) % 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 3 <=> 3 MOD 3 AS `3 <=> 3 % 3`,3 <=> 3 MOD 3 AS `3 <=> (3 % 3)`,(3 <=> 3) MOD 3 AS `(3 <=> 3) % 3` +select 3 <=> 3 % 3, 3 <=> (3 % 3), (3 <=> 3) % 3 union select * from v1; +3 <=> 3 % 3 3 <=> (3 % 3) (3 <=> 3) % 3 +0 0 1 +create or replace view v1 as select 2 <=> 3 ^ 3, 2 <=> (3 ^ 3), (2 <=> 3) ^ 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <=> 3 ^ 3 AS `2 <=> 3 ^ 3`,2 <=> 3 ^ 3 AS `2 <=> (3 ^ 3)`,(2 <=> 3) ^ 3 AS `(2 <=> 3) ^ 3` +select 2 <=> 3 ^ 3, 2 <=> (3 ^ 3), (2 <=> 3) ^ 3 union select * from v1; +2 <=> 3 ^ 3 2 <=> (3 ^ 3) (2 <=> 3) ^ 3 +0 0 3 +create or replace view v1 as select 1 <=> 3 BETWEEN 1 AND 3, 1 <=> (3 BETWEEN 1 AND 3), (1 <=> 3) BETWEEN 1 AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 1 <=> 3 between 1 and 3 AS `1 <=> 3 BETWEEN 1 AND 3`,1 <=> 3 between 1 and 3 AS `1 <=> (3 BETWEEN 1 AND 3)`,(1 <=> 3) between 1 and 3 AS `(1 <=> 3) BETWEEN 1 AND 3` +select 1 <=> 3 BETWEEN 1 AND 3, 1 <=> (3 BETWEEN 1 AND 3), (1 <=> 3) BETWEEN 1 AND 3 union select * from v1; +1 <=> 3 BETWEEN 1 AND 3 1 <=> (3 BETWEEN 1 AND 3) (1 <=> 3) BETWEEN 1 AND 3 +1 1 0 +create or replace view v1 as select 4 >= 3 IS FALSE, 4 >= (3 IS FALSE), (4 >= 3) IS FALSE; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 4 >= 3 is false AS `4 >= 3 IS FALSE`,4 >= (3 is false) AS `4 >= (3 IS FALSE)`,4 >= 3 is false AS `(4 >= 3) IS FALSE` +select 4 >= 3 IS FALSE, 4 >= (3 IS FALSE), (4 >= 3) IS FALSE union select * from v1; +4 >= 3 IS FALSE 4 >= (3 IS FALSE) (4 >= 3) IS FALSE +0 1 0 +create or replace view v1 as select charset(2 >= 3 COLLATE latin1_bin), charset(2 >= (3 COLLATE latin1_bin)), charset((2 >= 3) COLLATE latin1_bin); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select charset(2 >= 3 collate latin1_bin) AS `charset(2 >= 3 COLLATE latin1_bin)`,charset(2 >= 3 collate latin1_bin) AS `charset(2 >= (3 COLLATE latin1_bin))`,charset((2 >= 3) collate latin1_bin) AS `charset((2 >= 3) COLLATE latin1_bin)` +select charset(2 >= 3 COLLATE latin1_bin), charset(2 >= (3 COLLATE latin1_bin)), charset((2 >= 3) COLLATE latin1_bin) union select * from v1; +charset(2 >= 3 COLLATE latin1_bin) charset(2 >= (3 COLLATE latin1_bin)) charset((2 >= 3) COLLATE latin1_bin) +binary binary latin1 +create or replace view v1 as select 2 >= 3 IN (1,1), 2 >= (3 IN (1,1)), (2 >= 3) IN (1,1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 >= 3 in (1,1) AS `2 >= 3 IN (1,1)`,2 >= 3 in (1,1) AS `2 >= (3 IN (1,1))`,(2 >= 3) in (1,1) AS `(2 >= 3) IN (1,1)` +select 2 >= 3 IN (1,1), 2 >= (3 IN (1,1)), (2 >= 3) IN (1,1) union select * from v1; +2 >= 3 IN (1,1) 2 >= (3 IN (1,1)) (2 >= 3) IN (1,1) +1 1 0 +create or replace view v1 as select 2 >= 3 OR 0, 2 >= (3 OR 0), (2 >= 3) OR 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 >= 3 or 0 AS `2 >= 3 OR 0`,2 >= (3 or 0) AS `2 >= (3 OR 0)`,2 >= 3 or 0 AS `(2 >= 3) OR 0` +select 2 >= 3 OR 0, 2 >= (3 OR 0), (2 >= 3) OR 0 union select * from v1; +2 >= 3 OR 0 2 >= (3 OR 0) (2 >= 3) OR 0 +0 1 0 +create or replace view v1 as select 2 >= 3 || 0, 2 >= (3 || 0), (2 >= 3) || 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 >= 3 or 0 AS `2 >= 3 || 0`,2 >= (3 or 0) AS `2 >= (3 || 0)`,2 >= 3 or 0 AS `(2 >= 3) || 0` +select 2 >= 3 || 0, 2 >= (3 || 0), (2 >= 3) || 0 union select * from v1; +2 >= 3 || 0 2 >= (3 || 0) (2 >= 3) || 0 +0 1 0 +create or replace view v1 as select 2 >= 3 XOR 0, 2 >= (3 XOR 0), (2 >= 3) XOR 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 >= 3 xor 0 AS `2 >= 3 XOR 0`,2 >= (3 xor 0) AS `2 >= (3 XOR 0)`,2 >= 3 xor 0 AS `(2 >= 3) XOR 0` +select 2 >= 3 XOR 0, 2 >= (3 XOR 0), (2 >= 3) XOR 0 union select * from v1; +2 >= 3 XOR 0 2 >= (3 XOR 0) (2 >= 3) XOR 0 +0 1 0 +create or replace view v1 as select 2 >= 3 AND 3, 2 >= (3 AND 3), (2 >= 3) AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 >= 3 and 3 AS `2 >= 3 AND 3`,2 >= (3 and 3) AS `2 >= (3 AND 3)`,2 >= 3 and 3 AS `(2 >= 3) AND 3` +select 2 >= 3 AND 3, 2 >= (3 AND 3), (2 >= 3) AND 3 union select * from v1; +2 >= 3 AND 3 2 >= (3 AND 3) (2 >= 3) AND 3 +0 1 0 +create or replace view v1 as select 2 >= 3 && 3, 2 >= (3 && 3), (2 >= 3) && 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 >= 3 and 3 AS `2 >= 3 && 3`,2 >= (3 and 3) AS `2 >= (3 && 3)`,2 >= 3 and 3 AS `(2 >= 3) && 3` +select 2 >= 3 && 3, 2 >= (3 && 3), (2 >= 3) && 3 union select * from v1; +2 >= 3 && 3 2 >= (3 && 3) (2 >= 3) && 3 +0 1 0 +create or replace view v1 as select 2 >= 3 = 3, 2 >= (3 = 3), (2 >= 3) = 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 >= 3 = 3 AS `2 >= 3 = 3`,2 >= (3 = 3) AS `2 >= (3 = 3)`,2 >= 3 = 3 AS `(2 >= 3) = 3` +select 2 >= 3 = 3, 2 >= (3 = 3), (2 >= 3) = 3 union select * from v1; +2 >= 3 = 3 2 >= (3 = 3) (2 >= 3) = 3 +0 1 0 +create or replace view v1 as select 2 >= 3 <=> 3, 2 >= (3 <=> 3), (2 >= 3) <=> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 >= 3 <=> 3 AS `2 >= 3 <=> 3`,2 >= (3 <=> 3) AS `2 >= (3 <=> 3)`,2 >= 3 <=> 3 AS `(2 >= 3) <=> 3` +select 2 >= 3 <=> 3, 2 >= (3 <=> 3), (2 >= 3) <=> 3 union select * from v1; +2 >= 3 <=> 3 2 >= (3 <=> 3) (2 >= 3) <=> 3 +0 1 0 +create or replace view v1 as select 2 >= 3 >= 3, 2 >= (3 >= 3), (2 >= 3) >= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 >= 3 >= 3 AS `2 >= 3 >= 3`,2 >= (3 >= 3) AS `2 >= (3 >= 3)`,2 >= 3 >= 3 AS `(2 >= 3) >= 3` +select 2 >= 3 >= 3, 2 >= (3 >= 3), (2 >= 3) >= 3 union select * from v1; +2 >= 3 >= 3 2 >= (3 >= 3) (2 >= 3) >= 3 +0 1 0 +create or replace view v1 as select 0 >= 3 <= 3, 0 >= (3 <= 3), (0 >= 3) <= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 0 >= 3 <= 3 AS `0 >= 3 <= 3`,0 >= (3 <= 3) AS `0 >= (3 <= 3)`,0 >= 3 <= 3 AS `(0 >= 3) <= 3` +select 0 >= 3 <= 3, 0 >= (3 <= 3), (0 >= 3) <= 3 union select * from v1; +0 >= 3 <= 3 0 >= (3 <= 3) (0 >= 3) <= 3 +1 0 1 +create or replace view v1 as select 0 >= 2 < 3, 0 >= (2 < 3), (0 >= 2) < 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 0 >= 2 < 3 AS `0 >= 2 < 3`,0 >= (2 < 3) AS `0 >= (2 < 3)`,0 >= 2 < 3 AS `(0 >= 2) < 3` +select 0 >= 2 < 3, 0 >= (2 < 3), (0 >= 2) < 3 union select * from v1; +0 >= 2 < 3 0 >= (2 < 3) (0 >= 2) < 3 +1 0 1 +create or replace view v1 as select 2 >= 3 <> 0, 2 >= (3 <> 0), (2 >= 3) <> 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 >= 3 <> 0 AS `2 >= 3 <> 0`,2 >= (3 <> 0) AS `2 >= (3 <> 0)`,2 >= 3 <> 0 AS `(2 >= 3) <> 0` +select 2 >= 3 <> 0, 2 >= (3 <> 0), (2 >= 3) <> 0 union select * from v1; +2 >= 3 <> 0 2 >= (3 <> 0) (2 >= 3) <> 0 +0 1 0 +create or replace view v1 as select 2 >= 3 > 3, 2 >= (3 > 3), (2 >= 3) > 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 >= 3 > 3 AS `2 >= 3 > 3`,2 >= (3 > 3) AS `2 >= (3 > 3)`,2 >= 3 > 3 AS `(2 >= 3) > 3` +select 2 >= 3 > 3, 2 >= (3 > 3), (2 >= 3) > 3 union select * from v1; +2 >= 3 > 3 2 >= (3 > 3) (2 >= 3) > 3 +0 1 0 +create or replace view v1 as select 2 >= 3 != 0, 2 >= (3 != 0), (2 >= 3) != 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 >= 3 <> 0 AS `2 >= 3 != 0`,2 >= (3 <> 0) AS `2 >= (3 != 0)`,2 >= 3 <> 0 AS `(2 >= 3) != 0` +select 2 >= 3 != 0, 2 >= (3 != 0), (2 >= 3) != 0 union select * from v1; +2 >= 3 != 0 2 >= (3 != 0) (2 >= 3) != 0 +0 1 0 +create or replace view v1 as select 2 >= 3 LIKE 3, 2 >= (3 LIKE 3), (2 >= 3) LIKE 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 >= 3 like 3 AS `2 >= 3 LIKE 3`,2 >= 3 like 3 AS `2 >= (3 LIKE 3)`,(2 >= 3) like 3 AS `(2 >= 3) LIKE 3` +select 2 >= 3 LIKE 3, 2 >= (3 LIKE 3), (2 >= 3) LIKE 3 union select * from v1; +2 >= 3 LIKE 3 2 >= (3 LIKE 3) (2 >= 3) LIKE 3 +1 1 0 +create or replace view v1 as select 2 >= 3 REGEXP 3, 2 >= (3 REGEXP 3), (2 >= 3) REGEXP 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 >= 3 regexp 3 AS `2 >= 3 REGEXP 3`,2 >= 3 regexp 3 AS `2 >= (3 REGEXP 3)`,(2 >= 3) regexp 3 AS `(2 >= 3) REGEXP 3` +select 2 >= 3 REGEXP 3, 2 >= (3 REGEXP 3), (2 >= 3) REGEXP 3 union select * from v1; +2 >= 3 REGEXP 3 2 >= (3 REGEXP 3) (2 >= 3) REGEXP 3 +1 1 0 +create or replace view v1 as select 2 >= 3 | 3, 2 >= (3 | 3), (2 >= 3) | 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 >= 3 | 3 AS `2 >= 3 | 3`,2 >= 3 | 3 AS `2 >= (3 | 3)`,(2 >= 3) | 3 AS `(2 >= 3) | 3` +select 2 >= 3 | 3, 2 >= (3 | 3), (2 >= 3) | 3 union select * from v1; +2 >= 3 | 3 2 >= (3 | 3) (2 >= 3) | 3 +0 0 3 +create or replace view v1 as select 2 >= 3 & 1, 2 >= (3 & 1), (2 >= 3) & 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 >= 3 & 1 AS `2 >= 3 & 1`,2 >= 3 & 1 AS `2 >= (3 & 1)`,(2 >= 3) & 1 AS `(2 >= 3) & 1` +select 2 >= 3 & 1, 2 >= (3 & 1), (2 >= 3) & 1 union select * from v1; +2 >= 3 & 1 2 >= (3 & 1) (2 >= 3) & 1 +1 1 0 +create or replace view v1 as select 3 >= 3 << 3, 3 >= (3 << 3), (3 >= 3) << 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 3 >= 3 << 3 AS `3 >= 3 << 3`,3 >= 3 << 3 AS `3 >= (3 << 3)`,(3 >= 3) << 3 AS `(3 >= 3) << 3` +select 3 >= 3 << 3, 3 >= (3 << 3), (3 >= 3) << 3 union select * from v1; +3 >= 3 << 3 3 >= (3 << 3) (3 >= 3) << 3 +0 0 8 +create or replace view v1 as select 2 >= 3 >> 3, 2 >= (3 >> 3), (2 >= 3) >> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 >= 3 >> 3 AS `2 >= 3 >> 3`,2 >= 3 >> 3 AS `2 >= (3 >> 3)`,(2 >= 3) >> 3 AS `(2 >= 3) >> 3` +select 2 >= 3 >> 3, 2 >= (3 >> 3), (2 >= 3) >> 3 union select * from v1; +2 >= 3 >> 3 2 >= (3 >> 3) (2 >= 3) >> 3 +1 1 0 +create or replace view v1 as select 2 >= '2000-01-01' +INTERVAL 1 DAY, 2 >= ('2000-01-01' +INTERVAL 1 DAY), (2 >= '2000-01-01') +INTERVAL 1 DAY; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 >= '2000-01-01' + interval 1 day AS `2 >= '2000-01-01' +INTERVAL 1 DAY`,2 >= '2000-01-01' + interval 1 day AS `2 >= ('2000-01-01' +INTERVAL 1 DAY)`,(2 >= '2000-01-01') + interval 1 day AS `(2 >= '2000-01-01') +INTERVAL 1 DAY` +select 2 >= '2000-01-01' +INTERVAL 1 DAY, 2 >= ('2000-01-01' +INTERVAL 1 DAY), (2 >= '2000-01-01') +INTERVAL 1 DAY union select * from v1; +2 >= '2000-01-01' +INTERVAL 1 DAY 2 >= ('2000-01-01' +INTERVAL 1 DAY) (2 >= '2000-01-01') +INTERVAL 1 DAY +0 0 NULL +create or replace view v1 as select 2 >= 3 + 3, 2 >= (3 + 3), (2 >= 3) + 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 >= 3 + 3 AS `2 >= 3 + 3`,2 >= 3 + 3 AS `2 >= (3 + 3)`,(2 >= 3) + 3 AS `(2 >= 3) + 3` +select 2 >= 3 + 3, 2 >= (3 + 3), (2 >= 3) + 3 union select * from v1; +2 >= 3 + 3 2 >= (3 + 3) (2 >= 3) + 3 +0 0 3 +create or replace view v1 as select 2 >= 3 - 3, 2 >= (3 - 3), (2 >= 3) - 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 >= 3 - 3 AS `2 >= 3 - 3`,2 >= 3 - 3 AS `2 >= (3 - 3)`,(2 >= 3) - 3 AS `(2 >= 3) - 3` +select 2 >= 3 - 3, 2 >= (3 - 3), (2 >= 3) - 3 union select * from v1; +2 >= 3 - 3 2 >= (3 - 3) (2 >= 3) - 3 +1 1 -3 +create or replace view v1 as select 3 >= 3 * 3, 3 >= (3 * 3), (3 >= 3) * 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 3 >= 3 * 3 AS `3 >= 3 * 3`,3 >= 3 * 3 AS `3 >= (3 * 3)`,(3 >= 3) * 3 AS `(3 >= 3) * 3` +select 3 >= 3 * 3, 3 >= (3 * 3), (3 >= 3) * 3 union select * from v1; +3 >= 3 * 3 3 >= (3 * 3) (3 >= 3) * 3 +0 0 3 +create or replace view v1 as select 2 >= 3 / 3, 2 >= (3 / 3), (2 >= 3) / 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 >= 3 / 3 AS `2 >= 3 / 3`,2 >= 3 / 3 AS `2 >= (3 / 3)`,(2 >= 3) / 3 AS `(2 >= 3) / 3` +select 2 >= 3 / 3, 2 >= (3 / 3), (2 >= 3) / 3 union select * from v1; +2 >= 3 / 3 2 >= (3 / 3) (2 >= 3) / 3 +1 1 0.0000 +create or replace view v1 as select 2 >= 3 DIV 3, 2 >= (3 DIV 3), (2 >= 3) DIV 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 >= 3 DIV 3 AS `2 >= 3 DIV 3`,2 >= 3 DIV 3 AS `2 >= (3 DIV 3)`,(2 >= 3) DIV 3 AS `(2 >= 3) DIV 3` +select 2 >= 3 DIV 3, 2 >= (3 DIV 3), (2 >= 3) DIV 3 union select * from v1; +2 >= 3 DIV 3 2 >= (3 DIV 3) (2 >= 3) DIV 3 +1 1 0 +create or replace view v1 as select 2 >= 3 MOD 3, 2 >= (3 MOD 3), (2 >= 3) MOD 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 >= 3 MOD 3 AS `2 >= 3 MOD 3`,2 >= 3 MOD 3 AS `2 >= (3 MOD 3)`,(2 >= 3) MOD 3 AS `(2 >= 3) MOD 3` +select 2 >= 3 MOD 3, 2 >= (3 MOD 3), (2 >= 3) MOD 3 union select * from v1; +2 >= 3 MOD 3 2 >= (3 MOD 3) (2 >= 3) MOD 3 +1 1 0 +create or replace view v1 as select 2 >= 3 % 3, 2 >= (3 % 3), (2 >= 3) % 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 >= 3 MOD 3 AS `2 >= 3 % 3`,2 >= 3 MOD 3 AS `2 >= (3 % 3)`,(2 >= 3) MOD 3 AS `(2 >= 3) % 3` +select 2 >= 3 % 3, 2 >= (3 % 3), (2 >= 3) % 3 union select * from v1; +2 >= 3 % 3 2 >= (3 % 3) (2 >= 3) % 3 +1 1 0 +create or replace view v1 as select 2 >= 3 ^ 3, 2 >= (3 ^ 3), (2 >= 3) ^ 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 >= 3 ^ 3 AS `2 >= 3 ^ 3`,2 >= 3 ^ 3 AS `2 >= (3 ^ 3)`,(2 >= 3) ^ 3 AS `(2 >= 3) ^ 3` +select 2 >= 3 ^ 3, 2 >= (3 ^ 3), (2 >= 3) ^ 3 union select * from v1; +2 >= 3 ^ 3 2 >= (3 ^ 3) (2 >= 3) ^ 3 +1 1 3 +create or replace view v1 as select 2 >= 3 BETWEEN 1 AND 3, 2 >= (3 BETWEEN 1 AND 3), (2 >= 3) BETWEEN 1 AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 >= 3 between 1 and 3 AS `2 >= 3 BETWEEN 1 AND 3`,2 >= 3 between 1 and 3 AS `2 >= (3 BETWEEN 1 AND 3)`,(2 >= 3) between 1 and 3 AS `(2 >= 3) BETWEEN 1 AND 3` +select 2 >= 3 BETWEEN 1 AND 3, 2 >= (3 BETWEEN 1 AND 3), (2 >= 3) BETWEEN 1 AND 3 union select * from v1; +2 >= 3 BETWEEN 1 AND 3 2 >= (3 BETWEEN 1 AND 3) (2 >= 3) BETWEEN 1 AND 3 +1 1 0 +create or replace view v1 as select 2 <= 1 IS FALSE, 2 <= (1 IS FALSE), (2 <= 1) IS FALSE; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <= 1 is false AS `2 <= 1 IS FALSE`,2 <= (1 is false) AS `2 <= (1 IS FALSE)`,2 <= 1 is false AS `(2 <= 1) IS FALSE` +select 2 <= 1 IS FALSE, 2 <= (1 IS FALSE), (2 <= 1) IS FALSE union select * from v1; +2 <= 1 IS FALSE 2 <= (1 IS FALSE) (2 <= 1) IS FALSE +1 0 1 +create or replace view v1 as select charset(2 <= 3 COLLATE latin1_bin), charset(2 <= (3 COLLATE latin1_bin)), charset((2 <= 3) COLLATE latin1_bin); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select charset(2 <= 3 collate latin1_bin) AS `charset(2 <= 3 COLLATE latin1_bin)`,charset(2 <= 3 collate latin1_bin) AS `charset(2 <= (3 COLLATE latin1_bin))`,charset((2 <= 3) collate latin1_bin) AS `charset((2 <= 3) COLLATE latin1_bin)` +select charset(2 <= 3 COLLATE latin1_bin), charset(2 <= (3 COLLATE latin1_bin)), charset((2 <= 3) COLLATE latin1_bin) union select * from v1; +charset(2 <= 3 COLLATE latin1_bin) charset(2 <= (3 COLLATE latin1_bin)) charset((2 <= 3) COLLATE latin1_bin) +binary binary latin1 +create or replace view v1 as select 2 <= 3 IN (0,1), 2 <= (3 IN (0,1)), (2 <= 3) IN (0,1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <= 3 in (0,1) AS `2 <= 3 IN (0,1)`,2 <= 3 in (0,1) AS `2 <= (3 IN (0,1))`,(2 <= 3) in (0,1) AS `(2 <= 3) IN (0,1)` +select 2 <= 3 IN (0,1), 2 <= (3 IN (0,1)), (2 <= 3) IN (0,1) union select * from v1; +2 <= 3 IN (0,1) 2 <= (3 IN (0,1)) (2 <= 3) IN (0,1) +0 0 1 +create or replace view v1 as select 2 <= 3 OR 3, 2 <= (3 OR 3), (2 <= 3) OR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <= 3 or 3 AS `2 <= 3 OR 3`,2 <= (3 or 3) AS `2 <= (3 OR 3)`,2 <= 3 or 3 AS `(2 <= 3) OR 3` +select 2 <= 3 OR 3, 2 <= (3 OR 3), (2 <= 3) OR 3 union select * from v1; +2 <= 3 OR 3 2 <= (3 OR 3) (2 <= 3) OR 3 +1 0 1 +create or replace view v1 as select 2 <= 3 || 3, 2 <= (3 || 3), (2 <= 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <= 3 or 3 AS `2 <= 3 || 3`,2 <= (3 or 3) AS `2 <= (3 || 3)`,2 <= 3 or 3 AS `(2 <= 3) || 3` +select 2 <= 3 || 3, 2 <= (3 || 3), (2 <= 3) || 3 union select * from v1; +2 <= 3 || 3 2 <= (3 || 3) (2 <= 3) || 3 +1 0 1 +create or replace view v1 as select 2 <= 1 XOR 1, 2 <= (1 XOR 1), (2 <= 1) XOR 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <= 1 xor 1 AS `2 <= 1 XOR 1`,2 <= (1 xor 1) AS `2 <= (1 XOR 1)`,2 <= 1 xor 1 AS `(2 <= 1) XOR 1` +select 2 <= 1 XOR 1, 2 <= (1 XOR 1), (2 <= 1) XOR 1 union select * from v1; +2 <= 1 XOR 1 2 <= (1 XOR 1) (2 <= 1) XOR 1 +1 0 1 +create or replace view v1 as select 2 <= 3 AND 3, 2 <= (3 AND 3), (2 <= 3) AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <= 3 and 3 AS `2 <= 3 AND 3`,2 <= (3 and 3) AS `2 <= (3 AND 3)`,2 <= 3 and 3 AS `(2 <= 3) AND 3` +select 2 <= 3 AND 3, 2 <= (3 AND 3), (2 <= 3) AND 3 union select * from v1; +2 <= 3 AND 3 2 <= (3 AND 3) (2 <= 3) AND 3 +1 0 1 +create or replace view v1 as select 2 <= 3 && 3, 2 <= (3 && 3), (2 <= 3) && 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <= 3 and 3 AS `2 <= 3 && 3`,2 <= (3 and 3) AS `2 <= (3 && 3)`,2 <= 3 and 3 AS `(2 <= 3) && 3` +select 2 <= 3 && 3, 2 <= (3 && 3), (2 <= 3) && 3 union select * from v1; +2 <= 3 && 3 2 <= (3 && 3) (2 <= 3) && 3 +1 0 1 +create or replace view v1 as select 2 <= 0 = 0, 2 <= (0 = 0), (2 <= 0) = 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <= 0 = 0 AS `2 <= 0 = 0`,2 <= (0 = 0) AS `2 <= (0 = 0)`,2 <= 0 = 0 AS `(2 <= 0) = 0` +select 2 <= 0 = 0, 2 <= (0 = 0), (2 <= 0) = 0 union select * from v1; +2 <= 0 = 0 2 <= (0 = 0) (2 <= 0) = 0 +1 0 1 +create or replace view v1 as select 2 <= 0 <=> 0, 2 <= (0 <=> 0), (2 <= 0) <=> 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <= 0 <=> 0 AS `2 <= 0 <=> 0`,2 <= (0 <=> 0) AS `2 <= (0 <=> 0)`,2 <= 0 <=> 0 AS `(2 <= 0) <=> 0` +select 2 <= 0 <=> 0, 2 <= (0 <=> 0), (2 <= 0) <=> 0 union select * from v1; +2 <= 0 <=> 0 2 <= (0 <=> 0) (2 <= 0) <=> 0 +1 0 1 +create or replace view v1 as select 2 <= 0 >= 0, 2 <= (0 >= 0), (2 <= 0) >= 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <= 0 >= 0 AS `2 <= 0 >= 0`,2 <= (0 >= 0) AS `2 <= (0 >= 0)`,2 <= 0 >= 0 AS `(2 <= 0) >= 0` +select 2 <= 0 >= 0, 2 <= (0 >= 0), (2 <= 0) >= 0 union select * from v1; +2 <= 0 >= 0 2 <= (0 >= 0) (2 <= 0) >= 0 +1 0 1 +create or replace view v1 as select 2 <= 3 <= 3, 2 <= (3 <= 3), (2 <= 3) <= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <= 3 <= 3 AS `2 <= 3 <= 3`,2 <= (3 <= 3) AS `2 <= (3 <= 3)`,2 <= 3 <= 3 AS `(2 <= 3) <= 3` +select 2 <= 3 <= 3, 2 <= (3 <= 3), (2 <= 3) <= 3 union select * from v1; +2 <= 3 <= 3 2 <= (3 <= 3) (2 <= 3) <= 3 +1 0 1 +create or replace view v1 as select 2 <= 3 < 3, 2 <= (3 < 3), (2 <= 3) < 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <= 3 < 3 AS `2 <= 3 < 3`,2 <= (3 < 3) AS `2 <= (3 < 3)`,2 <= 3 < 3 AS `(2 <= 3) < 3` +select 2 <= 3 < 3, 2 <= (3 < 3), (2 <= 3) < 3 union select * from v1; +2 <= 3 < 3 2 <= (3 < 3) (2 <= 3) < 3 +1 0 1 +create or replace view v1 as select 2 <= 3 <> 3, 2 <= (3 <> 3), (2 <= 3) <> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <= 3 <> 3 AS `2 <= 3 <> 3`,2 <= (3 <> 3) AS `2 <= (3 <> 3)`,2 <= 3 <> 3 AS `(2 <= 3) <> 3` +select 2 <= 3 <> 3, 2 <= (3 <> 3), (2 <= 3) <> 3 union select * from v1; +2 <= 3 <> 3 2 <= (3 <> 3) (2 <= 3) <> 3 +1 0 1 +create or replace view v1 as select 2 <= 3 > 0, 2 <= (3 > 0), (2 <= 3) > 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <= 3 > 0 AS `2 <= 3 > 0`,2 <= (3 > 0) AS `2 <= (3 > 0)`,2 <= 3 > 0 AS `(2 <= 3) > 0` +select 2 <= 3 > 0, 2 <= (3 > 0), (2 <= 3) > 0 union select * from v1; +2 <= 3 > 0 2 <= (3 > 0) (2 <= 3) > 0 +1 0 1 +create or replace view v1 as select 2 <= 3 != 3, 2 <= (3 != 3), (2 <= 3) != 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <= 3 <> 3 AS `2 <= 3 != 3`,2 <= (3 <> 3) AS `2 <= (3 != 3)`,2 <= 3 <> 3 AS `(2 <= 3) != 3` +select 2 <= 3 != 3, 2 <= (3 != 3), (2 <= 3) != 3 union select * from v1; +2 <= 3 != 3 2 <= (3 != 3) (2 <= 3) != 3 +1 0 1 +create or replace view v1 as select 2 <= 0 LIKE 0, 2 <= (0 LIKE 0), (2 <= 0) LIKE 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <= 0 like 0 AS `2 <= 0 LIKE 0`,2 <= 0 like 0 AS `2 <= (0 LIKE 0)`,(2 <= 0) like 0 AS `(2 <= 0) LIKE 0` +select 2 <= 0 LIKE 0, 2 <= (0 LIKE 0), (2 <= 0) LIKE 0 union select * from v1; +2 <= 0 LIKE 0 2 <= (0 LIKE 0) (2 <= 0) LIKE 0 +0 0 1 +create or replace view v1 as select 2 <= 0 REGEXP 0, 2 <= (0 REGEXP 0), (2 <= 0) REGEXP 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <= 0 regexp 0 AS `2 <= 0 REGEXP 0`,2 <= 0 regexp 0 AS `2 <= (0 REGEXP 0)`,(2 <= 0) regexp 0 AS `(2 <= 0) REGEXP 0` +select 2 <= 0 REGEXP 0, 2 <= (0 REGEXP 0), (2 <= 0) REGEXP 0 union select * from v1; +2 <= 0 REGEXP 0 2 <= (0 REGEXP 0) (2 <= 0) REGEXP 0 +0 0 1 +create or replace view v1 as select 2 <= 3 | 3, 2 <= (3 | 3), (2 <= 3) | 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <= 3 | 3 AS `2 <= 3 | 3`,2 <= 3 | 3 AS `2 <= (3 | 3)`,(2 <= 3) | 3 AS `(2 <= 3) | 3` +select 2 <= 3 | 3, 2 <= (3 | 3), (2 <= 3) | 3 union select * from v1; +2 <= 3 | 3 2 <= (3 | 3) (2 <= 3) | 3 +1 1 3 +create or replace view v1 as select 2 <= 3 & 2, 2 <= (3 & 2), (2 <= 3) & 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <= 3 & 2 AS `2 <= 3 & 2`,2 <= 3 & 2 AS `2 <= (3 & 2)`,(2 <= 3) & 2 AS `(2 <= 3) & 2` +select 2 <= 3 & 2, 2 <= (3 & 2), (2 <= 3) & 2 union select * from v1; +2 <= 3 & 2 2 <= (3 & 2) (2 <= 3) & 2 +1 1 0 +create or replace view v1 as select 2 <= 3 << 3, 2 <= (3 << 3), (2 <= 3) << 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <= 3 << 3 AS `2 <= 3 << 3`,2 <= 3 << 3 AS `2 <= (3 << 3)`,(2 <= 3) << 3 AS `(2 <= 3) << 3` +select 2 <= 3 << 3, 2 <= (3 << 3), (2 <= 3) << 3 union select * from v1; +2 <= 3 << 3 2 <= (3 << 3) (2 <= 3) << 3 +1 1 8 +create or replace view v1 as select 0 <= 3 >> 1, 0 <= (3 >> 1), (0 <= 3) >> 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 0 <= 3 >> 1 AS `0 <= 3 >> 1`,0 <= 3 >> 1 AS `0 <= (3 >> 1)`,(0 <= 3) >> 1 AS `(0 <= 3) >> 1` +select 0 <= 3 >> 1, 0 <= (3 >> 1), (0 <= 3) >> 1 union select * from v1; +0 <= 3 >> 1 0 <= (3 >> 1) (0 <= 3) >> 1 +1 1 0 +create or replace view v1 as select 2 <= '2000-01-01' +INTERVAL 1 DAY, 2 <= ('2000-01-01' +INTERVAL 1 DAY), (2 <= '2000-01-01') +INTERVAL 1 DAY; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <= '2000-01-01' + interval 1 day AS `2 <= '2000-01-01' +INTERVAL 1 DAY`,2 <= '2000-01-01' + interval 1 day AS `2 <= ('2000-01-01' +INTERVAL 1 DAY)`,(2 <= '2000-01-01') + interval 1 day AS `(2 <= '2000-01-01') +INTERVAL 1 DAY` +select 2 <= '2000-01-01' +INTERVAL 1 DAY, 2 <= ('2000-01-01' +INTERVAL 1 DAY), (2 <= '2000-01-01') +INTERVAL 1 DAY union select * from v1; +2 <= '2000-01-01' +INTERVAL 1 DAY 2 <= ('2000-01-01' +INTERVAL 1 DAY) (2 <= '2000-01-01') +INTERVAL 1 DAY +1 1 NULL +create or replace view v1 as select 2 <= 3 + 3, 2 <= (3 + 3), (2 <= 3) + 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <= 3 + 3 AS `2 <= 3 + 3`,2 <= 3 + 3 AS `2 <= (3 + 3)`,(2 <= 3) + 3 AS `(2 <= 3) + 3` +select 2 <= 3 + 3, 2 <= (3 + 3), (2 <= 3) + 3 union select * from v1; +2 <= 3 + 3 2 <= (3 + 3) (2 <= 3) + 3 +1 1 4 +create or replace view v1 as select 2 <= 3 - 3, 2 <= (3 - 3), (2 <= 3) - 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <= 3 - 3 AS `2 <= 3 - 3`,2 <= 3 - 3 AS `2 <= (3 - 3)`,(2 <= 3) - 3 AS `(2 <= 3) - 3` +select 2 <= 3 - 3, 2 <= (3 - 3), (2 <= 3) - 3 union select * from v1; +2 <= 3 - 3 2 <= (3 - 3) (2 <= 3) - 3 +0 0 -2 +create or replace view v1 as select 2 <= 3 * 3, 2 <= (3 * 3), (2 <= 3) * 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <= 3 * 3 AS `2 <= 3 * 3`,2 <= 3 * 3 AS `2 <= (3 * 3)`,(2 <= 3) * 3 AS `(2 <= 3) * 3` +select 2 <= 3 * 3, 2 <= (3 * 3), (2 <= 3) * 3 union select * from v1; +2 <= 3 * 3 2 <= (3 * 3) (2 <= 3) * 3 +1 1 3 +create or replace view v1 as select 2 <= 3 / 3, 2 <= (3 / 3), (2 <= 3) / 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <= 3 / 3 AS `2 <= 3 / 3`,2 <= 3 / 3 AS `2 <= (3 / 3)`,(2 <= 3) / 3 AS `(2 <= 3) / 3` +select 2 <= 3 / 3, 2 <= (3 / 3), (2 <= 3) / 3 union select * from v1; +2 <= 3 / 3 2 <= (3 / 3) (2 <= 3) / 3 +0 0 0.3333 +create or replace view v1 as select 2 <= 9 DIV 3, 2 <= (9 DIV 3), (2 <= 9) DIV 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <= 9 DIV 3 AS `2 <= 9 DIV 3`,2 <= 9 DIV 3 AS `2 <= (9 DIV 3)`,(2 <= 9) DIV 3 AS `(2 <= 9) DIV 3` +select 2 <= 9 DIV 3, 2 <= (9 DIV 3), (2 <= 9) DIV 3 union select * from v1; +2 <= 9 DIV 3 2 <= (9 DIV 3) (2 <= 9) DIV 3 +1 1 0 +create or replace view v1 as select 2 <= 3 MOD 3, 2 <= (3 MOD 3), (2 <= 3) MOD 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <= 3 MOD 3 AS `2 <= 3 MOD 3`,2 <= 3 MOD 3 AS `2 <= (3 MOD 3)`,(2 <= 3) MOD 3 AS `(2 <= 3) MOD 3` +select 2 <= 3 MOD 3, 2 <= (3 MOD 3), (2 <= 3) MOD 3 union select * from v1; +2 <= 3 MOD 3 2 <= (3 MOD 3) (2 <= 3) MOD 3 +0 0 1 +create or replace view v1 as select 2 <= 3 % 3, 2 <= (3 % 3), (2 <= 3) % 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <= 3 MOD 3 AS `2 <= 3 % 3`,2 <= 3 MOD 3 AS `2 <= (3 % 3)`,(2 <= 3) MOD 3 AS `(2 <= 3) % 3` +select 2 <= 3 % 3, 2 <= (3 % 3), (2 <= 3) % 3 union select * from v1; +2 <= 3 % 3 2 <= (3 % 3) (2 <= 3) % 3 +0 0 1 +create or replace view v1 as select 2 <= 3 ^ 3, 2 <= (3 ^ 3), (2 <= 3) ^ 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <= 3 ^ 3 AS `2 <= 3 ^ 3`,2 <= 3 ^ 3 AS `2 <= (3 ^ 3)`,(2 <= 3) ^ 3 AS `(2 <= 3) ^ 3` +select 2 <= 3 ^ 3, 2 <= (3 ^ 3), (2 <= 3) ^ 3 union select * from v1; +2 <= 3 ^ 3 2 <= (3 ^ 3) (2 <= 3) ^ 3 +0 0 2 +create or replace view v1 as select 2 <= 3 BETWEEN 1 AND 3, 2 <= (3 BETWEEN 1 AND 3), (2 <= 3) BETWEEN 1 AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <= 3 between 1 and 3 AS `2 <= 3 BETWEEN 1 AND 3`,2 <= 3 between 1 and 3 AS `2 <= (3 BETWEEN 1 AND 3)`,(2 <= 3) between 1 and 3 AS `(2 <= 3) BETWEEN 1 AND 3` +select 2 <= 3 BETWEEN 1 AND 3, 2 <= (3 BETWEEN 1 AND 3), (2 <= 3) BETWEEN 1 AND 3 union select * from v1; +2 <= 3 BETWEEN 1 AND 3 2 <= (3 BETWEEN 1 AND 3) (2 <= 3) BETWEEN 1 AND 3 +0 0 1 +create or replace view v1 as select 2 < 1 IS FALSE, 2 < (1 IS FALSE), (2 < 1) IS FALSE; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 < 1 is false AS `2 < 1 IS FALSE`,2 < (1 is false) AS `2 < (1 IS FALSE)`,2 < 1 is false AS `(2 < 1) IS FALSE` +select 2 < 1 IS FALSE, 2 < (1 IS FALSE), (2 < 1) IS FALSE union select * from v1; +2 < 1 IS FALSE 2 < (1 IS FALSE) (2 < 1) IS FALSE +1 0 1 +create or replace view v1 as select charset(2 < 3 COLLATE latin1_bin), charset(2 < (3 COLLATE latin1_bin)), charset((2 < 3) COLLATE latin1_bin); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select charset(2 < 3 collate latin1_bin) AS `charset(2 < 3 COLLATE latin1_bin)`,charset(2 < 3 collate latin1_bin) AS `charset(2 < (3 COLLATE latin1_bin))`,charset((2 < 3) collate latin1_bin) AS `charset((2 < 3) COLLATE latin1_bin)` +select charset(2 < 3 COLLATE latin1_bin), charset(2 < (3 COLLATE latin1_bin)), charset((2 < 3) COLLATE latin1_bin) union select * from v1; +charset(2 < 3 COLLATE latin1_bin) charset(2 < (3 COLLATE latin1_bin)) charset((2 < 3) COLLATE latin1_bin) +binary binary latin1 +create or replace view v1 as select 2 < 3 IN (0,1), 2 < (3 IN (0,1)), (2 < 3) IN (0,1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 < 3 in (0,1) AS `2 < 3 IN (0,1)`,2 < 3 in (0,1) AS `2 < (3 IN (0,1))`,(2 < 3) in (0,1) AS `(2 < 3) IN (0,1)` +select 2 < 3 IN (0,1), 2 < (3 IN (0,1)), (2 < 3) IN (0,1) union select * from v1; +2 < 3 IN (0,1) 2 < (3 IN (0,1)) (2 < 3) IN (0,1) +0 0 1 +create or replace view v1 as select 2 < 3 OR 3, 2 < (3 OR 3), (2 < 3) OR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 < 3 or 3 AS `2 < 3 OR 3`,2 < (3 or 3) AS `2 < (3 OR 3)`,2 < 3 or 3 AS `(2 < 3) OR 3` +select 2 < 3 OR 3, 2 < (3 OR 3), (2 < 3) OR 3 union select * from v1; +2 < 3 OR 3 2 < (3 OR 3) (2 < 3) OR 3 +1 0 1 +create or replace view v1 as select 2 < 3 || 3, 2 < (3 || 3), (2 < 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 < 3 or 3 AS `2 < 3 || 3`,2 < (3 or 3) AS `2 < (3 || 3)`,2 < 3 or 3 AS `(2 < 3) || 3` +select 2 < 3 || 3, 2 < (3 || 3), (2 < 3) || 3 union select * from v1; +2 < 3 || 3 2 < (3 || 3) (2 < 3) || 3 +1 0 1 +create or replace view v1 as select 2 < 3 XOR 0, 2 < (3 XOR 0), (2 < 3) XOR 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 < 3 xor 0 AS `2 < 3 XOR 0`,2 < (3 xor 0) AS `2 < (3 XOR 0)`,2 < 3 xor 0 AS `(2 < 3) XOR 0` +select 2 < 3 XOR 0, 2 < (3 XOR 0), (2 < 3) XOR 0 union select * from v1; +2 < 3 XOR 0 2 < (3 XOR 0) (2 < 3) XOR 0 +1 0 1 +create or replace view v1 as select 2 < 3 AND 3, 2 < (3 AND 3), (2 < 3) AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 < 3 and 3 AS `2 < 3 AND 3`,2 < (3 and 3) AS `2 < (3 AND 3)`,2 < 3 and 3 AS `(2 < 3) AND 3` +select 2 < 3 AND 3, 2 < (3 AND 3), (2 < 3) AND 3 union select * from v1; +2 < 3 AND 3 2 < (3 AND 3) (2 < 3) AND 3 +1 0 1 +create or replace view v1 as select 2 < 3 && 3, 2 < (3 && 3), (2 < 3) && 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 < 3 and 3 AS `2 < 3 && 3`,2 < (3 and 3) AS `2 < (3 && 3)`,2 < 3 and 3 AS `(2 < 3) && 3` +select 2 < 3 && 3, 2 < (3 && 3), (2 < 3) && 3 union select * from v1; +2 < 3 && 3 2 < (3 && 3) (2 < 3) && 3 +1 0 1 +create or replace view v1 as select 2 < 3 = 1, 2 < (3 = 1), (2 < 3) = 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 < 3 = 1 AS `2 < 3 = 1`,2 < (3 = 1) AS `2 < (3 = 1)`,2 < 3 = 1 AS `(2 < 3) = 1` +select 2 < 3 = 1, 2 < (3 = 1), (2 < 3) = 1 union select * from v1; +2 < 3 = 1 2 < (3 = 1) (2 < 3) = 1 +1 0 1 +create or replace view v1 as select 2 < 3 <=> 1, 2 < (3 <=> 1), (2 < 3) <=> 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 < 3 <=> 1 AS `2 < 3 <=> 1`,2 < (3 <=> 1) AS `2 < (3 <=> 1)`,2 < 3 <=> 1 AS `(2 < 3) <=> 1` +select 2 < 3 <=> 1, 2 < (3 <=> 1), (2 < 3) <=> 1 union select * from v1; +2 < 3 <=> 1 2 < (3 <=> 1) (2 < 3) <=> 1 +1 0 1 +create or replace view v1 as select 2 < 3 >= 1, 2 < (3 >= 1), (2 < 3) >= 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 < 3 >= 1 AS `2 < 3 >= 1`,2 < (3 >= 1) AS `2 < (3 >= 1)`,2 < 3 >= 1 AS `(2 < 3) >= 1` +select 2 < 3 >= 1, 2 < (3 >= 1), (2 < 3) >= 1 union select * from v1; +2 < 3 >= 1 2 < (3 >= 1) (2 < 3) >= 1 +1 0 1 +create or replace view v1 as select 2 < 3 <= 3, 2 < (3 <= 3), (2 < 3) <= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 < 3 <= 3 AS `2 < 3 <= 3`,2 < (3 <= 3) AS `2 < (3 <= 3)`,2 < 3 <= 3 AS `(2 < 3) <= 3` +select 2 < 3 <= 3, 2 < (3 <= 3), (2 < 3) <= 3 union select * from v1; +2 < 3 <= 3 2 < (3 <= 3) (2 < 3) <= 3 +1 0 1 +create or replace view v1 as select 2 < 3 < 3, 2 < (3 < 3), (2 < 3) < 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 < 3 < 3 AS `2 < 3 < 3`,2 < (3 < 3) AS `2 < (3 < 3)`,2 < 3 < 3 AS `(2 < 3) < 3` +select 2 < 3 < 3, 2 < (3 < 3), (2 < 3) < 3 union select * from v1; +2 < 3 < 3 2 < (3 < 3) (2 < 3) < 3 +1 0 1 +create or replace view v1 as select 2 < 3 <> 3, 2 < (3 <> 3), (2 < 3) <> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 < 3 <> 3 AS `2 < 3 <> 3`,2 < (3 <> 3) AS `2 < (3 <> 3)`,2 < 3 <> 3 AS `(2 < 3) <> 3` +select 2 < 3 <> 3, 2 < (3 <> 3), (2 < 3) <> 3 union select * from v1; +2 < 3 <> 3 2 < (3 <> 3) (2 < 3) <> 3 +1 0 1 +create or replace view v1 as select 2 < 3 > 0, 2 < (3 > 0), (2 < 3) > 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 < 3 > 0 AS `2 < 3 > 0`,2 < (3 > 0) AS `2 < (3 > 0)`,2 < 3 > 0 AS `(2 < 3) > 0` +select 2 < 3 > 0, 2 < (3 > 0), (2 < 3) > 0 union select * from v1; +2 < 3 > 0 2 < (3 > 0) (2 < 3) > 0 +1 0 1 +create or replace view v1 as select 2 < 3 != 3, 2 < (3 != 3), (2 < 3) != 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 < 3 <> 3 AS `2 < 3 != 3`,2 < (3 <> 3) AS `2 < (3 != 3)`,2 < 3 <> 3 AS `(2 < 3) != 3` +select 2 < 3 != 3, 2 < (3 != 3), (2 < 3) != 3 union select * from v1; +2 < 3 != 3 2 < (3 != 3) (2 < 3) != 3 +1 0 1 +create or replace view v1 as select 2 < 3 LIKE 1, 2 < (3 LIKE 1), (2 < 3) LIKE 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 < 3 like 1 AS `2 < 3 LIKE 1`,2 < 3 like 1 AS `2 < (3 LIKE 1)`,(2 < 3) like 1 AS `(2 < 3) LIKE 1` +select 2 < 3 LIKE 1, 2 < (3 LIKE 1), (2 < 3) LIKE 1 union select * from v1; +2 < 3 LIKE 1 2 < (3 LIKE 1) (2 < 3) LIKE 1 +0 0 1 +create or replace view v1 as select 2 < 3 REGEXP 1, 2 < (3 REGEXP 1), (2 < 3) REGEXP 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 < 3 regexp 1 AS `2 < 3 REGEXP 1`,2 < 3 regexp 1 AS `2 < (3 REGEXP 1)`,(2 < 3) regexp 1 AS `(2 < 3) REGEXP 1` +select 2 < 3 REGEXP 1, 2 < (3 REGEXP 1), (2 < 3) REGEXP 1 union select * from v1; +2 < 3 REGEXP 1 2 < (3 REGEXP 1) (2 < 3) REGEXP 1 +0 0 1 +create or replace view v1 as select 2 < 3 | 3, 2 < (3 | 3), (2 < 3) | 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 < 3 | 3 AS `2 < 3 | 3`,2 < 3 | 3 AS `2 < (3 | 3)`,(2 < 3) | 3 AS `(2 < 3) | 3` +select 2 < 3 | 3, 2 < (3 | 3), (2 < 3) | 3 union select * from v1; +2 < 3 | 3 2 < (3 | 3) (2 < 3) | 3 +1 1 3 +create or replace view v1 as select 2 < 4 & 4, 2 < (4 & 4), (2 < 4) & 4; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 < 4 & 4 AS `2 < 4 & 4`,2 < 4 & 4 AS `2 < (4 & 4)`,(2 < 4) & 4 AS `(2 < 4) & 4` +select 2 < 4 & 4, 2 < (4 & 4), (2 < 4) & 4 union select * from v1; +2 < 4 & 4 2 < (4 & 4) (2 < 4) & 4 +1 1 0 +create or replace view v1 as select 2 < 3 << 3, 2 < (3 << 3), (2 < 3) << 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 < 3 << 3 AS `2 < 3 << 3`,2 < 3 << 3 AS `2 < (3 << 3)`,(2 < 3) << 3 AS `(2 < 3) << 3` +select 2 < 3 << 3, 2 < (3 << 3), (2 < 3) << 3 union select * from v1; +2 < 3 << 3 2 < (3 << 3) (2 < 3) << 3 +1 1 8 +create or replace view v1 as select 0 < 3 >> 1, 0 < (3 >> 1), (0 < 3) >> 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 0 < 3 >> 1 AS `0 < 3 >> 1`,0 < 3 >> 1 AS `0 < (3 >> 1)`,(0 < 3) >> 1 AS `(0 < 3) >> 1` +select 0 < 3 >> 1, 0 < (3 >> 1), (0 < 3) >> 1 union select * from v1; +0 < 3 >> 1 0 < (3 >> 1) (0 < 3) >> 1 +1 1 0 +create or replace view v1 as select 2 < '2000-01-01' +INTERVAL 1 DAY, 2 < ('2000-01-01' +INTERVAL 1 DAY), (2 < '2000-01-01') +INTERVAL 1 DAY; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 < '2000-01-01' + interval 1 day AS `2 < '2000-01-01' +INTERVAL 1 DAY`,2 < '2000-01-01' + interval 1 day AS `2 < ('2000-01-01' +INTERVAL 1 DAY)`,(2 < '2000-01-01') + interval 1 day AS `(2 < '2000-01-01') +INTERVAL 1 DAY` +select 2 < '2000-01-01' +INTERVAL 1 DAY, 2 < ('2000-01-01' +INTERVAL 1 DAY), (2 < '2000-01-01') +INTERVAL 1 DAY union select * from v1; +2 < '2000-01-01' +INTERVAL 1 DAY 2 < ('2000-01-01' +INTERVAL 1 DAY) (2 < '2000-01-01') +INTERVAL 1 DAY +1 1 NULL +create or replace view v1 as select 2 < 3 + 3, 2 < (3 + 3), (2 < 3) + 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 < 3 + 3 AS `2 < 3 + 3`,2 < 3 + 3 AS `2 < (3 + 3)`,(2 < 3) + 3 AS `(2 < 3) + 3` +select 2 < 3 + 3, 2 < (3 + 3), (2 < 3) + 3 union select * from v1; +2 < 3 + 3 2 < (3 + 3) (2 < 3) + 3 +1 1 4 +create or replace view v1 as select 2 < 3 - 3, 2 < (3 - 3), (2 < 3) - 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 < 3 - 3 AS `2 < 3 - 3`,2 < 3 - 3 AS `2 < (3 - 3)`,(2 < 3) - 3 AS `(2 < 3) - 3` +select 2 < 3 - 3, 2 < (3 - 3), (2 < 3) - 3 union select * from v1; +2 < 3 - 3 2 < (3 - 3) (2 < 3) - 3 +0 0 -2 +create or replace view v1 as select 2 < 3 * 3, 2 < (3 * 3), (2 < 3) * 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 < 3 * 3 AS `2 < 3 * 3`,2 < 3 * 3 AS `2 < (3 * 3)`,(2 < 3) * 3 AS `(2 < 3) * 3` +select 2 < 3 * 3, 2 < (3 * 3), (2 < 3) * 3 union select * from v1; +2 < 3 * 3 2 < (3 * 3) (2 < 3) * 3 +1 1 3 +create or replace view v1 as select 2 < 3 / 3, 2 < (3 / 3), (2 < 3) / 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 < 3 / 3 AS `2 < 3 / 3`,2 < 3 / 3 AS `2 < (3 / 3)`,(2 < 3) / 3 AS `(2 < 3) / 3` +select 2 < 3 / 3, 2 < (3 / 3), (2 < 3) / 3 union select * from v1; +2 < 3 / 3 2 < (3 / 3) (2 < 3) / 3 +0 0 0.3333 +create or replace view v1 as select 2 < 9 DIV 3, 2 < (9 DIV 3), (2 < 9) DIV 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 < 9 DIV 3 AS `2 < 9 DIV 3`,2 < 9 DIV 3 AS `2 < (9 DIV 3)`,(2 < 9) DIV 3 AS `(2 < 9) DIV 3` +select 2 < 9 DIV 3, 2 < (9 DIV 3), (2 < 9) DIV 3 union select * from v1; +2 < 9 DIV 3 2 < (9 DIV 3) (2 < 9) DIV 3 +1 1 0 +create or replace view v1 as select 2 < 3 MOD 3, 2 < (3 MOD 3), (2 < 3) MOD 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 < 3 MOD 3 AS `2 < 3 MOD 3`,2 < 3 MOD 3 AS `2 < (3 MOD 3)`,(2 < 3) MOD 3 AS `(2 < 3) MOD 3` +select 2 < 3 MOD 3, 2 < (3 MOD 3), (2 < 3) MOD 3 union select * from v1; +2 < 3 MOD 3 2 < (3 MOD 3) (2 < 3) MOD 3 +0 0 1 +create or replace view v1 as select 2 < 3 % 3, 2 < (3 % 3), (2 < 3) % 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 < 3 MOD 3 AS `2 < 3 % 3`,2 < 3 MOD 3 AS `2 < (3 % 3)`,(2 < 3) MOD 3 AS `(2 < 3) % 3` +select 2 < 3 % 3, 2 < (3 % 3), (2 < 3) % 3 union select * from v1; +2 < 3 % 3 2 < (3 % 3) (2 < 3) % 3 +0 0 1 +create or replace view v1 as select 2 < 3 ^ 3, 2 < (3 ^ 3), (2 < 3) ^ 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 < 3 ^ 3 AS `2 < 3 ^ 3`,2 < 3 ^ 3 AS `2 < (3 ^ 3)`,(2 < 3) ^ 3 AS `(2 < 3) ^ 3` +select 2 < 3 ^ 3, 2 < (3 ^ 3), (2 < 3) ^ 3 union select * from v1; +2 < 3 ^ 3 2 < (3 ^ 3) (2 < 3) ^ 3 +0 0 2 +create or replace view v1 as select 2 < 3 BETWEEN 1 AND 3, 2 < (3 BETWEEN 1 AND 3), (2 < 3) BETWEEN 1 AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 < 3 between 1 and 3 AS `2 < 3 BETWEEN 1 AND 3`,2 < 3 between 1 and 3 AS `2 < (3 BETWEEN 1 AND 3)`,(2 < 3) between 1 and 3 AS `(2 < 3) BETWEEN 1 AND 3` +select 2 < 3 BETWEEN 1 AND 3, 2 < (3 BETWEEN 1 AND 3), (2 < 3) BETWEEN 1 AND 3 union select * from v1; +2 < 3 BETWEEN 1 AND 3 2 < (3 BETWEEN 1 AND 3) (2 < 3) BETWEEN 1 AND 3 +0 0 1 +create or replace view v1 as select 2 <> 3 IS FALSE, 2 <> (3 IS FALSE), (2 <> 3) IS FALSE; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <> 3 is false AS `2 <> 3 IS FALSE`,2 <> (3 is false) AS `2 <> (3 IS FALSE)`,2 <> 3 is false AS `(2 <> 3) IS FALSE` +select 2 <> 3 IS FALSE, 2 <> (3 IS FALSE), (2 <> 3) IS FALSE union select * from v1; +2 <> 3 IS FALSE 2 <> (3 IS FALSE) (2 <> 3) IS FALSE +0 1 0 +create or replace view v1 as select charset(2 <> 3 COLLATE latin1_bin), charset(2 <> (3 COLLATE latin1_bin)), charset((2 <> 3) COLLATE latin1_bin); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select charset(2 <> 3 collate latin1_bin) AS `charset(2 <> 3 COLLATE latin1_bin)`,charset(2 <> 3 collate latin1_bin) AS `charset(2 <> (3 COLLATE latin1_bin))`,charset((2 <> 3) collate latin1_bin) AS `charset((2 <> 3) COLLATE latin1_bin)` +select charset(2 <> 3 COLLATE latin1_bin), charset(2 <> (3 COLLATE latin1_bin)), charset((2 <> 3) COLLATE latin1_bin) union select * from v1; +charset(2 <> 3 COLLATE latin1_bin) charset(2 <> (3 COLLATE latin1_bin)) charset((2 <> 3) COLLATE latin1_bin) +binary binary latin1 +create or replace view v1 as select 2 <> 3 IN (0,0), 2 <> (3 IN (0,0)), (2 <> 3) IN (0,0); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <> 3 in (0,0) AS `2 <> 3 IN (0,0)`,2 <> 3 in (0,0) AS `2 <> (3 IN (0,0))`,(2 <> 3) in (0,0) AS `(2 <> 3) IN (0,0)` +select 2 <> 3 IN (0,0), 2 <> (3 IN (0,0)), (2 <> 3) IN (0,0) union select * from v1; +2 <> 3 IN (0,0) 2 <> (3 IN (0,0)) (2 <> 3) IN (0,0) +1 1 0 +create or replace view v1 as select 1 <> 3 OR 3, 1 <> (3 OR 3), (1 <> 3) OR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 1 <> 3 or 3 AS `1 <> 3 OR 3`,1 <> (3 or 3) AS `1 <> (3 OR 3)`,1 <> 3 or 3 AS `(1 <> 3) OR 3` +select 1 <> 3 OR 3, 1 <> (3 OR 3), (1 <> 3) OR 3 union select * from v1; +1 <> 3 OR 3 1 <> (3 OR 3) (1 <> 3) OR 3 +1 0 1 +create or replace view v1 as select 1 <> 3 || 3, 1 <> (3 || 3), (1 <> 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 1 <> 3 or 3 AS `1 <> 3 || 3`,1 <> (3 or 3) AS `1 <> (3 || 3)`,1 <> 3 or 3 AS `(1 <> 3) || 3` +select 1 <> 3 || 3, 1 <> (3 || 3), (1 <> 3) || 3 union select * from v1; +1 <> 3 || 3 1 <> (3 || 3) (1 <> 3) || 3 +1 0 1 +create or replace view v1 as select 2 <> 3 XOR 3, 2 <> (3 XOR 3), (2 <> 3) XOR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <> 3 xor 3 AS `2 <> 3 XOR 3`,2 <> (3 xor 3) AS `2 <> (3 XOR 3)`,2 <> 3 xor 3 AS `(2 <> 3) XOR 3` +select 2 <> 3 XOR 3, 2 <> (3 XOR 3), (2 <> 3) XOR 3 union select * from v1; +2 <> 3 XOR 3 2 <> (3 XOR 3) (2 <> 3) XOR 3 +0 1 0 +create or replace view v1 as select 3 <> 3 AND 3, 3 <> (3 AND 3), (3 <> 3) AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 3 <> 3 and 3 AS `3 <> 3 AND 3`,3 <> (3 and 3) AS `3 <> (3 AND 3)`,3 <> 3 and 3 AS `(3 <> 3) AND 3` +select 3 <> 3 AND 3, 3 <> (3 AND 3), (3 <> 3) AND 3 union select * from v1; +3 <> 3 AND 3 3 <> (3 AND 3) (3 <> 3) AND 3 +0 1 0 +create or replace view v1 as select 3 <> 3 && 3, 3 <> (3 && 3), (3 <> 3) && 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 3 <> 3 and 3 AS `3 <> 3 && 3`,3 <> (3 and 3) AS `3 <> (3 && 3)`,3 <> 3 and 3 AS `(3 <> 3) && 3` +select 3 <> 3 && 3, 3 <> (3 && 3), (3 <> 3) && 3 union select * from v1; +3 <> 3 && 3 3 <> (3 && 3) (3 <> 3) && 3 +0 1 0 +create or replace view v1 as select 2 <> 3 = 3, 2 <> (3 = 3), (2 <> 3) = 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <> 3 = 3 AS `2 <> 3 = 3`,2 <> (3 = 3) AS `2 <> (3 = 3)`,2 <> 3 = 3 AS `(2 <> 3) = 3` +select 2 <> 3 = 3, 2 <> (3 = 3), (2 <> 3) = 3 union select * from v1; +2 <> 3 = 3 2 <> (3 = 3) (2 <> 3) = 3 +0 1 0 +create or replace view v1 as select 2 <> 3 <=> 3, 2 <> (3 <=> 3), (2 <> 3) <=> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <> 3 <=> 3 AS `2 <> 3 <=> 3`,2 <> (3 <=> 3) AS `2 <> (3 <=> 3)`,2 <> 3 <=> 3 AS `(2 <> 3) <=> 3` +select 2 <> 3 <=> 3, 2 <> (3 <=> 3), (2 <> 3) <=> 3 union select * from v1; +2 <> 3 <=> 3 2 <> (3 <=> 3) (2 <> 3) <=> 3 +0 1 0 +create or replace view v1 as select 2 <> 3 >= 3, 2 <> (3 >= 3), (2 <> 3) >= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <> 3 >= 3 AS `2 <> 3 >= 3`,2 <> (3 >= 3) AS `2 <> (3 >= 3)`,2 <> 3 >= 3 AS `(2 <> 3) >= 3` +select 2 <> 3 >= 3, 2 <> (3 >= 3), (2 <> 3) >= 3 union select * from v1; +2 <> 3 >= 3 2 <> (3 >= 3) (2 <> 3) >= 3 +0 1 0 +create or replace view v1 as select 1 <> 3 <= 3, 1 <> (3 <= 3), (1 <> 3) <= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 1 <> 3 <= 3 AS `1 <> 3 <= 3`,1 <> (3 <= 3) AS `1 <> (3 <= 3)`,1 <> 3 <= 3 AS `(1 <> 3) <= 3` +select 1 <> 3 <= 3, 1 <> (3 <= 3), (1 <> 3) <= 3 union select * from v1; +1 <> 3 <= 3 1 <> (3 <= 3) (1 <> 3) <= 3 +1 0 1 +create or replace view v1 as select 0 <> 3 < 3, 0 <> (3 < 3), (0 <> 3) < 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 0 <> 3 < 3 AS `0 <> 3 < 3`,0 <> (3 < 3) AS `0 <> (3 < 3)`,0 <> 3 < 3 AS `(0 <> 3) < 3` +select 0 <> 3 < 3, 0 <> (3 < 3), (0 <> 3) < 3 union select * from v1; +0 <> 3 < 3 0 <> (3 < 3) (0 <> 3) < 3 +1 0 1 +create or replace view v1 as select 0 <> 3 <> 3, 0 <> (3 <> 3), (0 <> 3) <> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 0 <> 3 <> 3 AS `0 <> 3 <> 3`,0 <> (3 <> 3) AS `0 <> (3 <> 3)`,0 <> 3 <> 3 AS `(0 <> 3) <> 3` +select 0 <> 3 <> 3, 0 <> (3 <> 3), (0 <> 3) <> 3 union select * from v1; +0 <> 3 <> 3 0 <> (3 <> 3) (0 <> 3) <> 3 +1 0 1 +create or replace view v1 as select 2 <> 3 > 3, 2 <> (3 > 3), (2 <> 3) > 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <> 3 > 3 AS `2 <> 3 > 3`,2 <> (3 > 3) AS `2 <> (3 > 3)`,2 <> 3 > 3 AS `(2 <> 3) > 3` +select 2 <> 3 > 3, 2 <> (3 > 3), (2 <> 3) > 3 union select * from v1; +2 <> 3 > 3 2 <> (3 > 3) (2 <> 3) > 3 +0 1 0 +create or replace view v1 as select 0 <> 3 != 3, 0 <> (3 != 3), (0 <> 3) != 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 0 <> 3 <> 3 AS `0 <> 3 != 3`,0 <> (3 <> 3) AS `0 <> (3 != 3)`,0 <> 3 <> 3 AS `(0 <> 3) != 3` +select 0 <> 3 != 3, 0 <> (3 != 3), (0 <> 3) != 3 union select * from v1; +0 <> 3 != 3 0 <> (3 != 3) (0 <> 3) != 3 +1 0 1 +create or replace view v1 as select 2 <> 3 LIKE 3, 2 <> (3 LIKE 3), (2 <> 3) LIKE 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <> 3 like 3 AS `2 <> 3 LIKE 3`,2 <> 3 like 3 AS `2 <> (3 LIKE 3)`,(2 <> 3) like 3 AS `(2 <> 3) LIKE 3` +select 2 <> 3 LIKE 3, 2 <> (3 LIKE 3), (2 <> 3) LIKE 3 union select * from v1; +2 <> 3 LIKE 3 2 <> (3 LIKE 3) (2 <> 3) LIKE 3 +1 1 0 +create or replace view v1 as select 2 <> 3 REGEXP 3, 2 <> (3 REGEXP 3), (2 <> 3) REGEXP 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <> 3 regexp 3 AS `2 <> 3 REGEXP 3`,2 <> 3 regexp 3 AS `2 <> (3 REGEXP 3)`,(2 <> 3) regexp 3 AS `(2 <> 3) REGEXP 3` +select 2 <> 3 REGEXP 3, 2 <> (3 REGEXP 3), (2 <> 3) REGEXP 3 union select * from v1; +2 <> 3 REGEXP 3 2 <> (3 REGEXP 3) (2 <> 3) REGEXP 3 +1 1 0 +create or replace view v1 as select 2 <> 3 | 3, 2 <> (3 | 3), (2 <> 3) | 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <> 3 | 3 AS `2 <> 3 | 3`,2 <> 3 | 3 AS `2 <> (3 | 3)`,(2 <> 3) | 3 AS `(2 <> 3) | 3` +select 2 <> 3 | 3, 2 <> (3 | 3), (2 <> 3) | 3 union select * from v1; +2 <> 3 | 3 2 <> (3 | 3) (2 <> 3) | 3 +1 1 3 +create or replace view v1 as select 2 <> 4 & 4, 2 <> (4 & 4), (2 <> 4) & 4; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <> 4 & 4 AS `2 <> 4 & 4`,2 <> 4 & 4 AS `2 <> (4 & 4)`,(2 <> 4) & 4 AS `(2 <> 4) & 4` +select 2 <> 4 & 4, 2 <> (4 & 4), (2 <> 4) & 4 union select * from v1; +2 <> 4 & 4 2 <> (4 & 4) (2 <> 4) & 4 +1 1 0 +create or replace view v1 as select 2 <> 3 << 3, 2 <> (3 << 3), (2 <> 3) << 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <> 3 << 3 AS `2 <> 3 << 3`,2 <> 3 << 3 AS `2 <> (3 << 3)`,(2 <> 3) << 3 AS `(2 <> 3) << 3` +select 2 <> 3 << 3, 2 <> (3 << 3), (2 <> 3) << 3 union select * from v1; +2 <> 3 << 3 2 <> (3 << 3) (2 <> 3) << 3 +1 1 8 +create or replace view v1 as select 2 <> 3 >> 3, 2 <> (3 >> 3), (2 <> 3) >> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <> 3 >> 3 AS `2 <> 3 >> 3`,2 <> 3 >> 3 AS `2 <> (3 >> 3)`,(2 <> 3) >> 3 AS `(2 <> 3) >> 3` +select 2 <> 3 >> 3, 2 <> (3 >> 3), (2 <> 3) >> 3 union select * from v1; +2 <> 3 >> 3 2 <> (3 >> 3) (2 <> 3) >> 3 +1 1 0 +create or replace view v1 as select 2 <> '2000-01-01' +INTERVAL 1 DAY, 2 <> ('2000-01-01' +INTERVAL 1 DAY), (2 <> '2000-01-01') +INTERVAL 1 DAY; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <> '2000-01-01' + interval 1 day AS `2 <> '2000-01-01' +INTERVAL 1 DAY`,2 <> '2000-01-01' + interval 1 day AS `2 <> ('2000-01-01' +INTERVAL 1 DAY)`,(2 <> '2000-01-01') + interval 1 day AS `(2 <> '2000-01-01') +INTERVAL 1 DAY` +select 2 <> '2000-01-01' +INTERVAL 1 DAY, 2 <> ('2000-01-01' +INTERVAL 1 DAY), (2 <> '2000-01-01') +INTERVAL 1 DAY union select * from v1; +2 <> '2000-01-01' +INTERVAL 1 DAY 2 <> ('2000-01-01' +INTERVAL 1 DAY) (2 <> '2000-01-01') +INTERVAL 1 DAY +1 1 NULL +create or replace view v1 as select 2 <> 3 + 3, 2 <> (3 + 3), (2 <> 3) + 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <> 3 + 3 AS `2 <> 3 + 3`,2 <> 3 + 3 AS `2 <> (3 + 3)`,(2 <> 3) + 3 AS `(2 <> 3) + 3` +select 2 <> 3 + 3, 2 <> (3 + 3), (2 <> 3) + 3 union select * from v1; +2 <> 3 + 3 2 <> (3 + 3) (2 <> 3) + 3 +1 1 4 +create or replace view v1 as select 2 <> 3 - 3, 2 <> (3 - 3), (2 <> 3) - 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <> 3 - 3 AS `2 <> 3 - 3`,2 <> 3 - 3 AS `2 <> (3 - 3)`,(2 <> 3) - 3 AS `(2 <> 3) - 3` +select 2 <> 3 - 3, 2 <> (3 - 3), (2 <> 3) - 3 union select * from v1; +2 <> 3 - 3 2 <> (3 - 3) (2 <> 3) - 3 +1 1 -2 +create or replace view v1 as select 2 <> 3 * 3, 2 <> (3 * 3), (2 <> 3) * 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <> 3 * 3 AS `2 <> 3 * 3`,2 <> 3 * 3 AS `2 <> (3 * 3)`,(2 <> 3) * 3 AS `(2 <> 3) * 3` +select 2 <> 3 * 3, 2 <> (3 * 3), (2 <> 3) * 3 union select * from v1; +2 <> 3 * 3 2 <> (3 * 3) (2 <> 3) * 3 +1 1 3 +create or replace view v1 as select 2 <> 3 / 3, 2 <> (3 / 3), (2 <> 3) / 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <> 3 / 3 AS `2 <> 3 / 3`,2 <> 3 / 3 AS `2 <> (3 / 3)`,(2 <> 3) / 3 AS `(2 <> 3) / 3` +select 2 <> 3 / 3, 2 <> (3 / 3), (2 <> 3) / 3 union select * from v1; +2 <> 3 / 3 2 <> (3 / 3) (2 <> 3) / 3 +1 1 0.3333 +create or replace view v1 as select 2 <> 3 DIV 3, 2 <> (3 DIV 3), (2 <> 3) DIV 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <> 3 DIV 3 AS `2 <> 3 DIV 3`,2 <> 3 DIV 3 AS `2 <> (3 DIV 3)`,(2 <> 3) DIV 3 AS `(2 <> 3) DIV 3` +select 2 <> 3 DIV 3, 2 <> (3 DIV 3), (2 <> 3) DIV 3 union select * from v1; +2 <> 3 DIV 3 2 <> (3 DIV 3) (2 <> 3) DIV 3 +1 1 0 +create or replace view v1 as select 3 <> 3 MOD 3, 3 <> (3 MOD 3), (3 <> 3) MOD 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 3 <> 3 MOD 3 AS `3 <> 3 MOD 3`,3 <> 3 MOD 3 AS `3 <> (3 MOD 3)`,(3 <> 3) MOD 3 AS `(3 <> 3) MOD 3` +select 3 <> 3 MOD 3, 3 <> (3 MOD 3), (3 <> 3) MOD 3 union select * from v1; +3 <> 3 MOD 3 3 <> (3 MOD 3) (3 <> 3) MOD 3 +1 1 0 +create or replace view v1 as select 3 <> 3 % 3, 3 <> (3 % 3), (3 <> 3) % 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 3 <> 3 MOD 3 AS `3 <> 3 % 3`,3 <> 3 MOD 3 AS `3 <> (3 % 3)`,(3 <> 3) MOD 3 AS `(3 <> 3) % 3` +select 3 <> 3 % 3, 3 <> (3 % 3), (3 <> 3) % 3 union select * from v1; +3 <> 3 % 3 3 <> (3 % 3) (3 <> 3) % 3 +1 1 0 +create or replace view v1 as select 2 <> 3 ^ 3, 2 <> (3 ^ 3), (2 <> 3) ^ 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <> 3 ^ 3 AS `2 <> 3 ^ 3`,2 <> 3 ^ 3 AS `2 <> (3 ^ 3)`,(2 <> 3) ^ 3 AS `(2 <> 3) ^ 3` +select 2 <> 3 ^ 3, 2 <> (3 ^ 3), (2 <> 3) ^ 3 union select * from v1; +2 <> 3 ^ 3 2 <> (3 ^ 3) (2 <> 3) ^ 3 +1 1 2 +create or replace view v1 as select 2 <> 3 BETWEEN 2 AND 3, 2 <> (3 BETWEEN 2 AND 3), (2 <> 3) BETWEEN 2 AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <> 3 between 2 and 3 AS `2 <> 3 BETWEEN 2 AND 3`,2 <> 3 between 2 and 3 AS `2 <> (3 BETWEEN 2 AND 3)`,(2 <> 3) between 2 and 3 AS `(2 <> 3) BETWEEN 2 AND 3` +select 2 <> 3 BETWEEN 2 AND 3, 2 <> (3 BETWEEN 2 AND 3), (2 <> 3) BETWEEN 2 AND 3 union select * from v1; +2 <> 3 BETWEEN 2 AND 3 2 <> (3 BETWEEN 2 AND 3) (2 <> 3) BETWEEN 2 AND 3 +1 1 0 +create or replace view v1 as select 2 > 0 IS FALSE, 2 > (0 IS FALSE), (2 > 0) IS FALSE; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 > 0 is false AS `2 > 0 IS FALSE`,2 > (0 is false) AS `2 > (0 IS FALSE)`,2 > 0 is false AS `(2 > 0) IS FALSE` +select 2 > 0 IS FALSE, 2 > (0 IS FALSE), (2 > 0) IS FALSE union select * from v1; +2 > 0 IS FALSE 2 > (0 IS FALSE) (2 > 0) IS FALSE +0 1 0 +create or replace view v1 as select charset(2 > 3 COLLATE latin1_bin), charset(2 > (3 COLLATE latin1_bin)), charset((2 > 3) COLLATE latin1_bin); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select charset(2 > 3 collate latin1_bin) AS `charset(2 > 3 COLLATE latin1_bin)`,charset(2 > 3 collate latin1_bin) AS `charset(2 > (3 COLLATE latin1_bin))`,charset((2 > 3) collate latin1_bin) AS `charset((2 > 3) COLLATE latin1_bin)` +select charset(2 > 3 COLLATE latin1_bin), charset(2 > (3 COLLATE latin1_bin)), charset((2 > 3) COLLATE latin1_bin) union select * from v1; +charset(2 > 3 COLLATE latin1_bin) charset(2 > (3 COLLATE latin1_bin)) charset((2 > 3) COLLATE latin1_bin) +binary binary latin1 +create or replace view v1 as select 2 > 3 IN (1,1), 2 > (3 IN (1,1)), (2 > 3) IN (1,1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 > 3 in (1,1) AS `2 > 3 IN (1,1)`,2 > 3 in (1,1) AS `2 > (3 IN (1,1))`,(2 > 3) in (1,1) AS `(2 > 3) IN (1,1)` +select 2 > 3 IN (1,1), 2 > (3 IN (1,1)), (2 > 3) IN (1,1) union select * from v1; +2 > 3 IN (1,1) 2 > (3 IN (1,1)) (2 > 3) IN (1,1) +1 1 0 +create or replace view v1 as select 0 > 3 OR 3, 0 > (3 OR 3), (0 > 3) OR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 0 > 3 or 3 AS `0 > 3 OR 3`,0 > (3 or 3) AS `0 > (3 OR 3)`,0 > 3 or 3 AS `(0 > 3) OR 3` +select 0 > 3 OR 3, 0 > (3 OR 3), (0 > 3) OR 3 union select * from v1; +0 > 3 OR 3 0 > (3 OR 3) (0 > 3) OR 3 +1 0 1 +create or replace view v1 as select 0 > 3 || 3, 0 > (3 || 3), (0 > 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 0 > 3 or 3 AS `0 > 3 || 3`,0 > (3 or 3) AS `0 > (3 || 3)`,0 > 3 or 3 AS `(0 > 3) || 3` +select 0 > 3 || 3, 0 > (3 || 3), (0 > 3) || 3 union select * from v1; +0 > 3 || 3 0 > (3 || 3) (0 > 3) || 3 +1 0 1 +create or replace view v1 as select 4 > 3 XOR 3, 4 > (3 XOR 3), (4 > 3) XOR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 4 > 3 xor 3 AS `4 > 3 XOR 3`,4 > (3 xor 3) AS `4 > (3 XOR 3)`,4 > 3 xor 3 AS `(4 > 3) XOR 3` +select 4 > 3 XOR 3, 4 > (3 XOR 3), (4 > 3) XOR 3 union select * from v1; +4 > 3 XOR 3 4 > (3 XOR 3) (4 > 3) XOR 3 +0 1 0 +create or replace view v1 as select 2 > 3 AND 3, 2 > (3 AND 3), (2 > 3) AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 > 3 and 3 AS `2 > 3 AND 3`,2 > (3 and 3) AS `2 > (3 AND 3)`,2 > 3 and 3 AS `(2 > 3) AND 3` +select 2 > 3 AND 3, 2 > (3 AND 3), (2 > 3) AND 3 union select * from v1; +2 > 3 AND 3 2 > (3 AND 3) (2 > 3) AND 3 +0 1 0 +create or replace view v1 as select 2 > 3 && 3, 2 > (3 && 3), (2 > 3) && 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 > 3 and 3 AS `2 > 3 && 3`,2 > (3 and 3) AS `2 > (3 && 3)`,2 > 3 and 3 AS `(2 > 3) && 3` +select 2 > 3 && 3, 2 > (3 && 3), (2 > 3) && 3 union select * from v1; +2 > 3 && 3 2 > (3 && 3) (2 > 3) && 3 +0 1 0 +create or replace view v1 as select 2 > 3 = 3, 2 > (3 = 3), (2 > 3) = 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 > 3 = 3 AS `2 > 3 = 3`,2 > (3 = 3) AS `2 > (3 = 3)`,2 > 3 = 3 AS `(2 > 3) = 3` +select 2 > 3 = 3, 2 > (3 = 3), (2 > 3) = 3 union select * from v1; +2 > 3 = 3 2 > (3 = 3) (2 > 3) = 3 +0 1 0 +create or replace view v1 as select 2 > 3 <=> 3, 2 > (3 <=> 3), (2 > 3) <=> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 > 3 <=> 3 AS `2 > 3 <=> 3`,2 > (3 <=> 3) AS `2 > (3 <=> 3)`,2 > 3 <=> 3 AS `(2 > 3) <=> 3` +select 2 > 3 <=> 3, 2 > (3 <=> 3), (2 > 3) <=> 3 union select * from v1; +2 > 3 <=> 3 2 > (3 <=> 3) (2 > 3) <=> 3 +0 1 0 +create or replace view v1 as select 2 > 3 >= 3, 2 > (3 >= 3), (2 > 3) >= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 > 3 >= 3 AS `2 > 3 >= 3`,2 > (3 >= 3) AS `2 > (3 >= 3)`,2 > 3 >= 3 AS `(2 > 3) >= 3` +select 2 > 3 >= 3, 2 > (3 >= 3), (2 > 3) >= 3 union select * from v1; +2 > 3 >= 3 2 > (3 >= 3) (2 > 3) >= 3 +0 1 0 +create or replace view v1 as select 2 > 0 <= 0, 2 > (0 <= 0), (2 > 0) <= 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 > 0 <= 0 AS `2 > 0 <= 0`,2 > (0 <= 0) AS `2 > (0 <= 0)`,2 > 0 <= 0 AS `(2 > 0) <= 0` +select 2 > 0 <= 0, 2 > (0 <= 0), (2 > 0) <= 0 union select * from v1; +2 > 0 <= 0 2 > (0 <= 0) (2 > 0) <= 0 +0 1 0 +create or replace view v1 as select 2 > 0 < 0, 2 > (0 < 0), (2 > 0) < 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 > 0 < 0 AS `2 > 0 < 0`,2 > (0 < 0) AS `2 > (0 < 0)`,2 > 0 < 0 AS `(2 > 0) < 0` +select 2 > 0 < 0, 2 > (0 < 0), (2 > 0) < 0 union select * from v1; +2 > 0 < 0 2 > (0 < 0) (2 > 0) < 0 +0 1 0 +create or replace view v1 as select 2 > 1 <> 1, 2 > (1 <> 1), (2 > 1) <> 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 > 1 <> 1 AS `2 > 1 <> 1`,2 > (1 <> 1) AS `2 > (1 <> 1)`,2 > 1 <> 1 AS `(2 > 1) <> 1` +select 2 > 1 <> 1, 2 > (1 <> 1), (2 > 1) <> 1 union select * from v1; +2 > 1 <> 1 2 > (1 <> 1) (2 > 1) <> 1 +0 1 0 +create or replace view v1 as select 2 > 3 > 3, 2 > (3 > 3), (2 > 3) > 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 > 3 > 3 AS `2 > 3 > 3`,2 > (3 > 3) AS `2 > (3 > 3)`,2 > 3 > 3 AS `(2 > 3) > 3` +select 2 > 3 > 3, 2 > (3 > 3), (2 > 3) > 3 union select * from v1; +2 > 3 > 3 2 > (3 > 3) (2 > 3) > 3 +0 1 0 +create or replace view v1 as select 2 > 1 != 1, 2 > (1 != 1), (2 > 1) != 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 > 1 <> 1 AS `2 > 1 != 1`,2 > (1 <> 1) AS `2 > (1 != 1)`,2 > 1 <> 1 AS `(2 > 1) != 1` +select 2 > 1 != 1, 2 > (1 != 1), (2 > 1) != 1 union select * from v1; +2 > 1 != 1 2 > (1 != 1) (2 > 1) != 1 +0 1 0 +create or replace view v1 as select 2 > 3 LIKE 3, 2 > (3 LIKE 3), (2 > 3) LIKE 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 > 3 like 3 AS `2 > 3 LIKE 3`,2 > 3 like 3 AS `2 > (3 LIKE 3)`,(2 > 3) like 3 AS `(2 > 3) LIKE 3` +select 2 > 3 LIKE 3, 2 > (3 LIKE 3), (2 > 3) LIKE 3 union select * from v1; +2 > 3 LIKE 3 2 > (3 LIKE 3) (2 > 3) LIKE 3 +1 1 0 +create or replace view v1 as select 2 > 3 REGEXP 3, 2 > (3 REGEXP 3), (2 > 3) REGEXP 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 > 3 regexp 3 AS `2 > 3 REGEXP 3`,2 > 3 regexp 3 AS `2 > (3 REGEXP 3)`,(2 > 3) regexp 3 AS `(2 > 3) REGEXP 3` +select 2 > 3 REGEXP 3, 2 > (3 REGEXP 3), (2 > 3) REGEXP 3 union select * from v1; +2 > 3 REGEXP 3 2 > (3 REGEXP 3) (2 > 3) REGEXP 3 +1 1 0 +create or replace view v1 as select 2 > 3 | 3, 2 > (3 | 3), (2 > 3) | 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 > 3 | 3 AS `2 > 3 | 3`,2 > 3 | 3 AS `2 > (3 | 3)`,(2 > 3) | 3 AS `(2 > 3) | 3` +select 2 > 3 | 3, 2 > (3 | 3), (2 > 3) | 3 union select * from v1; +2 > 3 | 3 2 > (3 | 3) (2 > 3) | 3 +0 0 3 +create or replace view v1 as select 4 > 2 & 2, 4 > (2 & 2), (4 > 2) & 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 4 > 2 & 2 AS `4 > 2 & 2`,4 > 2 & 2 AS `4 > (2 & 2)`,(4 > 2) & 2 AS `(4 > 2) & 2` +select 4 > 2 & 2, 4 > (2 & 2), (4 > 2) & 2 union select * from v1; +4 > 2 & 2 4 > (2 & 2) (4 > 2) & 2 +1 1 0 +create or replace view v1 as select 4 > 3 << 3, 4 > (3 << 3), (4 > 3) << 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 4 > 3 << 3 AS `4 > 3 << 3`,4 > 3 << 3 AS `4 > (3 << 3)`,(4 > 3) << 3 AS `(4 > 3) << 3` +select 4 > 3 << 3, 4 > (3 << 3), (4 > 3) << 3 union select * from v1; +4 > 3 << 3 4 > (3 << 3) (4 > 3) << 3 +0 0 8 +create or replace view v1 as select 2 > 3 >> 3, 2 > (3 >> 3), (2 > 3) >> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 > 3 >> 3 AS `2 > 3 >> 3`,2 > 3 >> 3 AS `2 > (3 >> 3)`,(2 > 3) >> 3 AS `(2 > 3) >> 3` +select 2 > 3 >> 3, 2 > (3 >> 3), (2 > 3) >> 3 union select * from v1; +2 > 3 >> 3 2 > (3 >> 3) (2 > 3) >> 3 +1 1 0 +create or replace view v1 as select 2 > '2000-01-01' +INTERVAL 1 DAY, 2 > ('2000-01-01' +INTERVAL 1 DAY), (2 > '2000-01-01') +INTERVAL 1 DAY; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 > '2000-01-01' + interval 1 day AS `2 > '2000-01-01' +INTERVAL 1 DAY`,2 > '2000-01-01' + interval 1 day AS `2 > ('2000-01-01' +INTERVAL 1 DAY)`,(2 > '2000-01-01') + interval 1 day AS `(2 > '2000-01-01') +INTERVAL 1 DAY` +select 2 > '2000-01-01' +INTERVAL 1 DAY, 2 > ('2000-01-01' +INTERVAL 1 DAY), (2 > '2000-01-01') +INTERVAL 1 DAY union select * from v1; +2 > '2000-01-01' +INTERVAL 1 DAY 2 > ('2000-01-01' +INTERVAL 1 DAY) (2 > '2000-01-01') +INTERVAL 1 DAY +0 0 NULL +create or replace view v1 as select 2 > 3 + 3, 2 > (3 + 3), (2 > 3) + 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 > 3 + 3 AS `2 > 3 + 3`,2 > 3 + 3 AS `2 > (3 + 3)`,(2 > 3) + 3 AS `(2 > 3) + 3` +select 2 > 3 + 3, 2 > (3 + 3), (2 > 3) + 3 union select * from v1; +2 > 3 + 3 2 > (3 + 3) (2 > 3) + 3 +0 0 3 +create or replace view v1 as select 2 > 3 - 3, 2 > (3 - 3), (2 > 3) - 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 > 3 - 3 AS `2 > 3 - 3`,2 > 3 - 3 AS `2 > (3 - 3)`,(2 > 3) - 3 AS `(2 > 3) - 3` +select 2 > 3 - 3, 2 > (3 - 3), (2 > 3) - 3 union select * from v1; +2 > 3 - 3 2 > (3 - 3) (2 > 3) - 3 +1 1 -3 +create or replace view v1 as select 4 > 3 * 3, 4 > (3 * 3), (4 > 3) * 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 4 > 3 * 3 AS `4 > 3 * 3`,4 > 3 * 3 AS `4 > (3 * 3)`,(4 > 3) * 3 AS `(4 > 3) * 3` +select 4 > 3 * 3, 4 > (3 * 3), (4 > 3) * 3 union select * from v1; +4 > 3 * 3 4 > (3 * 3) (4 > 3) * 3 +0 0 3 +create or replace view v1 as select 2 > 3 / 3, 2 > (3 / 3), (2 > 3) / 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 > 3 / 3 AS `2 > 3 / 3`,2 > 3 / 3 AS `2 > (3 / 3)`,(2 > 3) / 3 AS `(2 > 3) / 3` +select 2 > 3 / 3, 2 > (3 / 3), (2 > 3) / 3 union select * from v1; +2 > 3 / 3 2 > (3 / 3) (2 > 3) / 3 +1 1 0.0000 +create or replace view v1 as select 2 > 3 DIV 3, 2 > (3 DIV 3), (2 > 3) DIV 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 > 3 DIV 3 AS `2 > 3 DIV 3`,2 > 3 DIV 3 AS `2 > (3 DIV 3)`,(2 > 3) DIV 3 AS `(2 > 3) DIV 3` +select 2 > 3 DIV 3, 2 > (3 DIV 3), (2 > 3) DIV 3 union select * from v1; +2 > 3 DIV 3 2 > (3 DIV 3) (2 > 3) DIV 3 +1 1 0 +create or replace view v1 as select 2 > 3 MOD 3, 2 > (3 MOD 3), (2 > 3) MOD 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 > 3 MOD 3 AS `2 > 3 MOD 3`,2 > 3 MOD 3 AS `2 > (3 MOD 3)`,(2 > 3) MOD 3 AS `(2 > 3) MOD 3` +select 2 > 3 MOD 3, 2 > (3 MOD 3), (2 > 3) MOD 3 union select * from v1; +2 > 3 MOD 3 2 > (3 MOD 3) (2 > 3) MOD 3 +1 1 0 +create or replace view v1 as select 2 > 3 % 3, 2 > (3 % 3), (2 > 3) % 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 > 3 MOD 3 AS `2 > 3 % 3`,2 > 3 MOD 3 AS `2 > (3 % 3)`,(2 > 3) MOD 3 AS `(2 > 3) % 3` +select 2 > 3 % 3, 2 > (3 % 3), (2 > 3) % 3 union select * from v1; +2 > 3 % 3 2 > (3 % 3) (2 > 3) % 3 +1 1 0 +create or replace view v1 as select 2 > 3 ^ 3, 2 > (3 ^ 3), (2 > 3) ^ 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 > 3 ^ 3 AS `2 > 3 ^ 3`,2 > 3 ^ 3 AS `2 > (3 ^ 3)`,(2 > 3) ^ 3 AS `(2 > 3) ^ 3` +select 2 > 3 ^ 3, 2 > (3 ^ 3), (2 > 3) ^ 3 union select * from v1; +2 > 3 ^ 3 2 > (3 ^ 3) (2 > 3) ^ 3 +1 1 3 +create or replace view v1 as select 2 > 3 BETWEEN 1 AND 3, 2 > (3 BETWEEN 1 AND 3), (2 > 3) BETWEEN 1 AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 > 3 between 1 and 3 AS `2 > 3 BETWEEN 1 AND 3`,2 > 3 between 1 and 3 AS `2 > (3 BETWEEN 1 AND 3)`,(2 > 3) between 1 and 3 AS `(2 > 3) BETWEEN 1 AND 3` +select 2 > 3 BETWEEN 1 AND 3, 2 > (3 BETWEEN 1 AND 3), (2 > 3) BETWEEN 1 AND 3 union select * from v1; +2 > 3 BETWEEN 1 AND 3 2 > (3 BETWEEN 1 AND 3) (2 > 3) BETWEEN 1 AND 3 +1 1 0 +create or replace view v1 as select 2 != 3 IS FALSE, 2 != (3 IS FALSE), (2 != 3) IS FALSE; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <> 3 is false AS `2 != 3 IS FALSE`,2 <> (3 is false) AS `2 != (3 IS FALSE)`,2 <> 3 is false AS `(2 != 3) IS FALSE` +select 2 != 3 IS FALSE, 2 != (3 IS FALSE), (2 != 3) IS FALSE union select * from v1; +2 != 3 IS FALSE 2 != (3 IS FALSE) (2 != 3) IS FALSE +0 1 0 +create or replace view v1 as select charset(2 != 3 COLLATE latin1_bin), charset(2 != (3 COLLATE latin1_bin)), charset((2 != 3) COLLATE latin1_bin); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select charset(2 <> 3 collate latin1_bin) AS `charset(2 != 3 COLLATE latin1_bin)`,charset(2 <> 3 collate latin1_bin) AS `charset(2 != (3 COLLATE latin1_bin))`,charset((2 <> 3) collate latin1_bin) AS `charset((2 != 3) COLLATE latin1_bin)` +select charset(2 != 3 COLLATE latin1_bin), charset(2 != (3 COLLATE latin1_bin)), charset((2 != 3) COLLATE latin1_bin) union select * from v1; +charset(2 != 3 COLLATE latin1_bin) charset(2 != (3 COLLATE latin1_bin)) charset((2 != 3) COLLATE latin1_bin) +binary binary latin1 +create or replace view v1 as select 2 != 3 IN (0,0), 2 != (3 IN (0,0)), (2 != 3) IN (0,0); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <> 3 in (0,0) AS `2 != 3 IN (0,0)`,2 <> 3 in (0,0) AS `2 != (3 IN (0,0))`,(2 <> 3) in (0,0) AS `(2 != 3) IN (0,0)` +select 2 != 3 IN (0,0), 2 != (3 IN (0,0)), (2 != 3) IN (0,0) union select * from v1; +2 != 3 IN (0,0) 2 != (3 IN (0,0)) (2 != 3) IN (0,0) +1 1 0 +create or replace view v1 as select 1 != 3 OR 3, 1 != (3 OR 3), (1 != 3) OR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 1 <> 3 or 3 AS `1 != 3 OR 3`,1 <> (3 or 3) AS `1 != (3 OR 3)`,1 <> 3 or 3 AS `(1 != 3) OR 3` +select 1 != 3 OR 3, 1 != (3 OR 3), (1 != 3) OR 3 union select * from v1; +1 != 3 OR 3 1 != (3 OR 3) (1 != 3) OR 3 +1 0 1 +create or replace view v1 as select 1 != 3 || 3, 1 != (3 || 3), (1 != 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 1 <> 3 or 3 AS `1 != 3 || 3`,1 <> (3 or 3) AS `1 != (3 || 3)`,1 <> 3 or 3 AS `(1 != 3) || 3` +select 1 != 3 || 3, 1 != (3 || 3), (1 != 3) || 3 union select * from v1; +1 != 3 || 3 1 != (3 || 3) (1 != 3) || 3 +1 0 1 +create or replace view v1 as select 2 != 3 XOR 3, 2 != (3 XOR 3), (2 != 3) XOR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <> 3 xor 3 AS `2 != 3 XOR 3`,2 <> (3 xor 3) AS `2 != (3 XOR 3)`,2 <> 3 xor 3 AS `(2 != 3) XOR 3` +select 2 != 3 XOR 3, 2 != (3 XOR 3), (2 != 3) XOR 3 union select * from v1; +2 != 3 XOR 3 2 != (3 XOR 3) (2 != 3) XOR 3 +0 1 0 +create or replace view v1 as select 3 != 3 AND 3, 3 != (3 AND 3), (3 != 3) AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 3 <> 3 and 3 AS `3 != 3 AND 3`,3 <> (3 and 3) AS `3 != (3 AND 3)`,3 <> 3 and 3 AS `(3 != 3) AND 3` +select 3 != 3 AND 3, 3 != (3 AND 3), (3 != 3) AND 3 union select * from v1; +3 != 3 AND 3 3 != (3 AND 3) (3 != 3) AND 3 +0 1 0 +create or replace view v1 as select 3 != 3 && 3, 3 != (3 && 3), (3 != 3) && 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 3 <> 3 and 3 AS `3 != 3 && 3`,3 <> (3 and 3) AS `3 != (3 && 3)`,3 <> 3 and 3 AS `(3 != 3) && 3` +select 3 != 3 && 3, 3 != (3 && 3), (3 != 3) && 3 union select * from v1; +3 != 3 && 3 3 != (3 && 3) (3 != 3) && 3 +0 1 0 +create or replace view v1 as select 2 != 3 = 3, 2 != (3 = 3), (2 != 3) = 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <> 3 = 3 AS `2 != 3 = 3`,2 <> (3 = 3) AS `2 != (3 = 3)`,2 <> 3 = 3 AS `(2 != 3) = 3` +select 2 != 3 = 3, 2 != (3 = 3), (2 != 3) = 3 union select * from v1; +2 != 3 = 3 2 != (3 = 3) (2 != 3) = 3 +0 1 0 +create or replace view v1 as select 2 != 3 <=> 3, 2 != (3 <=> 3), (2 != 3) <=> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <> 3 <=> 3 AS `2 != 3 <=> 3`,2 <> (3 <=> 3) AS `2 != (3 <=> 3)`,2 <> 3 <=> 3 AS `(2 != 3) <=> 3` +select 2 != 3 <=> 3, 2 != (3 <=> 3), (2 != 3) <=> 3 union select * from v1; +2 != 3 <=> 3 2 != (3 <=> 3) (2 != 3) <=> 3 +0 1 0 +create or replace view v1 as select 2 != 3 >= 3, 2 != (3 >= 3), (2 != 3) >= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <> 3 >= 3 AS `2 != 3 >= 3`,2 <> (3 >= 3) AS `2 != (3 >= 3)`,2 <> 3 >= 3 AS `(2 != 3) >= 3` +select 2 != 3 >= 3, 2 != (3 >= 3), (2 != 3) >= 3 union select * from v1; +2 != 3 >= 3 2 != (3 >= 3) (2 != 3) >= 3 +0 1 0 +create or replace view v1 as select 1 != 3 <= 3, 1 != (3 <= 3), (1 != 3) <= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 1 <> 3 <= 3 AS `1 != 3 <= 3`,1 <> (3 <= 3) AS `1 != (3 <= 3)`,1 <> 3 <= 3 AS `(1 != 3) <= 3` +select 1 != 3 <= 3, 1 != (3 <= 3), (1 != 3) <= 3 union select * from v1; +1 != 3 <= 3 1 != (3 <= 3) (1 != 3) <= 3 +1 0 1 +create or replace view v1 as select 0 != 3 < 3, 0 != (3 < 3), (0 != 3) < 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 0 <> 3 < 3 AS `0 != 3 < 3`,0 <> (3 < 3) AS `0 != (3 < 3)`,0 <> 3 < 3 AS `(0 != 3) < 3` +select 0 != 3 < 3, 0 != (3 < 3), (0 != 3) < 3 union select * from v1; +0 != 3 < 3 0 != (3 < 3) (0 != 3) < 3 +1 0 1 +create or replace view v1 as select 0 != 3 <> 3, 0 != (3 <> 3), (0 != 3) <> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 0 <> 3 <> 3 AS `0 != 3 <> 3`,0 <> (3 <> 3) AS `0 != (3 <> 3)`,0 <> 3 <> 3 AS `(0 != 3) <> 3` +select 0 != 3 <> 3, 0 != (3 <> 3), (0 != 3) <> 3 union select * from v1; +0 != 3 <> 3 0 != (3 <> 3) (0 != 3) <> 3 +1 0 1 +create or replace view v1 as select 2 != 3 > 3, 2 != (3 > 3), (2 != 3) > 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <> 3 > 3 AS `2 != 3 > 3`,2 <> (3 > 3) AS `2 != (3 > 3)`,2 <> 3 > 3 AS `(2 != 3) > 3` +select 2 != 3 > 3, 2 != (3 > 3), (2 != 3) > 3 union select * from v1; +2 != 3 > 3 2 != (3 > 3) (2 != 3) > 3 +0 1 0 +create or replace view v1 as select 0 != 3 != 3, 0 != (3 != 3), (0 != 3) != 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 0 <> 3 <> 3 AS `0 != 3 != 3`,0 <> (3 <> 3) AS `0 != (3 != 3)`,0 <> 3 <> 3 AS `(0 != 3) != 3` +select 0 != 3 != 3, 0 != (3 != 3), (0 != 3) != 3 union select * from v1; +0 != 3 != 3 0 != (3 != 3) (0 != 3) != 3 +1 0 1 +create or replace view v1 as select 2 != 3 LIKE 3, 2 != (3 LIKE 3), (2 != 3) LIKE 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <> 3 like 3 AS `2 != 3 LIKE 3`,2 <> 3 like 3 AS `2 != (3 LIKE 3)`,(2 <> 3) like 3 AS `(2 != 3) LIKE 3` +select 2 != 3 LIKE 3, 2 != (3 LIKE 3), (2 != 3) LIKE 3 union select * from v1; +2 != 3 LIKE 3 2 != (3 LIKE 3) (2 != 3) LIKE 3 +1 1 0 +create or replace view v1 as select 2 != 3 REGEXP 3, 2 != (3 REGEXP 3), (2 != 3) REGEXP 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <> 3 regexp 3 AS `2 != 3 REGEXP 3`,2 <> 3 regexp 3 AS `2 != (3 REGEXP 3)`,(2 <> 3) regexp 3 AS `(2 != 3) REGEXP 3` +select 2 != 3 REGEXP 3, 2 != (3 REGEXP 3), (2 != 3) REGEXP 3 union select * from v1; +2 != 3 REGEXP 3 2 != (3 REGEXP 3) (2 != 3) REGEXP 3 +1 1 0 +create or replace view v1 as select 2 != 3 | 3, 2 != (3 | 3), (2 != 3) | 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <> 3 | 3 AS `2 != 3 | 3`,2 <> 3 | 3 AS `2 != (3 | 3)`,(2 <> 3) | 3 AS `(2 != 3) | 3` +select 2 != 3 | 3, 2 != (3 | 3), (2 != 3) | 3 union select * from v1; +2 != 3 | 3 2 != (3 | 3) (2 != 3) | 3 +1 1 3 +create or replace view v1 as select 2 != 4 & 4, 2 != (4 & 4), (2 != 4) & 4; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <> 4 & 4 AS `2 != 4 & 4`,2 <> 4 & 4 AS `2 != (4 & 4)`,(2 <> 4) & 4 AS `(2 != 4) & 4` +select 2 != 4 & 4, 2 != (4 & 4), (2 != 4) & 4 union select * from v1; +2 != 4 & 4 2 != (4 & 4) (2 != 4) & 4 +1 1 0 +create or replace view v1 as select 2 != 3 << 3, 2 != (3 << 3), (2 != 3) << 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <> 3 << 3 AS `2 != 3 << 3`,2 <> 3 << 3 AS `2 != (3 << 3)`,(2 <> 3) << 3 AS `(2 != 3) << 3` +select 2 != 3 << 3, 2 != (3 << 3), (2 != 3) << 3 union select * from v1; +2 != 3 << 3 2 != (3 << 3) (2 != 3) << 3 +1 1 8 +create or replace view v1 as select 2 != 3 >> 3, 2 != (3 >> 3), (2 != 3) >> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <> 3 >> 3 AS `2 != 3 >> 3`,2 <> 3 >> 3 AS `2 != (3 >> 3)`,(2 <> 3) >> 3 AS `(2 != 3) >> 3` +select 2 != 3 >> 3, 2 != (3 >> 3), (2 != 3) >> 3 union select * from v1; +2 != 3 >> 3 2 != (3 >> 3) (2 != 3) >> 3 +1 1 0 +create or replace view v1 as select 2 != '2000-01-01' +INTERVAL 1 DAY, 2 != ('2000-01-01' +INTERVAL 1 DAY), (2 != '2000-01-01') +INTERVAL 1 DAY; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <> '2000-01-01' + interval 1 day AS `2 != '2000-01-01' +INTERVAL 1 DAY`,2 <> '2000-01-01' + interval 1 day AS `2 != ('2000-01-01' +INTERVAL 1 DAY)`,(2 <> '2000-01-01') + interval 1 day AS `(2 != '2000-01-01') +INTERVAL 1 DAY` +select 2 != '2000-01-01' +INTERVAL 1 DAY, 2 != ('2000-01-01' +INTERVAL 1 DAY), (2 != '2000-01-01') +INTERVAL 1 DAY union select * from v1; +2 != '2000-01-01' +INTERVAL 1 DAY 2 != ('2000-01-01' +INTERVAL 1 DAY) (2 != '2000-01-01') +INTERVAL 1 DAY +1 1 NULL +create or replace view v1 as select 2 != 3 + 3, 2 != (3 + 3), (2 != 3) + 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <> 3 + 3 AS `2 != 3 + 3`,2 <> 3 + 3 AS `2 != (3 + 3)`,(2 <> 3) + 3 AS `(2 != 3) + 3` +select 2 != 3 + 3, 2 != (3 + 3), (2 != 3) + 3 union select * from v1; +2 != 3 + 3 2 != (3 + 3) (2 != 3) + 3 +1 1 4 +create or replace view v1 as select 2 != 3 - 3, 2 != (3 - 3), (2 != 3) - 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <> 3 - 3 AS `2 != 3 - 3`,2 <> 3 - 3 AS `2 != (3 - 3)`,(2 <> 3) - 3 AS `(2 != 3) - 3` +select 2 != 3 - 3, 2 != (3 - 3), (2 != 3) - 3 union select * from v1; +2 != 3 - 3 2 != (3 - 3) (2 != 3) - 3 +1 1 -2 +create or replace view v1 as select 2 != 3 * 3, 2 != (3 * 3), (2 != 3) * 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <> 3 * 3 AS `2 != 3 * 3`,2 <> 3 * 3 AS `2 != (3 * 3)`,(2 <> 3) * 3 AS `(2 != 3) * 3` +select 2 != 3 * 3, 2 != (3 * 3), (2 != 3) * 3 union select * from v1; +2 != 3 * 3 2 != (3 * 3) (2 != 3) * 3 +1 1 3 +create or replace view v1 as select 2 != 3 / 3, 2 != (3 / 3), (2 != 3) / 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <> 3 / 3 AS `2 != 3 / 3`,2 <> 3 / 3 AS `2 != (3 / 3)`,(2 <> 3) / 3 AS `(2 != 3) / 3` +select 2 != 3 / 3, 2 != (3 / 3), (2 != 3) / 3 union select * from v1; +2 != 3 / 3 2 != (3 / 3) (2 != 3) / 3 +1 1 0.3333 +create or replace view v1 as select 2 != 3 DIV 3, 2 != (3 DIV 3), (2 != 3) DIV 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <> 3 DIV 3 AS `2 != 3 DIV 3`,2 <> 3 DIV 3 AS `2 != (3 DIV 3)`,(2 <> 3) DIV 3 AS `(2 != 3) DIV 3` +select 2 != 3 DIV 3, 2 != (3 DIV 3), (2 != 3) DIV 3 union select * from v1; +2 != 3 DIV 3 2 != (3 DIV 3) (2 != 3) DIV 3 +1 1 0 +create or replace view v1 as select 3 != 3 MOD 3, 3 != (3 MOD 3), (3 != 3) MOD 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 3 <> 3 MOD 3 AS `3 != 3 MOD 3`,3 <> 3 MOD 3 AS `3 != (3 MOD 3)`,(3 <> 3) MOD 3 AS `(3 != 3) MOD 3` +select 3 != 3 MOD 3, 3 != (3 MOD 3), (3 != 3) MOD 3 union select * from v1; +3 != 3 MOD 3 3 != (3 MOD 3) (3 != 3) MOD 3 +1 1 0 +create or replace view v1 as select 3 != 3 % 3, 3 != (3 % 3), (3 != 3) % 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 3 <> 3 MOD 3 AS `3 != 3 % 3`,3 <> 3 MOD 3 AS `3 != (3 % 3)`,(3 <> 3) MOD 3 AS `(3 != 3) % 3` +select 3 != 3 % 3, 3 != (3 % 3), (3 != 3) % 3 union select * from v1; +3 != 3 % 3 3 != (3 % 3) (3 != 3) % 3 +1 1 0 +create or replace view v1 as select 2 != 3 ^ 3, 2 != (3 ^ 3), (2 != 3) ^ 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <> 3 ^ 3 AS `2 != 3 ^ 3`,2 <> 3 ^ 3 AS `2 != (3 ^ 3)`,(2 <> 3) ^ 3 AS `(2 != 3) ^ 3` +select 2 != 3 ^ 3, 2 != (3 ^ 3), (2 != 3) ^ 3 union select * from v1; +2 != 3 ^ 3 2 != (3 ^ 3) (2 != 3) ^ 3 +1 1 2 +create or replace view v1 as select 2 != 3 BETWEEN 2 AND 3, 2 != (3 BETWEEN 2 AND 3), (2 != 3) BETWEEN 2 AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <> 3 between 2 and 3 AS `2 != 3 BETWEEN 2 AND 3`,2 <> 3 between 2 and 3 AS `2 != (3 BETWEEN 2 AND 3)`,(2 <> 3) between 2 and 3 AS `(2 != 3) BETWEEN 2 AND 3` +select 2 != 3 BETWEEN 2 AND 3, 2 != (3 BETWEEN 2 AND 3), (2 != 3) BETWEEN 2 AND 3 union select * from v1; +2 != 3 BETWEEN 2 AND 3 2 != (3 BETWEEN 2 AND 3) (2 != 3) BETWEEN 2 AND 3 +1 1 0 +create or replace view v1 as select 2 LIKE 3 IS FALSE, 2 LIKE (3 IS FALSE), (2 LIKE 3) IS FALSE; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 like 3 is false AS `2 LIKE 3 IS FALSE`,2 like (3 is false) AS `2 LIKE (3 IS FALSE)`,2 like 3 is false AS `(2 LIKE 3) IS FALSE` +select 2 LIKE 3 IS FALSE, 2 LIKE (3 IS FALSE), (2 LIKE 3) IS FALSE union select * from v1; +2 LIKE 3 IS FALSE 2 LIKE (3 IS FALSE) (2 LIKE 3) IS FALSE +1 0 1 +create or replace view v1 as select charset(2 LIKE 3 COLLATE latin1_bin), charset(2 LIKE (3 COLLATE latin1_bin)), charset((2 LIKE 3) COLLATE latin1_bin); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select charset(2 like 3 collate latin1_bin) AS `charset(2 LIKE 3 COLLATE latin1_bin)`,charset(2 like 3 collate latin1_bin) AS `charset(2 LIKE (3 COLLATE latin1_bin))`,charset((2 like 3) collate latin1_bin) AS `charset((2 LIKE 3) COLLATE latin1_bin)` +select charset(2 LIKE 3 COLLATE latin1_bin), charset(2 LIKE (3 COLLATE latin1_bin)), charset((2 LIKE 3) COLLATE latin1_bin) union select * from v1; +charset(2 LIKE 3 COLLATE latin1_bin) charset(2 LIKE (3 COLLATE latin1_bin)) charset((2 LIKE 3) COLLATE latin1_bin) +binary binary latin1 +create or replace view v1 as select 2 LIKE 3 IN (0,1), 2 LIKE (3 IN (0,1)), (2 LIKE 3) IN (0,1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 like 3 in (0,1) AS `2 LIKE 3 IN (0,1)`,2 like (3 in (0,1)) AS `2 LIKE (3 IN (0,1))`,2 like 3 in (0,1) AS `(2 LIKE 3) IN (0,1)` +select 2 LIKE 3 IN (0,1), 2 LIKE (3 IN (0,1)), (2 LIKE 3) IN (0,1) union select * from v1; +2 LIKE 3 IN (0,1) 2 LIKE (3 IN (0,1)) (2 LIKE 3) IN (0,1) +1 0 1 +create or replace view v1 as select 2 LIKE 3 OR 3, 2 LIKE (3 OR 3), (2 LIKE 3) OR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 like 3 or 3 AS `2 LIKE 3 OR 3`,2 like (3 or 3) AS `2 LIKE (3 OR 3)`,2 like 3 or 3 AS `(2 LIKE 3) OR 3` +select 2 LIKE 3 OR 3, 2 LIKE (3 OR 3), (2 LIKE 3) OR 3 union select * from v1; +2 LIKE 3 OR 3 2 LIKE (3 OR 3) (2 LIKE 3) OR 3 +1 0 1 +create or replace view v1 as select 2 LIKE 3 || 3, 2 LIKE (3 || 3), (2 LIKE 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 like 3 or 3 AS `2 LIKE 3 || 3`,2 like (3 or 3) AS `2 LIKE (3 || 3)`,2 like 3 or 3 AS `(2 LIKE 3) || 3` +select 2 LIKE 3 || 3, 2 LIKE (3 || 3), (2 LIKE 3) || 3 union select * from v1; +2 LIKE 3 || 3 2 LIKE (3 || 3) (2 LIKE 3) || 3 +1 0 1 +create or replace view v1 as select 2 LIKE 3 XOR 3, 2 LIKE (3 XOR 3), (2 LIKE 3) XOR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 like 3 xor 3 AS `2 LIKE 3 XOR 3`,2 like (3 xor 3) AS `2 LIKE (3 XOR 3)`,2 like 3 xor 3 AS `(2 LIKE 3) XOR 3` +select 2 LIKE 3 XOR 3, 2 LIKE (3 XOR 3), (2 LIKE 3) XOR 3 union select * from v1; +2 LIKE 3 XOR 3 2 LIKE (3 XOR 3) (2 LIKE 3) XOR 3 +1 0 1 +create or replace view v1 as select 2 LIKE 2 AND 2, 2 LIKE (2 AND 2), (2 LIKE 2) AND 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 like 2 and 2 AS `2 LIKE 2 AND 2`,2 like (2 and 2) AS `2 LIKE (2 AND 2)`,2 like 2 and 2 AS `(2 LIKE 2) AND 2` +select 2 LIKE 2 AND 2, 2 LIKE (2 AND 2), (2 LIKE 2) AND 2 union select * from v1; +2 LIKE 2 AND 2 2 LIKE (2 AND 2) (2 LIKE 2) AND 2 +1 0 1 +create or replace view v1 as select 2 LIKE 2 && 2, 2 LIKE (2 && 2), (2 LIKE 2) && 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 like 2 and 2 AS `2 LIKE 2 && 2`,2 like (2 and 2) AS `2 LIKE (2 && 2)`,2 like 2 and 2 AS `(2 LIKE 2) && 2` +select 2 LIKE 2 && 2, 2 LIKE (2 && 2), (2 LIKE 2) && 2 union select * from v1; +2 LIKE 2 && 2 2 LIKE (2 && 2) (2 LIKE 2) && 2 +1 0 1 +create or replace view v1 as select 2 LIKE 2 = 1, 2 LIKE (2 = 1), (2 LIKE 2) = 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 like 2 = 1 AS `2 LIKE 2 = 1`,2 like (2 = 1) AS `2 LIKE (2 = 1)`,2 like 2 = 1 AS `(2 LIKE 2) = 1` +select 2 LIKE 2 = 1, 2 LIKE (2 = 1), (2 LIKE 2) = 1 union select * from v1; +2 LIKE 2 = 1 2 LIKE (2 = 1) (2 LIKE 2) = 1 +1 0 1 +create or replace view v1 as select 2 LIKE 2 <=> 1, 2 LIKE (2 <=> 1), (2 LIKE 2) <=> 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 like 2 <=> 1 AS `2 LIKE 2 <=> 1`,2 like (2 <=> 1) AS `2 LIKE (2 <=> 1)`,2 like 2 <=> 1 AS `(2 LIKE 2) <=> 1` +select 2 LIKE 2 <=> 1, 2 LIKE (2 <=> 1), (2 LIKE 2) <=> 1 union select * from v1; +2 LIKE 2 <=> 1 2 LIKE (2 <=> 1) (2 LIKE 2) <=> 1 +1 0 1 +create or replace view v1 as select 2 LIKE 2 >= 1, 2 LIKE (2 >= 1), (2 LIKE 2) >= 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 like 2 >= 1 AS `2 LIKE 2 >= 1`,2 like (2 >= 1) AS `2 LIKE (2 >= 1)`,2 like 2 >= 1 AS `(2 LIKE 2) >= 1` +select 2 LIKE 2 >= 1, 2 LIKE (2 >= 1), (2 LIKE 2) >= 1 union select * from v1; +2 LIKE 2 >= 1 2 LIKE (2 >= 1) (2 LIKE 2) >= 1 +1 0 1 +create or replace view v1 as select 2 LIKE 3 <= 3, 2 LIKE (3 <= 3), (2 LIKE 3) <= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 like 3 <= 3 AS `2 LIKE 3 <= 3`,2 like (3 <= 3) AS `2 LIKE (3 <= 3)`,2 like 3 <= 3 AS `(2 LIKE 3) <= 3` +select 2 LIKE 3 <= 3, 2 LIKE (3 <= 3), (2 LIKE 3) <= 3 union select * from v1; +2 LIKE 3 <= 3 2 LIKE (3 <= 3) (2 LIKE 3) <= 3 +1 0 1 +create or replace view v1 as select 2 LIKE 3 < 3, 2 LIKE (3 < 3), (2 LIKE 3) < 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 like 3 < 3 AS `2 LIKE 3 < 3`,2 like (3 < 3) AS `2 LIKE (3 < 3)`,2 like 3 < 3 AS `(2 LIKE 3) < 3` +select 2 LIKE 3 < 3, 2 LIKE (3 < 3), (2 LIKE 3) < 3 union select * from v1; +2 LIKE 3 < 3 2 LIKE (3 < 3) (2 LIKE 3) < 3 +1 0 1 +create or replace view v1 as select 2 LIKE 3 <> 3, 2 LIKE (3 <> 3), (2 LIKE 3) <> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 like 3 <> 3 AS `2 LIKE 3 <> 3`,2 like (3 <> 3) AS `2 LIKE (3 <> 3)`,2 like 3 <> 3 AS `(2 LIKE 3) <> 3` +select 2 LIKE 3 <> 3, 2 LIKE (3 <> 3), (2 LIKE 3) <> 3 union select * from v1; +2 LIKE 3 <> 3 2 LIKE (3 <> 3) (2 LIKE 3) <> 3 +1 0 1 +create or replace view v1 as select 2 LIKE 2 > 0, 2 LIKE (2 > 0), (2 LIKE 2) > 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 like 2 > 0 AS `2 LIKE 2 > 0`,2 like (2 > 0) AS `2 LIKE (2 > 0)`,2 like 2 > 0 AS `(2 LIKE 2) > 0` +select 2 LIKE 2 > 0, 2 LIKE (2 > 0), (2 LIKE 2) > 0 union select * from v1; +2 LIKE 2 > 0 2 LIKE (2 > 0) (2 LIKE 2) > 0 +1 0 1 +create or replace view v1 as select 2 LIKE 3 != 3, 2 LIKE (3 != 3), (2 LIKE 3) != 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 like 3 <> 3 AS `2 LIKE 3 != 3`,2 like (3 <> 3) AS `2 LIKE (3 != 3)`,2 like 3 <> 3 AS `(2 LIKE 3) != 3` +select 2 LIKE 3 != 3, 2 LIKE (3 != 3), (2 LIKE 3) != 3 union select * from v1; +2 LIKE 3 != 3 2 LIKE (3 != 3) (2 LIKE 3) != 3 +1 0 1 +create or replace view v1 as select 2 LIKE 2 LIKE 1, 2 LIKE (2 LIKE 1), (2 LIKE 2) LIKE 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 like 2 like 1 AS `2 LIKE 2 LIKE 1`,2 like (2 like 1) AS `2 LIKE (2 LIKE 1)`,2 like 2 like 1 AS `(2 LIKE 2) LIKE 1` +select 2 LIKE 2 LIKE 1, 2 LIKE (2 LIKE 1), (2 LIKE 2) LIKE 1 union select * from v1; +2 LIKE 2 LIKE 1 2 LIKE (2 LIKE 1) (2 LIKE 2) LIKE 1 +1 0 1 +create or replace view v1 as select 2 LIKE 2 REGEXP 1, 2 LIKE (2 REGEXP 1), (2 LIKE 2) REGEXP 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 like 2 regexp 1 AS `2 LIKE 2 REGEXP 1`,2 like (2 regexp 1) AS `2 LIKE (2 REGEXP 1)`,2 like 2 regexp 1 AS `(2 LIKE 2) REGEXP 1` +select 2 LIKE 2 REGEXP 1, 2 LIKE (2 REGEXP 1), (2 LIKE 2) REGEXP 1 union select * from v1; +2 LIKE 2 REGEXP 1 2 LIKE (2 REGEXP 1) (2 LIKE 2) REGEXP 1 +1 0 1 +create or replace view v1 as select 2 LIKE 3 | 3, 2 LIKE (3 | 3), (2 LIKE 3) | 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 like 3 | 3 AS `2 LIKE 3 | 3`,2 like 3 | 3 AS `2 LIKE (3 | 3)`,(2 like 3) | 3 AS `(2 LIKE 3) | 3` +select 2 LIKE 3 | 3, 2 LIKE (3 | 3), (2 LIKE 3) | 3 union select * from v1; +2 LIKE 3 | 3 2 LIKE (3 | 3) (2 LIKE 3) | 3 +0 0 3 +create or replace view v1 as select 2 LIKE 2 & 2, 2 LIKE (2 & 2), (2 LIKE 2) & 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 like 2 & 2 AS `2 LIKE 2 & 2`,2 like 2 & 2 AS `2 LIKE (2 & 2)`,(2 like 2) & 2 AS `(2 LIKE 2) & 2` +select 2 LIKE 2 & 2, 2 LIKE (2 & 2), (2 LIKE 2) & 2 union select * from v1; +2 LIKE 2 & 2 2 LIKE (2 & 2) (2 LIKE 2) & 2 +1 1 0 +create or replace view v1 as select 2 LIKE 2 << 2, 2 LIKE (2 << 2), (2 LIKE 2) << 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 like 2 << 2 AS `2 LIKE 2 << 2`,2 like 2 << 2 AS `2 LIKE (2 << 2)`,(2 like 2) << 2 AS `(2 LIKE 2) << 2` +select 2 LIKE 2 << 2, 2 LIKE (2 << 2), (2 LIKE 2) << 2 union select * from v1; +2 LIKE 2 << 2 2 LIKE (2 << 2) (2 LIKE 2) << 2 +0 0 4 +create or replace view v1 as select 2 LIKE 4 >> 1, 2 LIKE (4 >> 1), (2 LIKE 4) >> 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 like 4 >> 1 AS `2 LIKE 4 >> 1`,2 like 4 >> 1 AS `2 LIKE (4 >> 1)`,(2 like 4) >> 1 AS `(2 LIKE 4) >> 1` +select 2 LIKE 4 >> 1, 2 LIKE (4 >> 1), (2 LIKE 4) >> 1 union select * from v1; +2 LIKE 4 >> 1 2 LIKE (4 >> 1) (2 LIKE 4) >> 1 +1 1 0 +create or replace view v1 as select 2 LIKE '2000-01-01' +INTERVAL 1 DAY, 2 LIKE ('2000-01-01' +INTERVAL 1 DAY), (2 LIKE '2000-01-01') +INTERVAL 1 DAY; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 like '2000-01-01' + interval 1 day AS `2 LIKE '2000-01-01' +INTERVAL 1 DAY`,2 like '2000-01-01' + interval 1 day AS `2 LIKE ('2000-01-01' +INTERVAL 1 DAY)`,(2 like '2000-01-01') + interval 1 day AS `(2 LIKE '2000-01-01') +INTERVAL 1 DAY` +select 2 LIKE '2000-01-01' +INTERVAL 1 DAY, 2 LIKE ('2000-01-01' +INTERVAL 1 DAY), (2 LIKE '2000-01-01') +INTERVAL 1 DAY union select * from v1; +2 LIKE '2000-01-01' +INTERVAL 1 DAY 2 LIKE ('2000-01-01' +INTERVAL 1 DAY) (2 LIKE '2000-01-01') +INTERVAL 1 DAY +0 0 NULL +create or replace view v1 as select 2 LIKE 3 + 3, 2 LIKE (3 + 3), (2 LIKE 3) + 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 like 3 + 3 AS `2 LIKE 3 + 3`,2 like 3 + 3 AS `2 LIKE (3 + 3)`,(2 like 3) + 3 AS `(2 LIKE 3) + 3` +select 2 LIKE 3 + 3, 2 LIKE (3 + 3), (2 LIKE 3) + 3 union select * from v1; +2 LIKE 3 + 3 2 LIKE (3 + 3) (2 LIKE 3) + 3 +0 0 3 +create or replace view v1 as select 2 LIKE 3 - 3, 2 LIKE (3 - 3), (2 LIKE 3) - 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 like 3 - 3 AS `2 LIKE 3 - 3`,2 like 3 - 3 AS `2 LIKE (3 - 3)`,(2 like 3) - 3 AS `(2 LIKE 3) - 3` +select 2 LIKE 3 - 3, 2 LIKE (3 - 3), (2 LIKE 3) - 3 union select * from v1; +2 LIKE 3 - 3 2 LIKE (3 - 3) (2 LIKE 3) - 3 +0 0 -3 +create or replace view v1 as select 2 LIKE 2 * 2, 2 LIKE (2 * 2), (2 LIKE 2) * 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 like 2 * 2 AS `2 LIKE 2 * 2`,2 like 2 * 2 AS `2 LIKE (2 * 2)`,(2 like 2) * 2 AS `(2 LIKE 2) * 2` +select 2 LIKE 2 * 2, 2 LIKE (2 * 2), (2 LIKE 2) * 2 union select * from v1; +2 LIKE 2 * 2 2 LIKE (2 * 2) (2 LIKE 2) * 2 +0 0 2 +create or replace view v1 as select 2 LIKE 2 / 2, 2 LIKE (2 / 2), (2 LIKE 2) / 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 like 2 / 2 AS `2 LIKE 2 / 2`,2 like 2 / 2 AS `2 LIKE (2 / 2)`,(2 like 2) / 2 AS `(2 LIKE 2) / 2` +select 2 LIKE 2 / 2, 2 LIKE (2 / 2), (2 LIKE 2) / 2 union select * from v1; +2 LIKE 2 / 2 2 LIKE (2 / 2) (2 LIKE 2) / 2 +0 0 0.5000 +create or replace view v1 as select 2 LIKE 4 DIV 2, 2 LIKE (4 DIV 2), (2 LIKE 4) DIV 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 like 4 DIV 2 AS `2 LIKE 4 DIV 2`,2 like 4 DIV 2 AS `2 LIKE (4 DIV 2)`,(2 like 4) DIV 2 AS `(2 LIKE 4) DIV 2` +select 2 LIKE 4 DIV 2, 2 LIKE (4 DIV 2), (2 LIKE 4) DIV 2 union select * from v1; +2 LIKE 4 DIV 2 2 LIKE (4 DIV 2) (2 LIKE 4) DIV 2 +1 1 0 +create or replace view v1 as select 2 LIKE 2 MOD 2, 2 LIKE (2 MOD 2), (2 LIKE 2) MOD 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 like 2 MOD 2 AS `2 LIKE 2 MOD 2`,2 like 2 MOD 2 AS `2 LIKE (2 MOD 2)`,(2 like 2) MOD 2 AS `(2 LIKE 2) MOD 2` +select 2 LIKE 2 MOD 2, 2 LIKE (2 MOD 2), (2 LIKE 2) MOD 2 union select * from v1; +2 LIKE 2 MOD 2 2 LIKE (2 MOD 2) (2 LIKE 2) MOD 2 +0 0 1 +create or replace view v1 as select 2 LIKE 2 % 2, 2 LIKE (2 % 2), (2 LIKE 2) % 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 like 2 MOD 2 AS `2 LIKE 2 % 2`,2 like 2 MOD 2 AS `2 LIKE (2 % 2)`,(2 like 2) MOD 2 AS `(2 LIKE 2) % 2` +select 2 LIKE 2 % 2, 2 LIKE (2 % 2), (2 LIKE 2) % 2 union select * from v1; +2 LIKE 2 % 2 2 LIKE (2 % 2) (2 LIKE 2) % 2 +0 0 1 +create or replace view v1 as select 2 LIKE 3 ^ 3, 2 LIKE (3 ^ 3), (2 LIKE 3) ^ 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 like 3 ^ 3 AS `2 LIKE 3 ^ 3`,2 like 3 ^ 3 AS `2 LIKE (3 ^ 3)`,(2 like 3) ^ 3 AS `(2 LIKE 3) ^ 3` +select 2 LIKE 3 ^ 3, 2 LIKE (3 ^ 3), (2 LIKE 3) ^ 3 union select * from v1; +2 LIKE 3 ^ 3 2 LIKE (3 ^ 3) (2 LIKE 3) ^ 3 +0 0 3 +create or replace view v1 as select 2 LIKE 2 BETWEEN 1 AND 3, 2 LIKE (2 BETWEEN 1 AND 3), (2 LIKE 2) BETWEEN 1 AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 like 2 between 1 and 3 AS `2 LIKE 2 BETWEEN 1 AND 3`,2 like (2 between 1 and 3) AS `2 LIKE (2 BETWEEN 1 AND 3)`,2 like 2 between 1 and 3 AS `(2 LIKE 2) BETWEEN 1 AND 3` +select 2 LIKE 2 BETWEEN 1 AND 3, 2 LIKE (2 BETWEEN 1 AND 3), (2 LIKE 2) BETWEEN 1 AND 3 union select * from v1; +2 LIKE 2 BETWEEN 1 AND 3 2 LIKE (2 BETWEEN 1 AND 3) (2 LIKE 2) BETWEEN 1 AND 3 +1 0 1 +create or replace view v1 as select 2 REGEXP 3 IS FALSE, 2 REGEXP (3 IS FALSE), (2 REGEXP 3) IS FALSE; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 regexp 3 is false AS `2 REGEXP 3 IS FALSE`,2 regexp (3 is false) AS `2 REGEXP (3 IS FALSE)`,2 regexp 3 is false AS `(2 REGEXP 3) IS FALSE` +select 2 REGEXP 3 IS FALSE, 2 REGEXP (3 IS FALSE), (2 REGEXP 3) IS FALSE union select * from v1; +2 REGEXP 3 IS FALSE 2 REGEXP (3 IS FALSE) (2 REGEXP 3) IS FALSE +1 0 1 +create or replace view v1 as select charset(2 REGEXP 3 COLLATE latin1_bin), charset(2 REGEXP (3 COLLATE latin1_bin)), charset((2 REGEXP 3) COLLATE latin1_bin); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select charset(2 regexp 3 collate latin1_bin) AS `charset(2 REGEXP 3 COLLATE latin1_bin)`,charset(2 regexp 3 collate latin1_bin) AS `charset(2 REGEXP (3 COLLATE latin1_bin))`,charset((2 regexp 3) collate latin1_bin) AS `charset((2 REGEXP 3) COLLATE latin1_bin)` +select charset(2 REGEXP 3 COLLATE latin1_bin), charset(2 REGEXP (3 COLLATE latin1_bin)), charset((2 REGEXP 3) COLLATE latin1_bin) union select * from v1; +charset(2 REGEXP 3 COLLATE latin1_bin) charset(2 REGEXP (3 COLLATE latin1_bin)) charset((2 REGEXP 3) COLLATE latin1_bin) +binary binary latin1 +create or replace view v1 as select 2 REGEXP 3 IN (0,1), 2 REGEXP (3 IN (0,1)), (2 REGEXP 3) IN (0,1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 regexp 3 in (0,1) AS `2 REGEXP 3 IN (0,1)`,2 regexp (3 in (0,1)) AS `2 REGEXP (3 IN (0,1))`,2 regexp 3 in (0,1) AS `(2 REGEXP 3) IN (0,1)` +select 2 REGEXP 3 IN (0,1), 2 REGEXP (3 IN (0,1)), (2 REGEXP 3) IN (0,1) union select * from v1; +2 REGEXP 3 IN (0,1) 2 REGEXP (3 IN (0,1)) (2 REGEXP 3) IN (0,1) +1 0 1 +create or replace view v1 as select 2 REGEXP 3 OR 3, 2 REGEXP (3 OR 3), (2 REGEXP 3) OR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 regexp 3 or 3 AS `2 REGEXP 3 OR 3`,2 regexp (3 or 3) AS `2 REGEXP (3 OR 3)`,2 regexp 3 or 3 AS `(2 REGEXP 3) OR 3` +select 2 REGEXP 3 OR 3, 2 REGEXP (3 OR 3), (2 REGEXP 3) OR 3 union select * from v1; +2 REGEXP 3 OR 3 2 REGEXP (3 OR 3) (2 REGEXP 3) OR 3 +1 0 1 +create or replace view v1 as select 2 REGEXP 3 || 3, 2 REGEXP (3 || 3), (2 REGEXP 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 regexp 3 or 3 AS `2 REGEXP 3 || 3`,2 regexp (3 or 3) AS `2 REGEXP (3 || 3)`,2 regexp 3 or 3 AS `(2 REGEXP 3) || 3` +select 2 REGEXP 3 || 3, 2 REGEXP (3 || 3), (2 REGEXP 3) || 3 union select * from v1; +2 REGEXP 3 || 3 2 REGEXP (3 || 3) (2 REGEXP 3) || 3 +1 0 1 +create or replace view v1 as select 2 REGEXP 3 XOR 3, 2 REGEXP (3 XOR 3), (2 REGEXP 3) XOR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 regexp 3 xor 3 AS `2 REGEXP 3 XOR 3`,2 regexp (3 xor 3) AS `2 REGEXP (3 XOR 3)`,2 regexp 3 xor 3 AS `(2 REGEXP 3) XOR 3` +select 2 REGEXP 3 XOR 3, 2 REGEXP (3 XOR 3), (2 REGEXP 3) XOR 3 union select * from v1; +2 REGEXP 3 XOR 3 2 REGEXP (3 XOR 3) (2 REGEXP 3) XOR 3 +1 0 1 +create or replace view v1 as select 2 REGEXP 2 AND 2, 2 REGEXP (2 AND 2), (2 REGEXP 2) AND 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 regexp 2 and 2 AS `2 REGEXP 2 AND 2`,2 regexp (2 and 2) AS `2 REGEXP (2 AND 2)`,2 regexp 2 and 2 AS `(2 REGEXP 2) AND 2` +select 2 REGEXP 2 AND 2, 2 REGEXP (2 AND 2), (2 REGEXP 2) AND 2 union select * from v1; +2 REGEXP 2 AND 2 2 REGEXP (2 AND 2) (2 REGEXP 2) AND 2 +1 0 1 +create or replace view v1 as select 2 REGEXP 2 && 2, 2 REGEXP (2 && 2), (2 REGEXP 2) && 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 regexp 2 and 2 AS `2 REGEXP 2 && 2`,2 regexp (2 and 2) AS `2 REGEXP (2 && 2)`,2 regexp 2 and 2 AS `(2 REGEXP 2) && 2` +select 2 REGEXP 2 && 2, 2 REGEXP (2 && 2), (2 REGEXP 2) && 2 union select * from v1; +2 REGEXP 2 && 2 2 REGEXP (2 && 2) (2 REGEXP 2) && 2 +1 0 1 +create or replace view v1 as select 2 REGEXP 2 = 1, 2 REGEXP (2 = 1), (2 REGEXP 2) = 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 regexp 2 = 1 AS `2 REGEXP 2 = 1`,2 regexp (2 = 1) AS `2 REGEXP (2 = 1)`,2 regexp 2 = 1 AS `(2 REGEXP 2) = 1` +select 2 REGEXP 2 = 1, 2 REGEXP (2 = 1), (2 REGEXP 2) = 1 union select * from v1; +2 REGEXP 2 = 1 2 REGEXP (2 = 1) (2 REGEXP 2) = 1 +1 0 1 +create or replace view v1 as select 2 REGEXP 2 <=> 1, 2 REGEXP (2 <=> 1), (2 REGEXP 2) <=> 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 regexp 2 <=> 1 AS `2 REGEXP 2 <=> 1`,2 regexp (2 <=> 1) AS `2 REGEXP (2 <=> 1)`,2 regexp 2 <=> 1 AS `(2 REGEXP 2) <=> 1` +select 2 REGEXP 2 <=> 1, 2 REGEXP (2 <=> 1), (2 REGEXP 2) <=> 1 union select * from v1; +2 REGEXP 2 <=> 1 2 REGEXP (2 <=> 1) (2 REGEXP 2) <=> 1 +1 0 1 +create or replace view v1 as select 2 REGEXP 2 >= 1, 2 REGEXP (2 >= 1), (2 REGEXP 2) >= 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 regexp 2 >= 1 AS `2 REGEXP 2 >= 1`,2 regexp (2 >= 1) AS `2 REGEXP (2 >= 1)`,2 regexp 2 >= 1 AS `(2 REGEXP 2) >= 1` +select 2 REGEXP 2 >= 1, 2 REGEXP (2 >= 1), (2 REGEXP 2) >= 1 union select * from v1; +2 REGEXP 2 >= 1 2 REGEXP (2 >= 1) (2 REGEXP 2) >= 1 +1 0 1 +create or replace view v1 as select 2 REGEXP 3 <= 3, 2 REGEXP (3 <= 3), (2 REGEXP 3) <= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 regexp 3 <= 3 AS `2 REGEXP 3 <= 3`,2 regexp (3 <= 3) AS `2 REGEXP (3 <= 3)`,2 regexp 3 <= 3 AS `(2 REGEXP 3) <= 3` +select 2 REGEXP 3 <= 3, 2 REGEXP (3 <= 3), (2 REGEXP 3) <= 3 union select * from v1; +2 REGEXP 3 <= 3 2 REGEXP (3 <= 3) (2 REGEXP 3) <= 3 +1 0 1 +create or replace view v1 as select 2 REGEXP 3 < 3, 2 REGEXP (3 < 3), (2 REGEXP 3) < 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 regexp 3 < 3 AS `2 REGEXP 3 < 3`,2 regexp (3 < 3) AS `2 REGEXP (3 < 3)`,2 regexp 3 < 3 AS `(2 REGEXP 3) < 3` +select 2 REGEXP 3 < 3, 2 REGEXP (3 < 3), (2 REGEXP 3) < 3 union select * from v1; +2 REGEXP 3 < 3 2 REGEXP (3 < 3) (2 REGEXP 3) < 3 +1 0 1 +create or replace view v1 as select 2 REGEXP 3 <> 3, 2 REGEXP (3 <> 3), (2 REGEXP 3) <> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 regexp 3 <> 3 AS `2 REGEXP 3 <> 3`,2 regexp (3 <> 3) AS `2 REGEXP (3 <> 3)`,2 regexp 3 <> 3 AS `(2 REGEXP 3) <> 3` +select 2 REGEXP 3 <> 3, 2 REGEXP (3 <> 3), (2 REGEXP 3) <> 3 union select * from v1; +2 REGEXP 3 <> 3 2 REGEXP (3 <> 3) (2 REGEXP 3) <> 3 +1 0 1 +create or replace view v1 as select 2 REGEXP 2 > 0, 2 REGEXP (2 > 0), (2 REGEXP 2) > 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 regexp 2 > 0 AS `2 REGEXP 2 > 0`,2 regexp (2 > 0) AS `2 REGEXP (2 > 0)`,2 regexp 2 > 0 AS `(2 REGEXP 2) > 0` +select 2 REGEXP 2 > 0, 2 REGEXP (2 > 0), (2 REGEXP 2) > 0 union select * from v1; +2 REGEXP 2 > 0 2 REGEXP (2 > 0) (2 REGEXP 2) > 0 +1 0 1 +create or replace view v1 as select 2 REGEXP 3 != 3, 2 REGEXP (3 != 3), (2 REGEXP 3) != 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 regexp 3 <> 3 AS `2 REGEXP 3 != 3`,2 regexp (3 <> 3) AS `2 REGEXP (3 != 3)`,2 regexp 3 <> 3 AS `(2 REGEXP 3) != 3` +select 2 REGEXP 3 != 3, 2 REGEXP (3 != 3), (2 REGEXP 3) != 3 union select * from v1; +2 REGEXP 3 != 3 2 REGEXP (3 != 3) (2 REGEXP 3) != 3 +1 0 1 +create or replace view v1 as select 1 REGEXP 3 LIKE 3, 1 REGEXP (3 LIKE 3), (1 REGEXP 3) LIKE 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 1 regexp 3 like 3 AS `1 REGEXP 3 LIKE 3`,1 regexp (3 like 3) AS `1 REGEXP (3 LIKE 3)`,1 regexp 3 like 3 AS `(1 REGEXP 3) LIKE 3` +select 1 REGEXP 3 LIKE 3, 1 REGEXP (3 LIKE 3), (1 REGEXP 3) LIKE 3 union select * from v1; +1 REGEXP 3 LIKE 3 1 REGEXP (3 LIKE 3) (1 REGEXP 3) LIKE 3 +0 1 0 +create or replace view v1 as select 1 REGEXP 3 REGEXP 3, 1 REGEXP (3 REGEXP 3), (1 REGEXP 3) REGEXP 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 1 regexp 3 regexp 3 AS `1 REGEXP 3 REGEXP 3`,1 regexp (3 regexp 3) AS `1 REGEXP (3 REGEXP 3)`,1 regexp 3 regexp 3 AS `(1 REGEXP 3) REGEXP 3` +select 1 REGEXP 3 REGEXP 3, 1 REGEXP (3 REGEXP 3), (1 REGEXP 3) REGEXP 3 union select * from v1; +1 REGEXP 3 REGEXP 3 1 REGEXP (3 REGEXP 3) (1 REGEXP 3) REGEXP 3 +0 1 0 +create or replace view v1 as select 2 REGEXP 3 | 3, 2 REGEXP (3 | 3), (2 REGEXP 3) | 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 regexp 3 | 3 AS `2 REGEXP 3 | 3`,2 regexp 3 | 3 AS `2 REGEXP (3 | 3)`,(2 regexp 3) | 3 AS `(2 REGEXP 3) | 3` +select 2 REGEXP 3 | 3, 2 REGEXP (3 | 3), (2 REGEXP 3) | 3 union select * from v1; +2 REGEXP 3 | 3 2 REGEXP (3 | 3) (2 REGEXP 3) | 3 +0 0 3 +create or replace view v1 as select 2 REGEXP 2 & 2, 2 REGEXP (2 & 2), (2 REGEXP 2) & 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 regexp 2 & 2 AS `2 REGEXP 2 & 2`,2 regexp 2 & 2 AS `2 REGEXP (2 & 2)`,(2 regexp 2) & 2 AS `(2 REGEXP 2) & 2` +select 2 REGEXP 2 & 2, 2 REGEXP (2 & 2), (2 REGEXP 2) & 2 union select * from v1; +2 REGEXP 2 & 2 2 REGEXP (2 & 2) (2 REGEXP 2) & 2 +1 1 0 +create or replace view v1 as select 2 REGEXP 2 << 2, 2 REGEXP (2 << 2), (2 REGEXP 2) << 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 regexp 2 << 2 AS `2 REGEXP 2 << 2`,2 regexp 2 << 2 AS `2 REGEXP (2 << 2)`,(2 regexp 2) << 2 AS `(2 REGEXP 2) << 2` +select 2 REGEXP 2 << 2, 2 REGEXP (2 << 2), (2 REGEXP 2) << 2 union select * from v1; +2 REGEXP 2 << 2 2 REGEXP (2 << 2) (2 REGEXP 2) << 2 +0 0 4 +create or replace view v1 as select 2 REGEXP 4 >> 1, 2 REGEXP (4 >> 1), (2 REGEXP 4) >> 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 regexp 4 >> 1 AS `2 REGEXP 4 >> 1`,2 regexp 4 >> 1 AS `2 REGEXP (4 >> 1)`,(2 regexp 4) >> 1 AS `(2 REGEXP 4) >> 1` +select 2 REGEXP 4 >> 1, 2 REGEXP (4 >> 1), (2 REGEXP 4) >> 1 union select * from v1; +2 REGEXP 4 >> 1 2 REGEXP (4 >> 1) (2 REGEXP 4) >> 1 +1 1 0 +create or replace view v1 as select 2 REGEXP '2000-01-01' +INTERVAL 1 DAY, 2 REGEXP ('2000-01-01' +INTERVAL 1 DAY), (2 REGEXP '2000-01-01') +INTERVAL 1 DAY; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 regexp '2000-01-01' + interval 1 day AS `2 REGEXP '2000-01-01' +INTERVAL 1 DAY`,2 regexp '2000-01-01' + interval 1 day AS `2 REGEXP ('2000-01-01' +INTERVAL 1 DAY)`,(2 regexp '2000-01-01') + interval 1 day AS `(2 REGEXP '2000-01-01') +INTERVAL 1 DAY` +select 2 REGEXP '2000-01-01' +INTERVAL 1 DAY, 2 REGEXP ('2000-01-01' +INTERVAL 1 DAY), (2 REGEXP '2000-01-01') +INTERVAL 1 DAY union select * from v1; +2 REGEXP '2000-01-01' +INTERVAL 1 DAY 2 REGEXP ('2000-01-01' +INTERVAL 1 DAY) (2 REGEXP '2000-01-01') +INTERVAL 1 DAY +0 0 NULL +create or replace view v1 as select 2 REGEXP 3 + 3, 2 REGEXP (3 + 3), (2 REGEXP 3) + 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 regexp 3 + 3 AS `2 REGEXP 3 + 3`,2 regexp 3 + 3 AS `2 REGEXP (3 + 3)`,(2 regexp 3) + 3 AS `(2 REGEXP 3) + 3` +select 2 REGEXP 3 + 3, 2 REGEXP (3 + 3), (2 REGEXP 3) + 3 union select * from v1; +2 REGEXP 3 + 3 2 REGEXP (3 + 3) (2 REGEXP 3) + 3 +0 0 3 +create or replace view v1 as select 2 REGEXP 3 - 3, 2 REGEXP (3 - 3), (2 REGEXP 3) - 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 regexp 3 - 3 AS `2 REGEXP 3 - 3`,2 regexp 3 - 3 AS `2 REGEXP (3 - 3)`,(2 regexp 3) - 3 AS `(2 REGEXP 3) - 3` +select 2 REGEXP 3 - 3, 2 REGEXP (3 - 3), (2 REGEXP 3) - 3 union select * from v1; +2 REGEXP 3 - 3 2 REGEXP (3 - 3) (2 REGEXP 3) - 3 +0 0 -3 +create or replace view v1 as select 2 REGEXP 2 * 2, 2 REGEXP (2 * 2), (2 REGEXP 2) * 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 regexp 2 * 2 AS `2 REGEXP 2 * 2`,2 regexp 2 * 2 AS `2 REGEXP (2 * 2)`,(2 regexp 2) * 2 AS `(2 REGEXP 2) * 2` +select 2 REGEXP 2 * 2, 2 REGEXP (2 * 2), (2 REGEXP 2) * 2 union select * from v1; +2 REGEXP 2 * 2 2 REGEXP (2 * 2) (2 REGEXP 2) * 2 +0 0 2 +create or replace view v1 as select 2 REGEXP 2 / 2, 2 REGEXP (2 / 2), (2 REGEXP 2) / 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 regexp 2 / 2 AS `2 REGEXP 2 / 2`,2 regexp 2 / 2 AS `2 REGEXP (2 / 2)`,(2 regexp 2) / 2 AS `(2 REGEXP 2) / 2` +select 2 REGEXP 2 / 2, 2 REGEXP (2 / 2), (2 REGEXP 2) / 2 union select * from v1; +2 REGEXP 2 / 2 2 REGEXP (2 / 2) (2 REGEXP 2) / 2 +0 0 0.5000 +create or replace view v1 as select 2 REGEXP 4 DIV 2, 2 REGEXP (4 DIV 2), (2 REGEXP 4) DIV 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 regexp 4 DIV 2 AS `2 REGEXP 4 DIV 2`,2 regexp 4 DIV 2 AS `2 REGEXP (4 DIV 2)`,(2 regexp 4) DIV 2 AS `(2 REGEXP 4) DIV 2` +select 2 REGEXP 4 DIV 2, 2 REGEXP (4 DIV 2), (2 REGEXP 4) DIV 2 union select * from v1; +2 REGEXP 4 DIV 2 2 REGEXP (4 DIV 2) (2 REGEXP 4) DIV 2 +1 1 0 +create or replace view v1 as select 2 REGEXP 2 MOD 2, 2 REGEXP (2 MOD 2), (2 REGEXP 2) MOD 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 regexp 2 MOD 2 AS `2 REGEXP 2 MOD 2`,2 regexp 2 MOD 2 AS `2 REGEXP (2 MOD 2)`,(2 regexp 2) MOD 2 AS `(2 REGEXP 2) MOD 2` +select 2 REGEXP 2 MOD 2, 2 REGEXP (2 MOD 2), (2 REGEXP 2) MOD 2 union select * from v1; +2 REGEXP 2 MOD 2 2 REGEXP (2 MOD 2) (2 REGEXP 2) MOD 2 +0 0 1 +create or replace view v1 as select 2 REGEXP 2 % 2, 2 REGEXP (2 % 2), (2 REGEXP 2) % 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 regexp 2 MOD 2 AS `2 REGEXP 2 % 2`,2 regexp 2 MOD 2 AS `2 REGEXP (2 % 2)`,(2 regexp 2) MOD 2 AS `(2 REGEXP 2) % 2` +select 2 REGEXP 2 % 2, 2 REGEXP (2 % 2), (2 REGEXP 2) % 2 union select * from v1; +2 REGEXP 2 % 2 2 REGEXP (2 % 2) (2 REGEXP 2) % 2 +0 0 1 +create or replace view v1 as select 2 REGEXP 3 ^ 3, 2 REGEXP (3 ^ 3), (2 REGEXP 3) ^ 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 regexp 3 ^ 3 AS `2 REGEXP 3 ^ 3`,2 regexp 3 ^ 3 AS `2 REGEXP (3 ^ 3)`,(2 regexp 3) ^ 3 AS `(2 REGEXP 3) ^ 3` +select 2 REGEXP 3 ^ 3, 2 REGEXP (3 ^ 3), (2 REGEXP 3) ^ 3 union select * from v1; +2 REGEXP 3 ^ 3 2 REGEXP (3 ^ 3) (2 REGEXP 3) ^ 3 +0 0 3 +create or replace view v1 as select 2 REGEXP 2 BETWEEN 1 AND 3, 2 REGEXP (2 BETWEEN 1 AND 3), (2 REGEXP 2) BETWEEN 1 AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 regexp 2 between 1 and 3 AS `2 REGEXP 2 BETWEEN 1 AND 3`,2 regexp (2 between 1 and 3) AS `2 REGEXP (2 BETWEEN 1 AND 3)`,2 regexp 2 between 1 and 3 AS `(2 REGEXP 2) BETWEEN 1 AND 3` +select 2 REGEXP 2 BETWEEN 1 AND 3, 2 REGEXP (2 BETWEEN 1 AND 3), (2 REGEXP 2) BETWEEN 1 AND 3 union select * from v1; +2 REGEXP 2 BETWEEN 1 AND 3 2 REGEXP (2 BETWEEN 1 AND 3) (2 REGEXP 2) BETWEEN 1 AND 3 +1 0 1 +create or replace view v1 as select 2 | 3 IS FALSE, 2 | (3 IS FALSE), (2 | 3) IS FALSE; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 | 3 is false AS `2 | 3 IS FALSE`,2 | (3 is false) AS `2 | (3 IS FALSE)`,2 | 3 is false AS `(2 | 3) IS FALSE` +select 2 | 3 IS FALSE, 2 | (3 IS FALSE), (2 | 3) IS FALSE union select * from v1; +2 | 3 IS FALSE 2 | (3 IS FALSE) (2 | 3) IS FALSE +0 2 0 +create or replace view v1 as select charset(2 | 3 COLLATE latin1_bin), charset(2 | (3 COLLATE latin1_bin)), charset((2 | 3) COLLATE latin1_bin); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select charset(2 | 3 collate latin1_bin) AS `charset(2 | 3 COLLATE latin1_bin)`,charset(2 | 3 collate latin1_bin) AS `charset(2 | (3 COLLATE latin1_bin))`,charset((2 | 3) collate latin1_bin) AS `charset((2 | 3) COLLATE latin1_bin)` +select charset(2 | 3 COLLATE latin1_bin), charset(2 | (3 COLLATE latin1_bin)), charset((2 | 3) COLLATE latin1_bin) union select * from v1; +charset(2 | 3 COLLATE latin1_bin) charset(2 | (3 COLLATE latin1_bin)) charset((2 | 3) COLLATE latin1_bin) +binary binary latin1 +create or replace view v1 as select 2 | 3 IN (0,1), 2 | (3 IN (0,1)), (2 | 3) IN (0,1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 | 3 in (0,1) AS `2 | 3 IN (0,1)`,2 | (3 in (0,1)) AS `2 | (3 IN (0,1))`,2 | 3 in (0,1) AS `(2 | 3) IN (0,1)` +select 2 | 3 IN (0,1), 2 | (3 IN (0,1)), (2 | 3) IN (0,1) union select * from v1; +2 | 3 IN (0,1) 2 | (3 IN (0,1)) (2 | 3) IN (0,1) +0 2 0 +create or replace view v1 as select 2 | 3 OR 3, 2 | (3 OR 3), (2 | 3) OR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 | 3 or 3 AS `2 | 3 OR 3`,2 | (3 or 3) AS `2 | (3 OR 3)`,2 | 3 or 3 AS `(2 | 3) OR 3` +select 2 | 3 OR 3, 2 | (3 OR 3), (2 | 3) OR 3 union select * from v1; +2 | 3 OR 3 2 | (3 OR 3) (2 | 3) OR 3 +1 3 1 +create or replace view v1 as select 2 | 3 || 3, 2 | (3 || 3), (2 | 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 | 3 or 3 AS `2 | 3 || 3`,2 | (3 or 3) AS `2 | (3 || 3)`,2 | 3 or 3 AS `(2 | 3) || 3` +select 2 | 3 || 3, 2 | (3 || 3), (2 | 3) || 3 union select * from v1; +2 | 3 || 3 2 | (3 || 3) (2 | 3) || 3 +1 3 1 +create or replace view v1 as select 2 | 3 XOR 3, 2 | (3 XOR 3), (2 | 3) XOR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 | 3 xor 3 AS `2 | 3 XOR 3`,2 | (3 xor 3) AS `2 | (3 XOR 3)`,2 | 3 xor 3 AS `(2 | 3) XOR 3` +select 2 | 3 XOR 3, 2 | (3 XOR 3), (2 | 3) XOR 3 union select * from v1; +2 | 3 XOR 3 2 | (3 XOR 3) (2 | 3) XOR 3 +0 2 0 +create or replace view v1 as select 2 | 3 AND 3, 2 | (3 AND 3), (2 | 3) AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 | 3 and 3 AS `2 | 3 AND 3`,2 | (3 and 3) AS `2 | (3 AND 3)`,2 | 3 and 3 AS `(2 | 3) AND 3` +select 2 | 3 AND 3, 2 | (3 AND 3), (2 | 3) AND 3 union select * from v1; +2 | 3 AND 3 2 | (3 AND 3) (2 | 3) AND 3 +1 3 1 +create or replace view v1 as select 2 | 3 && 3, 2 | (3 && 3), (2 | 3) && 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 | 3 and 3 AS `2 | 3 && 3`,2 | (3 and 3) AS `2 | (3 && 3)`,2 | 3 and 3 AS `(2 | 3) && 3` +select 2 | 3 && 3, 2 | (3 && 3), (2 | 3) && 3 union select * from v1; +2 | 3 && 3 2 | (3 && 3) (2 | 3) && 3 +1 3 1 +create or replace view v1 as select 2 | 3 = 3, 2 | (3 = 3), (2 | 3) = 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 | 3 = 3 AS `2 | 3 = 3`,2 | (3 = 3) AS `2 | (3 = 3)`,2 | 3 = 3 AS `(2 | 3) = 3` +select 2 | 3 = 3, 2 | (3 = 3), (2 | 3) = 3 union select * from v1; +2 | 3 = 3 2 | (3 = 3) (2 | 3) = 3 +1 3 1 +create or replace view v1 as select 2 | 3 <=> 3, 2 | (3 <=> 3), (2 | 3) <=> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 | 3 <=> 3 AS `2 | 3 <=> 3`,2 | (3 <=> 3) AS `2 | (3 <=> 3)`,2 | 3 <=> 3 AS `(2 | 3) <=> 3` +select 2 | 3 <=> 3, 2 | (3 <=> 3), (2 | 3) <=> 3 union select * from v1; +2 | 3 <=> 3 2 | (3 <=> 3) (2 | 3) <=> 3 +1 3 1 +create or replace view v1 as select 2 | 3 >= 3, 2 | (3 >= 3), (2 | 3) >= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 | 3 >= 3 AS `2 | 3 >= 3`,2 | (3 >= 3) AS `2 | (3 >= 3)`,2 | 3 >= 3 AS `(2 | 3) >= 3` +select 2 | 3 >= 3, 2 | (3 >= 3), (2 | 3) >= 3 union select * from v1; +2 | 3 >= 3 2 | (3 >= 3) (2 | 3) >= 3 +1 3 1 +create or replace view v1 as select 2 | 3 <= 3, 2 | (3 <= 3), (2 | 3) <= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 | 3 <= 3 AS `2 | 3 <= 3`,2 | (3 <= 3) AS `2 | (3 <= 3)`,2 | 3 <= 3 AS `(2 | 3) <= 3` +select 2 | 3 <= 3, 2 | (3 <= 3), (2 | 3) <= 3 union select * from v1; +2 | 3 <= 3 2 | (3 <= 3) (2 | 3) <= 3 +1 3 1 +create or replace view v1 as select 2 | 3 < 3, 2 | (3 < 3), (2 | 3) < 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 | 3 < 3 AS `2 | 3 < 3`,2 | (3 < 3) AS `2 | (3 < 3)`,2 | 3 < 3 AS `(2 | 3) < 3` +select 2 | 3 < 3, 2 | (3 < 3), (2 | 3) < 3 union select * from v1; +2 | 3 < 3 2 | (3 < 3) (2 | 3) < 3 +0 2 0 +create or replace view v1 as select 2 | 3 <> 3, 2 | (3 <> 3), (2 | 3) <> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 | 3 <> 3 AS `2 | 3 <> 3`,2 | (3 <> 3) AS `2 | (3 <> 3)`,2 | 3 <> 3 AS `(2 | 3) <> 3` +select 2 | 3 <> 3, 2 | (3 <> 3), (2 | 3) <> 3 union select * from v1; +2 | 3 <> 3 2 | (3 <> 3) (2 | 3) <> 3 +0 2 0 +create or replace view v1 as select 2 | 3 > 3, 2 | (3 > 3), (2 | 3) > 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 | 3 > 3 AS `2 | 3 > 3`,2 | (3 > 3) AS `2 | (3 > 3)`,2 | 3 > 3 AS `(2 | 3) > 3` +select 2 | 3 > 3, 2 | (3 > 3), (2 | 3) > 3 union select * from v1; +2 | 3 > 3 2 | (3 > 3) (2 | 3) > 3 +0 2 0 +create or replace view v1 as select 2 | 3 != 3, 2 | (3 != 3), (2 | 3) != 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 | 3 <> 3 AS `2 | 3 != 3`,2 | (3 <> 3) AS `2 | (3 != 3)`,2 | 3 <> 3 AS `(2 | 3) != 3` +select 2 | 3 != 3, 2 | (3 != 3), (2 | 3) != 3 union select * from v1; +2 | 3 != 3 2 | (3 != 3) (2 | 3) != 3 +0 2 0 +create or replace view v1 as select 2 | 3 LIKE 3, 2 | (3 LIKE 3), (2 | 3) LIKE 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 | 3 like 3 AS `2 | 3 LIKE 3`,2 | (3 like 3) AS `2 | (3 LIKE 3)`,2 | 3 like 3 AS `(2 | 3) LIKE 3` +select 2 | 3 LIKE 3, 2 | (3 LIKE 3), (2 | 3) LIKE 3 union select * from v1; +2 | 3 LIKE 3 2 | (3 LIKE 3) (2 | 3) LIKE 3 +1 3 1 +create or replace view v1 as select 2 | 3 REGEXP 3, 2 | (3 REGEXP 3), (2 | 3) REGEXP 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 | 3 regexp 3 AS `2 | 3 REGEXP 3`,2 | (3 regexp 3) AS `2 | (3 REGEXP 3)`,2 | 3 regexp 3 AS `(2 | 3) REGEXP 3` +select 2 | 3 REGEXP 3, 2 | (3 REGEXP 3), (2 | 3) REGEXP 3 union select * from v1; +2 | 3 REGEXP 3 2 | (3 REGEXP 3) (2 | 3) REGEXP 3 +1 3 1 +create or replace view v1 as select 2 | 0 & 0, 2 | (0 & 0), (2 | 0) & 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 | 0 & 0 AS `2 | 0 & 0`,2 | 0 & 0 AS `2 | (0 & 0)`,(2 | 0) & 0 AS `(2 | 0) & 0` +select 2 | 0 & 0, 2 | (0 & 0), (2 | 0) & 0 union select * from v1; +2 | 0 & 0 2 | (0 & 0) (2 | 0) & 0 +2 2 0 +create or replace view v1 as select 2 | 3 << 3, 2 | (3 << 3), (2 | 3) << 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 | 3 << 3 AS `2 | 3 << 3`,2 | 3 << 3 AS `2 | (3 << 3)`,(2 | 3) << 3 AS `(2 | 3) << 3` +select 2 | 3 << 3, 2 | (3 << 3), (2 | 3) << 3 union select * from v1; +2 | 3 << 3 2 | (3 << 3) (2 | 3) << 3 +26 26 24 +create or replace view v1 as select 2 | 3 >> 3, 2 | (3 >> 3), (2 | 3) >> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 | 3 >> 3 AS `2 | 3 >> 3`,2 | 3 >> 3 AS `2 | (3 >> 3)`,(2 | 3) >> 3 AS `(2 | 3) >> 3` +select 2 | 3 >> 3, 2 | (3 >> 3), (2 | 3) >> 3 union select * from v1; +2 | 3 >> 3 2 | (3 >> 3) (2 | 3) >> 3 +2 2 0 +create or replace view v1 as select 2 | '2000-01-01' +INTERVAL 1 DAY, 2 | ('2000-01-01' +INTERVAL 1 DAY), (2 | '2000-01-01') +INTERVAL 1 DAY; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 | '2000-01-01' + interval 1 day AS `2 | '2000-01-01' +INTERVAL 1 DAY`,2 | '2000-01-01' + interval 1 day AS `2 | ('2000-01-01' +INTERVAL 1 DAY)`,(2 | '2000-01-01') + interval 1 day AS `(2 | '2000-01-01') +INTERVAL 1 DAY` +select 2 | '2000-01-01' +INTERVAL 1 DAY, 2 | ('2000-01-01' +INTERVAL 1 DAY), (2 | '2000-01-01') +INTERVAL 1 DAY union select * from v1; +2 | '2000-01-01' +INTERVAL 1 DAY 2 | ('2000-01-01' +INTERVAL 1 DAY) (2 | '2000-01-01') +INTERVAL 1 DAY +20000102 20000102 NULL +create or replace view v1 as select 2 | 1 + 1, 2 | (1 + 1), (2 | 1) + 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 | 1 + 1 AS `2 | 1 + 1`,2 | 1 + 1 AS `2 | (1 + 1)`,(2 | 1) + 1 AS `(2 | 1) + 1` +select 2 | 1 + 1, 2 | (1 + 1), (2 | 1) + 1 union select * from v1; +2 | 1 + 1 2 | (1 + 1) (2 | 1) + 1 +2 2 4 +create or replace view v1 as select 2 | 3 - 3, 2 | (3 - 3), (2 | 3) - 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 | 3 - 3 AS `2 | 3 - 3`,2 | 3 - 3 AS `2 | (3 - 3)`,(2 | 3) - 3 AS `(2 | 3) - 3` +select 2 | 3 - 3, 2 | (3 - 3), (2 | 3) - 3 union select * from v1; +2 | 3 - 3 2 | (3 - 3) (2 | 3) - 3 +2 2 0 +create or replace view v1 as select 2 | 3 * 3, 2 | (3 * 3), (2 | 3) * 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 | 3 * 3 AS `2 | 3 * 3`,2 | 3 * 3 AS `2 | (3 * 3)`,(2 | 3) * 3 AS `(2 | 3) * 3` +select 2 | 3 * 3, 2 | (3 * 3), (2 | 3) * 3 union select * from v1; +2 | 3 * 3 2 | (3 * 3) (2 | 3) * 3 +11 11 9 +create or replace view v1 as select 2 | 3 / 3, 2 | (3 / 3), (2 | 3) / 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 | 3 / 3 AS `2 | 3 / 3`,2 | 3 / 3 AS `2 | (3 / 3)`,(2 | 3) / 3 AS `(2 | 3) / 3` +select 2 | 3 / 3, 2 | (3 / 3), (2 | 3) / 3 union select * from v1; +2 | 3 / 3 2 | (3 / 3) (2 | 3) / 3 +3 3 1.0000 +create or replace view v1 as select 2 | 3 DIV 3, 2 | (3 DIV 3), (2 | 3) DIV 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 | 3 DIV 3 AS `2 | 3 DIV 3`,2 | 3 DIV 3 AS `2 | (3 DIV 3)`,(2 | 3) DIV 3 AS `(2 | 3) DIV 3` +select 2 | 3 DIV 3, 2 | (3 DIV 3), (2 | 3) DIV 3 union select * from v1; +2 | 3 DIV 3 2 | (3 DIV 3) (2 | 3) DIV 3 +3 3 1 +create or replace view v1 as select 2 | 3 MOD 3, 2 | (3 MOD 3), (2 | 3) MOD 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 | 3 MOD 3 AS `2 | 3 MOD 3`,2 | 3 MOD 3 AS `2 | (3 MOD 3)`,(2 | 3) MOD 3 AS `(2 | 3) MOD 3` +select 2 | 3 MOD 3, 2 | (3 MOD 3), (2 | 3) MOD 3 union select * from v1; +2 | 3 MOD 3 2 | (3 MOD 3) (2 | 3) MOD 3 +2 2 0 +create or replace view v1 as select 2 | 3 % 3, 2 | (3 % 3), (2 | 3) % 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 | 3 MOD 3 AS `2 | 3 % 3`,2 | 3 MOD 3 AS `2 | (3 % 3)`,(2 | 3) MOD 3 AS `(2 | 3) % 3` +select 2 | 3 % 3, 2 | (3 % 3), (2 | 3) % 3 union select * from v1; +2 | 3 % 3 2 | (3 % 3) (2 | 3) % 3 +2 2 0 +create or replace view v1 as select 2 | 3 ^ 3, 2 | (3 ^ 3), (2 | 3) ^ 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 | 3 ^ 3 AS `2 | 3 ^ 3`,2 | 3 ^ 3 AS `2 | (3 ^ 3)`,(2 | 3) ^ 3 AS `(2 | 3) ^ 3` +select 2 | 3 ^ 3, 2 | (3 ^ 3), (2 | 3) ^ 3 union select * from v1; +2 | 3 ^ 3 2 | (3 ^ 3) (2 | 3) ^ 3 +2 2 0 +create or replace view v1 as select 2 | 3 BETWEEN 1 AND 3, 2 | (3 BETWEEN 1 AND 3), (2 | 3) BETWEEN 1 AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 | 3 between 1 and 3 AS `2 | 3 BETWEEN 1 AND 3`,2 | (3 between 1 and 3) AS `2 | (3 BETWEEN 1 AND 3)`,2 | 3 between 1 and 3 AS `(2 | 3) BETWEEN 1 AND 3` +select 2 | 3 BETWEEN 1 AND 3, 2 | (3 BETWEEN 1 AND 3), (2 | 3) BETWEEN 1 AND 3 union select * from v1; +2 | 3 BETWEEN 1 AND 3 2 | (3 BETWEEN 1 AND 3) (2 | 3) BETWEEN 1 AND 3 +1 3 1 +create or replace view v1 as select 2 & 1 IS FALSE, 2 & (1 IS FALSE), (2 & 1) IS FALSE; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 & 1 is false AS `2 & 1 IS FALSE`,2 & (1 is false) AS `2 & (1 IS FALSE)`,2 & 1 is false AS `(2 & 1) IS FALSE` +select 2 & 1 IS FALSE, 2 & (1 IS FALSE), (2 & 1) IS FALSE union select * from v1; +2 & 1 IS FALSE 2 & (1 IS FALSE) (2 & 1) IS FALSE +1 0 1 +create or replace view v1 as select charset(2 & 3 COLLATE latin1_bin), charset(2 & (3 COLLATE latin1_bin)), charset((2 & 3) COLLATE latin1_bin); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select charset(2 & 3 collate latin1_bin) AS `charset(2 & 3 COLLATE latin1_bin)`,charset(2 & 3 collate latin1_bin) AS `charset(2 & (3 COLLATE latin1_bin))`,charset((2 & 3) collate latin1_bin) AS `charset((2 & 3) COLLATE latin1_bin)` +select charset(2 & 3 COLLATE latin1_bin), charset(2 & (3 COLLATE latin1_bin)), charset((2 & 3) COLLATE latin1_bin) union select * from v1; +charset(2 & 3 COLLATE latin1_bin) charset(2 & (3 COLLATE latin1_bin)) charset((2 & 3) COLLATE latin1_bin) +binary binary latin1 +create or replace view v1 as select 2 & 4 IN (0,1), 2 & (4 IN (0,1)), (2 & 4) IN (0,1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 & 4 in (0,1) AS `2 & 4 IN (0,1)`,2 & (4 in (0,1)) AS `2 & (4 IN (0,1))`,2 & 4 in (0,1) AS `(2 & 4) IN (0,1)` +select 2 & 4 IN (0,1), 2 & (4 IN (0,1)), (2 & 4) IN (0,1) union select * from v1; +2 & 4 IN (0,1) 2 & (4 IN (0,1)) (2 & 4) IN (0,1) +1 0 1 +create or replace view v1 as select 2 & 3 OR 3, 2 & (3 OR 3), (2 & 3) OR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 & 3 or 3 AS `2 & 3 OR 3`,2 & (3 or 3) AS `2 & (3 OR 3)`,2 & 3 or 3 AS `(2 & 3) OR 3` +select 2 & 3 OR 3, 2 & (3 OR 3), (2 & 3) OR 3 union select * from v1; +2 & 3 OR 3 2 & (3 OR 3) (2 & 3) OR 3 +1 0 1 +create or replace view v1 as select 2 & 3 || 3, 2 & (3 || 3), (2 & 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 & 3 or 3 AS `2 & 3 || 3`,2 & (3 or 3) AS `2 & (3 || 3)`,2 & 3 or 3 AS `(2 & 3) || 3` +select 2 & 3 || 3, 2 & (3 || 3), (2 & 3) || 3 union select * from v1; +2 & 3 || 3 2 & (3 || 3) (2 & 3) || 3 +1 0 1 +create or replace view v1 as select 2 & 1 XOR 1, 2 & (1 XOR 1), (2 & 1) XOR 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 & 1 xor 1 AS `2 & 1 XOR 1`,2 & (1 xor 1) AS `2 & (1 XOR 1)`,2 & 1 xor 1 AS `(2 & 1) XOR 1` +select 2 & 1 XOR 1, 2 & (1 XOR 1), (2 & 1) XOR 1 union select * from v1; +2 & 1 XOR 1 2 & (1 XOR 1) (2 & 1) XOR 1 +1 0 1 +create or replace view v1 as select 2 & 3 AND 3, 2 & (3 AND 3), (2 & 3) AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 & 3 and 3 AS `2 & 3 AND 3`,2 & (3 and 3) AS `2 & (3 AND 3)`,2 & 3 and 3 AS `(2 & 3) AND 3` +select 2 & 3 AND 3, 2 & (3 AND 3), (2 & 3) AND 3 union select * from v1; +2 & 3 AND 3 2 & (3 AND 3) (2 & 3) AND 3 +1 0 1 +create or replace view v1 as select 2 & 3 && 3, 2 & (3 && 3), (2 & 3) && 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 & 3 and 3 AS `2 & 3 && 3`,2 & (3 and 3) AS `2 & (3 && 3)`,2 & 3 and 3 AS `(2 & 3) && 3` +select 2 & 3 && 3, 2 & (3 && 3), (2 & 3) && 3 union select * from v1; +2 & 3 && 3 2 & (3 && 3) (2 & 3) && 3 +1 0 1 +create or replace view v1 as select 2 & 3 = 2, 2 & (3 = 2), (2 & 3) = 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 & 3 = 2 AS `2 & 3 = 2`,2 & (3 = 2) AS `2 & (3 = 2)`,2 & 3 = 2 AS `(2 & 3) = 2` +select 2 & 3 = 2, 2 & (3 = 2), (2 & 3) = 2 union select * from v1; +2 & 3 = 2 2 & (3 = 2) (2 & 3) = 2 +1 0 1 +create or replace view v1 as select 2 & 3 <=> 2, 2 & (3 <=> 2), (2 & 3) <=> 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 & 3 <=> 2 AS `2 & 3 <=> 2`,2 & (3 <=> 2) AS `2 & (3 <=> 2)`,2 & 3 <=> 2 AS `(2 & 3) <=> 2` +select 2 & 3 <=> 2, 2 & (3 <=> 2), (2 & 3) <=> 2 union select * from v1; +2 & 3 <=> 2 2 & (3 <=> 2) (2 & 3) <=> 2 +1 0 1 +create or replace view v1 as select 2 & 3 >= 2, 2 & (3 >= 2), (2 & 3) >= 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 & 3 >= 2 AS `2 & 3 >= 2`,2 & (3 >= 2) AS `2 & (3 >= 2)`,2 & 3 >= 2 AS `(2 & 3) >= 2` +select 2 & 3 >= 2, 2 & (3 >= 2), (2 & 3) >= 2 union select * from v1; +2 & 3 >= 2 2 & (3 >= 2) (2 & 3) >= 2 +1 0 1 +create or replace view v1 as select 2 & 3 <= 3, 2 & (3 <= 3), (2 & 3) <= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 & 3 <= 3 AS `2 & 3 <= 3`,2 & (3 <= 3) AS `2 & (3 <= 3)`,2 & 3 <= 3 AS `(2 & 3) <= 3` +select 2 & 3 <= 3, 2 & (3 <= 3), (2 & 3) <= 3 union select * from v1; +2 & 3 <= 3 2 & (3 <= 3) (2 & 3) <= 3 +1 0 1 +create or replace view v1 as select 2 & 3 < 3, 2 & (3 < 3), (2 & 3) < 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 & 3 < 3 AS `2 & 3 < 3`,2 & (3 < 3) AS `2 & (3 < 3)`,2 & 3 < 3 AS `(2 & 3) < 3` +select 2 & 3 < 3, 2 & (3 < 3), (2 & 3) < 3 union select * from v1; +2 & 3 < 3 2 & (3 < 3) (2 & 3) < 3 +1 0 1 +create or replace view v1 as select 2 & 3 <> 3, 2 & (3 <> 3), (2 & 3) <> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 & 3 <> 3 AS `2 & 3 <> 3`,2 & (3 <> 3) AS `2 & (3 <> 3)`,2 & 3 <> 3 AS `(2 & 3) <> 3` +select 2 & 3 <> 3, 2 & (3 <> 3), (2 & 3) <> 3 union select * from v1; +2 & 3 <> 3 2 & (3 <> 3) (2 & 3) <> 3 +1 0 1 +create or replace view v1 as select 2 & 3 > 1, 2 & (3 > 1), (2 & 3) > 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 & 3 > 1 AS `2 & 3 > 1`,2 & (3 > 1) AS `2 & (3 > 1)`,2 & 3 > 1 AS `(2 & 3) > 1` +select 2 & 3 > 1, 2 & (3 > 1), (2 & 3) > 1 union select * from v1; +2 & 3 > 1 2 & (3 > 1) (2 & 3) > 1 +1 0 1 +create or replace view v1 as select 2 & 3 != 3, 2 & (3 != 3), (2 & 3) != 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 & 3 <> 3 AS `2 & 3 != 3`,2 & (3 <> 3) AS `2 & (3 != 3)`,2 & 3 <> 3 AS `(2 & 3) != 3` +select 2 & 3 != 3, 2 & (3 != 3), (2 & 3) != 3 union select * from v1; +2 & 3 != 3 2 & (3 != 3) (2 & 3) != 3 +1 0 1 +create or replace view v1 as select 2 & 3 LIKE 2, 2 & (3 LIKE 2), (2 & 3) LIKE 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 & 3 like 2 AS `2 & 3 LIKE 2`,2 & (3 like 2) AS `2 & (3 LIKE 2)`,2 & 3 like 2 AS `(2 & 3) LIKE 2` +select 2 & 3 LIKE 2, 2 & (3 LIKE 2), (2 & 3) LIKE 2 union select * from v1; +2 & 3 LIKE 2 2 & (3 LIKE 2) (2 & 3) LIKE 2 +1 0 1 +create or replace view v1 as select 2 & 3 REGEXP 2, 2 & (3 REGEXP 2), (2 & 3) REGEXP 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 & 3 regexp 2 AS `2 & 3 REGEXP 2`,2 & (3 regexp 2) AS `2 & (3 REGEXP 2)`,2 & 3 regexp 2 AS `(2 & 3) REGEXP 2` +select 2 & 3 REGEXP 2, 2 & (3 REGEXP 2), (2 & 3) REGEXP 2 union select * from v1; +2 & 3 REGEXP 2 2 & (3 REGEXP 2) (2 & 3) REGEXP 2 +1 0 1 +create or replace view v1 as select 2 & 3 | 3, 2 & (3 | 3), (2 & 3) | 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 & 3 | 3 AS `2 & 3 | 3`,2 & (3 | 3) AS `2 & (3 | 3)`,2 & 3 | 3 AS `(2 & 3) | 3` +select 2 & 3 | 3, 2 & (3 | 3), (2 & 3) | 3 union select * from v1; +2 & 3 | 3 2 & (3 | 3) (2 & 3) | 3 +3 2 3 +create or replace view v1 as select 2 & 3 << 3, 2 & (3 << 3), (2 & 3) << 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 & 3 << 3 AS `2 & 3 << 3`,2 & 3 << 3 AS `2 & (3 << 3)`,(2 & 3) << 3 AS `(2 & 3) << 3` +select 2 & 3 << 3, 2 & (3 << 3), (2 & 3) << 3 union select * from v1; +2 & 3 << 3 2 & (3 << 3) (2 & 3) << 3 +0 0 16 +create or replace view v1 as select 2 & 3 >> 1, 2 & (3 >> 1), (2 & 3) >> 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 & 3 >> 1 AS `2 & 3 >> 1`,2 & 3 >> 1 AS `2 & (3 >> 1)`,(2 & 3) >> 1 AS `(2 & 3) >> 1` +select 2 & 3 >> 1, 2 & (3 >> 1), (2 & 3) >> 1 union select * from v1; +2 & 3 >> 1 2 & (3 >> 1) (2 & 3) >> 1 +0 0 1 +create or replace view v1 as select 2 & '2000-01-01' +INTERVAL 1 DAY, 2 & ('2000-01-01' +INTERVAL 1 DAY), (2 & '2000-01-01') +INTERVAL 1 DAY; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 & '2000-01-01' + interval 1 day AS `2 & '2000-01-01' +INTERVAL 1 DAY`,2 & '2000-01-01' + interval 1 day AS `2 & ('2000-01-01' +INTERVAL 1 DAY)`,(2 & '2000-01-01') + interval 1 day AS `(2 & '2000-01-01') +INTERVAL 1 DAY` +select 2 & '2000-01-01' +INTERVAL 1 DAY, 2 & ('2000-01-01' +INTERVAL 1 DAY), (2 & '2000-01-01') +INTERVAL 1 DAY union select * from v1; +2 & '2000-01-01' +INTERVAL 1 DAY 2 & ('2000-01-01' +INTERVAL 1 DAY) (2 & '2000-01-01') +INTERVAL 1 DAY +2 2 NULL +create or replace view v1 as select 2 & 3 + 3, 2 & (3 + 3), (2 & 3) + 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 & 3 + 3 AS `2 & 3 + 3`,2 & 3 + 3 AS `2 & (3 + 3)`,(2 & 3) + 3 AS `(2 & 3) + 3` +select 2 & 3 + 3, 2 & (3 + 3), (2 & 3) + 3 union select * from v1; +2 & 3 + 3 2 & (3 + 3) (2 & 3) + 3 +2 2 5 +create or replace view v1 as select 6 & 4 - 3, 6 & (4 - 3), (6 & 4) - 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 6 & 4 - 3 AS `6 & 4 - 3`,6 & 4 - 3 AS `6 & (4 - 3)`,(6 & 4) - 3 AS `(6 & 4) - 3` +select 6 & 4 - 3, 6 & (4 - 3), (6 & 4) - 3 union select * from v1; +6 & 4 - 3 6 & (4 - 3) (6 & 4) - 3 +0 0 1 +create or replace view v1 as select 2 & 3 * 3, 2 & (3 * 3), (2 & 3) * 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 & 3 * 3 AS `2 & 3 * 3`,2 & 3 * 3 AS `2 & (3 * 3)`,(2 & 3) * 3 AS `(2 & 3) * 3` +select 2 & 3 * 3, 2 & (3 * 3), (2 & 3) * 3 union select * from v1; +2 & 3 * 3 2 & (3 * 3) (2 & 3) * 3 +0 0 6 +create or replace view v1 as select 2 & 3 / 3, 2 & (3 / 3), (2 & 3) / 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 & 3 / 3 AS `2 & 3 / 3`,2 & 3 / 3 AS `2 & (3 / 3)`,(2 & 3) / 3 AS `(2 & 3) / 3` +select 2 & 3 / 3, 2 & (3 / 3), (2 & 3) / 3 union select * from v1; +2 & 3 / 3 2 & (3 / 3) (2 & 3) / 3 +0 0 0.6667 +create or replace view v1 as select 2 & 3 DIV 2, 2 & (3 DIV 2), (2 & 3) DIV 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 & 3 DIV 2 AS `2 & 3 DIV 2`,2 & 3 DIV 2 AS `2 & (3 DIV 2)`,(2 & 3) DIV 2 AS `(2 & 3) DIV 2` +select 2 & 3 DIV 2, 2 & (3 DIV 2), (2 & 3) DIV 2 union select * from v1; +2 & 3 DIV 2 2 & (3 DIV 2) (2 & 3) DIV 2 +0 0 1 +create or replace view v1 as select 2 & 3 MOD 3, 2 & (3 MOD 3), (2 & 3) MOD 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 & 3 MOD 3 AS `2 & 3 MOD 3`,2 & 3 MOD 3 AS `2 & (3 MOD 3)`,(2 & 3) MOD 3 AS `(2 & 3) MOD 3` +select 2 & 3 MOD 3, 2 & (3 MOD 3), (2 & 3) MOD 3 union select * from v1; +2 & 3 MOD 3 2 & (3 MOD 3) (2 & 3) MOD 3 +0 0 2 +create or replace view v1 as select 2 & 3 % 3, 2 & (3 % 3), (2 & 3) % 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 & 3 MOD 3 AS `2 & 3 % 3`,2 & 3 MOD 3 AS `2 & (3 % 3)`,(2 & 3) MOD 3 AS `(2 & 3) % 3` +select 2 & 3 % 3, 2 & (3 % 3), (2 & 3) % 3 union select * from v1; +2 & 3 % 3 2 & (3 % 3) (2 & 3) % 3 +0 0 2 +create or replace view v1 as select 2 & 3 ^ 3, 2 & (3 ^ 3), (2 & 3) ^ 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 & 3 ^ 3 AS `2 & 3 ^ 3`,2 & 3 ^ 3 AS `2 & (3 ^ 3)`,(2 & 3) ^ 3 AS `(2 & 3) ^ 3` +select 2 & 3 ^ 3, 2 & (3 ^ 3), (2 & 3) ^ 3 union select * from v1; +2 & 3 ^ 3 2 & (3 ^ 3) (2 & 3) ^ 3 +0 0 1 +create or replace view v1 as select 2 & 3 BETWEEN 1 AND 3, 2 & (3 BETWEEN 1 AND 3), (2 & 3) BETWEEN 1 AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 & 3 between 1 and 3 AS `2 & 3 BETWEEN 1 AND 3`,2 & (3 between 1 and 3) AS `2 & (3 BETWEEN 1 AND 3)`,2 & 3 between 1 and 3 AS `(2 & 3) BETWEEN 1 AND 3` +select 2 & 3 BETWEEN 1 AND 3, 2 & (3 BETWEEN 1 AND 3), (2 & 3) BETWEEN 1 AND 3 union select * from v1; +2 & 3 BETWEEN 1 AND 3 2 & (3 BETWEEN 1 AND 3) (2 & 3) BETWEEN 1 AND 3 +1 0 1 +create or replace view v1 as select 2 << 3 IS FALSE, 2 << (3 IS FALSE), (2 << 3) IS FALSE; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 << 3 is false AS `2 << 3 IS FALSE`,2 << (3 is false) AS `2 << (3 IS FALSE)`,2 << 3 is false AS `(2 << 3) IS FALSE` +select 2 << 3 IS FALSE, 2 << (3 IS FALSE), (2 << 3) IS FALSE union select * from v1; +2 << 3 IS FALSE 2 << (3 IS FALSE) (2 << 3) IS FALSE +0 2 0 +create or replace view v1 as select charset(2 << 3 COLLATE latin1_bin), charset(2 << (3 COLLATE latin1_bin)), charset((2 << 3) COLLATE latin1_bin); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select charset(2 << 3 collate latin1_bin) AS `charset(2 << 3 COLLATE latin1_bin)`,charset(2 << 3 collate latin1_bin) AS `charset(2 << (3 COLLATE latin1_bin))`,charset((2 << 3) collate latin1_bin) AS `charset((2 << 3) COLLATE latin1_bin)` +select charset(2 << 3 COLLATE latin1_bin), charset(2 << (3 COLLATE latin1_bin)), charset((2 << 3) COLLATE latin1_bin) union select * from v1; +charset(2 << 3 COLLATE latin1_bin) charset(2 << (3 COLLATE latin1_bin)) charset((2 << 3) COLLATE latin1_bin) +binary binary latin1 +create or replace view v1 as select 2 << 3 IN (0,1), 2 << (3 IN (0,1)), (2 << 3) IN (0,1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 << 3 in (0,1) AS `2 << 3 IN (0,1)`,2 << (3 in (0,1)) AS `2 << (3 IN (0,1))`,2 << 3 in (0,1) AS `(2 << 3) IN (0,1)` +select 2 << 3 IN (0,1), 2 << (3 IN (0,1)), (2 << 3) IN (0,1) union select * from v1; +2 << 3 IN (0,1) 2 << (3 IN (0,1)) (2 << 3) IN (0,1) +0 2 0 +create or replace view v1 as select 2 << 3 OR 3, 2 << (3 OR 3), (2 << 3) OR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 << 3 or 3 AS `2 << 3 OR 3`,2 << (3 or 3) AS `2 << (3 OR 3)`,2 << 3 or 3 AS `(2 << 3) OR 3` +select 2 << 3 OR 3, 2 << (3 OR 3), (2 << 3) OR 3 union select * from v1; +2 << 3 OR 3 2 << (3 OR 3) (2 << 3) OR 3 +1 4 1 +create or replace view v1 as select 2 << 3 || 3, 2 << (3 || 3), (2 << 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 << 3 or 3 AS `2 << 3 || 3`,2 << (3 or 3) AS `2 << (3 || 3)`,2 << 3 or 3 AS `(2 << 3) || 3` +select 2 << 3 || 3, 2 << (3 || 3), (2 << 3) || 3 union select * from v1; +2 << 3 || 3 2 << (3 || 3) (2 << 3) || 3 +1 4 1 +create or replace view v1 as select 2 << 3 XOR 3, 2 << (3 XOR 3), (2 << 3) XOR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 << 3 xor 3 AS `2 << 3 XOR 3`,2 << (3 xor 3) AS `2 << (3 XOR 3)`,2 << 3 xor 3 AS `(2 << 3) XOR 3` +select 2 << 3 XOR 3, 2 << (3 XOR 3), (2 << 3) XOR 3 union select * from v1; +2 << 3 XOR 3 2 << (3 XOR 3) (2 << 3) XOR 3 +0 2 0 +create or replace view v1 as select 2 << 3 AND 3, 2 << (3 AND 3), (2 << 3) AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 << 3 and 3 AS `2 << 3 AND 3`,2 << (3 and 3) AS `2 << (3 AND 3)`,2 << 3 and 3 AS `(2 << 3) AND 3` +select 2 << 3 AND 3, 2 << (3 AND 3), (2 << 3) AND 3 union select * from v1; +2 << 3 AND 3 2 << (3 AND 3) (2 << 3) AND 3 +1 4 1 +create or replace view v1 as select 2 << 3 && 3, 2 << (3 && 3), (2 << 3) && 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 << 3 and 3 AS `2 << 3 && 3`,2 << (3 and 3) AS `2 << (3 && 3)`,2 << 3 and 3 AS `(2 << 3) && 3` +select 2 << 3 && 3, 2 << (3 && 3), (2 << 3) && 3 union select * from v1; +2 << 3 && 3 2 << (3 && 3) (2 << 3) && 3 +1 4 1 +create or replace view v1 as select 2 << 3 = 3, 2 << (3 = 3), (2 << 3) = 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 << 3 = 3 AS `2 << 3 = 3`,2 << (3 = 3) AS `2 << (3 = 3)`,2 << 3 = 3 AS `(2 << 3) = 3` +select 2 << 3 = 3, 2 << (3 = 3), (2 << 3) = 3 union select * from v1; +2 << 3 = 3 2 << (3 = 3) (2 << 3) = 3 +0 4 0 +create or replace view v1 as select 2 << 3 <=> 3, 2 << (3 <=> 3), (2 << 3) <=> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 << 3 <=> 3 AS `2 << 3 <=> 3`,2 << (3 <=> 3) AS `2 << (3 <=> 3)`,2 << 3 <=> 3 AS `(2 << 3) <=> 3` +select 2 << 3 <=> 3, 2 << (3 <=> 3), (2 << 3) <=> 3 union select * from v1; +2 << 3 <=> 3 2 << (3 <=> 3) (2 << 3) <=> 3 +0 4 0 +create or replace view v1 as select 2 << 3 >= 3, 2 << (3 >= 3), (2 << 3) >= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 << 3 >= 3 AS `2 << 3 >= 3`,2 << (3 >= 3) AS `2 << (3 >= 3)`,2 << 3 >= 3 AS `(2 << 3) >= 3` +select 2 << 3 >= 3, 2 << (3 >= 3), (2 << 3) >= 3 union select * from v1; +2 << 3 >= 3 2 << (3 >= 3) (2 << 3) >= 3 +1 4 1 +create or replace view v1 as select 2 << 3 <= 3, 2 << (3 <= 3), (2 << 3) <= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 << 3 <= 3 AS `2 << 3 <= 3`,2 << (3 <= 3) AS `2 << (3 <= 3)`,2 << 3 <= 3 AS `(2 << 3) <= 3` +select 2 << 3 <= 3, 2 << (3 <= 3), (2 << 3) <= 3 union select * from v1; +2 << 3 <= 3 2 << (3 <= 3) (2 << 3) <= 3 +0 4 0 +create or replace view v1 as select 2 << 3 < 3, 2 << (3 < 3), (2 << 3) < 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 << 3 < 3 AS `2 << 3 < 3`,2 << (3 < 3) AS `2 << (3 < 3)`,2 << 3 < 3 AS `(2 << 3) < 3` +select 2 << 3 < 3, 2 << (3 < 3), (2 << 3) < 3 union select * from v1; +2 << 3 < 3 2 << (3 < 3) (2 << 3) < 3 +0 2 0 +create or replace view v1 as select 2 << 3 <> 3, 2 << (3 <> 3), (2 << 3) <> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 << 3 <> 3 AS `2 << 3 <> 3`,2 << (3 <> 3) AS `2 << (3 <> 3)`,2 << 3 <> 3 AS `(2 << 3) <> 3` +select 2 << 3 <> 3, 2 << (3 <> 3), (2 << 3) <> 3 union select * from v1; +2 << 3 <> 3 2 << (3 <> 3) (2 << 3) <> 3 +1 2 1 +create or replace view v1 as select 2 << 3 > 3, 2 << (3 > 3), (2 << 3) > 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 << 3 > 3 AS `2 << 3 > 3`,2 << (3 > 3) AS `2 << (3 > 3)`,2 << 3 > 3 AS `(2 << 3) > 3` +select 2 << 3 > 3, 2 << (3 > 3), (2 << 3) > 3 union select * from v1; +2 << 3 > 3 2 << (3 > 3) (2 << 3) > 3 +1 2 1 +create or replace view v1 as select 2 << 3 != 3, 2 << (3 != 3), (2 << 3) != 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 << 3 <> 3 AS `2 << 3 != 3`,2 << (3 <> 3) AS `2 << (3 != 3)`,2 << 3 <> 3 AS `(2 << 3) != 3` +select 2 << 3 != 3, 2 << (3 != 3), (2 << 3) != 3 union select * from v1; +2 << 3 != 3 2 << (3 != 3) (2 << 3) != 3 +1 2 1 +create or replace view v1 as select 2 << 3 LIKE 3, 2 << (3 LIKE 3), (2 << 3) LIKE 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 << 3 like 3 AS `2 << 3 LIKE 3`,2 << (3 like 3) AS `2 << (3 LIKE 3)`,2 << 3 like 3 AS `(2 << 3) LIKE 3` +select 2 << 3 LIKE 3, 2 << (3 LIKE 3), (2 << 3) LIKE 3 union select * from v1; +2 << 3 LIKE 3 2 << (3 LIKE 3) (2 << 3) LIKE 3 +0 4 0 +create or replace view v1 as select 2 << 3 REGEXP 3, 2 << (3 REGEXP 3), (2 << 3) REGEXP 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 << 3 regexp 3 AS `2 << 3 REGEXP 3`,2 << (3 regexp 3) AS `2 << (3 REGEXP 3)`,2 << 3 regexp 3 AS `(2 << 3) REGEXP 3` +select 2 << 3 REGEXP 3, 2 << (3 REGEXP 3), (2 << 3) REGEXP 3 union select * from v1; +2 << 3 REGEXP 3 2 << (3 REGEXP 3) (2 << 3) REGEXP 3 +0 4 0 +create or replace view v1 as select 2 << 3 | 3, 2 << (3 | 3), (2 << 3) | 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 << 3 | 3 AS `2 << 3 | 3`,2 << (3 | 3) AS `2 << (3 | 3)`,2 << 3 | 3 AS `(2 << 3) | 3` +select 2 << 3 | 3, 2 << (3 | 3), (2 << 3) | 3 union select * from v1; +2 << 3 | 3 2 << (3 | 3) (2 << 3) | 3 +19 16 19 +create or replace view v1 as select 2 << 3 & 3, 2 << (3 & 3), (2 << 3) & 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 << 3 & 3 AS `2 << 3 & 3`,2 << (3 & 3) AS `2 << (3 & 3)`,2 << 3 & 3 AS `(2 << 3) & 3` +select 2 << 3 & 3, 2 << (3 & 3), (2 << 3) & 3 union select * from v1; +2 << 3 & 3 2 << (3 & 3) (2 << 3) & 3 +0 16 0 +create or replace view v1 as select 2 << 3 << 3, 2 << (3 << 3), (2 << 3) << 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 << 3 << 3 AS `2 << 3 << 3`,2 << (3 << 3) AS `2 << (3 << 3)`,2 << 3 << 3 AS `(2 << 3) << 3` +select 2 << 3 << 3, 2 << (3 << 3), (2 << 3) << 3 union select * from v1; +2 << 3 << 3 2 << (3 << 3) (2 << 3) << 3 +128 33554432 128 +create or replace view v1 as select 2 << 2 >> 3, 2 << (2 >> 3), (2 << 2) >> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 << 2 >> 3 AS `2 << 2 >> 3`,2 << (2 >> 3) AS `2 << (2 >> 3)`,2 << 2 >> 3 AS `(2 << 2) >> 3` +select 2 << 2 >> 3, 2 << (2 >> 3), (2 << 2) >> 3 union select * from v1; +2 << 2 >> 3 2 << (2 >> 3) (2 << 2) >> 3 +1 2 1 +create or replace view v1 as select 2 << '2000-01-01' +INTERVAL 1 DAY, 2 << ('2000-01-01' +INTERVAL 1 DAY), (2 << '2000-01-01') +INTERVAL 1 DAY; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 << '2000-01-01' + interval 1 day AS `2 << '2000-01-01' +INTERVAL 1 DAY`,2 << '2000-01-01' + interval 1 day AS `2 << ('2000-01-01' +INTERVAL 1 DAY)`,(2 << '2000-01-01') + interval 1 day AS `(2 << '2000-01-01') +INTERVAL 1 DAY` +select 2 << '2000-01-01' +INTERVAL 1 DAY, 2 << ('2000-01-01' +INTERVAL 1 DAY), (2 << '2000-01-01') +INTERVAL 1 DAY union select * from v1; +2 << '2000-01-01' +INTERVAL 1 DAY 2 << ('2000-01-01' +INTERVAL 1 DAY) (2 << '2000-01-01') +INTERVAL 1 DAY +0 0 NULL +create or replace view v1 as select 2 << 3 + 3, 2 << (3 + 3), (2 << 3) + 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 << 3 + 3 AS `2 << 3 + 3`,2 << 3 + 3 AS `2 << (3 + 3)`,(2 << 3) + 3 AS `(2 << 3) + 3` +select 2 << 3 + 3, 2 << (3 + 3), (2 << 3) + 3 union select * from v1; +2 << 3 + 3 2 << (3 + 3) (2 << 3) + 3 +128 128 19 +create or replace view v1 as select 2 << 3 - 3, 2 << (3 - 3), (2 << 3) - 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 << 3 - 3 AS `2 << 3 - 3`,2 << 3 - 3 AS `2 << (3 - 3)`,(2 << 3) - 3 AS `(2 << 3) - 3` +select 2 << 3 - 3, 2 << (3 - 3), (2 << 3) - 3 union select * from v1; +2 << 3 - 3 2 << (3 - 3) (2 << 3) - 3 +2 2 13 +create or replace view v1 as select 2 << 3 * 3, 2 << (3 * 3), (2 << 3) * 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 << 3 * 3 AS `2 << 3 * 3`,2 << 3 * 3 AS `2 << (3 * 3)`,(2 << 3) * 3 AS `(2 << 3) * 3` +select 2 << 3 * 3, 2 << (3 * 3), (2 << 3) * 3 union select * from v1; +2 << 3 * 3 2 << (3 * 3) (2 << 3) * 3 +1024 1024 48 +create or replace view v1 as select 2 << 3 / 3, 2 << (3 / 3), (2 << 3) / 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 << 3 / 3 AS `2 << 3 / 3`,2 << 3 / 3 AS `2 << (3 / 3)`,(2 << 3) / 3 AS `(2 << 3) / 3` +select 2 << 3 / 3, 2 << (3 / 3), (2 << 3) / 3 union select * from v1; +2 << 3 / 3 2 << (3 / 3) (2 << 3) / 3 +4 4 5.3333 +create or replace view v1 as select 2 << 3 DIV 3, 2 << (3 DIV 3), (2 << 3) DIV 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 << 3 DIV 3 AS `2 << 3 DIV 3`,2 << 3 DIV 3 AS `2 << (3 DIV 3)`,(2 << 3) DIV 3 AS `(2 << 3) DIV 3` +select 2 << 3 DIV 3, 2 << (3 DIV 3), (2 << 3) DIV 3 union select * from v1; +2 << 3 DIV 3 2 << (3 DIV 3) (2 << 3) DIV 3 +4 4 5 +create or replace view v1 as select 2 << 3 MOD 3, 2 << (3 MOD 3), (2 << 3) MOD 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 << 3 MOD 3 AS `2 << 3 MOD 3`,2 << 3 MOD 3 AS `2 << (3 MOD 3)`,(2 << 3) MOD 3 AS `(2 << 3) MOD 3` +select 2 << 3 MOD 3, 2 << (3 MOD 3), (2 << 3) MOD 3 union select * from v1; +2 << 3 MOD 3 2 << (3 MOD 3) (2 << 3) MOD 3 +2 2 1 +create or replace view v1 as select 2 << 3 % 3, 2 << (3 % 3), (2 << 3) % 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 << 3 MOD 3 AS `2 << 3 % 3`,2 << 3 MOD 3 AS `2 << (3 % 3)`,(2 << 3) MOD 3 AS `(2 << 3) % 3` +select 2 << 3 % 3, 2 << (3 % 3), (2 << 3) % 3 union select * from v1; +2 << 3 % 3 2 << (3 % 3) (2 << 3) % 3 +2 2 1 +create or replace view v1 as select 2 << 3 ^ 3, 2 << (3 ^ 3), (2 << 3) ^ 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 << 3 ^ 3 AS `2 << 3 ^ 3`,2 << 3 ^ 3 AS `2 << (3 ^ 3)`,(2 << 3) ^ 3 AS `(2 << 3) ^ 3` +select 2 << 3 ^ 3, 2 << (3 ^ 3), (2 << 3) ^ 3 union select * from v1; +2 << 3 ^ 3 2 << (3 ^ 3) (2 << 3) ^ 3 +2 2 19 +create or replace view v1 as select 2 << 3 BETWEEN 1 AND 3, 2 << (3 BETWEEN 1 AND 3), (2 << 3) BETWEEN 1 AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 << 3 between 1 and 3 AS `2 << 3 BETWEEN 1 AND 3`,2 << (3 between 1 and 3) AS `2 << (3 BETWEEN 1 AND 3)`,2 << 3 between 1 and 3 AS `(2 << 3) BETWEEN 1 AND 3` +select 2 << 3 BETWEEN 1 AND 3, 2 << (3 BETWEEN 1 AND 3), (2 << 3) BETWEEN 1 AND 3 union select * from v1; +2 << 3 BETWEEN 1 AND 3 2 << (3 BETWEEN 1 AND 3) (2 << 3) BETWEEN 1 AND 3 +0 4 0 +create or replace view v1 as select 2 >> 3 IS FALSE, 2 >> (3 IS FALSE), (2 >> 3) IS FALSE; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 >> 3 is false AS `2 >> 3 IS FALSE`,2 >> (3 is false) AS `2 >> (3 IS FALSE)`,2 >> 3 is false AS `(2 >> 3) IS FALSE` +select 2 >> 3 IS FALSE, 2 >> (3 IS FALSE), (2 >> 3) IS FALSE union select * from v1; +2 >> 3 IS FALSE 2 >> (3 IS FALSE) (2 >> 3) IS FALSE +1 2 1 +create or replace view v1 as select charset(2 >> 3 COLLATE latin1_bin), charset(2 >> (3 COLLATE latin1_bin)), charset((2 >> 3) COLLATE latin1_bin); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select charset(2 >> 3 collate latin1_bin) AS `charset(2 >> 3 COLLATE latin1_bin)`,charset(2 >> 3 collate latin1_bin) AS `charset(2 >> (3 COLLATE latin1_bin))`,charset((2 >> 3) collate latin1_bin) AS `charset((2 >> 3) COLLATE latin1_bin)` +select charset(2 >> 3 COLLATE latin1_bin), charset(2 >> (3 COLLATE latin1_bin)), charset((2 >> 3) COLLATE latin1_bin) union select * from v1; +charset(2 >> 3 COLLATE latin1_bin) charset(2 >> (3 COLLATE latin1_bin)) charset((2 >> 3) COLLATE latin1_bin) +binary binary latin1 +create or replace view v1 as select 2 >> 3 IN (0,1), 2 >> (3 IN (0,1)), (2 >> 3) IN (0,1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 >> 3 in (0,1) AS `2 >> 3 IN (0,1)`,2 >> (3 in (0,1)) AS `2 >> (3 IN (0,1))`,2 >> 3 in (0,1) AS `(2 >> 3) IN (0,1)` +select 2 >> 3 IN (0,1), 2 >> (3 IN (0,1)), (2 >> 3) IN (0,1) union select * from v1; +2 >> 3 IN (0,1) 2 >> (3 IN (0,1)) (2 >> 3) IN (0,1) +1 2 1 +create or replace view v1 as select 2 >> 3 OR 0, 2 >> (3 OR 0), (2 >> 3) OR 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 >> 3 or 0 AS `2 >> 3 OR 0`,2 >> (3 or 0) AS `2 >> (3 OR 0)`,2 >> 3 or 0 AS `(2 >> 3) OR 0` +select 2 >> 3 OR 0, 2 >> (3 OR 0), (2 >> 3) OR 0 union select * from v1; +2 >> 3 OR 0 2 >> (3 OR 0) (2 >> 3) OR 0 +0 1 0 +create or replace view v1 as select 2 >> 3 || 0, 2 >> (3 || 0), (2 >> 3) || 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 >> 3 or 0 AS `2 >> 3 || 0`,2 >> (3 or 0) AS `2 >> (3 || 0)`,2 >> 3 or 0 AS `(2 >> 3) || 0` +select 2 >> 3 || 0, 2 >> (3 || 0), (2 >> 3) || 0 union select * from v1; +2 >> 3 || 0 2 >> (3 || 0) (2 >> 3) || 0 +0 1 0 +create or replace view v1 as select 2 >> 3 XOR 3, 2 >> (3 XOR 3), (2 >> 3) XOR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 >> 3 xor 3 AS `2 >> 3 XOR 3`,2 >> (3 xor 3) AS `2 >> (3 XOR 3)`,2 >> 3 xor 3 AS `(2 >> 3) XOR 3` +select 2 >> 3 XOR 3, 2 >> (3 XOR 3), (2 >> 3) XOR 3 union select * from v1; +2 >> 3 XOR 3 2 >> (3 XOR 3) (2 >> 3) XOR 3 +1 2 1 +create or replace view v1 as select 2 >> 3 AND 3, 2 >> (3 AND 3), (2 >> 3) AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 >> 3 and 3 AS `2 >> 3 AND 3`,2 >> (3 and 3) AS `2 >> (3 AND 3)`,2 >> 3 and 3 AS `(2 >> 3) AND 3` +select 2 >> 3 AND 3, 2 >> (3 AND 3), (2 >> 3) AND 3 union select * from v1; +2 >> 3 AND 3 2 >> (3 AND 3) (2 >> 3) AND 3 +0 1 0 +create or replace view v1 as select 2 >> 3 && 3, 2 >> (3 && 3), (2 >> 3) && 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 >> 3 and 3 AS `2 >> 3 && 3`,2 >> (3 and 3) AS `2 >> (3 && 3)`,2 >> 3 and 3 AS `(2 >> 3) && 3` +select 2 >> 3 && 3, 2 >> (3 && 3), (2 >> 3) && 3 union select * from v1; +2 >> 3 && 3 2 >> (3 && 3) (2 >> 3) && 3 +0 1 0 +create or replace view v1 as select 2 >> 3 = 3, 2 >> (3 = 3), (2 >> 3) = 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 >> 3 = 3 AS `2 >> 3 = 3`,2 >> (3 = 3) AS `2 >> (3 = 3)`,2 >> 3 = 3 AS `(2 >> 3) = 3` +select 2 >> 3 = 3, 2 >> (3 = 3), (2 >> 3) = 3 union select * from v1; +2 >> 3 = 3 2 >> (3 = 3) (2 >> 3) = 3 +0 1 0 +create or replace view v1 as select 2 >> 3 <=> 3, 2 >> (3 <=> 3), (2 >> 3) <=> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 >> 3 <=> 3 AS `2 >> 3 <=> 3`,2 >> (3 <=> 3) AS `2 >> (3 <=> 3)`,2 >> 3 <=> 3 AS `(2 >> 3) <=> 3` +select 2 >> 3 <=> 3, 2 >> (3 <=> 3), (2 >> 3) <=> 3 union select * from v1; +2 >> 3 <=> 3 2 >> (3 <=> 3) (2 >> 3) <=> 3 +0 1 0 +create or replace view v1 as select 2 >> 3 >= 3, 2 >> (3 >= 3), (2 >> 3) >= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 >> 3 >= 3 AS `2 >> 3 >= 3`,2 >> (3 >= 3) AS `2 >> (3 >= 3)`,2 >> 3 >= 3 AS `(2 >> 3) >= 3` +select 2 >> 3 >= 3, 2 >> (3 >= 3), (2 >> 3) >= 3 union select * from v1; +2 >> 3 >= 3 2 >> (3 >= 3) (2 >> 3) >= 3 +0 1 0 +create or replace view v1 as select 2 >> 3 <= 0, 2 >> (3 <= 0), (2 >> 3) <= 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 >> 3 <= 0 AS `2 >> 3 <= 0`,2 >> (3 <= 0) AS `2 >> (3 <= 0)`,2 >> 3 <= 0 AS `(2 >> 3) <= 0` +select 2 >> 3 <= 0, 2 >> (3 <= 0), (2 >> 3) <= 0 union select * from v1; +2 >> 3 <= 0 2 >> (3 <= 0) (2 >> 3) <= 0 +1 2 1 +create or replace view v1 as select 2 >> 3 < 3, 2 >> (3 < 3), (2 >> 3) < 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 >> 3 < 3 AS `2 >> 3 < 3`,2 >> (3 < 3) AS `2 >> (3 < 3)`,2 >> 3 < 3 AS `(2 >> 3) < 3` +select 2 >> 3 < 3, 2 >> (3 < 3), (2 >> 3) < 3 union select * from v1; +2 >> 3 < 3 2 >> (3 < 3) (2 >> 3) < 3 +1 2 1 +create or replace view v1 as select 2 >> 3 <> 3, 2 >> (3 <> 3), (2 >> 3) <> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 >> 3 <> 3 AS `2 >> 3 <> 3`,2 >> (3 <> 3) AS `2 >> (3 <> 3)`,2 >> 3 <> 3 AS `(2 >> 3) <> 3` +select 2 >> 3 <> 3, 2 >> (3 <> 3), (2 >> 3) <> 3 union select * from v1; +2 >> 3 <> 3 2 >> (3 <> 3) (2 >> 3) <> 3 +1 2 1 +create or replace view v1 as select 2 >> 3 > 3, 2 >> (3 > 3), (2 >> 3) > 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 >> 3 > 3 AS `2 >> 3 > 3`,2 >> (3 > 3) AS `2 >> (3 > 3)`,2 >> 3 > 3 AS `(2 >> 3) > 3` +select 2 >> 3 > 3, 2 >> (3 > 3), (2 >> 3) > 3 union select * from v1; +2 >> 3 > 3 2 >> (3 > 3) (2 >> 3) > 3 +0 2 0 +create or replace view v1 as select 2 >> 3 != 3, 2 >> (3 != 3), (2 >> 3) != 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 >> 3 <> 3 AS `2 >> 3 != 3`,2 >> (3 <> 3) AS `2 >> (3 != 3)`,2 >> 3 <> 3 AS `(2 >> 3) != 3` +select 2 >> 3 != 3, 2 >> (3 != 3), (2 >> 3) != 3 union select * from v1; +2 >> 3 != 3 2 >> (3 != 3) (2 >> 3) != 3 +1 2 1 +create or replace view v1 as select 2 >> 3 LIKE 3, 2 >> (3 LIKE 3), (2 >> 3) LIKE 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 >> 3 like 3 AS `2 >> 3 LIKE 3`,2 >> (3 like 3) AS `2 >> (3 LIKE 3)`,2 >> 3 like 3 AS `(2 >> 3) LIKE 3` +select 2 >> 3 LIKE 3, 2 >> (3 LIKE 3), (2 >> 3) LIKE 3 union select * from v1; +2 >> 3 LIKE 3 2 >> (3 LIKE 3) (2 >> 3) LIKE 3 +0 1 0 +create or replace view v1 as select 2 >> 3 REGEXP 3, 2 >> (3 REGEXP 3), (2 >> 3) REGEXP 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 >> 3 regexp 3 AS `2 >> 3 REGEXP 3`,2 >> (3 regexp 3) AS `2 >> (3 REGEXP 3)`,2 >> 3 regexp 3 AS `(2 >> 3) REGEXP 3` +select 2 >> 3 REGEXP 3, 2 >> (3 REGEXP 3), (2 >> 3) REGEXP 3 union select * from v1; +2 >> 3 REGEXP 3 2 >> (3 REGEXP 3) (2 >> 3) REGEXP 3 +0 1 0 +create or replace view v1 as select 2 >> 3 | 3, 2 >> (3 | 3), (2 >> 3) | 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 >> 3 | 3 AS `2 >> 3 | 3`,2 >> (3 | 3) AS `2 >> (3 | 3)`,2 >> 3 | 3 AS `(2 >> 3) | 3` +select 2 >> 3 | 3, 2 >> (3 | 3), (2 >> 3) | 3 union select * from v1; +2 >> 3 | 3 2 >> (3 | 3) (2 >> 3) | 3 +3 0 3 +create or replace view v1 as select 2 >> 3 & 1, 2 >> (3 & 1), (2 >> 3) & 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 >> 3 & 1 AS `2 >> 3 & 1`,2 >> (3 & 1) AS `2 >> (3 & 1)`,2 >> 3 & 1 AS `(2 >> 3) & 1` +select 2 >> 3 & 1, 2 >> (3 & 1), (2 >> 3) & 1 union select * from v1; +2 >> 3 & 1 2 >> (3 & 1) (2 >> 3) & 1 +0 1 0 +create or replace view v1 as select 2 >> 1 << 3, 2 >> (1 << 3), (2 >> 1) << 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 >> 1 << 3 AS `2 >> 1 << 3`,2 >> (1 << 3) AS `2 >> (1 << 3)`,2 >> 1 << 3 AS `(2 >> 1) << 3` +select 2 >> 1 << 3, 2 >> (1 << 3), (2 >> 1) << 3 union select * from v1; +2 >> 1 << 3 2 >> (1 << 3) (2 >> 1) << 3 +8 0 8 +create or replace view v1 as select 2 >> 3 >> 3, 2 >> (3 >> 3), (2 >> 3) >> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 >> 3 >> 3 AS `2 >> 3 >> 3`,2 >> (3 >> 3) AS `2 >> (3 >> 3)`,2 >> 3 >> 3 AS `(2 >> 3) >> 3` +select 2 >> 3 >> 3, 2 >> (3 >> 3), (2 >> 3) >> 3 union select * from v1; +2 >> 3 >> 3 2 >> (3 >> 3) (2 >> 3) >> 3 +0 2 0 +create or replace view v1 as select 2 >> '2000-01-01' +INTERVAL 1 DAY, 2 >> ('2000-01-01' +INTERVAL 1 DAY), (2 >> '2000-01-01') +INTERVAL 1 DAY; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 >> '2000-01-01' + interval 1 day AS `2 >> '2000-01-01' +INTERVAL 1 DAY`,2 >> '2000-01-01' + interval 1 day AS `2 >> ('2000-01-01' +INTERVAL 1 DAY)`,(2 >> '2000-01-01') + interval 1 day AS `(2 >> '2000-01-01') +INTERVAL 1 DAY` +select 2 >> '2000-01-01' +INTERVAL 1 DAY, 2 >> ('2000-01-01' +INTERVAL 1 DAY), (2 >> '2000-01-01') +INTERVAL 1 DAY union select * from v1; +2 >> '2000-01-01' +INTERVAL 1 DAY 2 >> ('2000-01-01' +INTERVAL 1 DAY) (2 >> '2000-01-01') +INTERVAL 1 DAY +0 0 NULL +create or replace view v1 as select 2 >> 3 + 3, 2 >> (3 + 3), (2 >> 3) + 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 >> 3 + 3 AS `2 >> 3 + 3`,2 >> 3 + 3 AS `2 >> (3 + 3)`,(2 >> 3) + 3 AS `(2 >> 3) + 3` +select 2 >> 3 + 3, 2 >> (3 + 3), (2 >> 3) + 3 union select * from v1; +2 >> 3 + 3 2 >> (3 + 3) (2 >> 3) + 3 +0 0 3 +create or replace view v1 as select 2 >> 1 - 1, 2 >> (1 - 1), (2 >> 1) - 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 >> 1 - 1 AS `2 >> 1 - 1`,2 >> 1 - 1 AS `2 >> (1 - 1)`,(2 >> 1) - 1 AS `(2 >> 1) - 1` +select 2 >> 1 - 1, 2 >> (1 - 1), (2 >> 1) - 1 union select * from v1; +2 >> 1 - 1 2 >> (1 - 1) (2 >> 1) - 1 +2 2 0 +create or replace view v1 as select 2 >> 1 * 3, 2 >> (1 * 3), (2 >> 1) * 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 >> 1 * 3 AS `2 >> 1 * 3`,2 >> 1 * 3 AS `2 >> (1 * 3)`,(2 >> 1) * 3 AS `(2 >> 1) * 3` +select 2 >> 1 * 3, 2 >> (1 * 3), (2 >> 1) * 3 union select * from v1; +2 >> 1 * 3 2 >> (1 * 3) (2 >> 1) * 3 +0 0 3 +create or replace view v1 as select 2 >> 3 / 3, 2 >> (3 / 3), (2 >> 3) / 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 >> 3 / 3 AS `2 >> 3 / 3`,2 >> 3 / 3 AS `2 >> (3 / 3)`,(2 >> 3) / 3 AS `(2 >> 3) / 3` +select 2 >> 3 / 3, 2 >> (3 / 3), (2 >> 3) / 3 union select * from v1; +2 >> 3 / 3 2 >> (3 / 3) (2 >> 3) / 3 +1 1 0.0000 +create or replace view v1 as select 2 >> 3 DIV 3, 2 >> (3 DIV 3), (2 >> 3) DIV 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 >> 3 DIV 3 AS `2 >> 3 DIV 3`,2 >> 3 DIV 3 AS `2 >> (3 DIV 3)`,(2 >> 3) DIV 3 AS `(2 >> 3) DIV 3` +select 2 >> 3 DIV 3, 2 >> (3 DIV 3), (2 >> 3) DIV 3 union select * from v1; +2 >> 3 DIV 3 2 >> (3 DIV 3) (2 >> 3) DIV 3 +1 1 0 +create or replace view v1 as select 2 >> 3 MOD 3, 2 >> (3 MOD 3), (2 >> 3) MOD 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 >> 3 MOD 3 AS `2 >> 3 MOD 3`,2 >> 3 MOD 3 AS `2 >> (3 MOD 3)`,(2 >> 3) MOD 3 AS `(2 >> 3) MOD 3` +select 2 >> 3 MOD 3, 2 >> (3 MOD 3), (2 >> 3) MOD 3 union select * from v1; +2 >> 3 MOD 3 2 >> (3 MOD 3) (2 >> 3) MOD 3 +2 2 0 +create or replace view v1 as select 2 >> 3 % 3, 2 >> (3 % 3), (2 >> 3) % 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 >> 3 MOD 3 AS `2 >> 3 % 3`,2 >> 3 MOD 3 AS `2 >> (3 % 3)`,(2 >> 3) MOD 3 AS `(2 >> 3) % 3` +select 2 >> 3 % 3, 2 >> (3 % 3), (2 >> 3) % 3 union select * from v1; +2 >> 3 % 3 2 >> (3 % 3) (2 >> 3) % 3 +2 2 0 +create or replace view v1 as select 2 >> 3 ^ 3, 2 >> (3 ^ 3), (2 >> 3) ^ 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 >> 3 ^ 3 AS `2 >> 3 ^ 3`,2 >> 3 ^ 3 AS `2 >> (3 ^ 3)`,(2 >> 3) ^ 3 AS `(2 >> 3) ^ 3` +select 2 >> 3 ^ 3, 2 >> (3 ^ 3), (2 >> 3) ^ 3 union select * from v1; +2 >> 3 ^ 3 2 >> (3 ^ 3) (2 >> 3) ^ 3 +2 2 3 +create or replace view v1 as select 2 >> 3 BETWEEN 1 AND 3, 2 >> (3 BETWEEN 1 AND 3), (2 >> 3) BETWEEN 1 AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 >> 3 between 1 and 3 AS `2 >> 3 BETWEEN 1 AND 3`,2 >> (3 between 1 and 3) AS `2 >> (3 BETWEEN 1 AND 3)`,2 >> 3 between 1 and 3 AS `(2 >> 3) BETWEEN 1 AND 3` +select 2 >> 3 BETWEEN 1 AND 3, 2 >> (3 BETWEEN 1 AND 3), (2 >> 3) BETWEEN 1 AND 3 union select * from v1; +2 >> 3 BETWEEN 1 AND 3 2 >> (3 BETWEEN 1 AND 3) (2 >> 3) BETWEEN 1 AND 3 +0 1 0 +create or replace view v1 as select 2 + 3 IS FALSE, 2 + (3 IS FALSE), (2 + 3) IS FALSE; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 + 3 is false AS `2 + 3 IS FALSE`,2 + (3 is false) AS `2 + (3 IS FALSE)`,2 + 3 is false AS `(2 + 3) IS FALSE` +select 2 + 3 IS FALSE, 2 + (3 IS FALSE), (2 + 3) IS FALSE union select * from v1; +2 + 3 IS FALSE 2 + (3 IS FALSE) (2 + 3) IS FALSE +0 2 0 +create or replace view v1 as select charset(2 + 3 COLLATE latin1_bin), charset(2 + (3 COLLATE latin1_bin)), charset((2 + 3) COLLATE latin1_bin); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select charset(2 + 3 collate latin1_bin) AS `charset(2 + 3 COLLATE latin1_bin)`,charset(2 + 3 collate latin1_bin) AS `charset(2 + (3 COLLATE latin1_bin))`,charset((2 + 3) collate latin1_bin) AS `charset((2 + 3) COLLATE latin1_bin)` +select charset(2 + 3 COLLATE latin1_bin), charset(2 + (3 COLLATE latin1_bin)), charset((2 + 3) COLLATE latin1_bin) union select * from v1; +charset(2 + 3 COLLATE latin1_bin) charset(2 + (3 COLLATE latin1_bin)) charset((2 + 3) COLLATE latin1_bin) +binary binary latin1 +create or replace view v1 as select 2 + 3 IN (0,1), 2 + (3 IN (0,1)), (2 + 3) IN (0,1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 + 3 in (0,1) AS `2 + 3 IN (0,1)`,2 + (3 in (0,1)) AS `2 + (3 IN (0,1))`,2 + 3 in (0,1) AS `(2 + 3) IN (0,1)` +select 2 + 3 IN (0,1), 2 + (3 IN (0,1)), (2 + 3) IN (0,1) union select * from v1; +2 + 3 IN (0,1) 2 + (3 IN (0,1)) (2 + 3) IN (0,1) +0 2 0 +create or replace view v1 as select 2 + 3 OR 3, 2 + (3 OR 3), (2 + 3) OR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 + 3 or 3 AS `2 + 3 OR 3`,2 + (3 or 3) AS `2 + (3 OR 3)`,2 + 3 or 3 AS `(2 + 3) OR 3` +select 2 + 3 OR 3, 2 + (3 OR 3), (2 + 3) OR 3 union select * from v1; +2 + 3 OR 3 2 + (3 OR 3) (2 + 3) OR 3 +1 3 1 +create or replace view v1 as select 2 + 3 || 3, 2 + (3 || 3), (2 + 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 + 3 or 3 AS `2 + 3 || 3`,2 + (3 or 3) AS `2 + (3 || 3)`,2 + 3 or 3 AS `(2 + 3) || 3` +select 2 + 3 || 3, 2 + (3 || 3), (2 + 3) || 3 union select * from v1; +2 + 3 || 3 2 + (3 || 3) (2 + 3) || 3 +1 3 1 +create or replace view v1 as select 2 + 3 XOR 3, 2 + (3 XOR 3), (2 + 3) XOR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 + 3 xor 3 AS `2 + 3 XOR 3`,2 + (3 xor 3) AS `2 + (3 XOR 3)`,2 + 3 xor 3 AS `(2 + 3) XOR 3` +select 2 + 3 XOR 3, 2 + (3 XOR 3), (2 + 3) XOR 3 union select * from v1; +2 + 3 XOR 3 2 + (3 XOR 3) (2 + 3) XOR 3 +0 2 0 +create or replace view v1 as select 2 + 3 AND 3, 2 + (3 AND 3), (2 + 3) AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 + 3 and 3 AS `2 + 3 AND 3`,2 + (3 and 3) AS `2 + (3 AND 3)`,2 + 3 and 3 AS `(2 + 3) AND 3` +select 2 + 3 AND 3, 2 + (3 AND 3), (2 + 3) AND 3 union select * from v1; +2 + 3 AND 3 2 + (3 AND 3) (2 + 3) AND 3 +1 3 1 +create or replace view v1 as select 2 + 3 && 3, 2 + (3 && 3), (2 + 3) && 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 + 3 and 3 AS `2 + 3 && 3`,2 + (3 and 3) AS `2 + (3 && 3)`,2 + 3 and 3 AS `(2 + 3) && 3` +select 2 + 3 && 3, 2 + (3 && 3), (2 + 3) && 3 union select * from v1; +2 + 3 && 3 2 + (3 && 3) (2 + 3) && 3 +1 3 1 +create or replace view v1 as select 2 + 3 = 3, 2 + (3 = 3), (2 + 3) = 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 + 3 = 3 AS `2 + 3 = 3`,2 + (3 = 3) AS `2 + (3 = 3)`,2 + 3 = 3 AS `(2 + 3) = 3` +select 2 + 3 = 3, 2 + (3 = 3), (2 + 3) = 3 union select * from v1; +2 + 3 = 3 2 + (3 = 3) (2 + 3) = 3 +0 3 0 +create or replace view v1 as select 2 + 3 <=> 3, 2 + (3 <=> 3), (2 + 3) <=> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 + 3 <=> 3 AS `2 + 3 <=> 3`,2 + (3 <=> 3) AS `2 + (3 <=> 3)`,2 + 3 <=> 3 AS `(2 + 3) <=> 3` +select 2 + 3 <=> 3, 2 + (3 <=> 3), (2 + 3) <=> 3 union select * from v1; +2 + 3 <=> 3 2 + (3 <=> 3) (2 + 3) <=> 3 +0 3 0 +create or replace view v1 as select 2 + 3 >= 3, 2 + (3 >= 3), (2 + 3) >= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 + 3 >= 3 AS `2 + 3 >= 3`,2 + (3 >= 3) AS `2 + (3 >= 3)`,2 + 3 >= 3 AS `(2 + 3) >= 3` +select 2 + 3 >= 3, 2 + (3 >= 3), (2 + 3) >= 3 union select * from v1; +2 + 3 >= 3 2 + (3 >= 3) (2 + 3) >= 3 +1 3 1 +create or replace view v1 as select 2 + 3 <= 3, 2 + (3 <= 3), (2 + 3) <= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 + 3 <= 3 AS `2 + 3 <= 3`,2 + (3 <= 3) AS `2 + (3 <= 3)`,2 + 3 <= 3 AS `(2 + 3) <= 3` +select 2 + 3 <= 3, 2 + (3 <= 3), (2 + 3) <= 3 union select * from v1; +2 + 3 <= 3 2 + (3 <= 3) (2 + 3) <= 3 +0 3 0 +create or replace view v1 as select 2 + 3 < 3, 2 + (3 < 3), (2 + 3) < 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 + 3 < 3 AS `2 + 3 < 3`,2 + (3 < 3) AS `2 + (3 < 3)`,2 + 3 < 3 AS `(2 + 3) < 3` +select 2 + 3 < 3, 2 + (3 < 3), (2 + 3) < 3 union select * from v1; +2 + 3 < 3 2 + (3 < 3) (2 + 3) < 3 +0 2 0 +create or replace view v1 as select 2 + 3 <> 3, 2 + (3 <> 3), (2 + 3) <> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 + 3 <> 3 AS `2 + 3 <> 3`,2 + (3 <> 3) AS `2 + (3 <> 3)`,2 + 3 <> 3 AS `(2 + 3) <> 3` +select 2 + 3 <> 3, 2 + (3 <> 3), (2 + 3) <> 3 union select * from v1; +2 + 3 <> 3 2 + (3 <> 3) (2 + 3) <> 3 +1 2 1 +create or replace view v1 as select 2 + 3 > 3, 2 + (3 > 3), (2 + 3) > 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 + 3 > 3 AS `2 + 3 > 3`,2 + (3 > 3) AS `2 + (3 > 3)`,2 + 3 > 3 AS `(2 + 3) > 3` +select 2 + 3 > 3, 2 + (3 > 3), (2 + 3) > 3 union select * from v1; +2 + 3 > 3 2 + (3 > 3) (2 + 3) > 3 +1 2 1 +create or replace view v1 as select 2 + 3 != 3, 2 + (3 != 3), (2 + 3) != 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 + 3 <> 3 AS `2 + 3 != 3`,2 + (3 <> 3) AS `2 + (3 != 3)`,2 + 3 <> 3 AS `(2 + 3) != 3` +select 2 + 3 != 3, 2 + (3 != 3), (2 + 3) != 3 union select * from v1; +2 + 3 != 3 2 + (3 != 3) (2 + 3) != 3 +1 2 1 +create or replace view v1 as select 2 + 3 LIKE 3, 2 + (3 LIKE 3), (2 + 3) LIKE 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 + 3 like 3 AS `2 + 3 LIKE 3`,2 + (3 like 3) AS `2 + (3 LIKE 3)`,2 + 3 like 3 AS `(2 + 3) LIKE 3` +select 2 + 3 LIKE 3, 2 + (3 LIKE 3), (2 + 3) LIKE 3 union select * from v1; +2 + 3 LIKE 3 2 + (3 LIKE 3) (2 + 3) LIKE 3 +0 3 0 +create or replace view v1 as select 2 + 3 REGEXP 3, 2 + (3 REGEXP 3), (2 + 3) REGEXP 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 + 3 regexp 3 AS `2 + 3 REGEXP 3`,2 + (3 regexp 3) AS `2 + (3 REGEXP 3)`,2 + 3 regexp 3 AS `(2 + 3) REGEXP 3` +select 2 + 3 REGEXP 3, 2 + (3 REGEXP 3), (2 + 3) REGEXP 3 union select * from v1; +2 + 3 REGEXP 3 2 + (3 REGEXP 3) (2 + 3) REGEXP 3 +0 3 0 +create or replace view v1 as select 2 + 3 | 3, 2 + (3 | 3), (2 + 3) | 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 + 3 | 3 AS `2 + 3 | 3`,2 + (3 | 3) AS `2 + (3 | 3)`,2 + 3 | 3 AS `(2 + 3) | 3` +select 2 + 3 | 3, 2 + (3 | 3), (2 + 3) | 3 union select * from v1; +2 + 3 | 3 2 + (3 | 3) (2 + 3) | 3 +7 5 7 +create or replace view v1 as select 2 + 3 & 3, 2 + (3 & 3), (2 + 3) & 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 + 3 & 3 AS `2 + 3 & 3`,2 + (3 & 3) AS `2 + (3 & 3)`,2 + 3 & 3 AS `(2 + 3) & 3` +select 2 + 3 & 3, 2 + (3 & 3), (2 + 3) & 3 union select * from v1; +2 + 3 & 3 2 + (3 & 3) (2 + 3) & 3 +1 5 1 +create or replace view v1 as select 2 + 3 << 3, 2 + (3 << 3), (2 + 3) << 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 + 3 << 3 AS `2 + 3 << 3`,2 + (3 << 3) AS `2 + (3 << 3)`,2 + 3 << 3 AS `(2 + 3) << 3` +select 2 + 3 << 3, 2 + (3 << 3), (2 + 3) << 3 union select * from v1; +2 + 3 << 3 2 + (3 << 3) (2 + 3) << 3 +40 26 40 +create or replace view v1 as select 2 + 3 >> 3, 2 + (3 >> 3), (2 + 3) >> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 + 3 >> 3 AS `2 + 3 >> 3`,2 + (3 >> 3) AS `2 + (3 >> 3)`,2 + 3 >> 3 AS `(2 + 3) >> 3` +select 2 + 3 >> 3, 2 + (3 >> 3), (2 + 3) >> 3 union select * from v1; +2 + 3 >> 3 2 + (3 >> 3) (2 + 3) >> 3 +0 2 0 +create or replace view v1 as select 2 + '2000-01-01' +INTERVAL 1 DAY, 2 + ('2000-01-01' +INTERVAL 1 DAY), (2 + '2000-01-01') +INTERVAL 1 DAY; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 + '2000-01-01' + interval 1 day AS `2 + '2000-01-01' +INTERVAL 1 DAY`,2 + ('2000-01-01' + interval 1 day) AS `2 + ('2000-01-01' +INTERVAL 1 DAY)`,2 + '2000-01-01' + interval 1 day AS `(2 + '2000-01-01') +INTERVAL 1 DAY` +select 2 + '2000-01-01' +INTERVAL 1 DAY, 2 + ('2000-01-01' +INTERVAL 1 DAY), (2 + '2000-01-01') +INTERVAL 1 DAY union select * from v1; +2 + '2000-01-01' +INTERVAL 1 DAY 2 + ('2000-01-01' +INTERVAL 1 DAY) (2 + '2000-01-01') +INTERVAL 1 DAY +NULL 20000104 NULL +create or replace view v1 as select 2 + 3 * 3, 2 + (3 * 3), (2 + 3) * 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 + 3 * 3 AS `2 + 3 * 3`,2 + 3 * 3 AS `2 + (3 * 3)`,(2 + 3) * 3 AS `(2 + 3) * 3` +select 2 + 3 * 3, 2 + (3 * 3), (2 + 3) * 3 union select * from v1; +2 + 3 * 3 2 + (3 * 3) (2 + 3) * 3 +11 11 15 +create or replace view v1 as select 2 + 3 / 3, 2 + (3 / 3), (2 + 3) / 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 + 3 / 3 AS `2 + 3 / 3`,2 + 3 / 3 AS `2 + (3 / 3)`,(2 + 3) / 3 AS `(2 + 3) / 3` +select 2 + 3 / 3, 2 + (3 / 3), (2 + 3) / 3 union select * from v1; +2 + 3 / 3 2 + (3 / 3) (2 + 3) / 3 +3.0000 3.0000 1.6667 +create or replace view v1 as select 2 + 3 DIV 3, 2 + (3 DIV 3), (2 + 3) DIV 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 + 3 DIV 3 AS `2 + 3 DIV 3`,2 + 3 DIV 3 AS `2 + (3 DIV 3)`,(2 + 3) DIV 3 AS `(2 + 3) DIV 3` +select 2 + 3 DIV 3, 2 + (3 DIV 3), (2 + 3) DIV 3 union select * from v1; +2 + 3 DIV 3 2 + (3 DIV 3) (2 + 3) DIV 3 +3 3 1 +create or replace view v1 as select 2 + 1 MOD 3, 2 + (1 MOD 3), (2 + 1) MOD 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 + 1 MOD 3 AS `2 + 1 MOD 3`,2 + 1 MOD 3 AS `2 + (1 MOD 3)`,(2 + 1) MOD 3 AS `(2 + 1) MOD 3` +select 2 + 1 MOD 3, 2 + (1 MOD 3), (2 + 1) MOD 3 union select * from v1; +2 + 1 MOD 3 2 + (1 MOD 3) (2 + 1) MOD 3 +3 3 0 +create or replace view v1 as select 2 + 1 % 3, 2 + (1 % 3), (2 + 1) % 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 + 1 MOD 3 AS `2 + 1 % 3`,2 + 1 MOD 3 AS `2 + (1 % 3)`,(2 + 1) MOD 3 AS `(2 + 1) % 3` +select 2 + 1 % 3, 2 + (1 % 3), (2 + 1) % 3 union select * from v1; +2 + 1 % 3 2 + (1 % 3) (2 + 1) % 3 +3 3 0 +create or replace view v1 as select 2 + 3 ^ 3, 2 + (3 ^ 3), (2 + 3) ^ 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 + 3 ^ 3 AS `2 + 3 ^ 3`,2 + 3 ^ 3 AS `2 + (3 ^ 3)`,(2 + 3) ^ 3 AS `(2 + 3) ^ 3` +select 2 + 3 ^ 3, 2 + (3 ^ 3), (2 + 3) ^ 3 union select * from v1; +2 + 3 ^ 3 2 + (3 ^ 3) (2 + 3) ^ 3 +2 2 6 +create or replace view v1 as select 2 + 3 BETWEEN 1 AND 3, 2 + (3 BETWEEN 1 AND 3), (2 + 3) BETWEEN 1 AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 + 3 between 1 and 3 AS `2 + 3 BETWEEN 1 AND 3`,2 + (3 between 1 and 3) AS `2 + (3 BETWEEN 1 AND 3)`,2 + 3 between 1 and 3 AS `(2 + 3) BETWEEN 1 AND 3` +select 2 + 3 BETWEEN 1 AND 3, 2 + (3 BETWEEN 1 AND 3), (2 + 3) BETWEEN 1 AND 3 union select * from v1; +2 + 3 BETWEEN 1 AND 3 2 + (3 BETWEEN 1 AND 3) (2 + 3) BETWEEN 1 AND 3 +0 3 0 +create or replace view v1 as select 2 - 3 IS FALSE, 2 - (3 IS FALSE), (2 - 3) IS FALSE; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 - 3 is false AS `2 - 3 IS FALSE`,2 - (3 is false) AS `2 - (3 IS FALSE)`,2 - 3 is false AS `(2 - 3) IS FALSE` +select 2 - 3 IS FALSE, 2 - (3 IS FALSE), (2 - 3) IS FALSE union select * from v1; +2 - 3 IS FALSE 2 - (3 IS FALSE) (2 - 3) IS FALSE +0 2 0 +create or replace view v1 as select charset(2 - 3 COLLATE latin1_bin), charset(2 - (3 COLLATE latin1_bin)), charset((2 - 3) COLLATE latin1_bin); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select charset(2 - 3 collate latin1_bin) AS `charset(2 - 3 COLLATE latin1_bin)`,charset(2 - 3 collate latin1_bin) AS `charset(2 - (3 COLLATE latin1_bin))`,charset((2 - 3) collate latin1_bin) AS `charset((2 - 3) COLLATE latin1_bin)` +select charset(2 - 3 COLLATE latin1_bin), charset(2 - (3 COLLATE latin1_bin)), charset((2 - 3) COLLATE latin1_bin) union select * from v1; +charset(2 - 3 COLLATE latin1_bin) charset(2 - (3 COLLATE latin1_bin)) charset((2 - 3) COLLATE latin1_bin) +binary binary latin1 +create or replace view v1 as select 2 - 3 IN (0,1), 2 - (3 IN (0,1)), (2 - 3) IN (0,1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 - 3 in (0,1) AS `2 - 3 IN (0,1)`,2 - (3 in (0,1)) AS `2 - (3 IN (0,1))`,2 - 3 in (0,1) AS `(2 - 3) IN (0,1)` +select 2 - 3 IN (0,1), 2 - (3 IN (0,1)), (2 - 3) IN (0,1) union select * from v1; +2 - 3 IN (0,1) 2 - (3 IN (0,1)) (2 - 3) IN (0,1) +0 2 0 +create or replace view v1 as select 2 - 2 OR 0, 2 - (2 OR 0), (2 - 2) OR 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 - 2 or 0 AS `2 - 2 OR 0`,2 - (2 or 0) AS `2 - (2 OR 0)`,2 - 2 or 0 AS `(2 - 2) OR 0` +select 2 - 2 OR 0, 2 - (2 OR 0), (2 - 2) OR 0 union select * from v1; +2 - 2 OR 0 2 - (2 OR 0) (2 - 2) OR 0 +0 1 0 +create or replace view v1 as select 2 - 2 || 0, 2 - (2 || 0), (2 - 2) || 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 - 2 or 0 AS `2 - 2 || 0`,2 - (2 or 0) AS `2 - (2 || 0)`,2 - 2 or 0 AS `(2 - 2) || 0` +select 2 - 2 || 0, 2 - (2 || 0), (2 - 2) || 0 union select * from v1; +2 - 2 || 0 2 - (2 || 0) (2 - 2) || 0 +0 1 0 +create or replace view v1 as select 2 - 3 XOR 3, 2 - (3 XOR 3), (2 - 3) XOR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 - 3 xor 3 AS `2 - 3 XOR 3`,2 - (3 xor 3) AS `2 - (3 XOR 3)`,2 - 3 xor 3 AS `(2 - 3) XOR 3` +select 2 - 3 XOR 3, 2 - (3 XOR 3), (2 - 3) XOR 3 union select * from v1; +2 - 3 XOR 3 2 - (3 XOR 3) (2 - 3) XOR 3 +0 2 0 +create or replace view v1 as select 2 - 2 AND 2, 2 - (2 AND 2), (2 - 2) AND 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 - 2 and 2 AS `2 - 2 AND 2`,2 - (2 and 2) AS `2 - (2 AND 2)`,2 - 2 and 2 AS `(2 - 2) AND 2` +select 2 - 2 AND 2, 2 - (2 AND 2), (2 - 2) AND 2 union select * from v1; +2 - 2 AND 2 2 - (2 AND 2) (2 - 2) AND 2 +0 1 0 +create or replace view v1 as select 2 - 2 && 2, 2 - (2 && 2), (2 - 2) && 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 - 2 and 2 AS `2 - 2 && 2`,2 - (2 and 2) AS `2 - (2 && 2)`,2 - 2 and 2 AS `(2 - 2) && 2` +select 2 - 2 && 2, 2 - (2 && 2), (2 - 2) && 2 union select * from v1; +2 - 2 && 2 2 - (2 && 2) (2 - 2) && 2 +0 1 0 +create or replace view v1 as select 2 - 3 = 3, 2 - (3 = 3), (2 - 3) = 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 - 3 = 3 AS `2 - 3 = 3`,2 - (3 = 3) AS `2 - (3 = 3)`,2 - 3 = 3 AS `(2 - 3) = 3` +select 2 - 3 = 3, 2 - (3 = 3), (2 - 3) = 3 union select * from v1; +2 - 3 = 3 2 - (3 = 3) (2 - 3) = 3 +0 1 0 +create or replace view v1 as select 2 - 3 <=> 3, 2 - (3 <=> 3), (2 - 3) <=> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 - 3 <=> 3 AS `2 - 3 <=> 3`,2 - (3 <=> 3) AS `2 - (3 <=> 3)`,2 - 3 <=> 3 AS `(2 - 3) <=> 3` +select 2 - 3 <=> 3, 2 - (3 <=> 3), (2 - 3) <=> 3 union select * from v1; +2 - 3 <=> 3 2 - (3 <=> 3) (2 - 3) <=> 3 +0 1 0 +create or replace view v1 as select 2 - 3 >= 3, 2 - (3 >= 3), (2 - 3) >= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 - 3 >= 3 AS `2 - 3 >= 3`,2 - (3 >= 3) AS `2 - (3 >= 3)`,2 - 3 >= 3 AS `(2 - 3) >= 3` +select 2 - 3 >= 3, 2 - (3 >= 3), (2 - 3) >= 3 union select * from v1; +2 - 3 >= 3 2 - (3 >= 3) (2 - 3) >= 3 +0 1 0 +create or replace view v1 as select 2 - 3 <= 2, 2 - (3 <= 2), (2 - 3) <= 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 - 3 <= 2 AS `2 - 3 <= 2`,2 - (3 <= 2) AS `2 - (3 <= 2)`,2 - 3 <= 2 AS `(2 - 3) <= 2` +select 2 - 3 <= 2, 2 - (3 <= 2), (2 - 3) <= 2 union select * from v1; +2 - 3 <= 2 2 - (3 <= 2) (2 - 3) <= 2 +1 2 1 +create or replace view v1 as select 2 - 3 < 3, 2 - (3 < 3), (2 - 3) < 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 - 3 < 3 AS `2 - 3 < 3`,2 - (3 < 3) AS `2 - (3 < 3)`,2 - 3 < 3 AS `(2 - 3) < 3` +select 2 - 3 < 3, 2 - (3 < 3), (2 - 3) < 3 union select * from v1; +2 - 3 < 3 2 - (3 < 3) (2 - 3) < 3 +1 2 1 +create or replace view v1 as select 2 - 3 <> 3, 2 - (3 <> 3), (2 - 3) <> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 - 3 <> 3 AS `2 - 3 <> 3`,2 - (3 <> 3) AS `2 - (3 <> 3)`,2 - 3 <> 3 AS `(2 - 3) <> 3` +select 2 - 3 <> 3, 2 - (3 <> 3), (2 - 3) <> 3 union select * from v1; +2 - 3 <> 3 2 - (3 <> 3) (2 - 3) <> 3 +1 2 1 +create or replace view v1 as select 2 - 3 > 3, 2 - (3 > 3), (2 - 3) > 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 - 3 > 3 AS `2 - 3 > 3`,2 - (3 > 3) AS `2 - (3 > 3)`,2 - 3 > 3 AS `(2 - 3) > 3` +select 2 - 3 > 3, 2 - (3 > 3), (2 - 3) > 3 union select * from v1; +2 - 3 > 3 2 - (3 > 3) (2 - 3) > 3 +0 2 0 +create or replace view v1 as select 2 - 3 != 3, 2 - (3 != 3), (2 - 3) != 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 - 3 <> 3 AS `2 - 3 != 3`,2 - (3 <> 3) AS `2 - (3 != 3)`,2 - 3 <> 3 AS `(2 - 3) != 3` +select 2 - 3 != 3, 2 - (3 != 3), (2 - 3) != 3 union select * from v1; +2 - 3 != 3 2 - (3 != 3) (2 - 3) != 3 +1 2 1 +create or replace view v1 as select 2 - 3 LIKE 3, 2 - (3 LIKE 3), (2 - 3) LIKE 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 - 3 like 3 AS `2 - 3 LIKE 3`,2 - (3 like 3) AS `2 - (3 LIKE 3)`,2 - 3 like 3 AS `(2 - 3) LIKE 3` +select 2 - 3 LIKE 3, 2 - (3 LIKE 3), (2 - 3) LIKE 3 union select * from v1; +2 - 3 LIKE 3 2 - (3 LIKE 3) (2 - 3) LIKE 3 +0 1 0 +create or replace view v1 as select 2 - 3 REGEXP 3, 2 - (3 REGEXP 3), (2 - 3) REGEXP 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 - 3 regexp 3 AS `2 - 3 REGEXP 3`,2 - (3 regexp 3) AS `2 - (3 REGEXP 3)`,2 - 3 regexp 3 AS `(2 - 3) REGEXP 3` +select 2 - 3 REGEXP 3, 2 - (3 REGEXP 3), (2 - 3) REGEXP 3 union select * from v1; +2 - 3 REGEXP 3 2 - (3 REGEXP 3) (2 - 3) REGEXP 3 +0 1 0 +create or replace view v1 as select 2 - 0 | 1, 2 - (0 | 1), (2 - 0) | 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 - 0 | 1 AS `2 - 0 | 1`,2 - (0 | 1) AS `2 - (0 | 1)`,2 - 0 | 1 AS `(2 - 0) | 1` +select 2 - 0 | 1, 2 - (0 | 1), (2 - 0) | 1 union select * from v1; +2 - 0 | 1 2 - (0 | 1) (2 - 0) | 1 +3 1 3 +create or replace view v1 as select 2 - 1 & 2, 2 - (1 & 2), (2 - 1) & 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 - 1 & 2 AS `2 - 1 & 2`,2 - (1 & 2) AS `2 - (1 & 2)`,2 - 1 & 2 AS `(2 - 1) & 2` +select 2 - 1 & 2, 2 - (1 & 2), (2 - 1) & 2 union select * from v1; +2 - 1 & 2 2 - (1 & 2) (2 - 1) & 2 +0 2 0 +create or replace view v1 as select 2 - 1 << 1, 2 - (1 << 1), (2 - 1) << 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 - 1 << 1 AS `2 - 1 << 1`,2 - (1 << 1) AS `2 - (1 << 1)`,2 - 1 << 1 AS `(2 - 1) << 1` +select 2 - 1 << 1, 2 - (1 << 1), (2 - 1) << 1 union select * from v1; +2 - 1 << 1 2 - (1 << 1) (2 - 1) << 1 +2 0 2 +create or replace view v1 as select 2 - 3 >> 3, 2 - (3 >> 3), (2 - 3) >> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 - 3 >> 3 AS `2 - 3 >> 3`,2 - (3 >> 3) AS `2 - (3 >> 3)`,2 - 3 >> 3 AS `(2 - 3) >> 3` +select 2 - 3 >> 3, 2 - (3 >> 3), (2 - 3) >> 3 union select * from v1; +2 - 3 >> 3 2 - (3 >> 3) (2 - 3) >> 3 +2305843009213693951 2 2305843009213693951 +create or replace view v1 as select 2 - '2000-01-01' +INTERVAL 1 DAY, 2 - ('2000-01-01' +INTERVAL 1 DAY), (2 - '2000-01-01') +INTERVAL 1 DAY; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 - '2000-01-01' + interval 1 day AS `2 - '2000-01-01' +INTERVAL 1 DAY`,2 - ('2000-01-01' + interval 1 day) AS `2 - ('2000-01-01' +INTERVAL 1 DAY)`,2 - '2000-01-01' + interval 1 day AS `(2 - '2000-01-01') +INTERVAL 1 DAY` +select 2 - '2000-01-01' +INTERVAL 1 DAY, 2 - ('2000-01-01' +INTERVAL 1 DAY), (2 - '2000-01-01') +INTERVAL 1 DAY union select * from v1; +2 - '2000-01-01' +INTERVAL 1 DAY 2 - ('2000-01-01' +INTERVAL 1 DAY) (2 - '2000-01-01') +INTERVAL 1 DAY +NULL -20000100 NULL +create or replace view v1 as select 2 - 3 + 3, 2 - (3 + 3), (2 - 3) + 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 - 3 + 3 AS `2 - 3 + 3`,2 - (3 + 3) AS `2 - (3 + 3)`,2 - 3 + 3 AS `(2 - 3) + 3` +select 2 - 3 + 3, 2 - (3 + 3), (2 - 3) + 3 union select * from v1; +2 - 3 + 3 2 - (3 + 3) (2 - 3) + 3 +2 -4 2 +create or replace view v1 as select 2 - 3 - 3, 2 - (3 - 3), (2 - 3) - 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 - 3 - 3 AS `2 - 3 - 3`,2 - (3 - 3) AS `2 - (3 - 3)`,2 - 3 - 3 AS `(2 - 3) - 3` +select 2 - 3 - 3, 2 - (3 - 3), (2 - 3) - 3 union select * from v1; +2 - 3 - 3 2 - (3 - 3) (2 - 3) - 3 +-4 2 -4 +create or replace view v1 as select 2 - 3 * 3, 2 - (3 * 3), (2 - 3) * 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 - 3 * 3 AS `2 - 3 * 3`,2 - 3 * 3 AS `2 - (3 * 3)`,(2 - 3) * 3 AS `(2 - 3) * 3` +select 2 - 3 * 3, 2 - (3 * 3), (2 - 3) * 3 union select * from v1; +2 - 3 * 3 2 - (3 * 3) (2 - 3) * 3 +-7 -7 -3 +create or replace view v1 as select 2 - 3 / 3, 2 - (3 / 3), (2 - 3) / 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 - 3 / 3 AS `2 - 3 / 3`,2 - 3 / 3 AS `2 - (3 / 3)`,(2 - 3) / 3 AS `(2 - 3) / 3` +select 2 - 3 / 3, 2 - (3 / 3), (2 - 3) / 3 union select * from v1; +2 - 3 / 3 2 - (3 / 3) (2 - 3) / 3 +1.0000 1.0000 -0.3333 +create or replace view v1 as select 2 - 3 DIV 3, 2 - (3 DIV 3), (2 - 3) DIV 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 - 3 DIV 3 AS `2 - 3 DIV 3`,2 - 3 DIV 3 AS `2 - (3 DIV 3)`,(2 - 3) DIV 3 AS `(2 - 3) DIV 3` +select 2 - 3 DIV 3, 2 - (3 DIV 3), (2 - 3) DIV 3 union select * from v1; +2 - 3 DIV 3 2 - (3 DIV 3) (2 - 3) DIV 3 +1 1 0 +create or replace view v1 as select 2 - 3 MOD 3, 2 - (3 MOD 3), (2 - 3) MOD 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 - 3 MOD 3 AS `2 - 3 MOD 3`,2 - 3 MOD 3 AS `2 - (3 MOD 3)`,(2 - 3) MOD 3 AS `(2 - 3) MOD 3` +select 2 - 3 MOD 3, 2 - (3 MOD 3), (2 - 3) MOD 3 union select * from v1; +2 - 3 MOD 3 2 - (3 MOD 3) (2 - 3) MOD 3 +2 2 -1 +create or replace view v1 as select 2 - 3 % 3, 2 - (3 % 3), (2 - 3) % 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 - 3 MOD 3 AS `2 - 3 % 3`,2 - 3 MOD 3 AS `2 - (3 % 3)`,(2 - 3) MOD 3 AS `(2 - 3) % 3` +select 2 - 3 % 3, 2 - (3 % 3), (2 - 3) % 3 union select * from v1; +2 - 3 % 3 2 - (3 % 3) (2 - 3) % 3 +2 2 -1 +create or replace view v1 as select 2 - 3 ^ 3, 2 - (3 ^ 3), (2 - 3) ^ 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 - 3 ^ 3 AS `2 - 3 ^ 3`,2 - 3 ^ 3 AS `2 - (3 ^ 3)`,(2 - 3) ^ 3 AS `(2 - 3) ^ 3` +select 2 - 3 ^ 3, 2 - (3 ^ 3), (2 - 3) ^ 3 union select * from v1; +2 - 3 ^ 3 2 - (3 ^ 3) (2 - 3) ^ 3 +2 2 18446744073709551612 +create or replace view v1 as select 2 - 3 BETWEEN 1 AND 3, 2 - (3 BETWEEN 1 AND 3), (2 - 3) BETWEEN 1 AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 - 3 between 1 and 3 AS `2 - 3 BETWEEN 1 AND 3`,2 - (3 between 1 and 3) AS `2 - (3 BETWEEN 1 AND 3)`,2 - 3 between 1 and 3 AS `(2 - 3) BETWEEN 1 AND 3` +select 2 - 3 BETWEEN 1 AND 3, 2 - (3 BETWEEN 1 AND 3), (2 - 3) BETWEEN 1 AND 3 union select * from v1; +2 - 3 BETWEEN 1 AND 3 2 - (3 BETWEEN 1 AND 3) (2 - 3) BETWEEN 1 AND 3 +0 1 0 +create or replace view v1 as select 2 * 0 IS FALSE, 2 * (0 IS FALSE), (2 * 0) IS FALSE; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 * 0 is false AS `2 * 0 IS FALSE`,2 * (0 is false) AS `2 * (0 IS FALSE)`,2 * 0 is false AS `(2 * 0) IS FALSE` +select 2 * 0 IS FALSE, 2 * (0 IS FALSE), (2 * 0) IS FALSE union select * from v1; +2 * 0 IS FALSE 2 * (0 IS FALSE) (2 * 0) IS FALSE +1 2 1 +create or replace view v1 as select charset(2 * 3 COLLATE latin1_bin), charset(2 * (3 COLLATE latin1_bin)), charset((2 * 3) COLLATE latin1_bin); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select charset(2 * 3 collate latin1_bin) AS `charset(2 * 3 COLLATE latin1_bin)`,charset(2 * 3 collate latin1_bin) AS `charset(2 * (3 COLLATE latin1_bin))`,charset((2 * 3) collate latin1_bin) AS `charset((2 * 3) COLLATE latin1_bin)` +select charset(2 * 3 COLLATE latin1_bin), charset(2 * (3 COLLATE latin1_bin)), charset((2 * 3) COLLATE latin1_bin) union select * from v1; +charset(2 * 3 COLLATE latin1_bin) charset(2 * (3 COLLATE latin1_bin)) charset((2 * 3) COLLATE latin1_bin) +binary binary latin1 +create or replace view v1 as select 2 * 0 IN (0,1), 2 * (0 IN (0,1)), (2 * 0) IN (0,1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 * 0 in (0,1) AS `2 * 0 IN (0,1)`,2 * (0 in (0,1)) AS `2 * (0 IN (0,1))`,2 * 0 in (0,1) AS `(2 * 0) IN (0,1)` +select 2 * 0 IN (0,1), 2 * (0 IN (0,1)), (2 * 0) IN (0,1) union select * from v1; +2 * 0 IN (0,1) 2 * (0 IN (0,1)) (2 * 0) IN (0,1) +1 2 1 +create or replace view v1 as select 2 * 3 OR 3, 2 * (3 OR 3), (2 * 3) OR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 * 3 or 3 AS `2 * 3 OR 3`,2 * (3 or 3) AS `2 * (3 OR 3)`,2 * 3 or 3 AS `(2 * 3) OR 3` +select 2 * 3 OR 3, 2 * (3 OR 3), (2 * 3) OR 3 union select * from v1; +2 * 3 OR 3 2 * (3 OR 3) (2 * 3) OR 3 +1 2 1 +create or replace view v1 as select 2 * 3 || 3, 2 * (3 || 3), (2 * 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 * 3 or 3 AS `2 * 3 || 3`,2 * (3 or 3) AS `2 * (3 || 3)`,2 * 3 or 3 AS `(2 * 3) || 3` +select 2 * 3 || 3, 2 * (3 || 3), (2 * 3) || 3 union select * from v1; +2 * 3 || 3 2 * (3 || 3) (2 * 3) || 3 +1 2 1 +create or replace view v1 as select 2 * 3 XOR 0, 2 * (3 XOR 0), (2 * 3) XOR 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 * 3 xor 0 AS `2 * 3 XOR 0`,2 * (3 xor 0) AS `2 * (3 XOR 0)`,2 * 3 xor 0 AS `(2 * 3) XOR 0` +select 2 * 3 XOR 0, 2 * (3 XOR 0), (2 * 3) XOR 0 union select * from v1; +2 * 3 XOR 0 2 * (3 XOR 0) (2 * 3) XOR 0 +1 2 1 +create or replace view v1 as select 2 * 3 AND 3, 2 * (3 AND 3), (2 * 3) AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 * 3 and 3 AS `2 * 3 AND 3`,2 * (3 and 3) AS `2 * (3 AND 3)`,2 * 3 and 3 AS `(2 * 3) AND 3` +select 2 * 3 AND 3, 2 * (3 AND 3), (2 * 3) AND 3 union select * from v1; +2 * 3 AND 3 2 * (3 AND 3) (2 * 3) AND 3 +1 2 1 +create or replace view v1 as select 2 * 3 && 3, 2 * (3 && 3), (2 * 3) && 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 * 3 and 3 AS `2 * 3 && 3`,2 * (3 and 3) AS `2 * (3 && 3)`,2 * 3 and 3 AS `(2 * 3) && 3` +select 2 * 3 && 3, 2 * (3 && 3), (2 * 3) && 3 union select * from v1; +2 * 3 && 3 2 * (3 && 3) (2 * 3) && 3 +1 2 1 +create or replace view v1 as select 2 * 3 = 3, 2 * (3 = 3), (2 * 3) = 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 * 3 = 3 AS `2 * 3 = 3`,2 * (3 = 3) AS `2 * (3 = 3)`,2 * 3 = 3 AS `(2 * 3) = 3` +select 2 * 3 = 3, 2 * (3 = 3), (2 * 3) = 3 union select * from v1; +2 * 3 = 3 2 * (3 = 3) (2 * 3) = 3 +0 2 0 +create or replace view v1 as select 2 * 3 <=> 3, 2 * (3 <=> 3), (2 * 3) <=> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 * 3 <=> 3 AS `2 * 3 <=> 3`,2 * (3 <=> 3) AS `2 * (3 <=> 3)`,2 * 3 <=> 3 AS `(2 * 3) <=> 3` +select 2 * 3 <=> 3, 2 * (3 <=> 3), (2 * 3) <=> 3 union select * from v1; +2 * 3 <=> 3 2 * (3 <=> 3) (2 * 3) <=> 3 +0 2 0 +create or replace view v1 as select 2 * 3 >= 3, 2 * (3 >= 3), (2 * 3) >= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 * 3 >= 3 AS `2 * 3 >= 3`,2 * (3 >= 3) AS `2 * (3 >= 3)`,2 * 3 >= 3 AS `(2 * 3) >= 3` +select 2 * 3 >= 3, 2 * (3 >= 3), (2 * 3) >= 3 union select * from v1; +2 * 3 >= 3 2 * (3 >= 3) (2 * 3) >= 3 +1 2 1 +create or replace view v1 as select 2 * 3 <= 3, 2 * (3 <= 3), (2 * 3) <= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 * 3 <= 3 AS `2 * 3 <= 3`,2 * (3 <= 3) AS `2 * (3 <= 3)`,2 * 3 <= 3 AS `(2 * 3) <= 3` +select 2 * 3 <= 3, 2 * (3 <= 3), (2 * 3) <= 3 union select * from v1; +2 * 3 <= 3 2 * (3 <= 3) (2 * 3) <= 3 +0 2 0 +create or replace view v1 as select 2 * 0 < 3, 2 * (0 < 3), (2 * 0) < 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 * 0 < 3 AS `2 * 0 < 3`,2 * (0 < 3) AS `2 * (0 < 3)`,2 * 0 < 3 AS `(2 * 0) < 3` +select 2 * 0 < 3, 2 * (0 < 3), (2 * 0) < 3 union select * from v1; +2 * 0 < 3 2 * (0 < 3) (2 * 0) < 3 +1 2 1 +create or replace view v1 as select 2 * 3 <> 3, 2 * (3 <> 3), (2 * 3) <> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 * 3 <> 3 AS `2 * 3 <> 3`,2 * (3 <> 3) AS `2 * (3 <> 3)`,2 * 3 <> 3 AS `(2 * 3) <> 3` +select 2 * 3 <> 3, 2 * (3 <> 3), (2 * 3) <> 3 union select * from v1; +2 * 3 <> 3 2 * (3 <> 3) (2 * 3) <> 3 +1 0 1 +create or replace view v1 as select 2 * 3 > 3, 2 * (3 > 3), (2 * 3) > 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 * 3 > 3 AS `2 * 3 > 3`,2 * (3 > 3) AS `2 * (3 > 3)`,2 * 3 > 3 AS `(2 * 3) > 3` +select 2 * 3 > 3, 2 * (3 > 3), (2 * 3) > 3 union select * from v1; +2 * 3 > 3 2 * (3 > 3) (2 * 3) > 3 +1 0 1 +create or replace view v1 as select 2 * 3 != 3, 2 * (3 != 3), (2 * 3) != 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 * 3 <> 3 AS `2 * 3 != 3`,2 * (3 <> 3) AS `2 * (3 != 3)`,2 * 3 <> 3 AS `(2 * 3) != 3` +select 2 * 3 != 3, 2 * (3 != 3), (2 * 3) != 3 union select * from v1; +2 * 3 != 3 2 * (3 != 3) (2 * 3) != 3 +1 0 1 +create or replace view v1 as select 2 * 3 LIKE 3, 2 * (3 LIKE 3), (2 * 3) LIKE 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 * 3 like 3 AS `2 * 3 LIKE 3`,2 * (3 like 3) AS `2 * (3 LIKE 3)`,2 * 3 like 3 AS `(2 * 3) LIKE 3` +select 2 * 3 LIKE 3, 2 * (3 LIKE 3), (2 * 3) LIKE 3 union select * from v1; +2 * 3 LIKE 3 2 * (3 LIKE 3) (2 * 3) LIKE 3 +0 2 0 +create or replace view v1 as select 2 * 3 REGEXP 3, 2 * (3 REGEXP 3), (2 * 3) REGEXP 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 * 3 regexp 3 AS `2 * 3 REGEXP 3`,2 * (3 regexp 3) AS `2 * (3 REGEXP 3)`,2 * 3 regexp 3 AS `(2 * 3) REGEXP 3` +select 2 * 3 REGEXP 3, 2 * (3 REGEXP 3), (2 * 3) REGEXP 3 union select * from v1; +2 * 3 REGEXP 3 2 * (3 REGEXP 3) (2 * 3) REGEXP 3 +0 2 0 +create or replace view v1 as select 2 * 3 | 3, 2 * (3 | 3), (2 * 3) | 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 * 3 | 3 AS `2 * 3 | 3`,2 * (3 | 3) AS `2 * (3 | 3)`,2 * 3 | 3 AS `(2 * 3) | 3` +select 2 * 3 | 3, 2 * (3 | 3), (2 * 3) | 3 union select * from v1; +2 * 3 | 3 2 * (3 | 3) (2 * 3) | 3 +7 6 7 +create or replace view v1 as select 2 * 3 & 3, 2 * (3 & 3), (2 * 3) & 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 * 3 & 3 AS `2 * 3 & 3`,2 * (3 & 3) AS `2 * (3 & 3)`,2 * 3 & 3 AS `(2 * 3) & 3` +select 2 * 3 & 3, 2 * (3 & 3), (2 * 3) & 3 union select * from v1; +2 * 3 & 3 2 * (3 & 3) (2 * 3) & 3 +2 6 2 +create or replace view v1 as select 2 * 3 >> 2, 2 * (3 >> 2), (2 * 3) >> 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 * 3 >> 2 AS `2 * 3 >> 2`,2 * (3 >> 2) AS `2 * (3 >> 2)`,2 * 3 >> 2 AS `(2 * 3) >> 2` +select 2 * 3 >> 2, 2 * (3 >> 2), (2 * 3) >> 2 union select * from v1; +2 * 3 >> 2 2 * (3 >> 2) (2 * 3) >> 2 +1 0 1 +create or replace view v1 as select 2 * '2000-01-01' +INTERVAL 1 DAY, 2 * ('2000-01-01' +INTERVAL 1 DAY), (2 * '2000-01-01') +INTERVAL 1 DAY; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 * '2000-01-01' + interval 1 day AS `2 * '2000-01-01' +INTERVAL 1 DAY`,2 * ('2000-01-01' + interval 1 day) AS `2 * ('2000-01-01' +INTERVAL 1 DAY)`,2 * '2000-01-01' + interval 1 day AS `(2 * '2000-01-01') +INTERVAL 1 DAY` +select 2 * '2000-01-01' +INTERVAL 1 DAY, 2 * ('2000-01-01' +INTERVAL 1 DAY), (2 * '2000-01-01') +INTERVAL 1 DAY union select * from v1; +2 * '2000-01-01' +INTERVAL 1 DAY 2 * ('2000-01-01' +INTERVAL 1 DAY) (2 * '2000-01-01') +INTERVAL 1 DAY +NULL 40000204 NULL +create or replace view v1 as select 2 * 3 + 3, 2 * (3 + 3), (2 * 3) + 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 * 3 + 3 AS `2 * 3 + 3`,2 * (3 + 3) AS `2 * (3 + 3)`,2 * 3 + 3 AS `(2 * 3) + 3` +select 2 * 3 + 3, 2 * (3 + 3), (2 * 3) + 3 union select * from v1; +2 * 3 + 3 2 * (3 + 3) (2 * 3) + 3 +9 12 9 +create or replace view v1 as select 2 * 3 - 3, 2 * (3 - 3), (2 * 3) - 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 * 3 - 3 AS `2 * 3 - 3`,2 * (3 - 3) AS `2 * (3 - 3)`,2 * 3 - 3 AS `(2 * 3) - 3` +select 2 * 3 - 3, 2 * (3 - 3), (2 * 3) - 3 union select * from v1; +2 * 3 - 3 2 * (3 - 3) (2 * 3) - 3 +3 0 3 +create or replace view v1 as select 2 * 3 DIV 2, 2 * (3 DIV 2), (2 * 3) DIV 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 * 3 DIV 2 AS `2 * 3 DIV 2`,2 * (3 DIV 2) AS `2 * (3 DIV 2)`,2 * 3 DIV 2 AS `(2 * 3) DIV 2` +select 2 * 3 DIV 2, 2 * (3 DIV 2), (2 * 3) DIV 2 union select * from v1; +2 * 3 DIV 2 2 * (3 DIV 2) (2 * 3) DIV 2 +3 2 3 +create or replace view v1 as select 2 * 3 MOD 2, 2 * (3 MOD 2), (2 * 3) MOD 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 * 3 MOD 2 AS `2 * 3 MOD 2`,2 * (3 MOD 2) AS `2 * (3 MOD 2)`,2 * 3 MOD 2 AS `(2 * 3) MOD 2` +select 2 * 3 MOD 2, 2 * (3 MOD 2), (2 * 3) MOD 2 union select * from v1; +2 * 3 MOD 2 2 * (3 MOD 2) (2 * 3) MOD 2 +0 2 0 +create or replace view v1 as select 2 * 3 % 2, 2 * (3 % 2), (2 * 3) % 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 * 3 MOD 2 AS `2 * 3 % 2`,2 * (3 MOD 2) AS `2 * (3 % 2)`,2 * 3 MOD 2 AS `(2 * 3) % 2` +select 2 * 3 % 2, 2 * (3 % 2), (2 * 3) % 2 union select * from v1; +2 * 3 % 2 2 * (3 % 2) (2 * 3) % 2 +0 2 0 +create or replace view v1 as select 2 * 3 ^ 3, 2 * (3 ^ 3), (2 * 3) ^ 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 * 3 ^ 3 AS `2 * 3 ^ 3`,2 * 3 ^ 3 AS `2 * (3 ^ 3)`,(2 * 3) ^ 3 AS `(2 * 3) ^ 3` +select 2 * 3 ^ 3, 2 * (3 ^ 3), (2 * 3) ^ 3 union select * from v1; +2 * 3 ^ 3 2 * (3 ^ 3) (2 * 3) ^ 3 +0 0 5 +create or replace view v1 as select 2 * 3 BETWEEN 1 AND 3, 2 * (3 BETWEEN 1 AND 3), (2 * 3) BETWEEN 1 AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 * 3 between 1 and 3 AS `2 * 3 BETWEEN 1 AND 3`,2 * (3 between 1 and 3) AS `2 * (3 BETWEEN 1 AND 3)`,2 * 3 between 1 and 3 AS `(2 * 3) BETWEEN 1 AND 3` +select 2 * 3 BETWEEN 1 AND 3, 2 * (3 BETWEEN 1 AND 3), (2 * 3) BETWEEN 1 AND 3 union select * from v1; +2 * 3 BETWEEN 1 AND 3 2 * (3 BETWEEN 1 AND 3) (2 * 3) BETWEEN 1 AND 3 +0 2 0 +create or replace view v1 as select 2 / 3 IS FALSE, 2 / (3 IS FALSE), (2 / 3) IS FALSE; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 / 3 is false AS `2 / 3 IS FALSE`,2 / (3 is false) AS `2 / (3 IS FALSE)`,2 / 3 is false AS `(2 / 3) IS FALSE` +select 2 / 3 IS FALSE, 2 / (3 IS FALSE), (2 / 3) IS FALSE union select * from v1; +2 / 3 IS FALSE 2 / (3 IS FALSE) (2 / 3) IS FALSE +0 NULL 0 +create or replace view v1 as select charset(2 / 3 COLLATE latin1_bin), charset(2 / (3 COLLATE latin1_bin)), charset((2 / 3) COLLATE latin1_bin); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select charset(2 / 3 collate latin1_bin) AS `charset(2 / 3 COLLATE latin1_bin)`,charset(2 / 3 collate latin1_bin) AS `charset(2 / (3 COLLATE latin1_bin))`,charset((2 / 3) collate latin1_bin) AS `charset((2 / 3) COLLATE latin1_bin)` +select charset(2 / 3 COLLATE latin1_bin), charset(2 / (3 COLLATE latin1_bin)), charset((2 / 3) COLLATE latin1_bin) union select * from v1; +charset(2 / 3 COLLATE latin1_bin) charset(2 / (3 COLLATE latin1_bin)) charset((2 / 3) COLLATE latin1_bin) +binary binary latin1 +create or replace view v1 as select 2 / 3 IN (0,1), 2 / (3 IN (0,1)), (2 / 3) IN (0,1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 / 3 in (0,1) AS `2 / 3 IN (0,1)`,2 / (3 in (0,1)) AS `2 / (3 IN (0,1))`,2 / 3 in (0,1) AS `(2 / 3) IN (0,1)` +select 2 / 3 IN (0,1), 2 / (3 IN (0,1)), (2 / 3) IN (0,1) union select * from v1; +2 / 3 IN (0,1) 2 / (3 IN (0,1)) (2 / 3) IN (0,1) +0 NULL 0 +create or replace view v1 as select 2 / 3 OR 3, 2 / (3 OR 3), (2 / 3) OR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 / 3 or 3 AS `2 / 3 OR 3`,2 / (3 or 3) AS `2 / (3 OR 3)`,2 / 3 or 3 AS `(2 / 3) OR 3` +select 2 / 3 OR 3, 2 / (3 OR 3), (2 / 3) OR 3 union select * from v1; +2 / 3 OR 3 2 / (3 OR 3) (2 / 3) OR 3 +1 2.0000 1 +create or replace view v1 as select 2 / 3 || 3, 2 / (3 || 3), (2 / 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 / 3 or 3 AS `2 / 3 || 3`,2 / (3 or 3) AS `2 / (3 || 3)`,2 / 3 or 3 AS `(2 / 3) || 3` +select 2 / 3 || 3, 2 / (3 || 3), (2 / 3) || 3 union select * from v1; +2 / 3 || 3 2 / (3 || 3) (2 / 3) || 3 +1 2.0000 1 +create or replace view v1 as select 2 / 3 XOR 3, 2 / (3 XOR 3), (2 / 3) XOR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 / 3 xor 3 AS `2 / 3 XOR 3`,2 / (3 xor 3) AS `2 / (3 XOR 3)`,2 / 3 xor 3 AS `(2 / 3) XOR 3` +select 2 / 3 XOR 3, 2 / (3 XOR 3), (2 / 3) XOR 3 union select * from v1; +2 / 3 XOR 3 2 / (3 XOR 3) (2 / 3) XOR 3 +0 NULL 0 +create or replace view v1 as select 2 / 3 AND 3, 2 / (3 AND 3), (2 / 3) AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 / 3 and 3 AS `2 / 3 AND 3`,2 / (3 and 3) AS `2 / (3 AND 3)`,2 / 3 and 3 AS `(2 / 3) AND 3` +select 2 / 3 AND 3, 2 / (3 AND 3), (2 / 3) AND 3 union select * from v1; +2 / 3 AND 3 2 / (3 AND 3) (2 / 3) AND 3 +1 2.0000 1 +create or replace view v1 as select 2 / 3 && 3, 2 / (3 && 3), (2 / 3) && 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 / 3 and 3 AS `2 / 3 && 3`,2 / (3 and 3) AS `2 / (3 && 3)`,2 / 3 and 3 AS `(2 / 3) && 3` +select 2 / 3 && 3, 2 / (3 && 3), (2 / 3) && 3 union select * from v1; +2 / 3 && 3 2 / (3 && 3) (2 / 3) && 3 +1 2.0000 1 +create or replace view v1 as select 2 / 3 = 3, 2 / (3 = 3), (2 / 3) = 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 / 3 = 3 AS `2 / 3 = 3`,2 / (3 = 3) AS `2 / (3 = 3)`,2 / 3 = 3 AS `(2 / 3) = 3` +select 2 / 3 = 3, 2 / (3 = 3), (2 / 3) = 3 union select * from v1; +2 / 3 = 3 2 / (3 = 3) (2 / 3) = 3 +0 2.0000 0 +create or replace view v1 as select 2 / 3 <=> 3, 2 / (3 <=> 3), (2 / 3) <=> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 / 3 <=> 3 AS `2 / 3 <=> 3`,2 / (3 <=> 3) AS `2 / (3 <=> 3)`,2 / 3 <=> 3 AS `(2 / 3) <=> 3` +select 2 / 3 <=> 3, 2 / (3 <=> 3), (2 / 3) <=> 3 union select * from v1; +2 / 3 <=> 3 2 / (3 <=> 3) (2 / 3) <=> 3 +0 2.0000 0 +create or replace view v1 as select 2 / 3 >= 3, 2 / (3 >= 3), (2 / 3) >= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 / 3 >= 3 AS `2 / 3 >= 3`,2 / (3 >= 3) AS `2 / (3 >= 3)`,2 / 3 >= 3 AS `(2 / 3) >= 3` +select 2 / 3 >= 3, 2 / (3 >= 3), (2 / 3) >= 3 union select * from v1; +2 / 3 >= 3 2 / (3 >= 3) (2 / 3) >= 3 +0 2.0000 0 +create or replace view v1 as select 2 / 3 <= 3, 2 / (3 <= 3), (2 / 3) <= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 / 3 <= 3 AS `2 / 3 <= 3`,2 / (3 <= 3) AS `2 / (3 <= 3)`,2 / 3 <= 3 AS `(2 / 3) <= 3` +select 2 / 3 <= 3, 2 / (3 <= 3), (2 / 3) <= 3 union select * from v1; +2 / 3 <= 3 2 / (3 <= 3) (2 / 3) <= 3 +1 2.0000 1 +create or replace view v1 as select 2 / 3 < 3, 2 / (3 < 3), (2 / 3) < 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 / 3 < 3 AS `2 / 3 < 3`,2 / (3 < 3) AS `2 / (3 < 3)`,2 / 3 < 3 AS `(2 / 3) < 3` +select 2 / 3 < 3, 2 / (3 < 3), (2 / 3) < 3 union select * from v1; +2 / 3 < 3 2 / (3 < 3) (2 / 3) < 3 +1 NULL 1 +create or replace view v1 as select 2 / 3 <> 3, 2 / (3 <> 3), (2 / 3) <> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 / 3 <> 3 AS `2 / 3 <> 3`,2 / (3 <> 3) AS `2 / (3 <> 3)`,2 / 3 <> 3 AS `(2 / 3) <> 3` +select 2 / 3 <> 3, 2 / (3 <> 3), (2 / 3) <> 3 union select * from v1; +2 / 3 <> 3 2 / (3 <> 3) (2 / 3) <> 3 +1 NULL 1 +create or replace view v1 as select 2 / 3 > 3, 2 / (3 > 3), (2 / 3) > 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 / 3 > 3 AS `2 / 3 > 3`,2 / (3 > 3) AS `2 / (3 > 3)`,2 / 3 > 3 AS `(2 / 3) > 3` +select 2 / 3 > 3, 2 / (3 > 3), (2 / 3) > 3 union select * from v1; +2 / 3 > 3 2 / (3 > 3) (2 / 3) > 3 +0 NULL 0 +create or replace view v1 as select 2 / 3 != 3, 2 / (3 != 3), (2 / 3) != 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 / 3 <> 3 AS `2 / 3 != 3`,2 / (3 <> 3) AS `2 / (3 != 3)`,2 / 3 <> 3 AS `(2 / 3) != 3` +select 2 / 3 != 3, 2 / (3 != 3), (2 / 3) != 3 union select * from v1; +2 / 3 != 3 2 / (3 != 3) (2 / 3) != 3 +1 NULL 1 +create or replace view v1 as select 2 / 3 LIKE 3, 2 / (3 LIKE 3), (2 / 3) LIKE 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 / 3 like 3 AS `2 / 3 LIKE 3`,2 / (3 like 3) AS `2 / (3 LIKE 3)`,2 / 3 like 3 AS `(2 / 3) LIKE 3` +select 2 / 3 LIKE 3, 2 / (3 LIKE 3), (2 / 3) LIKE 3 union select * from v1; +2 / 3 LIKE 3 2 / (3 LIKE 3) (2 / 3) LIKE 3 +0 2.0000 0 +create or replace view v1 as select 2 / 3 REGEXP 3, 2 / (3 REGEXP 3), (2 / 3) REGEXP 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 / 3 regexp 3 AS `2 / 3 REGEXP 3`,2 / (3 regexp 3) AS `2 / (3 REGEXP 3)`,2 / 3 regexp 3 AS `(2 / 3) REGEXP 3` +select 2 / 3 REGEXP 3, 2 / (3 REGEXP 3), (2 / 3) REGEXP 3 union select * from v1; +2 / 3 REGEXP 3 2 / (3 REGEXP 3) (2 / 3) REGEXP 3 +0 2.0000 0 +create or replace view v1 as select 2 / 3 | 3, 2 / (3 | 3), (2 / 3) | 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 / 3 | 3 AS `2 / 3 | 3`,2 / (3 | 3) AS `2 / (3 | 3)`,2 / 3 | 3 AS `(2 / 3) | 3` +select 2 / 3 | 3, 2 / (3 | 3), (2 / 3) | 3 union select * from v1; +2 / 3 | 3 2 / (3 | 3) (2 / 3) | 3 +3 0.6667 3 +create or replace view v1 as select 2 / 3 & 3, 2 / (3 & 3), (2 / 3) & 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 / 3 & 3 AS `2 / 3 & 3`,2 / (3 & 3) AS `2 / (3 & 3)`,2 / 3 & 3 AS `(2 / 3) & 3` +select 2 / 3 & 3, 2 / (3 & 3), (2 / 3) & 3 union select * from v1; +2 / 3 & 3 2 / (3 & 3) (2 / 3) & 3 +1 0.6667 1 +create or replace view v1 as select 2 / 3 << 3, 2 / (3 << 3), (2 / 3) << 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 / 3 << 3 AS `2 / 3 << 3`,2 / (3 << 3) AS `2 / (3 << 3)`,2 / 3 << 3 AS `(2 / 3) << 3` +select 2 / 3 << 3, 2 / (3 << 3), (2 / 3) << 3 union select * from v1; +2 / 3 << 3 2 / (3 << 3) (2 / 3) << 3 +8 0.0833 8 +create or replace view v1 as select 2 / 3 >> 3, 2 / (3 >> 3), (2 / 3) >> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 / 3 >> 3 AS `2 / 3 >> 3`,2 / (3 >> 3) AS `2 / (3 >> 3)`,2 / 3 >> 3 AS `(2 / 3) >> 3` +select 2 / 3 >> 3, 2 / (3 >> 3), (2 / 3) >> 3 union select * from v1; +2 / 3 >> 3 2 / (3 >> 3) (2 / 3) >> 3 +0 NULL 0 +create or replace view v1 as select 2 / '2000-01-01' +INTERVAL 1 DAY, 2 / ('2000-01-01' +INTERVAL 1 DAY), (2 / '2000-01-01') +INTERVAL 1 DAY; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 / '2000-01-01' + interval 1 day AS `2 / '2000-01-01' +INTERVAL 1 DAY`,2 / ('2000-01-01' + interval 1 day) AS `2 / ('2000-01-01' +INTERVAL 1 DAY)`,2 / '2000-01-01' + interval 1 day AS `(2 / '2000-01-01') +INTERVAL 1 DAY` +select 2 / '2000-01-01' +INTERVAL 1 DAY, 2 / ('2000-01-01' +INTERVAL 1 DAY), (2 / '2000-01-01') +INTERVAL 1 DAY union select * from v1; +2 / '2000-01-01' +INTERVAL 1 DAY 2 / ('2000-01-01' +INTERVAL 1 DAY) (2 / '2000-01-01') +INTERVAL 1 DAY +NULL 0.0000 NULL +create or replace view v1 as select 2 / 3 + 3, 2 / (3 + 3), (2 / 3) + 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 / 3 + 3 AS `2 / 3 + 3`,2 / (3 + 3) AS `2 / (3 + 3)`,2 / 3 + 3 AS `(2 / 3) + 3` +select 2 / 3 + 3, 2 / (3 + 3), (2 / 3) + 3 union select * from v1; +2 / 3 + 3 2 / (3 + 3) (2 / 3) + 3 +3.6667 0.3333 3.6667 +create or replace view v1 as select 2 / 3 - 3, 2 / (3 - 3), (2 / 3) - 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 / 3 - 3 AS `2 / 3 - 3`,2 / (3 - 3) AS `2 / (3 - 3)`,2 / 3 - 3 AS `(2 / 3) - 3` +select 2 / 3 - 3, 2 / (3 - 3), (2 / 3) - 3 union select * from v1; +2 / 3 - 3 2 / (3 - 3) (2 / 3) - 3 +-2.3333 NULL -2.3333 +create or replace view v1 as select 2 / 3 * 3, 2 / (3 * 3), (2 / 3) * 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 / 3 * 3 AS `2 / 3 * 3`,2 / (3 * 3) AS `2 / (3 * 3)`,2 / 3 * 3 AS `(2 / 3) * 3` +select 2 / 3 * 3, 2 / (3 * 3), (2 / 3) * 3 union select * from v1; +2 / 3 * 3 2 / (3 * 3) (2 / 3) * 3 +2.0001 0.2222 2.0001 +create or replace view v1 as select 2 / 3 / 3, 2 / (3 / 3), (2 / 3) / 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 / 3 / 3 AS `2 / 3 / 3`,2 / (3 / 3) AS `2 / (3 / 3)`,2 / 3 / 3 AS `(2 / 3) / 3` +select 2 / 3 / 3, 2 / (3 / 3), (2 / 3) / 3 union select * from v1; +2 / 3 / 3 2 / (3 / 3) (2 / 3) / 3 +0.22223333 2.0000 0.22223333 +create or replace view v1 as select 2 / 3 DIV 3, 2 / (3 DIV 3), (2 / 3) DIV 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 / 3 DIV 3 AS `2 / 3 DIV 3`,2 / (3 DIV 3) AS `2 / (3 DIV 3)`,2 / 3 DIV 3 AS `(2 / 3) DIV 3` +select 2 / 3 DIV 3, 2 / (3 DIV 3), (2 / 3) DIV 3 union select * from v1; +2 / 3 DIV 3 2 / (3 DIV 3) (2 / 3) DIV 3 +0 2.0000 0 +create or replace view v1 as select 2 / 3 MOD 3, 2 / (3 MOD 3), (2 / 3) MOD 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 / 3 MOD 3 AS `2 / 3 MOD 3`,2 / (3 MOD 3) AS `2 / (3 MOD 3)`,2 / 3 MOD 3 AS `(2 / 3) MOD 3` +select 2 / 3 MOD 3, 2 / (3 MOD 3), (2 / 3) MOD 3 union select * from v1; +2 / 3 MOD 3 2 / (3 MOD 3) (2 / 3) MOD 3 +0.6667 NULL 0.6667 +create or replace view v1 as select 2 / 3 % 3, 2 / (3 % 3), (2 / 3) % 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 / 3 MOD 3 AS `2 / 3 % 3`,2 / (3 MOD 3) AS `2 / (3 % 3)`,2 / 3 MOD 3 AS `(2 / 3) % 3` +select 2 / 3 % 3, 2 / (3 % 3), (2 / 3) % 3 union select * from v1; +2 / 3 % 3 2 / (3 % 3) (2 / 3) % 3 +0.6667 NULL 0.6667 +create or replace view v1 as select 2 / 3 ^ 3, 2 / (3 ^ 3), (2 / 3) ^ 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 / 3 ^ 3 AS `2 / 3 ^ 3`,2 / 3 ^ 3 AS `2 / (3 ^ 3)`,(2 / 3) ^ 3 AS `(2 / 3) ^ 3` +select 2 / 3 ^ 3, 2 / (3 ^ 3), (2 / 3) ^ 3 union select * from v1; +2 / 3 ^ 3 2 / (3 ^ 3) (2 / 3) ^ 3 +NULL NULL 2 +create or replace view v1 as select 2 / 3 BETWEEN 1 AND 3, 2 / (3 BETWEEN 1 AND 3), (2 / 3) BETWEEN 1 AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 / 3 between 1 and 3 AS `2 / 3 BETWEEN 1 AND 3`,2 / (3 between 1 and 3) AS `2 / (3 BETWEEN 1 AND 3)`,2 / 3 between 1 and 3 AS `(2 / 3) BETWEEN 1 AND 3` +select 2 / 3 BETWEEN 1 AND 3, 2 / (3 BETWEEN 1 AND 3), (2 / 3) BETWEEN 1 AND 3 union select * from v1; +2 / 3 BETWEEN 1 AND 3 2 / (3 BETWEEN 1 AND 3) (2 / 3) BETWEEN 1 AND 3 +0 2.0000 0 +create or replace view v1 as select 2 DIV 3 IS FALSE, 2 DIV (3 IS FALSE), (2 DIV 3) IS FALSE; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 DIV 3 is false AS `2 DIV 3 IS FALSE`,2 DIV (3 is false) AS `2 DIV (3 IS FALSE)`,2 DIV 3 is false AS `(2 DIV 3) IS FALSE` +select 2 DIV 3 IS FALSE, 2 DIV (3 IS FALSE), (2 DIV 3) IS FALSE union select * from v1; +2 DIV 3 IS FALSE 2 DIV (3 IS FALSE) (2 DIV 3) IS FALSE +1 NULL 1 +create or replace view v1 as select charset(2 DIV 3 COLLATE latin1_bin), charset(2 DIV (3 COLLATE latin1_bin)), charset((2 DIV 3) COLLATE latin1_bin); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select charset(2 DIV 3 collate latin1_bin) AS `charset(2 DIV 3 COLLATE latin1_bin)`,charset(2 DIV 3 collate latin1_bin) AS `charset(2 DIV (3 COLLATE latin1_bin))`,charset((2 DIV 3) collate latin1_bin) AS `charset((2 DIV 3) COLLATE latin1_bin)` +select charset(2 DIV 3 COLLATE latin1_bin), charset(2 DIV (3 COLLATE latin1_bin)), charset((2 DIV 3) COLLATE latin1_bin) union select * from v1; +charset(2 DIV 3 COLLATE latin1_bin) charset(2 DIV (3 COLLATE latin1_bin)) charset((2 DIV 3) COLLATE latin1_bin) +binary binary latin1 +create or replace view v1 as select 2 DIV 3 IN (0,1), 2 DIV (3 IN (0,1)), (2 DIV 3) IN (0,1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 DIV 3 in (0,1) AS `2 DIV 3 IN (0,1)`,2 DIV (3 in (0,1)) AS `2 DIV (3 IN (0,1))`,2 DIV 3 in (0,1) AS `(2 DIV 3) IN (0,1)` +select 2 DIV 3 IN (0,1), 2 DIV (3 IN (0,1)), (2 DIV 3) IN (0,1) union select * from v1; +2 DIV 3 IN (0,1) 2 DIV (3 IN (0,1)) (2 DIV 3) IN (0,1) +1 NULL 1 +create or replace view v1 as select 2 DIV 3 OR 3, 2 DIV (3 OR 3), (2 DIV 3) OR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 DIV 3 or 3 AS `2 DIV 3 OR 3`,2 DIV (3 or 3) AS `2 DIV (3 OR 3)`,2 DIV 3 or 3 AS `(2 DIV 3) OR 3` +select 2 DIV 3 OR 3, 2 DIV (3 OR 3), (2 DIV 3) OR 3 union select * from v1; +2 DIV 3 OR 3 2 DIV (3 OR 3) (2 DIV 3) OR 3 +1 2 1 +create or replace view v1 as select 2 DIV 3 || 3, 2 DIV (3 || 3), (2 DIV 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 DIV 3 or 3 AS `2 DIV 3 || 3`,2 DIV (3 or 3) AS `2 DIV (3 || 3)`,2 DIV 3 or 3 AS `(2 DIV 3) || 3` +select 2 DIV 3 || 3, 2 DIV (3 || 3), (2 DIV 3) || 3 union select * from v1; +2 DIV 3 || 3 2 DIV (3 || 3) (2 DIV 3) || 3 +1 2 1 +create or replace view v1 as select 2 DIV 3 XOR 3, 2 DIV (3 XOR 3), (2 DIV 3) XOR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 DIV 3 xor 3 AS `2 DIV 3 XOR 3`,2 DIV (3 xor 3) AS `2 DIV (3 XOR 3)`,2 DIV 3 xor 3 AS `(2 DIV 3) XOR 3` +select 2 DIV 3 XOR 3, 2 DIV (3 XOR 3), (2 DIV 3) XOR 3 union select * from v1; +2 DIV 3 XOR 3 2 DIV (3 XOR 3) (2 DIV 3) XOR 3 +1 NULL 1 +create or replace view v1 as select 2 DIV 3 AND 3, 2 DIV (3 AND 3), (2 DIV 3) AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 DIV 3 and 3 AS `2 DIV 3 AND 3`,2 DIV (3 and 3) AS `2 DIV (3 AND 3)`,2 DIV 3 and 3 AS `(2 DIV 3) AND 3` +select 2 DIV 3 AND 3, 2 DIV (3 AND 3), (2 DIV 3) AND 3 union select * from v1; +2 DIV 3 AND 3 2 DIV (3 AND 3) (2 DIV 3) AND 3 +0 2 0 +create or replace view v1 as select 2 DIV 3 && 3, 2 DIV (3 && 3), (2 DIV 3) && 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 DIV 3 and 3 AS `2 DIV 3 && 3`,2 DIV (3 and 3) AS `2 DIV (3 && 3)`,2 DIV 3 and 3 AS `(2 DIV 3) && 3` +select 2 DIV 3 && 3, 2 DIV (3 && 3), (2 DIV 3) && 3 union select * from v1; +2 DIV 3 && 3 2 DIV (3 && 3) (2 DIV 3) && 3 +0 2 0 +create or replace view v1 as select 2 DIV 3 = 3, 2 DIV (3 = 3), (2 DIV 3) = 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 DIV 3 = 3 AS `2 DIV 3 = 3`,2 DIV (3 = 3) AS `2 DIV (3 = 3)`,2 DIV 3 = 3 AS `(2 DIV 3) = 3` +select 2 DIV 3 = 3, 2 DIV (3 = 3), (2 DIV 3) = 3 union select * from v1; +2 DIV 3 = 3 2 DIV (3 = 3) (2 DIV 3) = 3 +0 2 0 +create or replace view v1 as select 2 DIV 3 <=> 3, 2 DIV (3 <=> 3), (2 DIV 3) <=> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 DIV 3 <=> 3 AS `2 DIV 3 <=> 3`,2 DIV (3 <=> 3) AS `2 DIV (3 <=> 3)`,2 DIV 3 <=> 3 AS `(2 DIV 3) <=> 3` +select 2 DIV 3 <=> 3, 2 DIV (3 <=> 3), (2 DIV 3) <=> 3 union select * from v1; +2 DIV 3 <=> 3 2 DIV (3 <=> 3) (2 DIV 3) <=> 3 +0 2 0 +create or replace view v1 as select 2 DIV 3 >= 3, 2 DIV (3 >= 3), (2 DIV 3) >= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 DIV 3 >= 3 AS `2 DIV 3 >= 3`,2 DIV (3 >= 3) AS `2 DIV (3 >= 3)`,2 DIV 3 >= 3 AS `(2 DIV 3) >= 3` +select 2 DIV 3 >= 3, 2 DIV (3 >= 3), (2 DIV 3) >= 3 union select * from v1; +2 DIV 3 >= 3 2 DIV (3 >= 3) (2 DIV 3) >= 3 +0 2 0 +create or replace view v1 as select 2 DIV 3 <= 3, 2 DIV (3 <= 3), (2 DIV 3) <= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 DIV 3 <= 3 AS `2 DIV 3 <= 3`,2 DIV (3 <= 3) AS `2 DIV (3 <= 3)`,2 DIV 3 <= 3 AS `(2 DIV 3) <= 3` +select 2 DIV 3 <= 3, 2 DIV (3 <= 3), (2 DIV 3) <= 3 union select * from v1; +2 DIV 3 <= 3 2 DIV (3 <= 3) (2 DIV 3) <= 3 +1 2 1 +create or replace view v1 as select 2 DIV 3 < 3, 2 DIV (3 < 3), (2 DIV 3) < 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 DIV 3 < 3 AS `2 DIV 3 < 3`,2 DIV (3 < 3) AS `2 DIV (3 < 3)`,2 DIV 3 < 3 AS `(2 DIV 3) < 3` +select 2 DIV 3 < 3, 2 DIV (3 < 3), (2 DIV 3) < 3 union select * from v1; +2 DIV 3 < 3 2 DIV (3 < 3) (2 DIV 3) < 3 +1 NULL 1 +create or replace view v1 as select 2 DIV 3 <> 3, 2 DIV (3 <> 3), (2 DIV 3) <> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 DIV 3 <> 3 AS `2 DIV 3 <> 3`,2 DIV (3 <> 3) AS `2 DIV (3 <> 3)`,2 DIV 3 <> 3 AS `(2 DIV 3) <> 3` +select 2 DIV 3 <> 3, 2 DIV (3 <> 3), (2 DIV 3) <> 3 union select * from v1; +2 DIV 3 <> 3 2 DIV (3 <> 3) (2 DIV 3) <> 3 +1 NULL 1 +create or replace view v1 as select 2 DIV 3 > 3, 2 DIV (3 > 3), (2 DIV 3) > 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 DIV 3 > 3 AS `2 DIV 3 > 3`,2 DIV (3 > 3) AS `2 DIV (3 > 3)`,2 DIV 3 > 3 AS `(2 DIV 3) > 3` +select 2 DIV 3 > 3, 2 DIV (3 > 3), (2 DIV 3) > 3 union select * from v1; +2 DIV 3 > 3 2 DIV (3 > 3) (2 DIV 3) > 3 +0 NULL 0 +create or replace view v1 as select 2 DIV 3 != 3, 2 DIV (3 != 3), (2 DIV 3) != 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 DIV 3 <> 3 AS `2 DIV 3 != 3`,2 DIV (3 <> 3) AS `2 DIV (3 != 3)`,2 DIV 3 <> 3 AS `(2 DIV 3) != 3` +select 2 DIV 3 != 3, 2 DIV (3 != 3), (2 DIV 3) != 3 union select * from v1; +2 DIV 3 != 3 2 DIV (3 != 3) (2 DIV 3) != 3 +1 NULL 1 +create or replace view v1 as select 2 DIV 3 LIKE 3, 2 DIV (3 LIKE 3), (2 DIV 3) LIKE 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 DIV 3 like 3 AS `2 DIV 3 LIKE 3`,2 DIV (3 like 3) AS `2 DIV (3 LIKE 3)`,2 DIV 3 like 3 AS `(2 DIV 3) LIKE 3` +select 2 DIV 3 LIKE 3, 2 DIV (3 LIKE 3), (2 DIV 3) LIKE 3 union select * from v1; +2 DIV 3 LIKE 3 2 DIV (3 LIKE 3) (2 DIV 3) LIKE 3 +0 2 0 +create or replace view v1 as select 2 DIV 3 REGEXP 3, 2 DIV (3 REGEXP 3), (2 DIV 3) REGEXP 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 DIV 3 regexp 3 AS `2 DIV 3 REGEXP 3`,2 DIV (3 regexp 3) AS `2 DIV (3 REGEXP 3)`,2 DIV 3 regexp 3 AS `(2 DIV 3) REGEXP 3` +select 2 DIV 3 REGEXP 3, 2 DIV (3 REGEXP 3), (2 DIV 3) REGEXP 3 union select * from v1; +2 DIV 3 REGEXP 3 2 DIV (3 REGEXP 3) (2 DIV 3) REGEXP 3 +0 2 0 +create or replace view v1 as select 2 DIV 3 | 3, 2 DIV (3 | 3), (2 DIV 3) | 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 DIV 3 | 3 AS `2 DIV 3 | 3`,2 DIV (3 | 3) AS `2 DIV (3 | 3)`,2 DIV 3 | 3 AS `(2 DIV 3) | 3` +select 2 DIV 3 | 3, 2 DIV (3 | 3), (2 DIV 3) | 3 union select * from v1; +2 DIV 3 | 3 2 DIV (3 | 3) (2 DIV 3) | 3 +3 0 3 +create or replace view v1 as select 2 DIV 3 & 1, 2 DIV (3 & 1), (2 DIV 3) & 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 DIV 3 & 1 AS `2 DIV 3 & 1`,2 DIV (3 & 1) AS `2 DIV (3 & 1)`,2 DIV 3 & 1 AS `(2 DIV 3) & 1` +select 2 DIV 3 & 1, 2 DIV (3 & 1), (2 DIV 3) & 1 union select * from v1; +2 DIV 3 & 1 2 DIV (3 & 1) (2 DIV 3) & 1 +0 2 0 +create or replace view v1 as select 4 DIV 3 << 3, 4 DIV (3 << 3), (4 DIV 3) << 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 4 DIV 3 << 3 AS `4 DIV 3 << 3`,4 DIV (3 << 3) AS `4 DIV (3 << 3)`,4 DIV 3 << 3 AS `(4 DIV 3) << 3` +select 4 DIV 3 << 3, 4 DIV (3 << 3), (4 DIV 3) << 3 union select * from v1; +4 DIV 3 << 3 4 DIV (3 << 3) (4 DIV 3) << 3 +8 0 8 +create or replace view v1 as select 2 DIV 3 >> 3, 2 DIV (3 >> 3), (2 DIV 3) >> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 DIV 3 >> 3 AS `2 DIV 3 >> 3`,2 DIV (3 >> 3) AS `2 DIV (3 >> 3)`,2 DIV 3 >> 3 AS `(2 DIV 3) >> 3` +select 2 DIV 3 >> 3, 2 DIV (3 >> 3), (2 DIV 3) >> 3 union select * from v1; +2 DIV 3 >> 3 2 DIV (3 >> 3) (2 DIV 3) >> 3 +0 NULL 0 +create or replace view v1 as select 2 DIV '2000-01-01' +INTERVAL 1 DAY, 2 DIV ('2000-01-01' +INTERVAL 1 DAY), (2 DIV '2000-01-01') +INTERVAL 1 DAY; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 DIV '2000-01-01' + interval 1 day AS `2 DIV '2000-01-01' +INTERVAL 1 DAY`,2 DIV ('2000-01-01' + interval 1 day) AS `2 DIV ('2000-01-01' +INTERVAL 1 DAY)`,2 DIV '2000-01-01' + interval 1 day AS `(2 DIV '2000-01-01') +INTERVAL 1 DAY` +select 2 DIV '2000-01-01' +INTERVAL 1 DAY, 2 DIV ('2000-01-01' +INTERVAL 1 DAY), (2 DIV '2000-01-01') +INTERVAL 1 DAY union select * from v1; +2 DIV '2000-01-01' +INTERVAL 1 DAY 2 DIV ('2000-01-01' +INTERVAL 1 DAY) (2 DIV '2000-01-01') +INTERVAL 1 DAY +NULL 0 NULL +create or replace view v1 as select 2 DIV 3 + 3, 2 DIV (3 + 3), (2 DIV 3) + 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 DIV 3 + 3 AS `2 DIV 3 + 3`,2 DIV (3 + 3) AS `2 DIV (3 + 3)`,2 DIV 3 + 3 AS `(2 DIV 3) + 3` +select 2 DIV 3 + 3, 2 DIV (3 + 3), (2 DIV 3) + 3 union select * from v1; +2 DIV 3 + 3 2 DIV (3 + 3) (2 DIV 3) + 3 +3 0 3 +create or replace view v1 as select 2 DIV 3 - 3, 2 DIV (3 - 3), (2 DIV 3) - 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 DIV 3 - 3 AS `2 DIV 3 - 3`,2 DIV (3 - 3) AS `2 DIV (3 - 3)`,2 DIV 3 - 3 AS `(2 DIV 3) - 3` +select 2 DIV 3 - 3, 2 DIV (3 - 3), (2 DIV 3) - 3 union select * from v1; +2 DIV 3 - 3 2 DIV (3 - 3) (2 DIV 3) - 3 +-3 NULL -3 +create or replace view v1 as select 4 DIV 3 * 3, 4 DIV (3 * 3), (4 DIV 3) * 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 4 DIV 3 * 3 AS `4 DIV 3 * 3`,4 DIV (3 * 3) AS `4 DIV (3 * 3)`,4 DIV 3 * 3 AS `(4 DIV 3) * 3` +select 4 DIV 3 * 3, 4 DIV (3 * 3), (4 DIV 3) * 3 union select * from v1; +4 DIV 3 * 3 4 DIV (3 * 3) (4 DIV 3) * 3 +3 0 3 +create or replace view v1 as select 2 DIV 3 / 3, 2 DIV (3 / 3), (2 DIV 3) / 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 DIV 3 / 3 AS `2 DIV 3 / 3`,2 DIV (3 / 3) AS `2 DIV (3 / 3)`,2 DIV 3 / 3 AS `(2 DIV 3) / 3` +select 2 DIV 3 / 3, 2 DIV (3 / 3), (2 DIV 3) / 3 union select * from v1; +2 DIV 3 / 3 2 DIV (3 / 3) (2 DIV 3) / 3 +0.0000 2 0.0000 +create or replace view v1 as select 2 DIV 3 DIV 3, 2 DIV (3 DIV 3), (2 DIV 3) DIV 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 DIV 3 DIV 3 AS `2 DIV 3 DIV 3`,2 DIV (3 DIV 3) AS `2 DIV (3 DIV 3)`,2 DIV 3 DIV 3 AS `(2 DIV 3) DIV 3` +select 2 DIV 3 DIV 3, 2 DIV (3 DIV 3), (2 DIV 3) DIV 3 union select * from v1; +2 DIV 3 DIV 3 2 DIV (3 DIV 3) (2 DIV 3) DIV 3 +0 2 0 +create or replace view v1 as select 2 DIV 3 MOD 3, 2 DIV (3 MOD 3), (2 DIV 3) MOD 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 DIV 3 MOD 3 AS `2 DIV 3 MOD 3`,2 DIV (3 MOD 3) AS `2 DIV (3 MOD 3)`,2 DIV 3 MOD 3 AS `(2 DIV 3) MOD 3` +select 2 DIV 3 MOD 3, 2 DIV (3 MOD 3), (2 DIV 3) MOD 3 union select * from v1; +2 DIV 3 MOD 3 2 DIV (3 MOD 3) (2 DIV 3) MOD 3 +0 NULL 0 +create or replace view v1 as select 2 DIV 3 % 3, 2 DIV (3 % 3), (2 DIV 3) % 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 DIV 3 MOD 3 AS `2 DIV 3 % 3`,2 DIV (3 MOD 3) AS `2 DIV (3 % 3)`,2 DIV 3 MOD 3 AS `(2 DIV 3) % 3` +select 2 DIV 3 % 3, 2 DIV (3 % 3), (2 DIV 3) % 3 union select * from v1; +2 DIV 3 % 3 2 DIV (3 % 3) (2 DIV 3) % 3 +0 NULL 0 +create or replace view v1 as select 2 DIV 3 ^ 3, 2 DIV (3 ^ 3), (2 DIV 3) ^ 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 DIV 3 ^ 3 AS `2 DIV 3 ^ 3`,2 DIV 3 ^ 3 AS `2 DIV (3 ^ 3)`,(2 DIV 3) ^ 3 AS `(2 DIV 3) ^ 3` +select 2 DIV 3 ^ 3, 2 DIV (3 ^ 3), (2 DIV 3) ^ 3 union select * from v1; +2 DIV 3 ^ 3 2 DIV (3 ^ 3) (2 DIV 3) ^ 3 +NULL NULL 3 +create or replace view v1 as select 2 DIV 3 BETWEEN 1 AND 3, 2 DIV (3 BETWEEN 1 AND 3), (2 DIV 3) BETWEEN 1 AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 DIV 3 between 1 and 3 AS `2 DIV 3 BETWEEN 1 AND 3`,2 DIV (3 between 1 and 3) AS `2 DIV (3 BETWEEN 1 AND 3)`,2 DIV 3 between 1 and 3 AS `(2 DIV 3) BETWEEN 1 AND 3` +select 2 DIV 3 BETWEEN 1 AND 3, 2 DIV (3 BETWEEN 1 AND 3), (2 DIV 3) BETWEEN 1 AND 3 union select * from v1; +2 DIV 3 BETWEEN 1 AND 3 2 DIV (3 BETWEEN 1 AND 3) (2 DIV 3) BETWEEN 1 AND 3 +0 2 0 +create or replace view v1 as select 2 MOD 3 IS FALSE, 2 MOD (3 IS FALSE), (2 MOD 3) IS FALSE; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 MOD 3 is false AS `2 MOD 3 IS FALSE`,2 MOD (3 is false) AS `2 MOD (3 IS FALSE)`,2 MOD 3 is false AS `(2 MOD 3) IS FALSE` +select 2 MOD 3 IS FALSE, 2 MOD (3 IS FALSE), (2 MOD 3) IS FALSE union select * from v1; +2 MOD 3 IS FALSE 2 MOD (3 IS FALSE) (2 MOD 3) IS FALSE +0 NULL 0 +create or replace view v1 as select charset(2 MOD 3 COLLATE latin1_bin), charset(2 MOD (3 COLLATE latin1_bin)), charset((2 MOD 3) COLLATE latin1_bin); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select charset(2 MOD 3 collate latin1_bin) AS `charset(2 MOD 3 COLLATE latin1_bin)`,charset(2 MOD 3 collate latin1_bin) AS `charset(2 MOD (3 COLLATE latin1_bin))`,charset((2 MOD 3) collate latin1_bin) AS `charset((2 MOD 3) COLLATE latin1_bin)` +select charset(2 MOD 3 COLLATE latin1_bin), charset(2 MOD (3 COLLATE latin1_bin)), charset((2 MOD 3) COLLATE latin1_bin) union select * from v1; +charset(2 MOD 3 COLLATE latin1_bin) charset(2 MOD (3 COLLATE latin1_bin)) charset((2 MOD 3) COLLATE latin1_bin) +binary binary latin1 +create or replace view v1 as select 2 MOD 3 IN (0,1), 2 MOD (3 IN (0,1)), (2 MOD 3) IN (0,1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 MOD 3 in (0,1) AS `2 MOD 3 IN (0,1)`,2 MOD (3 in (0,1)) AS `2 MOD (3 IN (0,1))`,2 MOD 3 in (0,1) AS `(2 MOD 3) IN (0,1)` +select 2 MOD 3 IN (0,1), 2 MOD (3 IN (0,1)), (2 MOD 3) IN (0,1) union select * from v1; +2 MOD 3 IN (0,1) 2 MOD (3 IN (0,1)) (2 MOD 3) IN (0,1) +0 NULL 0 +create or replace view v1 as select 2 MOD 3 OR 3, 2 MOD (3 OR 3), (2 MOD 3) OR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 MOD 3 or 3 AS `2 MOD 3 OR 3`,2 MOD (3 or 3) AS `2 MOD (3 OR 3)`,2 MOD 3 or 3 AS `(2 MOD 3) OR 3` +select 2 MOD 3 OR 3, 2 MOD (3 OR 3), (2 MOD 3) OR 3 union select * from v1; +2 MOD 3 OR 3 2 MOD (3 OR 3) (2 MOD 3) OR 3 +1 0 1 +create or replace view v1 as select 2 MOD 3 || 3, 2 MOD (3 || 3), (2 MOD 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 MOD 3 or 3 AS `2 MOD 3 || 3`,2 MOD (3 or 3) AS `2 MOD (3 || 3)`,2 MOD 3 or 3 AS `(2 MOD 3) || 3` +select 2 MOD 3 || 3, 2 MOD (3 || 3), (2 MOD 3) || 3 union select * from v1; +2 MOD 3 || 3 2 MOD (3 || 3) (2 MOD 3) || 3 +1 0 1 +create or replace view v1 as select 2 MOD 3 XOR 3, 2 MOD (3 XOR 3), (2 MOD 3) XOR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 MOD 3 xor 3 AS `2 MOD 3 XOR 3`,2 MOD (3 xor 3) AS `2 MOD (3 XOR 3)`,2 MOD 3 xor 3 AS `(2 MOD 3) XOR 3` +select 2 MOD 3 XOR 3, 2 MOD (3 XOR 3), (2 MOD 3) XOR 3 union select * from v1; +2 MOD 3 XOR 3 2 MOD (3 XOR 3) (2 MOD 3) XOR 3 +0 NULL 0 +create or replace view v1 as select 2 MOD 3 AND 3, 2 MOD (3 AND 3), (2 MOD 3) AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 MOD 3 and 3 AS `2 MOD 3 AND 3`,2 MOD (3 and 3) AS `2 MOD (3 AND 3)`,2 MOD 3 and 3 AS `(2 MOD 3) AND 3` +select 2 MOD 3 AND 3, 2 MOD (3 AND 3), (2 MOD 3) AND 3 union select * from v1; +2 MOD 3 AND 3 2 MOD (3 AND 3) (2 MOD 3) AND 3 +1 0 1 +create or replace view v1 as select 2 MOD 3 && 3, 2 MOD (3 && 3), (2 MOD 3) && 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 MOD 3 and 3 AS `2 MOD 3 && 3`,2 MOD (3 and 3) AS `2 MOD (3 && 3)`,2 MOD 3 and 3 AS `(2 MOD 3) && 3` +select 2 MOD 3 && 3, 2 MOD (3 && 3), (2 MOD 3) && 3 union select * from v1; +2 MOD 3 && 3 2 MOD (3 && 3) (2 MOD 3) && 3 +1 0 1 +create or replace view v1 as select 2 MOD 3 = 2, 2 MOD (3 = 2), (2 MOD 3) = 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 MOD 3 = 2 AS `2 MOD 3 = 2`,2 MOD (3 = 2) AS `2 MOD (3 = 2)`,2 MOD 3 = 2 AS `(2 MOD 3) = 2` +select 2 MOD 3 = 2, 2 MOD (3 = 2), (2 MOD 3) = 2 union select * from v1; +2 MOD 3 = 2 2 MOD (3 = 2) (2 MOD 3) = 2 +1 NULL 1 +create or replace view v1 as select 2 MOD 3 <=> 2, 2 MOD (3 <=> 2), (2 MOD 3) <=> 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 MOD 3 <=> 2 AS `2 MOD 3 <=> 2`,2 MOD (3 <=> 2) AS `2 MOD (3 <=> 2)`,2 MOD 3 <=> 2 AS `(2 MOD 3) <=> 2` +select 2 MOD 3 <=> 2, 2 MOD (3 <=> 2), (2 MOD 3) <=> 2 union select * from v1; +2 MOD 3 <=> 2 2 MOD (3 <=> 2) (2 MOD 3) <=> 2 +1 NULL 1 +create or replace view v1 as select 2 MOD 3 >= 1, 2 MOD (3 >= 1), (2 MOD 3) >= 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 MOD 3 >= 1 AS `2 MOD 3 >= 1`,2 MOD (3 >= 1) AS `2 MOD (3 >= 1)`,2 MOD 3 >= 1 AS `(2 MOD 3) >= 1` +select 2 MOD 3 >= 1, 2 MOD (3 >= 1), (2 MOD 3) >= 1 union select * from v1; +2 MOD 3 >= 1 2 MOD (3 >= 1) (2 MOD 3) >= 1 +1 0 1 +create or replace view v1 as select 2 MOD 3 <= 3, 2 MOD (3 <= 3), (2 MOD 3) <= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 MOD 3 <= 3 AS `2 MOD 3 <= 3`,2 MOD (3 <= 3) AS `2 MOD (3 <= 3)`,2 MOD 3 <= 3 AS `(2 MOD 3) <= 3` +select 2 MOD 3 <= 3, 2 MOD (3 <= 3), (2 MOD 3) <= 3 union select * from v1; +2 MOD 3 <= 3 2 MOD (3 <= 3) (2 MOD 3) <= 3 +1 0 1 +create or replace view v1 as select 2 MOD 3 < 3, 2 MOD (3 < 3), (2 MOD 3) < 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 MOD 3 < 3 AS `2 MOD 3 < 3`,2 MOD (3 < 3) AS `2 MOD (3 < 3)`,2 MOD 3 < 3 AS `(2 MOD 3) < 3` +select 2 MOD 3 < 3, 2 MOD (3 < 3), (2 MOD 3) < 3 union select * from v1; +2 MOD 3 < 3 2 MOD (3 < 3) (2 MOD 3) < 3 +1 NULL 1 +create or replace view v1 as select 2 MOD 3 <> 3, 2 MOD (3 <> 3), (2 MOD 3) <> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 MOD 3 <> 3 AS `2 MOD 3 <> 3`,2 MOD (3 <> 3) AS `2 MOD (3 <> 3)`,2 MOD 3 <> 3 AS `(2 MOD 3) <> 3` +select 2 MOD 3 <> 3, 2 MOD (3 <> 3), (2 MOD 3) <> 3 union select * from v1; +2 MOD 3 <> 3 2 MOD (3 <> 3) (2 MOD 3) <> 3 +1 NULL 1 +create or replace view v1 as select 2 MOD 3 > 3, 2 MOD (3 > 3), (2 MOD 3) > 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 MOD 3 > 3 AS `2 MOD 3 > 3`,2 MOD (3 > 3) AS `2 MOD (3 > 3)`,2 MOD 3 > 3 AS `(2 MOD 3) > 3` +select 2 MOD 3 > 3, 2 MOD (3 > 3), (2 MOD 3) > 3 union select * from v1; +2 MOD 3 > 3 2 MOD (3 > 3) (2 MOD 3) > 3 +0 NULL 0 +create or replace view v1 as select 2 MOD 3 != 3, 2 MOD (3 != 3), (2 MOD 3) != 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 MOD 3 <> 3 AS `2 MOD 3 != 3`,2 MOD (3 <> 3) AS `2 MOD (3 != 3)`,2 MOD 3 <> 3 AS `(2 MOD 3) != 3` +select 2 MOD 3 != 3, 2 MOD (3 != 3), (2 MOD 3) != 3 union select * from v1; +2 MOD 3 != 3 2 MOD (3 != 3) (2 MOD 3) != 3 +1 NULL 1 +create or replace view v1 as select 2 MOD 3 LIKE 2, 2 MOD (3 LIKE 2), (2 MOD 3) LIKE 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 MOD 3 like 2 AS `2 MOD 3 LIKE 2`,2 MOD (3 like 2) AS `2 MOD (3 LIKE 2)`,2 MOD 3 like 2 AS `(2 MOD 3) LIKE 2` +select 2 MOD 3 LIKE 2, 2 MOD (3 LIKE 2), (2 MOD 3) LIKE 2 union select * from v1; +2 MOD 3 LIKE 2 2 MOD (3 LIKE 2) (2 MOD 3) LIKE 2 +1 NULL 1 +create or replace view v1 as select 2 MOD 3 REGEXP 2, 2 MOD (3 REGEXP 2), (2 MOD 3) REGEXP 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 MOD 3 regexp 2 AS `2 MOD 3 REGEXP 2`,2 MOD (3 regexp 2) AS `2 MOD (3 REGEXP 2)`,2 MOD 3 regexp 2 AS `(2 MOD 3) REGEXP 2` +select 2 MOD 3 REGEXP 2, 2 MOD (3 REGEXP 2), (2 MOD 3) REGEXP 2 union select * from v1; +2 MOD 3 REGEXP 2 2 MOD (3 REGEXP 2) (2 MOD 3) REGEXP 2 +1 NULL 1 +create or replace view v1 as select 2 MOD 3 | 3, 2 MOD (3 | 3), (2 MOD 3) | 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 MOD 3 | 3 AS `2 MOD 3 | 3`,2 MOD (3 | 3) AS `2 MOD (3 | 3)`,2 MOD 3 | 3 AS `(2 MOD 3) | 3` +select 2 MOD 3 | 3, 2 MOD (3 | 3), (2 MOD 3) | 3 union select * from v1; +2 MOD 3 | 3 2 MOD (3 | 3) (2 MOD 3) | 3 +3 2 3 +create or replace view v1 as select 2 MOD 4 & 4, 2 MOD (4 & 4), (2 MOD 4) & 4; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 MOD 4 & 4 AS `2 MOD 4 & 4`,2 MOD (4 & 4) AS `2 MOD (4 & 4)`,2 MOD 4 & 4 AS `(2 MOD 4) & 4` +select 2 MOD 4 & 4, 2 MOD (4 & 4), (2 MOD 4) & 4 union select * from v1; +2 MOD 4 & 4 2 MOD (4 & 4) (2 MOD 4) & 4 +0 2 0 +create or replace view v1 as select 2 MOD 3 << 3, 2 MOD (3 << 3), (2 MOD 3) << 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 MOD 3 << 3 AS `2 MOD 3 << 3`,2 MOD (3 << 3) AS `2 MOD (3 << 3)`,2 MOD 3 << 3 AS `(2 MOD 3) << 3` +select 2 MOD 3 << 3, 2 MOD (3 << 3), (2 MOD 3) << 3 union select * from v1; +2 MOD 3 << 3 2 MOD (3 << 3) (2 MOD 3) << 3 +16 2 16 +create or replace view v1 as select 2 MOD 3 >> 3, 2 MOD (3 >> 3), (2 MOD 3) >> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 MOD 3 >> 3 AS `2 MOD 3 >> 3`,2 MOD (3 >> 3) AS `2 MOD (3 >> 3)`,2 MOD 3 >> 3 AS `(2 MOD 3) >> 3` +select 2 MOD 3 >> 3, 2 MOD (3 >> 3), (2 MOD 3) >> 3 union select * from v1; +2 MOD 3 >> 3 2 MOD (3 >> 3) (2 MOD 3) >> 3 +0 NULL 0 +create or replace view v1 as select 2 MOD '2000-01-01' +INTERVAL 1 DAY, 2 MOD ('2000-01-01' +INTERVAL 1 DAY), (2 MOD '2000-01-01') +INTERVAL 1 DAY; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 MOD '2000-01-01' + interval 1 day AS `2 MOD '2000-01-01' +INTERVAL 1 DAY`,2 MOD ('2000-01-01' + interval 1 day) AS `2 MOD ('2000-01-01' +INTERVAL 1 DAY)`,2 MOD '2000-01-01' + interval 1 day AS `(2 MOD '2000-01-01') +INTERVAL 1 DAY` +select 2 MOD '2000-01-01' +INTERVAL 1 DAY, 2 MOD ('2000-01-01' +INTERVAL 1 DAY), (2 MOD '2000-01-01') +INTERVAL 1 DAY union select * from v1; +2 MOD '2000-01-01' +INTERVAL 1 DAY 2 MOD ('2000-01-01' +INTERVAL 1 DAY) (2 MOD '2000-01-01') +INTERVAL 1 DAY +NULL 2 NULL +create or replace view v1 as select 2 MOD 3 + 3, 2 MOD (3 + 3), (2 MOD 3) + 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 MOD 3 + 3 AS `2 MOD 3 + 3`,2 MOD (3 + 3) AS `2 MOD (3 + 3)`,2 MOD 3 + 3 AS `(2 MOD 3) + 3` +select 2 MOD 3 + 3, 2 MOD (3 + 3), (2 MOD 3) + 3 union select * from v1; +2 MOD 3 + 3 2 MOD (3 + 3) (2 MOD 3) + 3 +5 2 5 +create or replace view v1 as select 2 MOD 3 - 3, 2 MOD (3 - 3), (2 MOD 3) - 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 MOD 3 - 3 AS `2 MOD 3 - 3`,2 MOD (3 - 3) AS `2 MOD (3 - 3)`,2 MOD 3 - 3 AS `(2 MOD 3) - 3` +select 2 MOD 3 - 3, 2 MOD (3 - 3), (2 MOD 3) - 3 union select * from v1; +2 MOD 3 - 3 2 MOD (3 - 3) (2 MOD 3) - 3 +-1 NULL -1 +create or replace view v1 as select 2 MOD 3 * 3, 2 MOD (3 * 3), (2 MOD 3) * 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 MOD 3 * 3 AS `2 MOD 3 * 3`,2 MOD (3 * 3) AS `2 MOD (3 * 3)`,2 MOD 3 * 3 AS `(2 MOD 3) * 3` +select 2 MOD 3 * 3, 2 MOD (3 * 3), (2 MOD 3) * 3 union select * from v1; +2 MOD 3 * 3 2 MOD (3 * 3) (2 MOD 3) * 3 +6 2 6 +create or replace view v1 as select 2 MOD 3 / 3, 2 MOD (3 / 3), (2 MOD 3) / 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 MOD 3 / 3 AS `2 MOD 3 / 3`,2 MOD (3 / 3) AS `2 MOD (3 / 3)`,2 MOD 3 / 3 AS `(2 MOD 3) / 3` +select 2 MOD 3 / 3, 2 MOD (3 / 3), (2 MOD 3) / 3 union select * from v1; +2 MOD 3 / 3 2 MOD (3 / 3) (2 MOD 3) / 3 +0.6667 0.0000 0.6667 +create or replace view v1 as select 3 MOD 4 DIV 3, 3 MOD (4 DIV 3), (3 MOD 4) DIV 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 3 MOD 4 DIV 3 AS `3 MOD 4 DIV 3`,3 MOD (4 DIV 3) AS `3 MOD (4 DIV 3)`,3 MOD 4 DIV 3 AS `(3 MOD 4) DIV 3` +select 3 MOD 4 DIV 3, 3 MOD (4 DIV 3), (3 MOD 4) DIV 3 union select * from v1; +3 MOD 4 DIV 3 3 MOD (4 DIV 3) (3 MOD 4) DIV 3 +1 0 1 +create or replace view v1 as select 2 MOD 3 MOD 3, 2 MOD (3 MOD 3), (2 MOD 3) MOD 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 MOD 3 MOD 3 AS `2 MOD 3 MOD 3`,2 MOD (3 MOD 3) AS `2 MOD (3 MOD 3)`,2 MOD 3 MOD 3 AS `(2 MOD 3) MOD 3` +select 2 MOD 3 MOD 3, 2 MOD (3 MOD 3), (2 MOD 3) MOD 3 union select * from v1; +2 MOD 3 MOD 3 2 MOD (3 MOD 3) (2 MOD 3) MOD 3 +2 NULL 2 +create or replace view v1 as select 2 MOD 3 % 3, 2 MOD (3 % 3), (2 MOD 3) % 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 MOD 3 MOD 3 AS `2 MOD 3 % 3`,2 MOD (3 MOD 3) AS `2 MOD (3 % 3)`,2 MOD 3 MOD 3 AS `(2 MOD 3) % 3` +select 2 MOD 3 % 3, 2 MOD (3 % 3), (2 MOD 3) % 3 union select * from v1; +2 MOD 3 % 3 2 MOD (3 % 3) (2 MOD 3) % 3 +2 NULL 2 +create or replace view v1 as select 2 MOD 3 ^ 3, 2 MOD (3 ^ 3), (2 MOD 3) ^ 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 MOD 3 ^ 3 AS `2 MOD 3 ^ 3`,2 MOD 3 ^ 3 AS `2 MOD (3 ^ 3)`,(2 MOD 3) ^ 3 AS `(2 MOD 3) ^ 3` +select 2 MOD 3 ^ 3, 2 MOD (3 ^ 3), (2 MOD 3) ^ 3 union select * from v1; +2 MOD 3 ^ 3 2 MOD (3 ^ 3) (2 MOD 3) ^ 3 +NULL NULL 1 +create or replace view v1 as select 2 MOD 3 BETWEEN 1 AND 3, 2 MOD (3 BETWEEN 1 AND 3), (2 MOD 3) BETWEEN 1 AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 MOD 3 between 1 and 3 AS `2 MOD 3 BETWEEN 1 AND 3`,2 MOD (3 between 1 and 3) AS `2 MOD (3 BETWEEN 1 AND 3)`,2 MOD 3 between 1 and 3 AS `(2 MOD 3) BETWEEN 1 AND 3` +select 2 MOD 3 BETWEEN 1 AND 3, 2 MOD (3 BETWEEN 1 AND 3), (2 MOD 3) BETWEEN 1 AND 3 union select * from v1; +2 MOD 3 BETWEEN 1 AND 3 2 MOD (3 BETWEEN 1 AND 3) (2 MOD 3) BETWEEN 1 AND 3 +1 0 1 +create or replace view v1 as select 2 % 3 IS FALSE, 2 % (3 IS FALSE), (2 % 3) IS FALSE; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 MOD 3 is false AS `2 % 3 IS FALSE`,2 MOD (3 is false) AS `2 % (3 IS FALSE)`,2 MOD 3 is false AS `(2 % 3) IS FALSE` +select 2 % 3 IS FALSE, 2 % (3 IS FALSE), (2 % 3) IS FALSE union select * from v1; +2 % 3 IS FALSE 2 % (3 IS FALSE) (2 % 3) IS FALSE +0 NULL 0 +create or replace view v1 as select charset(2 % 3 COLLATE latin1_bin), charset(2 % (3 COLLATE latin1_bin)), charset((2 % 3) COLLATE latin1_bin); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select charset(2 MOD 3 collate latin1_bin) AS `charset(2 % 3 COLLATE latin1_bin)`,charset(2 MOD 3 collate latin1_bin) AS `charset(2 % (3 COLLATE latin1_bin))`,charset((2 MOD 3) collate latin1_bin) AS `charset((2 % 3) COLLATE latin1_bin)` +select charset(2 % 3 COLLATE latin1_bin), charset(2 % (3 COLLATE latin1_bin)), charset((2 % 3) COLLATE latin1_bin) union select * from v1; +charset(2 % 3 COLLATE latin1_bin) charset(2 % (3 COLLATE latin1_bin)) charset((2 % 3) COLLATE latin1_bin) +binary binary latin1 +create or replace view v1 as select 2 % 3 IN (0,1), 2 % (3 IN (0,1)), (2 % 3) IN (0,1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 MOD 3 in (0,1) AS `2 % 3 IN (0,1)`,2 MOD (3 in (0,1)) AS `2 % (3 IN (0,1))`,2 MOD 3 in (0,1) AS `(2 % 3) IN (0,1)` +select 2 % 3 IN (0,1), 2 % (3 IN (0,1)), (2 % 3) IN (0,1) union select * from v1; +2 % 3 IN (0,1) 2 % (3 IN (0,1)) (2 % 3) IN (0,1) +0 NULL 0 +create or replace view v1 as select 2 % 3 OR 3, 2 % (3 OR 3), (2 % 3) OR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 MOD 3 or 3 AS `2 % 3 OR 3`,2 MOD (3 or 3) AS `2 % (3 OR 3)`,2 MOD 3 or 3 AS `(2 % 3) OR 3` +select 2 % 3 OR 3, 2 % (3 OR 3), (2 % 3) OR 3 union select * from v1; +2 % 3 OR 3 2 % (3 OR 3) (2 % 3) OR 3 +1 0 1 +create or replace view v1 as select 2 % 3 || 3, 2 % (3 || 3), (2 % 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 MOD 3 or 3 AS `2 % 3 || 3`,2 MOD (3 or 3) AS `2 % (3 || 3)`,2 MOD 3 or 3 AS `(2 % 3) || 3` +select 2 % 3 || 3, 2 % (3 || 3), (2 % 3) || 3 union select * from v1; +2 % 3 || 3 2 % (3 || 3) (2 % 3) || 3 +1 0 1 +create or replace view v1 as select 2 % 3 XOR 3, 2 % (3 XOR 3), (2 % 3) XOR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 MOD 3 xor 3 AS `2 % 3 XOR 3`,2 MOD (3 xor 3) AS `2 % (3 XOR 3)`,2 MOD 3 xor 3 AS `(2 % 3) XOR 3` +select 2 % 3 XOR 3, 2 % (3 XOR 3), (2 % 3) XOR 3 union select * from v1; +2 % 3 XOR 3 2 % (3 XOR 3) (2 % 3) XOR 3 +0 NULL 0 +create or replace view v1 as select 2 % 3 AND 3, 2 % (3 AND 3), (2 % 3) AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 MOD 3 and 3 AS `2 % 3 AND 3`,2 MOD (3 and 3) AS `2 % (3 AND 3)`,2 MOD 3 and 3 AS `(2 % 3) AND 3` +select 2 % 3 AND 3, 2 % (3 AND 3), (2 % 3) AND 3 union select * from v1; +2 % 3 AND 3 2 % (3 AND 3) (2 % 3) AND 3 +1 0 1 +create or replace view v1 as select 2 % 3 && 3, 2 % (3 && 3), (2 % 3) && 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 MOD 3 and 3 AS `2 % 3 && 3`,2 MOD (3 and 3) AS `2 % (3 && 3)`,2 MOD 3 and 3 AS `(2 % 3) && 3` +select 2 % 3 && 3, 2 % (3 && 3), (2 % 3) && 3 union select * from v1; +2 % 3 && 3 2 % (3 && 3) (2 % 3) && 3 +1 0 1 +create or replace view v1 as select 2 % 3 = 2, 2 % (3 = 2), (2 % 3) = 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 MOD 3 = 2 AS `2 % 3 = 2`,2 MOD (3 = 2) AS `2 % (3 = 2)`,2 MOD 3 = 2 AS `(2 % 3) = 2` +select 2 % 3 = 2, 2 % (3 = 2), (2 % 3) = 2 union select * from v1; +2 % 3 = 2 2 % (3 = 2) (2 % 3) = 2 +1 NULL 1 +create or replace view v1 as select 2 % 3 <=> 2, 2 % (3 <=> 2), (2 % 3) <=> 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 MOD 3 <=> 2 AS `2 % 3 <=> 2`,2 MOD (3 <=> 2) AS `2 % (3 <=> 2)`,2 MOD 3 <=> 2 AS `(2 % 3) <=> 2` +select 2 % 3 <=> 2, 2 % (3 <=> 2), (2 % 3) <=> 2 union select * from v1; +2 % 3 <=> 2 2 % (3 <=> 2) (2 % 3) <=> 2 +1 NULL 1 +create or replace view v1 as select 2 % 3 >= 1, 2 % (3 >= 1), (2 % 3) >= 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 MOD 3 >= 1 AS `2 % 3 >= 1`,2 MOD (3 >= 1) AS `2 % (3 >= 1)`,2 MOD 3 >= 1 AS `(2 % 3) >= 1` +select 2 % 3 >= 1, 2 % (3 >= 1), (2 % 3) >= 1 union select * from v1; +2 % 3 >= 1 2 % (3 >= 1) (2 % 3) >= 1 +1 0 1 +create or replace view v1 as select 2 % 3 <= 3, 2 % (3 <= 3), (2 % 3) <= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 MOD 3 <= 3 AS `2 % 3 <= 3`,2 MOD (3 <= 3) AS `2 % (3 <= 3)`,2 MOD 3 <= 3 AS `(2 % 3) <= 3` +select 2 % 3 <= 3, 2 % (3 <= 3), (2 % 3) <= 3 union select * from v1; +2 % 3 <= 3 2 % (3 <= 3) (2 % 3) <= 3 +1 0 1 +create or replace view v1 as select 2 % 3 < 3, 2 % (3 < 3), (2 % 3) < 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 MOD 3 < 3 AS `2 % 3 < 3`,2 MOD (3 < 3) AS `2 % (3 < 3)`,2 MOD 3 < 3 AS `(2 % 3) < 3` +select 2 % 3 < 3, 2 % (3 < 3), (2 % 3) < 3 union select * from v1; +2 % 3 < 3 2 % (3 < 3) (2 % 3) < 3 +1 NULL 1 +create or replace view v1 as select 2 % 3 <> 3, 2 % (3 <> 3), (2 % 3) <> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 MOD 3 <> 3 AS `2 % 3 <> 3`,2 MOD (3 <> 3) AS `2 % (3 <> 3)`,2 MOD 3 <> 3 AS `(2 % 3) <> 3` +select 2 % 3 <> 3, 2 % (3 <> 3), (2 % 3) <> 3 union select * from v1; +2 % 3 <> 3 2 % (3 <> 3) (2 % 3) <> 3 +1 NULL 1 +create or replace view v1 as select 2 % 3 > 3, 2 % (3 > 3), (2 % 3) > 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 MOD 3 > 3 AS `2 % 3 > 3`,2 MOD (3 > 3) AS `2 % (3 > 3)`,2 MOD 3 > 3 AS `(2 % 3) > 3` +select 2 % 3 > 3, 2 % (3 > 3), (2 % 3) > 3 union select * from v1; +2 % 3 > 3 2 % (3 > 3) (2 % 3) > 3 +0 NULL 0 +create or replace view v1 as select 2 % 3 != 3, 2 % (3 != 3), (2 % 3) != 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 MOD 3 <> 3 AS `2 % 3 != 3`,2 MOD (3 <> 3) AS `2 % (3 != 3)`,2 MOD 3 <> 3 AS `(2 % 3) != 3` +select 2 % 3 != 3, 2 % (3 != 3), (2 % 3) != 3 union select * from v1; +2 % 3 != 3 2 % (3 != 3) (2 % 3) != 3 +1 NULL 1 +create or replace view v1 as select 2 % 3 LIKE 2, 2 % (3 LIKE 2), (2 % 3) LIKE 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 MOD 3 like 2 AS `2 % 3 LIKE 2`,2 MOD (3 like 2) AS `2 % (3 LIKE 2)`,2 MOD 3 like 2 AS `(2 % 3) LIKE 2` +select 2 % 3 LIKE 2, 2 % (3 LIKE 2), (2 % 3) LIKE 2 union select * from v1; +2 % 3 LIKE 2 2 % (3 LIKE 2) (2 % 3) LIKE 2 +1 NULL 1 +create or replace view v1 as select 2 % 3 REGEXP 2, 2 % (3 REGEXP 2), (2 % 3) REGEXP 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 MOD 3 regexp 2 AS `2 % 3 REGEXP 2`,2 MOD (3 regexp 2) AS `2 % (3 REGEXP 2)`,2 MOD 3 regexp 2 AS `(2 % 3) REGEXP 2` +select 2 % 3 REGEXP 2, 2 % (3 REGEXP 2), (2 % 3) REGEXP 2 union select * from v1; +2 % 3 REGEXP 2 2 % (3 REGEXP 2) (2 % 3) REGEXP 2 +1 NULL 1 +create or replace view v1 as select 2 % 3 | 3, 2 % (3 | 3), (2 % 3) | 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 MOD 3 | 3 AS `2 % 3 | 3`,2 MOD (3 | 3) AS `2 % (3 | 3)`,2 MOD 3 | 3 AS `(2 % 3) | 3` +select 2 % 3 | 3, 2 % (3 | 3), (2 % 3) | 3 union select * from v1; +2 % 3 | 3 2 % (3 | 3) (2 % 3) | 3 +3 2 3 +create or replace view v1 as select 2 % 4 & 4, 2 % (4 & 4), (2 % 4) & 4; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 MOD 4 & 4 AS `2 % 4 & 4`,2 MOD (4 & 4) AS `2 % (4 & 4)`,2 MOD 4 & 4 AS `(2 % 4) & 4` +select 2 % 4 & 4, 2 % (4 & 4), (2 % 4) & 4 union select * from v1; +2 % 4 & 4 2 % (4 & 4) (2 % 4) & 4 +0 2 0 +create or replace view v1 as select 2 % 3 << 3, 2 % (3 << 3), (2 % 3) << 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 MOD 3 << 3 AS `2 % 3 << 3`,2 MOD (3 << 3) AS `2 % (3 << 3)`,2 MOD 3 << 3 AS `(2 % 3) << 3` +select 2 % 3 << 3, 2 % (3 << 3), (2 % 3) << 3 union select * from v1; +2 % 3 << 3 2 % (3 << 3) (2 % 3) << 3 +16 2 16 +create or replace view v1 as select 2 % 3 >> 3, 2 % (3 >> 3), (2 % 3) >> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 MOD 3 >> 3 AS `2 % 3 >> 3`,2 MOD (3 >> 3) AS `2 % (3 >> 3)`,2 MOD 3 >> 3 AS `(2 % 3) >> 3` +select 2 % 3 >> 3, 2 % (3 >> 3), (2 % 3) >> 3 union select * from v1; +2 % 3 >> 3 2 % (3 >> 3) (2 % 3) >> 3 +0 NULL 0 +create or replace view v1 as select 2 % '2000-01-01' +INTERVAL 1 DAY, 2 % ('2000-01-01' +INTERVAL 1 DAY), (2 % '2000-01-01') +INTERVAL 1 DAY; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 MOD '2000-01-01' + interval 1 day AS `2 % '2000-01-01' +INTERVAL 1 DAY`,2 MOD ('2000-01-01' + interval 1 day) AS `2 % ('2000-01-01' +INTERVAL 1 DAY)`,2 MOD '2000-01-01' + interval 1 day AS `(2 % '2000-01-01') +INTERVAL 1 DAY` +select 2 % '2000-01-01' +INTERVAL 1 DAY, 2 % ('2000-01-01' +INTERVAL 1 DAY), (2 % '2000-01-01') +INTERVAL 1 DAY union select * from v1; +2 % '2000-01-01' +INTERVAL 1 DAY 2 % ('2000-01-01' +INTERVAL 1 DAY) (2 % '2000-01-01') +INTERVAL 1 DAY +NULL 2 NULL +create or replace view v1 as select 2 % 3 + 3, 2 % (3 + 3), (2 % 3) + 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 MOD 3 + 3 AS `2 % 3 + 3`,2 MOD (3 + 3) AS `2 % (3 + 3)`,2 MOD 3 + 3 AS `(2 % 3) + 3` +select 2 % 3 + 3, 2 % (3 + 3), (2 % 3) + 3 union select * from v1; +2 % 3 + 3 2 % (3 + 3) (2 % 3) + 3 +5 2 5 +create or replace view v1 as select 2 % 3 - 3, 2 % (3 - 3), (2 % 3) - 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 MOD 3 - 3 AS `2 % 3 - 3`,2 MOD (3 - 3) AS `2 % (3 - 3)`,2 MOD 3 - 3 AS `(2 % 3) - 3` +select 2 % 3 - 3, 2 % (3 - 3), (2 % 3) - 3 union select * from v1; +2 % 3 - 3 2 % (3 - 3) (2 % 3) - 3 +-1 NULL -1 +create or replace view v1 as select 2 % 3 * 3, 2 % (3 * 3), (2 % 3) * 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 MOD 3 * 3 AS `2 % 3 * 3`,2 MOD (3 * 3) AS `2 % (3 * 3)`,2 MOD 3 * 3 AS `(2 % 3) * 3` +select 2 % 3 * 3, 2 % (3 * 3), (2 % 3) * 3 union select * from v1; +2 % 3 * 3 2 % (3 * 3) (2 % 3) * 3 +6 2 6 +create or replace view v1 as select 2 % 3 / 3, 2 % (3 / 3), (2 % 3) / 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 MOD 3 / 3 AS `2 % 3 / 3`,2 MOD (3 / 3) AS `2 % (3 / 3)`,2 MOD 3 / 3 AS `(2 % 3) / 3` +select 2 % 3 / 3, 2 % (3 / 3), (2 % 3) / 3 union select * from v1; +2 % 3 / 3 2 % (3 / 3) (2 % 3) / 3 +0.6667 0.0000 0.6667 +create or replace view v1 as select 3 % 4 DIV 3, 3 % (4 DIV 3), (3 % 4) DIV 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 3 MOD 4 DIV 3 AS `3 % 4 DIV 3`,3 MOD (4 DIV 3) AS `3 % (4 DIV 3)`,3 MOD 4 DIV 3 AS `(3 % 4) DIV 3` +select 3 % 4 DIV 3, 3 % (4 DIV 3), (3 % 4) DIV 3 union select * from v1; +3 % 4 DIV 3 3 % (4 DIV 3) (3 % 4) DIV 3 +1 0 1 +create or replace view v1 as select 2 % 3 MOD 3, 2 % (3 MOD 3), (2 % 3) MOD 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 MOD 3 MOD 3 AS `2 % 3 MOD 3`,2 MOD (3 MOD 3) AS `2 % (3 MOD 3)`,2 MOD 3 MOD 3 AS `(2 % 3) MOD 3` +select 2 % 3 MOD 3, 2 % (3 MOD 3), (2 % 3) MOD 3 union select * from v1; +2 % 3 MOD 3 2 % (3 MOD 3) (2 % 3) MOD 3 +2 NULL 2 +create or replace view v1 as select 2 % 3 % 3, 2 % (3 % 3), (2 % 3) % 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 MOD 3 MOD 3 AS `2 % 3 % 3`,2 MOD (3 MOD 3) AS `2 % (3 % 3)`,2 MOD 3 MOD 3 AS `(2 % 3) % 3` +select 2 % 3 % 3, 2 % (3 % 3), (2 % 3) % 3 union select * from v1; +2 % 3 % 3 2 % (3 % 3) (2 % 3) % 3 +2 NULL 2 +create or replace view v1 as select 2 % 3 ^ 3, 2 % (3 ^ 3), (2 % 3) ^ 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 MOD 3 ^ 3 AS `2 % 3 ^ 3`,2 MOD 3 ^ 3 AS `2 % (3 ^ 3)`,(2 MOD 3) ^ 3 AS `(2 % 3) ^ 3` +select 2 % 3 ^ 3, 2 % (3 ^ 3), (2 % 3) ^ 3 union select * from v1; +2 % 3 ^ 3 2 % (3 ^ 3) (2 % 3) ^ 3 +NULL NULL 1 +create or replace view v1 as select 2 % 3 BETWEEN 1 AND 3, 2 % (3 BETWEEN 1 AND 3), (2 % 3) BETWEEN 1 AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 MOD 3 between 1 and 3 AS `2 % 3 BETWEEN 1 AND 3`,2 MOD (3 between 1 and 3) AS `2 % (3 BETWEEN 1 AND 3)`,2 MOD 3 between 1 and 3 AS `(2 % 3) BETWEEN 1 AND 3` +select 2 % 3 BETWEEN 1 AND 3, 2 % (3 BETWEEN 1 AND 3), (2 % 3) BETWEEN 1 AND 3 union select * from v1; +2 % 3 BETWEEN 1 AND 3 2 % (3 BETWEEN 1 AND 3) (2 % 3) BETWEEN 1 AND 3 +1 0 1 +create or replace view v1 as select 2 ^ 3 IS FALSE, 2 ^ (3 IS FALSE), (2 ^ 3) IS FALSE; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 ^ 3 is false AS `2 ^ 3 IS FALSE`,2 ^ (3 is false) AS `2 ^ (3 IS FALSE)`,2 ^ 3 is false AS `(2 ^ 3) IS FALSE` +select 2 ^ 3 IS FALSE, 2 ^ (3 IS FALSE), (2 ^ 3) IS FALSE union select * from v1; +2 ^ 3 IS FALSE 2 ^ (3 IS FALSE) (2 ^ 3) IS FALSE +0 2 0 +create or replace view v1 as select charset(2 ^ 3 COLLATE latin1_bin), charset(2 ^ (3 COLLATE latin1_bin)), charset((2 ^ 3) COLLATE latin1_bin); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select charset(2 ^ 3 collate latin1_bin) AS `charset(2 ^ 3 COLLATE latin1_bin)`,charset(2 ^ 3 collate latin1_bin) AS `charset(2 ^ (3 COLLATE latin1_bin))`,charset((2 ^ 3) collate latin1_bin) AS `charset((2 ^ 3) COLLATE latin1_bin)` +select charset(2 ^ 3 COLLATE latin1_bin), charset(2 ^ (3 COLLATE latin1_bin)), charset((2 ^ 3) COLLATE latin1_bin) union select * from v1; +charset(2 ^ 3 COLLATE latin1_bin) charset(2 ^ (3 COLLATE latin1_bin)) charset((2 ^ 3) COLLATE latin1_bin) +binary binary latin1 +create or replace view v1 as select 2 ^ 3 IN (0,1), 2 ^ (3 IN (0,1)), (2 ^ 3) IN (0,1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 ^ 3 in (0,1) AS `2 ^ 3 IN (0,1)`,2 ^ (3 in (0,1)) AS `2 ^ (3 IN (0,1))`,2 ^ 3 in (0,1) AS `(2 ^ 3) IN (0,1)` +select 2 ^ 3 IN (0,1), 2 ^ (3 IN (0,1)), (2 ^ 3) IN (0,1) union select * from v1; +2 ^ 3 IN (0,1) 2 ^ (3 IN (0,1)) (2 ^ 3) IN (0,1) +1 2 1 +create or replace view v1 as select 2 ^ 3 OR 3, 2 ^ (3 OR 3), (2 ^ 3) OR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 ^ 3 or 3 AS `2 ^ 3 OR 3`,2 ^ (3 or 3) AS `2 ^ (3 OR 3)`,2 ^ 3 or 3 AS `(2 ^ 3) OR 3` +select 2 ^ 3 OR 3, 2 ^ (3 OR 3), (2 ^ 3) OR 3 union select * from v1; +2 ^ 3 OR 3 2 ^ (3 OR 3) (2 ^ 3) OR 3 +1 3 1 +create or replace view v1 as select 2 ^ 3 || 3, 2 ^ (3 || 3), (2 ^ 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 ^ 3 or 3 AS `2 ^ 3 || 3`,2 ^ (3 or 3) AS `2 ^ (3 || 3)`,2 ^ 3 or 3 AS `(2 ^ 3) || 3` +select 2 ^ 3 || 3, 2 ^ (3 || 3), (2 ^ 3) || 3 union select * from v1; +2 ^ 3 || 3 2 ^ (3 || 3) (2 ^ 3) || 3 +1 3 1 +create or replace view v1 as select 2 ^ 3 XOR 3, 2 ^ (3 XOR 3), (2 ^ 3) XOR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 ^ 3 xor 3 AS `2 ^ 3 XOR 3`,2 ^ (3 xor 3) AS `2 ^ (3 XOR 3)`,2 ^ 3 xor 3 AS `(2 ^ 3) XOR 3` +select 2 ^ 3 XOR 3, 2 ^ (3 XOR 3), (2 ^ 3) XOR 3 union select * from v1; +2 ^ 3 XOR 3 2 ^ (3 XOR 3) (2 ^ 3) XOR 3 +0 2 0 +create or replace view v1 as select 2 ^ 3 AND 3, 2 ^ (3 AND 3), (2 ^ 3) AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 ^ 3 and 3 AS `2 ^ 3 AND 3`,2 ^ (3 and 3) AS `2 ^ (3 AND 3)`,2 ^ 3 and 3 AS `(2 ^ 3) AND 3` +select 2 ^ 3 AND 3, 2 ^ (3 AND 3), (2 ^ 3) AND 3 union select * from v1; +2 ^ 3 AND 3 2 ^ (3 AND 3) (2 ^ 3) AND 3 +1 3 1 +create or replace view v1 as select 2 ^ 3 && 3, 2 ^ (3 && 3), (2 ^ 3) && 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 ^ 3 and 3 AS `2 ^ 3 && 3`,2 ^ (3 and 3) AS `2 ^ (3 && 3)`,2 ^ 3 and 3 AS `(2 ^ 3) && 3` +select 2 ^ 3 && 3, 2 ^ (3 && 3), (2 ^ 3) && 3 union select * from v1; +2 ^ 3 && 3 2 ^ (3 && 3) (2 ^ 3) && 3 +1 3 1 +create or replace view v1 as select 2 ^ 3 = 3, 2 ^ (3 = 3), (2 ^ 3) = 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 ^ 3 = 3 AS `2 ^ 3 = 3`,2 ^ (3 = 3) AS `2 ^ (3 = 3)`,2 ^ 3 = 3 AS `(2 ^ 3) = 3` +select 2 ^ 3 = 3, 2 ^ (3 = 3), (2 ^ 3) = 3 union select * from v1; +2 ^ 3 = 3 2 ^ (3 = 3) (2 ^ 3) = 3 +0 3 0 +create or replace view v1 as select 2 ^ 3 <=> 3, 2 ^ (3 <=> 3), (2 ^ 3) <=> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 ^ 3 <=> 3 AS `2 ^ 3 <=> 3`,2 ^ (3 <=> 3) AS `2 ^ (3 <=> 3)`,2 ^ 3 <=> 3 AS `(2 ^ 3) <=> 3` +select 2 ^ 3 <=> 3, 2 ^ (3 <=> 3), (2 ^ 3) <=> 3 union select * from v1; +2 ^ 3 <=> 3 2 ^ (3 <=> 3) (2 ^ 3) <=> 3 +0 3 0 +create or replace view v1 as select 2 ^ 3 >= 3, 2 ^ (3 >= 3), (2 ^ 3) >= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 ^ 3 >= 3 AS `2 ^ 3 >= 3`,2 ^ (3 >= 3) AS `2 ^ (3 >= 3)`,2 ^ 3 >= 3 AS `(2 ^ 3) >= 3` +select 2 ^ 3 >= 3, 2 ^ (3 >= 3), (2 ^ 3) >= 3 union select * from v1; +2 ^ 3 >= 3 2 ^ (3 >= 3) (2 ^ 3) >= 3 +0 3 0 +create or replace view v1 as select 2 ^ 3 <= 3, 2 ^ (3 <= 3), (2 ^ 3) <= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 ^ 3 <= 3 AS `2 ^ 3 <= 3`,2 ^ (3 <= 3) AS `2 ^ (3 <= 3)`,2 ^ 3 <= 3 AS `(2 ^ 3) <= 3` +select 2 ^ 3 <= 3, 2 ^ (3 <= 3), (2 ^ 3) <= 3 union select * from v1; +2 ^ 3 <= 3 2 ^ (3 <= 3) (2 ^ 3) <= 3 +1 3 1 +create or replace view v1 as select 2 ^ 3 < 3, 2 ^ (3 < 3), (2 ^ 3) < 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 ^ 3 < 3 AS `2 ^ 3 < 3`,2 ^ (3 < 3) AS `2 ^ (3 < 3)`,2 ^ 3 < 3 AS `(2 ^ 3) < 3` +select 2 ^ 3 < 3, 2 ^ (3 < 3), (2 ^ 3) < 3 union select * from v1; +2 ^ 3 < 3 2 ^ (3 < 3) (2 ^ 3) < 3 +1 2 1 +create or replace view v1 as select 2 ^ 3 <> 3, 2 ^ (3 <> 3), (2 ^ 3) <> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 ^ 3 <> 3 AS `2 ^ 3 <> 3`,2 ^ (3 <> 3) AS `2 ^ (3 <> 3)`,2 ^ 3 <> 3 AS `(2 ^ 3) <> 3` +select 2 ^ 3 <> 3, 2 ^ (3 <> 3), (2 ^ 3) <> 3 union select * from v1; +2 ^ 3 <> 3 2 ^ (3 <> 3) (2 ^ 3) <> 3 +1 2 1 +create or replace view v1 as select 2 ^ 3 > 3, 2 ^ (3 > 3), (2 ^ 3) > 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 ^ 3 > 3 AS `2 ^ 3 > 3`,2 ^ (3 > 3) AS `2 ^ (3 > 3)`,2 ^ 3 > 3 AS `(2 ^ 3) > 3` +select 2 ^ 3 > 3, 2 ^ (3 > 3), (2 ^ 3) > 3 union select * from v1; +2 ^ 3 > 3 2 ^ (3 > 3) (2 ^ 3) > 3 +0 2 0 +create or replace view v1 as select 2 ^ 3 != 3, 2 ^ (3 != 3), (2 ^ 3) != 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 ^ 3 <> 3 AS `2 ^ 3 != 3`,2 ^ (3 <> 3) AS `2 ^ (3 != 3)`,2 ^ 3 <> 3 AS `(2 ^ 3) != 3` +select 2 ^ 3 != 3, 2 ^ (3 != 3), (2 ^ 3) != 3 union select * from v1; +2 ^ 3 != 3 2 ^ (3 != 3) (2 ^ 3) != 3 +1 2 1 +create or replace view v1 as select 2 ^ 3 LIKE 3, 2 ^ (3 LIKE 3), (2 ^ 3) LIKE 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 ^ 3 like 3 AS `2 ^ 3 LIKE 3`,2 ^ (3 like 3) AS `2 ^ (3 LIKE 3)`,2 ^ 3 like 3 AS `(2 ^ 3) LIKE 3` +select 2 ^ 3 LIKE 3, 2 ^ (3 LIKE 3), (2 ^ 3) LIKE 3 union select * from v1; +2 ^ 3 LIKE 3 2 ^ (3 LIKE 3) (2 ^ 3) LIKE 3 +0 3 0 +create or replace view v1 as select 2 ^ 3 REGEXP 3, 2 ^ (3 REGEXP 3), (2 ^ 3) REGEXP 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 ^ 3 regexp 3 AS `2 ^ 3 REGEXP 3`,2 ^ (3 regexp 3) AS `2 ^ (3 REGEXP 3)`,2 ^ 3 regexp 3 AS `(2 ^ 3) REGEXP 3` +select 2 ^ 3 REGEXP 3, 2 ^ (3 REGEXP 3), (2 ^ 3) REGEXP 3 union select * from v1; +2 ^ 3 REGEXP 3 2 ^ (3 REGEXP 3) (2 ^ 3) REGEXP 3 +0 3 0 +create or replace view v1 as select 2 ^ 3 | 3, 2 ^ (3 | 3), (2 ^ 3) | 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 ^ 3 | 3 AS `2 ^ 3 | 3`,2 ^ (3 | 3) AS `2 ^ (3 | 3)`,2 ^ 3 | 3 AS `(2 ^ 3) | 3` +select 2 ^ 3 | 3, 2 ^ (3 | 3), (2 ^ 3) | 3 union select * from v1; +2 ^ 3 | 3 2 ^ (3 | 3) (2 ^ 3) | 3 +3 1 3 +create or replace view v1 as select 2 ^ 0 & 0, 2 ^ (0 & 0), (2 ^ 0) & 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 ^ 0 & 0 AS `2 ^ 0 & 0`,2 ^ (0 & 0) AS `2 ^ (0 & 0)`,2 ^ 0 & 0 AS `(2 ^ 0) & 0` +select 2 ^ 0 & 0, 2 ^ (0 & 0), (2 ^ 0) & 0 union select * from v1; +2 ^ 0 & 0 2 ^ (0 & 0) (2 ^ 0) & 0 +0 2 0 +create or replace view v1 as select 2 ^ 3 << 3, 2 ^ (3 << 3), (2 ^ 3) << 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 ^ 3 << 3 AS `2 ^ 3 << 3`,2 ^ (3 << 3) AS `2 ^ (3 << 3)`,2 ^ 3 << 3 AS `(2 ^ 3) << 3` +select 2 ^ 3 << 3, 2 ^ (3 << 3), (2 ^ 3) << 3 union select * from v1; +2 ^ 3 << 3 2 ^ (3 << 3) (2 ^ 3) << 3 +8 26 8 +create or replace view v1 as select 2 ^ 3 >> 3, 2 ^ (3 >> 3), (2 ^ 3) >> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 ^ 3 >> 3 AS `2 ^ 3 >> 3`,2 ^ (3 >> 3) AS `2 ^ (3 >> 3)`,2 ^ 3 >> 3 AS `(2 ^ 3) >> 3` +select 2 ^ 3 >> 3, 2 ^ (3 >> 3), (2 ^ 3) >> 3 union select * from v1; +2 ^ 3 >> 3 2 ^ (3 >> 3) (2 ^ 3) >> 3 +0 2 0 +create or replace view v1 as select 2 ^ '2000-01-01' +INTERVAL 1 DAY, 2 ^ ('2000-01-01' +INTERVAL 1 DAY), (2 ^ '2000-01-01') +INTERVAL 1 DAY; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 ^ '2000-01-01' + interval 1 day AS `2 ^ '2000-01-01' +INTERVAL 1 DAY`,2 ^ ('2000-01-01' + interval 1 day) AS `2 ^ ('2000-01-01' +INTERVAL 1 DAY)`,2 ^ '2000-01-01' + interval 1 day AS `(2 ^ '2000-01-01') +INTERVAL 1 DAY` +select 2 ^ '2000-01-01' +INTERVAL 1 DAY, 2 ^ ('2000-01-01' +INTERVAL 1 DAY), (2 ^ '2000-01-01') +INTERVAL 1 DAY union select * from v1; +2 ^ '2000-01-01' +INTERVAL 1 DAY 2 ^ ('2000-01-01' +INTERVAL 1 DAY) (2 ^ '2000-01-01') +INTERVAL 1 DAY +NULL 20000100 NULL +create or replace view v1 as select 2 ^ 3 + 1, 2 ^ (3 + 1), (2 ^ 3) + 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 ^ 3 + 1 AS `2 ^ 3 + 1`,2 ^ (3 + 1) AS `2 ^ (3 + 1)`,2 ^ 3 + 1 AS `(2 ^ 3) + 1` +select 2 ^ 3 + 1, 2 ^ (3 + 1), (2 ^ 3) + 1 union select * from v1; +2 ^ 3 + 1 2 ^ (3 + 1) (2 ^ 3) + 1 +2 6 2 +create or replace view v1 as select 5 ^ 1 - 1, 5 ^ (1 - 1), (5 ^ 1) - 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 5 ^ 1 - 1 AS `5 ^ 1 - 1`,5 ^ (1 - 1) AS `5 ^ (1 - 1)`,5 ^ 1 - 1 AS `(5 ^ 1) - 1` +select 5 ^ 1 - 1, 5 ^ (1 - 1), (5 ^ 1) - 1 union select * from v1; +5 ^ 1 - 1 5 ^ (1 - 1) (5 ^ 1) - 1 +3 5 3 +create or replace view v1 as select 2 ^ 3 * 3, 2 ^ (3 * 3), (2 ^ 3) * 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 ^ 3 * 3 AS `2 ^ 3 * 3`,2 ^ (3 * 3) AS `2 ^ (3 * 3)`,2 ^ 3 * 3 AS `(2 ^ 3) * 3` +select 2 ^ 3 * 3, 2 ^ (3 * 3), (2 ^ 3) * 3 union select * from v1; +2 ^ 3 * 3 2 ^ (3 * 3) (2 ^ 3) * 3 +3 11 3 +create or replace view v1 as select 2 ^ 3 / 3, 2 ^ (3 / 3), (2 ^ 3) / 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 ^ 3 / 3 AS `2 ^ 3 / 3`,2 ^ (3 / 3) AS `2 ^ (3 / 3)`,2 ^ 3 / 3 AS `(2 ^ 3) / 3` +select 2 ^ 3 / 3, 2 ^ (3 / 3), (2 ^ 3) / 3 union select * from v1; +2 ^ 3 / 3 2 ^ (3 / 3) (2 ^ 3) / 3 +0.3333 3 0.3333 +create or replace view v1 as select 2 ^ 3 DIV 3, 2 ^ (3 DIV 3), (2 ^ 3) DIV 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 ^ 3 DIV 3 AS `2 ^ 3 DIV 3`,2 ^ (3 DIV 3) AS `2 ^ (3 DIV 3)`,2 ^ 3 DIV 3 AS `(2 ^ 3) DIV 3` +select 2 ^ 3 DIV 3, 2 ^ (3 DIV 3), (2 ^ 3) DIV 3 union select * from v1; +2 ^ 3 DIV 3 2 ^ (3 DIV 3) (2 ^ 3) DIV 3 +0 3 0 +create or replace view v1 as select 2 ^ 3 MOD 3, 2 ^ (3 MOD 3), (2 ^ 3) MOD 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 ^ 3 MOD 3 AS `2 ^ 3 MOD 3`,2 ^ (3 MOD 3) AS `2 ^ (3 MOD 3)`,2 ^ 3 MOD 3 AS `(2 ^ 3) MOD 3` +select 2 ^ 3 MOD 3, 2 ^ (3 MOD 3), (2 ^ 3) MOD 3 union select * from v1; +2 ^ 3 MOD 3 2 ^ (3 MOD 3) (2 ^ 3) MOD 3 +1 2 1 +create or replace view v1 as select 2 ^ 3 % 3, 2 ^ (3 % 3), (2 ^ 3) % 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 ^ 3 MOD 3 AS `2 ^ 3 % 3`,2 ^ (3 MOD 3) AS `2 ^ (3 % 3)`,2 ^ 3 MOD 3 AS `(2 ^ 3) % 3` +select 2 ^ 3 % 3, 2 ^ (3 % 3), (2 ^ 3) % 3 union select * from v1; +2 ^ 3 % 3 2 ^ (3 % 3) (2 ^ 3) % 3 +1 2 1 +create or replace view v1 as select 2 ^ 3 BETWEEN 1 AND 3, 2 ^ (3 BETWEEN 1 AND 3), (2 ^ 3) BETWEEN 1 AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 ^ 3 between 1 and 3 AS `2 ^ 3 BETWEEN 1 AND 3`,2 ^ (3 between 1 and 3) AS `2 ^ (3 BETWEEN 1 AND 3)`,2 ^ 3 between 1 and 3 AS `(2 ^ 3) BETWEEN 1 AND 3` +select 2 ^ 3 BETWEEN 1 AND 3, 2 ^ (3 BETWEEN 1 AND 3), (2 ^ 3) BETWEEN 1 AND 3 union select * from v1; +2 ^ 3 BETWEEN 1 AND 3 2 ^ (3 BETWEEN 1 AND 3) (2 ^ 3) BETWEEN 1 AND 3 +1 3 1 +create or replace view v1 as select 2 BETWEEN 1 AND 1 IS FALSE, 2 BETWEEN 1 AND (1 IS FALSE), (2 BETWEEN 1 AND 1) IS FALSE; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 between 1 and 1 is false AS `2 BETWEEN 1 AND 1 IS FALSE`,2 between 1 and (1 is false) AS `2 BETWEEN 1 AND (1 IS FALSE)`,2 between 1 and 1 is false AS `(2 BETWEEN 1 AND 1) IS FALSE` +select 2 BETWEEN 1 AND 1 IS FALSE, 2 BETWEEN 1 AND (1 IS FALSE), (2 BETWEEN 1 AND 1) IS FALSE union select * from v1; +2 BETWEEN 1 AND 1 IS FALSE 2 BETWEEN 1 AND (1 IS FALSE) (2 BETWEEN 1 AND 1) IS FALSE +1 0 1 +create or replace view v1 as select charset(2 BETWEEN 1 AND 3 COLLATE latin1_bin), charset(2 BETWEEN 1 AND (3 COLLATE latin1_bin)), charset((2 BETWEEN 1 AND 3) COLLATE latin1_bin); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select charset(2 between 1 and 3 collate latin1_bin) AS `charset(2 BETWEEN 1 AND 3 COLLATE latin1_bin)`,charset(2 between 1 and 3 collate latin1_bin) AS `charset(2 BETWEEN 1 AND (3 COLLATE latin1_bin))`,charset((2 between 1 and 3) collate latin1_bin) AS `charset((2 BETWEEN 1 AND 3) COLLATE latin1_bin)` +select charset(2 BETWEEN 1 AND 3 COLLATE latin1_bin), charset(2 BETWEEN 1 AND (3 COLLATE latin1_bin)), charset((2 BETWEEN 1 AND 3) COLLATE latin1_bin) union select * from v1; +charset(2 BETWEEN 1 AND 3 COLLATE latin1_bin) charset(2 BETWEEN 1 AND (3 COLLATE latin1_bin)) charset((2 BETWEEN 1 AND 3) COLLATE latin1_bin) +binary binary latin1 +create or replace view v1 as select 2 BETWEEN 1 AND 3 IN (0,1), 2 BETWEEN 1 AND (3 IN (0,1)), (2 BETWEEN 1 AND 3) IN (0,1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 between 1 and 3 in (0,1) AS `2 BETWEEN 1 AND 3 IN (0,1)`,2 between 1 and 3 in (0,1) AS `2 BETWEEN 1 AND (3 IN (0,1))`,(2 between 1 and 3) in (0,1) AS `(2 BETWEEN 1 AND 3) IN (0,1)` +select 2 BETWEEN 1 AND 3 IN (0,1), 2 BETWEEN 1 AND (3 IN (0,1)), (2 BETWEEN 1 AND 3) IN (0,1) union select * from v1; +2 BETWEEN 1 AND 3 IN (0,1) 2 BETWEEN 1 AND (3 IN (0,1)) (2 BETWEEN 1 AND 3) IN (0,1) +0 0 1 +create or replace view v1 as select 2 BETWEEN 1 AND 3 OR 3, 2 BETWEEN 1 AND (3 OR 3), (2 BETWEEN 1 AND 3) OR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 between 1 and 3 or 3 AS `2 BETWEEN 1 AND 3 OR 3`,2 between 1 and (3 or 3) AS `2 BETWEEN 1 AND (3 OR 3)`,2 between 1 and 3 or 3 AS `(2 BETWEEN 1 AND 3) OR 3` +select 2 BETWEEN 1 AND 3 OR 3, 2 BETWEEN 1 AND (3 OR 3), (2 BETWEEN 1 AND 3) OR 3 union select * from v1; +2 BETWEEN 1 AND 3 OR 3 2 BETWEEN 1 AND (3 OR 3) (2 BETWEEN 1 AND 3) OR 3 +1 0 1 +create or replace view v1 as select 2 BETWEEN 1 AND 3 || 3, 2 BETWEEN 1 AND (3 || 3), (2 BETWEEN 1 AND 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 between 1 and 3 or 3 AS `2 BETWEEN 1 AND 3 || 3`,2 between 1 and (3 or 3) AS `2 BETWEEN 1 AND (3 || 3)`,2 between 1 and 3 or 3 AS `(2 BETWEEN 1 AND 3) || 3` +select 2 BETWEEN 1 AND 3 || 3, 2 BETWEEN 1 AND (3 || 3), (2 BETWEEN 1 AND 3) || 3 union select * from v1; +2 BETWEEN 1 AND 3 || 3 2 BETWEEN 1 AND (3 || 3) (2 BETWEEN 1 AND 3) || 3 +1 0 1 +create or replace view v1 as select 2 BETWEEN 1 AND 1 XOR 1, 2 BETWEEN 1 AND (1 XOR 1), (2 BETWEEN 1 AND 1) XOR 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 between 1 and 1 xor 1 AS `2 BETWEEN 1 AND 1 XOR 1`,2 between 1 and (1 xor 1) AS `2 BETWEEN 1 AND (1 XOR 1)`,2 between 1 and 1 xor 1 AS `(2 BETWEEN 1 AND 1) XOR 1` +select 2 BETWEEN 1 AND 1 XOR 1, 2 BETWEEN 1 AND (1 XOR 1), (2 BETWEEN 1 AND 1) XOR 1 union select * from v1; +2 BETWEEN 1 AND 1 XOR 1 2 BETWEEN 1 AND (1 XOR 1) (2 BETWEEN 1 AND 1) XOR 1 +1 0 1 +create or replace view v1 as select 2 BETWEEN 1 AND 3 AND 3, 2 BETWEEN 1 AND (3 AND 3), (2 BETWEEN 1 AND 3) AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 between 1 and 3 and 3 AS `2 BETWEEN 1 AND 3 AND 3`,2 between 1 and (3 and 3) AS `2 BETWEEN 1 AND (3 AND 3)`,2 between 1 and 3 and 3 AS `(2 BETWEEN 1 AND 3) AND 3` +select 2 BETWEEN 1 AND 3 AND 3, 2 BETWEEN 1 AND (3 AND 3), (2 BETWEEN 1 AND 3) AND 3 union select * from v1; +2 BETWEEN 1 AND 3 AND 3 2 BETWEEN 1 AND (3 AND 3) (2 BETWEEN 1 AND 3) AND 3 +1 0 1 +create or replace view v1 as select 2 BETWEEN 1 AND 3 && 3, 2 BETWEEN 1 AND (3 && 3), (2 BETWEEN 1 AND 3) && 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 between 1 and 3 and 3 AS `2 BETWEEN 1 AND 3 && 3`,2 between 1 and (3 and 3) AS `2 BETWEEN 1 AND (3 && 3)`,2 between 1 and 3 and 3 AS `(2 BETWEEN 1 AND 3) && 3` +select 2 BETWEEN 1 AND 3 && 3, 2 BETWEEN 1 AND (3 && 3), (2 BETWEEN 1 AND 3) && 3 union select * from v1; +2 BETWEEN 1 AND 3 && 3 2 BETWEEN 1 AND (3 && 3) (2 BETWEEN 1 AND 3) && 3 +1 0 1 +create or replace view v1 as select 2 BETWEEN 1 AND 3 = 1, 2 BETWEEN 1 AND (3 = 1), (2 BETWEEN 1 AND 3) = 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 between 1 and 3 = 1 AS `2 BETWEEN 1 AND 3 = 1`,2 between 1 and (3 = 1) AS `2 BETWEEN 1 AND (3 = 1)`,2 between 1 and 3 = 1 AS `(2 BETWEEN 1 AND 3) = 1` +select 2 BETWEEN 1 AND 3 = 1, 2 BETWEEN 1 AND (3 = 1), (2 BETWEEN 1 AND 3) = 1 union select * from v1; +2 BETWEEN 1 AND 3 = 1 2 BETWEEN 1 AND (3 = 1) (2 BETWEEN 1 AND 3) = 1 +1 0 1 +create or replace view v1 as select 2 BETWEEN 1 AND 3 <=> 1, 2 BETWEEN 1 AND (3 <=> 1), (2 BETWEEN 1 AND 3) <=> 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 between 1 and 3 <=> 1 AS `2 BETWEEN 1 AND 3 <=> 1`,2 between 1 and (3 <=> 1) AS `2 BETWEEN 1 AND (3 <=> 1)`,2 between 1 and 3 <=> 1 AS `(2 BETWEEN 1 AND 3) <=> 1` +select 2 BETWEEN 1 AND 3 <=> 1, 2 BETWEEN 1 AND (3 <=> 1), (2 BETWEEN 1 AND 3) <=> 1 union select * from v1; +2 BETWEEN 1 AND 3 <=> 1 2 BETWEEN 1 AND (3 <=> 1) (2 BETWEEN 1 AND 3) <=> 1 +1 0 1 +create or replace view v1 as select 2 BETWEEN 1 AND 3 >= 1, 2 BETWEEN 1 AND (3 >= 1), (2 BETWEEN 1 AND 3) >= 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 between 1 and 3 >= 1 AS `2 BETWEEN 1 AND 3 >= 1`,2 between 1 and (3 >= 1) AS `2 BETWEEN 1 AND (3 >= 1)`,2 between 1 and 3 >= 1 AS `(2 BETWEEN 1 AND 3) >= 1` +select 2 BETWEEN 1 AND 3 >= 1, 2 BETWEEN 1 AND (3 >= 1), (2 BETWEEN 1 AND 3) >= 1 union select * from v1; +2 BETWEEN 1 AND 3 >= 1 2 BETWEEN 1 AND (3 >= 1) (2 BETWEEN 1 AND 3) >= 1 +1 0 1 +create or replace view v1 as select 2 BETWEEN 1 AND 3 <= 3, 2 BETWEEN 1 AND (3 <= 3), (2 BETWEEN 1 AND 3) <= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 between 1 and 3 <= 3 AS `2 BETWEEN 1 AND 3 <= 3`,2 between 1 and (3 <= 3) AS `2 BETWEEN 1 AND (3 <= 3)`,2 between 1 and 3 <= 3 AS `(2 BETWEEN 1 AND 3) <= 3` +select 2 BETWEEN 1 AND 3 <= 3, 2 BETWEEN 1 AND (3 <= 3), (2 BETWEEN 1 AND 3) <= 3 union select * from v1; +2 BETWEEN 1 AND 3 <= 3 2 BETWEEN 1 AND (3 <= 3) (2 BETWEEN 1 AND 3) <= 3 +1 0 1 +create or replace view v1 as select 2 BETWEEN 1 AND 3 < 3, 2 BETWEEN 1 AND (3 < 3), (2 BETWEEN 1 AND 3) < 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 between 1 and 3 < 3 AS `2 BETWEEN 1 AND 3 < 3`,2 between 1 and (3 < 3) AS `2 BETWEEN 1 AND (3 < 3)`,2 between 1 and 3 < 3 AS `(2 BETWEEN 1 AND 3) < 3` +select 2 BETWEEN 1 AND 3 < 3, 2 BETWEEN 1 AND (3 < 3), (2 BETWEEN 1 AND 3) < 3 union select * from v1; +2 BETWEEN 1 AND 3 < 3 2 BETWEEN 1 AND (3 < 3) (2 BETWEEN 1 AND 3) < 3 +1 0 1 +create or replace view v1 as select 2 BETWEEN 1 AND 3 <> 3, 2 BETWEEN 1 AND (3 <> 3), (2 BETWEEN 1 AND 3) <> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 between 1 and 3 <> 3 AS `2 BETWEEN 1 AND 3 <> 3`,2 between 1 and (3 <> 3) AS `2 BETWEEN 1 AND (3 <> 3)`,2 between 1 and 3 <> 3 AS `(2 BETWEEN 1 AND 3) <> 3` +select 2 BETWEEN 1 AND 3 <> 3, 2 BETWEEN 1 AND (3 <> 3), (2 BETWEEN 1 AND 3) <> 3 union select * from v1; +2 BETWEEN 1 AND 3 <> 3 2 BETWEEN 1 AND (3 <> 3) (2 BETWEEN 1 AND 3) <> 3 +1 0 1 +create or replace view v1 as select 2 BETWEEN 1 AND 3 > 0, 2 BETWEEN 1 AND (3 > 0), (2 BETWEEN 1 AND 3) > 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 between 1 and 3 > 0 AS `2 BETWEEN 1 AND 3 > 0`,2 between 1 and (3 > 0) AS `2 BETWEEN 1 AND (3 > 0)`,2 between 1 and 3 > 0 AS `(2 BETWEEN 1 AND 3) > 0` +select 2 BETWEEN 1 AND 3 > 0, 2 BETWEEN 1 AND (3 > 0), (2 BETWEEN 1 AND 3) > 0 union select * from v1; +2 BETWEEN 1 AND 3 > 0 2 BETWEEN 1 AND (3 > 0) (2 BETWEEN 1 AND 3) > 0 +1 0 1 +create or replace view v1 as select 2 BETWEEN 1 AND 3 != 3, 2 BETWEEN 1 AND (3 != 3), (2 BETWEEN 1 AND 3) != 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 between 1 and 3 <> 3 AS `2 BETWEEN 1 AND 3 != 3`,2 between 1 and (3 <> 3) AS `2 BETWEEN 1 AND (3 != 3)`,2 between 1 and 3 <> 3 AS `(2 BETWEEN 1 AND 3) != 3` +select 2 BETWEEN 1 AND 3 != 3, 2 BETWEEN 1 AND (3 != 3), (2 BETWEEN 1 AND 3) != 3 union select * from v1; +2 BETWEEN 1 AND 3 != 3 2 BETWEEN 1 AND (3 != 3) (2 BETWEEN 1 AND 3) != 3 +1 0 1 +create or replace view v1 as select 2 BETWEEN 1 AND 3 LIKE 1, 2 BETWEEN 1 AND (3 LIKE 1), (2 BETWEEN 1 AND 3) LIKE 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 between 1 and 3 like 1 AS `2 BETWEEN 1 AND 3 LIKE 1`,2 between 1 and 3 like 1 AS `2 BETWEEN 1 AND (3 LIKE 1)`,(2 between 1 and 3) like 1 AS `(2 BETWEEN 1 AND 3) LIKE 1` +select 2 BETWEEN 1 AND 3 LIKE 1, 2 BETWEEN 1 AND (3 LIKE 1), (2 BETWEEN 1 AND 3) LIKE 1 union select * from v1; +2 BETWEEN 1 AND 3 LIKE 1 2 BETWEEN 1 AND (3 LIKE 1) (2 BETWEEN 1 AND 3) LIKE 1 +0 0 1 +create or replace view v1 as select 2 BETWEEN 1 AND 3 REGEXP 1, 2 BETWEEN 1 AND (3 REGEXP 1), (2 BETWEEN 1 AND 3) REGEXP 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 between 1 and 3 regexp 1 AS `2 BETWEEN 1 AND 3 REGEXP 1`,2 between 1 and 3 regexp 1 AS `2 BETWEEN 1 AND (3 REGEXP 1)`,(2 between 1 and 3) regexp 1 AS `(2 BETWEEN 1 AND 3) REGEXP 1` +select 2 BETWEEN 1 AND 3 REGEXP 1, 2 BETWEEN 1 AND (3 REGEXP 1), (2 BETWEEN 1 AND 3) REGEXP 1 union select * from v1; +2 BETWEEN 1 AND 3 REGEXP 1 2 BETWEEN 1 AND (3 REGEXP 1) (2 BETWEEN 1 AND 3) REGEXP 1 +0 0 1 +create or replace view v1 as select 2 BETWEEN 1 AND 3 | 3, 2 BETWEEN 1 AND (3 | 3), (2 BETWEEN 1 AND 3) | 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 between 1 and 3 | 3 AS `2 BETWEEN 1 AND 3 | 3`,2 between 1 and 3 | 3 AS `2 BETWEEN 1 AND (3 | 3)`,(2 between 1 and 3) | 3 AS `(2 BETWEEN 1 AND 3) | 3` +select 2 BETWEEN 1 AND 3 | 3, 2 BETWEEN 1 AND (3 | 3), (2 BETWEEN 1 AND 3) | 3 union select * from v1; +2 BETWEEN 1 AND 3 | 3 2 BETWEEN 1 AND (3 | 3) (2 BETWEEN 1 AND 3) | 3 +1 1 3 +create or replace view v1 as select 2 BETWEEN 1 AND 2 & 2, 2 BETWEEN 1 AND (2 & 2), (2 BETWEEN 1 AND 2) & 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 between 1 and 2 & 2 AS `2 BETWEEN 1 AND 2 & 2`,2 between 1 and 2 & 2 AS `2 BETWEEN 1 AND (2 & 2)`,(2 between 1 and 2) & 2 AS `(2 BETWEEN 1 AND 2) & 2` +select 2 BETWEEN 1 AND 2 & 2, 2 BETWEEN 1 AND (2 & 2), (2 BETWEEN 1 AND 2) & 2 union select * from v1; +2 BETWEEN 1 AND 2 & 2 2 BETWEEN 1 AND (2 & 2) (2 BETWEEN 1 AND 2) & 2 +1 1 0 +create or replace view v1 as select 2 BETWEEN 1 AND 3 << 3, 2 BETWEEN 1 AND (3 << 3), (2 BETWEEN 1 AND 3) << 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 between 1 and 3 << 3 AS `2 BETWEEN 1 AND 3 << 3`,2 between 1 and 3 << 3 AS `2 BETWEEN 1 AND (3 << 3)`,(2 between 1 and 3) << 3 AS `(2 BETWEEN 1 AND 3) << 3` +select 2 BETWEEN 1 AND 3 << 3, 2 BETWEEN 1 AND (3 << 3), (2 BETWEEN 1 AND 3) << 3 union select * from v1; +2 BETWEEN 1 AND 3 << 3 2 BETWEEN 1 AND (3 << 3) (2 BETWEEN 1 AND 3) << 3 +1 1 8 +create or replace view v1 as select 2 BETWEEN 1 AND 4 >> 1, 2 BETWEEN 1 AND (4 >> 1), (2 BETWEEN 1 AND 4) >> 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 between 1 and 4 >> 1 AS `2 BETWEEN 1 AND 4 >> 1`,2 between 1 and 4 >> 1 AS `2 BETWEEN 1 AND (4 >> 1)`,(2 between 1 and 4) >> 1 AS `(2 BETWEEN 1 AND 4) >> 1` +select 2 BETWEEN 1 AND 4 >> 1, 2 BETWEEN 1 AND (4 >> 1), (2 BETWEEN 1 AND 4) >> 1 union select * from v1; +2 BETWEEN 1 AND 4 >> 1 2 BETWEEN 1 AND (4 >> 1) (2 BETWEEN 1 AND 4) >> 1 +1 1 0 +create or replace view v1 as select 2 BETWEEN 1 AND '2000-01-01' +INTERVAL 1 DAY, 2 BETWEEN 1 AND ('2000-01-01' +INTERVAL 1 DAY), (2 BETWEEN 1 AND '2000-01-01') +INTERVAL 1 DAY; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 between 1 and '2000-01-01' + interval 1 day AS `2 BETWEEN 1 AND '2000-01-01' +INTERVAL 1 DAY`,2 between 1 and '2000-01-01' + interval 1 day AS `2 BETWEEN 1 AND ('2000-01-01' +INTERVAL 1 DAY)`,(2 between 1 and '2000-01-01') + interval 1 day AS `(2 BETWEEN 1 AND '2000-01-01') +INTERVAL 1 DAY` +select 2 BETWEEN 1 AND '2000-01-01' +INTERVAL 1 DAY, 2 BETWEEN 1 AND ('2000-01-01' +INTERVAL 1 DAY), (2 BETWEEN 1 AND '2000-01-01') +INTERVAL 1 DAY union select * from v1; +2 BETWEEN 1 AND '2000-01-01' +INTERVAL 1 DAY 2 BETWEEN 1 AND ('2000-01-01' +INTERVAL 1 DAY) (2 BETWEEN 1 AND '2000-01-01') +INTERVAL 1 DAY +1 1 NULL +create or replace view v1 as select 2 BETWEEN 1 AND 3 + 3, 2 BETWEEN 1 AND (3 + 3), (2 BETWEEN 1 AND 3) + 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 between 1 and 3 + 3 AS `2 BETWEEN 1 AND 3 + 3`,2 between 1 and 3 + 3 AS `2 BETWEEN 1 AND (3 + 3)`,(2 between 1 and 3) + 3 AS `(2 BETWEEN 1 AND 3) + 3` +select 2 BETWEEN 1 AND 3 + 3, 2 BETWEEN 1 AND (3 + 3), (2 BETWEEN 1 AND 3) + 3 union select * from v1; +2 BETWEEN 1 AND 3 + 3 2 BETWEEN 1 AND (3 + 3) (2 BETWEEN 1 AND 3) + 3 +1 1 4 +create or replace view v1 as select 2 BETWEEN 1 AND 3 - 3, 2 BETWEEN 1 AND (3 - 3), (2 BETWEEN 1 AND 3) - 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 between 1 and 3 - 3 AS `2 BETWEEN 1 AND 3 - 3`,2 between 1 and 3 - 3 AS `2 BETWEEN 1 AND (3 - 3)`,(2 between 1 and 3) - 3 AS `(2 BETWEEN 1 AND 3) - 3` +select 2 BETWEEN 1 AND 3 - 3, 2 BETWEEN 1 AND (3 - 3), (2 BETWEEN 1 AND 3) - 3 union select * from v1; +2 BETWEEN 1 AND 3 - 3 2 BETWEEN 1 AND (3 - 3) (2 BETWEEN 1 AND 3) - 3 +0 0 -2 +create or replace view v1 as select 2 BETWEEN 1 AND 3 * 3, 2 BETWEEN 1 AND (3 * 3), (2 BETWEEN 1 AND 3) * 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 between 1 and 3 * 3 AS `2 BETWEEN 1 AND 3 * 3`,2 between 1 and 3 * 3 AS `2 BETWEEN 1 AND (3 * 3)`,(2 between 1 and 3) * 3 AS `(2 BETWEEN 1 AND 3) * 3` +select 2 BETWEEN 1 AND 3 * 3, 2 BETWEEN 1 AND (3 * 3), (2 BETWEEN 1 AND 3) * 3 union select * from v1; +2 BETWEEN 1 AND 3 * 3 2 BETWEEN 1 AND (3 * 3) (2 BETWEEN 1 AND 3) * 3 +1 1 3 +create or replace view v1 as select 2 BETWEEN 1 AND 3 / 3, 2 BETWEEN 1 AND (3 / 3), (2 BETWEEN 1 AND 3) / 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 between 1 and 3 / 3 AS `2 BETWEEN 1 AND 3 / 3`,2 between 1 and 3 / 3 AS `2 BETWEEN 1 AND (3 / 3)`,(2 between 1 and 3) / 3 AS `(2 BETWEEN 1 AND 3) / 3` +select 2 BETWEEN 1 AND 3 / 3, 2 BETWEEN 1 AND (3 / 3), (2 BETWEEN 1 AND 3) / 3 union select * from v1; +2 BETWEEN 1 AND 3 / 3 2 BETWEEN 1 AND (3 / 3) (2 BETWEEN 1 AND 3) / 3 +0 0 0.3333 +create or replace view v1 as select 2 BETWEEN 1 AND 4 DIV 2, 2 BETWEEN 1 AND (4 DIV 2), (2 BETWEEN 1 AND 4) DIV 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 between 1 and 4 DIV 2 AS `2 BETWEEN 1 AND 4 DIV 2`,2 between 1 and 4 DIV 2 AS `2 BETWEEN 1 AND (4 DIV 2)`,(2 between 1 and 4) DIV 2 AS `(2 BETWEEN 1 AND 4) DIV 2` +select 2 BETWEEN 1 AND 4 DIV 2, 2 BETWEEN 1 AND (4 DIV 2), (2 BETWEEN 1 AND 4) DIV 2 union select * from v1; +2 BETWEEN 1 AND 4 DIV 2 2 BETWEEN 1 AND (4 DIV 2) (2 BETWEEN 1 AND 4) DIV 2 +1 1 0 +create or replace view v1 as select 2 BETWEEN 1 AND 3 MOD 3, 2 BETWEEN 1 AND (3 MOD 3), (2 BETWEEN 1 AND 3) MOD 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 between 1 and 3 MOD 3 AS `2 BETWEEN 1 AND 3 MOD 3`,2 between 1 and 3 MOD 3 AS `2 BETWEEN 1 AND (3 MOD 3)`,(2 between 1 and 3) MOD 3 AS `(2 BETWEEN 1 AND 3) MOD 3` +select 2 BETWEEN 1 AND 3 MOD 3, 2 BETWEEN 1 AND (3 MOD 3), (2 BETWEEN 1 AND 3) MOD 3 union select * from v1; +2 BETWEEN 1 AND 3 MOD 3 2 BETWEEN 1 AND (3 MOD 3) (2 BETWEEN 1 AND 3) MOD 3 +0 0 1 +create or replace view v1 as select 2 BETWEEN 1 AND 3 % 3, 2 BETWEEN 1 AND (3 % 3), (2 BETWEEN 1 AND 3) % 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 between 1 and 3 MOD 3 AS `2 BETWEEN 1 AND 3 % 3`,2 between 1 and 3 MOD 3 AS `2 BETWEEN 1 AND (3 % 3)`,(2 between 1 and 3) MOD 3 AS `(2 BETWEEN 1 AND 3) % 3` +select 2 BETWEEN 1 AND 3 % 3, 2 BETWEEN 1 AND (3 % 3), (2 BETWEEN 1 AND 3) % 3 union select * from v1; +2 BETWEEN 1 AND 3 % 3 2 BETWEEN 1 AND (3 % 3) (2 BETWEEN 1 AND 3) % 3 +0 0 1 +create or replace view v1 as select 2 BETWEEN 1 AND 3 ^ 3, 2 BETWEEN 1 AND (3 ^ 3), (2 BETWEEN 1 AND 3) ^ 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 between 1 and 3 ^ 3 AS `2 BETWEEN 1 AND 3 ^ 3`,2 between 1 and 3 ^ 3 AS `2 BETWEEN 1 AND (3 ^ 3)`,(2 between 1 and 3) ^ 3 AS `(2 BETWEEN 1 AND 3) ^ 3` +select 2 BETWEEN 1 AND 3 ^ 3, 2 BETWEEN 1 AND (3 ^ 3), (2 BETWEEN 1 AND 3) ^ 3 union select * from v1; +2 BETWEEN 1 AND 3 ^ 3 2 BETWEEN 1 AND (3 ^ 3) (2 BETWEEN 1 AND 3) ^ 3 +0 0 2 +create or replace view v1 as select 2 BETWEEN 1 AND 3 BETWEEN 1 AND 3, 2 BETWEEN 1 AND (3 BETWEEN 1 AND 3), (2 BETWEEN 1 AND 3) BETWEEN 1 AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 between 1 and 3 between 1 and 3 AS `2 BETWEEN 1 AND 3 BETWEEN 1 AND 3`,2 between 1 and 3 between 1 and 3 AS `2 BETWEEN 1 AND (3 BETWEEN 1 AND 3)`,(2 between 1 and 3) between 1 and 3 AS `(2 BETWEEN 1 AND 3) BETWEEN 1 AND 3` +select 2 BETWEEN 1 AND 3 BETWEEN 1 AND 3, 2 BETWEEN 1 AND (3 BETWEEN 1 AND 3), (2 BETWEEN 1 AND 3) BETWEEN 1 AND 3 union select * from v1; +2 BETWEEN 1 AND 3 BETWEEN 1 AND 3 2 BETWEEN 1 AND (3 BETWEEN 1 AND 3) (2 BETWEEN 1 AND 3) BETWEEN 1 AND 3 +0 0 1 +create or replace view v1 as select 2 LIKE 2 ESCAPE 3 IS FALSE, 2 LIKE 2 ESCAPE (3 IS FALSE), (2 LIKE 2 ESCAPE 3) IS FALSE; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 like 2 escape 3 is false AS `2 LIKE 2 ESCAPE 3 IS FALSE`,2 like 2 escape (3 is false) AS `2 LIKE 2 ESCAPE (3 IS FALSE)`,2 like 2 escape 3 is false AS `(2 LIKE 2 ESCAPE 3) IS FALSE` +select 2 LIKE 2 ESCAPE 3 IS FALSE, 2 LIKE 2 ESCAPE (3 IS FALSE), (2 LIKE 2 ESCAPE 3) IS FALSE union select * from v1; +2 LIKE 2 ESCAPE 3 IS FALSE 2 LIKE 2 ESCAPE (3 IS FALSE) (2 LIKE 2 ESCAPE 3) IS FALSE +0 1 0 +create or replace view v1 as select charset(2 LIKE 1 ESCAPE 3 COLLATE latin1_bin), charset(2 LIKE 1 ESCAPE (3 COLLATE latin1_bin)), charset((2 LIKE 1 ESCAPE 3) COLLATE latin1_bin); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select charset(2 like 1 escape 3 collate latin1_bin) AS `charset(2 LIKE 1 ESCAPE 3 COLLATE latin1_bin)`,charset(2 like 1 escape 3 collate latin1_bin) AS `charset(2 LIKE 1 ESCAPE (3 COLLATE latin1_bin))`,charset((2 like 1 escape 3) collate latin1_bin) AS `charset((2 LIKE 1 ESCAPE 3) COLLATE latin1_bin)` +select charset(2 LIKE 1 ESCAPE 3 COLLATE latin1_bin), charset(2 LIKE 1 ESCAPE (3 COLLATE latin1_bin)), charset((2 LIKE 1 ESCAPE 3) COLLATE latin1_bin) union select * from v1; +charset(2 LIKE 1 ESCAPE 3 COLLATE latin1_bin) charset(2 LIKE 1 ESCAPE (3 COLLATE latin1_bin)) charset((2 LIKE 1 ESCAPE 3) COLLATE latin1_bin) +binary binary latin1 +create or replace view v1 as select 2 LIKE 1 ESCAPE 3 IN(0,1), 2 LIKE 1 ESCAPE (3 IN(0,1)), (2 LIKE 1 ESCAPE 3) IN(0,1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 like 1 escape 3 in (0,1) AS `2 LIKE 1 ESCAPE 3 IN(0,1)`,2 like 1 escape (3 in (0,1)) AS `2 LIKE 1 ESCAPE (3 IN(0,1))`,2 like 1 escape 3 in (0,1) AS `(2 LIKE 1 ESCAPE 3) IN(0,1)` +select 2 LIKE 1 ESCAPE 3 IN(0,1), 2 LIKE 1 ESCAPE (3 IN(0,1)), (2 LIKE 1 ESCAPE 3) IN(0,1) union select * from v1; +2 LIKE 1 ESCAPE 3 IN(0,1) 2 LIKE 1 ESCAPE (3 IN(0,1)) (2 LIKE 1 ESCAPE 3) IN(0,1) +1 0 1 +create or replace view v1 as select 2 LIKE 1 ESCAPE 3 OR 4, 2 LIKE 1 ESCAPE (3 OR 4), (2 LIKE 1 ESCAPE 3) OR 4; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 like 1 escape 3 or 4 AS `2 LIKE 1 ESCAPE 3 OR 4`,2 like 1 escape (3 or 4) AS `2 LIKE 1 ESCAPE (3 OR 4)`,2 like 1 escape 3 or 4 AS `(2 LIKE 1 ESCAPE 3) OR 4` +select 2 LIKE 1 ESCAPE 3 OR 4, 2 LIKE 1 ESCAPE (3 OR 4), (2 LIKE 1 ESCAPE 3) OR 4 union select * from v1; +2 LIKE 1 ESCAPE 3 OR 4 2 LIKE 1 ESCAPE (3 OR 4) (2 LIKE 1 ESCAPE 3) OR 4 +1 0 1 +create or replace view v1 as select 2 LIKE 1 ESCAPE 3 || 4, 2 LIKE 1 ESCAPE (3 || 4), (2 LIKE 1 ESCAPE 3) || 4; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 like 1 escape 3 or 4 AS `2 LIKE 1 ESCAPE 3 || 4`,2 like 1 escape (3 or 4) AS `2 LIKE 1 ESCAPE (3 || 4)`,2 like 1 escape 3 or 4 AS `(2 LIKE 1 ESCAPE 3) || 4` +select 2 LIKE 1 ESCAPE 3 || 4, 2 LIKE 1 ESCAPE (3 || 4), (2 LIKE 1 ESCAPE 3) || 4 union select * from v1; +2 LIKE 1 ESCAPE 3 || 4 2 LIKE 1 ESCAPE (3 || 4) (2 LIKE 1 ESCAPE 3) || 4 +1 0 1 +create or replace view v1 as select 2 LIKE 1 ESCAPE 3 XOR 4, 2 LIKE 1 ESCAPE (3 XOR 4), (2 LIKE 1 ESCAPE 3) XOR 4; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 like 1 escape 3 xor 4 AS `2 LIKE 1 ESCAPE 3 XOR 4`,2 like 1 escape (3 xor 4) AS `2 LIKE 1 ESCAPE (3 XOR 4)`,2 like 1 escape 3 xor 4 AS `(2 LIKE 1 ESCAPE 3) XOR 4` +select 2 LIKE 1 ESCAPE 3 XOR 4, 2 LIKE 1 ESCAPE (3 XOR 4), (2 LIKE 1 ESCAPE 3) XOR 4 union select * from v1; +2 LIKE 1 ESCAPE 3 XOR 4 2 LIKE 1 ESCAPE (3 XOR 4) (2 LIKE 1 ESCAPE 3) XOR 4 +1 0 1 +create or replace view v1 as select 2 LIKE 2 ESCAPE 3 AND 0, 2 LIKE 2 ESCAPE (3 AND 0), (2 LIKE 2 ESCAPE 3) AND 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 like 2 escape 3 and 0 AS `2 LIKE 2 ESCAPE 3 AND 0`,2 like 2 escape (3 and 0) AS `2 LIKE 2 ESCAPE (3 AND 0)`,2 like 2 escape 3 and 0 AS `(2 LIKE 2 ESCAPE 3) AND 0` +select 2 LIKE 2 ESCAPE 3 AND 0, 2 LIKE 2 ESCAPE (3 AND 0), (2 LIKE 2 ESCAPE 3) AND 0 union select * from v1; +2 LIKE 2 ESCAPE 3 AND 0 2 LIKE 2 ESCAPE (3 AND 0) (2 LIKE 2 ESCAPE 3) AND 0 +0 1 0 +create or replace view v1 as select 2 LIKE 2 ESCAPE 3 && 0, 2 LIKE 2 ESCAPE (3 && 0), (2 LIKE 2 ESCAPE 3) && 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 like 2 escape 3 and 0 AS `2 LIKE 2 ESCAPE 3 && 0`,2 like 2 escape (3 and 0) AS `2 LIKE 2 ESCAPE (3 && 0)`,2 like 2 escape 3 and 0 AS `(2 LIKE 2 ESCAPE 3) && 0` +select 2 LIKE 2 ESCAPE 3 && 0, 2 LIKE 2 ESCAPE (3 && 0), (2 LIKE 2 ESCAPE 3) && 0 union select * from v1; +2 LIKE 2 ESCAPE 3 && 0 2 LIKE 2 ESCAPE (3 && 0) (2 LIKE 2 ESCAPE 3) && 0 +0 1 0 +create or replace view v1 as select 2 LIKE 2 ESCAPE 3 = 4, 2 LIKE 2 ESCAPE (3 = 4), (2 LIKE 2 ESCAPE 3) = 4; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 like 2 escape 3 = 4 AS `2 LIKE 2 ESCAPE 3 = 4`,2 like 2 escape (3 = 4) AS `2 LIKE 2 ESCAPE (3 = 4)`,2 like 2 escape 3 = 4 AS `(2 LIKE 2 ESCAPE 3) = 4` +select 2 LIKE 2 ESCAPE 3 = 4, 2 LIKE 2 ESCAPE (3 = 4), (2 LIKE 2 ESCAPE 3) = 4 union select * from v1; +2 LIKE 2 ESCAPE 3 = 4 2 LIKE 2 ESCAPE (3 = 4) (2 LIKE 2 ESCAPE 3) = 4 +0 1 0 +create or replace view v1 as select 2 LIKE 2 ESCAPE 3 <=> 4, 2 LIKE 2 ESCAPE (3 <=> 4), (2 LIKE 2 ESCAPE 3) <=> 4; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 like 2 escape 3 <=> 4 AS `2 LIKE 2 ESCAPE 3 <=> 4`,2 like 2 escape (3 <=> 4) AS `2 LIKE 2 ESCAPE (3 <=> 4)`,2 like 2 escape 3 <=> 4 AS `(2 LIKE 2 ESCAPE 3) <=> 4` +select 2 LIKE 2 ESCAPE 3 <=> 4, 2 LIKE 2 ESCAPE (3 <=> 4), (2 LIKE 2 ESCAPE 3) <=> 4 union select * from v1; +2 LIKE 2 ESCAPE 3 <=> 4 2 LIKE 2 ESCAPE (3 <=> 4) (2 LIKE 2 ESCAPE 3) <=> 4 +0 1 0 +create or replace view v1 as select 2 LIKE 2 ESCAPE 3 >= 4, 2 LIKE 2 ESCAPE (3 >= 4), (2 LIKE 2 ESCAPE 3) >= 4; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 like 2 escape 3 >= 4 AS `2 LIKE 2 ESCAPE 3 >= 4`,2 like 2 escape (3 >= 4) AS `2 LIKE 2 ESCAPE (3 >= 4)`,2 like 2 escape 3 >= 4 AS `(2 LIKE 2 ESCAPE 3) >= 4` +select 2 LIKE 2 ESCAPE 3 >= 4, 2 LIKE 2 ESCAPE (3 >= 4), (2 LIKE 2 ESCAPE 3) >= 4 union select * from v1; +2 LIKE 2 ESCAPE 3 >= 4 2 LIKE 2 ESCAPE (3 >= 4) (2 LIKE 2 ESCAPE 3) >= 4 +0 1 0 +create or replace view v1 as select 2 LIKE 1 ESCAPE 3 <= 4, 2 LIKE 1 ESCAPE (3 <= 4), (2 LIKE 1 ESCAPE 3) <= 4; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 like 1 escape 3 <= 4 AS `2 LIKE 1 ESCAPE 3 <= 4`,2 like 1 escape (3 <= 4) AS `2 LIKE 1 ESCAPE (3 <= 4)`,2 like 1 escape 3 <= 4 AS `(2 LIKE 1 ESCAPE 3) <= 4` +select 2 LIKE 1 ESCAPE 3 <= 4, 2 LIKE 1 ESCAPE (3 <= 4), (2 LIKE 1 ESCAPE 3) <= 4 union select * from v1; +2 LIKE 1 ESCAPE 3 <= 4 2 LIKE 1 ESCAPE (3 <= 4) (2 LIKE 1 ESCAPE 3) <= 4 +1 0 1 +create or replace view v1 as select 2 LIKE 1 ESCAPE 3 < 4, 2 LIKE 1 ESCAPE (3 < 4), (2 LIKE 1 ESCAPE 3) < 4; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 like 1 escape 3 < 4 AS `2 LIKE 1 ESCAPE 3 < 4`,2 like 1 escape (3 < 4) AS `2 LIKE 1 ESCAPE (3 < 4)`,2 like 1 escape 3 < 4 AS `(2 LIKE 1 ESCAPE 3) < 4` +select 2 LIKE 1 ESCAPE 3 < 4, 2 LIKE 1 ESCAPE (3 < 4), (2 LIKE 1 ESCAPE 3) < 4 union select * from v1; +2 LIKE 1 ESCAPE 3 < 4 2 LIKE 1 ESCAPE (3 < 4) (2 LIKE 1 ESCAPE 3) < 4 +1 0 1 +create or replace view v1 as select 2 LIKE 1 ESCAPE 3 <> 4, 2 LIKE 1 ESCAPE (3 <> 4), (2 LIKE 1 ESCAPE 3) <> 4; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 like 1 escape 3 <> 4 AS `2 LIKE 1 ESCAPE 3 <> 4`,2 like 1 escape (3 <> 4) AS `2 LIKE 1 ESCAPE (3 <> 4)`,2 like 1 escape 3 <> 4 AS `(2 LIKE 1 ESCAPE 3) <> 4` +select 2 LIKE 1 ESCAPE 3 <> 4, 2 LIKE 1 ESCAPE (3 <> 4), (2 LIKE 1 ESCAPE 3) <> 4 union select * from v1; +2 LIKE 1 ESCAPE 3 <> 4 2 LIKE 1 ESCAPE (3 <> 4) (2 LIKE 1 ESCAPE 3) <> 4 +1 0 1 +create or replace view v1 as select 2 LIKE 2 ESCAPE 3 > 4, 2 LIKE 2 ESCAPE (3 > 4), (2 LIKE 2 ESCAPE 3) > 4; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 like 2 escape 3 > 4 AS `2 LIKE 2 ESCAPE 3 > 4`,2 like 2 escape (3 > 4) AS `2 LIKE 2 ESCAPE (3 > 4)`,2 like 2 escape 3 > 4 AS `(2 LIKE 2 ESCAPE 3) > 4` +select 2 LIKE 2 ESCAPE 3 > 4, 2 LIKE 2 ESCAPE (3 > 4), (2 LIKE 2 ESCAPE 3) > 4 union select * from v1; +2 LIKE 2 ESCAPE 3 > 4 2 LIKE 2 ESCAPE (3 > 4) (2 LIKE 2 ESCAPE 3) > 4 +0 1 0 +create or replace view v1 as select 2 LIKE 1 ESCAPE 3 != 4, 2 LIKE 1 ESCAPE (3 != 4), (2 LIKE 1 ESCAPE 3) != 4; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 like 1 escape 3 <> 4 AS `2 LIKE 1 ESCAPE 3 != 4`,2 like 1 escape (3 <> 4) AS `2 LIKE 1 ESCAPE (3 != 4)`,2 like 1 escape 3 <> 4 AS `(2 LIKE 1 ESCAPE 3) != 4` +select 2 LIKE 1 ESCAPE 3 != 4, 2 LIKE 1 ESCAPE (3 != 4), (2 LIKE 1 ESCAPE 3) != 4 union select * from v1; +2 LIKE 1 ESCAPE 3 != 4 2 LIKE 1 ESCAPE (3 != 4) (2 LIKE 1 ESCAPE 3) != 4 +1 0 1 +create or replace view v1 as select 2 LIKE 2 ESCAPE 3 LIKE 4, 2 LIKE 2 ESCAPE (3 LIKE 4), (2 LIKE 2 ESCAPE 3) LIKE 4; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 like 2 escape 3 like 4 AS `2 LIKE 2 ESCAPE 3 LIKE 4`,2 like 2 escape (3 like 4) AS `2 LIKE 2 ESCAPE (3 LIKE 4)`,2 like 2 escape 3 like 4 AS `(2 LIKE 2 ESCAPE 3) LIKE 4` +select 2 LIKE 2 ESCAPE 3 LIKE 4, 2 LIKE 2 ESCAPE (3 LIKE 4), (2 LIKE 2 ESCAPE 3) LIKE 4 union select * from v1; +2 LIKE 2 ESCAPE 3 LIKE 4 2 LIKE 2 ESCAPE (3 LIKE 4) (2 LIKE 2 ESCAPE 3) LIKE 4 +0 1 0 +create or replace view v1 as select 2 LIKE 2 ESCAPE 3 REGEXP 4, 2 LIKE 2 ESCAPE (3 REGEXP 4), (2 LIKE 2 ESCAPE 3) REGEXP 4; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 like 2 escape 3 regexp 4 AS `2 LIKE 2 ESCAPE 3 REGEXP 4`,2 like 2 escape (3 regexp 4) AS `2 LIKE 2 ESCAPE (3 REGEXP 4)`,2 like 2 escape 3 regexp 4 AS `(2 LIKE 2 ESCAPE 3) REGEXP 4` +select 2 LIKE 2 ESCAPE 3 REGEXP 4, 2 LIKE 2 ESCAPE (3 REGEXP 4), (2 LIKE 2 ESCAPE 3) REGEXP 4 union select * from v1; +2 LIKE 2 ESCAPE 3 REGEXP 4 2 LIKE 2 ESCAPE (3 REGEXP 4) (2 LIKE 2 ESCAPE 3) REGEXP 4 +0 1 0 +create or replace view v1 as select 2 LIKE 1 ESCAPE 3 | 4, 2 LIKE 1 ESCAPE (3 | 4), (2 LIKE 1 ESCAPE 3) | 4; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 like 1 escape 3 | 4 AS `2 LIKE 1 ESCAPE 3 | 4`,2 like 1 escape 3 | 4 AS `2 LIKE 1 ESCAPE (3 | 4)`,(2 like 1 escape 3) | 4 AS `(2 LIKE 1 ESCAPE 3) | 4` +select 2 LIKE 1 ESCAPE 3 | 4, 2 LIKE 1 ESCAPE (3 | 4), (2 LIKE 1 ESCAPE 3) | 4 union select * from v1; +2 LIKE 1 ESCAPE 3 | 4 2 LIKE 1 ESCAPE (3 | 4) (2 LIKE 1 ESCAPE 3) | 4 +0 0 4 +create or replace view v1 as select 2 LIKE 2 ESCAPE 3 & 4, 2 LIKE 2 ESCAPE (3 & 4), (2 LIKE 2 ESCAPE 3) & 4; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 like 2 escape 3 & 4 AS `2 LIKE 2 ESCAPE 3 & 4`,2 like 2 escape 3 & 4 AS `2 LIKE 2 ESCAPE (3 & 4)`,(2 like 2 escape 3) & 4 AS `(2 LIKE 2 ESCAPE 3) & 4` +select 2 LIKE 2 ESCAPE 3 & 4, 2 LIKE 2 ESCAPE (3 & 4), (2 LIKE 2 ESCAPE 3) & 4 union select * from v1; +2 LIKE 2 ESCAPE 3 & 4 2 LIKE 2 ESCAPE (3 & 4) (2 LIKE 2 ESCAPE 3) & 4 +1 1 0 +create or replace view v1 as select 2 LIKE 2 ESCAPE 1 << 1, 2 LIKE 2 ESCAPE (1 << 1), (2 LIKE 2 ESCAPE 1) << 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 like 2 escape 1 << 1 AS `2 LIKE 2 ESCAPE 1 << 1`,2 like 2 escape 1 << 1 AS `2 LIKE 2 ESCAPE (1 << 1)`,(2 like 2 escape 1) << 1 AS `(2 LIKE 2 ESCAPE 1) << 1` +select 2 LIKE 2 ESCAPE 1 << 1, 2 LIKE 2 ESCAPE (1 << 1), (2 LIKE 2 ESCAPE 1) << 1 union select * from v1; +2 LIKE 2 ESCAPE 1 << 1 2 LIKE 2 ESCAPE (1 << 1) (2 LIKE 2 ESCAPE 1) << 1 +1 1 2 +create or replace view v1 as select 2 LIKE 2 ESCAPE 3 >> 4, 2 LIKE 2 ESCAPE (3 >> 4), (2 LIKE 2 ESCAPE 3) >> 4; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 like 2 escape 3 >> 4 AS `2 LIKE 2 ESCAPE 3 >> 4`,2 like 2 escape 3 >> 4 AS `2 LIKE 2 ESCAPE (3 >> 4)`,(2 like 2 escape 3) >> 4 AS `(2 LIKE 2 ESCAPE 3) >> 4` +select 2 LIKE 2 ESCAPE 3 >> 4, 2 LIKE 2 ESCAPE (3 >> 4), (2 LIKE 2 ESCAPE 3) >> 4 union select * from v1; +2 LIKE 2 ESCAPE 3 >> 4 2 LIKE 2 ESCAPE (3 >> 4) (2 LIKE 2 ESCAPE 3) >> 4 +1 1 0 +create or replace view v1 as select 2 LIKE 1 ESCAPE 3 +INTERVAL 1 DAY, 2 LIKE 1 ESCAPE (3 +INTERVAL 1 DAY), (2 LIKE 1 ESCAPE 3) +INTERVAL 1 DAY; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 like 1 escape 3 + interval 1 day AS `2 LIKE 1 ESCAPE 3 +INTERVAL 1 DAY`,2 like 1 escape 3 + interval 1 day AS `2 LIKE 1 ESCAPE (3 +INTERVAL 1 DAY)`,(2 like 1 escape 3) + interval 1 day AS `(2 LIKE 1 ESCAPE 3) +INTERVAL 1 DAY` +select 2 LIKE 1 ESCAPE 3 +INTERVAL 1 DAY, 2 LIKE 1 ESCAPE (3 +INTERVAL 1 DAY), (2 LIKE 1 ESCAPE 3) +INTERVAL 1 DAY union select * from v1; +2 LIKE 1 ESCAPE 3 +INTERVAL 1 DAY 2 LIKE 1 ESCAPE (3 +INTERVAL 1 DAY) (2 LIKE 1 ESCAPE 3) +INTERVAL 1 DAY +0 0 NULL +create or replace view v1 as select 2 LIKE 1 ESCAPE 3 + 4, 2 LIKE 1 ESCAPE (3 + 4), (2 LIKE 1 ESCAPE 3) + 4; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 like 1 escape 3 + 4 AS `2 LIKE 1 ESCAPE 3 + 4`,2 like 1 escape 3 + 4 AS `2 LIKE 1 ESCAPE (3 + 4)`,(2 like 1 escape 3) + 4 AS `(2 LIKE 1 ESCAPE 3) + 4` +select 2 LIKE 1 ESCAPE 3 + 4, 2 LIKE 1 ESCAPE (3 + 4), (2 LIKE 1 ESCAPE 3) + 4 union select * from v1; +2 LIKE 1 ESCAPE 3 + 4 2 LIKE 1 ESCAPE (3 + 4) (2 LIKE 1 ESCAPE 3) + 4 +0 0 4 +create or replace view v1 as select 2 LIKE 2 ESCAPE 1 - 1, 2 LIKE 2 ESCAPE (1 - 1), (2 LIKE 2 ESCAPE 1) - 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 like 2 escape 1 - 1 AS `2 LIKE 2 ESCAPE 1 - 1`,2 like 2 escape 1 - 1 AS `2 LIKE 2 ESCAPE (1 - 1)`,(2 like 2 escape 1) - 1 AS `(2 LIKE 2 ESCAPE 1) - 1` +select 2 LIKE 2 ESCAPE 1 - 1, 2 LIKE 2 ESCAPE (1 - 1), (2 LIKE 2 ESCAPE 1) - 1 union select * from v1; +2 LIKE 2 ESCAPE 1 - 1 2 LIKE 2 ESCAPE (1 - 1) (2 LIKE 2 ESCAPE 1) - 1 +1 1 0 +create or replace view v1 as select 2 LIKE 2 ESCAPE 3 * 0, 2 LIKE 2 ESCAPE (3 * 0), (2 LIKE 2 ESCAPE 3) * 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 like 2 escape 3 * 0 AS `2 LIKE 2 ESCAPE 3 * 0`,2 like 2 escape 3 * 0 AS `2 LIKE 2 ESCAPE (3 * 0)`,(2 like 2 escape 3) * 0 AS `(2 LIKE 2 ESCAPE 3) * 0` +select 2 LIKE 2 ESCAPE 3 * 0, 2 LIKE 2 ESCAPE (3 * 0), (2 LIKE 2 ESCAPE 3) * 0 union select * from v1; +2 LIKE 2 ESCAPE 3 * 0 2 LIKE 2 ESCAPE (3 * 0) (2 LIKE 2 ESCAPE 3) * 0 +1 1 0 +create or replace view v1 as select 2 LIKE 2 ESCAPE 3 DIV 3, 2 LIKE 2 ESCAPE (3 DIV 3), (2 LIKE 2 ESCAPE 3) DIV 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 like 2 escape 3 DIV 3 AS `2 LIKE 2 ESCAPE 3 DIV 3`,2 like 2 escape 3 DIV 3 AS `2 LIKE 2 ESCAPE (3 DIV 3)`,(2 like 2 escape 3) DIV 3 AS `(2 LIKE 2 ESCAPE 3) DIV 3` +select 2 LIKE 2 ESCAPE 3 DIV 3, 2 LIKE 2 ESCAPE (3 DIV 3), (2 LIKE 2 ESCAPE 3) DIV 3 union select * from v1; +2 LIKE 2 ESCAPE 3 DIV 3 2 LIKE 2 ESCAPE (3 DIV 3) (2 LIKE 2 ESCAPE 3) DIV 3 +1 1 0 +create or replace view v1 as select 2 LIKE 2 ESCAPE 3 MOD 1, 2 LIKE 2 ESCAPE (3 MOD 1), (2 LIKE 2 ESCAPE 3) MOD 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 like 2 escape 3 MOD 1 AS `2 LIKE 2 ESCAPE 3 MOD 1`,2 like 2 escape 3 MOD 1 AS `2 LIKE 2 ESCAPE (3 MOD 1)`,(2 like 2 escape 3) MOD 1 AS `(2 LIKE 2 ESCAPE 3) MOD 1` +select 2 LIKE 2 ESCAPE 3 MOD 1, 2 LIKE 2 ESCAPE (3 MOD 1), (2 LIKE 2 ESCAPE 3) MOD 1 union select * from v1; +2 LIKE 2 ESCAPE 3 MOD 1 2 LIKE 2 ESCAPE (3 MOD 1) (2 LIKE 2 ESCAPE 3) MOD 1 +1 1 0 +create or replace view v1 as select 2 LIKE 2 ESCAPE 3 % 1, 2 LIKE 2 ESCAPE (3 % 1), (2 LIKE 2 ESCAPE 3) % 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 like 2 escape 3 MOD 1 AS `2 LIKE 2 ESCAPE 3 % 1`,2 like 2 escape 3 MOD 1 AS `2 LIKE 2 ESCAPE (3 % 1)`,(2 like 2 escape 3) MOD 1 AS `(2 LIKE 2 ESCAPE 3) % 1` +select 2 LIKE 2 ESCAPE 3 % 1, 2 LIKE 2 ESCAPE (3 % 1), (2 LIKE 2 ESCAPE 3) % 1 union select * from v1; +2 LIKE 2 ESCAPE 3 % 1 2 LIKE 2 ESCAPE (3 % 1) (2 LIKE 2 ESCAPE 3) % 1 +1 1 0 +create or replace view v1 as select 2 LIKE 1 ESCAPE 3 ^ 4, 2 LIKE 1 ESCAPE (3 ^ 4), (2 LIKE 1 ESCAPE 3) ^ 4; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 like 1 escape 3 ^ 4 AS `2 LIKE 1 ESCAPE 3 ^ 4`,2 like 1 escape 3 ^ 4 AS `2 LIKE 1 ESCAPE (3 ^ 4)`,(2 like 1 escape 3) ^ 4 AS `(2 LIKE 1 ESCAPE 3) ^ 4` +select 2 LIKE 1 ESCAPE 3 ^ 4, 2 LIKE 1 ESCAPE (3 ^ 4), (2 LIKE 1 ESCAPE 3) ^ 4 union select * from v1; +2 LIKE 1 ESCAPE 3 ^ 4 2 LIKE 1 ESCAPE (3 ^ 4) (2 LIKE 1 ESCAPE 3) ^ 4 +0 0 4 +create or replace view v1 as select 2 LIKE 2 ESCAPE 3 BETWEEN 2 AND 4, 2 LIKE 2 ESCAPE (3 BETWEEN 2 AND 4), (2 LIKE 2 ESCAPE 3) BETWEEN 2 AND 4; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 like 2 escape 3 between 2 and 4 AS `2 LIKE 2 ESCAPE 3 BETWEEN 2 AND 4`,2 like 2 escape (3 between 2 and 4) AS `2 LIKE 2 ESCAPE (3 BETWEEN 2 AND 4)`,2 like 2 escape 3 between 2 and 4 AS `(2 LIKE 2 ESCAPE 3) BETWEEN 2 AND 4` +select 2 LIKE 2 ESCAPE 3 BETWEEN 2 AND 4, 2 LIKE 2 ESCAPE (3 BETWEEN 2 AND 4), (2 LIKE 2 ESCAPE 3) BETWEEN 2 AND 4 union select * from v1; +2 LIKE 2 ESCAPE 3 BETWEEN 2 AND 4 2 LIKE 2 ESCAPE (3 BETWEEN 2 AND 4) (2 LIKE 2 ESCAPE 3) BETWEEN 2 AND 4 +0 1 0 +create or replace view v1 as select NOT 2 IN (SELECT 0 UNION SELECT 2), NOT (2 IN (SELECT 0 UNION SELECT 2)), (NOT 2) IN (SELECT 0 UNION SELECT 2); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select !(2 in (select 0 union select 2)) AS `NOT 2 IN (SELECT 0 UNION SELECT 2)`,!(2 in (select 0 union select 2)) AS `NOT (2 IN (SELECT 0 UNION SELECT 2))`,!2 in (select 0 union select 2) AS `(NOT 2) IN (SELECT 0 UNION SELECT 2)` +select NOT 2 IN (SELECT 0 UNION SELECT 2), NOT (2 IN (SELECT 0 UNION SELECT 2)), (NOT 2) IN (SELECT 0 UNION SELECT 2) union select * from v1; +NOT 2 IN (SELECT 0 UNION SELECT 2) NOT (2 IN (SELECT 0 UNION SELECT 2)) (NOT 2) IN (SELECT 0 UNION SELECT 2) +0 0 1 +create or replace view v1 as select - 2 IN (SELECT 2 UNION SELECT 1), - (2 IN (SELECT 2 UNION SELECT 1)), (- 2) IN (SELECT 2 UNION SELECT 1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select -2 in (select 2 union select 1) AS `- 2 IN (SELECT 2 UNION SELECT 1)`,-(2 in (select 2 union select 1)) AS `- (2 IN (SELECT 2 UNION SELECT 1))`,-2 in (select 2 union select 1) AS `(- 2) IN (SELECT 2 UNION SELECT 1)` +select - 2 IN (SELECT 2 UNION SELECT 1), - (2 IN (SELECT 2 UNION SELECT 1)), (- 2) IN (SELECT 2 UNION SELECT 1) union select * from v1; +- 2 IN (SELECT 2 UNION SELECT 1) - (2 IN (SELECT 2 UNION SELECT 1)) (- 2) IN (SELECT 2 UNION SELECT 1) +0 -1 0 +create or replace view v1 as select ~ 2 IN (SELECT 0 UNION SELECT 1), ~ (2 IN (SELECT 0 UNION SELECT 1)), (~ 2) IN (SELECT 0 UNION SELECT 1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select ~2 in (select 0 union select 1) AS `~ 2 IN (SELECT 0 UNION SELECT 1)`,~(2 in (select 0 union select 1)) AS `~ (2 IN (SELECT 0 UNION SELECT 1))`,~2 in (select 0 union select 1) AS `(~ 2) IN (SELECT 0 UNION SELECT 1)` +select ~ 2 IN (SELECT 0 UNION SELECT 1), ~ (2 IN (SELECT 0 UNION SELECT 1)), (~ 2) IN (SELECT 0 UNION SELECT 1) union select * from v1; +~ 2 IN (SELECT 0 UNION SELECT 1) ~ (2 IN (SELECT 0 UNION SELECT 1)) (~ 2) IN (SELECT 0 UNION SELECT 1) +0 18446744073709551615 0 +create or replace view v1 as select ! 2 IN (SELECT 0 UNION SELECT 2), ! (2 IN (SELECT 0 UNION SELECT 2)), (! 2) IN (SELECT 0 UNION SELECT 2); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select !2 in (select 0 union select 2) AS `! 2 IN (SELECT 0 UNION SELECT 2)`,!(2 in (select 0 union select 2)) AS `! (2 IN (SELECT 0 UNION SELECT 2))`,!2 in (select 0 union select 2) AS `(! 2) IN (SELECT 0 UNION SELECT 2)` +select ! 2 IN (SELECT 0 UNION SELECT 2), ! (2 IN (SELECT 0 UNION SELECT 2)), (! 2) IN (SELECT 0 UNION SELECT 2) union select * from v1; +! 2 IN (SELECT 0 UNION SELECT 2) ! (2 IN (SELECT 0 UNION SELECT 2)) (! 2) IN (SELECT 0 UNION SELECT 2) +1 0 1 +create or replace view v1 as select BINARY 'c' IN (SELECT 'C' UNION SELECT 'X'), BINARY ('c' IN (SELECT 'C' UNION SELECT 'X')), (BINARY 'c') IN (SELECT 'C' UNION SELECT 'X'); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select cast('c' as char charset binary) in (select 'C' union select 'X') AS `BINARY 'c' IN (SELECT 'C' UNION SELECT 'X')`,cast('c' in (select 'C' union select 'X') as char charset binary) AS `BINARY ('c' IN (SELECT 'C' UNION SELECT 'X'))`,cast('c' as char charset binary) in (select 'C' union select 'X') AS `(BINARY 'c') IN (SELECT 'C' UNION SELECT 'X')` +select BINARY 'c' IN (SELECT 'C' UNION SELECT 'X'), BINARY ('c' IN (SELECT 'C' UNION SELECT 'X')), (BINARY 'c') IN (SELECT 'C' UNION SELECT 'X') union select * from v1; +BINARY 'c' IN (SELECT 'C' UNION SELECT 'X') BINARY ('c' IN (SELECT 'C' UNION SELECT 'X')) (BINARY 'c') IN (SELECT 'C' UNION SELECT 'X') +0 1 0 +create or replace view v1 as select 0 OR 3 IN (SELECT 3 UNION SELECT 10), 0 OR (3 IN (SELECT 3 UNION SELECT 10)), (0 OR 3) IN (SELECT 3 UNION SELECT 10); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 0 or 3 in (select 3 union select 10) AS `0 OR 3 IN (SELECT 3 UNION SELECT 10)`,0 or 3 in (select 3 union select 10) AS `0 OR (3 IN (SELECT 3 UNION SELECT 10))`,(0 or 3) in (select 3 union select 10) AS `(0 OR 3) IN (SELECT 3 UNION SELECT 10)` +select 0 OR 3 IN (SELECT 3 UNION SELECT 10), 0 OR (3 IN (SELECT 3 UNION SELECT 10)), (0 OR 3) IN (SELECT 3 UNION SELECT 10) union select * from v1; +0 OR 3 IN (SELECT 3 UNION SELECT 10) 0 OR (3 IN (SELECT 3 UNION SELECT 10)) (0 OR 3) IN (SELECT 3 UNION SELECT 10) +1 1 0 +create or replace view v1 as select 0 || 3 IN (SELECT 3 UNION SELECT 10), 0 || (3 IN (SELECT 3 UNION SELECT 10)), (0 || 3) IN (SELECT 3 UNION SELECT 10); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 0 or 3 in (select 3 union select 10) AS `0 || 3 IN (SELECT 3 UNION SELECT 10)`,0 or 3 in (select 3 union select 10) AS `0 || (3 IN (SELECT 3 UNION SELECT 10))`,(0 or 3) in (select 3 union select 10) AS `(0 || 3) IN (SELECT 3 UNION SELECT 10)` +select 0 || 3 IN (SELECT 3 UNION SELECT 10), 0 || (3 IN (SELECT 3 UNION SELECT 10)), (0 || 3) IN (SELECT 3 UNION SELECT 10) union select * from v1; +0 || 3 IN (SELECT 3 UNION SELECT 10) 0 || (3 IN (SELECT 3 UNION SELECT 10)) (0 || 3) IN (SELECT 3 UNION SELECT 10) +1 1 0 +create or replace view v1 as select 2 XOR 3 IN (SELECT 4 UNION SELECT 5), 2 XOR (3 IN (SELECT 4 UNION SELECT 5)), (2 XOR 3) IN (SELECT 4 UNION SELECT 5); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 xor 3 in (select 4 union select 5) AS `2 XOR 3 IN (SELECT 4 UNION SELECT 5)`,2 xor 3 in (select 4 union select 5) AS `2 XOR (3 IN (SELECT 4 UNION SELECT 5))`,(2 xor 3) in (select 4 union select 5) AS `(2 XOR 3) IN (SELECT 4 UNION SELECT 5)` +select 2 XOR 3 IN (SELECT 4 UNION SELECT 5), 2 XOR (3 IN (SELECT 4 UNION SELECT 5)), (2 XOR 3) IN (SELECT 4 UNION SELECT 5) union select * from v1; +2 XOR 3 IN (SELECT 4 UNION SELECT 5) 2 XOR (3 IN (SELECT 4 UNION SELECT 5)) (2 XOR 3) IN (SELECT 4 UNION SELECT 5) +1 1 0 +create or replace view v1 as select 2 AND 3 IN (SELECT 0 UNION SELECT 1), 2 AND (3 IN (SELECT 0 UNION SELECT 1)), (2 AND 3) IN (SELECT 0 UNION SELECT 1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 and 3 in (select 0 union select 1) AS `2 AND 3 IN (SELECT 0 UNION SELECT 1)`,2 and 3 in (select 0 union select 1) AS `2 AND (3 IN (SELECT 0 UNION SELECT 1))`,(2 and 3) in (select 0 union select 1) AS `(2 AND 3) IN (SELECT 0 UNION SELECT 1)` +select 2 AND 3 IN (SELECT 0 UNION SELECT 1), 2 AND (3 IN (SELECT 0 UNION SELECT 1)), (2 AND 3) IN (SELECT 0 UNION SELECT 1) union select * from v1; +2 AND 3 IN (SELECT 0 UNION SELECT 1) 2 AND (3 IN (SELECT 0 UNION SELECT 1)) (2 AND 3) IN (SELECT 0 UNION SELECT 1) +0 0 1 +create or replace view v1 as select 2 && 3 IN (SELECT 0 UNION SELECT 1), 2 && (3 IN (SELECT 0 UNION SELECT 1)), (2 && 3) IN (SELECT 0 UNION SELECT 1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 and 3 in (select 0 union select 1) AS `2 && 3 IN (SELECT 0 UNION SELECT 1)`,2 and 3 in (select 0 union select 1) AS `2 && (3 IN (SELECT 0 UNION SELECT 1))`,(2 and 3) in (select 0 union select 1) AS `(2 && 3) IN (SELECT 0 UNION SELECT 1)` +select 2 && 3 IN (SELECT 0 UNION SELECT 1), 2 && (3 IN (SELECT 0 UNION SELECT 1)), (2 && 3) IN (SELECT 0 UNION SELECT 1) union select * from v1; +2 && 3 IN (SELECT 0 UNION SELECT 1) 2 && (3 IN (SELECT 0 UNION SELECT 1)) (2 && 3) IN (SELECT 0 UNION SELECT 1) +0 0 1 +create or replace view v1 as select 2 = 3 IN (SELECT 0 UNION SELECT 1), 2 = (3 IN (SELECT 0 UNION SELECT 1)), (2 = 3) IN (SELECT 0 UNION SELECT 1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 = 3 in (select 0 union select 1) AS `2 = 3 IN (SELECT 0 UNION SELECT 1)`,2 = 3 in (select 0 union select 1) AS `2 = (3 IN (SELECT 0 UNION SELECT 1))`,(2 = 3) in (select 0 union select 1) AS `(2 = 3) IN (SELECT 0 UNION SELECT 1)` +select 2 = 3 IN (SELECT 0 UNION SELECT 1), 2 = (3 IN (SELECT 0 UNION SELECT 1)), (2 = 3) IN (SELECT 0 UNION SELECT 1) union select * from v1; +2 = 3 IN (SELECT 0 UNION SELECT 1) 2 = (3 IN (SELECT 0 UNION SELECT 1)) (2 = 3) IN (SELECT 0 UNION SELECT 1) +0 0 1 +create or replace view v1 as select 2 <=> 3 IN (SELECT 0 UNION SELECT 1), 2 <=> (3 IN (SELECT 0 UNION SELECT 1)), (2 <=> 3) IN (SELECT 0 UNION SELECT 1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <=> 3 in (select 0 union select 1) AS `2 <=> 3 IN (SELECT 0 UNION SELECT 1)`,2 <=> 3 in (select 0 union select 1) AS `2 <=> (3 IN (SELECT 0 UNION SELECT 1))`,(2 <=> 3) in (select 0 union select 1) AS `(2 <=> 3) IN (SELECT 0 UNION SELECT 1)` +select 2 <=> 3 IN (SELECT 0 UNION SELECT 1), 2 <=> (3 IN (SELECT 0 UNION SELECT 1)), (2 <=> 3) IN (SELECT 0 UNION SELECT 1) union select * from v1; +2 <=> 3 IN (SELECT 0 UNION SELECT 1) 2 <=> (3 IN (SELECT 0 UNION SELECT 1)) (2 <=> 3) IN (SELECT 0 UNION SELECT 1) +0 0 1 +create or replace view v1 as select 2 >= 3 IN (SELECT 1 UNION SELECT 1), 2 >= (3 IN (SELECT 1 UNION SELECT 1)), (2 >= 3) IN (SELECT 1 UNION SELECT 1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 >= 3 in (select 1 union select 1) AS `2 >= 3 IN (SELECT 1 UNION SELECT 1)`,2 >= 3 in (select 1 union select 1) AS `2 >= (3 IN (SELECT 1 UNION SELECT 1))`,(2 >= 3) in (select 1 union select 1) AS `(2 >= 3) IN (SELECT 1 UNION SELECT 1)` +select 2 >= 3 IN (SELECT 1 UNION SELECT 1), 2 >= (3 IN (SELECT 1 UNION SELECT 1)), (2 >= 3) IN (SELECT 1 UNION SELECT 1) union select * from v1; +2 >= 3 IN (SELECT 1 UNION SELECT 1) 2 >= (3 IN (SELECT 1 UNION SELECT 1)) (2 >= 3) IN (SELECT 1 UNION SELECT 1) +1 1 0 +create or replace view v1 as select 2 <= 3 IN (SELECT 0 UNION SELECT 1), 2 <= (3 IN (SELECT 0 UNION SELECT 1)), (2 <= 3) IN (SELECT 0 UNION SELECT 1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <= 3 in (select 0 union select 1) AS `2 <= 3 IN (SELECT 0 UNION SELECT 1)`,2 <= 3 in (select 0 union select 1) AS `2 <= (3 IN (SELECT 0 UNION SELECT 1))`,(2 <= 3) in (select 0 union select 1) AS `(2 <= 3) IN (SELECT 0 UNION SELECT 1)` +select 2 <= 3 IN (SELECT 0 UNION SELECT 1), 2 <= (3 IN (SELECT 0 UNION SELECT 1)), (2 <= 3) IN (SELECT 0 UNION SELECT 1) union select * from v1; +2 <= 3 IN (SELECT 0 UNION SELECT 1) 2 <= (3 IN (SELECT 0 UNION SELECT 1)) (2 <= 3) IN (SELECT 0 UNION SELECT 1) +0 0 1 +create or replace view v1 as select 2 < 3 IN (SELECT 0 UNION SELECT 1), 2 < (3 IN (SELECT 0 UNION SELECT 1)), (2 < 3) IN (SELECT 0 UNION SELECT 1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 < 3 in (select 0 union select 1) AS `2 < 3 IN (SELECT 0 UNION SELECT 1)`,2 < 3 in (select 0 union select 1) AS `2 < (3 IN (SELECT 0 UNION SELECT 1))`,(2 < 3) in (select 0 union select 1) AS `(2 < 3) IN (SELECT 0 UNION SELECT 1)` +select 2 < 3 IN (SELECT 0 UNION SELECT 1), 2 < (3 IN (SELECT 0 UNION SELECT 1)), (2 < 3) IN (SELECT 0 UNION SELECT 1) union select * from v1; +2 < 3 IN (SELECT 0 UNION SELECT 1) 2 < (3 IN (SELECT 0 UNION SELECT 1)) (2 < 3) IN (SELECT 0 UNION SELECT 1) +0 0 1 +create or replace view v1 as select 2 <> 3 IN (SELECT 0 UNION SELECT 0), 2 <> (3 IN (SELECT 0 UNION SELECT 0)), (2 <> 3) IN (SELECT 0 UNION SELECT 0); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <> 3 in (select 0 union select 0) AS `2 <> 3 IN (SELECT 0 UNION SELECT 0)`,2 <> 3 in (select 0 union select 0) AS `2 <> (3 IN (SELECT 0 UNION SELECT 0))`,(2 <> 3) in (select 0 union select 0) AS `(2 <> 3) IN (SELECT 0 UNION SELECT 0)` +select 2 <> 3 IN (SELECT 0 UNION SELECT 0), 2 <> (3 IN (SELECT 0 UNION SELECT 0)), (2 <> 3) IN (SELECT 0 UNION SELECT 0) union select * from v1; +2 <> 3 IN (SELECT 0 UNION SELECT 0) 2 <> (3 IN (SELECT 0 UNION SELECT 0)) (2 <> 3) IN (SELECT 0 UNION SELECT 0) +1 1 0 +create or replace view v1 as select 2 > 3 IN (SELECT 1 UNION SELECT 1), 2 > (3 IN (SELECT 1 UNION SELECT 1)), (2 > 3) IN (SELECT 1 UNION SELECT 1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 > 3 in (select 1 union select 1) AS `2 > 3 IN (SELECT 1 UNION SELECT 1)`,2 > 3 in (select 1 union select 1) AS `2 > (3 IN (SELECT 1 UNION SELECT 1))`,(2 > 3) in (select 1 union select 1) AS `(2 > 3) IN (SELECT 1 UNION SELECT 1)` +select 2 > 3 IN (SELECT 1 UNION SELECT 1), 2 > (3 IN (SELECT 1 UNION SELECT 1)), (2 > 3) IN (SELECT 1 UNION SELECT 1) union select * from v1; +2 > 3 IN (SELECT 1 UNION SELECT 1) 2 > (3 IN (SELECT 1 UNION SELECT 1)) (2 > 3) IN (SELECT 1 UNION SELECT 1) +1 1 0 +create or replace view v1 as select 2 != 3 IN (SELECT 0 UNION SELECT 0), 2 != (3 IN (SELECT 0 UNION SELECT 0)), (2 != 3) IN (SELECT 0 UNION SELECT 0); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <> 3 in (select 0 union select 0) AS `2 != 3 IN (SELECT 0 UNION SELECT 0)`,2 <> 3 in (select 0 union select 0) AS `2 != (3 IN (SELECT 0 UNION SELECT 0))`,(2 <> 3) in (select 0 union select 0) AS `(2 != 3) IN (SELECT 0 UNION SELECT 0)` +select 2 != 3 IN (SELECT 0 UNION SELECT 0), 2 != (3 IN (SELECT 0 UNION SELECT 0)), (2 != 3) IN (SELECT 0 UNION SELECT 0) union select * from v1; +2 != 3 IN (SELECT 0 UNION SELECT 0) 2 != (3 IN (SELECT 0 UNION SELECT 0)) (2 != 3) IN (SELECT 0 UNION SELECT 0) +1 1 0 +create or replace view v1 as select 2 LIKE 3 IN (SELECT 0 UNION SELECT 1), 2 LIKE (3 IN (SELECT 0 UNION SELECT 1)), (2 LIKE 3) IN (SELECT 0 UNION SELECT 1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 like 3 in (select 0 union select 1) AS `2 LIKE 3 IN (SELECT 0 UNION SELECT 1)`,2 like (3 in (select 0 union select 1)) AS `2 LIKE (3 IN (SELECT 0 UNION SELECT 1))`,2 like 3 in (select 0 union select 1) AS `(2 LIKE 3) IN (SELECT 0 UNION SELECT 1)` +select 2 LIKE 3 IN (SELECT 0 UNION SELECT 1), 2 LIKE (3 IN (SELECT 0 UNION SELECT 1)), (2 LIKE 3) IN (SELECT 0 UNION SELECT 1) union select * from v1; +2 LIKE 3 IN (SELECT 0 UNION SELECT 1) 2 LIKE (3 IN (SELECT 0 UNION SELECT 1)) (2 LIKE 3) IN (SELECT 0 UNION SELECT 1) +1 0 1 +create or replace view v1 as select 2 REGEXP 3 IN (SELECT 0 UNION SELECT 1), 2 REGEXP (3 IN (SELECT 0 UNION SELECT 1)), (2 REGEXP 3) IN (SELECT 0 UNION SELECT 1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 regexp 3 in (select 0 union select 1) AS `2 REGEXP 3 IN (SELECT 0 UNION SELECT 1)`,2 regexp (3 in (select 0 union select 1)) AS `2 REGEXP (3 IN (SELECT 0 UNION SELECT 1))`,2 regexp 3 in (select 0 union select 1) AS `(2 REGEXP 3) IN (SELECT 0 UNION SELECT 1)` +select 2 REGEXP 3 IN (SELECT 0 UNION SELECT 1), 2 REGEXP (3 IN (SELECT 0 UNION SELECT 1)), (2 REGEXP 3) IN (SELECT 0 UNION SELECT 1) union select * from v1; +2 REGEXP 3 IN (SELECT 0 UNION SELECT 1) 2 REGEXP (3 IN (SELECT 0 UNION SELECT 1)) (2 REGEXP 3) IN (SELECT 0 UNION SELECT 1) +1 0 1 +create or replace view v1 as select 2 | 3 IN (SELECT 0 UNION SELECT 1), 2 | (3 IN (SELECT 0 UNION SELECT 1)), (2 | 3) IN (SELECT 0 UNION SELECT 1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 | 3 in (select 0 union select 1) AS `2 | 3 IN (SELECT 0 UNION SELECT 1)`,2 | (3 in (select 0 union select 1)) AS `2 | (3 IN (SELECT 0 UNION SELECT 1))`,2 | 3 in (select 0 union select 1) AS `(2 | 3) IN (SELECT 0 UNION SELECT 1)` +select 2 | 3 IN (SELECT 0 UNION SELECT 1), 2 | (3 IN (SELECT 0 UNION SELECT 1)), (2 | 3) IN (SELECT 0 UNION SELECT 1) union select * from v1; +2 | 3 IN (SELECT 0 UNION SELECT 1) 2 | (3 IN (SELECT 0 UNION SELECT 1)) (2 | 3) IN (SELECT 0 UNION SELECT 1) +0 2 0 +create or replace view v1 as select 2 & 4 IN (SELECT 0 UNION SELECT 1), 2 & (4 IN (SELECT 0 UNION SELECT 1)), (2 & 4) IN (SELECT 0 UNION SELECT 1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 & 4 in (select 0 union select 1) AS `2 & 4 IN (SELECT 0 UNION SELECT 1)`,2 & (4 in (select 0 union select 1)) AS `2 & (4 IN (SELECT 0 UNION SELECT 1))`,2 & 4 in (select 0 union select 1) AS `(2 & 4) IN (SELECT 0 UNION SELECT 1)` +select 2 & 4 IN (SELECT 0 UNION SELECT 1), 2 & (4 IN (SELECT 0 UNION SELECT 1)), (2 & 4) IN (SELECT 0 UNION SELECT 1) union select * from v1; +2 & 4 IN (SELECT 0 UNION SELECT 1) 2 & (4 IN (SELECT 0 UNION SELECT 1)) (2 & 4) IN (SELECT 0 UNION SELECT 1) +1 0 1 +create or replace view v1 as select 2 << 3 IN (SELECT 0 UNION SELECT 1), 2 << (3 IN (SELECT 0 UNION SELECT 1)), (2 << 3) IN (SELECT 0 UNION SELECT 1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 << 3 in (select 0 union select 1) AS `2 << 3 IN (SELECT 0 UNION SELECT 1)`,2 << (3 in (select 0 union select 1)) AS `2 << (3 IN (SELECT 0 UNION SELECT 1))`,2 << 3 in (select 0 union select 1) AS `(2 << 3) IN (SELECT 0 UNION SELECT 1)` +select 2 << 3 IN (SELECT 0 UNION SELECT 1), 2 << (3 IN (SELECT 0 UNION SELECT 1)), (2 << 3) IN (SELECT 0 UNION SELECT 1) union select * from v1; +2 << 3 IN (SELECT 0 UNION SELECT 1) 2 << (3 IN (SELECT 0 UNION SELECT 1)) (2 << 3) IN (SELECT 0 UNION SELECT 1) +0 2 0 +create or replace view v1 as select 2 >> 3 IN (SELECT 0 UNION SELECT 1), 2 >> (3 IN (SELECT 0 UNION SELECT 1)), (2 >> 3) IN (SELECT 0 UNION SELECT 1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 >> 3 in (select 0 union select 1) AS `2 >> 3 IN (SELECT 0 UNION SELECT 1)`,2 >> (3 in (select 0 union select 1)) AS `2 >> (3 IN (SELECT 0 UNION SELECT 1))`,2 >> 3 in (select 0 union select 1) AS `(2 >> 3) IN (SELECT 0 UNION SELECT 1)` +select 2 >> 3 IN (SELECT 0 UNION SELECT 1), 2 >> (3 IN (SELECT 0 UNION SELECT 1)), (2 >> 3) IN (SELECT 0 UNION SELECT 1) union select * from v1; +2 >> 3 IN (SELECT 0 UNION SELECT 1) 2 >> (3 IN (SELECT 0 UNION SELECT 1)) (2 >> 3) IN (SELECT 0 UNION SELECT 1) +1 2 1 +create or replace view v1 as select 2 + 3 IN (SELECT 0 UNION SELECT 1), 2 + (3 IN (SELECT 0 UNION SELECT 1)), (2 + 3) IN (SELECT 0 UNION SELECT 1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 + 3 in (select 0 union select 1) AS `2 + 3 IN (SELECT 0 UNION SELECT 1)`,2 + (3 in (select 0 union select 1)) AS `2 + (3 IN (SELECT 0 UNION SELECT 1))`,2 + 3 in (select 0 union select 1) AS `(2 + 3) IN (SELECT 0 UNION SELECT 1)` +select 2 + 3 IN (SELECT 0 UNION SELECT 1), 2 + (3 IN (SELECT 0 UNION SELECT 1)), (2 + 3) IN (SELECT 0 UNION SELECT 1) union select * from v1; +2 + 3 IN (SELECT 0 UNION SELECT 1) 2 + (3 IN (SELECT 0 UNION SELECT 1)) (2 + 3) IN (SELECT 0 UNION SELECT 1) +0 2 0 +create or replace view v1 as select 2 - 3 IN (SELECT 0 UNION SELECT 1), 2 - (3 IN (SELECT 0 UNION SELECT 1)), (2 - 3) IN (SELECT 0 UNION SELECT 1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 - 3 in (select 0 union select 1) AS `2 - 3 IN (SELECT 0 UNION SELECT 1)`,2 - (3 in (select 0 union select 1)) AS `2 - (3 IN (SELECT 0 UNION SELECT 1))`,2 - 3 in (select 0 union select 1) AS `(2 - 3) IN (SELECT 0 UNION SELECT 1)` +select 2 - 3 IN (SELECT 0 UNION SELECT 1), 2 - (3 IN (SELECT 0 UNION SELECT 1)), (2 - 3) IN (SELECT 0 UNION SELECT 1) union select * from v1; +2 - 3 IN (SELECT 0 UNION SELECT 1) 2 - (3 IN (SELECT 0 UNION SELECT 1)) (2 - 3) IN (SELECT 0 UNION SELECT 1) +0 2 0 +create or replace view v1 as select 2 * 0 IN (SELECT 0 UNION SELECT 1), 2 * (0 IN (SELECT 0 UNION SELECT 1)), (2 * 0) IN (SELECT 0 UNION SELECT 1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 * 0 in (select 0 union select 1) AS `2 * 0 IN (SELECT 0 UNION SELECT 1)`,2 * (0 in (select 0 union select 1)) AS `2 * (0 IN (SELECT 0 UNION SELECT 1))`,2 * 0 in (select 0 union select 1) AS `(2 * 0) IN (SELECT 0 UNION SELECT 1)` +select 2 * 0 IN (SELECT 0 UNION SELECT 1), 2 * (0 IN (SELECT 0 UNION SELECT 1)), (2 * 0) IN (SELECT 0 UNION SELECT 1) union select * from v1; +2 * 0 IN (SELECT 0 UNION SELECT 1) 2 * (0 IN (SELECT 0 UNION SELECT 1)) (2 * 0) IN (SELECT 0 UNION SELECT 1) +1 2 1 +create or replace view v1 as select 2 / 3 IN (SELECT 0 UNION SELECT 1), 2 / (3 IN (SELECT 0 UNION SELECT 1)), (2 / 3) IN (SELECT 0 UNION SELECT 1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 / 3 in (select 0 union select 1) AS `2 / 3 IN (SELECT 0 UNION SELECT 1)`,2 / (3 in (select 0 union select 1)) AS `2 / (3 IN (SELECT 0 UNION SELECT 1))`,2 / 3 in (select 0 union select 1) AS `(2 / 3) IN (SELECT 0 UNION SELECT 1)` +select 2 / 3 IN (SELECT 0 UNION SELECT 1), 2 / (3 IN (SELECT 0 UNION SELECT 1)), (2 / 3) IN (SELECT 0 UNION SELECT 1) union select * from v1; +2 / 3 IN (SELECT 0 UNION SELECT 1) 2 / (3 IN (SELECT 0 UNION SELECT 1)) (2 / 3) IN (SELECT 0 UNION SELECT 1) +0 NULL 0 +create or replace view v1 as select 2 DIV 3 IN (SELECT 0 UNION SELECT 1), 2 DIV (3 IN (SELECT 0 UNION SELECT 1)), (2 DIV 3) IN (SELECT 0 UNION SELECT 1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 DIV 3 in (select 0 union select 1) AS `2 DIV 3 IN (SELECT 0 UNION SELECT 1)`,2 DIV (3 in (select 0 union select 1)) AS `2 DIV (3 IN (SELECT 0 UNION SELECT 1))`,2 DIV 3 in (select 0 union select 1) AS `(2 DIV 3) IN (SELECT 0 UNION SELECT 1)` +select 2 DIV 3 IN (SELECT 0 UNION SELECT 1), 2 DIV (3 IN (SELECT 0 UNION SELECT 1)), (2 DIV 3) IN (SELECT 0 UNION SELECT 1) union select * from v1; +2 DIV 3 IN (SELECT 0 UNION SELECT 1) 2 DIV (3 IN (SELECT 0 UNION SELECT 1)) (2 DIV 3) IN (SELECT 0 UNION SELECT 1) +1 NULL 1 +create or replace view v1 as select 2 MOD 3 IN (SELECT 0 UNION SELECT 1), 2 MOD (3 IN (SELECT 0 UNION SELECT 1)), (2 MOD 3) IN (SELECT 0 UNION SELECT 1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 MOD 3 in (select 0 union select 1) AS `2 MOD 3 IN (SELECT 0 UNION SELECT 1)`,2 MOD (3 in (select 0 union select 1)) AS `2 MOD (3 IN (SELECT 0 UNION SELECT 1))`,2 MOD 3 in (select 0 union select 1) AS `(2 MOD 3) IN (SELECT 0 UNION SELECT 1)` +select 2 MOD 3 IN (SELECT 0 UNION SELECT 1), 2 MOD (3 IN (SELECT 0 UNION SELECT 1)), (2 MOD 3) IN (SELECT 0 UNION SELECT 1) union select * from v1; +2 MOD 3 IN (SELECT 0 UNION SELECT 1) 2 MOD (3 IN (SELECT 0 UNION SELECT 1)) (2 MOD 3) IN (SELECT 0 UNION SELECT 1) +0 NULL 0 +create or replace view v1 as select 2 % 3 IN (SELECT 0 UNION SELECT 1), 2 % (3 IN (SELECT 0 UNION SELECT 1)), (2 % 3) IN (SELECT 0 UNION SELECT 1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 MOD 3 in (select 0 union select 1) AS `2 % 3 IN (SELECT 0 UNION SELECT 1)`,2 MOD (3 in (select 0 union select 1)) AS `2 % (3 IN (SELECT 0 UNION SELECT 1))`,2 MOD 3 in (select 0 union select 1) AS `(2 % 3) IN (SELECT 0 UNION SELECT 1)` +select 2 % 3 IN (SELECT 0 UNION SELECT 1), 2 % (3 IN (SELECT 0 UNION SELECT 1)), (2 % 3) IN (SELECT 0 UNION SELECT 1) union select * from v1; +2 % 3 IN (SELECT 0 UNION SELECT 1) 2 % (3 IN (SELECT 0 UNION SELECT 1)) (2 % 3) IN (SELECT 0 UNION SELECT 1) +0 NULL 0 +create or replace view v1 as select 2 ^ 3 IN (SELECT 0 UNION SELECT 1), 2 ^ (3 IN (SELECT 0 UNION SELECT 1)), (2 ^ 3) IN (SELECT 0 UNION SELECT 1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 ^ 3 in (select 0 union select 1) AS `2 ^ 3 IN (SELECT 0 UNION SELECT 1)`,2 ^ (3 in (select 0 union select 1)) AS `2 ^ (3 IN (SELECT 0 UNION SELECT 1))`,2 ^ 3 in (select 0 union select 1) AS `(2 ^ 3) IN (SELECT 0 UNION SELECT 1)` +select 2 ^ 3 IN (SELECT 0 UNION SELECT 1), 2 ^ (3 IN (SELECT 0 UNION SELECT 1)), (2 ^ 3) IN (SELECT 0 UNION SELECT 1) union select * from v1; +2 ^ 3 IN (SELECT 0 UNION SELECT 1) 2 ^ (3 IN (SELECT 0 UNION SELECT 1)) (2 ^ 3) IN (SELECT 0 UNION SELECT 1) +1 2 1 +create or replace view v1 as select 2 BETWEEN 1 AND 3 IN (SELECT 0 UNION SELECT 1), 2 BETWEEN 1 AND (3 IN (SELECT 0 UNION SELECT 1)), (2 BETWEEN 1 AND 3) IN (SELECT 0 UNION SELECT 1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 between 1 and 3 in (select 0 union select 1) AS `2 BETWEEN 1 AND 3 IN (SELECT 0 UNION SELECT 1)`,2 between 1 and 3 in (select 0 union select 1) AS `2 BETWEEN 1 AND (3 IN (SELECT 0 UNION SELECT 1))`,(2 between 1 and 3) in (select 0 union select 1) AS `(2 BETWEEN 1 AND 3) IN (SELECT 0 UNION SELECT 1)` +select 2 BETWEEN 1 AND 3 IN (SELECT 0 UNION SELECT 1), 2 BETWEEN 1 AND (3 IN (SELECT 0 UNION SELECT 1)), (2 BETWEEN 1 AND 3) IN (SELECT 0 UNION SELECT 1) union select * from v1; +2 BETWEEN 1 AND 3 IN (SELECT 0 UNION SELECT 1) 2 BETWEEN 1 AND (3 IN (SELECT 0 UNION SELECT 1)) (2 BETWEEN 1 AND 3) IN (SELECT 0 UNION SELECT 1) +0 0 1 +create or replace view v1 as select 2 LIKE 1 ESCAPE 3 IN (SELECT 0 UNION SELECT 1), 2 LIKE 1 ESCAPE (3 IN (SELECT 0 UNION SELECT 1)), (2 LIKE 1 ESCAPE 3) IN (SELECT 0 UNION SELECT 1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 like 1 escape 3 in (select 0 union select 1) AS `2 LIKE 1 ESCAPE 3 IN (SELECT 0 UNION SELECT 1)`,2 like 1 escape (3 in (select 0 union select 1)) AS `2 LIKE 1 ESCAPE (3 IN (SELECT 0 UNION SELECT 1))`,2 like 1 escape 3 in (select 0 union select 1) AS `(2 LIKE 1 ESCAPE 3) IN (SELECT 0 UNION SELECT 1)` +select 2 LIKE 1 ESCAPE 3 IN (SELECT 0 UNION SELECT 1), 2 LIKE 1 ESCAPE (3 IN (SELECT 0 UNION SELECT 1)), (2 LIKE 1 ESCAPE 3) IN (SELECT 0 UNION SELECT 1) union select * from v1; +2 LIKE 1 ESCAPE 3 IN (SELECT 0 UNION SELECT 1) 2 LIKE 1 ESCAPE (3 IN (SELECT 0 UNION SELECT 1)) (2 LIKE 1 ESCAPE 3) IN (SELECT 0 UNION SELECT 1) +1 0 1 +create or replace view v1 as select 3 BETWEEN 1 AND 2 AND NULL, 3 BETWEEN (1 AND 2) AND NULL, 3 BETWEEN 1 AND (2 AND NULL), (3 BETWEEN 1 AND 2) AND NULL; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 3 between 1 and 2 and NULL AS `3 BETWEEN 1 AND 2 AND NULL`,3 between (1 and 2) and NULL AS `3 BETWEEN (1 AND 2) AND NULL`,3 between 1 and (2 and NULL) AS `3 BETWEEN 1 AND (2 AND NULL)`,3 between 1 and 2 and NULL AS `(3 BETWEEN 1 AND 2) AND NULL` +select 3 BETWEEN 1 AND 2 AND NULL, 3 BETWEEN (1 AND 2) AND NULL, 3 BETWEEN 1 AND (2 AND NULL), (3 BETWEEN 1 AND 2) AND NULL union select * from v1; +3 BETWEEN 1 AND 2 AND NULL 3 BETWEEN (1 AND 2) AND NULL 3 BETWEEN 1 AND (2 AND NULL) (3 BETWEEN 1 AND 2) AND NULL +0 NULL NULL 0 +set sql_mode=PIPES_AS_CONCAT; +create or replace view v1 as select 2 OR 3 || 3, 2 OR (3 || 3), (2 OR 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 or concat(3,3) AS `2 OR 3 || 3`,2 or concat(3,3) AS `2 OR (3 || 3)`,concat(2 or 3,3) AS `(2 OR 3) || 3` +select 2 OR 3 || 3, 2 OR (3 || 3), (2 OR 3) || 3 union select * from v1; +2 OR 3 || 3 2 OR (3 || 3) (2 OR 3) || 3 +1 1 13 +create or replace view v1 as select 2 || 3 OR 3, 2 || (3 OR 3), (2 || 3) OR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select concat(2,3) or 3 AS `2 || 3 OR 3`,concat(2,3 or 3) AS `2 || (3 OR 3)`,concat(2,3) or 3 AS `(2 || 3) OR 3` +select 2 || 3 OR 3, 2 || (3 OR 3), (2 || 3) OR 3 union select * from v1; +2 || 3 OR 3 2 || (3 OR 3) (2 || 3) OR 3 +1 21 1 +create or replace view v1 as select NOT 2 || 3, NOT (2 || 3), (NOT 2) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select !concat(2,3) AS `NOT 2 || 3`,!concat(2,3) AS `NOT (2 || 3)`,concat(!2,3) AS `(NOT 2) || 3` +select NOT 2 || 3, NOT (2 || 3), (NOT 2) || 3 union select * from v1; +NOT 2 || 3 NOT (2 || 3) (NOT 2) || 3 +0 0 03 +create or replace view v1 as select - '2 ' || 3, - ('2 ' || 3), (- '2 ') || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select concat(-'2 ',3) AS `- '2 ' || 3`,-concat('2 ',3) AS `- ('2 ' || 3)`,concat(-'2 ',3) AS `(- '2 ') || 3` +select - '2 ' || 3, - ('2 ' || 3), (- '2 ') || 3 union select * from v1; +- '2 ' || 3 - ('2 ' || 3) (- '2 ') || 3 +-23 -2 -23 +create or replace view v1 as select ~ 2 || 3, ~ (2 || 3), (~ 2) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select concat(~2,3) AS `~ 2 || 3`,~concat(2,3) AS `~ (2 || 3)`,concat(~2,3) AS `(~ 2) || 3` +select ~ 2 || 3, ~ (2 || 3), (~ 2) || 3 union select * from v1; +~ 2 || 3 ~ (2 || 3) (~ 2) || 3 +184467440737095516133 18446744073709551592 184467440737095516133 +create or replace view v1 as select ! 2 || 3, ! (2 || 3), (! 2) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select concat(!2,3) AS `! 2 || 3`,!concat(2,3) AS `! (2 || 3)`,concat(!2,3) AS `(! 2) || 3` +select ! 2 || 3, ! (2 || 3), (! 2) || 3 union select * from v1; +! 2 || 3 ! (2 || 3) (! 2) || 3 +03 0 03 +create or replace view v1 as select 2 || 3 IS FALSE, 2 || (3 IS FALSE), (2 || 3) IS FALSE; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select concat(2,3) is false AS `2 || 3 IS FALSE`,concat(2,3 is false) AS `2 || (3 IS FALSE)`,concat(2,3) is false AS `(2 || 3) IS FALSE` +select 2 || 3 IS FALSE, 2 || (3 IS FALSE), (2 || 3) IS FALSE union select * from v1; +2 || 3 IS FALSE 2 || (3 IS FALSE) (2 || 3) IS FALSE +0 20 0 +create or replace view v1 as select 0 || 3 IN (3,10), 0 || (3 IN (3,10)), (0 || 3) IN (3,10); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select concat(0,3) in (3,10) AS `0 || 3 IN (3,10)`,concat(0,3 in (3,10)) AS `0 || (3 IN (3,10))`,concat(0,3) in (3,10) AS `(0 || 3) IN (3,10)` +select 0 || 3 IN (3,10), 0 || (3 IN (3,10)), (0 || 3) IN (3,10) union select * from v1; +0 || 3 IN (3,10) 0 || (3 IN (3,10)) (0 || 3) IN (3,10) +1 01 1 +create or replace view v1 as select 1 || 0 XOR 1, 1 || (0 XOR 1), (1 || 0) XOR 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select concat(1,0) xor 1 AS `1 || 0 XOR 1`,concat(1,0 xor 1) AS `1 || (0 XOR 1)`,concat(1,0) xor 1 AS `(1 || 0) XOR 1` +select 1 || 0 XOR 1, 1 || (0 XOR 1), (1 || 0) XOR 1 union select * from v1; +1 || 0 XOR 1 1 || (0 XOR 1) (1 || 0) XOR 1 +0 11 0 +create or replace view v1 as select 1 || 1 AND 0, 1 || (1 AND 0), (1 || 1) AND 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select concat(1,1) and 0 AS `1 || 1 AND 0`,concat(1,1 and 0) AS `1 || (1 AND 0)`,concat(1,1) and 0 AS `(1 || 1) AND 0` +select 1 || 1 AND 0, 1 || (1 AND 0), (1 || 1) AND 0 union select * from v1; +1 || 1 AND 0 1 || (1 AND 0) (1 || 1) AND 0 +0 10 0 +create or replace view v1 as select 1 || 1 && 0, 1 || (1 && 0), (1 || 1) && 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select concat(1,1) and 0 AS `1 || 1 && 0`,concat(1,1 and 0) AS `1 || (1 && 0)`,concat(1,1) and 0 AS `(1 || 1) && 0` +select 1 || 1 && 0, 1 || (1 && 0), (1 || 1) && 0 union select * from v1; +1 || 1 && 0 1 || (1 && 0) (1 || 1) && 0 +0 10 0 +create or replace view v1 as select 2 || 3 = 3, 2 || (3 = 3), (2 || 3) = 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select concat(2,3) = 3 AS `2 || 3 = 3`,concat(2,3 = 3) AS `2 || (3 = 3)`,concat(2,3) = 3 AS `(2 || 3) = 3` +select 2 || 3 = 3, 2 || (3 = 3), (2 || 3) = 3 union select * from v1; +2 || 3 = 3 2 || (3 = 3) (2 || 3) = 3 +0 21 0 +create or replace view v1 as select 2 || 3 <=> 3, 2 || (3 <=> 3), (2 || 3) <=> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select concat(2,3) <=> 3 AS `2 || 3 <=> 3`,concat(2,3 <=> 3) AS `2 || (3 <=> 3)`,concat(2,3) <=> 3 AS `(2 || 3) <=> 3` +select 2 || 3 <=> 3, 2 || (3 <=> 3), (2 || 3) <=> 3 union select * from v1; +2 || 3 <=> 3 2 || (3 <=> 3) (2 || 3) <=> 3 +0 21 0 +create or replace view v1 as select 2 || 3 >= 3, 2 || (3 >= 3), (2 || 3) >= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select concat(2,3) >= 3 AS `2 || 3 >= 3`,concat(2,3 >= 3) AS `2 || (3 >= 3)`,concat(2,3) >= 3 AS `(2 || 3) >= 3` +select 2 || 3 >= 3, 2 || (3 >= 3), (2 || 3) >= 3 union select * from v1; +2 || 3 >= 3 2 || (3 >= 3) (2 || 3) >= 3 +1 21 1 +create or replace view v1 as select 2 || 3 <= 0, 2 || (3 <= 0), (2 || 3) <= 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select concat(2,3) <= 0 AS `2 || 3 <= 0`,concat(2,3 <= 0) AS `2 || (3 <= 0)`,concat(2,3) <= 0 AS `(2 || 3) <= 0` +select 2 || 3 <= 0, 2 || (3 <= 0), (2 || 3) <= 0 union select * from v1; +2 || 3 <= 0 2 || (3 <= 0) (2 || 3) <= 0 +0 20 0 +create or replace view v1 as select 2 || 3 < 0, 2 || (3 < 0), (2 || 3) < 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select concat(2,3) < 0 AS `2 || 3 < 0`,concat(2,3 < 0) AS `2 || (3 < 0)`,concat(2,3) < 0 AS `(2 || 3) < 0` +select 2 || 3 < 0, 2 || (3 < 0), (2 || 3) < 0 union select * from v1; +2 || 3 < 0 2 || (3 < 0) (2 || 3) < 0 +0 20 0 +create or replace view v1 as select 0 || 3 <> 3, 0 || (3 <> 3), (0 || 3) <> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select concat(0,3) <> 3 AS `0 || 3 <> 3`,concat(0,3 <> 3) AS `0 || (3 <> 3)`,concat(0,3) <> 3 AS `(0 || 3) <> 3` +select 0 || 3 <> 3, 0 || (3 <> 3), (0 || 3) <> 3 union select * from v1; +0 || 3 <> 3 0 || (3 <> 3) (0 || 3) <> 3 +0 00 0 +create or replace view v1 as select 2 || 3 > 3, 2 || (3 > 3), (2 || 3) > 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select concat(2,3) > 3 AS `2 || 3 > 3`,concat(2,3 > 3) AS `2 || (3 > 3)`,concat(2,3) > 3 AS `(2 || 3) > 3` +select 2 || 3 > 3, 2 || (3 > 3), (2 || 3) > 3 union select * from v1; +2 || 3 > 3 2 || (3 > 3) (2 || 3) > 3 +1 20 1 +create or replace view v1 as select 0 || 3 != 3, 0 || (3 != 3), (0 || 3) != 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select concat(0,3) <> 3 AS `0 || 3 != 3`,concat(0,3 <> 3) AS `0 || (3 != 3)`,concat(0,3) <> 3 AS `(0 || 3) != 3` +select 0 || 3 != 3, 0 || (3 != 3), (0 || 3) != 3 union select * from v1; +0 || 3 != 3 0 || (3 != 3) (0 || 3) != 3 +0 00 0 +create or replace view v1 as select 2 || 3 LIKE 3, 2 || (3 LIKE 3), (2 || 3) LIKE 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select concat(2,3) like 3 AS `2 || 3 LIKE 3`,concat(2,3 like 3) AS `2 || (3 LIKE 3)`,concat(2,3) like 3 AS `(2 || 3) LIKE 3` +select 2 || 3 LIKE 3, 2 || (3 LIKE 3), (2 || 3) LIKE 3 union select * from v1; +2 || 3 LIKE 3 2 || (3 LIKE 3) (2 || 3) LIKE 3 +0 21 0 +create or replace view v1 as select 2 || 3 REGEXP 3, 2 || (3 REGEXP 3), (2 || 3) REGEXP 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select concat(2,3) regexp 3 AS `2 || 3 REGEXP 3`,concat(2,3 regexp 3) AS `2 || (3 REGEXP 3)`,concat(2,3) regexp 3 AS `(2 || 3) REGEXP 3` +select 2 || 3 REGEXP 3, 2 || (3 REGEXP 3), (2 || 3) REGEXP 3 union select * from v1; +2 || 3 REGEXP 3 2 || (3 REGEXP 3) (2 || 3) REGEXP 3 +1 21 1 +create or replace view v1 as select 2 || ' 3' | 3, 2 || (' 3' | 3), (2 || ' 3') | 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select concat(2,' 3') | 3 AS `2 || ' 3' | 3`,concat(2,' 3' | 3) AS `2 || (' 3' | 3)`,concat(2,' 3') | 3 AS `(2 || ' 3') | 3` +select 2 || ' 3' | 3, 2 || (' 3' | 3), (2 || ' 3') | 3 union select * from v1; +2 || ' 3' | 3 2 || (' 3' | 3) (2 || ' 3') | 3 +3 23 3 +create or replace view v1 as select 0 || 2 & 2, 0 || (2 & 2), (0 || 2) & 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select concat(0,2) & 2 AS `0 || 2 & 2`,concat(0,2 & 2) AS `0 || (2 & 2)`,concat(0,2) & 2 AS `(0 || 2) & 2` +select 0 || 2 & 2, 0 || (2 & 2), (0 || 2) & 2 union select * from v1; +0 || 2 & 2 0 || (2 & 2) (0 || 2) & 2 +2 02 2 +create or replace view v1 as select 2 || 3 << 3, 2 || (3 << 3), (2 || 3) << 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select concat(2,3) << 3 AS `2 || 3 << 3`,concat(2,3 << 3) AS `2 || (3 << 3)`,concat(2,3) << 3 AS `(2 || 3) << 3` +select 2 || 3 << 3, 2 || (3 << 3), (2 || 3) << 3 union select * from v1; +2 || 3 << 3 2 || (3 << 3) (2 || 3) << 3 +184 224 184 +create or replace view v1 as select 2 || 3 >> 3, 2 || (3 >> 3), (2 || 3) >> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select concat(2,3) >> 3 AS `2 || 3 >> 3`,concat(2,3 >> 3) AS `2 || (3 >> 3)`,concat(2,3) >> 3 AS `(2 || 3) >> 3` +select 2 || 3 >> 3, 2 || (3 >> 3), (2 || 3) >> 3 union select * from v1; +2 || 3 >> 3 2 || (3 >> 3) (2 || 3) >> 3 +2 20 2 +create or replace view v1 as select 2 || '2000-01-01' +INTERVAL 1 DAY, 2 || ('2000-01-01' +INTERVAL 1 DAY), (2 || '2000-01-01') +INTERVAL 1 DAY; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select concat(2,'2000-01-01') + interval 1 day AS `2 || '2000-01-01' +INTERVAL 1 DAY`,concat(2,'2000-01-01' + interval 1 day) AS `2 || ('2000-01-01' +INTERVAL 1 DAY)`,concat(2,'2000-01-01') + interval 1 day AS `(2 || '2000-01-01') +INTERVAL 1 DAY` +select 2 || '2000-01-01' +INTERVAL 1 DAY, 2 || ('2000-01-01' +INTERVAL 1 DAY), (2 || '2000-01-01') +INTERVAL 1 DAY union select * from v1; +2 || '2000-01-01' +INTERVAL 1 DAY 2 || ('2000-01-01' +INTERVAL 1 DAY) (2 || '2000-01-01') +INTERVAL 1 DAY +NULL 22000-01-02 NULL +create or replace view v1 as select 2 || ' 3' + 3, 2 || (' 3' + 3), (2 || ' 3') + 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select concat(2,' 3') + 3 AS `2 || ' 3' + 3`,concat(2,' 3' + 3) AS `2 || (' 3' + 3)`,concat(2,' 3') + 3 AS `(2 || ' 3') + 3` +select 2 || ' 3' + 3, 2 || (' 3' + 3), (2 || ' 3') + 3 union select * from v1; +2 || ' 3' + 3 2 || (' 3' + 3) (2 || ' 3') + 3 +5 26 5 +create or replace view v1 as select 2 || ' 3' - 3, 2 || (' 3' - 3), (2 || ' 3') - 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select concat(2,' 3') - 3 AS `2 || ' 3' - 3`,concat(2,' 3' - 3) AS `2 || (' 3' - 3)`,concat(2,' 3') - 3 AS `(2 || ' 3') - 3` +select 2 || ' 3' - 3, 2 || (' 3' - 3), (2 || ' 3') - 3 union select * from v1; +2 || ' 3' - 3 2 || (' 3' - 3) (2 || ' 3') - 3 +-1 20 -1 +create or replace view v1 as select 2 || 3 * 3, 2 || (3 * 3), (2 || 3) * 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select concat(2,3) * 3 AS `2 || 3 * 3`,concat(2,3 * 3) AS `2 || (3 * 3)`,concat(2,3) * 3 AS `(2 || 3) * 3` +select 2 || 3 * 3, 2 || (3 * 3), (2 || 3) * 3 union select * from v1; +2 || 3 * 3 2 || (3 * 3) (2 || 3) * 3 +69 29 69 +create or replace view v1 as select 2 || 3 / 3, 2 || (3 / 3), (2 || 3) / 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select concat(2,3) / 3 AS `2 || 3 / 3`,concat(2,3 / 3) AS `2 || (3 / 3)`,concat(2,3) / 3 AS `(2 || 3) / 3` +select 2 || 3 / 3, 2 || (3 / 3), (2 || 3) / 3 union select * from v1; +2 || 3 / 3 2 || (3 / 3) (2 || 3) / 3 +7.666666666666667 21.0000 7.666666666666667 +create or replace view v1 as select 2 || 3 DIV 3, 2 || (3 DIV 3), (2 || 3) DIV 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select concat(2,3) DIV 3 AS `2 || 3 DIV 3`,concat(2,3 DIV 3) AS `2 || (3 DIV 3)`,concat(2,3) DIV 3 AS `(2 || 3) DIV 3` +select 2 || 3 DIV 3, 2 || (3 DIV 3), (2 || 3) DIV 3 union select * from v1; +2 || 3 DIV 3 2 || (3 DIV 3) (2 || 3) DIV 3 +7 21 7 +create or replace view v1 as select 0 || 3 MOD 3, 0 || (3 MOD 3), (0 || 3) MOD 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select concat(0,3) MOD 3 AS `0 || 3 MOD 3`,concat(0,3 MOD 3) AS `0 || (3 MOD 3)`,concat(0,3) MOD 3 AS `(0 || 3) MOD 3` +select 0 || 3 MOD 3, 0 || (3 MOD 3), (0 || 3) MOD 3 union select * from v1; +0 || 3 MOD 3 0 || (3 MOD 3) (0 || 3) MOD 3 +0 00 0 +create or replace view v1 as select 0 || 3 % 3, 0 || (3 % 3), (0 || 3) % 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select concat(0,3) MOD 3 AS `0 || 3 % 3`,concat(0,3 MOD 3) AS `0 || (3 % 3)`,concat(0,3) MOD 3 AS `(0 || 3) % 3` +select 0 || 3 % 3, 0 || (3 % 3), (0 || 3) % 3 union select * from v1; +0 || 3 % 3 0 || (3 % 3) (0 || 3) % 3 +0 00 0 +create or replace view v1 as select 2 || ' 3' ^ 3, 2 || (' 3' ^ 3), (2 || ' 3') ^ 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select concat(2,' 3') ^ 3 AS `2 || ' 3' ^ 3`,concat(2,' 3' ^ 3) AS `2 || (' 3' ^ 3)`,concat(2,' 3') ^ 3 AS `(2 || ' 3') ^ 3` +select 2 || ' 3' ^ 3, 2 || (' 3' ^ 3), (2 || ' 3') ^ 3 union select * from v1; +2 || ' 3' ^ 3 2 || (' 3' ^ 3) (2 || ' 3') ^ 3 +1 20 1 +create or replace view v1 as select 2 || 3 BETWEEN 2 AND 3, 2 || (3 BETWEEN 2 AND 3), (2 || 3) BETWEEN 2 AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select concat(2,3) between 2 and 3 AS `2 || 3 BETWEEN 2 AND 3`,concat(2,3 between 2 and 3) AS `2 || (3 BETWEEN 2 AND 3)`,concat(2,3) between 2 and 3 AS `(2 || 3) BETWEEN 2 AND 3` +select 2 || 3 BETWEEN 2 AND 3, 2 || (3 BETWEEN 2 AND 3), (2 || 3) BETWEEN 2 AND 3 union select * from v1; +2 || 3 BETWEEN 2 AND 3 2 || (3 BETWEEN 2 AND 3) (2 || 3) BETWEEN 2 AND 3 +0 21 0 +create or replace view v1 as select 2 XOR 3 || 3, 2 XOR (3 || 3), (2 XOR 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 xor concat(3,3) AS `2 XOR 3 || 3`,2 xor concat(3,3) AS `2 XOR (3 || 3)`,concat(2 xor 3,3) AS `(2 XOR 3) || 3` +select 2 XOR 3 || 3, 2 XOR (3 || 3), (2 XOR 3) || 3 union select * from v1; +2 XOR 3 || 3 2 XOR (3 || 3) (2 XOR 3) || 3 +0 0 03 +create or replace view v1 as select 0 AND 3 || 3, 0 AND (3 || 3), (0 AND 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 0 and concat(3,3) AS `0 AND 3 || 3`,0 and concat(3,3) AS `0 AND (3 || 3)`,concat(0 and 3,3) AS `(0 AND 3) || 3` +select 0 AND 3 || 3, 0 AND (3 || 3), (0 AND 3) || 3 union select * from v1; +0 AND 3 || 3 0 AND (3 || 3) (0 AND 3) || 3 +0 0 03 +create or replace view v1 as select 0 && 3 || 3, 0 && (3 || 3), (0 && 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 0 and concat(3,3) AS `0 && 3 || 3`,0 and concat(3,3) AS `0 && (3 || 3)`,concat(0 and 3,3) AS `(0 && 3) || 3` +select 0 && 3 || 3, 0 && (3 || 3), (0 && 3) || 3 union select * from v1; +0 && 3 || 3 0 && (3 || 3) (0 && 3) || 3 +0 0 03 +create or replace view v1 as select 2 = 3 || 3, 2 = (3 || 3), (2 = 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 = concat(3,3) AS `2 = 3 || 3`,2 = concat(3,3) AS `2 = (3 || 3)`,concat(2 = 3,3) AS `(2 = 3) || 3` +select 2 = 3 || 3, 2 = (3 || 3), (2 = 3) || 3 union select * from v1; +2 = 3 || 3 2 = (3 || 3) (2 = 3) || 3 +0 0 03 +create or replace view v1 as select 2 <=> 3 || 3, 2 <=> (3 || 3), (2 <=> 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <=> concat(3,3) AS `2 <=> 3 || 3`,2 <=> concat(3,3) AS `2 <=> (3 || 3)`,concat(2 <=> 3,3) AS `(2 <=> 3) || 3` +select 2 <=> 3 || 3, 2 <=> (3 || 3), (2 <=> 3) || 3 union select * from v1; +2 <=> 3 || 3 2 <=> (3 || 3) (2 <=> 3) || 3 +0 0 03 +create or replace view v1 as select 2 >= 3 || 0, 2 >= (3 || 0), (2 >= 3) || 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 >= concat(3,0) AS `2 >= 3 || 0`,2 >= concat(3,0) AS `2 >= (3 || 0)`,concat(2 >= 3,0) AS `(2 >= 3) || 0` +select 2 >= 3 || 0, 2 >= (3 || 0), (2 >= 3) || 0 union select * from v1; +2 >= 3 || 0 2 >= (3 || 0) (2 >= 3) || 0 +0 0 00 +create or replace view v1 as select 2 <= 3 || 3, 2 <= (3 || 3), (2 <= 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 <= concat(3,3) AS `2 <= 3 || 3`,2 <= concat(3,3) AS `2 <= (3 || 3)`,concat(2 <= 3,3) AS `(2 <= 3) || 3` +select 2 <= 3 || 3, 2 <= (3 || 3), (2 <= 3) || 3 union select * from v1; +2 <= 3 || 3 2 <= (3 || 3) (2 <= 3) || 3 +1 1 13 +create or replace view v1 as select 2 < 3 || 3, 2 < (3 || 3), (2 < 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 < concat(3,3) AS `2 < 3 || 3`,2 < concat(3,3) AS `2 < (3 || 3)`,concat(2 < 3,3) AS `(2 < 3) || 3` +select 2 < 3 || 3, 2 < (3 || 3), (2 < 3) || 3 union select * from v1; +2 < 3 || 3 2 < (3 || 3) (2 < 3) || 3 +1 1 13 +create or replace view v1 as select 1 <> 3 || 3, 1 <> (3 || 3), (1 <> 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 1 <> concat(3,3) AS `1 <> 3 || 3`,1 <> concat(3,3) AS `1 <> (3 || 3)`,concat(1 <> 3,3) AS `(1 <> 3) || 3` +select 1 <> 3 || 3, 1 <> (3 || 3), (1 <> 3) || 3 union select * from v1; +1 <> 3 || 3 1 <> (3 || 3) (1 <> 3) || 3 +1 1 13 +create or replace view v1 as select 0 > 3 || 3, 0 > (3 || 3), (0 > 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 0 > concat(3,3) AS `0 > 3 || 3`,0 > concat(3,3) AS `0 > (3 || 3)`,concat(0 > 3,3) AS `(0 > 3) || 3` +select 0 > 3 || 3, 0 > (3 || 3), (0 > 3) || 3 union select * from v1; +0 > 3 || 3 0 > (3 || 3) (0 > 3) || 3 +0 0 03 +create or replace view v1 as select 1 != 3 || 3, 1 != (3 || 3), (1 != 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 1 <> concat(3,3) AS `1 != 3 || 3`,1 <> concat(3,3) AS `1 != (3 || 3)`,concat(1 <> 3,3) AS `(1 != 3) || 3` +select 1 != 3 || 3, 1 != (3 || 3), (1 != 3) || 3 union select * from v1; +1 != 3 || 3 1 != (3 || 3) (1 != 3) || 3 +1 1 13 +create or replace view v1 as select 2 LIKE 3 || 3, 2 LIKE (3 || 3), (2 LIKE 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 like concat(3,3) AS `2 LIKE 3 || 3`,2 like concat(3,3) AS `2 LIKE (3 || 3)`,concat(2 like 3,3) AS `(2 LIKE 3) || 3` +select 2 LIKE 3 || 3, 2 LIKE (3 || 3), (2 LIKE 3) || 3 union select * from v1; +2 LIKE 3 || 3 2 LIKE (3 || 3) (2 LIKE 3) || 3 +0 0 03 +create or replace view v1 as select 2 REGEXP 3 || 3, 2 REGEXP (3 || 3), (2 REGEXP 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 regexp concat(3,3) AS `2 REGEXP 3 || 3`,2 regexp concat(3,3) AS `2 REGEXP (3 || 3)`,concat(2 regexp 3,3) AS `(2 REGEXP 3) || 3` +select 2 REGEXP 3 || 3, 2 REGEXP (3 || 3), (2 REGEXP 3) || 3 union select * from v1; +2 REGEXP 3 || 3 2 REGEXP (3 || 3) (2 REGEXP 3) || 3 +0 0 03 +create or replace view v1 as select 2 | 3 || 3, 2 | (3 || 3), (2 | 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 | concat(3,3) AS `2 | 3 || 3`,2 | concat(3,3) AS `2 | (3 || 3)`,concat(2 | 3,3) AS `(2 | 3) || 3` +select 2 | 3 || 3, 2 | (3 || 3), (2 | 3) || 3 union select * from v1; +2 | 3 || 3 2 | (3 || 3) (2 | 3) || 3 +35 35 33 +create or replace view v1 as select 2 & 3 || 3, 2 & (3 || 3), (2 & 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 & concat(3,3) AS `2 & 3 || 3`,2 & concat(3,3) AS `2 & (3 || 3)`,concat(2 & 3,3) AS `(2 & 3) || 3` +select 2 & 3 || 3, 2 & (3 || 3), (2 & 3) || 3 union select * from v1; +2 & 3 || 3 2 & (3 || 3) (2 & 3) || 3 +0 0 23 +create or replace view v1 as select 2 << 3 || 3, 2 << (3 || 3), (2 << 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 << concat(3,3) AS `2 << 3 || 3`,2 << concat(3,3) AS `2 << (3 || 3)`,concat(2 << 3,3) AS `(2 << 3) || 3` +select 2 << 3 || 3, 2 << (3 || 3), (2 << 3) || 3 union select * from v1; +2 << 3 || 3 2 << (3 || 3) (2 << 3) || 3 +17179869184 17179869184 163 +create or replace view v1 as select 2 >> 3 || 0, 2 >> (3 || 0), (2 >> 3) || 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 >> concat(3,0) AS `2 >> 3 || 0`,2 >> concat(3,0) AS `2 >> (3 || 0)`,concat(2 >> 3,0) AS `(2 >> 3) || 0` +select 2 >> 3 || 0, 2 >> (3 || 0), (2 >> 3) || 0 union select * from v1; +2 >> 3 || 0 2 >> (3 || 0) (2 >> 3) || 0 +0 0 00 +create or replace view v1 as select 2 + 3 || 3, 2 + (3 || 3), (2 + 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 + concat(3,3) AS `2 + 3 || 3`,2 + concat(3,3) AS `2 + (3 || 3)`,concat(2 + 3,3) AS `(2 + 3) || 3` +select 2 + 3 || 3, 2 + (3 || 3), (2 + 3) || 3 union select * from v1; +2 + 3 || 3 2 + (3 || 3) (2 + 3) || 3 +35 35 53 +create or replace view v1 as select 2 - 2 || 0, 2 - (2 || 0), (2 - 2) || 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 - concat(2,0) AS `2 - 2 || 0`,2 - concat(2,0) AS `2 - (2 || 0)`,concat(2 - 2,0) AS `(2 - 2) || 0` +select 2 - 2 || 0, 2 - (2 || 0), (2 - 2) || 0 union select * from v1; +2 - 2 || 0 2 - (2 || 0) (2 - 2) || 0 +-18 -18 00 +create or replace view v1 as select 2 * 3 || 3, 2 * (3 || 3), (2 * 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 * concat(3,3) AS `2 * 3 || 3`,2 * concat(3,3) AS `2 * (3 || 3)`,concat(2 * 3,3) AS `(2 * 3) || 3` +select 2 * 3 || 3, 2 * (3 || 3), (2 * 3) || 3 union select * from v1; +2 * 3 || 3 2 * (3 || 3) (2 * 3) || 3 +66 66 63 +create or replace view v1 as select 2 / 3 || 3, 2 / (3 || 3), (2 / 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 / concat(3,3) AS `2 / 3 || 3`,2 / concat(3,3) AS `2 / (3 || 3)`,concat(2 / 3,3) AS `(2 / 3) || 3` +select 2 / 3 || 3, 2 / (3 || 3), (2 / 3) || 3 union select * from v1; +2 / 3 || 3 2 / (3 || 3) (2 / 3) || 3 +0.06060606060606061 0.06060606060606061 0.66673 +create or replace view v1 as select 2 DIV 3 || 3, 2 DIV (3 || 3), (2 DIV 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 DIV concat(3,3) AS `2 DIV 3 || 3`,2 DIV concat(3,3) AS `2 DIV (3 || 3)`,concat(2 DIV 3,3) AS `(2 DIV 3) || 3` +select 2 DIV 3 || 3, 2 DIV (3 || 3), (2 DIV 3) || 3 union select * from v1; +2 DIV 3 || 3 2 DIV (3 || 3) (2 DIV 3) || 3 +0 0 03 +create or replace view v1 as select 2 MOD 3 || 3, 2 MOD (3 || 3), (2 MOD 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 MOD concat(3,3) AS `2 MOD 3 || 3`,2 MOD concat(3,3) AS `2 MOD (3 || 3)`,concat(2 MOD 3,3) AS `(2 MOD 3) || 3` +select 2 MOD 3 || 3, 2 MOD (3 || 3), (2 MOD 3) || 3 union select * from v1; +2 MOD 3 || 3 2 MOD (3 || 3) (2 MOD 3) || 3 +2 2 23 +create or replace view v1 as select 2 % 3 || 3, 2 % (3 || 3), (2 % 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 MOD concat(3,3) AS `2 % 3 || 3`,2 MOD concat(3,3) AS `2 % (3 || 3)`,concat(2 MOD 3,3) AS `(2 % 3) || 3` +select 2 % 3 || 3, 2 % (3 || 3), (2 % 3) || 3 union select * from v1; +2 % 3 || 3 2 % (3 || 3) (2 % 3) || 3 +2 2 23 +create or replace view v1 as select 2 ^ 3 || 3, 2 ^ (3 || 3), (2 ^ 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 ^ concat(3,3) AS `2 ^ 3 || 3`,2 ^ concat(3,3) AS `2 ^ (3 || 3)`,concat(2 ^ 3,3) AS `(2 ^ 3) || 3` +select 2 ^ 3 || 3, 2 ^ (3 || 3), (2 ^ 3) || 3 union select * from v1; +2 ^ 3 || 3 2 ^ (3 || 3) (2 ^ 3) || 3 +35 35 13 +create or replace view v1 as select 2 BETWEEN 1 AND 3 || 3, 2 BETWEEN 1 AND (3 || 3), (2 BETWEEN 1 AND 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 2 between 1 and concat(3,3) AS `2 BETWEEN 1 AND 3 || 3`,2 between 1 and concat(3,3) AS `2 BETWEEN 1 AND (3 || 3)`,concat(2 between 1 and 3,3) AS `(2 BETWEEN 1 AND 3) || 3` +select 2 BETWEEN 1 AND 3 || 3, 2 BETWEEN 1 AND (3 || 3), (2 BETWEEN 1 AND 3) || 3 union select * from v1; +2 BETWEEN 1 AND 3 || 3 2 BETWEEN 1 AND (3 || 3) (2 BETWEEN 1 AND 3) || 3 +1 1 13 +create or replace view v1 as select charset(2 LIKE 1 ESCAPE 3 || ''), charset(2 LIKE 1 ESCAPE (3 || '')), charset((2 LIKE 1 ESCAPE 3) || ''); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select charset(2 like 1 escape concat(3,'')) AS `charset(2 LIKE 1 ESCAPE 3 || '')`,charset(2 like 1 escape concat(3,'')) AS `charset(2 LIKE 1 ESCAPE (3 || ''))`,charset(concat(2 like 1 escape 3,'')) AS `charset((2 LIKE 1 ESCAPE 3) || '')` +select charset(2 LIKE 1 ESCAPE 3 || ''), charset(2 LIKE 1 ESCAPE (3 || '')), charset((2 LIKE 1 ESCAPE 3) || '') union select * from v1; +charset(2 LIKE 1 ESCAPE 3 || '') charset(2 LIKE 1 ESCAPE (3 || '')) charset((2 LIKE 1 ESCAPE 3) || '') +binary binary latin1 +create or replace view v1 as select ! - 1, - ! 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select !-1 AS `! - 1`,-!1 AS `- ! 1` +create or replace view v1 as select ! BINARY 1, BINARY ! 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select !cast(1 as char charset binary) AS `! BINARY 1`,cast(!1 as char charset binary) AS `BINARY ! 1` +create or replace view v1 as select ! (NOT 1), NOT ! 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 1 <> 0 AS `! (NOT 1)`,1 <> 0 AS `NOT ! 1` +create or replace view v1 as select ! ~ 1, ~ ! 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select !~1 AS `! ~ 1`,~!1 AS `~ ! 1` +create or replace view v1 as select - BINARY 1, BINARY - 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select -cast(1 as char charset binary) AS `- BINARY 1`,cast(-1 as char charset binary) AS `BINARY - 1` +create or replace view v1 as select - (NOT 1), NOT - 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select -!1 AS `- (NOT 1)`,!-1 AS `NOT - 1` +create or replace view v1 as select - ~ 1, ~ - 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select -~1 AS `- ~ 1`,~-1 AS `~ - 1` +create or replace view v1 as select BINARY (NOT 1), NOT BINARY 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select cast(!1 as char charset binary) AS `BINARY (NOT 1)`,!cast(1 as char charset binary) AS `NOT BINARY 1` +create or replace view v1 as select BINARY ~ 1, ~ BINARY 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select cast(~1 as char charset binary) AS `BINARY ~ 1`,~cast(1 as char charset binary) AS `~ BINARY 1` +create or replace view v1 as select NOT ~ 1, ~ (NOT 1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select !~1 AS `NOT ~ 1`,~!1 AS `~ (NOT 1)` +create or replace view v1 as select 1 IS TRUE IS FALSE, 2 IS FALSE IS UNKNOWN, 3 IS UNKNOWN IS NULL, 4 IS NULL IS TRUE; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +view_definition +select 1 is true is false AS `1 IS TRUE IS FALSE`,/*always not null*/ 1 is null AS `2 IS FALSE IS UNKNOWN`,/*always not null*/ 1 is null AS `3 IS UNKNOWN IS NULL`,/*always not null*/ 1 is null is true AS `4 IS NULL IS TRUE` +drop view v1; diff --git a/mysql-test/main/precedence.test b/mysql-test/main/precedence.test new file mode 100644 index 00000000000..ad367c23603 --- /dev/null +++ b/mysql-test/main/precedence.test @@ -0,0 +1,4788 @@ +# +# A fairly exhastive test for operator precedence +# + +disable_warnings; + +#################### I couldn't come up with a test where precedence changes the result here +# +#create or replace view v1 as select BINARY 2 IS TRUE, BINARY (2 IS TRUE), (BINARY 2) IS TRUE; +#Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +#select BINARY 2 IS TRUE, BINARY (2 IS TRUE), (BINARY 2) IS TRUE union select * from v1; +# +#create or replace view v1 as select BINARY 2 OR 3, BINARY (2 OR 3), (BINARY 2) OR 3; +#Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +#select BINARY 2 OR 3, BINARY (2 OR 3), (BINARY 2) OR 3 union select * from v1; +# +#create or replace view v1 as select BINARY 2 || 3, BINARY (2 || 3), (BINARY 2) || 3; +#Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +#select BINARY 2 || 3, BINARY (2 || 3), (BINARY 2) || 3 union select * from v1; +# +#create or replace view v1 as select BINARY 2 XOR 3, BINARY (2 XOR 3), (BINARY 2) XOR 3; +#Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +#select BINARY 2 XOR 3, BINARY (2 XOR 3), (BINARY 2) XOR 3 union select * from v1; +# +#create or replace view v1 as select BINARY 2 AND 3, BINARY (2 AND 3), (BINARY 2) AND 3; +#Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +#select BINARY 2 AND 3, BINARY (2 AND 3), (BINARY 2) AND 3 union select * from v1; +# +#create or replace view v1 as select BINARY 2 && 3, BINARY (2 && 3), (BINARY 2) && 3; +#Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +#select BINARY 2 && 3, BINARY (2 && 3), (BINARY 2) && 3 union select * from v1; +# +#create or replace view v1 as select BINARY 2 | 3, BINARY (2 | 3), (BINARY 2) | 3; +#Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +#select BINARY 2 | 3, BINARY (2 | 3), (BINARY 2) | 3 union select * from v1; +# +#create or replace view v1 as select BINARY 2 & 3, BINARY (2 & 3), (BINARY 2) & 3; +#Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +#select BINARY 2 & 3, BINARY (2 & 3), (BINARY 2) & 3 union select * from v1; +# +#create or replace view v1 as select BINARY 2 << 3, BINARY (2 << 3), (BINARY 2) << 3; +#Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +#select BINARY 2 << 3, BINARY (2 << 3), (BINARY 2) << 3 union select * from v1; +# +#create or replace view v1 as select BINARY 2 >> 3, BINARY (2 >> 3), (BINARY 2) >> 3; +#Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +#select BINARY 2 >> 3, BINARY (2 >> 3), (BINARY 2) >> 3 union select * from v1; +# +#create or replace view v1 as select BINARY '2000-01-01' +INTERVAL 1 DAY, BINARY ('2000-01-01' +INTERVAL 1 DAY), (BINARY '2000-01-01') +INTERVAL 1 DAY; +#Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +#select BINARY '2000-01-01' +INTERVAL 1 DAY, BINARY ('2000-01-01' +INTERVAL 1 DAY), (BINARY '2000-01-01') +INTERVAL 1 DAY union select * from v1; +# +#create or replace view v1 as select BINARY 2 + 3, BINARY (2 + 3), (BINARY 2) + 3; +#Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +#select BINARY 2 + 3, BINARY (2 + 3), (BINARY 2) + 3 union select * from v1; +# +#create or replace view v1 as select BINARY 2 - 3, BINARY (2 - 3), (BINARY 2) - 3; +#Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +#select BINARY 2 - 3, BINARY (2 - 3), (BINARY 2) - 3 union select * from v1; +# +#create or replace view v1 as select BINARY 2 * 3, BINARY (2 * 3), (BINARY 2) * 3; +#Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +#select BINARY 2 * 3, BINARY (2 * 3), (BINARY 2) * 3 union select * from v1; +# +#create or replace view v1 as select BINARY 2 / 3, BINARY (2 / 3), (BINARY 2) / 3; +#Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +#select BINARY 2 / 3, BINARY (2 / 3), (BINARY 2) / 3 union select * from v1; +# +#create or replace view v1 as select BINARY 2 DIV 3, BINARY (2 DIV 3), (BINARY 2) DIV 3; +#Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +#select BINARY 2 DIV 3, BINARY (2 DIV 3), (BINARY 2) DIV 3 union select * from v1; +# +#create or replace view v1 as select BINARY 2 MOD 3, BINARY (2 MOD 3), (BINARY 2) MOD 3; +#Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +#select BINARY 2 MOD 3, BINARY (2 MOD 3), (BINARY 2) MOD 3 union select * from v1; +# +#create or replace view v1 as select BINARY 2 % 3, BINARY (2 % 3), (BINARY 2) % 3; +#Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +#select BINARY 2 % 3, BINARY (2 % 3), (BINARY 2) % 3 union select * from v1; +# +#create or replace view v1 as select BINARY 2 ^ 3, BINARY (2 ^ 3), (BINARY 2) ^ 3; +#Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +#select BINARY 2 ^ 3, BINARY (2 ^ 3), (BINARY 2) ^ 3 union select * from v1; +# +#set sql_mode=PIPES_AS_CONCAT; +#create or replace view v1 as select 2 || 3 COLLATE latin1_bin, 2 || (3 COLLATE latin1_bin), (2 || 3) COLLATE latin1_bin; +#Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +#select 2 || 3 COLLATE latin1_bin, 2 || (3 COLLATE latin1_bin), (2 || 3) COLLATE latin1_bin union select * from v1; + +########################## The result doesn't depend on the precedence +# +#create or replace view v1 as select NOT 2 XOR 0, NOT (2 XOR 0), (NOT 2) XOR 0; +#Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +#select NOT 2 XOR 0, NOT (2 XOR 0), (NOT 2) XOR 0 union select * from v1; +# +#create or replace view v1 as select - 2 * 3, - (2 * 3), (- 2) * 3; +#Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +#select - 2 * 3, - (2 * 3), (- 2) * 3 union select * from v1; +# +#create or replace view v1 as select - 2 / 3, - (2 / 3), (- 2) / 3; +#Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +#select - 2 / 3, - (2 / 3), (- 2) / 3 union select * from v1; +# +#create or replace view v1 as select - 2 DIV 3, - (2 DIV 3), (- 2) DIV 3; +#Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +#select - 2 DIV 3, - (2 DIV 3), (- 2) DIV 3 union select * from v1; +# +#create or replace view v1 as select - 2 MOD 3, - (2 MOD 3), (- 2) MOD 3; +#Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +#select - 2 MOD 3, - (2 MOD 3), (- 2) MOD 3 union select * from v1; +# +#create or replace view v1 as select - 2 % 3, - (2 % 3), (- 2) % 3; +#Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +#select - 2 % 3, - (2 % 3), (- 2) % 3 union select * from v1; +# +#create or replace view v1 as select ~ 2 ^ 3, ~ (2 ^ 3), (~ 2) ^ 3; +#Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +#select ~ 2 ^ 3, ~ (2 ^ 3), (~ 2) ^ 3 union select * from v1; +# +#create or replace view v1 as select ! 2 XOR 3, ! (2 XOR 3), (! 2) XOR 3; +#Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +#select ! 2 XOR 3, ! (2 XOR 3), (! 2) XOR 3 union select * from v1; +# +#create or replace view v1 as select 2 OR 3 OR 3, 2 OR (3 OR 3), (2 OR 3) OR 3; +#Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +#select 2 OR 3 OR 3, 2 OR (3 OR 3), (2 OR 3) OR 3 union select * from v1; +# +#create or replace view v1 as select 2 OR 3 || 3, 2 OR (3 || 3), (2 OR 3) || 3; +#Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +#select 2 OR 3 || 3, 2 OR (3 || 3), (2 OR 3) || 3 union select * from v1; +# +#create or replace view v1 as select 2 || 3 OR 3, 2 || (3 OR 3), (2 || 3) OR 3; +#Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +#select 2 || 3 OR 3, 2 || (3 OR 3), (2 || 3) OR 3 union select * from v1; +# +#create or replace view v1 as select 2 || 3 || 3, 2 || (3 || 3), (2 || 3) || 3; +#Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +#select 2 || 3 || 3, 2 || (3 || 3), (2 || 3) || 3 union select * from v1; +# +#create or replace view v1 as select 2 XOR 3 IS FALSE, 2 XOR (3 IS FALSE), (2 XOR 3) IS FALSE; +#Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +#select 2 XOR 3 IS FALSE, 2 XOR (3 IS FALSE), (2 XOR 3) IS FALSE union select * from v1; +# +#create or replace view v1 as select 2 XOR 3 XOR 3, 2 XOR (3 XOR 3), (2 XOR 3) XOR 3; +#Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +#select 2 XOR 3 XOR 3, 2 XOR (3 XOR 3), (2 XOR 3) XOR 3 union select * from v1; +# +#create or replace view v1 as select 2 AND 3 AND 3, 2 AND (3 AND 3), (2 AND 3) AND 3; +#Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +#select 2 AND 3 AND 3, 2 AND (3 AND 3), (2 AND 3) AND 3 union select * from v1; +# +#create or replace view v1 as select 2 AND 3 && 3, 2 AND (3 && 3), (2 AND 3) && 3; +#Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +#select 2 AND 3 && 3, 2 AND (3 && 3), (2 AND 3) && 3 union select * from v1; +# +#create or replace view v1 as select 2 && 3 AND 3, 2 && (3 AND 3), (2 && 3) AND 3; +#Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +#select 2 && 3 AND 3, 2 && (3 AND 3), (2 && 3) AND 3 union select * from v1; +# +#create or replace view v1 as select 2 && 3 && 3, 2 && (3 && 3), (2 && 3) && 3; +#Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +#select 2 && 3 && 3, 2 && (3 && 3), (2 && 3) && 3 union select * from v1; +# +#create or replace view v1 as select 2 | 3 | 3, 2 | (3 | 3), (2 | 3) | 3; +#Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +#select 2 | 3 | 3, 2 | (3 | 3), (2 | 3) | 3 union select * from v1; +# +#create or replace view v1 as select 2 & 3 & 3, 2 & (3 & 3), (2 & 3) & 3; +#Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +#select 2 & 3 & 3, 2 & (3 & 3), (2 & 3) & 3 union select * from v1; +# +#create or replace view v1 as select 2 + 3 + 3, 2 + (3 + 3), (2 + 3) + 3; +#Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +#select 2 + 3 + 3, 2 + (3 + 3), (2 + 3) + 3 union select * from v1; +# +#create or replace view v1 as select 2 + 3 - 3, 2 + (3 - 3), (2 + 3) - 3; +#Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +#select 2 + 3 - 3, 2 + (3 - 3), (2 + 3) - 3 union select * from v1; +# +#create or replace view v1 as select 2 * 3 << 3, 2 * (3 << 3), (2 * 3) << 3; +#Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +#select 2 * 3 << 3, 2 * (3 << 3), (2 * 3) << 3 union select * from v1; +# +#create or replace view v1 as select 2 * 3 * 3, 2 * (3 * 3), (2 * 3) * 3; +#Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +#select 2 * 3 * 3, 2 * (3 * 3), (2 * 3) * 3 union select * from v1; +# +#create or replace view v1 as select 2 * 3 / 3, 2 * (3 / 3), (2 * 3) / 3; +#Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +#select 2 * 3 / 3, 2 * (3 / 3), (2 * 3) / 3 union select * from v1; +# +#create or replace view v1 as select 2 ^ 3 ^ 3, 2 ^ (3 ^ 3), (2 ^ 3) ^ 3; +#Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +#select 2 ^ 3 ^ 3, 2 ^ (3 ^ 3), (2 ^ 3) ^ 3 union select * from v1; + +create or replace view v1 as select NOT NULL IS TRUE, NOT (NULL IS TRUE), (NOT NULL) IS TRUE; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select NOT NULL IS TRUE, NOT (NULL IS TRUE), (NOT NULL) IS TRUE union select * from v1; + +create or replace view v1 as select ! NULL IS TRUE, ! (NULL IS TRUE), (! NULL) IS TRUE; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select ! NULL IS TRUE, ! (NULL IS TRUE), (! NULL) IS TRUE union select * from v1; + +create or replace view v1 as select charset(NOT 2 COLLATE latin1_bin), charset(NOT (2 COLLATE latin1_bin)), charset((NOT 2) COLLATE latin1_bin); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select charset(NOT 2 COLLATE latin1_bin), charset(NOT (2 COLLATE latin1_bin)), charset((NOT 2) COLLATE latin1_bin) union select * from v1; + +create or replace view v1 as select NOT 2 IN (0,2), NOT (2 IN (0,2)), (NOT 2) IN (0,2); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select NOT 2 IN (0,2), NOT (2 IN (0,2)), (NOT 2) IN (0,2) union select * from v1; + +create or replace view v1 as select NOT 2 OR 3, NOT (2 OR 3), (NOT 2) OR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select NOT 2 OR 3, NOT (2 OR 3), (NOT 2) OR 3 union select * from v1; + +create or replace view v1 as select NOT 2 || 3, NOT (2 || 3), (NOT 2) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select NOT 2 || 3, NOT (2 || 3), (NOT 2) || 3 union select * from v1; + +create or replace view v1 as select NOT 2 AND 0, NOT (2 AND 0), (NOT 2) AND 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select NOT 2 AND 0, NOT (2 AND 0), (NOT 2) AND 0 union select * from v1; + +create or replace view v1 as select NOT 2 && 0, NOT (2 && 0), (NOT 2) && 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select NOT 2 && 0, NOT (2 && 0), (NOT 2) && 0 union select * from v1; + +create or replace view v1 as select NOT 2 = 3, NOT (2 = 3), (NOT 2) = 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select NOT 2 = 3, NOT (2 = 3), (NOT 2) = 3 union select * from v1; + +create or replace view v1 as select NOT 2 <=> 3, NOT (2 <=> 3), (NOT 2) <=> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select NOT 2 <=> 3, NOT (2 <=> 3), (NOT 2) <=> 3 union select * from v1; + +create or replace view v1 as select NOT 2 >= 3, NOT (2 >= 3), (NOT 2) >= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select NOT 2 >= 3, NOT (2 >= 3), (NOT 2) >= 3 union select * from v1; + +create or replace view v1 as select NOT 2 <= 3, NOT (2 <= 3), (NOT 2) <= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select NOT 2 <= 3, NOT (2 <= 3), (NOT 2) <= 3 union select * from v1; + +create or replace view v1 as select NOT 2 < 3, NOT (2 < 3), (NOT 2) < 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select NOT 2 < 3, NOT (2 < 3), (NOT 2) < 3 union select * from v1; + +create or replace view v1 as select NOT 2 <> 3, NOT (2 <> 3), (NOT 2) <> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select NOT 2 <> 3, NOT (2 <> 3), (NOT 2) <> 3 union select * from v1; + +create or replace view v1 as select NOT 2 > 3, NOT (2 > 3), (NOT 2) > 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select NOT 2 > 3, NOT (2 > 3), (NOT 2) > 3 union select * from v1; + +create or replace view v1 as select NOT 2 != 3, NOT (2 != 3), (NOT 2) != 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select NOT 2 != 3, NOT (2 != 3), (NOT 2) != 3 union select * from v1; + +create or replace view v1 as select NOT 2 LIKE 3, NOT (2 LIKE 3), (NOT 2) LIKE 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select NOT 2 LIKE 3, NOT (2 LIKE 3), (NOT 2) LIKE 3 union select * from v1; + +create or replace view v1 as select NOT 2 REGEXP 3, NOT (2 REGEXP 3), (NOT 2) REGEXP 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select NOT 2 REGEXP 3, NOT (2 REGEXP 3), (NOT 2) REGEXP 3 union select * from v1; + +create or replace view v1 as select NOT 2 | 3, NOT (2 | 3), (NOT 2) | 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select NOT 2 | 3, NOT (2 | 3), (NOT 2) | 3 union select * from v1; + +create or replace view v1 as select NOT 0 & 2, NOT (0 & 2), (NOT 0) & 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select NOT 0 & 2, NOT (0 & 2), (NOT 0) & 2 union select * from v1; + +create or replace view v1 as select NOT 0 << 3, NOT (0 << 3), (NOT 0) << 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select NOT 0 << 3, NOT (0 << 3), (NOT 0) << 3 union select * from v1; + +create or replace view v1 as select NOT 2 >> 3, NOT (2 >> 3), (NOT 2) >> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select NOT 2 >> 3, NOT (2 >> 3), (NOT 2) >> 3 union select * from v1; + +create or replace view v1 as select NOT '2000-01-01' +INTERVAL 1 DAY, NOT ('2000-01-01' +INTERVAL 1 DAY), (NOT '2000-01-01') +INTERVAL 1 DAY; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select NOT '2000-01-01' +INTERVAL 1 DAY, NOT ('2000-01-01' +INTERVAL 1 DAY), (NOT '2000-01-01') +INTERVAL 1 DAY union select * from v1; + +create or replace view v1 as select NOT 2 + 3, NOT (2 + 3), (NOT 2) + 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select NOT 2 + 3, NOT (2 + 3), (NOT 2) + 3 union select * from v1; + +create or replace view v1 as select NOT 2 - 3, NOT (2 - 3), (NOT 2) - 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select NOT 2 - 3, NOT (2 - 3), (NOT 2) - 3 union select * from v1; + +create or replace view v1 as select NOT 0 * 3, NOT (0 * 3), (NOT 0) * 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select NOT 0 * 3, NOT (0 * 3), (NOT 0) * 3 union select * from v1; + +create or replace view v1 as select NOT 0 / 3, NOT (0 / 3), (NOT 0) / 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select NOT 0 / 3, NOT (0 / 3), (NOT 0) / 3 union select * from v1; + +create or replace view v1 as select NOT 2 DIV 3, NOT (2 DIV 3), (NOT 2) DIV 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select NOT 2 DIV 3, NOT (2 DIV 3), (NOT 2) DIV 3 union select * from v1; + +create or replace view v1 as select NOT 6 MOD 3, NOT (6 MOD 3), (NOT 6) MOD 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select NOT 6 MOD 3, NOT (6 MOD 3), (NOT 6) MOD 3 union select * from v1; + +create or replace view v1 as select NOT 6 % 3, NOT (6 % 3), (NOT 6) % 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select NOT 6 % 3, NOT (6 % 3), (NOT 6) % 3 union select * from v1; + +create or replace view v1 as select NOT 2 ^ 3, NOT (2 ^ 3), (NOT 2) ^ 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select NOT 2 ^ 3, NOT (2 ^ 3), (NOT 2) ^ 3 union select * from v1; + +create or replace view v1 as select NOT 2 BETWEEN 3 AND 4, NOT (2 BETWEEN 3 AND 4), (NOT 2) BETWEEN 3 AND 4; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select NOT 2 BETWEEN 3 AND 4, NOT (2 BETWEEN 3 AND 4), (NOT 2) BETWEEN 3 AND 4 union select * from v1; + +create or replace view v1 as select - 2 IS TRUE, - (2 IS TRUE), (- 2) IS TRUE; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select - 2 IS TRUE, - (2 IS TRUE), (- 2) IS TRUE union select * from v1; + +create or replace view v1 as select charset(- "2" COLLATE latin1_bin), charset(- ("2" COLLATE latin1_bin)), charset((- "2") COLLATE latin1_bin); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select charset(- "2" COLLATE latin1_bin), charset(- ("2" COLLATE latin1_bin)), charset((- "2") COLLATE latin1_bin) union select * from v1; + +create or replace view v1 as select - 2 IN (2,1), - (2 IN (2,1)), (- 2) IN (2,1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select - 2 IN (2,1), - (2 IN (2,1)), (- 2) IN (2,1) union select * from v1; + +create or replace view v1 as select - 2 OR 3, - (2 OR 3), (- 2) OR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select - 2 OR 3, - (2 OR 3), (- 2) OR 3 union select * from v1; + +create or replace view v1 as select - 2 || 3, - (2 || 3), (- 2) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select - 2 || 3, - (2 || 3), (- 2) || 3 union select * from v1; + +create or replace view v1 as select - 0 XOR 3, - (0 XOR 3), (- 0) XOR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select - 0 XOR 3, - (0 XOR 3), (- 0) XOR 3 union select * from v1; + +create or replace view v1 as select - 2 AND 3, - (2 AND 3), (- 2) AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select - 2 AND 3, - (2 AND 3), (- 2) AND 3 union select * from v1; + +create or replace view v1 as select - 2 && 3, - (2 && 3), (- 2) && 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select - 2 && 3, - (2 && 3), (- 2) && 3 union select * from v1; + +create or replace view v1 as select - 2 = 2, - (2 = 2), (- 2) = 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select - 2 = 2, - (2 = 2), (- 2) = 2 union select * from v1; + +create or replace view v1 as select - 2 <=> 2, - (2 <=> 2), (- 2) <=> 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select - 2 <=> 2, - (2 <=> 2), (- 2) <=> 2 union select * from v1; + +create or replace view v1 as select - 2 >= 1, - (2 >= 1), (- 2) >= 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select - 2 >= 1, - (2 >= 1), (- 2) >= 1 union select * from v1; + +create or replace view v1 as select - 2 <= 3, - (2 <= 3), (- 2) <= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select - 2 <= 3, - (2 <= 3), (- 2) <= 3 union select * from v1; + +create or replace view v1 as select - 2 < 3, - (2 < 3), (- 2) < 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select - 2 < 3, - (2 < 3), (- 2) < 3 union select * from v1; + +create or replace view v1 as select - 2 <> 3, - (2 <> 3), (- 2) <> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select - 2 <> 3, - (2 <> 3), (- 2) <> 3 union select * from v1; + +create or replace view v1 as select - 2 > 1, - (2 > 1), (- 2) > 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select - 2 > 1, - (2 > 1), (- 2) > 1 union select * from v1; + +create or replace view v1 as select - 2 != 3, - (2 != 3), (- 2) != 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select - 2 != 3, - (2 != 3), (- 2) != 3 union select * from v1; + +create or replace view v1 as select - 2 LIKE 2, - (2 LIKE 2), (- 2) LIKE 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select - 2 LIKE 2, - (2 LIKE 2), (- 2) LIKE 2 union select * from v1; + +create or replace view v1 as select - 2 REGEXP 2, - (2 REGEXP 2), (- 2) REGEXP 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select - 2 REGEXP 2, - (2 REGEXP 2), (- 2) REGEXP 2 union select * from v1; + +create or replace view v1 as select - 2 | 3, - (2 | 3), (- 2) | 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select - 2 | 3, - (2 | 3), (- 2) | 3 union select * from v1; + +create or replace view v1 as select - 2 & 3, - (2 & 3), (- 2) & 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select - 2 & 3, - (2 & 3), (- 2) & 3 union select * from v1; + +create or replace view v1 as select - 2 << 3, - (2 << 3), (- 2) << 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select - 2 << 3, - (2 << 3), (- 2) << 3 union select * from v1; + +create or replace view v1 as select - 2 >> 3, - (2 >> 3), (- 2) >> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select - 2 >> 3, - (2 >> 3), (- 2) >> 3 union select * from v1; + +create or replace view v1 as select - '2000-01-01' +INTERVAL 1 DAY, - ('2000-01-01' +INTERVAL 1 DAY), (- '2000-01-01') +INTERVAL 1 DAY; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select - '2000-01-01' +INTERVAL 1 DAY, - ('2000-01-01' +INTERVAL 1 DAY), (- '2000-01-01') +INTERVAL 1 DAY union select * from v1; + +create or replace view v1 as select - 2 + 3, - (2 + 3), (- 2) + 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select - 2 + 3, - (2 + 3), (- 2) + 3 union select * from v1; + +create or replace view v1 as select - 2 - 3, - (2 - 3), (- 2) - 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select - 2 - 3, - (2 - 3), (- 2) - 3 union select * from v1; + +create or replace view v1 as select - 2 ^ 3, - (2 ^ 3), (- 2) ^ 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select - 2 ^ 3, - (2 ^ 3), (- 2) ^ 3 union select * from v1; + +create or replace view v1 as select - 2 BETWEEN 1 AND 3, - (2 BETWEEN 1 AND 3), (- 2) BETWEEN 1 AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select - 2 BETWEEN 1 AND 3, - (2 BETWEEN 1 AND 3), (- 2) BETWEEN 1 AND 3 union select * from v1; + +create or replace view v1 as select ~ 2 IS TRUE, ~ (2 IS TRUE), (~ 2) IS TRUE; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select ~ 2 IS TRUE, ~ (2 IS TRUE), (~ 2) IS TRUE union select * from v1; + +create or replace view v1 as select charset(~ 2 COLLATE latin1_bin), charset(~ (2 COLLATE latin1_bin)), charset((~ 2) COLLATE latin1_bin); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select charset(~ 2 COLLATE latin1_bin), charset(~ (2 COLLATE latin1_bin)), charset((~ 2) COLLATE latin1_bin) union select * from v1; + +create or replace view v1 as select ~ 2 IN (0,1), ~ (2 IN (0,1)), (~ 2) IN (0,1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select ~ 2 IN (0,1), ~ (2 IN (0,1)), (~ 2) IN (0,1) union select * from v1; + +create or replace view v1 as select ~ 2 OR 3, ~ (2 OR 3), (~ 2) OR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select ~ 2 OR 3, ~ (2 OR 3), (~ 2) OR 3 union select * from v1; + +create or replace view v1 as select ~ 2 || 3, ~ (2 || 3), (~ 2) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select ~ 2 || 3, ~ (2 || 3), (~ 2) || 3 union select * from v1; + +create or replace view v1 as select ~ 2 XOR 3, ~ (2 XOR 3), (~ 2) XOR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select ~ 2 XOR 3, ~ (2 XOR 3), (~ 2) XOR 3 union select * from v1; + +create or replace view v1 as select ~ 2 AND 3, ~ (2 AND 3), (~ 2) AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select ~ 2 AND 3, ~ (2 AND 3), (~ 2) AND 3 union select * from v1; + +create or replace view v1 as select ~ 2 && 3, ~ (2 && 3), (~ 2) && 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select ~ 2 && 3, ~ (2 && 3), (~ 2) && 3 union select * from v1; + +create or replace view v1 as select ~ 2 = 3, ~ (2 = 3), (~ 2) = 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select ~ 2 = 3, ~ (2 = 3), (~ 2) = 3 union select * from v1; + +create or replace view v1 as select ~ 2 <=> 3, ~ (2 <=> 3), (~ 2) <=> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select ~ 2 <=> 3, ~ (2 <=> 3), (~ 2) <=> 3 union select * from v1; + +create or replace view v1 as select ~ 2 >= 3, ~ (2 >= 3), (~ 2) >= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select ~ 2 >= 3, ~ (2 >= 3), (~ 2) >= 3 union select * from v1; + +create or replace view v1 as select ~ 2 <= 3, ~ (2 <= 3), (~ 2) <= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select ~ 2 <= 3, ~ (2 <= 3), (~ 2) <= 3 union select * from v1; + +create or replace view v1 as select ~ 2 < 3, ~ (2 < 3), (~ 2) < 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select ~ 2 < 3, ~ (2 < 3), (~ 2) < 3 union select * from v1; + +create or replace view v1 as select ~ 2 <> 3, ~ (2 <> 3), (~ 2) <> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select ~ 2 <> 3, ~ (2 <> 3), (~ 2) <> 3 union select * from v1; + +create or replace view v1 as select ~ 2 > 3, ~ (2 > 3), (~ 2) > 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select ~ 2 > 3, ~ (2 > 3), (~ 2) > 3 union select * from v1; + +create or replace view v1 as select ~ 2 != 3, ~ (2 != 3), (~ 2) != 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select ~ 2 != 3, ~ (2 != 3), (~ 2) != 3 union select * from v1; + +create or replace view v1 as select ~ 2 LIKE 3, ~ (2 LIKE 3), (~ 2) LIKE 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select ~ 2 LIKE 3, ~ (2 LIKE 3), (~ 2) LIKE 3 union select * from v1; + +create or replace view v1 as select ~ 2 REGEXP 3, ~ (2 REGEXP 3), (~ 2) REGEXP 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select ~ 2 REGEXP 3, ~ (2 REGEXP 3), (~ 2) REGEXP 3 union select * from v1; + +create or replace view v1 as select ~ 2 | 3, ~ (2 | 3), (~ 2) | 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select ~ 2 | 3, ~ (2 | 3), (~ 2) | 3 union select * from v1; + +create or replace view v1 as select ~ 2 & 3, ~ (2 & 3), (~ 2) & 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select ~ 2 & 3, ~ (2 & 3), (~ 2) & 3 union select * from v1; + +create or replace view v1 as select ~ 2 << 3, ~ (2 << 3), (~ 2) << 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select ~ 2 << 3, ~ (2 << 3), (~ 2) << 3 union select * from v1; + +create or replace view v1 as select ~ 2 >> 3, ~ (2 >> 3), (~ 2) >> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select ~ 2 >> 3, ~ (2 >> 3), (~ 2) >> 3 union select * from v1; + +create or replace view v1 as select ~ '2000-01-01' +INTERVAL 1 DAY, ~ ('2000-01-01' +INTERVAL 1 DAY), (~ '2000-01-01') +INTERVAL 1 DAY; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select ~ '2000-01-01' +INTERVAL 1 DAY, ~ ('2000-01-01' +INTERVAL 1 DAY), (~ '2000-01-01') +INTERVAL 1 DAY union select * from v1; + +create or replace view v1 as select ~ 10000 + 3, ~ (10000 + 3), (~ 10000) + 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select ~ 10000 + 3, ~ (10000 + 3), (~ 10000) + 3 union select * from v1; + +create or replace view v1 as select ~ 2 - 3, ~ (2 - 3), (~ 2) - 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select ~ 2 - 3, ~ (2 - 3), (~ 2) - 3 union select * from v1; + +create or replace view v1 as select ~ 10000000000000000000 * 2, ~ (100 * 2), (~ 10000000000000000000) * 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select ~ 10000000000000000000 * 2, ~ (100 * 2), (~ 10000000000000000000) * 2 union select * from v1; + +create or replace view v1 as select ~ 2 / 3, ~ (2 / 3), (~ 2) / 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select ~ 2 / 3, ~ (2 / 3), (~ 2) / 3 union select * from v1; + +create or replace view v1 as select ~ 2 DIV 3, ~ (2 DIV 3), (~ 2) DIV 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select ~ 2 DIV 3, ~ (2 DIV 3), (~ 2) DIV 3 union select * from v1; + +create or replace view v1 as select ~ 2 MOD 3, ~ (2 MOD 3), (~ 2) MOD 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select ~ 2 MOD 3, ~ (2 MOD 3), (~ 2) MOD 3 union select * from v1; + +create or replace view v1 as select ~ 2 % 3, ~ (2 % 3), (~ 2) % 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select ~ 2 % 3, ~ (2 % 3), (~ 2) % 3 union select * from v1; + +create or replace view v1 as select ~ 2 BETWEEN 1 AND 3, ~ (2 BETWEEN 1 AND 3), (~ 2) BETWEEN 1 AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select ~ 2 BETWEEN 1 AND 3, ~ (2 BETWEEN 1 AND 3), (~ 2) BETWEEN 1 AND 3 union select * from v1; + +create or replace view v1 as select charset(! 2 COLLATE latin1_bin), charset(! (2 COLLATE latin1_bin)), charset((! 2) COLLATE latin1_bin); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select charset(! 2 COLLATE latin1_bin), charset(! (2 COLLATE latin1_bin)), charset((! 2) COLLATE latin1_bin) union select * from v1; + +create or replace view v1 as select ! 2 IN (0,2), ! (2 IN (0,2)), (! 2) IN (0,2); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select ! 2 IN (0,2), ! (2 IN (0,2)), (! 2) IN (0,2) union select * from v1; + +create or replace view v1 as select ! 2 OR 3, ! (2 OR 3), (! 2) OR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select ! 2 OR 3, ! (2 OR 3), (! 2) OR 3 union select * from v1; + +create or replace view v1 as select ! 2 || 3, ! (2 || 3), (! 2) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select ! 2 || 3, ! (2 || 3), (! 2) || 3 union select * from v1; + +create or replace view v1 as select ! 2 AND 0, ! (2 AND 0), (! 2) AND 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select ! 2 AND 0, ! (2 AND 0), (! 2) AND 0 union select * from v1; + +create or replace view v1 as select ! 2 && 0, ! (2 && 0), (! 2) && 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select ! 2 && 0, ! (2 && 0), (! 2) && 0 union select * from v1; + +create or replace view v1 as select ! 2 = 3, ! (2 = 3), (! 2) = 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select ! 2 = 3, ! (2 = 3), (! 2) = 3 union select * from v1; + +create or replace view v1 as select ! 2 <=> 3, ! (2 <=> 3), (! 2) <=> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select ! 2 <=> 3, ! (2 <=> 3), (! 2) <=> 3 union select * from v1; + +create or replace view v1 as select ! 2 >= 3, ! (2 >= 3), (! 2) >= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select ! 2 >= 3, ! (2 >= 3), (! 2) >= 3 union select * from v1; + +create or replace view v1 as select ! 2 <= 3, ! (2 <= 3), (! 2) <= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select ! 2 <= 3, ! (2 <= 3), (! 2) <= 3 union select * from v1; + +create or replace view v1 as select ! 2 < 3, ! (2 < 3), (! 2) < 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select ! 2 < 3, ! (2 < 3), (! 2) < 3 union select * from v1; + +create or replace view v1 as select ! 2 <> 3, ! (2 <> 3), (! 2) <> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select ! 2 <> 3, ! (2 <> 3), (! 2) <> 3 union select * from v1; + +create or replace view v1 as select ! 2 > 3, ! (2 > 3), (! 2) > 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select ! 2 > 3, ! (2 > 3), (! 2) > 3 union select * from v1; + +create or replace view v1 as select ! 2 != 3, ! (2 != 3), (! 2) != 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select ! 2 != 3, ! (2 != 3), (! 2) != 3 union select * from v1; + +create or replace view v1 as select ! 2 LIKE 3, ! (2 LIKE 3), (! 2) LIKE 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select ! 2 LIKE 3, ! (2 LIKE 3), (! 2) LIKE 3 union select * from v1; + +create or replace view v1 as select ! 2 REGEXP 3, ! (2 REGEXP 3), (! 2) REGEXP 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select ! 2 REGEXP 3, ! (2 REGEXP 3), (! 2) REGEXP 3 union select * from v1; + +create or replace view v1 as select ! 2 | 3, ! (2 | 3), (! 2) | 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select ! 2 | 3, ! (2 | 3), (! 2) | 3 union select * from v1; + +create or replace view v1 as select ! 2 & 0, ! (2 & 0), (! 2) & 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select ! 2 & 0, ! (2 & 0), (! 2) & 0 union select * from v1; + +create or replace view v1 as select ! 0 << 3, ! (0 << 3), (! 0) << 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select ! 0 << 3, ! (0 << 3), (! 0) << 3 union select * from v1; + +create or replace view v1 as select ! 2 >> 3, ! (2 >> 3), (! 2) >> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select ! 2 >> 3, ! (2 >> 3), (! 2) >> 3 union select * from v1; + +create or replace view v1 as select ! '2000-01-01' +INTERVAL 1 DAY, ! ('2000-01-01' +INTERVAL 1 DAY), (! '2000-01-01') +INTERVAL 1 DAY; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select ! '2000-01-01' +INTERVAL 1 DAY, ! ('2000-01-01' +INTERVAL 1 DAY), (! '2000-01-01') +INTERVAL 1 DAY union select * from v1; + +create or replace view v1 as select ! 2 + 3, ! (2 + 3), (! 2) + 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select ! 2 + 3, ! (2 + 3), (! 2) + 3 union select * from v1; + +create or replace view v1 as select ! 2 - 3, ! (2 - 3), (! 2) - 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select ! 2 - 3, ! (2 - 3), (! 2) - 3 union select * from v1; + +create or replace view v1 as select ! 0 * 3, ! (0 * 3), (! 0) * 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select ! 0 * 3, ! (0 * 3), (! 0) * 3 union select * from v1; + +create or replace view v1 as select ! 0 / 3, ! (0 / 3), (! 0) / 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select ! 0 / 3, ! (0 / 3), (! 0) / 3 union select * from v1; + +create or replace view v1 as select ! 2 DIV 3, ! (2 DIV 3), (! 2) DIV 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select ! 2 DIV 3, ! (2 DIV 3), (! 2) DIV 3 union select * from v1; + +create or replace view v1 as select ! 6 MOD 3, ! (6 MOD 3), (! 6) MOD 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select ! 6 MOD 3, ! (6 MOD 3), (! 6) MOD 3 union select * from v1; + +create or replace view v1 as select ! 6 % 3, ! (6 % 3), (! 6) % 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select ! 6 % 3, ! (6 % 3), (! 6) % 3 union select * from v1; + +create or replace view v1 as select ! 2 ^ 3, ! (2 ^ 3), (! 2) ^ 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select ! 2 ^ 3, ! (2 ^ 3), (! 2) ^ 3 union select * from v1; + +create or replace view v1 as select ! 2 BETWEEN 3 AND 4, ! (2 BETWEEN 3 AND 4), (! 2) BETWEEN 3 AND 4; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select ! 2 BETWEEN 3 AND 4, ! (2 BETWEEN 3 AND 4), (! 2) BETWEEN 3 AND 4 union select * from v1; + +create or replace view v1 as select CHARSET(BINARY '2' COLLATE latin1_bin), CHARSET(BINARY ('2' COLLATE latin1_bin)), 'error'/*CHARSET((BINARY '2') COLLATE latin1_bin)*/; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select CHARSET(BINARY '2' COLLATE latin1_bin), CHARSET(BINARY ('2' COLLATE latin1_bin)), 'error'/*CHARSET((BINARY '2') COLLATE latin1_bin)*/ union select * from v1; + +create or replace view v1 as select BINARY 'c' IN ('C','X'), BINARY ('c' IN ('C','X')), (BINARY 'c') IN ('C','X'); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select BINARY 'c' IN ('C','X'), BINARY ('c' IN ('C','X')), (BINARY 'c') IN ('C','X') union select * from v1; + +create or replace view v1 as select BINARY 'c' = 'C', BINARY ('c' = 'C'), (BINARY 'c') = 'C'; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select BINARY 'c' = 'C', BINARY ('c' = 'C'), (BINARY 'c') = 'C' union select * from v1; + +create or replace view v1 as select BINARY 'c' <=> 'C', BINARY ('c' <=> 'C'), (BINARY 'c') <=> 'C'; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select BINARY 'c' <=> 'C', BINARY ('c' <=> 'C'), (BINARY 'c') <=> 'C' union select * from v1; + +create or replace view v1 as select BINARY 'c' >= 'D', BINARY ('c' >= 'D'), (BINARY 'c') >= 'D'; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select BINARY 'c' >= 'D', BINARY ('c' >= 'D'), (BINARY 'c') >= 'D' union select * from v1; + +create or replace view v1 as select BINARY 'c' <= 'C', BINARY ('c' <= 'C'), (BINARY 'c') <= 'C'; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select BINARY 'c' <= 'C', BINARY ('c' <= 'C'), (BINARY 'c') <= 'C' union select * from v1; + +create or replace view v1 as select BINARY 'c' < 'D', BINARY ('c' < 'D'), (BINARY 'c') < 'D'; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select BINARY 'c' < 'D', BINARY ('c' < 'D'), (BINARY 'c') < 'D' union select * from v1; + +create or replace view v1 as select BINARY 'c' <> 'C', BINARY ('c' <> 'C'), (BINARY 'c') <> 'C'; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select BINARY 'c' <> 'C', BINARY ('c' <> 'C'), (BINARY 'c') <> 'C' union select * from v1; + +create or replace view v1 as select BINARY 'c' > 'C', BINARY ('c' > 'C'), (BINARY 'c') > 'C'; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select BINARY 'c' > 'C', BINARY ('c' > 'C'), (BINARY 'c') > 'C' union select * from v1; + +create or replace view v1 as select BINARY 'c' != 'C', BINARY ('c' != 'C'), (BINARY 'c') != 'C'; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select BINARY 'c' != 'C', BINARY ('c' != 'C'), (BINARY 'c') != 'C' union select * from v1; + +create or replace view v1 as select BINARY 'c' LIKE 'C', BINARY ('c' LIKE 'C'), (BINARY 'c') LIKE 'C'; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select BINARY 'c' LIKE 'C', BINARY ('c' LIKE 'C'), (BINARY 'c') LIKE 'C' union select * from v1; + +create or replace view v1 as select BINARY 'c' REGEXP 'C', BINARY ('c' REGEXP 'C'), (BINARY 'c') REGEXP 'C'; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select BINARY 'c' REGEXP 'C', BINARY ('c' REGEXP 'C'), (BINARY 'c') REGEXP 'C' union select * from v1; + +create or replace view v1 as select BINARY 'c' BETWEEN 'A' AND 'D', BINARY ('c' BETWEEN 'A' AND 'D'), (BINARY 'c') BETWEEN 'A' AND 'D'; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select BINARY 'c' BETWEEN 'A' AND 'D', BINARY ('c' BETWEEN 'A' AND 'D'), (BINARY 'c') BETWEEN 'A' AND 'D' union select * from v1; + +create or replace view v1 as select 2 OR 3 IS FALSE, 2 OR (3 IS FALSE), (2 OR 3) IS FALSE; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 OR 3 IS FALSE, 2 OR (3 IS FALSE), (2 OR 3) IS FALSE union select * from v1; + +create or replace view v1 as select charset(2 OR 3 COLLATE latin1_bin), charset(2 OR (3 COLLATE latin1_bin)), charset((2 OR 3) COLLATE latin1_bin); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select charset(2 OR 3 COLLATE latin1_bin), charset(2 OR (3 COLLATE latin1_bin)), charset((2 OR 3) COLLATE latin1_bin) union select * from v1; + +create or replace view v1 as select 0 OR 3 IN (3,10), 0 OR (3 IN (3,10)), (0 OR 3) IN (3,10); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 0 OR 3 IN (3,10), 0 OR (3 IN (3,10)), (0 OR 3) IN (3,10) union select * from v1; + +create or replace view v1 as select 1 OR 0 XOR 1, 1 OR (0 XOR 1), (1 OR 0) XOR 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 1 OR 0 XOR 1, 1 OR (0 XOR 1), (1 OR 0) XOR 1 union select * from v1; + +create or replace view v1 as select 1 OR 1 AND 0, 1 OR (1 AND 0), (1 OR 1) AND 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 1 OR 1 AND 0, 1 OR (1 AND 0), (1 OR 1) AND 0 union select * from v1; + +create or replace view v1 as select 1 OR 1 && 0, 1 OR (1 && 0), (1 OR 1) && 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 1 OR 1 && 0, 1 OR (1 && 0), (1 OR 1) && 0 union select * from v1; + +create or replace view v1 as select 2 OR 3 = 3, 2 OR (3 = 3), (2 OR 3) = 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 OR 3 = 3, 2 OR (3 = 3), (2 OR 3) = 3 union select * from v1; + +create or replace view v1 as select 2 OR 3 <=> 3, 2 OR (3 <=> 3), (2 OR 3) <=> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 OR 3 <=> 3, 2 OR (3 <=> 3), (2 OR 3) <=> 3 union select * from v1; + +create or replace view v1 as select 2 OR 3 >= 3, 2 OR (3 >= 3), (2 OR 3) >= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 OR 3 >= 3, 2 OR (3 >= 3), (2 OR 3) >= 3 union select * from v1; + +create or replace view v1 as select 2 OR 3 <= 0, 2 OR (3 <= 0), (2 OR 3) <= 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 OR 3 <= 0, 2 OR (3 <= 0), (2 OR 3) <= 0 union select * from v1; + +create or replace view v1 as select 2 OR 3 < 0, 2 OR (3 < 0), (2 OR 3) < 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 OR 3 < 0, 2 OR (3 < 0), (2 OR 3) < 0 union select * from v1; + +create or replace view v1 as select 0 OR 3 <> 3, 0 OR (3 <> 3), (0 OR 3) <> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 0 OR 3 <> 3, 0 OR (3 <> 3), (0 OR 3) <> 3 union select * from v1; + +create or replace view v1 as select 2 OR 3 > 3, 2 OR (3 > 3), (2 OR 3) > 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 OR 3 > 3, 2 OR (3 > 3), (2 OR 3) > 3 union select * from v1; + +create or replace view v1 as select 0 OR 3 != 3, 0 OR (3 != 3), (0 OR 3) != 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 0 OR 3 != 3, 0 OR (3 != 3), (0 OR 3) != 3 union select * from v1; + +create or replace view v1 as select 2 OR 3 LIKE 3, 2 OR (3 LIKE 3), (2 OR 3) LIKE 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 OR 3 LIKE 3, 2 OR (3 LIKE 3), (2 OR 3) LIKE 3 union select * from v1; + +create or replace view v1 as select 2 OR 3 REGEXP 3, 2 OR (3 REGEXP 3), (2 OR 3) REGEXP 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 OR 3 REGEXP 3, 2 OR (3 REGEXP 3), (2 OR 3) REGEXP 3 union select * from v1; + +create or replace view v1 as select 2 OR 3 | 3, 2 OR (3 | 3), (2 OR 3) | 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 OR 3 | 3, 2 OR (3 | 3), (2 OR 3) | 3 union select * from v1; + +create or replace view v1 as select 0 OR 2 & 2, 0 OR (2 & 2), (0 OR 2) & 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 0 OR 2 & 2, 0 OR (2 & 2), (0 OR 2) & 2 union select * from v1; + +create or replace view v1 as select 2 OR 3 << 3, 2 OR (3 << 3), (2 OR 3) << 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 OR 3 << 3, 2 OR (3 << 3), (2 OR 3) << 3 union select * from v1; + +create or replace view v1 as select 2 OR 3 >> 3, 2 OR (3 >> 3), (2 OR 3) >> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 OR 3 >> 3, 2 OR (3 >> 3), (2 OR 3) >> 3 union select * from v1; + +create or replace view v1 as select 2 OR '2000-01-01' +INTERVAL 1 DAY, 2 OR ('2000-01-01' +INTERVAL 1 DAY), (2 OR '2000-01-01') +INTERVAL 1 DAY; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 OR '2000-01-01' +INTERVAL 1 DAY, 2 OR ('2000-01-01' +INTERVAL 1 DAY), (2 OR '2000-01-01') +INTERVAL 1 DAY union select * from v1; + +create or replace view v1 as select 2 OR 3 + 3, 2 OR (3 + 3), (2 OR 3) + 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 OR 3 + 3, 2 OR (3 + 3), (2 OR 3) + 3 union select * from v1; + +create or replace view v1 as select 2 OR 3 - 3, 2 OR (3 - 3), (2 OR 3) - 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 OR 3 - 3, 2 OR (3 - 3), (2 OR 3) - 3 union select * from v1; + +create or replace view v1 as select 2 OR 3 * 3, 2 OR (3 * 3), (2 OR 3) * 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 OR 3 * 3, 2 OR (3 * 3), (2 OR 3) * 3 union select * from v1; + +create or replace view v1 as select 2 OR 3 / 3, 2 OR (3 / 3), (2 OR 3) / 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 OR 3 / 3, 2 OR (3 / 3), (2 OR 3) / 3 union select * from v1; + +create or replace view v1 as select 2 OR 3 DIV 3, 2 OR (3 DIV 3), (2 OR 3) DIV 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 OR 3 DIV 3, 2 OR (3 DIV 3), (2 OR 3) DIV 3 union select * from v1; + +create or replace view v1 as select 0 OR 3 MOD 3, 0 OR (3 MOD 3), (0 OR 3) MOD 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 0 OR 3 MOD 3, 0 OR (3 MOD 3), (0 OR 3) MOD 3 union select * from v1; + +create or replace view v1 as select 0 OR 3 % 3, 0 OR (3 % 3), (0 OR 3) % 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 0 OR 3 % 3, 0 OR (3 % 3), (0 OR 3) % 3 union select * from v1; + +create or replace view v1 as select 2 OR 3 ^ 3, 2 OR (3 ^ 3), (2 OR 3) ^ 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 OR 3 ^ 3, 2 OR (3 ^ 3), (2 OR 3) ^ 3 union select * from v1; + +create or replace view v1 as select 2 OR 3 BETWEEN 2 AND 3, 2 OR (3 BETWEEN 2 AND 3), (2 OR 3) BETWEEN 2 AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 OR 3 BETWEEN 2 AND 3, 2 OR (3 BETWEEN 2 AND 3), (2 OR 3) BETWEEN 2 AND 3 union select * from v1; + +create or replace view v1 as select 2 || 3 IS FALSE, 2 || (3 IS FALSE), (2 || 3) IS FALSE; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 || 3 IS FALSE, 2 || (3 IS FALSE), (2 || 3) IS FALSE union select * from v1; + +create or replace view v1 as select charset(2 || 3 COLLATE latin1_bin), charset(2 || (3 COLLATE latin1_bin)), charset((2 || 3) COLLATE latin1_bin); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select charset(2 || 3 COLLATE latin1_bin), charset(2 || (3 COLLATE latin1_bin)), charset((2 || 3) COLLATE latin1_bin) union select * from v1; + +create or replace view v1 as select 0 || 3 IN (3,10), 0 || (3 IN (3,10)), (0 || 3) IN (3,10); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 0 || 3 IN (3,10), 0 || (3 IN (3,10)), (0 || 3) IN (3,10) union select * from v1; + +create or replace view v1 as select 1 || 0 XOR 1, 1 || (0 XOR 1), (1 || 0) XOR 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 1 || 0 XOR 1, 1 || (0 XOR 1), (1 || 0) XOR 1 union select * from v1; + +create or replace view v1 as select 1 || 1 AND 0, 1 || (1 AND 0), (1 || 1) AND 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 1 || 1 AND 0, 1 || (1 AND 0), (1 || 1) AND 0 union select * from v1; + +create or replace view v1 as select 1 || 1 && 0, 1 || (1 && 0), (1 || 1) && 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 1 || 1 && 0, 1 || (1 && 0), (1 || 1) && 0 union select * from v1; + +create or replace view v1 as select 2 || 3 = 3, 2 || (3 = 3), (2 || 3) = 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 || 3 = 3, 2 || (3 = 3), (2 || 3) = 3 union select * from v1; + +create or replace view v1 as select 2 || 3 <=> 3, 2 || (3 <=> 3), (2 || 3) <=> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 || 3 <=> 3, 2 || (3 <=> 3), (2 || 3) <=> 3 union select * from v1; + +create or replace view v1 as select 2 || 3 >= 3, 2 || (3 >= 3), (2 || 3) >= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 || 3 >= 3, 2 || (3 >= 3), (2 || 3) >= 3 union select * from v1; + +create or replace view v1 as select 2 || 3 <= 0, 2 || (3 <= 0), (2 || 3) <= 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 || 3 <= 0, 2 || (3 <= 0), (2 || 3) <= 0 union select * from v1; + +create or replace view v1 as select 2 || 3 < 0, 2 || (3 < 0), (2 || 3) < 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 || 3 < 0, 2 || (3 < 0), (2 || 3) < 0 union select * from v1; + +create or replace view v1 as select 0 || 3 <> 3, 0 || (3 <> 3), (0 || 3) <> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 0 || 3 <> 3, 0 || (3 <> 3), (0 || 3) <> 3 union select * from v1; + +create or replace view v1 as select 2 || 3 > 3, 2 || (3 > 3), (2 || 3) > 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 || 3 > 3, 2 || (3 > 3), (2 || 3) > 3 union select * from v1; + +create or replace view v1 as select 0 || 3 != 3, 0 || (3 != 3), (0 || 3) != 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 0 || 3 != 3, 0 || (3 != 3), (0 || 3) != 3 union select * from v1; + +create or replace view v1 as select 2 || 3 LIKE 3, 2 || (3 LIKE 3), (2 || 3) LIKE 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 || 3 LIKE 3, 2 || (3 LIKE 3), (2 || 3) LIKE 3 union select * from v1; + +create or replace view v1 as select 2 || 3 REGEXP 3, 2 || (3 REGEXP 3), (2 || 3) REGEXP 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 || 3 REGEXP 3, 2 || (3 REGEXP 3), (2 || 3) REGEXP 3 union select * from v1; + +create or replace view v1 as select 2 || 3 | 3, 2 || (3 | 3), (2 || 3) | 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 || 3 | 3, 2 || (3 | 3), (2 || 3) | 3 union select * from v1; + +create or replace view v1 as select 0 || 2 & 2, 0 || (2 & 2), (0 || 2) & 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 0 || 2 & 2, 0 || (2 & 2), (0 || 2) & 2 union select * from v1; + +create or replace view v1 as select 2 || 3 << 3, 2 || (3 << 3), (2 || 3) << 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 || 3 << 3, 2 || (3 << 3), (2 || 3) << 3 union select * from v1; + +create or replace view v1 as select 2 || 3 >> 3, 2 || (3 >> 3), (2 || 3) >> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 || 3 >> 3, 2 || (3 >> 3), (2 || 3) >> 3 union select * from v1; + +create or replace view v1 as select 2 || '2000-01-01' +INTERVAL 1 DAY, 2 || ('2000-01-01' +INTERVAL 1 DAY), (2 || '2000-01-01') +INTERVAL 1 DAY; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 || '2000-01-01' +INTERVAL 1 DAY, 2 || ('2000-01-01' +INTERVAL 1 DAY), (2 || '2000-01-01') +INTERVAL 1 DAY union select * from v1; + +create or replace view v1 as select 2 || 3 + 3, 2 || (3 + 3), (2 || 3) + 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 || 3 + 3, 2 || (3 + 3), (2 || 3) + 3 union select * from v1; + +create or replace view v1 as select 2 || 3 - 3, 2 || (3 - 3), (2 || 3) - 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 || 3 - 3, 2 || (3 - 3), (2 || 3) - 3 union select * from v1; + +create or replace view v1 as select 2 || 3 * 3, 2 || (3 * 3), (2 || 3) * 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 || 3 * 3, 2 || (3 * 3), (2 || 3) * 3 union select * from v1; + +create or replace view v1 as select 2 || 3 / 3, 2 || (3 / 3), (2 || 3) / 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 || 3 / 3, 2 || (3 / 3), (2 || 3) / 3 union select * from v1; + +create or replace view v1 as select 2 || 3 DIV 3, 2 || (3 DIV 3), (2 || 3) DIV 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 || 3 DIV 3, 2 || (3 DIV 3), (2 || 3) DIV 3 union select * from v1; + +create or replace view v1 as select 0 || 3 MOD 3, 0 || (3 MOD 3), (0 || 3) MOD 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 0 || 3 MOD 3, 0 || (3 MOD 3), (0 || 3) MOD 3 union select * from v1; + +create or replace view v1 as select 0 || 3 % 3, 0 || (3 % 3), (0 || 3) % 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 0 || 3 % 3, 0 || (3 % 3), (0 || 3) % 3 union select * from v1; + +create or replace view v1 as select 2 || 3 ^ 3, 2 || (3 ^ 3), (2 || 3) ^ 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 || 3 ^ 3, 2 || (3 ^ 3), (2 || 3) ^ 3 union select * from v1; + +create or replace view v1 as select 2 || 3 BETWEEN 2 AND 3, 2 || (3 BETWEEN 2 AND 3), (2 || 3) BETWEEN 2 AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 || 3 BETWEEN 2 AND 3, 2 || (3 BETWEEN 2 AND 3), (2 || 3) BETWEEN 2 AND 3 union select * from v1; + +create or replace view v1 as select charset(2 XOR 3 COLLATE latin1_bin), charset(2 XOR (3 COLLATE latin1_bin)), charset((2 XOR 3) COLLATE latin1_bin); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select charset(2 XOR 3 COLLATE latin1_bin), charset(2 XOR (3 COLLATE latin1_bin)), charset((2 XOR 3) COLLATE latin1_bin) union select * from v1; + +create or replace view v1 as select 2 XOR 3 IN (4,5), 2 XOR (3 IN (4,5)), (2 XOR 3) IN (4,5); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 XOR 3 IN (4,5), 2 XOR (3 IN (4,5)), (2 XOR 3) IN (4,5) union select * from v1; + +create or replace view v1 as select 2 XOR 3 OR 3, 2 XOR (3 OR 3), (2 XOR 3) OR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 XOR 3 OR 3, 2 XOR (3 OR 3), (2 XOR 3) OR 3 union select * from v1; + +create or replace view v1 as select 2 XOR 3 || 3, 2 XOR (3 || 3), (2 XOR 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 XOR 3 || 3, 2 XOR (3 || 3), (2 XOR 3) || 3 union select * from v1; + +create or replace view v1 as select 2 XOR 0 AND 0, 2 XOR (0 AND 0), (2 XOR 0) AND 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 XOR 0 AND 0, 2 XOR (0 AND 0), (2 XOR 0) AND 0 union select * from v1; + +create or replace view v1 as select 2 XOR 0 && 0, 2 XOR (0 && 0), (2 XOR 0) && 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 XOR 0 && 0, 2 XOR (0 && 0), (2 XOR 0) && 0 union select * from v1; + +create or replace view v1 as select 2 XOR 2 = 3, 2 XOR (2 = 3), (2 XOR 2) = 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 XOR 2 = 3, 2 XOR (2 = 3), (2 XOR 2) = 3 union select * from v1; + +create or replace view v1 as select NULL XOR 3 <=> 3, NULL XOR (3 <=> 3), (NULL XOR 3) <=> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select NULL XOR 3 <=> 3, NULL XOR (3 <=> 3), (NULL XOR 3) <=> 3 union select * from v1; + +create or replace view v1 as select 2 XOR 1 >= 3, 2 XOR (1 >= 3), (2 XOR 1) >= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 XOR 1 >= 3, 2 XOR (1 >= 3), (2 XOR 1) >= 3 union select * from v1; + +create or replace view v1 as select 2 XOR 3 <= 3, 2 XOR (3 <= 3), (2 XOR 3) <= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 XOR 3 <= 3, 2 XOR (3 <= 3), (2 XOR 3) <= 3 union select * from v1; + +create or replace view v1 as select 2 XOR 1 < 3, 2 XOR (1 < 3), (2 XOR 1) < 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 XOR 1 < 3, 2 XOR (1 < 3), (2 XOR 1) < 3 union select * from v1; + +create or replace view v1 as select 2 XOR 2 <> 3, 2 XOR (2 <> 3), (2 XOR 2) <> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 XOR 2 <> 3, 2 XOR (2 <> 3), (2 XOR 2) <> 3 union select * from v1; + +create or replace view v1 as select 2 XOR 3 > 3, 2 XOR (3 > 3), (2 XOR 3) > 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 XOR 3 > 3, 2 XOR (3 > 3), (2 XOR 3) > 3 union select * from v1; + +create or replace view v1 as select 2 XOR 2 != 3, 2 XOR (2 != 3), (2 XOR 2) != 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 XOR 2 != 3, 2 XOR (2 != 3), (2 XOR 2) != 3 union select * from v1; + +create or replace view v1 as select 2 XOR 1 LIKE 3, 2 XOR (1 LIKE 3), (2 XOR 1) LIKE 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 XOR 1 LIKE 3, 2 XOR (1 LIKE 3), (2 XOR 1) LIKE 3 union select * from v1; + +create or replace view v1 as select 2 XOR 1 REGEXP 3, 2 XOR (1 REGEXP 3), (2 XOR 1) REGEXP 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 XOR 1 REGEXP 3, 2 XOR (1 REGEXP 3), (2 XOR 1) REGEXP 3 union select * from v1; + +create or replace view v1 as select 2 XOR 3 | 3, 2 XOR (3 | 3), (2 XOR 3) | 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 XOR 3 | 3, 2 XOR (3 | 3), (2 XOR 3) | 3 union select * from v1; + +create or replace view v1 as select 2 XOR 0 & 0, 2 XOR (0 & 0), (2 XOR 0) & 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 XOR 0 & 0, 2 XOR (0 & 0), (2 XOR 0) & 0 union select * from v1; + +create or replace view v1 as select 0 XOR 3 << 3, 0 XOR (3 << 3), (0 XOR 3) << 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 0 XOR 3 << 3, 0 XOR (3 << 3), (0 XOR 3) << 3 union select * from v1; + +create or replace view v1 as select 2 XOR 3 >> 3, 2 XOR (3 >> 3), (2 XOR 3) >> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 XOR 3 >> 3, 2 XOR (3 >> 3), (2 XOR 3) >> 3 union select * from v1; + +create or replace view v1 as select 2 XOR '2000-01-01' +INTERVAL 1 DAY, 2 XOR ('2000-01-01' +INTERVAL 1 DAY), (2 XOR '2000-01-01') +INTERVAL 1 DAY; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 XOR '2000-01-01' +INTERVAL 1 DAY, 2 XOR ('2000-01-01' +INTERVAL 1 DAY), (2 XOR '2000-01-01') +INTERVAL 1 DAY union select * from v1; + +create or replace view v1 as select 2 XOR 3 + 3, 2 XOR (3 + 3), (2 XOR 3) + 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 XOR 3 + 3, 2 XOR (3 + 3), (2 XOR 3) + 3 union select * from v1; + +create or replace view v1 as select 2 XOR 3 - 3, 2 XOR (3 - 3), (2 XOR 3) - 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 XOR 3 - 3, 2 XOR (3 - 3), (2 XOR 3) - 3 union select * from v1; + +create or replace view v1 as select 0 XOR 3 * 3, 0 XOR (3 * 3), (0 XOR 3) * 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 0 XOR 3 * 3, 0 XOR (3 * 3), (0 XOR 3) * 3 union select * from v1; + +create or replace view v1 as select 0 XOR 3 / 3, 0 XOR (3 / 3), (0 XOR 3) / 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 0 XOR 3 / 3, 0 XOR (3 / 3), (0 XOR 3) / 3 union select * from v1; + +create or replace view v1 as select 0 XOR 3 DIV 3, 0 XOR (3 DIV 3), (0 XOR 3) DIV 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 0 XOR 3 DIV 3, 0 XOR (3 DIV 3), (0 XOR 3) DIV 3 union select * from v1; + +create or replace view v1 as select 2 XOR 3 MOD 3, 2 XOR (3 MOD 3), (2 XOR 3) MOD 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 XOR 3 MOD 3, 2 XOR (3 MOD 3), (2 XOR 3) MOD 3 union select * from v1; + +create or replace view v1 as select 2 XOR 3 % 3, 2 XOR (3 % 3), (2 XOR 3) % 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 XOR 3 % 3, 2 XOR (3 % 3), (2 XOR 3) % 3 union select * from v1; + +create or replace view v1 as select 2 XOR 3 ^ 3, 2 XOR (3 ^ 3), (2 XOR 3) ^ 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 XOR 3 ^ 3, 2 XOR (3 ^ 3), (2 XOR 3) ^ 3 union select * from v1; + +create or replace view v1 as select 2 XOR 3 BETWEEN 0 AND 3, 2 XOR (3 BETWEEN 0 AND 3), (2 XOR 3) BETWEEN 0 AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 XOR 3 BETWEEN 0 AND 3, 2 XOR (3 BETWEEN 0 AND 3), (2 XOR 3) BETWEEN 0 AND 3 union select * from v1; + +create or replace view v1 as select 0 AND 3 IS FALSE, 0 AND (3 IS FALSE), (0 AND 3) IS FALSE; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 0 AND 3 IS FALSE, 0 AND (3 IS FALSE), (0 AND 3) IS FALSE union select * from v1; + +create or replace view v1 as select charset(2 AND 3 COLLATE latin1_bin), charset(2 AND (3 COLLATE latin1_bin)), charset((2 AND 3) COLLATE latin1_bin); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select charset(2 AND 3 COLLATE latin1_bin), charset(2 AND (3 COLLATE latin1_bin)), charset((2 AND 3) COLLATE latin1_bin) union select * from v1; + +create or replace view v1 as select 2 AND 3 IN (0,1), 2 AND (3 IN (0,1)), (2 AND 3) IN (0,1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 AND 3 IN (0,1), 2 AND (3 IN (0,1)), (2 AND 3) IN (0,1) union select * from v1; + +create or replace view v1 as select 0 AND 3 OR 3, 0 AND (3 OR 3), (0 AND 3) OR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 0 AND 3 OR 3, 0 AND (3 OR 3), (0 AND 3) OR 3 union select * from v1; + +create or replace view v1 as select 0 AND 3 || 3, 0 AND (3 || 3), (0 AND 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 0 AND 3 || 3, 0 AND (3 || 3), (0 AND 3) || 3 union select * from v1; + +create or replace view v1 as select 0 AND 3 XOR 3, 0 AND (3 XOR 3), (0 AND 3) XOR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 0 AND 3 XOR 3, 0 AND (3 XOR 3), (0 AND 3) XOR 3 union select * from v1; + +create or replace view v1 as select 2 AND 3 = 3, 2 AND (3 = 3), (2 AND 3) = 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 AND 3 = 3, 2 AND (3 = 3), (2 AND 3) = 3 union select * from v1; + +create or replace view v1 as select 2 AND 3 <=> 3, 2 AND (3 <=> 3), (2 AND 3) <=> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 AND 3 <=> 3, 2 AND (3 <=> 3), (2 AND 3) <=> 3 union select * from v1; + +create or replace view v1 as select 2 AND 3 >= 3, 2 AND (3 >= 3), (2 AND 3) >= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 AND 3 >= 3, 2 AND (3 >= 3), (2 AND 3) >= 3 union select * from v1; + +create or replace view v1 as select 2 AND 4 <= 3, 2 AND (4 <= 3), (2 AND 4) <= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 AND 4 <= 3, 2 AND (4 <= 3), (2 AND 4) <= 3 union select * from v1; + +create or replace view v1 as select 2 AND 3 < 3, 2 AND (3 < 3), (2 AND 3) < 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 AND 3 < 3, 2 AND (3 < 3), (2 AND 3) < 3 union select * from v1; + +create or replace view v1 as select 2 AND 3 <> 3, 2 AND (3 <> 3), (2 AND 3) <> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 AND 3 <> 3, 2 AND (3 <> 3), (2 AND 3) <> 3 union select * from v1; + +create or replace view v1 as select 2 AND 3 > 1, 2 AND (3 > 1), (2 AND 3) > 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 AND 3 > 1, 2 AND (3 > 1), (2 AND 3) > 1 union select * from v1; + +create or replace view v1 as select 2 AND 3 != 3, 2 AND (3 != 3), (2 AND 3) != 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 AND 3 != 3, 2 AND (3 != 3), (2 AND 3) != 3 union select * from v1; + +create or replace view v1 as select 2 AND 3 LIKE 3, 2 AND (3 LIKE 3), (2 AND 3) LIKE 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 AND 3 LIKE 3, 2 AND (3 LIKE 3), (2 AND 3) LIKE 3 union select * from v1; + +create or replace view v1 as select 2 AND 3 REGEXP 3, 2 AND (3 REGEXP 3), (2 AND 3) REGEXP 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 AND 3 REGEXP 3, 2 AND (3 REGEXP 3), (2 AND 3) REGEXP 3 union select * from v1; + +create or replace view v1 as select 2 AND 3 | 3, 2 AND (3 | 3), (2 AND 3) | 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 AND 3 | 3, 2 AND (3 | 3), (2 AND 3) | 3 union select * from v1; + +create or replace view v1 as select 2 AND 2 & 2, 2 AND (2 & 2), (2 AND 2) & 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 AND 2 & 2, 2 AND (2 & 2), (2 AND 2) & 2 union select * from v1; + +create or replace view v1 as select 2 AND 3 << 3, 2 AND (3 << 3), (2 AND 3) << 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 AND 3 << 3, 2 AND (3 << 3), (2 AND 3) << 3 union select * from v1; + +create or replace view v1 as select 2 AND 3 >> 1, 2 AND (3 >> 1), (2 AND 3) >> 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 AND 3 >> 1, 2 AND (3 >> 1), (2 AND 3) >> 1 union select * from v1; + +create or replace view v1 as select 2 AND '2000-01-01' +INTERVAL 1 DAY, 2 AND ('2000-01-01' +INTERVAL 1 DAY), (2 AND '2000-01-01') +INTERVAL 1 DAY; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 AND '2000-01-01' +INTERVAL 1 DAY, 2 AND ('2000-01-01' +INTERVAL 1 DAY), (2 AND '2000-01-01') +INTERVAL 1 DAY union select * from v1; + +create or replace view v1 as select 2 AND 3 + 3, 2 AND (3 + 3), (2 AND 3) + 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 AND 3 + 3, 2 AND (3 + 3), (2 AND 3) + 3 union select * from v1; + +create or replace view v1 as select 2 AND 3 - 3, 2 AND (3 - 3), (2 AND 3) - 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 AND 3 - 3, 2 AND (3 - 3), (2 AND 3) - 3 union select * from v1; + +create or replace view v1 as select 2 AND 3 * 3, 2 AND (3 * 3), (2 AND 3) * 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 AND 3 * 3, 2 AND (3 * 3), (2 AND 3) * 3 union select * from v1; + +create or replace view v1 as select 2 AND 3 / 3, 2 AND (3 / 3), (2 AND 3) / 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 AND 3 / 3, 2 AND (3 / 3), (2 AND 3) / 3 union select * from v1; + +create or replace view v1 as select 2 AND 3 DIV 3, 2 AND (3 DIV 3), (2 AND 3) DIV 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 AND 3 DIV 3, 2 AND (3 DIV 3), (2 AND 3) DIV 3 union select * from v1; + +create or replace view v1 as select 2 AND 3 MOD 3, 2 AND (3 MOD 3), (2 AND 3) MOD 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 AND 3 MOD 3, 2 AND (3 MOD 3), (2 AND 3) MOD 3 union select * from v1; + +create or replace view v1 as select 2 AND 3 % 3, 2 AND (3 % 3), (2 AND 3) % 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 AND 3 % 3, 2 AND (3 % 3), (2 AND 3) % 3 union select * from v1; + +create or replace view v1 as select 2 AND 3 ^ 3, 2 AND (3 ^ 3), (2 AND 3) ^ 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 AND 3 ^ 3, 2 AND (3 ^ 3), (2 AND 3) ^ 3 union select * from v1; + +create or replace view v1 as select 2 AND 3 BETWEEN 2 AND 3, 2 AND (3 BETWEEN 2 AND 3), (2 AND 3) BETWEEN 2 AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 AND 3 BETWEEN 2 AND 3, 2 AND (3 BETWEEN 2 AND 3), (2 AND 3) BETWEEN 2 AND 3 union select * from v1; + +create or replace view v1 as select 0 && 3 IS FALSE, 0 && (3 IS FALSE), (0 && 3) IS FALSE; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 0 && 3 IS FALSE, 0 && (3 IS FALSE), (0 && 3) IS FALSE union select * from v1; + +create or replace view v1 as select charset(2 && 3 COLLATE latin1_bin), charset(2 && (3 COLLATE latin1_bin)), charset((2 && 3) COLLATE latin1_bin); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select charset(2 && 3 COLLATE latin1_bin), charset(2 && (3 COLLATE latin1_bin)), charset((2 && 3) COLLATE latin1_bin) union select * from v1; + +create or replace view v1 as select 2 && 3 IN (0,1), 2 && (3 IN (0,1)), (2 && 3) IN (0,1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 && 3 IN (0,1), 2 && (3 IN (0,1)), (2 && 3) IN (0,1) union select * from v1; + +create or replace view v1 as select 0 && 3 OR 3, 0 && (3 OR 3), (0 && 3) OR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 0 && 3 OR 3, 0 && (3 OR 3), (0 && 3) OR 3 union select * from v1; + +create or replace view v1 as select 0 && 3 || 3, 0 && (3 || 3), (0 && 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 0 && 3 || 3, 0 && (3 || 3), (0 && 3) || 3 union select * from v1; + +create or replace view v1 as select 0 && 3 XOR 3, 0 && (3 XOR 3), (0 && 3) XOR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 0 && 3 XOR 3, 0 && (3 XOR 3), (0 && 3) XOR 3 union select * from v1; + +create or replace view v1 as select 2 && 3 = 3, 2 && (3 = 3), (2 && 3) = 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 && 3 = 3, 2 && (3 = 3), (2 && 3) = 3 union select * from v1; + +create or replace view v1 as select 2 && 3 <=> 3, 2 && (3 <=> 3), (2 && 3) <=> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 && 3 <=> 3, 2 && (3 <=> 3), (2 && 3) <=> 3 union select * from v1; + +create or replace view v1 as select 2 && 3 >= 3, 2 && (3 >= 3), (2 && 3) >= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 && 3 >= 3, 2 && (3 >= 3), (2 && 3) >= 3 union select * from v1; + +create or replace view v1 as select 2 && 4 <= 3, 2 && (4 <= 3), (2 && 4) <= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 && 4 <= 3, 2 && (4 <= 3), (2 && 4) <= 3 union select * from v1; + +create or replace view v1 as select 2 && 3 < 3, 2 && (3 < 3), (2 && 3) < 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 && 3 < 3, 2 && (3 < 3), (2 && 3) < 3 union select * from v1; + +create or replace view v1 as select 2 && 3 <> 3, 2 && (3 <> 3), (2 && 3) <> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 && 3 <> 3, 2 && (3 <> 3), (2 && 3) <> 3 union select * from v1; + +create or replace view v1 as select 2 && 3 > 1, 2 && (3 > 1), (2 && 3) > 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 && 3 > 1, 2 && (3 > 1), (2 && 3) > 1 union select * from v1; + +create or replace view v1 as select 2 && 3 != 3, 2 && (3 != 3), (2 && 3) != 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 && 3 != 3, 2 && (3 != 3), (2 && 3) != 3 union select * from v1; + +create or replace view v1 as select 2 && 3 LIKE 3, 2 && (3 LIKE 3), (2 && 3) LIKE 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 && 3 LIKE 3, 2 && (3 LIKE 3), (2 && 3) LIKE 3 union select * from v1; + +create or replace view v1 as select 2 && 3 REGEXP 3, 2 && (3 REGEXP 3), (2 && 3) REGEXP 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 && 3 REGEXP 3, 2 && (3 REGEXP 3), (2 && 3) REGEXP 3 union select * from v1; + +create or replace view v1 as select 2 && 3 | 3, 2 && (3 | 3), (2 && 3) | 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 && 3 | 3, 2 && (3 | 3), (2 && 3) | 3 union select * from v1; + +create or replace view v1 as select 2 && 2 & 2, 2 && (2 & 2), (2 && 2) & 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 && 2 & 2, 2 && (2 & 2), (2 && 2) & 2 union select * from v1; + +create or replace view v1 as select 2 && 3 << 3, 2 && (3 << 3), (2 && 3) << 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 && 3 << 3, 2 && (3 << 3), (2 && 3) << 3 union select * from v1; + +create or replace view v1 as select 2 && 3 >> 1, 2 && (3 >> 1), (2 && 3) >> 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 && 3 >> 1, 2 && (3 >> 1), (2 && 3) >> 1 union select * from v1; + +create or replace view v1 as select 2 && '2000-01-01' +INTERVAL 1 DAY, 2 && ('2000-01-01' +INTERVAL 1 DAY), (2 && '2000-01-01') +INTERVAL 1 DAY; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 && '2000-01-01' +INTERVAL 1 DAY, 2 && ('2000-01-01' +INTERVAL 1 DAY), (2 && '2000-01-01') +INTERVAL 1 DAY union select * from v1; + +create or replace view v1 as select 2 && 3 + 3, 2 && (3 + 3), (2 && 3) + 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 && 3 + 3, 2 && (3 + 3), (2 && 3) + 3 union select * from v1; + +create or replace view v1 as select 2 && 3 - 3, 2 && (3 - 3), (2 && 3) - 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 && 3 - 3, 2 && (3 - 3), (2 && 3) - 3 union select * from v1; + +create or replace view v1 as select 2 && 3 * 3, 2 && (3 * 3), (2 && 3) * 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 && 3 * 3, 2 && (3 * 3), (2 && 3) * 3 union select * from v1; + +create or replace view v1 as select 2 && 3 / 3, 2 && (3 / 3), (2 && 3) / 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 && 3 / 3, 2 && (3 / 3), (2 && 3) / 3 union select * from v1; + +create or replace view v1 as select 2 && 3 DIV 3, 2 && (3 DIV 3), (2 && 3) DIV 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 && 3 DIV 3, 2 && (3 DIV 3), (2 && 3) DIV 3 union select * from v1; + +create or replace view v1 as select 2 && 3 MOD 3, 2 && (3 MOD 3), (2 && 3) MOD 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 && 3 MOD 3, 2 && (3 MOD 3), (2 && 3) MOD 3 union select * from v1; + +create or replace view v1 as select 2 && 3 % 3, 2 && (3 % 3), (2 && 3) % 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 && 3 % 3, 2 && (3 % 3), (2 && 3) % 3 union select * from v1; + +create or replace view v1 as select 2 && 3 ^ 3, 2 && (3 ^ 3), (2 && 3) ^ 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 && 3 ^ 3, 2 && (3 ^ 3), (2 && 3) ^ 3 union select * from v1; + +create or replace view v1 as select 2 && 3 BETWEEN 2 AND 3, 2 && (3 BETWEEN 2 AND 3), (2 && 3) BETWEEN 2 AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 && 3 BETWEEN 2 AND 3, 2 && (3 BETWEEN 2 AND 3), (2 && 3) BETWEEN 2 AND 3 union select * from v1; + +create or replace view v1 as select 2 = 3 IS FALSE, 2 = (3 IS FALSE), (2 = 3) IS FALSE; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 = 3 IS FALSE, 2 = (3 IS FALSE), (2 = 3) IS FALSE union select * from v1; + +create or replace view v1 as select charset(2 = 3 COLLATE latin1_bin), charset(2 = (3 COLLATE latin1_bin)), charset((2 = 3) COLLATE latin1_bin); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select charset(2 = 3 COLLATE latin1_bin), charset(2 = (3 COLLATE latin1_bin)), charset((2 = 3) COLLATE latin1_bin) union select * from v1; + +create or replace view v1 as select 2 = 3 IN (0,1), 2 = (3 IN (0,1)), (2 = 3) IN (0,1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 = 3 IN (0,1), 2 = (3 IN (0,1)), (2 = 3) IN (0,1) union select * from v1; + +create or replace view v1 as select 2 = 3 OR 3, 2 = (3 OR 3), (2 = 3) OR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 = 3 OR 3, 2 = (3 OR 3), (2 = 3) OR 3 union select * from v1; + +create or replace view v1 as select 2 = 3 || 3, 2 = (3 || 3), (2 = 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 = 3 || 3, 2 = (3 || 3), (2 = 3) || 3 union select * from v1; + +create or replace view v1 as select 2 = 3 XOR 3, 2 = (3 XOR 3), (2 = 3) XOR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 = 3 XOR 3, 2 = (3 XOR 3), (2 = 3) XOR 3 union select * from v1; + +create or replace view v1 as select 2 = 2 AND 2, 2 = (2 AND 2), (2 = 2) AND 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 = 2 AND 2, 2 = (2 AND 2), (2 = 2) AND 2 union select * from v1; + +create or replace view v1 as select 2 = 2 && 2, 2 = (2 && 2), (2 = 2) && 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 = 2 && 2, 2 = (2 && 2), (2 = 2) && 2 union select * from v1; + +create or replace view v1 as select 1 = 3 = 3, 1 = (3 = 3), (1 = 3) = 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 1 = 3 = 3, 1 = (3 = 3), (1 = 3) = 3 union select * from v1; + +create or replace view v1 as select 1 = 3 <=> 3, 1 = (3 <=> 3), (1 = 3) <=> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 1 = 3 <=> 3, 1 = (3 <=> 3), (1 = 3) <=> 3 union select * from v1; + +create or replace view v1 as select 1 = 3 >= 3, 1 = (3 >= 3), (1 = 3) >= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 1 = 3 >= 3, 1 = (3 >= 3), (1 = 3) >= 3 union select * from v1; + +create or replace view v1 as select 2 = 3 <= 3, 2 = (3 <= 3), (2 = 3) <= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 = 3 <= 3, 2 = (3 <= 3), (2 = 3) <= 3 union select * from v1; + +create or replace view v1 as select 2 = 3 < 3, 2 = (3 < 3), (2 = 3) < 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 = 3 < 3, 2 = (3 < 3), (2 = 3) < 3 union select * from v1; + +create or replace view v1 as select 2 = 3 <> 3, 2 = (3 <> 3), (2 = 3) <> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 = 3 <> 3, 2 = (3 <> 3), (2 = 3) <> 3 union select * from v1; + +create or replace view v1 as select 0 = 3 > 3, 0 = (3 > 3), (0 = 3) > 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 0 = 3 > 3, 0 = (3 > 3), (0 = 3) > 3 union select * from v1; + +create or replace view v1 as select 2 = 3 != 3, 2 = (3 != 3), (2 = 3) != 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 = 3 != 3, 2 = (3 != 3), (2 = 3) != 3 union select * from v1; + +create or replace view v1 as select 1 = 3 LIKE 3, 1 = (3 LIKE 3), (1 = 3) LIKE 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 1 = 3 LIKE 3, 1 = (3 LIKE 3), (1 = 3) LIKE 3 union select * from v1; + +create or replace view v1 as select 1 = 3 REGEXP 3, 1 = (3 REGEXP 3), (1 = 3) REGEXP 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 1 = 3 REGEXP 3, 1 = (3 REGEXP 3), (1 = 3) REGEXP 3 union select * from v1; + +create or replace view v1 as select 2 = 3 | 3, 2 = (3 | 3), (2 = 3) | 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 = 3 | 3, 2 = (3 | 3), (2 = 3) | 3 union select * from v1; + +create or replace view v1 as select 2 = 3 & 2, 2 = (3 & 2), (2 = 3) & 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 = 3 & 2, 2 = (3 & 2), (2 = 3) & 2 union select * from v1; + +create or replace view v1 as select 3 = 3 << 3, 3 = (3 << 3), (3 = 3) << 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 3 = 3 << 3, 3 = (3 << 3), (3 = 3) << 3 union select * from v1; + +create or replace view v1 as select 1 = 3 >> 1, 1 = (3 >> 1), (1 = 3) >> 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 1 = 3 >> 1, 1 = (3 >> 1), (1 = 3) >> 1 union select * from v1; + +create or replace view v1 as select 2 = '2000-01-01' +INTERVAL 1 DAY, 2 = ('2000-01-01' +INTERVAL 1 DAY), (2 = '2000-01-01') +INTERVAL 1 DAY; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 = '2000-01-01' +INTERVAL 1 DAY, 2 = ('2000-01-01' +INTERVAL 1 DAY), (2 = '2000-01-01') +INTERVAL 1 DAY union select * from v1; + +create or replace view v1 as select 2 = 3 + 3, 2 = (3 + 3), (2 = 3) + 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 = 3 + 3, 2 = (3 + 3), (2 = 3) + 3 union select * from v1; + +create or replace view v1 as select 2 = 3 - 3, 2 = (3 - 3), (2 = 3) - 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 = 3 - 3, 2 = (3 - 3), (2 = 3) - 3 union select * from v1; + +create or replace view v1 as select 3 = 3 * 3, 3 = (3 * 3), (3 = 3) * 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 3 = 3 * 3, 3 = (3 * 3), (3 = 3) * 3 union select * from v1; + +create or replace view v1 as select 3 = 9 / 3, 3 = (9 / 3), (3 = 9) / 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 3 = 9 / 3, 3 = (9 / 3), (3 = 9) / 3 union select * from v1; + +create or replace view v1 as select 3 = 9 DIV 3, 3 = (9 DIV 3), (3 = 9) DIV 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 3 = 9 DIV 3, 3 = (9 DIV 3), (3 = 9) DIV 3 union select * from v1; + +create or replace view v1 as select 3 = 3 MOD 3, 3 = (3 MOD 3), (3 = 3) MOD 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 3 = 3 MOD 3, 3 = (3 MOD 3), (3 = 3) MOD 3 union select * from v1; + +create or replace view v1 as select 3 = 3 % 3, 3 = (3 % 3), (3 = 3) % 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 3 = 3 % 3, 3 = (3 % 3), (3 = 3) % 3 union select * from v1; + +create or replace view v1 as select 2 = 3 ^ 3, 2 = (3 ^ 3), (2 = 3) ^ 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 = 3 ^ 3, 2 = (3 ^ 3), (2 = 3) ^ 3 union select * from v1; + +create or replace view v1 as select 1 = 3 BETWEEN 1 AND 3, 1 = (3 BETWEEN 1 AND 3), (1 = 3) BETWEEN 1 AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 1 = 3 BETWEEN 1 AND 3, 1 = (3 BETWEEN 1 AND 3), (1 = 3) BETWEEN 1 AND 3 union select * from v1; + +create or replace view v1 as select 2 <=> 3 IS FALSE, 2 <=> (3 IS FALSE), (2 <=> 3) IS FALSE; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 <=> 3 IS FALSE, 2 <=> (3 IS FALSE), (2 <=> 3) IS FALSE union select * from v1; + +create or replace view v1 as select charset(2 <=> 3 COLLATE latin1_bin), charset(2 <=> (3 COLLATE latin1_bin)), charset((2 <=> 3) COLLATE latin1_bin); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select charset(2 <=> 3 COLLATE latin1_bin), charset(2 <=> (3 COLLATE latin1_bin)), charset((2 <=> 3) COLLATE latin1_bin) union select * from v1; + +create or replace view v1 as select 2 <=> 3 IN (0,1), 2 <=> (3 IN (0,1)), (2 <=> 3) IN (0,1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 <=> 3 IN (0,1), 2 <=> (3 IN (0,1)), (2 <=> 3) IN (0,1) union select * from v1; + +create or replace view v1 as select 2 <=> 3 OR 3, 2 <=> (3 OR 3), (2 <=> 3) OR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 <=> 3 OR 3, 2 <=> (3 OR 3), (2 <=> 3) OR 3 union select * from v1; + +create or replace view v1 as select 2 <=> 3 || 3, 2 <=> (3 || 3), (2 <=> 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 <=> 3 || 3, 2 <=> (3 || 3), (2 <=> 3) || 3 union select * from v1; + +create or replace view v1 as select 2 <=> 3 XOR 3, 2 <=> (3 XOR 3), (2 <=> 3) XOR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 <=> 3 XOR 3, 2 <=> (3 XOR 3), (2 <=> 3) XOR 3 union select * from v1; + +create or replace view v1 as select 2 <=> 2 AND 2, 2 <=> (2 AND 2), (2 <=> 2) AND 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 <=> 2 AND 2, 2 <=> (2 AND 2), (2 <=> 2) AND 2 union select * from v1; + +create or replace view v1 as select 2 <=> 2 && 2, 2 <=> (2 && 2), (2 <=> 2) && 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 <=> 2 && 2, 2 <=> (2 && 2), (2 <=> 2) && 2 union select * from v1; + +create or replace view v1 as select 1 <=> 3 = 3, 1 <=> (3 = 3), (1 <=> 3) = 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 1 <=> 3 = 3, 1 <=> (3 = 3), (1 <=> 3) = 3 union select * from v1; + +create or replace view v1 as select 1 <=> 3 <=> 3, 1 <=> (3 <=> 3), (1 <=> 3) <=> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 1 <=> 3 <=> 3, 1 <=> (3 <=> 3), (1 <=> 3) <=> 3 union select * from v1; + +create or replace view v1 as select 1 <=> 3 >= 3, 1 <=> (3 >= 3), (1 <=> 3) >= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 1 <=> 3 >= 3, 1 <=> (3 >= 3), (1 <=> 3) >= 3 union select * from v1; + +create or replace view v1 as select 2 <=> 3 <= 3, 2 <=> (3 <= 3), (2 <=> 3) <= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 <=> 3 <= 3, 2 <=> (3 <= 3), (2 <=> 3) <= 3 union select * from v1; + +create or replace view v1 as select 2 <=> 3 < 3, 2 <=> (3 < 3), (2 <=> 3) < 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 <=> 3 < 3, 2 <=> (3 < 3), (2 <=> 3) < 3 union select * from v1; + +create or replace view v1 as select 2 <=> 3 <> 3, 2 <=> (3 <> 3), (2 <=> 3) <> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 <=> 3 <> 3, 2 <=> (3 <> 3), (2 <=> 3) <> 3 union select * from v1; + +create or replace view v1 as select 0 <=> 3 > 3, 0 <=> (3 > 3), (0 <=> 3) > 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 0 <=> 3 > 3, 0 <=> (3 > 3), (0 <=> 3) > 3 union select * from v1; + +create or replace view v1 as select 2 <=> 3 != 3, 2 <=> (3 != 3), (2 <=> 3) != 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 <=> 3 != 3, 2 <=> (3 != 3), (2 <=> 3) != 3 union select * from v1; + +create or replace view v1 as select 1 <=> 3 LIKE 3, 1 <=> (3 LIKE 3), (1 <=> 3) LIKE 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 1 <=> 3 LIKE 3, 1 <=> (3 LIKE 3), (1 <=> 3) LIKE 3 union select * from v1; + +create or replace view v1 as select 1 <=> 3 REGEXP 3, 1 <=> (3 REGEXP 3), (1 <=> 3) REGEXP 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 1 <=> 3 REGEXP 3, 1 <=> (3 REGEXP 3), (1 <=> 3) REGEXP 3 union select * from v1; + +create or replace view v1 as select 2 <=> 3 | 3, 2 <=> (3 | 3), (2 <=> 3) | 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 <=> 3 | 3, 2 <=> (3 | 3), (2 <=> 3) | 3 union select * from v1; + +create or replace view v1 as select 2 <=> 3 & 2, 2 <=> (3 & 2), (2 <=> 3) & 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 <=> 3 & 2, 2 <=> (3 & 2), (2 <=> 3) & 2 union select * from v1; + +create or replace view v1 as select 3 <=> 3 << 3, 3 <=> (3 << 3), (3 <=> 3) << 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 3 <=> 3 << 3, 3 <=> (3 << 3), (3 <=> 3) << 3 union select * from v1; + +create or replace view v1 as select 1 <=> 3 >> 1, 1 <=> (3 >> 1), (1 <=> 3) >> 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 1 <=> 3 >> 1, 1 <=> (3 >> 1), (1 <=> 3) >> 1 union select * from v1; + +create or replace view v1 as select 2 <=> '2000-01-01' +INTERVAL 1 DAY, 2 <=> ('2000-01-01' +INTERVAL 1 DAY), (2 <=> '2000-01-01') +INTERVAL 1 DAY; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 <=> '2000-01-01' +INTERVAL 1 DAY, 2 <=> ('2000-01-01' +INTERVAL 1 DAY), (2 <=> '2000-01-01') +INTERVAL 1 DAY union select * from v1; + +create or replace view v1 as select 2 <=> 3 + 3, 2 <=> (3 + 3), (2 <=> 3) + 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 <=> 3 + 3, 2 <=> (3 + 3), (2 <=> 3) + 3 union select * from v1; + +create or replace view v1 as select 2 <=> 3 - 3, 2 <=> (3 - 3), (2 <=> 3) - 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 <=> 3 - 3, 2 <=> (3 - 3), (2 <=> 3) - 3 union select * from v1; + +create or replace view v1 as select 3 <=> 3 * 3, 3 <=> (3 * 3), (3 <=> 3) * 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 3 <=> 3 * 3, 3 <=> (3 * 3), (3 <=> 3) * 3 union select * from v1; + +create or replace view v1 as select 3 <=> 9 / 3, 3 <=> (9 / 3), (3 <=> 9) / 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 3 <=> 9 / 3, 3 <=> (9 / 3), (3 <=> 9) / 3 union select * from v1; + +create or replace view v1 as select 3 <=> 9 DIV 3, 3 <=> (9 DIV 3), (3 <=> 9) DIV 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 3 <=> 9 DIV 3, 3 <=> (9 DIV 3), (3 <=> 9) DIV 3 union select * from v1; + +create or replace view v1 as select 3 <=> 3 MOD 3, 3 <=> (3 MOD 3), (3 <=> 3) MOD 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 3 <=> 3 MOD 3, 3 <=> (3 MOD 3), (3 <=> 3) MOD 3 union select * from v1; + +create or replace view v1 as select 3 <=> 3 % 3, 3 <=> (3 % 3), (3 <=> 3) % 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 3 <=> 3 % 3, 3 <=> (3 % 3), (3 <=> 3) % 3 union select * from v1; + +create or replace view v1 as select 2 <=> 3 ^ 3, 2 <=> (3 ^ 3), (2 <=> 3) ^ 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 <=> 3 ^ 3, 2 <=> (3 ^ 3), (2 <=> 3) ^ 3 union select * from v1; + +create or replace view v1 as select 1 <=> 3 BETWEEN 1 AND 3, 1 <=> (3 BETWEEN 1 AND 3), (1 <=> 3) BETWEEN 1 AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 1 <=> 3 BETWEEN 1 AND 3, 1 <=> (3 BETWEEN 1 AND 3), (1 <=> 3) BETWEEN 1 AND 3 union select * from v1; + +create or replace view v1 as select 4 >= 3 IS FALSE, 4 >= (3 IS FALSE), (4 >= 3) IS FALSE; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 4 >= 3 IS FALSE, 4 >= (3 IS FALSE), (4 >= 3) IS FALSE union select * from v1; + +create or replace view v1 as select charset(2 >= 3 COLLATE latin1_bin), charset(2 >= (3 COLLATE latin1_bin)), charset((2 >= 3) COLLATE latin1_bin); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select charset(2 >= 3 COLLATE latin1_bin), charset(2 >= (3 COLLATE latin1_bin)), charset((2 >= 3) COLLATE latin1_bin) union select * from v1; + +create or replace view v1 as select 2 >= 3 IN (1,1), 2 >= (3 IN (1,1)), (2 >= 3) IN (1,1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 >= 3 IN (1,1), 2 >= (3 IN (1,1)), (2 >= 3) IN (1,1) union select * from v1; + +create or replace view v1 as select 2 >= 3 OR 0, 2 >= (3 OR 0), (2 >= 3) OR 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 >= 3 OR 0, 2 >= (3 OR 0), (2 >= 3) OR 0 union select * from v1; + +create or replace view v1 as select 2 >= 3 || 0, 2 >= (3 || 0), (2 >= 3) || 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 >= 3 || 0, 2 >= (3 || 0), (2 >= 3) || 0 union select * from v1; + +create or replace view v1 as select 2 >= 3 XOR 0, 2 >= (3 XOR 0), (2 >= 3) XOR 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 >= 3 XOR 0, 2 >= (3 XOR 0), (2 >= 3) XOR 0 union select * from v1; + +create or replace view v1 as select 2 >= 3 AND 3, 2 >= (3 AND 3), (2 >= 3) AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 >= 3 AND 3, 2 >= (3 AND 3), (2 >= 3) AND 3 union select * from v1; + +create or replace view v1 as select 2 >= 3 && 3, 2 >= (3 && 3), (2 >= 3) && 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 >= 3 && 3, 2 >= (3 && 3), (2 >= 3) && 3 union select * from v1; + +create or replace view v1 as select 2 >= 3 = 3, 2 >= (3 = 3), (2 >= 3) = 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 >= 3 = 3, 2 >= (3 = 3), (2 >= 3) = 3 union select * from v1; + +create or replace view v1 as select 2 >= 3 <=> 3, 2 >= (3 <=> 3), (2 >= 3) <=> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 >= 3 <=> 3, 2 >= (3 <=> 3), (2 >= 3) <=> 3 union select * from v1; + +create or replace view v1 as select 2 >= 3 >= 3, 2 >= (3 >= 3), (2 >= 3) >= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 >= 3 >= 3, 2 >= (3 >= 3), (2 >= 3) >= 3 union select * from v1; + +create or replace view v1 as select 0 >= 3 <= 3, 0 >= (3 <= 3), (0 >= 3) <= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 0 >= 3 <= 3, 0 >= (3 <= 3), (0 >= 3) <= 3 union select * from v1; + +create or replace view v1 as select 0 >= 2 < 3, 0 >= (2 < 3), (0 >= 2) < 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 0 >= 2 < 3, 0 >= (2 < 3), (0 >= 2) < 3 union select * from v1; + +create or replace view v1 as select 2 >= 3 <> 0, 2 >= (3 <> 0), (2 >= 3) <> 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 >= 3 <> 0, 2 >= (3 <> 0), (2 >= 3) <> 0 union select * from v1; + +create or replace view v1 as select 2 >= 3 > 3, 2 >= (3 > 3), (2 >= 3) > 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 >= 3 > 3, 2 >= (3 > 3), (2 >= 3) > 3 union select * from v1; + +create or replace view v1 as select 2 >= 3 != 0, 2 >= (3 != 0), (2 >= 3) != 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 >= 3 != 0, 2 >= (3 != 0), (2 >= 3) != 0 union select * from v1; + +create or replace view v1 as select 2 >= 3 LIKE 3, 2 >= (3 LIKE 3), (2 >= 3) LIKE 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 >= 3 LIKE 3, 2 >= (3 LIKE 3), (2 >= 3) LIKE 3 union select * from v1; + +create or replace view v1 as select 2 >= 3 REGEXP 3, 2 >= (3 REGEXP 3), (2 >= 3) REGEXP 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 >= 3 REGEXP 3, 2 >= (3 REGEXP 3), (2 >= 3) REGEXP 3 union select * from v1; + +create or replace view v1 as select 2 >= 3 | 3, 2 >= (3 | 3), (2 >= 3) | 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 >= 3 | 3, 2 >= (3 | 3), (2 >= 3) | 3 union select * from v1; + +create or replace view v1 as select 2 >= 3 & 1, 2 >= (3 & 1), (2 >= 3) & 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 >= 3 & 1, 2 >= (3 & 1), (2 >= 3) & 1 union select * from v1; + +create or replace view v1 as select 3 >= 3 << 3, 3 >= (3 << 3), (3 >= 3) << 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 3 >= 3 << 3, 3 >= (3 << 3), (3 >= 3) << 3 union select * from v1; + +create or replace view v1 as select 2 >= 3 >> 3, 2 >= (3 >> 3), (2 >= 3) >> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 >= 3 >> 3, 2 >= (3 >> 3), (2 >= 3) >> 3 union select * from v1; + +create or replace view v1 as select 2 >= '2000-01-01' +INTERVAL 1 DAY, 2 >= ('2000-01-01' +INTERVAL 1 DAY), (2 >= '2000-01-01') +INTERVAL 1 DAY; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 >= '2000-01-01' +INTERVAL 1 DAY, 2 >= ('2000-01-01' +INTERVAL 1 DAY), (2 >= '2000-01-01') +INTERVAL 1 DAY union select * from v1; + +create or replace view v1 as select 2 >= 3 + 3, 2 >= (3 + 3), (2 >= 3) + 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 >= 3 + 3, 2 >= (3 + 3), (2 >= 3) + 3 union select * from v1; + +create or replace view v1 as select 2 >= 3 - 3, 2 >= (3 - 3), (2 >= 3) - 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 >= 3 - 3, 2 >= (3 - 3), (2 >= 3) - 3 union select * from v1; + +create or replace view v1 as select 3 >= 3 * 3, 3 >= (3 * 3), (3 >= 3) * 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 3 >= 3 * 3, 3 >= (3 * 3), (3 >= 3) * 3 union select * from v1; + +create or replace view v1 as select 2 >= 3 / 3, 2 >= (3 / 3), (2 >= 3) / 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 >= 3 / 3, 2 >= (3 / 3), (2 >= 3) / 3 union select * from v1; + +create or replace view v1 as select 2 >= 3 DIV 3, 2 >= (3 DIV 3), (2 >= 3) DIV 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 >= 3 DIV 3, 2 >= (3 DIV 3), (2 >= 3) DIV 3 union select * from v1; + +create or replace view v1 as select 2 >= 3 MOD 3, 2 >= (3 MOD 3), (2 >= 3) MOD 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 >= 3 MOD 3, 2 >= (3 MOD 3), (2 >= 3) MOD 3 union select * from v1; + +create or replace view v1 as select 2 >= 3 % 3, 2 >= (3 % 3), (2 >= 3) % 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 >= 3 % 3, 2 >= (3 % 3), (2 >= 3) % 3 union select * from v1; + +create or replace view v1 as select 2 >= 3 ^ 3, 2 >= (3 ^ 3), (2 >= 3) ^ 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 >= 3 ^ 3, 2 >= (3 ^ 3), (2 >= 3) ^ 3 union select * from v1; + +create or replace view v1 as select 2 >= 3 BETWEEN 1 AND 3, 2 >= (3 BETWEEN 1 AND 3), (2 >= 3) BETWEEN 1 AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 >= 3 BETWEEN 1 AND 3, 2 >= (3 BETWEEN 1 AND 3), (2 >= 3) BETWEEN 1 AND 3 union select * from v1; + +create or replace view v1 as select 2 <= 1 IS FALSE, 2 <= (1 IS FALSE), (2 <= 1) IS FALSE; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 <= 1 IS FALSE, 2 <= (1 IS FALSE), (2 <= 1) IS FALSE union select * from v1; + +create or replace view v1 as select charset(2 <= 3 COLLATE latin1_bin), charset(2 <= (3 COLLATE latin1_bin)), charset((2 <= 3) COLLATE latin1_bin); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select charset(2 <= 3 COLLATE latin1_bin), charset(2 <= (3 COLLATE latin1_bin)), charset((2 <= 3) COLLATE latin1_bin) union select * from v1; + +create or replace view v1 as select 2 <= 3 IN (0,1), 2 <= (3 IN (0,1)), (2 <= 3) IN (0,1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 <= 3 IN (0,1), 2 <= (3 IN (0,1)), (2 <= 3) IN (0,1) union select * from v1; + +create or replace view v1 as select 2 <= 3 OR 3, 2 <= (3 OR 3), (2 <= 3) OR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 <= 3 OR 3, 2 <= (3 OR 3), (2 <= 3) OR 3 union select * from v1; + +create or replace view v1 as select 2 <= 3 || 3, 2 <= (3 || 3), (2 <= 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 <= 3 || 3, 2 <= (3 || 3), (2 <= 3) || 3 union select * from v1; + +create or replace view v1 as select 2 <= 1 XOR 1, 2 <= (1 XOR 1), (2 <= 1) XOR 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 <= 1 XOR 1, 2 <= (1 XOR 1), (2 <= 1) XOR 1 union select * from v1; + +create or replace view v1 as select 2 <= 3 AND 3, 2 <= (3 AND 3), (2 <= 3) AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 <= 3 AND 3, 2 <= (3 AND 3), (2 <= 3) AND 3 union select * from v1; + +create or replace view v1 as select 2 <= 3 && 3, 2 <= (3 && 3), (2 <= 3) && 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 <= 3 && 3, 2 <= (3 && 3), (2 <= 3) && 3 union select * from v1; + +create or replace view v1 as select 2 <= 0 = 0, 2 <= (0 = 0), (2 <= 0) = 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 <= 0 = 0, 2 <= (0 = 0), (2 <= 0) = 0 union select * from v1; + +create or replace view v1 as select 2 <= 0 <=> 0, 2 <= (0 <=> 0), (2 <= 0) <=> 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 <= 0 <=> 0, 2 <= (0 <=> 0), (2 <= 0) <=> 0 union select * from v1; + +create or replace view v1 as select 2 <= 0 >= 0, 2 <= (0 >= 0), (2 <= 0) >= 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 <= 0 >= 0, 2 <= (0 >= 0), (2 <= 0) >= 0 union select * from v1; + +create or replace view v1 as select 2 <= 3 <= 3, 2 <= (3 <= 3), (2 <= 3) <= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 <= 3 <= 3, 2 <= (3 <= 3), (2 <= 3) <= 3 union select * from v1; + +create or replace view v1 as select 2 <= 3 < 3, 2 <= (3 < 3), (2 <= 3) < 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 <= 3 < 3, 2 <= (3 < 3), (2 <= 3) < 3 union select * from v1; + +create or replace view v1 as select 2 <= 3 <> 3, 2 <= (3 <> 3), (2 <= 3) <> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 <= 3 <> 3, 2 <= (3 <> 3), (2 <= 3) <> 3 union select * from v1; + +create or replace view v1 as select 2 <= 3 > 0, 2 <= (3 > 0), (2 <= 3) > 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 <= 3 > 0, 2 <= (3 > 0), (2 <= 3) > 0 union select * from v1; + +create or replace view v1 as select 2 <= 3 != 3, 2 <= (3 != 3), (2 <= 3) != 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 <= 3 != 3, 2 <= (3 != 3), (2 <= 3) != 3 union select * from v1; + +create or replace view v1 as select 2 <= 0 LIKE 0, 2 <= (0 LIKE 0), (2 <= 0) LIKE 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 <= 0 LIKE 0, 2 <= (0 LIKE 0), (2 <= 0) LIKE 0 union select * from v1; + +create or replace view v1 as select 2 <= 0 REGEXP 0, 2 <= (0 REGEXP 0), (2 <= 0) REGEXP 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 <= 0 REGEXP 0, 2 <= (0 REGEXP 0), (2 <= 0) REGEXP 0 union select * from v1; + +create or replace view v1 as select 2 <= 3 | 3, 2 <= (3 | 3), (2 <= 3) | 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 <= 3 | 3, 2 <= (3 | 3), (2 <= 3) | 3 union select * from v1; + +create or replace view v1 as select 2 <= 3 & 2, 2 <= (3 & 2), (2 <= 3) & 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 <= 3 & 2, 2 <= (3 & 2), (2 <= 3) & 2 union select * from v1; + +create or replace view v1 as select 2 <= 3 << 3, 2 <= (3 << 3), (2 <= 3) << 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 <= 3 << 3, 2 <= (3 << 3), (2 <= 3) << 3 union select * from v1; + +create or replace view v1 as select 0 <= 3 >> 1, 0 <= (3 >> 1), (0 <= 3) >> 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 0 <= 3 >> 1, 0 <= (3 >> 1), (0 <= 3) >> 1 union select * from v1; + +create or replace view v1 as select 2 <= '2000-01-01' +INTERVAL 1 DAY, 2 <= ('2000-01-01' +INTERVAL 1 DAY), (2 <= '2000-01-01') +INTERVAL 1 DAY; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 <= '2000-01-01' +INTERVAL 1 DAY, 2 <= ('2000-01-01' +INTERVAL 1 DAY), (2 <= '2000-01-01') +INTERVAL 1 DAY union select * from v1; + +create or replace view v1 as select 2 <= 3 + 3, 2 <= (3 + 3), (2 <= 3) + 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 <= 3 + 3, 2 <= (3 + 3), (2 <= 3) + 3 union select * from v1; + +create or replace view v1 as select 2 <= 3 - 3, 2 <= (3 - 3), (2 <= 3) - 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 <= 3 - 3, 2 <= (3 - 3), (2 <= 3) - 3 union select * from v1; + +create or replace view v1 as select 2 <= 3 * 3, 2 <= (3 * 3), (2 <= 3) * 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 <= 3 * 3, 2 <= (3 * 3), (2 <= 3) * 3 union select * from v1; + +create or replace view v1 as select 2 <= 3 / 3, 2 <= (3 / 3), (2 <= 3) / 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 <= 3 / 3, 2 <= (3 / 3), (2 <= 3) / 3 union select * from v1; + +create or replace view v1 as select 2 <= 9 DIV 3, 2 <= (9 DIV 3), (2 <= 9) DIV 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 <= 9 DIV 3, 2 <= (9 DIV 3), (2 <= 9) DIV 3 union select * from v1; + +create or replace view v1 as select 2 <= 3 MOD 3, 2 <= (3 MOD 3), (2 <= 3) MOD 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 <= 3 MOD 3, 2 <= (3 MOD 3), (2 <= 3) MOD 3 union select * from v1; + +create or replace view v1 as select 2 <= 3 % 3, 2 <= (3 % 3), (2 <= 3) % 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 <= 3 % 3, 2 <= (3 % 3), (2 <= 3) % 3 union select * from v1; + +create or replace view v1 as select 2 <= 3 ^ 3, 2 <= (3 ^ 3), (2 <= 3) ^ 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 <= 3 ^ 3, 2 <= (3 ^ 3), (2 <= 3) ^ 3 union select * from v1; + +create or replace view v1 as select 2 <= 3 BETWEEN 1 AND 3, 2 <= (3 BETWEEN 1 AND 3), (2 <= 3) BETWEEN 1 AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 <= 3 BETWEEN 1 AND 3, 2 <= (3 BETWEEN 1 AND 3), (2 <= 3) BETWEEN 1 AND 3 union select * from v1; + +create or replace view v1 as select 2 < 1 IS FALSE, 2 < (1 IS FALSE), (2 < 1) IS FALSE; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 < 1 IS FALSE, 2 < (1 IS FALSE), (2 < 1) IS FALSE union select * from v1; + +create or replace view v1 as select charset(2 < 3 COLLATE latin1_bin), charset(2 < (3 COLLATE latin1_bin)), charset((2 < 3) COLLATE latin1_bin); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select charset(2 < 3 COLLATE latin1_bin), charset(2 < (3 COLLATE latin1_bin)), charset((2 < 3) COLLATE latin1_bin) union select * from v1; + +create or replace view v1 as select 2 < 3 IN (0,1), 2 < (3 IN (0,1)), (2 < 3) IN (0,1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 < 3 IN (0,1), 2 < (3 IN (0,1)), (2 < 3) IN (0,1) union select * from v1; + +create or replace view v1 as select 2 < 3 OR 3, 2 < (3 OR 3), (2 < 3) OR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 < 3 OR 3, 2 < (3 OR 3), (2 < 3) OR 3 union select * from v1; + +create or replace view v1 as select 2 < 3 || 3, 2 < (3 || 3), (2 < 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 < 3 || 3, 2 < (3 || 3), (2 < 3) || 3 union select * from v1; + +create or replace view v1 as select 2 < 3 XOR 0, 2 < (3 XOR 0), (2 < 3) XOR 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 < 3 XOR 0, 2 < (3 XOR 0), (2 < 3) XOR 0 union select * from v1; + +create or replace view v1 as select 2 < 3 AND 3, 2 < (3 AND 3), (2 < 3) AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 < 3 AND 3, 2 < (3 AND 3), (2 < 3) AND 3 union select * from v1; + +create or replace view v1 as select 2 < 3 && 3, 2 < (3 && 3), (2 < 3) && 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 < 3 && 3, 2 < (3 && 3), (2 < 3) && 3 union select * from v1; + +create or replace view v1 as select 2 < 3 = 1, 2 < (3 = 1), (2 < 3) = 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 < 3 = 1, 2 < (3 = 1), (2 < 3) = 1 union select * from v1; + +create or replace view v1 as select 2 < 3 <=> 1, 2 < (3 <=> 1), (2 < 3) <=> 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 < 3 <=> 1, 2 < (3 <=> 1), (2 < 3) <=> 1 union select * from v1; + +create or replace view v1 as select 2 < 3 >= 1, 2 < (3 >= 1), (2 < 3) >= 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 < 3 >= 1, 2 < (3 >= 1), (2 < 3) >= 1 union select * from v1; + +create or replace view v1 as select 2 < 3 <= 3, 2 < (3 <= 3), (2 < 3) <= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 < 3 <= 3, 2 < (3 <= 3), (2 < 3) <= 3 union select * from v1; + +create or replace view v1 as select 2 < 3 < 3, 2 < (3 < 3), (2 < 3) < 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 < 3 < 3, 2 < (3 < 3), (2 < 3) < 3 union select * from v1; + +create or replace view v1 as select 2 < 3 <> 3, 2 < (3 <> 3), (2 < 3) <> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 < 3 <> 3, 2 < (3 <> 3), (2 < 3) <> 3 union select * from v1; + +create or replace view v1 as select 2 < 3 > 0, 2 < (3 > 0), (2 < 3) > 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 < 3 > 0, 2 < (3 > 0), (2 < 3) > 0 union select * from v1; + +create or replace view v1 as select 2 < 3 != 3, 2 < (3 != 3), (2 < 3) != 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 < 3 != 3, 2 < (3 != 3), (2 < 3) != 3 union select * from v1; + +create or replace view v1 as select 2 < 3 LIKE 1, 2 < (3 LIKE 1), (2 < 3) LIKE 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 < 3 LIKE 1, 2 < (3 LIKE 1), (2 < 3) LIKE 1 union select * from v1; + +create or replace view v1 as select 2 < 3 REGEXP 1, 2 < (3 REGEXP 1), (2 < 3) REGEXP 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 < 3 REGEXP 1, 2 < (3 REGEXP 1), (2 < 3) REGEXP 1 union select * from v1; + +create or replace view v1 as select 2 < 3 | 3, 2 < (3 | 3), (2 < 3) | 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 < 3 | 3, 2 < (3 | 3), (2 < 3) | 3 union select * from v1; + +create or replace view v1 as select 2 < 4 & 4, 2 < (4 & 4), (2 < 4) & 4; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 < 4 & 4, 2 < (4 & 4), (2 < 4) & 4 union select * from v1; + +create or replace view v1 as select 2 < 3 << 3, 2 < (3 << 3), (2 < 3) << 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 < 3 << 3, 2 < (3 << 3), (2 < 3) << 3 union select * from v1; + +create or replace view v1 as select 0 < 3 >> 1, 0 < (3 >> 1), (0 < 3) >> 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 0 < 3 >> 1, 0 < (3 >> 1), (0 < 3) >> 1 union select * from v1; + +create or replace view v1 as select 2 < '2000-01-01' +INTERVAL 1 DAY, 2 < ('2000-01-01' +INTERVAL 1 DAY), (2 < '2000-01-01') +INTERVAL 1 DAY; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 < '2000-01-01' +INTERVAL 1 DAY, 2 < ('2000-01-01' +INTERVAL 1 DAY), (2 < '2000-01-01') +INTERVAL 1 DAY union select * from v1; + +create or replace view v1 as select 2 < 3 + 3, 2 < (3 + 3), (2 < 3) + 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 < 3 + 3, 2 < (3 + 3), (2 < 3) + 3 union select * from v1; + +create or replace view v1 as select 2 < 3 - 3, 2 < (3 - 3), (2 < 3) - 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 < 3 - 3, 2 < (3 - 3), (2 < 3) - 3 union select * from v1; + +create or replace view v1 as select 2 < 3 * 3, 2 < (3 * 3), (2 < 3) * 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 < 3 * 3, 2 < (3 * 3), (2 < 3) * 3 union select * from v1; + +create or replace view v1 as select 2 < 3 / 3, 2 < (3 / 3), (2 < 3) / 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 < 3 / 3, 2 < (3 / 3), (2 < 3) / 3 union select * from v1; + +create or replace view v1 as select 2 < 9 DIV 3, 2 < (9 DIV 3), (2 < 9) DIV 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 < 9 DIV 3, 2 < (9 DIV 3), (2 < 9) DIV 3 union select * from v1; + +create or replace view v1 as select 2 < 3 MOD 3, 2 < (3 MOD 3), (2 < 3) MOD 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 < 3 MOD 3, 2 < (3 MOD 3), (2 < 3) MOD 3 union select * from v1; + +create or replace view v1 as select 2 < 3 % 3, 2 < (3 % 3), (2 < 3) % 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 < 3 % 3, 2 < (3 % 3), (2 < 3) % 3 union select * from v1; + +create or replace view v1 as select 2 < 3 ^ 3, 2 < (3 ^ 3), (2 < 3) ^ 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 < 3 ^ 3, 2 < (3 ^ 3), (2 < 3) ^ 3 union select * from v1; + +create or replace view v1 as select 2 < 3 BETWEEN 1 AND 3, 2 < (3 BETWEEN 1 AND 3), (2 < 3) BETWEEN 1 AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 < 3 BETWEEN 1 AND 3, 2 < (3 BETWEEN 1 AND 3), (2 < 3) BETWEEN 1 AND 3 union select * from v1; + +create or replace view v1 as select 2 <> 3 IS FALSE, 2 <> (3 IS FALSE), (2 <> 3) IS FALSE; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 <> 3 IS FALSE, 2 <> (3 IS FALSE), (2 <> 3) IS FALSE union select * from v1; + +create or replace view v1 as select charset(2 <> 3 COLLATE latin1_bin), charset(2 <> (3 COLLATE latin1_bin)), charset((2 <> 3) COLLATE latin1_bin); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select charset(2 <> 3 COLLATE latin1_bin), charset(2 <> (3 COLLATE latin1_bin)), charset((2 <> 3) COLLATE latin1_bin) union select * from v1; + +create or replace view v1 as select 2 <> 3 IN (0,0), 2 <> (3 IN (0,0)), (2 <> 3) IN (0,0); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 <> 3 IN (0,0), 2 <> (3 IN (0,0)), (2 <> 3) IN (0,0) union select * from v1; + +create or replace view v1 as select 1 <> 3 OR 3, 1 <> (3 OR 3), (1 <> 3) OR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 1 <> 3 OR 3, 1 <> (3 OR 3), (1 <> 3) OR 3 union select * from v1; + +create or replace view v1 as select 1 <> 3 || 3, 1 <> (3 || 3), (1 <> 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 1 <> 3 || 3, 1 <> (3 || 3), (1 <> 3) || 3 union select * from v1; + +create or replace view v1 as select 2 <> 3 XOR 3, 2 <> (3 XOR 3), (2 <> 3) XOR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 <> 3 XOR 3, 2 <> (3 XOR 3), (2 <> 3) XOR 3 union select * from v1; + +create or replace view v1 as select 3 <> 3 AND 3, 3 <> (3 AND 3), (3 <> 3) AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 3 <> 3 AND 3, 3 <> (3 AND 3), (3 <> 3) AND 3 union select * from v1; + +create or replace view v1 as select 3 <> 3 && 3, 3 <> (3 && 3), (3 <> 3) && 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 3 <> 3 && 3, 3 <> (3 && 3), (3 <> 3) && 3 union select * from v1; + +create or replace view v1 as select 2 <> 3 = 3, 2 <> (3 = 3), (2 <> 3) = 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 <> 3 = 3, 2 <> (3 = 3), (2 <> 3) = 3 union select * from v1; + +create or replace view v1 as select 2 <> 3 <=> 3, 2 <> (3 <=> 3), (2 <> 3) <=> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 <> 3 <=> 3, 2 <> (3 <=> 3), (2 <> 3) <=> 3 union select * from v1; + +create or replace view v1 as select 2 <> 3 >= 3, 2 <> (3 >= 3), (2 <> 3) >= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 <> 3 >= 3, 2 <> (3 >= 3), (2 <> 3) >= 3 union select * from v1; + +create or replace view v1 as select 1 <> 3 <= 3, 1 <> (3 <= 3), (1 <> 3) <= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 1 <> 3 <= 3, 1 <> (3 <= 3), (1 <> 3) <= 3 union select * from v1; + +create or replace view v1 as select 0 <> 3 < 3, 0 <> (3 < 3), (0 <> 3) < 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 0 <> 3 < 3, 0 <> (3 < 3), (0 <> 3) < 3 union select * from v1; + +create or replace view v1 as select 0 <> 3 <> 3, 0 <> (3 <> 3), (0 <> 3) <> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 0 <> 3 <> 3, 0 <> (3 <> 3), (0 <> 3) <> 3 union select * from v1; + +create or replace view v1 as select 2 <> 3 > 3, 2 <> (3 > 3), (2 <> 3) > 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 <> 3 > 3, 2 <> (3 > 3), (2 <> 3) > 3 union select * from v1; + +create or replace view v1 as select 0 <> 3 != 3, 0 <> (3 != 3), (0 <> 3) != 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 0 <> 3 != 3, 0 <> (3 != 3), (0 <> 3) != 3 union select * from v1; + +create or replace view v1 as select 2 <> 3 LIKE 3, 2 <> (3 LIKE 3), (2 <> 3) LIKE 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 <> 3 LIKE 3, 2 <> (3 LIKE 3), (2 <> 3) LIKE 3 union select * from v1; + +create or replace view v1 as select 2 <> 3 REGEXP 3, 2 <> (3 REGEXP 3), (2 <> 3) REGEXP 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 <> 3 REGEXP 3, 2 <> (3 REGEXP 3), (2 <> 3) REGEXP 3 union select * from v1; + +create or replace view v1 as select 2 <> 3 | 3, 2 <> (3 | 3), (2 <> 3) | 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 <> 3 | 3, 2 <> (3 | 3), (2 <> 3) | 3 union select * from v1; + +create or replace view v1 as select 2 <> 4 & 4, 2 <> (4 & 4), (2 <> 4) & 4; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 <> 4 & 4, 2 <> (4 & 4), (2 <> 4) & 4 union select * from v1; + +create or replace view v1 as select 2 <> 3 << 3, 2 <> (3 << 3), (2 <> 3) << 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 <> 3 << 3, 2 <> (3 << 3), (2 <> 3) << 3 union select * from v1; + +create or replace view v1 as select 2 <> 3 >> 3, 2 <> (3 >> 3), (2 <> 3) >> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 <> 3 >> 3, 2 <> (3 >> 3), (2 <> 3) >> 3 union select * from v1; + +create or replace view v1 as select 2 <> '2000-01-01' +INTERVAL 1 DAY, 2 <> ('2000-01-01' +INTERVAL 1 DAY), (2 <> '2000-01-01') +INTERVAL 1 DAY; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 <> '2000-01-01' +INTERVAL 1 DAY, 2 <> ('2000-01-01' +INTERVAL 1 DAY), (2 <> '2000-01-01') +INTERVAL 1 DAY union select * from v1; + +create or replace view v1 as select 2 <> 3 + 3, 2 <> (3 + 3), (2 <> 3) + 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 <> 3 + 3, 2 <> (3 + 3), (2 <> 3) + 3 union select * from v1; + +create or replace view v1 as select 2 <> 3 - 3, 2 <> (3 - 3), (2 <> 3) - 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 <> 3 - 3, 2 <> (3 - 3), (2 <> 3) - 3 union select * from v1; + +create or replace view v1 as select 2 <> 3 * 3, 2 <> (3 * 3), (2 <> 3) * 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 <> 3 * 3, 2 <> (3 * 3), (2 <> 3) * 3 union select * from v1; + +create or replace view v1 as select 2 <> 3 / 3, 2 <> (3 / 3), (2 <> 3) / 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 <> 3 / 3, 2 <> (3 / 3), (2 <> 3) / 3 union select * from v1; + +create or replace view v1 as select 2 <> 3 DIV 3, 2 <> (3 DIV 3), (2 <> 3) DIV 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 <> 3 DIV 3, 2 <> (3 DIV 3), (2 <> 3) DIV 3 union select * from v1; + +create or replace view v1 as select 3 <> 3 MOD 3, 3 <> (3 MOD 3), (3 <> 3) MOD 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 3 <> 3 MOD 3, 3 <> (3 MOD 3), (3 <> 3) MOD 3 union select * from v1; + +create or replace view v1 as select 3 <> 3 % 3, 3 <> (3 % 3), (3 <> 3) % 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 3 <> 3 % 3, 3 <> (3 % 3), (3 <> 3) % 3 union select * from v1; + +create or replace view v1 as select 2 <> 3 ^ 3, 2 <> (3 ^ 3), (2 <> 3) ^ 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 <> 3 ^ 3, 2 <> (3 ^ 3), (2 <> 3) ^ 3 union select * from v1; + +create or replace view v1 as select 2 <> 3 BETWEEN 2 AND 3, 2 <> (3 BETWEEN 2 AND 3), (2 <> 3) BETWEEN 2 AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 <> 3 BETWEEN 2 AND 3, 2 <> (3 BETWEEN 2 AND 3), (2 <> 3) BETWEEN 2 AND 3 union select * from v1; + +create or replace view v1 as select 2 > 0 IS FALSE, 2 > (0 IS FALSE), (2 > 0) IS FALSE; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 > 0 IS FALSE, 2 > (0 IS FALSE), (2 > 0) IS FALSE union select * from v1; + +create or replace view v1 as select charset(2 > 3 COLLATE latin1_bin), charset(2 > (3 COLLATE latin1_bin)), charset((2 > 3) COLLATE latin1_bin); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select charset(2 > 3 COLLATE latin1_bin), charset(2 > (3 COLLATE latin1_bin)), charset((2 > 3) COLLATE latin1_bin) union select * from v1; + +create or replace view v1 as select 2 > 3 IN (1,1), 2 > (3 IN (1,1)), (2 > 3) IN (1,1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 > 3 IN (1,1), 2 > (3 IN (1,1)), (2 > 3) IN (1,1) union select * from v1; + +create or replace view v1 as select 0 > 3 OR 3, 0 > (3 OR 3), (0 > 3) OR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 0 > 3 OR 3, 0 > (3 OR 3), (0 > 3) OR 3 union select * from v1; + +create or replace view v1 as select 0 > 3 || 3, 0 > (3 || 3), (0 > 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 0 > 3 || 3, 0 > (3 || 3), (0 > 3) || 3 union select * from v1; + +create or replace view v1 as select 4 > 3 XOR 3, 4 > (3 XOR 3), (4 > 3) XOR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 4 > 3 XOR 3, 4 > (3 XOR 3), (4 > 3) XOR 3 union select * from v1; + +create or replace view v1 as select 2 > 3 AND 3, 2 > (3 AND 3), (2 > 3) AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 > 3 AND 3, 2 > (3 AND 3), (2 > 3) AND 3 union select * from v1; + +create or replace view v1 as select 2 > 3 && 3, 2 > (3 && 3), (2 > 3) && 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 > 3 && 3, 2 > (3 && 3), (2 > 3) && 3 union select * from v1; + +create or replace view v1 as select 2 > 3 = 3, 2 > (3 = 3), (2 > 3) = 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 > 3 = 3, 2 > (3 = 3), (2 > 3) = 3 union select * from v1; + +create or replace view v1 as select 2 > 3 <=> 3, 2 > (3 <=> 3), (2 > 3) <=> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 > 3 <=> 3, 2 > (3 <=> 3), (2 > 3) <=> 3 union select * from v1; + +create or replace view v1 as select 2 > 3 >= 3, 2 > (3 >= 3), (2 > 3) >= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 > 3 >= 3, 2 > (3 >= 3), (2 > 3) >= 3 union select * from v1; + +create or replace view v1 as select 2 > 0 <= 0, 2 > (0 <= 0), (2 > 0) <= 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 > 0 <= 0, 2 > (0 <= 0), (2 > 0) <= 0 union select * from v1; + +create or replace view v1 as select 2 > 0 < 0, 2 > (0 < 0), (2 > 0) < 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 > 0 < 0, 2 > (0 < 0), (2 > 0) < 0 union select * from v1; + +create or replace view v1 as select 2 > 1 <> 1, 2 > (1 <> 1), (2 > 1) <> 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 > 1 <> 1, 2 > (1 <> 1), (2 > 1) <> 1 union select * from v1; + +create or replace view v1 as select 2 > 3 > 3, 2 > (3 > 3), (2 > 3) > 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 > 3 > 3, 2 > (3 > 3), (2 > 3) > 3 union select * from v1; + +create or replace view v1 as select 2 > 1 != 1, 2 > (1 != 1), (2 > 1) != 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 > 1 != 1, 2 > (1 != 1), (2 > 1) != 1 union select * from v1; + +create or replace view v1 as select 2 > 3 LIKE 3, 2 > (3 LIKE 3), (2 > 3) LIKE 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 > 3 LIKE 3, 2 > (3 LIKE 3), (2 > 3) LIKE 3 union select * from v1; + +create or replace view v1 as select 2 > 3 REGEXP 3, 2 > (3 REGEXP 3), (2 > 3) REGEXP 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 > 3 REGEXP 3, 2 > (3 REGEXP 3), (2 > 3) REGEXP 3 union select * from v1; + +create or replace view v1 as select 2 > 3 | 3, 2 > (3 | 3), (2 > 3) | 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 > 3 | 3, 2 > (3 | 3), (2 > 3) | 3 union select * from v1; + +create or replace view v1 as select 4 > 2 & 2, 4 > (2 & 2), (4 > 2) & 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 4 > 2 & 2, 4 > (2 & 2), (4 > 2) & 2 union select * from v1; + +create or replace view v1 as select 4 > 3 << 3, 4 > (3 << 3), (4 > 3) << 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 4 > 3 << 3, 4 > (3 << 3), (4 > 3) << 3 union select * from v1; + +create or replace view v1 as select 2 > 3 >> 3, 2 > (3 >> 3), (2 > 3) >> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 > 3 >> 3, 2 > (3 >> 3), (2 > 3) >> 3 union select * from v1; + +create or replace view v1 as select 2 > '2000-01-01' +INTERVAL 1 DAY, 2 > ('2000-01-01' +INTERVAL 1 DAY), (2 > '2000-01-01') +INTERVAL 1 DAY; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 > '2000-01-01' +INTERVAL 1 DAY, 2 > ('2000-01-01' +INTERVAL 1 DAY), (2 > '2000-01-01') +INTERVAL 1 DAY union select * from v1; + +create or replace view v1 as select 2 > 3 + 3, 2 > (3 + 3), (2 > 3) + 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 > 3 + 3, 2 > (3 + 3), (2 > 3) + 3 union select * from v1; + +create or replace view v1 as select 2 > 3 - 3, 2 > (3 - 3), (2 > 3) - 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 > 3 - 3, 2 > (3 - 3), (2 > 3) - 3 union select * from v1; + +create or replace view v1 as select 4 > 3 * 3, 4 > (3 * 3), (4 > 3) * 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 4 > 3 * 3, 4 > (3 * 3), (4 > 3) * 3 union select * from v1; + +create or replace view v1 as select 2 > 3 / 3, 2 > (3 / 3), (2 > 3) / 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 > 3 / 3, 2 > (3 / 3), (2 > 3) / 3 union select * from v1; + +create or replace view v1 as select 2 > 3 DIV 3, 2 > (3 DIV 3), (2 > 3) DIV 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 > 3 DIV 3, 2 > (3 DIV 3), (2 > 3) DIV 3 union select * from v1; + +create or replace view v1 as select 2 > 3 MOD 3, 2 > (3 MOD 3), (2 > 3) MOD 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 > 3 MOD 3, 2 > (3 MOD 3), (2 > 3) MOD 3 union select * from v1; + +create or replace view v1 as select 2 > 3 % 3, 2 > (3 % 3), (2 > 3) % 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 > 3 % 3, 2 > (3 % 3), (2 > 3) % 3 union select * from v1; + +create or replace view v1 as select 2 > 3 ^ 3, 2 > (3 ^ 3), (2 > 3) ^ 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 > 3 ^ 3, 2 > (3 ^ 3), (2 > 3) ^ 3 union select * from v1; + +create or replace view v1 as select 2 > 3 BETWEEN 1 AND 3, 2 > (3 BETWEEN 1 AND 3), (2 > 3) BETWEEN 1 AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 > 3 BETWEEN 1 AND 3, 2 > (3 BETWEEN 1 AND 3), (2 > 3) BETWEEN 1 AND 3 union select * from v1; + +create or replace view v1 as select 2 != 3 IS FALSE, 2 != (3 IS FALSE), (2 != 3) IS FALSE; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 != 3 IS FALSE, 2 != (3 IS FALSE), (2 != 3) IS FALSE union select * from v1; + +create or replace view v1 as select charset(2 != 3 COLLATE latin1_bin), charset(2 != (3 COLLATE latin1_bin)), charset((2 != 3) COLLATE latin1_bin); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select charset(2 != 3 COLLATE latin1_bin), charset(2 != (3 COLLATE latin1_bin)), charset((2 != 3) COLLATE latin1_bin) union select * from v1; + +create or replace view v1 as select 2 != 3 IN (0,0), 2 != (3 IN (0,0)), (2 != 3) IN (0,0); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 != 3 IN (0,0), 2 != (3 IN (0,0)), (2 != 3) IN (0,0) union select * from v1; + +create or replace view v1 as select 1 != 3 OR 3, 1 != (3 OR 3), (1 != 3) OR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 1 != 3 OR 3, 1 != (3 OR 3), (1 != 3) OR 3 union select * from v1; + +create or replace view v1 as select 1 != 3 || 3, 1 != (3 || 3), (1 != 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 1 != 3 || 3, 1 != (3 || 3), (1 != 3) || 3 union select * from v1; + +create or replace view v1 as select 2 != 3 XOR 3, 2 != (3 XOR 3), (2 != 3) XOR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 != 3 XOR 3, 2 != (3 XOR 3), (2 != 3) XOR 3 union select * from v1; + +create or replace view v1 as select 3 != 3 AND 3, 3 != (3 AND 3), (3 != 3) AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 3 != 3 AND 3, 3 != (3 AND 3), (3 != 3) AND 3 union select * from v1; + +create or replace view v1 as select 3 != 3 && 3, 3 != (3 && 3), (3 != 3) && 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 3 != 3 && 3, 3 != (3 && 3), (3 != 3) && 3 union select * from v1; + +create or replace view v1 as select 2 != 3 = 3, 2 != (3 = 3), (2 != 3) = 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 != 3 = 3, 2 != (3 = 3), (2 != 3) = 3 union select * from v1; + +create or replace view v1 as select 2 != 3 <=> 3, 2 != (3 <=> 3), (2 != 3) <=> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 != 3 <=> 3, 2 != (3 <=> 3), (2 != 3) <=> 3 union select * from v1; + +create or replace view v1 as select 2 != 3 >= 3, 2 != (3 >= 3), (2 != 3) >= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 != 3 >= 3, 2 != (3 >= 3), (2 != 3) >= 3 union select * from v1; + +create or replace view v1 as select 1 != 3 <= 3, 1 != (3 <= 3), (1 != 3) <= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 1 != 3 <= 3, 1 != (3 <= 3), (1 != 3) <= 3 union select * from v1; + +create or replace view v1 as select 0 != 3 < 3, 0 != (3 < 3), (0 != 3) < 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 0 != 3 < 3, 0 != (3 < 3), (0 != 3) < 3 union select * from v1; + +create or replace view v1 as select 0 != 3 <> 3, 0 != (3 <> 3), (0 != 3) <> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 0 != 3 <> 3, 0 != (3 <> 3), (0 != 3) <> 3 union select * from v1; + +create or replace view v1 as select 2 != 3 > 3, 2 != (3 > 3), (2 != 3) > 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 != 3 > 3, 2 != (3 > 3), (2 != 3) > 3 union select * from v1; + +create or replace view v1 as select 0 != 3 != 3, 0 != (3 != 3), (0 != 3) != 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 0 != 3 != 3, 0 != (3 != 3), (0 != 3) != 3 union select * from v1; + +create or replace view v1 as select 2 != 3 LIKE 3, 2 != (3 LIKE 3), (2 != 3) LIKE 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 != 3 LIKE 3, 2 != (3 LIKE 3), (2 != 3) LIKE 3 union select * from v1; + +create or replace view v1 as select 2 != 3 REGEXP 3, 2 != (3 REGEXP 3), (2 != 3) REGEXP 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 != 3 REGEXP 3, 2 != (3 REGEXP 3), (2 != 3) REGEXP 3 union select * from v1; + +create or replace view v1 as select 2 != 3 | 3, 2 != (3 | 3), (2 != 3) | 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 != 3 | 3, 2 != (3 | 3), (2 != 3) | 3 union select * from v1; + +create or replace view v1 as select 2 != 4 & 4, 2 != (4 & 4), (2 != 4) & 4; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 != 4 & 4, 2 != (4 & 4), (2 != 4) & 4 union select * from v1; + +create or replace view v1 as select 2 != 3 << 3, 2 != (3 << 3), (2 != 3) << 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 != 3 << 3, 2 != (3 << 3), (2 != 3) << 3 union select * from v1; + +create or replace view v1 as select 2 != 3 >> 3, 2 != (3 >> 3), (2 != 3) >> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 != 3 >> 3, 2 != (3 >> 3), (2 != 3) >> 3 union select * from v1; + +create or replace view v1 as select 2 != '2000-01-01' +INTERVAL 1 DAY, 2 != ('2000-01-01' +INTERVAL 1 DAY), (2 != '2000-01-01') +INTERVAL 1 DAY; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 != '2000-01-01' +INTERVAL 1 DAY, 2 != ('2000-01-01' +INTERVAL 1 DAY), (2 != '2000-01-01') +INTERVAL 1 DAY union select * from v1; + +create or replace view v1 as select 2 != 3 + 3, 2 != (3 + 3), (2 != 3) + 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 != 3 + 3, 2 != (3 + 3), (2 != 3) + 3 union select * from v1; + +create or replace view v1 as select 2 != 3 - 3, 2 != (3 - 3), (2 != 3) - 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 != 3 - 3, 2 != (3 - 3), (2 != 3) - 3 union select * from v1; + +create or replace view v1 as select 2 != 3 * 3, 2 != (3 * 3), (2 != 3) * 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 != 3 * 3, 2 != (3 * 3), (2 != 3) * 3 union select * from v1; + +create or replace view v1 as select 2 != 3 / 3, 2 != (3 / 3), (2 != 3) / 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 != 3 / 3, 2 != (3 / 3), (2 != 3) / 3 union select * from v1; + +create or replace view v1 as select 2 != 3 DIV 3, 2 != (3 DIV 3), (2 != 3) DIV 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 != 3 DIV 3, 2 != (3 DIV 3), (2 != 3) DIV 3 union select * from v1; + +create or replace view v1 as select 3 != 3 MOD 3, 3 != (3 MOD 3), (3 != 3) MOD 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 3 != 3 MOD 3, 3 != (3 MOD 3), (3 != 3) MOD 3 union select * from v1; + +create or replace view v1 as select 3 != 3 % 3, 3 != (3 % 3), (3 != 3) % 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 3 != 3 % 3, 3 != (3 % 3), (3 != 3) % 3 union select * from v1; + +create or replace view v1 as select 2 != 3 ^ 3, 2 != (3 ^ 3), (2 != 3) ^ 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 != 3 ^ 3, 2 != (3 ^ 3), (2 != 3) ^ 3 union select * from v1; + +create or replace view v1 as select 2 != 3 BETWEEN 2 AND 3, 2 != (3 BETWEEN 2 AND 3), (2 != 3) BETWEEN 2 AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 != 3 BETWEEN 2 AND 3, 2 != (3 BETWEEN 2 AND 3), (2 != 3) BETWEEN 2 AND 3 union select * from v1; + +create or replace view v1 as select 2 LIKE 3 IS FALSE, 2 LIKE (3 IS FALSE), (2 LIKE 3) IS FALSE; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 LIKE 3 IS FALSE, 2 LIKE (3 IS FALSE), (2 LIKE 3) IS FALSE union select * from v1; + +create or replace view v1 as select charset(2 LIKE 3 COLLATE latin1_bin), charset(2 LIKE (3 COLLATE latin1_bin)), charset((2 LIKE 3) COLLATE latin1_bin); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select charset(2 LIKE 3 COLLATE latin1_bin), charset(2 LIKE (3 COLLATE latin1_bin)), charset((2 LIKE 3) COLLATE latin1_bin) union select * from v1; + +create or replace view v1 as select 2 LIKE 3 IN (0,1), 2 LIKE (3 IN (0,1)), (2 LIKE 3) IN (0,1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 LIKE 3 IN (0,1), 2 LIKE (3 IN (0,1)), (2 LIKE 3) IN (0,1) union select * from v1; + +create or replace view v1 as select 2 LIKE 3 OR 3, 2 LIKE (3 OR 3), (2 LIKE 3) OR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 LIKE 3 OR 3, 2 LIKE (3 OR 3), (2 LIKE 3) OR 3 union select * from v1; + +create or replace view v1 as select 2 LIKE 3 || 3, 2 LIKE (3 || 3), (2 LIKE 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 LIKE 3 || 3, 2 LIKE (3 || 3), (2 LIKE 3) || 3 union select * from v1; + +create or replace view v1 as select 2 LIKE 3 XOR 3, 2 LIKE (3 XOR 3), (2 LIKE 3) XOR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 LIKE 3 XOR 3, 2 LIKE (3 XOR 3), (2 LIKE 3) XOR 3 union select * from v1; + +create or replace view v1 as select 2 LIKE 2 AND 2, 2 LIKE (2 AND 2), (2 LIKE 2) AND 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 LIKE 2 AND 2, 2 LIKE (2 AND 2), (2 LIKE 2) AND 2 union select * from v1; + +create or replace view v1 as select 2 LIKE 2 && 2, 2 LIKE (2 && 2), (2 LIKE 2) && 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 LIKE 2 && 2, 2 LIKE (2 && 2), (2 LIKE 2) && 2 union select * from v1; + +create or replace view v1 as select 2 LIKE 2 = 1, 2 LIKE (2 = 1), (2 LIKE 2) = 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 LIKE 2 = 1, 2 LIKE (2 = 1), (2 LIKE 2) = 1 union select * from v1; + +create or replace view v1 as select 2 LIKE 2 <=> 1, 2 LIKE (2 <=> 1), (2 LIKE 2) <=> 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 LIKE 2 <=> 1, 2 LIKE (2 <=> 1), (2 LIKE 2) <=> 1 union select * from v1; + +create or replace view v1 as select 2 LIKE 2 >= 1, 2 LIKE (2 >= 1), (2 LIKE 2) >= 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 LIKE 2 >= 1, 2 LIKE (2 >= 1), (2 LIKE 2) >= 1 union select * from v1; + +create or replace view v1 as select 2 LIKE 3 <= 3, 2 LIKE (3 <= 3), (2 LIKE 3) <= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 LIKE 3 <= 3, 2 LIKE (3 <= 3), (2 LIKE 3) <= 3 union select * from v1; + +create or replace view v1 as select 2 LIKE 3 < 3, 2 LIKE (3 < 3), (2 LIKE 3) < 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 LIKE 3 < 3, 2 LIKE (3 < 3), (2 LIKE 3) < 3 union select * from v1; + +create or replace view v1 as select 2 LIKE 3 <> 3, 2 LIKE (3 <> 3), (2 LIKE 3) <> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 LIKE 3 <> 3, 2 LIKE (3 <> 3), (2 LIKE 3) <> 3 union select * from v1; + +create or replace view v1 as select 2 LIKE 2 > 0, 2 LIKE (2 > 0), (2 LIKE 2) > 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 LIKE 2 > 0, 2 LIKE (2 > 0), (2 LIKE 2) > 0 union select * from v1; + +create or replace view v1 as select 2 LIKE 3 != 3, 2 LIKE (3 != 3), (2 LIKE 3) != 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 LIKE 3 != 3, 2 LIKE (3 != 3), (2 LIKE 3) != 3 union select * from v1; + +create or replace view v1 as select 2 LIKE 2 LIKE 1, 2 LIKE (2 LIKE 1), (2 LIKE 2) LIKE 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 LIKE 2 LIKE 1, 2 LIKE (2 LIKE 1), (2 LIKE 2) LIKE 1 union select * from v1; + +create or replace view v1 as select 2 LIKE 2 REGEXP 1, 2 LIKE (2 REGEXP 1), (2 LIKE 2) REGEXP 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 LIKE 2 REGEXP 1, 2 LIKE (2 REGEXP 1), (2 LIKE 2) REGEXP 1 union select * from v1; + +create or replace view v1 as select 2 LIKE 3 | 3, 2 LIKE (3 | 3), (2 LIKE 3) | 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 LIKE 3 | 3, 2 LIKE (3 | 3), (2 LIKE 3) | 3 union select * from v1; + +create or replace view v1 as select 2 LIKE 2 & 2, 2 LIKE (2 & 2), (2 LIKE 2) & 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 LIKE 2 & 2, 2 LIKE (2 & 2), (2 LIKE 2) & 2 union select * from v1; + +create or replace view v1 as select 2 LIKE 2 << 2, 2 LIKE (2 << 2), (2 LIKE 2) << 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 LIKE 2 << 2, 2 LIKE (2 << 2), (2 LIKE 2) << 2 union select * from v1; + +create or replace view v1 as select 2 LIKE 4 >> 1, 2 LIKE (4 >> 1), (2 LIKE 4) >> 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 LIKE 4 >> 1, 2 LIKE (4 >> 1), (2 LIKE 4) >> 1 union select * from v1; + +create or replace view v1 as select 2 LIKE '2000-01-01' +INTERVAL 1 DAY, 2 LIKE ('2000-01-01' +INTERVAL 1 DAY), (2 LIKE '2000-01-01') +INTERVAL 1 DAY; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 LIKE '2000-01-01' +INTERVAL 1 DAY, 2 LIKE ('2000-01-01' +INTERVAL 1 DAY), (2 LIKE '2000-01-01') +INTERVAL 1 DAY union select * from v1; + +create or replace view v1 as select 2 LIKE 3 + 3, 2 LIKE (3 + 3), (2 LIKE 3) + 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 LIKE 3 + 3, 2 LIKE (3 + 3), (2 LIKE 3) + 3 union select * from v1; + +create or replace view v1 as select 2 LIKE 3 - 3, 2 LIKE (3 - 3), (2 LIKE 3) - 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 LIKE 3 - 3, 2 LIKE (3 - 3), (2 LIKE 3) - 3 union select * from v1; + +create or replace view v1 as select 2 LIKE 2 * 2, 2 LIKE (2 * 2), (2 LIKE 2) * 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 LIKE 2 * 2, 2 LIKE (2 * 2), (2 LIKE 2) * 2 union select * from v1; + +create or replace view v1 as select 2 LIKE 2 / 2, 2 LIKE (2 / 2), (2 LIKE 2) / 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 LIKE 2 / 2, 2 LIKE (2 / 2), (2 LIKE 2) / 2 union select * from v1; + +create or replace view v1 as select 2 LIKE 4 DIV 2, 2 LIKE (4 DIV 2), (2 LIKE 4) DIV 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 LIKE 4 DIV 2, 2 LIKE (4 DIV 2), (2 LIKE 4) DIV 2 union select * from v1; + +create or replace view v1 as select 2 LIKE 2 MOD 2, 2 LIKE (2 MOD 2), (2 LIKE 2) MOD 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 LIKE 2 MOD 2, 2 LIKE (2 MOD 2), (2 LIKE 2) MOD 2 union select * from v1; + +create or replace view v1 as select 2 LIKE 2 % 2, 2 LIKE (2 % 2), (2 LIKE 2) % 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 LIKE 2 % 2, 2 LIKE (2 % 2), (2 LIKE 2) % 2 union select * from v1; + +create or replace view v1 as select 2 LIKE 3 ^ 3, 2 LIKE (3 ^ 3), (2 LIKE 3) ^ 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 LIKE 3 ^ 3, 2 LIKE (3 ^ 3), (2 LIKE 3) ^ 3 union select * from v1; + +create or replace view v1 as select 2 LIKE 2 BETWEEN 1 AND 3, 2 LIKE (2 BETWEEN 1 AND 3), (2 LIKE 2) BETWEEN 1 AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 LIKE 2 BETWEEN 1 AND 3, 2 LIKE (2 BETWEEN 1 AND 3), (2 LIKE 2) BETWEEN 1 AND 3 union select * from v1; + +create or replace view v1 as select 2 REGEXP 3 IS FALSE, 2 REGEXP (3 IS FALSE), (2 REGEXP 3) IS FALSE; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 REGEXP 3 IS FALSE, 2 REGEXP (3 IS FALSE), (2 REGEXP 3) IS FALSE union select * from v1; + +create or replace view v1 as select charset(2 REGEXP 3 COLLATE latin1_bin), charset(2 REGEXP (3 COLLATE latin1_bin)), charset((2 REGEXP 3) COLLATE latin1_bin); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select charset(2 REGEXP 3 COLLATE latin1_bin), charset(2 REGEXP (3 COLLATE latin1_bin)), charset((2 REGEXP 3) COLLATE latin1_bin) union select * from v1; + +create or replace view v1 as select 2 REGEXP 3 IN (0,1), 2 REGEXP (3 IN (0,1)), (2 REGEXP 3) IN (0,1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 REGEXP 3 IN (0,1), 2 REGEXP (3 IN (0,1)), (2 REGEXP 3) IN (0,1) union select * from v1; + +create or replace view v1 as select 2 REGEXP 3 OR 3, 2 REGEXP (3 OR 3), (2 REGEXP 3) OR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 REGEXP 3 OR 3, 2 REGEXP (3 OR 3), (2 REGEXP 3) OR 3 union select * from v1; + +create or replace view v1 as select 2 REGEXP 3 || 3, 2 REGEXP (3 || 3), (2 REGEXP 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 REGEXP 3 || 3, 2 REGEXP (3 || 3), (2 REGEXP 3) || 3 union select * from v1; + +create or replace view v1 as select 2 REGEXP 3 XOR 3, 2 REGEXP (3 XOR 3), (2 REGEXP 3) XOR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 REGEXP 3 XOR 3, 2 REGEXP (3 XOR 3), (2 REGEXP 3) XOR 3 union select * from v1; + +create or replace view v1 as select 2 REGEXP 2 AND 2, 2 REGEXP (2 AND 2), (2 REGEXP 2) AND 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 REGEXP 2 AND 2, 2 REGEXP (2 AND 2), (2 REGEXP 2) AND 2 union select * from v1; + +create or replace view v1 as select 2 REGEXP 2 && 2, 2 REGEXP (2 && 2), (2 REGEXP 2) && 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 REGEXP 2 && 2, 2 REGEXP (2 && 2), (2 REGEXP 2) && 2 union select * from v1; + +create or replace view v1 as select 2 REGEXP 2 = 1, 2 REGEXP (2 = 1), (2 REGEXP 2) = 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 REGEXP 2 = 1, 2 REGEXP (2 = 1), (2 REGEXP 2) = 1 union select * from v1; + +create or replace view v1 as select 2 REGEXP 2 <=> 1, 2 REGEXP (2 <=> 1), (2 REGEXP 2) <=> 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 REGEXP 2 <=> 1, 2 REGEXP (2 <=> 1), (2 REGEXP 2) <=> 1 union select * from v1; + +create or replace view v1 as select 2 REGEXP 2 >= 1, 2 REGEXP (2 >= 1), (2 REGEXP 2) >= 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 REGEXP 2 >= 1, 2 REGEXP (2 >= 1), (2 REGEXP 2) >= 1 union select * from v1; + +create or replace view v1 as select 2 REGEXP 3 <= 3, 2 REGEXP (3 <= 3), (2 REGEXP 3) <= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 REGEXP 3 <= 3, 2 REGEXP (3 <= 3), (2 REGEXP 3) <= 3 union select * from v1; + +create or replace view v1 as select 2 REGEXP 3 < 3, 2 REGEXP (3 < 3), (2 REGEXP 3) < 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 REGEXP 3 < 3, 2 REGEXP (3 < 3), (2 REGEXP 3) < 3 union select * from v1; + +create or replace view v1 as select 2 REGEXP 3 <> 3, 2 REGEXP (3 <> 3), (2 REGEXP 3) <> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 REGEXP 3 <> 3, 2 REGEXP (3 <> 3), (2 REGEXP 3) <> 3 union select * from v1; + +create or replace view v1 as select 2 REGEXP 2 > 0, 2 REGEXP (2 > 0), (2 REGEXP 2) > 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 REGEXP 2 > 0, 2 REGEXP (2 > 0), (2 REGEXP 2) > 0 union select * from v1; + +create or replace view v1 as select 2 REGEXP 3 != 3, 2 REGEXP (3 != 3), (2 REGEXP 3) != 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 REGEXP 3 != 3, 2 REGEXP (3 != 3), (2 REGEXP 3) != 3 union select * from v1; + +create or replace view v1 as select 1 REGEXP 3 LIKE 3, 1 REGEXP (3 LIKE 3), (1 REGEXP 3) LIKE 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 1 REGEXP 3 LIKE 3, 1 REGEXP (3 LIKE 3), (1 REGEXP 3) LIKE 3 union select * from v1; + +create or replace view v1 as select 1 REGEXP 3 REGEXP 3, 1 REGEXP (3 REGEXP 3), (1 REGEXP 3) REGEXP 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 1 REGEXP 3 REGEXP 3, 1 REGEXP (3 REGEXP 3), (1 REGEXP 3) REGEXP 3 union select * from v1; + +create or replace view v1 as select 2 REGEXP 3 | 3, 2 REGEXP (3 | 3), (2 REGEXP 3) | 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 REGEXP 3 | 3, 2 REGEXP (3 | 3), (2 REGEXP 3) | 3 union select * from v1; + +create or replace view v1 as select 2 REGEXP 2 & 2, 2 REGEXP (2 & 2), (2 REGEXP 2) & 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 REGEXP 2 & 2, 2 REGEXP (2 & 2), (2 REGEXP 2) & 2 union select * from v1; + +create or replace view v1 as select 2 REGEXP 2 << 2, 2 REGEXP (2 << 2), (2 REGEXP 2) << 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 REGEXP 2 << 2, 2 REGEXP (2 << 2), (2 REGEXP 2) << 2 union select * from v1; + +create or replace view v1 as select 2 REGEXP 4 >> 1, 2 REGEXP (4 >> 1), (2 REGEXP 4) >> 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 REGEXP 4 >> 1, 2 REGEXP (4 >> 1), (2 REGEXP 4) >> 1 union select * from v1; + +create or replace view v1 as select 2 REGEXP '2000-01-01' +INTERVAL 1 DAY, 2 REGEXP ('2000-01-01' +INTERVAL 1 DAY), (2 REGEXP '2000-01-01') +INTERVAL 1 DAY; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 REGEXP '2000-01-01' +INTERVAL 1 DAY, 2 REGEXP ('2000-01-01' +INTERVAL 1 DAY), (2 REGEXP '2000-01-01') +INTERVAL 1 DAY union select * from v1; + +create or replace view v1 as select 2 REGEXP 3 + 3, 2 REGEXP (3 + 3), (2 REGEXP 3) + 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 REGEXP 3 + 3, 2 REGEXP (3 + 3), (2 REGEXP 3) + 3 union select * from v1; + +create or replace view v1 as select 2 REGEXP 3 - 3, 2 REGEXP (3 - 3), (2 REGEXP 3) - 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 REGEXP 3 - 3, 2 REGEXP (3 - 3), (2 REGEXP 3) - 3 union select * from v1; + +create or replace view v1 as select 2 REGEXP 2 * 2, 2 REGEXP (2 * 2), (2 REGEXP 2) * 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 REGEXP 2 * 2, 2 REGEXP (2 * 2), (2 REGEXP 2) * 2 union select * from v1; + +create or replace view v1 as select 2 REGEXP 2 / 2, 2 REGEXP (2 / 2), (2 REGEXP 2) / 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 REGEXP 2 / 2, 2 REGEXP (2 / 2), (2 REGEXP 2) / 2 union select * from v1; + +create or replace view v1 as select 2 REGEXP 4 DIV 2, 2 REGEXP (4 DIV 2), (2 REGEXP 4) DIV 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 REGEXP 4 DIV 2, 2 REGEXP (4 DIV 2), (2 REGEXP 4) DIV 2 union select * from v1; + +create or replace view v1 as select 2 REGEXP 2 MOD 2, 2 REGEXP (2 MOD 2), (2 REGEXP 2) MOD 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 REGEXP 2 MOD 2, 2 REGEXP (2 MOD 2), (2 REGEXP 2) MOD 2 union select * from v1; + +create or replace view v1 as select 2 REGEXP 2 % 2, 2 REGEXP (2 % 2), (2 REGEXP 2) % 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 REGEXP 2 % 2, 2 REGEXP (2 % 2), (2 REGEXP 2) % 2 union select * from v1; + +create or replace view v1 as select 2 REGEXP 3 ^ 3, 2 REGEXP (3 ^ 3), (2 REGEXP 3) ^ 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 REGEXP 3 ^ 3, 2 REGEXP (3 ^ 3), (2 REGEXP 3) ^ 3 union select * from v1; + +create or replace view v1 as select 2 REGEXP 2 BETWEEN 1 AND 3, 2 REGEXP (2 BETWEEN 1 AND 3), (2 REGEXP 2) BETWEEN 1 AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 REGEXP 2 BETWEEN 1 AND 3, 2 REGEXP (2 BETWEEN 1 AND 3), (2 REGEXP 2) BETWEEN 1 AND 3 union select * from v1; + +create or replace view v1 as select 2 | 3 IS FALSE, 2 | (3 IS FALSE), (2 | 3) IS FALSE; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 | 3 IS FALSE, 2 | (3 IS FALSE), (2 | 3) IS FALSE union select * from v1; + +create or replace view v1 as select charset(2 | 3 COLLATE latin1_bin), charset(2 | (3 COLLATE latin1_bin)), charset((2 | 3) COLLATE latin1_bin); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select charset(2 | 3 COLLATE latin1_bin), charset(2 | (3 COLLATE latin1_bin)), charset((2 | 3) COLLATE latin1_bin) union select * from v1; + +create or replace view v1 as select 2 | 3 IN (0,1), 2 | (3 IN (0,1)), (2 | 3) IN (0,1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 | 3 IN (0,1), 2 | (3 IN (0,1)), (2 | 3) IN (0,1) union select * from v1; + +create or replace view v1 as select 2 | 3 OR 3, 2 | (3 OR 3), (2 | 3) OR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 | 3 OR 3, 2 | (3 OR 3), (2 | 3) OR 3 union select * from v1; + +create or replace view v1 as select 2 | 3 || 3, 2 | (3 || 3), (2 | 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 | 3 || 3, 2 | (3 || 3), (2 | 3) || 3 union select * from v1; + +create or replace view v1 as select 2 | 3 XOR 3, 2 | (3 XOR 3), (2 | 3) XOR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 | 3 XOR 3, 2 | (3 XOR 3), (2 | 3) XOR 3 union select * from v1; + +create or replace view v1 as select 2 | 3 AND 3, 2 | (3 AND 3), (2 | 3) AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 | 3 AND 3, 2 | (3 AND 3), (2 | 3) AND 3 union select * from v1; + +create or replace view v1 as select 2 | 3 && 3, 2 | (3 && 3), (2 | 3) && 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 | 3 && 3, 2 | (3 && 3), (2 | 3) && 3 union select * from v1; + +create or replace view v1 as select 2 | 3 = 3, 2 | (3 = 3), (2 | 3) = 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 | 3 = 3, 2 | (3 = 3), (2 | 3) = 3 union select * from v1; + +create or replace view v1 as select 2 | 3 <=> 3, 2 | (3 <=> 3), (2 | 3) <=> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 | 3 <=> 3, 2 | (3 <=> 3), (2 | 3) <=> 3 union select * from v1; + +create or replace view v1 as select 2 | 3 >= 3, 2 | (3 >= 3), (2 | 3) >= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 | 3 >= 3, 2 | (3 >= 3), (2 | 3) >= 3 union select * from v1; + +create or replace view v1 as select 2 | 3 <= 3, 2 | (3 <= 3), (2 | 3) <= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 | 3 <= 3, 2 | (3 <= 3), (2 | 3) <= 3 union select * from v1; + +create or replace view v1 as select 2 | 3 < 3, 2 | (3 < 3), (2 | 3) < 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 | 3 < 3, 2 | (3 < 3), (2 | 3) < 3 union select * from v1; + +create or replace view v1 as select 2 | 3 <> 3, 2 | (3 <> 3), (2 | 3) <> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 | 3 <> 3, 2 | (3 <> 3), (2 | 3) <> 3 union select * from v1; + +create or replace view v1 as select 2 | 3 > 3, 2 | (3 > 3), (2 | 3) > 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 | 3 > 3, 2 | (3 > 3), (2 | 3) > 3 union select * from v1; + +create or replace view v1 as select 2 | 3 != 3, 2 | (3 != 3), (2 | 3) != 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 | 3 != 3, 2 | (3 != 3), (2 | 3) != 3 union select * from v1; + +create or replace view v1 as select 2 | 3 LIKE 3, 2 | (3 LIKE 3), (2 | 3) LIKE 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 | 3 LIKE 3, 2 | (3 LIKE 3), (2 | 3) LIKE 3 union select * from v1; + +create or replace view v1 as select 2 | 3 REGEXP 3, 2 | (3 REGEXP 3), (2 | 3) REGEXP 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 | 3 REGEXP 3, 2 | (3 REGEXP 3), (2 | 3) REGEXP 3 union select * from v1; + +create or replace view v1 as select 2 | 0 & 0, 2 | (0 & 0), (2 | 0) & 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 | 0 & 0, 2 | (0 & 0), (2 | 0) & 0 union select * from v1; + +create or replace view v1 as select 2 | 3 << 3, 2 | (3 << 3), (2 | 3) << 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 | 3 << 3, 2 | (3 << 3), (2 | 3) << 3 union select * from v1; + +create or replace view v1 as select 2 | 3 >> 3, 2 | (3 >> 3), (2 | 3) >> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 | 3 >> 3, 2 | (3 >> 3), (2 | 3) >> 3 union select * from v1; + +create or replace view v1 as select 2 | '2000-01-01' +INTERVAL 1 DAY, 2 | ('2000-01-01' +INTERVAL 1 DAY), (2 | '2000-01-01') +INTERVAL 1 DAY; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 | '2000-01-01' +INTERVAL 1 DAY, 2 | ('2000-01-01' +INTERVAL 1 DAY), (2 | '2000-01-01') +INTERVAL 1 DAY union select * from v1; + +create or replace view v1 as select 2 | 1 + 1, 2 | (1 + 1), (2 | 1) + 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 | 1 + 1, 2 | (1 + 1), (2 | 1) + 1 union select * from v1; + +create or replace view v1 as select 2 | 3 - 3, 2 | (3 - 3), (2 | 3) - 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 | 3 - 3, 2 | (3 - 3), (2 | 3) - 3 union select * from v1; + +create or replace view v1 as select 2 | 3 * 3, 2 | (3 * 3), (2 | 3) * 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 | 3 * 3, 2 | (3 * 3), (2 | 3) * 3 union select * from v1; + +create or replace view v1 as select 2 | 3 / 3, 2 | (3 / 3), (2 | 3) / 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 | 3 / 3, 2 | (3 / 3), (2 | 3) / 3 union select * from v1; + +create or replace view v1 as select 2 | 3 DIV 3, 2 | (3 DIV 3), (2 | 3) DIV 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 | 3 DIV 3, 2 | (3 DIV 3), (2 | 3) DIV 3 union select * from v1; + +create or replace view v1 as select 2 | 3 MOD 3, 2 | (3 MOD 3), (2 | 3) MOD 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 | 3 MOD 3, 2 | (3 MOD 3), (2 | 3) MOD 3 union select * from v1; + +create or replace view v1 as select 2 | 3 % 3, 2 | (3 % 3), (2 | 3) % 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 | 3 % 3, 2 | (3 % 3), (2 | 3) % 3 union select * from v1; + +create or replace view v1 as select 2 | 3 ^ 3, 2 | (3 ^ 3), (2 | 3) ^ 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 | 3 ^ 3, 2 | (3 ^ 3), (2 | 3) ^ 3 union select * from v1; + +create or replace view v1 as select 2 | 3 BETWEEN 1 AND 3, 2 | (3 BETWEEN 1 AND 3), (2 | 3) BETWEEN 1 AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 | 3 BETWEEN 1 AND 3, 2 | (3 BETWEEN 1 AND 3), (2 | 3) BETWEEN 1 AND 3 union select * from v1; + +create or replace view v1 as select 2 & 1 IS FALSE, 2 & (1 IS FALSE), (2 & 1) IS FALSE; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 & 1 IS FALSE, 2 & (1 IS FALSE), (2 & 1) IS FALSE union select * from v1; + +create or replace view v1 as select charset(2 & 3 COLLATE latin1_bin), charset(2 & (3 COLLATE latin1_bin)), charset((2 & 3) COLLATE latin1_bin); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select charset(2 & 3 COLLATE latin1_bin), charset(2 & (3 COLLATE latin1_bin)), charset((2 & 3) COLLATE latin1_bin) union select * from v1; + +create or replace view v1 as select 2 & 4 IN (0,1), 2 & (4 IN (0,1)), (2 & 4) IN (0,1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 & 4 IN (0,1), 2 & (4 IN (0,1)), (2 & 4) IN (0,1) union select * from v1; + +create or replace view v1 as select 2 & 3 OR 3, 2 & (3 OR 3), (2 & 3) OR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 & 3 OR 3, 2 & (3 OR 3), (2 & 3) OR 3 union select * from v1; + +create or replace view v1 as select 2 & 3 || 3, 2 & (3 || 3), (2 & 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 & 3 || 3, 2 & (3 || 3), (2 & 3) || 3 union select * from v1; + +create or replace view v1 as select 2 & 1 XOR 1, 2 & (1 XOR 1), (2 & 1) XOR 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 & 1 XOR 1, 2 & (1 XOR 1), (2 & 1) XOR 1 union select * from v1; + +create or replace view v1 as select 2 & 3 AND 3, 2 & (3 AND 3), (2 & 3) AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 & 3 AND 3, 2 & (3 AND 3), (2 & 3) AND 3 union select * from v1; + +create or replace view v1 as select 2 & 3 && 3, 2 & (3 && 3), (2 & 3) && 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 & 3 && 3, 2 & (3 && 3), (2 & 3) && 3 union select * from v1; + +create or replace view v1 as select 2 & 3 = 2, 2 & (3 = 2), (2 & 3) = 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 & 3 = 2, 2 & (3 = 2), (2 & 3) = 2 union select * from v1; + +create or replace view v1 as select 2 & 3 <=> 2, 2 & (3 <=> 2), (2 & 3) <=> 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 & 3 <=> 2, 2 & (3 <=> 2), (2 & 3) <=> 2 union select * from v1; + +create or replace view v1 as select 2 & 3 >= 2, 2 & (3 >= 2), (2 & 3) >= 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 & 3 >= 2, 2 & (3 >= 2), (2 & 3) >= 2 union select * from v1; + +create or replace view v1 as select 2 & 3 <= 3, 2 & (3 <= 3), (2 & 3) <= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 & 3 <= 3, 2 & (3 <= 3), (2 & 3) <= 3 union select * from v1; + +create or replace view v1 as select 2 & 3 < 3, 2 & (3 < 3), (2 & 3) < 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 & 3 < 3, 2 & (3 < 3), (2 & 3) < 3 union select * from v1; + +create or replace view v1 as select 2 & 3 <> 3, 2 & (3 <> 3), (2 & 3) <> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 & 3 <> 3, 2 & (3 <> 3), (2 & 3) <> 3 union select * from v1; + +create or replace view v1 as select 2 & 3 > 1, 2 & (3 > 1), (2 & 3) > 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 & 3 > 1, 2 & (3 > 1), (2 & 3) > 1 union select * from v1; + +create or replace view v1 as select 2 & 3 != 3, 2 & (3 != 3), (2 & 3) != 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 & 3 != 3, 2 & (3 != 3), (2 & 3) != 3 union select * from v1; + +create or replace view v1 as select 2 & 3 LIKE 2, 2 & (3 LIKE 2), (2 & 3) LIKE 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 & 3 LIKE 2, 2 & (3 LIKE 2), (2 & 3) LIKE 2 union select * from v1; + +create or replace view v1 as select 2 & 3 REGEXP 2, 2 & (3 REGEXP 2), (2 & 3) REGEXP 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 & 3 REGEXP 2, 2 & (3 REGEXP 2), (2 & 3) REGEXP 2 union select * from v1; + +create or replace view v1 as select 2 & 3 | 3, 2 & (3 | 3), (2 & 3) | 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 & 3 | 3, 2 & (3 | 3), (2 & 3) | 3 union select * from v1; + +create or replace view v1 as select 2 & 3 << 3, 2 & (3 << 3), (2 & 3) << 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 & 3 << 3, 2 & (3 << 3), (2 & 3) << 3 union select * from v1; + +create or replace view v1 as select 2 & 3 >> 1, 2 & (3 >> 1), (2 & 3) >> 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 & 3 >> 1, 2 & (3 >> 1), (2 & 3) >> 1 union select * from v1; + +create or replace view v1 as select 2 & '2000-01-01' +INTERVAL 1 DAY, 2 & ('2000-01-01' +INTERVAL 1 DAY), (2 & '2000-01-01') +INTERVAL 1 DAY; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 & '2000-01-01' +INTERVAL 1 DAY, 2 & ('2000-01-01' +INTERVAL 1 DAY), (2 & '2000-01-01') +INTERVAL 1 DAY union select * from v1; + +create or replace view v1 as select 2 & 3 + 3, 2 & (3 + 3), (2 & 3) + 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 & 3 + 3, 2 & (3 + 3), (2 & 3) + 3 union select * from v1; + +create or replace view v1 as select 6 & 4 - 3, 6 & (4 - 3), (6 & 4) - 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 6 & 4 - 3, 6 & (4 - 3), (6 & 4) - 3 union select * from v1; + +create or replace view v1 as select 2 & 3 * 3, 2 & (3 * 3), (2 & 3) * 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 & 3 * 3, 2 & (3 * 3), (2 & 3) * 3 union select * from v1; + +create or replace view v1 as select 2 & 3 / 3, 2 & (3 / 3), (2 & 3) / 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 & 3 / 3, 2 & (3 / 3), (2 & 3) / 3 union select * from v1; + +create or replace view v1 as select 2 & 3 DIV 2, 2 & (3 DIV 2), (2 & 3) DIV 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 & 3 DIV 2, 2 & (3 DIV 2), (2 & 3) DIV 2 union select * from v1; + +create or replace view v1 as select 2 & 3 MOD 3, 2 & (3 MOD 3), (2 & 3) MOD 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 & 3 MOD 3, 2 & (3 MOD 3), (2 & 3) MOD 3 union select * from v1; + +create or replace view v1 as select 2 & 3 % 3, 2 & (3 % 3), (2 & 3) % 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 & 3 % 3, 2 & (3 % 3), (2 & 3) % 3 union select * from v1; + +create or replace view v1 as select 2 & 3 ^ 3, 2 & (3 ^ 3), (2 & 3) ^ 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 & 3 ^ 3, 2 & (3 ^ 3), (2 & 3) ^ 3 union select * from v1; + +create or replace view v1 as select 2 & 3 BETWEEN 1 AND 3, 2 & (3 BETWEEN 1 AND 3), (2 & 3) BETWEEN 1 AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 & 3 BETWEEN 1 AND 3, 2 & (3 BETWEEN 1 AND 3), (2 & 3) BETWEEN 1 AND 3 union select * from v1; + +create or replace view v1 as select 2 << 3 IS FALSE, 2 << (3 IS FALSE), (2 << 3) IS FALSE; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 << 3 IS FALSE, 2 << (3 IS FALSE), (2 << 3) IS FALSE union select * from v1; + +create or replace view v1 as select charset(2 << 3 COLLATE latin1_bin), charset(2 << (3 COLLATE latin1_bin)), charset((2 << 3) COLLATE latin1_bin); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select charset(2 << 3 COLLATE latin1_bin), charset(2 << (3 COLLATE latin1_bin)), charset((2 << 3) COLLATE latin1_bin) union select * from v1; + +create or replace view v1 as select 2 << 3 IN (0,1), 2 << (3 IN (0,1)), (2 << 3) IN (0,1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 << 3 IN (0,1), 2 << (3 IN (0,1)), (2 << 3) IN (0,1) union select * from v1; + +create or replace view v1 as select 2 << 3 OR 3, 2 << (3 OR 3), (2 << 3) OR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 << 3 OR 3, 2 << (3 OR 3), (2 << 3) OR 3 union select * from v1; + +create or replace view v1 as select 2 << 3 || 3, 2 << (3 || 3), (2 << 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 << 3 || 3, 2 << (3 || 3), (2 << 3) || 3 union select * from v1; + +create or replace view v1 as select 2 << 3 XOR 3, 2 << (3 XOR 3), (2 << 3) XOR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 << 3 XOR 3, 2 << (3 XOR 3), (2 << 3) XOR 3 union select * from v1; + +create or replace view v1 as select 2 << 3 AND 3, 2 << (3 AND 3), (2 << 3) AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 << 3 AND 3, 2 << (3 AND 3), (2 << 3) AND 3 union select * from v1; + +create or replace view v1 as select 2 << 3 && 3, 2 << (3 && 3), (2 << 3) && 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 << 3 && 3, 2 << (3 && 3), (2 << 3) && 3 union select * from v1; + +create or replace view v1 as select 2 << 3 = 3, 2 << (3 = 3), (2 << 3) = 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 << 3 = 3, 2 << (3 = 3), (2 << 3) = 3 union select * from v1; + +create or replace view v1 as select 2 << 3 <=> 3, 2 << (3 <=> 3), (2 << 3) <=> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 << 3 <=> 3, 2 << (3 <=> 3), (2 << 3) <=> 3 union select * from v1; + +create or replace view v1 as select 2 << 3 >= 3, 2 << (3 >= 3), (2 << 3) >= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 << 3 >= 3, 2 << (3 >= 3), (2 << 3) >= 3 union select * from v1; + +create or replace view v1 as select 2 << 3 <= 3, 2 << (3 <= 3), (2 << 3) <= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 << 3 <= 3, 2 << (3 <= 3), (2 << 3) <= 3 union select * from v1; + +create or replace view v1 as select 2 << 3 < 3, 2 << (3 < 3), (2 << 3) < 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 << 3 < 3, 2 << (3 < 3), (2 << 3) < 3 union select * from v1; + +create or replace view v1 as select 2 << 3 <> 3, 2 << (3 <> 3), (2 << 3) <> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 << 3 <> 3, 2 << (3 <> 3), (2 << 3) <> 3 union select * from v1; + +create or replace view v1 as select 2 << 3 > 3, 2 << (3 > 3), (2 << 3) > 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 << 3 > 3, 2 << (3 > 3), (2 << 3) > 3 union select * from v1; + +create or replace view v1 as select 2 << 3 != 3, 2 << (3 != 3), (2 << 3) != 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 << 3 != 3, 2 << (3 != 3), (2 << 3) != 3 union select * from v1; + +create or replace view v1 as select 2 << 3 LIKE 3, 2 << (3 LIKE 3), (2 << 3) LIKE 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 << 3 LIKE 3, 2 << (3 LIKE 3), (2 << 3) LIKE 3 union select * from v1; + +create or replace view v1 as select 2 << 3 REGEXP 3, 2 << (3 REGEXP 3), (2 << 3) REGEXP 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 << 3 REGEXP 3, 2 << (3 REGEXP 3), (2 << 3) REGEXP 3 union select * from v1; + +create or replace view v1 as select 2 << 3 | 3, 2 << (3 | 3), (2 << 3) | 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 << 3 | 3, 2 << (3 | 3), (2 << 3) | 3 union select * from v1; + +create or replace view v1 as select 2 << 3 & 3, 2 << (3 & 3), (2 << 3) & 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 << 3 & 3, 2 << (3 & 3), (2 << 3) & 3 union select * from v1; + +create or replace view v1 as select 2 << 3 << 3, 2 << (3 << 3), (2 << 3) << 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 << 3 << 3, 2 << (3 << 3), (2 << 3) << 3 union select * from v1; + +create or replace view v1 as select 2 << 2 >> 3, 2 << (2 >> 3), (2 << 2) >> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 << 2 >> 3, 2 << (2 >> 3), (2 << 2) >> 3 union select * from v1; + +create or replace view v1 as select 2 << '2000-01-01' +INTERVAL 1 DAY, 2 << ('2000-01-01' +INTERVAL 1 DAY), (2 << '2000-01-01') +INTERVAL 1 DAY; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 << '2000-01-01' +INTERVAL 1 DAY, 2 << ('2000-01-01' +INTERVAL 1 DAY), (2 << '2000-01-01') +INTERVAL 1 DAY union select * from v1; + +create or replace view v1 as select 2 << 3 + 3, 2 << (3 + 3), (2 << 3) + 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 << 3 + 3, 2 << (3 + 3), (2 << 3) + 3 union select * from v1; + +create or replace view v1 as select 2 << 3 - 3, 2 << (3 - 3), (2 << 3) - 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 << 3 - 3, 2 << (3 - 3), (2 << 3) - 3 union select * from v1; + +create or replace view v1 as select 2 << 3 * 3, 2 << (3 * 3), (2 << 3) * 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 << 3 * 3, 2 << (3 * 3), (2 << 3) * 3 union select * from v1; + +create or replace view v1 as select 2 << 3 / 3, 2 << (3 / 3), (2 << 3) / 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 << 3 / 3, 2 << (3 / 3), (2 << 3) / 3 union select * from v1; + +create or replace view v1 as select 2 << 3 DIV 3, 2 << (3 DIV 3), (2 << 3) DIV 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 << 3 DIV 3, 2 << (3 DIV 3), (2 << 3) DIV 3 union select * from v1; + +create or replace view v1 as select 2 << 3 MOD 3, 2 << (3 MOD 3), (2 << 3) MOD 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 << 3 MOD 3, 2 << (3 MOD 3), (2 << 3) MOD 3 union select * from v1; + +create or replace view v1 as select 2 << 3 % 3, 2 << (3 % 3), (2 << 3) % 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 << 3 % 3, 2 << (3 % 3), (2 << 3) % 3 union select * from v1; + +create or replace view v1 as select 2 << 3 ^ 3, 2 << (3 ^ 3), (2 << 3) ^ 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 << 3 ^ 3, 2 << (3 ^ 3), (2 << 3) ^ 3 union select * from v1; + +create or replace view v1 as select 2 << 3 BETWEEN 1 AND 3, 2 << (3 BETWEEN 1 AND 3), (2 << 3) BETWEEN 1 AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 << 3 BETWEEN 1 AND 3, 2 << (3 BETWEEN 1 AND 3), (2 << 3) BETWEEN 1 AND 3 union select * from v1; + +create or replace view v1 as select 2 >> 3 IS FALSE, 2 >> (3 IS FALSE), (2 >> 3) IS FALSE; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 >> 3 IS FALSE, 2 >> (3 IS FALSE), (2 >> 3) IS FALSE union select * from v1; + +create or replace view v1 as select charset(2 >> 3 COLLATE latin1_bin), charset(2 >> (3 COLLATE latin1_bin)), charset((2 >> 3) COLLATE latin1_bin); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select charset(2 >> 3 COLLATE latin1_bin), charset(2 >> (3 COLLATE latin1_bin)), charset((2 >> 3) COLLATE latin1_bin) union select * from v1; + +create or replace view v1 as select 2 >> 3 IN (0,1), 2 >> (3 IN (0,1)), (2 >> 3) IN (0,1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 >> 3 IN (0,1), 2 >> (3 IN (0,1)), (2 >> 3) IN (0,1) union select * from v1; + +create or replace view v1 as select 2 >> 3 OR 0, 2 >> (3 OR 0), (2 >> 3) OR 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 >> 3 OR 0, 2 >> (3 OR 0), (2 >> 3) OR 0 union select * from v1; + +create or replace view v1 as select 2 >> 3 || 0, 2 >> (3 || 0), (2 >> 3) || 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 >> 3 || 0, 2 >> (3 || 0), (2 >> 3) || 0 union select * from v1; + +create or replace view v1 as select 2 >> 3 XOR 3, 2 >> (3 XOR 3), (2 >> 3) XOR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 >> 3 XOR 3, 2 >> (3 XOR 3), (2 >> 3) XOR 3 union select * from v1; + +create or replace view v1 as select 2 >> 3 AND 3, 2 >> (3 AND 3), (2 >> 3) AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 >> 3 AND 3, 2 >> (3 AND 3), (2 >> 3) AND 3 union select * from v1; + +create or replace view v1 as select 2 >> 3 && 3, 2 >> (3 && 3), (2 >> 3) && 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 >> 3 && 3, 2 >> (3 && 3), (2 >> 3) && 3 union select * from v1; + +create or replace view v1 as select 2 >> 3 = 3, 2 >> (3 = 3), (2 >> 3) = 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 >> 3 = 3, 2 >> (3 = 3), (2 >> 3) = 3 union select * from v1; + +create or replace view v1 as select 2 >> 3 <=> 3, 2 >> (3 <=> 3), (2 >> 3) <=> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 >> 3 <=> 3, 2 >> (3 <=> 3), (2 >> 3) <=> 3 union select * from v1; + +create or replace view v1 as select 2 >> 3 >= 3, 2 >> (3 >= 3), (2 >> 3) >= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 >> 3 >= 3, 2 >> (3 >= 3), (2 >> 3) >= 3 union select * from v1; + +create or replace view v1 as select 2 >> 3 <= 0, 2 >> (3 <= 0), (2 >> 3) <= 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 >> 3 <= 0, 2 >> (3 <= 0), (2 >> 3) <= 0 union select * from v1; + +create or replace view v1 as select 2 >> 3 < 3, 2 >> (3 < 3), (2 >> 3) < 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 >> 3 < 3, 2 >> (3 < 3), (2 >> 3) < 3 union select * from v1; + +create or replace view v1 as select 2 >> 3 <> 3, 2 >> (3 <> 3), (2 >> 3) <> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 >> 3 <> 3, 2 >> (3 <> 3), (2 >> 3) <> 3 union select * from v1; + +create or replace view v1 as select 2 >> 3 > 3, 2 >> (3 > 3), (2 >> 3) > 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 >> 3 > 3, 2 >> (3 > 3), (2 >> 3) > 3 union select * from v1; + +create or replace view v1 as select 2 >> 3 != 3, 2 >> (3 != 3), (2 >> 3) != 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 >> 3 != 3, 2 >> (3 != 3), (2 >> 3) != 3 union select * from v1; + +create or replace view v1 as select 2 >> 3 LIKE 3, 2 >> (3 LIKE 3), (2 >> 3) LIKE 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 >> 3 LIKE 3, 2 >> (3 LIKE 3), (2 >> 3) LIKE 3 union select * from v1; + +create or replace view v1 as select 2 >> 3 REGEXP 3, 2 >> (3 REGEXP 3), (2 >> 3) REGEXP 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 >> 3 REGEXP 3, 2 >> (3 REGEXP 3), (2 >> 3) REGEXP 3 union select * from v1; + +create or replace view v1 as select 2 >> 3 | 3, 2 >> (3 | 3), (2 >> 3) | 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 >> 3 | 3, 2 >> (3 | 3), (2 >> 3) | 3 union select * from v1; + +create or replace view v1 as select 2 >> 3 & 1, 2 >> (3 & 1), (2 >> 3) & 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 >> 3 & 1, 2 >> (3 & 1), (2 >> 3) & 1 union select * from v1; + +create or replace view v1 as select 2 >> 1 << 3, 2 >> (1 << 3), (2 >> 1) << 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 >> 1 << 3, 2 >> (1 << 3), (2 >> 1) << 3 union select * from v1; + +create or replace view v1 as select 2 >> 3 >> 3, 2 >> (3 >> 3), (2 >> 3) >> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 >> 3 >> 3, 2 >> (3 >> 3), (2 >> 3) >> 3 union select * from v1; + +create or replace view v1 as select 2 >> '2000-01-01' +INTERVAL 1 DAY, 2 >> ('2000-01-01' +INTERVAL 1 DAY), (2 >> '2000-01-01') +INTERVAL 1 DAY; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 >> '2000-01-01' +INTERVAL 1 DAY, 2 >> ('2000-01-01' +INTERVAL 1 DAY), (2 >> '2000-01-01') +INTERVAL 1 DAY union select * from v1; + +create or replace view v1 as select 2 >> 3 + 3, 2 >> (3 + 3), (2 >> 3) + 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 >> 3 + 3, 2 >> (3 + 3), (2 >> 3) + 3 union select * from v1; + +create or replace view v1 as select 2 >> 1 - 1, 2 >> (1 - 1), (2 >> 1) - 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 >> 1 - 1, 2 >> (1 - 1), (2 >> 1) - 1 union select * from v1; + +create or replace view v1 as select 2 >> 1 * 3, 2 >> (1 * 3), (2 >> 1) * 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 >> 1 * 3, 2 >> (1 * 3), (2 >> 1) * 3 union select * from v1; + +create or replace view v1 as select 2 >> 3 / 3, 2 >> (3 / 3), (2 >> 3) / 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 >> 3 / 3, 2 >> (3 / 3), (2 >> 3) / 3 union select * from v1; + +create or replace view v1 as select 2 >> 3 DIV 3, 2 >> (3 DIV 3), (2 >> 3) DIV 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 >> 3 DIV 3, 2 >> (3 DIV 3), (2 >> 3) DIV 3 union select * from v1; + +create or replace view v1 as select 2 >> 3 MOD 3, 2 >> (3 MOD 3), (2 >> 3) MOD 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 >> 3 MOD 3, 2 >> (3 MOD 3), (2 >> 3) MOD 3 union select * from v1; + +create or replace view v1 as select 2 >> 3 % 3, 2 >> (3 % 3), (2 >> 3) % 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 >> 3 % 3, 2 >> (3 % 3), (2 >> 3) % 3 union select * from v1; + +create or replace view v1 as select 2 >> 3 ^ 3, 2 >> (3 ^ 3), (2 >> 3) ^ 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 >> 3 ^ 3, 2 >> (3 ^ 3), (2 >> 3) ^ 3 union select * from v1; + +create or replace view v1 as select 2 >> 3 BETWEEN 1 AND 3, 2 >> (3 BETWEEN 1 AND 3), (2 >> 3) BETWEEN 1 AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 >> 3 BETWEEN 1 AND 3, 2 >> (3 BETWEEN 1 AND 3), (2 >> 3) BETWEEN 1 AND 3 union select * from v1; + +create or replace view v1 as select 2 + 3 IS FALSE, 2 + (3 IS FALSE), (2 + 3) IS FALSE; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 + 3 IS FALSE, 2 + (3 IS FALSE), (2 + 3) IS FALSE union select * from v1; + +create or replace view v1 as select charset(2 + 3 COLLATE latin1_bin), charset(2 + (3 COLLATE latin1_bin)), charset((2 + 3) COLLATE latin1_bin); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select charset(2 + 3 COLLATE latin1_bin), charset(2 + (3 COLLATE latin1_bin)), charset((2 + 3) COLLATE latin1_bin) union select * from v1; + +create or replace view v1 as select 2 + 3 IN (0,1), 2 + (3 IN (0,1)), (2 + 3) IN (0,1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 + 3 IN (0,1), 2 + (3 IN (0,1)), (2 + 3) IN (0,1) union select * from v1; + +create or replace view v1 as select 2 + 3 OR 3, 2 + (3 OR 3), (2 + 3) OR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 + 3 OR 3, 2 + (3 OR 3), (2 + 3) OR 3 union select * from v1; + +create or replace view v1 as select 2 + 3 || 3, 2 + (3 || 3), (2 + 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 + 3 || 3, 2 + (3 || 3), (2 + 3) || 3 union select * from v1; + +create or replace view v1 as select 2 + 3 XOR 3, 2 + (3 XOR 3), (2 + 3) XOR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 + 3 XOR 3, 2 + (3 XOR 3), (2 + 3) XOR 3 union select * from v1; + +create or replace view v1 as select 2 + 3 AND 3, 2 + (3 AND 3), (2 + 3) AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 + 3 AND 3, 2 + (3 AND 3), (2 + 3) AND 3 union select * from v1; + +create or replace view v1 as select 2 + 3 && 3, 2 + (3 && 3), (2 + 3) && 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 + 3 && 3, 2 + (3 && 3), (2 + 3) && 3 union select * from v1; + +create or replace view v1 as select 2 + 3 = 3, 2 + (3 = 3), (2 + 3) = 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 + 3 = 3, 2 + (3 = 3), (2 + 3) = 3 union select * from v1; + +create or replace view v1 as select 2 + 3 <=> 3, 2 + (3 <=> 3), (2 + 3) <=> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 + 3 <=> 3, 2 + (3 <=> 3), (2 + 3) <=> 3 union select * from v1; + +create or replace view v1 as select 2 + 3 >= 3, 2 + (3 >= 3), (2 + 3) >= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 + 3 >= 3, 2 + (3 >= 3), (2 + 3) >= 3 union select * from v1; + +create or replace view v1 as select 2 + 3 <= 3, 2 + (3 <= 3), (2 + 3) <= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 + 3 <= 3, 2 + (3 <= 3), (2 + 3) <= 3 union select * from v1; + +create or replace view v1 as select 2 + 3 < 3, 2 + (3 < 3), (2 + 3) < 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 + 3 < 3, 2 + (3 < 3), (2 + 3) < 3 union select * from v1; + +create or replace view v1 as select 2 + 3 <> 3, 2 + (3 <> 3), (2 + 3) <> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 + 3 <> 3, 2 + (3 <> 3), (2 + 3) <> 3 union select * from v1; + +create or replace view v1 as select 2 + 3 > 3, 2 + (3 > 3), (2 + 3) > 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 + 3 > 3, 2 + (3 > 3), (2 + 3) > 3 union select * from v1; + +create or replace view v1 as select 2 + 3 != 3, 2 + (3 != 3), (2 + 3) != 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 + 3 != 3, 2 + (3 != 3), (2 + 3) != 3 union select * from v1; + +create or replace view v1 as select 2 + 3 LIKE 3, 2 + (3 LIKE 3), (2 + 3) LIKE 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 + 3 LIKE 3, 2 + (3 LIKE 3), (2 + 3) LIKE 3 union select * from v1; + +create or replace view v1 as select 2 + 3 REGEXP 3, 2 + (3 REGEXP 3), (2 + 3) REGEXP 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 + 3 REGEXP 3, 2 + (3 REGEXP 3), (2 + 3) REGEXP 3 union select * from v1; + +create or replace view v1 as select 2 + 3 | 3, 2 + (3 | 3), (2 + 3) | 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 + 3 | 3, 2 + (3 | 3), (2 + 3) | 3 union select * from v1; + +create or replace view v1 as select 2 + 3 & 3, 2 + (3 & 3), (2 + 3) & 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 + 3 & 3, 2 + (3 & 3), (2 + 3) & 3 union select * from v1; + +create or replace view v1 as select 2 + 3 << 3, 2 + (3 << 3), (2 + 3) << 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 + 3 << 3, 2 + (3 << 3), (2 + 3) << 3 union select * from v1; + +create or replace view v1 as select 2 + 3 >> 3, 2 + (3 >> 3), (2 + 3) >> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 + 3 >> 3, 2 + (3 >> 3), (2 + 3) >> 3 union select * from v1; + +create or replace view v1 as select 2 + '2000-01-01' +INTERVAL 1 DAY, 2 + ('2000-01-01' +INTERVAL 1 DAY), (2 + '2000-01-01') +INTERVAL 1 DAY; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 + '2000-01-01' +INTERVAL 1 DAY, 2 + ('2000-01-01' +INTERVAL 1 DAY), (2 + '2000-01-01') +INTERVAL 1 DAY union select * from v1; + +create or replace view v1 as select 2 + 3 * 3, 2 + (3 * 3), (2 + 3) * 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 + 3 * 3, 2 + (3 * 3), (2 + 3) * 3 union select * from v1; + +create or replace view v1 as select 2 + 3 / 3, 2 + (3 / 3), (2 + 3) / 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 + 3 / 3, 2 + (3 / 3), (2 + 3) / 3 union select * from v1; + +create or replace view v1 as select 2 + 3 DIV 3, 2 + (3 DIV 3), (2 + 3) DIV 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 + 3 DIV 3, 2 + (3 DIV 3), (2 + 3) DIV 3 union select * from v1; + +create or replace view v1 as select 2 + 1 MOD 3, 2 + (1 MOD 3), (2 + 1) MOD 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 + 1 MOD 3, 2 + (1 MOD 3), (2 + 1) MOD 3 union select * from v1; + +create or replace view v1 as select 2 + 1 % 3, 2 + (1 % 3), (2 + 1) % 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 + 1 % 3, 2 + (1 % 3), (2 + 1) % 3 union select * from v1; + +create or replace view v1 as select 2 + 3 ^ 3, 2 + (3 ^ 3), (2 + 3) ^ 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 + 3 ^ 3, 2 + (3 ^ 3), (2 + 3) ^ 3 union select * from v1; + +create or replace view v1 as select 2 + 3 BETWEEN 1 AND 3, 2 + (3 BETWEEN 1 AND 3), (2 + 3) BETWEEN 1 AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 + 3 BETWEEN 1 AND 3, 2 + (3 BETWEEN 1 AND 3), (2 + 3) BETWEEN 1 AND 3 union select * from v1; + +create or replace view v1 as select 2 - 3 IS FALSE, 2 - (3 IS FALSE), (2 - 3) IS FALSE; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 - 3 IS FALSE, 2 - (3 IS FALSE), (2 - 3) IS FALSE union select * from v1; + +create or replace view v1 as select charset(2 - 3 COLLATE latin1_bin), charset(2 - (3 COLLATE latin1_bin)), charset((2 - 3) COLLATE latin1_bin); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select charset(2 - 3 COLLATE latin1_bin), charset(2 - (3 COLLATE latin1_bin)), charset((2 - 3) COLLATE latin1_bin) union select * from v1; + +create or replace view v1 as select 2 - 3 IN (0,1), 2 - (3 IN (0,1)), (2 - 3) IN (0,1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 - 3 IN (0,1), 2 - (3 IN (0,1)), (2 - 3) IN (0,1) union select * from v1; + +create or replace view v1 as select 2 - 2 OR 0, 2 - (2 OR 0), (2 - 2) OR 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 - 2 OR 0, 2 - (2 OR 0), (2 - 2) OR 0 union select * from v1; + +create or replace view v1 as select 2 - 2 || 0, 2 - (2 || 0), (2 - 2) || 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 - 2 || 0, 2 - (2 || 0), (2 - 2) || 0 union select * from v1; + +create or replace view v1 as select 2 - 3 XOR 3, 2 - (3 XOR 3), (2 - 3) XOR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 - 3 XOR 3, 2 - (3 XOR 3), (2 - 3) XOR 3 union select * from v1; + +create or replace view v1 as select 2 - 2 AND 2, 2 - (2 AND 2), (2 - 2) AND 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 - 2 AND 2, 2 - (2 AND 2), (2 - 2) AND 2 union select * from v1; + +create or replace view v1 as select 2 - 2 && 2, 2 - (2 && 2), (2 - 2) && 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 - 2 && 2, 2 - (2 && 2), (2 - 2) && 2 union select * from v1; + +create or replace view v1 as select 2 - 3 = 3, 2 - (3 = 3), (2 - 3) = 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 - 3 = 3, 2 - (3 = 3), (2 - 3) = 3 union select * from v1; + +create or replace view v1 as select 2 - 3 <=> 3, 2 - (3 <=> 3), (2 - 3) <=> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 - 3 <=> 3, 2 - (3 <=> 3), (2 - 3) <=> 3 union select * from v1; + +create or replace view v1 as select 2 - 3 >= 3, 2 - (3 >= 3), (2 - 3) >= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 - 3 >= 3, 2 - (3 >= 3), (2 - 3) >= 3 union select * from v1; + +create or replace view v1 as select 2 - 3 <= 2, 2 - (3 <= 2), (2 - 3) <= 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 - 3 <= 2, 2 - (3 <= 2), (2 - 3) <= 2 union select * from v1; + +create or replace view v1 as select 2 - 3 < 3, 2 - (3 < 3), (2 - 3) < 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 - 3 < 3, 2 - (3 < 3), (2 - 3) < 3 union select * from v1; + +create or replace view v1 as select 2 - 3 <> 3, 2 - (3 <> 3), (2 - 3) <> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 - 3 <> 3, 2 - (3 <> 3), (2 - 3) <> 3 union select * from v1; + +create or replace view v1 as select 2 - 3 > 3, 2 - (3 > 3), (2 - 3) > 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 - 3 > 3, 2 - (3 > 3), (2 - 3) > 3 union select * from v1; + +create or replace view v1 as select 2 - 3 != 3, 2 - (3 != 3), (2 - 3) != 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 - 3 != 3, 2 - (3 != 3), (2 - 3) != 3 union select * from v1; + +create or replace view v1 as select 2 - 3 LIKE 3, 2 - (3 LIKE 3), (2 - 3) LIKE 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 - 3 LIKE 3, 2 - (3 LIKE 3), (2 - 3) LIKE 3 union select * from v1; + +create or replace view v1 as select 2 - 3 REGEXP 3, 2 - (3 REGEXP 3), (2 - 3) REGEXP 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 - 3 REGEXP 3, 2 - (3 REGEXP 3), (2 - 3) REGEXP 3 union select * from v1; + +create or replace view v1 as select 2 - 0 | 1, 2 - (0 | 1), (2 - 0) | 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 - 0 | 1, 2 - (0 | 1), (2 - 0) | 1 union select * from v1; + +create or replace view v1 as select 2 - 1 & 2, 2 - (1 & 2), (2 - 1) & 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 - 1 & 2, 2 - (1 & 2), (2 - 1) & 2 union select * from v1; + +create or replace view v1 as select 2 - 1 << 1, 2 - (1 << 1), (2 - 1) << 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 - 1 << 1, 2 - (1 << 1), (2 - 1) << 1 union select * from v1; + +create or replace view v1 as select 2 - 3 >> 3, 2 - (3 >> 3), (2 - 3) >> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 - 3 >> 3, 2 - (3 >> 3), (2 - 3) >> 3 union select * from v1; + +create or replace view v1 as select 2 - '2000-01-01' +INTERVAL 1 DAY, 2 - ('2000-01-01' +INTERVAL 1 DAY), (2 - '2000-01-01') +INTERVAL 1 DAY; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 - '2000-01-01' +INTERVAL 1 DAY, 2 - ('2000-01-01' +INTERVAL 1 DAY), (2 - '2000-01-01') +INTERVAL 1 DAY union select * from v1; + +create or replace view v1 as select 2 - 3 + 3, 2 - (3 + 3), (2 - 3) + 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 - 3 + 3, 2 - (3 + 3), (2 - 3) + 3 union select * from v1; + +create or replace view v1 as select 2 - 3 - 3, 2 - (3 - 3), (2 - 3) - 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 - 3 - 3, 2 - (3 - 3), (2 - 3) - 3 union select * from v1; + +create or replace view v1 as select 2 - 3 * 3, 2 - (3 * 3), (2 - 3) * 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 - 3 * 3, 2 - (3 * 3), (2 - 3) * 3 union select * from v1; + +create or replace view v1 as select 2 - 3 / 3, 2 - (3 / 3), (2 - 3) / 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 - 3 / 3, 2 - (3 / 3), (2 - 3) / 3 union select * from v1; + +create or replace view v1 as select 2 - 3 DIV 3, 2 - (3 DIV 3), (2 - 3) DIV 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 - 3 DIV 3, 2 - (3 DIV 3), (2 - 3) DIV 3 union select * from v1; + +create or replace view v1 as select 2 - 3 MOD 3, 2 - (3 MOD 3), (2 - 3) MOD 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 - 3 MOD 3, 2 - (3 MOD 3), (2 - 3) MOD 3 union select * from v1; + +create or replace view v1 as select 2 - 3 % 3, 2 - (3 % 3), (2 - 3) % 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 - 3 % 3, 2 - (3 % 3), (2 - 3) % 3 union select * from v1; + +create or replace view v1 as select 2 - 3 ^ 3, 2 - (3 ^ 3), (2 - 3) ^ 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 - 3 ^ 3, 2 - (3 ^ 3), (2 - 3) ^ 3 union select * from v1; + +create or replace view v1 as select 2 - 3 BETWEEN 1 AND 3, 2 - (3 BETWEEN 1 AND 3), (2 - 3) BETWEEN 1 AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 - 3 BETWEEN 1 AND 3, 2 - (3 BETWEEN 1 AND 3), (2 - 3) BETWEEN 1 AND 3 union select * from v1; + +create or replace view v1 as select 2 * 0 IS FALSE, 2 * (0 IS FALSE), (2 * 0) IS FALSE; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 * 0 IS FALSE, 2 * (0 IS FALSE), (2 * 0) IS FALSE union select * from v1; + +create or replace view v1 as select charset(2 * 3 COLLATE latin1_bin), charset(2 * (3 COLLATE latin1_bin)), charset((2 * 3) COLLATE latin1_bin); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select charset(2 * 3 COLLATE latin1_bin), charset(2 * (3 COLLATE latin1_bin)), charset((2 * 3) COLLATE latin1_bin) union select * from v1; + +create or replace view v1 as select 2 * 0 IN (0,1), 2 * (0 IN (0,1)), (2 * 0) IN (0,1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 * 0 IN (0,1), 2 * (0 IN (0,1)), (2 * 0) IN (0,1) union select * from v1; + +create or replace view v1 as select 2 * 3 OR 3, 2 * (3 OR 3), (2 * 3) OR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 * 3 OR 3, 2 * (3 OR 3), (2 * 3) OR 3 union select * from v1; + +create or replace view v1 as select 2 * 3 || 3, 2 * (3 || 3), (2 * 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 * 3 || 3, 2 * (3 || 3), (2 * 3) || 3 union select * from v1; + +create or replace view v1 as select 2 * 3 XOR 0, 2 * (3 XOR 0), (2 * 3) XOR 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 * 3 XOR 0, 2 * (3 XOR 0), (2 * 3) XOR 0 union select * from v1; + +create or replace view v1 as select 2 * 3 AND 3, 2 * (3 AND 3), (2 * 3) AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 * 3 AND 3, 2 * (3 AND 3), (2 * 3) AND 3 union select * from v1; + +create or replace view v1 as select 2 * 3 && 3, 2 * (3 && 3), (2 * 3) && 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 * 3 && 3, 2 * (3 && 3), (2 * 3) && 3 union select * from v1; + +create or replace view v1 as select 2 * 3 = 3, 2 * (3 = 3), (2 * 3) = 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 * 3 = 3, 2 * (3 = 3), (2 * 3) = 3 union select * from v1; + +create or replace view v1 as select 2 * 3 <=> 3, 2 * (3 <=> 3), (2 * 3) <=> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 * 3 <=> 3, 2 * (3 <=> 3), (2 * 3) <=> 3 union select * from v1; + +create or replace view v1 as select 2 * 3 >= 3, 2 * (3 >= 3), (2 * 3) >= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 * 3 >= 3, 2 * (3 >= 3), (2 * 3) >= 3 union select * from v1; + +create or replace view v1 as select 2 * 3 <= 3, 2 * (3 <= 3), (2 * 3) <= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 * 3 <= 3, 2 * (3 <= 3), (2 * 3) <= 3 union select * from v1; + +create or replace view v1 as select 2 * 0 < 3, 2 * (0 < 3), (2 * 0) < 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 * 0 < 3, 2 * (0 < 3), (2 * 0) < 3 union select * from v1; + +create or replace view v1 as select 2 * 3 <> 3, 2 * (3 <> 3), (2 * 3) <> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 * 3 <> 3, 2 * (3 <> 3), (2 * 3) <> 3 union select * from v1; + +create or replace view v1 as select 2 * 3 > 3, 2 * (3 > 3), (2 * 3) > 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 * 3 > 3, 2 * (3 > 3), (2 * 3) > 3 union select * from v1; + +create or replace view v1 as select 2 * 3 != 3, 2 * (3 != 3), (2 * 3) != 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 * 3 != 3, 2 * (3 != 3), (2 * 3) != 3 union select * from v1; + +create or replace view v1 as select 2 * 3 LIKE 3, 2 * (3 LIKE 3), (2 * 3) LIKE 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 * 3 LIKE 3, 2 * (3 LIKE 3), (2 * 3) LIKE 3 union select * from v1; + +create or replace view v1 as select 2 * 3 REGEXP 3, 2 * (3 REGEXP 3), (2 * 3) REGEXP 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 * 3 REGEXP 3, 2 * (3 REGEXP 3), (2 * 3) REGEXP 3 union select * from v1; + +create or replace view v1 as select 2 * 3 | 3, 2 * (3 | 3), (2 * 3) | 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 * 3 | 3, 2 * (3 | 3), (2 * 3) | 3 union select * from v1; + +create or replace view v1 as select 2 * 3 & 3, 2 * (3 & 3), (2 * 3) & 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 * 3 & 3, 2 * (3 & 3), (2 * 3) & 3 union select * from v1; + +create or replace view v1 as select 2 * 3 >> 2, 2 * (3 >> 2), (2 * 3) >> 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 * 3 >> 2, 2 * (3 >> 2), (2 * 3) >> 2 union select * from v1; + +create or replace view v1 as select 2 * '2000-01-01' +INTERVAL 1 DAY, 2 * ('2000-01-01' +INTERVAL 1 DAY), (2 * '2000-01-01') +INTERVAL 1 DAY; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 * '2000-01-01' +INTERVAL 1 DAY, 2 * ('2000-01-01' +INTERVAL 1 DAY), (2 * '2000-01-01') +INTERVAL 1 DAY union select * from v1; + +create or replace view v1 as select 2 * 3 + 3, 2 * (3 + 3), (2 * 3) + 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 * 3 + 3, 2 * (3 + 3), (2 * 3) + 3 union select * from v1; + +create or replace view v1 as select 2 * 3 - 3, 2 * (3 - 3), (2 * 3) - 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 * 3 - 3, 2 * (3 - 3), (2 * 3) - 3 union select * from v1; + +create or replace view v1 as select 2 * 3 DIV 2, 2 * (3 DIV 2), (2 * 3) DIV 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 * 3 DIV 2, 2 * (3 DIV 2), (2 * 3) DIV 2 union select * from v1; + +create or replace view v1 as select 2 * 3 MOD 2, 2 * (3 MOD 2), (2 * 3) MOD 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 * 3 MOD 2, 2 * (3 MOD 2), (2 * 3) MOD 2 union select * from v1; + +create or replace view v1 as select 2 * 3 % 2, 2 * (3 % 2), (2 * 3) % 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 * 3 % 2, 2 * (3 % 2), (2 * 3) % 2 union select * from v1; + +create or replace view v1 as select 2 * 3 ^ 3, 2 * (3 ^ 3), (2 * 3) ^ 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 * 3 ^ 3, 2 * (3 ^ 3), (2 * 3) ^ 3 union select * from v1; + +create or replace view v1 as select 2 * 3 BETWEEN 1 AND 3, 2 * (3 BETWEEN 1 AND 3), (2 * 3) BETWEEN 1 AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 * 3 BETWEEN 1 AND 3, 2 * (3 BETWEEN 1 AND 3), (2 * 3) BETWEEN 1 AND 3 union select * from v1; + +create or replace view v1 as select 2 / 3 IS FALSE, 2 / (3 IS FALSE), (2 / 3) IS FALSE; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 / 3 IS FALSE, 2 / (3 IS FALSE), (2 / 3) IS FALSE union select * from v1; + +create or replace view v1 as select charset(2 / 3 COLLATE latin1_bin), charset(2 / (3 COLLATE latin1_bin)), charset((2 / 3) COLLATE latin1_bin); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select charset(2 / 3 COLLATE latin1_bin), charset(2 / (3 COLLATE latin1_bin)), charset((2 / 3) COLLATE latin1_bin) union select * from v1; + +create or replace view v1 as select 2 / 3 IN (0,1), 2 / (3 IN (0,1)), (2 / 3) IN (0,1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 / 3 IN (0,1), 2 / (3 IN (0,1)), (2 / 3) IN (0,1) union select * from v1; + +create or replace view v1 as select 2 / 3 OR 3, 2 / (3 OR 3), (2 / 3) OR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 / 3 OR 3, 2 / (3 OR 3), (2 / 3) OR 3 union select * from v1; + +create or replace view v1 as select 2 / 3 || 3, 2 / (3 || 3), (2 / 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 / 3 || 3, 2 / (3 || 3), (2 / 3) || 3 union select * from v1; + +create or replace view v1 as select 2 / 3 XOR 3, 2 / (3 XOR 3), (2 / 3) XOR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 / 3 XOR 3, 2 / (3 XOR 3), (2 / 3) XOR 3 union select * from v1; + +create or replace view v1 as select 2 / 3 AND 3, 2 / (3 AND 3), (2 / 3) AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 / 3 AND 3, 2 / (3 AND 3), (2 / 3) AND 3 union select * from v1; + +create or replace view v1 as select 2 / 3 && 3, 2 / (3 && 3), (2 / 3) && 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 / 3 && 3, 2 / (3 && 3), (2 / 3) && 3 union select * from v1; + +create or replace view v1 as select 2 / 3 = 3, 2 / (3 = 3), (2 / 3) = 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 / 3 = 3, 2 / (3 = 3), (2 / 3) = 3 union select * from v1; + +create or replace view v1 as select 2 / 3 <=> 3, 2 / (3 <=> 3), (2 / 3) <=> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 / 3 <=> 3, 2 / (3 <=> 3), (2 / 3) <=> 3 union select * from v1; + +create or replace view v1 as select 2 / 3 >= 3, 2 / (3 >= 3), (2 / 3) >= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 / 3 >= 3, 2 / (3 >= 3), (2 / 3) >= 3 union select * from v1; + +create or replace view v1 as select 2 / 3 <= 3, 2 / (3 <= 3), (2 / 3) <= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 / 3 <= 3, 2 / (3 <= 3), (2 / 3) <= 3 union select * from v1; + +create or replace view v1 as select 2 / 3 < 3, 2 / (3 < 3), (2 / 3) < 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 / 3 < 3, 2 / (3 < 3), (2 / 3) < 3 union select * from v1; + +create or replace view v1 as select 2 / 3 <> 3, 2 / (3 <> 3), (2 / 3) <> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 / 3 <> 3, 2 / (3 <> 3), (2 / 3) <> 3 union select * from v1; + +create or replace view v1 as select 2 / 3 > 3, 2 / (3 > 3), (2 / 3) > 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 / 3 > 3, 2 / (3 > 3), (2 / 3) > 3 union select * from v1; + +create or replace view v1 as select 2 / 3 != 3, 2 / (3 != 3), (2 / 3) != 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 / 3 != 3, 2 / (3 != 3), (2 / 3) != 3 union select * from v1; + +create or replace view v1 as select 2 / 3 LIKE 3, 2 / (3 LIKE 3), (2 / 3) LIKE 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 / 3 LIKE 3, 2 / (3 LIKE 3), (2 / 3) LIKE 3 union select * from v1; + +create or replace view v1 as select 2 / 3 REGEXP 3, 2 / (3 REGEXP 3), (2 / 3) REGEXP 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 / 3 REGEXP 3, 2 / (3 REGEXP 3), (2 / 3) REGEXP 3 union select * from v1; + +create or replace view v1 as select 2 / 3 | 3, 2 / (3 | 3), (2 / 3) | 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 / 3 | 3, 2 / (3 | 3), (2 / 3) | 3 union select * from v1; + +create or replace view v1 as select 2 / 3 & 3, 2 / (3 & 3), (2 / 3) & 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 / 3 & 3, 2 / (3 & 3), (2 / 3) & 3 union select * from v1; + +create or replace view v1 as select 2 / 3 << 3, 2 / (3 << 3), (2 / 3) << 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 / 3 << 3, 2 / (3 << 3), (2 / 3) << 3 union select * from v1; + +create or replace view v1 as select 2 / 3 >> 3, 2 / (3 >> 3), (2 / 3) >> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 / 3 >> 3, 2 / (3 >> 3), (2 / 3) >> 3 union select * from v1; + +create or replace view v1 as select 2 / '2000-01-01' +INTERVAL 1 DAY, 2 / ('2000-01-01' +INTERVAL 1 DAY), (2 / '2000-01-01') +INTERVAL 1 DAY; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 / '2000-01-01' +INTERVAL 1 DAY, 2 / ('2000-01-01' +INTERVAL 1 DAY), (2 / '2000-01-01') +INTERVAL 1 DAY union select * from v1; + +create or replace view v1 as select 2 / 3 + 3, 2 / (3 + 3), (2 / 3) + 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 / 3 + 3, 2 / (3 + 3), (2 / 3) + 3 union select * from v1; + +create or replace view v1 as select 2 / 3 - 3, 2 / (3 - 3), (2 / 3) - 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 / 3 - 3, 2 / (3 - 3), (2 / 3) - 3 union select * from v1; + +create or replace view v1 as select 2 / 3 * 3, 2 / (3 * 3), (2 / 3) * 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 / 3 * 3, 2 / (3 * 3), (2 / 3) * 3 union select * from v1; + +create or replace view v1 as select 2 / 3 / 3, 2 / (3 / 3), (2 / 3) / 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 / 3 / 3, 2 / (3 / 3), (2 / 3) / 3 union select * from v1; + +create or replace view v1 as select 2 / 3 DIV 3, 2 / (3 DIV 3), (2 / 3) DIV 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 / 3 DIV 3, 2 / (3 DIV 3), (2 / 3) DIV 3 union select * from v1; + +create or replace view v1 as select 2 / 3 MOD 3, 2 / (3 MOD 3), (2 / 3) MOD 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 / 3 MOD 3, 2 / (3 MOD 3), (2 / 3) MOD 3 union select * from v1; + +create or replace view v1 as select 2 / 3 % 3, 2 / (3 % 3), (2 / 3) % 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 / 3 % 3, 2 / (3 % 3), (2 / 3) % 3 union select * from v1; + +create or replace view v1 as select 2 / 3 ^ 3, 2 / (3 ^ 3), (2 / 3) ^ 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 / 3 ^ 3, 2 / (3 ^ 3), (2 / 3) ^ 3 union select * from v1; + +create or replace view v1 as select 2 / 3 BETWEEN 1 AND 3, 2 / (3 BETWEEN 1 AND 3), (2 / 3) BETWEEN 1 AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 / 3 BETWEEN 1 AND 3, 2 / (3 BETWEEN 1 AND 3), (2 / 3) BETWEEN 1 AND 3 union select * from v1; + +create or replace view v1 as select 2 DIV 3 IS FALSE, 2 DIV (3 IS FALSE), (2 DIV 3) IS FALSE; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 DIV 3 IS FALSE, 2 DIV (3 IS FALSE), (2 DIV 3) IS FALSE union select * from v1; + +create or replace view v1 as select charset(2 DIV 3 COLLATE latin1_bin), charset(2 DIV (3 COLLATE latin1_bin)), charset((2 DIV 3) COLLATE latin1_bin); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select charset(2 DIV 3 COLLATE latin1_bin), charset(2 DIV (3 COLLATE latin1_bin)), charset((2 DIV 3) COLLATE latin1_bin) union select * from v1; + +create or replace view v1 as select 2 DIV 3 IN (0,1), 2 DIV (3 IN (0,1)), (2 DIV 3) IN (0,1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 DIV 3 IN (0,1), 2 DIV (3 IN (0,1)), (2 DIV 3) IN (0,1) union select * from v1; + +create or replace view v1 as select 2 DIV 3 OR 3, 2 DIV (3 OR 3), (2 DIV 3) OR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 DIV 3 OR 3, 2 DIV (3 OR 3), (2 DIV 3) OR 3 union select * from v1; + +create or replace view v1 as select 2 DIV 3 || 3, 2 DIV (3 || 3), (2 DIV 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 DIV 3 || 3, 2 DIV (3 || 3), (2 DIV 3) || 3 union select * from v1; + +create or replace view v1 as select 2 DIV 3 XOR 3, 2 DIV (3 XOR 3), (2 DIV 3) XOR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 DIV 3 XOR 3, 2 DIV (3 XOR 3), (2 DIV 3) XOR 3 union select * from v1; + +create or replace view v1 as select 2 DIV 3 AND 3, 2 DIV (3 AND 3), (2 DIV 3) AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 DIV 3 AND 3, 2 DIV (3 AND 3), (2 DIV 3) AND 3 union select * from v1; + +create or replace view v1 as select 2 DIV 3 && 3, 2 DIV (3 && 3), (2 DIV 3) && 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 DIV 3 && 3, 2 DIV (3 && 3), (2 DIV 3) && 3 union select * from v1; + +create or replace view v1 as select 2 DIV 3 = 3, 2 DIV (3 = 3), (2 DIV 3) = 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 DIV 3 = 3, 2 DIV (3 = 3), (2 DIV 3) = 3 union select * from v1; + +create or replace view v1 as select 2 DIV 3 <=> 3, 2 DIV (3 <=> 3), (2 DIV 3) <=> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 DIV 3 <=> 3, 2 DIV (3 <=> 3), (2 DIV 3) <=> 3 union select * from v1; + +create or replace view v1 as select 2 DIV 3 >= 3, 2 DIV (3 >= 3), (2 DIV 3) >= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 DIV 3 >= 3, 2 DIV (3 >= 3), (2 DIV 3) >= 3 union select * from v1; + +create or replace view v1 as select 2 DIV 3 <= 3, 2 DIV (3 <= 3), (2 DIV 3) <= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 DIV 3 <= 3, 2 DIV (3 <= 3), (2 DIV 3) <= 3 union select * from v1; + +create or replace view v1 as select 2 DIV 3 < 3, 2 DIV (3 < 3), (2 DIV 3) < 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 DIV 3 < 3, 2 DIV (3 < 3), (2 DIV 3) < 3 union select * from v1; + +create or replace view v1 as select 2 DIV 3 <> 3, 2 DIV (3 <> 3), (2 DIV 3) <> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 DIV 3 <> 3, 2 DIV (3 <> 3), (2 DIV 3) <> 3 union select * from v1; + +create or replace view v1 as select 2 DIV 3 > 3, 2 DIV (3 > 3), (2 DIV 3) > 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 DIV 3 > 3, 2 DIV (3 > 3), (2 DIV 3) > 3 union select * from v1; + +create or replace view v1 as select 2 DIV 3 != 3, 2 DIV (3 != 3), (2 DIV 3) != 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 DIV 3 != 3, 2 DIV (3 != 3), (2 DIV 3) != 3 union select * from v1; + +create or replace view v1 as select 2 DIV 3 LIKE 3, 2 DIV (3 LIKE 3), (2 DIV 3) LIKE 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 DIV 3 LIKE 3, 2 DIV (3 LIKE 3), (2 DIV 3) LIKE 3 union select * from v1; + +create or replace view v1 as select 2 DIV 3 REGEXP 3, 2 DIV (3 REGEXP 3), (2 DIV 3) REGEXP 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 DIV 3 REGEXP 3, 2 DIV (3 REGEXP 3), (2 DIV 3) REGEXP 3 union select * from v1; + +create or replace view v1 as select 2 DIV 3 | 3, 2 DIV (3 | 3), (2 DIV 3) | 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 DIV 3 | 3, 2 DIV (3 | 3), (2 DIV 3) | 3 union select * from v1; + +create or replace view v1 as select 2 DIV 3 & 1, 2 DIV (3 & 1), (2 DIV 3) & 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 DIV 3 & 1, 2 DIV (3 & 1), (2 DIV 3) & 1 union select * from v1; + +create or replace view v1 as select 4 DIV 3 << 3, 4 DIV (3 << 3), (4 DIV 3) << 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 4 DIV 3 << 3, 4 DIV (3 << 3), (4 DIV 3) << 3 union select * from v1; + +create or replace view v1 as select 2 DIV 3 >> 3, 2 DIV (3 >> 3), (2 DIV 3) >> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 DIV 3 >> 3, 2 DIV (3 >> 3), (2 DIV 3) >> 3 union select * from v1; + +create or replace view v1 as select 2 DIV '2000-01-01' +INTERVAL 1 DAY, 2 DIV ('2000-01-01' +INTERVAL 1 DAY), (2 DIV '2000-01-01') +INTERVAL 1 DAY; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 DIV '2000-01-01' +INTERVAL 1 DAY, 2 DIV ('2000-01-01' +INTERVAL 1 DAY), (2 DIV '2000-01-01') +INTERVAL 1 DAY union select * from v1; + +create or replace view v1 as select 2 DIV 3 + 3, 2 DIV (3 + 3), (2 DIV 3) + 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 DIV 3 + 3, 2 DIV (3 + 3), (2 DIV 3) + 3 union select * from v1; + +create or replace view v1 as select 2 DIV 3 - 3, 2 DIV (3 - 3), (2 DIV 3) - 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 DIV 3 - 3, 2 DIV (3 - 3), (2 DIV 3) - 3 union select * from v1; + +create or replace view v1 as select 4 DIV 3 * 3, 4 DIV (3 * 3), (4 DIV 3) * 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 4 DIV 3 * 3, 4 DIV (3 * 3), (4 DIV 3) * 3 union select * from v1; + +create or replace view v1 as select 2 DIV 3 / 3, 2 DIV (3 / 3), (2 DIV 3) / 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 DIV 3 / 3, 2 DIV (3 / 3), (2 DIV 3) / 3 union select * from v1; + +create or replace view v1 as select 2 DIV 3 DIV 3, 2 DIV (3 DIV 3), (2 DIV 3) DIV 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 DIV 3 DIV 3, 2 DIV (3 DIV 3), (2 DIV 3) DIV 3 union select * from v1; + +create or replace view v1 as select 2 DIV 3 MOD 3, 2 DIV (3 MOD 3), (2 DIV 3) MOD 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 DIV 3 MOD 3, 2 DIV (3 MOD 3), (2 DIV 3) MOD 3 union select * from v1; + +create or replace view v1 as select 2 DIV 3 % 3, 2 DIV (3 % 3), (2 DIV 3) % 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 DIV 3 % 3, 2 DIV (3 % 3), (2 DIV 3) % 3 union select * from v1; + +create or replace view v1 as select 2 DIV 3 ^ 3, 2 DIV (3 ^ 3), (2 DIV 3) ^ 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 DIV 3 ^ 3, 2 DIV (3 ^ 3), (2 DIV 3) ^ 3 union select * from v1; + +create or replace view v1 as select 2 DIV 3 BETWEEN 1 AND 3, 2 DIV (3 BETWEEN 1 AND 3), (2 DIV 3) BETWEEN 1 AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 DIV 3 BETWEEN 1 AND 3, 2 DIV (3 BETWEEN 1 AND 3), (2 DIV 3) BETWEEN 1 AND 3 union select * from v1; + +create or replace view v1 as select 2 MOD 3 IS FALSE, 2 MOD (3 IS FALSE), (2 MOD 3) IS FALSE; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 MOD 3 IS FALSE, 2 MOD (3 IS FALSE), (2 MOD 3) IS FALSE union select * from v1; + +create or replace view v1 as select charset(2 MOD 3 COLLATE latin1_bin), charset(2 MOD (3 COLLATE latin1_bin)), charset((2 MOD 3) COLLATE latin1_bin); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select charset(2 MOD 3 COLLATE latin1_bin), charset(2 MOD (3 COLLATE latin1_bin)), charset((2 MOD 3) COLLATE latin1_bin) union select * from v1; + +create or replace view v1 as select 2 MOD 3 IN (0,1), 2 MOD (3 IN (0,1)), (2 MOD 3) IN (0,1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 MOD 3 IN (0,1), 2 MOD (3 IN (0,1)), (2 MOD 3) IN (0,1) union select * from v1; + +create or replace view v1 as select 2 MOD 3 OR 3, 2 MOD (3 OR 3), (2 MOD 3) OR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 MOD 3 OR 3, 2 MOD (3 OR 3), (2 MOD 3) OR 3 union select * from v1; + +create or replace view v1 as select 2 MOD 3 || 3, 2 MOD (3 || 3), (2 MOD 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 MOD 3 || 3, 2 MOD (3 || 3), (2 MOD 3) || 3 union select * from v1; + +create or replace view v1 as select 2 MOD 3 XOR 3, 2 MOD (3 XOR 3), (2 MOD 3) XOR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 MOD 3 XOR 3, 2 MOD (3 XOR 3), (2 MOD 3) XOR 3 union select * from v1; + +create or replace view v1 as select 2 MOD 3 AND 3, 2 MOD (3 AND 3), (2 MOD 3) AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 MOD 3 AND 3, 2 MOD (3 AND 3), (2 MOD 3) AND 3 union select * from v1; + +create or replace view v1 as select 2 MOD 3 && 3, 2 MOD (3 && 3), (2 MOD 3) && 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 MOD 3 && 3, 2 MOD (3 && 3), (2 MOD 3) && 3 union select * from v1; + +create or replace view v1 as select 2 MOD 3 = 2, 2 MOD (3 = 2), (2 MOD 3) = 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 MOD 3 = 2, 2 MOD (3 = 2), (2 MOD 3) = 2 union select * from v1; + +create or replace view v1 as select 2 MOD 3 <=> 2, 2 MOD (3 <=> 2), (2 MOD 3) <=> 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 MOD 3 <=> 2, 2 MOD (3 <=> 2), (2 MOD 3) <=> 2 union select * from v1; + +create or replace view v1 as select 2 MOD 3 >= 1, 2 MOD (3 >= 1), (2 MOD 3) >= 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 MOD 3 >= 1, 2 MOD (3 >= 1), (2 MOD 3) >= 1 union select * from v1; + +create or replace view v1 as select 2 MOD 3 <= 3, 2 MOD (3 <= 3), (2 MOD 3) <= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 MOD 3 <= 3, 2 MOD (3 <= 3), (2 MOD 3) <= 3 union select * from v1; + +create or replace view v1 as select 2 MOD 3 < 3, 2 MOD (3 < 3), (2 MOD 3) < 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 MOD 3 < 3, 2 MOD (3 < 3), (2 MOD 3) < 3 union select * from v1; + +create or replace view v1 as select 2 MOD 3 <> 3, 2 MOD (3 <> 3), (2 MOD 3) <> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 MOD 3 <> 3, 2 MOD (3 <> 3), (2 MOD 3) <> 3 union select * from v1; + +create or replace view v1 as select 2 MOD 3 > 3, 2 MOD (3 > 3), (2 MOD 3) > 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 MOD 3 > 3, 2 MOD (3 > 3), (2 MOD 3) > 3 union select * from v1; + +create or replace view v1 as select 2 MOD 3 != 3, 2 MOD (3 != 3), (2 MOD 3) != 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 MOD 3 != 3, 2 MOD (3 != 3), (2 MOD 3) != 3 union select * from v1; + +create or replace view v1 as select 2 MOD 3 LIKE 2, 2 MOD (3 LIKE 2), (2 MOD 3) LIKE 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 MOD 3 LIKE 2, 2 MOD (3 LIKE 2), (2 MOD 3) LIKE 2 union select * from v1; + +create or replace view v1 as select 2 MOD 3 REGEXP 2, 2 MOD (3 REGEXP 2), (2 MOD 3) REGEXP 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 MOD 3 REGEXP 2, 2 MOD (3 REGEXP 2), (2 MOD 3) REGEXP 2 union select * from v1; + +create or replace view v1 as select 2 MOD 3 | 3, 2 MOD (3 | 3), (2 MOD 3) | 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 MOD 3 | 3, 2 MOD (3 | 3), (2 MOD 3) | 3 union select * from v1; + +create or replace view v1 as select 2 MOD 4 & 4, 2 MOD (4 & 4), (2 MOD 4) & 4; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 MOD 4 & 4, 2 MOD (4 & 4), (2 MOD 4) & 4 union select * from v1; + +create or replace view v1 as select 2 MOD 3 << 3, 2 MOD (3 << 3), (2 MOD 3) << 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 MOD 3 << 3, 2 MOD (3 << 3), (2 MOD 3) << 3 union select * from v1; + +create or replace view v1 as select 2 MOD 3 >> 3, 2 MOD (3 >> 3), (2 MOD 3) >> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 MOD 3 >> 3, 2 MOD (3 >> 3), (2 MOD 3) >> 3 union select * from v1; + +create or replace view v1 as select 2 MOD '2000-01-01' +INTERVAL 1 DAY, 2 MOD ('2000-01-01' +INTERVAL 1 DAY), (2 MOD '2000-01-01') +INTERVAL 1 DAY; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 MOD '2000-01-01' +INTERVAL 1 DAY, 2 MOD ('2000-01-01' +INTERVAL 1 DAY), (2 MOD '2000-01-01') +INTERVAL 1 DAY union select * from v1; + +create or replace view v1 as select 2 MOD 3 + 3, 2 MOD (3 + 3), (2 MOD 3) + 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 MOD 3 + 3, 2 MOD (3 + 3), (2 MOD 3) + 3 union select * from v1; + +create or replace view v1 as select 2 MOD 3 - 3, 2 MOD (3 - 3), (2 MOD 3) - 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 MOD 3 - 3, 2 MOD (3 - 3), (2 MOD 3) - 3 union select * from v1; + +create or replace view v1 as select 2 MOD 3 * 3, 2 MOD (3 * 3), (2 MOD 3) * 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 MOD 3 * 3, 2 MOD (3 * 3), (2 MOD 3) * 3 union select * from v1; + +create or replace view v1 as select 2 MOD 3 / 3, 2 MOD (3 / 3), (2 MOD 3) / 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 MOD 3 / 3, 2 MOD (3 / 3), (2 MOD 3) / 3 union select * from v1; + +create or replace view v1 as select 3 MOD 4 DIV 3, 3 MOD (4 DIV 3), (3 MOD 4) DIV 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 3 MOD 4 DIV 3, 3 MOD (4 DIV 3), (3 MOD 4) DIV 3 union select * from v1; + +create or replace view v1 as select 2 MOD 3 MOD 3, 2 MOD (3 MOD 3), (2 MOD 3) MOD 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 MOD 3 MOD 3, 2 MOD (3 MOD 3), (2 MOD 3) MOD 3 union select * from v1; + +create or replace view v1 as select 2 MOD 3 % 3, 2 MOD (3 % 3), (2 MOD 3) % 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 MOD 3 % 3, 2 MOD (3 % 3), (2 MOD 3) % 3 union select * from v1; + +create or replace view v1 as select 2 MOD 3 ^ 3, 2 MOD (3 ^ 3), (2 MOD 3) ^ 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 MOD 3 ^ 3, 2 MOD (3 ^ 3), (2 MOD 3) ^ 3 union select * from v1; + +create or replace view v1 as select 2 MOD 3 BETWEEN 1 AND 3, 2 MOD (3 BETWEEN 1 AND 3), (2 MOD 3) BETWEEN 1 AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 MOD 3 BETWEEN 1 AND 3, 2 MOD (3 BETWEEN 1 AND 3), (2 MOD 3) BETWEEN 1 AND 3 union select * from v1; + +create or replace view v1 as select 2 % 3 IS FALSE, 2 % (3 IS FALSE), (2 % 3) IS FALSE; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 % 3 IS FALSE, 2 % (3 IS FALSE), (2 % 3) IS FALSE union select * from v1; + +create or replace view v1 as select charset(2 % 3 COLLATE latin1_bin), charset(2 % (3 COLLATE latin1_bin)), charset((2 % 3) COLLATE latin1_bin); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select charset(2 % 3 COLLATE latin1_bin), charset(2 % (3 COLLATE latin1_bin)), charset((2 % 3) COLLATE latin1_bin) union select * from v1; + +create or replace view v1 as select 2 % 3 IN (0,1), 2 % (3 IN (0,1)), (2 % 3) IN (0,1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 % 3 IN (0,1), 2 % (3 IN (0,1)), (2 % 3) IN (0,1) union select * from v1; + +create or replace view v1 as select 2 % 3 OR 3, 2 % (3 OR 3), (2 % 3) OR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 % 3 OR 3, 2 % (3 OR 3), (2 % 3) OR 3 union select * from v1; + +create or replace view v1 as select 2 % 3 || 3, 2 % (3 || 3), (2 % 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 % 3 || 3, 2 % (3 || 3), (2 % 3) || 3 union select * from v1; + +create or replace view v1 as select 2 % 3 XOR 3, 2 % (3 XOR 3), (2 % 3) XOR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 % 3 XOR 3, 2 % (3 XOR 3), (2 % 3) XOR 3 union select * from v1; + +create or replace view v1 as select 2 % 3 AND 3, 2 % (3 AND 3), (2 % 3) AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 % 3 AND 3, 2 % (3 AND 3), (2 % 3) AND 3 union select * from v1; + +create or replace view v1 as select 2 % 3 && 3, 2 % (3 && 3), (2 % 3) && 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 % 3 && 3, 2 % (3 && 3), (2 % 3) && 3 union select * from v1; + +create or replace view v1 as select 2 % 3 = 2, 2 % (3 = 2), (2 % 3) = 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 % 3 = 2, 2 % (3 = 2), (2 % 3) = 2 union select * from v1; + +create or replace view v1 as select 2 % 3 <=> 2, 2 % (3 <=> 2), (2 % 3) <=> 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 % 3 <=> 2, 2 % (3 <=> 2), (2 % 3) <=> 2 union select * from v1; + +create or replace view v1 as select 2 % 3 >= 1, 2 % (3 >= 1), (2 % 3) >= 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 % 3 >= 1, 2 % (3 >= 1), (2 % 3) >= 1 union select * from v1; + +create or replace view v1 as select 2 % 3 <= 3, 2 % (3 <= 3), (2 % 3) <= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 % 3 <= 3, 2 % (3 <= 3), (2 % 3) <= 3 union select * from v1; + +create or replace view v1 as select 2 % 3 < 3, 2 % (3 < 3), (2 % 3) < 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 % 3 < 3, 2 % (3 < 3), (2 % 3) < 3 union select * from v1; + +create or replace view v1 as select 2 % 3 <> 3, 2 % (3 <> 3), (2 % 3) <> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 % 3 <> 3, 2 % (3 <> 3), (2 % 3) <> 3 union select * from v1; + +create or replace view v1 as select 2 % 3 > 3, 2 % (3 > 3), (2 % 3) > 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 % 3 > 3, 2 % (3 > 3), (2 % 3) > 3 union select * from v1; + +create or replace view v1 as select 2 % 3 != 3, 2 % (3 != 3), (2 % 3) != 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 % 3 != 3, 2 % (3 != 3), (2 % 3) != 3 union select * from v1; + +create or replace view v1 as select 2 % 3 LIKE 2, 2 % (3 LIKE 2), (2 % 3) LIKE 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 % 3 LIKE 2, 2 % (3 LIKE 2), (2 % 3) LIKE 2 union select * from v1; + +create or replace view v1 as select 2 % 3 REGEXP 2, 2 % (3 REGEXP 2), (2 % 3) REGEXP 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 % 3 REGEXP 2, 2 % (3 REGEXP 2), (2 % 3) REGEXP 2 union select * from v1; + +create or replace view v1 as select 2 % 3 | 3, 2 % (3 | 3), (2 % 3) | 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 % 3 | 3, 2 % (3 | 3), (2 % 3) | 3 union select * from v1; + +create or replace view v1 as select 2 % 4 & 4, 2 % (4 & 4), (2 % 4) & 4; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 % 4 & 4, 2 % (4 & 4), (2 % 4) & 4 union select * from v1; + +create or replace view v1 as select 2 % 3 << 3, 2 % (3 << 3), (2 % 3) << 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 % 3 << 3, 2 % (3 << 3), (2 % 3) << 3 union select * from v1; + +create or replace view v1 as select 2 % 3 >> 3, 2 % (3 >> 3), (2 % 3) >> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 % 3 >> 3, 2 % (3 >> 3), (2 % 3) >> 3 union select * from v1; + +create or replace view v1 as select 2 % '2000-01-01' +INTERVAL 1 DAY, 2 % ('2000-01-01' +INTERVAL 1 DAY), (2 % '2000-01-01') +INTERVAL 1 DAY; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 % '2000-01-01' +INTERVAL 1 DAY, 2 % ('2000-01-01' +INTERVAL 1 DAY), (2 % '2000-01-01') +INTERVAL 1 DAY union select * from v1; + +create or replace view v1 as select 2 % 3 + 3, 2 % (3 + 3), (2 % 3) + 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 % 3 + 3, 2 % (3 + 3), (2 % 3) + 3 union select * from v1; + +create or replace view v1 as select 2 % 3 - 3, 2 % (3 - 3), (2 % 3) - 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 % 3 - 3, 2 % (3 - 3), (2 % 3) - 3 union select * from v1; + +create or replace view v1 as select 2 % 3 * 3, 2 % (3 * 3), (2 % 3) * 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 % 3 * 3, 2 % (3 * 3), (2 % 3) * 3 union select * from v1; + +create or replace view v1 as select 2 % 3 / 3, 2 % (3 / 3), (2 % 3) / 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 % 3 / 3, 2 % (3 / 3), (2 % 3) / 3 union select * from v1; + +create or replace view v1 as select 3 % 4 DIV 3, 3 % (4 DIV 3), (3 % 4) DIV 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 3 % 4 DIV 3, 3 % (4 DIV 3), (3 % 4) DIV 3 union select * from v1; + +create or replace view v1 as select 2 % 3 MOD 3, 2 % (3 MOD 3), (2 % 3) MOD 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 % 3 MOD 3, 2 % (3 MOD 3), (2 % 3) MOD 3 union select * from v1; + +create or replace view v1 as select 2 % 3 % 3, 2 % (3 % 3), (2 % 3) % 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 % 3 % 3, 2 % (3 % 3), (2 % 3) % 3 union select * from v1; + +create or replace view v1 as select 2 % 3 ^ 3, 2 % (3 ^ 3), (2 % 3) ^ 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 % 3 ^ 3, 2 % (3 ^ 3), (2 % 3) ^ 3 union select * from v1; + +create or replace view v1 as select 2 % 3 BETWEEN 1 AND 3, 2 % (3 BETWEEN 1 AND 3), (2 % 3) BETWEEN 1 AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 % 3 BETWEEN 1 AND 3, 2 % (3 BETWEEN 1 AND 3), (2 % 3) BETWEEN 1 AND 3 union select * from v1; + +create or replace view v1 as select 2 ^ 3 IS FALSE, 2 ^ (3 IS FALSE), (2 ^ 3) IS FALSE; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 ^ 3 IS FALSE, 2 ^ (3 IS FALSE), (2 ^ 3) IS FALSE union select * from v1; + +create or replace view v1 as select charset(2 ^ 3 COLLATE latin1_bin), charset(2 ^ (3 COLLATE latin1_bin)), charset((2 ^ 3) COLLATE latin1_bin); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select charset(2 ^ 3 COLLATE latin1_bin), charset(2 ^ (3 COLLATE latin1_bin)), charset((2 ^ 3) COLLATE latin1_bin) union select * from v1; + +create or replace view v1 as select 2 ^ 3 IN (0,1), 2 ^ (3 IN (0,1)), (2 ^ 3) IN (0,1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 ^ 3 IN (0,1), 2 ^ (3 IN (0,1)), (2 ^ 3) IN (0,1) union select * from v1; + +create or replace view v1 as select 2 ^ 3 OR 3, 2 ^ (3 OR 3), (2 ^ 3) OR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 ^ 3 OR 3, 2 ^ (3 OR 3), (2 ^ 3) OR 3 union select * from v1; + +create or replace view v1 as select 2 ^ 3 || 3, 2 ^ (3 || 3), (2 ^ 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 ^ 3 || 3, 2 ^ (3 || 3), (2 ^ 3) || 3 union select * from v1; + +create or replace view v1 as select 2 ^ 3 XOR 3, 2 ^ (3 XOR 3), (2 ^ 3) XOR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 ^ 3 XOR 3, 2 ^ (3 XOR 3), (2 ^ 3) XOR 3 union select * from v1; + +create or replace view v1 as select 2 ^ 3 AND 3, 2 ^ (3 AND 3), (2 ^ 3) AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 ^ 3 AND 3, 2 ^ (3 AND 3), (2 ^ 3) AND 3 union select * from v1; + +create or replace view v1 as select 2 ^ 3 && 3, 2 ^ (3 && 3), (2 ^ 3) && 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 ^ 3 && 3, 2 ^ (3 && 3), (2 ^ 3) && 3 union select * from v1; + +create or replace view v1 as select 2 ^ 3 = 3, 2 ^ (3 = 3), (2 ^ 3) = 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 ^ 3 = 3, 2 ^ (3 = 3), (2 ^ 3) = 3 union select * from v1; + +create or replace view v1 as select 2 ^ 3 <=> 3, 2 ^ (3 <=> 3), (2 ^ 3) <=> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 ^ 3 <=> 3, 2 ^ (3 <=> 3), (2 ^ 3) <=> 3 union select * from v1; + +create or replace view v1 as select 2 ^ 3 >= 3, 2 ^ (3 >= 3), (2 ^ 3) >= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 ^ 3 >= 3, 2 ^ (3 >= 3), (2 ^ 3) >= 3 union select * from v1; + +create or replace view v1 as select 2 ^ 3 <= 3, 2 ^ (3 <= 3), (2 ^ 3) <= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 ^ 3 <= 3, 2 ^ (3 <= 3), (2 ^ 3) <= 3 union select * from v1; + +create or replace view v1 as select 2 ^ 3 < 3, 2 ^ (3 < 3), (2 ^ 3) < 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 ^ 3 < 3, 2 ^ (3 < 3), (2 ^ 3) < 3 union select * from v1; + +create or replace view v1 as select 2 ^ 3 <> 3, 2 ^ (3 <> 3), (2 ^ 3) <> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 ^ 3 <> 3, 2 ^ (3 <> 3), (2 ^ 3) <> 3 union select * from v1; + +create or replace view v1 as select 2 ^ 3 > 3, 2 ^ (3 > 3), (2 ^ 3) > 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 ^ 3 > 3, 2 ^ (3 > 3), (2 ^ 3) > 3 union select * from v1; + +create or replace view v1 as select 2 ^ 3 != 3, 2 ^ (3 != 3), (2 ^ 3) != 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 ^ 3 != 3, 2 ^ (3 != 3), (2 ^ 3) != 3 union select * from v1; + +create or replace view v1 as select 2 ^ 3 LIKE 3, 2 ^ (3 LIKE 3), (2 ^ 3) LIKE 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 ^ 3 LIKE 3, 2 ^ (3 LIKE 3), (2 ^ 3) LIKE 3 union select * from v1; + +create or replace view v1 as select 2 ^ 3 REGEXP 3, 2 ^ (3 REGEXP 3), (2 ^ 3) REGEXP 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 ^ 3 REGEXP 3, 2 ^ (3 REGEXP 3), (2 ^ 3) REGEXP 3 union select * from v1; + +create or replace view v1 as select 2 ^ 3 | 3, 2 ^ (3 | 3), (2 ^ 3) | 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 ^ 3 | 3, 2 ^ (3 | 3), (2 ^ 3) | 3 union select * from v1; + +create or replace view v1 as select 2 ^ 0 & 0, 2 ^ (0 & 0), (2 ^ 0) & 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 ^ 0 & 0, 2 ^ (0 & 0), (2 ^ 0) & 0 union select * from v1; + +create or replace view v1 as select 2 ^ 3 << 3, 2 ^ (3 << 3), (2 ^ 3) << 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 ^ 3 << 3, 2 ^ (3 << 3), (2 ^ 3) << 3 union select * from v1; + +create or replace view v1 as select 2 ^ 3 >> 3, 2 ^ (3 >> 3), (2 ^ 3) >> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 ^ 3 >> 3, 2 ^ (3 >> 3), (2 ^ 3) >> 3 union select * from v1; + +create or replace view v1 as select 2 ^ '2000-01-01' +INTERVAL 1 DAY, 2 ^ ('2000-01-01' +INTERVAL 1 DAY), (2 ^ '2000-01-01') +INTERVAL 1 DAY; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 ^ '2000-01-01' +INTERVAL 1 DAY, 2 ^ ('2000-01-01' +INTERVAL 1 DAY), (2 ^ '2000-01-01') +INTERVAL 1 DAY union select * from v1; + +create or replace view v1 as select 2 ^ 3 + 1, 2 ^ (3 + 1), (2 ^ 3) + 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 ^ 3 + 1, 2 ^ (3 + 1), (2 ^ 3) + 1 union select * from v1; + +create or replace view v1 as select 5 ^ 1 - 1, 5 ^ (1 - 1), (5 ^ 1) - 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 5 ^ 1 - 1, 5 ^ (1 - 1), (5 ^ 1) - 1 union select * from v1; + +create or replace view v1 as select 2 ^ 3 * 3, 2 ^ (3 * 3), (2 ^ 3) * 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 ^ 3 * 3, 2 ^ (3 * 3), (2 ^ 3) * 3 union select * from v1; + +create or replace view v1 as select 2 ^ 3 / 3, 2 ^ (3 / 3), (2 ^ 3) / 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 ^ 3 / 3, 2 ^ (3 / 3), (2 ^ 3) / 3 union select * from v1; + +create or replace view v1 as select 2 ^ 3 DIV 3, 2 ^ (3 DIV 3), (2 ^ 3) DIV 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 ^ 3 DIV 3, 2 ^ (3 DIV 3), (2 ^ 3) DIV 3 union select * from v1; + +create or replace view v1 as select 2 ^ 3 MOD 3, 2 ^ (3 MOD 3), (2 ^ 3) MOD 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 ^ 3 MOD 3, 2 ^ (3 MOD 3), (2 ^ 3) MOD 3 union select * from v1; + +create or replace view v1 as select 2 ^ 3 % 3, 2 ^ (3 % 3), (2 ^ 3) % 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 ^ 3 % 3, 2 ^ (3 % 3), (2 ^ 3) % 3 union select * from v1; + +create or replace view v1 as select 2 ^ 3 BETWEEN 1 AND 3, 2 ^ (3 BETWEEN 1 AND 3), (2 ^ 3) BETWEEN 1 AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 ^ 3 BETWEEN 1 AND 3, 2 ^ (3 BETWEEN 1 AND 3), (2 ^ 3) BETWEEN 1 AND 3 union select * from v1; + +create or replace view v1 as select 2 BETWEEN 1 AND 1 IS FALSE, 2 BETWEEN 1 AND (1 IS FALSE), (2 BETWEEN 1 AND 1) IS FALSE; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 BETWEEN 1 AND 1 IS FALSE, 2 BETWEEN 1 AND (1 IS FALSE), (2 BETWEEN 1 AND 1) IS FALSE union select * from v1; + +create or replace view v1 as select charset(2 BETWEEN 1 AND 3 COLLATE latin1_bin), charset(2 BETWEEN 1 AND (3 COLLATE latin1_bin)), charset((2 BETWEEN 1 AND 3) COLLATE latin1_bin); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select charset(2 BETWEEN 1 AND 3 COLLATE latin1_bin), charset(2 BETWEEN 1 AND (3 COLLATE latin1_bin)), charset((2 BETWEEN 1 AND 3) COLLATE latin1_bin) union select * from v1; + +create or replace view v1 as select 2 BETWEEN 1 AND 3 IN (0,1), 2 BETWEEN 1 AND (3 IN (0,1)), (2 BETWEEN 1 AND 3) IN (0,1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 BETWEEN 1 AND 3 IN (0,1), 2 BETWEEN 1 AND (3 IN (0,1)), (2 BETWEEN 1 AND 3) IN (0,1) union select * from v1; + +create or replace view v1 as select 2 BETWEEN 1 AND 3 OR 3, 2 BETWEEN 1 AND (3 OR 3), (2 BETWEEN 1 AND 3) OR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 BETWEEN 1 AND 3 OR 3, 2 BETWEEN 1 AND (3 OR 3), (2 BETWEEN 1 AND 3) OR 3 union select * from v1; + +create or replace view v1 as select 2 BETWEEN 1 AND 3 || 3, 2 BETWEEN 1 AND (3 || 3), (2 BETWEEN 1 AND 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 BETWEEN 1 AND 3 || 3, 2 BETWEEN 1 AND (3 || 3), (2 BETWEEN 1 AND 3) || 3 union select * from v1; + +create or replace view v1 as select 2 BETWEEN 1 AND 1 XOR 1, 2 BETWEEN 1 AND (1 XOR 1), (2 BETWEEN 1 AND 1) XOR 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 BETWEEN 1 AND 1 XOR 1, 2 BETWEEN 1 AND (1 XOR 1), (2 BETWEEN 1 AND 1) XOR 1 union select * from v1; + +create or replace view v1 as select 2 BETWEEN 1 AND 3 AND 3, 2 BETWEEN 1 AND (3 AND 3), (2 BETWEEN 1 AND 3) AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 BETWEEN 1 AND 3 AND 3, 2 BETWEEN 1 AND (3 AND 3), (2 BETWEEN 1 AND 3) AND 3 union select * from v1; + +create or replace view v1 as select 2 BETWEEN 1 AND 3 && 3, 2 BETWEEN 1 AND (3 && 3), (2 BETWEEN 1 AND 3) && 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 BETWEEN 1 AND 3 && 3, 2 BETWEEN 1 AND (3 && 3), (2 BETWEEN 1 AND 3) && 3 union select * from v1; + +create or replace view v1 as select 2 BETWEEN 1 AND 3 = 1, 2 BETWEEN 1 AND (3 = 1), (2 BETWEEN 1 AND 3) = 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 BETWEEN 1 AND 3 = 1, 2 BETWEEN 1 AND (3 = 1), (2 BETWEEN 1 AND 3) = 1 union select * from v1; + +create or replace view v1 as select 2 BETWEEN 1 AND 3 <=> 1, 2 BETWEEN 1 AND (3 <=> 1), (2 BETWEEN 1 AND 3) <=> 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 BETWEEN 1 AND 3 <=> 1, 2 BETWEEN 1 AND (3 <=> 1), (2 BETWEEN 1 AND 3) <=> 1 union select * from v1; + +create or replace view v1 as select 2 BETWEEN 1 AND 3 >= 1, 2 BETWEEN 1 AND (3 >= 1), (2 BETWEEN 1 AND 3) >= 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 BETWEEN 1 AND 3 >= 1, 2 BETWEEN 1 AND (3 >= 1), (2 BETWEEN 1 AND 3) >= 1 union select * from v1; + +create or replace view v1 as select 2 BETWEEN 1 AND 3 <= 3, 2 BETWEEN 1 AND (3 <= 3), (2 BETWEEN 1 AND 3) <= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 BETWEEN 1 AND 3 <= 3, 2 BETWEEN 1 AND (3 <= 3), (2 BETWEEN 1 AND 3) <= 3 union select * from v1; + +create or replace view v1 as select 2 BETWEEN 1 AND 3 < 3, 2 BETWEEN 1 AND (3 < 3), (2 BETWEEN 1 AND 3) < 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 BETWEEN 1 AND 3 < 3, 2 BETWEEN 1 AND (3 < 3), (2 BETWEEN 1 AND 3) < 3 union select * from v1; + +create or replace view v1 as select 2 BETWEEN 1 AND 3 <> 3, 2 BETWEEN 1 AND (3 <> 3), (2 BETWEEN 1 AND 3) <> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 BETWEEN 1 AND 3 <> 3, 2 BETWEEN 1 AND (3 <> 3), (2 BETWEEN 1 AND 3) <> 3 union select * from v1; + +create or replace view v1 as select 2 BETWEEN 1 AND 3 > 0, 2 BETWEEN 1 AND (3 > 0), (2 BETWEEN 1 AND 3) > 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 BETWEEN 1 AND 3 > 0, 2 BETWEEN 1 AND (3 > 0), (2 BETWEEN 1 AND 3) > 0 union select * from v1; + +create or replace view v1 as select 2 BETWEEN 1 AND 3 != 3, 2 BETWEEN 1 AND (3 != 3), (2 BETWEEN 1 AND 3) != 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 BETWEEN 1 AND 3 != 3, 2 BETWEEN 1 AND (3 != 3), (2 BETWEEN 1 AND 3) != 3 union select * from v1; + +create or replace view v1 as select 2 BETWEEN 1 AND 3 LIKE 1, 2 BETWEEN 1 AND (3 LIKE 1), (2 BETWEEN 1 AND 3) LIKE 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 BETWEEN 1 AND 3 LIKE 1, 2 BETWEEN 1 AND (3 LIKE 1), (2 BETWEEN 1 AND 3) LIKE 1 union select * from v1; + +create or replace view v1 as select 2 BETWEEN 1 AND 3 REGEXP 1, 2 BETWEEN 1 AND (3 REGEXP 1), (2 BETWEEN 1 AND 3) REGEXP 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 BETWEEN 1 AND 3 REGEXP 1, 2 BETWEEN 1 AND (3 REGEXP 1), (2 BETWEEN 1 AND 3) REGEXP 1 union select * from v1; + +create or replace view v1 as select 2 BETWEEN 1 AND 3 | 3, 2 BETWEEN 1 AND (3 | 3), (2 BETWEEN 1 AND 3) | 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 BETWEEN 1 AND 3 | 3, 2 BETWEEN 1 AND (3 | 3), (2 BETWEEN 1 AND 3) | 3 union select * from v1; + +create or replace view v1 as select 2 BETWEEN 1 AND 2 & 2, 2 BETWEEN 1 AND (2 & 2), (2 BETWEEN 1 AND 2) & 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 BETWEEN 1 AND 2 & 2, 2 BETWEEN 1 AND (2 & 2), (2 BETWEEN 1 AND 2) & 2 union select * from v1; + +create or replace view v1 as select 2 BETWEEN 1 AND 3 << 3, 2 BETWEEN 1 AND (3 << 3), (2 BETWEEN 1 AND 3) << 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 BETWEEN 1 AND 3 << 3, 2 BETWEEN 1 AND (3 << 3), (2 BETWEEN 1 AND 3) << 3 union select * from v1; + +create or replace view v1 as select 2 BETWEEN 1 AND 4 >> 1, 2 BETWEEN 1 AND (4 >> 1), (2 BETWEEN 1 AND 4) >> 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 BETWEEN 1 AND 4 >> 1, 2 BETWEEN 1 AND (4 >> 1), (2 BETWEEN 1 AND 4) >> 1 union select * from v1; + +create or replace view v1 as select 2 BETWEEN 1 AND '2000-01-01' +INTERVAL 1 DAY, 2 BETWEEN 1 AND ('2000-01-01' +INTERVAL 1 DAY), (2 BETWEEN 1 AND '2000-01-01') +INTERVAL 1 DAY; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 BETWEEN 1 AND '2000-01-01' +INTERVAL 1 DAY, 2 BETWEEN 1 AND ('2000-01-01' +INTERVAL 1 DAY), (2 BETWEEN 1 AND '2000-01-01') +INTERVAL 1 DAY union select * from v1; + +create or replace view v1 as select 2 BETWEEN 1 AND 3 + 3, 2 BETWEEN 1 AND (3 + 3), (2 BETWEEN 1 AND 3) + 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 BETWEEN 1 AND 3 + 3, 2 BETWEEN 1 AND (3 + 3), (2 BETWEEN 1 AND 3) + 3 union select * from v1; + +create or replace view v1 as select 2 BETWEEN 1 AND 3 - 3, 2 BETWEEN 1 AND (3 - 3), (2 BETWEEN 1 AND 3) - 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 BETWEEN 1 AND 3 - 3, 2 BETWEEN 1 AND (3 - 3), (2 BETWEEN 1 AND 3) - 3 union select * from v1; + +create or replace view v1 as select 2 BETWEEN 1 AND 3 * 3, 2 BETWEEN 1 AND (3 * 3), (2 BETWEEN 1 AND 3) * 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 BETWEEN 1 AND 3 * 3, 2 BETWEEN 1 AND (3 * 3), (2 BETWEEN 1 AND 3) * 3 union select * from v1; + +create or replace view v1 as select 2 BETWEEN 1 AND 3 / 3, 2 BETWEEN 1 AND (3 / 3), (2 BETWEEN 1 AND 3) / 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 BETWEEN 1 AND 3 / 3, 2 BETWEEN 1 AND (3 / 3), (2 BETWEEN 1 AND 3) / 3 union select * from v1; + +create or replace view v1 as select 2 BETWEEN 1 AND 4 DIV 2, 2 BETWEEN 1 AND (4 DIV 2), (2 BETWEEN 1 AND 4) DIV 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 BETWEEN 1 AND 4 DIV 2, 2 BETWEEN 1 AND (4 DIV 2), (2 BETWEEN 1 AND 4) DIV 2 union select * from v1; + +create or replace view v1 as select 2 BETWEEN 1 AND 3 MOD 3, 2 BETWEEN 1 AND (3 MOD 3), (2 BETWEEN 1 AND 3) MOD 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 BETWEEN 1 AND 3 MOD 3, 2 BETWEEN 1 AND (3 MOD 3), (2 BETWEEN 1 AND 3) MOD 3 union select * from v1; + +create or replace view v1 as select 2 BETWEEN 1 AND 3 % 3, 2 BETWEEN 1 AND (3 % 3), (2 BETWEEN 1 AND 3) % 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 BETWEEN 1 AND 3 % 3, 2 BETWEEN 1 AND (3 % 3), (2 BETWEEN 1 AND 3) % 3 union select * from v1; + +create or replace view v1 as select 2 BETWEEN 1 AND 3 ^ 3, 2 BETWEEN 1 AND (3 ^ 3), (2 BETWEEN 1 AND 3) ^ 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 BETWEEN 1 AND 3 ^ 3, 2 BETWEEN 1 AND (3 ^ 3), (2 BETWEEN 1 AND 3) ^ 3 union select * from v1; + +create or replace view v1 as select 2 BETWEEN 1 AND 3 BETWEEN 1 AND 3, 2 BETWEEN 1 AND (3 BETWEEN 1 AND 3), (2 BETWEEN 1 AND 3) BETWEEN 1 AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 BETWEEN 1 AND 3 BETWEEN 1 AND 3, 2 BETWEEN 1 AND (3 BETWEEN 1 AND 3), (2 BETWEEN 1 AND 3) BETWEEN 1 AND 3 union select * from v1; + +create or replace view v1 as select 2 LIKE 2 ESCAPE 3 IS FALSE, 2 LIKE 2 ESCAPE (3 IS FALSE), (2 LIKE 2 ESCAPE 3) IS FALSE; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 LIKE 2 ESCAPE 3 IS FALSE, 2 LIKE 2 ESCAPE (3 IS FALSE), (2 LIKE 2 ESCAPE 3) IS FALSE union select * from v1; + +create or replace view v1 as select charset(2 LIKE 1 ESCAPE 3 COLLATE latin1_bin), charset(2 LIKE 1 ESCAPE (3 COLLATE latin1_bin)), charset((2 LIKE 1 ESCAPE 3) COLLATE latin1_bin); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select charset(2 LIKE 1 ESCAPE 3 COLLATE latin1_bin), charset(2 LIKE 1 ESCAPE (3 COLLATE latin1_bin)), charset((2 LIKE 1 ESCAPE 3) COLLATE latin1_bin) union select * from v1; + +create or replace view v1 as select 2 LIKE 1 ESCAPE 3 IN(0,1), 2 LIKE 1 ESCAPE (3 IN(0,1)), (2 LIKE 1 ESCAPE 3) IN(0,1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 LIKE 1 ESCAPE 3 IN(0,1), 2 LIKE 1 ESCAPE (3 IN(0,1)), (2 LIKE 1 ESCAPE 3) IN(0,1) union select * from v1; + +create or replace view v1 as select 2 LIKE 1 ESCAPE 3 OR 4, 2 LIKE 1 ESCAPE (3 OR 4), (2 LIKE 1 ESCAPE 3) OR 4; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 LIKE 1 ESCAPE 3 OR 4, 2 LIKE 1 ESCAPE (3 OR 4), (2 LIKE 1 ESCAPE 3) OR 4 union select * from v1; + +create or replace view v1 as select 2 LIKE 1 ESCAPE 3 || 4, 2 LIKE 1 ESCAPE (3 || 4), (2 LIKE 1 ESCAPE 3) || 4; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 LIKE 1 ESCAPE 3 || 4, 2 LIKE 1 ESCAPE (3 || 4), (2 LIKE 1 ESCAPE 3) || 4 union select * from v1; + +create or replace view v1 as select 2 LIKE 1 ESCAPE 3 XOR 4, 2 LIKE 1 ESCAPE (3 XOR 4), (2 LIKE 1 ESCAPE 3) XOR 4; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 LIKE 1 ESCAPE 3 XOR 4, 2 LIKE 1 ESCAPE (3 XOR 4), (2 LIKE 1 ESCAPE 3) XOR 4 union select * from v1; + +create or replace view v1 as select 2 LIKE 2 ESCAPE 3 AND 0, 2 LIKE 2 ESCAPE (3 AND 0), (2 LIKE 2 ESCAPE 3) AND 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 LIKE 2 ESCAPE 3 AND 0, 2 LIKE 2 ESCAPE (3 AND 0), (2 LIKE 2 ESCAPE 3) AND 0 union select * from v1; + +create or replace view v1 as select 2 LIKE 2 ESCAPE 3 && 0, 2 LIKE 2 ESCAPE (3 && 0), (2 LIKE 2 ESCAPE 3) && 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 LIKE 2 ESCAPE 3 && 0, 2 LIKE 2 ESCAPE (3 && 0), (2 LIKE 2 ESCAPE 3) && 0 union select * from v1; + +create or replace view v1 as select 2 LIKE 2 ESCAPE 3 = 4, 2 LIKE 2 ESCAPE (3 = 4), (2 LIKE 2 ESCAPE 3) = 4; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 LIKE 2 ESCAPE 3 = 4, 2 LIKE 2 ESCAPE (3 = 4), (2 LIKE 2 ESCAPE 3) = 4 union select * from v1; + +create or replace view v1 as select 2 LIKE 2 ESCAPE 3 <=> 4, 2 LIKE 2 ESCAPE (3 <=> 4), (2 LIKE 2 ESCAPE 3) <=> 4; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 LIKE 2 ESCAPE 3 <=> 4, 2 LIKE 2 ESCAPE (3 <=> 4), (2 LIKE 2 ESCAPE 3) <=> 4 union select * from v1; + +create or replace view v1 as select 2 LIKE 2 ESCAPE 3 >= 4, 2 LIKE 2 ESCAPE (3 >= 4), (2 LIKE 2 ESCAPE 3) >= 4; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 LIKE 2 ESCAPE 3 >= 4, 2 LIKE 2 ESCAPE (3 >= 4), (2 LIKE 2 ESCAPE 3) >= 4 union select * from v1; + +create or replace view v1 as select 2 LIKE 1 ESCAPE 3 <= 4, 2 LIKE 1 ESCAPE (3 <= 4), (2 LIKE 1 ESCAPE 3) <= 4; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 LIKE 1 ESCAPE 3 <= 4, 2 LIKE 1 ESCAPE (3 <= 4), (2 LIKE 1 ESCAPE 3) <= 4 union select * from v1; + +create or replace view v1 as select 2 LIKE 1 ESCAPE 3 < 4, 2 LIKE 1 ESCAPE (3 < 4), (2 LIKE 1 ESCAPE 3) < 4; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 LIKE 1 ESCAPE 3 < 4, 2 LIKE 1 ESCAPE (3 < 4), (2 LIKE 1 ESCAPE 3) < 4 union select * from v1; + +create or replace view v1 as select 2 LIKE 1 ESCAPE 3 <> 4, 2 LIKE 1 ESCAPE (3 <> 4), (2 LIKE 1 ESCAPE 3) <> 4; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 LIKE 1 ESCAPE 3 <> 4, 2 LIKE 1 ESCAPE (3 <> 4), (2 LIKE 1 ESCAPE 3) <> 4 union select * from v1; + +create or replace view v1 as select 2 LIKE 2 ESCAPE 3 > 4, 2 LIKE 2 ESCAPE (3 > 4), (2 LIKE 2 ESCAPE 3) > 4; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 LIKE 2 ESCAPE 3 > 4, 2 LIKE 2 ESCAPE (3 > 4), (2 LIKE 2 ESCAPE 3) > 4 union select * from v1; + +create or replace view v1 as select 2 LIKE 1 ESCAPE 3 != 4, 2 LIKE 1 ESCAPE (3 != 4), (2 LIKE 1 ESCAPE 3) != 4; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 LIKE 1 ESCAPE 3 != 4, 2 LIKE 1 ESCAPE (3 != 4), (2 LIKE 1 ESCAPE 3) != 4 union select * from v1; + +create or replace view v1 as select 2 LIKE 2 ESCAPE 3 LIKE 4, 2 LIKE 2 ESCAPE (3 LIKE 4), (2 LIKE 2 ESCAPE 3) LIKE 4; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 LIKE 2 ESCAPE 3 LIKE 4, 2 LIKE 2 ESCAPE (3 LIKE 4), (2 LIKE 2 ESCAPE 3) LIKE 4 union select * from v1; + +create or replace view v1 as select 2 LIKE 2 ESCAPE 3 REGEXP 4, 2 LIKE 2 ESCAPE (3 REGEXP 4), (2 LIKE 2 ESCAPE 3) REGEXP 4; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 LIKE 2 ESCAPE 3 REGEXP 4, 2 LIKE 2 ESCAPE (3 REGEXP 4), (2 LIKE 2 ESCAPE 3) REGEXP 4 union select * from v1; + +create or replace view v1 as select 2 LIKE 1 ESCAPE 3 | 4, 2 LIKE 1 ESCAPE (3 | 4), (2 LIKE 1 ESCAPE 3) | 4; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 LIKE 1 ESCAPE 3 | 4, 2 LIKE 1 ESCAPE (3 | 4), (2 LIKE 1 ESCAPE 3) | 4 union select * from v1; + +create or replace view v1 as select 2 LIKE 2 ESCAPE 3 & 4, 2 LIKE 2 ESCAPE (3 & 4), (2 LIKE 2 ESCAPE 3) & 4; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 LIKE 2 ESCAPE 3 & 4, 2 LIKE 2 ESCAPE (3 & 4), (2 LIKE 2 ESCAPE 3) & 4 union select * from v1; + +create or replace view v1 as select 2 LIKE 2 ESCAPE 1 << 1, 2 LIKE 2 ESCAPE (1 << 1), (2 LIKE 2 ESCAPE 1) << 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 LIKE 2 ESCAPE 1 << 1, 2 LIKE 2 ESCAPE (1 << 1), (2 LIKE 2 ESCAPE 1) << 1 union select * from v1; + +create or replace view v1 as select 2 LIKE 2 ESCAPE 3 >> 4, 2 LIKE 2 ESCAPE (3 >> 4), (2 LIKE 2 ESCAPE 3) >> 4; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 LIKE 2 ESCAPE 3 >> 4, 2 LIKE 2 ESCAPE (3 >> 4), (2 LIKE 2 ESCAPE 3) >> 4 union select * from v1; + +create or replace view v1 as select 2 LIKE 1 ESCAPE 3 +INTERVAL 1 DAY, 2 LIKE 1 ESCAPE (3 +INTERVAL 1 DAY), (2 LIKE 1 ESCAPE 3) +INTERVAL 1 DAY; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 LIKE 1 ESCAPE 3 +INTERVAL 1 DAY, 2 LIKE 1 ESCAPE (3 +INTERVAL 1 DAY), (2 LIKE 1 ESCAPE 3) +INTERVAL 1 DAY union select * from v1; + +create or replace view v1 as select 2 LIKE 1 ESCAPE 3 + 4, 2 LIKE 1 ESCAPE (3 + 4), (2 LIKE 1 ESCAPE 3) + 4; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 LIKE 1 ESCAPE 3 + 4, 2 LIKE 1 ESCAPE (3 + 4), (2 LIKE 1 ESCAPE 3) + 4 union select * from v1; + +create or replace view v1 as select 2 LIKE 2 ESCAPE 1 - 1, 2 LIKE 2 ESCAPE (1 - 1), (2 LIKE 2 ESCAPE 1) - 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 LIKE 2 ESCAPE 1 - 1, 2 LIKE 2 ESCAPE (1 - 1), (2 LIKE 2 ESCAPE 1) - 1 union select * from v1; + +create or replace view v1 as select 2 LIKE 2 ESCAPE 3 * 0, 2 LIKE 2 ESCAPE (3 * 0), (2 LIKE 2 ESCAPE 3) * 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 LIKE 2 ESCAPE 3 * 0, 2 LIKE 2 ESCAPE (3 * 0), (2 LIKE 2 ESCAPE 3) * 0 union select * from v1; + +create or replace view v1 as select 2 LIKE 2 ESCAPE 3 DIV 3, 2 LIKE 2 ESCAPE (3 DIV 3), (2 LIKE 2 ESCAPE 3) DIV 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 LIKE 2 ESCAPE 3 DIV 3, 2 LIKE 2 ESCAPE (3 DIV 3), (2 LIKE 2 ESCAPE 3) DIV 3 union select * from v1; + +create or replace view v1 as select 2 LIKE 2 ESCAPE 3 MOD 1, 2 LIKE 2 ESCAPE (3 MOD 1), (2 LIKE 2 ESCAPE 3) MOD 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 LIKE 2 ESCAPE 3 MOD 1, 2 LIKE 2 ESCAPE (3 MOD 1), (2 LIKE 2 ESCAPE 3) MOD 1 union select * from v1; + +create or replace view v1 as select 2 LIKE 2 ESCAPE 3 % 1, 2 LIKE 2 ESCAPE (3 % 1), (2 LIKE 2 ESCAPE 3) % 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 LIKE 2 ESCAPE 3 % 1, 2 LIKE 2 ESCAPE (3 % 1), (2 LIKE 2 ESCAPE 3) % 1 union select * from v1; + +create or replace view v1 as select 2 LIKE 1 ESCAPE 3 ^ 4, 2 LIKE 1 ESCAPE (3 ^ 4), (2 LIKE 1 ESCAPE 3) ^ 4; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 LIKE 1 ESCAPE 3 ^ 4, 2 LIKE 1 ESCAPE (3 ^ 4), (2 LIKE 1 ESCAPE 3) ^ 4 union select * from v1; + +create or replace view v1 as select 2 LIKE 2 ESCAPE 3 BETWEEN 2 AND 4, 2 LIKE 2 ESCAPE (3 BETWEEN 2 AND 4), (2 LIKE 2 ESCAPE 3) BETWEEN 2 AND 4; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 LIKE 2 ESCAPE 3 BETWEEN 2 AND 4, 2 LIKE 2 ESCAPE (3 BETWEEN 2 AND 4), (2 LIKE 2 ESCAPE 3) BETWEEN 2 AND 4 union select * from v1; + +create or replace view v1 as select NOT 2 IN (SELECT 0 UNION SELECT 2), NOT (2 IN (SELECT 0 UNION SELECT 2)), (NOT 2) IN (SELECT 0 UNION SELECT 2); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select NOT 2 IN (SELECT 0 UNION SELECT 2), NOT (2 IN (SELECT 0 UNION SELECT 2)), (NOT 2) IN (SELECT 0 UNION SELECT 2) union select * from v1; + +create or replace view v1 as select - 2 IN (SELECT 2 UNION SELECT 1), - (2 IN (SELECT 2 UNION SELECT 1)), (- 2) IN (SELECT 2 UNION SELECT 1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select - 2 IN (SELECT 2 UNION SELECT 1), - (2 IN (SELECT 2 UNION SELECT 1)), (- 2) IN (SELECT 2 UNION SELECT 1) union select * from v1; + +create or replace view v1 as select ~ 2 IN (SELECT 0 UNION SELECT 1), ~ (2 IN (SELECT 0 UNION SELECT 1)), (~ 2) IN (SELECT 0 UNION SELECT 1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select ~ 2 IN (SELECT 0 UNION SELECT 1), ~ (2 IN (SELECT 0 UNION SELECT 1)), (~ 2) IN (SELECT 0 UNION SELECT 1) union select * from v1; + +create or replace view v1 as select ! 2 IN (SELECT 0 UNION SELECT 2), ! (2 IN (SELECT 0 UNION SELECT 2)), (! 2) IN (SELECT 0 UNION SELECT 2); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select ! 2 IN (SELECT 0 UNION SELECT 2), ! (2 IN (SELECT 0 UNION SELECT 2)), (! 2) IN (SELECT 0 UNION SELECT 2) union select * from v1; + +create or replace view v1 as select BINARY 'c' IN (SELECT 'C' UNION SELECT 'X'), BINARY ('c' IN (SELECT 'C' UNION SELECT 'X')), (BINARY 'c') IN (SELECT 'C' UNION SELECT 'X'); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select BINARY 'c' IN (SELECT 'C' UNION SELECT 'X'), BINARY ('c' IN (SELECT 'C' UNION SELECT 'X')), (BINARY 'c') IN (SELECT 'C' UNION SELECT 'X') union select * from v1; + +create or replace view v1 as select 0 OR 3 IN (SELECT 3 UNION SELECT 10), 0 OR (3 IN (SELECT 3 UNION SELECT 10)), (0 OR 3) IN (SELECT 3 UNION SELECT 10); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 0 OR 3 IN (SELECT 3 UNION SELECT 10), 0 OR (3 IN (SELECT 3 UNION SELECT 10)), (0 OR 3) IN (SELECT 3 UNION SELECT 10) union select * from v1; + +create or replace view v1 as select 0 || 3 IN (SELECT 3 UNION SELECT 10), 0 || (3 IN (SELECT 3 UNION SELECT 10)), (0 || 3) IN (SELECT 3 UNION SELECT 10); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 0 || 3 IN (SELECT 3 UNION SELECT 10), 0 || (3 IN (SELECT 3 UNION SELECT 10)), (0 || 3) IN (SELECT 3 UNION SELECT 10) union select * from v1; + +create or replace view v1 as select 2 XOR 3 IN (SELECT 4 UNION SELECT 5), 2 XOR (3 IN (SELECT 4 UNION SELECT 5)), (2 XOR 3) IN (SELECT 4 UNION SELECT 5); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 XOR 3 IN (SELECT 4 UNION SELECT 5), 2 XOR (3 IN (SELECT 4 UNION SELECT 5)), (2 XOR 3) IN (SELECT 4 UNION SELECT 5) union select * from v1; + +create or replace view v1 as select 2 AND 3 IN (SELECT 0 UNION SELECT 1), 2 AND (3 IN (SELECT 0 UNION SELECT 1)), (2 AND 3) IN (SELECT 0 UNION SELECT 1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 AND 3 IN (SELECT 0 UNION SELECT 1), 2 AND (3 IN (SELECT 0 UNION SELECT 1)), (2 AND 3) IN (SELECT 0 UNION SELECT 1) union select * from v1; + +create or replace view v1 as select 2 && 3 IN (SELECT 0 UNION SELECT 1), 2 && (3 IN (SELECT 0 UNION SELECT 1)), (2 && 3) IN (SELECT 0 UNION SELECT 1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 && 3 IN (SELECT 0 UNION SELECT 1), 2 && (3 IN (SELECT 0 UNION SELECT 1)), (2 && 3) IN (SELECT 0 UNION SELECT 1) union select * from v1; + +create or replace view v1 as select 2 = 3 IN (SELECT 0 UNION SELECT 1), 2 = (3 IN (SELECT 0 UNION SELECT 1)), (2 = 3) IN (SELECT 0 UNION SELECT 1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 = 3 IN (SELECT 0 UNION SELECT 1), 2 = (3 IN (SELECT 0 UNION SELECT 1)), (2 = 3) IN (SELECT 0 UNION SELECT 1) union select * from v1; + +create or replace view v1 as select 2 <=> 3 IN (SELECT 0 UNION SELECT 1), 2 <=> (3 IN (SELECT 0 UNION SELECT 1)), (2 <=> 3) IN (SELECT 0 UNION SELECT 1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 <=> 3 IN (SELECT 0 UNION SELECT 1), 2 <=> (3 IN (SELECT 0 UNION SELECT 1)), (2 <=> 3) IN (SELECT 0 UNION SELECT 1) union select * from v1; + +create or replace view v1 as select 2 >= 3 IN (SELECT 1 UNION SELECT 1), 2 >= (3 IN (SELECT 1 UNION SELECT 1)), (2 >= 3) IN (SELECT 1 UNION SELECT 1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 >= 3 IN (SELECT 1 UNION SELECT 1), 2 >= (3 IN (SELECT 1 UNION SELECT 1)), (2 >= 3) IN (SELECT 1 UNION SELECT 1) union select * from v1; + +create or replace view v1 as select 2 <= 3 IN (SELECT 0 UNION SELECT 1), 2 <= (3 IN (SELECT 0 UNION SELECT 1)), (2 <= 3) IN (SELECT 0 UNION SELECT 1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 <= 3 IN (SELECT 0 UNION SELECT 1), 2 <= (3 IN (SELECT 0 UNION SELECT 1)), (2 <= 3) IN (SELECT 0 UNION SELECT 1) union select * from v1; + +create or replace view v1 as select 2 < 3 IN (SELECT 0 UNION SELECT 1), 2 < (3 IN (SELECT 0 UNION SELECT 1)), (2 < 3) IN (SELECT 0 UNION SELECT 1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 < 3 IN (SELECT 0 UNION SELECT 1), 2 < (3 IN (SELECT 0 UNION SELECT 1)), (2 < 3) IN (SELECT 0 UNION SELECT 1) union select * from v1; + +create or replace view v1 as select 2 <> 3 IN (SELECT 0 UNION SELECT 0), 2 <> (3 IN (SELECT 0 UNION SELECT 0)), (2 <> 3) IN (SELECT 0 UNION SELECT 0); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 <> 3 IN (SELECT 0 UNION SELECT 0), 2 <> (3 IN (SELECT 0 UNION SELECT 0)), (2 <> 3) IN (SELECT 0 UNION SELECT 0) union select * from v1; + +create or replace view v1 as select 2 > 3 IN (SELECT 1 UNION SELECT 1), 2 > (3 IN (SELECT 1 UNION SELECT 1)), (2 > 3) IN (SELECT 1 UNION SELECT 1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 > 3 IN (SELECT 1 UNION SELECT 1), 2 > (3 IN (SELECT 1 UNION SELECT 1)), (2 > 3) IN (SELECT 1 UNION SELECT 1) union select * from v1; + +create or replace view v1 as select 2 != 3 IN (SELECT 0 UNION SELECT 0), 2 != (3 IN (SELECT 0 UNION SELECT 0)), (2 != 3) IN (SELECT 0 UNION SELECT 0); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 != 3 IN (SELECT 0 UNION SELECT 0), 2 != (3 IN (SELECT 0 UNION SELECT 0)), (2 != 3) IN (SELECT 0 UNION SELECT 0) union select * from v1; + +create or replace view v1 as select 2 LIKE 3 IN (SELECT 0 UNION SELECT 1), 2 LIKE (3 IN (SELECT 0 UNION SELECT 1)), (2 LIKE 3) IN (SELECT 0 UNION SELECT 1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 LIKE 3 IN (SELECT 0 UNION SELECT 1), 2 LIKE (3 IN (SELECT 0 UNION SELECT 1)), (2 LIKE 3) IN (SELECT 0 UNION SELECT 1) union select * from v1; + +create or replace view v1 as select 2 REGEXP 3 IN (SELECT 0 UNION SELECT 1), 2 REGEXP (3 IN (SELECT 0 UNION SELECT 1)), (2 REGEXP 3) IN (SELECT 0 UNION SELECT 1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 REGEXP 3 IN (SELECT 0 UNION SELECT 1), 2 REGEXP (3 IN (SELECT 0 UNION SELECT 1)), (2 REGEXP 3) IN (SELECT 0 UNION SELECT 1) union select * from v1; + +create or replace view v1 as select 2 | 3 IN (SELECT 0 UNION SELECT 1), 2 | (3 IN (SELECT 0 UNION SELECT 1)), (2 | 3) IN (SELECT 0 UNION SELECT 1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 | 3 IN (SELECT 0 UNION SELECT 1), 2 | (3 IN (SELECT 0 UNION SELECT 1)), (2 | 3) IN (SELECT 0 UNION SELECT 1) union select * from v1; + +create or replace view v1 as select 2 & 4 IN (SELECT 0 UNION SELECT 1), 2 & (4 IN (SELECT 0 UNION SELECT 1)), (2 & 4) IN (SELECT 0 UNION SELECT 1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 & 4 IN (SELECT 0 UNION SELECT 1), 2 & (4 IN (SELECT 0 UNION SELECT 1)), (2 & 4) IN (SELECT 0 UNION SELECT 1) union select * from v1; + +create or replace view v1 as select 2 << 3 IN (SELECT 0 UNION SELECT 1), 2 << (3 IN (SELECT 0 UNION SELECT 1)), (2 << 3) IN (SELECT 0 UNION SELECT 1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 << 3 IN (SELECT 0 UNION SELECT 1), 2 << (3 IN (SELECT 0 UNION SELECT 1)), (2 << 3) IN (SELECT 0 UNION SELECT 1) union select * from v1; + +create or replace view v1 as select 2 >> 3 IN (SELECT 0 UNION SELECT 1), 2 >> (3 IN (SELECT 0 UNION SELECT 1)), (2 >> 3) IN (SELECT 0 UNION SELECT 1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 >> 3 IN (SELECT 0 UNION SELECT 1), 2 >> (3 IN (SELECT 0 UNION SELECT 1)), (2 >> 3) IN (SELECT 0 UNION SELECT 1) union select * from v1; + +create or replace view v1 as select 2 + 3 IN (SELECT 0 UNION SELECT 1), 2 + (3 IN (SELECT 0 UNION SELECT 1)), (2 + 3) IN (SELECT 0 UNION SELECT 1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 + 3 IN (SELECT 0 UNION SELECT 1), 2 + (3 IN (SELECT 0 UNION SELECT 1)), (2 + 3) IN (SELECT 0 UNION SELECT 1) union select * from v1; + +create or replace view v1 as select 2 - 3 IN (SELECT 0 UNION SELECT 1), 2 - (3 IN (SELECT 0 UNION SELECT 1)), (2 - 3) IN (SELECT 0 UNION SELECT 1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 - 3 IN (SELECT 0 UNION SELECT 1), 2 - (3 IN (SELECT 0 UNION SELECT 1)), (2 - 3) IN (SELECT 0 UNION SELECT 1) union select * from v1; + +create or replace view v1 as select 2 * 0 IN (SELECT 0 UNION SELECT 1), 2 * (0 IN (SELECT 0 UNION SELECT 1)), (2 * 0) IN (SELECT 0 UNION SELECT 1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 * 0 IN (SELECT 0 UNION SELECT 1), 2 * (0 IN (SELECT 0 UNION SELECT 1)), (2 * 0) IN (SELECT 0 UNION SELECT 1) union select * from v1; + +create or replace view v1 as select 2 / 3 IN (SELECT 0 UNION SELECT 1), 2 / (3 IN (SELECT 0 UNION SELECT 1)), (2 / 3) IN (SELECT 0 UNION SELECT 1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 / 3 IN (SELECT 0 UNION SELECT 1), 2 / (3 IN (SELECT 0 UNION SELECT 1)), (2 / 3) IN (SELECT 0 UNION SELECT 1) union select * from v1; + +create or replace view v1 as select 2 DIV 3 IN (SELECT 0 UNION SELECT 1), 2 DIV (3 IN (SELECT 0 UNION SELECT 1)), (2 DIV 3) IN (SELECT 0 UNION SELECT 1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 DIV 3 IN (SELECT 0 UNION SELECT 1), 2 DIV (3 IN (SELECT 0 UNION SELECT 1)), (2 DIV 3) IN (SELECT 0 UNION SELECT 1) union select * from v1; + +create or replace view v1 as select 2 MOD 3 IN (SELECT 0 UNION SELECT 1), 2 MOD (3 IN (SELECT 0 UNION SELECT 1)), (2 MOD 3) IN (SELECT 0 UNION SELECT 1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 MOD 3 IN (SELECT 0 UNION SELECT 1), 2 MOD (3 IN (SELECT 0 UNION SELECT 1)), (2 MOD 3) IN (SELECT 0 UNION SELECT 1) union select * from v1; + +create or replace view v1 as select 2 % 3 IN (SELECT 0 UNION SELECT 1), 2 % (3 IN (SELECT 0 UNION SELECT 1)), (2 % 3) IN (SELECT 0 UNION SELECT 1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 % 3 IN (SELECT 0 UNION SELECT 1), 2 % (3 IN (SELECT 0 UNION SELECT 1)), (2 % 3) IN (SELECT 0 UNION SELECT 1) union select * from v1; + +create or replace view v1 as select 2 ^ 3 IN (SELECT 0 UNION SELECT 1), 2 ^ (3 IN (SELECT 0 UNION SELECT 1)), (2 ^ 3) IN (SELECT 0 UNION SELECT 1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 ^ 3 IN (SELECT 0 UNION SELECT 1), 2 ^ (3 IN (SELECT 0 UNION SELECT 1)), (2 ^ 3) IN (SELECT 0 UNION SELECT 1) union select * from v1; + +create or replace view v1 as select 2 BETWEEN 1 AND 3 IN (SELECT 0 UNION SELECT 1), 2 BETWEEN 1 AND (3 IN (SELECT 0 UNION SELECT 1)), (2 BETWEEN 1 AND 3) IN (SELECT 0 UNION SELECT 1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 BETWEEN 1 AND 3 IN (SELECT 0 UNION SELECT 1), 2 BETWEEN 1 AND (3 IN (SELECT 0 UNION SELECT 1)), (2 BETWEEN 1 AND 3) IN (SELECT 0 UNION SELECT 1) union select * from v1; + +create or replace view v1 as select 2 LIKE 1 ESCAPE 3 IN (SELECT 0 UNION SELECT 1), 2 LIKE 1 ESCAPE (3 IN (SELECT 0 UNION SELECT 1)), (2 LIKE 1 ESCAPE 3) IN (SELECT 0 UNION SELECT 1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 LIKE 1 ESCAPE 3 IN (SELECT 0 UNION SELECT 1), 2 LIKE 1 ESCAPE (3 IN (SELECT 0 UNION SELECT 1)), (2 LIKE 1 ESCAPE 3) IN (SELECT 0 UNION SELECT 1) union select * from v1; + +create or replace view v1 as select 3 BETWEEN 1 AND 2 AND NULL, 3 BETWEEN (1 AND 2) AND NULL, 3 BETWEEN 1 AND (2 AND NULL), (3 BETWEEN 1 AND 2) AND NULL; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 3 BETWEEN 1 AND 2 AND NULL, 3 BETWEEN (1 AND 2) AND NULL, 3 BETWEEN 1 AND (2 AND NULL), (3 BETWEEN 1 AND 2) AND NULL union select * from v1; + +set sql_mode=PIPES_AS_CONCAT; +create or replace view v1 as select 2 OR 3 || 3, 2 OR (3 || 3), (2 OR 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 OR 3 || 3, 2 OR (3 || 3), (2 OR 3) || 3 union select * from v1; + +create or replace view v1 as select 2 || 3 OR 3, 2 || (3 OR 3), (2 || 3) OR 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 || 3 OR 3, 2 || (3 OR 3), (2 || 3) OR 3 union select * from v1; + +create or replace view v1 as select NOT 2 || 3, NOT (2 || 3), (NOT 2) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select NOT 2 || 3, NOT (2 || 3), (NOT 2) || 3 union select * from v1; + +create or replace view v1 as select - '2 ' || 3, - ('2 ' || 3), (- '2 ') || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select - '2 ' || 3, - ('2 ' || 3), (- '2 ') || 3 union select * from v1; + +create or replace view v1 as select ~ 2 || 3, ~ (2 || 3), (~ 2) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select ~ 2 || 3, ~ (2 || 3), (~ 2) || 3 union select * from v1; + +create or replace view v1 as select ! 2 || 3, ! (2 || 3), (! 2) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select ! 2 || 3, ! (2 || 3), (! 2) || 3 union select * from v1; + +create or replace view v1 as select 2 || 3 IS FALSE, 2 || (3 IS FALSE), (2 || 3) IS FALSE; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 || 3 IS FALSE, 2 || (3 IS FALSE), (2 || 3) IS FALSE union select * from v1; + +create or replace view v1 as select 0 || 3 IN (3,10), 0 || (3 IN (3,10)), (0 || 3) IN (3,10); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 0 || 3 IN (3,10), 0 || (3 IN (3,10)), (0 || 3) IN (3,10) union select * from v1; + +create or replace view v1 as select 1 || 0 XOR 1, 1 || (0 XOR 1), (1 || 0) XOR 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 1 || 0 XOR 1, 1 || (0 XOR 1), (1 || 0) XOR 1 union select * from v1; + +create or replace view v1 as select 1 || 1 AND 0, 1 || (1 AND 0), (1 || 1) AND 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 1 || 1 AND 0, 1 || (1 AND 0), (1 || 1) AND 0 union select * from v1; + +create or replace view v1 as select 1 || 1 && 0, 1 || (1 && 0), (1 || 1) && 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 1 || 1 && 0, 1 || (1 && 0), (1 || 1) && 0 union select * from v1; + +create or replace view v1 as select 2 || 3 = 3, 2 || (3 = 3), (2 || 3) = 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 || 3 = 3, 2 || (3 = 3), (2 || 3) = 3 union select * from v1; + +create or replace view v1 as select 2 || 3 <=> 3, 2 || (3 <=> 3), (2 || 3) <=> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 || 3 <=> 3, 2 || (3 <=> 3), (2 || 3) <=> 3 union select * from v1; + +create or replace view v1 as select 2 || 3 >= 3, 2 || (3 >= 3), (2 || 3) >= 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 || 3 >= 3, 2 || (3 >= 3), (2 || 3) >= 3 union select * from v1; + +create or replace view v1 as select 2 || 3 <= 0, 2 || (3 <= 0), (2 || 3) <= 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 || 3 <= 0, 2 || (3 <= 0), (2 || 3) <= 0 union select * from v1; + +create or replace view v1 as select 2 || 3 < 0, 2 || (3 < 0), (2 || 3) < 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 || 3 < 0, 2 || (3 < 0), (2 || 3) < 0 union select * from v1; + +create or replace view v1 as select 0 || 3 <> 3, 0 || (3 <> 3), (0 || 3) <> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 0 || 3 <> 3, 0 || (3 <> 3), (0 || 3) <> 3 union select * from v1; + +create or replace view v1 as select 2 || 3 > 3, 2 || (3 > 3), (2 || 3) > 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 || 3 > 3, 2 || (3 > 3), (2 || 3) > 3 union select * from v1; + +create or replace view v1 as select 0 || 3 != 3, 0 || (3 != 3), (0 || 3) != 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 0 || 3 != 3, 0 || (3 != 3), (0 || 3) != 3 union select * from v1; + +create or replace view v1 as select 2 || 3 LIKE 3, 2 || (3 LIKE 3), (2 || 3) LIKE 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 || 3 LIKE 3, 2 || (3 LIKE 3), (2 || 3) LIKE 3 union select * from v1; + +create or replace view v1 as select 2 || 3 REGEXP 3, 2 || (3 REGEXP 3), (2 || 3) REGEXP 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 || 3 REGEXP 3, 2 || (3 REGEXP 3), (2 || 3) REGEXP 3 union select * from v1; + +create or replace view v1 as select 2 || ' 3' | 3, 2 || (' 3' | 3), (2 || ' 3') | 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 || ' 3' | 3, 2 || (' 3' | 3), (2 || ' 3') | 3 union select * from v1; + +create or replace view v1 as select 0 || 2 & 2, 0 || (2 & 2), (0 || 2) & 2; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 0 || 2 & 2, 0 || (2 & 2), (0 || 2) & 2 union select * from v1; + +create or replace view v1 as select 2 || 3 << 3, 2 || (3 << 3), (2 || 3) << 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 || 3 << 3, 2 || (3 << 3), (2 || 3) << 3 union select * from v1; + +create or replace view v1 as select 2 || 3 >> 3, 2 || (3 >> 3), (2 || 3) >> 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 || 3 >> 3, 2 || (3 >> 3), (2 || 3) >> 3 union select * from v1; + +create or replace view v1 as select 2 || '2000-01-01' +INTERVAL 1 DAY, 2 || ('2000-01-01' +INTERVAL 1 DAY), (2 || '2000-01-01') +INTERVAL 1 DAY; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 || '2000-01-01' +INTERVAL 1 DAY, 2 || ('2000-01-01' +INTERVAL 1 DAY), (2 || '2000-01-01') +INTERVAL 1 DAY union select * from v1; + +create or replace view v1 as select 2 || ' 3' + 3, 2 || (' 3' + 3), (2 || ' 3') + 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 || ' 3' + 3, 2 || (' 3' + 3), (2 || ' 3') + 3 union select * from v1; + +create or replace view v1 as select 2 || ' 3' - 3, 2 || (' 3' - 3), (2 || ' 3') - 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 || ' 3' - 3, 2 || (' 3' - 3), (2 || ' 3') - 3 union select * from v1; + +create or replace view v1 as select 2 || 3 * 3, 2 || (3 * 3), (2 || 3) * 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 || 3 * 3, 2 || (3 * 3), (2 || 3) * 3 union select * from v1; + +create or replace view v1 as select 2 || 3 / 3, 2 || (3 / 3), (2 || 3) / 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 || 3 / 3, 2 || (3 / 3), (2 || 3) / 3 union select * from v1; + +create or replace view v1 as select 2 || 3 DIV 3, 2 || (3 DIV 3), (2 || 3) DIV 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 || 3 DIV 3, 2 || (3 DIV 3), (2 || 3) DIV 3 union select * from v1; + +create or replace view v1 as select 0 || 3 MOD 3, 0 || (3 MOD 3), (0 || 3) MOD 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 0 || 3 MOD 3, 0 || (3 MOD 3), (0 || 3) MOD 3 union select * from v1; + +create or replace view v1 as select 0 || 3 % 3, 0 || (3 % 3), (0 || 3) % 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 0 || 3 % 3, 0 || (3 % 3), (0 || 3) % 3 union select * from v1; + +create or replace view v1 as select 2 || ' 3' ^ 3, 2 || (' 3' ^ 3), (2 || ' 3') ^ 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 || ' 3' ^ 3, 2 || (' 3' ^ 3), (2 || ' 3') ^ 3 union select * from v1; + +create or replace view v1 as select 2 || 3 BETWEEN 2 AND 3, 2 || (3 BETWEEN 2 AND 3), (2 || 3) BETWEEN 2 AND 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 || 3 BETWEEN 2 AND 3, 2 || (3 BETWEEN 2 AND 3), (2 || 3) BETWEEN 2 AND 3 union select * from v1; + +create or replace view v1 as select 2 XOR 3 || 3, 2 XOR (3 || 3), (2 XOR 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 XOR 3 || 3, 2 XOR (3 || 3), (2 XOR 3) || 3 union select * from v1; + +create or replace view v1 as select 0 AND 3 || 3, 0 AND (3 || 3), (0 AND 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 0 AND 3 || 3, 0 AND (3 || 3), (0 AND 3) || 3 union select * from v1; + +create or replace view v1 as select 0 && 3 || 3, 0 && (3 || 3), (0 && 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 0 && 3 || 3, 0 && (3 || 3), (0 && 3) || 3 union select * from v1; + +create or replace view v1 as select 2 = 3 || 3, 2 = (3 || 3), (2 = 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 = 3 || 3, 2 = (3 || 3), (2 = 3) || 3 union select * from v1; + +create or replace view v1 as select 2 <=> 3 || 3, 2 <=> (3 || 3), (2 <=> 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 <=> 3 || 3, 2 <=> (3 || 3), (2 <=> 3) || 3 union select * from v1; + +create or replace view v1 as select 2 >= 3 || 0, 2 >= (3 || 0), (2 >= 3) || 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 >= 3 || 0, 2 >= (3 || 0), (2 >= 3) || 0 union select * from v1; + +create or replace view v1 as select 2 <= 3 || 3, 2 <= (3 || 3), (2 <= 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 <= 3 || 3, 2 <= (3 || 3), (2 <= 3) || 3 union select * from v1; + +create or replace view v1 as select 2 < 3 || 3, 2 < (3 || 3), (2 < 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 < 3 || 3, 2 < (3 || 3), (2 < 3) || 3 union select * from v1; + +create or replace view v1 as select 1 <> 3 || 3, 1 <> (3 || 3), (1 <> 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 1 <> 3 || 3, 1 <> (3 || 3), (1 <> 3) || 3 union select * from v1; + +create or replace view v1 as select 0 > 3 || 3, 0 > (3 || 3), (0 > 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 0 > 3 || 3, 0 > (3 || 3), (0 > 3) || 3 union select * from v1; + +create or replace view v1 as select 1 != 3 || 3, 1 != (3 || 3), (1 != 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 1 != 3 || 3, 1 != (3 || 3), (1 != 3) || 3 union select * from v1; + +create or replace view v1 as select 2 LIKE 3 || 3, 2 LIKE (3 || 3), (2 LIKE 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 LIKE 3 || 3, 2 LIKE (3 || 3), (2 LIKE 3) || 3 union select * from v1; + +create or replace view v1 as select 2 REGEXP 3 || 3, 2 REGEXP (3 || 3), (2 REGEXP 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 REGEXP 3 || 3, 2 REGEXP (3 || 3), (2 REGEXP 3) || 3 union select * from v1; + +create or replace view v1 as select 2 | 3 || 3, 2 | (3 || 3), (2 | 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 | 3 || 3, 2 | (3 || 3), (2 | 3) || 3 union select * from v1; + +create or replace view v1 as select 2 & 3 || 3, 2 & (3 || 3), (2 & 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 & 3 || 3, 2 & (3 || 3), (2 & 3) || 3 union select * from v1; + +create or replace view v1 as select 2 << 3 || 3, 2 << (3 || 3), (2 << 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 << 3 || 3, 2 << (3 || 3), (2 << 3) || 3 union select * from v1; + +create or replace view v1 as select 2 >> 3 || 0, 2 >> (3 || 0), (2 >> 3) || 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 >> 3 || 0, 2 >> (3 || 0), (2 >> 3) || 0 union select * from v1; + +create or replace view v1 as select 2 + 3 || 3, 2 + (3 || 3), (2 + 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 + 3 || 3, 2 + (3 || 3), (2 + 3) || 3 union select * from v1; + +create or replace view v1 as select 2 - 2 || 0, 2 - (2 || 0), (2 - 2) || 0; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 - 2 || 0, 2 - (2 || 0), (2 - 2) || 0 union select * from v1; + +create or replace view v1 as select 2 * 3 || 3, 2 * (3 || 3), (2 * 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 * 3 || 3, 2 * (3 || 3), (2 * 3) || 3 union select * from v1; + +create or replace view v1 as select 2 / 3 || 3, 2 / (3 || 3), (2 / 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 / 3 || 3, 2 / (3 || 3), (2 / 3) || 3 union select * from v1; + +create or replace view v1 as select 2 DIV 3 || 3, 2 DIV (3 || 3), (2 DIV 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 DIV 3 || 3, 2 DIV (3 || 3), (2 DIV 3) || 3 union select * from v1; + +create or replace view v1 as select 2 MOD 3 || 3, 2 MOD (3 || 3), (2 MOD 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 MOD 3 || 3, 2 MOD (3 || 3), (2 MOD 3) || 3 union select * from v1; + +create or replace view v1 as select 2 % 3 || 3, 2 % (3 || 3), (2 % 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 % 3 || 3, 2 % (3 || 3), (2 % 3) || 3 union select * from v1; + +create or replace view v1 as select 2 ^ 3 || 3, 2 ^ (3 || 3), (2 ^ 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 ^ 3 || 3, 2 ^ (3 || 3), (2 ^ 3) || 3 union select * from v1; + +create or replace view v1 as select 2 BETWEEN 1 AND 3 || 3, 2 BETWEEN 1 AND (3 || 3), (2 BETWEEN 1 AND 3) || 3; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select 2 BETWEEN 1 AND 3 || 3, 2 BETWEEN 1 AND (3 || 3), (2 BETWEEN 1 AND 3) || 3 union select * from v1; + +create or replace view v1 as select charset(2 LIKE 1 ESCAPE 3 || ''), charset(2 LIKE 1 ESCAPE (3 || '')), charset((2 LIKE 1 ESCAPE 3) || ''); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; +select charset(2 LIKE 1 ESCAPE 3 || ''), charset(2 LIKE 1 ESCAPE (3 || '')), charset((2 LIKE 1 ESCAPE 3) || '') union select * from v1; + +# not precedence tests as such, but still tests of Item::print, parentheses and enum precedence + +create or replace view v1 as select ! - 1, - ! 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; + +create or replace view v1 as select ! BINARY 1, BINARY ! 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; + +create or replace view v1 as select ! (NOT 1), NOT ! 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; + +create or replace view v1 as select ! ~ 1, ~ ! 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; + +create or replace view v1 as select - BINARY 1, BINARY - 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; + +create or replace view v1 as select - (NOT 1), NOT - 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; + +create or replace view v1 as select - ~ 1, ~ - 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; + +create or replace view v1 as select BINARY (NOT 1), NOT BINARY 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; + +create or replace view v1 as select BINARY ~ 1, ~ BINARY 1; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; + +create or replace view v1 as select NOT ~ 1, ~ (NOT 1); +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; + +create or replace view v1 as select 1 IS TRUE IS FALSE, 2 IS FALSE IS UNKNOWN, 3 IS UNKNOWN IS NULL, 4 IS NULL IS TRUE; +Select view_definition from information_schema.views where table_schema='test' and table_name='v1'; + +drop view v1; diff --git a/mysql-test/main/precedence_bugs.result b/mysql-test/main/precedence_bugs.result new file mode 100644 index 00000000000..4b13e820d7f --- /dev/null +++ b/mysql-test/main/precedence_bugs.result @@ -0,0 +1,60 @@ +# +# Bug#6726: NOT BETWEEN parse failure +# +create table t1 (a int, b int); +insert into t1 values (1,2), (2,3), (3,4), (4,5); +select * from t1 where a not between 1 and 2; +a b +3 4 +4 5 +select * from t1 where a not between 1 and 2 and b not between 3 and 4; +a b +4 5 +drop table t1; +# +# MDEV-13673 Bad result in view +# +explain extended select (3-2)+1, (3/2)*1, 3-(2+1), 3/(2*1); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select 3 - 2 + 1 AS `(3-2)+1`,3 / 2 * 1 AS `(3/2)*1`,3 - (2 + 1) AS `3-(2+1)`,3 / (2 * 1) AS `3/(2*1)` +# +# MDEV-11784 View is created with invalid definition which causes ERROR 1241 (21000): Operand should contain 1 column(s) +# +create table t1 (i int, j int); +insert t1 values (1,1),(2,2); +create view v1 as select (2, 3) not in (select i, j from t1); +select * from v1; +(2, 3) not in (select i, j from t1) +1 +show create view v1; +View v1 +Create View CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select !((2,3) in (select `t1`.`i`,`t1`.`j` from `t1`)) AS `(2, 3) not in (select i, j from t1)` +character_set_client latin1 +collation_connection latin1_swedish_ci +drop view v1; +drop table t1; +# +# MDEV-23656 view: removal of parentheses results in wrong result +# +create table t1 (a int, b decimal(10,2)); +insert into t1 values (1, 10.2); +create view v1 as select avg(b) / (2 + a) from t1; +show create view v1; +View v1 +Create View CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select avg(`t1`.`b`) / (2 + `t1`.`a`) AS `avg(b) / (2 + a)` from `t1` +character_set_client latin1 +collation_connection latin1_swedish_ci +drop view v1; +drop table t1; +# +# MDEV-17408 VIEW is incorrectly defined for a combination of = and BETWEEN +# +create view v1 as select 1 like (now() between '2000-01-01' and '2012-12-12' ); +show create view v1; +View v1 +Create View CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select 1 like (current_timestamp() between '2000-01-01' and '2012-12-12') AS `1 like (now() between '2000-01-01' and '2012-12-12' )` +character_set_client latin1 +collation_connection latin1_swedish_ci +drop view v1; diff --git a/mysql-test/main/precedence_bugs.test b/mysql-test/main/precedence_bugs.test new file mode 100644 index 00000000000..6e8e624c840 --- /dev/null +++ b/mysql-test/main/precedence_bugs.test @@ -0,0 +1,41 @@ +--echo # +--echo # Bug#6726: NOT BETWEEN parse failure +--echo # +create table t1 (a int, b int); +insert into t1 values (1,2), (2,3), (3,4), (4,5); +select * from t1 where a not between 1 and 2; +select * from t1 where a not between 1 and 2 and b not between 3 and 4; +drop table t1; + +--echo # +--echo # MDEV-13673 Bad result in view +--echo # +explain extended select (3-2)+1, (3/2)*1, 3-(2+1), 3/(2*1); + +--echo # +--echo # MDEV-11784 View is created with invalid definition which causes ERROR 1241 (21000): Operand should contain 1 column(s) +--echo # +create table t1 (i int, j int); +insert t1 values (1,1),(2,2); +create view v1 as select (2, 3) not in (select i, j from t1); +select * from v1; +query_vertical show create view v1; +drop view v1; +drop table t1; + +--echo # +--echo # MDEV-23656 view: removal of parentheses results in wrong result +--echo # +create table t1 (a int, b decimal(10,2)); +insert into t1 values (1, 10.2); +create view v1 as select avg(b) / (2 + a) from t1; +query_vertical show create view v1; +drop view v1; +drop table t1; + +--echo # +--echo # MDEV-17408 VIEW is incorrectly defined for a combination of = and BETWEEN +--echo # +create view v1 as select 1 like (now() between '2000-01-01' and '2012-12-12' ); +query_vertical show create view v1; +drop view v1; diff --git a/mysql-test/main/range_vs_index_merge_innodb.result b/mysql-test/main/range_vs_index_merge_innodb.result index 497aa3d94dc..302534abddc 100644 --- a/mysql-test/main/range_vs_index_merge_innodb.result +++ b/mysql-test/main/range_vs_index_merge_innodb.result @@ -55,7 +55,7 @@ SELECT * FROM City WHERE (Population >= 100000 OR Name LIKE 'P%') AND Country='CAN' OR (Population < 100000 OR Name Like 'T%') AND Country='ARG'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City range Population,Country,Name Country 3 NULL 106 Using index condition; Using where +1 SIMPLE City index_merge Population,Country,Name Population,Name,Country 4,35,3 NULL 821 Using sort_union(Population,Name,Country); Using where EXPLAIN SELECT * FROM City WHERE Population < 200000 AND Name LIKE 'P%' AND @@ -622,7 +622,7 @@ WHERE ((Population > 101000 AND Population < 102000) AND ((ID BETWEEN 3400 AND 3800) AND (Country < 'AGO' OR Name LIKE 'Pa%')); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge PRIMARY,Population,Country,Name Population,PRIMARY 4,4 NULL 440 Using sort_union(Population,PRIMARY); Using where +1 SIMPLE City index_merge PRIMARY,Population,Country,Name Country,Name 3,35 NULL 831 Using sort_union(Country,Name); Using where EXPLAIN SELECT * FROM City WHERE ((Population > 101000 AND Population < 110000) AND @@ -630,7 +630,7 @@ WHERE ((Population > 101000 AND Population < 110000) AND ((ID BETWEEN 3790 AND 3800) AND (Country < 'C' OR Name LIKE 'P%')); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge PRIMARY,Population,Country,Name Country,Name,PRIMARY 3,35,4 NULL 87 Using sort_union(Country,Name,PRIMARY); Using where +1 SIMPLE City index_merge PRIMARY,Population,Country,Name Country,Name 7,39 NULL 678 Using sort_union(Country,Name); Using where SELECT * FROM City USE INDEX () WHERE ((Population > 101000 AND Population < 102000) AND (Country < 'C' OR Name BETWEEN 'P' AND 'S')) OR diff --git a/mysql-test/main/stat_tables_innodb.result b/mysql-test/main/stat_tables_innodb.result index e937d1ffe0f..1f848f8c8eb 100644 --- a/mysql-test/main/stat_tables_innodb.result +++ b/mysql-test/main/stat_tables_innodb.result @@ -82,7 +82,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE supplier ref PRIMARY,i_s_nationkey i_s_nationkey 5 dbt3_s001.nation.n_nationkey 1 Using index 1 SIMPLE customer ref PRIMARY,i_c_nationkey i_c_nationkey 5 dbt3_s001.nation.n_nationkey 6 Using index 1 SIMPLE orders ref|filter PRIMARY,i_o_orderdate,i_o_custkey i_o_custkey|i_o_orderdate 5|4 dbt3_s001.customer.c_custkey 15 (14%) Using where; Using rowid filter -1 SIMPLE lineitem ref PRIMARY,i_l_suppkey,i_l_orderkey,i_l_orderkey_quantity PRIMARY 4 dbt3_s001.orders.o_orderkey 4 Using where +1 SIMPLE lineitem ref PRIMARY,i_l_suppkey,i_l_orderkey,i_l_orderkey_quantity i_l_suppkey 9 dbt3_s001.supplier.s_suppkey,dbt3_s001.orders.o_orderkey 1 select n_name, sum(l_extendedprice * (1 - l_discount)) as revenue from customer, orders, lineitem, supplier, nation, region where c_custkey = o_custkey and l_orderkey = o_orderkey @@ -213,7 +213,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE supplier ref PRIMARY,i_s_nationkey i_s_nationkey 5 dbt3_s001.nation.n_nationkey 1 Using index 1 SIMPLE customer ref PRIMARY,i_c_nationkey i_c_nationkey 5 dbt3_s001.nation.n_nationkey 6 Using index 1 SIMPLE orders ref|filter PRIMARY,i_o_orderdate,i_o_custkey i_o_custkey|i_o_orderdate 5|4 dbt3_s001.customer.c_custkey 15 (14%) Using where; Using rowid filter -1 SIMPLE lineitem ref PRIMARY,i_l_suppkey,i_l_orderkey,i_l_orderkey_quantity PRIMARY 4 dbt3_s001.orders.o_orderkey 4 Using where +1 SIMPLE lineitem ref PRIMARY,i_l_suppkey,i_l_orderkey,i_l_orderkey_quantity i_l_suppkey 9 dbt3_s001.supplier.s_suppkey,dbt3_s001.orders.o_orderkey 1 select n_name, sum(l_extendedprice * (1 - l_discount)) as revenue from customer, orders, lineitem, supplier, nation, region where c_custkey = o_custkey and l_orderkey = o_orderkey diff --git a/mysql-test/main/view.result b/mysql-test/main/view.result index c1ed5d72d68..1891e3c44f7 100644 --- a/mysql-test/main/view.result +++ b/mysql-test/main/view.result @@ -6608,17 +6608,6 @@ INSERT INTO v (f1, f3) VALUES (1,1), (2,2); ERROR HY000: Can not modify more than one base table through a join view 'test.v' drop view v; drop tables t1,t2,t3; -create table t1 (i int, j int); -insert t1 values (1,1),(2,2); -create view v1 as select (2, 3) not in (select i, j from t1); -select * from v1; -(2, 3) not in (select i, j from t1) -1 -show create view v1; -View Create View character_set_client collation_connection -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select !((2,3) in (select `t1`.`i`,`t1`.`j` from `t1`)) AS `(2, 3) not in (select i, j from t1)` latin1 latin1_swedish_ci -drop view v1; -drop table t1; # # MDEV-10704: Assertion `field->field->table == table_arg' # failed in fill_record(THD*, TABLE*, List<Item>&, List<Item>&, diff --git a/mysql-test/main/view.test b/mysql-test/main/view.test index 0545810fa69..9b2baa69e8c 100644 --- a/mysql-test/main/view.test +++ b/mysql-test/main/view.test @@ -6303,17 +6303,6 @@ INSERT INTO v (f1, f3) VALUES (1,1), (2,2); drop view v; drop tables t1,t2,t3; -# -# MDEV-11784 View is created with invalid definition which causes ERROR 1241 (21000): Operand should contain 1 column(s) -# -create table t1 (i int, j int); -insert t1 values (1,1),(2,2); -create view v1 as select (2, 3) not in (select i, j from t1); -select * from v1; -show create view v1; -drop view v1; -drop table t1; - --echo # --echo # MDEV-10704: Assertion `field->field->table == table_arg' --echo # failed in fill_record(THD*, TABLE*, List<Item>&, List<Item>&, diff --git a/mysql-test/suite/encryption/r/tempfiles_encrypted.result b/mysql-test/suite/encryption/r/tempfiles_encrypted.result index d08cb33e0fc..14c754a76bc 100644 --- a/mysql-test/suite/encryption/r/tempfiles_encrypted.result +++ b/mysql-test/suite/encryption/r/tempfiles_encrypted.result @@ -4,6 +4,3962 @@ select @@encrypt_tmp_files; @@encrypt_tmp_files 1 +drop table if exists t1,t2; +drop view if exists v1; +# ######################################################################## +# # Parser tests +# ######################################################################## +# +# Check what happens when one attempts to use window function without OVER clause +create table t1 (a int, b int); +insert into t1 values (1,1),(2,2); +select row_number() from t1; +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 'from t1' at line 1 +select rank() from t1; +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 'from t1' at line 1 +# Attempt to use window function in the WHERE clause +select * from t1 where 1=rank() over (order by a); +ERROR HY000: Window function is allowed only in SELECT list and ORDER BY clause +select * from t1 where 1>row_number() over (partition by b order by a); +ERROR HY000: Window function is allowed only in SELECT list and ORDER BY clause +drop table t1; +# ######################################################################## +# # Functionality tests +# ######################################################################## +# +# Check if ROW_NUMBER() works in basic cases +create table t1(a int, b int, x char(32)); +insert into t1 values (2, 10, 'xx'); +insert into t1 values (2, 10, 'zz'); +insert into t1 values (2, 20, 'yy'); +insert into t1 values (3, 10, 'xxx'); +insert into t1 values (3, 20, 'vvv'); +select a, row_number() over (partition by a order by b) from t1; +a row_number() over (partition by a order by b) +2 1 +2 2 +2 3 +3 1 +3 2 +select a, b, x, row_number() over (partition by a order by x) from t1; +a b x row_number() over (partition by a order by x) +2 10 xx 1 +2 20 yy 2 +2 10 zz 3 +3 20 vvv 1 +3 10 xxx 2 +drop table t1; +create table t1 (pk int primary key, a int, b int); +insert into t1 values +(1, 10, 22), +(2, 11, 21), +(3, 12, 20), +(4, 13, 19), +(5, 14, 18); +select +pk, a, b, +row_number() over (order by a), +row_number() over (order by b) +from t1 +order by b; +pk a b row_number() over (order by a) row_number() over (order by b) +5 14 18 5 1 +4 13 19 4 2 +3 12 20 3 3 +2 11 21 2 4 +1 10 22 1 5 +drop table t1; +# +# Try RANK() function +# +create table t2 ( +pk int primary key, +a int +); +insert into t2 values +( 1 , 0), +( 2 , 0), +( 3 , 1), +( 4 , 1), +( 8 , 2), +( 5 , 2), +( 6 , 2), +( 7 , 2), +( 9 , 4), +(10 , 4); +select pk, a, rank() over (order by a) from t2; +pk a rank() over (order by a) +1 0 1 +10 4 9 +2 0 1 +3 1 3 +4 1 3 +5 2 5 +6 2 5 +7 2 5 +8 2 5 +9 4 9 +select pk, a, rank() over (order by a desc) from t2; +pk a rank() over (order by a desc) +1 0 9 +10 4 1 +2 0 9 +3 1 7 +4 1 7 +5 2 3 +6 2 3 +7 2 3 +8 2 3 +9 4 1 +drop table t2; +# +# Try Aggregates as window functions. With frames. +# +create table t0 (a int); +insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +create table t1 (pk int, c int); +insert into t1 select a+1,1 from t0; +update t1 set c=2 where pk not in (1,2,3,4); +select * from t1; +pk c +1 1 +2 1 +3 1 +4 1 +5 2 +6 2 +7 2 +8 2 +9 2 +10 2 +select +pk, c, +count(*) over (partition by c order by pk +rows between 2 preceding and 2 following) as CNT +from t1; +pk c CNT +1 1 3 +2 1 4 +3 1 4 +4 1 3 +5 2 3 +6 2 4 +7 2 5 +8 2 5 +9 2 4 +10 2 3 +select +pk, c, +count(*) over (partition by c order by pk +rows between 1 preceding and 2 following) as CNT +from t1; +pk c CNT +1 1 3 +2 1 4 +3 1 3 +4 1 2 +5 2 3 +6 2 4 +7 2 4 +8 2 4 +9 2 3 +10 2 2 +select +pk, c, +count(*) over (partition by c order by pk +rows between 2 preceding and current row) as CNT +from t1; +pk c CNT +1 1 1 +2 1 2 +3 1 3 +4 1 3 +5 2 1 +6 2 2 +7 2 3 +8 2 3 +9 2 3 +10 2 3 +select +pk,c, +count(*) over (partition by c order by pk rows +between 1 following and 2 following) as CNT +from t1; +pk c CNT +1 1 2 +2 1 2 +3 1 1 +4 1 0 +5 2 2 +6 2 2 +7 2 2 +8 2 2 +9 2 1 +10 2 0 +select +pk,c, +count(*) over (partition by c order by pk rows +between 2 preceding and 1 preceding) as CNT +from t1; +pk c CNT +1 1 0 +2 1 1 +3 1 2 +4 1 2 +5 2 0 +6 2 1 +7 2 2 +8 2 2 +9 2 2 +10 2 2 +select +pk, c, +count(*) over (partition by c order by pk +rows between current row and 1 following) as CNT +from t1; +pk c CNT +1 1 2 +2 1 2 +3 1 2 +4 1 1 +5 2 2 +6 2 2 +7 2 2 +8 2 2 +9 2 2 +10 2 1 +# Check ORDER BY DESC +select +pk, c, +count(*) over (partition by c order by pk desc +rows between 2 preceding and 2 following) as CNT +from t1; +pk c CNT +4 1 3 +3 1 4 +2 1 4 +1 1 3 +10 2 3 +9 2 4 +8 2 5 +7 2 5 +6 2 4 +5 2 3 +drop table t0,t1; +# +# Resolution of window names +# +create table t0 (a int); +insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +create table t1 (pk int, c int); +insert into t1 select a+1,1 from t0; +update t1 set c=2 where pk not in (1,2,3,4); +select * from t1; +pk c +1 1 +2 1 +3 1 +4 1 +5 2 +6 2 +7 2 +8 2 +9 2 +10 2 +select +pk, c, +count(*) over w1 as CNT +from t1 +window w1 as (partition by c order by pk +rows between 2 preceding and 2 following); +pk c CNT +1 1 3 +2 1 4 +3 1 4 +4 1 3 +5 2 3 +6 2 4 +7 2 5 +8 2 5 +9 2 4 +10 2 3 +select +pk, c, +count(*) over (w1 rows between 2 preceding and 2 following) as CNT +from t1 +window w1 as (partition by c order by pk); +pk c CNT +1 1 3 +2 1 4 +3 1 4 +4 1 3 +5 2 3 +6 2 4 +7 2 5 +8 2 5 +9 2 4 +10 2 3 +select +pk, c, +count(*) over (w1 order by pk rows between 2 preceding and 2 following) as CNT +from t1 +window w1 as (partition by c); +pk c CNT +1 1 3 +2 1 4 +3 1 4 +4 1 3 +5 2 3 +6 2 4 +7 2 5 +8 2 5 +9 2 4 +10 2 3 +select +pk, c, +count(*) over (w2 rows between 2 preceding and 2 following) as CNT +from t1 +window w1 as (partition by c), w2 as (w1 order by pk); +pk c CNT +1 1 3 +2 1 4 +3 1 4 +4 1 3 +5 2 3 +6 2 4 +7 2 5 +8 2 5 +9 2 4 +10 2 3 +select +pk, c, +count(*) over w3 as CNT +from t1 +window +w1 as (partition by c), +w2 as (w1 order by pk), +w3 as (w2 rows between 2 preceding and 2 following); +pk c CNT +1 1 3 +2 1 4 +3 1 4 +4 1 3 +5 2 3 +6 2 4 +7 2 5 +8 2 5 +9 2 4 +10 2 3 +select +pk, c, +count(*) over w as CNT +from t1 +window w1 as (partition by c order by pk +rows between 2 preceding and 2 following); +ERROR HY000: Window specification with name 'w' is not defined +select +pk, c, +count(*) over (w2 rows between 2 preceding and 2 following) as CNT +from t1 +window w1 as (partition by c), w1 as (order by pk); +ERROR HY000: Multiple window specifications with the same name 'w1' +select +pk, c, +count(*) over (w2 rows between 2 preceding and 2 following) as CNT +from t1 +window w1 as (partition by c), w2 as (w partition by c order by pk); +ERROR HY000: Window specification with name 'w' is not defined +select +pk, c, +count(*) over (w2 rows between 2 preceding and 2 following) as CNT +from t1 +window w1 as (partition by c), w2 as (w1 partition by c order by pk); +ERROR HY000: Window specification referencing another one 'w1' cannot contain partition list +select +pk, c, +count(*) over (w2 rows between 2 preceding and 2 following) as CNT +from t1 +window w1 as (partition by c order by pk), w2 as (w1 order by pk); +ERROR HY000: Referenced window specification 'w1' already contains order list +select +pk, c, +count(*) over w3 as CNT +from t1 +window +w1 as (partition by c), +w2 as (w1 order by pk rows between 3 preceding and 2 following), +w3 as (w2 rows between 2 preceding and 2 following); +ERROR HY000: Referenced window specification 'w2' cannot contain window frame +select +pk, c, +count(*) over w1 as CNT +from t1 +window w1 as (partition by c order by pk +rows between unbounded following and 2 following); +ERROR HY000: Unacceptable combination of window frame bound specifications +select +pk, c, +count(*) over (w1 rows between 2 preceding and unbounded preceding) as CNT +from t1 +window w1 as (partition by c order by pk); +ERROR HY000: Unacceptable combination of window frame bound specifications +select +pk, c, +count(*) over (w1 order by pk rows between current row and 2 preceding) as CNT +from t1 +window w1 as (partition by c); +ERROR HY000: Unacceptable combination of window frame bound specifications +select +pk, c, +count(*) over (w2 rows between 2 following and current row) as CNT +from t1 +window w1 as (partition by c), w2 as (w1 order by pk); +ERROR HY000: Unacceptable combination of window frame bound specifications +select +pk, c +from t1 where rank() over w1 > 2 +window w1 as (partition by c order by pk); +ERROR HY000: Window function is allowed only in SELECT list and ORDER BY clause +select +c, max(pk) as m +from t1 +group by c + rank() over w1 +window w1 as (order by m); +ERROR HY000: Window function is allowed only in SELECT list and ORDER BY clause +select +c, max(pk) as m, rank() over w1 as r +from t1 +group by c+r +window w1 as (order by m); +ERROR HY000: Window function is allowed only in SELECT list and ORDER BY clause +select +c, max(pk) as m, rank() over w1 as r +from t1 +group by c having c+r > 3 +window w1 as (order by m); +ERROR HY000: Window function is allowed only in SELECT list and ORDER BY clause +select +c, max(pk) as m, rank() over w1 as r, +rank() over (partition by r+1 order by m) +from t1 +group by c +window w1 as (order by m); +ERROR HY000: Window function is not allowed in window specification +select +c, max(pk) as m, rank() over w1 as r, +rank() over (partition by m order by r) +from t1 +group by c +window w1 as (order by m); +ERROR HY000: Window function is not allowed in window specification +select +c, max(pk) as m, rank() over w1 as r, dense_rank() over w2 as dr +from t1 +group by c +window w1 as (order by m), w2 as (partition by r order by m); +ERROR HY000: Window function is not allowed in window specification +select +pk, c, +row_number() over (partition by c order by pk +range between unbounded preceding and current row) as r +from t1; +ERROR HY000: Window frame is not allowed with 'row_number' +select +pk, c, +rank() over w1 as r +from t1 +window w1 as (partition by c order by pk +rows between 2 preceding and 2 following); +ERROR HY000: Window frame is not allowed with 'rank' +select +pk, c, +dense_rank() over (partition by c order by pk +rows between 1 preceding and 1 following) as r +from t1; +ERROR HY000: Window frame is not allowed with 'dense_rank' +select +pk, c, +rank() over w1 as r +from t1 +window w1 as (partition by c); +ERROR HY000: No order list in window specification for 'rank' +select +pk, c, +dense_rank() over (partition by c) as r +from t1; +ERROR HY000: No order list in window specification for 'dense_rank' +drop table t0,t1; +# +# MDEV-9634: Window function produces incorrect value +# +create table t0 (a int); +insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +create table t2 (part_id int, pk int, a int); +insert into t2 select +if(a<5, 0, 1), a, if(a<5, NULL, 1) from t0; +select * from t2; +part_id pk a +0 0 NULL +0 1 NULL +0 2 NULL +0 3 NULL +0 4 NULL +1 5 1 +1 6 1 +1 7 1 +1 8 1 +1 9 1 +select +part_id, pk, a, +count(a) over (partition by part_id order by pk +rows between 1 preceding and 1 following) as CNT +from t2; +part_id pk a CNT +0 0 NULL 0 +0 1 NULL 0 +0 2 NULL 0 +0 3 NULL 0 +0 4 NULL 0 +1 5 1 2 +1 6 1 3 +1 7 1 3 +1 8 1 3 +1 9 1 2 +drop table t0, t2; +# +# RANGE-type bounds +# +create table t3 ( +pk int, +val int +); +insert into t3 values +(0, 1), +(1, 1), +(2, 1), +(3, 2), +(4, 2), +(5, 2), +(6, 2); +select +val, +count(val) over (order by val +range between current row and +current row) +as CNT +from t3; +val CNT +1 3 +1 3 +1 3 +2 4 +2 4 +2 4 +2 4 +insert into t3 values +(7, 3), +(8, 3); +select +val, +count(val) over (order by val +range between current row and +current row) +as CNT +from t3; +val CNT +1 3 +1 3 +1 3 +2 4 +2 4 +2 4 +2 4 +3 2 +3 2 +drop table t3; +# Now, check with PARTITION BY +create table t4 ( +part_id int, +pk int, +val int +); +insert into t4 values +(1234, 100, 1), +(1234, 101, 1), +(1234, 102, 1), +(1234, 103, 2), +(1234, 104, 2), +(1234, 105, 2), +(1234, 106, 2), +(1234, 107, 3), +(1234, 108, 3), +(5678, 200, 1), +(5678, 201, 1), +(5678, 202, 1), +(5678, 203, 2), +(5678, 204, 2), +(5678, 205, 2), +(5678, 206, 2), +(5678, 207, 3), +(5678, 208, 3); +select +part_id, +val, +count(val) over (partition by part_id +order by val +range between current row and +current row) +as CNT +from t4; +part_id val CNT +1234 1 3 +1234 1 3 +1234 1 3 +1234 2 4 +1234 2 4 +1234 2 4 +1234 2 4 +1234 3 2 +1234 3 2 +5678 1 3 +5678 1 3 +5678 1 3 +5678 2 4 +5678 2 4 +5678 2 4 +5678 2 4 +5678 3 2 +5678 3 2 +# +# Try RANGE UNBOUNDED PRECEDING | FOLLOWING +# +select +part_id, +val, +count(val) over (partition by part_id +order by val +range between unbounded preceding and +current row) +as CNT +from t4; +part_id val CNT +1234 1 3 +1234 1 3 +1234 1 3 +1234 2 7 +1234 2 7 +1234 2 7 +1234 2 7 +1234 3 9 +1234 3 9 +5678 1 3 +5678 1 3 +5678 1 3 +5678 2 7 +5678 2 7 +5678 2 7 +5678 2 7 +5678 3 9 +5678 3 9 +select +part_id, +val, +count(val) over (partition by part_id +order by val +range between current row and +unbounded following) +as CNT +from t4; +part_id val CNT +1234 1 9 +1234 1 9 +1234 1 9 +1234 2 6 +1234 2 6 +1234 2 6 +1234 2 6 +1234 3 2 +1234 3 2 +5678 1 9 +5678 1 9 +5678 1 9 +5678 2 6 +5678 2 6 +5678 2 6 +5678 2 6 +5678 3 2 +5678 3 2 +select +part_id, +val, +count(val) over (partition by part_id +order by val +range between unbounded preceding and +unbounded following) +as CNT +from t4; +part_id val CNT +1234 1 9 +1234 1 9 +1234 1 9 +1234 2 9 +1234 2 9 +1234 2 9 +1234 2 9 +1234 3 9 +1234 3 9 +5678 1 9 +5678 1 9 +5678 1 9 +5678 2 9 +5678 2 9 +5678 2 9 +5678 2 9 +5678 3 9 +5678 3 9 +drop table t4; +# +# MDEV-9695: Wrong window frame when using RANGE BETWEEN N FOLLOWING AND PRECEDING +# +create table t1 (pk int, a int, b int); +insert into t1 values +( 1 , 0, 1), +( 2 , 0, 2), +( 3 , 1, 4), +( 4 , 1, 8), +( 5 , 2, 32), +( 6 , 2, 64), +( 7 , 2, 128), +( 8 , 2, 16); +select pk, a, b, +bit_or(b) over (partition by a order by pk ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING) as bit_or +from t1; +pk a b bit_or +1 0 1 3 +2 0 2 3 +3 1 4 12 +4 1 8 12 +5 2 32 96 +6 2 64 224 +7 2 128 208 +8 2 16 144 +# Extra ROWS n PRECEDING tests +select pk, a, b, +bit_or(b) over (partition by a order by pk ROWS BETWEEN 1 PRECEDING AND 1 PRECEDING) as bit_or +from t1; +pk a b bit_or +1 0 1 0 +2 0 2 1 +3 1 4 0 +4 1 8 4 +5 2 32 0 +6 2 64 32 +7 2 128 64 +8 2 16 128 +drop table t1; +create table t2 ( +pk int, +a int, +b int +); +insert into t2 values +( 1, 0, 1), +( 2, 0, 2), +( 3, 0, 4), +( 4, 0, 8), +( 5, 1, 16), +( 6, 1, 32), +( 7, 1, 64), +( 8, 1, 128), +( 9, 2, 256), +(10, 2, 512), +(11, 2, 1024), +(12, 2, 2048); +select pk, a, b, +bit_or(b) over (partition by a order by pk ROWS BETWEEN 1 PRECEDING AND 1 PRECEDING) as bit_or +from t2; +pk a b bit_or +1 0 1 0 +2 0 2 1 +3 0 4 2 +4 0 8 4 +5 1 16 0 +6 1 32 16 +7 1 64 32 +8 1 128 64 +9 2 256 0 +10 2 512 256 +11 2 1024 512 +12 2 2048 1024 +select pk, a, b, +bit_or(b) over (partition by a order by pk ROWS BETWEEN 2 PRECEDING AND 2 PRECEDING) as bit_or +from t2; +pk a b bit_or +1 0 1 0 +2 0 2 0 +3 0 4 1 +4 0 8 2 +5 1 16 0 +6 1 32 0 +7 1 64 16 +8 1 128 32 +9 2 256 0 +10 2 512 0 +11 2 1024 256 +12 2 2048 512 +select pk, a, b, +bit_or(b) over (partition by a order by pk ROWS BETWEEN 2 PRECEDING AND 1 PRECEDING) as bit_or +from t2; +pk a b bit_or +1 0 1 0 +2 0 2 1 +3 0 4 3 +4 0 8 6 +5 1 16 0 +6 1 32 16 +7 1 64 48 +8 1 128 96 +9 2 256 0 +10 2 512 256 +11 2 1024 768 +12 2 2048 1536 +# Check CURRENT ROW +select pk, a, b, +bit_or(b) over (partition by a order by pk ROWS BETWEEN CURRENT ROW AND CURRENT ROW) as bit_or +from t2; +pk a b bit_or +1 0 1 1 +2 0 2 2 +3 0 4 4 +4 0 8 8 +5 1 16 16 +6 1 32 32 +7 1 64 64 +8 1 128 128 +9 2 256 256 +10 2 512 512 +11 2 1024 1024 +12 2 2048 2048 +drop table t2; +# +# Try RANGE PRECEDING|FOLLWING n +# +create table t1 ( +part_id int, +pk int, +a int +); +insert into t1 values +(10, 1, 1), +(10, 2, 2), +(10, 3, 4), +(10, 4, 8), +(10, 5,26), +(10, 6,27), +(10, 7,40), +(10, 8,71), +(10, 9,72); +select +pk, a, +count(a) over (ORDER BY a +RANGE BETWEEN UNBOUNDED PRECEDING +AND 10 FOLLOWING) as cnt +from t1; +pk a cnt +1 1 4 +2 2 4 +3 4 4 +4 8 4 +5 26 6 +6 27 6 +7 40 7 +8 71 9 +9 72 9 +select +pk, a, +count(a) over (ORDER BY a DESC +RANGE BETWEEN UNBOUNDED PRECEDING +AND 10 FOLLOWING) as cnt +from t1; +pk a cnt +9 72 2 +8 71 2 +7 40 3 +6 27 5 +5 26 5 +4 8 9 +3 4 9 +2 2 9 +1 1 9 +select +pk, a, +count(a) over (ORDER BY a +RANGE BETWEEN UNBOUNDED PRECEDING +AND 1 FOLLOWING) as cnt +from t1; +pk a cnt +1 1 2 +2 2 2 +3 4 3 +4 8 4 +5 26 6 +6 27 6 +7 40 7 +8 71 9 +9 72 9 +select +pk, a, +count(a) over (ORDER BY a +RANGE BETWEEN UNBOUNDED PRECEDING +AND 10 PRECEDING) as cnt +from t1; +pk a cnt +1 1 0 +2 2 0 +3 4 0 +4 8 0 +5 26 4 +6 27 4 +7 40 6 +8 71 7 +9 72 7 +select +pk, a, +count(a) over (ORDER BY a DESC +RANGE BETWEEN UNBOUNDED PRECEDING +AND 10 PRECEDING) as cnt +from t1; +pk a cnt +9 72 0 +8 71 0 +7 40 2 +6 27 3 +5 26 3 +4 8 5 +3 4 5 +2 2 5 +1 1 5 +select +pk, a, +count(a) over (ORDER BY a +RANGE BETWEEN UNBOUNDED PRECEDING +AND 1 PRECEDING) as cnt +from t1; +pk a cnt +1 1 0 +2 2 1 +3 4 2 +4 8 3 +5 26 4 +6 27 5 +7 40 6 +8 71 7 +9 72 8 +select +pk, a, +count(a) over (ORDER BY a +RANGE BETWEEN 1 PRECEDING +AND CURRENT ROW) as cnt +from t1; +pk a cnt +1 1 1 +2 2 2 +3 4 1 +4 8 1 +5 26 1 +6 27 2 +7 40 1 +8 71 1 +9 72 2 +select +pk, a, +count(a) over (ORDER BY a DESC +RANGE BETWEEN 1 PRECEDING +AND CURRENT ROW) as cnt +from t1; +pk a cnt +9 72 1 +8 71 2 +7 40 1 +6 27 1 +5 26 2 +4 8 1 +3 4 1 +2 2 1 +1 1 2 +select +pk, a, +count(a) over (ORDER BY a +RANGE BETWEEN 1 FOLLOWING +AND 3 FOLLOWING) as cnt +from t1; +pk a cnt +1 1 2 +2 2 1 +3 4 0 +4 8 0 +5 26 1 +6 27 0 +7 40 0 +8 71 1 +9 72 0 +# Try CURRENT ROW with[out] DESC +select +pk, a, +count(a) over (ORDER BY a +RANGE BETWEEN CURRENT ROW +AND 1 FOLLOWING) as cnt +from t1; +pk a cnt +1 1 2 +2 2 1 +3 4 1 +4 8 1 +5 26 2 +6 27 1 +7 40 1 +8 71 2 +9 72 1 +select +pk, a, +count(a) over (order by a desc +range between current row +and 1 following) as cnt +from t1; +pk a cnt +9 72 2 +8 71 1 +7 40 1 +6 27 2 +5 26 1 +4 8 1 +3 4 1 +2 2 2 +1 1 1 +insert into t1 select 22, pk, a from t1; +select +part_id, pk, a, +count(a) over (PARTITION BY part_id +ORDER BY a +RANGE BETWEEN UNBOUNDED PRECEDING +AND 10 FOLLOWING) as cnt +from t1; +part_id pk a cnt +10 1 1 4 +10 2 2 4 +10 3 4 4 +10 4 8 4 +10 5 26 6 +10 6 27 6 +10 7 40 7 +10 8 71 9 +10 9 72 9 +22 1 1 4 +22 2 2 4 +22 3 4 4 +22 4 8 4 +22 5 26 6 +22 6 27 6 +22 7 40 7 +22 8 71 9 +22 9 72 9 +select +pk, a, +count(a) over (PARTITION BY part_id +ORDER BY a +RANGE BETWEEN UNBOUNDED PRECEDING +AND 1 PRECEDING) as cnt +from t1; +pk a cnt +1 1 0 +2 2 1 +3 4 2 +4 8 3 +5 26 4 +6 27 5 +7 40 6 +8 71 7 +9 72 8 +1 1 0 +2 2 1 +3 4 2 +4 8 3 +5 26 4 +6 27 5 +7 40 6 +8 71 7 +9 72 8 +drop table t1; +# Try a RANGE frame over non-integer datatype: +create table t1 ( +col1 int, +a decimal(5,3) +); +insert into t1 values (1, 0.45); +insert into t1 values (1, 0.5); +insert into t1 values (1, 0.55); +insert into t1 values (1, 1.21); +insert into t1 values (1, 1.22); +insert into t1 values (1, 3.33); +select +a, +count(col1) over (order by a +range between 0.1 preceding +and 0.1 following) +from t1; +a count(col1) over (order by a +range between 0.1 preceding +and 0.1 following) +0.450 3 +0.500 3 +0.550 3 +1.210 2 +1.220 2 +3.330 1 +drop table t1; +# +# RANGE-type frames and NULL values +# +create table t1 ( +pk int, +a int, +b int +); +insert into t1 values (1, NULL,1); +insert into t1 values (2, NULL,1); +insert into t1 values (3, NULL,1); +insert into t1 values (4, 10 ,1); +insert into t1 values (5, 11 ,1); +insert into t1 values (6, 12 ,1); +insert into t1 values (7, 13 ,1); +insert into t1 values (8, 14 ,1); +select +pk, a, +count(b) over (order by a +range between 2 preceding +and 2 following) as CNT +from t1 +order by a, pk; +pk a CNT +1 NULL 3 +2 NULL 3 +3 NULL 3 +4 10 3 +5 11 4 +6 12 5 +7 13 4 +8 14 3 +drop table t1; +# +# Try ranges that have bound1 > bound2. The standard actually allows them +# +create table t0 (a int); +insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +create table t1 (pk int, c int); +insert into t1 select a+1,1 from t0; +update t1 set c=2 where pk not in (1,2,3,4); +select * from t1; +pk c +1 1 +2 1 +3 1 +4 1 +5 2 +6 2 +7 2 +8 2 +9 2 +10 2 +select +pk, c, +count(*) over (partition by c +order by pk +rows between 1 preceding +and 2 preceding) +as cnt +from t1; +pk c cnt +1 1 0 +2 1 0 +3 1 0 +4 1 0 +5 2 0 +6 2 0 +7 2 0 +8 2 0 +9 2 0 +10 2 0 +select +pk, c, +sum(c) over (partition by c +order by pk +rows between 1 preceding +and 2 preceding) +as sum +from t1; +pk c sum +1 1 NULL +2 1 NULL +3 1 NULL +4 1 NULL +5 2 NULL +6 2 NULL +7 2 NULL +8 2 NULL +9 2 NULL +10 2 NULL +select +pk, c, +sum(c) over (partition by c +order by pk +rows between 2 following +and 1 following) +as sum +from t1; +pk c sum +1 1 NULL +2 1 NULL +3 1 NULL +4 1 NULL +5 2 NULL +6 2 NULL +7 2 NULL +8 2 NULL +9 2 NULL +10 2 NULL +select +pk, c, +count(*) over (partition by c +order by pk +range between 1 preceding +and 2 preceding) +as cnt +from t1; +pk c cnt +1 1 0 +2 1 0 +3 1 0 +4 1 0 +5 2 0 +6 2 0 +7 2 0 +8 2 0 +9 2 0 +10 2 0 +drop table t0, t1; +# +# Error checking for frame bounds +# +create table t1 (a int, b int, c varchar(32)); +insert into t1 values (1,1,'foo'); +insert into t1 values (2,2,'bar'); +select +count(*) over (order by a,b +range between unbounded preceding and current row) +from t1; +ERROR HY000: RANGE-type frame requires ORDER BY clause with single sort key +select +count(*) over (order by c +range between unbounded preceding and current row) +from t1; +ERROR HY000: Numeric datatype is required for RANGE-type frame +select +count(*) over (order by a +range between 'abcd' preceding and current row) +from t1; +ERROR HY000: Numeric datatype is required for RANGE-type frame +select +count(*) over (order by a +range between current row and 'foo' following) +from t1; +ERROR HY000: Numeric datatype is required for RANGE-type frame +# Try range frame with invalid bounds +select +count(*) over (order by a +rows between 0.5 preceding and current row) +from t1; +ERROR HY000: Integer is required for ROWS-type frame +select +count(*) over (order by a +rows between current row and 3.14 following) +from t1; +ERROR HY000: Integer is required for ROWS-type frame +# +# EXCLUDE clause is parsed but not supported +# +select +count(*) over (order by a +rows between 1 preceding and 1 following +exclude current row) +from t1; +ERROR HY000: Frame exclusion is not supported yet +select +count(*) over (order by a +range between 1 preceding and 1 following +exclude ties) +from t1; +ERROR HY000: Frame exclusion is not supported yet +select +count(*) over (order by a +range between 1 preceding and 1 following +exclude group) +from t1; +ERROR HY000: Frame exclusion is not supported yet +select +count(*) over (order by a +rows between 1 preceding and 1 following +exclude no others) +from t1; +count(*) over (order by a +rows between 1 preceding and 1 following +exclude no others) +2 +2 +drop table t1; +# +# Window function in grouping query +# +create table t1 ( +username varchar(32), +amount int +); +insert into t1 values +('user1',1), +('user1',5), +('user1',3), +('user2',10), +('user2',20), +('user2',30); +select +username, +sum(amount) as s, +rank() over (order by s desc) +from t1 +group by username; +username s rank() over (order by s desc) +user1 9 2 +user2 60 1 +drop table t1; +# +# mdev-9719: Window function in prepared statement +# +create table t1(a int, b int, x char(32)); +insert into t1 values (2, 10, 'xx'); +insert into t1 values (2, 10, 'zz'); +insert into t1 values (2, 20, 'yy'); +insert into t1 values (3, 10, 'xxx'); +insert into t1 values (3, 20, 'vvv'); +prepare stmt from 'select a, row_number() over (partition by a order by b) from t1'; +execute stmt; +a row_number() over (partition by a order by b) +2 1 +2 2 +2 3 +3 1 +3 2 +drop table t1; +# +# mdev-9754: Window name resolution in prepared statement +# +create table t0 (a int); +insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +create table t1 (pk int, c int); +insert into t1 select a+1,1 from t0; +update t1 set c=2 where pk not in (1,2,3,4); +select * from t1; +pk c +1 1 +2 1 +3 1 +4 1 +5 2 +6 2 +7 2 +8 2 +9 2 +10 2 +prepare stmt from +'select + pk, c, + count(*) over w1 as CNT +from t1 +window w1 as (partition by c order by pk + rows between 2 preceding and 2 following)'; +execute stmt; +pk c CNT +1 1 3 +2 1 4 +3 1 4 +4 1 3 +5 2 3 +6 2 4 +7 2 5 +8 2 5 +9 2 4 +10 2 3 +drop table t0,t1; +# +# EXPLAIN FORMAT=JSON support for window functions +# +create table t0 (a int); +insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +explain format=json select rank() over (order by a) from t0; +EXPLAIN +{ + "query_block": { + "select_id": 1, + "window_functions_computation": { + "sorts": { + "filesort": { + "sort_key": "t0.a" + } + }, + "temporary_table": { + "table": { + "table_name": "t0", + "access_type": "ALL", + "rows": 10, + "filtered": 100 + } + } + } + } +} +create table t1 (a int, b int, c int); +insert into t1 select a,a,a from t0; +explain format=json +select +a, +rank() over (order by sum(b)) +from t1 +group by a; +EXPLAIN +{ + "query_block": { + "select_id": 1, + "filesort": { + "sort_key": "t1.a", + "window_functions_computation": { + "sorts": { + "filesort": { + "sort_key": "sum(t1.b)" + } + }, + "temporary_table": { + "table": { + "table_name": "t1", + "access_type": "ALL", + "rows": 10, + "filtered": 100 + } + } + } + } + } +} +explain format=json +select +a, +rank() over (order by sum(b)) +from t1 +group by a +order by null; +EXPLAIN +{ + "query_block": { + "select_id": 1, + "window_functions_computation": { + "sorts": { + "filesort": { + "sort_key": "sum(t1.b)" + } + }, + "temporary_table": { + "table": { + "table_name": "t1", + "access_type": "ALL", + "rows": 10, + "filtered": 100 + } + } + } + } +} +# +# Check how window function works together with GROUP BY and HAVING +# +select b,max(a) as MX, rank() over (order by b) from t1 group by b having MX in (3,5,7); +b MX rank() over (order by b) +3 3 1 +5 5 2 +7 7 3 +explain format=json +select b,max(a) as MX, rank() over (order by b) from t1 group by b having MX in (3,5,7); +EXPLAIN +{ + "query_block": { + "select_id": 1, + "having_condition": "MX in (3,5,7)", + "filesort": { + "sort_key": "t1.b", + "window_functions_computation": { + "sorts": { + "filesort": { + "sort_key": "t1.b" + } + }, + "temporary_table": { + "table": { + "table_name": "t1", + "access_type": "ALL", + "rows": 10, + "filtered": 100 + } + } + } + } + } +} +drop table t1; +drop table t0; +# +# Building ordering index for window functions +# +create table t1 ( +pk int primary key, +a int, +b int, +c int +); +insert into t1 values +(101 , 0, 10, 1), +(102 , 0, 10, 2), +(103 , 1, 10, 3), +(104 , 1, 10, 4), +(108 , 2, 10, 5), +(105 , 2, 20, 6), +(106 , 2, 20, 7), +(107 , 2, 20, 8), +(109 , 4, 20, 9), +(110 , 4, 20, 10), +(111 , 5, NULL, 11), +(112 , 5, 1, 12), +(113 , 5, NULL, 13), +(114 , 5, NULL, 14), +(115 , 5, NULL, 15), +(116 , 6, 1, NULL), +(117 , 6, 1, 10), +(118 , 6, 1, 1), +(119 , 6, 1, NULL), +(120 , 6, 1, NULL), +(121 , 6, 1, NULL), +(122 , 6, 1, 2), +(123 , 6, 1, 20), +(124 , 6, 1, -10), +(125 , 6, 1, NULL), +(126 , 6, 1, NULL), +(127 , 6, 1, NULL); +select sum(b) over (partition by a order by b,pk +rows between unbounded preceding and current row) as c1, +avg(b) over (w1 rows between 1 preceding and 1 following) as c2, +sum(c) over (w2 rows between 1 preceding and 1 following) as c5, +avg(b) over (w1 rows between 5 preceding and 5 following) as c3, +sum(b) over (w1 rows between 1 preceding and 1 following) as c4 +from t1 +window w1 as (partition by a order by b,pk), +w2 as (partition by b order by c,pk); +c1 c2 c5 c3 c4 +1 1.0000 42 1.0000 1 +1 1.0000 NULL 1.0000 2 +10 1.0000 NULL 1.0000 3 +10 10.0000 3 10.0000 20 +10 10.0000 9 10.0000 20 +10 15.0000 9 17.5000 30 +11 1.0000 NULL 1.0000 3 +12 1.0000 -10 1.0000 2 +2 1.0000 24 1.0000 3 +20 10.0000 12 10.0000 20 +20 10.0000 6 10.0000 20 +20 20.0000 27 20.0000 40 +3 1.0000 -7 1.0000 3 +30 16.6667 13 17.5000 50 +4 1.0000 NULL 1.0000 3 +40 20.0000 19 20.0000 40 +5 1.0000 NULL 1.0000 3 +50 20.0000 21 17.5000 60 +6 1.0000 NULL 1.0000 3 +7 1.0000 13 1.0000 3 +70 20.0000 24 17.5000 40 +8 1.0000 32 1.0000 3 +9 1.0000 -9 1.0000 3 +NULL 1.0000 29 1.0000 1 +NULL NULL 24 1.0000 NULL +NULL NULL 38 1.0000 NULL +NULL NULL 42 1.0000 NULL +drop table t1; +# +# MDEV-9848: Window functions: reuse sorting and/or scanning +# +create table t1 (a int, b int, c int); +insert into t1 values +(1,3,1), +(2,2,1), +(3,1,1); +# Check using counters +flush status; +select +rank() over (partition by c order by a), +rank() over (partition by c order by b) +from t1; +rank() over (partition by c order by a) rank() over (partition by c order by b) +1 3 +2 2 +3 1 +show status like '%sort%'; +Variable_name Value +Sort_merge_passes 0 +Sort_priority_queue_sorts 0 +Sort_range 0 +Sort_rows 6 +Sort_scan 2 +flush status; +select +rank() over (partition by c order by a), +rank() over (partition by c order by a) +from t1; +rank() over (partition by c order by a) rank() over (partition by c order by a) +1 1 +2 2 +3 3 +show status like '%sort%'; +Variable_name Value +Sort_merge_passes 0 +Sort_priority_queue_sorts 0 +Sort_range 0 +Sort_rows 3 +Sort_scan 1 +explain format=json +select +rank() over (partition by c order by a), +rank() over (partition by c order by a) +from t1; +EXPLAIN +{ + "query_block": { + "select_id": 1, + "window_functions_computation": { + "sorts": { + "filesort": { + "sort_key": "t1.c, t1.a" + } + }, + "temporary_table": { + "table": { + "table_name": "t1", + "access_type": "ALL", + "rows": 3, + "filtered": 100 + } + } + } + } +} +explain format=json +select +rank() over (order by a), +row_number() over (order by a) +from t1; +EXPLAIN +{ + "query_block": { + "select_id": 1, + "window_functions_computation": { + "sorts": { + "filesort": { + "sort_key": "t1.a" + } + }, + "temporary_table": { + "table": { + "table_name": "t1", + "access_type": "ALL", + "rows": 3, + "filtered": 100 + } + } + } + } +} +explain format=json +select +rank() over (partition by c order by a), +count(*) over (partition by c) +from t1; +EXPLAIN +{ + "query_block": { + "select_id": 1, + "window_functions_computation": { + "sorts": { + "filesort": { + "sort_key": "t1.c, t1.a" + } + }, + "temporary_table": { + "table": { + "table_name": "t1", + "access_type": "ALL", + "rows": 3, + "filtered": 100 + } + } + } + } +} +explain format=json +select +count(*) over (partition by c), +rank() over (partition by c order by a) +from t1; +EXPLAIN +{ + "query_block": { + "select_id": 1, + "window_functions_computation": { + "sorts": { + "filesort": { + "sort_key": "t1.c, t1.a" + } + }, + "temporary_table": { + "table": { + "table_name": "t1", + "access_type": "ALL", + "rows": 3, + "filtered": 100 + } + } + } + } +} +drop table t1; +# +# MDEV-9847: Window functions: crash with big_tables=1 +# +create table t1(a int); +insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +set @tmp=@@big_tables; +set big_tables=1; +select rank() over (order by a) from t1; +rank() over (order by a) +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +set big_tables=@tmp; +drop table t1; +# +# Check if "ORDER BY window_func" works +# +create table t1 (s1 int, s2 char(5)); +insert into t1 values (1,'a'); +insert into t1 values (null,null); +insert into t1 values (1,null); +insert into t1 values (null,'a'); +insert into t1 values (2,'b'); +insert into t1 values (-1,''); +explain format=json +select *, row_number() over (order by s1, s2) as X from t1 order by X desc; +EXPLAIN +{ + "query_block": { + "select_id": 1, + "filesort": { + "sort_key": "row_number() over ( order by t1.s1,t1.s2) desc", + "window_functions_computation": { + "sorts": { + "filesort": { + "sort_key": "t1.s1, t1.s2" + } + }, + "temporary_table": { + "table": { + "table_name": "t1", + "access_type": "ALL", + "rows": 6, + "filtered": 100 + } + } + } + } + } +} +select *, row_number() over (order by s1, s2) as X from t1 order by X desc; +s1 s2 X +2 b 6 +1 a 5 +1 NULL 4 +-1 3 +NULL a 2 +NULL NULL 1 +drop table t1; +# +# Try window functions that are not directly present in the select list +# +create table t1 (a int, b int); +insert into t1 values +(1,3), +(2,2), +(3,1); +select +a, b, +rank() over (order by a), rank() over (order by b), +rank() over (order by a) - rank() over (order by b) as diff +from +t1; +a b rank() over (order by a) rank() over (order by b) diff +1 3 1 3 -2 +2 2 2 2 0 +3 1 3 1 2 +drop table t1; +create table t1 (i int); +insert into t1 values (1),(2); +SELECT MAX(i) OVER (PARTITION BY (i)) FROM t1; +MAX(i) OVER (PARTITION BY (i)) +1 +2 +drop table t1; +# +# Check the 0 in ROWS 0 PRECEDING +# +create table t1 ( +part_id int, +pk int, +a int +); +insert into t1 values (1, 1, 1); +insert into t1 values (1, 2, 2); +insert into t1 values (1, 3, 4); +insert into t1 values (1, 4, 8); +select +pk, a, +sum(a) over (order by pk rows between 0 preceding and current row) +from t1; +pk a sum(a) over (order by pk rows between 0 preceding and current row) +1 1 1 +2 2 2 +3 4 4 +4 8 8 +select +pk, a, +sum(a) over (order by pk rows between 1 preceding and 0 preceding) +from t1; +pk a sum(a) over (order by pk rows between 1 preceding and 0 preceding) +1 1 1 +2 2 3 +3 4 6 +4 8 12 +insert into t1 values (200, 1, 1); +insert into t1 values (200, 2, 2); +insert into t1 values (200, 3, 4); +insert into t1 values (200, 4, 8); +select +part_id, pk, a, +sum(a) over (partition by part_id order by pk rows between 0 preceding and current row) +from t1; +part_id pk a sum(a) over (partition by part_id order by pk rows between 0 preceding and current row) +1 1 1 1 +1 2 2 2 +1 3 4 4 +1 4 8 8 +200 1 1 1 +200 2 2 2 +200 3 4 4 +200 4 8 8 +select +part_id, pk, a, +sum(a) over (partition by part_id order by pk rows between 1 preceding and 0 preceding) +from t1; +part_id pk a sum(a) over (partition by part_id order by pk rows between 1 preceding and 0 preceding) +1 1 1 1 +1 2 2 3 +1 3 4 6 +1 4 8 12 +200 1 1 1 +200 2 2 3 +200 3 4 6 +200 4 8 12 +drop table t1; +# +# MDEV-9780, The "DISTINCT must not bet converted into GROUP BY when +# window functions are present" part +# +create table t1 (part_id int, a int); +insert into t1 values +(100, 1), +(100, 2), +(100, 2), +(100, 3), +(2000, 1), +(2000, 2), +(2000, 3), +(2000, 3), +(2000, 3); +select rank() over (partition by part_id order by a) from t1; +rank() over (partition by part_id order by a) +1 +2 +2 +4 +1 +2 +3 +3 +3 +select distinct rank() over (partition by part_id order by a) from t1; +rank() over (partition by part_id order by a) +1 +2 +4 +3 +explain format=json +select distinct rank() over (partition by part_id order by a) from t1; +EXPLAIN +{ + "query_block": { + "select_id": 1, + "duplicate_removal": { + "window_functions_computation": { + "sorts": { + "filesort": { + "sort_key": "t1.part_id, t1.a" + } + }, + "temporary_table": { + "table": { + "table_name": "t1", + "access_type": "ALL", + "rows": 9, + "filtered": 100 + } + } + } + } + } +} +drop table t1; +# +# MDEV-9893: Window functions with different ORDER BY lists, +# one of these lists containing an expression +# +create table t1 (s1 int, s2 char(5)); +insert into t1 values (1,'a'); +insert into t1 values (null,null); +insert into t1 values (3,null); +insert into t1 values (4,'a'); +insert into t1 values (2,'b'); +insert into t1 values (-1,''); +select +*, +ROW_NUMBER() OVER (order by s1), +CUME_DIST() OVER (order by -s1) +from t1; +s1 s2 ROW_NUMBER() OVER (order by s1) CUME_DIST() OVER (order by -s1) +-1 2 1.0000000000 +1 a 3 0.8333333333 +2 b 4 0.6666666667 +3 NULL 5 0.5000000000 +4 a 6 0.3333333333 +NULL NULL 1 0.1666666667 +drop table t1; +# +# MDEV-9925: Wrong result with aggregate function as a window function +# +create table t1 (i int); +insert into t1 values (1),(2); +select i, sum(i) over (partition by i) from t1; +i sum(i) over (partition by i) +1 1 +2 2 +drop table t1; +# +# MDEV-9922: Assertion `!join->only_const_tables() && fsort' failed in int create_sort_index +# +create view v1 as select 1 as i; +select rank() over (order by i) from v1; +rank() over (order by i) +1 +drop view v1; +# +# MDEV-10097: Assertion `count > 0' failed in Item_sum_sum::add_helper(bool) +# +CREATE TABLE `orders` ( +`o_orderkey` int(11) NOT NULL, +`o_custkey` int(11) DEFAULT NULL, +PRIMARY KEY (`o_orderkey`) +) DEFAULT CHARSET=latin1; +INSERT INTO `orders` VALUES (59908,242); +INSERT INTO `orders` VALUES (59940,238); +SELECT o_custkey, avg(o_custkey) OVER (PARTITION BY abs(o_custkey) +ORDER BY o_custkey +RANGE BETWEEN 15 FOLLOWING +AND 15 FOLLOWING) from orders; +o_custkey avg(o_custkey) OVER (PARTITION BY abs(o_custkey) +ORDER BY o_custkey +RANGE BETWEEN 15 FOLLOWING +AND 15 FOLLOWING) +238 NULL +242 NULL +DROP table orders; +# +# MDEV-10842: window functions with the same order column +# but different directions +# +create table t1 ( +pk int primary key, +a int, +b int, +c char(10) +); +insert into t1 values +( 1, 0, 1, 'one'), +( 2, 0, 2, 'two'), +( 3, 0, 3, 'three'), +( 4, 1, 1, 'one'), +( 5, 1, 1, 'two'), +( 6, 1, 2, 'three'), +( 7, 2, NULL, 'n_one'), +( 8, 2, 1, 'n_two'), +( 9, 2, 2, 'n_three'), +(10, 2, 0, 'n_four'), +(11, 2, 10, NULL); +select pk, +row_number() over (order by pk desc) as r_desc, +row_number() over (order by pk asc) as r_asc +from t1; +pk r_desc r_asc +11 1 11 +10 2 10 +9 3 9 +8 4 8 +7 5 7 +6 6 6 +5 7 5 +4 8 4 +3 9 3 +2 10 2 +1 11 1 +drop table t1; +# +# MDEV-10874: two window functions with compatible sorting +# +create table t1 ( +pk int primary key, +a int, +b int, +c char(10), +d decimal(10, 3), +e real +); +insert into t1 values +( 1, 0, 1, 'one', 0.1, 0.001), +( 2, 0, 2, 'two', 0.2, 0.002), +( 3, 0, 3, 'three', 0.3, 0.003), +( 4, 1, 2, 'three', 0.4, 0.004), +( 5, 1, 1, 'two', 0.5, 0.005), +( 6, 1, 1, 'one', 0.6, 0.006), +( 7, 2, NULL, 'n_one', 0.5, 0.007), +( 8, 2, 1, 'n_two', NULL, 0.008), +( 9, 2, 2, NULL, 0.7, 0.009), +(10, 2, 0, 'n_four', 0.8, 0.010), +(11, 2, 10, NULL, 0.9, NULL); +select pk, a, d, +sum(d) over (partition by a order by pk +ROWS between 1 preceding and current row) as sum_1, +sum(d) over (order by a +ROWS BETWEEN 1 preceding and 2 following) as sum_2 +from t1; +pk a d sum_1 sum_2 +1 0 0.100 0.100 0.600 +2 0 0.200 0.300 1.000 +3 0 0.300 0.500 1.400 +4 1 0.400 0.400 1.800 +5 1 0.500 0.900 2.000 +6 1 0.600 1.100 1.600 +7 2 0.500 0.500 1.800 +8 2 NULL 0.500 2.000 +9 2 0.700 0.700 2.400 +10 2 0.800 1.500 2.400 +11 2 0.900 1.700 1.700 +explain format=json +select pk, a, d, +sum(d) over (partition by a order by pk +ROWS between 1 preceding and current row) as sum_1, +sum(d) over (order by a +ROWS BETWEEN 1 preceding and 2 following) as sum_2 +from t1; +EXPLAIN +{ + "query_block": { + "select_id": 1, + "window_functions_computation": { + "sorts": { + "filesort": { + "sort_key": "t1.a, t1.pk" + } + }, + "temporary_table": { + "table": { + "table_name": "t1", + "access_type": "ALL", + "rows": 11, + "filtered": 100 + } + } + } + } +} +select pk, a, d, +sum(d) over (partition by a order by pk desc +ROWS between 1 preceding and current row) as sum_1, +sum(d) over (order by a +ROWS BETWEEN 1 preceding and 2 following) as sum_2 +from t1; +pk a d sum_1 sum_2 +3 0 0.300 0.300 0.600 +2 0 0.200 0.500 1.200 +1 0 0.100 0.300 1.400 +6 1 0.600 0.600 1.600 +5 1 0.500 1.100 2.400 +4 1 0.400 0.900 2.600 +11 2 0.900 0.900 2.800 +10 2 0.800 1.700 2.400 +9 2 0.700 1.500 2.000 +8 2 NULL 0.700 1.200 +7 2 0.500 0.500 0.500 +drop table t1; +# +# MDEV-9941: two window functions with compatible partitions +# +create table t1 ( +a int, +b int, +c int +); +insert into t1 values +(10, 1, 1), +(10, 3, 10), +(10, 1, 10), +(10, 3, 100), +(10, 5, 1000), +(10, 1, 100); +explain format=json +select +a,b,c, +row_number() over (partition by a), +row_number() over (partition by a, b) +from t1; +EXPLAIN +{ + "query_block": { + "select_id": 1, + "window_functions_computation": { + "sorts": { + "filesort": { + "sort_key": "t1.a, t1.b" + } + }, + "temporary_table": { + "table": { + "table_name": "t1", + "access_type": "ALL", + "rows": 6, + "filtered": 100 + } + } + } + } +} +drop table t1; +# +# MDEV-10815: Window Function Expressions Wrong Results +# +create table t(a decimal(35,10), b int); +insert into t(a,b) values(1,1); +insert into t(a,b) values(2,1); +insert into t(a,b) values(0,1); +insert into t(a,b) values(1, 2); +insert into t(a,b) values(1.5,2); +insert into t(a,b) values(3, 2); +insert into t(a,b) values(4.5,2); +select a, b, +sum(t.a) over (partition by t.b order by a) as simple_sum, +sum(t.a) over (partition by t.b order by a) + 1 as sum_and_const, +sum(t.b) over (partition by t.b order by a) + sum(t.a) over (partition by t.b order by a) as sum_and_sum +from t +order by t.b, t.a; +a b simple_sum sum_and_const sum_and_sum +0.0000000000 1 0.0000000000 1.0000000000 1.0000000000 +1.0000000000 1 1.0000000000 2.0000000000 3.0000000000 +2.0000000000 1 3.0000000000 4.0000000000 6.0000000000 +1.0000000000 2 1.0000000000 2.0000000000 3.0000000000 +1.5000000000 2 2.5000000000 3.5000000000 6.5000000000 +3.0000000000 2 5.5000000000 6.5000000000 11.5000000000 +4.5000000000 2 10.0000000000 11.0000000000 18.0000000000 +drop table t; +# +# MDEV-10669: Crash in SELECT with window function used +# +create table t(a decimal(35,10), b int); +insert into t(a,b) values(1,1); +insert into t(a,b) values(2,1); +insert into t(a,b) values(0,1); +SELECT (CASE WHEN sum(t.a) over (partition by t.b)=0 THEN null ELSE null END) AS a FROM t; +a +NULL +NULL +NULL +SELECT ifnull(((t.a) / CASE WHEN sum(t.a) over(partition by t.b) =0 then null else null end) ,0) from t; +ifnull(((t.a) / CASE WHEN sum(t.a) over(partition by t.b) =0 then null else null end) ,0) +0.00000000000000 +0.00000000000000 +0.00000000000000 +SELECT sum(t.a) over (partition by t.b order by a), +sqrt(ifnull((sum(t.a) over (partition by t.b order by a)), 0)) +from t; +sum(t.a) over (partition by t.b order by a) sqrt(ifnull((sum(t.a) over (partition by t.b order by a)), 0)) +0.0000000000 0 +1.0000000000 1 +3.0000000000 1.7320508075688772 +drop table t; +# +# MDEV-10868: view definitions with window functions +# +create table t0 (a int); +insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +create table t1 (pk int, c int); +insert into t1 select a+1,1 from t0; +update t1 set c=2 where pk not in (1,2,3,4); +select * from t1; +pk c +1 1 +2 1 +3 1 +4 1 +5 2 +6 2 +7 2 +8 2 +9 2 +10 2 +select pk, c, c/count(*) over (partition by c order by pk +rows between 1 preceding and 2 following) as CNT +from t1; +pk c CNT +1 1 0.3333 +2 1 0.2500 +3 1 0.3333 +4 1 0.5000 +5 2 0.6667 +6 2 0.5000 +7 2 0.5000 +8 2 0.5000 +9 2 0.6667 +10 2 1.0000 +create view v1 as select pk, c, c/count(*) over (partition by c order by pk +rows between 1 preceding and 2 following) as CNT +from t1; +show create view v1; +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`pk` AS `pk`,`t1`.`c` AS `c`,`t1`.`c` / count(0) over ( partition by `t1`.`c` order by `t1`.`pk` rows between 1 preceding and 2 following ) AS `CNT` from `t1` latin1 latin1_swedish_ci +select * from v1; +pk c CNT +1 1 0.3333 +2 1 0.2500 +3 1 0.3333 +4 1 0.5000 +5 2 0.6667 +6 2 0.5000 +7 2 0.5000 +8 2 0.5000 +9 2 0.6667 +10 2 1.0000 +select pk, c, c/count(*) over w1 as CNT from t1 +window w1 as (partition by c order by pk rows between 1 preceding and 2 following); +pk c CNT +1 1 0.3333 +2 1 0.2500 +3 1 0.3333 +4 1 0.5000 +5 2 0.6667 +6 2 0.5000 +7 2 0.5000 +8 2 0.5000 +9 2 0.6667 +10 2 1.0000 +create view v2 as select pk, c, c/count(*) over w1 as CNT from t1 +window w1 as (partition by c order by pk rows between 1 preceding and 2 following); +show create view v2; +View Create View character_set_client collation_connection +v2 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select `t1`.`pk` AS `pk`,`t1`.`c` AS `c`,`t1`.`c` / count(0) over ( partition by `t1`.`c` order by `t1`.`pk` rows between 1 preceding and 2 following ) AS `CNT` from `t1` latin1 latin1_swedish_ci +select * from v2; +pk c CNT +1 1 0.3333 +2 1 0.2500 +3 1 0.3333 +4 1 0.5000 +5 2 0.6667 +6 2 0.5000 +7 2 0.5000 +8 2 0.5000 +9 2 0.6667 +10 2 1.0000 +select pk, c, c/count(*) over w1 as CNT from t1 +window w1 as (partition by c order by pk rows unbounded preceding); +pk c CNT +1 1 1.0000 +2 1 0.5000 +3 1 0.3333 +4 1 0.2500 +5 2 2.0000 +6 2 1.0000 +7 2 0.6667 +8 2 0.5000 +9 2 0.4000 +10 2 0.3333 +create view v3 as select pk, c, c/count(*) over w1 as CNT from t1 +window w1 as (partition by c order by pk rows unbounded preceding); +show create view v3; +View Create View character_set_client collation_connection +v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS select `t1`.`pk` AS `pk`,`t1`.`c` AS `c`,`t1`.`c` / count(0) over ( partition by `t1`.`c` order by `t1`.`pk` rows between unbounded preceding and current row ) AS `CNT` from `t1` latin1 latin1_swedish_ci +select * from v3; +pk c CNT +1 1 1.0000 +2 1 0.5000 +3 1 0.3333 +4 1 0.2500 +5 2 2.0000 +6 2 1.0000 +7 2 0.6667 +8 2 0.5000 +9 2 0.4000 +10 2 0.3333 +select pk, c, c/count(*) over (partition by c order by pk +range between 3 preceding and current row) as CNT +from t1; +pk c CNT +1 1 1.0000 +2 1 0.5000 +3 1 0.3333 +4 1 0.2500 +5 2 2.0000 +6 2 1.0000 +7 2 0.6667 +8 2 0.5000 +9 2 0.5000 +10 2 0.5000 +create view v4 as select pk, c, c/count(*) over (partition by c order by pk +range between 3 preceding and current row) as CNT +from t1; +show create view v4; +View Create View character_set_client collation_connection +v4 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v4` AS select `t1`.`pk` AS `pk`,`t1`.`c` AS `c`,`t1`.`c` / count(0) over ( partition by `t1`.`c` order by `t1`.`pk` range between 3 preceding and current row ) AS `CNT` from `t1` latin1 latin1_swedish_ci +select * from v4; +pk c CNT +1 1 1.0000 +2 1 0.5000 +3 1 0.3333 +4 1 0.2500 +5 2 2.0000 +6 2 1.0000 +7 2 0.6667 +8 2 0.5000 +9 2 0.5000 +10 2 0.5000 +drop view v1,v2,v3,v4; +drop table t0,t1; +# +# MDEV-10875: window function in subquery +# +CREATE TABLE t1 (i INT); +INSERT INTO t1 VALUES (3),(1); +CREATE TABLE t2 (c VARCHAR(8)); +INSERT INTO t2 VALUES ('foo'),('bar'),('foo'); +SELECT COUNT(*) OVER (PARTITION BY c) FROM t2; +COUNT(*) OVER (PARTITION BY c) +1 +2 +2 +SELECT * FROM t1 WHERE i IN ( SELECT COUNT(*) OVER (PARTITION BY c) FROM t2 ); +i +1 +DROP TABLE t1, t2; +# +# MDEV-9976: window function without PARTITION BY and ORDER BY +# +CREATE TABLE t1 (id int, a int); +INSERT INTO t1 VALUES +(1,1000), (2,1100), (3,1800), (4,1500), (5,1700), (6,1200), +(7,2000), (8,2100), (9,1600); +SELECT id, sum(a) OVER (PARTITION BY id +ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) +FROM t1; +id sum(a) OVER (PARTITION BY id +1 1000 +2 1100 +3 1800 +4 1500 +5 1700 +6 1200 +7 2000 +8 2100 +9 1600 +ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) +SELECT id, sum(a) OVER (ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) +FROM t1; +id sum(a) OVER (ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) +1 14000 +2 13000 +3 5900 +4 10700 +5 7600 +6 11900 +7 4100 +8 2100 +9 9200 +DROP TABLE t1; +# +# MDEV-11867: window function with aggregation +# over the result of grouping +# +create table t1 ( +username varchar(32), +amount int +); +insert into t1 values +('user1',1), +('user1',5), +('user1',3), +('user2',10), +('user2',20), +('user2',30); +select username, sum(amount) as s, avg(sum(amount)) over (order by s desc) +from t1 +group by username; +username s avg(sum(amount)) over (order by s desc) +user1 9 34.5000 +user2 60 60.0000 +select username, sum(amount), avg(sum(amount)) over (order by sum(amount) desc) +from t1 +group by username; +username sum(amount) avg(sum(amount)) over (order by sum(amount) desc) +user1 9 34.5000 +user2 60 60.0000 +drop table t1; +# +# MDEV-11594: window function over implicit grouping +# +create table t1 (id int); +insert into t1 values (1), (2), (3), (2); +select sum(id) over (order by sum(id)) from t1; +sum(id) over (order by sum(id)) +1 +select sum(sum(id)) over (order by sum(id)) from t1; +sum(sum(id)) over (order by sum(id)) +8 +drop table t1; +# +# MDEV-9923: integer constant in order by list +# of window specification +# +create table t1 (id int); +insert into t1 values (1), (2), (3), (2); +select rank() over (order by 1) from t1; +rank() over (order by 1) +1 +1 +1 +1 +select rank() over (order by 2) from t1; +rank() over (order by 2) +1 +1 +1 +1 +select rank() over (partition by id order by 2) from t1; +rank() over (partition by id order by 2) +1 +1 +1 +1 +drop table t1; +# +# MDEV-10660: view using a simple window function +# +create table t1 (id int); +insert into t1 values (1), (2), (3), (2); +create view v1(id,rnk) as +select id, rank() over (order by id) from t1; +show create view v1; +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`id` AS `id`,rank() over ( order by `t1`.`id`) AS `rnk` from `t1` latin1 latin1_swedish_ci +select id, rank() over (order by id) from t1; +id rank() over (order by id) +1 1 +2 2 +2 2 +3 4 +select * from v1; +id rnk +1 1 +2 2 +2 2 +3 4 +drop view v1; +drop table t1; +# +# MDEV-11138: window function in the query without tables +# +select row_number() over (); +row_number() over () +1 +select count(*) over (); +count(*) over () +1 +select sum(5) over (); +sum(5) over () +5 +select row_number() over (), sum(5) over (); +row_number() over () sum(5) over () +1 5 +select row_number() over (order by 2); +row_number() over (order by 2) +1 +select row_number() over (partition by 2); +row_number() over (partition by 2) +1 +select row_number() over (partition by 4 order by 1+2); +row_number() over (partition by 4 order by 1+2) +1 +# +# MDEV-11999: execution of prepared statement for +# tableless query with window functions +# +prepare stmt from +"select row_number() over (partition by 4 order by 1+2)"; +execute stmt; +row_number() over (partition by 4 order by 1+2) +1 +execute stmt; +row_number() over (partition by 4 order by 1+2) +1 +deallocate prepare stmt; +# +# MDEV-11745: window function with min/max +# +create table t1 (i int, b int); +insert into t1 values +(1,1),(2,1),(3,1),(4,4),(5,4),(6,4),(7,8),(8,8),(9,8),(10,8); +select b, min(i) over (partition by b) as f +from t1 as tt +order by i; +b f +1 1 +1 1 +1 1 +4 4 +4 4 +4 4 +8 7 +8 7 +8 7 +8 7 +select b, min(i) over (partition by b) as f +from (select * from t1) as tt +order by i; +b f +1 1 +1 1 +1 1 +4 4 +4 4 +4 4 +8 7 +8 7 +8 7 +8 7 +select b, min(i+10) over (partition by b) as f +from t1 as tt +order by i; +b f +1 11 +1 11 +1 11 +4 14 +4 14 +4 14 +8 17 +8 17 +8 17 +8 17 +select b, min(i) over (partition by b) as f +from (select i+10 as i, b from t1) as tt +order by i; +b f +1 11 +1 11 +1 11 +4 14 +4 14 +4 14 +8 17 +8 17 +8 17 +8 17 +select b, min(i+20) over (partition by b) as f +from (select i+10 as i, b from t1) as tt +order by i; +b f +1 31 +1 31 +1 31 +4 34 +4 34 +4 34 +8 37 +8 37 +8 37 +8 37 +select b, max(i) over (partition by b) as f +from t1 as tt +order by i; +b f +1 3 +1 3 +1 3 +4 6 +4 6 +4 6 +8 10 +8 10 +8 10 +8 10 +select b, max(i) over (partition by b) as f +from (select * from t1) as tt +order by i; +b f +1 3 +1 3 +1 3 +4 6 +4 6 +4 6 +8 10 +8 10 +8 10 +8 10 +select b, max(i+10) over (partition by b) as f +from t1 as tt +order by i; +b f +1 13 +1 13 +1 13 +4 16 +4 16 +4 16 +8 20 +8 20 +8 20 +8 20 +select b, max(i) over (partition by b) as f +from (select i+10 as i, b from t1) as tt +order by i; +b f +1 13 +1 13 +1 13 +4 16 +4 16 +4 16 +8 20 +8 20 +8 20 +8 20 +select b, max(i+20) over (partition by b) as f +from (select i+10 as i, b from t1) as tt +order by i; +b f +1 33 +1 33 +1 33 +4 36 +4 36 +4 36 +8 40 +8 40 +8 40 +8 40 +select max(i), max(i), sum(i), count(i) +from t1 as tt +group by b; +max(i) max(i) sum(i) count(i) +3 3 6 3 +6 6 15 3 +10 10 34 4 +select max(i), min(sum(i)) over (partition by count(i)) f +from t1 as tt +group by b; +max(i) f +3 6 +6 6 +10 34 +select max(i), min(sum(i)) over (partition by count(i)) f +from (select * from t1) as tt +group by b; +max(i) f +3 6 +6 6 +10 34 +select max(i+10), min(sum(i)+10) over (partition by count(i)) f +from t1 as tt +group by b; +max(i+10) f +13 16 +16 16 +20 44 +select max(i), max(i), sum(i), count(i) +from (select i+10 as i, b from t1) as tt +group by b; +max(i) max(i) sum(i) count(i) +13 13 36 3 +16 16 45 3 +20 20 74 4 +select max(i), min(sum(i)) over (partition by count(i)) f +from (select i+10 as i, b from t1) as tt +group by b; +max(i) f +13 36 +16 36 +20 74 +select max(i), min(i), min(max(i)-min(i)) over (partition by count(i)) f +from (select i+10 as i, b from t1) as tt +group by b; +max(i) min(i) f +13 11 2 +16 14 2 +20 17 3 +drop table t1; +# +# MDEV-12015: window function over select with WHERE +# that is always FALSE +# +CREATE TABLE t1 (i INT); +INSERT INTO t1 VALUES (3), (1), (2); +SELECT i, ROW_NUMBER() OVER () FROM t1 WHERE 1 = 2; +i ROW_NUMBER() OVER () +SELECT i, COUNT(*) OVER () FROM t1 WHERE 1 = 2; +i COUNT(*) OVER () +DROP TABLE t1; +# +# MDEV-12051: window function in query with implicit grouping +# on always empty set +# +create table t1 (a int, b varchar(8)); +insert into t1 values (1,'foo'),(2,'bar'); +select max(a), row_number() over () from t1 where a > 10; +max(a) row_number() over () +NULL 1 +select max(a), sum(max(a)) over () from t1 where a > 10; +max(a) sum(max(a)) over () +NULL NULL +select max(a), sum(max(a)) over (partition by max(a)) from t1 where a > 10; +max(a) sum(max(a)) over (partition by max(a)) +NULL NULL +select max(a), row_number() over () from t1 where 1 = 2; +max(a) row_number() over () +NULL 1 +select max(a), sum(max(a)) over () from t1 where 1 = 2; +max(a) sum(max(a)) over () +NULL NULL +select max(a), sum(max(a)) over (partition by max(a)) from t1 where 1 = 2; +max(a) sum(max(a)) over (partition by max(a)) +NULL NULL +select max(a), row_number() over () from t1 where 1 = 2 +having max(a) is not null; +max(a) row_number() over () +select max(a), sum(max(a)) over () from t1 where 1 = 2 +having max(a) is not null; +max(a) sum(max(a)) over () +drop table t1; +# +# MDEV-10885: window function in query with implicit grouping +# with constant condition evaluated to false +# +CREATE TABLE t1 (a INT, b VARCHAR(8)); +INSERT INTO t1 VALUES (1,'foo'),(2,'bar'); +CREATE TABLE t2 (c INT); +INSERT INTO t2 VALUES (3),(4); +CREATE TABLE t3 (d INT); +INSERT INTO t3 VALUES (5),(6); +SELECT MAX(a), ROW_NUMBER() OVER (PARTITION BY MAX(a)) FROM t1 +WHERE EXISTS ( SELECT * FROM t2 WHERE c IN ( SELECT MAX(d) FROM t3 ) ); +MAX(a) ROW_NUMBER() OVER (PARTITION BY MAX(a)) +NULL 1 +SELECT MAX(a), COUNT(MAX(a)) OVER (PARTITION BY MAX(a)) FROM t1 +WHERE EXISTS ( SELECT * FROM t2 WHERE c IN ( SELECT MAX(d) FROM t3 ) ); +MAX(a) COUNT(MAX(a)) OVER (PARTITION BY MAX(a)) +NULL 0 +SELECT MAX(a), SUM(MAX(a)) OVER (PARTITION BY MAX(a)) FROM t1 +WHERE EXISTS ( SELECT * FROM t2 WHERE c IN ( SELECT MAX(d) FROM t3 ) ); +MAX(a) SUM(MAX(a)) OVER (PARTITION BY MAX(a)) +NULL NULL +SELECT MAX(a), ROW_NUMBER() OVER (PARTITION BY MAX(a)) FROM t1 +WHERE EXISTS ( SELECT * FROM t2 WHERE c IN ( SELECT MAX(d) FROM t3 ) ) +HAVING MAX(a) IS NOT NULL; +MAX(a) ROW_NUMBER() OVER (PARTITION BY MAX(a)) +SELECT a, MAX(a), ROW_NUMBER() OVER (PARTITION BY b) FROM t1 +WHERE EXISTS ( SELECT * FROM t2 WHERE c IN ( SELECT MAX(d) FROM t3 ) ); +a MAX(a) ROW_NUMBER() OVER (PARTITION BY b) +NULL NULL 1 +SELECT a, COUNT(a), AVG(a) OVER (PARTITION BY b) FROM t1 +WHERE EXISTS ( SELECT * FROM t2 WHERE c IN ( SELECT MAX(d) FROM t3 ) ); +a COUNT(a) AVG(a) OVER (PARTITION BY b) +NULL 0 NULL +SELECT a, MAX(a), AVG(a) OVER (PARTITION BY b) FROM t1 +WHERE EXISTS ( SELECT * FROM t2 WHERE c IN ( SELECT MAX(d) FROM t3 ) ); +a MAX(a) AVG(a) OVER (PARTITION BY b) +NULL NULL NULL +DROP TABLE t1,t2,t3; +# +# MDEV-10859: Wrong result of aggregate window function in query +# with HAVING and no ORDER BY +# +create table empsalary (depname varchar(32), empno smallint primary key, salary int); +insert into empsalary values +('develop', 1, 5000), ('develop', 2, 4000),('sales', 3, '6000'),('sales', 4, 5000); +SELECT depname, empno, salary, avg(salary) OVER (PARTITION BY depname) FROM empsalary; +depname empno salary avg(salary) OVER (PARTITION BY depname) +develop 1 5000 4500.0000 +develop 2 4000 4500.0000 +sales 3 6000 5500.0000 +sales 4 5000 5500.0000 +SELECT depname, empno, salary, avg(salary) OVER (PARTITION BY depname) FROM empsalary ORDER BY depname; +depname empno salary avg(salary) OVER (PARTITION BY depname) +develop 1 5000 4500.0000 +develop 2 4000 4500.0000 +sales 3 6000 5500.0000 +sales 4 5000 5500.0000 +# +# These last 2 should have the same row results, ignoring order. +# +SELECT depname, empno, salary, avg(salary) OVER (PARTITION BY depname) FROM empsalary HAVING empno > 1; +depname empno salary avg(salary) OVER (PARTITION BY depname) +develop 2 4000 4000.0000 +sales 3 6000 5500.0000 +sales 4 5000 5500.0000 +SELECT depname, empno, salary, avg(salary) OVER (PARTITION BY depname) FROM empsalary HAVING empno > 1 ORDER BY depname; +depname empno salary avg(salary) OVER (PARTITION BY depname) +develop 2 4000 4000.0000 +sales 3 6000 5500.0000 +sales 4 5000 5500.0000 +drop table empsalary; +# +# MDEV-11868: min(distinct) over () returns wrong value +# +create table TDEC (CDEC int, RNUM int); +create view VDEC as select * from TDEC; +insert into TDEC (CDEC) values (null),(-1),(0),(1),(0),(10); +select TDEC.CDEC, min(TDEC.CDEC) over () from TDEC; +CDEC min(TDEC.CDEC) over () +NULL -1 +-1 -1 +0 -1 +0 -1 +1 -1 +10 -1 +select VDEC.CDEC, min(VDEC.CDEC) over () from VDEC; +CDEC min(VDEC.CDEC) over () +NULL -1 +-1 -1 +0 -1 +0 -1 +1 -1 +10 -1 +select TDEC.CDEC, max(TDEC.CDEC) over () from TDEC; +CDEC max(TDEC.CDEC) over () +NULL 10 +-1 10 +0 10 +0 10 +1 10 +10 10 +select VDEC.CDEC, max(VDEC.CDEC) over () from VDEC; +CDEC max(VDEC.CDEC) over () +NULL 10 +-1 10 +0 10 +0 10 +1 10 +10 10 +select TDEC.CDEC, min(distinct TDEC.CDEC) over () from TDEC; +CDEC min(distinct TDEC.CDEC) over () +NULL -1 +-1 -1 +0 -1 +0 -1 +1 -1 +10 -1 +select VDEC.CDEC, min(distinct VDEC.CDEC) over () from VDEC; +CDEC min(distinct VDEC.CDEC) over () +NULL -1 +-1 -1 +0 -1 +0 -1 +1 -1 +10 -1 +select TDEC.CDEC, max(distinct TDEC.CDEC) over () from TDEC; +CDEC max(distinct TDEC.CDEC) over () +NULL 10 +-1 10 +0 10 +0 10 +1 10 +10 10 +select VDEC.CDEC, max(distinct VDEC.CDEC) over () from VDEC; +CDEC max(distinct VDEC.CDEC) over () +NULL 10 +-1 10 +0 10 +0 10 +1 10 +10 10 +# +# These should be removed once support for them is added. +# +select TDEC.CDEC, count(distinct TDEC.CDEC) over () from TDEC; +ERROR 42000: This version of MariaDB doesn't yet support 'COUNT(DISTINCT) aggregate as window function' +select VDEC.CDEC, count(distinct VDEC.CDEC) over () from VDEC; +ERROR 42000: This version of MariaDB doesn't yet support 'COUNT(DISTINCT) aggregate as window function' +select TDEC.CDEC, sum(distinct TDEC.CDEC) over () from TDEC; +ERROR 42000: This version of MariaDB doesn't yet support 'SUM(DISTINCT) aggregate as window function' +select VDEC.CDEC, sum(distinct VDEC.CDEC) over () from VDEC; +ERROR 42000: This version of MariaDB doesn't yet support 'SUM(DISTINCT) aggregate as window function' +select TDEC.CDEC, avg(distinct TDEC.CDEC) over () from TDEC; +ERROR 42000: This version of MariaDB doesn't yet support 'AVG(DISTINCT) aggregate as window function' +select VDEC.CDEC, avg(distinct VDEC.CDEC) over () from VDEC; +ERROR 42000: This version of MariaDB doesn't yet support 'AVG(DISTINCT) aggregate as window function' +select TDEC.CDEC, GROUP_CONCAT(TDEC.CDEC) over () from TDEC; +ERROR 42000: This version of MariaDB doesn't yet support 'GROUP_CONCAT() aggregate as window function' +select VDEC.CDEC, GROUP_CONCAT(distinct VDEC.CDEC) over () from VDEC; +ERROR 42000: This version of MariaDB doesn't yet support 'GROUP_CONCAT() aggregate as window function' +drop table TDEC; +drop view VDEC; +# +# MDEV-10700: 10.2.2 windowing function returns incorrect result +# +create table t(a int,b int, c int , d int); +insert into t(a,b,c,d) values(1, rand(10)*1000, rand(10)*1000, rand(10)*1000); +insert into t(a,b,c,d) values(1, rand(10)*1000, rand(10)*1000, rand(10)*1000); +replace into t(a,b,c,d) select 1, rand(10)*1000, rand(10)*1000, rand(10)*1000 from t t1, t t2, t t3, t t4, t t5, t t6, t t7, t t8, t t9, t t10, t t11, t t12, t t13, t t14, t t15, t t16, t t17; +select count(distinct s) from (select sum(d) over(partition by a,b,c) as s from t) Z where s > 0; +count(distinct s) +993 +select count(distinct s) from (select sum(d) as s from t group by a,b,c) Z where s > 0; +count(distinct s) +993 +select count(distinct s) from (select sum(d) over(partition by a,b) as s from t) Z where s > 0; +count(distinct s) +993 +select count(distinct s) from (select sum(d) as s from t group by a,b) Z where s > 0; +count(distinct s) +993 +select count(distinct s) from (select sum(d) over(partition by a) as s from t) Z where s > 0; +count(distinct s) +1 +select count(distinct s) from (select sum(d) as s from t group by a) Z where s > 0; +count(distinct s) +1 +drop table t; +# +# MDEV-9924: window function in query with group by optimized away +# +create table t1 (i int); +insert into t1 values (2),(3),(1); +select row_number() over () from t1 group by 1+2; +row_number() over () +1 +select max(i), row_number() over () from t1 group by 1+2; +max(i) row_number() over () +3 1 +select rank() over (order by max(i)) from t1 group by 1+2; +rank() over (order by max(i)) +1 +select i, row_number() over () from t1 group by 1+2; +i row_number() over () +2 1 +select i, rank() over (order by i) rnk from t1 group by 1+2; +i rnk +2 1 +drop table t1; +# +# MDEV-11907: window function as the second operand of division +# +create table t1 (pk int, c int); +insert into t1 values (1,1),(2,1),(3,1),(4,1),(5,2); +set @sql_mode_save= @@sql_mode; +set sql_mode='ERROR_FOR_DIVISION_BY_ZERO'; +select pk, c, c/count(*) over +(partition by c order by pk +rows between 1 preceding and 2 following) as CNT +from t1; +pk c CNT +1 1 0.3333 +2 1 0.2500 +3 1 0.3333 +4 1 0.5000 +5 2 2.0000 +show warnings; +Level Code Message +set sql_mode=@sql_mode_save; +drop table t1; +# +# MDEV-12336: several functions over a window function +# +create table t1 (name varchar(10), cnt int); +insert into t1 values ('Fred', 23), ('Fred', 35), ('Joe', 10); +select q.name, q.row_cnt, +round( 100 * ( q.row_cnt / +sum(q.row_cnt) over +( +order by q.name +rows between +unbounded preceding and +unbounded following +) +),2 +) pct_of_total +from +( +select name, count(*) row_cnt, sum(cnt) sum_cnt +from t1 +group by 1 +) q; +name row_cnt pct_of_total +Fred 2 66.67 +Joe 1 33.33 +drop table t1; +# +# MDEV-11990: window function over min/max aggregation +# +create table t1 (id int); +insert into t1 values (1), (2), (3), (2), (4), (2); +select sum(max(id)) over (order by max(id)) from t1; +sum(max(id)) over (order by max(id)) +4 +explain +select sum(max(id)) over (order by max(id)) from t1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 6 Using temporary +create index idx on t1(id); +select sum(max(id)) over (order by max(id)) from t1; +sum(max(id)) over (order by max(id)) +4 +explain +select sum(max(id)) over (order by max(id)) from t1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used +select sum(max(id)) over (order by max(id)) from t1 where id < 3; +sum(max(id)) over (order by max(id)) +2 +select count(max(id)) over (order by max(id)) from t1 where id < 3; +count(max(id)) over (order by max(id)) +1 +select max(id), rank() over (order by max(id)) from t1 where id < 3; +max(id) rank() over (order by max(id)) +2 1 +drop table t1; +# +# main.win failure post MDEV-12336 +# +create table t(a decimal(35,10), b int); +insert into t values (1, 10), (2, 20), (3, 30); +prepare stmt from "SELECT (CASE WHEN sum(t.a) over (partition by t.b)=1 THEN 1000 ELSE 300 END) AS a FROM t"; +execute stmt; +a +1000 +300 +300 +drop table t; +# +# MDEV-12851 case with window functions query crashes server +# +create table t1(dt datetime); +insert into t1 values ('2017-05-17'), ('2017-05-18'); +select dt, +case when (max(dt) over (order by dt rows between 1 following and 1 following) is null) +then '9999-12-31 12:00:00' + else max(dt) over (order by dt rows between 1 following and 1 following) +end x, +case when (max(dt) over (order by dt rows between 1 following and 1 following) is not null) +then '9999-12-31 12:00:00' + else max(dt) over (order by dt rows between 1 following and 1 following) +end x +from t1; +dt x x +2017-05-17 00:00:00 2017-05-18 00:00:00 9999-12-31 12:00:00 +2017-05-18 00:00:00 9999-12-31 12:00:00 NULL +drop table t1; +create table t1(i int); +insert into t1 values (null),(1),(2); +select max(i) over (order by i), +max(i) over (order by i) is null, +max(i) over (order by i) is not null +from t1; +max(i) over (order by i) max(i) over (order by i) is null max(i) over (order by i) is not null +NULL 1 0 +1 0 1 +2 0 1 +drop table t1; +# +# MDEV-13189: Window functions crash when using INTERVAL function +# +create table t1(i int); +insert into t1 values (1),(2),(10),(20),(30); +select sum(i) over (order by i), interval(sum(i) over (order by i), 10, 20) +from t1; +sum(i) over (order by i) interval(sum(i) over (order by i), 10, 20) +1 0 +3 0 +13 1 +33 2 +63 2 +drop table t1; +# +# MDEV-13352: Server crashes in st_join_table::remove_duplicates +# +CREATE TABLE t1 (i INT); +INSERT INTO t1 VALUES (1),(2); +SELECT DISTINCT ROW_NUMBER() OVER(), i FROM t1 WHERE 0; +ROW_NUMBER() OVER() i +SELECT ROW_NUMBER() OVER(), i FROM t1 WHERE 0; +ROW_NUMBER() OVER() i +DROP TABLE t1; +# +# MDEV-13344: Server crashes in in AGGR_OP::put_record on subquery +# with window function and constant table +# (Testcase only) +# +CREATE TABLE t1 (c CHAR(8)) ENGINE=MyISAM; +INSERT IGNORE INTO t1 VALUES ('foo'); +SELECT ('bar',1) IN ( SELECT c, ROW_NUMBER() OVER (PARTITION BY c) FROM t1); +('bar',1) IN ( SELECT c, ROW_NUMBER() OVER (PARTITION BY c) FROM t1) +0 +DROP TABLE t1; +# +# MDEV-13351: Server crashes in st_select_lex::set_explain_type upon UNION with window function +# +CREATE TABLE t1 (i INT); +INSERT INTO t1 VALUES (1),(2); +SELECT Nth_value(i,1) OVER() FROM t1 +UNION ALL +( SELECT Nth_value(i,2) OVER() FROM t1 LIMIT 0 ) +; +Nth_value(i,1) OVER() +1 +1 +DROP TABLE t1; +# +# A regression after MDEV-13351: +# MDEV-13374 : Server crashes in first_linear_tab / st_select_lex::set_explain_type +# upon UNION with aggregate function +# +CREATE TABLE t1 (i INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1),(2); +SELECT i AS fld FROM t1 UNION SELECT COUNT(*) AS fld FROM t1; +fld +1 +2 +DROP TABLE t1; +# +# MDEV-13240 Wrong warning with MAX(datetime_field) OVER (...) +# +CREATE TABLE t1 (dt DATETIME); +INSERT INTO t1 VALUES ('2017-05-17'); +SELECT MAX(dt) OVER (ORDER BY dt ROWS BETWEEN 1 FOLLOWING AND 1 FOLLOWING) FROM t1; +MAX(dt) OVER (ORDER BY dt ROWS BETWEEN 1 FOLLOWING AND 1 FOLLOWING) +NULL +DROP TABLE t1; +# +# MDEV-13358 FIRST_VALUE throws SQL Error (1292): Incorrect datetime value +# +CREATE TABLE IF NOT EXISTS `fv_test` ( +`SOME_DATE` datetime NOT NULL +); +INSERT INTO `fv_test` (`SOME_DATE`) VALUES ('2017-07-20 12:47:56'); +CREATE TABLE fv_result +SELECT +FIRST_VALUE(SOME_DATE) OVER(ORDER BY SOME_DATE DESC) AS somedate +FROM fv_test; +SHOW CREATE TABLE fv_result; +Table Create Table +fv_result CREATE TABLE `fv_result` ( + `somedate` datetime DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SELECT * FROM fv_result; +somedate +2017-07-20 12:47:56 +DROP TABLE fv_test, fv_result; +# +# MDEV-13649: Server crashes in set_field_to_null_with_conversions or in Field::set_notnull +# +CREATE TABLE t1 (a int); +INSERT INTO t1 VALUES (0),(1),(2); +SELECT LEAD(a) OVER (PARTITION BY a ORDER BY a) as lead, +a AND LEAD(a) OVER (PARTITION BY a ORDER BY a) AS a_and_lead_part +FROM t1; +lead a_and_lead_part +NULL 0 +NULL NULL +NULL NULL +SELECT a OR LEAD(a) OVER (ORDER BY a) AS a_or_lead_order +FROM t1 +ORDER BY a; +a_or_lead_order +1 +1 +1 +SELECT a AND LEAD(a) OVER (ORDER BY a) AS a_and_lead_order +FROM t1 +ORDER BY a; +a_and_lead_order +0 +1 +NULL +SELECT a XOR LEAD(a) OVER (ORDER BY a) AS a_xor_lead_order +FROM t1 +ORDER BY a; +a_xor_lead_order +1 +0 +NULL +SELECT NOT LEAD(a) OVER (ORDER BY a) AS not_lead_order +FROM t1 +ORDER BY a; +not_lead_order +0 +0 +NULL +SELECT LEAD(a) OVER (ORDER BY a) is not null AS is_not_null_lead_order +FROM t1 +ORDER BY a; +is_not_null_lead_order +1 +1 +0 +drop table t1; +# +# MDEV-13354: Server crashes in find_field_in_tables upon PS with window function and subquery +# +CREATE TABLE t1 (i INT, a char); +INSERT INTO t1 VALUES (1, 'a'),(2, 'b'); +PREPARE stmt FROM "SELECT row_number() over (partition by i order by i), i FROM (SELECT * from t1) as sq"; +EXECUTE stmt; +row_number() over (partition by i order by i) i +1 1 +1 2 +DROP TABLE t1; +# +# MDEV-13384: "window" seems like a reserved column name but it's not listed as one +# +# Currently we allow window as an identifier, except for table aliases. +# +CREATE TABLE door (id INT, window VARCHAR(10)); +SELECT id +FROM door as window; +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 'window' at line 2 +SELECT id, window +FROM door; +id window +SELECT id, window +FROM door as window; +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 'window' at line 2 +DROP TABLE door; +# +# MDEV-13352: Server crashes in st_join_table::remove_duplicates +# +CREATE TABLE t1 (i INT); +INSERT INTO t1 VALUES (1),(2); +SELECT DISTINCT ROW_NUMBER() OVER(), i FROM t1 WHERE 0; +ROW_NUMBER() OVER() i +SELECT ROW_NUMBER() OVER(), i FROM t1 WHERE 0; +ROW_NUMBER() OVER() i +DROP TABLE t1; +# +# MDEV-15853: Assertion `tab->filesort_result == 0' failed +# +CREATE TABLE t1 ( a1 int); +insert into t1 values (1),(2),(3); +CREATE TABLE t2 (b1 int, a1 int, a2 int); +insert into t2 values (1,2,3),(2,3,4),(3,4,5); +SELECT COUNT(DISTINCT t2.a2), +rank() OVER (ORDER BY t2.b1) +FROM t2 ,t1 GROUP BY t2.b1 ORDER BY t1.a1; +COUNT(DISTINCT t2.a2) rank() OVER (ORDER BY t2.b1) +1 1 +1 2 +1 3 +DROP TABLE t1,t2; +# +# MDEV-16990: server crashes in base_list_iterator::next +# +CREATE TABLE t1(i int); +insert into t1 values (1),(2); +SELECT DISTINCT row_number() OVER (), MAX(1) FROM t1; +row_number() OVER () MAX(1) +1 1 +SELECT DISTINCT BIT_AND(0) OVER (), MAX(1) FROM t1; +BIT_AND(0) OVER () MAX(1) +0 1 +drop table t1; +# +# MDEV-17525: Window functions not working in ONLY_FULL_GROUP_BY mode +# +CREATE TABLE t1 (name CHAR(10), test CHAR(10), score TINYINT); +INSERT INTO t1 VALUES +('Chun', 'SQL', 75), ('Chun', 'Tuning', 73), +('Esben', 'SQL', 43), ('Esben', 'Tuning', 31), +('Kaolin', 'SQL', 56), ('Kaolin', 'Tuning', 88), +('Tatiana', 'SQL', 87), ('Tatiana', 'Tuning', 83); +SET @save_sql_mode= @@sql_mode; +SET sql_mode = 'ONLY_FULL_GROUP_BY'; +SELECT name, test, score, +AVG(score) OVER (PARTITION BY test) AS average_by_test +FROM t1 +ORDER BY test, name; +name test score average_by_test +Chun SQL 75 65.2500 +Esben SQL 43 65.2500 +Kaolin SQL 56 65.2500 +Tatiana SQL 87 65.2500 +Chun Tuning 73 68.7500 +Esben Tuning 31 68.7500 +Kaolin Tuning 88 68.7500 +Tatiana Tuning 83 68.7500 +set @@sql_mode= @save_sql_mode; +SELECT name, test, score, +AVG(score) OVER (PARTITION BY test) AS average_by_test +FROM t1 +ORDER BY test, name; +name test score average_by_test +Chun SQL 75 65.2500 +Esben SQL 43 65.2500 +Kaolin SQL 56 65.2500 +Tatiana SQL 87 65.2500 +Chun Tuning 73 68.7500 +Esben Tuning 31 68.7500 +Kaolin Tuning 88 68.7500 +Tatiana Tuning 83 68.7500 +drop table t1; +# +# MDEV-12575: Server crash in AGGR_OP::put_record or in JOIN_CACHE::free +# or Invalid write in JOIN::make_aggr_tables_info +# +SELECT DISTINCT BIT_OR(100) OVER () FROM dual +GROUP BY LEFT('2018-08-24', 100) order by 1+2; +BIT_OR(100) OVER () +100 +CREATE TABLE t1 (i INT); +INSERT INTO t1 VALUES (1),(2); +SELECT * FROM ( +SELECT +ROW_NUMBER() OVER(), i, sum(i) +FROM t1 +WHERE 1=0 +limit 0 +) AS sq; +ROW_NUMBER() OVER() i sum(i) +SELECT * FROM ( +SELECT +ROW_NUMBER() OVER(), i, sum(i) +FROM t1 +WHERE 1=0 +GROUP BY i +) AS sq; +ROW_NUMBER() OVER() i sum(i) +drop table t1; +create table t1 (a int); +explain +select distinct 1, row_number() over (order by 1) from t1 where a=0 group by a with rollup; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +select distinct 1, row_number() over (order by 1) from t1 where a=0 group by a with rollup; +1 row_number() over (order by 1) +drop table t1; +explain +SELECT DISTINCT BIT_OR(100) OVER () FROM dual +GROUP BY LEFT('2018-08-24', 100) WITH ROLLUP +HAVING @A := 'qwerty'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible HAVING +SELECT DISTINCT BIT_OR(100) OVER () FROM dual +GROUP BY LEFT('2018-08-24', 100) WITH ROLLUP +HAVING @A := 'qwerty'; +BIT_OR(100) OVER () +explain +SELECT DISTINCT BIT_OR(100) OVER () FROM dual +GROUP BY LEFT('2018-08-24', 100) +HAVING @A := 'qwerty'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible HAVING +SELECT DISTINCT BIT_OR(100) OVER () FROM dual +GROUP BY LEFT('2018-08-24', 100) +HAVING @A := 'qwerty'; +BIT_OR(100) OVER () +create table t1 (a int); +explain +SELECT DISTINCT BIT_OR(100) OVER () FROM t1 +GROUP BY LEFT('2018-08-24', 100) having 1=1 limit 0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Zero limit +drop table t1; +# +# MDEV-13170: Database service (MySQL) stops after update with trigger +# +CREATE TABLE t1 ( t1_id int, point_id int, ml_id int, UNIQUE KEY t1_ml_u (ml_id,point_id)) ; +INSERT INTO t1 VALUES (1,1,8884),(2,1,8885); +CREATE TABLE t2 ( db_time datetime, au_nr int, col_id int, new_val int); +CREATE TABLE t3 (id1 int, id2 int, d1 int); +CREATE TRIGGER t1_aurtrg AFTER UPDATE ON t1 FOR EACH ROW begin +CREATE OR REPLACE TEMPORARY TABLE trg_u AS +WITH l AS +(SELECT a.*, +Max(t2.col_id) over (PARTITION BY a.d1), +Max(t2.new_val) over (PARTITION BY a.d1) +FROM +(SELECT d1 , id1, id2 FROM t3) a +JOIN t2 ON (a.d1=t2.db_time AND a.id1=t2.au_nr)) +SELECT 1; +END;// +update t1 set ml_id=8884 where point_id=1; +ERROR 23000: Duplicate entry '8884-1' for key 't1_ml_u' +update t1 set ml_id=8884 where point_id=1; +ERROR 23000: Duplicate entry '8884-1' for key 't1_ml_u' +drop table t1, t2,t3; +CREATE TABLE t1 (i INT, a char); +INSERT INTO t1 VALUES (1, 'a'),(2, 'b'); +create view v1 as select * from t1; +PREPARE stmt FROM "SELECT i, row_number() over (partition by i order by i) FROM v1"; +execute stmt; +i row_number() over (partition by i order by i) +1 1 +2 1 +deallocate prepare stmt; +drop table t1; +drop view v1; +# +# MDEV-17676: Assertion `inited==NONE || (inited==RND && scan)' failed in handler::ha_rnd_init +# +CREATE TABLE t1 (b1 text NOT NULL); +INSERT INTO t1 VALUES ('2'),('1'); +EXPLAIN +SELECT DISTINCT MIN(b1) OVER () FROM t1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using temporary +SELECT DISTINCT MIN(b1) OVER () FROM t1; +MIN(b1) OVER () +1 +drop table t1; +# +# MDEV-15424: Unreasonal SQL Error (1356) on select from view +# +create table t1 (id int, n1 int); +insert into t1 values (1,1), (2,1), (3,2), (4,4); +create view v1 as SELECT ifnull(max(n1) over (partition by n1),'aaa') FROM t1; +explain select * from v1; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY <derived2> ALL NULL NULL NULL NULL 4 +2 DERIVED t1 ALL NULL NULL NULL NULL 4 Using temporary +select * from v1; +ifnull(max(n1) over (partition by n1),'aaa') +1 +1 +2 +4 +drop table t1; +drop view v1; +# +# MDEV-18431: Select max + row_number giving incorrect result +# +create table t1 (id int, v int); +insert into t1 values (1, 1), (1,2), (1,3), (2, 1), (2, 2); +select e.id, +(select max(t1.v) from t1 where t1.id=e.id) as a, +row_number() over (partition by e.id order by e.v) as b, +(select max(t1.v) from t1 where t1.id=e.id) + (row_number() over (partition by e.id order by e.v)) as sum_a_b +from t1 e; +id a b sum_a_b +1 3 1 4 +1 3 2 5 +1 3 3 6 +2 2 1 3 +2 2 2 4 +drop table t1; +# +# MDEV-15837: Assertion `item1->type() == Item::FIELD_ITEM && item2->type() == Item::FIELD_ITEM' +# failed in compare_order_elements function +# +CREATE TABLE t1 (a1 int); +insert into t1 values (1),(2),(3); +SELECT rank() OVER (ORDER BY 1), ROW_NUMBER() OVER (ORDER BY (EXPORT_SET(5,'Y','N',',',4))) FROM t1; +rank() OVER (ORDER BY 1) ROW_NUMBER() OVER (ORDER BY (EXPORT_SET(5,'Y','N',',',4))) +1 1 +1 2 +1 3 +drop table t1; +# +# MDEV-17781: Server crashes in next_linear_tab +# +CREATE TABLE t1 (i1 int); +explain +(SELECT AVG(0) OVER (), MAX('2') FROM t1) +UNION ALL +(SELECT AVG(0) OVER (), MAX('2') FROM t1); +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 UNION NULL NULL NULL NULL NULL NULL NULL No tables used +(SELECT AVG(0) OVER (), MAX('2') FROM t1) +UNION ALL +(SELECT AVG(0) OVER (), MAX('2') FROM t1); +AVG(0) OVER () MAX('2') +0.0000 NULL +0.0000 NULL +drop table t1; +# +# MDEV-14791: Crash with order by expression containing window functions +# +CREATE TABLE t1 (b1 int, b2 int); +INSERT INTO t1 VALUES (1,1),(0,0); +explain +SELECT b1 from t1 order by row_number() over (ORDER BY b2) + 1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using temporary; Using filesort +SELECT b1 from t1 order by row_number() over (ORDER BY b2) + 1; +b1 +0 +1 +explain +SELECT b1 from t1 order by row_number() over (ORDER BY b2); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using temporary; Using filesort +SELECT b1 from t1 order by row_number() over (ORDER BY b2); +b1 +0 +1 +DROP TABLE t1; +CREATE TABLE t1 (a int, b int, c int); +INSERT INTO t1 VALUES (2,3,207), (1,21,909), (7,13,312), (8,64,248); +explain +SELECT * FROM t1 ORDER BY max(t1.a) over (partition by c); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using temporary; Using filesort +SELECT * FROM t1 ORDER BY max(t1.a) over (partition by c); +a b c +1 21 909 +2 3 207 +7 13 312 +8 64 248 +explain +SELECT max(t1.a) over (partition by c) as x, b, c from t1 order by max(t1.a) over (partition by c); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using temporary; Using filesort +SELECT max(t1.a) over (partition by c) as x, b, c from t1 order by max(t1.a) over (partition by c); +x b c +1 21 909 +2 3 207 +7 13 312 +8 64 248 +drop table t1; +# +# MDEV-18373: DENSE_RANK is not calculated correctly +# +create table t1 (a int, b int); +insert into t1 values (60, 1515),(60, 2000),(70, 2000),(55, 1600); +select b, dense_rank() over (order by sum(a)) from t1 group by b; +b dense_rank() over (order by sum(a)) +1515 2 +1600 1 +2000 3 +select b, dense_rank() over (order by sum(a)+1) from t1 group by b; +b dense_rank() over (order by sum(a)+1) +1515 2 +1600 1 +2000 3 +select b, row_number() over (partition by sum(a)) from t1 group by b; +b row_number() over (partition by sum(a)) +1515 1 +1600 1 +2000 1 +select b, row_number() over (partition by sum(a)+1) from t1 group by b; +b row_number() over (partition by sum(a)+1) +1515 1 +1600 1 +2000 1 +drop table t1; +# +# MDEV-18015: Assertion `global_status_var.global_memory_used == 0' failed when using UDF, +# window functions and views +# +create table t1 (id int, n1 int); +insert into t1 values (1,1),(2,1),(3,2),(4,4); +explain +select max(n1) over (partition by 'abc') from t1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using temporary +select max(n1) over (partition by 'abc') from t1; +max(n1) over (partition by 'abc') +4 +4 +4 +4 +explain +select rank() over (partition by 'abc' order by 'xyz') from t1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using temporary +select rank() over (partition by 'abc' order by 'xyz') from t1; +rank() over (partition by 'abc' order by 'xyz') +1 +1 +1 +1 +drop table t1; +# +# MDEV-19380: ASAN heap-use-after-free in Protocol::net_store_data +# +CREATE TABLE t1 (i int); +INSERT INTO t1 VALUES (1),(2),(3); +SELECT (SELECT MIN('foo') OVER() FROM t1 LIMIT 1) as x; +x +foo +drop table t1; +# +# MDEV-16579: Wrong result of query using DISTINCT COUNT(*) OVER (*) +# +CREATE TABLE t1 (i int) ; +INSERT INTO t1 VALUES (1),(0),(1),(2),(0),(1),(2),(1),(2); +SELECT DISTINCT COUNT(*) OVER (), MOD(MIN(i),2) FROM t1 GROUP BY i ; +COUNT(*) OVER () MOD(MIN(i),2) +3 0 +3 1 +drop table t1; +# +# MDEV-21318: Wrong results with window functions and implicit grouping +# +CREATE TABLE t1 (a INT); +# +# With empty const table +# The expected result here is 1, NULL +# +explain +SELECT row_number() over(), sum(1) FROM t1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 system NULL NULL NULL NULL 0 Const row not found; Using temporary +SELECT row_number() over(), sum(1) FROM t1; +row_number() over() sum(1) +1 NULL +insert into t1 values (2); +# +# Const table has 1 row, but still impossible where +# The expected result here is 1, NULL +# +EXPLAIN SELECT row_number() over(), sum(1) FROM t1 where a=1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +SELECT row_number() over(), sum(1) FROM t1 where a=1; +row_number() over() sum(1) +1 NULL +# +# Impossible HAVING +# Empty result is expected +# +EXPLAIN SELECT row_number() over(), sum(1) FROM t1 where a=1 having 1=0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible HAVING +SELECT row_number() over(), sum(1) FROM t1 where a=1 having 1=0; +row_number() over() sum(1) +# +# const table has 1 row, no impossible where +# The expected result here is 1, 2 +# +EXPLAIN SELECT row_number() over(), sum(a) FROM t1 where a=2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 system NULL NULL NULL NULL 1 Using temporary +SELECT row_number() over(), sum(a) FROM t1 where a=2; +row_number() over() sum(a) +1 2 +drop table t1; +# +# Impossible Where +# +create table t1(a int); +insert into t1 values (1); +# +# Expected result is NULL, 0, NULL +# +EXPLAIN SELECT MAX(a) OVER (), COUNT(a), abs(a) FROM t1 WHERE FALSE; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +SELECT MAX(a) OVER (), COUNT(a), abs(a) FROM t1 WHERE FALSE; +MAX(a) OVER () COUNT(a) abs(a) +NULL 0 NULL +# +# Expected result is 1, 0, NULL +# +EXPLAIN +SELECT MAX(1) OVER (), COUNT(a), abs(a) FROM t1 WHERE FALSE; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +SELECT MAX(1) OVER (), COUNT(a), abs(a) FROM t1 WHERE FALSE; +MAX(1) OVER () COUNT(a) abs(a) +1 0 NULL +drop table t1; +# +# MDEV-22461: JOIN::make_aggr_tables_info(): Assertion `select_options & (1ULL << 17)' failed. +# +CREATE TEMPORARY TABLE t0 (a INT PRIMARY KEY ) ; +INSERT INTO t0 VALUES (1),(2),(3); +SELECT a FROM t0 +WHERE a < 8 +GROUP BY 1.5 +WINDOW v2 AS ( PARTITION BY a ORDER BY a DESC ); +a +1 +SELECT a, ROW_NUMBER() OVER v2 +FROM t0 +WHERE a < 8 +GROUP BY 1.5 +WINDOW v2 AS ( PARTITION BY a ORDER BY a DESC ); +a ROW_NUMBER() OVER v2 +1 1 +drop table t0; +# +# MDEV-16230:Server crashes when Analyze format=json is run with a window function with +# empty PARTITION BY and ORDER BY clauses +# +CREATE TABLE t1(a INT, b INT); +INSERT INTO t1 VALUES (1,1),(2,2),(3,3); +ANALYZE FORMAT=JSON SELECT row_number() OVER() FROM t1; +ANALYZE +{ + "query_block": { + "select_id": 1, + "r_loops": 1, + "r_total_time_ms": "REPLACED", + "window_functions_computation": { + "sorts": { + "filesort": { + "sort_key": "`row_number() OVER()`", + "r_loops": 1, + "r_total_time_ms": "REPLACED", + "r_used_priority_queue": false, + "r_output_rows": 3, + "r_buffer_size": "REPLACED" + } + }, + "temporary_table": { + "table": { + "table_name": "t1", + "access_type": "ALL", + "r_loops": 1, + "rows": 3, + "r_rows": 3, + "r_total_time_ms": "REPLACED", + "filtered": 100, + "r_filtered": 100 + } + } + } + } +} +SELECT row_number() OVER() FROM t1; +row_number() OVER() +1 +2 +3 +DROP TABLE t1; +# +# MDEV-22984: Throw an error when arguments to window functions are window functions +# +CREATE TABLE t1(a INT, b INT); +INSERT INTO t1 VALUES (1,1), (2,2), (3,3); +SELECT NTILE(MAX(a) OVER (PARTITION BY a)) OVER (PARTITION BY a ORDER BY b) FROM t1; +ERROR HY000: Window functions can not be used as arguments to group functions. +SELECT FIRST_VALUE(MAX(a) OVER (PARTITION BY a)) OVER (ORDER BY a) AS x FROM t1 GROUP BY a; +ERROR HY000: Window functions can not be used as arguments to group functions. +DROP TABLE t1; +# +# MDEV-12059: Assertion `precision > 0' failed with a window function or window aggregate function +# +CREATE TABLE t1 (d DECIMAL(1,0) UNSIGNED); +INSERT INTO t1 VALUES (1),(2); +SELECT MIN(d) OVER () FROM t1; +MIN(d) OVER () +1 +1 +DROP TABLE t1; +# +# MDEV-22463: Element_type &Bounds_checked_array<Item *>::operator[](size_t) [Element_type = Item *]: +# Assertion `n < m_size' failed +# +CREATE TABLE t1 (a INT, b INT, c INT, d INT, e INT, f INT, g int, h INT, i INT); +INSERT INTO t1 SELECT seq,seq,seq,seq, seq,seq,seq,seq,seq FROM seq_1_to_5; +SELECT ROW_NUMBER() OVER w2 FROM t1 WINDOW w2 AS (PARTITION BY -1,0,1,2,3,4,5,6); +ROW_NUMBER() OVER w2 +1 +2 +3 +4 +5 +SELECT a FROM t1 ORDER BY ROW_NUMBER() OVER (PARTITION BY -1,1,0,2,3,4,5,6,7,8); +a +1 +2 +3 +4 +5 +SELECT a,b FROM t1 WINDOW w2 AS (PARTITION BY -1,1,0,2,3,4); +a b +1 1 +2 2 +3 3 +4 4 +5 5 +SELECT ROW_NUMBER() OVER w2 FROM t1 WINDOW w2 AS (PARTITION BY -1,0,1,2,3,4,5,6); +ROW_NUMBER() OVER w2 +1 +2 +3 +4 +5 +DROP TABLE t1; +# +# MDEV-18916: crash in Window_spec::print_partition() with decimals +# +SELECT cast((rank() over w1) as decimal (53,56)); +ERROR 42000: Too big scale 56 specified for 'rank() over w1'. Maximum is 38 +SELECT cast((rank() over w1) as decimal (53,30)); +ERROR HY000: Window specification with name 'w1' is not defined +# +# MDEV-15180: server crashed with NTH_VALUE() +# +CREATE TABLE t1 (i1 int, a int); +INSERT INTO t1 VALUES (1, 1), (2, 2),(3, 3); +CREATE TABLE t2 (i2 int); +INSERT INTO t2 VALUES (1),(2),(5),(1),(7),(4),(3); +CREATE VIEW v1 AS (SELECT * FROM t1,t2 WHERE t1.i1=t2.i2) ; +SELECT NTH_VALUE(i1, i1) OVER (PARTITION BY i1) FROM v1; +NTH_VALUE(i1, i1) OVER (PARTITION BY i1) +1 +1 +NULL +NULL +DROP VIEW v1; +DROP TABLE t1,t2; +# +# End of 10.2 tests +# +# +# MDEV-16489 when lead() returns null on a datetime field, the result is treated as the literal string '[NULL]' +# +CREATE TABLE t1 (d datetime); +INSERT INTO t1 VALUES ('2018-01-01 00:00:00'),('2018-02-01 00:00:00'); +SELECT *, LEAD(d) OVER (ORDER BY d) AS x FROM t1; +d x +2018-01-01 00:00:00 2018-02-01 00:00:00 +2018-02-01 00:00:00 NULL +DROP TABLE t1; +CREATE TABLE t1 (d time); +INSERT INTO t1 VALUES ('00:00:01'),('00:00:02'); +SELECT *, LEAD(d) OVER (ORDER BY d) AS x FROM t1; +d x +00:00:01 00:00:02 +00:00:02 NULL +DROP TABLE t1; +# +# MDEV-20351 Window function BIT_OR() OVER (..) return a wrong data type +# +CREATE TABLE t1 (pk INT, a INT, b BIGINT UNSIGNED); +INSERT INTO t1 VALUES (1, 0, 1), (2, 0, 18446744073709551615); +CREATE TABLE t2 AS +SELECT pk, a, bit_or(b) AS bit_or FROM t1 GROUP BY pk; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `pk` int(11) DEFAULT NULL, + `a` int(11) DEFAULT NULL, + `bit_or` bigint(21) unsigned NOT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SELECT * FROM t1; +pk a b +1 0 1 +2 0 18446744073709551615 +DROP TABLE t2; +CREATE OR REPLACE TABLE t2 AS +SELECT pk, a, BIT_OR(b) OVER (PARTITION BY a ORDER BY pk ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING) AS bit_or +FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `pk` int(11) DEFAULT NULL, + `a` int(11) DEFAULT NULL, + `bit_or` bigint(21) unsigned NOT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SELECT * FROM t2; +pk a bit_or +1 0 18446744073709551615 +2 0 18446744073709551615 +DROP TABLE t2; +DROP TABLE t1; +# +# End of 10.3 tests +# +# +# MDEV-16722: Assertion `type() != NULL_ITEM' failed +# +create table t1 (a int); +insert into t1 values (1),(2),(3); +SELECT row_number() OVER (order by a) FROM t1 order by NAME_CONST('myname',NULL); +row_number() OVER (order by a) +1 +2 +3 +drop table t1; +# +# MDEV-23867: select crash in compute_window_func +# +set @save_sort_buffer_size=@@sort_buffer_size; +set sort_buffer_size= 2000; +CREATE TABLE t1( a INT, b INT, c INT); +INSERT INTO t1 select seq, seq, seq from seq_1_to_5000; +CREATE TABLE t2( a INT, b INT, c INT); +INSERT INTO t2 SELECT a, b, ROW_NUMBER() OVER (PARTITION BY b) FROM t1; +SELECT COUNT(*), MAX(c) FROM t2; +COUNT(*) MAX(c) +5000 1 +CREATE TABLE t3( a INT, b INT, c INT); +INSERT INTO t3 SELECT a, b, SUM(a) OVER () FROM t1; +SELECT COUNT(*), MAX(c) FROM t3; +COUNT(*) MAX(c) +5000 12502500 +set @@sort_buffer_size=@save_sort_buffer_size; +DROP TABLE t1,t2,t3; +# end of 10.2 test # # MDEV-22556: Incorrect result for window function when using encrypt-tmp-files=ON # @@ -16,3 +3972,4 @@ count(*) 5000 set @@sort_buffer_size=@save_sort_buffer_size; drop table t1; +# End of 10.4 tests diff --git a/mysql-test/suite/encryption/t/tempfiles_encrypted.test b/mysql-test/suite/encryption/t/tempfiles_encrypted.test index 96b981c1c06..7628442f884 100644 --- a/mysql-test/suite/encryption/t/tempfiles_encrypted.test +++ b/mysql-test/suite/encryption/t/tempfiles_encrypted.test @@ -5,9 +5,31 @@ source include/have_file_key_management_plugin.inc; source include/have_sequence.inc; source include/have_innodb.inc; - + select @@encrypt_tmp_files; +--source main/win.test + +--echo # +--echo # MDEV-23867: select crash in compute_window_func +--echo # + +set @save_sort_buffer_size=@@sort_buffer_size; + +set sort_buffer_size= 2000; +CREATE TABLE t1( a INT, b INT, c INT); +INSERT INTO t1 select seq, seq, seq from seq_1_to_5000; +CREATE TABLE t2( a INT, b INT, c INT); +INSERT INTO t2 SELECT a, b, ROW_NUMBER() OVER (PARTITION BY b) FROM t1; +SELECT COUNT(*), MAX(c) FROM t2; +CREATE TABLE t3( a INT, b INT, c INT); +INSERT INTO t3 SELECT a, b, SUM(a) OVER () FROM t1; +SELECT COUNT(*), MAX(c) FROM t3; +set @@sort_buffer_size=@save_sort_buffer_size; +DROP TABLE t1,t2,t3; + +--echo # end of 10.2 test + --echo # --echo # MDEV-22556: Incorrect result for window function when using encrypt-tmp-files=ON --echo # @@ -21,3 +43,5 @@ select count(*) from (select a, b, c, ROW_NUMBER() OVER (PARTITION BY a) FROM t1 set @@sort_buffer_size=@save_sort_buffer_size; drop table t1; + +--echo # End of 10.4 tests diff --git a/mysql-test/suite/galera/r/MDEV-22707.result b/mysql-test/suite/galera/r/MDEV-22707.result new file mode 100644 index 00000000000..a74844d7e12 --- /dev/null +++ b/mysql-test/suite/galera/r/MDEV-22707.result @@ -0,0 +1,26 @@ +CREATE TABLE t1(f2 INT) ENGINE=InnoDB; +connect node_1_applier_thd, 127.0.0.1, root, , test, $NODE_MYPORT_1; +SET GLOBAL debug_dbug = "+d,sync.wsrep_apply_cb"; +connection node_2; +SET SESSION wsrep_sync_wait = 0; +INSERT INTO t1 (f2) VALUES (2); +connection node_1_applier_thd; +SET SESSION DEBUG_SYNC = "now WAIT_FOR sync.wsrep_apply_cb_reached"; +connection node_1; +SET SESSION wsrep_sync_wait = 0; +SET DEBUG_SYNC = 'wsrep_before_replication SIGNAL wsrep_before_replication_reached WAIT_FOR continue'; +INSERT INTO t1 (f2) VALUES (1); +connect node_1_flush_thd, 127.0.0.1, root, , test, $NODE_MYPORT_1; +SET DEBUG_SYNC="now WAIT_FOR wsrep_before_replication_reached"; +SET GLOBAL debug_dbug = "+d,sync.wsrep_before_mdl_wait"; +FLUSH TABLES; +connect node_1_sync_release_thd, 127.0.0.1, root, , test, $NODE_MYPORT_1; +SET GLOBAL debug_dbug = ""; +SET DEBUG_SYNC = "now SIGNAL signal.wsrep_before_mdl_wait"; +SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb"; +SET DEBUG_SYNC = "now SIGNAL continue"; +SET DEBUG_SYNC = "RESET"; +connection node_1; +connection node_1_flush_thd; +connection node_2; +DROP TABLE t1; diff --git a/mysql-test/suite/galera/r/galera_var_replicate_myisam_on.result b/mysql-test/suite/galera/r/galera_var_replicate_myisam_on.result index 716af033e7a..ad28f5a426e 100644 --- a/mysql-test/suite/galera/r/galera_var_replicate_myisam_on.result +++ b/mysql-test/suite/galera/r/galera_var_replicate_myisam_on.result @@ -107,6 +107,135 @@ i 1 DROP TABLE t1; connection node_1; -SET GLOBAL wsrep_replicate_myisam = 0; +CREATE TABLE t1 (id INT NOT NULL PRIMARY KEY, b INT) ENGINE=MyISAM; +INSERT INTO t1 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9),(10,10); +PREPARE upd from 'update t1 set b = 100 where id = 5'; +PREPARE ins from 'insert into t1 values (11,11)'; +PREPARE del from 'delete from t1 where id = 4'; +PREPARE rep from 'replace into t1 values (12,12),(6,600)'; +EXECUTE upd; +EXECUTE ins; +EXECUTE del; +EXECUTE rep; +SELECT * FROM t1 ORDER BY id; +id b +1 1 +2 2 +3 3 +5 100 +6 600 +7 7 +8 8 +9 9 +10 10 +11 11 +12 12 +connection node_2; +SELECT * FROM t1 ORDER BY id; +id b +1 1 +2 2 +3 3 +5 100 +6 600 +7 7 +8 8 +9 9 +10 10 +11 11 +12 12 +DROP TABLE t1; +connection node_1; +CREATE TABLE t1 (id INT NOT NULL PRIMARY KEY, b INT) ENGINE=MyISAM; +INSERT INTO t1 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9),(10,10); +CREATE PROCEDURE proc() +BEGIN +UPDATE t1 set b = 100 WHERE id = 5; +INSERT INTO t1 VALUES (11,11); +DELETE FROM t1 WHERE id = 4; +REPLACE INTO t1 VALUES (12,12),(6,600); +COMMIT; +END| +CALL proc(); +SELECT * FROM t1 ORDER BY id; +id b +1 1 +2 2 +3 3 +5 100 +6 600 +7 7 +8 8 +9 9 +10 10 +11 11 +12 12 +connection node_2; +SELECT * FROM t1 ORDER BY id; +id b +1 1 +2 2 +3 3 +5 100 +6 600 +7 7 +8 8 +9 9 +10 10 +11 11 +12 12 +DROP PROCEDURE proc; +DROP TABLE t1; +connection node_1; +CREATE TABLE t1 (id INT NOT NULL PRIMARY KEY, b INT) ENGINE=MyISAM; +CREATE TABLE t2 (id INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b INT) ENGINE=MyISAM; +INSERT INTO t1 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9),(10,10); +CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW INSERT INTO t2 VALUES (NULL, NEW.b); +CREATE TRIGGER tr2 BEFORE UPDATE ON t1 FOR EACH ROW INSERT INTO t2 VALUES (NULL, OLD.b),(NULL, NEW.b); +CREATE TRIGGER tr3 BEFORE DELETE ON t1 FOR EACH ROW INSERT INTO t2 VALUES (NULL, OLD.b); +INSERT INTO t1 VALUES (11,11); +UPDATE t1 SET b = 200 WHERE id = 2; +DELETE FROM t1 where id = 5; +SELECT * FROM t1 ORDER BY id; +id b +1 1 +2 200 +3 3 +4 4 +6 6 +7 7 +8 8 +9 9 +10 10 +11 11 +SELECT * FROM t2 ORDER BY id; +id b +1 11 +2 2 +3 200 +4 5 +connection node_2; +SELECT * FROM t1 ORDER BY id; +id b +1 1 +2 200 +3 3 +4 4 +6 6 +7 7 +8 8 +9 9 +10 10 +11 11 +SELECT * FROM t2 ORDER BY id; +id b +1 11 +2 2 +3 200 +4 5 +DROP TRIGGER tr1; +DROP TRIGGER tr2; +DROP TRIGGER tr3; +DROP TABLE t1,t2; +connection node_1; connection node_2; -SET GLOBAL wsrep_replicate_myisam = 0; diff --git a/mysql-test/suite/galera/t/MDEV-22707.test b/mysql-test/suite/galera/t/MDEV-22707.test new file mode 100644 index 00000000000..19755f7c5ac --- /dev/null +++ b/mysql-test/suite/galera/t/MDEV-22707.test @@ -0,0 +1,51 @@ +# +# MDEV-22707 galera got stuck after flush tables +# + +--source include/galera_cluster.inc +--source include/have_innodb.inc +--source include/have_debug.inc +--source include/have_debug_sync.inc + +CREATE TABLE t1(f2 INT) ENGINE=InnoDB; + +--connect node_1_applier_thd, 127.0.0.1, root, , test, $NODE_MYPORT_1 +SET GLOBAL debug_dbug = "+d,sync.wsrep_apply_cb"; + +--connection node_2 +SET SESSION wsrep_sync_wait = 0; +--send INSERT INTO t1 (f2) VALUES (2) + +--connection node_1_applier_thd +# Wait for `sync.wsrep_apply_cb_reached` signal +SET SESSION DEBUG_SYNC = "now WAIT_FOR sync.wsrep_apply_cb_reached"; + +--connection node_1 +SET SESSION wsrep_sync_wait = 0; +SET DEBUG_SYNC = 'wsrep_before_replication SIGNAL wsrep_before_replication_reached WAIT_FOR continue'; +--send INSERT INTO t1 (f2) VALUES (1) + +--connect node_1_flush_thd, 127.0.0.1, root, , test, $NODE_MYPORT_1 +SET DEBUG_SYNC="now WAIT_FOR wsrep_before_replication_reached"; +SET GLOBAL debug_dbug = "+d,sync.wsrep_before_mdl_wait"; +--send FLUSH TABLES + +--connect node_1_sync_release_thd, 127.0.0.1, root, , test, $NODE_MYPORT_1 +# First clear all DBUG points +SET GLOBAL debug_dbug = ""; +# Now signal threads to continue execution +SET DEBUG_SYNC = "now SIGNAL signal.wsrep_before_mdl_wait"; +SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb"; +SET DEBUG_SYNC = "now SIGNAL continue"; +SET DEBUG_SYNC = "RESET"; + +--connection node_1 +--reap + +--connection node_1_flush_thd +--reap + +--connection node_2 +--reap + +DROP TABLE t1; diff --git a/mysql-test/suite/galera/t/galera_var_replicate_myisam_on.test b/mysql-test/suite/galera/t/galera_var_replicate_myisam_on.test index 90c786f0af0..adb5cb04273 100644 --- a/mysql-test/suite/galera/t/galera_var_replicate_myisam_on.test +++ b/mysql-test/suite/galera/t/galera_var_replicate_myisam_on.test @@ -142,8 +142,88 @@ INSERT INTO t1 VALUES(1); SELECT * FROM t1; DROP TABLE t1; +# +# Test prepared staments +# +--connection node_1 +CREATE TABLE t1 (id INT NOT NULL PRIMARY KEY, b INT) ENGINE=MyISAM; +INSERT INTO t1 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9),(10,10); + +PREPARE upd from 'update t1 set b = 100 where id = 5'; +PREPARE ins from 'insert into t1 values (11,11)'; +PREPARE del from 'delete from t1 where id = 4'; +PREPARE rep from 'replace into t1 values (12,12),(6,600)'; + +EXECUTE upd; +EXECUTE ins; +EXECUTE del; +EXECUTE rep; + +SELECT * FROM t1 ORDER BY id; + +--connection node_2 +SELECT * FROM t1 ORDER BY id; + +DROP TABLE t1; + +# +# Test procedure +# +--connection node_1 +CREATE TABLE t1 (id INT NOT NULL PRIMARY KEY, b INT) ENGINE=MyISAM; +INSERT INTO t1 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9),(10,10); + +DELIMITER |; +CREATE PROCEDURE proc() +BEGIN + UPDATE t1 set b = 100 WHERE id = 5; + INSERT INTO t1 VALUES (11,11); + DELETE FROM t1 WHERE id = 4; + REPLACE INTO t1 VALUES (12,12),(6,600); + COMMIT; +END| +DELIMITER ;| + +CALL proc(); +SELECT * FROM t1 ORDER BY id; + +--connection node_2 +SELECT * FROM t1 ORDER BY id; + +DROP PROCEDURE proc; +DROP TABLE t1; + +# +# Test trigger +# +--connection node_1 +CREATE TABLE t1 (id INT NOT NULL PRIMARY KEY, b INT) ENGINE=MyISAM; +CREATE TABLE t2 (id INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b INT) ENGINE=MyISAM; +INSERT INTO t1 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9),(10,10); +CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW INSERT INTO t2 VALUES (NULL, NEW.b); +CREATE TRIGGER tr2 BEFORE UPDATE ON t1 FOR EACH ROW INSERT INTO t2 VALUES (NULL, OLD.b),(NULL, NEW.b); +CREATE TRIGGER tr3 BEFORE DELETE ON t1 FOR EACH ROW INSERT INTO t2 VALUES (NULL, OLD.b); + +INSERT INTO t1 VALUES (11,11); +UPDATE t1 SET b = 200 WHERE id = 2; +DELETE FROM t1 where id = 5; +SELECT * FROM t1 ORDER BY id; +SELECT * FROM t2 ORDER BY id; + +--connection node_2 +SELECT * FROM t1 ORDER BY id; +SELECT * FROM t2 ORDER BY id; +DROP TRIGGER tr1; +DROP TRIGGER tr2; +DROP TRIGGER tr3; +DROP TABLE t1,t2; + --connection node_1 +--disable_query_log --eval SET GLOBAL wsrep_replicate_myisam = $wsrep_replicate_myisam_orig +--enable_query_log --connection node_2 +--disable_query_log --eval SET GLOBAL wsrep_replicate_myisam = $wsrep_replicate_myisam_orig +--enable_query_log diff --git a/mysql-test/suite/galera_sr/r/MDEV-23623.result b/mysql-test/suite/galera_sr/r/MDEV-23623.result new file mode 100644 index 00000000000..edba2a16bcb --- /dev/null +++ b/mysql-test/suite/galera_sr/r/MDEV-23623.result @@ -0,0 +1,26 @@ +connection node_2; +connection node_1; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY AUTO_INCREMENT, f2 CHAR(255)) ENGINE=InnoDB; +INSERT INTO t1 (f2) VALUES ('a'); +INSERT INTO t1 (f2) VALUES ('b'); +INSERT INTO t1 (f2) VALUES ('c'); +connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2; +connection node_2a; +SET SESSION wsrep_sync_wait = 0; +SET GLOBAL wsrep_provider_options = 'dbug=d,after_certify_apply_monitor_enter'; +connection node_2; +SET SESSION wsrep_retry_autocommit = 0; +SET SESSION wsrep_trx_fragment_size = 64; +DELETE FROM t1 ORDER BY f1 DESC LIMIT 2;; +connection node_2a; +SET SESSION wsrep_on = 0; +SET SESSION wsrep_on = 1; +connection node_1; +INSERT INTO t1 (f2) VALUES ('d'),('e'); +connection node_2a; +SET GLOBAL wsrep_provider_options = 'signal=after_certify_apply_monitor_enter'; +SET GLOBAL wsrep_provider_options = 'dbug='; +connection node_2; +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction +connection node_1; +DROP TABLE t1; diff --git a/mysql-test/suite/galera_sr/t/MDEV-23623.test b/mysql-test/suite/galera_sr/t/MDEV-23623.test new file mode 100644 index 00000000000..2fe728f42bb --- /dev/null +++ b/mysql-test/suite/galera_sr/t/MDEV-23623.test @@ -0,0 +1,50 @@ +# +# MDEV-23623 - trans_commit_stmt(THD*): Assertion +# `thd->in_active_multi_stmt_transaction() || +# thd->m_transaction_psi == __null' failed +# + +--source include/galera_cluster.inc +--source include/have_debug_sync.inc +--source include/galera_have_debug_sync.inc + +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY AUTO_INCREMENT, f2 CHAR(255)) ENGINE=InnoDB; +INSERT INTO t1 (f2) VALUES ('a'); +INSERT INTO t1 (f2) VALUES ('b'); +INSERT INTO t1 (f2) VALUES ('c'); + +--connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2 +--connection node_2a +SET SESSION wsrep_sync_wait = 0; +--let $galera_sync_point = after_certify_apply_monitor_enter +--source include/galera_set_sync_point.inc + +--connection node_2 +SET SESSION wsrep_retry_autocommit = 0; +SET SESSION wsrep_trx_fragment_size = 64; +--send DELETE FROM t1 ORDER BY f1 DESC LIMIT 2; + +--connection node_2a +--source include/galera_wait_sync_point.inc + +# +# This is going to cause a certification +# failure on node_2 +# +--connection node_1 +INSERT INTO t1 (f2) VALUES ('d'),('e'); + +--connection node_2a +--source include/galera_signal_sync_point.inc +--source include/galera_clear_sync_point.inc + +--connection node_2 +--error ER_LOCK_DEADLOCK +--reap + +# +# Assertion would happen when the following +# DROP TABLE is applied on node_2 +# +--connection node_1 +DROP TABLE t1; diff --git a/mysql-test/suite/innodb/include/wait_all_purged.inc b/mysql-test/suite/innodb/include/wait_all_purged.inc index a478cc8aa2c..e3a506c7622 100644 --- a/mysql-test/suite/innodb/include/wait_all_purged.inc +++ b/mysql-test/suite/innodb/include/wait_all_purged.inc @@ -1,30 +1,17 @@ # Wait for everything to be purged. # The user should have set innodb_purge_rseg_truncate_frequency=1. +--disable_query_log if (!$wait_all_purged) { - let $wait_all_purged= 0; + SET GLOBAL innodb_max_purge_lag_wait= 0; } -let $remaining_expect= `select concat('InnoDB ',$wait_all_purged)`; - -let $wait_counter= 600; -if ($VALGRIND_TEST) +if ($wait_all_purged) { - let $wait_counter= 2000; + eval SET GLOBAL innodb_max_purge_lag_wait= $wait_all_purged; } +--enable_query_log -while ($wait_counter) -{ - --replace_regex /.*History list length ([0-9]+).*/\1/ - let $remaining= `SHOW ENGINE INNODB STATUS`; - if ($remaining == $remaining_expect) - { - let $wait_counter= 0; - } - if ($wait_counter) - { - real_sleep 0.1; - dec $wait_counter; - } -} +--replace_regex /.*History list length ([0-9]+).*/\1/ +let $remaining= `SHOW ENGINE INNODB STATUS`; echo $remaining transactions not purged; diff --git a/mysql-test/suite/innodb/r/innodb-virtual-columns.result b/mysql-test/suite/innodb/r/innodb-virtual-columns.result index 4b2df7eb287..484c9b30bd6 100644 --- a/mysql-test/suite/innodb/r/innodb-virtual-columns.result +++ b/mysql-test/suite/innodb/r/innodb-virtual-columns.result @@ -34,7 +34,7 @@ grad_degree CREATE TABLE `grad_degree` ( `plan` varchar(10) NOT NULL, `admit_term` char(4) NOT NULL, `wdraw_rsn` varchar(4) NOT NULL DEFAULT '', - `ofis_deg_status` varchar(15) GENERATED ALWAYS AS (case when `wdraw_rsn` = '' then 'In progress' when (`wdraw_rsn` = 'DCMP' or `wdraw_rsn` = 'TRDC') then 'Completed' else 'Not Completed' end) VIRTUAL, + `ofis_deg_status` varchar(15) GENERATED ALWAYS AS (case when `wdraw_rsn` = '' then 'In progress' when `wdraw_rsn` = 'DCMP' or `wdraw_rsn` = 'TRDC' then 'Completed' else 'Not Completed' end) VIRTUAL, `deg_start_term` char(4) NOT NULL DEFAULT '' COMMENT 'Educated guess at the beginning of the data', `deg_as_of_term` char(4) NOT NULL COMMENT 'In most cases also end term', PRIMARY KEY (`student_id`,`plan`,`admit_term`) @@ -142,14 +142,14 @@ grad_degree CREATE TABLE `grad_degree` ( `plan` varchar(10) NOT NULL, `admit_term` char(4) NOT NULL, `wdraw_rsn` varchar(4) NOT NULL DEFAULT '', - `ofis_deg_status` varchar(15) GENERATED ALWAYS AS (case when `wdraw_rsn` = '' then 'In progress' when (`wdraw_rsn` = 'DCMP' or `wdraw_rsn` = 'TRDC') then 'Completed' else 'Not Completed' end) VIRTUAL, - `ofis_deg_status2` varchar(15) GENERATED ALWAYS AS (case when `wdraw_rsn` = '' then 'In progress2' when (`wdraw_rsn` = 'DCMP' or `wdraw_rsn` = 'TRDC') then 'Completed2' else 'Not Completed2' end) VIRTUAL, - `ofis_deg_status3` varchar(15) GENERATED ALWAYS AS (case when `wdraw_rsn` = '' then 'In progress3' when (`wdraw_rsn` = 'DCMP' or `wdraw_rsn` = 'TRDC') then 'Completed3' else 'Not Completed3' end) VIRTUAL, - `ofis_deg_status4` varchar(15) GENERATED ALWAYS AS (case when `wdraw_rsn` = '' then 'In progress4' when (`wdraw_rsn` = 'DCMP' or `wdraw_rsn` = 'TRDC') then 'Completed4' else 'Not Completed4' end) VIRTUAL, - `ofis_deg_status5` varchar(15) GENERATED ALWAYS AS (case when `wdraw_rsn` = '' then 'In progress5' when (`wdraw_rsn` = 'DCMP' or `wdraw_rsn` = 'TRDC') then 'Completed5' else 'Not Completed5' end) VIRTUAL, - `ofis_deg_status6` varchar(15) GENERATED ALWAYS AS (case when `wdraw_rsn` = '' then 'In progress6' when (`wdraw_rsn` = 'DCMP' or `wdraw_rsn` = 'TRDC') then 'Completed6' else 'Not Completed6' end) VIRTUAL, - `ofis_deg_status7` varchar(15) GENERATED ALWAYS AS (case when `wdraw_rsn` = '' then 'In progress7' when (`wdraw_rsn` = 'DCMP' or `wdraw_rsn` = 'TRDC') then 'Completed7' else 'Not Completed7' end) VIRTUAL, - `ofis_deg_status8` varchar(15) GENERATED ALWAYS AS (case when `wdraw_rsn` = '' then 'In progress8' when (`wdraw_rsn` = 'DCMP' or `wdraw_rsn` = 'TRDC') then 'Completed8' else 'Not Completed8' end) VIRTUAL, + `ofis_deg_status` varchar(15) GENERATED ALWAYS AS (case when `wdraw_rsn` = '' then 'In progress' when `wdraw_rsn` = 'DCMP' or `wdraw_rsn` = 'TRDC' then 'Completed' else 'Not Completed' end) VIRTUAL, + `ofis_deg_status2` varchar(15) GENERATED ALWAYS AS (case when `wdraw_rsn` = '' then 'In progress2' when `wdraw_rsn` = 'DCMP' or `wdraw_rsn` = 'TRDC' then 'Completed2' else 'Not Completed2' end) VIRTUAL, + `ofis_deg_status3` varchar(15) GENERATED ALWAYS AS (case when `wdraw_rsn` = '' then 'In progress3' when `wdraw_rsn` = 'DCMP' or `wdraw_rsn` = 'TRDC' then 'Completed3' else 'Not Completed3' end) VIRTUAL, + `ofis_deg_status4` varchar(15) GENERATED ALWAYS AS (case when `wdraw_rsn` = '' then 'In progress4' when `wdraw_rsn` = 'DCMP' or `wdraw_rsn` = 'TRDC' then 'Completed4' else 'Not Completed4' end) VIRTUAL, + `ofis_deg_status5` varchar(15) GENERATED ALWAYS AS (case when `wdraw_rsn` = '' then 'In progress5' when `wdraw_rsn` = 'DCMP' or `wdraw_rsn` = 'TRDC' then 'Completed5' else 'Not Completed5' end) VIRTUAL, + `ofis_deg_status6` varchar(15) GENERATED ALWAYS AS (case when `wdraw_rsn` = '' then 'In progress6' when `wdraw_rsn` = 'DCMP' or `wdraw_rsn` = 'TRDC' then 'Completed6' else 'Not Completed6' end) VIRTUAL, + `ofis_deg_status7` varchar(15) GENERATED ALWAYS AS (case when `wdraw_rsn` = '' then 'In progress7' when `wdraw_rsn` = 'DCMP' or `wdraw_rsn` = 'TRDC' then 'Completed7' else 'Not Completed7' end) VIRTUAL, + `ofis_deg_status8` varchar(15) GENERATED ALWAYS AS (case when `wdraw_rsn` = '' then 'In progress8' when `wdraw_rsn` = 'DCMP' or `wdraw_rsn` = 'TRDC' then 'Completed8' else 'Not Completed8' end) VIRTUAL, `deg_start_term` char(4) NOT NULL DEFAULT '' COMMENT 'Educated guess at the beginning of the data', `deg_as_of_term` char(4) NOT NULL COMMENT 'In most cases also end term', PRIMARY KEY (`student_id`,`plan`,`admit_term`) @@ -199,14 +199,14 @@ grad_degree CREATE TABLE `grad_degree` ( `plan` varchar(10) NOT NULL, `admit_term` char(4) NOT NULL, `wdraw_rsn` varchar(4) NOT NULL DEFAULT '', - `ofis_deg_status` varchar(15) GENERATED ALWAYS AS (case when `wdraw_rsn` = '' then 'In progress' when (`wdraw_rsn` = 'DCMP' or `wdraw_rsn` = 'TRDC') then 'Completed' else 'Not Completed' end) VIRTUAL, - `ofis_deg_status2` varchar(15) GENERATED ALWAYS AS (case when `wdraw_rsn` = '' then 'In progress2' when (`wdraw_rsn` = 'DCMP' or `wdraw_rsn` = 'TRDC') then 'Completed2' else 'Not Completed2' end) VIRTUAL, - `ofis_deg_status3` varchar(15) GENERATED ALWAYS AS (case when `wdraw_rsn` = '' then 'In progress3' when (`wdraw_rsn` = 'DCMP' or `wdraw_rsn` = 'TRDC') then 'Completed3' else 'Not Completed3' end) VIRTUAL, - `ofis_deg_status4` varchar(15) GENERATED ALWAYS AS (case when `wdraw_rsn` = '' then 'In progress4' when (`wdraw_rsn` = 'DCMP' or `wdraw_rsn` = 'TRDC') then 'Completed4' else 'Not Completed4' end) VIRTUAL, - `ofis_deg_status5` varchar(15) GENERATED ALWAYS AS (case when `wdraw_rsn` = '' then 'In progress5' when (`wdraw_rsn` = 'DCMP' or `wdraw_rsn` = 'TRDC') then 'Completed5' else 'Not Completed5' end) VIRTUAL, - `ofis_deg_status6` varchar(15) GENERATED ALWAYS AS (case when `wdraw_rsn` = '' then 'In progress6' when (`wdraw_rsn` = 'DCMP' or `wdraw_rsn` = 'TRDC') then 'Completed6' else 'Not Completed6' end) VIRTUAL, - `ofis_deg_status7` varchar(15) GENERATED ALWAYS AS (case when `wdraw_rsn` = '' then 'In progress7' when (`wdraw_rsn` = 'DCMP' or `wdraw_rsn` = 'TRDC') then 'Completed7' else 'Not Completed7' end) VIRTUAL, - `ofis_deg_status8` varchar(15) GENERATED ALWAYS AS (case when `wdraw_rsn` = '' then 'In progress8' when (`wdraw_rsn` = 'DCMP' or `wdraw_rsn` = 'TRDC') then 'Completed8' else 'Not Completed8' end) VIRTUAL, + `ofis_deg_status` varchar(15) GENERATED ALWAYS AS (case when `wdraw_rsn` = '' then 'In progress' when `wdraw_rsn` = 'DCMP' or `wdraw_rsn` = 'TRDC' then 'Completed' else 'Not Completed' end) VIRTUAL, + `ofis_deg_status2` varchar(15) GENERATED ALWAYS AS (case when `wdraw_rsn` = '' then 'In progress2' when `wdraw_rsn` = 'DCMP' or `wdraw_rsn` = 'TRDC' then 'Completed2' else 'Not Completed2' end) VIRTUAL, + `ofis_deg_status3` varchar(15) GENERATED ALWAYS AS (case when `wdraw_rsn` = '' then 'In progress3' when `wdraw_rsn` = 'DCMP' or `wdraw_rsn` = 'TRDC' then 'Completed3' else 'Not Completed3' end) VIRTUAL, + `ofis_deg_status4` varchar(15) GENERATED ALWAYS AS (case when `wdraw_rsn` = '' then 'In progress4' when `wdraw_rsn` = 'DCMP' or `wdraw_rsn` = 'TRDC' then 'Completed4' else 'Not Completed4' end) VIRTUAL, + `ofis_deg_status5` varchar(15) GENERATED ALWAYS AS (case when `wdraw_rsn` = '' then 'In progress5' when `wdraw_rsn` = 'DCMP' or `wdraw_rsn` = 'TRDC' then 'Completed5' else 'Not Completed5' end) VIRTUAL, + `ofis_deg_status6` varchar(15) GENERATED ALWAYS AS (case when `wdraw_rsn` = '' then 'In progress6' when `wdraw_rsn` = 'DCMP' or `wdraw_rsn` = 'TRDC' then 'Completed6' else 'Not Completed6' end) VIRTUAL, + `ofis_deg_status7` varchar(15) GENERATED ALWAYS AS (case when `wdraw_rsn` = '' then 'In progress7' when `wdraw_rsn` = 'DCMP' or `wdraw_rsn` = 'TRDC' then 'Completed7' else 'Not Completed7' end) VIRTUAL, + `ofis_deg_status8` varchar(15) GENERATED ALWAYS AS (case when `wdraw_rsn` = '' then 'In progress8' when `wdraw_rsn` = 'DCMP' or `wdraw_rsn` = 'TRDC' then 'Completed8' else 'Not Completed8' end) VIRTUAL, `deg_as_of_term` char(4) NOT NULL COMMENT 'In most cases also end term', PRIMARY KEY (`student_id`,`plan`,`admit_term`), KEY `grad_degree_as_of_term_ndx` (`deg_as_of_term`) @@ -278,14 +278,14 @@ grad_degree CREATE TABLE `grad_degree` ( `plan` varchar(10) NOT NULL, `admit_term` char(4) NOT NULL, `wdraw_rsn` varchar(4) NOT NULL DEFAULT '', - `ofis_deg_status` varchar(15) GENERATED ALWAYS AS (case when `wdraw_rsn` = '' then 'In progress' when (`wdraw_rsn` = 'DCMP' or `wdraw_rsn` = 'TRDC') then 'Completed' else 'Not Completed' end) VIRTUAL, - `ofis_deg_status2` varchar(15) GENERATED ALWAYS AS (case when `wdraw_rsn` = '' then 'In progress2' when (`wdraw_rsn` = 'DCMP' or `wdraw_rsn` = 'TRDC') then 'Completed2' else 'Not Completed2' end) VIRTUAL, - `ofis_deg_status3` varchar(15) GENERATED ALWAYS AS (case when `wdraw_rsn` = '' then 'In progress3' when (`wdraw_rsn` = 'DCMP' or `wdraw_rsn` = 'TRDC') then 'Completed3' else 'Not Completed3' end) VIRTUAL, - `ofis_deg_status4` varchar(15) GENERATED ALWAYS AS (case when `wdraw_rsn` = '' then 'In progress4' when (`wdraw_rsn` = 'DCMP' or `wdraw_rsn` = 'TRDC') then 'Completed4' else 'Not Completed4' end) VIRTUAL, - `ofis_deg_status5` varchar(15) GENERATED ALWAYS AS (case when `wdraw_rsn` = '' then 'In progress5' when (`wdraw_rsn` = 'DCMP' or `wdraw_rsn` = 'TRDC') then 'Completed5' else 'Not Completed5' end) VIRTUAL, - `ofis_deg_status6` varchar(15) GENERATED ALWAYS AS (case when `wdraw_rsn` = '' then 'In progress6' when (`wdraw_rsn` = 'DCMP' or `wdraw_rsn` = 'TRDC') then 'Completed6' else 'Not Completed6' end) VIRTUAL, - `ofis_deg_status7` varchar(15) GENERATED ALWAYS AS (case when `wdraw_rsn` = '' then 'In progress7' when (`wdraw_rsn` = 'DCMP' or `wdraw_rsn` = 'TRDC') then 'Completed7' else 'Not Completed7' end) VIRTUAL, - `ofis_deg_status8` varchar(15) GENERATED ALWAYS AS (case when `wdraw_rsn` = '' then 'In progress8' when (`wdraw_rsn` = 'DCMP' or `wdraw_rsn` = 'TRDC') then 'Completed8' else 'Not Completed8' end) VIRTUAL, + `ofis_deg_status` varchar(15) GENERATED ALWAYS AS (case when `wdraw_rsn` = '' then 'In progress' when `wdraw_rsn` = 'DCMP' or `wdraw_rsn` = 'TRDC' then 'Completed' else 'Not Completed' end) VIRTUAL, + `ofis_deg_status2` varchar(15) GENERATED ALWAYS AS (case when `wdraw_rsn` = '' then 'In progress2' when `wdraw_rsn` = 'DCMP' or `wdraw_rsn` = 'TRDC' then 'Completed2' else 'Not Completed2' end) VIRTUAL, + `ofis_deg_status3` varchar(15) GENERATED ALWAYS AS (case when `wdraw_rsn` = '' then 'In progress3' when `wdraw_rsn` = 'DCMP' or `wdraw_rsn` = 'TRDC' then 'Completed3' else 'Not Completed3' end) VIRTUAL, + `ofis_deg_status4` varchar(15) GENERATED ALWAYS AS (case when `wdraw_rsn` = '' then 'In progress4' when `wdraw_rsn` = 'DCMP' or `wdraw_rsn` = 'TRDC' then 'Completed4' else 'Not Completed4' end) VIRTUAL, + `ofis_deg_status5` varchar(15) GENERATED ALWAYS AS (case when `wdraw_rsn` = '' then 'In progress5' when `wdraw_rsn` = 'DCMP' or `wdraw_rsn` = 'TRDC' then 'Completed5' else 'Not Completed5' end) VIRTUAL, + `ofis_deg_status6` varchar(15) GENERATED ALWAYS AS (case when `wdraw_rsn` = '' then 'In progress6' when `wdraw_rsn` = 'DCMP' or `wdraw_rsn` = 'TRDC' then 'Completed6' else 'Not Completed6' end) VIRTUAL, + `ofis_deg_status7` varchar(15) GENERATED ALWAYS AS (case when `wdraw_rsn` = '' then 'In progress7' when `wdraw_rsn` = 'DCMP' or `wdraw_rsn` = 'TRDC' then 'Completed7' else 'Not Completed7' end) VIRTUAL, + `ofis_deg_status8` varchar(15) GENERATED ALWAYS AS (case when `wdraw_rsn` = '' then 'In progress8' when `wdraw_rsn` = 'DCMP' or `wdraw_rsn` = 'TRDC' then 'Completed8' else 'Not Completed8' end) VIRTUAL, `deg_start_term` char(4) NOT NULL DEFAULT '' COMMENT 'Educated guess at the beginning of the data', `deg_as_of_term` char(4) NOT NULL COMMENT 'In most cases also end term', PRIMARY KEY (`student_id`,`plan`,`admit_term`) diff --git a/mysql-test/suite/innodb/r/instant_alter_crash.result b/mysql-test/suite/innodb/r/instant_alter_crash.result index cfcb24f8bb2..ef0e310492a 100644 --- a/mysql-test/suite/innodb/r/instant_alter_crash.result +++ b/mysql-test/suite/innodb/r/instant_alter_crash.result @@ -40,6 +40,7 @@ ALTER TABLE t2 DROP COLUMN c3, ADD COLUMN c5 TEXT DEFAULT 'naturam abhorrere'; connection default; SET DEBUG_SYNC='now WAIT_FOR ddl'; SET GLOBAL innodb_flush_log_at_trx_commit=1; +SET debug_dbug='+d,dict_sys_mutex_avoid'; UPDATE t1 SET c2=c2+1; # Kill the server disconnect ddl; @@ -68,6 +69,7 @@ ALTER TABLE t2 ADD COLUMN (c4 TEXT NOT NULL DEFAULT ' et malorum'); connection default; SET DEBUG_SYNC='now WAIT_FOR ddl'; SET GLOBAL innodb_flush_log_at_trx_commit=1; +SET debug_dbug='+d,dict_sys_mutex_avoid'; DELETE FROM t1; # Kill the server disconnect ddl; diff --git a/mysql-test/suite/innodb/r/instant_alter_index_rename.result b/mysql-test/suite/innodb/r/instant_alter_index_rename.result index 69f7cc8df4c..41dec275d90 100644 --- a/mysql-test/suite/innodb/r/instant_alter_index_rename.result +++ b/mysql-test/suite/innodb/r/instant_alter_index_rename.result @@ -198,3 +198,39 @@ Table Op Msg_type Msg_text test.t1 check status OK DROP TABLE t1; DROP FUNCTION get_index_id; +# +# MDEV-23356 InnoDB: Failing assertion: field->col->mtype == type, crash or ASAN failures in row_sel_convert_mysql_key_to_innobase, InnoDB indexes are inconsistent after INDEX changes +# +CREATE TABLE t1 (a INT, b INT, c CHAR(8), +KEY ind1(c), KEY ind2(b)) ENGINE=InnoDB STATS_PERSISTENT=1; +INSERT INTO t1 SELECT 1, 1, 'a' FROM seq_1_to_100; +SELECT table_name, index_name, stat_name FROM mysql.innodb_index_stats; +table_name index_name stat_name +t1 GEN_CLUST_INDEX n_diff_pfx01 +t1 GEN_CLUST_INDEX n_leaf_pages +t1 GEN_CLUST_INDEX size +t1 ind1 n_diff_pfx01 +t1 ind1 n_diff_pfx02 +t1 ind1 n_leaf_pages +t1 ind1 size +t1 ind2 n_diff_pfx01 +t1 ind2 n_diff_pfx02 +t1 ind2 n_leaf_pages +t1 ind2 size +ALTER TABLE t1 DROP INDEX ind2, ADD INDEX ind3(b), +DROP INDEX ind1, ADD INDEX ind2(c); +SELECT table_name, index_name, stat_name FROM mysql.innodb_index_stats; +table_name index_name stat_name +t1 GEN_CLUST_INDEX n_diff_pfx01 +t1 GEN_CLUST_INDEX n_leaf_pages +t1 GEN_CLUST_INDEX size +t1 ind2 n_diff_pfx01 +t1 ind2 n_diff_pfx02 +t1 ind2 n_leaf_pages +t1 ind2 size +t1 ind3 n_diff_pfx01 +t1 ind3 n_diff_pfx02 +t1 ind3 n_leaf_pages +t1 ind3 size +UPDATE t1 SET a = 1 WHERE c = 'foo'; +DROP TABLE t1; diff --git a/mysql-test/suite/innodb/r/stats_persistent.result b/mysql-test/suite/innodb/r/stats_persistent.result new file mode 100644 index 00000000000..3ae10e31cb3 --- /dev/null +++ b/mysql-test/suite/innodb/r/stats_persistent.result @@ -0,0 +1,19 @@ +# +# MDEV-23991 dict_table_stats_lock() has unnecessarily long scope +# +CREATE TABLE t1(a INT) ENGINE=INNODB STATS_PERSISTENT=1; +SET DEBUG_SYNC='dict_stats_update_persistent SIGNAL stop WAIT_FOR go'; +ANALYZE TABLE t1; +connect con1, localhost, root; +SET DEBUG_SYNC='now WAIT_FOR stop'; +SELECT ENGINE,SUM(DATA_LENGTH+INDEX_LENGTH),COUNT(ENGINE),SUM(DATA_LENGTH),SUM(INDEX_LENGTH) FROM information_schema.TABLES WHERE ENGINE='InnoDB'; +ENGINE SUM(DATA_LENGTH+INDEX_LENGTH) COUNT(ENGINE) SUM(DATA_LENGTH) SUM(INDEX_LENGTH) +InnoDB 114688 4 65536 49152 +SET DEBUG_SYNC='now SIGNAL go'; +disconnect con1; +connection default; +Table Op Msg_type Msg_text +test.t1 analyze status Engine-independent statistics collected +test.t1 analyze status OK +SET DEBUG_SYNC= 'RESET'; +DROP TABLE t1; diff --git a/mysql-test/suite/innodb/t/instant_alter_bugs.test b/mysql-test/suite/innodb/t/instant_alter_bugs.test index 1cfbbccde27..ad4343a056d 100644 --- a/mysql-test/suite/innodb/t/instant_alter_bugs.test +++ b/mysql-test/suite/innodb/t/instant_alter_bugs.test @@ -447,10 +447,6 @@ create table t1 ( col_text_g text generated always as (substr(col_text,1,499)) ) engine innodb row_format = redundant; insert into t1 (col_int,col_text) values (0, 'a'), (null, 'b'); -# FIXME: remove the following to trigger the bug ---disable_query_log -alter table t1 modify column col_text text null, force; ---enable_query_log alter table t1 modify column col_text text null, algorithm = instant; insert into t1 (col_int,col_text) values (1, null), (null, null); update t1 set col_text= 'd'; diff --git a/mysql-test/suite/innodb/t/instant_alter_crash.test b/mysql-test/suite/innodb/t/instant_alter_crash.test index 13ff292d9ff..f9b18aa589f 100644 --- a/mysql-test/suite/innodb/t/instant_alter_crash.test +++ b/mysql-test/suite/innodb/t/instant_alter_crash.test @@ -55,6 +55,7 @@ ALTER TABLE t2 DROP COLUMN c3, ADD COLUMN c5 TEXT DEFAULT 'naturam abhorrere'; connection default; SET DEBUG_SYNC='now WAIT_FOR ddl'; SET GLOBAL innodb_flush_log_at_trx_commit=1; +SET debug_dbug='+d,dict_sys_mutex_avoid'; UPDATE t1 SET c2=c2+1; --source include/kill_mysqld.inc @@ -83,6 +84,7 @@ ALTER TABLE t2 ADD COLUMN (c4 TEXT NOT NULL DEFAULT ' et malorum'); connection default; SET DEBUG_SYNC='now WAIT_FOR ddl'; SET GLOBAL innodb_flush_log_at_trx_commit=1; +SET debug_dbug='+d,dict_sys_mutex_avoid'; DELETE FROM t1; --source include/kill_mysqld.inc diff --git a/mysql-test/suite/innodb/t/instant_alter_index_rename.test b/mysql-test/suite/innodb/t/instant_alter_index_rename.test index dd6cee7c860..af66c1027cc 100644 --- a/mysql-test/suite/innodb/t/instant_alter_index_rename.test +++ b/mysql-test/suite/innodb/t/instant_alter_index_rename.test @@ -1,5 +1,6 @@ --source include/have_innodb.inc --source include/have_debug.inc +--source include/have_sequence.inc delimiter |; create function get_index_id(tbl_id int, index_name char(100)) @@ -207,3 +208,22 @@ CHECK TABLE t1 EXTENDED ; DROP TABLE t1; DROP FUNCTION get_index_id; + +--echo # +--echo # MDEV-23356 InnoDB: Failing assertion: field->col->mtype == type, crash or ASAN failures in row_sel_convert_mysql_key_to_innobase, InnoDB indexes are inconsistent after INDEX changes +--echo # + +CREATE TABLE t1 (a INT, b INT, c CHAR(8), + KEY ind1(c), KEY ind2(b)) ENGINE=InnoDB STATS_PERSISTENT=1; + +INSERT INTO t1 SELECT 1, 1, 'a' FROM seq_1_to_100; + +SELECT table_name, index_name, stat_name FROM mysql.innodb_index_stats; + +ALTER TABLE t1 DROP INDEX ind2, ADD INDEX ind3(b), + DROP INDEX ind1, ADD INDEX ind2(c); + +SELECT table_name, index_name, stat_name FROM mysql.innodb_index_stats; + +UPDATE t1 SET a = 1 WHERE c = 'foo'; +DROP TABLE t1; diff --git a/mysql-test/suite/innodb/t/stats_persistent.test b/mysql-test/suite/innodb/t/stats_persistent.test new file mode 100644 index 00000000000..ac412d56d0d --- /dev/null +++ b/mysql-test/suite/innodb/t/stats_persistent.test @@ -0,0 +1,27 @@ +--source include/have_innodb.inc +--source include/have_debug.inc +--source include/have_debug_sync.inc +--source include/count_sessions.inc + +--echo # +--echo # MDEV-23991 dict_table_stats_lock() has unnecessarily long scope +--echo # +CREATE TABLE t1(a INT) ENGINE=INNODB STATS_PERSISTENT=1; + +SET DEBUG_SYNC='dict_stats_update_persistent SIGNAL stop WAIT_FOR go'; +--send ANALYZE TABLE t1 + +--connect(con1, localhost, root) +SET DEBUG_SYNC='now WAIT_FOR stop'; + +SELECT ENGINE,SUM(DATA_LENGTH+INDEX_LENGTH),COUNT(ENGINE),SUM(DATA_LENGTH),SUM(INDEX_LENGTH) FROM information_schema.TABLES WHERE ENGINE='InnoDB'; + +SET DEBUG_SYNC='now SIGNAL go'; +--disconnect con1 + +--connection default +--reap +SET DEBUG_SYNC= 'RESET'; +DROP TABLE t1; + +--source include/wait_until_count_sessions.inc diff --git a/mysql-test/suite/mariabackup/ddl_incremental_encrypted.opt b/mysql-test/suite/mariabackup/ddl_incremental_encrypted.opt new file mode 100644 index 00000000000..1de4aa13350 --- /dev/null +++ b/mysql-test/suite/mariabackup/ddl_incremental_encrypted.opt @@ -0,0 +1,7 @@ +--plugin-load-add=$FILE_KEY_MANAGEMENT_SO +--innodb-file-per-table +--innodb-encryption-threads=4 +--innodb-encrypt-tables +--innodb-encrypt-log +--loose-file-key-management +--loose-file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys.txt diff --git a/mysql-test/suite/mariabackup/ddl_incremental_encrypted.result b/mysql-test/suite/mariabackup/ddl_incremental_encrypted.result new file mode 100644 index 00000000000..f42b6469db6 --- /dev/null +++ b/mysql-test/suite/mariabackup/ddl_incremental_encrypted.result @@ -0,0 +1,26 @@ +SET @old_innodb_log_optimize_ddl=@@global.innodb_log_optimize_ddl; +SET GLOBAL innodb_log_optimize_ddl=ON; +SET @old_debug_dbug=@@global.debug_dbug; +SET GLOBAL debug_dbug="+d,ib_log_checkpoint_avoid"; +SET @old_innodb_page_cleaner_disabled_debug=@@global.innodb_page_cleaner_disabled_debug; +SET GLOBAL innodb_page_cleaner_disabled_debug=ON; +CREATE TABLE t1 (c INT) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1); +# backup +SET GLOBAL debug_dbug="+d,ib_do_not_log_crypt_data"; +INSERT INTO t1 VALUES (2); +# incremental backup +# prepare +# incremental prepare +SET GLOBAL innodb_log_optimize_ddl=@old_innodb_log_optimize_ddl; +SET GLOBAL innodb_page_cleaner_disabled_debug=@old_innodb_page_cleaner_disabled_debug; +SET GLOBAL debug_dbug=@old_debug_dbug; +# Restore and check results +# shutdown server +# remove datadir +# xtrabackup move back +# restart +SELECT count(*) FROM t1; +count(*) +2 +DROP TABLE t1; diff --git a/mysql-test/suite/mariabackup/ddl_incremental_encrypted.test b/mysql-test/suite/mariabackup/ddl_incremental_encrypted.test new file mode 100644 index 00000000000..196201f61c7 --- /dev/null +++ b/mysql-test/suite/mariabackup/ddl_incremental_encrypted.test @@ -0,0 +1,66 @@ +# +# If MDEV-20755 bug is no fixed, incremental prepare will fail. +# +--source include/have_debug.inc +--source include/have_file_key_management.inc + +--let $base_dir=$MYSQLTEST_VARDIR/tmp/backup +--let $inc_dir=$MYSQLTEST_VARDIR/tmp/backup_inc + +SET @old_innodb_log_optimize_ddl=@@global.innodb_log_optimize_ddl; +SET GLOBAL innodb_log_optimize_ddl=ON; + +# Disable pages flushing to allow redo log records to be executed on --prepare. +SET @old_debug_dbug=@@global.debug_dbug; +SET GLOBAL debug_dbug="+d,ib_log_checkpoint_avoid"; +SET @old_innodb_page_cleaner_disabled_debug=@@global.innodb_page_cleaner_disabled_debug; +SET GLOBAL innodb_page_cleaner_disabled_debug=ON; + +CREATE TABLE t1 (c INT) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1); + +--echo # backup +--disable_result_log +--exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$base_dir +--enable_result_log + +# Do not log crypt data to avoid it's execution on --prepare. +SET GLOBAL debug_dbug="+d,ib_do_not_log_crypt_data"; +INSERT INTO t1 VALUES (2); + +--disable_result_log + +# Execute OPTIMIZE TABLE after the table is copied to execute optimized ddl +# callback during backup, which, in turns, will create t1.new file in backup +# directory. +--let after_copy_test_t1=OPTIMIZE TABLE test.t1; + +--echo # incremental backup +--exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$inc_dir --incremental-basedir=$base_dir --dbug=+d,mariabackup_events + +--echo # prepare +--exec $XTRABACKUP --prepare --target-dir=$base_dir + +# If the tablespace is created during delta tablespace open procedure, then +# crypt data will be not written, and page corruption test will not pass +# when some redo log event is executed, and --prepare will fail. +--echo # incremental prepare +--exec $XTRABACKUP --prepare --target-dir=$base_dir --incremental-dir=$inc_dir + +--enable_result_log + +SET GLOBAL innodb_log_optimize_ddl=@old_innodb_log_optimize_ddl; +SET GLOBAL innodb_page_cleaner_disabled_debug=@old_innodb_page_cleaner_disabled_debug; +SET GLOBAL debug_dbug=@old_debug_dbug; + +--echo # Restore and check results +--let $targetdir=$base_dir +--source include/restart_and_restore.inc +--enable_result_log + +SELECT count(*) FROM t1; + +# Cleanup +DROP TABLE t1; +--rmdir $base_dir +--rmdir $inc_dir diff --git a/mysql-test/suite/mariabackup/mlog_index_load.result b/mysql-test/suite/mariabackup/mlog_index_load.result new file mode 100644 index 00000000000..b2367d52dce --- /dev/null +++ b/mysql-test/suite/mariabackup/mlog_index_load.result @@ -0,0 +1,16 @@ +CREATE TABLE t1(i INT PRIMARY KEY auto_increment, a int) ENGINE INNODB; +INSERT INTO t1(a) SELECT * from seq_1_to_10000; +SET GLOBAL innodb_log_optimize_ddl=ON; +# xtrabackup backup +t1.frm +t1.ibd +t1.new +# xtrabackup prepare +# shutdown server +# remove datadir +# xtrabackup move back +# restart +SELECT COUNT(*) from t1; +COUNT(*) +10000 +DROP TABLE t1; diff --git a/mysql-test/suite/mariabackup/mlog_index_load.test b/mysql-test/suite/mariabackup/mlog_index_load.test new file mode 100644 index 00000000000..b9fd6f8ca32 --- /dev/null +++ b/mysql-test/suite/mariabackup/mlog_index_load.test @@ -0,0 +1,28 @@ +--source include/have_debug.inc + +CREATE TABLE t1(i INT PRIMARY KEY auto_increment, a int) ENGINE INNODB; +INSERT INTO t1(a) SELECT * from seq_1_to_10000; +SET GLOBAL innodb_log_optimize_ddl=ON; + +let $targetdir=$MYSQLTEST_VARDIR/tmp/backup; + +let after_copy_test_t1=CREATE INDEX a_ind ON test.t1(a) ALGORITHM=INPLACE; +echo # xtrabackup backup; +--disable_result_log +exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir --dbug=+d,mariabackup_events; +--enable_result_log + +--list_files $targetdir/test t1* +--let before_copy_test_t1= + +echo # xtrabackup prepare; +--disable_result_log +exec $XTRABACKUP --prepare --target-dir=$targetdir; +-- source include/restart_and_restore.inc +--enable_result_log + +# Check that new table is there after restore. +SELECT COUNT(*) from t1; +DROP TABLE t1; +rmdir $targetdir; + diff --git a/mysql-test/suite/period/r/update.result b/mysql-test/suite/period/r/update.result index b02c075560e..b61d8a73b83 100644 --- a/mysql-test/suite/period/r/update.result +++ b/mysql-test/suite/period/r/update.result @@ -292,3 +292,15 @@ Warning 1264 Out of range value for column 'id' at row 1 Warning 1264 Out of range value for column 'id' at row 2 update ignore t1 for portion of p from '1995-07-06' to '2009-01-12' set f = 1; drop table t1; +# +# MDEV-22805 SIGSEGV in check_fields on UPDATE (optimized builds) | Assertion `thd->lex->sql_command == SQLCOM_UPDATE' failed. +# +CREATE TABLE t1 (a INT, b DATE, c DATE, PERIOD FOR APPTIME(b, c)); +INSERT INTO t1 VALUES(1, '1999-01-01', '2018-12-12'); +UPDATE t1 FOR PORTION OF APPTIME FROM (SELECT '1999-01-01' FROM t1 WHERE a=2) TO '2018-01-01' SET a = 100; +ERROR 42000: This version of MariaDB doesn't yet support 'updating and querying the same temporal periods table' +CREATE VIEW v1 AS SELECT * FROM t1; +UPDATE v1 FOR PORTION OF APPTIME FROM (SELECT '1999-01-01' FROM t1 WHERE a=2) TO '2018-01-01' SET a = 100; +ERROR 42S02: 'v1' is a view +DROP VIEW v1; +DROP TABLE t1; diff --git a/mysql-test/suite/period/t/update.test b/mysql-test/suite/period/t/update.test index d4a2080ea0a..66d3bc1e9bf 100644 --- a/mysql-test/suite/period/t/update.test +++ b/mysql-test/suite/period/t/update.test @@ -183,3 +183,21 @@ update ignore t1 set id = 2429681664; update ignore t1 for portion of p from '1995-07-06' to '2009-01-12' set f = 1; drop table t1; + +--echo # +--echo # MDEV-22805 SIGSEGV in check_fields on UPDATE (optimized builds) | Assertion `thd->lex->sql_command == SQLCOM_UPDATE' failed. +--echo # +CREATE TABLE t1 (a INT, b DATE, c DATE, PERIOD FOR APPTIME(b, c)); + +INSERT INTO t1 VALUES(1, '1999-01-01', '2018-12-12'); + +# Without a patch the following statement crashs a server built in debug mode +--error ER_NOT_SUPPORTED_YET +UPDATE t1 FOR PORTION OF APPTIME FROM (SELECT '1999-01-01' FROM t1 WHERE a=2) TO '2018-01-01' SET a = 100; + +CREATE VIEW v1 AS SELECT * FROM t1; +--error ER_IT_IS_A_VIEW +UPDATE v1 FOR PORTION OF APPTIME FROM (SELECT '1999-01-01' FROM t1 WHERE a=2) TO '2018-01-01' SET a = 100; + +DROP VIEW v1; +DROP TABLE t1; diff --git a/mysql-test/suite/plugins/r/server_audit.result b/mysql-test/suite/plugins/r/server_audit.result index 82e16c9be25..ab726a0e22f 100644 --- a/mysql-test/suite/plugins/r/server_audit.result +++ b/mysql-test/suite/plugins/r/server_audit.result @@ -227,6 +227,21 @@ set global server_audit_logging= on; disconnect cn1; drop user user1@localhost; set global server_audit_events=''; +CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'; +CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd'; +connect(localhost,plug,plug_dest,test,MYSQL_PORT,MYSQL_SOCK); +connect plug_con,localhost,plug,plug_dest; +ERROR 28000: Access denied for user 'plug'@'localhost' (using password: YES) +GRANT PROXY ON plug_dest TO plug; +connect plug_con,localhost,plug,plug_dest; +connection plug_con; +select USER(),CURRENT_USER(); +USER() CURRENT_USER() +plug@localhost plug_dest@% +connection default; +disconnect plug_con; +DROP USER plug; +DROP USER plug_dest; set global server_audit_query_log_limit= 15; select (1), (2), (3), (4); 1 2 3 4 @@ -416,6 +431,46 @@ TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,proxies_priv, TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,roles_mapping, TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,global_priv, TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global server_audit_events=\'\'',0 +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,db, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,tables_priv, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,columns_priv, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,procs_priv, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,proxies_priv, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,roles_mapping, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,global_priv, +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'CREATE USER plug IDENTIFIED WITH \'test_plugin_server\' AS \'plug_dest\'',0 +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,db, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,tables_priv, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,columns_priv, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,procs_priv, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,proxies_priv, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,roles_mapping, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,global_priv, +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'CREATE USER plug_dest IDENTIFIED BY *****',0 +TIME,HOSTNAME,plug,localhost,ID,0,FAILED_CONNECT,,,ID +TIME,HOSTNAME,plug,localhost,ID,0,DISCONNECT,,,0 +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,proxies_priv, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,global_priv, +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'GRANT PROXY ON plug_dest TO plug',0 +TIME,HOSTNAME,plug,localhost,ID,0,PROXY_CONNECT,test,`plug_dest`@`%`,0 +TIME,HOSTNAME,plug,localhost,ID,0,CONNECT,test,,0 +TIME,HOSTNAME,plug,localhost,ID,0,DISCONNECT,test,,0 +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,db, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,tables_priv, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,columns_priv, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,procs_priv, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,proxies_priv, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,roles_mapping, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,global_priv, +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'DROP USER plug',0 +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,db, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,tables_priv, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,columns_priv, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,procs_priv, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,proxies_priv, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,roles_mapping, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,global_priv, +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'DROP USER plug_dest',0 TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global serv',0 TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'select (1), (2)',0 TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'select \'A\', ',0 diff --git a/mysql-test/suite/plugins/t/server_audit.test b/mysql-test/suite/plugins/t/server_audit.test index 2a76c1eaadc..787541f7ca0 100644 --- a/mysql-test/suite/plugins/t/server_audit.test +++ b/mysql-test/suite/plugins/t/server_audit.test @@ -1,4 +1,4 @@ - +--source include/have_plugin_auth.inc --source include/not_embedded.inc if (!$SERVER_AUDIT_SO) { @@ -174,6 +174,25 @@ drop user user1@localhost; set global server_audit_events=''; +CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'; +CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd'; +--sleep 2 +--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK +--error ER_ACCESS_DENIED_ERROR : this should fail : no grant +connect(plug_con,localhost,plug,plug_dest); +--sleep 2 +GRANT PROXY ON plug_dest TO plug; +--sleep 2 +connect(plug_con,localhost,plug,plug_dest); +connection plug_con; +select USER(),CURRENT_USER(); +connection default; +disconnect plug_con; +--sleep 2 +--sleep 2 +DROP USER plug; +DROP USER plug_dest; + set global server_audit_query_log_limit= 15; select (1), (2), (3), (4); select 'A', 'B', 'C', 'D'; diff --git a/mysql-test/suite/roles/set_default_role_clear.result b/mysql-test/suite/roles/set_default_role_clear.result index 6441dfc2aa4..281ed7e45ea 100644 --- a/mysql-test/suite/roles/set_default_role_clear.result +++ b/mysql-test/suite/roles/set_default_role_clear.result @@ -17,6 +17,7 @@ Grants for test_user@localhost GRANT `test_role` TO `test_user`@`localhost` GRANT USAGE ON *.* TO `test_user`@`localhost` GRANT SELECT ON *.* TO `test_role` +SET DEFAULT ROLE test_role FOR 'test_user'@'localhost' select user, host, default_role from mysql.user where user='test_user'; User Host default_role test_user localhost test_role diff --git a/mysql-test/suite/roles/set_default_role_for.result b/mysql-test/suite/roles/set_default_role_for.result index 533a646e6e3..fec43b8e763 100644 --- a/mysql-test/suite/roles/set_default_role_for.result +++ b/mysql-test/suite/roles/set_default_role_for.result @@ -21,6 +21,7 @@ Grants for user_a@localhost GRANT `role_a` TO `user_a`@`localhost` GRANT USAGE ON *.* TO `user_a`@`localhost` GRANT SELECT ON *.* TO `role_a` +SET DEFAULT ROLE role_a FOR 'user_a'@'localhost' select user, host, default_role from mysql.user where user like 'user_%'; User Host default_role user_a localhost role_a @@ -42,6 +43,7 @@ Grants for user_b@localhost GRANT `role_b` TO `user_b`@`localhost` GRANT USAGE ON *.* TO `user_b`@`localhost` GRANT INSERT, UPDATE ON *.* TO `role_b` +SET DEFAULT ROLE role_b FOR 'user_b'@'localhost' select user, host, default_role from mysql.user where user like 'user_%'; ERROR 42000: SELECT command denied to user 'user_b'@'localhost' for table 'user' set default role NONE for user_a@localhost; diff --git a/mysql-test/suite/roles/set_default_role_invalid.result b/mysql-test/suite/roles/set_default_role_invalid.result index c8789594593..08087acc51f 100644 --- a/mysql-test/suite/roles/set_default_role_invalid.result +++ b/mysql-test/suite/roles/set_default_role_invalid.result @@ -24,6 +24,7 @@ Grants for test_user@localhost GRANT `test_role` TO `test_user`@`localhost` GRANT USAGE ON *.* TO `test_user`@`localhost` GRANT SELECT ON *.* TO `test_role` +SET DEFAULT ROLE test_role FOR 'test_user'@'localhost' select user, host, default_role from mysql.user where user='test_user'; User Host default_role test_user localhost test_role @@ -71,6 +72,7 @@ GRANT `r1` TO `b`@`%` GRANT `r2` TO `b`@`%` GRANT USAGE ON *.* TO `b`@`%` GRANT SELECT ON `mysql`.* TO `b`@`%` +SET DEFAULT ROLE r2 FOR 'b'@'%' SET DEFAULT ROLE r1 FOR a; ERROR 42000: Access denied for user 'b'@'%' to database 'mysql' SELECT CURRENT_ROLE; @@ -96,6 +98,7 @@ GRANT `r1` TO `b`@`%` GRANT `r2` TO `b`@`%` GRANT USAGE ON *.* TO `b`@`%` GRANT SELECT, UPDATE ON `mysql`.* TO `b`@`%` +SET DEFAULT ROLE r2 FOR 'b'@'%' SET DEFAULT ROLE r1 FOR a; ERROR OP000: User `a@%` has not been granted role `r1` SET DEFAULT ROLE invalid_role; diff --git a/mysql-test/suite/roles/set_default_role_new_connection.result b/mysql-test/suite/roles/set_default_role_new_connection.result index dbf0db863c6..71035737f99 100644 --- a/mysql-test/suite/roles/set_default_role_new_connection.result +++ b/mysql-test/suite/roles/set_default_role_new_connection.result @@ -23,6 +23,7 @@ Grants for test_user@localhost GRANT `test_role` TO `test_user`@`localhost` GRANT USAGE ON *.* TO `test_user`@`localhost` GRANT SELECT ON *.* TO `test_role` +SET DEFAULT ROLE test_role FOR 'test_user'@'localhost' select user, host, default_role from mysql.user where user = 'test_user'; User Host default_role test_user localhost test_role @@ -51,6 +52,7 @@ Grants for test_user@localhost GRANT `test_role` TO `test_user`@`localhost` GRANT USAGE ON *.* TO `test_user`@`localhost` GRANT SELECT ON *.* TO `test_role` +SET DEFAULT ROLE test_role FOR 'test_user'@'localhost' select user, host, default_role from mysql.user where user = 'test_user'; User Host default_role test_user localhost test_role diff --git a/mysql-test/suite/sql_sequence/mysqldump.result b/mysql-test/suite/sql_sequence/mysqldump.result index 5a3711ebda3..e6aedb57ea6 100644 --- a/mysql-test/suite/sql_sequence/mysqldump.result +++ b/mysql-test/suite/sql_sequence/mysqldump.result @@ -2,20 +2,8 @@ CREATE SEQUENCE a1 engine=aria; CREATE TABLE t1(a INT, KEY (a)) KEY_BLOCK_SIZE=1024; insert into t1 values (1),(2); CREATE SEQUENCE x1 engine=innodb; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `a1` ( - `next_not_cached_value` bigint(21) NOT NULL, - `minimum_value` bigint(21) NOT NULL, - `maximum_value` bigint(21) NOT NULL, - `start_value` bigint(21) NOT NULL COMMENT 'start value when sequences is created or value if RESTART is used', - `increment` bigint(21) NOT NULL COMMENT 'increment value', - `cache_size` bigint(21) unsigned NOT NULL, - `cycle_option` tinyint(1) unsigned NOT NULL COMMENT '0 if no cycles are allowed, 1 if the sequence should begin a new cycle when maximum_value is passed', - `cycle_count` bigint(21) NOT NULL COMMENT 'How many cycles have been done' -) ENGINE=Aria SEQUENCE=1; -/*!40101 SET character_set_client = @saved_cs_client */; -INSERT INTO `a1` VALUES (1,1,9223372036854775806,1,1,1000,0,0); +CREATE SEQUENCE `a1` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=Aria; +SELECT SETVAL(`a1`, 1, 0); /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `t1` ( @@ -24,20 +12,8 @@ CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=1024; /*!40101 SET character_set_client = @saved_cs_client */; INSERT INTO `t1` VALUES (1),(2); -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `x1` ( - `next_not_cached_value` bigint(21) NOT NULL, - `minimum_value` bigint(21) NOT NULL, - `maximum_value` bigint(21) NOT NULL, - `start_value` bigint(21) NOT NULL COMMENT 'start value when sequences is created or value if RESTART is used', - `increment` bigint(21) NOT NULL COMMENT 'increment value', - `cache_size` bigint(21) unsigned NOT NULL, - `cycle_option` tinyint(1) unsigned NOT NULL COMMENT '0 if no cycles are allowed, 1 if the sequence should begin a new cycle when maximum_value is passed', - `cycle_count` bigint(21) NOT NULL COMMENT 'How many cycles have been done' -) ENGINE=InnoDB SEQUENCE=1; -/*!40101 SET character_set_client = @saved_cs_client */; -INSERT INTO `x1` VALUES (1,1,9223372036854775806,1,1,1000,0,0); +CREATE SEQUENCE `x1` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=InnoDB; +SELECT SETVAL(`x1`, 1, 0); DROP TABLE a1,t1,x1; set default_storage_engine=InnoDB; create sequence t1; diff --git a/mysql-test/suite/sql_sequence/next.result b/mysql-test/suite/sql_sequence/next.result index fe761baa032..76991fbe68c 100644 --- a/mysql-test/suite/sql_sequence/next.result +++ b/mysql-test/suite/sql_sequence/next.result @@ -541,5 +541,10 @@ CREATE VIEW v AS SELECT 1; LOCK TABLE v READ; SELECT NEXT VALUE FOR v; ERROR 42S02: 'test.v' is not a SEQUENCE +# +# MDEV-24018: SIGSEGV in Item_func_nextval::update_table on SELECT SETVAL +# +SELECT SETVAL (v,0); +ERROR 42S02: 'test.v' is not a SEQUENCE UNLOCK TABLES; DROP VIEW v; diff --git a/mysql-test/suite/sql_sequence/next.test b/mysql-test/suite/sql_sequence/next.test index 5eac3b668ba..9f0eebdf774 100644 --- a/mysql-test/suite/sql_sequence/next.test +++ b/mysql-test/suite/sql_sequence/next.test @@ -288,5 +288,12 @@ CREATE VIEW v AS SELECT 1; LOCK TABLE v READ; --error ER_NOT_SEQUENCE SELECT NEXT VALUE FOR v; + +--echo # +--echo # MDEV-24018: SIGSEGV in Item_func_nextval::update_table on SELECT SETVAL +--echo # +--error ER_NOT_SEQUENCE +SELECT SETVAL (v,0); + UNLOCK TABLES; DROP VIEW v; diff --git a/mysql-test/suite/sys_vars/r/session_track_system_variables_basic.result b/mysql-test/suite/sys_vars/r/session_track_system_variables_basic.result index e0f3e210feb..c3f4a4ee4eb 100644 --- a/mysql-test/suite/sys_vars/r/session_track_system_variables_basic.result +++ b/mysql-test/suite/sys_vars/r/session_track_system_variables_basic.result @@ -147,6 +147,8 @@ SELECT @@session.session_track_system_variables; @@session.session_track_system_variables +# MDEV-22524 SIGABRT in safe_mutex_unlock with session_track_system_variables and max_relay_log_size. +SET SESSION session_track_system_variables="sql_slave_skip_counter", sql_slave_skip_counter= 0; # Restoring the original values. SET @@global.session_track_system_variables = @global_saved_tmp; # End of tests. diff --git a/mysql-test/suite/sys_vars/r/sysvars_innodb.result b/mysql-test/suite/sys_vars/r/sysvars_innodb.result index eba68ff6185..26460f915d8 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_innodb.result +++ b/mysql-test/suite/sys_vars/r/sysvars_innodb.result @@ -1250,7 +1250,11 @@ SESSION_VALUE NULL DEFAULT_VALUE OFF VARIABLE_SCOPE GLOBAL VARIABLE_TYPE BOOLEAN +<<<<<<< HEAD VARIABLE_COMMENT Deprecated parameter with no effect. +======= +VARIABLE_COMMENT DEPRECATED. Ignored in MariaDB 10.5. Reduce redo logging when natively creating indexes or rebuilding tables. Enabling this may slow down backup and cause delay due to page flushing. +>>>>>>> c05e571e7d53ba11a3422490cff0d93e6691ea62 NUMERIC_MIN_VALUE NULL NUMERIC_MAX_VALUE NULL NUMERIC_BLOCK_SIZE NULL @@ -1353,6 +1357,18 @@ NUMERIC_BLOCK_SIZE 0 ENUM_VALUE_LIST NULL READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED +VARIABLE_NAME INNODB_MAX_PURGE_LAG_WAIT +SESSION_VALUE NULL +DEFAULT_VALUE 4294967295 +VARIABLE_SCOPE GLOBAL +VARIABLE_TYPE INT UNSIGNED +VARIABLE_COMMENT Wait until History list length is below the specified limit +NUMERIC_MIN_VALUE 0 +NUMERIC_MAX_VALUE 4294967295 +NUMERIC_BLOCK_SIZE 0 +ENUM_VALUE_LIST NULL +READ_ONLY NO +COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME INNODB_MAX_UNDO_LOG_SIZE SESSION_VALUE NULL DEFAULT_VALUE 10485760 diff --git a/mysql-test/suite/sys_vars/t/session_track_system_variables_basic.test b/mysql-test/suite/sys_vars/t/session_track_system_variables_basic.test index 20f0cd6cf17..8c1d5dd6546 100644 --- a/mysql-test/suite/sys_vars/t/session_track_system_variables_basic.test +++ b/mysql-test/suite/sys_vars/t/session_track_system_variables_basic.test @@ -119,6 +119,8 @@ SELECT @@global.session_track_system_variables; SELECT @@session.session_track_system_variables; --echo +--echo # MDEV-22524 SIGABRT in safe_mutex_unlock with session_track_system_variables and max_relay_log_size. +SET SESSION session_track_system_variables="sql_slave_skip_counter", sql_slave_skip_counter= 0; --echo # Restoring the original values. SET @@global.session_track_system_variables = @global_saved_tmp; diff --git a/mysql-test/suite/wsrep/r/mdev_22681.result b/mysql-test/suite/wsrep/r/mdev_22681.result new file mode 100644 index 00000000000..ecce324ead6 --- /dev/null +++ b/mysql-test/suite/wsrep/r/mdev_22681.result @@ -0,0 +1,3 @@ +CREATE TABLE t1 (a INT) ENGINE=InnoDB; +EXECUTE IMMEDIATE 'CREATE OR REPLACE TABLE t1 ENGINE=InnoDB AS SELECT 1 AS b'; +DROP TABLE t1; diff --git a/mysql-test/suite/wsrep/t/mdev_22681.cnf b/mysql-test/suite/wsrep/t/mdev_22681.cnf new file mode 100644 index 00000000000..2f310476733 --- /dev/null +++ b/mysql-test/suite/wsrep/t/mdev_22681.cnf @@ -0,0 +1,10 @@ +!include ../my.cnf + +[mysqld.1] +wsrep-on=ON +log-bin +binlog-format=ROW +innodb-flush-log-at-trx-commit=1 +wsrep-cluster-address=gcomm:// +wsrep-provider=@ENV.WSREP_PROVIDER +innodb-autoinc-lock-mode=2 diff --git a/mysql-test/suite/wsrep/t/mdev_22681.test b/mysql-test/suite/wsrep/t/mdev_22681.test new file mode 100644 index 00000000000..ce1129c7485 --- /dev/null +++ b/mysql-test/suite/wsrep/t/mdev_22681.test @@ -0,0 +1,15 @@ +# +# MDEV-22681: Server crashes in galera::ReplicatorSMM::CommitOrder::CommitOrder +# or assertion failed in wsrep::transaction::before_prepare. +# +# EXECUTE IMMEDIATE 'CREATE OR REPLACE TABLE t1 ENGINE=InnoDB AS SELECT 1 AS b' +# crashes the server if binlog is on (see mdev_22681.cnf for configuration). +# +--source include/have_wsrep.inc +--source include/have_wsrep_provider.inc +--source include/have_innodb.inc + +CREATE TABLE t1 (a INT) ENGINE=InnoDB; +EXECUTE IMMEDIATE 'CREATE OR REPLACE TABLE t1 ENGINE=InnoDB AS SELECT 1 AS b'; + +DROP TABLE t1; diff --git a/mysys/CMakeLists.txt b/mysys/CMakeLists.txt index 3cc84a6abc8..6a3a1efaeca 100644 --- a/mysys/CMakeLists.txt +++ b/mysys/CMakeLists.txt @@ -137,7 +137,7 @@ ENDIF() ADD_CONVENIENCE_LIBRARY(mysys ${MYSYS_SOURCES}) MAYBE_DISABLE_IPO(mysys) TARGET_LINK_LIBRARIES(mysys dbug strings ${ZLIB_LIBRARY} - ${LIBNSL} ${LIBM} ${LIBRT} ${LIBDL} ${LIBSOCKET} ${LIBEXECINFO}) + ${LIBNSL} ${LIBM} ${LIBRT} ${CMAKE_DL_LIBS} ${LIBSOCKET} ${LIBEXECINFO}) DTRACE_INSTRUMENT(mysys) IF(HAVE_BFD_H) diff --git a/mysys/mf_iocache.c b/mysys/mf_iocache.c index 75ff99b40a5..82ab6f20646 100644 --- a/mysys/mf_iocache.c +++ b/mysys/mf_iocache.c @@ -251,7 +251,7 @@ int init_io_cache_ext(IO_CACHE *info, File file, size_t cachesize, info->write_buffer= info->buffer + cachesize; else info->write_buffer= info->buffer; - info->alloced_buffer= 1; + info->alloced_buffer= buffer_block; break; /* Enough memory found */ } if (cachesize == min_cache) @@ -321,14 +321,14 @@ int init_slave_io_cache(IO_CACHE *master, IO_CACHE *slave) DBUG_ASSERT(!master->share); DBUG_ASSERT(master->alloced_buffer); - if (!(slave_buf= (uchar*)my_malloc(PSI_INSTRUMENT_ME, master->buffer_length, MYF(0)))) + if (!(slave_buf= (uchar*)my_malloc(PSI_INSTRUMENT_ME, master->alloced_buffer, MYF(0)))) { return 1; } memcpy(slave, master, sizeof(IO_CACHE)); slave->buffer= slave_buf; - memcpy(slave->buffer, master->buffer, master->buffer_length); + memcpy(slave->buffer, master->buffer, master->alloced_buffer); slave->read_pos= slave->buffer + (master->read_pos - master->buffer); slave->read_end= slave->buffer + (master->read_end - master->buffer); diff --git a/plugin/auth_gssapi/CMakeLists.txt b/plugin/auth_gssapi/CMakeLists.txt index 3c43d169d07..87c62812c39 100644 --- a/plugin/auth_gssapi/CMakeLists.txt +++ b/plugin/auth_gssapi/CMakeLists.txt @@ -18,6 +18,11 @@ ELSE() SET(GSSAPI_SERVER gssapi_server.cc) SET(GSSAPI_ERRMSG gssapi_errmsg.cc) + IF(APPLE) + SET_SOURCE_FILES_PROPERTIES( + ${GSSAPI_CLIENT} ${GSSAPI_SERVER} ${GSSAPI_ERRMSG} + PROPERTY COMPILE_FLAGS "-Wno-deprecated-declarations") + ENDIF() SET(CMAKE_REQUIRED_INCLUDES ${GSSAPI_INCS}) SET(CMAKE_REQUIRED_LIBRARIES ${GSSAPI_LIBS}) SET(CMAKE_REQUIRED_FLAGS "-Werror -Wall") diff --git a/plugin/auth_pam/CMakeLists.txt b/plugin/auth_pam/CMakeLists.txt index 93ac29cd425..d89b8591a8f 100644 --- a/plugin/auth_pam/CMakeLists.txt +++ b/plugin/auth_pam/CMakeLists.txt @@ -5,27 +5,35 @@ CHECK_INCLUDE_FILES (security/pam_ext.h HAVE_PAM_EXT_H) CHECK_INCLUDE_FILES (security/pam_appl.h HAVE_PAM_APPL_H) CHECK_FUNCTION_EXISTS (strndup HAVE_STRNDUP) +INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) + +# Check whether getgrouplist uses git_t for second and third arguments. +SET(CMAKE_REQUIRED_FLAGS -Werror) +CHECK_C_SOURCE_COMPILES( +" +#include <grp.h> +#include <unistd.h> +int main() { + char *arg_1; + gid_t arg_2, arg_3; + int arg_4; + (void)getgrouplist(arg_1,arg_2,&arg_3,&arg_4); + return 0; +} +" +HAVE_POSIX_GETGROUPLIST +) +SET(CMAKE_REQUIRED_FLAGS) + SET(CMAKE_REQUIRED_LIBRARIES pam) CHECK_FUNCTION_EXISTS(pam_syslog HAVE_PAM_SYSLOG) SET(CMAKE_REQUIRED_LIBRARIES) -IF(HAVE_PAM_SYSLOG) - ADD_DEFINITIONS(-DHAVE_PAM_SYSLOG) -ENDIF() - -IF(HAVE_PAM_EXT_H) - ADD_DEFINITIONS(-DHAVE_PAM_EXT_H) -ENDIF() - IF(HAVE_PAM_APPL_H) - ADD_DEFINITIONS(-DHAVE_PAM_APPL_H) - IF(HAVE_STRNDUP) - ADD_DEFINITIONS(-DHAVE_STRNDUP) - ENDIF(HAVE_STRNDUP) FIND_LIBRARY(PAM_LIBRARY pam) # for srpm build-depends detection ADD_DEFINITIONS(-D_GNU_SOURCE) MYSQL_ADD_PLUGIN(auth_pam_v1 auth_pam_v1.c LINK_LIBRARIES pam MODULE_ONLY) - MYSQL_ADD_PLUGIN(auth_pam auth_pam.c LINK_LIBRARIES pam ${LIBDL} MODULE_ONLY) + MYSQL_ADD_PLUGIN(auth_pam auth_pam.c LINK_LIBRARIES pam ${CMAKE_DL_LIBS} MODULE_ONLY) IF (TARGET auth_pam) MYSQL_ADD_EXECUTABLE(auth_pam_tool auth_pam_tool.c DESTINATION ${INSTALL_PLUGINDIR}/auth_pam_tool_dir COMPONENT Server) TARGET_LINK_LIBRARIES(auth_pam_tool pam) @@ -47,3 +55,6 @@ IF(HAVE_PAM_APPL_H) ENDIF() ENDIF() ENDIF(HAVE_PAM_APPL_H) + +CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake + ${CMAKE_CURRENT_BINARY_DIR}/config_auth_pam.h) diff --git a/plugin/auth_pam/auth_pam.c b/plugin/auth_pam/auth_pam.c index c1c05bba216..35272c6b7cd 100644 --- a/plugin/auth_pam/auth_pam.c +++ b/plugin/auth_pam/auth_pam.c @@ -1,5 +1,5 @@ /* - Copyright (c) 2011, 2019, MariaDB Corporation. + Copyright (c) 2011, 2020, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -15,6 +15,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */ +#include <config_auth_pam.h> #include <unistd.h> #include <string.h> #include <sys/types.h> diff --git a/plugin/auth_pam/config.h.cmake b/plugin/auth_pam/config.h.cmake new file mode 100644 index 00000000000..2a60e99d52c --- /dev/null +++ b/plugin/auth_pam/config.h.cmake @@ -0,0 +1,5 @@ +#cmakedefine HAVE_POSIX_GETGROUPLIST 1 +#cmakedefine HAVE_PAM_SYSLOG 1 +#cmakedefine HAVE_PAM_EXT_H 1 +#cmakedefine HAVE_PAM_APPL_H 1 +#cmakedefine HAVE_STRNDUP 1 diff --git a/plugin/auth_pam/mapper/pam_user_map.c b/plugin/auth_pam/mapper/pam_user_map.c index 9d7ed53f8b1..fa8d9ae08c1 100644 --- a/plugin/auth_pam/mapper/pam_user_map.c +++ b/plugin/auth_pam/mapper/pam_user_map.c @@ -31,6 +31,7 @@ These comments are written to the syslog as 'authpriv.debug' and usually end up in /var/log/secure file. */ +#include <config_auth_pam.h> #include <stdlib.h> #include <stdio.h> #include <ctype.h> @@ -70,10 +71,16 @@ pam_syslog (const pam_handle_t *pamh, int priority, #define GROUP_BUFFER_SIZE 100 static const char debug_keyword[]= "debug"; -static int populate_user_groups(const char *user, gid_t **groups) +#ifdef HAVE_POSIX_GETGROUPLIST +typedef gid_t my_gid_t; +#else +typedef int my_gid_t; +#endif + +static int populate_user_groups(const char *user, my_gid_t **groups) { - gid_t user_group_id; - gid_t *loc_groups= *groups; + my_gid_t user_group_id; + my_gid_t *loc_groups= *groups; int ng; { @@ -88,22 +95,23 @@ static int populate_user_groups(const char *user, gid_t **groups) { /* The rare case when the user is present in more than */ /* GROUP_BUFFER_SIZE groups. */ - loc_groups= (gid_t *) malloc(ng * sizeof (gid_t)); + loc_groups= (my_gid_t *) malloc(ng * sizeof (my_gid_t)); + if (!loc_groups) return 0; (void) getgrouplist(user, user_group_id, loc_groups, &ng); - *groups= loc_groups; + *groups= (my_gid_t*)loc_groups; } return ng; } -static int user_in_group(const gid_t *user_groups, int ng,const char *group) +static int user_in_group(const my_gid_t *user_groups, int ng,const char *group) { - gid_t group_id; - const gid_t *groups_end = user_groups + ng; + my_gid_t group_id; + const my_gid_t *groups_end = user_groups + ng; { struct group *g= getgrnam(group); @@ -122,7 +130,7 @@ static int user_in_group(const gid_t *user_groups, int ng,const char *group) } -static void print_groups(pam_handle_t *pamh, const gid_t *user_groups, int ng) +static void print_groups(pam_handle_t *pamh, const my_gid_t *user_groups, int ng) { char buf[256]; char *c_buf= buf, *buf_end= buf+sizeof(buf)-2; @@ -158,8 +166,8 @@ int pam_sm_authenticate(pam_handle_t *pamh, int flags, const char *username; char buf[256]; FILE *f; - gid_t group_buffer[GROUP_BUFFER_SIZE]; - gid_t *groups= group_buffer; + my_gid_t group_buffer[GROUP_BUFFER_SIZE]; + my_gid_t *groups= group_buffer; int n_groups= -1; for (; argc > 0; argc--) diff --git a/plugin/aws_key_management/aws_key_management_plugin.cc b/plugin/aws_key_management/aws_key_management_plugin.cc index 348c171b618..7740c2eae60 100644 --- a/plugin/aws_key_management/aws_key_management_plugin.cc +++ b/plugin/aws_key_management/aws_key_management_plugin.cc @@ -162,6 +162,10 @@ public: { } + virtual void Flush(void) override + { + } + protected: virtual void ProcessFormattedStatement(Aws::String&& statement) override { diff --git a/plugin/server_audit/server_audit.c b/plugin/server_audit/server_audit.c index 33e4d067766..bd630a16eb7 100644 --- a/plugin/server_audit/server_audit.c +++ b/plugin/server_audit/server_audit.c @@ -16,7 +16,7 @@ #define PLUGIN_VERSION 0x104 -#define PLUGIN_STR_VERSION "1.4.8" +#define PLUGIN_STR_VERSION "1.4.10" #define _my_thread_var loc_thread_var @@ -327,6 +327,10 @@ struct connection_info char query_buffer[1024]; time_t query_time; int log_always; + char proxy[64]; + int proxy_length; + char proxy_host[64]; + int proxy_host_length; }; #define DEFAULT_FILENAME_LEN 16 @@ -1131,9 +1135,13 @@ static void setup_connection_simple(struct connection_info *ci) ci->ip_length= 0; ci->query_length= 0; ci->header= 0; + ci->proxy_length= 0; } +#define MAX_HOSTNAME 61 +#define USERNAME_LENGTH 384 + static void setup_connection_connect(struct connection_info *cn, const struct mysql_event_connection *event) { @@ -1150,6 +1158,29 @@ static void setup_connection_connect(struct connection_info *cn, get_str_n(cn->ip, &cn->ip_length, sizeof(cn->ip), event->ip, event->ip_length); cn->header= 0; + if (event->proxy_user && event->proxy_user[0]) + { + const char *priv_host= event->proxy_user + + sizeof(char[MAX_HOSTNAME+USERNAME_LENGTH+5]); + size_t priv_host_length; + + if (mysql_57_started) + { + priv_host+= sizeof(size_t); + priv_host_length= *(size_t *) (priv_host + MAX_HOSTNAME); + } + else + priv_host_length= strlen(priv_host); + + + get_str_n(cn->proxy, &cn->proxy_length, sizeof(cn->proxy), + event->priv_user, event->priv_user_length); + get_str_n(cn->proxy_host, &cn->proxy_host_length, + sizeof(cn->proxy_host), + priv_host, priv_host_length); + } + else + cn->proxy_length= 0; } @@ -1349,6 +1380,31 @@ static size_t log_header(char *message, size_t message_len, } +static int log_proxy(const struct connection_info *cn, + const struct mysql_event_connection *event) + +{ + time_t ctime; + size_t csize; + char message[1024]; + + (void) time(&ctime); + csize= log_header(message, sizeof(message)-1, &ctime, + servhost, servhost_len, + cn->user, cn->user_length, + cn->host, cn->host_length, + cn->ip, cn->ip_length, + event->thread_id, 0, "PROXY_CONNECT"); + csize+= my_snprintf(message+csize, sizeof(message) - 1 - csize, + ",%.*s,`%.*s`@`%.*s`,%d", cn->db_length, cn->db, + cn->proxy_length, cn->proxy, + cn->proxy_host_length, cn->proxy_host, + event->status); + message[csize]= '\n'; + return write_log(message, csize + 1, 1); +} + + static int log_connection(const struct connection_info *cn, const struct mysql_event_connection *event, const char *type) @@ -2010,9 +2066,13 @@ static void update_connection_info(struct connection_info *cn, { case MYSQL_AUDIT_CONNECTION_CONNECT: setup_connection_connect(cn, event); + if (event->status == 0 && event->proxy_user && event->proxy_user[0]) + log_proxy(cn, event); break; case MYSQL_AUDIT_CONNECTION_CHANGE_USER: *after_action= AA_CHANGE_USER; + if (event->proxy_user && event->proxy_user[0]) + log_proxy(cn, event); break; default:; } diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt index 7f6945c728a..e4760e1daae 100644 --- a/sql/CMakeLists.txt +++ b/sql/CMakeLists.txt @@ -194,7 +194,7 @@ DTRACE_INSTRUMENT(sql) TARGET_LINK_LIBRARIES(sql mysys mysys_ssl dbug strings vio pcre2-8 tpool - ${LIBWRAP} ${LIBCRYPT} ${LIBDL} ${CMAKE_THREAD_LIBS_INIT} + ${LIBWRAP} ${LIBCRYPT} ${CMAKE_DL_LIBS} ${CMAKE_THREAD_LIBS_INIT} ${SSL_LIBRARIES} ${LIBSYSTEMD}) diff --git a/sql/item.h b/sql/item.h index 19b7b5d03e9..fb480b4c578 100644 --- a/sql/item.h +++ b/sql/item.h @@ -120,20 +120,19 @@ enum precedence { XOR_PRECEDENCE, // XOR AND_PRECEDENCE, // AND, && NOT_PRECEDENCE, // NOT (unless HIGH_NOT_PRECEDENCE) - BETWEEN_PRECEDENCE, // BETWEEN, CASE, WHEN, THEN, ELSE - CMP_PRECEDENCE, // =, <=>, >=, >, <=, <, <>, !=, IS, LIKE, REGEXP, IN + CMP_PRECEDENCE, // =, <=>, >=, >, <=, <, <>, !=, IS + BETWEEN_PRECEDENCE, // BETWEEN + IN_PRECEDENCE, // IN, LIKE, REGEXP BITOR_PRECEDENCE, // | BITAND_PRECEDENCE, // & SHIFT_PRECEDENCE, // <<, >> - ADDINTERVAL_PRECEDENCE, // first argument in +INTERVAL + INTERVAL_PRECEDENCE, // first argument in +INTERVAL ADD_PRECEDENCE, // +, - MUL_PRECEDENCE, // *, /, DIV, %, MOD BITXOR_PRECEDENCE, // ^ PIPES_PRECEDENCE, // || (if PIPES_AS_CONCAT) - NEG_PRECEDENCE, // unary -, ~ - BANG_PRECEDENCE, // !, NOT (if HIGH_NOT_PRECEDENCE) + NEG_PRECEDENCE, // unary -, ~, !, NOT (if HIGH_NOT_PRECEDENCE) COLLATE_PRECEDENCE, // BINARY, COLLATE - INTERVAL_PRECEDENCE, // INTERVAL DEFAULT_PRECEDENCE, HIGHEST_PRECEDENCE }; @@ -1716,6 +1715,8 @@ public: mysql_register_view(). */ virtual enum precedence precedence() const { return DEFAULT_PRECEDENCE; } + enum precedence higher_precedence() const + { return (enum precedence)(precedence() + 1); } void print_parenthesised(String *str, enum_query_type query_type, enum precedence parent_prec); /** @@ -5439,7 +5440,11 @@ public: { (*ref)->restore_to_before_no_rows_in_result(); } - virtual void print(String *str, enum_query_type query_type); + void print(String *str, enum_query_type query_type); + enum precedence precedence() const + { + return ref ? (*ref)->precedence() : DEFAULT_PRECEDENCE; + } void cleanup(); Item_field *field_for_view_update() { return (*ref)->field_for_view_update(); } diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index c753b963fd4..2b662c4de7d 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -2331,7 +2331,7 @@ longlong Item_func_between::val_int_cmp_real() void Item_func_between::print(String *str, enum_query_type query_type) { - args[0]->print_parenthesised(str, query_type, precedence()); + args[0]->print_parenthesised(str, query_type, higher_precedence()); if (negated) str->append(STRING_WITH_LEN(" not")); str->append(STRING_WITH_LEN(" between ")); @@ -3348,27 +3348,28 @@ Item* Item_func_case_simple::propagate_equal_fields(THD *thd, } -void Item_func_case::print_when_then_arguments(String *str, - enum_query_type query_type, - Item **items, uint count) +inline void Item_func_case::print_when_then_arguments(String *str, + enum_query_type + query_type, + Item **items, uint count) { - for (uint i=0 ; i < count ; i++) + for (uint i= 0; i < count; i++) { str->append(STRING_WITH_LEN("when ")); - items[i]->print_parenthesised(str, query_type, precedence()); + items[i]->print(str, query_type); str->append(STRING_WITH_LEN(" then ")); - items[i + count]->print_parenthesised(str, query_type, precedence()); + items[i + count]->print(str, query_type); str->append(' '); } } -void Item_func_case::print_else_argument(String *str, - enum_query_type query_type, - Item *item) +inline void Item_func_case::print_else_argument(String *str, + enum_query_type query_type, + Item *item) { str->append(STRING_WITH_LEN("else ")); - item->print_parenthesised(str, query_type, precedence()); + item->print(str, query_type); str->append(' '); } @@ -5600,12 +5601,14 @@ void Item_func_like::print(String *str, enum_query_type query_type) str->append(STRING_WITH_LEN(" not ")); str->append(func_name()); str->append(' '); - args[1]->print_parenthesised(str, query_type, precedence()); if (escape_used_in_parsing) { + args[1]->print_parenthesised(str, query_type, precedence()); str->append(STRING_WITH_LEN(" escape ")); - escape_item->print(str, query_type); + escape_item->print_parenthesised(str, query_type, higher_precedence()); } + else + args[1]->print_parenthesised(str, query_type, higher_precedence()); } diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h index fe6cba607a7..fa715badfc7 100644 --- a/sql/item_cmpfunc.h +++ b/sql/item_cmpfunc.h @@ -1,7 +1,7 @@ #ifndef ITEM_CMPFUNC_INCLUDED #define ITEM_CMPFUNC_INCLUDED /* Copyright (c) 2000, 2015, Oracle and/or its affiliates. - Copyright (c) 2009, 2016, MariaDB + Copyright (c) 2009, 2020, MariaDB 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 @@ -608,7 +608,7 @@ public: enum Functype functype() const override { return NOT_FUNC; } const char *func_name() const override { return "not"; } bool find_not_null_fields(table_map allowed) override { return false; } - enum precedence precedence() const override { return BANG_PRECEDENCE; } + enum precedence precedence() const override { return NEG_PRECEDENCE; } Item *neg_transformer(THD *thd) override; bool fix_fields(THD *, Item **) override; void print(String *str, enum_query_type query_type) override; @@ -2184,9 +2184,11 @@ protected: bool aggregate_then_and_else_arguments(THD *thd, uint count); virtual Item **else_expr_addr() const= 0; virtual Item *find_item()= 0; - void print_when_then_arguments(String *str, enum_query_type query_type, - Item **items, uint count); - void print_else_argument(String *str, enum_query_type query_type, Item *item); + inline void print_when_then_arguments(String *str, + enum_query_type query_type, + Item **items, uint count); + inline void print_else_argument(String *str, enum_query_type query_type, + Item *item); void reorder_args(uint start); public: Item_func_case(THD *thd, List<Item> &list) @@ -2202,7 +2204,6 @@ public: bool fix_fields(THD *thd, Item **ref); table_map not_null_tables() const { return 0; } const char *func_name() const { return "case"; } - enum precedence precedence() const { return BETWEEN_PRECEDENCE; } CHARSET_INFO *compare_collation() const { return cmp_collation.collation; } bool need_parentheses_in_default() { return true; } }; @@ -2467,7 +2468,7 @@ public: virtual void print(String *str, enum_query_type query_type); enum Functype functype() const { return IN_FUNC; } const char *func_name() const { return "in"; } - enum precedence precedence() const { return CMP_PRECEDENCE; } + enum precedence precedence() const { return IN_PRECEDENCE; } bool eval_not_null_tables(void *opt_arg); bool find_not_null_fields(table_map allowed); void fix_after_pullout(st_select_lex *new_parent, Item **ref, bool merge); @@ -2793,7 +2794,7 @@ public: return this; } const char *func_name() const { return "like"; } - enum precedence precedence() const { return CMP_PRECEDENCE; } + enum precedence precedence() const { return IN_PRECEDENCE; } bool fix_fields(THD *thd, Item **ref); bool fix_length_and_dec() { @@ -2902,7 +2903,7 @@ public: longlong val_int(); bool fix_length_and_dec(); const char *func_name() const { return "regexp"; } - enum precedence precedence() const { return CMP_PRECEDENCE; } + enum precedence precedence() const { return IN_PRECEDENCE; } Item *get_copy(THD *) { return 0; } void print(String *str, enum_query_type query_type) { diff --git a/sql/item_func.cc b/sql/item_func.cc index 8a75d2c9946..c0714bc263f 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -640,8 +640,7 @@ void Item_func::print_op(String *str, enum_query_type query_type) str->append(func_name()); str->append(' '); } - args[arg_count-1]->print_parenthesised(str, query_type, - (enum precedence)(precedence() + 1)); + args[arg_count-1]->print_parenthesised(str, query_type, higher_precedence()); } diff --git a/sql/item_jsonfunc.cc b/sql/item_jsonfunc.cc index 0299adf42bc..032ecb1bb91 100644 --- a/sql/item_jsonfunc.cc +++ b/sql/item_jsonfunc.cc @@ -2464,6 +2464,8 @@ String *Item_func_json_merge_patch::val_str(String *str) uint n_arg; bool empty_result, merge_to_null; + /* To report errors properly if some JSON is invalid. */ + je1.s.error= je2.s.error= 0; merge_to_null= args[0]->null_value; for (n_arg=1; n_arg < arg_count; n_arg++) diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index 334fec2e048..cbde9599073 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -3357,7 +3357,7 @@ void Item_in_subselect::print(String *str, enum_query_type query_type) str->append(STRING_WITH_LEN("<exists>")); else { - left_expr->print(str, query_type); + left_expr->print_parenthesised(str, query_type, precedence()); str->append(STRING_WITH_LEN(" in ")); } Item_subselect::print(str, query_type); diff --git a/sql/item_subselect.h b/sql/item_subselect.h index 7e504d09565..ec4398b9a76 100644 --- a/sql/item_subselect.h +++ b/sql/item_subselect.h @@ -640,7 +640,7 @@ public: bool val_bool() override; bool test_limit(st_select_lex_unit *unit); void print(String *str, enum_query_type query_type) override; - enum precedence precedence() const override { return CMP_PRECEDENCE; } + enum precedence precedence() const override { return IN_PRECEDENCE; } bool fix_fields(THD *thd, Item **ref) override; bool fix_length_and_dec() override; void fix_after_pullout(st_select_lex *new_parent, Item **ref, diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index 6b5c6fa323c..b8650a5c7e9 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -2095,9 +2095,9 @@ static const char *interval_names[]= void Item_date_add_interval::print(String *str, enum_query_type query_type) { - args[0]->print_parenthesised(str, query_type, ADDINTERVAL_PRECEDENCE); + args[0]->print_parenthesised(str, query_type, INTERVAL_PRECEDENCE); str->append(date_sub_interval?" - interval ":" + interval "); - args[1]->print_parenthesised(str, query_type, INTERVAL_PRECEDENCE); + args[1]->print(str, query_type); str->append(' '); str->append(interval_names[int_type]); } diff --git a/sql/item_timefunc.h b/sql/item_timefunc.h index 35c9df533c4..a910b2cb723 100644 --- a/sql/item_timefunc.h +++ b/sql/item_timefunc.h @@ -948,7 +948,7 @@ public: bool fix_length_and_dec(); bool eq(const Item *item, bool binary_cmp) const; void print(String *str, enum_query_type query_type); - enum precedence precedence() const { return ADDINTERVAL_PRECEDENCE; } + enum precedence precedence() const { return INTERVAL_PRECEDENCE; } bool need_parentheses_in_default() { return true; } Item *get_copy(THD *thd) { return get_item_copy<Item_date_add_interval>(thd, this); } diff --git a/sql/mf_iocache_encr.cc b/sql/mf_iocache_encr.cc index b27f10c7d72..072c0a48269 100644 --- a/sql/mf_iocache_encr.cc +++ b/sql/mf_iocache_encr.cc @@ -71,6 +71,16 @@ static int my_b_encr_read(IO_CACHE *info, uchar *Buffer, size_t Count) DBUG_RETURN(1); } info->seek_not_done= 0; + if (info->next_file_user) + { + IO_CACHE *c; + for (c= info->next_file_user; + c!= info; + c= c->next_file_user) + { + c->seek_not_done= 1; + } + } } do diff --git a/sql/session_tracker.cc b/sql/session_tracker.cc index 1e5e356a5ba..de82d8be90c 100644 --- a/sql/session_tracker.cc +++ b/sql/session_tracker.cc @@ -445,8 +445,11 @@ bool Session_sysvars_tracker::vars_list::store(THD *thd, String *buf) show.name= svar->name.str; show.value= (char *) svar; + mysql_mutex_lock(&LOCK_global_system_variables); const char *value= get_one_variable(thd, &show, OPT_SESSION, SHOW_SYS, NULL, &charset, val_buf, &val_length); + mysql_mutex_unlock(&LOCK_global_system_variables); + if (is_plugin) mysql_mutex_unlock(&LOCK_plugin); diff --git a/sql/set_var.cc b/sql/set_var.cc index 38c8d1f1775..fe98d98fbd4 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -1084,7 +1084,6 @@ static void store_var(Field *field, sys_var *var, enum_var_type scope, int fill_sysvars(THD *thd, TABLE_LIST *tables, COND *cond) { char name_buffer[NAME_CHAR_LEN]; - enum_check_fields save_count_cuted_fields= thd->count_cuted_fields; bool res= 1; CHARSET_INFO *scs= system_charset_info; StringBuffer<STRING_BUFFER_USUAL_SIZE> strbuf(scs); @@ -1095,7 +1094,6 @@ int fill_sysvars(THD *thd, TABLE_LIST *tables, COND *cond) DBUG_ASSERT(tables->table->in_use == thd); cond= make_cond_for_info_schema(thd, cond, tables); - thd->count_cuted_fields= CHECK_FIELD_WARN; mysql_prlock_rdlock(&LOCK_system_variables_hash); for (uint i= 0; i < system_variable_hash.records; i++) @@ -1269,7 +1267,6 @@ int fill_sysvars(THD *thd, TABLE_LIST *tables, COND *cond) res= 0; end: mysql_prlock_unlock(&LOCK_system_variables_hash); - thd->count_cuted_fields= save_count_cuted_fields; return res; } diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 3958cb3fba7..2c96e0e9ff2 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -304,8 +304,9 @@ ulong role_global_merges= 0, role_db_merges= 0, role_table_merges= 0, static void update_hostname(acl_host_and_ip *host, const char *hostname); static bool show_proxy_grants (THD *, const char *, const char *, char *, size_t); -static bool show_role_grants(THD *, const char *, const char *, +static bool show_role_grants(THD *, const char *, ACL_USER_BASE *, char *, size_t); +static bool show_default_role(THD *, ACL_USER *, char *, size_t); static bool show_global_privileges(THD *, ACL_USER_BASE *, bool, char *, size_t); static bool show_database_privileges(THD *, const char *, const char *, @@ -9000,7 +9001,7 @@ static bool print_grants_for_role(THD *thd, ACL_ROLE * role) { char buff[1024]; - if (show_role_grants(thd, role->user.str, "", role, buff, sizeof(buff))) + if (show_role_grants(thd, "", role, buff, sizeof(buff))) return TRUE; if (show_global_privileges(thd, role, TRUE, buff, sizeof(buff))) @@ -9245,7 +9246,7 @@ bool mysql_show_grants(THD *thd, LEX_USER *lex_user) } /* Show granted roles to acl_user */ - if (show_role_grants(thd, username, hostname, acl_user, buff, sizeof(buff))) + if (show_role_grants(thd, hostname, acl_user, buff, sizeof(buff))) goto end; /* Add first global access grants */ @@ -9302,6 +9303,14 @@ bool mysql_show_grants(THD *thd, LEX_USER *lex_user) } } + if (username) + { + /* Show default role to acl_user */ + if (show_default_role(thd, acl_user, buff, sizeof(buff))) + goto end; + } + + error= 0; end: mysql_mutex_unlock(&acl_cache->lock); @@ -9328,15 +9337,44 @@ static ROLE_GRANT_PAIR *find_role_grant_pair(const LEX_CSTRING *u, my_hash_search(&acl_roles_mappings, (uchar*)pair_key.ptr(), key_length); } -static bool show_role_grants(THD *thd, const char *username, - const char *hostname, ACL_USER_BASE *acl_entry, +static bool show_default_role(THD *thd, ACL_USER *acl_entry, + char *buff, size_t buffsize) +{ + Protocol *protocol= thd->protocol; + LEX_CSTRING def_rolename= acl_entry->default_rolename; + + if (def_rolename.length) + { + String def_str(buff, buffsize, system_charset_info); + def_str.length(0); + def_str.append(STRING_WITH_LEN("SET DEFAULT ROLE ")); + def_str.append(&def_rolename); + def_str.append(" FOR '"); + def_str.append(&acl_entry->user); + DBUG_ASSERT(!(acl_entry->flags & IS_ROLE)); + def_str.append(STRING_WITH_LEN("'@'")); + def_str.append(acl_entry->host.hostname, acl_entry->hostname_length, + system_charset_info); + def_str.append('\''); + protocol->prepare_for_resend(); + protocol->store(def_str.ptr(),def_str.length(),def_str.charset()); + if (protocol->write()) + { + return TRUE; + } + } + return FALSE; +} + +static bool show_role_grants(THD *thd, const char *hostname, + ACL_USER_BASE *acl_entry, char *buff, size_t buffsize) { uint counter; Protocol *protocol= thd->protocol; LEX_CSTRING host= {const_cast<char*>(hostname), strlen(hostname)}; - String grant(buff,sizeof(buff),system_charset_info); + String grant(buff, buffsize, system_charset_info); for (counter= 0; counter < acl_entry->role_grants.elements; counter++) { grant.length(0); @@ -9377,7 +9415,7 @@ static bool show_global_privileges(THD *thd, ACL_USER_BASE *acl_entry, privilege_t want_access(NO_ACL); Protocol *protocol= thd->protocol; - String global(buff,sizeof(buff),system_charset_info); + String global(buff, buffsize, system_charset_info); global.length(0); global.append(STRING_WITH_LEN("GRANT ")); @@ -9471,7 +9509,7 @@ static bool show_database_privileges(THD *thd, const char *username, want_access=acl_db->initial_access; if (want_access) { - String db(buff,sizeof(buff),system_charset_info); + String db(buff, buffsize, system_charset_info); db.length(0); db.append(STRING_WITH_LEN("GRANT ")); diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 20f1fb356a3..2769575f2cb 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -1918,7 +1918,12 @@ retry_share: DBUG_RETURN(FALSE); } +#ifdef WITH_WSREP + if (!((flags & MYSQL_OPEN_IGNORE_FLUSH) || + (wsrep_on(thd) && thd->wsrep_applier))) +#else if (!(flags & MYSQL_OPEN_IGNORE_FLUSH)) +#endif { if (share->tdc->flushed) { diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index 592b53ceecf..61e3b89c9a3 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -3997,21 +3997,21 @@ bool LEX::can_not_use_merged() } } -/* - Detect that we need only table structure of derived table/view +/** + Detect that we need only table structure of derived table/view. - SYNOPSIS - only_view_structure() + Also used by I_S tables (@see create_schema_table) to detect that + they need a full table structure and cannot optimize unused columns away - RETURN - TRUE yes, we need only structure - FALSE no, we need data + @retval TRUE yes, we need only structure + @retval FALSE no, we need data */ bool LEX::only_view_structure() { switch (sql_command) { case SQLCOM_SHOW_CREATE: + case SQLCOM_CHECKSUM: case SQLCOM_SHOW_TABLES: case SQLCOM_SHOW_FIELDS: case SQLCOM_REVOKE_ALL: @@ -4019,6 +4019,8 @@ bool LEX::only_view_structure() case SQLCOM_GRANT: case SQLCOM_CREATE_VIEW: return TRUE; + case SQLCOM_CREATE_TABLE: + return create_info.like(); default: return FALSE; } diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 3eb28d960b3..3d43305431b 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -3835,6 +3835,7 @@ mysql_execute_command(THD *thd) lex->sql_command != SQLCOM_BEGIN && lex->sql_command != SQLCOM_CALL && lex->sql_command != SQLCOM_EXECUTE && + lex->sql_command != SQLCOM_EXECUTE_IMMEDIATE && !(sql_command_flags[lex->sql_command] & CF_AUTO_COMMIT_TRANS)) { wsrep_start_trx_if_not_started(thd); @@ -4407,6 +4408,11 @@ mysql_execute_command(THD *thd) /* mysql_update return 2 if we need to switch to multi-update */ if (up_result != 2) break; + if (thd->lex->period_conditions.is_set()) + { + DBUG_ASSERT(0); // Should never happen + goto error; + } } /* fall through */ case SQLCOM_UPDATE_MULTI: @@ -7926,7 +7932,6 @@ void mysql_parse(THD *thd, char *rawbuf, uint length, bool is_com_multi, bool is_next_command) { - int error __attribute__((unused)); DBUG_ENTER("mysql_parse"); DBUG_EXECUTE_IF("parser_debug", turn_parser_debug_on_MYSQLparse();); DBUG_EXECUTE_IF("parser_debug", turn_parser_debug_on_ORAparse();); @@ -8007,6 +8012,7 @@ void mysql_parse(THD *thd, char *rawbuf, uint length, (char *) thd->security_ctx->host_or_ip, 0); + int error __attribute__((unused)); error= mysql_execute_command(thd); MYSQL_QUERY_EXEC_DONE(error); } @@ -9105,8 +9111,6 @@ void add_join_natural(TABLE_LIST *a, TABLE_LIST *b, List<String> *using_fields, SELECT_LEX *lex) { b->natural_join= a; - a->part_of_natural_join= TRUE; - b->part_of_natural_join= TRUE; lex->prev_join_using= using_fields; } diff --git a/sql/sql_select.cc b/sql/sql_select.cc index c54f8902976..2a856a0d51f 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -2785,6 +2785,10 @@ int JOIN::optimize_stage2() (select_options & (SELECT_DESCRIBE | SELECT_NO_JOIN_CACHE)) | (select_lex->ftfunc_list->elements ? SELECT_NO_JOIN_CACHE : 0); + if (select_lex->options & OPTION_SCHEMA_TABLE && + optimize_schema_tables_reads(this)) + DBUG_RETURN(1); + if (make_join_readinfo(this, select_opts_for_readinfo, no_jbuf_after)) DBUG_RETURN(1); @@ -2961,10 +2965,6 @@ int JOIN::optimize_stage2() having_is_correlated= MY_TEST(having->used_tables() & OUTER_REF_TABLE_BIT); tmp_having= having; - if ((select_lex->options & OPTION_SCHEMA_TABLE) && - optimize_schema_tables_reads(this)) - DBUG_RETURN(TRUE); - if (unlikely(thd->is_error())) DBUG_RETURN(TRUE); @@ -18172,8 +18172,7 @@ public: bool add_schema_fields(THD *thd, TABLE *table, TMP_TABLE_PARAM *param, - const ST_SCHEMA_TABLE &schema_table, - const MY_BITMAP &bitmap); + const ST_SCHEMA_TABLE &schema_table); bool finalize(THD *thd, TABLE *table, TMP_TABLE_PARAM *param, bool do_not_open, bool keep_row_order); @@ -18282,8 +18281,7 @@ TABLE *Create_tmp_table::start(THD *thd, No need to change table name to lower case as we are only creating MyISAM, Aria or HEAP tables here */ - fn_format(path, path, mysql_tmpdir, "", - MY_REPLACE_EXT|MY_UNPACK_FILENAME); + fn_format(path, path, mysql_tmpdir, "", MY_REPLACE_EXT|MY_UNPACK_FILENAME); if (m_group) { @@ -19105,8 +19103,7 @@ err: bool Create_tmp_table::add_schema_fields(THD *thd, TABLE *table, TMP_TABLE_PARAM *param, - const ST_SCHEMA_TABLE &schema_table, - const MY_BITMAP &bitmap) + const ST_SCHEMA_TABLE &schema_table) { DBUG_ENTER("Create_tmp_table::add_schema_fields"); DBUG_ASSERT(table); @@ -19125,11 +19122,9 @@ bool Create_tmp_table::add_schema_fields(THD *thd, TABLE *table, for (fieldnr= 0; !defs[fieldnr].end_marker(); fieldnr++) { const ST_FIELD_INFO &def= defs[fieldnr]; - bool visible= bitmap_is_set(&bitmap, fieldnr); Record_addr addr(def.nullable()); const Type_handler *h= def.type_handler(); - Field *field= h->make_schema_field(&table->mem_root, table, - addr, def, visible); + Field *field= h->make_schema_field(&table->mem_root, table, addr, def); if (!field) { thd->mem_root= mem_root_save; @@ -19192,17 +19187,16 @@ TABLE *create_tmp_table(THD *thd, TMP_TABLE_PARAM *param, List<Item> &fields, TABLE *create_tmp_table_for_schema(THD *thd, TMP_TABLE_PARAM *param, const ST_SCHEMA_TABLE &schema_table, - const MY_BITMAP &bitmap, longlong select_options, const LEX_CSTRING &table_alias, - bool keep_row_order) + bool do_not_open, bool keep_row_order) { TABLE *table; Create_tmp_table maker(param, (ORDER *) NULL, false, false, select_options, HA_POS_ERROR); if (!(table= maker.start(thd, param, &table_alias)) || - maker.add_schema_fields(thd, table, param, schema_table, bitmap) || - maker.finalize(thd, table, param, false, keep_row_order)) + maker.add_schema_fields(thd, table, param, schema_table) || + maker.finalize(thd, table, param, do_not_open, keep_row_order)) { maker.cleanup_on_failure(thd, table); return NULL; @@ -19583,14 +19577,10 @@ bool create_internal_tmp_table(TABLE *table, KEY *keyinfo, } } - if (unlikely((error= maria_create(share->path.str, - file_type, - share->keys, &keydef, - (uint) (*recinfo-start_recinfo), - start_recinfo, - share->uniques, &uniquedef, - &create_info, - create_flags)))) + if (unlikely((error= maria_create(share->path.str, file_type, share->keys, + &keydef, (uint) (*recinfo-start_recinfo), + start_recinfo, share->uniques, &uniquedef, + &create_info, create_flags)))) { table->file->print_error(error,MYF(0)); /* purecov: inspected */ table->db_stat=0; diff --git a/sql/sql_select.h b/sql/sql_select.h index 947863bc2d9..bb9ecf88df0 100644 --- a/sql/sql_select.h +++ b/sql/sql_select.h @@ -2436,10 +2436,9 @@ TABLE *create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields, bool keep_row_order= FALSE); TABLE *create_tmp_table_for_schema(THD *thd, TMP_TABLE_PARAM *param, const ST_SCHEMA_TABLE &schema_table, - const MY_BITMAP &bitmap, longlong select_options, const LEX_CSTRING &alias, - bool keep_row_order); + bool do_not_open, bool keep_row_order); void free_tmp_table(THD *thd, TABLE *entry); bool create_internal_tmp_table_from_heap(THD *thd, TABLE *table, diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 794589b234c..8c6bc460474 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -3675,8 +3675,6 @@ static bool show_status_array(THD *thd, const char *wild, CHARSET_INFO *charset= system_charset_info; DBUG_ENTER("show_status_array"); - thd->count_cuted_fields= CHECK_FIELD_WARN; - prefix_end=strnmov(name_buffer, prefix, sizeof(name_buffer)-1); if (*prefix) *prefix_end++= '_'; @@ -3776,6 +3774,8 @@ static bool show_status_array(THD *thd, const char *wild, pos= get_one_variable(thd, var, scope, show_type, status_var, &charset, buff, &length); + if (table->field[1]->field_length) + thd->count_cuted_fields= CHECK_FIELD_WARN; table->field[1]->store(pos, (uint32) length, charset); thd->count_cuted_fields= CHECK_FIELD_IGNORE; table->field[1]->set_notnull(); @@ -8046,51 +8046,6 @@ ST_SCHEMA_TABLE *get_schema_table(enum enum_schema_tables schema_table_idx) return &schema_tables[schema_table_idx]; } -static void -mark_all_fields_used_in_query(THD *thd, - ST_FIELD_INFO *schema_fields, - MY_BITMAP *bitmap, - Item *all_items) -{ - Item *item; - DBUG_ENTER("mark_all_fields_used_in_query"); - - /* If not SELECT command, return all columns */ - if (thd->lex->sql_command != SQLCOM_SELECT && - thd->lex->sql_command != SQLCOM_SET_OPTION) - { - bitmap_set_all(bitmap); - DBUG_VOID_RETURN; - } - - for (item= all_items ; item ; item= item->next) - { - if (item->type() == Item::FIELD_ITEM) - { - ST_FIELD_INFO *fields= schema_fields; - uint count; - Item_field *item_field= (Item_field*) item; - - /* item_field can be '*' as this function is called before fix_fields */ - if (item_field->field_name.str == star_clex_str.str) - { - bitmap_set_all(bitmap); - break; - } - for (count=0; !fields->end_marker(); fields++, count++) - { - if (!my_strcasecmp(system_charset_info, fields->name().str, - item_field->field_name.str)) - { - bitmap_set_bit(bitmap, count); - break; - } - } - } - } - DBUG_VOID_RETURN; -} - /** Create information_schema table using schema_table data. @@ -8103,7 +8058,7 @@ mark_all_fields_used_in_query(THD *thd, 0<decimals<10 and 0<=length<100 . @param - thd thread handler + thd thread handler @param table_list Used to pass I_S table information(fields info, tables parameters etc) and table name. @@ -8114,32 +8069,16 @@ mark_all_fields_used_in_query(THD *thd, TABLE *create_schema_table(THD *thd, TABLE_LIST *table_list) { - uint field_count; - Item *all_items; + uint field_count= 0; TABLE *table; ST_SCHEMA_TABLE *schema_table= table_list->schema_table; - ST_FIELD_INFO *fields_info= schema_table->fields_info; - ST_FIELD_INFO *fields; - MY_BITMAP bitmap; - my_bitmap_map *buf; + ST_FIELD_INFO *fields= schema_table->fields_info; + bool need_all_fieds= table_list->schema_table_reformed || // SHOW command + thd->lex->only_view_structure(); // need table structure DBUG_ENTER("create_schema_table"); - for (field_count= 0, fields= fields_info; !fields->end_marker(); fields++) + for (; !fields->end_marker(); fields++) field_count++; - if (!(buf= (my_bitmap_map*) thd->alloc(bitmap_buffer_size(field_count)))) - DBUG_RETURN(NULL); - my_bitmap_init(&bitmap, buf, field_count, 0); - - if (!thd->stmt_arena->is_conventional() && - thd->mem_root != thd->stmt_arena->mem_root) - all_items= thd->stmt_arena->free_list; - else - all_items= thd->free_list; - - if (table_list->part_of_natural_join) - bitmap_set_all(&bitmap); - else - mark_all_fields_used_in_query(thd, fields_info, &bitmap, all_items); TMP_TABLE_PARAM *tmp_table_param = new (thd->mem_root) TMP_TABLE_PARAM; tmp_table_param->init(); @@ -8148,13 +8087,9 @@ TABLE *create_schema_table(THD *thd, TABLE_LIST *table_list) tmp_table_param->schema_table= 1; SELECT_LEX *select_lex= table_list->select_lex; bool keep_row_order= is_show_command(thd); - if (!(table= create_tmp_table_for_schema(thd, tmp_table_param, - *schema_table, bitmap, - (select_lex->options | - thd->variables.option_bits | - TMP_TABLE_ALL_COLUMNS), - table_list->alias, - keep_row_order))) + if (!(table= create_tmp_table_for_schema(thd, tmp_table_param, *schema_table, + (select_lex->options | thd->variables.option_bits | TMP_TABLE_ALL_COLUMNS), + table_list->alias, !need_all_fieds, keep_row_order))) DBUG_RETURN(0); my_bitmap_map* bitmaps= (my_bitmap_map*) thd->alloc(bitmap_buffer_size(field_count)); @@ -8546,6 +8481,67 @@ end: } +static int optimize_schema_tables_memory_usage(TABLE_LIST *table_list) +{ + TABLE *table= table_list->table; + THD *thd=table->in_use; + if (!table->is_created()) + { + TMP_TABLE_PARAM *p= table_list->schema_table_param; + TMP_ENGINE_COLUMNDEF *from_recinfo, *to_recinfo; + DBUG_ASSERT(table->s->keys == 0); + DBUG_ASSERT(table->s->uniques == 0); + + // XXX HACK HACK HACK: in a stored function, RETURN (SELECT ...) + // enables warnings (in THD::sp_eval_expr) for the whole val_xxx/store pair, + // while the intention is to warn only for store(). Until this is + // fixed let's avoid data truncation warnings in I_S->fill_table() + if (thd->count_cuted_fields == CHECK_FIELD_IGNORE) + { + + uchar *cur= table->field[0]->ptr; + /* first recinfo could be a NULL bitmap, not an actual Field */ + from_recinfo= to_recinfo= p->start_recinfo + (cur != table->record[0]); + for (uint i=0; i < table->s->fields; i++, from_recinfo++) + { + Field *field= table->field[i]; + DBUG_ASSERT(field->vcol_info == 0); + DBUG_ASSERT(from_recinfo->length= field->pack_length_in_rec()); + if (bitmap_is_set(table->read_set, i)) + { + field->move_field(cur); + *to_recinfo++= *from_recinfo; + cur+= from_recinfo->length; + } + else + { + field= new (thd->mem_root) Field_string(cur, 0, field->null_ptr, + field->null_bit, Field::NONE, + &field->field_name, field->dtcollation()); + field->init(table); + field->field_index= i; + DBUG_ASSERT(field->pack_length_in_rec() == 0); + table->field[i]= field; + } + } + if ((table->s->reclength= (ulong)(cur - table->record[0])) == 0) + { + /* all fields were optimized away. Force a non-0-length row */ + table->s->reclength= to_recinfo->length= 1; + to_recinfo++; + } + p->recinfo= to_recinfo; + } // XXX end of HACK HACK HACK + + // TODO switch from Aria to Memory if all blobs were optimized away? + if (instantiate_tmp_table(table, p->keyinfo, p->start_recinfo, &p->recinfo, + table_list->select_lex->options | thd->variables.option_bits)) + return 1; + } + return 0; +} + + /* This is the optimizer part of get_schema_tables_result(). */ @@ -8566,6 +8562,9 @@ bool optimize_schema_tables_reads(JOIN *join) TABLE_LIST *table_list= tab->table->pos_in_table_list; if (table_list->schema_table && thd->fill_information_schema_tables()) { + if (optimize_schema_tables_memory_usage(table_list)) + DBUG_RETURN(1); + /* A value of 0 indicates a dummy implementation */ if (table_list->schema_table->fill_table == 0) continue; @@ -8588,10 +8587,10 @@ bool optimize_schema_tables_reads(JOIN *join) cond= tab->cache_select->cond; } if (optimize_for_get_all_tables(thd, table_list, cond)) - DBUG_RETURN(TRUE); // Handle OOM + DBUG_RETURN(1); // Handle OOM } } - DBUG_RETURN(FALSE); + DBUG_RETURN(0); } @@ -8656,13 +8655,10 @@ bool get_schema_tables_result(JOIN *join, continue; /* - If schema table is already processed and - the statement is not a subselect then - we don't need to fill this table again. - If schema table is already processed and - schema_table_state != executed_place then - table is already processed and - we should skip second data processing. + If schema table is already processed and the statement is not a + subselect then we don't need to fill this table again. If schema table + is already processed and schema_table_state != executed_place then + table is already processed and we should skip second data processing. */ if (table_list->schema_table_state && (!is_subselect || table_list->schema_table_state != executed_place)) @@ -8724,8 +8720,7 @@ bool get_schema_tables_result(JOIN *join, It also means that an audit plugin cannot process the error correctly either. See also thd->clear_error() */ - thd->get_stmt_da()->push_warning(thd, - thd->get_stmt_da()->sql_errno(), + thd->get_stmt_da()->push_warning(thd, thd->get_stmt_da()->sql_errno(), thd->get_stmt_da()->get_sqlstate(), Sql_condition::WARN_LEVEL_ERROR, thd->get_stmt_da()->message()); diff --git a/sql/sql_type.cc b/sql/sql_type.cc index b7ad8c04af5..dad5a6e50a3 100644 --- a/sql/sql_type.cc +++ b/sql/sql_type.cc @@ -2655,8 +2655,7 @@ Field *Type_handler_set::make_conversion_table_field(MEM_ROOT *root, Field *Type_handler_enum::make_schema_field(MEM_ROOT *root, TABLE *table, const Record_addr &addr, - const ST_FIELD_INFO &def, - bool show_field) const + const ST_FIELD_INFO &def) const { LEX_CSTRING name= def.name(); const Typelib *typelib= def.typelib(); @@ -3861,8 +3860,7 @@ Field *Type_handler_set::make_table_field(MEM_ROOT *root, Field *Type_handler_float::make_schema_field(MEM_ROOT *root, TABLE *table, const Record_addr &addr, - const ST_FIELD_INFO &def, - bool show_field) const + const ST_FIELD_INFO &def) const { LEX_CSTRING name= def.name(); return new (root) @@ -3876,8 +3874,7 @@ Field *Type_handler_float::make_schema_field(MEM_ROOT *root, TABLE *table, Field *Type_handler_double::make_schema_field(MEM_ROOT *root, TABLE *table, const Record_addr &addr, - const ST_FIELD_INFO &def, - bool show_field) const + const ST_FIELD_INFO &def) const { LEX_CSTRING name= def.name(); return new (root) @@ -3892,8 +3889,7 @@ Field *Type_handler_double::make_schema_field(MEM_ROOT *root, TABLE *table, Field *Type_handler_decimal_result::make_schema_field(MEM_ROOT *root, TABLE *table, const Record_addr &addr, - const ST_FIELD_INFO &def, - bool show_field) const + const ST_FIELD_INFO &def) const { LEX_CSTRING name= def.name(); uint dec= def.decimal_scale(); @@ -3909,28 +3905,20 @@ Field *Type_handler_decimal_result::make_schema_field(MEM_ROOT *root, Field *Type_handler_blob_common::make_schema_field(MEM_ROOT *root, TABLE *table, const Record_addr &addr, - const ST_FIELD_INFO &def, - bool show_field) const + const ST_FIELD_INFO &def) const { LEX_CSTRING name= def.name(); - if (show_field) - { - return new (root) - Field_blob(addr.ptr(), addr.null_ptr(), addr.null_bit(), - Field::NONE, &name, table->s, - length_bytes(), - &my_charset_bin); - } - else - return new (root) - Field_null(addr.ptr(), 0, Field::NONE, &name, &my_charset_bin); + return new (root) + Field_blob(addr.ptr(), addr.null_ptr(), addr.null_bit(), + Field::NONE, &name, table->s, + length_bytes(), + &my_charset_bin); } Field *Type_handler_varchar::make_schema_field(MEM_ROOT *root, TABLE *table, const Record_addr &addr, - const ST_FIELD_INFO &def, - bool show_field) const + const ST_FIELD_INFO &def) const { DBUG_ASSERT(def.char_length()); LEX_CSTRING name= def.name(); @@ -3944,7 +3932,7 @@ Field *Type_handler_varchar::make_schema_field(MEM_ROOT *root, TABLE *table, field->field_length= octet_length; return field; } - else if (show_field) + else { return new (root) Field_varstring(addr.ptr(), octet_length, @@ -3953,16 +3941,12 @@ Field *Type_handler_varchar::make_schema_field(MEM_ROOT *root, TABLE *table, Field::NONE, &name, table->s, system_charset_info); } - else - return new (root) - Field_null(addr.ptr(), 0, Field::NONE, &name, system_charset_info); } Field *Type_handler_tiny::make_schema_field(MEM_ROOT *root, TABLE *table, const Record_addr &addr, - const ST_FIELD_INFO &def, - bool show_field) const + const ST_FIELD_INFO &def) const { LEX_CSTRING name= def.name(); return new (root) @@ -3974,8 +3958,7 @@ Field *Type_handler_tiny::make_schema_field(MEM_ROOT *root, TABLE *table, Field *Type_handler_short::make_schema_field(MEM_ROOT *root, TABLE *table, const Record_addr &addr, - const ST_FIELD_INFO &def, - bool show_field) const + const ST_FIELD_INFO &def) const { LEX_CSTRING name= def.name(); return new (root) @@ -3987,8 +3970,7 @@ Field *Type_handler_short::make_schema_field(MEM_ROOT *root, TABLE *table, Field *Type_handler_long::make_schema_field(MEM_ROOT *root, TABLE *table, const Record_addr &addr, - const ST_FIELD_INFO &def, - bool show_field) const + const ST_FIELD_INFO &def) const { LEX_CSTRING name= def.name(); return new (root) @@ -4000,8 +3982,7 @@ Field *Type_handler_long::make_schema_field(MEM_ROOT *root, TABLE *table, Field *Type_handler_longlong::make_schema_field(MEM_ROOT *root, TABLE *table, const Record_addr &addr, - const ST_FIELD_INFO &def, - bool show_field) const + const ST_FIELD_INFO &def) const { LEX_CSTRING name= def.name(); return new (root) @@ -4013,8 +3994,7 @@ Field *Type_handler_longlong::make_schema_field(MEM_ROOT *root, TABLE *table, Field *Type_handler_date_common::make_schema_field(MEM_ROOT *root, TABLE *table, const Record_addr &addr, - const ST_FIELD_INFO &def, - bool show_field) const + const ST_FIELD_INFO &def) const { LEX_CSTRING name= def.name(); return new (root) @@ -4025,8 +4005,7 @@ Field *Type_handler_date_common::make_schema_field(MEM_ROOT *root, TABLE *table, Field *Type_handler_time_common::make_schema_field(MEM_ROOT *root, TABLE *table, const Record_addr &addr, - const ST_FIELD_INFO &def, - bool show_field) const + const ST_FIELD_INFO &def) const { LEX_CSTRING name= def.name(); return new_Field_time(root, @@ -4038,8 +4017,7 @@ Field *Type_handler_time_common::make_schema_field(MEM_ROOT *root, TABLE *table, Field *Type_handler_datetime_common::make_schema_field(MEM_ROOT *root, TABLE *table, const Record_addr &addr, - const ST_FIELD_INFO &def, - bool show_field) const + const ST_FIELD_INFO &def) const { LEX_CSTRING name= def.name(); return new (root) Field_datetimef(addr.ptr(), diff --git a/sql/sql_type.h b/sql/sql_type.h index 41e840d9ed7..6aaac029361 100644 --- a/sql/sql_type.h +++ b/sql/sql_type.h @@ -3934,8 +3934,7 @@ public: virtual Field *make_schema_field(MEM_ROOT *root, TABLE *table, const Record_addr &addr, - const ST_FIELD_INFO &def, - bool show_field) const + const ST_FIELD_INFO &def) const { DBUG_ASSERT(0); return NULL; @@ -4817,8 +4816,7 @@ public: Field *make_schema_field(MEM_ROOT *root, TABLE *table, const Record_addr &addr, - const ST_FIELD_INFO &def, - bool show_field) const override; + const ST_FIELD_INFO &def) const override; Field *make_num_distinct_aggregator_field(MEM_ROOT *, const Item *) const override; void make_sort_key_part(uchar *to, Item *item, @@ -5477,8 +5475,7 @@ public: Field *make_schema_field(MEM_ROOT *root, TABLE *table, const Record_addr &addr, - const ST_FIELD_INFO &def, - bool show_field) const override; + const ST_FIELD_INFO &def) const override; Field *make_table_field_from_def(TABLE_SHARE *share, MEM_ROOT *mem_root, const LEX_CSTRING *name, @@ -5529,8 +5526,7 @@ public: Field *make_schema_field(MEM_ROOT *root, TABLE *table, const Record_addr &addr, - const ST_FIELD_INFO &def, - bool show_field) const override; + const ST_FIELD_INFO &def) const override; Field *make_table_field_from_def(TABLE_SHARE *share, MEM_ROOT *mem_root, const LEX_CSTRING *name, @@ -5581,8 +5577,7 @@ public: Field *make_schema_field(MEM_ROOT *root, TABLE *table, const Record_addr &addr, - const ST_FIELD_INFO &def, - bool show_field) const override; + const ST_FIELD_INFO &def) const override; Field *make_table_field_from_def(TABLE_SHARE *share, MEM_ROOT *mem_root, const LEX_CSTRING *name, @@ -5648,8 +5643,7 @@ public: Field *make_schema_field(MEM_ROOT *root, TABLE *table, const Record_addr &addr, - const ST_FIELD_INFO &def, - bool show_field) const override; + const ST_FIELD_INFO &def) const override; Field *make_table_field_from_def(TABLE_SHARE *share, MEM_ROOT *mem_root, const LEX_CSTRING *name, @@ -5879,8 +5873,7 @@ public: Field *make_schema_field(MEM_ROOT *root, TABLE *table, const Record_addr &addr, - const ST_FIELD_INFO &def, - bool show_field) const override; + const ST_FIELD_INFO &def) const override; Field *make_table_field_from_def(TABLE_SHARE *share, MEM_ROOT *mem_root, const LEX_CSTRING *name, @@ -5935,8 +5928,7 @@ public: Field *make_schema_field(MEM_ROOT *root, TABLE *table, const Record_addr &addr, - const ST_FIELD_INFO &def, - bool show_field) const override; + const ST_FIELD_INFO &def) const override; Field *make_table_field_from_def(TABLE_SHARE *share, MEM_ROOT *mem_root, const LEX_CSTRING *name, @@ -5991,8 +5983,7 @@ public: Field *make_schema_field(MEM_ROOT *root, TABLE *table, const Record_addr &addr, - const ST_FIELD_INFO &def, - bool show_field) const override; + const ST_FIELD_INFO &def) const override; Item_literal *create_literal_item(THD *thd, const char *str, size_t length, CHARSET_INFO *cs, bool send_error) const override; @@ -6202,8 +6193,7 @@ public: Field *make_schema_field(MEM_ROOT *root, TABLE *table, const Record_addr &addr, - const ST_FIELD_INFO &def, - bool show_field) const override; + const ST_FIELD_INFO &def) const override; Item_literal *create_literal_item(THD *thd, const char *str, size_t length, CHARSET_INFO *cs, bool send_error) const override; @@ -6333,8 +6323,7 @@ public: Field *make_schema_field(MEM_ROOT *root, TABLE *table, const Record_addr &addr, - const ST_FIELD_INFO &def, - bool show_field) const override; + const ST_FIELD_INFO &def) const override; Item *create_typecast_item(THD *thd, Item *item, const Type_cast_attributes &attr) const override; bool validate_implicit_default_value(THD *thd, const Column_definition &def) @@ -6909,8 +6898,7 @@ public: Field *make_schema_field(MEM_ROOT *root, TABLE *table, const Record_addr &addr, - const ST_FIELD_INFO &def, - bool show_field) const override; + const ST_FIELD_INFO &def) const override; Field *make_table_field_from_def(TABLE_SHARE *share, MEM_ROOT *mem_root, const LEX_CSTRING *name, @@ -7030,8 +7018,7 @@ public: Field *make_schema_field(MEM_ROOT *root, TABLE *table, const Record_addr &addr, - const ST_FIELD_INFO &def, - bool show_field) const override; + const ST_FIELD_INFO &def) const override; Field *make_table_field_from_def(TABLE_SHARE *share, MEM_ROOT *mem_root, const LEX_CSTRING *name, @@ -7214,8 +7201,7 @@ public: Field *make_schema_field(MEM_ROOT *root, TABLE *table, const Record_addr &addr, - const ST_FIELD_INFO &def, - bool show_field) const override; + const ST_FIELD_INFO &def) const override; }; diff --git a/sql/sql_update.cc b/sql/sql_update.cc index 2d360849928..104061da059 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -419,6 +419,14 @@ int mysql_update(THD *thd, DBUG_PRINT("info", ("Switch to multi-update")); /* pass counter value */ thd->lex->table_count= table_count; + if (thd->lex->period_conditions.is_set()) + { + my_error(ER_NOT_SUPPORTED_YET, MYF(0), + "updating and querying the same temporal periods table"); + + DBUG_RETURN(1); + } + /* convert to multiupdate */ DBUG_RETURN(2); } diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index ed361ed5df4..1ae79bfccda 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -115,6 +115,14 @@ int yylex(void *yylval, void *yythd); #endif +static Item* escape(THD *thd) +{ + thd->lex->escape_used= false; + const char *esc= thd->variables.sql_mode & MODE_NO_BACKSLASH_ESCAPES ? "" : "\\"; + return new (thd->mem_root) Item_string_ascii(thd, esc, MY_TEST(esc[0])); +} + + /** @brief Bison callback to report a syntax/OOM error @@ -329,15 +337,14 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize); */ /* Start SQL_MODE_DEFAULT_SPECIFIC */ -%expect 37 +%expect 53 /* End SQL_MODE_DEFAULT_SPECIFIC */ /* Start SQL_MODE_ORACLE_SPECIFIC -%expect 40 +%expect 56 End SQL_MODE_ORACLE_SPECIFIC */ - /* Comments for TOKENS. For each token, please include in the same line a comment that contains @@ -1142,16 +1149,6 @@ End SQL_MODE_ORACLE_SPECIFIC */ %token <kwd> XML_SYM %token <kwd> YEAR_SYM /* SQL-2003-R */ - -/* - Give ESCAPE (in LIKE) a very low precedence. - This allows the concatenation operator || to be used on the right - side of "LIKE" with sql_mode=PIPES_AS_CONCAT (without ORACLE): - SELECT 'ab' LIKE 'a'||'b'||'c'; -*/ -%left PREC_BELOW_ESCAPE -%left ESCAPE_SYM - /* A dummy token to force the priority of table_ref production in a join. */ %left CONDITIONLESS_JOIN %left JOIN_SYM INNER_SYM STRAIGHT_JOIN CROSS LEFT RIGHT ON_SYM USING @@ -1162,10 +1159,12 @@ End SQL_MODE_ORACLE_SPECIFIC */ %left AND_SYM AND_AND_SYM %left PREC_BELOW_NOT -%left NOT_SYM -%left BETWEEN_SYM CASE_SYM WHEN_SYM THEN_SYM ELSE -%left '=' EQUAL_SYM GE '>' LE '<' NE IS LIKE SOUNDS_SYM REGEXP IN_SYM +%nonassoc NOT_SYM +%left '=' EQUAL_SYM GE '>' LE '<' NE +%nonassoc IS +%right BETWEEN_SYM +%left LIKE SOUNDS_SYM REGEXP IN_SYM %left '|' %left '&' %left SHIFT_LEFT SHIFT_RIGHT @@ -1173,9 +1172,9 @@ End SQL_MODE_ORACLE_SPECIFIC */ %left '*' '/' '%' DIV_SYM MOD_SYM %left '^' %left MYSQL_CONCAT_SYM -%left NEG '~' NOT2_SYM BINARY -%left COLLATE_SYM -%left SUBQUERY_AS_EXPR +%nonassoc NEG '~' NOT2_SYM BINARY +%nonassoc COLLATE_SYM +%nonassoc SUBQUERY_AS_EXPR /* Tokens that can change their meaning from identifier to something else @@ -1448,7 +1447,6 @@ End SQL_MODE_ORACLE_SPECIFIC */ select_sublist_qualified_asterisk expr_or_default set_expr_or_default signed_literal expr_or_literal - opt_escape sp_opt_default simple_ident_nospvar field_or_var limit_option @@ -9301,59 +9299,59 @@ expr: if (unlikely($$ == NULL)) MYSQL_YYABORT; } - | bool_pri IS TRUE_SYM %prec IS + | expr IS TRUE_SYM %prec IS { $$= new (thd->mem_root) Item_func_istrue(thd, $1); if (unlikely($$ == NULL)) MYSQL_YYABORT; } - | bool_pri IS not TRUE_SYM %prec IS + | expr IS not TRUE_SYM %prec IS { $$= new (thd->mem_root) Item_func_isnottrue(thd, $1); if (unlikely($$ == NULL)) MYSQL_YYABORT; } - | bool_pri IS FALSE_SYM %prec IS + | expr IS FALSE_SYM %prec IS { $$= new (thd->mem_root) Item_func_isfalse(thd, $1); if (unlikely($$ == NULL)) MYSQL_YYABORT; } - | bool_pri IS not FALSE_SYM %prec IS + | expr IS not FALSE_SYM %prec IS { $$= new (thd->mem_root) Item_func_isnotfalse(thd, $1); if (unlikely($$ == NULL)) MYSQL_YYABORT; } - | bool_pri IS UNKNOWN_SYM %prec IS + | expr IS UNKNOWN_SYM %prec IS { $$= new (thd->mem_root) Item_func_isnull(thd, $1); if (unlikely($$ == NULL)) MYSQL_YYABORT; } - | bool_pri IS not UNKNOWN_SYM %prec IS + | expr IS not UNKNOWN_SYM %prec IS { $$= new (thd->mem_root) Item_func_isnotnull(thd, $1); if (unlikely($$ == NULL)) MYSQL_YYABORT; } - | bool_pri %prec PREC_BELOW_NOT - ; - -bool_pri: - bool_pri IS NULL_SYM %prec IS + | expr IS NULL_SYM %prec PREC_BELOW_NOT { $$= new (thd->mem_root) Item_func_isnull(thd, $1); if (unlikely($$ == NULL)) MYSQL_YYABORT; } - | bool_pri IS not NULL_SYM %prec IS + | expr IS not NULL_SYM %prec IS { $$= new (thd->mem_root) Item_func_isnotnull(thd, $1); if (unlikely($$ == NULL)) MYSQL_YYABORT; } - | bool_pri EQUAL_SYM predicate %prec EQUAL_SYM + | bool_pri + ; + +bool_pri: + bool_pri EQUAL_SYM predicate %prec EQUAL_SYM { $$= new (thd->mem_root) Item_func_equal(thd, $1, $3); if (unlikely($$ == NULL)) @@ -9375,42 +9373,42 @@ bool_pri: ; predicate: - bit_expr IN_SYM subquery + predicate IN_SYM subquery { $$= new (thd->mem_root) Item_in_subselect(thd, $1, $3); - if (unlikely($$ == NULL)) + if (unlikely(!$$)) MYSQL_YYABORT; } - | bit_expr not IN_SYM subquery + | predicate not IN_SYM subquery { Item *item= new (thd->mem_root) Item_in_subselect(thd, $1, $4); - if (unlikely(item == NULL)) + if (unlikely(!item)) MYSQL_YYABORT; $$= negate_expression(thd, item); - if (unlikely($$ == NULL)) + if (unlikely(!$$)) MYSQL_YYABORT; } - | bit_expr IN_SYM '(' expr ')' + | predicate IN_SYM '(' expr ')' { $$= handle_sql2003_note184_exception(thd, $1, true, $4); if (unlikely($$ == NULL)) MYSQL_YYABORT; } - | bit_expr IN_SYM '(' expr ',' expr_list ')' - { + | predicate IN_SYM '(' expr ',' expr_list ')' + { $6->push_front($4, thd->mem_root); $6->push_front($1, thd->mem_root); $$= new (thd->mem_root) Item_func_in(thd, *$6); if (unlikely($$ == NULL)) MYSQL_YYABORT; } - | bit_expr not IN_SYM '(' expr ')' + | predicate not IN_SYM '(' expr ')' { $$= handle_sql2003_note184_exception(thd, $1, false, $5); if (unlikely($$ == NULL)) MYSQL_YYABORT; } - | bit_expr not IN_SYM '(' expr ',' expr_list ')' + | predicate not IN_SYM '(' expr ',' expr_list ')' { $7->push_front($5, thd->mem_root); $7->push_front($1, thd->mem_root); @@ -9419,13 +9417,13 @@ predicate: MYSQL_YYABORT; $$= item->neg_transformer(thd); } - | bit_expr BETWEEN_SYM bit_expr AND_SYM predicate + | predicate BETWEEN_SYM predicate AND_SYM predicate %prec BETWEEN_SYM { $$= new (thd->mem_root) Item_func_between(thd, $1, $3, $5); if (unlikely($$ == NULL)) MYSQL_YYABORT; } - | bit_expr not BETWEEN_SYM bit_expr AND_SYM predicate + | predicate not BETWEEN_SYM predicate AND_SYM predicate %prec BETWEEN_SYM { Item_func_between *item; item= new (thd->mem_root) Item_func_between(thd, $1, $4, $6); @@ -9433,7 +9431,7 @@ predicate: MYSQL_YYABORT; $$= item->neg_transformer(thd); } - | bit_expr SOUNDS_SYM LIKE bit_expr + | predicate SOUNDS_SYM LIKE predicate { Item *item1= new (thd->mem_root) Item_func_soundex(thd, $1); Item *item4= new (thd->mem_root) Item_func_soundex(thd, $4); @@ -9443,28 +9441,41 @@ predicate: if (unlikely($$ == NULL)) MYSQL_YYABORT; } - | bit_expr LIKE bit_expr opt_escape + | predicate LIKE predicate { - $$= new (thd->mem_root) Item_func_like(thd, $1, $3, $4, - Lex->escape_used); - if (unlikely($$ == NULL)) + $$= new (thd->mem_root) Item_func_like(thd, $1, $3, escape(thd), false); + if (unlikely(!$$)) MYSQL_YYABORT; } - | bit_expr not LIKE bit_expr opt_escape + | predicate LIKE predicate ESCAPE_SYM predicate %prec LIKE { - Item *item= new (thd->mem_root) Item_func_like(thd, $1, $4, $5, - Lex->escape_used); - if (unlikely(item == NULL)) + Lex->escape_used= true; + $$= new (thd->mem_root) Item_func_like(thd, $1, $3, $5, true); + if (unlikely(!$$)) + MYSQL_YYABORT; + } + | predicate not LIKE predicate + { + Item *item= new (thd->mem_root) Item_func_like(thd, $1, $4, escape(thd), false); + if (unlikely(!item)) + MYSQL_YYABORT; + $$= item->neg_transformer(thd); + } + | predicate not LIKE predicate ESCAPE_SYM predicate %prec LIKE + { + Lex->escape_used= true; + Item *item= new (thd->mem_root) Item_func_like(thd, $1, $4, $6, true); + if (unlikely(!item)) MYSQL_YYABORT; $$= item->neg_transformer(thd); } - | bit_expr REGEXP bit_expr + | predicate REGEXP predicate { $$= new (thd->mem_root) Item_func_regex(thd, $1, $3); if (unlikely($$ == NULL)) MYSQL_YYABORT; } - | bit_expr not REGEXP bit_expr + | predicate not REGEXP predicate { Item *item= new (thd->mem_root) Item_func_regex(thd, $1, $4); if (unlikely(item == NULL)) @@ -11907,23 +11918,6 @@ opt_having_clause: } ; -opt_escape: - ESCAPE_SYM simple_expr - { - Lex->escape_used= TRUE; - $$= $2; - } - | /* empty */ %prec PREC_BELOW_ESCAPE - { - Lex->escape_used= FALSE; - $$= ((thd->variables.sql_mode & MODE_NO_BACKSLASH_ESCAPES) ? - new (thd->mem_root) Item_string_ascii(thd, "", 0) : - new (thd->mem_root) Item_string_ascii(thd, "\\", 1)); - if (unlikely($$ == NULL)) - MYSQL_YYABORT; - } - ; - /* group by statement in select */ diff --git a/sql/table.h b/sql/table.h index 7edf1e68a0b..ec865f2e3ce 100644 --- a/sql/table.h +++ b/sql/table.h @@ -2244,7 +2244,6 @@ struct TABLE_LIST parsing 'this' is a NATURAL/USING join iff (natural_join != NULL). */ TABLE_LIST *natural_join; - bool part_of_natural_join; /* True if 'this' represents a nested join that is a NATURAL JOIN. For one of the operands of 'this', the member 'natural_join' points diff --git a/storage/connect/global.h b/storage/connect/global.h index fd26c87b800..d17620861fa 100644 --- a/storage/connect/global.h +++ b/storage/connect/global.h @@ -1,7 +1,7 @@ /***********************************************************************/ /* GLOBAL.H: Declaration file used by all CONNECT implementations. */ /* (C) Copyright MariaDB Corporation Ab */ -/* Author Olivier Bertrand 1993-2018 */ +/* Author Olivier Bertrand 1993-2020 */ /***********************************************************************/ /***********************************************************************/ @@ -89,14 +89,10 @@ extern "C" { #define PAT_LOG "log" #if defined(UNIX) || defined(LINUX) || defined(UNIV_LINUX) - /*********************************************************************/ - /* printf does not accept null pointer for %s target. */ - /*********************************************************************/ + // printf does not accept null pointer for %s target #define SVP(S) ((S) ? S : "<null>") #else - /*********************************************************************/ - /* printf accepts null pointer for %s target. */ - /*********************************************************************/ + // printf accepts null pointer for %s target #define SVP(S) S #endif @@ -112,9 +108,6 @@ extern "C" { /***********************************************************************/ #include "os.h" -typedef uint OFFSET; -typedef char NAME[9]; - typedef struct { ushort Length; char String[2]; @@ -127,6 +120,7 @@ typedef struct _global *PGLOBAL; typedef struct _globplg *PGS; typedef struct _activity *PACTIVITY; typedef struct _parm *PPARM; +typedef char NAME[9]; /***********************************************************************/ /* Segment Sub-Allocation block structure declares. */ @@ -135,8 +129,8 @@ typedef struct _parm *PPARM; /* restore them if needed. This scheme implies that no SubFree be used */ /***********************************************************************/ typedef struct { /* Plug Area SubAlloc header */ - OFFSET To_Free; /* Offset of next free block */ - uint FreeBlk; /* Size of remaining free memory */ + size_t To_Free; /* Offset of next free block */ + size_t FreeBlk; /* Size of remaining free memory */ } POOLHEADER, *PPOOLHEADER; /***********************************************************************/ @@ -188,11 +182,12 @@ typedef struct _parm { /***********************************************************************/ typedef struct _global { /* Global structure */ void *Sarea; /* Points to work area */ - uint Sarea_Size; /* Work area size */ + size_t Sarea_Size; /* Work area size */ PACTIVITY Activityp; - char Message[MAX_STR]; + char Message[MAX_STR]; /* Message (result, error, trace) */ ulong More; /* Used by jsonudf */ - int Createas; /* To pass multi to ext tables */ + size_t Saved_Size; /* Saved work area to_free */ + bool Createas; /* To pass multi to ext tables */ void *Xchk; /* indexes in create/alter */ short Alchecked; /* Checked for ALTER */ short Mrr; /* True when doing mrr */ @@ -210,19 +205,18 @@ DllExport char *PlugReadMessage(PGLOBAL, int, char *); DllExport char *PlugGetMessage(PGLOBAL, int); #endif // XMSG || NEWMSG #if defined(__WIN__) -DllExport short GetLineLength(PGLOBAL); // Console line length +DllExport short GetLineLength(PGLOBAL); // Console line length #endif // __WIN__ -DllExport PGLOBAL PlugInit(LPCSTR, uint); // Plug global initialization -DllExport int PlugExit(PGLOBAL); // Plug global termination +DllExport PGLOBAL PlugInit(LPCSTR, size_t); // Plug global initialization +DllExport int PlugExit(PGLOBAL); // Plug global termination DllExport LPSTR PlugRemoveType(LPSTR, LPCSTR); DllExport LPCSTR PlugSetPath(LPSTR to, LPCSTR prefix, LPCSTR name, LPCSTR dir); DllExport BOOL PlugIsAbsolutePath(LPCSTR path); -DllExport bool AllocSarea(PGLOBAL, uint); +DllExport bool AllocSarea(PGLOBAL, size_t); DllExport void FreeSarea(PGLOBAL); -DllExport BOOL PlugSubSet(void *, uint); +DllExport BOOL PlugSubSet(void *, size_t); DllExport void *PlugSubAlloc(PGLOBAL, void *, size_t); DllExport char *PlugDup(PGLOBAL g, const char *str); -DllExport void *MakePtr(void *, OFFSET); DllExport void htrc(char const *fmt, ...); DllExport void xtrc(uint, char const* fmt, ...); DllExport uint GetTraceValue(void); @@ -232,8 +226,24 @@ DllExport uint GetTraceValue(void); #endif /***********************************************************************/ -/* Non exported routine declarations. */ +/* Inline routine definitions. */ +/***********************************************************************/ +/***********************************************************************/ +/* This routine makes a pointer from an offset to a memory pointer. */ +/***********************************************************************/ +inline void* MakePtr(void* memp, size_t offset) { + // return ((offset == 0) ? NULL : &((char*)memp)[offset]); + return (!offset) ? NULL : (char *)memp + offset; +} /* end of MakePtr */ + +/***********************************************************************/ +/* This routine makes an offset from a pointer new format. */ /***********************************************************************/ -//void *PlugSubAlloc(PGLOBAL, void *, size_t); // Does throw +inline size_t MakeOff(void* memp, void* ptr) { +#if defined(_DEBUG) + assert(ptr > memp); +#endif // _DEBUG + return ((!ptr) ? 0 : (size_t)((char*)ptr - (size_t)memp)); +} /* end of MakeOff */ /*-------------------------- End of Global.H --------------------------*/ diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc index a5d000d566d..56efa73cf3d 100644 --- a/storage/connect/ha_connect.cc +++ b/storage/connect/ha_connect.cc @@ -170,9 +170,9 @@ #define JSONMAX 10 // JSON Default max grp size extern "C" { - char version[]= "Version 1.07.0001 November 12, 2019"; + char version[]= "Version 1.07.0002 October 18, 2020"; #if defined(__WIN__) - char compver[]= "Version 1.07.0001 " __DATE__ " " __TIME__; + char compver[]= "Version 1.07.0002 " __DATE__ " " __TIME__; static char slash= '\\'; #else // !__WIN__ static char slash= '/'; @@ -251,11 +251,13 @@ bool ExactInfo(void); USETEMP UseTemp(void); int GetConvSize(void); TYPCONV GetTypeConv(void); +bool JsonAllPath(void); char *GetJsonNull(void); +int GetDefaultDepth(void); uint GetJsonGrpSize(void); char *GetJavaWrapper(void); -uint GetWorkSize(void); -void SetWorkSize(uint); +size_t GetWorkSize(void); +void SetWorkSize(size_t); extern "C" const char *msglang(void); static void PopUser(PCONNECT xp); @@ -345,11 +347,19 @@ static MYSQL_THDVAR_ENUM( 1, // def (AUTO) &usetemp_typelib); // typelib +#ifdef _WIN64 // Size used for g->Sarea_Size -static MYSQL_THDVAR_UINT(work_size, - PLUGIN_VAR_RQCMDARG, - "Size of the CONNECT work area.", - NULL, NULL, SZWORK, SZWMIN, UINT_MAX, 1); +static MYSQL_THDVAR_ULONGLONG(work_size, + PLUGIN_VAR_RQCMDARG, + "Size of the CONNECT work area.", + NULL, NULL, SZWORK, SZWMIN, ULONGLONG_MAX, 1); +#else +// Size used for g->Sarea_Size +static MYSQL_THDVAR_ULONG(work_size, + PLUGIN_VAR_RQCMDARG, + "Size of the CONNECT work area.", + NULL, NULL, SZWORK, SZWMIN, ULONG_MAX, 1); +#endif // Size used when converting TEXT columns to VARCHAR static MYSQL_THDVAR_INT(conv_size, @@ -384,6 +394,11 @@ static MYSQL_THDVAR_ENUM( 1, // def (yes) &xconv_typelib); // typelib +// Adding JPATH to all Json table columns +static MYSQL_THDVAR_BOOL(json_all_path, PLUGIN_VAR_RQCMDARG, + "Adding JPATH to all Json table columns", + NULL, NULL, 0); // NO by default + // Null representation for JSON values static MYSQL_THDVAR_STR(json_null, PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_MEMALLOC, @@ -391,6 +406,12 @@ static MYSQL_THDVAR_STR(json_null, // check_json_null, update_json_null, NULL, NULL, "<null>"); +// Default Json, XML or Mongo depth +static MYSQL_THDVAR_INT(default_depth, + PLUGIN_VAR_RQCMDARG, + "Default depth used by Json, XML and Mongo discovery", + NULL, NULL, 0, -1, 16, 1); + // Estimate max number of rows for JSON aggregate functions static MYSQL_THDVAR_UINT(json_grp_size, PLUGIN_VAR_RQCMDARG, // opt @@ -452,15 +473,17 @@ uint GetTraceValue(void) {return (uint)(connect_hton ? THDVAR(current_thd, xtrace) : 0);} bool ExactInfo(void) {return THDVAR(current_thd, exact_info);} static bool CondPushEnabled(void) {return THDVAR(current_thd, cond_push);} +bool JsonAllPath(void) {return THDVAR(current_thd, json_all_path);} USETEMP UseTemp(void) {return (USETEMP)THDVAR(current_thd, use_tempfile);} int GetConvSize(void) {return THDVAR(current_thd, conv_size);} TYPCONV GetTypeConv(void) {return (TYPCONV)THDVAR(current_thd, type_conv);} char *GetJsonNull(void) {return connect_hton ? THDVAR(current_thd, json_null) : NULL;} +int GetDefaultDepth(void) {return THDVAR(current_thd, default_depth);} uint GetJsonGrpSize(void) {return connect_hton ? THDVAR(current_thd, json_grp_size) : 10;} -uint GetWorkSize(void) {return THDVAR(current_thd, work_size);} -void SetWorkSize(uint) +size_t GetWorkSize(void) {return (size_t)THDVAR(current_thd, work_size);} +void SetWorkSize(size_t) { // Changing the session variable value seems to be impossible here // and should be done in a check function @@ -470,7 +493,8 @@ void SetWorkSize(uint) #if defined(JAVA_SUPPORT) char *GetJavaWrapper(void) -{return connect_hton ? THDVAR(current_thd, java_wrapper) : (char*)"wrappers/JdbcInterface";} +{return connect_hton ? THDVAR(current_thd, java_wrapper) + : (char*)"wrappers/JdbcInterface";} #endif // JAVA_SUPPORT #if defined(JAVA_SUPPORT) || defined(CMGO_SUPPORT) @@ -619,8 +643,10 @@ ha_create_table_option connect_field_option_list[]= HA_FOPTION_NUMBER("FIELD_LENGTH", fldlen, 0, 0, INT_MAX32, 1), HA_FOPTION_STRING("DATE_FORMAT", dateformat), HA_FOPTION_STRING("FIELD_FORMAT", fieldformat), - HA_FOPTION_STRING("SPECIAL", special), - HA_FOPTION_ENUM("DISTRIB", opt, "scattered,clustered,sorted", 0), + HA_FOPTION_STRING("JPATH", jsonpath), + HA_FOPTION_STRING("XPATH", xmlpath), + HA_FOPTION_STRING("SPECIAL", special), + HA_FOPTION_ENUM("DISTRIB", opt, "scattered,clustered,sorted", 0), HA_FOPTION_END }; @@ -1310,9 +1336,10 @@ int GetIntegerTableOption(PGLOBAL g, PTOS options, PCSZ opname, int idef) if ((ulonglong) opval == (ulonglong)NO_IVAL) { PCSZ pv; - if ((pv= GetListOption(g, opname, options->oplist))) - opval= CharToNumber((char*)pv, strlen(pv), ULONGLONG_MAX, true); - else + if ((pv = GetListOption(g, opname, options->oplist))) { + // opval = CharToNumber((char*)pv, strlen(pv), ULONGLONG_MAX, false); + return atoi(pv); + } else return idef; } // endif opval @@ -1564,8 +1591,9 @@ void *ha_connect::GetColumnOption(PGLOBAL g, void *field, PCOLINFO pcf) pcf->Offset= (int)fop->offset; pcf->Freq= (int)fop->freq; pcf->Datefmt= (char*)fop->dateformat; - pcf->Fieldfmt= (char*)fop->fieldformat; - } else { + pcf->Fieldfmt = fop->fieldformat ? (char*)fop->fieldformat + : fop->jsonpath ? (char*)fop->jsonpath : (char*)fop->xmlpath; + } else { pcf->Offset= -1; pcf->Freq= 0; pcf->Datefmt= NULL; @@ -1574,6 +1602,9 @@ void *ha_connect::GetColumnOption(PGLOBAL g, void *field, PCOLINFO pcf) chset= (char *)fp->charset()->name; + if (!strcmp(chset, "binary")) + v = 'B'; // Binary string + switch (fp->type()) { case MYSQL_TYPE_BLOB: case MYSQL_TYPE_VARCHAR: @@ -1583,7 +1614,7 @@ void *ha_connect::GetColumnOption(PGLOBAL g, void *field, PCOLINFO pcf) default: pcf->Type= MYSQLtoPLG(fp->type(), &v); break; - } // endswitch SQL type + } // endswitch SQL type switch (pcf->Type) { case TYPE_STRING: @@ -1637,7 +1668,7 @@ void *ha_connect::GetColumnOption(PGLOBAL g, void *field, PCOLINFO pcf) break; default: break; - } // endswitch type + } // endswitch type if (fp->flags & UNSIGNED_FLAG) pcf->Flags |= U_UNSIGNED; @@ -2208,7 +2239,7 @@ int ha_connect::MakeRecord(char *buf) case TYPE_BIN: p= value->GetCharValue(); charset= &my_charset_bin; - rc= fp->store(p, strlen(p), charset, CHECK_FIELD_WARN); + rc= fp->store(p, value->GetSize(), charset, CHECK_FIELD_WARN); break; case TYPE_DOUBLE: rc= fp->store(value->GetFloatValue()); @@ -4968,7 +4999,7 @@ int ha_connect::check_stmt(PGLOBAL g, MODE newmode, bool cras) } // endif CheckCleanup if (cras) - g->Createas= 1; // To tell external tables of a multi-table command + g->Createas= true; // To tell external tables of a multi-table command if (trace(1)) htrc("Calling CntCheckDB db=%s cras=%d\n", GetDBName(NULL), cras); @@ -5322,91 +5353,100 @@ static char *encode(PGLOBAL g, const char *cnm) @return Return 0 if ok */ -static bool add_field(String *sql, const char *field_name, int typ, int len, - int dec, char *key, uint tm, const char *rem, char *dft, - char *xtra, char *fmt, int flag, bool dbf, char v) -{ - char var= (len > 255) ? 'V' : v; - bool q, error= false; - const char *type= PLGtoMYSQLtype(typ, dbf, var); +static bool add_field(String* sql, TABTYPE ttp, const char* field_name, int typ, + int len, int dec, char* key, uint tm, const char* rem, + char* dft, char* xtra, char* fmt, int flag, bool dbf, char v) { +#if defined(DEVELOPMENT) + // Some client programs regard CHAR(36) as GUID + char var = (len > 255 || len == 36) ? 'V' : v; +#else + char var = (len > 255) ? 'V' : v; +#endif + bool q, error = false; + const char* type = PLGtoMYSQLtype(typ, dbf, var); - error|= sql->append('`'); - error|= sql->append(field_name); - error|= sql->append("` "); - error|= sql->append(type); + error |= sql->append('`'); + error |= sql->append(field_name); + error |= sql->append("` "); + error |= sql->append(type); - if (typ == TYPE_STRING || - (len && typ != TYPE_DATE && (typ != TYPE_DOUBLE || dec >= 0))) { - error|= sql->append('('); - error|= sql->append_ulonglong(len); + if (typ == TYPE_STRING || + (len && typ != TYPE_DATE && (typ != TYPE_DOUBLE || dec >= 0))) { + error |= sql->append('('); + error |= sql->append_ulonglong(len); if (typ == TYPE_DOUBLE) { - error|= sql->append(','); - // dec must be < len and < 31 - error|= sql->append_ulonglong(MY_MIN(dec, (MY_MIN(len, 31) - 1))); - } else if (dec > 0 && !strcmp(type, "DECIMAL")) { - error|= sql->append(','); - // dec must be < len - error|= sql->append_ulonglong(MY_MIN(dec, len - 1)); - } // endif dec - - error|= sql->append(')'); - } // endif len - - if (v == 'U') - error|= sql->append(" UNSIGNED"); - else if (v == 'Z') - error|= sql->append(" ZEROFILL"); - - if (key && *key) { - error|= sql->append(" "); - error|= sql->append(key); - } // endif key - - if (tm) - error|= sql->append(STRING_WITH_LEN(" NOT NULL"), system_charset_info); - - if (dft && *dft) { - error|= sql->append(" DEFAULT "); - - if (typ == TYPE_DATE) - q= (strspn(dft, "0123456789 -:/") == strlen(dft)); - else - q= !IsTypeNum(typ); + error |= sql->append(','); + // dec must be < len and < 31 + error |= sql->append_ulonglong(MY_MIN(dec, (MY_MIN(len, 31) - 1))); + } else if (dec > 0 && !strcmp(type, "DECIMAL")) { + error |= sql->append(','); + // dec must be < len + error |= sql->append_ulonglong(MY_MIN(dec, len - 1)); + } // endif dec + + error |= sql->append(')'); + } // endif len + + if (v == 'U') + error |= sql->append(" UNSIGNED"); + else if (v == 'Z') + error |= sql->append(" ZEROFILL"); + + if (key && *key) { + error |= sql->append(" "); + error |= sql->append(key); + } // endif key + + if (tm) + error |= sql->append(STRING_WITH_LEN(" NOT NULL"), system_charset_info); + + if (dft && *dft) { + error |= sql->append(" DEFAULT "); + + if (typ == TYPE_DATE) + q = (strspn(dft, "0123456789 -:/") == strlen(dft)); + else + q = !IsTypeNum(typ); - if (q) { - error|= sql->append("'"); - error|= sql->append_for_single_quote(dft, strlen(dft)); - error|= sql->append("'"); - } else - error|= sql->append(dft); - - } // endif dft - - if (xtra && *xtra) { - error|= sql->append(" "); - error|= sql->append(xtra); - } // endif rem - - if (rem && *rem) { - error|= sql->append(" COMMENT '"); - error|= sql->append_for_single_quote(rem, strlen(rem)); - error|= sql->append("'"); - } // endif rem - - if (fmt && *fmt) { - error|= sql->append(" FIELD_FORMAT='"); - error|= sql->append_for_single_quote(fmt, strlen(fmt)); - error|= sql->append("'"); - } // endif flag - - if (flag) { - error|= sql->append(" FLAG="); - error|= sql->append_ulonglong(flag); - } // endif flag - - error|= sql->append(','); - return error; + if (q) { + error |= sql->append("'"); + error |= sql->append_for_single_quote(dft, strlen(dft)); + error |= sql->append("'"); + } else + error |= sql->append(dft); + + } // endif dft + + if (xtra && *xtra) { + error |= sql->append(" "); + error |= sql->append(xtra); + } // endif rem + + if (rem && *rem) { + error |= sql->append(" COMMENT '"); + error |= sql->append_for_single_quote(rem, strlen(rem)); + error |= sql->append("'"); + } // endif rem + + if (fmt && *fmt) { + switch (ttp) { + case TAB_JSON: error |= sql->append(" JPATH='"); break; + case TAB_XML: error |= sql->append(" XPATH='"); break; + default: error |= sql->append(" FIELD_FORMAT='"); + } // endswitch ttp + + error |= sql->append_for_single_quote(fmt, strlen(fmt)); + error |= sql->append("'"); + } // endif flag + + if (flag) { + error |= sql->append(" FLAG="); + error |= sql->append_ulonglong(flag); + } // endif flag + + error |= sql->append(','); + return error; } // end of add_field /** @@ -6027,7 +6067,7 @@ static int connect_assisted_discovery(handlerton *, THD* thd, len= 256; // STRBLK's have 0 length // Now add the field - if (add_field(&sql, cnm, typ, len, dec, NULL, tm, + if (add_field(&sql, ttp, cnm, typ, len, dec, NULL, tm, NULL, NULL, NULL, NULL, flg, dbf, v)) rc= HA_ERR_OUT_OF_MEM; } // endfor crp @@ -6221,7 +6261,7 @@ static int connect_assisted_discovery(handlerton *, THD* thd, prec= 0; // Now add the field - if (add_field(&sql, cnm, typ, prec, dec, key, tm, rem, dft, xtra, + if (add_field(&sql, ttp, cnm, typ, prec, dec, key, tm, rem, dft, xtra, fmt, flg, dbf, v)) rc= HA_ERR_OUT_OF_MEM; } // endfor i @@ -6974,7 +7014,7 @@ bool ha_connect::NoFieldOptionChange(TABLE *tab) fop1->fldlen == fop2->fldlen && CheckString(fop1->dateformat, fop2->dateformat) && CheckString(fop1->fieldformat, fop2->fieldformat) && - CheckString(fop1->special, fop2->special)); + CheckString(fop1->special, fop2->special)); } // endfor fld return rc; @@ -7346,7 +7386,9 @@ static struct st_mysql_sys_var* connect_system_variables[]= { MYSQL_SYSVAR(errmsg_dir_path), #endif // XMSG MYSQL_SYSVAR(json_null), - MYSQL_SYSVAR(json_grp_size), + MYSQL_SYSVAR(json_all_path), + MYSQL_SYSVAR(default_depth), + MYSQL_SYSVAR(json_grp_size), #if defined(JAVA_SUPPORT) MYSQL_SYSVAR(jvm_path), MYSQL_SYSVAR(class_path), @@ -7372,7 +7414,7 @@ maria_declare_plugin(connect) 0x0107, /* version number (1.07) */ NULL, /* status variables */ connect_system_variables, /* system variables */ - "1.07.0001", /* string version */ + "1.07.0002", /* string version */ MariaDB_PLUGIN_MATURITY_STABLE /* maturity */ } maria_declare_plugin_end; diff --git a/storage/connect/ha_connect.h b/storage/connect/ha_connect.h index 8be1fe262b6..d1aca22b01f 100644 --- a/storage/connect/ha_connect.h +++ b/storage/connect/ha_connect.h @@ -104,7 +104,9 @@ struct ha_field_option_struct uint opt; const char *dateformat; const char *fieldformat; - char *special; + const char* jsonpath; + const char* xmlpath; + char *special; }; /* diff --git a/storage/connect/json.cpp b/storage/connect/json.cpp index 5d7d08285cf..f6dca8146d6 100644 --- a/storage/connect/json.cpp +++ b/storage/connect/json.cpp @@ -93,9 +93,8 @@ char *NextChr(PSZ s, char sep) PJSON ParseJson(PGLOBAL g, char *s, int len, int *ptyp, bool *comma) { int i, pretty = (ptyp) ? *ptyp : 3; - bool b = false, pty[3] = {true, true, true}; - PJSON jsp = NULL; - STRG src; + bool b = false, pty[3] = {true,true,true}; + PJSON jsp = NULL, jp = NULL; if (trace(1)) htrc("ParseJson: s=%.10s len=%d\n", s, len); @@ -106,27 +105,29 @@ PJSON ParseJson(PGLOBAL g, char *s, int len, int *ptyp, bool *comma) } else if (comma) *comma = false; - src.str = s; - src.len = len; - // Trying to guess the pretty format if (s[0] == '[' && (s[1] == '\n' || (s[1] == '\r' && s[2] == '\n'))) pty[0] = false; try { - for (i = 0; i < len; i++) + jp = new(g) JSON(); + jp->s = s; + jp->len = len; + jp->pty = pty; + + for (i = 0; i < jp->len; i++) switch (s[i]) { case '[': if (jsp) - goto tryit; - else if (!(jsp = ParseArray(g, ++i, src, pty))) - throw 1; + jsp = jp->ParseAsArray(g, i, pretty, ptyp); + else + jsp = jp->ParseArray(g, ++i); break; case '{': if (jsp) - goto tryit; - else if (!(jsp = ParseObject(g, ++i, src, pty))) + jsp = jp->ParseAsArray(g, i, pretty, ptyp); + else if (!(jsp = jp->ParseObject(g, ++i))) throw 2; break; @@ -157,8 +158,8 @@ PJSON ParseJson(PGLOBAL g, char *s, int len, int *ptyp, bool *comma) /* falls through */ default: if (jsp) - goto tryit; - else if (!(jsp = ParseValue(g, i, src, pty))) + jsp = jp->ParseAsArray(g, i, pretty, ptyp); + else if (!(jsp = jp->ParseValue(g, i))) throw 4; break; @@ -187,10 +188,17 @@ PJSON ParseJson(PGLOBAL g, char *s, int len, int *ptyp, bool *comma) } // end catch return jsp; +} // end of ParseJson -tryit: +/***********************************************************************/ +/* Parse several items as being in an array. */ +/***********************************************************************/ +PJAR JSON::ParseAsArray(PGLOBAL g, int& i, int pretty, int *ptyp) +{ if (pty[0] && (!pretty || pretty > 2)) { - if ((jsp = ParseArray(g, (i = 0), src, pty)) && ptyp && pretty == 3) + PJAR jsp; + + if ((jsp = ParseArray(g, (i = 0))) && ptyp && pretty == 3) *ptyp = (pty[0]) ? 0 : 3; return jsp; @@ -198,26 +206,23 @@ tryit: strcpy(g->Message, "More than one item in file"); return NULL; -} // end of ParseJson +} // end of ParseAsArray /***********************************************************************/ /* Parse a JSON Array. */ /***********************************************************************/ -PJAR ParseArray(PGLOBAL g, int& i, STRG& src, bool *pty) +PJAR JSON::ParseArray(PGLOBAL g, int& i) { - char *s = src.str; - int len = src.len; - int level = 0; - bool b = (!i); - PJAR jarp = new(g) JARRAY; - PJVAL jvp = NULL; + int level = 0; + bool b = (!i); + PJAR jarp = new(g) JARRAY; for (; i < len; i++) switch (s[i]) { case ',': if (level < 2) { sprintf(g->Message, "Unexpected ',' near %.*s",ARGS); - return NULL; + throw 1; } else level = 1; @@ -225,8 +230,8 @@ PJAR ParseArray(PGLOBAL g, int& i, STRG& src, bool *pty) case ']': if (level == 1) { sprintf(g->Message, "Unexpected ',]' near %.*s", ARGS); - return NULL; - } // endif level + throw 1; + } // endif level jarp->InitArray(g); return jarp; @@ -240,11 +245,9 @@ PJAR ParseArray(PGLOBAL g, int& i, STRG& src, bool *pty) default: if (level == 2) { sprintf(g->Message, "Unexpected value near %.*s", ARGS); - return NULL; - } else if ((jvp = ParseValue(g, i, src, pty))) - jarp->AddValue(g, jvp); - else - return NULL; + throw 1; + } else + jarp->AddValue(g, ParseValue(g, i)); level = (b) ? 1 : 2; break; @@ -256,18 +259,15 @@ PJAR ParseArray(PGLOBAL g, int& i, STRG& src, bool *pty) return jarp; } // endif b - strcpy(g->Message, "Unexpected EOF in array"); - return NULL; + throw ("Unexpected EOF in array"); } // end of ParseArray /***********************************************************************/ /* Parse a JSON Object. */ /***********************************************************************/ -PJOB ParseObject(PGLOBAL g, int& i, STRG& src, bool *pty) +PJOB JSON::ParseObject(PGLOBAL g, int& i) { PSZ key; - char *s = src.str; - int len = src.len; int level = 0; PJOB jobp = new(g) JOBJECT; PJPR jpp = NULL; @@ -276,42 +276,37 @@ PJOB ParseObject(PGLOBAL g, int& i, STRG& src, bool *pty) switch (s[i]) { case '"': if (level < 2) { - if ((key = ParseString(g, ++i, src))) { - jpp = jobp->AddPair(g, key); - level = 1; - } else - return NULL; - + key = ParseString(g, ++i); + jpp = jobp->AddPair(g, key); + level = 1; } else { sprintf(g->Message, "misplaced string near %.*s", ARGS); - return NULL; + throw 2; } // endif level break; case ':': if (level == 1) { - if (!(jpp->Val = ParseValue(g, ++i, src, pty))) - return NULL; - + jpp->Val = ParseValue(g, ++i); level = 2; } else { sprintf(g->Message, "Unexpected ':' near %.*s", ARGS); - return NULL; + throw 2; } // endif level break; case ',': if (level < 2) { sprintf(g->Message, "Unexpected ',' near %.*s", ARGS); - return NULL; + throw 2; } else - level = 1; + level = 0; break; case '}': - if (level == 1) { + if (level < 2) { sprintf(g->Message, "Unexpected '}' near %.*s", ARGS); - return NULL; + throw 2; } // endif level return jobp; @@ -324,20 +319,19 @@ PJOB ParseObject(PGLOBAL g, int& i, STRG& src, bool *pty) default: sprintf(g->Message, "Unexpected character '%c' near %.*s", s[i], ARGS); - return NULL; + throw 2; }; // endswitch s[i] strcpy(g->Message, "Unexpected EOF in Object"); - return NULL; + throw 2; } // end of ParseObject /***********************************************************************/ /* Parse a JSON Value. */ /***********************************************************************/ -PJVAL ParseValue(PGLOBAL g, int& i, STRG& src, bool *pty) +PJVAL JSON::ParseValue(PGLOBAL g, int& i) { - char *strval, *s = src.str; - int n, len = src.len; + int n; PJVAL jvp = new(g) JVALUE; for (; i < len; i++) @@ -355,21 +349,13 @@ PJVAL ParseValue(PGLOBAL g, int& i, STRG& src, bool *pty) suite: switch (s[i]) { case '[': - if (!(jvp->Jsp = ParseArray(g, ++i, src, pty))) - return NULL; - + jvp->Jsp = ParseArray(g, ++i); break; case '{': - if (!(jvp->Jsp = ParseObject(g, ++i, src, pty))) - return NULL; - + jvp->Jsp = ParseObject(g, ++i); break; case '"': - if ((strval = ParseString(g, ++i, src))) - jvp->Value = AllocateValue(g, strval, TYPE_STRING); - else - return NULL; - + jvp->Value = AllocateValue(g, ParseString(g, ++i), TYPE_STRING); break; case 't': if (!strncmp(s + i, "true", 4)) { @@ -398,11 +384,9 @@ PJVAL ParseValue(PGLOBAL g, int& i, STRG& src, bool *pty) break; case '-': default: - if (s[i] == '-' || isdigit(s[i])) { - if (!(jvp->Value = ParseNumeric(g, i, src))) - goto err; - - } else + if (s[i] == '-' || isdigit(s[i])) + jvp->Value = ParseNumeric(g, i); + else goto err; }; // endswitch s[i] @@ -410,25 +394,21 @@ PJVAL ParseValue(PGLOBAL g, int& i, STRG& src, bool *pty) return jvp; err: - sprintf(g->Message, "Unexpected character '%c' near %.*s", - s[i], ARGS); - return NULL; + sprintf(g->Message, "Unexpected character '%c' near %.*s", s[i], ARGS); + throw 3; } // end of ParseValue /***********************************************************************/ /* Unescape and parse a JSON string. */ /***********************************************************************/ -char *ParseString(PGLOBAL g, int& i, STRG& src) +char *JSON::ParseString(PGLOBAL g, int& i) { - char *s = src.str; uchar *p; - int n = 0, len = src.len; + int n = 0; // Be sure of memory availability - if (len + 1 - i > (signed)((PPOOLHEADER)g->Sarea)->FreeBlk) { - strcpy(g->Message, "ParseString: Out of memory"); - return NULL; - } // endif len + if (((size_t)len + 1 - i) > ((PPOOLHEADER)g->Sarea)->FreeBlk) + throw("ParseString: Out of memory"); // The size to allocate is not known yet p = (uchar*)PlugSubAlloc(g, NULL, 0); @@ -502,17 +482,16 @@ char *ParseString(PGLOBAL g, int& i, STRG& src) }; // endswitch s[i] err: - strcpy(g->Message, "Unexpected EOF in String"); - return NULL; + throw("Unexpected EOF in String"); } // end of ParseString /***********************************************************************/ /* Parse a JSON numeric value. */ /***********************************************************************/ -PVAL ParseNumeric(PGLOBAL g, int& i, STRG& src) +PVAL JSON::ParseNumeric(PGLOBAL g, int& i) { - char *s = src.str, buf[50]; - int n = 0, len = src.len; + char buf[50]; + int n = 0; short nd = 0; bool has_dot = false; bool has_e = false; @@ -575,14 +554,11 @@ PVAL ParseNumeric(PGLOBAL g, int& i, STRG& src) i--; // Unstack following character return valp; - } else { - strcpy(g->Message, "No digit found"); - return NULL; - } // endif found_digit + } else + throw("No digit found"); err: - strcpy(g->Message, "Unexpected EOF in number"); - return NULL; + throw("Unexpected EOF in number"); } // end of ParseNumeric /***********************************************************************/ diff --git a/storage/connect/json.h b/storage/connect/json.h index 1d058ad575f..bc94b372133 100644 --- a/storage/connect/json.h +++ b/storage/connect/json.h @@ -1,10 +1,11 @@ /**************** json H Declares Source Code File (.H) ****************/ /* Name: json.h Version 1.2 */ /* */ -/* (C) Copyright to the author Olivier BERTRAND 2014 - 2017 */ +/* (C) Copyright to the author Olivier BERTRAND 2014 - 2020 */ /* */ /* This file contains the JSON classes declares. */ /***********************************************************************/ +#include <mysql_com.h> #include "value.h" #if defined(_DEBUG) @@ -44,15 +45,31 @@ typedef struct { int len; } STRG, *PSG; +// BSON size should be equal on Linux and Windows +#define BMX 255 +typedef struct BSON* PBSON; + +/***********************************************************************/ +/* Structure used to return binary json to Json UDF functions. */ +/***********************************************************************/ +struct BSON { + char Msg[BMX + 1]; + char *Filename; + PGLOBAL G; + int Pretty; + ulong Reslen; + my_bool Changed; + PJSON Top; + PJSON Jsp; + PBSON Bsp; +}; // end of struct BSON + +PBSON JbinAlloc(PGLOBAL g, UDF_ARGS* args, ulong len, PJSON jsp); + char *NextChr(PSZ s, char sep); char *GetJsonNull(void); -PJSON ParseJson(PGLOBAL g, char *s, int n, int *prty = NULL, bool *b = NULL); -PJAR ParseArray(PGLOBAL g, int& i, STRG& src, bool *pty); -PJOB ParseObject(PGLOBAL g, int& i, STRG& src, bool *pty); -PJVAL ParseValue(PGLOBAL g, int& i, STRG& src, bool *pty); -char *ParseString(PGLOBAL g, int& i, STRG& src); -PVAL ParseNumeric(PGLOBAL g, int& i, STRG& src); +PJSON ParseJson(PGLOBAL g, char* s, int n, int* prty = NULL, bool* b = NULL); PSZ Serialize(PGLOBAL g, PJSON jsp, char *fn, int pretty); bool SerializeArray(JOUT *js, PJAR jarp, bool b); bool SerializeObject(JOUT *js, PJOB jobp); @@ -130,7 +147,7 @@ class JOUTPRT : public JOUTFILE { class JPAIR : public BLOCK { friend class JOBJECT; friend class JSNX; - friend PJOB ParseObject(PGLOBAL, int&, STRG&, bool*); + friend class JSON; friend bool SerializeObject(JOUT *, PJOB); public: JPAIR(PCSZ key) : BLOCK() {Key = key; Val = NULL; Next = NULL;} @@ -149,8 +166,9 @@ class JPAIR : public BLOCK { /* Class JSON. The base class for all other json classes. */ /***********************************************************************/ class JSON : public BLOCK { + friend PJSON ParseJson(PGLOBAL, char*, int, int*, bool*); public: - JSON(void) {Size = 0;} + JSON(void) : s(NULL), len(0), pty(NULL) {Size = 0;} int size(void) {return Size;} virtual int GetSize(bool b) {return Size;} @@ -187,14 +205,27 @@ class JSON : public BLOCK { virtual bool IsNull(void) {X return true;} protected: - int Size; + PJAR ParseArray(PGLOBAL g, int& i); + PJOB ParseObject(PGLOBAL g, int& i); + PJVAL ParseValue(PGLOBAL g, int& i); + char *ParseString(PGLOBAL g, int& i); + PVAL ParseNumeric(PGLOBAL g, int& i); + PJAR ParseAsArray(PGLOBAL g, int& i, int pretty, int *ptyp); + + // Members + int Size; + + // Only used when parsing + private: + char *s; + int len; + bool *pty; }; // end of class JSON /***********************************************************************/ /* Class JOBJECT: contains a list of value pairs. */ /***********************************************************************/ class JOBJECT : public JSON { - friend PJOB ParseObject(PGLOBAL, int&, STRG&, bool*); friend bool SerializeObject(JOUT *, PJOB); friend class JSNX; public: @@ -260,8 +291,8 @@ class JVALUE : public JSON { friend class JARRAY; friend class JSNX; friend class JSONCOL; - friend PJVAL ParseValue(PGLOBAL, int&, STRG&, bool*); - friend bool SerializeValue(JOUT *, PJVAL); + friend class JSON; + friend bool SerializeValue(JOUT*, PJVAL); public: JVALUE(void) : JSON() {Clear();} JVALUE(PJSON jsp); diff --git a/storage/connect/jsonudf.cpp b/storage/connect/jsonudf.cpp index edd596ea02e..9ea37fb651d 100644 --- a/storage/connect/jsonudf.cpp +++ b/storage/connect/jsonudf.cpp @@ -25,7 +25,7 @@ #else #define PUSH_WARNING(M) htrc(M) #endif -#define M 7 +#define M 9 bool IsNum(PSZ s); char *NextChr(PSZ s, char sep); @@ -1076,29 +1076,10 @@ my_bool JSNX::AddPath(void) /* --------------------------------- JSON UDF ---------------------------------- */ -// BSON size should be equal on Linux and Windows -#define BMX 255 -typedef struct BSON *PBSON; - -/*********************************************************************************/ -/* Structure used to return binary json. */ -/*********************************************************************************/ -struct BSON { - char Msg[BMX + 1]; - char *Filename; - PGLOBAL G; - int Pretty; - ulong Reslen; - my_bool Changed; - PJSON Top; - PJSON Jsp; - PBSON Bsp; -}; // end of struct BSON - /*********************************************************************************/ /* Allocate and initialize a BSON structure. */ /*********************************************************************************/ -static PBSON JbinAlloc(PGLOBAL g, UDF_ARGS *args, ulong len, PJSON jsp) +PBSON JbinAlloc(PGLOBAL g, UDF_ARGS *args, ulong len, PJSON jsp) { PBSON bsp = (PBSON)PlgDBSubAlloc(g, NULL, sizeof(BSON)); @@ -1111,7 +1092,7 @@ static PBSON JbinAlloc(PGLOBAL g, UDF_ARGS *args, ulong len, PJSON jsp) bsp->Reslen = len; bsp->Changed = false; bsp->Top = bsp->Jsp = jsp; - bsp->Bsp = (IsJson(args, 0) == 3) ? (PBSON)args->args[0] : NULL; + bsp->Bsp = (args && IsJson(args, 0) == 3) ? (PBSON)args->args[0] : NULL; } else PUSH_WARNING(g->Message); @@ -1144,7 +1125,7 @@ static my_bool JsonSubSet(PGLOBAL g) { PPOOLHEADER pph = (PPOOLHEADER)g->Sarea; - pph->To_Free = (OFFSET)((g->Createas) ? g->Createas : sizeof(POOLHEADER)); + pph->To_Free = (g->Saved_Size) ? g->Saved_Size : (size_t)sizeof(POOLHEADER); pph->FreeBlk = g->Sarea_Size - pph->To_Free; return FALSE; } /* end of JsonSubSet */ @@ -1154,7 +1135,7 @@ static my_bool JsonSubSet(PGLOBAL g) /*********************************************************************************/ inline void JsonMemSave(PGLOBAL g) { - g->Createas = (int)((PPOOLHEADER)g->Sarea)->To_Free; + g->Saved_Size = ((PPOOLHEADER)g->Sarea)->To_Free; } /* end of JsonMemSave */ /*********************************************************************************/ @@ -1422,7 +1403,7 @@ static int IsJson(UDF_ARGS *args, uint i, bool b) n = 2; // arg is a json file name } else if (b) { char *sap; - PGLOBAL g = PlugInit(NULL, args->lengths[i] * M + 1024); + PGLOBAL g = PlugInit(NULL, (size_t)args->lengths[i] * M + 1024); JsonSubSet(g); sap = MakePSZ(g, args, i); @@ -1625,7 +1606,7 @@ static my_bool CheckMemory(PGLOBAL g, UDF_INIT *initid, UDF_ARGS *args, uint n, return true; } // endif SareaAlloc - g->Createas = 0; + g->Saved_Size = 0; g->Xchk = NULL; initid->max_length = rl; } // endif Size @@ -4425,13 +4406,15 @@ char *json_file(UDF_INIT *initid, UDF_ARGS *args, char *result, fn = MakePSZ(g, args, 0); if (args->arg_count > 1) { - int len, pretty, pty = 3; + int len, pretty = 3, pty = 3; PJSON jsp; PJVAL jvp = NULL; - pretty = (args->arg_type[1] == INT_RESULT) ? (int)*(longlong*)args->args[1] - : (args->arg_count > 2 && args->arg_type[2] == INT_RESULT) - ? (int)*(longlong*)args->args[2] : 3; + for (unsigned int i = 1; i < args->arg_count; i++) + if (args->arg_type[i] == INT_RESULT && *(longlong*)args->args[i] < 4) { + pretty = (int) * (longlong*)args->args[i]; + break; + } // endif type /*******************************************************************************/ /* Parse the json file and allocate its tree structure. */ @@ -4499,6 +4482,7 @@ my_bool jfile_make_init(UDF_INIT *initid, UDF_ARGS *args, char *message) } // endif CalcLen(args, false, reslen, memlen); + memlen = memlen + 5000; // To take care of not pretty files return JsonInit(initid, args, message, true, reslen, memlen); } // end of jfile_make_init @@ -5628,20 +5612,19 @@ my_bool jbin_file_init(UDF_INIT *initid, UDF_ARGS *args, char *message) } else if (args->arg_type[0] != STRING_RESULT || !args->args[0]) { strcpy(message, "First argument must be a constant string (file name)"); return true; - } else if (args->arg_count > 1 && args->arg_type[1] != STRING_RESULT) { - strcpy(message, "Second argument is not a string (path)"); - return true; - } else if (args->arg_count > 2 && args->arg_type[2] != INT_RESULT) { - strcpy(message, "Third argument is not an integer (pretty)"); - return true; - } else if (args->arg_count > 3) { - if (args->arg_type[3] != INT_RESULT) { - strcpy(message, "Fourth argument is not an integer (memory)"); + } // endifs + + for (unsigned int i = 1; i < args->arg_count; i++) { + if (!(args->arg_type[i] == INT_RESULT || args->arg_type[i] == STRING_RESULT)) { + sprintf(message, "Argument %d is not an integer or a string (pretty or path)", i); return true; - } else - more += (ulong)*(longlong*)args->args[3]; + } // endif arg_type - } // endifs + // Take care of eventual memory argument + if (args->arg_type[i] == INT_RESULT && args->args[i]) + more += (ulong) * (longlong*)args->args[i]; + + } // endfor i initid->maybe_null = 1; CalcLen(args, false, reslen, memlen); @@ -5656,7 +5639,7 @@ char *jbin_file(UDF_INIT *initid, UDF_ARGS *args, char *result, unsigned long *res_length, char *is_null, char *error) { char *fn; - int pretty, len = 0, pty = 3; + int pretty = 3, len = 0, pty = 3; PJSON jsp; PJVAL jvp = NULL; PGLOBAL g = (PGLOBAL)initid->ptr; @@ -5668,7 +5651,12 @@ char *jbin_file(UDF_INIT *initid, UDF_ARGS *args, char *result, PlugSubSet(g->Sarea, g->Sarea_Size); g->Xchk = NULL; fn = MakePSZ(g, args, 0); - pretty = (args->arg_count > 2 && args->args[2]) ? (int)*(longlong*)args->args[2] : 3; + + for (unsigned int i = 1; i < args->arg_count; i++) + if (args->arg_type[i] == INT_RESULT && *(longlong*)args->args[i] < 4) { + pretty = (int) * (longlong*)args->args[i]; + break; + } // endif type /*********************************************************************************/ /* Parse the json file and allocate its tree structure. */ @@ -5759,7 +5747,7 @@ char *json_serialize(UDF_INIT *initid, UDF_ARGS *args, char *result, // Keep result of constant function g->Xchk = (initid->const_item) ? str : NULL; } else { - *error = 1; + // *error = 1; str = strcpy(result, "Argument is not a Jbin tree"); } // endif @@ -5776,6 +5764,474 @@ void json_serialize_deinit(UDF_INIT* initid) } // end of json_serialize_deinit /*********************************************************************************/ +/* Convert a prettiest Json file to Pretty=0. */ +/*********************************************************************************/ +my_bool jfile_convert_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { + unsigned long reslen, memlen; + + if (args->arg_count != 3) { + strcpy(message, "This function must have 3 arguments"); + return true; + } else if (args->arg_type[2] != INT_RESULT) { + strcpy(message, "Third Argument must be an integer (LRECL)"); + return true; + } else for (int i = 0; i < 2; i++) + if (args->arg_type[i] != STRING_RESULT) { + sprintf(message, "Arguments %d must be a string (file name)", i+1); + return true; + } // endif args + + CalcLen(args, false, reslen, memlen); + return JsonInit(initid, args, message, false, reslen, memlen); +} // end of jfile_convert_init + +char *jfile_convert(UDF_INIT* initid, UDF_ARGS* args, char* result, + unsigned long *res_length, char *, char *error) { + char *str, *fn, *ofn; + int lrecl = (int)*(longlong*)args->args[2]; + PGLOBAL g = (PGLOBAL)initid->ptr; + + PlugSubSet(g->Sarea, g->Sarea_Size); + fn = MakePSZ(g, args, 0); + ofn = MakePSZ(g, args, 1); + + if (!g->Xchk) { + JUP* jup = new(g) JUP(g); + + str = jup->UnprettyJsonFile(g, fn, ofn, lrecl); + g->Xchk = str; + } else + str = (char*)g->Xchk; + + if (!str) { + str = PlugDup(g, g->Message); + } // endif str + + *res_length = strlen(str); + return str; +} // end of jfile_convert + +void jfile_convert_deinit(UDF_INIT* initid) { + JsonFreeMem((PGLOBAL)initid->ptr); +} // end of jfile_convert_deinit + +/* --------------------------------- Class JUP --------------------------------- */ + +#define ARGS MY_MIN(24,len-i),s+MY_MAX(i-3,0) + +/*********************************************************************************/ +/* JUP public constructor. */ +/*********************************************************************************/ +JUP::JUP(PGLOBAL g) { + fs = NULL; + s = buff = NULL; + i = k = len = recl = 0; +} // end of JUP constructor + +/*********************************************************************************/ +/* Copy a json file to another with pretty = 0. */ +/*********************************************************************************/ +char* JUP::UnprettyJsonFile(PGLOBAL g, char *fn, char *outfn, int lrecl) { + char *ret = NULL; + HANDLE hFile; + MEMMAP mm; + + /*******************************************************************************/ + /* Create the mapping file object. */ + /*******************************************************************************/ + hFile = CreateFileMap(g, fn, &mm, MODE_READ, false); + + if (hFile == INVALID_HANDLE_VALUE) { + DWORD rc = GetLastError(); + + if (!(*g->Message)) + sprintf(g->Message, MSG(OPEN_MODE_ERROR), "map", (int)rc, fn); + + return NULL; + } // endif hFile + + /*******************************************************************************/ + /* Get the file size (assuming file is smaller than 4 GB) */ + /*******************************************************************************/ + if (!mm.lenL) { // Empty or deleted file + CloseFileHandle(hFile); + return NULL; + } else + len = (int)mm.lenL; + + if (!mm.memory) { + CloseFileHandle(hFile); + sprintf(g->Message, MSG(MAP_VIEW_ERROR), fn, GetLastError()); + return NULL; + } else + s = (char*)mm.memory; + + CloseFileHandle(hFile); // Not used anymore + + /*********************************************************************************/ + /* Parse the json file and allocate its tree structure. */ + /*********************************************************************************/ + if (!(fs = fopen(outfn, "wb"))) { + sprintf(g->Message, MSG(OPEN_MODE_ERROR), + "w", (int)errno, outfn); + strcat(strcat(g->Message, ": "), strerror(errno)); + CloseMemMap(mm.memory, (size_t)mm.lenL); + return NULL; + } // endif fs + + g->Message[0] = 0; + + if (!unPretty(g, lrecl)) + ret = outfn; + + CloseMemMap(mm.memory, (size_t)mm.lenL); + fclose(fs); + return ret; +} // end of UnprettyJsonFile + +/***********************************************************************/ +/* Translate a json file to pretty = 0. */ +/***********************************************************************/ +bool JUP::unPretty(PGLOBAL g, int lrecl) { + bool go, next, rc = false; + + if (trace(1)) + htrc("UnPretty: s=%.10s len=%zd lrecl=%d\n", s, len, lrecl); + + if (!s || !len) { + strcpy(g->Message, "Void JSON file"); + return true; + } else if (*s != '[') { + // strcpy(g->Message, "JSON file is not an array"); + s = strchr(s, '['); + // return true; + } // endif s + + i = 1; + go = next = true; + + try { + // Allocate the record + buff = (char*)PlugSubAlloc(g, NULL, (size_t)lrecl + 3); + recl = lrecl; + + do { + for (k = 0; go && i < len; i++) + switch (s[i]) { + case '{': + buff[k++] = s[i++]; + CopyObject(g); + break; + case '[': + throw "JSON file is not an array of objects"; + break; + case ' ': + case '\t': + case '\n': + case '\r': + break; + case ',': + go = false; + break; + case ']': + go = next = false; + break; + default: + sprintf(g->Message, "Unexpected '%c' near %.*s", s[i], ARGS); + throw 4; + break; + }; // endswitch s[i] + + // Write the record +#ifdef __win_ + buff[k++] = '\r'; +#endif + buff[k++] = '\n'; + buff[k] = 0; + + if ((fputs(buff, fs)) == EOF) { + sprintf(g->Message, MSG(FPUTS_ERROR), strerror(errno)); + throw 5; + } // endif EOF + + go = true; + } while (next); + + } catch (int n) { + if (trace(1)) + htrc("Exception %d: %s\n", n, g->Message); + rc = true; + } catch (const char* msg) { + strcpy(g->Message, msg); + rc = true; + } // end catch + + return rc; +} // end of unPretty + +/***********************************************************************/ +/* Copy a JSON Object. */ +/***********************************************************************/ +void JUP::CopyObject(PGLOBAL g) { + int level = 0; + + for (; i < len; i++) + switch (s[i]) { + case '"': + AddBuff(s[i++]); + + if (level < 2) { + CopyString(g); + level = 1; + } else { + sprintf(g->Message, "misplaced string near %.*s", ARGS); + throw 3; + } // endif level + + break; + case ':': + AddBuff(s[i++]); + + if (level == 1) { + CopyValue(g); + level = 2; + } else { + sprintf(g->Message, "Unexpected ':' near %.*s", ARGS); + throw 3; + } // endif level + + break; + case ',': + AddBuff(s[i]); + + if (level < 2) { + sprintf(g->Message, "Unexpected ',' near %.*s", ARGS); + throw 3; + } else + level = 0; + + break; + case '}': + AddBuff(s[i]); + + if (level == 1) { + sprintf(g->Message, "Unexpected '}' near %.*s", ARGS); + throw 3; + } // endif level + + return; + case '\n': + case '\r': + case ' ': + case '\t': + break; + default: + sprintf(g->Message, "Unexpected character '%c' near %.*s", s[i], ARGS); + throw 3; + }; // endswitch s[i] + + throw "Unexpected EOF in Object"; +} // end of CopyObject + +/***********************************************************************/ +/* Copy a JSON Array. */ +/***********************************************************************/ +void JUP::CopyArray(PGLOBAL g) { + int level = 0; + + for (; i < len; i++) + switch (s[i]) { + case ',': + if (level < 2) { + sprintf(g->Message, "Unexpected ',' near %.*s", ARGS); + throw 2; + } else + level = 1; + + AddBuff(s[i]); + break; + case ']': + if (level == 1) { + sprintf(g->Message, "Unexpected ',]' near %.*s", ARGS); + throw 2; + } // endif level + + AddBuff(s[i]); + return; + case '\n': + case '\r': + case ' ': + case '\t': + break; + default: + if (level == 2) { + sprintf(g->Message, "Unexpected value near %.*s", ARGS); + throw 2; + } // endif level + + CopyValue(g); + level = 2; + break; + }; // endswitch s[i] + + throw "Unexpected EOF in array"; +} // end of CopyArray + +/***********************************************************************/ +/* Copy a JSON Value. */ +/***********************************************************************/ +void JUP::CopyValue(PGLOBAL g) { + for (; i < len; i++) + switch (s[i]) { + case '\n': + case '\r': + case ' ': + case '\t': + break; + default: + goto suite; + } // endswitch + +suite: + switch (s[i]) { + case '[': + AddBuff(s[i++]); + CopyArray(g); + break; + case '{': + AddBuff(s[i++]); + CopyObject(g); + break; + case '"': + AddBuff(s[i++]); + CopyString(g); + break; + case 't': + if (!strncmp(s + i, "true", 4)) { + AddBuff(s[i++]); + AddBuff(s[i++]); + AddBuff(s[i++]); + AddBuff(s[i]); + } else + goto err; + + break; + case 'f': + if (!strncmp(s + i, "false", 5)) { + AddBuff(s[i++]); + AddBuff(s[i++]); + AddBuff(s[i++]); + AddBuff(s[i++]); + AddBuff(s[i]); + } else + goto err; + + break; + case 'n': + if (!strncmp(s + i, "null", 4)) { + AddBuff(s[i++]); + AddBuff(s[i++]); + AddBuff(s[i++]); + AddBuff(s[i]); + } else + goto err; + + break; + default: + if (s[i] == '-' || isdigit(s[i])) + CopyNumeric(g); + else + goto err; + + }; // endswitch s[i] + + return; + +err: + sprintf(g->Message, "Unexpected character '%c' near %.*s", s[i], ARGS); + throw 1; +} // end of CopyValue + +/***********************************************************************/ +/* Unescape and parse a JSON string. */ +/***********************************************************************/ +void JUP::CopyString(PGLOBAL g) { + for (; i < len; i++) { + AddBuff(s[i]); + + switch (s[i]) { + case '"': + return; + case '\\': + AddBuff(s[++i]); + break; + default: + break; + }; // endswitch s[i] + + } // endfor i + + throw "Unexpected EOF in String"; +} // end of CopyString + +/***********************************************************************/ +/* Copy a JSON numeric value. */ +/***********************************************************************/ +void JUP::CopyNumeric(PGLOBAL g) { + bool has_dot = false; + bool has_e = false; + bool found_digit = false; + + for (; i < len; i++) { + switch (s[i]) { + case '.': + if (!found_digit || has_dot || has_e) + goto err; + + has_dot = true; + break; + case 'e': + case 'E': + if (!found_digit || has_e) + goto err; + + has_e = true; + found_digit = false; + break; + case '+': + if (!has_e) + goto err; + + // fall through + case '-': + if (found_digit) + goto err; + + break; + default: + if (isdigit(s[i])) { + found_digit = true; + } else + goto fin; + + }; // endswitch s[i] + + AddBuff(s[i]); + } // endfor i + +fin: + if (!found_digit) + throw "No digit found"; + else + i--; + + return; + +err: + throw "Unexpected EOF in number"; +} // end of CopyNumeric + +/*********************************************************************************/ /* Utility function returning an environment variable value. */ /*********************************************************************************/ my_bool envar_init(UDF_INIT *initid, UDF_ARGS *args, char *message) diff --git a/storage/connect/jsonudf.h b/storage/connect/jsonudf.h index ee56869a111..897b0fe9919 100644 --- a/storage/connect/jsonudf.h +++ b/storage/connect/jsonudf.h @@ -235,6 +235,10 @@ extern "C" { DllExport char *json_serialize(UDF_EXEC_ARGS); DllExport void json_serialize_deinit(UDF_INIT*); + DllExport my_bool jfile_convert_init(UDF_INIT*, UDF_ARGS*, char*); + DllExport char* jfile_convert(UDF_EXEC_ARGS); + DllExport void jfile_convert_deinit(UDF_INIT*); + DllExport my_bool envar_init(UDF_INIT*, UDF_ARGS*, char*); DllExport char *envar(UDF_EXEC_ARGS); @@ -324,3 +328,38 @@ protected: my_bool Wr; // Write mode my_bool Jb; // Must return json item }; // end of class JSNX + +/*********************************************************************************/ +/* Class JUP: used by jfile_convert to make a json file pretty = 0. */ +/*********************************************************************************/ +class JUP : public BLOCK { +public: + // Constructor + JUP(PGLOBAL g); + + // Implementation + void AddBuff(char c) { + if (k < recl) + buff[k++] = c; + else + throw "Record size is too small"; + } // end of AddBuff + + // Methods + char *UnprettyJsonFile(PGLOBAL g, char* fn, char* outfn, int lrecl); + bool unPretty(PGLOBAL g, int lrecl); + void CopyObject(PGLOBAL g); + void CopyArray(PGLOBAL g); + void CopyValue(PGLOBAL g); + void CopyString(PGLOBAL g); + void CopyNumeric(PGLOBAL g); + + // Members + FILE* fs; + char* s; + char* buff; + int len; + int recl; + int i, k; +}; // end of class JUP + diff --git a/storage/connect/mongo.cpp b/storage/connect/mongo.cpp index bd3d3b893c1..5f10a89ee67 100644 --- a/storage/connect/mongo.cpp +++ b/storage/connect/mongo.cpp @@ -35,6 +35,7 @@ bool MakeSelector(PGLOBAL g, PFIL fp, PSTRG s); bool IsNum(PSZ s); +int GetDefaultDepth(void); /***********************************************************************/ /* Make selector json representation for Mongo tables. */ @@ -248,15 +249,10 @@ MGODISC::MGODISC(PGLOBAL g, int *lg) { /***********************************************************************/ int MGODISC::GetColumns(PGLOBAL g, PCSZ db, PCSZ uri, PTOS topt) { - PCSZ level = GetStringTableOption(g, topt, "Level", NULL); PMGODEF tdp; - if (level) { - lvl = atoi(level); - lvl = (lvl > 16) ? 16 : lvl; - } else - lvl = 0; - + lvl = GetIntegerTableOption(g, topt, "Level", GetDefaultDepth()); + lvl = GetIntegerTableOption(g, topt, "Depth", lvl); all = GetBooleanTableOption(g, topt, "Fullarray", false); /*********************************************************************/ diff --git a/storage/connect/mysql-test/connect/r/json_java_2.result b/storage/connect/mysql-test/connect/r/json_java_2.result index 4bbac236200..47fc4abbd28 100644 --- a/storage/connect/mysql-test/connect/r/json_java_2.result +++ b/storage/connect/mysql-test/connect/r/json_java_2.result @@ -20,12 +20,12 @@ SELECT * from t1; Column_Name Data_Type Type_Name Column_Size Buffer_Length Decimal_Digits Nullable Jpath _id 1 CHAR 24 24 0 0 _id address_building 1 CHAR 10 10 0 0 address.building -address_coord 1 CHAR 256 256 0 1 address.coord +address_coord 1 CHAR 1024 1024 0 1 address.coord address_street 1 CHAR 38 38 0 0 address.street address_zipcode 1 CHAR 5 5 0 0 address.zipcode borough 1 CHAR 13 13 0 0 cuisine 1 CHAR 64 64 0 0 -grades_date 1 CHAR 256 256 0 1 grades.0.date +grades_date 1 CHAR 1024 1024 0 1 grades.0.date grades_grade 1 CHAR 14 14 0 1 grades.0.grade grades_score 5 BIGINT 2 2 0 1 grades.0.score name 1 CHAR 98 98 0 0 @@ -64,16 +64,16 @@ OPTION_LIST='Level=1,Driver=Java,Version=2' CONNECTION='mongodb://localhost:2701 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `_id` char(24) NOT NULL `FIELD_FORMAT`='_id', - `address_building` char(10) NOT NULL `FIELD_FORMAT`='address.building', - `address_coord` varchar(256) DEFAULT NULL `FIELD_FORMAT`='address.coord', - `address_street` char(38) NOT NULL `FIELD_FORMAT`='address.street', - `address_zipcode` char(5) NOT NULL `FIELD_FORMAT`='address.zipcode', + `_id` char(24) NOT NULL `JPATH`='_id', + `address_building` char(10) NOT NULL `JPATH`='address.building', + `address_coord` varchar(1024) DEFAULT NULL `JPATH`='address.coord', + `address_street` char(38) NOT NULL `JPATH`='address.street', + `address_zipcode` char(5) NOT NULL `JPATH`='address.zipcode', `borough` char(13) NOT NULL, `cuisine` char(64) NOT NULL, - `grades_date` varchar(256) DEFAULT NULL `FIELD_FORMAT`='grades.0.date', - `grades_grade` char(14) DEFAULT NULL `FIELD_FORMAT`='grades.0.grade', - `grades_score` bigint(2) DEFAULT NULL `FIELD_FORMAT`='grades.0.score', + `grades_date` varchar(1024) DEFAULT NULL `JPATH`='grades.0.date', + `grades_grade` char(14) DEFAULT NULL `JPATH`='grades.0.grade', + `grades_score` bigint(2) DEFAULT NULL `JPATH`='grades.0.score', `name` char(98) NOT NULL, `restaurant_id` char(8) NOT NULL ) ENGINE=CONNECT DEFAULT CHARSET=latin1 CONNECTION='mongodb://localhost:27017' `TABLE_TYPE`='JSON' `TABNAME`='restaurants' `OPTION_LIST`='Level=1,Driver=Java,Version=2' `DATA_CHARSET`='utf8' `LRECL`=4096 @@ -251,15 +251,15 @@ OPTION_LIST='Driver=Java,level=2,version=2'; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `_id` char(24) NOT NULL `FIELD_FORMAT`='_id', - `address_building` char(10) NOT NULL `FIELD_FORMAT`='address.building', - `address_coord` double(18,16) DEFAULT NULL `FIELD_FORMAT`='address.coord.0', - `address_street` char(38) NOT NULL `FIELD_FORMAT`='address.street', - `address_zipcode` char(5) NOT NULL `FIELD_FORMAT`='address.zipcode', + `_id` char(24) NOT NULL `JPATH`='_id', + `address_building` char(10) NOT NULL `JPATH`='address.building', + `address_coord` double(18,16) DEFAULT NULL `JPATH`='address.coord.0', + `address_street` char(38) NOT NULL `JPATH`='address.street', + `address_zipcode` char(5) NOT NULL `JPATH`='address.zipcode', `borough` char(13) NOT NULL, - `grades_date` char(24) DEFAULT NULL `FIELD_FORMAT`='grades.0.date', - `grades_grade` char(14) DEFAULT NULL `FIELD_FORMAT`='grades.0.grade', - `grades_score` bigint(2) DEFAULT NULL `FIELD_FORMAT`='grades.0.score', + `grades_date` char(24) DEFAULT NULL `JPATH`='grades.0.date', + `grades_grade` char(14) DEFAULT NULL `JPATH`='grades.0.grade', + `grades_score` bigint(2) DEFAULT NULL `JPATH`='grades.0.score', `name` char(98) NOT NULL, `restaurant_id` char(8) NOT NULL ) ENGINE=CONNECT DEFAULT CHARSET=latin1 CONNECTION='mongodb://localhost:27017' `TABLE_TYPE`='JSON' `TABNAME`='restaurants' `COLIST`='{"cuisine":0}' `FILTER`='{"cuisine":"French","borough":{"$ne":"Manhattan"}}' `OPTION_LIST`='Driver=Java,level=2,version=2' `LRECL`=4096 diff --git a/storage/connect/mysql-test/connect/r/json_java_3.result b/storage/connect/mysql-test/connect/r/json_java_3.result index eb8bfc022d6..720c82cd7f9 100644 --- a/storage/connect/mysql-test/connect/r/json_java_3.result +++ b/storage/connect/mysql-test/connect/r/json_java_3.result @@ -20,12 +20,12 @@ SELECT * from t1; Column_Name Data_Type Type_Name Column_Size Buffer_Length Decimal_Digits Nullable Jpath _id 1 CHAR 24 24 0 0 _id address_building 1 CHAR 10 10 0 0 address.building -address_coord 1 CHAR 256 256 0 1 address.coord +address_coord 1 CHAR 1024 1024 0 1 address.coord address_street 1 CHAR 38 38 0 0 address.street address_zipcode 1 CHAR 5 5 0 0 address.zipcode borough 1 CHAR 13 13 0 0 cuisine 1 CHAR 64 64 0 0 -grades_date 1 CHAR 256 256 0 1 grades.0.date +grades_date 1 CHAR 1024 1024 0 1 grades.0.date grades_grade 1 CHAR 14 14 0 1 grades.0.grade grades_score 5 BIGINT 2 2 0 1 grades.0.score name 1 CHAR 98 98 0 0 @@ -64,16 +64,16 @@ OPTION_LIST='Level=1,Driver=Java,Version=3' CONNECTION='mongodb://localhost:2701 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `_id` char(24) NOT NULL `FIELD_FORMAT`='_id', - `address_building` char(10) NOT NULL `FIELD_FORMAT`='address.building', - `address_coord` varchar(256) DEFAULT NULL `FIELD_FORMAT`='address.coord', - `address_street` char(38) NOT NULL `FIELD_FORMAT`='address.street', - `address_zipcode` char(5) NOT NULL `FIELD_FORMAT`='address.zipcode', + `_id` char(24) NOT NULL `JPATH`='_id', + `address_building` char(10) NOT NULL `JPATH`='address.building', + `address_coord` varchar(1024) DEFAULT NULL `JPATH`='address.coord', + `address_street` char(38) NOT NULL `JPATH`='address.street', + `address_zipcode` char(5) NOT NULL `JPATH`='address.zipcode', `borough` char(13) NOT NULL, `cuisine` char(64) NOT NULL, - `grades_date` varchar(256) DEFAULT NULL `FIELD_FORMAT`='grades.0.date', - `grades_grade` char(14) DEFAULT NULL `FIELD_FORMAT`='grades.0.grade', - `grades_score` bigint(2) DEFAULT NULL `FIELD_FORMAT`='grades.0.score', + `grades_date` varchar(1024) DEFAULT NULL `JPATH`='grades.0.date', + `grades_grade` char(14) DEFAULT NULL `JPATH`='grades.0.grade', + `grades_score` bigint(2) DEFAULT NULL `JPATH`='grades.0.score', `name` char(98) NOT NULL, `restaurant_id` char(8) NOT NULL ) ENGINE=CONNECT DEFAULT CHARSET=latin1 CONNECTION='mongodb://localhost:27017' `TABLE_TYPE`='JSON' `TABNAME`='restaurants' `OPTION_LIST`='Level=1,Driver=Java,Version=3' `DATA_CHARSET`='utf8' `LRECL`=4096 @@ -251,15 +251,15 @@ OPTION_LIST='Driver=Java,level=2,version=3'; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `_id` char(24) NOT NULL `FIELD_FORMAT`='_id', - `address_building` char(10) NOT NULL `FIELD_FORMAT`='address.building', - `address_coord` double(18,16) DEFAULT NULL `FIELD_FORMAT`='address.coord.0', - `address_street` char(38) NOT NULL `FIELD_FORMAT`='address.street', - `address_zipcode` char(5) NOT NULL `FIELD_FORMAT`='address.zipcode', + `_id` char(24) NOT NULL `JPATH`='_id', + `address_building` char(10) NOT NULL `JPATH`='address.building', + `address_coord` double(18,16) DEFAULT NULL `JPATH`='address.coord.0', + `address_street` char(38) NOT NULL `JPATH`='address.street', + `address_zipcode` char(5) NOT NULL `JPATH`='address.zipcode', `borough` char(13) NOT NULL, - `grades_date` bigint(13) DEFAULT NULL `FIELD_FORMAT`='grades.0.date', - `grades_grade` char(14) DEFAULT NULL `FIELD_FORMAT`='grades.0.grade', - `grades_score` bigint(2) DEFAULT NULL `FIELD_FORMAT`='grades.0.score', + `grades_date` bigint(13) DEFAULT NULL `JPATH`='grades.0.date', + `grades_grade` char(14) DEFAULT NULL `JPATH`='grades.0.grade', + `grades_score` bigint(2) DEFAULT NULL `JPATH`='grades.0.score', `name` char(98) NOT NULL, `restaurant_id` char(8) NOT NULL ) ENGINE=CONNECT DEFAULT CHARSET=latin1 CONNECTION='mongodb://localhost:27017' `TABLE_TYPE`='JSON' `TABNAME`='restaurants' `COLIST`='{"cuisine":0}' `FILTER`='{"cuisine":"French","borough":{"$ne":"Manhattan"}}' `OPTION_LIST`='Driver=Java,level=2,version=3' `LRECL`=4096 diff --git a/storage/connect/mysql-test/connect/r/json_mongo_c.result b/storage/connect/mysql-test/connect/r/json_mongo_c.result index 550e94f286e..f9bfc01763e 100644 --- a/storage/connect/mysql-test/connect/r/json_mongo_c.result +++ b/storage/connect/mysql-test/connect/r/json_mongo_c.result @@ -20,12 +20,12 @@ SELECT * from t1; Column_Name Data_Type Type_Name Column_Size Buffer_Length Decimal_Digits Nullable Jpath _id 1 CHAR 24 24 0 0 _id address_building 1 CHAR 10 10 0 0 address.building -address_coord 1 CHAR 256 256 0 1 address.coord +address_coord 1 CHAR 1024 1024 0 1 address.coord address_street 1 CHAR 38 38 0 0 address.street address_zipcode 1 CHAR 5 5 0 0 address.zipcode borough 1 CHAR 13 13 0 0 cuisine 1 CHAR 64 64 0 0 -grades_date 1 CHAR 256 256 0 1 grades.0.date +grades_date 1 CHAR 1024 1024 0 1 grades.0.date grades_grade 1 CHAR 14 14 0 1 grades.0.grade grades_score 5 BIGINT 2 2 0 1 grades.0.score name 1 CHAR 98 98 0 0 @@ -64,16 +64,16 @@ OPTION_LIST='Level=1,Driver=C,Version=0' CONNECTION='mongodb://localhost:27017' SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `_id` char(24) NOT NULL `FIELD_FORMAT`='_id', - `address_building` char(10) NOT NULL `FIELD_FORMAT`='address.building', - `address_coord` varchar(256) DEFAULT NULL `FIELD_FORMAT`='address.coord', - `address_street` char(38) NOT NULL `FIELD_FORMAT`='address.street', - `address_zipcode` char(5) NOT NULL `FIELD_FORMAT`='address.zipcode', + `_id` char(24) NOT NULL `JPATH`='_id', + `address_building` char(10) NOT NULL `JPATH`='address.building', + `address_coord` varchar(1024) DEFAULT NULL `JPATH`='address.coord', + `address_street` char(38) NOT NULL `JPATH`='address.street', + `address_zipcode` char(5) NOT NULL `JPATH`='address.zipcode', `borough` char(13) NOT NULL, `cuisine` char(64) NOT NULL, - `grades_date` varchar(256) DEFAULT NULL `FIELD_FORMAT`='grades.0.date', - `grades_grade` char(14) DEFAULT NULL `FIELD_FORMAT`='grades.0.grade', - `grades_score` bigint(2) DEFAULT NULL `FIELD_FORMAT`='grades.0.score', + `grades_date` varchar(1024) DEFAULT NULL `JPATH`='grades.0.date', + `grades_grade` char(14) DEFAULT NULL `JPATH`='grades.0.grade', + `grades_score` bigint(2) DEFAULT NULL `JPATH`='grades.0.score', `name` char(98) NOT NULL, `restaurant_id` char(8) NOT NULL ) ENGINE=CONNECT DEFAULT CHARSET=latin1 CONNECTION='mongodb://localhost:27017' `TABLE_TYPE`='JSON' `TABNAME`='restaurants' `OPTION_LIST`='Level=1,Driver=C,Version=0' `DATA_CHARSET`='utf8' `LRECL`=1024 @@ -251,15 +251,15 @@ OPTION_LIST='Driver=C,level=2,version=0'; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `_id` char(24) NOT NULL `FIELD_FORMAT`='_id', - `address_building` char(10) NOT NULL `FIELD_FORMAT`='address.building', - `address_coord` double(23,20) DEFAULT NULL `FIELD_FORMAT`='address.coord.0', - `address_street` char(38) NOT NULL `FIELD_FORMAT`='address.street', - `address_zipcode` char(5) NOT NULL `FIELD_FORMAT`='address.zipcode', + `_id` char(24) NOT NULL `JPATH`='_id', + `address_building` char(10) NOT NULL `JPATH`='address.building', + `address_coord` double(23,20) DEFAULT NULL `JPATH`='address.coord.0', + `address_street` char(38) NOT NULL `JPATH`='address.street', + `address_zipcode` char(5) NOT NULL `JPATH`='address.zipcode', `borough` char(13) NOT NULL, - `grades_date` bigint(13) DEFAULT NULL `FIELD_FORMAT`='grades.0.date', - `grades_grade` char(14) DEFAULT NULL `FIELD_FORMAT`='grades.0.grade', - `grades_score` bigint(2) DEFAULT NULL `FIELD_FORMAT`='grades.0.score', + `grades_date` bigint(13) DEFAULT NULL `JPATH`='grades.0.date', + `grades_grade` char(14) DEFAULT NULL `JPATH`='grades.0.grade', + `grades_score` bigint(2) DEFAULT NULL `JPATH`='grades.0.score', `name` char(98) NOT NULL, `restaurant_id` char(8) NOT NULL ) ENGINE=CONNECT DEFAULT CHARSET=latin1 CONNECTION='mongodb://localhost:27017' `TABLE_TYPE`='JSON' `TABNAME`='restaurants' `COLIST`='{"projection":{"cuisine":0}}' `FILTER`='{"cuisine":"French","borough":{"$ne":"Manhattan"}}' `OPTION_LIST`='Driver=C,level=2,version=0' `LRECL`=1024 diff --git a/storage/connect/mysql-test/connect/r/updelx.result b/storage/connect/mysql-test/connect/r/updelx.result index 2aed1e06928..bb82afcc1a8 100644 --- a/storage/connect/mysql-test/connect/r/updelx.result +++ b/storage/connect/mysql-test/connect/r/updelx.result @@ -978,7 +978,7 @@ DROP TABLE t1; # FIX table CREATE TABLE t1 ( id INT(4) KEY NOT NULL, -msg VARCHAR(16) CHARSET BINARY DISTRIB=CLUSTERED) +msg VARCHAR(16) DISTRIB=CLUSTERED) ENGINE=CONNECT TABLE_TYPE=FIX BLOCK_SIZE=4; Warnings: Warning 1105 No file name. Table will use t1.fix @@ -1345,7 +1345,7 @@ DROP TABLE t1; # BIN table CREATE TABLE t1 ( id INT(4) KEY NOT NULL, -msg VARCHAR(16) CHARSET BINARY DISTRIB=CLUSTERED) +msg VARCHAR(16) DISTRIB=CLUSTERED) ENGINE=CONNECT TABLE_TYPE=BIN BLOCK_SIZE=8; Warnings: Warning 1105 No file name. Table will use t1.bin diff --git a/storage/connect/mysql-test/connect/t/updelx.test b/storage/connect/mysql-test/connect/t/updelx.test index 19d0d790a30..f6291432e48 100644 --- a/storage/connect/mysql-test/connect/t/updelx.test +++ b/storage/connect/mysql-test/connect/t/updelx.test @@ -36,7 +36,7 @@ DROP TABLE t1; --echo # FIX table CREATE TABLE t1 ( id INT(4) KEY NOT NULL, -msg VARCHAR(16) CHARSET BINARY DISTRIB=CLUSTERED) +msg VARCHAR(16) DISTRIB=CLUSTERED) ENGINE=CONNECT TABLE_TYPE=FIX BLOCK_SIZE=4; -- source updelx.inc ALTER TABLE t1 MAPPED=YES; @@ -48,7 +48,7 @@ DROP TABLE t1; --echo # BIN table CREATE TABLE t1 ( id INT(4) KEY NOT NULL, -msg VARCHAR(16) CHARSET BINARY DISTRIB=CLUSTERED) +msg VARCHAR(16) DISTRIB=CLUSTERED) ENGINE=CONNECT TABLE_TYPE=BIN BLOCK_SIZE=8; -- source updelx.inc ALTER TABLE t1 MAPPED=YES; diff --git a/storage/connect/myutil.h b/storage/connect/myutil.h index 6991172b39e..fa41fa47d61 100644 --- a/storage/connect/myutil.h +++ b/storage/connect/myutil.h @@ -6,8 +6,8 @@ enum enum_field_types PLGtoMYSQL(int type, bool dbf, char var = 0); const char *PLGtoMYSQLtype(int type, bool dbf, char var = 0); -int MYSQLtoPLG(char *typname, char *var = NULL); -int MYSQLtoPLG(int mytype, char *var = NULL); +int MYSQLtoPLG(char *typname, char *var); +int MYSQLtoPLG(int mytype, char *var); PCSZ MyDateFmt(int mytype); PCSZ MyDateFmt(char *typname); diff --git a/storage/connect/plgdbutl.cpp b/storage/connect/plgdbutl.cpp index c20c3d56c3f..bdfa3462c28 100644 --- a/storage/connect/plgdbutl.cpp +++ b/storage/connect/plgdbutl.cpp @@ -5,7 +5,7 @@ /* */ /* COPYRIGHT: */ /* ---------- */ -/* (C) Copyright to the author Olivier BERTRAND 1998-2018 */ +/* (C) Copyright to the author Olivier BERTRAND 1998-2020 */ /* */ /* WHAT THIS PROGRAM DOES: */ /* ----------------------- */ @@ -1245,7 +1245,7 @@ void *PlgDBalloc(PGLOBAL g, void *area, MBLOCK& mp) mp.Sub = mp.Size <= ((mp.Sub) ? maxsub : (maxsub >> 2)); if (trace(2)) - htrc("PlgDBalloc: in %p size=%d used=%d free=%d sub=%d\n", + htrc("PlgDBalloc: in %p size=%zd used=%zd free=%zd sub=%d\n", arp, mp.Size, pph->To_Free, pph->FreeBlk, mp.Sub); if (!mp.Sub) { @@ -1261,7 +1261,7 @@ void *PlgDBalloc(PGLOBAL g, void *area, MBLOCK& mp) mp.Memp = malloc(mp.Size); if (trace(8)) - htrc("PlgDBalloc: %s(%d) at %p\n", v, mp.Size, mp.Memp); + htrc("PlgDBalloc: %s(%zd) at %p\n", v, mp.Size, mp.Memp); if (!mp.Inlist && mp.Memp) { // New allocated block, put it in the memory block chain. @@ -1293,7 +1293,7 @@ void *PlgDBrealloc(PGLOBAL g, void *area, MBLOCK& mp, size_t newsize) #endif if (trace(2)) - htrc("PlgDBrealloc: %p size=%d sub=%d\n", mp.Memp, mp.Size, mp.Sub); + htrc("PlgDBrealloc: %p size=%zd sub=%d\n", mp.Memp, mp.Size, mp.Sub); if (newsize == mp.Size) return mp.Memp; // Nothing to do @@ -1343,7 +1343,7 @@ void *PlgDBrealloc(PGLOBAL g, void *area, MBLOCK& mp, size_t newsize) } // endif's if (trace(8)) - htrc(" newsize=%d newp=%p sub=%d\n", mp.Size, mp.Memp, mp.Sub); + htrc(" newsize=%zd newp=%p sub=%d\n", mp.Size, mp.Memp, mp.Sub); return mp.Memp; } // end of PlgDBrealloc @@ -1395,13 +1395,13 @@ void *PlgDBSubAlloc(PGLOBAL g, void *memp, size_t size) pph = (PPOOLHEADER)memp; if (trace(16)) - htrc("PlgDBSubAlloc: memp=%p size=%d used=%d free=%d\n", + htrc("PlgDBSubAlloc: memp=%p size=%zd used=%zd free=%zd\n", memp, size, pph->To_Free, pph->FreeBlk); - if ((uint)size > pph->FreeBlk) { /* Not enough memory left in pool */ + if (size > pph->FreeBlk) { /* Not enough memory left in pool */ sprintf(g->Message, - "Not enough memory in Work area for request of %d (used=%d free=%d)", - (int) size, pph->To_Free, pph->FreeBlk); + "Not enough memory in Work area for request of %zd (used=%zd free=%zd)", + size, pph->To_Free, pph->FreeBlk); if (trace(1)) htrc("%s\n", g->Message); @@ -1417,7 +1417,7 @@ void *PlgDBSubAlloc(PGLOBAL g, void *memp, size_t size) pph->FreeBlk -= size; // New size of pool free block if (trace(16)) - htrc("Done memp=%p used=%d free=%d\n", + htrc("Done memp=%p used=%zd free=%zd\n", memp, pph->To_Free, pph->FreeBlk); return (memp); diff --git a/storage/connect/plugutil.cpp b/storage/connect/plugutil.cpp index 3899379ade2..e45feb31bea 100644 --- a/storage/connect/plugutil.cpp +++ b/storage/connect/plugutil.cpp @@ -6,7 +6,7 @@ /* */ /* COPYRIGHT: */ /* ---------- */ -/* (C) Copyright to the author Olivier BERTRAND 1993-2019 */ +/* (C) Copyright to the author Olivier BERTRAND 1993-2020 */ /* */ /* WHAT THIS PROGRAM DOES: */ /* ----------------------- */ @@ -142,7 +142,7 @@ void htrc(char const* fmt, ...) /* Language points on initial language name and eventual path. */ /* Return value is the pointer to the Global structure. */ /***********************************************************************/ -PGLOBAL PlugInit(LPCSTR Language, uint worksize) +PGLOBAL PlugInit(LPCSTR Language, size_t worksize) { PGLOBAL g; @@ -158,13 +158,14 @@ PGLOBAL PlugInit(LPCSTR Language, uint worksize) } // end try/catch g->Sarea = NULL; - g->Createas = 0; + g->Createas = false; g->Alchecked = 0; g->Mrr = 0; g->Activityp = NULL; g->Xchk = NULL; g->N = 0; g->More = 0; + g->Saved_Size = 0; strcpy(g->Message, ""); /*******************************************************************/ @@ -459,7 +460,7 @@ short GetLineLength(PGLOBAL g) /***********************************************************************/ /* Program for memory allocation of work and language areas. */ /***********************************************************************/ -bool AllocSarea(PGLOBAL g, uint size) +bool AllocSarea(PGLOBAL g, size_t size) { /*********************************************************************/ /* This is the allocation routine for the WIN32/UNIX/AIX version. */ @@ -483,7 +484,7 @@ bool AllocSarea(PGLOBAL g, uint size) if (trace(8)) { #endif if (g->Sarea) - htrc("Work area of %u allocated at %p\n", size, g->Sarea); + htrc("Work area of %zd allocated at %p\n", size, g->Sarea); else htrc("SareaAlloc: %-.256s\n", g->Message); @@ -510,7 +511,7 @@ void FreeSarea(PGLOBAL g) #else if (trace(8)) #endif - htrc("Freeing Sarea at %p size = %d\n", g->Sarea, g->Sarea_Size); + htrc("Freeing Sarea at %p size = %zd\n", g->Sarea, g->Sarea_Size); g->Sarea = NULL; g->Sarea_Size = 0; @@ -524,11 +525,11 @@ void FreeSarea(PGLOBAL g) /* Here there should be some verification done such as validity of */ /* the address and size not larger than memory size. */ /***********************************************************************/ -BOOL PlugSubSet(void *memp, uint size) +BOOL PlugSubSet(void *memp, size_t size) { PPOOLHEADER pph = (PPOOLHEADER)memp; - pph->To_Free = (OFFSET)sizeof(POOLHEADER); + pph->To_Free = (size_t)sizeof(POOLHEADER); pph->FreeBlk = size - pph->To_Free; return FALSE; } /* end of PlugSubSet */ @@ -560,15 +561,15 @@ void *PlugSubAlloc(PGLOBAL g, void *memp, size_t size) pph = (PPOOLHEADER)memp; if (trace(16)) - htrc("SubAlloc in %p size=%d used=%d free=%d\n", + htrc("SubAlloc in %p size=%zd used=%zd free=%zd\n", memp, size, pph->To_Free, pph->FreeBlk); - if ((uint)size > pph->FreeBlk) { /* Not enough memory left in pool */ + if (size > pph->FreeBlk) { /* Not enough memory left in pool */ PCSZ pname = "Work"; sprintf(g->Message, - "Not enough memory in %-.256s area for request of %u (used=%d free=%d)", - pname, (uint)size, pph->To_Free, pph->FreeBlk); + "Not enough memory in %-.256s area for request of %zu (used=%zu free=%zu)", + pname, size, pph->To_Free, pph->FreeBlk); if (trace(1)) htrc("PlugSubAlloc: %-.256s\n", g->Message); @@ -580,11 +581,11 @@ void *PlugSubAlloc(PGLOBAL g, void *memp, size_t size) /* Do the suballocation the simplest way. */ /*********************************************************************/ memp = MakePtr(memp, pph->To_Free); /* Points to suballocated block */ - pph->To_Free += (OFFSET)size; /* New offset of pool free block */ - pph->FreeBlk -= (uint)size; /* New size of pool free block */ + pph->To_Free += size; /* New offset of pool free block */ + pph->FreeBlk -= size; /* New size of pool free block */ if (trace(16)) - htrc("Done memp=%p used=%d free=%d\n", + htrc("Done memp=%p used=%zd free=%zd\n", memp, pph->To_Free, pph->FreeBlk); return (memp); @@ -605,40 +606,4 @@ char *PlugDup(PGLOBAL g, const char *str) } // end of PlugDup -#if 0 -/***********************************************************************/ -/* This routine suballocate a copy of the passed string. */ -/***********************************************************************/ -char *PlugDup(PGLOBAL g, const char *str) - { - char *buf; - size_t len; - - if (str && (len = strlen(str))) { - buf = (char*)PlugSubAlloc(g, NULL, len + 1); - strcpy(buf, str); - } else - buf = NULL; - - return(buf); - } /* end of PlugDup */ -#endif // 0 - -/***********************************************************************/ -/* This routine makes a pointer from an offset to a memory pointer. */ -/***********************************************************************/ -void *MakePtr(void *memp, OFFSET offset) - { - return ((offset == 0) ? NULL : &((char *)memp)[offset]); - } /* end of MakePtr */ - -/***********************************************************************/ -/* This routine makes an offset from a pointer new format. */ -/***********************************************************************/ -#if 0 -OFFSET MakeOff(void *memp, void *ptr) - { - return ((!ptr) ? 0 : (OFFSET)((char *)ptr - (char *)memp)); - } /* end of MakeOff */ -#endif /*--------------------- End of PLUGUTIL program -----------------------*/ diff --git a/storage/connect/tabjson.cpp b/storage/connect/tabjson.cpp index 692ca9d0258..dbcd590c3de 100644 --- a/storage/connect/tabjson.cpp +++ b/storage/connect/tabjson.cpp @@ -52,19 +52,10 @@ /* External functions. */ /***********************************************************************/ USETEMP UseTemp(void); +bool JsonAllPath(void); +int GetDefaultDepth(void); char *GetJsonNull(void); -//typedef struct _jncol { -// struct _jncol *Next; -// char *Name; -// char *Fmt; -// int Type; -// int Len; -// int Scale; -// bool Cbn; -// bool Found; -//} JCOL, *PJCL; - /***********************************************************************/ /* JSONColumns: construct the result blocks containing the description */ /* of all the columns of a table contained inside a JSON file. */ @@ -167,23 +158,20 @@ JSONDISC::JSONDISC(PGLOBAL g, uint *lg) jsp = NULL; row = NULL; sep = NULL; - i = n = bf = ncol = lvl = 0; - all = false; + i = n = bf = ncol = lvl = sz = 0; + all = strfy = false; } // end of JSONDISC constructor int JSONDISC::GetColumns(PGLOBAL g, PCSZ db, PCSZ dsn, PTOS topt) { char filename[_MAX_PATH]; bool mgo = (GetTypeID(topt->type) == TAB_MONGO); - PCSZ level = GetStringTableOption(g, topt, "Level", NULL); - - if (level) { - lvl = atoi(level); - lvl = (lvl > 16) ? 16 : lvl; - } else - lvl = 0; - sep = GetStringTableOption(g, topt, "Separator", "."); + lvl = GetIntegerTableOption(g, topt, "Level", GetDefaultDepth()); + lvl = GetIntegerTableOption(g, topt, "Depth", lvl); + sep = GetStringTableOption(g, topt, "Separator", "."); + sz = GetIntegerTableOption(g, topt, "Jsize", 1024); + strfy = GetBooleanTableOption(g, topt, "Stringify", false); /*********************************************************************/ /* Open the input file. */ @@ -306,7 +294,7 @@ int JSONDISC::GetColumns(PGLOBAL g, PCSZ db, PCSZ dsn, PTOS topt) // Allocate the parse work memory PGLOBAL G = (PGLOBAL)PlugSubAlloc(g, NULL, sizeof(GLOBAL)); memset(G, 0, sizeof(GLOBAL)); - G->Sarea_Size = tdp->Lrecl * 10; + G->Sarea_Size = (size_t)tdp->Lrecl * 10; G->Sarea = PlugSubAlloc(g, NULL, G->Sarea_Size); PlugSubSet(G->Sarea, G->Sarea_Size); G->jump_level = 0; @@ -403,7 +391,10 @@ bool JSONDISC::Find(PGLOBAL g, PJVAL jvp, PCSZ key, int j) PJAR jar; if ((valp = jvp ? jvp->GetValue() : NULL)) { - jcol.Type = valp->GetType(); + if (JsonAllPath() && !fmt[bf]) + strcat(fmt, colname); + + jcol.Type = valp->GetType(); jcol.Len = valp->GetValLen(); jcol.Scale = valp->GetValPrec(); jcol.Cbn = valp->IsNull(); @@ -482,8 +473,16 @@ bool JSONDISC::Find(PGLOBAL g, PJVAL jvp, PCSZ key, int j) } // endswitch Type } else if (lvl >= 0) { - jcol.Type = TYPE_STRING; - jcol.Len = 256; + if (strfy) { + if (!fmt[bf]) + strcat(fmt, colname); + + strcat(fmt, ".*"); + } else if (JsonAllPath() && !fmt[bf]) + strcat(fmt, colname); + + jcol.Type = TYPE_STRING; + jcol.Len = sz; jcol.Scale = 0; jcol.Cbn = true; } else @@ -1489,7 +1488,18 @@ PVAL JSONCOL::MakeJson(PGLOBAL g, PJSON jsp) if (Value->IsTypeNum()) { strcpy(g->Message, "Cannot make Json for a numeric column"); Value->Reset(); - } else + } else if (Value->GetType() == TYPE_BIN) { + if ((unsigned)Value->GetClen() >= sizeof(BSON)) { + ulong len = Tjp->Lrecl ? Tjp->Lrecl : 500; + PBSON bsp = JbinAlloc(g, NULL, len, jsp); + + strcat(bsp->Msg, " column"); + ((BINVAL*)Value)->SetBinValue(bsp, sizeof(BSON)); + } else { + strcpy(g->Message, "Column size too small"); + Value->SetValue_char(NULL, 0); + } // endif Clen + } else Value->SetValue_psz(Serialize(g, jsp, NULL, 0)); return Value; @@ -1985,8 +1995,9 @@ int TDBJSON::MakeNewDoc(PGLOBAL g) /***********************************************************************/ int TDBJSON::MakeDocument(PGLOBAL g) { - char *p, *memory, *objpath, *key = NULL; + char *p, *p1, *p2, *memory, *objpath, *key = NULL; int len, i = 0; + my_bool a; MODE mode = Mode; PJSON jsp; PJOB objp = NULL; @@ -2029,22 +2040,39 @@ int TDBJSON::MakeDocument(PGLOBAL g) if ((objpath = PlugDup(g, Objname))) { if (*objpath == '$') objpath++; if (*objpath == '.') objpath++; + p1 = (*objpath == '[') ? objpath++ : NULL; /*********************************************************************/ /* Find the table in the tree structure. */ /*********************************************************************/ - for (; jsp && objpath; objpath = p) { - if ((p = strchr(objpath, Sep))) - *p++ = 0; - - if (*objpath != '[' && !IsNum(objpath)) { - // objpass is a key + for (p = objpath; jsp && p; p = (p2 ? p2 : NULL)) { + a = (p1 != NULL); + p1 = strchr(p, '['); + p2 = strchr(p, '.'); + + if (!p2) + p2 = p1; + else if (p1) { + if (p1 < p2) + p2 = p1; + else if (p1 == p2 + 1) + *p2++ = 0; // Old syntax .[ + else + p1 = NULL; + + } // endif p1 + + if (p2) + *p2++ = 0; + + if (!a && *p && *p != '[' && !IsNum(p)) { + // obj is a key if (jsp->GetType() != TYPE_JOB) { strcpy(g->Message, "Table path does not match the json file"); return RC_FX; } // endif Type - key = objpath; + key = p; objp = jsp->GetObject(); arp = NULL; val = objp->GetValue(key); @@ -2055,15 +2083,15 @@ int TDBJSON::MakeDocument(PGLOBAL g) } // endif val } else { - if (*objpath == '[') { + if (*p == '[') { // Old style - if (objpath[strlen(objpath) - 1] != ']') { - sprintf(g->Message, "Invalid Table path %s", Objname); + if (p[strlen(p) - 1] != ']') { + sprintf(g->Message, "Invalid Table path near %s", p); return RC_FX; } else - objpath++; + p++; - } // endif objpath + } // endif p if (jsp->GetType() != TYPE_JAR) { strcpy(g->Message, "Table path does not match the json file"); @@ -2072,7 +2100,7 @@ int TDBJSON::MakeDocument(PGLOBAL g) arp = jsp->GetArray(); objp = NULL; - i = atoi(objpath) - B; + i = atoi(p) - B; val = arp->GetValue(i); if (!val) { @@ -2083,7 +2111,7 @@ int TDBJSON::MakeDocument(PGLOBAL g) } // endif jsp = val->GetJson(); - } // endfor objpath + } // endfor p } // endif objpath diff --git a/storage/connect/tabjson.h b/storage/connect/tabjson.h index 8c3f1013919..88aa5e2ee8b 100644 --- a/storage/connect/tabjson.h +++ b/storage/connect/tabjson.h @@ -68,8 +68,8 @@ public: PCSZ sep; char colname[65], fmt[129], buf[16]; uint *length; - int i, n, bf, ncol, lvl; - bool all; + int i, n, bf, ncol, lvl, sz; + bool all, strfy; }; // end of JSONDISC /***********************************************************************/ diff --git a/storage/connect/tabrest.cpp b/storage/connect/tabrest.cpp index 3ef2a460b9d..b1bdeffc880 100644 --- a/storage/connect/tabrest.cpp +++ b/storage/connect/tabrest.cpp @@ -158,16 +158,32 @@ PQRYRES __stdcall ColREST(PGLOBAL g, PTOS tp, char *tab, char *db, bool info) http = GetStringTableOption(g, tp, "Http", NULL); uri = GetStringTableOption(g, tp, "Uri", NULL); - fn = GetStringTableOption(g, tp, "Filename", "rest.json"); #if defined(MARIADB) ftype = GetStringTableOption(g, tp, "Type", "JSON"); #else // !MARIADB // OEM tables must specify the file type ftype = GetStringTableOption(g, tp, "Ftype", "JSON"); #endif // !MARIADB + fn = GetStringTableOption(g, tp, "Filename", NULL); + + if (!fn) { + int n, m = strlen(ftype) + 1; + + strcat(strcpy(filename, tab), "."); + n = strlen(filename); + + // Fold ftype to lower case + for (int i = 0; i < m; i++) + filename[n + i] = tolower(ftype[i]); + + fn = filename; + tp->filename = PlugDup(g, fn); + } // endif fn // We used the file name relative to recorded datapath - snprintf(filename, sizeof filename, IF_WIN(".\\%s\\%s","./%s/%s"), db, fn); + PlugSetPath(filename, fn, db); + //strcat(strcat(strcat(strcpy(filename, "."), slash), db), slash); + //strncat(filename, fn, _MAX_PATH - strlen(filename)); // Retrieve the file from the web and copy it locally if (http && grf(g->Message, trace(515), http, uri, filename)) { @@ -226,12 +242,10 @@ bool RESTDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff) Http = GetStringCatInfo(g, "Http", NULL); Uri = GetStringCatInfo(g, "Uri", NULL); - Fn = GetStringCatInfo(g, "Filename", "rest.json"); + Fn = GetStringCatInfo(g, "Filename", NULL); // We used the file name relative to recorded datapath - //PlugSetPath(filename, Fn, GetPath()); - strcpy(filename, GetPath()); - strncat(filename, Fn, _MAX_PATH - strlen(filename)); + PlugSetPath(filename, Fn, GetPath()); // Retrieve the file from the web and copy it locally rc = grf(g->Message, xt, Http, Uri, filename); @@ -269,7 +283,7 @@ PTDB RESTDEF::GetTable(PGLOBAL g, MODE m) if (trace(515)) htrc("REST GetTable mode=%d\n", m); - if (m != MODE_READ && m != MODE_READX) { + if (m != MODE_READ && m != MODE_READX && m != MODE_ANY) { strcpy(g->Message, "REST tables are currently read only"); return NULL; } // endif m diff --git a/storage/connect/tabxml.cpp b/storage/connect/tabxml.cpp index b6260eb66ee..81c19ff1a4f 100644 --- a/storage/connect/tabxml.cpp +++ b/storage/connect/tabxml.cpp @@ -3,7 +3,7 @@ /* ------------- */ /* Version 3.0 */ /* */ -/* Author Olivier BERTRAND 2007 - 2017 */ +/* Author Olivier BERTRAND 2007 - 2020 */ /* */ /* This program are the XML tables classes using MS-DOM or libxml2. */ /***********************************************************************/ @@ -62,6 +62,8 @@ extern "C" char version[]; #define TYPE_UNKNOWN 12 /* Must be greater than other types */ #define XLEN(M) sizeof(M) - strlen(M) - 1 /* To avoid overflow*/ +int GetDefaultDepth(void); + /***********************************************************************/ /* Class and structure used by XMLColumns. */ /***********************************************************************/ @@ -149,8 +151,9 @@ PQRYRES XMLColumns(PGLOBAL g, char *db, char *tab, PTOS topt, bool info) strcpy(g->Message, MSG(MISSING_FNAME)); return NULL; } else { - lvl = GetIntegerTableOption(g, topt, "Level", 0); - lvl = (lvl < 0) ? 0 : (lvl > 16) ? 16 : lvl; + lvl = GetIntegerTableOption(g, topt, "Level", GetDefaultDepth()); + lvl = GetIntegerTableOption(g, topt, "Depth", lvl); + lvl = (lvl < 0) ? 0 : (lvl > 16) ? 16 : lvl; } // endif fn if (trace(1)) diff --git a/storage/connect/user_connect.cc b/storage/connect/user_connect.cc index 8abd33079d6..a7e6b53b8ce 100644 --- a/storage/connect/user_connect.cc +++ b/storage/connect/user_connect.cc @@ -28,7 +28,7 @@ */ /****************************************************************************/ -/* Author: Olivier Bertrand -- bertrandop@gmail.com -- 2004-2015 */ +/* Author: Olivier Bertrand -- bertrandop@gmail.com -- 2004-2020 */ /****************************************************************************/ #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation @@ -58,8 +58,8 @@ PCONNECT user_connect::to_users= NULL; /****************************************************************************/ /* Get the work_size SESSION variable value . */ /****************************************************************************/ -uint GetWorkSize(void); -void SetWorkSize(uint); +size_t GetWorkSize(void); +void SetWorkSize(size_t); /* -------------------------- class user_connect -------------------------- */ @@ -97,14 +97,14 @@ user_connect::~user_connect() bool user_connect::user_init() { // Initialize Plug-like environment - uint worksize= GetWorkSize(); + size_t worksize= GetWorkSize(); PACTIVITY ap= NULL; PDBUSER dup= NULL; // Areasize= 64M because of VEC tables. Should be parameterisable //g= PlugInit(NULL, 67108864); //g= PlugInit(NULL, 134217728); // 128M was because of old embedded tests - g= PlugInit(NULL, worksize); + g= PlugInit(NULL, (size_t)worksize); // Check whether the initialization is complete if (!g || !g->Sarea || PlugSubSet(g->Sarea, g->Sarea_Size) @@ -157,16 +157,17 @@ void user_connect::SetHandler(ha_connect *hc) bool user_connect::CheckCleanup(bool force) { if (thdp->query_id > last_query_id || force) { - uint worksize= GetWorkSize(), size = g->Sarea_Size; + size_t worksize = GetWorkSize(); PlugCleanup(g, true); - if (size != worksize) { + if (worksize != g->Sarea_Size) { FreeSarea(g); + g->Saved_Size = g->Sarea_Size; // Check whether the work area could be allocated if (AllocSarea(g, worksize)) { - AllocSarea(g, size); + AllocSarea(g, g->Saved_Size); SetWorkSize(g->Sarea_Size); // Was too big } // endif sarea @@ -174,10 +175,11 @@ bool user_connect::CheckCleanup(bool force) PlugSubSet(g->Sarea, g->Sarea_Size); g->Xchk = NULL; - g->Createas = 0; + g->Createas = false; g->Alchecked = 0; g->Mrr = 0; g->More = 0; + g->Saved_Size = 0; last_query_id= thdp->query_id; if (trace(65) && !force) diff --git a/storage/connect/value.cpp b/storage/connect/value.cpp index 2fad67f453b..5951b26e81e 100644 --- a/storage/connect/value.cpp +++ b/storage/connect/value.cpp @@ -2251,6 +2251,15 @@ void BINVAL::SetBinValue(void *p) } // end of SetBinValue /***********************************************************************/ +/* BINVAL SetBinValue: fill string with len bytes. */ +/***********************************************************************/ +void BINVAL::SetBinValue(void* p, ulong len) +{ + memcpy(Binp, p, len); + Len = len; +} // end of SetBinValue + +/***********************************************************************/ /* GetBinValue: fill a buffer with the internal binary value. */ /* This function checks whether the buffer length is enough and */ /* returns true if not. Actual filling occurs only if go is true. */ diff --git a/storage/connect/value.h b/storage/connect/value.h index 4f7d9a440fa..ee7a1c8032f 100644 --- a/storage/connect/value.h +++ b/storage/connect/value.h @@ -115,8 +115,8 @@ class DllExport VALUE : public BLOCK { virtual void SetValue(ulonglong) {assert(false);} virtual void SetValue(double) {assert(false);} virtual void SetValue_pvblk(PVBLK blk, int n) = 0; - virtual void SetBinValue(void *p) = 0; - virtual bool GetBinValue(void *buf, int buflen, bool go) = 0; + virtual void SetBinValue(void* p) = 0; + virtual bool GetBinValue(void *buf, int buflen, bool go) = 0; virtual int ShowValue(char *buf, int len) = 0; virtual char *GetCharString(char *p) = 0; virtual bool IsEqual(PVAL vp, bool chktype) = 0; @@ -385,7 +385,8 @@ class DllExport BINVAL: public VALUE { virtual void SetValue(ulonglong n); virtual void SetValue(double f); virtual void SetBinValue(void *p); - virtual bool GetBinValue(void *buf, int buflen, bool go); + virtual void SetBinValue(void* p, ulong len); + virtual bool GetBinValue(void *buf, int buflen, bool go); virtual int CompareValue(PVAL) {assert(false); return 0;} virtual int ShowValue(char *buf, int len); virtual char *GetCharString(char *p); diff --git a/storage/heap/ha_heap.cc b/storage/heap/ha_heap.cc index 895b6edfcf2..f8c2e72ba4a 100644 --- a/storage/heap/ha_heap.cc +++ b/storage/heap/ha_heap.cc @@ -26,12 +26,8 @@ #include "ha_heap.h" #include "sql_base.h" -static handler *heap_create_handler(handlerton *hton, - TABLE_SHARE *table, - MEM_ROOT *mem_root); -static int -heap_prepare_hp_create_info(TABLE *table_arg, bool internal_table, - HP_CREATE_INFO *hp_create_info); +static handler *heap_create_handler(handlerton *, TABLE_SHARE *, MEM_ROOT *); +static int heap_prepare_hp_create_info(TABLE *, bool, HP_CREATE_INFO *); static int heap_panic(handlerton *hton, ha_panic_function flag) @@ -371,8 +367,8 @@ int ha_heap::info(uint flag) { HEAPINFO hp_info; - if (!table) - return 1; + if (!file) + return 0; (void) heap_info(file,&hp_info,flag); @@ -606,16 +602,15 @@ ha_rows ha_heap::records_in_range(uint inx, const key_range *min_key, } -static int -heap_prepare_hp_create_info(TABLE *table_arg, bool internal_table, - HP_CREATE_INFO *hp_create_info) +static int heap_prepare_hp_create_info(TABLE *table_arg, bool internal_table, + HP_CREATE_INFO *hp_create_info) { - uint key, parts, mem_per_row= 0, keys= table_arg->s->keys; + TABLE_SHARE *share= table_arg->s; + uint key, parts, mem_per_row= 0, keys= share->keys; uint auto_key= 0, auto_key_type= 0; ha_rows max_rows; HP_KEYDEF *keydef; HA_KEYSEG *seg; - TABLE_SHARE *share= table_arg->s; bool found_real_auto_increment= 0; bzero(hp_create_info, sizeof(*hp_create_info)); @@ -623,12 +618,12 @@ heap_prepare_hp_create_info(TABLE *table_arg, bool internal_table, for (key= parts= 0; key < keys; key++) parts+= table_arg->key_info[key].user_defined_key_parts; - if (!(keydef= (HP_KEYDEF*) my_malloc(hp_key_memory_HP_KEYDEF, - keys * sizeof(HP_KEYDEF) + - parts * sizeof(HA_KEYSEG), - MYF(MY_WME | MY_THREAD_SPECIFIC)))) + if (!my_multi_malloc(hp_key_memory_HP_KEYDEF, + MYF(MY_WME | MY_THREAD_SPECIFIC), + &keydef, keys * sizeof(HP_KEYDEF), + &seg, parts * sizeof(HA_KEYSEG), + NULL)) return my_errno; - seg= reinterpret_cast<HA_KEYSEG*>(keydef + keys); for (key= 0; key < keys; key++) { KEY *pos= table_arg->key_info+key; diff --git a/storage/innobase/CMakeLists.txt b/storage/innobase/CMakeLists.txt index 10f183790a7..b7e7fb93bf3 100644 --- a/storage/innobase/CMakeLists.txt +++ b/storage/innobase/CMakeLists.txt @@ -29,6 +29,7 @@ SET(INNOBASE_SOURCES btr/btr0pcur.cc btr/btr0sea.cc btr/btr0defragment.cc + buf/buf0block_hint.cc buf/buf0buddy.cc buf/buf0buf.cc buf/buf0dblwr.cc diff --git a/storage/innobase/btr/btr0btr.cc b/storage/innobase/btr/btr0btr.cc index e7e70f76790..b2de0ad33b2 100644 --- a/storage/innobase/btr/btr0btr.cc +++ b/storage/innobase/btr/btr0btr.cc @@ -280,7 +280,7 @@ the index. ulint btr_height_get( /*===========*/ - dict_index_t* index, /*!< in: index tree */ + const dict_index_t* index, /*!< in: index tree */ mtr_t* mtr) /*!< in/out: mini-transaction */ { ulint height=0; @@ -582,7 +582,7 @@ Gets the number of pages in a B-tree. ulint btr_get_size( /*=========*/ - dict_index_t* index, /*!< in: index */ + const dict_index_t* index, /*!< in: index */ ulint flag, /*!< in: BTR_N_LEAF_PAGES or BTR_TOTAL_SIZE */ mtr_t* mtr) /*!< in/out: mini-transaction where index is s-latched */ diff --git a/storage/innobase/btr/btr0bulk.cc b/storage/innobase/btr/btr0bulk.cc index ee1bc20e1c9..6e8b88172e8 100644 --- a/storage/innobase/btr/btr0bulk.cc +++ b/storage/innobase/btr/btr0bulk.cc @@ -849,6 +849,8 @@ PageBulk::latch() m_mtr.start(); m_index->set_modified(m_mtr); + ut_ad(m_block->page.buf_fix_count()); + /* In case the block is S-latched by page_cleaner. */ if (!buf_page_optimistic_get(RW_X_LATCH, m_block, m_modify_clock, __FILE__, __LINE__, &m_mtr)) { @@ -867,6 +869,8 @@ PageBulk::latch() buf_block_buf_fix_dec(m_block); + ut_ad(m_block->page.buf_fix_count()); + ut_ad(m_cur_rec > m_page && m_cur_rec < m_heap_top); return (m_err); diff --git a/storage/innobase/btr/btr0cur.cc b/storage/innobase/btr/btr0cur.cc index fdb56e34d7e..846d8ecfd7e 100644 --- a/storage/innobase/btr/btr0cur.cc +++ b/storage/innobase/btr/btr0cur.cc @@ -770,6 +770,9 @@ btr_cur_optimistic_latch_leaves( unsigned line, mtr_t* mtr) { + ut_ad(block->page.buf_fix_count()); + ut_ad(block->page.state() == BUF_BLOCK_FILE_PAGE); + switch (*latch_mode) { default: ut_error; @@ -780,16 +783,10 @@ btr_cur_optimistic_latch_leaves( modify_clock, file, line, mtr)); case BTR_SEARCH_PREV: case BTR_MODIFY_PREV: - if (block->page.state() != BUF_BLOCK_FILE_PAGE) { - return(false); - } - /* pin the block not to be relocated */ - buf_block_buf_fix_inc(block, file, line); - rw_lock_s_lock(&block->lock); if (block->modify_clock != modify_clock) { rw_lock_s_unlock(&block->lock); - break; + return false; } const uint32_t curr_page_no = block->page.id().page_no(); const uint32_t left_page_no = btr_page_get_prev(block->frame); @@ -816,7 +813,7 @@ btr_cur_optimistic_latch_leaves( /* release the left block */ btr_leaf_page_release( cursor->left_block, mode, mtr); - break; + return false; } } else { cursor->left_block = NULL; @@ -825,15 +822,22 @@ btr_cur_optimistic_latch_leaves( if (buf_page_optimistic_get(mode, block, modify_clock, file, line, mtr)) { if (btr_page_get_prev(block->frame) == left_page_no) { - buf_block_buf_fix_dec(block); + /* block was already buffer-fixed while + entering the function and + buf_page_optimistic_get() buffer-fixes + it again. */ + ut_ad(2 <= block->page.buf_fix_count()); *latch_mode = mode; return(true); } else { - /* release the block */ + /* release the block and decrement of + buf_fix_count which was incremented + in buf_page_optimistic_get() */ btr_leaf_page_release(block, mode, mtr); } } + ut_ad(block->page.buf_fix_count()); /* release the left block */ if (cursor->left_block != NULL) { btr_leaf_page_release(cursor->left_block, @@ -841,8 +845,6 @@ btr_cur_optimistic_latch_leaves( } } - /* unpin the block */ - buf_block_buf_fix_dec(block); return false; } @@ -1397,12 +1399,7 @@ btr_cur_search_to_nth_level_func( guess = NULL; #else info = btr_search_get_info(index); - - if (!buf_pool.is_obsolete(info->withdraw_clock)) { - guess = info->root_guess; - } else { - guess = NULL; - } + guess = info->root_guess; #ifdef BTR_CUR_HASH_ADAPT @@ -1836,10 +1833,7 @@ retry_page_get: } #ifdef BTR_CUR_ADAPT - if (block != guess) { - info->root_guess = block; - info->withdraw_clock = buf_pool.withdraw_clock(); - } + info->root_guess = block; #endif } @@ -6561,21 +6555,19 @@ btr_record_not_null_field_in_rec( } } -/*******************************************************************//** -Estimates the number of different key values in a given index, for +/** Estimates the number of different key values in a given index, for each n-column prefix of the index where 1 <= n <= dict_index_get_n_unique(index). The estimates are stored in the array index->stat_n_diff_key_vals[] (indexed 0..n_uniq-1) and the number of pages that were sampled is saved in -index->stat_n_sample_sizes[]. +result.n_sample_sizes[]. If innodb_stats_method is nulls_ignored, we also record the number of non-null values for each prefix and stored the estimates in -array index->stat_n_non_null_key_vals. -@return true if the index is available and we get the estimated numbers, -false if the index is unavailable. */ -bool -btr_estimate_number_of_different_key_vals( -/*======================================*/ - dict_index_t* index) /*!< in: index */ +array result.n_non_null_key_vals. +@param[in] index index +@return vector with statistics information +empty vector if the index is unavailable. */ +std::vector<index_field_stats_t> +btr_estimate_number_of_different_key_vals(dict_index_t* index) { btr_cur_t cursor; page_t* page; @@ -6595,11 +6587,11 @@ btr_estimate_number_of_different_key_vals( rec_offs* offsets_rec = NULL; rec_offs* offsets_next_rec = NULL; + std::vector<index_field_stats_t> result; + /* For spatial index, there is no such stats can be fetched. */ - if (dict_index_is_spatial(index)) { - return(false); - } + ut_ad(!dict_index_is_spatial(index)); n_cols = dict_index_get_n_unique(index); @@ -6709,7 +6701,7 @@ btr_estimate_number_of_different_key_vals( mtr_commit(&mtr); mem_heap_free(heap); - return(false); + return result; } /* Count the number of different key values for each prefix of @@ -6815,8 +6807,12 @@ exit_loop: also the pages used for external storage of fields (those pages are included in index->stat_n_leaf_pages) */ + result.reserve(n_cols); + for (j = 0; j < n_cols; j++) { - index->stat_n_diff_key_vals[j] + index_field_stats_t stat; + + stat.n_diff_key_vals = BTR_TABLE_STATS_FROM_SAMPLE( n_diff[j], index, n_sample_pages, total_external_size, not_empty_flag); @@ -6837,25 +6833,23 @@ exit_loop: add_on = n_sample_pages; } - index->stat_n_diff_key_vals[j] += add_on; + stat.n_diff_key_vals += add_on; - index->stat_n_sample_sizes[j] = n_sample_pages; + stat.n_sample_sizes = n_sample_pages; - /* Update the stat_n_non_null_key_vals[] with our - sampled result. stat_n_non_null_key_vals[] is created - and initialized to zero in dict_index_add_to_cache(), - along with stat_n_diff_key_vals[] array */ if (n_not_null != NULL) { - index->stat_n_non_null_key_vals[j] = + stat.n_non_null_key_vals = BTR_TABLE_STATS_FROM_SAMPLE( n_not_null[j], index, n_sample_pages, total_external_size, not_empty_flag); } + + result.push_back(stat); } mem_heap_free(heap); - return(true); + return result; } /*================== EXTERNAL STORAGE OF BIG FIELDS ===================*/ diff --git a/storage/innobase/btr/btr0pcur.cc b/storage/innobase/btr/btr0pcur.cc index cc8c11c42e1..ad254976973 100644 --- a/storage/innobase/btr/btr0pcur.cc +++ b/storage/innobase/btr/btr0pcur.cc @@ -202,11 +202,10 @@ before_first: cursor->old_n_fields, &cursor->old_rec_buf, &cursor->buf_size); - cursor->block_when_stored = block; + cursor->block_when_stored.store(block); /* Function try to check if block is S/X latch. */ cursor->modify_clock = buf_block_get_modify_clock(block); - cursor->withdraw_clock = buf_pool.withdraw_clock(); } /**************************************************************//** @@ -236,6 +235,26 @@ btr_pcur_copy_stored_position( pcur_receive->old_n_fields = pcur_donate->old_n_fields; } +/** Structure acts as functor to do the latching of leaf pages. +It returns true if latching of leaf pages succeeded and false +otherwise. */ +struct optimistic_latch_leaves +{ + btr_pcur_t *const cursor; + ulint *latch_mode; + mtr_t *const mtr; + + optimistic_latch_leaves(btr_pcur_t *cursor, ulint *latch_mode, mtr_t *mtr) + :cursor(cursor), latch_mode(latch_mode), mtr(mtr) {} + + bool operator() (buf_block_t *hint) const + { + return hint && btr_cur_optimistic_latch_leaves( + hint, cursor->modify_clock, latch_mode, + btr_pcur_get_btr_cur(cursor), __FILE__, __LINE__, mtr); + } +}; + /**************************************************************//** Restores the stored position of a persistent cursor bufferfixing the page and obtaining the specified latches. If the cursor position was saved when the @@ -298,7 +317,7 @@ btr_pcur_restore_position_func( cursor->latch_mode = BTR_LATCH_MODE_WITHOUT_INTENTION(latch_mode); cursor->pos_state = BTR_PCUR_IS_POSITIONED; - cursor->block_when_stored = btr_pcur_get_block(cursor); + cursor->block_when_stored.clear(); return(FALSE); } @@ -313,12 +332,9 @@ btr_pcur_restore_position_func( case BTR_MODIFY_PREV: /* Try optimistic restoration. */ - if (!buf_pool.is_obsolete(cursor->withdraw_clock) - && btr_cur_optimistic_latch_leaves( - cursor->block_when_stored, cursor->modify_clock, - &latch_mode, btr_pcur_get_btr_cur(cursor), - file, line, mtr)) { - + if (cursor->block_when_stored.run_with_hint( + optimistic_latch_leaves(cursor, &latch_mode, + mtr))) { cursor->pos_state = BTR_PCUR_IS_POSITIONED; cursor->latch_mode = latch_mode; @@ -416,11 +432,10 @@ btr_pcur_restore_position_func( since the cursor can now be on a different page! But we can retain the value of old_rec */ - cursor->block_when_stored = btr_pcur_get_block(cursor); + cursor->block_when_stored.store(btr_pcur_get_block(cursor)); cursor->modify_clock = buf_block_get_modify_clock( - cursor->block_when_stored); + cursor->block_when_stored.block()); cursor->old_stored = true; - cursor->withdraw_clock = buf_pool.withdraw_clock(); mem_heap_free(heap); diff --git a/storage/innobase/buf/buf0block_hint.cc b/storage/innobase/buf/buf0block_hint.cc new file mode 100644 index 00000000000..4d699004476 --- /dev/null +++ b/storage/innobase/buf/buf0block_hint.cc @@ -0,0 +1,59 @@ +/***************************************************************************** + +Copyright (c) 2020, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2020, MariaDB Corporation. + +This program is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License, version 2.0, as published by the +Free Software Foundation. + +This program is also distributed with certain software (including but not +limited to OpenSSL) that is licensed under separate terms, as designated in a +particular file or component or in included license documentation. The authors +of MySQL hereby grant you an additional permission to link the program and +your derivative works with the separately licensed software that they have +included with MySQL. + +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, version 2.0, +for more details. + +You should have received a copy of the GNU General Public License along with +this program; if not, write to the Free Software Foundation, Inc., +51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +*****************************************************************************/ + +#include "buf0block_hint.h" +namespace buf { + +void Block_hint::buffer_fix_block_if_still_valid() +{ + /* To check if m_block belongs to the current buf_pool, we must + prevent freeing memory while we check, and until we buffer-fix the + block. For this purpose it is enough to latch any of the many + latches taken by buf_pool_t::resize(). + + Similar to buf_page_optimistic_get(), we must validate + m_block->page.id() after acquiring the hash_lock, because the object + may have been freed and not actually attached to buf_pool.page_hash + at the moment. (The block could have been reused to store a + different page, and that slice of buf_pool.page_hash could be protected + by another hash_lock that we are not holding.) + + Finally, assuming that we have correct hash bucket latched, we must + validate m_block->state() to ensure that the block is not being freed. */ + if (m_block) + { + const ulint fold= m_page_id.fold(); + page_hash_latch *hash_lock= buf_pool.page_hash.lock<false>(fold); + if (buf_pool.is_uncompressed(m_block) && m_page_id == m_block->page.id() && + m_block->page.state() == BUF_BLOCK_FILE_PAGE) + m_block->fix(); + else + clear(); + hash_lock->read_unlock(); + } +} +} // namespace buf diff --git a/storage/innobase/buf/buf0buf.cc b/storage/innobase/buf/buf0buf.cc index 2cdd36a8b60..9a180614afd 100644 --- a/storage/innobase/buf/buf0buf.cc +++ b/storage/innobase/buf/buf0buf.cc @@ -1479,8 +1479,6 @@ bool buf_pool_t::create() NUMA_MEMPOLICY_INTERLEAVE_IN_SCOPE; ut_ad(!resizing); - ut_ad(!withdrawing); - ut_ad(!withdraw_clock()); ut_ad(!chunks_old); chunk_t::map_reg= UT_NEW_NOKEY(chunk_t::map()); @@ -1637,7 +1635,6 @@ inline bool buf_pool_t::realloc(buf_block_t *block) { buf_block_t* new_block; - ut_ad(withdrawing); mysql_mutex_assert_owner(&mutex); ut_ad(block->page.state() == BUF_BLOCK_FILE_PAGE); @@ -1909,9 +1906,6 @@ inline bool buf_pool_t::withdraw_blocks() ib::info() << "withdrawn target: " << UT_LIST_GET_LEN(withdraw) << " blocks"; - /* retry is not needed */ - ++withdraw_clock_; - return(false); } @@ -2105,7 +2099,6 @@ inline void buf_pool_t::resize() ut_ad(withdraw_target == 0); withdraw_target = w; - withdrawing.store(true, std::memory_order_relaxed); } buf_resize_status("Withdrawing blocks to be shrunken."); @@ -2121,7 +2114,6 @@ withdraw_retry: if (srv_shutdown_state != SRV_SHUTDOWN_NONE) { /* abort to resize for shutdown. */ - withdrawing.store(false, std::memory_order_relaxed); return; } @@ -2162,8 +2154,6 @@ withdraw_retry: goto withdraw_retry; } - withdrawing.store(false, std::memory_order_relaxed); - buf_resize_status("Latching whole of buffer pool."); #ifndef DBUG_OFF diff --git a/storage/innobase/dict/dict0dict.cc b/storage/innobase/dict/dict0dict.cc index a4a660be584..ca4081e90e9 100644 --- a/storage/innobase/dict/dict0dict.cc +++ b/storage/innobase/dict/dict0dict.cc @@ -1992,6 +1992,12 @@ void dict_sys_t::remove(dict_table_t* table, bool lru, bool keep) #ifdef BTR_CUR_HASH_ADAPT if (UNIV_UNLIKELY(UT_LIST_GET_LEN(table->freed_indexes) != 0)) { + if (table->fts) { + fts_optimize_remove_table(table); + fts_free(table); + table->fts = NULL; + } + table->vc_templ = NULL; table->id = 0; return; diff --git a/storage/innobase/dict/dict0mem.cc b/storage/innobase/dict/dict0mem.cc index c27ea57e68d..96f2d7b6e3b 100644 --- a/storage/innobase/dict/dict0mem.cc +++ b/storage/innobase/dict/dict0mem.cc @@ -124,25 +124,17 @@ bool dict_col_t::same_encoding(uint16_t a, uint16_t b) return false; } -/** Creates a table memory object. -@param[in] name table name -@param[in] space tablespace -@param[in] n_cols total number of columns including virtual and - non-virtual columns -@param[in] n_v_cols number of virtual columns -@param[in] flags table flags -@param[in] flags2 table flags2 -@param[in] init_stats_latch whether to init the stats latch +/** Create a table memory object. +@param name table name +@param space tablespace +@param n_cols total number of columns (both virtual and non-virtual) +@param n_v_cols number of virtual columns +@param flags table flags +@param flags2 table flags2 @return own: table object */ -dict_table_t* -dict_mem_table_create( - const char* name, - fil_space_t* space, - ulint n_cols, - ulint n_v_cols, - ulint flags, - ulint flags2, - bool init_stats_latch) +dict_table_t *dict_mem_table_create(const char *name, fil_space_t *space, + ulint n_cols, ulint n_v_cols, ulint flags, + ulint flags2) { dict_table_t* table; mem_heap_t* heap; @@ -210,12 +202,6 @@ dict_mem_table_create( new(&table->foreign_set) dict_foreign_set(); new(&table->referenced_set) dict_foreign_set(); - if (init_stats_latch) { - rw_lock_create(dict_table_stats_key, &table->stats_latch, - SYNC_INDEX_TREE); - table->stats_latch_inited = true; - } - return(table); } @@ -258,10 +244,6 @@ dict_mem_table_free( UT_DELETE(table->s_cols); - if (table->stats_latch_inited) { - rw_lock_free(&table->stats_latch); - } - mem_heap_free(table->heap); } diff --git a/storage/innobase/dict/dict0stats.cc b/storage/innobase/dict/dict0stats.cc index 03330664264..2d1cb86e51a 100644 --- a/storage/innobase/dict/dict0stats.cc +++ b/storage/innobase/dict/dict0stats.cc @@ -483,8 +483,6 @@ dict_stats_table_clone_create( ut_d(t->magic_n = DICT_TABLE_MAGIC_N); - rw_lock_create(dict_table_stats_key, &t->stats_latch, SYNC_INDEX_TREE); - return(t); } @@ -497,7 +495,6 @@ dict_stats_table_clone_free( /*========================*/ dict_table_t* t) /*!< in: dummy table object to free */ { - rw_lock_free(&t->stats_latch); mem_heap_free(t->heap); } @@ -514,7 +511,7 @@ dict_stats_empty_index( { ut_ad(!(index->type & DICT_FTS)); ut_ad(!dict_index_is_ibuf(index)); - ut_ad(rw_lock_own(&index->table->stats_latch, RW_LOCK_X)); + ut_ad(mutex_own(&dict_sys.mutex)); ulint n_uniq = index->n_uniq; @@ -544,10 +541,9 @@ dict_stats_empty_table( bool empty_defrag_stats) /*!< in: whether to empty defrag stats */ { - /* Zero the stats members */ - - rw_lock_x_lock(&table->stats_latch); + mutex_enter(&dict_sys.mutex); + /* Zero the stats members */ table->stat_n_rows = 0; table->stat_clustered_index_size = 1; /* 1 page for each index, not counting the clustered */ @@ -571,8 +567,7 @@ dict_stats_empty_table( } table->stat_initialized = TRUE; - - rw_lock_x_unlock(&table->stats_latch); + mutex_exit(&dict_sys.mutex); } /*********************************************************************//** @@ -671,6 +666,8 @@ dict_stats_copy( to have the same statistics as if the table was empty */ { + ut_ad(mutex_own(&dict_sys.mutex)); + dst->stats_last_recalc = src->stats_last_recalc; dst->stat_n_rows = src->stat_n_rows; dst->stat_clustered_index_size = src->stat_clustered_index_size; @@ -788,8 +785,6 @@ dict_stats_snapshot_create( { mutex_enter(&dict_sys.mutex); - rw_lock_s_lock(&table->stats_latch); - dict_stats_assert_initialized(table); dict_table_t* t; @@ -803,8 +798,6 @@ dict_stats_snapshot_create( t->stats_sample_pages = table->stats_sample_pages; t->stats_bg_flag = table->stats_bg_flag; - rw_lock_s_unlock(&table->stats_latch); - mutex_exit(&dict_sys.mutex); return(t); @@ -844,10 +837,14 @@ dict_stats_update_transient_for_index( Initialize some bogus index cardinality statistics, so that the data can be queried in various means, also via secondary indexes. */ + mutex_enter(&dict_sys.mutex); dict_stats_empty_index(index, false); + mutex_exit(&dict_sys.mutex); #if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG } else if (ibuf_debug && !dict_index_is_clust(index)) { + mutex_enter(&dict_sys.mutex); dict_stats_empty_index(index, false); + mutex_exit(&dict_sys.mutex); #endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */ } else { mtr_t mtr; @@ -868,7 +865,9 @@ dict_stats_update_transient_for_index( switch (size) { case ULINT_UNDEFINED: + mutex_enter(&dict_sys.mutex); dict_stats_empty_index(index, false); + mutex_exit(&dict_sys.mutex); return; case 0: /* The root node of the tree is a leaf */ @@ -880,11 +879,23 @@ dict_stats_update_transient_for_index( /* Do not continue if table decryption has failed or table is already marked as corrupted. */ if (index->is_readable()) { - /* We don't handle the return value since it - will be false only when some thread is - dropping the table and we don't have to empty - the statistics of the to be dropped index */ - btr_estimate_number_of_different_key_vals(index); + std::vector<index_field_stats_t> stats + = btr_estimate_number_of_different_key_vals( + index); + + if (!stats.empty()) { + ut_ad(!mutex_own(&dict_sys.mutex)); + mutex_enter(&dict_sys.mutex); + for (size_t i = 0; i < stats.size(); ++i) { + index->stat_n_diff_key_vals[i] + = stats[i].n_diff_key_vals; + index->stat_n_sample_sizes[i] + = stats[i].n_sample_sizes; + index->stat_n_non_null_key_vals[i] + = stats[i].n_non_null_key_vals; + } + mutex_exit(&dict_sys.mutex); + } } } } @@ -901,6 +912,8 @@ dict_stats_update_transient( /*========================*/ dict_table_t* table) /*!< in/out: table */ { + ut_ad(!mutex_own(&dict_sys.mutex)); + dict_index_t* index; ulint sum_of_index_sizes = 0; @@ -926,27 +939,25 @@ dict_stats_update_transient( ut_ad(!dict_index_is_ibuf(index)); - if (index->type & DICT_FTS || dict_index_is_spatial(index)) { + if (index->type & (DICT_FTS | DICT_SPATIAL)) { continue; } - dict_stats_empty_index(index, false); - - if (dict_stats_should_ignore_index(index)) { + if (dict_stats_should_ignore_index(index) + || !index->is_readable()) { + mutex_enter(&dict_sys.mutex); + dict_stats_empty_index(index, false); + mutex_exit(&dict_sys.mutex); continue; } - /* Do not continue if table decryption has failed or - table is already marked as corrupted. */ - if (!index->is_readable()) { - break; - } - dict_stats_update_transient_for_index(index); sum_of_index_sizes += index->stat_index_size; } + mutex_enter(&dict_sys.mutex); + index = dict_table_get_first_index(table); table->stat_n_rows = index->stat_n_diff_key_vals[ @@ -962,6 +973,8 @@ dict_stats_update_transient( table->stat_modified_counter = 0; table->stat_initialized = TRUE; + + mutex_exit(&dict_sys.mutex); } /* @{ Pseudo code about the relation between the following functions @@ -1807,16 +1820,31 @@ dict_stats_analyze_index_for_n_prefix( btr_pcur_close(&pcur); } +/** statistics for an index */ +struct index_stats_t +{ + std::vector<index_field_stats_t> stats; + ulint index_size; + ulint n_leaf_pages; + + index_stats_t(ulint n_uniq) : index_size(1), n_leaf_pages(1) + { + stats.reserve(n_uniq); + for (ulint i= 0; i < n_uniq; ++i) + stats.push_back(index_field_stats_t(0, 1, 0)); + } +}; + /** Set dict_index_t::stat_n_diff_key_vals[] and stat_n_sample_sizes[]. @param[in] n_diff_data input data to use to derive the results -@param[in,out] index index whose stat_n_diff_key_vals[] to set */ +@param[in,out] index_stats index stats to set */ UNIV_INLINE void dict_stats_index_set_n_diff( const n_diff_data_t* n_diff_data, - dict_index_t* index) + index_stats_t& index_stats) { - for (ulint n_prefix = dict_index_get_n_unique(index); + for (ulint n_prefix = index_stats.stats.size(); n_prefix >= 1; n_prefix--) { /* n_diff_all_analyzed_pages can be 0 here if @@ -1847,14 +1875,14 @@ dict_stats_index_set_n_diff( that the total number of ordinary leaf pages is T * D / (D + E). */ n_ordinary_leaf_pages - = index->stat_n_leaf_pages + = index_stats.n_leaf_pages * data->n_leaf_pages_to_analyze / (data->n_leaf_pages_to_analyze + data->n_external_pages_sum); } /* See REF01 for an explanation of the algorithm */ - index->stat_n_diff_key_vals[n_prefix - 1] + index_stats.stats[n_prefix - 1].n_diff_key_vals = n_ordinary_leaf_pages * data->n_diff_on_level @@ -1863,7 +1891,7 @@ dict_stats_index_set_n_diff( * data->n_diff_all_analyzed_pages / data->n_leaf_pages_to_analyze; - index->stat_n_sample_sizes[n_prefix - 1] + index_stats.stats[n_prefix - 1].n_sample_sizes = data->n_leaf_pages_to_analyze; DEBUG_PRINTF(" %s(): n_diff=" UINT64PF @@ -1872,9 +1900,9 @@ dict_stats_index_set_n_diff( " * " UINT64PF " / " UINT64PF " * " UINT64PF " / " UINT64PF ")\n", __func__, - index->stat_n_diff_key_vals[n_prefix - 1], + index_stats.stats[n_prefix - 1].n_diff_key_vals, n_prefix, - index->stat_n_leaf_pages, + index_stats.n_leaf_pages, data->n_diff_on_level, data->n_recs_on_level, data->n_diff_all_analyzed_pages, @@ -1882,15 +1910,12 @@ dict_stats_index_set_n_diff( } } -/*********************************************************************//** -Calculates new statistics for a given index and saves them to the index +/** Calculates new statistics for a given index and saves them to the index members stat_n_diff_key_vals[], stat_n_sample_sizes[], stat_index_size and -stat_n_leaf_pages. This function could be slow. */ -static -void -dict_stats_analyze_index( -/*=====================*/ - dict_index_t* index) /*!< in/out: index to analyze */ +stat_n_leaf_pages. This function can be slow. +@param[in] index index to analyze +@return index stats */ +static index_stats_t dict_stats_analyze_index(dict_index_t* index) { ulint root_level; ulint level; @@ -1901,26 +1926,28 @@ dict_stats_analyze_index( ib_uint64_t total_pages; mtr_t mtr; ulint size; + index_stats_t result(index->n_uniq); DBUG_ENTER("dict_stats_analyze_index"); DBUG_PRINT("info", ("index: %s, online status: %d", index->name(), dict_index_get_online_status(index))); + ut_ad(!mutex_own(&dict_sys.mutex)); // because this function is slow + ut_ad(index->table->get_ref_count()); + /* Disable update statistic for Rtree */ if (dict_index_is_spatial(index)) { - DBUG_VOID_RETURN; + DBUG_RETURN(result); } DEBUG_PRINTF(" %s(index=%s)\n", __func__, index->name()); - dict_stats_empty_index(index, false); - mtr.start(); mtr_s_lock_index(index, &mtr); size = btr_get_size(index, BTR_TOTAL_SIZE, &mtr); if (size != ULINT_UNDEFINED) { - index->stat_index_size = size; + result.index_size = size; size = btr_get_size(index, BTR_N_LEAF_PAGES, &mtr); } @@ -1930,13 +1957,13 @@ dict_stats_analyze_index( switch (size) { case ULINT_UNDEFINED: dict_stats_assert_initialized_index(index); - DBUG_VOID_RETURN; + DBUG_RETURN(result); case 0: /* The root node of the tree is a leaf */ size = 1; } - index->stat_n_leaf_pages = size; + result.n_leaf_pages = size; mtr.start(); mtr_sx_lock_index(index, &mtr); @@ -1975,14 +2002,18 @@ dict_stats_analyze_index( NULL /* boundaries not needed */, &mtr); + mtr.commit(); + + mutex_enter(&dict_sys.mutex); for (ulint i = 0; i < n_uniq; i++) { - index->stat_n_sample_sizes[i] = total_pages; + result.stats[i].n_diff_key_vals = index->stat_n_diff_key_vals[i]; + result.stats[i].n_sample_sizes = total_pages; + result.stats[i].n_non_null_key_vals = index->stat_n_non_null_key_vals[i]; } + result.n_leaf_pages = index->stat_n_leaf_pages; + mutex_exit(&dict_sys.mutex); - mtr.commit(); - - dict_stats_assert_initialized_index(index); - DBUG_VOID_RETURN; + DBUG_RETURN(result); } /* For each level that is being scanned in the btree, this contains the @@ -2174,13 +2205,12 @@ found_level: /* n_prefix == 0 means that the above loop did not end up prematurely due to tree being changed and so n_diff_data[] is set up. */ if (n_prefix == 0) { - dict_stats_index_set_n_diff(n_diff_data, index); + dict_stats_index_set_n_diff(n_diff_data, result); } UT_DELETE_ARRAY(n_diff_data); - dict_stats_assert_initialized_index(index); - DBUG_VOID_RETURN; + DBUG_RETURN(result); } /*********************************************************************//** @@ -2198,7 +2228,7 @@ dict_stats_update_persistent( DEBUG_PRINTF("%s(table=%s)\n", __func__, table->name); - rw_lock_x_lock(&table->stats_latch); + DEBUG_SYNC_C("dict_stats_update_persistent"); /* analyze the clustered index first */ @@ -2209,7 +2239,6 @@ dict_stats_update_persistent( || (index->type | DICT_UNIQUE) != (DICT_CLUSTERED | DICT_UNIQUE)) { /* Table definition is corrupt */ - rw_lock_x_unlock(&table->stats_latch); dict_stats_empty_table(table, true); return(DB_CORRUPTION); @@ -2217,7 +2246,16 @@ dict_stats_update_persistent( ut_ad(!dict_index_is_ibuf(index)); - dict_stats_analyze_index(index); + index_stats_t stats = dict_stats_analyze_index(index); + + mutex_enter(&dict_sys.mutex); + index->stat_index_size = stats.index_size; + index->stat_n_leaf_pages = stats.n_leaf_pages; + for (size_t i = 0; i < stats.stats.size(); ++i) { + index->stat_n_diff_key_vals[i] = stats.stats[i].n_diff_key_vals; + index->stat_n_sample_sizes[i] = stats.stats[i].n_sample_sizes; + index->stat_n_non_null_key_vals[i] = stats.stats[i].n_non_null_key_vals; + } ulint n_unique = dict_index_get_n_unique(index); @@ -2235,7 +2273,7 @@ dict_stats_update_persistent( ut_ad(!dict_index_is_ibuf(index)); - if (index->type & DICT_FTS || dict_index_is_spatial(index)) { + if (index->type & (DICT_FTS | DICT_SPATIAL)) { continue; } @@ -2246,7 +2284,20 @@ dict_stats_update_persistent( } if (!(table->stats_bg_flag & BG_STAT_SHOULD_QUIT)) { - dict_stats_analyze_index(index); + mutex_exit(&dict_sys.mutex); + stats = dict_stats_analyze_index(index); + mutex_enter(&dict_sys.mutex); + + index->stat_index_size = stats.index_size; + index->stat_n_leaf_pages = stats.n_leaf_pages; + for (size_t i = 0; i < stats.stats.size(); ++i) { + index->stat_n_diff_key_vals[i] + = stats.stats[i].n_diff_key_vals; + index->stat_n_sample_sizes[i] + = stats.stats[i].n_sample_sizes; + index->stat_n_non_null_key_vals[i] + = stats.stats[i].n_non_null_key_vals; + } } table->stat_sum_of_other_index_sizes @@ -2261,7 +2312,7 @@ dict_stats_update_persistent( dict_stats_assert_initialized(table); - rw_lock_x_unlock(&table->stats_latch); + mutex_exit(&dict_sys.mutex); return(DB_SUCCESS); } @@ -3078,11 +3129,22 @@ dict_stats_update_for_index( if (dict_stats_is_persistent_enabled(index->table)) { if (dict_stats_persistent_storage_check(false)) { - rw_lock_x_lock(&index->table->stats_latch); - dict_stats_analyze_index(index); + index_stats_t stats = dict_stats_analyze_index(index); + mutex_enter(&dict_sys.mutex); + index->stat_index_size = stats.index_size; + index->stat_n_leaf_pages = stats.n_leaf_pages; + for (size_t i = 0; i < stats.stats.size(); ++i) { + index->stat_n_diff_key_vals[i] + = stats.stats[i].n_diff_key_vals; + index->stat_n_sample_sizes[i] + = stats.stats[i].n_sample_sizes; + index->stat_n_non_null_key_vals[i] + = stats.stats[i].n_non_null_key_vals; + } index->table->stat_sum_of_other_index_sizes += index->stat_index_size; - rw_lock_x_unlock(&index->table->stats_latch); + mutex_exit(&dict_sys.mutex); + dict_stats_save(index->table, &index->id); DBUG_VOID_RETURN; } @@ -3103,9 +3165,7 @@ dict_stats_update_for_index( } } - rw_lock_x_lock(&index->table->stats_latch); dict_stats_update_transient_for_index(index); - rw_lock_x_unlock(&index->table->stats_latch); DBUG_VOID_RETURN; } @@ -3259,7 +3319,7 @@ dict_stats_update( switch (err) { case DB_SUCCESS: - rw_lock_x_lock(&table->stats_latch); + mutex_enter(&dict_sys.mutex); /* Pass reset_ignored_indexes=true as parameter to dict_stats_copy. This will cause statictics @@ -3268,7 +3328,7 @@ dict_stats_update( dict_stats_assert_initialized(table); - rw_lock_x_unlock(&table->stats_latch); + mutex_exit(&dict_sys.mutex); dict_stats_table_clone_free(t); @@ -3322,13 +3382,8 @@ dict_stats_update( } transient: - - rw_lock_x_lock(&table->stats_latch); - dict_stats_update_transient(table); - rw_lock_x_unlock(&table->stats_latch); - return(DB_SUCCESS); } diff --git a/storage/innobase/fts/fts0ast.cc b/storage/innobase/fts/fts0ast.cc index a2834f5e7e5..bb42f7c9f54 100644 --- a/storage/innobase/fts/fts0ast.cc +++ b/storage/innobase/fts/fts0ast.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 2007, 2018, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2007, 2020, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2018, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under @@ -557,8 +557,7 @@ fts_ast_node_check_union( fts_ast_node_t* node) { if (node->type == FTS_AST_LIST - || node->type == FTS_AST_SUBEXP_LIST - || node->type == FTS_AST_PARSER_PHRASE_LIST) { + || node->type == FTS_AST_SUBEXP_LIST) { for (node = node->list.head; node; node = node->next) { if (!fts_ast_node_check_union(node)) { @@ -566,6 +565,9 @@ fts_ast_node_check_union( } } + } else if (node->type == FTS_AST_PARSER_PHRASE_LIST) { + /* Phrase search for plugin parser */ + return(false); } else if (node->type == FTS_AST_OPER && (node->oper == FTS_IGNORE || node->oper == FTS_EXIST)) { diff --git a/storage/innobase/fts/fts0que.cc b/storage/innobase/fts/fts0que.cc index dd74aad4de7..8e2cb838e5a 100644 --- a/storage/innobase/fts/fts0que.cc +++ b/storage/innobase/fts/fts0que.cc @@ -4423,24 +4423,27 @@ fts_phrase_or_proximity_search( if (k == ib_vector_size(query->match_array[j])) { end_list = TRUE; - if (match[j]->doc_id != match[0]->doc_id) { - /* no match */ - if (query->flags & FTS_PHRASE) { - ulint s; + if (query->flags & FTS_PHRASE) { + ulint s; + /* Since i is the last doc id in the + match_array[j], remove all doc ids > i + from the match_array[0]. */ + fts_match_t* match_temp; + for (s = i + 1; s < n_matched; s++) { + match_temp = static_cast< + fts_match_t*>(ib_vector_get( + query->match_array[0], s)); + match_temp->doc_id = 0; + } + if (match[j]->doc_id != + match[0]->doc_id) { + /* no match */ match[0]->doc_id = 0; - - for (s = i + 1; s < n_matched; - s++) { - match[0] = static_cast< - fts_match_t*>( - ib_vector_get( - query->match_array[0], - s)); - match[0]->doc_id = 0; - } } + } + if (match[j]->doc_id != match[0]->doc_id) { goto func_exit; } } diff --git a/storage/innobase/gis/gis0sea.cc b/storage/innobase/gis/gis0sea.cc index 0a0d4242c00..d9a0ae80c33 100644 --- a/storage/innobase/gis/gis0sea.cc +++ b/storage/innobase/gis/gis0sea.cc @@ -1237,6 +1237,24 @@ rtr_check_discard_page( lock_mutex_exit(); } +/** Structure acts as functor to get the optimistic access of the page. +It returns true if it successfully gets the page. */ +struct optimistic_get +{ + btr_pcur_t *const r_cursor; + mtr_t *const mtr; + + optimistic_get(btr_pcur_t *r_cursor,mtr_t *mtr) + :r_cursor(r_cursor), mtr(mtr) {} + + bool operator()(buf_block_t *hint) const + { + return hint && buf_page_optimistic_get( + RW_X_LATCH, hint, r_cursor->modify_clock, __FILE__, + __LINE__, mtr); + } +}; + /** Restore the stored position of a persistent cursor bufferfixing the page */ static bool @@ -1270,11 +1288,8 @@ rtr_cur_restore_position( ut_ad(latch_mode == BTR_CONT_MODIFY_TREE); - if (!buf_pool.is_obsolete(r_cursor->withdraw_clock) - && buf_page_optimistic_get(RW_X_LATCH, - r_cursor->block_when_stored, - r_cursor->modify_clock, - __FILE__, __LINE__, mtr)) { + if (r_cursor->block_when_stored.run_with_hint( + optimistic_get(r_cursor, mtr))) { ut_ad(r_cursor->pos_state == BTR_PCUR_IS_POSITIONED); ut_ad(r_cursor->rel_pos == BTR_PCUR_ON); diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index b636592bb87..c7e65abb0c7 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -223,6 +223,27 @@ enum default_row_format_enum { DEFAULT_ROW_FORMAT_DYNAMIC = 2, }; +/** A dummy variable */ +static uint innodb_max_purge_lag_wait; + +/** Wait for trx_sys_t::rseg_history_len to be below a limit. */ +static void innodb_max_purge_lag_wait_update(THD *thd, st_mysql_sys_var *, + void *, const void *limit) +{ + const uint l= *static_cast<const uint*>(limit); + if (trx_sys.rseg_history_len <= l) + return; + mysql_mutex_unlock(&LOCK_global_system_variables); + while (trx_sys.rseg_history_len > l) + { + if (thd_kill_level(thd)) + break; + srv_wake_purge_thread_if_not_active(); + os_thread_sleep(100000); + } + mysql_mutex_lock(&LOCK_global_system_variables); +} + static void set_my_errno(int err) { @@ -567,7 +588,6 @@ static PSI_rwlock_info all_innodb_rwlocks[] = { PSI_RWLOCK_KEY(trx_purge_latch), PSI_RWLOCK_KEY(index_tree_rw_lock), PSI_RWLOCK_KEY(index_online_log), - PSI_RWLOCK_KEY(dict_table_stats) }; # endif /* UNIV_PFS_RWLOCK */ @@ -14186,6 +14206,8 @@ ha_innobase::info_low( DEBUG_SYNC_C("ha_innobase_info_low"); + ut_ad(!mutex_own(&dict_sys.mutex)); + /* If we are forcing recovery at a high level, we will suppress statistics calculation on tables, because that may crash the server if an index is badly corrupted. */ @@ -14222,7 +14244,6 @@ ha_innobase::info_low( opt = DICT_STATS_RECALC_TRANSIENT; } - ut_ad(!mutex_own(&dict_sys.mutex)); ret = dict_stats_update(ib_table, opt); if (ret != DB_SUCCESS) { @@ -14238,14 +14259,14 @@ ha_innobase::info_low( stats.update_time = (ulong) ib_table->update_time; } + DBUG_EXECUTE_IF("dict_sys_mutex_avoid", goto func_exit;); + if (flag & HA_STATUS_VARIABLE) { ulint stat_clustered_index_size; ulint stat_sum_of_other_index_sizes; - if (!(flag & HA_STATUS_NO_LOCK)) { - rw_lock_s_lock(&ib_table->stats_latch); - } + mutex_enter(&dict_sys.mutex); ut_a(ib_table->stat_initialized); @@ -14257,9 +14278,7 @@ ha_innobase::info_low( stat_sum_of_other_index_sizes = ib_table->stat_sum_of_other_index_sizes; - if (!(flag & HA_STATUS_NO_LOCK)) { - rw_lock_s_unlock(&ib_table->stats_latch); - } + mutex_exit(&dict_sys.mutex); /* The MySQL optimizer seems to assume in a left join that n_rows @@ -14360,10 +14379,26 @@ ha_innobase::info_low( ib_push_frm_error(m_user_thd, ib_table, table, num_innodb_index, true); } - if (!(flag & HA_STATUS_NO_LOCK)) { - rw_lock_s_lock(&ib_table->stats_latch); + snprintf(path, sizeof(path), "%s/%s%s", + mysql_data_home, table->s->normalized_path.str, + reg_ext); + + unpack_filename(path,path); + + /* Note that we do not know the access time of the table, + nor the CHECK TABLE time, nor the UPDATE or INSERT time. */ + + if (os_file_get_status( + path, &stat_info, false, + srv_read_only_mode) == DB_SUCCESS) { + stats.create_time = (ulong) stat_info.ctime; } + struct Locking { + Locking() { mutex_enter(&dict_sys.mutex); } + ~Locking() { mutex_exit(&dict_sys.mutex); } + } locking; + ut_a(ib_table->stat_initialized); for (uint i = 0; i < table->s->keys; i++) { @@ -14441,25 +14476,6 @@ ha_innobase::info_low( key->rec_per_key[j] = rec_per_key_int; } } - - if (!(flag & HA_STATUS_NO_LOCK)) { - rw_lock_s_unlock(&ib_table->stats_latch); - } - - snprintf(path, sizeof(path), "%s/%s%s", - mysql_data_home, table->s->normalized_path.str, - reg_ext); - - unpack_filename(path,path); - - /* Note that we do not know the access time of the table, - nor the CHECK TABLE time, nor the UPDATE or INSERT time. */ - - if (os_file_get_status( - path, &stat_info, false, - srv_read_only_mode) == DB_SUCCESS) { - stats.create_time = (ulong) stat_info.ctime; - } } if (srv_force_recovery > SRV_FORCE_NO_IBUF_MERGE) { @@ -19111,6 +19127,11 @@ static MYSQL_SYSVAR_ULONG(max_purge_lag_delay, srv_max_purge_lag_delay, 0L, /* Minimum value */ 10000000UL, 0); /* Maximum value */ +static MYSQL_SYSVAR_UINT(max_purge_lag_wait, innodb_max_purge_lag_wait, + PLUGIN_VAR_RQCMDARG, + "Wait until History list length is below the specified limit", + NULL, innodb_max_purge_lag_wait_update, UINT_MAX, 0, UINT_MAX, 0); + static MYSQL_SYSVAR_BOOL(rollback_on_timeout, innobase_rollback_on_timeout, PLUGIN_VAR_OPCMDARG | PLUGIN_VAR_READONLY, "Roll back the complete transaction on lock wait timeout, for 4.x compatibility (disabled by default)", @@ -20049,6 +20070,7 @@ static struct st_mysql_sys_var* innobase_system_variables[]= { MYSQL_SYSVAR(flushing_avg_loops), MYSQL_SYSVAR(max_purge_lag), MYSQL_SYSVAR(max_purge_lag_delay), + MYSQL_SYSVAR(max_purge_lag_wait), MYSQL_SYSVAR(old_blocks_pct), MYSQL_SYSVAR(old_blocks_time), MYSQL_SYSVAR(open_files), diff --git a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc index 9343ca7fe45..7d20796b646 100644 --- a/storage/innobase/handler/handler0alter.cc +++ b/storage/innobase/handler/handler0alter.cc @@ -56,6 +56,8 @@ Smart ALTER TABLE #include "ha_innodb.h" #include "ut0stage.h" #include "span.h" +#include <thread> +#include <sstream> using st_::span; /** File format constraint for ALTER TABLE */ @@ -556,6 +558,7 @@ inline bool dict_table_t::instant_column(const dict_table_t& table, mem_heap_alloc(heap, table.n_v_cols * sizeof(*v_cols))); for (ulint i = table.n_v_cols; i--; ) { new (&v_cols[i]) dict_v_col_t(table.v_cols[i]); + v_cols[i].v_indexes.clear(); } } else { ut_ad(table.n_v_cols == 0); @@ -7363,22 +7366,28 @@ innobase_rename_index_cache(dict_index_t* index, const char* new_name) /** Rename the index name in cache. @param[in] ctx alter context @param[in] ha_alter_info Data used during inplace alter. */ -static void innobase_rename_indexes_cache( - const ha_innobase_inplace_ctx* ctx, - const Alter_inplace_info* ha_alter_info) +static void +innobase_rename_indexes_cache(const ha_innobase_inplace_ctx *ctx, + const Alter_inplace_info *ha_alter_info) { - DBUG_ASSERT(ha_alter_info->handler_flags & ALTER_RENAME_INDEX); + DBUG_ASSERT(ha_alter_info->handler_flags & ALTER_RENAME_INDEX); - for (const Alter_inplace_info::Rename_key_pair& pair : - ha_alter_info->rename_keys) { - dict_index_t* index = dict_table_get_index_on_name( - ctx->old_table, pair.old_key->name.str); - ut_ad(index); + std::vector<std::pair<dict_index_t *, const char *>> rename_info; + rename_info.reserve(ha_alter_info->rename_keys.size()); - innobase_rename_index_cache(index, pair.new_key->name.str); - } -} + for (const Alter_inplace_info::Rename_key_pair &pair : + ha_alter_info->rename_keys) + { + dict_index_t *index= + dict_table_get_index_on_name(ctx->old_table, pair.old_key->name.str); + ut_ad(index); + rename_info.emplace_back(index, pair.new_key->name.str); + } + + for (const auto &pair : rename_info) + innobase_rename_index_cache(pair.first, pair.second); +} /** Fill the stored column information in s_cols list. @param[in] altered_table mysql table object @@ -10535,11 +10544,18 @@ alter_stats_norebuild( } } - for (const Alter_inplace_info::Rename_key_pair& pair : - ha_alter_info->rename_keys) { + for (size_t i = 0; i < ha_alter_info->rename_keys.size(); i++) { + const Alter_inplace_info::Rename_key_pair& pair + = ha_alter_info->rename_keys[i]; + + std::stringstream ss; + ss << TEMP_FILE_PREFIX_INNODB << std::this_thread::get_id() + << i; + auto tmp_name = ss.str(); + dberr_t err = dict_stats_rename_index(ctx->new_table, pair.old_key->name.str, - pair.new_key->name.str); + tmp_name.c_str()); if (err != DB_SUCCESS) { push_warning_printf( @@ -10551,6 +10567,34 @@ alter_stats_norebuild( " statistics storage: %s", ctx->new_table->name.m_name, pair.old_key->name.str, + tmp_name.c_str(), + ut_strerr(err)); + } + } + + for (size_t i = 0; i < ha_alter_info->rename_keys.size(); i++) { + const Alter_inplace_info::Rename_key_pair& pair + = ha_alter_info->rename_keys[i]; + + std::stringstream ss; + ss << TEMP_FILE_PREFIX_INNODB << std::this_thread::get_id() + << i; + auto tmp_name = ss.str(); + + dberr_t err = dict_stats_rename_index(ctx->new_table, + tmp_name.c_str(), + pair.new_key->name.str); + + if (err != DB_SUCCESS) { + push_warning_printf( + thd, + Sql_condition::WARN_LEVEL_WARN, + ER_ERROR_ON_RENAME, + "Error renaming an index of table '%s'" + " from '%s' to '%s' in InnoDB persistent" + " statistics storage: %s", + ctx->new_table->name.m_name, + tmp_name.c_str(), pair.new_key->name.str, ut_strerr(err)); } diff --git a/storage/innobase/handler/i_s.cc b/storage/innobase/handler/i_s.cc index b0dc115977e..ecc0905de56 100644 --- a/storage/innobase/handler/i_s.cc +++ b/storage/innobase/handler/i_s.cc @@ -5037,33 +5037,39 @@ i_s_dict_fill_sys_tablestats( OK(field_store_string(fields[SYS_TABLESTATS_NAME], table->name.m_name)); - rw_lock_s_lock(&table->stats_latch); - - OK(fields[SYS_TABLESTATS_INIT]->store(table->stat_initialized, true)); + { + struct Locking + { + Locking() { mutex_enter(&dict_sys.mutex); } + ~Locking() { mutex_exit(&dict_sys.mutex); } + } locking; - if (table->stat_initialized) { - OK(fields[SYS_TABLESTATS_NROW]->store(table->stat_n_rows, + OK(fields[SYS_TABLESTATS_INIT]->store(table->stat_initialized, true)); - OK(fields[SYS_TABLESTATS_CLUST_SIZE]->store( - table->stat_clustered_index_size, true)); + if (table->stat_initialized) { + OK(fields[SYS_TABLESTATS_NROW]->store( + table->stat_n_rows, true)); - OK(fields[SYS_TABLESTATS_INDEX_SIZE]->store( - table->stat_sum_of_other_index_sizes, true)); + OK(fields[SYS_TABLESTATS_CLUST_SIZE]->store( + table->stat_clustered_index_size, true)); - OK(fields[SYS_TABLESTATS_MODIFIED]->store( - table->stat_modified_counter, true)); - } else { - OK(fields[SYS_TABLESTATS_NROW]->store(0, true)); + OK(fields[SYS_TABLESTATS_INDEX_SIZE]->store( + table->stat_sum_of_other_index_sizes, + true)); - OK(fields[SYS_TABLESTATS_CLUST_SIZE]->store(0, true)); + OK(fields[SYS_TABLESTATS_MODIFIED]->store( + table->stat_modified_counter, true)); + } else { + OK(fields[SYS_TABLESTATS_NROW]->store(0, true)); - OK(fields[SYS_TABLESTATS_INDEX_SIZE]->store(0, true)); + OK(fields[SYS_TABLESTATS_CLUST_SIZE]->store(0, true)); - OK(fields[SYS_TABLESTATS_MODIFIED]->store(0, true)); - } + OK(fields[SYS_TABLESTATS_INDEX_SIZE]->store(0, true)); - rw_lock_s_unlock(&table->stats_latch); + OK(fields[SYS_TABLESTATS_MODIFIED]->store(0, true)); + } + } OK(fields[SYS_TABLESTATS_AUTONINC]->store(table->autoinc, true)); diff --git a/storage/innobase/ibuf/ibuf0ibuf.cc b/storage/innobase/ibuf/ibuf0ibuf.cc index 5c9d7955c90..91a450b0711 100644 --- a/storage/innobase/ibuf/ibuf0ibuf.cc +++ b/storage/innobase/ibuf/ibuf0ibuf.cc @@ -1309,7 +1309,7 @@ ibuf_dummy_index_create( dict_index_t* index; table = dict_mem_table_create("IBUF_DUMMY", NULL, n, 0, - comp ? DICT_TF_COMPACT : 0, 0, false); + comp ? DICT_TF_COMPACT : 0, 0); index = dict_mem_index_create(table, "IBUF_DUMMY", 0, n); diff --git a/storage/innobase/include/btr0btr.h b/storage/innobase/include/btr0btr.h index 317c63c97d8..7fae1ad163b 100644 --- a/storage/innobase/include/btr0btr.h +++ b/storage/innobase/include/btr0btr.h @@ -214,7 +214,7 @@ the index. ulint btr_height_get( /*===========*/ - dict_index_t* index, /*!< in: index tree */ + const dict_index_t* index, /*!< in: index tree */ mtr_t* mtr) /*!< in/out: mini-transaction */ MY_ATTRIBUTE((warn_unused_result)); @@ -579,7 +579,7 @@ Gets the number of pages in a B-tree. ulint btr_get_size( /*=========*/ - dict_index_t* index, /*!< in: index */ + const dict_index_t* index, /*!< in: index */ ulint flag, /*!< in: BTR_N_LEAF_PAGES or BTR_TOTAL_SIZE */ mtr_t* mtr) /*!< in/out: mini-transaction where index is s-latched */ diff --git a/storage/innobase/include/btr0cur.h b/storage/innobase/include/btr0cur.h index 838b49dad47..7136d726db0 100644 --- a/storage/innobase/include/btr0cur.h +++ b/storage/innobase/include/btr0cur.h @@ -590,8 +590,24 @@ btr_estimate_n_rows_in_range( btr_pos_t* range_start, btr_pos_t* range_end); -/*******************************************************************//** -Estimates the number of different key values in a given index, for + +/** Statistics for one field of an index. */ +struct index_field_stats_t +{ + ib_uint64_t n_diff_key_vals; + ib_uint64_t n_sample_sizes; + ib_uint64_t n_non_null_key_vals; + + index_field_stats_t(ib_uint64_t n_diff_key_vals= 0, + ib_uint64_t n_sample_sizes= 0, + ib_uint64_t n_non_null_key_vals= 0) + : n_diff_key_vals(n_diff_key_vals), n_sample_sizes(n_sample_sizes), + n_non_null_key_vals(n_non_null_key_vals) + { + } +}; + +/** Estimates the number of different key values in a given index, for each n-column prefix of the index where 1 <= n <= dict_index_get_n_unique(index). The estimates are stored in the array index->stat_n_diff_key_vals[] (indexed 0..n_uniq-1) and the number of pages that were sampled is saved in @@ -599,12 +615,11 @@ index->stat_n_sample_sizes[]. If innodb_stats_method is nulls_ignored, we also record the number of non-null values for each prefix and stored the estimates in array index->stat_n_non_null_key_vals. -@return true if the index is available and we get the estimated numbers, -false if the index is unavailable. */ -bool -btr_estimate_number_of_different_key_vals( -/*======================================*/ - dict_index_t* index); /*!< in: index */ +@param[in] index index +@return stat vector if the index is available and we get the estimated numbers, +empty vector if the index is unavailable. */ +std::vector<index_field_stats_t> +btr_estimate_number_of_different_key_vals(dict_index_t* index); /** Gets the externally stored size of a record, in units of a database page. @param[in] rec record diff --git a/storage/innobase/include/btr0pcur.h b/storage/innobase/include/btr0pcur.h index bceb35a6969..bc7afbf3b67 100644 --- a/storage/innobase/include/btr0pcur.h +++ b/storage/innobase/include/btr0pcur.h @@ -29,6 +29,7 @@ Created 2/23/1996 Heikki Tuuri #include "dict0dict.h" #include "btr0cur.h" +#include "buf0block_hint.h" #include "btr0btr.h" #include "gis0rtree.h" @@ -502,13 +503,10 @@ struct btr_pcur_t{ whether cursor was on, before, or after the old_rec record */ enum btr_pcur_pos_t rel_pos; /** buffer block when the position was stored */ - buf_block_t* block_when_stored; + buf::Block_hint block_when_stored; /** the modify clock value of the buffer block when the cursor position was stored */ ib_uint64_t modify_clock; - /** the withdraw clock value of the buffer pool when the cursor - position was stored */ - ulint withdraw_clock; /** btr_pcur_store_position() and btr_pcur_restore_position() state. */ enum pcur_pos_t pos_state; /** PAGE_CUR_G, ... */ @@ -529,9 +527,8 @@ struct btr_pcur_t{ btr_cur(), latch_mode(RW_NO_LATCH), old_stored(false), old_rec(NULL), old_n_fields(0), rel_pos(btr_pcur_pos_t(0)), - block_when_stored(NULL), - modify_clock(0), withdraw_clock(0), - pos_state(BTR_PCUR_NOT_POSITIONED), + block_when_stored(), + modify_clock(0), pos_state(BTR_PCUR_NOT_POSITIONED), search_mode(PAGE_CUR_UNSUPP), trx_if_known(NULL), old_rec_buf(NULL), buf_size(0) { diff --git a/storage/innobase/include/btr0sea.h b/storage/innobase/include/btr0sea.h index f09920b1816..f8f2050d3d3 100644 --- a/storage/innobase/include/btr0sea.h +++ b/storage/innobase/include/btr0sea.h @@ -192,8 +192,6 @@ struct btr_search_t{ the machine word, i.e., they cannot be turned into bit-fields. */ buf_block_t* root_guess;/*!< the root page frame when it was last time fetched, or NULL */ - ulint withdraw_clock; /*!< the withdraw clock value of the buffer - pool when root_guess was stored */ #ifdef BTR_CUR_HASH_ADAPT ulint hash_analysis; /*!< when this exceeds BTR_SEARCH_HASH_ANALYSIS, the hash diff --git a/storage/innobase/include/buf0block_hint.h b/storage/innobase/include/buf0block_hint.h new file mode 100644 index 00000000000..ee48e7ce6d2 --- /dev/null +++ b/storage/innobase/include/buf0block_hint.h @@ -0,0 +1,76 @@ +/***************************************************************************** + +Copyright (c) 2020, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2020, MariaDB Corporation. +This program is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License, version 2.0, as published by the +Free Software Foundation. + +This program is also distributed with certain software (including but not +limited to OpenSSL) that is licensed under separate terms, as designated in a +particular file or component or in included license documentation. The authors +of MySQL hereby grant you an additional permission to link the program and +your derivative works with the separately licensed software that they have +included with MySQL. + +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, version 2.0, +for more details. + +You should have received a copy of the GNU General Public License along with +this program; if not, write to the Free Software Foundation, Inc., +51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +*****************************************************************************/ +#pragma once +#include "buf0buf.h" + +namespace buf { +class Block_hint { +public: + /** Stores the pointer to the block, which is currently buffer-fixed. + @param block a pointer to a buffer-fixed block to be stored */ + inline void store(buf_block_t *block) + { + ut_ad(block->page.buf_fix_count()); + m_block= block; + m_page_id= block->page.id(); + } + + /** Clears currently stored pointer. */ + inline void clear() { m_block= nullptr; } + + /** Invoke f on m_block(which may be null) + @param f The function to be executed. It will be passed the pointer. + If you wish to use the block pointer subsequently, + you need to ensure you buffer-fix it before returning from f. + @return the return value of f + */ + template <typename F> + bool run_with_hint(const F &f) + { + buffer_fix_block_if_still_valid(); + /* m_block could be changed during f() call, so we use local + variable to remember which block we need to unfix */ + buf_block_t *block= m_block; + bool res= f(block); + if (block) + buf_block_buf_fix_dec(block); + return res; + } + + buf_block_t *block() const { return m_block; } + + private: + /** The block pointer stored by store(). */ + buf_block_t *m_block= nullptr; + /** If m_block is non-null, the m_block->page.id at time it was stored. */ + page_id_t m_page_id{0, 0}; + + /** A helper function which checks if m_block is not a dangling pointer and + still points to block with page with m_page_id and if so, buffer-fixes it, + otherwise clear()s it */ + void buffer_fix_block_if_still_valid(); +}; +} // namespace buf diff --git a/storage/innobase/include/buf0buf.h b/storage/innobase/include/buf0buf.h index d8e152f1ffa..df52d6b572c 100644 --- a/storage/innobase/include/buf0buf.h +++ b/storage/innobase/include/buf0buf.h @@ -1467,21 +1467,7 @@ public: /** @return whether resize() is in progress */ bool resize_in_progress() const { - return UNIV_UNLIKELY(resizing.load(std::memory_order_relaxed) || - withdrawing.load(std::memory_order_relaxed)); - } - - /** @return the withdraw_clock */ - ulint withdraw_clock() const - { return withdraw_clock_.load(std::memory_order_relaxed); } - - /** Verify the possibility that a stored page is not in buffer pool. - @param withdraw_clock the withdraw clock of the page - @return whether the page might be relocated */ - bool is_obsolete(ulint withdraw_clock) const - { - return UNIV_UNLIKELY(withdrawing.load(std::memory_order_relaxed) || - this->withdraw_clock() != withdraw_clock); + return UNIV_UNLIKELY(resizing.load(std::memory_order_relaxed)); } /** @return the current size in blocks */ @@ -1594,9 +1580,7 @@ public: @return whether block has been created by chunk_t::create() */ bool is_uncompressed(const buf_block_t *block) const { - /* The pointer should be aligned. */ - return !(size_t(block) % sizeof *block) && - is_block_field(reinterpret_cast<const void*>(block)); + return is_block_field(reinterpret_cast<const void*>(block)); } /** Get the page_hash latch for a page */ @@ -2091,13 +2075,6 @@ private: /** whether resize() is in the critical path */ std::atomic<bool> resizing; - - /** whether withdrawing buffer pool pages might cause page relocation */ - std::atomic<bool> withdrawing; - - /** a counter that is incremented every time a pointer to a page may - become obsolete */ - std::atomic<ulint> withdraw_clock_; }; /** The InnoDB buffer pool */ diff --git a/storage/innobase/include/buf0buf.ic b/storage/innobase/include/buf0buf.ic index 3074489527f..4d8cef4c4b2 100644 --- a/storage/innobase/include/buf0buf.ic +++ b/storage/innobase/include/buf0buf.ic @@ -288,8 +288,6 @@ buf_block_buf_fix_dec( /*==================*/ buf_block_t* block) /*!< in/out: block to bufferunfix */ { - block->unfix(); - #ifdef UNIV_DEBUG /* No debug latch is acquired if block belongs to system temporary. Debug latch is not of much help if access to block is single @@ -298,6 +296,8 @@ buf_block_buf_fix_dec( rw_lock_s_unlock(block->debug_latch); } #endif /* UNIV_DEBUG */ + + block->unfix(); } /********************************************************************//** diff --git a/storage/innobase/include/dict0dict.h b/storage/innobase/include/dict0dict.h index b5319d51c9a..276252e625c 100644 --- a/storage/innobase/include/dict0dict.h +++ b/storage/innobase/include/dict0dict.h @@ -1280,7 +1280,7 @@ UNIV_INLINE rw_lock_t* dict_index_get_lock( /*================*/ - dict_index_t* index) /*!< in: index */ + const dict_index_t* index) /*!< in: index */ MY_ATTRIBUTE((nonnull, warn_unused_result)); /********************************************************************//** Returns free space reserved for future updates of records. This is diff --git a/storage/innobase/include/dict0dict.ic b/storage/innobase/include/dict0dict.ic index 4a006471c37..eda639ba7c1 100644 --- a/storage/innobase/include/dict0dict.ic +++ b/storage/innobase/include/dict0dict.ic @@ -914,7 +914,7 @@ UNIV_INLINE rw_lock_t* dict_index_get_lock( /*================*/ - dict_index_t* index) /*!< in: index */ + const dict_index_t* index) /*!< in: index */ { ut_ad(index->magic_n == DICT_INDEX_MAGIC_N); diff --git a/storage/innobase/include/dict0mem.h b/storage/innobase/include/dict0mem.h index 68eb417e531..1ad2517c8fb 100644 --- a/storage/innobase/include/dict0mem.h +++ b/storage/innobase/include/dict0mem.h @@ -298,19 +298,17 @@ parent table will fail, and user has to drop excessive foreign constraint before proceeds. */ #define FK_MAX_CASCADE_DEL 15 -/** Creates a table memory object. -@param[in] name table name -@param[in] space tablespace -@param[in] n_cols total number of columns including virtual and - non-virtual columns -@param[in] n_v_cols number of virtual columns -@param[in] flags table flags -@param[in] flags2 table flags2 -@param[in] init_stats_latch whether to init the stats latch +/** Create a table memory object. +@param name table name +@param space tablespace +@param n_cols total number of columns (both virtual and non-virtual) +@param n_v_cols number of virtual columns +@param flags table flags +@param flags2 table flags2 @return own: table object */ dict_table_t *dict_mem_table_create(const char *name, fil_space_t *space, ulint n_cols, ulint n_v_cols, ulint flags, - ulint flags2, bool init_stats_latch= true); + ulint flags2); /****************************************************************/ /** Free a table memory object. */ void @@ -1118,7 +1116,7 @@ public: when InnoDB was started up */ zip_pad_info_t zip_pad;/*!< Information about state of compression failures and successes */ - rw_lock_t lock; /*!< read-write lock protecting the + mutable rw_lock_t lock; /*!< read-write lock protecting the upper levels of the index tree */ /** Determine if the index has been committed to the @@ -2137,22 +2135,8 @@ public: /*!< set of foreign key constraints which refer to this table */ dict_foreign_set referenced_set; - /** Statistics for query optimization. @{ */ - - /** This latch protects: - dict_table_t::stat_initialized, - dict_table_t::stat_n_rows (*), - dict_table_t::stat_clustered_index_size, - dict_table_t::stat_sum_of_other_index_sizes, - dict_table_t::stat_modified_counter (*), - dict_table_t::indexes*::stat_n_diff_key_vals[], - dict_table_t::indexes*::stat_index_size, - dict_table_t::indexes*::stat_n_leaf_pages. - (*) Those are not always protected for - performance reasons. */ - rw_lock_t stats_latch; - - bool stats_latch_inited= false; + /** Statistics for query optimization. Mostly protected by + dict_sys.mutex. @{ */ /** TRUE if statistics have been calculated the first time after database startup or table creation. */ diff --git a/storage/innobase/include/dict0stats.ic b/storage/innobase/include/dict0stats.ic index 0b8c57a5eba..4972efe8961 100644 --- a/storage/innobase/include/dict0stats.ic +++ b/storage/innobase/include/dict0stats.ic @@ -75,7 +75,7 @@ dict_stats_is_persistent_enabled(const dict_table_t* table) + dict_stats_update(DICT_STATS_RECALC_TRANSIENT) on a table that has just been PS-enabled. This is acceptable. Avoiding this would mean that we would have to - protect the ::stat_persistent with dict_table_t::stats_latch like the + protect the stat_persistent with dict_sys.mutex like the other ::stat_ members which would be too big performance penalty, especially when this function is called from dict_stats_update_if_needed(). */ @@ -178,10 +178,7 @@ dict_stats_deinit( ut_a(table->get_ref_count() == 0); - rw_lock_x_lock(&table->stats_latch); - if (!table->stat_initialized) { - rw_lock_x_unlock(&table->stats_latch); return; } @@ -221,6 +218,4 @@ dict_stats_deinit( sizeof(index->stat_n_leaf_pages)); } #endif /* HAVE_valgrind */ - - rw_lock_x_unlock(&table->stats_latch); } diff --git a/storage/innobase/include/sync0sync.h b/storage/innobase/include/sync0sync.h index be8ad78de82..ce19178a5ad 100644 --- a/storage/innobase/include/sync0sync.h +++ b/storage/innobase/include/sync0sync.h @@ -108,7 +108,6 @@ extern mysql_pfs_key_t trx_i_s_cache_lock_key; extern mysql_pfs_key_t trx_purge_latch_key; extern mysql_pfs_key_t index_tree_rw_lock_key; extern mysql_pfs_key_t index_online_log_key; -extern mysql_pfs_key_t dict_table_stats_key; extern mysql_pfs_key_t trx_sys_rw_lock_key; #endif /* UNIV_PFS_RWLOCK */ diff --git a/storage/innobase/include/trx0undo.h b/storage/innobase/include/trx0undo.h index 37421930b9b..9325f39a309 100644 --- a/storage/innobase/include/trx0undo.h +++ b/storage/innobase/include/trx0undo.h @@ -327,8 +327,6 @@ struct trx_undo_t { (IB_ID_MAX if the undo log is empty) */ buf_block_t* guess_block; /*!< guess for the buffer block where the top page might reside */ - ulint withdraw_clock; /*!< the withdraw clock value of the - buffer pool when guess_block was stored */ /** @return whether the undo log is empty */ bool empty() const { return top_undo_no == IB_ID_MAX; } diff --git a/storage/innobase/row/row0mysql.cc b/storage/innobase/row/row0mysql.cc index c9ccb35ea05..33aa578873f 100644 --- a/storage/innobase/row/row0mysql.cc +++ b/storage/innobase/row/row0mysql.cc @@ -1522,7 +1522,7 @@ error_exit: srv_stats.n_rows_inserted.inc(size_t(trx->id)); } - /* Not protected by dict_table_stats_lock() for performance + /* Not protected by dict_sys.mutex for performance reasons, we would rather get garbage in stat_n_rows (which is just an estimate anyway) than protecting the following code with a latch. */ @@ -1892,7 +1892,7 @@ row_update_for_mysql(row_prebuilt_t* prebuilt) ut_ad(is_delete == (node->is_delete == PLAIN_DELETE)); if (is_delete) { - /* Not protected by dict_table_stats_lock() for performance + /* Not protected by dict_sys.mutex for performance reasons, we would rather get garbage in stat_n_rows (which is just an estimate anyway) than protecting the following code with a latch. */ @@ -2234,8 +2234,7 @@ row_update_cascade_for_mysql( bool stats; if (node->is_delete == PLAIN_DELETE) { - /* Not protected by - dict_table_stats_lock() for + /* Not protected by dict_sys.mutex for performance reasons, we would rather get garbage in stat_n_rows (which is just an estimate anyway) than diff --git a/storage/innobase/row/row0uins.cc b/storage/innobase/row/row0uins.cc index 1529d8050db..114d83c8564 100644 --- a/storage/innobase/row/row0uins.cc +++ b/storage/innobase/row/row0uins.cc @@ -567,7 +567,7 @@ row_undo_ins( } if (err == DB_SUCCESS && node->table->stat_initialized) { - /* Not protected by dict_table_stats_lock() for + /* Not protected by dict_sys.mutex for performance reasons, we would rather get garbage in stat_n_rows (which is just an estimate anyway) than protecting the following code with a latch. */ diff --git a/storage/innobase/sync/sync0debug.cc b/storage/innobase/sync/sync0debug.cc index a41d8a0d4f9..87646867319 100644 --- a/storage/innobase/sync/sync0debug.cc +++ b/storage/innobase/sync/sync0debug.cc @@ -1334,9 +1334,6 @@ sync_latch_meta_init() LATCH_ADD_RWLOCK(INDEX_TREE, SYNC_INDEX_TREE, index_tree_rw_lock_key); - LATCH_ADD_RWLOCK(DICT_TABLE_STATS, SYNC_INDEX_TREE, - dict_table_stats_key); - /* JAN: TODO: Add PFS instrumentation */ LATCH_ADD_MUTEX(DEFRAGMENT_MUTEX, SYNC_NO_ORDER_CHECK, PFS_NOT_INSTRUMENTED); diff --git a/storage/innobase/sync/sync0sync.cc b/storage/innobase/sync/sync0sync.cc index dd78aa9ae14..c2957a3fdcb 100644 --- a/storage/innobase/sync/sync0sync.cc +++ b/storage/innobase/sync/sync0sync.cc @@ -87,7 +87,6 @@ mysql_pfs_key_t buf_block_lock_key; mysql_pfs_key_t buf_block_debug_latch_key; # endif /* UNIV_DEBUG */ mysql_pfs_key_t dict_operation_lock_key; -mysql_pfs_key_t dict_table_stats_key; mysql_pfs_key_t index_tree_rw_lock_key; mysql_pfs_key_t index_online_log_key; mysql_pfs_key_t fil_space_latch_key; diff --git a/storage/innobase/trx/trx0rec.cc b/storage/innobase/trx/trx0rec.cc index 6b0395cef07..52130b50eb1 100644 --- a/storage/innobase/trx/trx0rec.cc +++ b/storage/innobase/trx/trx0rec.cc @@ -1912,8 +1912,6 @@ dberr_t trx_undo_report_rename(trx_t* trx, const dict_table_t* table) if (uint16_t offset = trx_undo_page_report_rename( trx, table, block, &mtr)) { - undo->withdraw_clock - = buf_pool.withdraw_clock(); undo->top_page_no = undo->last_page_no; undo->top_offset = offset; undo->top_undo_no = trx->undo_no++; @@ -2076,7 +2074,6 @@ trx_undo_report_row_operation( mtr_commit(&mtr); } else { /* Success */ - undo->withdraw_clock = buf_pool.withdraw_clock(); mtr_commit(&mtr); undo->top_page_no = undo_block->page.id().page_no(); diff --git a/storage/innobase/trx/trx0undo.cc b/storage/innobase/trx/trx0undo.cc index 1f3ce121c28..67e515127d0 100644 --- a/storage/innobase/trx/trx0undo.cc +++ b/storage/innobase/trx/trx0undo.cc @@ -981,7 +981,6 @@ trx_undo_mem_create( undo->top_undo_no = IB_ID_MAX; undo->top_page_no = page_no; undo->guess_block = NULL; - undo->withdraw_clock = 0; ut_ad(undo->empty()); return(undo); @@ -1157,9 +1156,7 @@ trx_undo_assign(trx_t* trx, dberr_t* err, mtr_t* mtr) if (undo) { return buf_page_get_gen( page_id_t(undo->rseg->space->id, undo->last_page_no), - 0, RW_X_LATCH, - buf_pool.is_obsolete(undo->withdraw_clock) - ? NULL : undo->guess_block, + 0, RW_X_LATCH, undo->guess_block, BUF_GET, __FILE__, __LINE__, mtr, err); } @@ -1213,9 +1210,7 @@ trx_undo_assign_low(trx_t* trx, trx_rseg_t* rseg, trx_undo_t** undo, if (*undo) { return buf_page_get_gen( page_id_t(rseg->space->id, (*undo)->last_page_no), - 0, RW_X_LATCH, - buf_pool.is_obsolete((*undo)->withdraw_clock) - ? NULL : (*undo)->guess_block, + 0, RW_X_LATCH, (*undo)->guess_block, BUF_GET, __FILE__, __LINE__, mtr, err); } diff --git a/storage/maria/ha_maria.cc b/storage/maria/ha_maria.cc index 26066135b2c..8d57959e13a 100644 --- a/storage/maria/ha_maria.cc +++ b/storage/maria/ha_maria.cc @@ -2550,6 +2550,9 @@ int ha_maria::info(uint flag) MARIA_INFO maria_info; char name_buff[FN_REFLEN]; + if (!file) + return 0; + (void) maria_status(file, &maria_info, flag); if (flag & HA_STATUS_VARIABLE) { diff --git a/storage/mroonga/vendor/groonga/CMakeLists.txt b/storage/mroonga/vendor/groonga/CMakeLists.txt index 564e859d146..d271d4c4eb9 100644 --- a/storage/mroonga/vendor/groonga/CMakeLists.txt +++ b/storage/mroonga/vendor/groonga/CMakeLists.txt @@ -240,7 +240,6 @@ include(build/ac_macros/check_functions.m4) ac_check_symbols(fpclassify math.h) ac_check_lib(m fpclassify) -ac_check_lib(dl dlopen) ac_check_lib(execinfo backtrace) if(HAVE_LIBEXECINFO) set(HAVE_BACKTRACE TRUE) diff --git a/storage/mroonga/vendor/groonga/lib/CMakeLists.txt b/storage/mroonga/vendor/groonga/lib/CMakeLists.txt index 21628b26ce2..8c71563f722 100644 --- a/storage/mroonga/vendor/groonga/lib/CMakeLists.txt +++ b/storage/mroonga/vendor/groonga/lib/CMakeLists.txt @@ -97,7 +97,7 @@ set(GRN_ALL_LIBRARIES ${LZ4_LIBS} ${LIBZSTD_LIBS} ${MESSAGE_PACK_LIBS} - ${DL_LIBS} + ${CMAKE_DL_LIBS} ${M_LIBS} ${WS2_32_LIBS} ${MRUBY_LIBS} diff --git a/storage/rocksdb/build_rocksdb.cmake b/storage/rocksdb/build_rocksdb.cmake index 2b4649b1fbe..5f1566edcf5 100644 --- a/storage/rocksdb/build_rocksdb.cmake +++ b/storage/rocksdb/build_rocksdb.cmake @@ -160,7 +160,7 @@ find_package(Threads REQUIRED) if(WIN32) set(SYSTEM_LIBS ${SYSTEM_LIBS} Shlwapi.lib Rpcrt4.lib) else() - set(SYSTEM_LIBS ${CMAKE_THREAD_LIBS_INIT} ${LIBRT} ${LIBDL}) + set(SYSTEM_LIBS ${CMAKE_THREAD_LIBS_INIT} ${LIBRT} ${CMAKE_DL_LIBS}) endif() set(ROCKSDB_LIBS rocksdblib}) diff --git a/storage/tokudb/hatoku_hton.cc b/storage/tokudb/hatoku_hton.cc index a52f64dc807..c4d2cbf20a0 100644 --- a/storage/tokudb/hatoku_hton.cc +++ b/storage/tokudb/hatoku_hton.cc @@ -26,6 +26,7 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved. #include "hatoku_hton.h" #include "PerconaFT/src/ydb.h" +#include <mutex> #define TOKU_METADB_NAME "tokudb_meta" @@ -239,6 +240,7 @@ tokudb::thread::rwlock_t tokudb_hton_initialized_lock; static SHOW_VAR *toku_global_status_variables = NULL; static uint64_t toku_global_status_max_rows; static TOKU_ENGINE_STATUS_ROW_S* toku_global_status_rows = NULL; +static std::mutex toku_global_status_rows_mutex; static void handle_ydb_error(int error) { switch (error) { @@ -1901,6 +1903,7 @@ static int show_tokudb_vars(TOKUDB_UNUSED(THD* thd), const int panic_string_len = 1024; char panic_string[panic_string_len] = {'\0'}; fs_redzone_state redzone_state; + const std::lock_guard<std::mutex> lock(toku_global_status_rows_mutex); uint64_t num_rows; error = db_env->get_engine_status( diff --git a/strings/json_lib.c b/strings/json_lib.c index 42bec2c3f79..772f6029e77 100644 --- a/strings/json_lib.c +++ b/strings/json_lib.c @@ -910,7 +910,7 @@ int json_read_keyname_chr(json_engine_t *j) case S_QUOTE: for (;;) /* Skip spaces until ':'. */ { - if ((c_len= json_next_char(&j->s) > 0)) + if ((c_len= json_next_char(&j->s)) > 0) { if (j->s.c_next == ':') { diff --git a/wsrep-lib b/wsrep-lib -Subproject ae4e58ba031587039c8830f2f8ca51fa9fb7d6e +Subproject 2da6e4894e1df5d1db51db2bbc49255e02251b9 |