summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--extra/mariabackup/xtrabackup.cc153
-rw-r--r--include/my_sys.h9
-rw-r--r--include/mysql_version.h.in7
m---------libmariadb0
-rw-r--r--mysql-test/main/case.result6
-rw-r--r--mysql-test/main/derived_cond_pushdown.result16
-rw-r--r--mysql-test/main/func_json.result5
-rw-r--r--mysql-test/main/func_json.test1
-rw-r--r--mysql-test/main/func_math.result5
-rw-r--r--mysql-test/main/func_math.test5
-rw-r--r--mysql-test/main/func_test.result19
-rw-r--r--mysql-test/main/func_test.test17
-rw-r--r--mysql-test/main/grant5.result32
-rw-r--r--mysql-test/main/grant5.test18
-rw-r--r--mysql-test/main/parser.result19
-rw-r--r--mysql-test/main/parser.test16
-rw-r--r--mysql-test/main/parser_precedence.result748
-rw-r--r--mysql-test/main/parser_precedence.test335
-rw-r--r--mysql-test/main/precedence.result8019
-rw-r--r--mysql-test/main/precedence.test4788
-rw-r--r--mysql-test/main/precedence_bugs.result60
-rw-r--r--mysql-test/main/precedence_bugs.test41
-rw-r--r--mysql-test/main/view.result11
-rw-r--r--mysql-test/main/view.test11
-rw-r--r--mysql-test/suite/encryption/r/tempfiles_encrypted.result3951
-rw-r--r--mysql-test/suite/encryption/t/tempfiles_encrypted.opt1
-rw-r--r--mysql-test/suite/encryption/t/tempfiles_encrypted.test31
-rw-r--r--mysql-test/suite/galera/r/MDEV-22707.result26
-rw-r--r--mysql-test/suite/galera/t/MDEV-22707.test51
-rw-r--r--mysql-test/suite/innodb/include/wait_all_purged.inc24
-rw-r--r--mysql-test/suite/innodb/r/innodb-virtual-columns.result50
-rw-r--r--mysql-test/suite/mariabackup/ddl_incremental_encrypted.opt7
-rw-r--r--mysql-test/suite/mariabackup/ddl_incremental_encrypted.result26
-rw-r--r--mysql-test/suite/mariabackup/ddl_incremental_encrypted.test66
-rw-r--r--mysql-test/suite/mariabackup/mlog_index_load.result1
-rw-r--r--mysql-test/suite/mariabackup/mlog_index_load.test1
-rw-r--r--mysql-test/suite/roles/set_default_role_clear.result1
-rw-r--r--mysql-test/suite/roles/set_default_role_for.result2
-rw-r--r--mysql-test/suite/roles/set_default_role_invalid.result3
-rw-r--r--mysql-test/suite/roles/set_default_role_new_connection.result2
-rw-r--r--mysql-test/suite/sys_vars/r/session_track_system_variables_basic.result2
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_innodb.result16
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_server_embedded.result2
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result2
-rw-r--r--mysql-test/suite/sys_vars/t/session_track_system_variables_basic.test2
-rw-r--r--mysys/mf_iocache.c6
-rw-r--r--plugin/auth_gssapi/CMakeLists.txt5
-rw-r--r--plugin/auth_pam/CMakeLists.txt34
-rw-r--r--plugin/auth_pam/auth_pam.c1
-rw-r--r--plugin/auth_pam/config.h.cmake5
-rw-r--r--plugin/auth_pam/mapper/pam_user_map.c30
-rw-r--r--sql/item.h19
-rw-r--r--sql/item_cmpfunc.cc29
-rw-r--r--sql/item_cmpfunc.h19
-rw-r--r--sql/item_func.cc3
-rw-r--r--sql/item_jsonfunc.cc2
-rw-r--r--sql/item_subselect.cc2
-rw-r--r--sql/item_subselect.h2
-rw-r--r--sql/item_timefunc.cc4
-rw-r--r--sql/item_timefunc.h2
-rw-r--r--sql/mf_iocache_encr.cc10
-rw-r--r--sql/session_tracker.cc3
-rw-r--r--sql/sql_acl.cc54
-rw-r--r--sql/sql_base.cc5
-rw-r--r--sql/sql_yacc.yy132
-rw-r--r--sql/sql_yacc_ora.yy132
-rw-r--r--sql/sys_vars.cc2
-rw-r--r--storage/connect/global.h56
-rw-r--r--storage/connect/ha_connect.cc256
-rw-r--r--storage/connect/ha_connect.h4
-rw-r--r--storage/connect/json.cpp164
-rw-r--r--storage/connect/json.h57
-rw-r--r--storage/connect/jsonudf.cpp550
-rw-r--r--storage/connect/jsonudf.h39
-rw-r--r--storage/connect/mongo.cpp10
-rw-r--r--storage/connect/mysql-test/connect/r/json_java_2.result36
-rw-r--r--storage/connect/mysql-test/connect/r/json_java_3.result36
-rw-r--r--storage/connect/mysql-test/connect/r/json_mongo_c.result36
-rw-r--r--storage/connect/mysql-test/connect/r/updelx.result4
-rw-r--r--storage/connect/mysql-test/connect/t/updelx.test4
-rw-r--r--storage/connect/myutil.h4
-rw-r--r--storage/connect/plgdbutl.cpp20
-rw-r--r--storage/connect/plugutil.cpp67
-rw-r--r--storage/connect/tabjson.cpp141
-rw-r--r--storage/connect/tabjson.h4
-rw-r--r--storage/connect/tabrest.cpp28
-rw-r--r--storage/connect/tabxml.cpp9
-rw-r--r--storage/connect/user_connect.cc20
-rw-r--r--storage/connect/value.cpp9
-rw-r--r--storage/connect/value.h7
-rw-r--r--storage/innobase/CMakeLists.txt1
-rw-r--r--storage/innobase/btr/btr0bulk.cc4
-rw-r--r--storage/innobase/btr/btr0cur.cc43
-rw-r--r--storage/innobase/btr/btr0pcur.cc39
-rw-r--r--storage/innobase/buf/buf0block_hint.cc78
-rw-r--r--storage/innobase/buf/buf0buf.cc76
-rw-r--r--storage/innobase/dict/dict0dict.cc149
-rw-r--r--storage/innobase/dict/dict0mem.cc48
-rw-r--r--storage/innobase/dict/dict0stats.cc10
-rw-r--r--storage/innobase/fil/fil0crypt.cc2
-rw-r--r--storage/innobase/fts/fts0ast.cc8
-rw-r--r--storage/innobase/fts/fts0que.cc31
-rw-r--r--storage/innobase/gis/gis0sea.cc25
-rw-r--r--storage/innobase/handler/ha_innodb.cc35
-rw-r--r--storage/innobase/ibuf/ibuf0ibuf.cc2
-rw-r--r--storage/innobase/include/btr0pcur.h11
-rw-r--r--storage/innobase/include/buf0block_hint.h77
-rw-r--r--storage/innobase/include/buf0buf.h17
-rw-r--r--storage/innobase/include/buf0buf.ic37
-rw-r--r--storage/innobase/include/dict0dict.h25
-rw-r--r--storage/innobase/include/dict0mem.h115
-rw-r--r--storage/innobase/include/mtr0mtr.ic4
-rw-r--r--storage/innobase/include/os0once.h120
-rw-r--r--storage/innobase/include/trx0sys.h4
-rw-r--r--storage/innobase/include/trx0undo.h4
-rw-r--r--storage/innobase/lock/lock0lock.cc2
-rw-r--r--storage/innobase/mtr/mtr0mtr.cc4
-rw-r--r--storage/innobase/page/page0zip.cc2
-rw-r--r--storage/innobase/trx/trx0rec.cc2
-rw-r--r--storage/innobase/trx/trx0undo.cc9
-rw-r--r--strings/json_lib.c2
122 files changed, 19101 insertions, 2556 deletions
diff --git a/.gitignore b/.gitignore
index 76c2122428d..f5a365a42e7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -100,6 +100,7 @@ pcre/pcre_chartables.c
pcre/pcregrep
pcre/pcretest
pcre/test*grep
+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/extra/mariabackup/xtrabackup.cc b/extra/mariabackup/xtrabackup.cc
index 8693165f350..5cb0aca60bf 100644
--- a/extra/mariabackup/xtrabackup.cc
+++ b/extra/mariabackup/xtrabackup.cc
@@ -2530,17 +2530,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;
@@ -2584,7 +2591,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) {
@@ -2595,18 +2602,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;
}
@@ -2627,7 +2627,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;
}
}
@@ -2636,8 +2636,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;
}
@@ -2651,8 +2651,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);
@@ -2661,8 +2661,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*/
@@ -2672,8 +2672,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);
@@ -2970,9 +2970,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);
@@ -4570,7 +4570,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);
@@ -5130,22 +5130,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;
}
@@ -5182,17 +5226,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+1];
@@ -5227,7 +5272,7 @@ xb_process_datadir(
suffix)) {
if (!func(
path, NULL,
- fileinfo.name, NULL))
+ fileinfo.name, func_arg))
{
os_file_closedir(dbdir);
return(FALSE);
@@ -5291,7 +5336,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);
@@ -5451,6 +5496,12 @@ 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 = hash_create(1000);
+ ut_ad(inc_dir_tables_hash);
+ }
+
/* Fix DDL for prepare. Process .del,.ren, and .new files.
The order in which files are processed, is important
(see MDEV-18185, MDEV-18201)
@@ -5462,6 +5513,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);
@@ -5545,8 +5598,6 @@ static bool xtrabackup_prepare_func(char** argv)
goto error_cleanup;
}
- inc_dir_tables_hash = hash_create(1000);
-
ok = xtrabackup_apply_deltas();
xb_data_files_close();
diff --git a/include/my_sys.h b/include/my_sys.h
index 60f5613eec1..70dc12cc28f 100644
--- a/include/my_sys.h
+++ b/include/my_sys.h
@@ -480,18 +480,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;
#ifdef HAVE_AIOWAIT
/*
As inidicated by ifdef, this is for async I/O, which is not currently
diff --git a/include/mysql_version.h.in b/include/mysql_version.h.in
index 59df2b7c086..da572953fc5 100644
--- a/include/mysql_version.h.in
+++ b/include/mysql_version.h.in
@@ -17,13 +17,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/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 542397755dc..7de4253593f 100644
--- a/mysql-test/main/derived_cond_pushdown.result
+++ b/mysql-test/main/derived_cond_pushdown.result
@@ -10068,11 +10068,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": {
@@ -10117,11 +10117,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": {
@@ -10166,11 +10166,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": {
@@ -10215,7 +10215,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,
@@ -10227,7 +10227,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 969a79f00b3..94c3a0d6c0c 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 e03e304a0da..a246113d210 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 bf8e25b4ee1..92b56cb4de4 100644
--- a/mysql-test/main/func_math.result
+++ b/mysql-test/main/func_math.result
@@ -1766,11 +1766,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 f169ae0c326..70adff02a22 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 8fec77cdba4..abf17d736a7 100644
--- a/mysql-test/main/grant5.result
+++ b/mysql-test/main/grant5.result
@@ -38,6 +38,38 @@ connection default;
disconnect u1;
drop user u1@localhost;
drop database mysqltest1;
+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`@`%`
+SET ROLE test_role;
+SET DEFAULT ROLE test_role;
+SHOW GRANTS;
+Grants for root@localhost
+GRANT `test_role` TO `root`@`localhost` WITH ADMIN OPTION
+GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` WITH GRANT OPTION
+GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
+GRANT USAGE ON *.* TO `test_role`
+SET DEFAULT ROLE test_role FOR 'root'@'localhost'
+SET DEFAULT ROLE NONE;
+SHOW GRANTS;
+Grants for root@localhost
+GRANT `test_role` TO `root`@`localhost` WITH ADMIN OPTION
+GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` WITH GRANT OPTION
+GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
+GRANT USAGE ON *.* TO `test_role`
+DROP USER test_user;
+DROP ROLE test_role;
#
# MDEV-20076: SHOW GRANTS does not quote role names properly
#
diff --git a/mysql-test/main/grant5.test b/mysql-test/main/grant5.test
index 9d882ee40a9..703d87f08cc 100644
--- a/mysql-test/main/grant5.test
+++ b/mysql-test/main/grant5.test
@@ -52,6 +52,24 @@ 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;
+SET DEFAULT ROLE NONE for test_user;
+SHOW GRANTS FOR test_user;
+SET ROLE test_role;
+SET DEFAULT ROLE test_role;
+SHOW GRANTS;
+SET DEFAULT ROLE NONE;
+SHOW GRANTS;
+DROP USER test_user;
+DROP ROLE test_role;
+
+#
# End of 10.1 tests
#
diff --git a/mysql-test/main/parser.result b/mysql-test/main/parser.result
index f66fa7c457f..1c58c7379e4 100644
--- a/mysql-test/main/parser.result
+++ b/mysql-test/main/parser.result
@@ -1314,6 +1314,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
#
@@ -1767,4 +1784,4 @@ 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
diff --git a/mysql-test/main/parser.test b/mysql-test/main/parser.test
index 5a2d0294171..9fb68b92b8f 100644
--- a/mysql-test/main/parser.test
+++ b/mysql-test/main/parser.test
@@ -1343,6 +1343,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 #
@@ -1547,4 +1561,4 @@ 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
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/view.result b/mysql-test/main/view.result
index 671eb1e32a0..b6ad828e43a 100644
--- a/mysql-test/main/view.result
+++ b/mysql-test/main/view.result
@@ -6593,17 +6593,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 ef42cf08df7..6e7b0adfbc3 100644
--- a/mysql-test/main/view.test
+++ b/mysql-test/main/view.test
@@ -6302,17 +6302,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
new file mode 100644
index 00000000000..09512363be4
--- /dev/null
+++ b/mysql-test/suite/encryption/r/tempfiles_encrypted.result
@@ -0,0 +1,3951 @@
+#
+# Tests when the temporary files are encrypted
+#
+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-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
diff --git a/mysql-test/suite/encryption/t/tempfiles_encrypted.opt b/mysql-test/suite/encryption/t/tempfiles_encrypted.opt
new file mode 100644
index 00000000000..81877a8d1c5
--- /dev/null
+++ b/mysql-test/suite/encryption/t/tempfiles_encrypted.opt
@@ -0,0 +1 @@
+--encrypt-tmp_files=ON
diff --git a/mysql-test/suite/encryption/t/tempfiles_encrypted.test b/mysql-test/suite/encryption/t/tempfiles_encrypted.test
new file mode 100644
index 00000000000..962893df3f9
--- /dev/null
+++ b/mysql-test/suite/encryption/t/tempfiles_encrypted.test
@@ -0,0 +1,31 @@
+--echo #
+--echo # Tests when the temporary files are encrypted
+--echo #
+
+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
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/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/innodb/include/wait_all_purged.inc b/mysql-test/suite/innodb/include/wait_all_purged.inc
index 992e14f0843..e3a506c7622 100644
--- a/mysql-test/suite/innodb/include/wait_all_purged.inc
+++ b/mysql-test/suite/innodb/include/wait_all_purged.inc
@@ -1,25 +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;
-while ($wait_counter)
+if ($wait_all_purged)
{
- --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;
- }
+ eval SET GLOBAL innodb_max_purge_lag_wait= $wait_all_purged;
}
+--enable_query_log
+
+--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/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..9349457ffbb
--- /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 server
+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
index bc83981106e..8925e897399 100644
--- a/mysql-test/suite/mariabackup/mlog_index_load.result
+++ b/mysql-test/suite/mariabackup/mlog_index_load.result
@@ -1,5 +1,6 @@
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
diff --git a/mysql-test/suite/mariabackup/mlog_index_load.test b/mysql-test/suite/mariabackup/mlog_index_load.test
index fb29041fd3c..b9fd6f8ca32 100644
--- a/mysql-test/suite/mariabackup/mlog_index_load.test
+++ b/mysql-test/suite/mariabackup/mlog_index_load.test
@@ -2,6 +2,7 @@
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;
diff --git a/mysql-test/suite/roles/set_default_role_clear.result b/mysql-test/suite/roles/set_default_role_clear.result
index 56e9662154c..05d52b6d58a 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 a3cd896ee84..b67b30ee075 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'
insert ignore into mysql.user (user, host) values ('someuser', 'somehost');
diff --git a/mysql-test/suite/roles/set_default_role_invalid.result b/mysql-test/suite/roles/set_default_role_invalid.result
index 9ebe3069b4c..4417ef21f21 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 03575e8aa8a..eaa42193d6e 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/sys_vars/r/session_track_system_variables_basic.result b/mysql-test/suite/sys_vars/r/session_track_system_variables_basic.result
index 90d2fec3d0a..377b50e4481 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
@@ -153,6 +153,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 2bd2920ff9d..b43e9f1adc0 100644
--- a/mysql-test/suite/sys_vars/r/sysvars_innodb.result
+++ b/mysql-test/suite/sys_vars/r/sysvars_innodb.result
@@ -1307,10 +1307,10 @@ READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME INNODB_LOG_OPTIMIZE_DDL
SESSION_VALUE NULL
-DEFAULT_VALUE ON
+DEFAULT_VALUE OFF
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BOOLEAN
-VARIABLE_COMMENT Reduce redo logging when natively creating indexes or rebuilding tables. Setting this OFF avoids delay due to page flushing and allows concurrent backup.
+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.
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
@@ -1401,6 +1401,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/r/sysvars_server_embedded.result b/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result
index 0cbf4a9a2b2..fbf6e37e715 100644
--- a/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result
+++ b/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result
@@ -2267,7 +2267,7 @@ VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BIGINT
VARIABLE_COMMENT Size of the statement digest. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
-NUMERIC_MAX_VALUE 200
+NUMERIC_MAX_VALUE 1048576
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY YES
diff --git a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result
index f65be0f3159..9dee77a9110 100644
--- a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result
+++ b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result
@@ -2417,7 +2417,7 @@ VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BIGINT
VARIABLE_COMMENT Size of the statement digest. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
-NUMERIC_MAX_VALUE 200
+NUMERIC_MAX_VALUE 1048576
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY YES
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 2cb51e3e968..ceb2353d823 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/mysys/mf_iocache.c b/mysys/mf_iocache.c
index 9b3fd6a97b8..917ccd160ee 100644
--- a/mysys/mf_iocache.c
+++ b/mysys/mf_iocache.c
@@ -250,7 +250,7 @@ int init_io_cache(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)
@@ -324,14 +324,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(master->buffer_length, MYF(0))))
+ if (!(slave_buf= (uchar*)my_malloc(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 bca4f5af3a1..4d3718dd471 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})
INCLUDE(CheckCXXSymbolExists)
diff --git a/plugin/auth_pam/CMakeLists.txt b/plugin/auth_pam/CMakeLists.txt
index 5366246745e..ff7ba4a4f68 100644
--- a/plugin/auth_pam/CMakeLists.txt
+++ b/plugin/auth_pam/CMakeLists.txt
@@ -5,23 +5,31 @@ 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
MYSQL_ADD_PLUGIN(auth_pam auth_pam.c LINK_LIBRARIES pam MODULE_ONLY)
@@ -37,3 +45,5 @@ IF(HAVE_PAM_APPL_H)
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 fae73aea690..c80ec51b48d 100644
--- a/plugin/auth_pam/auth_pam.c
+++ b/plugin/auth_pam/auth_pam.c
@@ -16,6 +16,7 @@
#define _GNU_SOURCE 1 /* for strndup */
+#include <config_auth_pam.h>
#include <mysql/plugin_auth.h>
#include <stdio.h>
#include <string.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/sql/item.h b/sql/item.h
index 1b77a2f5466..c3675adb74f 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -116,20 +116,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
};
@@ -1454,6 +1453,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);
/**
@@ -4974,7 +4975,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 2d4501ed222..195d30c222b 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -2251,7 +2251,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 "));
@@ -3238,27 +3238,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(' ');
}
@@ -5232,12 +5233,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 f22ef0a6c3c..dfbba3fdca9 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
@@ -595,7 +595,7 @@ public:
longlong val_int();
enum Functype functype() const { return NOT_FUNC; }
const char *func_name() const { return "not"; }
- enum precedence precedence() const { return BANG_PRECEDENCE; }
+ enum precedence precedence() const { return NEG_PRECEDENCE; }
Item *neg_transformer(THD *thd);
bool fix_fields(THD *, Item **);
virtual void print(String *str, enum_query_type query_type);
@@ -2115,9 +2115,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)
@@ -2132,7 +2134,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; }
};
@@ -2397,7 +2398,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);
void fix_after_pullout(st_select_lex *new_parent, Item **ref, bool merge);
bool count_sargable_conds(void *arg);
@@ -2712,7 +2713,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()
{
@@ -2840,7 +2841,7 @@ public:
bool fix_fields(THD *thd, Item **ref);
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 c343fe26248..43aeba9d56a 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -621,8 +621,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 7e99a845194..082d7935360 100644
--- a/sql/item_jsonfunc.cc
+++ b/sql/item_jsonfunc.cc
@@ -2431,6 +2431,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 bc5111667ff..3e49f893ee3 100644
--- a/sql/item_subselect.cc
+++ b/sql/item_subselect.cc
@@ -3285,7 +3285,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 52480743855..1cea7291c9e 100644
--- a/sql/item_subselect.h
+++ b/sql/item_subselect.h
@@ -629,7 +629,7 @@ public:
bool val_bool();
bool test_limit(st_select_lex_unit *unit);
void print(String *str, enum_query_type query_type);
- 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();
void fix_after_pullout(st_select_lex *new_parent, Item **ref, bool merge);
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc
index 9bdbcf82f2b..cb5754c3b05 100644
--- a/sql/item_timefunc.cc
+++ b/sql/item_timefunc.cc
@@ -2241,9 +2241,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 8b39092e09a..518b573173f 100644
--- a/sql/item_timefunc.h
+++ b/sql/item_timefunc.h
@@ -989,7 +989,7 @@ public:
bool get_date(MYSQL_TIME *res, ulonglong fuzzy_date);
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 35cd55394a9..3ddece6039b 100644
--- a/sql/session_tracker.cc
+++ b/sql/session_tracker.cc
@@ -443,8 +443,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/sql_acl.cc b/sql/sql_acl.cc
index d8a81cea53c..c4b8d41d04c 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -236,8 +236,9 @@ static void update_hostname(acl_host_and_ip *host, const char *hostname);
static ulong get_sort(uint count,...);
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 *,
@@ -8508,7 +8509,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)))
@@ -8734,7 +8735,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 */
@@ -8791,6 +8792,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);
@@ -8817,15 +8826,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);
@@ -8866,7 +8904,7 @@ static bool show_global_privileges(THD *thd, ACL_USER_BASE *acl_entry,
ulong want_access;
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 "));
@@ -8959,7 +8997,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 00e1198df0e..89a58bae272 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -1914,7 +1914,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_yacc.yy b/sql/sql_yacc.yy
index 0d25d0f7c1e..18fe94dd62a 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
@@ -884,10 +892,9 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
%parse-param { THD *thd }
%lex-param { THD *thd }
/*
- Currently there are 52 shift/reduce conflicts.
- We should not introduce new conflicts any more.
+ We should not introduce any further shift/reduce conflicts.
*/
-%expect 51
+%expect 67
/*
Comments for TOKENS.
@@ -1664,16 +1671,6 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
%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
@@ -1683,10 +1680,12 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
%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
@@ -1694,8 +1693,8 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
%left '*' '/' '%' DIV_SYM MOD_SYM
%left '^'
%left MYSQL_CONCAT_SYM
-%left NEG '~' NOT2_SYM BINARY
-%left COLLATE_SYM
+%nonassoc NEG '~' NOT2_SYM BINARY
+%nonassoc COLLATE_SYM
/*
Tokens that can change their meaning from identifier to something else
@@ -1939,7 +1938,6 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
select_sublist_qualified_asterisk
expr_or_default set_expr_or_default
geometry_function signed_literal expr_or_literal
- opt_escape
sp_opt_default
simple_ident_nospvar
field_or_var limit_option
@@ -9790,59 +9788,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))
@@ -9864,13 +9862,13 @@ bool_pri:
;
predicate:
- bit_expr IN_SYM '(' subselect ')'
+ predicate IN_SYM '(' subselect ')'
{
$$= new (thd->mem_root) Item_in_subselect(thd, $1, $4);
if (unlikely($$ == NULL))
MYSQL_YYABORT;
}
- | bit_expr not IN_SYM '(' subselect ')'
+ | predicate not IN_SYM '(' subselect ')'
{
Item *item= new (thd->mem_root) Item_in_subselect(thd, $1, $5);
if (unlikely(item == NULL))
@@ -9879,27 +9877,27 @@ predicate:
if (unlikely($$ == NULL))
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);
@@ -9908,13 +9906,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);
@@ -9922,7 +9920,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);
@@ -9932,28 +9930,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);
}
- | bit_expr REGEXP bit_expr
+ | 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);
+ }
+ | 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))
@@ -12557,23 +12568,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/sql_yacc_ora.yy b/sql/sql_yacc_ora.yy
index c2684c3ea7f..735d5ad59a2 100644
--- a/sql/sql_yacc_ora.yy
+++ b/sql/sql_yacc_ora.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
@@ -278,10 +286,9 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
%parse-param { THD *thd }
%lex-param { THD *thd }
/*
- Currently there are 55 shift/reduce conflicts.
- We should not introduce new conflicts any more.
+ We should not introduce any further shift/reduce conflicts.
*/
-%expect 54
+%expect 70
/*
Comments for TOKENS.
@@ -1058,16 +1065,6 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
%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
@@ -1077,10 +1074,12 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
%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
@@ -1088,8 +1087,8 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
%left '*' '/' '%' DIV_SYM MOD_SYM
%left '^'
%left MYSQL_CONCAT_SYM
-%left NEG '~' NOT2_SYM BINARY
-%left COLLATE_SYM
+%nonassoc NEG '~' NOT2_SYM BINARY
+%nonassoc COLLATE_SYM
/*
Tokens that can change their meaning from identifier to something else
@@ -1340,7 +1339,6 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
select_sublist_qualified_asterisk
expr_or_default set_expr_or_default
geometry_function signed_literal expr_or_literal
- opt_escape
sp_opt_default
simple_ident_nospvar
field_or_var limit_option
@@ -9735,59 +9733,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))
@@ -9809,13 +9807,13 @@ bool_pri:
;
predicate:
- bit_expr IN_SYM '(' subselect ')'
+ predicate IN_SYM '(' subselect ')'
{
$$= new (thd->mem_root) Item_in_subselect(thd, $1, $4);
if (unlikely($$ == NULL))
MYSQL_YYABORT;
}
- | bit_expr not IN_SYM '(' subselect ')'
+ | predicate not IN_SYM '(' subselect ')'
{
Item *item= new (thd->mem_root) Item_in_subselect(thd, $1, $5);
if (unlikely(item == NULL))
@@ -9824,27 +9822,27 @@ predicate:
if (unlikely($$ == NULL))
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);
@@ -9853,13 +9851,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);
@@ -9867,7 +9865,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);
@@ -9877,28 +9875,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);
}
- | bit_expr REGEXP bit_expr
+ | 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);
+ }
+ | 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))
@@ -12501,23 +12512,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/sys_vars.cc b/sql/sys_vars.cc
index b096c8c5a12..60308e4413c 100644
--- a/sql/sys_vars.cc
+++ b/sql/sys_vars.cc
@@ -325,7 +325,7 @@ static Sys_var_long Sys_pfs_digest_size(
"Size of the statement digest."
" Use 0 to disable, -1 for automated sizing.",
PARSED_EARLY READ_ONLY GLOBAL_VAR(pfs_param.m_digest_sizing),
- CMD_LINE(REQUIRED_ARG), VALID_RANGE(-1, 200),
+ CMD_LINE(REQUIRED_ARG), VALID_RANGE(-1, 1024 * 1024),
DEFAULT(-1),
BLOCK_SIZE(1));
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 53e9c112ab8..8894a16c2a9 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__;
char slash= '\\';
#else // !__WIN__
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
};
@@ -1311,9 +1337,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
@@ -1565,8 +1592,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;
@@ -1575,6 +1603,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:
@@ -1584,7 +1615,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:
@@ -1638,7 +1669,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;
@@ -2211,7 +2242,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());
@@ -4970,7 +5001,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);
@@ -5320,91 +5351,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
/**
@@ -6026,7 +6066,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
@@ -6220,7 +6260,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
@@ -6973,7 +7013,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;
@@ -7345,7 +7385,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),
@@ -7371,7 +7413,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 3e4474d140e..b7090be8b27 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 98a4659cea8..ea3ea18da0b 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)
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 d5bd1215e77..f16aaa80803 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
@@ -4423,13 +4404,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. */
@@ -4497,6 +4480,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
@@ -5626,20 +5610,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);
@@ -5654,7 +5637,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;
@@ -5666,7 +5649,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. */
@@ -5757,7 +5745,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
@@ -5774,6 +5762,478 @@ 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) {
+ if (g->Message)
+ str = PlugDup(g, g->Message);
+ else
+ str = PlugDup(g, "Unexpected error");
+
+ } // 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 e296553d8e2..7bc7c5f592b 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: */
/* ----------------------- */
@@ -1242,7 +1242,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) {
@@ -1258,7 +1258,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.
@@ -1290,7 +1290,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
@@ -1340,7 +1340,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
@@ -1392,13 +1392,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);
@@ -1414,7 +1414,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 e74937b942a..0ab594f5533 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: %s\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 %s area for request of %u (used=%d free=%d)",
- pname, (uint)size, pph->To_Free, pph->FreeBlk);
+ "Not enough memory in %s area for request of %zd (used=%zd free=%zd)",
+ pname, size, pph->To_Free, pph->FreeBlk);
if (trace(1))
htrc("PlugSubAlloc: %s\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 3b0d458a7a6..cdf9e40f97c 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. */
@@ -254,12 +242,14 @@ int JSONDISC::GetColumns(PGLOBAL g, PCSZ db, PCSZ dsn, PTOS topt)
jsp = (tjsp->GetDoc()) ? tjsp->GetDoc()->GetValue(0) : NULL;
} else {
- if (!(tdp->Lrecl = GetIntegerTableOption(g, topt, "Lrecl", 0)))
- if (!mgo) {
- sprintf(g->Message, "LRECL must be specified for pretty=%d", tdp->Pretty);
- return 0;
- } else
- tdp->Lrecl = 8192; // Should be enough
+ if (!((tdp->Lrecl = GetIntegerTableOption(g, topt, "Lrecl", 0)))) {
+ if (!mgo) {
+ sprintf(g->Message, "LRECL must be specified for pretty=%d", tdp->Pretty);
+ return 0;
+ } else
+ tdp->Lrecl = 8192; // Should be enough
+
+ } // endif Lrecl
tdp->Ending = GetIntegerTableOption(g, topt, "Ending", CRLF);
@@ -304,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;
@@ -401,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();
@@ -480,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
@@ -1329,7 +1330,7 @@ bool JSONCOL::ParseJpath(PGLOBAL g)
{
char *p, *p1 = NULL, *p2 = NULL, *pbuf = NULL;
int i;
- bool a, mul = false;
+ bool a;
if (Parsed)
return false; // Already done
@@ -1486,7 +1487,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;
@@ -1559,7 +1571,6 @@ void JSONCOL::ReadColumn(PGLOBAL g)
PVAL JSONCOL::GetColumnValue(PGLOBAL g, PJSON row, int i)
{
int n = Nod - 1;
- bool expd = false;
PJAR arp;
PJVAL val = NULL;
@@ -1983,8 +1994,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;
@@ -2027,22 +2039,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);
@@ -2053,15 +2082,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");
@@ -2070,7 +2099,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) {
@@ -2081,7 +2110,7 @@ int TDBJSON::MakeDocument(PGLOBAL g)
} // endif
jsp = val->GetJson();
- } // endfor objpath
+ } // endfor p
} // endif objpath
@@ -2119,13 +2148,15 @@ int TDBJSON::Cardinality(PGLOBAL g)
{
if (!g)
return (Xcol || Multiple) ? 0 : 1;
- else if (Cardinal < 0)
- if (!Multiple) {
- if (MakeDocument(g) == RC_OK)
- Cardinal = Doc->size();
+ else if (Cardinal < 0) {
+ if (!Multiple) {
+ if (MakeDocument(g) == RC_OK)
+ Cardinal = Doc->size();
- } else
- return 10;
+ } else
+ return 10;
+
+ } // endif Cardinal
return Cardinal;
} // end of Cardinality
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 68941c67be8..6c9e9597cec 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 c25443ef7ef..09d6db1ad27 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 df75722d0e8..de04f7678f9 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/innobase/CMakeLists.txt b/storage/innobase/CMakeLists.txt
index 4513a63049d..10be3187072 100644
--- a/storage/innobase/CMakeLists.txt
+++ b/storage/innobase/CMakeLists.txt
@@ -28,6 +28,7 @@ SET(INNOBASE_SOURCES
btr/btr0scrub.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/btr0bulk.cc b/storage/innobase/btr/btr0bulk.cc
index 3de8ee5c1c2..69f605dc905 100644
--- a/storage/innobase/btr/btr0bulk.cc
+++ b/storage/innobase/btr/btr0bulk.cc
@@ -698,6 +698,8 @@ PageBulk::latch()
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)) {
@@ -716,6 +718,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 a682148a482..d300c01fe90 100644
--- a/storage/innobase/btr/btr0cur.cc
+++ b/storage/innobase/btr/btr0cur.cc
@@ -639,6 +639,8 @@ btr_cur_optimistic_latch_leaves(
ulint mode;
ulint left_page_no;
ulint curr_page_no;
+ ut_ad(block->page.buf_fix_count);
+ ut_ad(buf_block_get_state(block) == BUF_BLOCK_FILE_PAGE);
switch (*latch_mode) {
case BTR_SEARCH_LEAF:
@@ -650,20 +652,10 @@ btr_cur_optimistic_latch_leaves(
mode = *latch_mode == BTR_SEARCH_PREV
? RW_S_LATCH : RW_X_LATCH;
- buf_page_mutex_enter(block);
- if (buf_block_get_state(block) != BUF_BLOCK_FILE_PAGE) {
- buf_page_mutex_exit(block);
- return(false);
- }
- /* pin the block not to be relocated */
- buf_block_buf_fix_inc(block, file, line);
- buf_page_mutex_exit(block);
-
rw_lock_s_lock(&block->lock);
if (block->modify_clock != modify_clock) {
rw_lock_s_unlock(&block->lock);
-
- goto unpin_failed;
+ return false;
}
curr_page_no = block->page.id.page_no();
@@ -690,7 +682,7 @@ btr_cur_optimistic_latch_leaves(
/* release the left block */
btr_leaf_page_release(
cursor->left_block, mode, mtr);
- goto unpin_failed;
+ return false;
}
} else {
cursor->left_block = NULL;
@@ -700,23 +692,28 @@ btr_cur_optimistic_latch_leaves(
file, line, mtr)) {
if (btr_page_get_prev(buf_block_get_frame(block))
== 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,
mode, mtr);
}
-unpin_failed:
- /* unpin the block */
- buf_block_buf_fix_dec(block);
+
return(false);
default:
@@ -1281,12 +1278,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
@@ -1722,10 +1714,7 @@ retry_page_get:
}
#ifdef BTR_CUR_ADAPT
- if (block != guess) {
- info->root_guess = block;
- info->withdraw_clock = buf_withdraw_clock;
- }
+ info->root_guess = block;
#endif
}
diff --git a/storage/innobase/btr/btr0pcur.cc b/storage/innobase/btr/btr0pcur.cc
index 4f06251d0bf..019369d997d 100644
--- a/storage/innobase/btr/btr0pcur.cc
+++ b/storage/innobase/btr/btr0pcur.cc
@@ -174,11 +174,10 @@ before_first:
index, rec, &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_withdraw_clock;
}
/**************************************************************//**
@@ -208,6 +207,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
@@ -270,7 +289,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);
}
@@ -285,12 +304,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;
@@ -388,11 +404,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_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..9f974e8304d
--- /dev/null
+++ b/storage/innobase/buf/buf0block_hint.cc
@@ -0,0 +1,78 @@
+/*****************************************************************************
+
+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()
+{
+ /* We need to check if m_block points to one of chunks. For this to be
+ meaningful we need to 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_resize().
+ However, for buffer-fixing to be meaningful, the block has to contain a page
+ (as opposed to being already empty, which might mean that buf_pool_resize()
+ can proceed and free it once we free the s-latch), so we confirm that the
+ block contains a page. However, it is not sufficient to check that this is
+ just any page, because just after we check it could get freed, unless we
+ have a latch which prevents this. This is tricky because page_hash latches
+ are sharded by page_id and we don't know the page_id until we look into the
+ block. To solve this chicken-and-egg problem somewhat, we latch the shard
+ for the m_page_id and compare block->page.id to it - so if is equal then we
+ can be reasonably sure that we have the correct latch.
+ There is still a theoretical problem here, where other threads might try
+ to modify the m_block->page.id while we are comparing it, but the chance of
+ accidentally causing the old space_id == m_page_id.m_space and the new
+ page_no == m_page_id.m_page_no is minimal as compilers emit a single 8-byte
+ comparison instruction to compare both at the same time atomically, and f()
+ will probably double-check the block->page.id again, anyway.
+ Finally, assuming that we have correct hash bucket latched, we should check if
+ the state of the block is BUF_BLOCK_FILE_PAGE before buffer-fixing the block,
+ as otherwise we risk buffer-fixing and operating on a block, which is already
+ meant to be freed. In particular, buf_LRU_free_page() first calls
+ buf_LRU_block_remove_hashed() under hash bucket latch protection to change the
+ state to BUF_BLOCK_REMOVE_HASH and then releases the latch. Later it calls
+ buf_LRU_block_free_hashed_page() without any latch to change the state to
+ BUF_BLOCK_MEMORY and reset the page's id, which means buf_resize() can free it
+ regardless of our buffer-fixing. */
+ if (m_block)
+ {
+ const buf_pool_t *const buf_pool= buf_pool_get(m_page_id);
+ rw_lock_t *latch= buf_page_hash_lock_get(buf_pool, m_page_id);
+ rw_lock_s_lock(latch);
+ /* If not own buf_pool_mutex, page_hash can be changed. */
+ latch= buf_page_hash_lock_s_confirm(latch, buf_pool, m_page_id);
+ if (buf_pool->is_block_field(m_block) &&
+ m_page_id == m_block->page.id &&
+ buf_block_get_state(m_block) == BUF_BLOCK_FILE_PAGE)
+ buf_block_buf_fix_inc(m_block, __FILE__, __LINE__);
+ else
+ clear();
+ rw_lock_s_unlock(latch);
+ }
+}
+} // namespace buf
diff --git a/storage/innobase/buf/buf0buf.cc b/storage/innobase/buf/buf0buf.cc
index 5e7c49becc2..6867d15ee57 100644
--- a/storage/innobase/buf/buf0buf.cc
+++ b/storage/innobase/buf/buf0buf.cc
@@ -339,14 +339,6 @@ buf_pool_t* buf_pool_ptr;
/** true when resizing buffer pool is in the critical path. */
volatile bool buf_pool_resizing;
-/** true when withdrawing buffer pool pages might cause page relocation */
-volatile bool buf_pool_withdrawing;
-
-/** the clock is incremented every time a pointer to a page may become obsolete;
-if the withdrwa clock has not changed, the pointer is still valid in buffer
-pool. if changed, the pointer might not be in buffer pool any more. */
-volatile ulint buf_withdraw_clock;
-
/** Map of buffer pool chunks by its first frame address
This is newly made by initialization of buffer pool and buf_resize_thread.
Currently, no need mutex protection for update. */
@@ -2110,8 +2102,6 @@ buf_pool_init(
NUMA_MEMPOLICY_INTERLEAVE_IN_SCOPE;
buf_pool_resizing = false;
- buf_pool_withdrawing = false;
- buf_withdraw_clock = 0;
buf_pool_ptr = (buf_pool_t*) ut_zalloc_nokey(
n_instances * sizeof *buf_pool_ptr);
@@ -2171,7 +2161,6 @@ buf_page_realloc(
{
buf_block_t* new_block;
- ut_ad(buf_pool_withdrawing);
ut_ad(buf_pool_mutex_own(buf_pool));
ut_ad(buf_block_get_state(block) == BUF_BLOCK_FILE_PAGE);
@@ -2593,9 +2582,6 @@ buf_pool_withdraw_blocks(
ib::info() << "buffer pool " << i << " : withdrawn target "
<< UT_LIST_GET_LEN(buf_pool->withdraw) << " blocks.";
- /* retry is not needed */
- ++buf_withdraw_clock;
-
return(false);
}
@@ -2692,7 +2678,6 @@ buf_pool_resize()
NUMA_MEMPOLICY_INTERLEAVE_IN_SCOPE;
ut_ad(!buf_pool_resizing);
- ut_ad(!buf_pool_withdrawing);
ut_ad(srv_buf_pool_chunk_unit > 0);
new_instance_size = srv_buf_pool_size / srv_buf_pool_instances;
@@ -2760,7 +2745,6 @@ buf_pool_resize()
ut_ad(buf_pool->withdraw_target == 0);
buf_pool->withdraw_target = withdraw_target;
- buf_pool_withdrawing = true;
}
}
@@ -2785,7 +2769,6 @@ withdraw_retry:
if (srv_shutdown_state != SRV_SHUTDOWN_NONE) {
/* abort to resize for shutdown. */
- buf_pool_withdrawing = false;
return;
}
@@ -2847,7 +2830,6 @@ withdraw_retry:
goto withdraw_retry;
}
- buf_pool_withdrawing = false;
buf_resize_status("Latching whole of buffer pool.");
@@ -4046,37 +4028,6 @@ buf_block_from_ahi(const byte* ptr)
/********************************************************************//**
Find out if a pointer belongs to a buf_block_t. It can be a pointer to
-the buf_block_t itself or a member of it. This functions checks one of
-the buffer pool instances.
-@return TRUE if ptr belongs to a buf_block_t struct */
-static
-ibool
-buf_pointer_is_block_field_instance(
-/*================================*/
- buf_pool_t* buf_pool, /*!< in: buffer pool instance */
- const void* ptr) /*!< in: pointer not dereferenced */
-{
- const buf_chunk_t* chunk = buf_pool->chunks;
- const buf_chunk_t* const echunk = chunk + ut_min(
- buf_pool->n_chunks, buf_pool->n_chunks_new);
-
- /* TODO: protect buf_pool->chunks with a mutex (the older pointer will
- currently remain while during buf_pool_resize()) */
- while (chunk < echunk) {
- if (ptr >= (void*) chunk->blocks
- && ptr < (void*) (chunk->blocks + chunk->size)) {
-
- return(TRUE);
- }
-
- chunk++;
- }
-
- return(FALSE);
-}
-
-/********************************************************************//**
-Find out if a pointer belongs to a buf_block_t. It can be a pointer to
the buf_block_t itself or a member of it
@return TRUE if ptr belongs to a buf_block_t struct */
ibool
@@ -4087,11 +4038,7 @@ buf_pointer_is_block_field(
ulint i;
for (i = 0; i < srv_buf_pool_instances; i++) {
- ibool found;
-
- found = buf_pointer_is_block_field_instance(
- buf_pool_from_array(i), ptr);
- if (found) {
+ if (buf_pool_from_array(i)->is_block_field(ptr)) {
return(TRUE);
}
}
@@ -4099,25 +4046,6 @@ buf_pointer_is_block_field(
return(FALSE);
}
-/********************************************************************//**
-Find out if a buffer block was created by buf_chunk_init().
-@return TRUE if "block" has been added to buf_pool->free by buf_chunk_init() */
-static
-ibool
-buf_block_is_uncompressed(
-/*======================*/
- buf_pool_t* buf_pool, /*!< in: buffer pool instance */
- const buf_block_t* block) /*!< in: pointer to block,
- not dereferenced */
-{
- if ((((ulint) block) % sizeof *block) != 0) {
- /* The pointer should be aligned. */
- return(FALSE);
- }
-
- return(buf_pointer_is_block_field_instance(buf_pool, (void*) block));
-}
-
#if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG
/********************************************************************//**
Return true if probe is enabled.
@@ -4356,7 +4284,7 @@ loop:
has been allocated by buf_page_alloc_descriptor(),
it may have been freed by buf_relocate(). */
- if (!buf_block_is_uncompressed(buf_pool, block)
+ if (!buf_pool->is_block_field(block)
|| page_id != block->page.id
|| buf_block_get_state(block) != BUF_BLOCK_FILE_PAGE) {
diff --git a/storage/innobase/dict/dict0dict.cc b/storage/innobase/dict/dict0dict.cc
index a6d6e9e6b3c..2e165a3a7bc 100644
--- a/storage/innobase/dict/dict0dict.cc
+++ b/storage/innobase/dict/dict0dict.cc
@@ -60,7 +60,6 @@ extern uint ibuf_debug;
#include "lock0lock.h"
#include "mach0data.h"
#include "mem0mem.h"
-#include "os0once.h"
#include "page0page.h"
#include "page0zip.h"
#include "pars0pars.h"
@@ -263,76 +262,6 @@ dict_mutex_exit_for_mysql(void)
mutex_exit(&dict_sys->mutex);
}
-/** Allocate and init a dict_table_t's stats latch.
-This function must not be called concurrently on the same table object.
-@param[in,out] table_void table whose stats latch to create */
-static
-void
-dict_table_stats_latch_alloc(
- void* table_void)
-{
- dict_table_t* table = static_cast<dict_table_t*>(table_void);
-
- /* Note: rw_lock_create() will call the constructor */
-
- table->stats_latch = static_cast<rw_lock_t*>(
- ut_malloc_nokey(sizeof(rw_lock_t)));
-
- ut_a(table->stats_latch != NULL);
-
- rw_lock_create(dict_table_stats_key, table->stats_latch,
- SYNC_INDEX_TREE);
-}
-
-/** Deinit and free a dict_table_t's stats latch.
-This function must not be called concurrently on the same table object.
-@param[in,out] table table whose stats latch to free */
-static
-void
-dict_table_stats_latch_free(
- dict_table_t* table)
-{
- rw_lock_free(table->stats_latch);
- ut_free(table->stats_latch);
-}
-
-/** Create a dict_table_t's stats latch or delay for lazy creation.
-This function is only called from either single threaded environment
-or from a thread that has not shared the table object with other threads.
-@param[in,out] table table whose stats latch to create
-@param[in] enabled if false then the latch is disabled
-and dict_table_stats_lock()/unlock() become noop on this table. */
-void
-dict_table_stats_latch_create(
- dict_table_t* table,
- bool enabled)
-{
- if (!enabled) {
- table->stats_latch = NULL;
- table->stats_latch_created = os_once::DONE;
- return;
- }
-
- /* We create this lazily the first time it is used. */
- table->stats_latch = NULL;
- table->stats_latch_created = os_once::NEVER_DONE;
-}
-
-/** Destroy a dict_table_t's stats latch.
-This function is only called from either single threaded environment
-or from a thread that has not shared the table object with other threads.
-@param[in,out] table table whose stats latch to destroy */
-void
-dict_table_stats_latch_destroy(
- dict_table_t* table)
-{
- if (table->stats_latch_created == os_once::DONE
- && table->stats_latch != NULL) {
-
- dict_table_stats_latch_free(table);
- }
-}
-
/** Lock the appropriate latch to protect a given table's statistics.
@param[in] table table whose stats to lock
@param[in] latch_mode RW_S_LATCH or RW_X_LATCH */
@@ -344,23 +273,12 @@ dict_table_stats_lock(
ut_ad(table != NULL);
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
- os_once::do_or_wait_for_done(
- &table->stats_latch_created,
- dict_table_stats_latch_alloc, table);
-
- if (table->stats_latch == NULL) {
- /* This is a dummy table object that is private in the current
- thread and is not shared between multiple threads, thus we
- skip any locking. */
- return;
- }
-
switch (latch_mode) {
case RW_S_LATCH:
- rw_lock_s_lock(table->stats_latch);
+ rw_lock_s_lock(&table->stats_latch);
break;
case RW_X_LATCH:
- rw_lock_x_lock(table->stats_latch);
+ rw_lock_x_lock(&table->stats_latch);
break;
case RW_NO_LATCH:
/* fall through */
@@ -380,19 +298,12 @@ dict_table_stats_unlock(
ut_ad(table != NULL);
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
- if (table->stats_latch == NULL) {
- /* This is a dummy table object that is private in the current
- thread and is not shared between multiple threads, thus we
- skip any locking. */
- return;
- }
-
switch (latch_mode) {
case RW_S_LATCH:
- rw_lock_s_unlock(table->stats_latch);
+ rw_lock_s_unlock(&table->stats_latch);
break;
case RW_X_LATCH:
- rw_lock_x_unlock(table->stats_latch);
+ rw_lock_x_unlock(&table->stats_latch);
break;
case RW_NO_LATCH:
/* fall through */
@@ -734,34 +645,6 @@ dict_table_get_nth_v_col_mysql(
return(dict_table_get_nth_v_col(table, i));
}
-/** Allocate and init the autoinc latch of a given table.
-This function must not be called concurrently on the same table object.
-@param[in,out] table_void table whose autoinc latch to create */
-static
-void
-dict_table_autoinc_alloc(
- void* table_void)
-{
- dict_table_t* table = static_cast<dict_table_t*>(table_void);
- table->autoinc_mutex = UT_NEW_NOKEY(ib_mutex_t());
- ut_a(table->autoinc_mutex != NULL);
- mutex_create(LATCH_ID_AUTOINC, table->autoinc_mutex);
-}
-
-/** Allocate and init the zip_pad_mutex of a given index.
-This function must not be called concurrently on the same index object.
-@param[in,out] index_void index whose zip_pad_mutex to create */
-static
-void
-dict_index_zip_pad_alloc(
- void* index_void)
-{
- dict_index_t* index = static_cast<dict_index_t*>(index_void);
- index->zip_pad.mutex = UT_NEW_NOKEY(SysMutex());
- ut_a(index->zip_pad.mutex != NULL);
- mutex_create(LATCH_ID_ZIP_PAD_MUTEX, index->zip_pad.mutex);
-}
-
/********************************************************************//**
Acquire the autoinc lock. */
void
@@ -769,11 +652,7 @@ dict_table_autoinc_lock(
/*====================*/
dict_table_t* table) /*!< in/out: table */
{
- os_once::do_or_wait_for_done(
- &table->autoinc_mutex_created,
- dict_table_autoinc_alloc, table);
-
- mutex_enter(table->autoinc_mutex);
+ mysql_mutex_lock(&table->autoinc_mutex);
}
/** Acquire the zip_pad_mutex latch.
@@ -783,11 +662,7 @@ void
dict_index_zip_pad_lock(
dict_index_t* index)
{
- os_once::do_or_wait_for_done(
- &index->zip_pad.mutex_created,
- dict_index_zip_pad_alloc, index);
-
- mutex_enter(index->zip_pad.mutex);
+ mysql_mutex_lock(&index->zip_pad.mutex);
}
/** Get all the FTS indexes on a table.
@@ -822,7 +697,7 @@ dict_table_autoinc_unlock(
/*======================*/
dict_table_t* table) /*!< in/out: table */
{
- mutex_exit(table->autoinc_mutex);
+ mysql_mutex_unlock(&table->autoinc_mutex);
}
/** Looks for column n in an index.
@@ -1254,6 +1129,7 @@ dict_table_t::add_to_cache()
ut_ad(dict_lru_validate());
ut_ad(mutex_own(&dict_sys->mutex));
+ mysql_mutex_init(0, &autoinc_mutex, NULL);
cached = TRUE;
ulint fold = ut_fold_string(name.m_name);
@@ -1395,7 +1271,7 @@ dict_index_t *dict_index_t::clone() const
(mem_heap_zalloc(heap, n_uniq * sizeof *stat_n_sample_sizes));
index->stat_n_non_null_key_vals= static_cast<ib_uint64_t*>
(mem_heap_zalloc(heap, n_uniq * sizeof *stat_n_non_null_key_vals));
- memset(&index->zip_pad, 0, sizeof index->zip_pad);
+ mysql_mutex_init(0, &index->zip_pad.mutex, NULL);
return index;
}
@@ -2086,8 +1962,15 @@ dict_table_remove_from_cache_low(
UT_DELETE(table->vc_templ);
}
+ mysql_mutex_destroy(&table->autoinc_mutex);
#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 78ed717156c..a7201f165c0 100644
--- a/storage/innobase/dict/dict0mem.cc
+++ b/storage/innobase/dict/dict0mem.cc
@@ -115,19 +115,24 @@ operator<<(
return(s << ut_get_name(NULL, table_name.m_name));
}
-/**********************************************************************//**
-Creates a table memory object.
+/** 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
+@param init_stats_latch whether to init the stats latch
@return own: table object */
dict_table_t*
dict_mem_table_create(
-/*==================*/
- const char* name, /*!< in: table name */
- fil_space_t* space, /*!< in: tablespace */
- ulint n_cols, /*!< in: total number of columns including
- virtual and non-virtual columns */
- ulint n_v_cols,/*!< in: number of virtual columns */
- ulint flags, /*!< in: table flags */
- ulint flags2) /*!< in: table flags2 */
+ 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* table;
mem_heap_t* heap;
@@ -171,16 +176,9 @@ dict_mem_table_create(
table->v_cols = static_cast<dict_v_col_t*>(
mem_heap_alloc(heap, n_v_cols * sizeof(*table->v_cols)));
- /* true means that the stats latch will be enabled -
- dict_table_stats_lock() will not be noop. */
- dict_table_stats_latch_create(table, true);
-
table->autoinc_lock = static_cast<ib_lock_t*>(
mem_heap_alloc(heap, lock_get_size()));
- /* lazy creation of table autoinc latch */
- dict_table_autoinc_create_lazy(table);
-
/* If the table has an FTS index or we are in the process
of building one, create the table->fts */
if (dict_table_has_fts_index(table)
@@ -195,6 +193,12 @@ 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);
}
@@ -223,9 +227,7 @@ dict_mem_table_free(
}
}
- dict_table_autoinc_destroy(table);
dict_mem_table_free_foreign_vcol_set(table);
- dict_table_stats_latch_destroy(table);
table->foreign_set.~dict_foreign_set();
table->referenced_set.~dict_foreign_set();
@@ -246,6 +248,10 @@ 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);
}
@@ -778,7 +784,7 @@ dict_mem_index_create(
dict_mem_fill_index_struct(index, heap, index_name, type, n_fields);
- dict_index_zip_pad_mutex_create_lazy(index);
+ mysql_mutex_init(0, &index->zip_pad.mutex, NULL);
if (type & DICT_SPATIAL) {
index->rtr_track = static_cast<rtr_info_track_t*>(
@@ -1093,7 +1099,7 @@ dict_mem_index_free(
ut_ad(index);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
- dict_index_zip_pad_mutex_destroy(index);
+ mysql_mutex_destroy(&index->zip_pad.mutex);
if (dict_index_is_spatial(index)) {
rtr_info_active::iterator it;
diff --git a/storage/innobase/dict/dict0stats.cc b/storage/innobase/dict/dict0stats.cc
index 758a95017c9..2c0ba38886f 100644
--- a/storage/innobase/dict/dict0stats.cc
+++ b/storage/innobase/dict/dict0stats.cc
@@ -33,6 +33,7 @@ Created Jan 06, 2010 Vasil Dimov
#include "pars0pars.h"
#include <mysql_com.h>
#include "btr0btr.h"
+#include "sync0sync.h"
#include <algorithm>
#include <map>
@@ -418,11 +419,6 @@ dict_stats_table_clone_create(
t->corrupted = table->corrupted;
- /* This private object "t" is not shared with other threads, so
- we do not need the stats_latch (thus we pass false below). The
- dict_table_stats_lock()/unlock() routines will do nothing. */
- dict_table_stats_latch_create(t, false);
-
UT_LIST_INIT(t->indexes, &dict_index_t::indexes);
#ifdef BTR_CUR_HASH_ADAPT
UT_LIST_INIT(t->freed_indexes, &dict_index_t::indexes);
@@ -488,6 +484,8 @@ 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);
}
@@ -500,7 +498,7 @@ dict_stats_table_clone_free(
/*========================*/
dict_table_t* t) /*!< in: dummy table object to free */
{
- dict_table_stats_latch_destroy(t);
+ rw_lock_free(&t->stats_latch);
mem_heap_free(t->heap);
}
diff --git a/storage/innobase/fil/fil0crypt.cc b/storage/innobase/fil/fil0crypt.cc
index 2ba13709016..f0f0351e20a 100644
--- a/storage/innobase/fil/fil0crypt.cc
+++ b/storage/innobase/fil/fil0crypt.cc
@@ -407,6 +407,8 @@ fil_space_crypt_t::write_page0(
mlog_write_ulint(page + offset + MAGIC_SZ + 2 + len + 8, encryption,
MLOG_1BYTE, mtr);
+ DBUG_EXECUTE_IF("ib_do_not_log_crypt_data", return;);
+
byte* log_ptr = mlog_open(mtr, 11 + 17 + len);
if (log_ptr != NULL) {
diff --git a/storage/innobase/fts/fts0ast.cc b/storage/innobase/fts/fts0ast.cc
index e22613a265b..6be4fb0d52b 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 2d8f040d788..b3ef795a463 100644
--- a/storage/innobase/fts/fts0que.cc
+++ b/storage/innobase/fts/fts0que.cc
@@ -4421,24 +4421,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 65079260aae..ff5cbcfa9aa 100644
--- a/storage/innobase/gis/gis0sea.cc
+++ b/storage/innobase/gis/gis0sea.cc
@@ -1256,6 +1256,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
@@ -1289,11 +1307,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 d6dc48dad7c..0be3a532e69 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -248,6 +248,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.history_size() <= l)
+ return;
+ mysql_mutex_unlock(&LOCK_global_system_variables);
+ while (trx_sys.history_size() > 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)
{
@@ -19308,6 +19329,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)",
@@ -19406,10 +19432,10 @@ static MYSQL_SYSVAR_BOOL(log_compressed_pages, page_zip_log_pages,
static MYSQL_SYSVAR_BOOL(log_optimize_ddl, innodb_log_optimize_ddl,
PLUGIN_VAR_OPCMDARG,
- "Reduce redo logging when natively creating indexes or rebuilding tables."
- " Setting this OFF avoids delay due to page flushing and"
- " allows concurrent backup.",
- NULL, NULL, TRUE);
+ "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.",
+ NULL, NULL, FALSE);
static MYSQL_SYSVAR_ULONG(autoextend_increment,
sys_tablespace_auto_extend_increment,
@@ -20328,6 +20354,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/ibuf/ibuf0ibuf.cc b/storage/innobase/ibuf/ibuf0ibuf.cc
index c6c934c76c4..5c94c005e4e 100644
--- a/storage/innobase/ibuf/ibuf0ibuf.cc
+++ b/storage/innobase/ibuf/ibuf0ibuf.cc
@@ -1447,7 +1447,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);
+ comp ? DICT_TF_COMPACT : 0, 0, false);
index = dict_mem_index_create(table, "IBUF_DUMMY", 0, n);
diff --git a/storage/innobase/include/btr0pcur.h b/storage/innobase/include/btr0pcur.h
index c20b971de98..38960b1d15c 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, ... */
@@ -528,9 +526,8 @@ struct btr_pcur_t{
btr_pcur_t() :
btr_cur(), latch_mode(0), 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/buf0block_hint.h b/storage/innobase/include/buf0block_hint.h
new file mode 100644
index 00000000000..2d681175b25
--- /dev/null
+++ b/storage/innobase/include/buf0block_hint.h
@@ -0,0 +1,77 @@
+/*****************************************************************************
+
+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:
+ Block_hint():m_block(NULL),m_page_id(0,0) {}
+ /** 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= NULL; }
+
+ /** 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;
+ /** If m_block is non-null, the m_block->page.id at time it was stored. */
+ page_id_t m_page_id;
+
+ /** 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 bc14be6a3c5..1c9383aff80 100644
--- a/storage/innobase/include/buf0buf.h
+++ b/storage/innobase/include/buf0buf.h
@@ -101,10 +101,6 @@ extern buf_pool_t* buf_pool_ptr; /*!< The buffer pools
extern volatile bool buf_pool_withdrawing; /*!< true when withdrawing buffer
pool pages might cause page relocation */
-extern volatile ulint buf_withdraw_clock; /*!< the clock is incremented
- every time a pointer to a page may
- become obsolete */
-
# ifdef UNIV_DEBUG
extern my_bool buf_disable_resize_buffer_pool_debug; /*!< if TRUE, resizing
buffer pool is not allowed. */
@@ -1373,14 +1369,6 @@ buf_get_nth_chunk_block(
ulint n, /*!< in: nth chunk in the buffer pool */
ulint* chunk_size); /*!< in: chunk size */
-/** Verify the possibility that a stored page is not in buffer pool.
-@param[in] withdraw_clock withdraw clock when stored the page
-@retval true if the page might be relocated */
-UNIV_INLINE
-bool
-buf_pool_is_obsolete(
- ulint withdraw_clock);
-
/** Calculate aligned buffer pool size based on srv_buf_pool_chunk_unit,
if needed.
@param[in] size size in bytes
@@ -2207,6 +2195,11 @@ struct buf_pool_t{
buf_tmp_array_t* tmp_arr;
/*!< Array for temporal memory
used in compression and encryption */
+ /** Determine if a pointer belongs to a buf_block_t.
+ It can be a pointer to the buf_block_t itself or a member of it.
+ @param ptr a pointer that will not be dereferenced
+ @return whether the ptr belongs to a buf_block_t struct */
+ inline bool is_block_field(const void *ptr) const;
#if BUF_BUDDY_LOW > UNIV_ZIP_SIZE_MIN
# error "BUF_BUDDY_LOW > UNIV_ZIP_SIZE_MIN"
diff --git a/storage/innobase/include/buf0buf.ic b/storage/innobase/include/buf0buf.ic
index f331091a1d7..3f8ad25bdfe 100644
--- a/storage/innobase/include/buf0buf.ic
+++ b/storage/innobase/include/buf0buf.ic
@@ -2,7 +2,7 @@
Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, Google Inc.
-Copyright (c) 2014, 2019, MariaDB Corporation.
+Copyright (c) 2014, 2020, MariaDB Corporation.
Portions of this file contain modifications contributed and copyrighted by
Google, Inc. Those modifications are gratefully acknowledged and are described
@@ -54,6 +54,25 @@ struct buf_chunk_t{
}
};
+bool buf_pool_t::is_block_field(const void *ptr) const
+{
+ const buf_chunk_t* chunk= chunks;
+ const buf_chunk_t *const echunk= chunk + ut_min(n_chunks,
+ n_chunks_new);
+ /* TODO: protect chunks with a mutex (the older pointer will
+ currently remain during resize()) */
+ while (chunk < echunk)
+ {
+ if (ptr >= reinterpret_cast<const void*>(chunk->blocks) &&
+ ptr < reinterpret_cast<const void*>(
+ chunk->blocks + chunk->size))
+ return true;
+ chunk++;
+ }
+
+ return false;
+}
+
/*********************************************************************//**
Gets the current size of buffer buf_pool in bytes.
@return size in bytes */
@@ -1056,8 +1075,6 @@ buf_block_buf_fix_dec(
/*==================*/
buf_block_t* block) /*!< in/out: block to bufferunfix */
{
- buf_block_unfix(block);
-
#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
@@ -1066,6 +1083,8 @@ buf_block_buf_fix_dec(
rw_lock_s_unlock(&block->debug_latch);
}
#endif /* UNIV_DEBUG */
+
+ buf_block_unfix(block);
}
/** Returns the buffer pool instance given a page id.
@@ -1439,18 +1458,6 @@ buf_page_get_frame(
}
}
-/** Verify the possibility that a stored page is not in buffer pool.
-@param[in] withdraw_clock withdraw clock when stored the page
-@retval true if the page might be relocated */
-UNIV_INLINE
-bool
-buf_pool_is_obsolete(
- ulint withdraw_clock)
-{
- return(UNIV_UNLIKELY(buf_pool_withdrawing
- || buf_withdraw_clock != withdraw_clock));
-}
-
/** Calculate aligned buffer pool size based on srv_buf_pool_chunk_unit,
if needed.
@param[in] size size in bytes
diff --git a/storage/innobase/include/dict0dict.h b/storage/innobase/include/dict0dict.h
index 9f5485bb15c..1c34e69bbf7 100644
--- a/storage/innobase/include/dict0dict.h
+++ b/storage/innobase/include/dict0dict.h
@@ -302,7 +302,7 @@ UNIV_INLINE
void
dict_table_autoinc_initialize(dict_table_t* table, ib_uint64_t value)
{
- ut_ad(dict_table_autoinc_own(table));
+ mysql_mutex_assert_owner(&table->autoinc_mutex);
table->autoinc = value;
}
@@ -315,7 +315,7 @@ UNIV_INLINE
ib_uint64_t
dict_table_autoinc_read(const dict_table_t* table)
{
- ut_ad(dict_table_autoinc_own(table));
+ mysql_mutex_assert_owner(&table->autoinc_mutex);
return(table->autoinc);
}
@@ -329,7 +329,7 @@ UNIV_INLINE
bool
dict_table_autoinc_update_if_greater(dict_table_t* table, ib_uint64_t value)
{
- ut_ad(dict_table_autoinc_own(table));
+ mysql_mutex_assert_owner(&table->autoinc_mutex);
if (value > table->autoinc) {
@@ -1468,25 +1468,6 @@ void
dict_mutex_exit_for_mysql(void);
/*===========================*/
-/** Create a dict_table_t's stats latch or delay for lazy creation.
-This function is only called from either single threaded environment
-or from a thread that has not shared the table object with other threads.
-@param[in,out] table table whose stats latch to create
-@param[in] enabled if false then the latch is disabled
-and dict_table_stats_lock()/unlock() become noop on this table. */
-void
-dict_table_stats_latch_create(
- dict_table_t* table,
- bool enabled);
-
-/** Destroy a dict_table_t's stats latch.
-This function is only called from either single threaded environment
-or from a thread that has not shared the table object with other threads.
-@param[in,out] table table whose stats latch to destroy */
-void
-dict_table_stats_latch_destroy(
- dict_table_t* table);
-
/** Lock the appropriate latch to protect a given table's statistics.
@param[in] table table whose stats to lock
@param[in] latch_mode RW_S_LATCH or RW_X_LATCH */
diff --git a/storage/innobase/include/dict0mem.h b/storage/innobase/include/dict0mem.h
index dfe8f9747f7..1c4292a2d38 100644
--- a/storage/innobase/include/dict0mem.h
+++ b/storage/innobase/include/dict0mem.h
@@ -44,7 +44,6 @@ Created 1/8/1996 Heikki Tuuri
#include "fts0fts.h"
#include "buf0buf.h"
#include "gis0type.h"
-#include "os0once.h"
#include "fil0fil.h"
#include "fil0crypt.h"
#include <set>
@@ -296,20 +295,25 @@ 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.
+/** 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
+@param init_stats_latch whether to init the stats latch
@return own: table object */
dict_table_t*
dict_mem_table_create(
-/*==================*/
- const char* name, /*!< in: table name */
- fil_space_t* space, /*!< in: tablespace */
- ulint n_cols, /*!< in: total number of columns
- including virtual and non-virtual
- columns */
- ulint n_v_cols, /*!< in: number of virtual columns */
- ulint flags, /*!< in: table flags */
- ulint flags2); /*!< in: table flags2 */
+ const char* name,
+ fil_space_t* space,
+ ulint n_cols,
+ ulint n_v_cols,
+ ulint flags,
+ ulint flags2,
+ bool init_stats_latch=true);
+
/****************************************************************//**
Free a table memory object. */
void
@@ -812,7 +816,7 @@ extern ulong zip_pad_max;
an uncompressed page should be left as padding to avoid compression
failures. This estimate is based on a self-adapting heuristic. */
struct zip_pad_info_t {
- SysMutex* mutex; /*!< mutex protecting the info */
+ mysql_mutex_t mutex; /*!< mutex protecting the info */
ulint pad; /*!< number of bytes used as pad */
ulint success;/*!< successful compression ops during
current round */
@@ -820,9 +824,6 @@ struct zip_pad_info_t {
current round */
ulint n_rounds;/*!< number of currently successful
rounds */
- volatile os_once::state_t
- mutex_created;
- /*!< Creation state of mutex member */
};
/** Number of samples of data size kept when page compression fails for
@@ -1864,7 +1865,7 @@ struct dict_table_t {
/** Statistics for query optimization. @{ */
/** Creation state of 'stats_latch'. */
- volatile os_once::state_t stats_latch_created;
+ bool stats_latch_inited;
/** This latch protects:
dict_table_t::stat_initialized,
@@ -1877,7 +1878,7 @@ struct dict_table_t {
dict_table_t::indexes*::stat_n_leaf_pages.
(*) Those are not always protected for
performance reasons. */
- rw_lock_t* stats_latch;
+ rw_lock_t stats_latch;
/** TRUE if statistics have been calculated the first time after
database startup or table creation. */
@@ -2001,11 +2002,8 @@ struct dict_table_t {
from a select. */
lock_t* autoinc_lock;
- /** Creation state of autoinc_mutex member */
- volatile os_once::state_t autoinc_mutex_created;
-
/** Mutex protecting the autoincrement counter. */
- ib_mutex_t* autoinc_mutex;
+ mysql_mutex_t autoinc_mutex;
/** Autoinc counter value to give to the next inserted row. */
ib_uint64_t autoinc;
@@ -2112,64 +2110,6 @@ struct dict_foreign_add_to_referenced_table {
}
};
-/** Destroy the autoinc latch of the given table.
-This function is only called from either single threaded environment
-or from a thread that has not shared the table object with other threads.
-@param[in,out] table table whose stats latch to destroy */
-inline
-void
-dict_table_autoinc_destroy(
- dict_table_t* table)
-{
- if (table->autoinc_mutex_created == os_once::DONE
- && table->autoinc_mutex != NULL) {
- mutex_free(table->autoinc_mutex);
- UT_DELETE(table->autoinc_mutex);
- }
-}
-
-/** Request for lazy creation of the autoinc latch of a given table.
-This function is only called from either single threaded environment
-or from a thread that has not shared the table object with other threads.
-@param[in,out] table table whose autoinc latch is to be created. */
-inline
-void
-dict_table_autoinc_create_lazy(
- dict_table_t* table)
-{
- table->autoinc_mutex = NULL;
- table->autoinc_mutex_created = os_once::NEVER_DONE;
-}
-
-/** Request a lazy creation of dict_index_t::zip_pad::mutex.
-This function is only called from either single threaded environment
-or from a thread that has not shared the table object with other threads.
-@param[in,out] index index whose zip_pad mutex is to be created */
-inline
-void
-dict_index_zip_pad_mutex_create_lazy(
- dict_index_t* index)
-{
- index->zip_pad.mutex = NULL;
- index->zip_pad.mutex_created = os_once::NEVER_DONE;
-}
-
-/** Destroy the zip_pad_mutex of the given index.
-This function is only called from either single threaded environment
-or from a thread that has not shared the table object with other threads.
-@param[in,out] table table whose stats latch to destroy */
-inline
-void
-dict_index_zip_pad_mutex_destroy(
- dict_index_t* index)
-{
- if (index->zip_pad.mutex_created == os_once::DONE
- && index->zip_pad.mutex != NULL) {
- mutex_free(index->zip_pad.mutex);
- UT_DELETE(index->zip_pad.mutex);
- }
-}
-
/** Release the zip_pad_mutex of a given index.
@param[in,out] index index whose zip_pad_mutex is to be released */
inline
@@ -2177,22 +2117,9 @@ void
dict_index_zip_pad_unlock(
dict_index_t* index)
{
- mutex_exit(index->zip_pad.mutex);
+ mysql_mutex_unlock(&index->zip_pad.mutex);
}
-#ifdef UNIV_DEBUG
-/** Check if the current thread owns the autoinc_mutex of a given table.
-@param[in] table the autoinc_mutex belongs to this table
-@return true, if the current thread owns the autoinc_mutex, false otherwise.*/
-inline
-bool
-dict_table_autoinc_own(
- const dict_table_t* table)
-{
- return(mutex_own(table->autoinc_mutex));
-}
-#endif /* UNIV_DEBUG */
-
/** Check whether the col is used in spatial index or regular index.
@param[in] col column to check
@return spatial status */
diff --git a/storage/innobase/include/mtr0mtr.ic b/storage/innobase/include/mtr0mtr.ic
index 845b2ff625f..17b7f04a29d 100644
--- a/storage/innobase/include/mtr0mtr.ic
+++ b/storage/innobase/include/mtr0mtr.ic
@@ -170,10 +170,10 @@ mtr_t::release_block_at_savepoint(
ut_a(slot->object == block);
- buf_block_unfix(reinterpret_cast<buf_block_t*>(block));
-
buf_page_release_latch(block, slot->type);
+ buf_block_unfix(reinterpret_cast<buf_block_t*>(block));
+
slot->object = NULL;
}
diff --git a/storage/innobase/include/os0once.h b/storage/innobase/include/os0once.h
deleted file mode 100644
index a818b451830..00000000000
--- a/storage/innobase/include/os0once.h
+++ /dev/null
@@ -1,120 +0,0 @@
-/*****************************************************************************
-
-Copyright (c) 2014, Oracle and/or its affiliates. All Rights Reserved.
-
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; version 2 of the License.
-
-This program is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc.,
-51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
-
-*****************************************************************************/
-
-/**************************************************//**
-@file include/os0once.h
-A class that aids executing a given function exactly once in a multi-threaded
-environment.
-
-Created Feb 20, 2014 Vasil Dimov
-*******************************************************/
-
-#ifndef os0once_h
-#define os0once_h
-
-#include "univ.i"
-
-#include "ut0ut.h"
-#include "my_cpu.h"
-
-/** Execute a given function exactly once in a multi-threaded environment
-or wait for the function to be executed by another thread.
-
-Example usage:
-First the user must create a control variable of type os_once::state_t and
-assign it os_once::NEVER_DONE.
-Then the user must pass this variable, together with a function to be
-executed to os_once::do_or_wait_for_done().
-
-Multiple threads can call os_once::do_or_wait_for_done() simultaneously with
-the same (os_once::state_t) control variable. The provided function will be
-called exactly once and when os_once::do_or_wait_for_done() returns then this
-function has completed execution, by this or another thread. In other words
-os_once::do_or_wait_for_done() will either execute the provided function or
-will wait for its execution to complete if it is already called by another
-thread or will do nothing if the function has already completed its execution
-earlier.
-
-This mimics pthread_once(3), but unfortunatelly pthread_once(3) does not
-support passing arguments to the init_routine() function. We should use
-std::call_once() when we start compiling with C++11 enabled. */
-class os_once {
-public:
- /** Control variables' state type */
- typedef ib_uint32_t state_t;
-
- /** Not yet executed. */
- static const state_t NEVER_DONE = 0;
-
- /** Currently being executed by this or another thread. */
- static const state_t IN_PROGRESS = 1;
-
- /** Finished execution. */
- static const state_t DONE = 2;
-
- /** Call a given function or wait its execution to complete if it is
- already called by another thread.
- @param[in,out] state control variable
- @param[in] do_func function to call
- @param[in,out] do_func_arg an argument to pass to do_func(). */
- static
- void
- do_or_wait_for_done(
- volatile state_t* state,
- void (*do_func)(void*),
- void* do_func_arg)
- {
- int32 oldval = NEVER_DONE;
-
- /* Avoid calling my_atomic_cas32() in the most common case. */
- if (*state == DONE) {
- return;
- }
-
- if (my_atomic_cas32((int32*) state, &oldval, IN_PROGRESS)) {
- /* We are the first. Call the function. */
-
- do_func(do_func_arg);
-
- my_atomic_store32((int32*) state, DONE);
- } else {
- /* The state is not NEVER_DONE, so either it is
- IN_PROGRESS (somebody is calling the function right
- now or DONE (it has already been called and completed).
- Wait for it to become DONE. */
- for (;;) {
- const state_t s = *state;
-
- switch (s) {
- case DONE:
- return;
- case IN_PROGRESS:
- break;
- case NEVER_DONE:
- /* fall through */
- default:
- ut_error;
- }
-
- MY_RELAX_CPU();
- }
- }
- }
-};
-
-#endif /* os0once_h */
diff --git a/storage/innobase/include/trx0sys.h b/storage/innobase/include/trx0sys.h
index 786b5fe2386..b8ccb2726b2 100644
--- a/storage/innobase/include/trx0sys.h
+++ b/storage/innobase/include/trx0sys.h
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2017, 2019, MariaDB Corporation.
+Copyright (c) 2017, 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 the Free Software
@@ -1119,7 +1119,7 @@ public:
}
/** @return number of committed transactions waiting for purge */
- ulint history_size() const
+ uint32 history_size() const
{
return uint32(my_atomic_load32(&const_cast<trx_sys_t*>(this)
->rseg_history_len));
diff --git a/storage/innobase/include/trx0undo.h b/storage/innobase/include/trx0undo.h
index 7be4314ecbc..22420f111b5 100644
--- a/storage/innobase/include/trx0undo.h
+++ b/storage/innobase/include/trx0undo.h
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2017, 2018, MariaDB Corporation.
+Copyright (c) 2017, 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 the Free Software
@@ -366,8 +366,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/lock/lock0lock.cc b/storage/innobase/lock/lock0lock.cc
index c8c8e66d0b2..1a25cff5961 100644
--- a/storage/innobase/lock/lock0lock.cc
+++ b/storage/innobase/lock/lock0lock.cc
@@ -4551,7 +4551,7 @@ lock_print_info_summary(
fprintf(file,
"Purge done for trx's n:o < " TRX_ID_FMT
" undo n:o < " TRX_ID_FMT " state: %s\n"
- "History list length " ULINTPF "\n",
+ "History list length %u\n",
purge_sys.tail.trx_no(),
purge_sys.tail.undo_no,
purge_sys.enabled()
diff --git a/storage/innobase/mtr/mtr0mtr.cc b/storage/innobase/mtr/mtr0mtr.cc
index 1749c582f2c..ef6dc58e749 100644
--- a/storage/innobase/mtr/mtr0mtr.cc
+++ b/storage/innobase/mtr/mtr0mtr.cc
@@ -233,8 +233,8 @@ static void memo_slot_release(mtr_memo_slot_t *slot)
case MTR_MEMO_PAGE_SX_FIX:
case MTR_MEMO_PAGE_X_FIX:
buf_block_t *block= reinterpret_cast<buf_block_t*>(slot->object);
- buf_block_unfix(block);
buf_page_release_latch(block, slot->type);
+ buf_block_unfix(block);
break;
}
slot->object= NULL;
@@ -276,8 +276,8 @@ struct ReleaseLatches {
case MTR_MEMO_PAGE_SX_FIX:
case MTR_MEMO_PAGE_X_FIX:
buf_block_t *block= reinterpret_cast<buf_block_t*>(slot->object);
- buf_block_unfix(block);
buf_page_release_latch(block, slot->type);
+ buf_block_unfix(block);
break;
}
slot->object= NULL;
diff --git a/storage/innobase/page/page0zip.cc b/storage/innobase/page/page0zip.cc
index f1f10bcd58d..50b2a56a941 100644
--- a/storage/innobase/page/page0zip.cc
+++ b/storage/innobase/page/page0zip.cc
@@ -1654,7 +1654,7 @@ page_zip_fields_free(
{
if (index) {
dict_table_t* table = index->table;
- dict_index_zip_pad_mutex_destroy(index);
+ mysql_mutex_destroy(&index->zip_pad.mutex);
mem_heap_free(index->heap);
dict_mem_table_free(table);
diff --git a/storage/innobase/trx/trx0rec.cc b/storage/innobase/trx/trx0rec.cc
index c7be4f44ee0..aaab2e1b5ec 100644
--- a/storage/innobase/trx/trx0rec.cc
+++ b/storage/innobase/trx/trx0rec.cc
@@ -1915,7 +1915,6 @@ dberr_t trx_undo_report_rename(trx_t* trx, const dict_table_t* table)
if (ulint offset = trx_undo_page_report_rename(
trx, table, block, &mtr)) {
- undo->withdraw_clock = buf_withdraw_clock;
undo->top_page_no = undo->last_page_no;
undo->top_offset = offset;
undo->top_undo_no = trx->undo_no++;
@@ -2055,7 +2054,6 @@ trx_undo_report_row_operation(
mtr_commit(&mtr);
} else {
/* Success */
- undo->withdraw_clock = buf_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 e43902006d0..7254c830cde 100644
--- a/storage/innobase/trx/trx0undo.cc
+++ b/storage/innobase/trx/trx0undo.cc
@@ -1213,7 +1213,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);
@@ -1402,9 +1401,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),
- univ_page_size, RW_X_LATCH,
- buf_pool_is_obsolete(undo->withdraw_clock)
- ? NULL : undo->guess_block,
+ univ_page_size, RW_X_LATCH, undo->guess_block,
BUF_GET, __FILE__, __LINE__, mtr, err);
}
@@ -1458,9 +1455,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),
- univ_page_size, RW_X_LATCH,
- buf_pool_is_obsolete((*undo)->withdraw_clock)
- ? NULL : (*undo)->guess_block,
+ univ_page_size, RW_X_LATCH, (*undo)->guess_block,
BUF_GET, __FILE__, __LINE__, mtr, err);
}
diff --git a/strings/json_lib.c b/strings/json_lib.c
index d24fab4ddeb..8ae921b348a 100644
--- a/strings/json_lib.c
+++ b/strings/json_lib.c
@@ -895,7 +895,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 == ':')
{