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

Interplay between function based default and lock tables

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Duplicate
    • 10.3.15
    • N/A
    • Locking
    • None
    • CentOS 7
      Windows 10 1803

    Description

      When you lock a table which has a column set to get a default value from a function and insert into that table after locking MariaDB segfaults.

      Attached File Name Includes function based default Includes lock statement Causes Segfault
      seqfault.sql Yes Yes Yes
      without_lock.sql Yes No No
      without_default No Yes No

      Attachments

        1. seqfault.sql
          0.4 kB
          SGC IT
        2. without_default.sql
          0.3 kB
          SGC IT
        3. without_lock.sql
          0.4 kB
          SGC IT

        Issue Links

          Activity

            alice Alice Sherepa added a comment -

            Thanks for the report!
            It seems to be the same problem as MDEV-16039:

            --source include/have_innodb.inc
            CREATE TABLE `allele` (
              `pkey` int(11) NOT NULL AUTO_INCREMENT,
              `person` varchar(30) DEFAULT substring_index(user(),'@',1),
              PRIMARY KEY (`pkey`)) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
            LOCK TABLES `allele` WRITE;
            INSERT INTO `allele` VALUES (1,null);
            UNLOCK TABLES;
            

            10.2 2b660fb4c212973ba0f11

            ==27447==ERROR: AddressSanitizer: use-after-poison on address 0x62b000000ef0 at pc 0x000000717a8e bp 0x7f6498b1a230 sp 0x7f6498b1a220
            READ of size 8 at 0x62b000000ef0 thread T27
                #0 0x717a8d in Item_args::walk_args(bool (Item::*)(void*), bool, void*) /10.2/sql/item.h:4026
                #1 0x718558 in Item_func_or_sum::walk(bool (Item::*)(void*), bool, void*) /10.2/sql/item.h:4311
                #2 0xa81b06 in fix_session_vcol_expr(THD*, Virtual_column_info*) /10.2/sql/table.cc:2796
                #3 0x6fe1e6 in fix_all_session_vcol_exprs /10.2/sql/sql_base.cc:4952
                #4 0x6ff1fb in lock_tables(THD*, TABLE_LIST*, unsigned int, unsigned int) /10.2/sql/sql_base.cc:5130
                #5 0x6fd415 in open_and_lock_tables(THD*, DDL_options_st const&, TABLE_LIST*, bool, unsigned int, Prelocking_strategy*) /10.2/sql/sql_base.cc:4819
                #6 0x6dea66 in open_and_lock_tables(THD*, TABLE_LIST*, bool, unsigned int) /10.2/sql/sql_base.h:509
                #7 0x7a51d6 in mysql_insert(THD*, TABLE_LIST*, List<Item>&, List<List<Item> >&, List<Item>&, List<Item>&, enum_duplicates, bool) /10.2/sql/sql_insert.cc:758
                #8 0x8066e7 in mysql_execute_command(THD*) /10.2/sql/sql_parse.cc:4169
                #9 0x81d564 in mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool) /10.2/sql/sql_parse.cc:7754
                #10 0x7f9e38 in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool) /10.2/sql/sql_parse.cc:1833
                #11 0x7f6f2e in do_command(THD*) /10.2/sql/sql_parse.cc:1387
                #12 0xb2d0b3 in do_handle_one_connection(CONNECT*) /10.2/sql/sql_connect.cc:1335
                #13 0xb2caac in handle_one_connection /10.2/sql/sql_connect.cc:1241
                #14 0x1d14b45 in pfs_spawn_thread /10.2/storage/perfschema/pfs.cc:1862
                #15 0x7f64b00bc6b9 in start_thread (/lib/x86_64-linux-gnu/libpthread.so.0+0x76b9)
                #16 0x7f64af55141c in clone (/lib/x86_64-linux-gnu/libc.so.6+0x10741c)
            
            

            alice Alice Sherepa added a comment - Thanks for the report! It seems to be the same problem as MDEV-16039 : --source include/have_innodb.inc CREATE TABLE `allele` ( `pkey` int (11) NOT NULL AUTO_INCREMENT, `person` varchar (30) DEFAULT substring_index( user (), '@' ,1), PRIMARY KEY (`pkey`)) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1; LOCK TABLES `allele` WRITE; INSERT INTO `allele` VALUES (1, null ); UNLOCK TABLES; 10.2 2b660fb4c212973ba0f11 ==27447==ERROR: AddressSanitizer: use-after-poison on address 0x62b000000ef0 at pc 0x000000717a8e bp 0x7f6498b1a230 sp 0x7f6498b1a220 READ of size 8 at 0x62b000000ef0 thread T27 #0 0x717a8d in Item_args::walk_args(bool (Item::*)(void*), bool, void*) /10.2/sql/item.h:4026 #1 0x718558 in Item_func_or_sum::walk(bool (Item::*)(void*), bool, void*) /10.2/sql/item.h:4311 #2 0xa81b06 in fix_session_vcol_expr(THD*, Virtual_column_info*) /10.2/sql/table.cc:2796 #3 0x6fe1e6 in fix_all_session_vcol_exprs /10.2/sql/sql_base.cc:4952 #4 0x6ff1fb in lock_tables(THD*, TABLE_LIST*, unsigned int, unsigned int) /10.2/sql/sql_base.cc:5130 #5 0x6fd415 in open_and_lock_tables(THD*, DDL_options_st const&, TABLE_LIST*, bool, unsigned int, Prelocking_strategy*) /10.2/sql/sql_base.cc:4819 #6 0x6dea66 in open_and_lock_tables(THD*, TABLE_LIST*, bool, unsigned int) /10.2/sql/sql_base.h:509 #7 0x7a51d6 in mysql_insert(THD*, TABLE_LIST*, List<Item>&, List<List<Item> >&, List<Item>&, List<Item>&, enum_duplicates, bool) /10.2/sql/sql_insert.cc:758 #8 0x8066e7 in mysql_execute_command(THD*) /10.2/sql/sql_parse.cc:4169 #9 0x81d564 in mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool) /10.2/sql/sql_parse.cc:7754 #10 0x7f9e38 in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool) /10.2/sql/sql_parse.cc:1833 #11 0x7f6f2e in do_command(THD*) /10.2/sql/sql_parse.cc:1387 #12 0xb2d0b3 in do_handle_one_connection(CONNECT*) /10.2/sql/sql_connect.cc:1335 #13 0xb2caac in handle_one_connection /10.2/sql/sql_connect.cc:1241 #14 0x1d14b45 in pfs_spawn_thread /10.2/storage/perfschema/pfs.cc:1862 #15 0x7f64b00bc6b9 in start_thread (/lib/x86_64-linux-gnu/libpthread.so.0+0x76b9) #16 0x7f64af55141c in clone (/lib/x86_64-linux-gnu/libc.so.6+0x10741c)

            People

              Unassigned Unassigned
              sgcit SGC IT
              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.