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

concurrent queries with virtual columns crash in temporal code

    XMLWordPrintable

Details

    Description

      MariaDB doesn't seem to be able to run a concurrent SELECT workload on randomly created tables having virtual columns.
      10.1.12 crash details:

      Invalid read of size 8
      at : val_temporal_packed (item.h:1252)
      by: get_datetime_value(THD*, Item***, Item**, enum_field_types, bool*) (item_cmpfunc.cc:742)
      by: Arg_comparator::compare_temporal(enum_field_types) (item_cmpfunc.cc:793)
      by: compare (item_cmpfunc.h:88)
      by: Item_func_le::val_int() (item_cmpfunc.cc:1781)
      by: Item::save_in_field(Field*, bool) (item.cc:5931)
      by: update_virtual_fields(THD*, TABLE*, enum_vcol_update_mode) (table.cc:6897)
      by: rr_sequential(READ_RECORD*) (records.cc:483)
      by: sub_select(JOIN*, st_join_table*, bool) (sql_select.cc:18312)
      by: do_select(JOIN*, List<Item>*, TABLE*, Procedure*) (sql_select.cc:17948)
      by: JOIN::exec_inner() (sql_select.cc:3228)
      by: exec (sql_select.cc:2518)
      by: mysql_select(THD*, Item***, TABLE_LIST*, unsigned int, List<Item>&, Item*, unsigned int, st_order*, st_order*, Item*, st_order*, unsigned long long, select_result*, st_select_lex_unit*, st_select_lex*) (sql_select.cc:3451)
      by: handle_select(THD*, LEX*, select_result*, unsigned long) (sql_select.cc:384)
      by: execute_sqlcom_select(THD*, TABLE_LIST*) (sql_parse.cc:5936)
      by: mysql_execute_command(THD*) (sql_parse.cc:2962)
      by: mysql_parse(THD*, char*, unsigned int, Parser_state*) (sql_parse.cc:7336)
      by: dispatch_command(enum_server_command, THD*, char*, unsigned int) (sql_parse.cc:1488)
      by: do_command(THD*) (sql_parse.cc:1109)
      by: do_handle_one_connection(THD*) (sql_connect.cc:1349)
      by: handle_one_connection (sql_connect.cc:1261)
      by: start_thread (pthread_create.c:308)
      by: clone (clone.S:113)
      Address 0x2f207463656c6763 is not stack'd, malloc'd or (recently) free'd
      

      On Windows, typical crash is:

      Version: '10.1.12-MariaDB'  socket: ''  port: 3306  mariadb.org binary distribution
      mysqld.exe!get_datetime_value()[item_cmpfunc.cc:746]
      mysqld.exe!Arg_comparator::compare_temporal()[item_cmpfunc.cc:794]
      mysqld.exe!Item_func_ne::val_int()[item_cmpfunc.cc:1759]
      mysqld.exe!Item::val_bool()[item.cc:84]
      mysqld.exe!Item_cond_and::val_int()[item_cmpfunc.cc:4911]
      mysqld.exe!Item::save_in_field()[item.cc:5931]
      mysqld.exe!update_virtual_fields()[table.cc:6888]
      mysqld.exe!rr_sequential()[records.cc:484]
      mysqld.exe!sub_select()[sql_select.cc:18290]
      mysqld.exe!do_select()[sql_select.cc:17948]
      mysqld.exe!JOIN::exec_inner()[sql_select.cc:3228]
      mysqld.exe!JOIN::exec()[sql_select.cc:2519]
      mysqld.exe!mysql_select()[sql_select.cc:3453]
      mysqld.exe!handle_select()[sql_select.cc:384]
      mysqld.exe!execute_sqlcom_select()[sql_parse.cc:5936]
      mysqld.exe!mysql_execute_command()[sql_parse.cc:2962]
      mysqld.exe!mysql_parse()[sql_parse.cc:7341]
      mysqld.exe!dispatch_command()[sql_parse.cc:1491]
      mysqld.exe!do_command()[sql_parse.cc:1109]
      

      How to repeat
      ------------------
      generic readonly test on multiple connections with virtual column tables.
      I will provide a sample of some tables I used, one have to run:

      SELECT * FROM <table>;

      in multiple connections and pick any table randomly.
      Try flushing tables or optimizing them (or recreating) during a run if it is not repeatable.

      Attachments

        1. schema.sql
          39 kB
        2. threads1
          39 kB

        Issue Links

          Activity

            People

              serg Sergei Golubchik
              sbester1 sbester1
              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.