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

Assertion `is_valid_value_slow()' failed in Datetime::Datetime upon EXTRACT under mode ZERO_DATE_TIME_CAST

    XMLWordPrintable

Details

    Description

      Note: MDEV-23018 mentions the same assertion, but everything else is different there.

      SET SESSION old_mode= 'ZERO_DATE_TIME_CAST';
      SELECT EXTRACT(DAY FROM CAST('100000:00:00' AS DATETIME));
      

      10.4 7f8cd326

      mysqld: /data/src/10.4/sql/sql_type.h:2172: Datetime::Datetime(THD*, Item*, date_mode_t): Assertion `is_valid_value_slow()' failed.
      200908  2:10:33 [ERROR] mysqld got signal 6 ;
       
      #6  0x00007f1567d4a729 in __assert_fail_base (fmt=0x7f1567ee0588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x55a1c878c118 "is_valid_value_slow()", file=0x55a1c878c097 "/data/src/10.4/sql/sql_type.h", line=2172, function=<optimized out>) at assert.c:92
      #7  0x00007f1567d5bf36 in __GI___assert_fail (assertion=0x55a1c878c118 "is_valid_value_slow()", file=0x55a1c878c097 "/data/src/10.4/sql/sql_type.h", line=2172, function=0x55a1c878c1b0 "Datetime::Datetime(THD*, Item*, date_mode_t)") at assert.c:101
      #8  0x000055a1c78a0c3a in Datetime::Datetime (this=0x7f1561d2cf60, thd=0x7f1550000d90, item=0x7f1550013988, fuzzydate=...) at /data/src/10.4/sql/sql_type.h:2172
      #9  0x000055a1c7d1929c in Datetime::Datetime (this=0x7f1561d2cf60, thd=0x7f1550000d90, item=0x7f1550013988, fuzzydate=..., dec=0) at /data/src/10.4/sql/sql_type.h:2220
      #10 0x000055a1c7e4da3a in Item_datetime_typecast::get_date (this=0x7f1550013a38, thd=0x7f1550000d90, ltime=0x7f1561d2cf60, fuzzydate=...) at /data/src/10.4/sql/item_timefunc.cc:2475
      #11 0x000055a1c7be40f0 in Temporal_hybrid::Temporal_hybrid (this=0x7f1561d2cf60, thd=0x7f1550000d90, item=0x7f1550013a38, fuzzydate=...) at /data/src/10.4/sql/sql_type.cc:254
      #12 0x000055a1c7e50c06 in Extract_source::Extract_source (this=0x7f1561d2cf60, thd=0x7f1550000d90, item=0x7f1550013a38, mode=...) at /data/src/10.4/sql/sql_type.h:1130
      #13 0x000055a1c7e4c415 in Item_extract::val_int (this=0x7f1550013af8) at /data/src/10.4/sql/item_timefunc.cc:2159
      #14 0x000055a1c7bf635d in Type_handler::Item_send_long (this=0x55a1c908dc70 <type_handler_long>, item=0x7f1550013af8, protocol=0x7f1550001358, buf=0x7f1561d2d0a0) at /data/src/10.4/sql/sql_type.cc:6992
      #15 0x000055a1c7c039c4 in Type_handler_long::Item_send (this=0x55a1c908dc70 <type_handler_long>, item=0x7f1550013af8, protocol=0x7f1550001358, buf=0x7f1561d2d0a0) at /data/src/10.4/sql/sql_type.h:5043
      #16 0x000055a1c78a1492 in Item::send (this=0x7f1550013af8, protocol=0x7f1550001358, buffer=0x7f1561d2d0a0) at /data/src/10.4/sql/item.h:1038
      #17 0x000055a1c789b1d3 in Protocol::send_result_set_row (this=0x7f1550001358, row_items=0x7f1550013658) at /data/src/10.4/sql/protocol.cc:1035
      #18 0x000055a1c79542c2 in select_send::send_data (this=0x7f1550014518, items=...) at /data/src/10.4/sql/sql_class.cc:3010
      #19 0x000055a1c7a1cefd in JOIN::exec_inner (this=0x7f1550014540) at /data/src/10.4/sql/sql_select.cc:4346
      #20 0x000055a1c7a1c79a in JOIN::exec (this=0x7f1550014540) at /data/src/10.4/sql/sql_select.cc:4260
      #21 0x000055a1c7a1deee in mysql_select (thd=0x7f1550000d90, tables=0x0, wild_num=0, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x7f1550014518, unit=0x7f1550004cb8, select_lex=0x7f1550013510) at /data/src/10.4/sql/sql_select.cc:4695
      #22 0x000055a1c7a0d8ff in handle_select (thd=0x7f1550000d90, lex=0x7f1550004bf8, result=0x7f1550014518, setup_tables_done_option=0) at /data/src/10.4/sql/sql_select.cc:410
      #23 0x000055a1c79d3384 in execute_sqlcom_select (thd=0x7f1550000d90, all_tables=0x0) at /data/src/10.4/sql/sql_parse.cc:6355
      #24 0x000055a1c79c99d6 in mysql_execute_command (thd=0x7f1550000d90) at /data/src/10.4/sql/sql_parse.cc:3889
      #25 0x000055a1c79d738f in mysql_parse (thd=0x7f1550000d90, rawbuf=0x7f1550013438 "SELECT EXTRACT(DAY FROM CAST('100000:00:00' AS DATETIME))", length=57, parser_state=0x7f1561d2e550, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:7896
      #26 0x000055a1c79c389e in dispatch_command (command=COM_QUERY, thd=0x7f1550000d90, packet=0x7f1550008791 "", packet_length=57, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:1834
      #27 0x000055a1c79c2106 in do_command (thd=0x7f1550000d90) at /data/src/10.4/sql/sql_parse.cc:1352
      #28 0x000055a1c7b4fd55 in do_handle_one_connection (connect=0x55a1cbe27030) at /data/src/10.4/sql/sql_connect.cc:1412
      #29 0x000055a1c7b4fa9e in handle_one_connection (arg=0x55a1cbe27030) at /data/src/10.4/sql/sql_connect.cc:1316
      #30 0x000055a1c8565502 in pfs_spawn_thread (arg=0x55a1cbd2d1b0) at /data/src/10.4/storage/perfschema/pfs.cc:1869
      #31 0x00007f1568273609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #32 0x00007f1567e47103 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Reproducible on 10.4, 10.5.
      Can't be reproducible on 10.3 because the assertion was only added in 10.4. I don't know whether the underlying issue (if any) exists in earlier versions.
      No obvious problem on a non-debug build.

      Attachments

        Activity

          People

            sanja Oleksandr Byelkin
            elenst Elena Stepanova
            Votes:
            0 Vote for this issue
            Watchers:
            2 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.