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

Assertion `!table || (!table->read_set || bitmap_is_set(table->read_set, field_index) || (!(ptr >= table->record[0] && ptr < table->record[0] + table->s->reclength)))' failed in Field_datetimef::get_TIME upon DELETE from view with virtual columns

    Details

      Description

      CREATE TABLE t1 (d DATETIME(3), v DATETIME(2) AS (d));
      CREATE VIEW v1 AS SELECT * FROM t1;
       
      INSERT INTO t1 (d) VALUES ('2004-04-19 15:37:39.123'),('1985-12-24 10:15:08.456') ;
      DELETE FROM v1 ORDER BY v LIMIT 4;
       
      # Cleanup
      DROP VIEW v1;
      DROP TABLE t1;
      

      10.4 30da40bb8c3

      mysqld: /data/src/10.4/sql/field.cc:6889: virtual bool Field_datetimef::get_TIME(MYSQL_TIME*, const uchar*, date_mode_t) const: Assertion `!table || (!table->read_set || bitmap_is_set(table->read_set, field_index) || (!(ptr >= table->record[0] && ptr < table->record[0] + table->s->reclength)))' failed.
      190108 14:10:23 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007fc39319cee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
      #8  0x0000557ec9ec85ed in Field_datetimef::get_TIME (this=0x7fc37c124110, ltime=0x7fc38d32d1b0, pos=0x7fc37c1376ae "\231r&\371g", fuzzydate=...) at /data/src/10.4/sql/field.cc:6889
      #9  0x0000557ec9ede076 in Field_datetimef::get_date (this=0x7fc37c124110, ltime=0x7fc38d32d1b0, fuzzydate=...) at /data/src/10.4/sql/field.h:3410
      #10 0x0000557ec9edcd1c in Field_temporal::save_in_field (this=0x7fc37c124110, to=0x7fc37c13a0e8) at /data/src/10.4/sql/field.h:2664
      #11 0x0000557ec9ed9c0e in Field::store_field (this=0x7fc37c13a0e8, from=0x7fc37c124110) at /data/src/10.4/sql/field.h:770
      #12 0x0000557ec9ee3816 in field_conv_incompatible (to=0x7fc37c13a0e8, from=0x7fc37c124110) at /data/src/10.4/sql/field_conv.cc:851
      #13 0x0000557ec9ee3872 in field_conv (to=0x7fc37c13a0e8, from=0x7fc37c124110) at /data/src/10.4/sql/field_conv.cc:864
      #14 0x0000557ec9f174e3 in save_field_in_field (from=0x7fc37c124110, null_value=0x7fc37c16fbbe, to=0x7fc37c13a0e8, no_conversions=false) at /data/src/10.4/sql/item.cc:6352
      #15 0x0000557ec9f17724 in Item_field::save_in_field (this=0x7fc37c16fb48, to=0x7fc37c13a0e8, no_conversions=false) at /data/src/10.4/sql/item.cc:6403
      #16 0x0000557ec9cff23c in TABLE::update_virtual_fields (this=0x7fc37c123340, h=0x7fc37c136f18, update_mode=VCOL_UPDATE_FOR_DELETE) at /data/src/10.4/sql/table.cc:7798
      #17 0x0000557eca09891f in record_should_be_deleted (thd=0x7fc37c000b00, table=0x7fc37c123340, sel=0x0, explain=0x7fc37c07f278, truncate_history=false) at /data/src/10.4/sql/sql_delete.cc:239
      #18 0x0000557eca09a620 in mysql_delete (thd=0x7fc37c000b00, table_list=0x7fc37c0152f8, conds=0x7fc37c015bb0, order_list=0x7fc37c0053a8, limit=4, options=0, result=0x0) at /data/src/10.4/sql/sql_delete.cc:736
      #19 0x0000557ec9be02a6 in mysql_execute_command (thd=0x7fc37c000b00) at /data/src/10.4/sql/sql_parse.cc:4928
      #20 0x0000557ec9bea2c4 in mysql_parse (thd=0x7fc37c000b00, rawbuf=0x7fc37c014f98 "DELETE LOW_PRIORITY IGNORE FROM `view_t8` WHERE `col_timestamp` BETWEEN 1 AND 7 ORDER BY `col_bit`,`col_blob`,`col_char`,`col_date`,`col_enum`,`col_int`,`col_time`,`col_timestamp`,`col_varchar`,`col_y"..., length=330, parser_state=0x7fc38d32e600, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:8104
      #21 0x0000557ec9bd74ee in dispatch_command (command=COM_QUERY, thd=0x7fc37c000b00, packet=0x7fc37c00b421 "DELETE LOW_PRIORITY IGNORE FROM `view_t8` WHERE `col_timestamp` BETWEEN 1 AND 7 ORDER BY `col_bit`,`col_blob`,`col_char`,`col_date`,`col_enum`,`col_int`,`col_time`,`col_timestamp`,`col_varchar`,`col_y"..., packet_length=331, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:1851
      #22 0x0000557ec9bd5f12 in do_command (thd=0x7fc37c000b00) at /data/src/10.4/sql/sql_parse.cc:1396
      #23 0x0000557ec9d42140 in do_handle_one_connection (connect=0x557ecde7c320) at /data/src/10.4/sql/sql_connect.cc:1402
      #24 0x0000557ec9d41ec4 in handle_one_connection (arg=0x557ecde7c320) at /data/src/10.4/sql/sql_connect.cc:1308
      #25 0x0000557eca201308 in pfs_spawn_thread (arg=0x557ecdd8d140) at /data/src/10.4/storage/perfschema/pfs.cc:1862
      #26 0x00007fc394c58494 in start_thread (arg=0x7fc38d32f700) at pthread_create.c:333
      #27 0x00007fc39325993f in clone () from /lib/x86_64-linux-gnu/libc.so.6
      

      Reproducible with at least MyISAM and InnoDB.
      Not reproducible on 10.3.
      No visible effect on a non-debug build.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                sanja Oleksandr Byelkin
                Reporter:
                elenst Elena Stepanova
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated: