summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2020-10-05 12:50:51 +0200
committerSergei Golubchik <serg@mariadb.org>2020-10-23 15:53:41 +0200
commit05a878c139963d4859ef8f2c974fee5dae56ee51 (patch)
treeb150c716706d86cadf1655f27984f70490555706
parent7f974e5ad3317168f174465dc61c0feb27c04162 (diff)
downloadmariadb-git-05a878c139963d4859ef8f2c974fee5dae56ee51.tar.gz
precedence bugfixing
fix printing precedence for BETWEEN, LIKE/ESCAPE, REGEXP, IN don't use precedence for printing CASE/WHEN/THEN/ELSE/END fix parsing precedence of BETWEEN, LIKE/ESCAPE, REGEXP, IN support predicate arguments for IN, BETWEEN, SOUNDS LIKE, LIKE/ESCAPE, REGEXP use %nonassoc for unary operators fix parsing of IS TRUE/FALSE/UNKNOWN/NULL remove parser_precedence test as superseded by the precedence test
-rw-r--r--mysql-test/r/derived_cond_pushdown.result16
-rw-r--r--mysql-test/r/func_test.result9
-rw-r--r--mysql-test/r/parser.result17
-rw-r--r--mysql-test/r/parser_precedence.result748
-rw-r--r--mysql-test/r/precedence.result480
-rw-r--r--mysql-test/suite/innodb/r/innodb-virtual-columns.result50
-rw-r--r--mysql-test/t/func_test.test8
-rw-r--r--mysql-test/t/parser.test14
-rw-r--r--mysql-test/t/parser_precedence.test335
-rw-r--r--sql/item.h7
-rw-r--r--sql/item_cmpfunc.cc14
-rw-r--r--sql/item_cmpfunc.h7
-rw-r--r--sql/item_func.cc3
-rw-r--r--sql/item_subselect.cc2
-rw-r--r--sql/item_subselect.h2
-rw-r--r--sql/sql_yacc.yy115
16 files changed, 343 insertions, 1484 deletions
diff --git a/mysql-test/r/derived_cond_pushdown.result b/mysql-test/r/derived_cond_pushdown.result
index e2c24639cc7..d4e8feff740 100644
--- a/mysql-test/r/derived_cond_pushdown.result
+++ b/mysql-test/r/derived_cond_pushdown.result
@@ -10052,11 +10052,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": {
@@ -10101,11 +10101,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": {
@@ -10150,11 +10150,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": {
@@ -10199,7 +10199,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,
@@ -10211,7 +10211,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/r/func_test.result b/mysql-test/r/func_test.result
index 94cf6d3e6fa..c2a1ea1137d 100644
--- a/mysql-test/r/func_test.result
+++ b/mysql-test/r/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
diff --git a/mysql-test/r/parser.result b/mysql-test/r/parser.result
index 45fcca146fe..9ae5b654eed 100644
--- a/mysql-test/r/parser.result
+++ b/mysql-test/r/parser.result
@@ -1321,3 +1321,20 @@ 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;
diff --git a/mysql-test/r/parser_precedence.result b/mysql-test/r/parser_precedence.result
deleted file mode 100644
index f23295bd61b..00000000000
--- a/mysql-test/r/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/r/precedence.result b/mysql-test/r/precedence.result
index 2a797467758..7584375061d 100644
--- a/mysql-test/r/precedence.result
+++ b/mysql-test/r/precedence.result
@@ -1996,11 +1996,10 @@ 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) 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
-0 0 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
@@ -2095,19 +2094,17 @@ 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';
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 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
-1 1 1
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 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
-1 1 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
@@ -2202,11 +2199,10 @@ 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';
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 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
-1 1 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
@@ -2224,11 +2220,10 @@ 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) 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
-0 0 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
@@ -2323,19 +2318,17 @@ 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';
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 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
-1 1 1
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 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
-1 1 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
@@ -2430,11 +2423,10 @@ 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';
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 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
-1 1 1
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
@@ -2452,11 +2444,10 @@ 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) 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
-1 1 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
@@ -2551,19 +2542,17 @@ 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';
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 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
-1 1 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 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
-1 1 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
@@ -2658,11 +2647,10 @@ 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';
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 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
-1 1 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
@@ -2680,11 +2668,10 @@ 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) 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
-0 0 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
@@ -2779,19 +2766,17 @@ 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';
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 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
-0 0 0
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 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
-0 0 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
@@ -2886,11 +2871,10 @@ 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';
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 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
-0 0 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
@@ -2908,11 +2892,10 @@ 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) 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
-0 0 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
@@ -3007,19 +2990,17 @@ 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';
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 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
-0 0 0
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 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
-0 0 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
@@ -3114,11 +3095,10 @@ 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';
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 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
-0 0 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
@@ -3136,11 +3116,10 @@ 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) 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
-1 1 1
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
@@ -3235,19 +3214,17 @@ 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';
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 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
-1 1 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 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
-1 1 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
@@ -3342,11 +3319,10 @@ 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';
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 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
-1 1 1
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
@@ -3364,11 +3340,10 @@ 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) 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
-1 1 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
@@ -3463,19 +3438,17 @@ 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';
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 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
-1 1 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 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
-1 1 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
@@ -3570,11 +3543,10 @@ 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';
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 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
-1 1 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
@@ -3592,11 +3564,10 @@ 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) 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
-1 1 1
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
@@ -3691,19 +3662,17 @@ 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';
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 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
-1 1 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 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
-1 1 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
@@ -3798,19 +3767,17 @@ 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';
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 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
-1 1 1
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 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
-1 1 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
@@ -3819,12 +3786,12 @@ select charset(2 LIKE 3 COLLATE latin1_bin), charset(2 LIKE (3 COLLATE latin1_bi
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);
-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 'IN (0,1), 2 LIKE (3 IN (0,1)), (2 LIKE 3) IN (0,1)' at line 1
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 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;
-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 'IN (0,1), 2 LIKE (3 IN (0,1)), (2 LIKE 3) IN (0,1) union select * from v1' at line 1
+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
@@ -3863,179 +3830,171 @@ 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';
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 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
-1 1 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 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
-1 1 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 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
-1 1 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 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
-1 1 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 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
-1 1 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 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
-1 1 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 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
-1 1 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 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
-1 1 1
create or replace view v1 as select 2 LIKE 2 LIKE 1, 2 LIKE (2 LIKE 1), (2 LIKE 2) LIKE 1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'LIKE 1, 2 LIKE (2 LIKE 1), (2 LIKE 2) LIKE 1' at line 1
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 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;
-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 'LIKE 1, 2 LIKE (2 LIKE 1), (2 LIKE 2) LIKE 1 union select * from v1' at line 1
+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;
-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 'REGEXP 1, 2 LIKE (2 REGEXP 1), (2 LIKE 2) REGEXP 1' at line 1
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 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;
-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 'REGEXP 1, 2 LIKE (2 REGEXP 1), (2 LIKE 2) REGEXP 1 union select * from v1' at line 1
+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;
-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 '| 3, 2 LIKE (3 | 3), (2 LIKE 3) | 3' at line 1
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 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;
-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 '| 3, 2 LIKE (3 | 3), (2 LIKE 3) | 3 union select * from v1' at line 1
+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;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '& 2, 2 LIKE (2 & 2), (2 LIKE 2) & 2' at line 1
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 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;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '& 2, 2 LIKE (2 & 2), (2 LIKE 2) & 2 union select * from v1' at line 1
+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;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '<< 2, 2 LIKE (2 << 2), (2 LIKE 2) << 2' at line 1
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 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;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '<< 2, 2 LIKE (2 << 2), (2 LIKE 2) << 2 union select * from v1' at line 1
+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;
-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 '>> 1, 2 LIKE (4 >> 1), (2 LIKE 4) >> 1' at line 1
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 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;
-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 '>> 1, 2 LIKE (4 >> 1), (2 LIKE 4) >> 1 union select * from v1' at line 1
+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;
-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 '+INTERVAL 1 DAY, 2 LIKE ('2000-01-01' +INTERVAL 1 DAY), (2 LIKE '2000-01-01')...' at line 1
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 '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;
-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 '+INTERVAL 1 DAY, 2 LIKE ('2000-01-01' +INTERVAL 1 DAY), (2 LIKE '2000-01-01')...' at line 1
+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;
-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 '+ 3, 2 LIKE (3 + 3), (2 LIKE 3) + 3' at line 1
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 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;
-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 '+ 3, 2 LIKE (3 + 3), (2 LIKE 3) + 3 union select * from v1' at line 1
+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;
-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 '- 3, 2 LIKE (3 - 3), (2 LIKE 3) - 3' at line 1
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 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;
-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 '- 3, 2 LIKE (3 - 3), (2 LIKE 3) - 3 union select * from v1' at line 1
+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;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '* 2, 2 LIKE (2 * 2), (2 LIKE 2) * 2' at line 1
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 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;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '* 2, 2 LIKE (2 * 2), (2 LIKE 2) * 2 union select * from v1' at line 1
+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;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '/ 2, 2 LIKE (2 / 2), (2 LIKE 2) / 2' at line 1
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 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;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '/ 2, 2 LIKE (2 / 2), (2 LIKE 2) / 2 union select * from v1' at line 1
+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;
-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 'DIV 2, 2 LIKE (4 DIV 2), (2 LIKE 4) DIV 2' at line 1
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 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;
-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 'DIV 2, 2 LIKE (4 DIV 2), (2 LIKE 4) DIV 2 union select * from v1' at line 1
+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;
-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 'MOD 2, 2 LIKE (2 MOD 2), (2 LIKE 2) MOD 2' at line 1
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 2 % 2 AS `2 LIKE 2 MOD 2`,2 like 2 % 2 AS `2 LIKE (2 MOD 2)`,(2 like 2) % 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;
-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 'MOD 2, 2 LIKE (2 MOD 2), (2 LIKE 2) MOD 2 union select * from v1' at line 1
+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;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '% 2, 2 LIKE (2 % 2), (2 LIKE 2) % 2' at line 1
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 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;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '% 2, 2 LIKE (2 % 2), (2 LIKE 2) % 2 union select * from v1' at line 1
+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;
-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 '^ 3, 2 LIKE (3 ^ 3), (2 LIKE 3) ^ 3' at line 1
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 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;
-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 '^ 3, 2 LIKE (3 ^ 3), (2 LIKE 3) ^ 3 union select * from v1' at line 1
+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;
-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 'BETWEEN 1 AND 3, 2 LIKE (2 BETWEEN 1 AND 3), (2 LIKE 2) BETWEEN 1 AND 3' at line 1
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 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;
-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 'BETWEEN 1 AND 3, 2 LIKE (2 BETWEEN 1 AND 3), (2 LIKE 2) BETWEEN 1 AND 3 union...' at line 1
+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
@@ -4051,12 +4010,12 @@ select charset(2 REGEXP 3 COLLATE latin1_bin), charset(2 REGEXP (3 COLLATE latin
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);
-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 'IN (0,1), 2 REGEXP (3 IN (0,1)), (2 REGEXP 3) IN (0,1)' at line 1
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 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;
-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 'IN (0,1), 2 REGEXP (3 IN (0,1)), (2 REGEXP 3) IN (0,1) union select * from v1' at line 1
+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
@@ -4149,19 +4108,19 @@ select 2 REGEXP 3 != 3, 2 REGEXP (3 != 3), (2 REGEXP 3) != 3 union select * from
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;
-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 'LIKE 3, 1 REGEXP (3 LIKE 3), (1 REGEXP 3) LIKE 3' at line 1
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 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;
-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 'LIKE 3, 1 REGEXP (3 LIKE 3), (1 REGEXP 3) LIKE 3 union select * from v1' at line 1
+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;
-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 'REGEXP 3, 1 REGEXP (3 REGEXP 3), (1 REGEXP 3) REGEXP 3' at line 1
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 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;
-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 'REGEXP 3, 1 REGEXP (3 REGEXP 3), (1 REGEXP 3) REGEXP 3 union select * from v1' at line 1
+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
@@ -4254,12 +4213,12 @@ 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;
-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 'BETWEEN 1 AND 3, 2 REGEXP (2 BETWEEN 1 AND 3), (2 REGEXP 2) BETWEEN 1 AND 3' at line 1
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 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;
-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 'BETWEEN 1 AND 3, 2 REGEXP (2 BETWEEN 1 AND 3), (2 REGEXP 2) BETWEEN 1 AND 3 u...' at line 1
+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
@@ -6896,11 +6855,10 @@ select 2 ^ 3 BETWEEN 1 AND 3, 2 ^ (3 BETWEEN 1 AND 3), (2 ^ 3) BETWEEN 1 AND 3 u
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 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
-1 1 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
@@ -6953,67 +6911,59 @@ select 2 BETWEEN 1 AND 3 && 3, 2 BETWEEN 1 AND (3 && 3), (2 BETWEEN 1 AND 3) &&
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 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
-1 1 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 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
-1 1 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 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
-1 1 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 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
-1 1 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 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
-1 1 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 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
-1 1 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 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
-1 1 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 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
-1 1 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
@@ -7122,19 +7072,17 @@ select 2 BETWEEN 1 AND 3 ^ 3, 2 BETWEEN 1 AND (3 ^ 3), (2 BETWEEN 1 AND 3) ^ 3 u
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 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
-0 0 0
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 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
-0 0 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
@@ -7143,221 +7091,208 @@ select charset(2 LIKE 1 ESCAPE 3 COLLATE latin1_bin), charset(2 LIKE 1 ESCAPE (3
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);
-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 'IN(0,1), 2 LIKE 1 ESCAPE (3 IN(0,1)), (2 LIKE 1 ESCAPE 3) IN(0,1)' at line 1
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 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;
-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 'IN(0,1), 2 LIKE 1 ESCAPE (3 IN(0,1)), (2 LIKE 1 ESCAPE 3) IN(0,1) union selec...' at line 1
+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 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
-1 1 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 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
-1 1 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 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
-1 1 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 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
-0 0 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 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
-0 0 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 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
-0 0 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 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
-0 0 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 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
-0 0 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 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
-1 1 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 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
-1 1 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 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
-1 1 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 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
-0 0 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 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
-1 1 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;
-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 'LIKE 4, 2 LIKE 2 ESCAPE (3 LIKE 4), (2 LIKE 2 ESCAPE 3) LIKE 4' at line 1
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 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;
-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 'LIKE 4, 2 LIKE 2 ESCAPE (3 LIKE 4), (2 LIKE 2 ESCAPE 3) LIKE 4 union select *...' at line 1
+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;
-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 'REGEXP 4, 2 LIKE 2 ESCAPE (3 REGEXP 4), (2 LIKE 2 ESCAPE 3) REGEXP 4' at line 1
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 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;
-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 'REGEXP 4, 2 LIKE 2 ESCAPE (3 REGEXP 4), (2 LIKE 2 ESCAPE 3) REGEXP 4 union se...' at line 1
+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;
-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 '| 4, 2 LIKE 1 ESCAPE (3 | 4), (2 LIKE 1 ESCAPE 3) | 4' at line 1
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 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;
-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 '| 4, 2 LIKE 1 ESCAPE (3 | 4), (2 LIKE 1 ESCAPE 3) | 4 union select * from v1' at line 1
+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;
-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 '& 4, 2 LIKE 2 ESCAPE (3 & 4), (2 LIKE 2 ESCAPE 3) & 4' at line 1
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 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;
-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 '& 4, 2 LIKE 2 ESCAPE (3 & 4), (2 LIKE 2 ESCAPE 3) & 4 union select * from v1' at line 1
+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;
-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 '<< 1, 2 LIKE 2 ESCAPE (1 << 1), (2 LIKE 2 ESCAPE 1) << 1' at line 1
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 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;
-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 '<< 1, 2 LIKE 2 ESCAPE (1 << 1), (2 LIKE 2 ESCAPE 1) << 1 union select * from v1' at line 1
+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;
-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 '>> 4, 2 LIKE 2 ESCAPE (3 >> 4), (2 LIKE 2 ESCAPE 3) >> 4' at line 1
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 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;
-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 '>> 4, 2 LIKE 2 ESCAPE (3 >> 4), (2 LIKE 2 ESCAPE 3) >> 4 union select * from v1' at line 1
+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;
-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 '+INTERVAL 1 DAY, 2 LIKE 1 ESCAPE (3 +INTERVAL 1 DAY), (2 LIKE 1 ESCAPE 3) +IN...' at line 1
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 + 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;
-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 '+INTERVAL 1 DAY, 2 LIKE 1 ESCAPE (3 +INTERVAL 1 DAY), (2 LIKE 1 ESCAPE 3) +IN...' at line 1
+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;
-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 '+ 4, 2 LIKE 1 ESCAPE (3 + 4), (2 LIKE 1 ESCAPE 3) + 4' at line 1
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 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;
-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 '+ 4, 2 LIKE 1 ESCAPE (3 + 4), (2 LIKE 1 ESCAPE 3) + 4 union select * from v1' at line 1
+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;
-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 '- 1, 2 LIKE 2 ESCAPE (1 - 1), (2 LIKE 2 ESCAPE 1) - 1' at line 1
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 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;
-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 '- 1, 2 LIKE 2 ESCAPE (1 - 1), (2 LIKE 2 ESCAPE 1) - 1 union select * from v1' at line 1
+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;
-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 '* 0, 2 LIKE 2 ESCAPE (3 * 0), (2 LIKE 2 ESCAPE 3) * 0' at line 1
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 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;
-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 '* 0, 2 LIKE 2 ESCAPE (3 * 0), (2 LIKE 2 ESCAPE 3) * 0 union select * from v1' at line 1
+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;
-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 'DIV 3, 2 LIKE 2 ESCAPE (3 DIV 3), (2 LIKE 2 ESCAPE 3) DIV 3' at line 1
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 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;
-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 'DIV 3, 2 LIKE 2 ESCAPE (3 DIV 3), (2 LIKE 2 ESCAPE 3) DIV 3 union select * fr...' at line 1
+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;
-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 'MOD 1, 2 LIKE 2 ESCAPE (3 MOD 1), (2 LIKE 2 ESCAPE 3) MOD 1' at line 1
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 2 escape 3 % 1 AS `2 LIKE 2 ESCAPE 3 MOD 1`,2 like 2 escape 3 % 1 AS `2 LIKE 2 ESCAPE (3 MOD 1)`,(2 like 2 escape 3) % 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;
-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 'MOD 1, 2 LIKE 2 ESCAPE (3 MOD 1), (2 LIKE 2 ESCAPE 3) MOD 1 union select * fr...' at line 1
+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;
-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 '% 1, 2 LIKE 2 ESCAPE (3 % 1), (2 LIKE 2 ESCAPE 3) % 1' at line 1
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 2 escape 3 % 1 AS `2 LIKE 2 ESCAPE 3 % 1`,2 like 2 escape 3 % 1 AS `2 LIKE 2 ESCAPE (3 % 1)`,(2 like 2 escape 3) % 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;
-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 '% 1, 2 LIKE 2 ESCAPE (3 % 1), (2 LIKE 2 ESCAPE 3) % 1 union select * from v1' at line 1
+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;
-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 '^ 4, 2 LIKE 1 ESCAPE (3 ^ 4), (2 LIKE 1 ESCAPE 3) ^ 4' at line 1
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 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;
-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 '^ 4, 2 LIKE 1 ESCAPE (3 ^ 4), (2 LIKE 1 ESCAPE 3) ^ 4 union select * from v1' at line 1
+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;
-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 'BETWEEN 2 AND 4, 2 LIKE 2 ESCAPE (3 BETWEEN 2 AND 4), (2 LIKE 2 ESCAPE 3) BET...' at line 1
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 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;
-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 'BETWEEN 2 AND 4, 2 LIKE 2 ESCAPE (3 BETWEEN 2 AND 4), (2 LIKE 2 ESCAPE 3) BET...' at line 1
+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
@@ -7396,121 +7331,108 @@ BINARY 'c' IN (SELECT 'C' UNION SELECT 'X') BINARY ('c' IN (SELECT 'C' UNION SEL
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) 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
-1 1 1
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 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
-1 1 1
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) 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
-1 1 1
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) 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
-0 0 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 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 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
-0 0 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) 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
-0 0 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) 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
-0 0 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) 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
-1 1 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) 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
-0 0 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) 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
-0 0 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) 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
-1 1 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) 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
-1 1 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) 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
-1 1 1
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);
-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 'IN (SELECT 0 UNION SELECT 1), 2 LIKE (3 IN (SELECT 0 UNION SELECT 1)), (2 LIK...' at line 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 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 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;
-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 'IN (SELECT 0 UNION SELECT 1), 2 LIKE (3 IN (SELECT 0 UNION SELECT 1)), (2 LIK...' at line 1
+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);
-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 'IN (SELECT 0 UNION SELECT 1), 2 REGEXP (3 IN (SELECT 0 UNION SELECT 1)), (2 R...' at line 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 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 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;
-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 'IN (SELECT 0 UNION SELECT 1), 2 REGEXP (3 IN (SELECT 0 UNION SELECT 1)), (2 R...' at line 1
+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
@@ -7598,18 +7520,17 @@ select 2 ^ 3 IN (SELECT 0 UNION SELECT 1), 2 ^ (3 IN (SELECT 0 UNION SELECT 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) 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
-0 0 0
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);
-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 'IN (SELECT 0 UNION SELECT 1), 2 LIKE 1 ESCAPE (3 IN (SELECT 0 UNION SELECT 1)...' at line 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 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;
-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 'IN (SELECT 0 UNION SELECT 1), 2 LIKE 1 ESCAPE (3 IN (SELECT 0 UNION SELECT 1)...' at line 1
+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
@@ -8097,8 +8018,7 @@ Select view_definition from information_schema.views where table_schema='test' a
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 1 IS TRUE IS FALSE, 2 IS FALSE IS UNKNOWN, 3 IS UNKNOWN IS NULL, 4 IS NULL 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 FALSE, 2 IS FALSE IS UNKNOWN, 3 IS UNKNOWN IS NULL, 4 IS NULL IS TRUE' at line 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`
+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/suite/innodb/r/innodb-virtual-columns.result b/mysql-test/suite/innodb/r/innodb-virtual-columns.result
index de97d933ad9..20cd55bd7b0 100644
--- a/mysql-test/suite/innodb/r/innodb-virtual-columns.result
+++ b/mysql-test/suite/innodb/r/innodb-virtual-columns.result
@@ -30,7 +30,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`)
@@ -136,14 +136,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`)
@@ -193,14 +193,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`)
@@ -270,14 +270,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/t/func_test.test b/mysql-test/t/func_test.test
index 9bdbe5bc4e4..570fd0ae87a 100644
--- a/mysql-test/t/func_test.test
+++ b/mysql-test/t/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';
diff --git a/mysql-test/t/parser.test b/mysql-test/t/parser.test
index 7e11a71c500..c5bd31c576e 100644
--- a/mysql-test/t/parser.test
+++ b/mysql-test/t/parser.test
@@ -1351,3 +1351,17 @@ create function fs() returns serial return 1;
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;
diff --git a/mysql-test/t/parser_precedence.test b/mysql-test/t/parser_precedence.test
deleted file mode 100644
index 7b69bc9c6da..00000000000
--- a/mysql-test/t/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/sql/item.h b/sql/item.h
index b789f703c2e..a49f9e8e5e4 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -82,8 +82,9 @@ 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, // <<, >>
@@ -1381,6 +1382,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);
/**
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index 69c7eb33852..d3a59e5b4f0 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -2312,7 +2312,7 @@ longlong Item_func_between::val_int()
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 "));
@@ -3375,15 +3375,15 @@ void Item_func_case::print(String *str, enum_query_type query_type)
for (uint i= first_expr_num + 1 ; i < nwhens + first_expr_num + 1; i++)
{
str->append(STRING_WITH_LEN("when "));
- args[i]->print_parenthesised(str, query_type, precedence());
+ args[i]->print(str, query_type);
str->append(STRING_WITH_LEN(" then "));
- args[i+nwhens]->print_parenthesised(str, query_type, precedence());
+ args[i+nwhens]->print(str, query_type);
str->append(' ');
}
if (else_expr_num != -1)
{
str->append(STRING_WITH_LEN("else "));
- args[else_expr_num]->print_parenthesised(str, query_type, precedence());
+ args[else_expr_num]->print(str, query_type);
str->append(' ');
}
str->append(STRING_WITH_LEN("end"));
@@ -5243,12 +5243,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 579b1bde1ce..22736339bf6 100644
--- a/sql/item_cmpfunc.h
+++ b/sql/item_cmpfunc.h
@@ -1590,7 +1590,6 @@ public:
uint decimal_precision() const;
table_map not_null_tables() const { return 0; }
const char *func_name() const { return "case"; }
- enum precedence precedence() const { return BETWEEN_PRECEDENCE; }
virtual void print(String *str, enum_query_type query_type);
Item *find_item(String *str);
CHARSET_INFO *compare_collation() const { return cmp_collation.collation; }
@@ -1704,7 +1703,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);
@@ -1999,7 +1998,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()
{
@@ -2127,7 +2126,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 *thd, MEM_ROOT *mem_root) { return 0; }
void print(String *str, enum_query_type query_type)
{
diff --git a/sql/item_func.cc b/sql/item_func.cc
index 9d588ce0eb1..cc4a0157d1a 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -481,8 +481,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_subselect.cc b/sql/item_subselect.cc
index 0499a677be9..802bfca64b7 100644
--- a/sql/item_subselect.cc
+++ b/sql/item_subselect.cc
@@ -3283,7 +3283,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 816073ed5d3..2292c22480f 100644
--- a/sql/item_subselect.h
+++ b/sql/item_subselect.h
@@ -628,7 +628,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/sql_yacc.yy b/sql/sql_yacc.yy
index 138d5e13701..2eabc4f0a6d 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -149,6 +149,14 @@ void LEX::parse_error()
}
+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
@@ -1022,10 +1030,10 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
%parse-param { THD *thd }
%lex-param { THD *thd }
/*
- Currently there are 102 shift/reduce conflicts.
+ Currently there are 105 shift/reduce conflicts.
We should not introduce new conflicts any more.
*/
-%expect 101
+%expect 105
/*
Comments for TOKENS.
@@ -1721,17 +1729,19 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
%left OR_OR_SYM OR_SYM OR2_SYM
%left XOR
%left AND_SYM AND_AND_SYM
-%left BETWEEN_SYM CASE_SYM WHEN_SYM THEN_SYM ELSE
-%left '=' EQUAL_SYM GE '>' LE '<' NE IS LIKE REGEXP IN_SYM
+%nonassoc NOT_SYM
+%left '=' EQUAL_SYM GE '>' LE '<' NE
+%nonassoc IS
+%right BETWEEN_SYM
+%left LIKE REGEXP IN_SYM
%left '|'
%left '&'
%left SHIFT_LEFT SHIFT_RIGHT
%left '-' '+'
%left '*' '/' '%' DIV_SYM MOD_SYM
%left '^'
-%left NEG '~'
-%right NOT_SYM NOT2_SYM
-%right BINARY COLLATE_SYM
+%nonassoc NEG '~' NOT2_SYM BINARY
+%nonassoc COLLATE_SYM
%left INTERVAL_SYM
%type <lex_str>
@@ -1831,7 +1841,6 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
table_wild simple_expr column_default_non_parenthesized_expr udf_expr
expr_or_default set_expr_or_default
geometry_function signed_literal expr_or_literal
- opt_escape
sp_opt_default
simple_ident_nospvar simple_ident_q
field_or_var limit_option
@@ -8915,59 +8924,59 @@ expr:
if ($$ == 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 ($$ == 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 ($$ == 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 ($$ == 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 ($$ == 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 ($$ == 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 ($$ == NULL)
MYSQL_YYABORT;
}
- | bool_pri
- ;
-
-bool_pri:
- bool_pri IS NULL_SYM %prec IS
+ | expr IS NULL_SYM %prec IS
{
$$= new (thd->mem_root) Item_func_isnull(thd, $1);
if ($$ == 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 ($$ == 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 ($$ == NULL)
@@ -8989,13 +8998,13 @@ bool_pri:
;
predicate:
- bit_expr IN_SYM '(' subselect ')'
+ predicate IN_SYM '(' subselect ')'
{
$$= new (thd->mem_root) Item_in_subselect(thd, $1, $4);
if ($$ == 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 (item == NULL)
@@ -9004,13 +9013,13 @@ predicate:
if ($$ == NULL)
MYSQL_YYABORT;
}
- | bit_expr IN_SYM '(' expr ')'
+ | predicate IN_SYM '(' expr ')'
{
$$= handle_sql2003_note184_exception(thd, $1, true, $4);
if ($$ == 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);
@@ -9018,13 +9027,13 @@ predicate:
if ($$ == NULL)
MYSQL_YYABORT;
}
- | bit_expr not IN_SYM '(' expr ')'
+ | predicate not IN_SYM '(' expr ')'
{
$$= handle_sql2003_note184_exception(thd, $1, false, $5);
if ($$ == 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);
@@ -9033,13 +9042,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 ($$ == 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);
@@ -9047,7 +9056,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);
@@ -9057,28 +9066,41 @@ predicate:
if ($$ == NULL)
MYSQL_YYABORT;
}
- | bit_expr LIKE simple_expr opt_escape
+ | predicate LIKE predicate
+ {
+ $$= new (thd->mem_root) Item_func_like(thd, $1, $3, escape(thd), false);
+ if ($$ == NULL)
+ MYSQL_YYABORT;
+ }
+ | predicate LIKE predicate ESCAPE_SYM predicate %prec LIKE
{
- $$= new (thd->mem_root) Item_func_like(thd, $1, $3, $4,
- Lex->escape_used);
+ Lex->escape_used= true;
+ $$= new (thd->mem_root) Item_func_like(thd, $1, $3, $5, true);
if ($$ == NULL)
MYSQL_YYABORT;
}
- | bit_expr not LIKE simple_expr opt_escape
+ | predicate not LIKE predicate
+ {
+ Item *item= new (thd->mem_root) Item_func_like(thd, $1, $4, escape(thd), false);
+ if (item == NULL)
+ MYSQL_YYABORT;
+ $$= item->neg_transformer(thd);
+ }
+ | predicate not LIKE predicate ESCAPE_SYM predicate %prec LIKE
{
- Item *item= new (thd->mem_root) Item_func_like(thd, $1, $4, $5,
- Lex->escape_used);
+ Lex->escape_used= true;
+ Item *item= new (thd->mem_root) Item_func_like(thd, $1, $4, $6, true);
if (item == NULL)
MYSQL_YYABORT;
$$= item->neg_transformer(thd);
}
- | bit_expr REGEXP bit_expr
+ | predicate REGEXP predicate
{
$$= new (thd->mem_root) Item_func_regex(thd, $1, $3);
if ($$ == 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 (item == NULL)
@@ -11468,23 +11490,6 @@ opt_having_clause:
}
;
-opt_escape:
- ESCAPE_SYM simple_expr
- {
- Lex->escape_used= TRUE;
- $$= $2;
- }
- | /* empty */
- {
- 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 ($$ == NULL)
- MYSQL_YYABORT;
- }
- ;
-
/*
group by statement in select
*/