Details

    • Bug
    • Status: Stalled (View Workflow)
    • Minor
    • Resolution: Unresolved
    • 1.4.2
    • 23.10
    • ExeMgr
    • None
    • 2020-2

    Description

      see mysql/queries/working_tpch1/qa_fe_cnxFunctions/hex.sql

      The query:

      select cidx, CDECIMAL1, HEX(CDECIMAL1) from DataTypeTestm order by cidx;
      

      should return

      1         -9   FFFFFFFFFFFFFFF7
      2         -8   FFFFFFFFFFFFFFF8
      3         -7   FFFFFFFFFFFFFFF9
      4         -6   FFFFFFFFFFFFFFFA
      5         -5   FFFFFFFFFFFFFFFB
      6          5   5
      7          6   6
      8          7   7
      9          8   8
      10        9   9
      11        0   0
      

      But instead returns

      1	-9	FFFF
      2	-8	FFFF
      3	-7	FFFF
      4	-6	FFFF
      5	-5	FFFF
      6	5	5
      7	6	6
      8	7	7
      9	8	8
      10	9	9
      11	0	0
      

      This appears to only affect decimal types. I looked in the utils/funcexp/hex.cpp code and no changes there should have caused this.

      Attachments

        Issue Links

          Activity

            Investigated this issue. ColumnStore creates the correct string with length 16, however the server truncates the field length when the string is sent to it via store() call in fetchNextRow().

            There is an open server issue for this: https://jira.mariadb.org/browse/MDEV-20548

            Closing this issue.

            tntnatbry Gagan Goel (Inactive) added a comment - Investigated this issue. ColumnStore creates the correct string with length 16, however the server truncates the field length when the string is sent to it via store() call in fetchNextRow(). There is an open server issue for this: https://jira.mariadb.org/browse/MDEV-20548 Closing this issue.
            drrtuy Roman added a comment -

            Opened as a notification.

            drrtuy Roman added a comment - Opened as a notification.

            changed the fix version to n/a because it was messing up daniel's accounting. Change it to whatever is appropriate once it's fixed.

            pleblanc Patrick LeBlanc (Inactive) added a comment - changed the fix version to n/a because it was messing up daniel's accounting. Change it to whatever is appropriate once it's fixed.

            The ref file (mysql/queries/working_tpch1/qa_fe_cnxFunctions/hex.sql.ref.log) is temporarily changed to match (incorrect) output from ColumnStore. We need to revert it back when MDEV-20548 is fixed.

            tntnatbry Gagan Goel (Inactive) added a comment - The ref file (mysql/queries/working_tpch1/qa_fe_cnxFunctions/hex.sql.ref.log) is temporarily changed to match (incorrect) output from ColumnStore. We need to revert it back when MDEV-20548 is fixed.

            MDEV-20548 is not done, so we cannot do this for 1..5.3.

            gdorman Gregory Dorman (Inactive) added a comment - MDEV-20548 is not done, so we cannot do this for 1..5.3.
            bar Alexander Barkov added a comment - - edited

            How to repeat the problem:

            First, I create the table:

            cd mariadb-columnstore-regression-test
            mysql test < mysql/scripts/create_datatypetestm.sql 
            

            Now run this query:

            select cidx, CDECIMAL1, HEX(CDECIMAL1) from datatypetestm order by cidx;
            

            +------+-----------+----------------+
            | cidx | CDECIMAL1 | HEX(CDECIMAL1) |
            +------+-----------+----------------+
            |    1 |        -9 | FFFF           |
            |    2 |        -8 | FFFF           |
            |    3 |        -7 | FFFF           |
            |    4 |        -6 | FFFF           |
            |    5 |        -5 | FFFF           |
            |    6 |         5 | 5              |
            |    7 |         6 | 6              |
            |    8 |         7 | 7              |
            |    9 |         8 | 8              |
            |   10 |         9 | 9              |
            |   11 |         0 | 0              |
            +------+-----------+----------------+
            

            Notice, the FFFF in the last column is wrong.

            Now if I change the engine from ColumnStore to InnoDB, the results become correct:

            alter table datatypetestm engine=innodb;
            select cidx, CDECIMAL1, HEX(CDECIMAL1) from datatypetestm order by cidx;
            

            +------+-----------+------------------+
            | cidx | CDECIMAL1 | HEX(CDECIMAL1)   |
            +------+-----------+------------------+
            |    1 |        -9 | FFFFFFFFFFFFFFF7 |
            |    2 |        -8 | FFFFFFFFFFFFFFF8 |
            |    3 |        -7 | FFFFFFFFFFFFFFF9 |
            |    4 |        -6 | FFFFFFFFFFFFFFFA |
            |    5 |        -5 | FFFFFFFFFFFFFFFB |
            |    6 |         5 | 5                |
            |    7 |         6 | 6                |
            |    8 |         7 | 7                |
            |    9 |         8 | 8                |
            |   10 |         9 | 9                |
            |   11 |         0 | 0                |
            +------+-----------+------------------+
            

            bar Alexander Barkov added a comment - - edited How to repeat the problem: First, I create the table: cd mariadb-columnstore-regression-test mysql test < mysql/scripts/create_datatypetestm.sql Now run this query: select cidx, CDECIMAL1, HEX(CDECIMAL1) from datatypetestm order by cidx; +------+-----------+----------------+ | cidx | CDECIMAL1 | HEX(CDECIMAL1) | +------+-----------+----------------+ | 1 | -9 | FFFF | | 2 | -8 | FFFF | | 3 | -7 | FFFF | | 4 | -6 | FFFF | | 5 | -5 | FFFF | | 6 | 5 | 5 | | 7 | 6 | 6 | | 8 | 7 | 7 | | 9 | 8 | 8 | | 10 | 9 | 9 | | 11 | 0 | 0 | +------+-----------+----------------+ Notice, the FFFF in the last column is wrong. Now if I change the engine from ColumnStore to InnoDB, the results become correct: alter table datatypetestm engine=innodb; select cidx, CDECIMAL1, HEX(CDECIMAL1) from datatypetestm order by cidx; +------+-----------+------------------+ | cidx | CDECIMAL1 | HEX(CDECIMAL1) | +------+-----------+------------------+ | 1 | -9 | FFFFFFFFFFFFFFF7 | | 2 | -8 | FFFFFFFFFFFFFFF8 | | 3 | -7 | FFFFFFFFFFFFFFF9 | | 4 | -6 | FFFFFFFFFFFFFFFA | | 5 | -5 | FFFFFFFFFFFFFFFB | | 6 | 5 | 5 | | 7 | 6 | 6 | | 8 | 7 | 7 | | 9 | 8 | 8 | | 10 | 9 | 9 | | 11 | 0 | 0 | +------+-----------+------------------+

            People

              leonid.fedorov Leonid Fedorov
              David.Hall David Hall (Inactive)
              Daniel Lee Daniel Lee (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

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