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

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

Details

    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.

      Attachments

        Activity

          yablacky L. Schwarz created issue -
          yablacky L. Schwarz made changes -
          Field Original Value New Value
          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.
          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.
          yablacky L. Schwarz made changes -
          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.
          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.
          yablacky L. Schwarz made changes -
          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.
          The following expressions don't have the expected result (do not ignore the spaces):

          {{
          select (! !0) = (!!0), (! !1) = (!!1);
          +----------------+----------------+
          | (! !0) = (!!0) | (! !1) = (!!1) |
          +----------------+----------------+
          | 0 | 0 |
          +----------------+----------------+
          }}

          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.
          yablacky L. Schwarz made changes -
          Description The following expressions don't have the expected result (do not ignore the spaces):

          {{
          select (! !0) = (!!0), (! !1) = (!!1);
          +----------------+----------------+
          | (! !0) = (!!0) | (! !1) = (!!1) |
          +----------------+----------------+
          | 0 | 0 |
          +----------------+----------------+
          }}

          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.
          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.
          yablacky L. Schwarz made changes -
          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.
          The following expressions don't have the expected result (do not ignore the spaces):


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

          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.
          yablacky L. Schwarz made changes -
          Description The following expressions don't have the expected result (do not ignore the spaces):


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

          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.
          The following expressions don't have the expected result (do not ignore the spaces):

          (sorry I'm stil trying to post it in a way that it can be read...)

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

          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.
          yablacky L. Schwarz made changes -
          Description The following expressions don't have the expected result (do not ignore the spaces):

          (sorry I'm stil trying to post it in a way that it can be read...)

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

          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.
          The following expressions don't have the expected result (do not ignore the spaces):

          (sorry I'm stil trying to post it in a way that it can be read...)

          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.
          yablacky L. Schwarz made changes -
          Description The following expressions don't have the expected result (do not ignore the spaces):

          (sorry I'm stil trying to post it in a way that it can be read...)

          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.
          The following expressions don't have the expected result (do not ignore the spaces):

          (sorry I'm stil trying to post it in a way that it can be read...)

          {code:java}

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

          {code}

          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.
          yablacky L. Schwarz made changes -
          Description The following expressions don't have the expected result (do not ignore the spaces):

          (sorry I'm stil trying to post it in a way that it can be read...)

          {code:java}

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

          {code}

          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.
          The following expressions don't have the expected result (do not ignore the spaces):

          {code:java}

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

          {code}

          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.
          serg Sergei Golubchik made changes -
          Component/s OTHER [ 10125 ]

          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.

          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.
          elenst Elena Stepanova made changes -
          Fix Version/s 10.1 [ 16100 ]
          Fix Version/s 10.0 [ 16000 ]
          Affects Version/s 5.3.12 [ 12000 ]
          Affects Version/s 5.2.14 [ 12101 ]
          Affects Version/s 5.1.67 [ 12100 ]
          Affects Version/s 10.1 [ 16100 ]
          Affects Version/s 10.0 [ 16000 ]
          Affects Version/s 5.5 [ 15800 ]
          Affects Version/s 5.5.38 [ 15400 ]
          Affects Version/s 5.5.43 [ 18601 ]
          Labels upstream
          elenst Elena Stepanova made changes -
          Status Open [ 1 ] Confirmed [ 10101 ]
          elenst Elena Stepanova made changes -
          sanja Oleksandr Byelkin added a comment - - edited

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

          sanja Oleksandr Byelkin added a comment - - edited select ((0 <> 0) = ( not (0))) AS `(! !0) = (!!0)`,((1 <> 0) = ( not (1))) AS `(! !1) = (!!1)`
          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.

          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.
          serg Sergei Golubchik made changes -
          Fix Version/s 5.5 [ 15800 ]
          serg Sergei Golubchik made changes -
          Assignee Sergei Golubchik [ serg ]
          serg Sergei Golubchik made changes -
          Summary Evaluation of two "!" operators depends on space in beetween. Evaluation of two "!" operators depends on space in beetween
          serg Sergei Golubchik made changes -
          Status Confirmed [ 10101 ] In Progress [ 3 ]
          serg Sergei Golubchik made changes -
          Status In Progress [ 3 ] Stalled [ 10000 ]
          serg Sergei Golubchik added a comment - bar , could you review it, please? http://lists.askmonty.org/pipermail/commits/2016-June/009443.html
          serg Sergei Golubchik made changes -
          Assignee Sergei Golubchik [ serg ] Alexander Barkov [ bar ]
          Status Stalled [ 10000 ] In Review [ 10002 ]

          Comments sent by IRC.

          bar Alexander Barkov added a comment - Comments sent by IRC.
          bar Alexander Barkov made changes -
          Status In Review [ 10002 ] Stalled [ 10000 ]
          bar Alexander Barkov made changes -
          Assignee Alexander Barkov [ bar ] Sergei Golubchik [ serg ]
          serg Sergei Golubchik made changes -
          Fix Version/s 5.5.50 [ 22014 ]
          Fix Version/s 10.0.26 [ 22016 ]
          Fix Version/s 10.1.15 [ 22018 ]
          Fix Version/s 5.5 [ 15800 ]
          Fix Version/s 10.0 [ 16000 ]
          Fix Version/s 10.1 [ 16100 ]
          Resolution Fixed [ 1 ]
          Status Stalled [ 10000 ] Closed [ 6 ]
          serg Sergei Golubchik made changes -
          Workflow MariaDB v3 [ 70030 ] MariaDB v4 [ 149277 ]

          People

            serg Sergei Golubchik
            yablacky L. Schwarz
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.