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

Assertion `0' failed in stored_field_cmp_to_item on SELECT

    XMLWordPrintable

Details

    • Bug
    • Status: Confirmed (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.4.13, 10.5.2, 10.5.3, 10.6, 10.7(EOL), 10.8(EOL), 10.9(EOL), 10.10(EOL), 10.11, 11.0(EOL), 11.1(EOL), 11.2(EOL), 11.3(EOL), 11.4
    • 10.5, 10.6, 10.11
    • GIS

    Description

      USE test;
      CREATE TABLE t(c BIGINT);
      SELECT 1 FROM t WHERE c<GEOMFROMTEXT('LINESTRING(-1 1)');
      

      Leads to:

      10.5.3 98003440c2f8d20164a191ced1b7d92b283bb68f

      mysqld: /test/10.5_dbg/sql/item.cc:9742: int stored_field_cmp_to_item(THD*, Field*, Item*): Assertion `0' failed.
      

      10.5.3 98003440c2f8d20164a191ced1b7d92b283bb68f

      Core was generated by `/test/MD210420-mariadb-10.5.3-linux-x86_64-dbg/bin/mysqld --no-defaults --core-'.
      Program terminated with signal SIGABRT, Aborted.
      #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6)
          at ../sysdeps/unix/sysv/linux/pthread_kill.c:57
      [Current thread is 1 (Thread 0x7f1ddbb88700 (LWP 730940))]
      (gdb) bt
      #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:57
      #1  0x0000559b5994e03d in my_write_core (sig=sig@entry=6) at /test/10.5_dbg/mysys/stacktrace.c:518
      #2  0x0000559b590f3d7b in handle_fatal_signal (sig=6) at /test/10.5_dbg/sql/signal_handler.cc:329
      #3  <signal handler called>
      #4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
      #5  0x00007f1dda2cc801 in __GI_abort () at abort.c:79
      #6  0x00007f1dda2bc39a in __assert_fail_base (fmt=0x7f1dda4437d8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x559b59c7ed21 "0", file=file@entry=0x559b59c5fb0e "/test/10.5_dbg/sql/item.cc", line=line@entry=9742, function=function@entry=0x559b59c5cca0 <stored_field_cmp_to_item(THD*, Field*, Item*)::__PRETTY_FUNCTION__> "int stored_field_cmp_to_item(THD*, Field*, Item*)") at assert.c:92
      #7  0x00007f1dda2bc412 in __GI___assert_fail (assertion=assertion@entry=0x559b59c7ed21 "0", file=file@entry=0x559b59c5fb0e "/test/10.5_dbg/sql/item.cc", line=line@entry=9742, function=function@entry=0x559b59c5cca0 <stored_field_cmp_to_item(THD*, Field*, Item*)::__PRETTY_FUNCTION__> "int stored_field_cmp_to_item(THD*, Field*, Item*)") at assert.c:101
      #8  0x0000559b5912aa6c in stored_field_cmp_to_item (thd=thd@entry=0x7f1dae415088, field=field@entry=0x7f1dae4520d8, item=0x7f1dae475010) at /test/10.5_dbg/sql/item.cc:9742
      #9  0x0000559b591454b2 in convert_const_to_int (thd=thd@entry=0x7f1dae415088, field_item=field_item@entry=0x7f1dae474dc0, item=0x7f1dae475178) at /test/10.5_dbg/sql/item_cmpfunc.cc:353
      #10 0x0000559b5914609d in Item_func::convert_const_compared_to_int_field (this=this@entry=0x7f1dae4750d8, thd=thd@entry=0x7f1dae415088) at /test/10.5_dbg/sql/item_cmpfunc.cc:402
      #11 0x0000559b5914625e in Item_func::setup_args_and_comparator (this=this@entry=0x7f1dae4750d8, thd=0x7f1dae415088, cmp=cmp@entry=0x7f1dae4751a8) at /test/10.5_dbg/sql/item_cmpfunc.cc:422
      #12 0x0000559b59146420 in Item_bool_rowready_func2::fix_length_and_dec (this=0x7f1dae4750d8) at /test/10.5_dbg/sql/item_cmpfunc.cc:455
      #13 0x0000559b59175434 in Item_func::fix_fields (this=0x7f1dae4750d8, thd=0x7f1dae415088, ref=<optimized out>) at /test/10.5_dbg/sql/item_func.cc:370
      #14 0x0000559b58dd0a5a in Item::fix_fields_if_needed (ref=0x7f1dae4760b8, thd=0x7f1dae415088, this=0x7f1dae4750d8) at /test/10.5_dbg/sql/item.h:976
      #15 Item::fix_fields_if_needed_for_scalar (ref=0x7f1dae4760b8, thd=0x7f1dae415088, this=0x7f1dae4750d8) at /test/10.5_dbg/sql/item.h:980
      #16 Item::fix_fields_if_needed_for_bool (ref=0x7f1dae4760b8, thd=0x7f1dae415088, this=0x7f1dae4750d8) at /test/10.5_dbg/sql/item.h:984
      #17 setup_conds (thd=thd@entry=0x7f1dae415088, tables=tables@entry=0x7f1dae4746d0, leaves=..., conds=conds@entry=0x7f1dae4760b8) at /test/10.5_dbg/sql/sql_base.cc:8275
      #18 0x0000559b58eb8f4c in setup_without_group (reserved=0x7f1dae474484, hidden_group_fields=0x7f1dae475f8f, win_funcs=..., win_specs=..., group=0x0, order=0x0, conds=0x7f1dae4760b8, all_fields=..., fields=..., leaves=..., tables=0x7f1dae4746d0, ref_pointer_array=..., thd=0x7f1dae415088) at /test/10.5_dbg/sql/sql_select.cc:693
      #19 JOIN::prepare (this=this@entry=0x7f1dae475ca8, tables_init=tables_init@entry=0x7f1dae4746d0, conds_init=conds_init@entry=0x7f1dae4750d8, og_num=og_num@entry=0, order_init=order_init@entry=0x0, skip_order_by=skip_order_by@entry=false, group_init=0x0, having_init=0x0, proc_param_init=0x0, select_lex_arg=0x7f1dae474178, unit_arg=0x7f1dae419098) at /test/10.5_dbg/sql/sql_select.cc:1246
      #20 0x0000559b58ec6385 in mysql_select (thd=thd@entry=0x7f1dae415088, tables=0x7f1dae4746d0, fields=..., conds=0x7f1dae4750d8, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x7f1dae475c80, unit=0x7f1dae419098, select_lex=0x7f1dae474178) at /test/10.5_dbg/sql/sql_select.cc:4634
      #21 0x0000559b58ec6787 in handle_select (thd=thd@entry=0x7f1dae415088, lex=lex@entry=0x7f1dae418fd0, result=result@entry=0x7f1dae475c80, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.5_dbg/sql/sql_select.cc:417
      #22 0x0000559b58e50ef4 in execute_sqlcom_select (thd=thd@entry=0x7f1dae415088, all_tables=0x7f1dae4746d0) at /test/10.5_dbg/sql/sql_parse.cc:6172
      #23 0x0000559b58e49919 in mysql_execute_command (thd=thd@entry=0x7f1dae415088) at /test/10.5_dbg/sql/sql_parse.cc:3901
      #24 0x0000559b58e56f2b in mysql_parse (thd=thd@entry=0x7f1dae415088, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x7f1ddbb87450, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.5_dbg/sql/sql_parse.cc:7957
      #25 0x0000559b58e42c45 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x7f1dae415088, packet=packet@entry=0x7f1dae467089 "SELECT 1 FROM t WHERE c<GEOMFROMTEXT('LINESTRING(-1 1)')", packet_length=packet_length@entry=56, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.5_dbg/sql/sql_parse.cc:1839
      #26 0x0000559b58e4149b in do_command (thd=0x7f1dae415088) at /test/10.5_dbg/sql/sql_parse.cc:1358
      #27 0x0000559b58f9c415 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x7f1db9fc53a8, put_in_cache=put_in_cache@entry=true) at /test/10.5_dbg/sql/sql_connect.cc:1422
      #28 0x0000559b58f9c744 in handle_one_connection (arg=arg@entry=0x7f1db9fc53a8) at /test/10.5_dbg/sql/sql_connect.cc:1319
      #29 0x0000559b593fcfb0 in pfs_spawn_thread (arg=0x7f1dd9845b08) at /test/10.5_dbg/storage/perfschema/pfs.cc:2201
      #30 0x00007f1ddafaf6db in start_thread (arg=0x7f1ddbb88700) at pthread_create.c:463
      #31 0x00007f1dda3ad88f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Bug confirmed present in:
      MariaDB: 10.4.13 (dbg), 10.5.2 (dbg), 10.5.3 (dbg)

      Bug confirmed not present in:
      MariaDB: 10.1.45 (dbg), 10.1.45 (opt), 10.2.32 (dbg), 10.2.32 (opt), 10.3.23 (dbg), 10.3.23 (opt), 10.4.13 (opt), 10.5.2 (opt), 10.5.3 (opt)
      MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.47 (dbg), 5.6.47 (opt), 5.7.29 (dbg), 5.7.29 (opt), 8.0.19 (dbg), 8.0.19 (opt)

      MariaDB 10.3.23 (dbg);

      10.3.23>SELECT 1 FROM t WHERE c<GEOMFROMTEXT('LINESTRING(-1 1)');
      Empty set, 1 warning (0.002 sec)
       
      10.3.23>SHOW WARNINGS\G
      *************************** 1. row ***************************
        Level: Warning
         Code: 1292
      Message: Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x01\x02\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\xF0\xBF\x00\x00\x00\x00\x00\x00\xF0?'
      1 row in set (0.000 sec)
      

      Attachments

        Issue Links

          Activity

            People

              holyfoot Alexey Botchkov
              Roel Roel Van de Paar
              Votes:
              0 Vote for this issue
              Watchers:
              4 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.