Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-8328

Evaluation of two "!" operators depends on space in beetween.

    Details

    • Type: Bug
    • Status: Confirmed
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 5.1.67, 5.2.14, 5.3.12, 10.1, 10.0, 5.5
    • Fix Version/s: 10.1, 10.0
    • Component/s: Optimizer, Parser
    • Labels:
    • 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.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              Hide
              elenst Elena Stepanova added a comment -

              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.

              Show
              elenst Elena Stepanova added a comment - 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.
              Hide
              sanja Oleksandr Byelkin added a comment - - edited
              select ((0 <> 0) = (not(0))) AS `(! !0) = (!!0)`,((1 <> 0) = (not(1))) AS `(! !1) = (!!1)`
              
              Show
              sanja Oleksandr Byelkin added a comment - - edited select ((0 <> 0) = (not(0))) AS `(! !0) = (!!0)`,((1 <> 0) = (not(1))) AS `(! !1) = (!!1)`
              Hide
              yablacky L. Schwarz added a comment - - edited

              Guess which one is the correct result:

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

              Frustrating.

              Show
              yablacky L. Schwarz added a comment - - edited Guess which one is the correct result: MariaDB [(none)]> select ! !0, !! 0; +------+------+ | ! !0 | !! 0 | +------+------+ | 0 | 1 | +------+------+ 1 row in set (0.00 sec) Frustrating.

                People

                • Assignee:
                  Unassigned
                  Reporter:
                  yablacky L. Schwarz
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  5 Start watching this issue

                  Dates

                  • Created:
                    Updated: