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

Hexadecimal literals on X' value ' form not working in numeric context, gives warning

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 5.5(EOL), 10.0(EOL), 10.1(EOL)
    • N/A
    • Documentation
    • None

    Description

      According to this page: https://mariadb.com/kb/en/mariadb/hexadecimal-literals/

      The result from:

      SELECT x'0a'+0;

      and:

      SELECT X'0a'+0;

      should be equivalent of:

      SELECT 0x0a+0;

      However, I get 0 for the two former queries and 10 for the latter:

      MariaDB [(none)]> SELECT x'0a'+0;
      +---------+
      | x'0a'+0 |
      +---------+
      |       0 |
      +---------+
      1 row in set, 1 warning (0.00 sec)
       
      MariaDB [(none)]> show warnings;
      +---------+------+------------------------------------------+
      | Level   | Code | Message                                  |
      +---------+------+------------------------------------------+
      | Warning | 1292 | Truncated incorrect DOUBLE value: '\x0A' |
      +---------+------+------------------------------------------+
      1 row in set (0.00 sec)
      

      (This is also inconsistent with the results for these queries in MySQL.)

      Attachments

        Activity

          People

            greenman Ian Gilfillan
            karll Karl Levik
            Votes:
            0 Vote for this issue
            Watchers:
            5 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.