[MDEV-8328] Evaluation of two "!" operators depends on space in beetween Created: 2015-06-17  Updated: 2016-06-14  Resolved: 2016-06-14

Status: Closed
Project: MariaDB Server
Component/s: Optimizer, Parser
Affects Version/s: 5.1.67, 5.2.14, 5.3.12, 5.5, 10.0, 10.1
Fix Version/s: 5.5.50, 10.0.26, 10.1.15

Type: Bug Priority: Major
Reporter: L. Schwarz Assignee: Sergei Golubchik
Resolution: Fixed Votes: 0
Labels: upstream
Environment:

Windows



 Description   

The following expressions don't have the expected result (do not ignore the spaces):

 
MariaDB [(none)]> select (! !0) = (!!0), (! !1) = (!!1);
+----------------+----------------+
| (! !0) = (!!0) | (! !1) = (!!1) |
+----------------+----------------+
|              0 |              0 |
+----------------+----------------+
1 row in set (0.00 sec)
 

I would expect that the results are both 1. I would expect that the calculation does not depend on existance of spaces between ! and !.

Changing sql_mode does not change behaviour (HIGH_NOT_PRECEDENCE).

On a MySQL 4.1 server the result of that query is all 1.



 Comments   
Comment by Elena Stepanova [ 2015-06-18 ]

Thanks for the report.

Despite it's an upstream bug (https://bugs.mysql.com/bug.php?id=55477), I'm not decreasing the priority since it's been in Verified state for almost 5 years.

Comment by Oleksandr Byelkin [ 2015-09-03 ]

select ((0 <> 0) = (not(0))) AS `(! !0) = (!!0)`,((1 <> 0) = (not(1))) AS `(! !1) = (!!1)`

Comment by L. Schwarz [ 2015-09-04 ]

Guess which one is the correct result:

 
MariaDB [(none)]> select ! !0, !! 0;
+------+------+
| ! !0 | !! 0 |
+------+------+
|    0 |    1 |
+------+------+
1 row in set (0.00 sec)
 

Frustrating.

Comment by Sergei Golubchik [ 2016-06-10 ]

bar, could you review it, please?

http://lists.askmonty.org/pipermail/commits/2016-June/009443.html

Comment by Alexander Barkov [ 2016-06-14 ]

Comments sent by IRC.

Generated at Thu Feb 08 07:26:20 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.