Uploaded image for project: 'MariaDB ColumnStore'
  1. MariaDB ColumnStore
  2. MCOL-389

cast of int mod function to char results in trailing decimal points

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Fixed
    • 1.0.4
    • 1.0.7
    • DMLProc
    • None
    • 2016-24, 2016-25, 2017-01

    Description

      The combination of mod and cast seems to result in addition of decimal points in the resulting string for columnstore table data. Note the 3rd query result, this should also be 1.

      create table t1(id int) engine=columnstore;
      insert into t1 values (1);

      MariaDB [loans]> select id from t1;
      ------

      id

      ------

      1

      ------
      1 row in set (0.03 sec)

      MariaDB [loans]> select cast(id as char) from t1;
      ------------------

      cast(id as char)

      ------------------

      1

      ------------------
      1 row in set (0.01 sec)

      MariaDB [loans]> select cast(mod(id,1024) as char) from t1;
      ----------------------------

      cast(mod(id,1024) as char)

      ----------------------------

      1.000000

      ----------------------------
      1 row in set (0.01 sec)

      MariaDB [loans]> select mod(id,1024) from t1;
      --------------

      mod(id,1024)

      --------------

      1

      --------------
      1 row in set (0.01 sec)

      Attachments

        Activity

          People

            dleeyh Daniel Lee (Inactive)
            dthompson David Thompson (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 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.