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

Assertion `arg_count == 2 || args[0] == args[2] || _current_thd()->lex->context_analysis_only' failed with virtual column

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.2(EOL), 10.3(EOL), 10.4(EOL), 10.5, 10.6, 10.8(EOL), 10.9(EOL), 10.10(EOL), 10.11, 11.0(EOL), 11.1(EOL)
    • 10.5, 10.6, 10.11
    • Virtual Columns
    • None

    Description

      CREATE TABLE t1 (
        f1 char(8) CHARACTER SET latin1,
        f2 char(8) CHARACTER SET utf8,
        vc char(8) GENERATED ALWAYS AS (nullif(f1,f2))
      );
      CREATE TABLE t2 LIKE t1;
       
      # Cleanup
      DROP TABLE t1, t2;
      

      10.4 f5dceafd

      mysqld: /data/src/10.4/sql/item_cmpfunc.cc:2816: virtual void Item_func_nullif::print(String*, enum_query_type): Assertion `arg_count == 2 || args[0] == args[2] || _current_thd()->lex->context_analysis_only' failed.
      230609 18:23:24 [ERROR] mysqld got signal 6 ;
       
      #9  0x00007f4479774df2 in __GI___assert_fail (assertion=0x55ea8697e3c0 "arg_count == 2 || args[0] == args[2] || _current_thd()->lex->context_analysis_only", file=0x55ea8697c460 "/data/src/10.4/sql/item_cmpfunc.cc", line=2816, function=0x55ea8697e360 "virtual void Item_func_nullif::print(String*, enum_query_type)") at ./assert/assert.c:101
      #10 0x000055ea84df1b4b in Item_func_nullif::print (this=0x61d0001fb8a8, str=0x7f4471a21560, query_type=665) at /data/src/10.4/sql/item_cmpfunc.cc:2816
      #11 0x000055ea84d61673 in Item::print_parenthesised (this=0x61d0001fb8a8, str=0x7f4471a21560, query_type=665, parent_prec=LOWEST_PRECEDENCE) at /data/src/10.4/sql/item.cc:488
      #12 0x000055ea847829de in Item::print_for_table_def (this=0x61d0001fb8a8, str=0x7f4471a21560) at /data/src/10.4/sql/item.h:1725
      #13 0x000055ea847830fa in Virtual_column_info::print (this=0x619000085630, str=0x7f4471a21560) at /data/src/10.4/sql/item.h:7636
      #14 0x000055ea848e6107 in pack_expression (buf=0x7f4471a21560, vcol=0x619000085630, field_nr=2, type=VCOL_GENERATED_VIRTUAL) at /data/src/10.4/sql/unireg.cc:626
      #15 0x000055ea848e63a0 in pack_vcols (buf=0x7f4471a21560, create_fields=..., check_constraint_list=0x7f4471a23090) at /data/src/10.4/sql/unireg.cc:647
      #16 0x000055ea848e1df2 in build_frm_image (thd=0x62b00005b208, table=..., create_info=0x7f4471a23130, create_fields=..., keys=0, key_info=0x62b000063e60, db_file=0x62b000063700) at /data/src/10.4/sql/unireg.cc:204
      #17 0x000055ea847cf83d in mysql_create_frm_image (thd=0x62b00005b208, db=..., table_name=..., create_info=0x7f4471a23130, alter_info=0x7f4471a23030, create_table_mode=0, key_info=0x7f4471a22b90, key_count=0x7f4471a22b80, frm=0x7f4471a22bb0) at /data/src/10.4/sql/sql_table.cc:4925
      #18 0x000055ea847d0f99 in create_table_impl (thd=0x62b00005b208, orig_db=..., orig_table_name=..., db=..., table_name=..., path=0x7f4471a22bd0 "./test/t2", options=..., create_info=0x7f4471a23130, alter_info=0x7f4471a23030, create_table_mode=0, is_trans=0x7f4471a22f30, key_info=0x7f4471a22b90, key_count=0x7f4471a22b80, frm=0x7f4471a22bb0) at /data/src/10.4/sql/sql_table.cc:5164
      #19 0x000055ea847d1a4e in mysql_create_table_no_lock (thd=0x62b00005b208, db=0x62b000062360, table_name=0x62b000062370, create_info=0x7f4471a23130, alter_info=0x7f4471a23030, is_trans=0x7f4471a22f30, create_table_mode=0, table_list=0x62b000062348) at /data/src/10.4/sql/sql_table.cc:5267
      #20 0x000055ea847d5f5d in mysql_create_like_table (thd=0x62b00005b208, table=0x62b000062348, src_table=0x62b000062aa0, create_info=0x7f4471a249b0) at /data/src/10.4/sql/sql_table.cc:5894
      #21 0x000055ea84800ace in Sql_cmd_create_table_like::execute (this=0x62b0000622c0, thd=0x62b00005b208) at /data/src/10.4/sql/sql_table.cc:11784
      #22 0x000055ea84586c61 in mysql_execute_command (thd=0x62b00005b208) at /data/src/10.4/sql/sql_parse.cc:6216
      #23 0x000055ea84592463 in mysql_parse (thd=0x62b00005b208, rawbuf=0x62b000062228 "CREATE TABLE t2 LIKE t1", length=23, parser_state=0x7f4471a26860, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:8008
      #24 0x000055ea845687a6 in dispatch_command (command=COM_QUERY, thd=0x62b00005b208, packet=0x629000230209 "CREATE TABLE t2 LIKE t1", packet_length=23, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:1857
      #25 0x000055ea84565315 in do_command (thd=0x62b00005b208) at /data/src/10.4/sql/sql_parse.cc:1378
      #26 0x000055ea849640ba in do_handle_one_connection (connect=0x6080000009a8) at /data/src/10.4/sql/sql_connect.cc:1420
      #27 0x000055ea849639d1 in handle_one_connection (arg=0x6080000009a8) at /data/src/10.4/sql/sql_connect.cc:1324
      #28 0x000055ea855d0aee in pfs_spawn_thread (arg=0x615000003508) at /data/src/10.4/storage/perfschema/pfs.cc:1869
      #29 0x00007f44797c8fd4 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
      #30 0x00007f44798495bc in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
      

      The failure started happening after this commit in 10.2.44:

      commit 9c5fd0f624df846686742182825d964c546fac58
      Author: Sergei Golubchik
      Date:   Sat Apr 16 11:53:44 2022 +0200
       
          vcols: cannot use CONTEXT_ANALYSIS_ONLY_VCOL_EXPR on fix_fields
      

      No obvious immediate problem on a non-debug build.

      Attachments

        Activity

          People

            nikitamalyavin Nikita Malyavin
            elenst Elena Stepanova
            Votes:
            0 Vote for this issue
            Watchers:
            1 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.