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

The negative result of the bitwise operator

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Not a Bug
    • Affects Version/s: 10.9.4
    • Fix Version/s: N/A
    • Component/s: Data types
    • Labels:
      None
    • Environment:
      mariadb docker

      Description

      Consider the following statements:

      SELECT -5 & -4; – expected: -8, actual: 18446744073709551608
      SELECT '-5' | '-4'; – expected: -3, actual: 18446744073709551615
      SELECT '5' ^ '-4'; – expected: -7, actual: 18446744073709551609
      SELECT ~5; – expected: -6, actual: 18446744073709551610
      SELECT -3 > ('5' ^ '-4'); – expected: 1, actual: 0

      The result should be negative, but it actually becomes a large value, We think this should be a spillover issue.

      version :10.9.4-MariaDB-1:10.9.4+maria~ubu2204

        Attachments

          Activity

            People

            Assignee:
            serg Sergei Golubchik
            Reporter:
            undefined 王瑞丰
            Votes:
            0 Vote for this issue
            Watchers:
            2 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.