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

HOUR() function returns NULL when it should not

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 1.0.9
    • 1.2.0
    • MariaDB Server
    • None

    Description

      Hi,

      the following query returns NULL when run on a table with engine Columnstore and the correct result when run on an identical table with engine Aria:

      CREATE TABLE test_stats1 (
        ts DATETIME DEFAULT NULL
      ) ENGINE = Columnstore;
      CREATE TABLE test_stats2 (
        ts DATETIME DEFAULT NULL
      ) ENGINE = Aria;
       
      INSERT INTO test_stats1 VALUES ('2017-07-07 12:00:00');
      INSERT INTO test_stats2 VALUES ('2017-07-07 12:00:00');
       
      SELECT HOUR(TIMEDIFF(MAX(ts), now())) FROM test_stats1;
      -> NULL
      SELECT HOUR(TIMEDIFF(MAX(ts), now())) FROM test_stats2;
      -> 73
      

      Strangely, omitting HOUR() works correctly:

      SELECT TIMEDIFF(MAX(ts), now()) FROM test_stats1;
      -> -74:43:31
      SELECT TIMEDIFF(MAX(ts), now()) FROM test_stats2;
      -> -74:43:34
      

      Attachments

        Issue Links

          Activity

            People

              dleeyh Daniel Lee (Inactive)
              mballarin Marc Ballarin
              Votes:
              1 Vote for this issue
              Watchers:
              4 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.