mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
MDEV-13673 Bad result in view
When printing an expression, like a/(b*c), we need to print parentheses, even though / and * have the same precedence. Basically, we should always treat the second argument as having one level higher precedence than it normally is.
This commit is contained in:
@ -838,3 +838,8 @@ select 0=0, 0=-0, 0.0= -0.0, 0.0 = -(0.0), 0.0E1=-0.0E1, 0.0E1=-(0.0E1);
|
||||
select CRC32(NULL), CRC32(''), CRC32('MySQL'), CRC32('mysql'), CRC32('01234567'), CRC32('012345678');
|
||||
CRC32(NULL) CRC32('') CRC32('MySQL') CRC32('mysql') CRC32('01234567') CRC32('012345678')
|
||||
NULL 0 3259397556 2501908538 763378421 939184570
|
||||
explain extended select (3-2)+1, (3/2)*1, 3-(2+1), 3/(2*1);
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
|
||||
Warnings:
|
||||
Note 1003 select 3 - 2 + 1 AS `(3-2)+1`,3 / 2 * 1 AS `(3/2)*1`,3 - (2 + 1) AS `3-(2+1)`,3 / (2 * 1) AS `3/(2*1)`
|
||||
|
Reference in New Issue
Block a user