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

Internal error: Un-recognized Arithmetic Operand during query with timestamp

    XMLWordPrintable

    Details

    • Sprint:
      2016-22, 2016-24

      Description

      Steps to reproduce :-
      1)Create a table -> table_1
      CREATE TABLE `table_1` (
      `id` int(11) NOT NULL,
      `time_slice_size` int(11) DEFAULT NULL
      ) ENGINE=Columnstore DEFAULT CHARSET=latin1;

      2)Insert data in table_1 -> insert into table_1 values(1,60);

      3)Create another table -> table_2
      CREATE TABLE `table_2` (
      `id` int(11) NOT NULL AUTO_INCREMENT,
      `start_timestamp` timestamp NULL DEFAULT NULL,
      `end_timestamp` timestamp NULL DEFAULT NULL,
      PRIMARY KEY (`id`)
      ) ENGINE=MyISAM AUTO_INCREMENT=9155 DEFAULT CHARSET=latin1;

      4)Insert data into table_2 :- insert into table_2 values (1,'2016-10-10 08:00:00','2016-10-10 09:00:00');

      5)Run below query :-
      select tb1.time_slice_size,tb2.id bm_id, tb2.end_timestamp, tb2.start_timestamp FROM table_1 tb1, table_2 tb2 where tb1.id = tb2.id AND '1970-01-01 06:30:00' >= from_unixtime((unix_timestamp(tb2.end_timestamp)-unix_timestamp(tb2.start_timestamp))%tb1.time_slice_size) limit 1;

      This will give ERROR 1815 (HY000): Internal error: Un-recognized Arithmetic Operand.

      And if i replace tb1.time_slice_size with some hard coded values like 60.It work fine.

      select tb1.time_slice_size,tb2.id bm_id, tb2.end_timestamp, tb2.start_timestamp FROM table_1 tb1, table_2 tb2 where tb1.id = tb2.id AND '1970-01-01 06:30:00' >= from_unixtime((unix_timestamp(tb2.end_timestamp)-unix_timestamp(tb2.start_timestamp))%60);

        Attachments

          Activity

            People

            Assignee:
            LinuxJedi Andrew Hutchings (Inactive)
            Reporter:
            kssonu4u Kumar Saurav Sonu
            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.