1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Item::print(): remove redundant parentheses

by introducing new Item::precedence() method and using it
to decide whether parentheses are required
This commit is contained in:
Sergei Golubchik
2016-11-27 19:50:10 +01:00
parent 1db438c833
commit 180065ebb0
188 changed files with 2684 additions and 2553 deletions

View File

@ -5,8 +5,8 @@ SHOW CREATE TABLE mysql57_virtual;
Table Create Table
mysql57_virtual CREATE TABLE `mysql57_virtual` (
`a` int(11) DEFAULT NULL,
`b` int(11) GENERATED ALWAYS AS ((`a` + 1)) VIRTUAL,
`c` int(11) GENERATED ALWAYS AS ((`a` + 3)) STORED
`b` int(11) GENERATED ALWAYS AS (`a` + 1) VIRTUAL,
`c` int(11) GENERATED ALWAYS AS (`a` + 3) STORED
) ENGINE=MyISAM DEFAULT CHARSET=latin1
insert into mysql57_virtual (a) values (1),(2);
select * from mysql57_virtual;
@ -20,8 +20,8 @@ SHOW CREATE TABLE mysql57_virtual;
Table Create Table
mysql57_virtual CREATE TABLE `mysql57_virtual` (
`a` int(11) DEFAULT NULL,
`b` int(11) GENERATED ALWAYS AS ((`a` + 1)) VIRTUAL,
`c` int(11) GENERATED ALWAYS AS ((`a` + 3)) STORED
`b` int(11) GENERATED ALWAYS AS (`a` + 1) VIRTUAL,
`c` int(11) GENERATED ALWAYS AS (`a` + 3) STORED
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='I am now a MariaDB table'
DROP TABLE mysql57_virtual;
#
@ -32,7 +32,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) GENERATED ALWAYS AS ((`a` + 1)) STORED,
`c` int(11) GENERATED ALWAYS AS ((`a` + 2)) VIRTUAL
`b` int(11) GENERATED ALWAYS AS (`a` + 1) STORED,
`c` int(11) GENERATED ALWAYS AS (`a` + 2) VIRTUAL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;