diff options
author | Sergei Golubchik <serg@mariadb.org> | 2016-11-27 19:50:10 +0100 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2016-12-12 20:44:41 +0100 |
commit | 180065ebb0db78ea5c955b54c9f7997dbcba3121 (patch) | |
tree | 849adc822b510535367bdffa1153809091fb64df /mysql-test/r/func_date_add.result | |
parent | 1db438c83386e0e58487056d6ea25a0f5e97f4d9 (diff) | |
download | mariadb-git-180065ebb0db78ea5c955b54c9f7997dbcba3121.tar.gz |
Item::print(): remove redundant parentheses
by introducing new Item::precedence() method and using it
to decide whether parentheses are required
Diffstat (limited to 'mysql-test/r/func_date_add.result')
-rw-r--r-- | mysql-test/r/func_date_add.result | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/mysql-test/r/func_date_add.result b/mysql-test/r/func_date_add.result index e8fbba786a4..83fe5c3b551 100644 --- a/mysql-test/r/func_date_add.result +++ b/mysql-test/r/func_date_add.result @@ -102,3 +102,49 @@ select * from t1 where case a when adddate( '2012-12-12', 7 ) then true end; a drop table t1; End of 5.5 tests +create or replace view v1 as select 3 & 20010101 + interval 2 day as x; +show create view v1; +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select 3 & 20010101 + interval 2 day AS `x` latin1 latin1_swedish_ci +select 3 & 20010101 + interval 2 day, x from v1; +3 & 20010101 + interval 2 day x +3 3 +create or replace view v1 as select (3 & 20010101) + interval 2 day as x; +show create view v1; +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select (3 & 20010101) + interval 2 day AS `x` latin1 latin1_swedish_ci +select (3 & 20010101) + interval 2 day, x from v1; +(3 & 20010101) + interval 2 day x +NULL NULL +Warnings: +Warning 1292 Incorrect datetime value: '1' +Warning 1292 Incorrect datetime value: '1' +create or replace view v1 as select 3 & (20010101 + interval 2 day) as x; +show create view v1; +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select 3 & 20010101 + interval 2 day AS `x` latin1 latin1_swedish_ci +select 3 & (20010101 + interval 2 day), x from v1; +3 & (20010101 + interval 2 day) x +3 3 +create or replace view v1 as select 30 + 20010101 + interval 2 day as x; +show create view v1; +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select 30 + 20010101 + interval 2 day AS `x` latin1 latin1_swedish_ci +select 30 + 20010101 + interval 2 day, x from v1; +30 + 20010101 + interval 2 day x +2001-02-02 2001-02-02 +create or replace view v1 as select (30 + 20010101) + interval 2 day as x; +show create view v1; +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select 30 + 20010101 + interval 2 day AS `x` latin1 latin1_swedish_ci +select (30 + 20010101) + interval 2 day, x from v1; +(30 + 20010101) + interval 2 day x +2001-02-02 2001-02-02 +create or replace view v1 as select 30 + (20010101 + interval 2 day) as x; +show create view v1; +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select 30 + (20010101 + interval 2 day) AS `x` latin1 latin1_swedish_ci +select 30 + (20010101 + interval 2 day), x from v1; +30 + (20010101 + interval 2 day) x +20010133 20010133 +End of 10.2 tests |