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

using DATETIME(6) as row_start/row_end crashes server

    XMLWordPrintable

    Details

      Description

      create table t (
        a int,
        row_start datetime(6) generated always as row start,
        row_end datetime(6) generated always as row end,
        period for system_time(row_start, row_end)
      ) with system versioning;
      insert into t (a) values (1);
      drop table t;
      

      #8  Field::set_max (this=0x7f92e00fb750) at field.h:654
      #9  TABLE::vers_update_fields (this=0x7f92e0036058) at table.cc:7926
      #10 fill_record (thd=0x7f92e0000cf8, table_arg=0x7f92e0036058, fields=class List<Item> with 1 elements, values=class List<Item> with 1 elements, ignore_errors=false, update=false) at sql_base.cc:8322
      #11 fill_record_n_invoke_before_triggers (thd=0x7f92e0000cf8, table=0x7f92e0036058, fields=class List<Item> with 1 elements, values=class List<Item> with 1 elements, ignore_errors=false, event=TRG_EVENT_INSERT) at sql_base.cc:8449
      #12 mysql_insert (thd=0x7f92e0000cf8, table_list=0x7f92e0013ee8, fields=class List<Item> with 1 elements, values_list=..., update_fields=class List<Item> with 0 elements, update_values=class List<Item> with 0 elements, duplic=DUP_ERROR, ignore=false) at sql_insert.cc:960
      #13 mysql_execute_command (thd=0x7f92e0000cf8) at sql_parse.cc:4728
      #14 mysql_parse (thd=0x7f92e0000cf8, rawbuf=0x7f92e0013e00 "insert into t (a) values (1)", length=28, parser_state=0x7f9335fb9560, is_com_multi=false, is_next_command=false) at sql_parse.cc:8095
      

      row_start/row_end can only be either TIMESTAMP(6) or BIGINT UNSIGNED. DATETIME(6) should be disallowed.

      Test case was found here https://stackoverflow.com/questions/52655055/using-datetime-in-mariadb-10-3-9-system-versioned-tables-works-for-rowstart-but

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              bar Alexander Barkov
              Reporter:
              kevg Eugene Kosov (Inactive)
              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.