[MDEV-16207] Sig 11 on RHEL7 on Azure Created: 2018-05-17  Updated: 2019-08-30  Resolved: 2019-08-30

Status: Closed
Project: MariaDB Server
Component/s: OTHER
Affects Version/s: 5.5.60
Fix Version/s: N/A

Type: Bug Priority: Critical
Reporter: Michal Schorm Assignee: Oleksandr Byelkin
Resolution: Won't Fix Votes: 0
Labels: crash
Environment:

MS Azure, RHEL 7.4
Customer claims he wasn't succesfull reproducing the issue outside


Attachments: Text File Logs Snippet.txt     Text File MariaDB_Query with Logs.txt     Text File MariaDB_Query.txt     Text File alarm_events.txt     File my.cnf     Text File rest_measurement_registry.txt     Text File site_configuration.txt     Text File syslog_events.txt     Text File turbine_information.txt    
Issue Links:
Relates
relates to MDEV-8525 mariadb 10.0.20 crashing when data is... Closed

 Description   

Hello,

I have a trouble in examining a customer's issue.
I have available full backtrace, coredump, specific query on which the server dies, table structure, server log, systemd journal and my.cnf configuration.
Even though I was unsuccessful solving it yet. It might me much easier for you to help me out. Which I would be grateful for, as the issue solving is really crucial for the customer.

Backtrace:

#0  0x00007ff1628d99b1 in __pthread_kill (threadid=<optimized out>, signo=signo@entry=11) at ../nptl/sysdeps/unix/sysv/linux/pthread_kill.c:61
#1  0x00007ff1636b3d43 in my_write_core (sig=11) at /usr/src/debug/mariadb-5.5.60/mysys/stacktrace.c:457
#2  0x00007ff1631ff4dd in handle_fatal_signal (sig=11) at /usr/src/debug/mariadb-5.5.60/sql/signal_handler.cc:262
#3  <signal handler called>
#4  Item_field::Item_field (this=0x7ff0f009c468, f=0x0) at /usr/src/debug/mariadb-5.5.60/sql/item.cc:2331
#5  0x00007ff163294cd5 in Item_subselect::get_tmp_table_item (this=0x7ff0f000fbd8, thd_arg=<optimized out>) at /usr/src/debug/mariadb-5.5.60/sql/item_subselect.cc:873
#6  0x00007ff16321a31f in Item_ref::get_tmp_table_item (this=this@entry=0x7ff0f00639d8, thd=<optimized out>) at /usr/src/debug/mariadb-5.5.60/sql/item.cc:7588
#7  0x00007ff16322a91d in Item_direct_view_ref::get_tmp_table_item (this=0x7ff0f00639d8, thd=<optimized out>) at /usr/src/debug/mariadb-5.5.60/sql/item.h:3360
#8  0x00007ff1630ec8e4 in change_refs_to_tmp_fields (all_fields=..., elements=11, res_all_fields=..., res_selected_fields=..., ref_pointer_array=0x7ff0f0064548, thd=0x7ff166803c80)
    at /usr/src/debug/mariadb-5.5.60/sql/sql_select.cc:21827
#9  JOIN::exec (this=this@entry=0x7ff0f0057a88) at /usr/src/debug/mariadb-5.5.60/sql/sql_select.cc:2500
#10 0x00007ff1630e795f in mysql_select (thd=thd@entry=0x7ff166803c80, rref_pointer_array=rref_pointer_array@entry=0x7ff1668079a8, tables=0x7ff0f001b388, wild_num=1, fields=..., conds=0x0, og_num=2, 
    order=0x7ff0f0025d58, group=0x0, having=0x0, proc_param=0x0, select_options=select_options@entry=2147748608, result=result@entry=0x7ff0f0035638, unit=unit@entry=0x7ff166806fa8, 
    select_lex=select_lex@entry=0x7ff1668076a8) at /usr/src/debug/mariadb-5.5.60/sql/sql_select.cc:3118
#11 0x00007ff1630e7bcc in handle_select (thd=thd@entry=0x7ff166803c80, lex=lex@entry=0x7ff166806ef8, result=result@entry=0x7ff0f0035638, setup_tables_done_option=setup_tables_done_option@entry=0)
    at /usr/src/debug/mariadb-5.5.60/sql/sql_select.cc:323
#12 0x00007ff163088724 in execute_sqlcom_select (thd=thd@entry=0x7ff166803c80, all_tables=<optimized out>) at /usr/src/debug/mariadb-5.5.60/sql/sql_parse.cc:4678
#13 0x00007ff16309009a in mysql_execute_command (thd=thd@entry=0x7ff166803c80) at /usr/src/debug/mariadb-5.5.60/sql/sql_parse.cc:2224
#14 0x00007ff163098106 in mysql_parse (thd=thd@entry=0x7ff166803c80, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x7ff162c10500)
    at /usr/src/debug/mariadb-5.5.60/sql/sql_parse.cc:5923
#15 0x00007ff1630997b3 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x7ff166803c80, 
    packet=packet@entry=0x7ff166808761 ' ' <repeats 24 times>, "SELECT \n", ' ' <repeats 28 times>, "*\n", ' ' <repeats 24 times>, "FROM\n", ' ' <repeats 28 times>, "(SELECT \n", ' ' <repeats 32 times>, "site_index,\n", ' ' <repeats 28 times>..., packet_length=packet_length@entry=5213) at /usr/src/debug/mariadb-5.5.60/sql/sql_parse.cc:1066
#16 0x00007ff16309b535 in do_command (thd=0x7ff166803c80) at /usr/src/debug/mariadb-5.5.60/sql/sql_parse.cc:793
#17 0x00007ff16316e1b3 in do_handle_one_connection (thd_arg=thd_arg@entry=0x7ff166803c80) at /usr/src/debug/mariadb-5.5.60/sql/sql_connect.cc:1268
#18 0x00007ff16316e2b0 in handle_one_connection (arg=0x7ff166803c80) at /usr/src/debug/mariadb-5.5.60/sql/sql_connect.cc:1184
#19 0x00007ff1628d4e25 in start_thread (arg=0x7ff162c11700) at pthread_create.c:308
#20 0x00007ff1610d234d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113

Full backtrace:

#0  0x00007ff1628d99b1 in __pthread_kill (threadid=<optimized out>, signo=signo@entry=11) at ../nptl/sysdeps/unix/sysv/linux/pthread_kill.c:61
        __arg2 = 28355
        _a3 = 11
        _a1 = 27637
        resultvar = <optimized out>
        __arg3 = 11
        __arg1 = 27637
        _a2 = 28355
        pd = <optimized out>
        tid = 28355
        val = <optimized out>
#1  0x00007ff1636b3d43 in my_write_core (sig=11) at /usr/src/debug/mariadb-5.5.60/mysys/stacktrace.c:457
No locals.
#2  0x00007ff1631ff4dd in handle_fatal_signal (sig=11) at /usr/src/debug/mariadb-5.5.60/sql/signal_handler.cc:262
        curr_time = 1526293938
        tm = {tm_sec = 18, tm_min = 32, tm_hour = 10, tm_mday = 14, tm_mon = 4, tm_year = 118, tm_wday = 1, tm_yday = 133, tm_isdst = 0, tm_gmtoff = 0, tm_zone = 0x7ff165587100 "UTC"}
#3  <signal handler called>
No locals.
#4  Item_field::Item_field (this=0x7ff0f009c468, f=0x0) at /usr/src/debug/mariadb-5.5.60/sql/item.cc:2331
No locals.
#5  0x00007ff163294cd5 in Item_subselect::get_tmp_table_item (this=0x7ff0f000fbd8, thd_arg=<optimized out>) at /usr/src/debug/mariadb-5.5.60/sql/item_subselect.cc:873
No locals.
#6  0x00007ff16321a31f in Item_ref::get_tmp_table_item (this=this@entry=0x7ff0f00639d8, thd=<optimized out>) at /usr/src/debug/mariadb-5.5.60/sql/item.cc:7588
        item = <optimized out>
#7  0x00007ff16322a91d in Item_direct_view_ref::get_tmp_table_item (this=0x7ff0f00639d8, thd=<optimized out>) at /usr/src/debug/mariadb-5.5.60/sql/item.h:3360
        item = 0x7ff0f009c468
#8  0x00007ff1630ec8e4 in change_refs_to_tmp_fields (all_fields=..., elements=11, res_all_fields=..., res_selected_fields=..., ref_pointer_array=0x7ff0f0064548, thd=0x7ff166803c80)
    at /usr/src/debug/mariadb-5.5.60/sql/sql_select.cc:21827
        new_item = <optimized out>
        i = 5
        border = 0
        itr = <optimized out>
        it = {<base_list_iterator> = {list = <optimized out>, el = 0x7ff0f0063b50, prev = <optimized out>, current = <optimized out>}, <No data fields>}
#9  JOIN::exec (this=this@entry=0x7ff0f0057a88) at /usr/src/debug/mariadb-5.5.60/sql/sql_select.cc:2500
        save_proc = <optimized out>
        columns_list = <optimized out>
        __FUNCTION__ = "exec"
        __PRETTY_FUNCTION__ = "void JOIN::exec()"
        curr_join = 0x7ff0f0057a88
        tmp_error = <optimized out>
        _db_stack_frame_ = {func = 0x7ff163713ab0 "mysql_select", file = 0x7ff163715778 "/builddir/build/BUILD/mariadb-5.5.60/sql/sql_select.cc", level = 2147483655, prev = 0x7ff162c0ed60}
        curr_all_fields = 0x7ff0f0057e10
        curr_fields_list = <optimized out>
        curr_tmp_table = 0x7ff0f0096ef8
#10 0x00007ff1630e795f in mysql_select (thd=thd@entry=0x7ff166803c80, rref_pointer_array=rref_pointer_array@entry=0x7ff1668079a8, tables=0x7ff0f001b388, wild_num=1, fields=..., conds=0x0, og_num=2, 
    order=0x7ff0f0025d58, group=0x0, having=0x0, proc_param=0x0, select_options=select_options@entry=2147748608, result=result@entry=0x7ff0f0035638, unit=unit@entry=0x7ff166806fa8, 
    select_lex=select_lex@entry=0x7ff1668076a8) at /usr/src/debug/mariadb-5.5.60/sql/sql_select.cc:3118
        err = false
        free_join = true
        join = 0x7ff0f0057a88
        __FUNCTION__ = "mysql_select"
        _db_stack_frame_ = {func = 0x7ff163713abd "handle_select", file = 0x7ff163715778 "/builddir/build/BUILD/mariadb-5.5.60/sql/sql_select.cc", level = 2147483654, prev = 0x7ff162c0ee20}
#11 0x00007ff1630e7bcc in handle_select (thd=thd@entry=0x7ff166803c80, lex=lex@entry=0x7ff166806ef8, result=result@entry=0x7ff0f0035638, setup_tables_done_option=setup_tables_done_option@entry=0)
    at /usr/src/debug/mariadb-5.5.60/sql/sql_select.cc:323
        unit = 0x7ff166806fa8
---Type <return> to continue, or q <return> to quit---
        res = <optimized out>
        select_lex = 0x7ff1668076a8
        _db_stack_frame_ = {func = 0x7ff16370cb71 "mysql_execute_command", file = 0x7ff16370d148 "/builddir/build/BUILD/mariadb-5.5.60/sql/sql_parse.cc", level = 2147483653, prev = 0x7ff162c0f3e0}
#12 0x00007ff163088724 in execute_sqlcom_select (thd=thd@entry=0x7ff166803c80, all_tables=<optimized out>) at /usr/src/debug/mariadb-5.5.60/sql/sql_parse.cc:4678
        lex = 0x7ff166806ef8
        result = 0x7ff0f0035638
        res = <optimized out>
#13 0x00007ff16309009a in mysql_execute_command (thd=thd@entry=0x7ff166803c80) at /usr/src/debug/mariadb-5.5.60/sql/sql_parse.cc:2224
        privileges_requested = <optimized out>
        res = 0
        lex = 0x7ff166806ef8
        _db_stack_frame_ = {func = 0x7ff16370ce2e "mysql_parse", file = 0x7ff16370d148 "/builddir/build/BUILD/mariadb-5.5.60/sql/sql_parse.cc", level = 2147483652, prev = 0x7ff162c102e0}
        __PRETTY_FUNCTION__ = "int mysql_execute_command(THD*)"
        up_result = 0
        __FUNCTION__ = "mysql_execute_command"
        select_lex = 0x7ff1668076a8
        first_table = 0x7ff0f001b388
        all_tables = 0x7ff0f001b388
        unit = 0x7ff166806fa8
        have_table_map_for_update = false
#14 0x00007ff163098106 in mysql_parse (thd=thd@entry=0x7ff166803c80, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x7ff162c10500)
    at /usr/src/debug/mariadb-5.5.60/sql/sql_parse.cc:5923
        found_semicolon = <optimized out>
        lex = 0x7ff166806ef8
        err = <optimized out>
        error = <optimized out>
        _db_stack_frame_ = {func = 0x7ff16370cea3 "dispatch_command", file = 0x7ff16370d148 "/builddir/build/BUILD/mariadb-5.5.60/sql/sql_parse.cc", level = 2147483651, prev = 0x7ff162c10490}
        __PRETTY_FUNCTION__ = "void mysql_parse(THD*, char*, uint, Parser_state*)"
        __FUNCTION__ = "mysql_parse"
#15 0x00007ff1630997b3 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x7ff166803c80, 
    packet=packet@entry=0x7ff166808761 ' ' <repeats 24 times>, "SELECT \n", ' ' <repeats 28 times>, "*\n", ' ' <repeats 24 times>, "FROM\n", ' ' <repeats 28 times>, "(SELECT \n", ' ' <repeats 32 times>, "site_index,\n", ' ' <repeats 28 times>..., packet_length=packet_length@entry=5213) at /usr/src/debug/mariadb-5.5.60/sql/sql_parse.cc:1066
        packet_end = 0x7ff0f00095f4 ""
        parser_state = {m_lip = {m_thd = 0x7ff166803c80, yylineno = 83, yytoklen = 8, yylval = 0x7ff162c0f230, lookahead_token = -1, lookahead_yylval = 0x0, m_ptr = 0x7ff0f00095f5 "\v", 
            m_tok_start = 0x7ff0f00095f5 "\v", m_tok_end = 0x7ff0f00095f5 "\v", m_end_of_query = 0x7ff0f00095f4 "", m_tok_start_prev = 0x7ff0f00095f4 "", 
            m_buf = 0x7ff0f00081c8 "SELECT \n", ' ' <repeats 28 times>, "*\n", ' ' <repeats 24 times>, "FROM\n", ' ' <repeats 28 times>, "(SELECT \n", ' ' <repeats 32 times>, "site_index,\n", ' ' <repeats 36 times>, "turbine_id AS wt"..., m_buf_length = 5164, m_echo = true, m_echo_saved = 127, 
            m_cpp_buf = 0x7ff0f0009688 "SELECT \n", ' ' <repeats 28 times>, "*\n", ' ' <repeats 24 times>, "FROM\n", ' ' <repeats 28 times>, "(SELECT \n", ' ' <repeats 32 times>, "site_index,\n", ' ' <repeats 36 times>, "turbine_id AS wt"..., m_cpp_ptr = 0x7ff0f000aab4 "", m_cpp_tok_start = 0x7ff0f000aab4 "", m_cpp_tok_start_prev = 0x7ff0f000aab4 "", m_cpp_tok_end = 0x7ff0f000aab4 "", m_body_utf8 = 0x0, 
            m_body_utf8_ptr = 0x7ff0f0003ee0 "W>x#\377\177", m_cpp_utf8_processed_ptr = 0x0, next_state = MY_LEX_END, found_semicolon = 0x0, tok_bitmap = 127 '\177', ignore_space = false, 
            stmt_prepare_mode = false, multi_statements = true, in_comment = NO_COMMENT, in_comment_saved = (PRESERVE_COMMENT | unknown: 1668050088), m_cpp_text_start = 0x7ff0f000aaa7 "severity desc", 
            m_cpp_text_end = 0x7ff0f000aaaf " desc", m_underscore_cs = 0x0}, m_yacc = {yacc_yyss = 0x0, yacc_yyvs = 0x0, m_set_signal_info = {m_item = {0x0 <repeats 12 times>}}, m_lock_type = TL_READ_DEFAULT, 
            m_mdl_type = MDL_SHARED_READ}}
        net = 0x7ff166803f90
        __PRETTY_FUNCTION__ = "bool dispatch_command(enum_server_command, THD*, char*, uint)"
        __FUNCTION__ = "dispatch_command"
        error = false
        _db_stack_frame_ = {func = 0x7ff16370cf89 "do_command", file = 0x7ff16370d148 "/builddir/build/BUILD/mariadb-5.5.60/sql/sql_parse.cc", level = 2147483650, prev = 0x7ff162c10d40}
#16 0x00007ff16309b535 in do_command (thd=0x7ff166803c80) at /usr/src/debug/mariadb-5.5.60/sql/sql_parse.cc:793
        return_value = <optimized out>
        packet = 0x7ff166808760 "\003", ' ' <repeats 24 times>, "SELECT \n", ' ' <repeats 28 times>, "*\n", ' ' <repeats 24 times>, "FROM\n", ' ' <repeats 28 times>, "(SELECT \n", ' ' <repeats 32 times>, "site_index,\n", ' ' <repeats 27 times>...
        packet_length = 5214
        net = 0x7ff166803f90
        command = COM_QUERY
---Type <return> to continue, or q <return> to quit---
        __PRETTY_FUNCTION__ = "bool do_command(THD*)"
        _db_stack_frame_ = {func = 0x7ff163838687 "?func", file = 0x7ff16383868d "?file", level = 2147483649, prev = 0x0}
#17 0x00007ff16316e1b3 in do_handle_one_connection (thd_arg=thd_arg@entry=0x7ff166803c80) at /usr/src/debug/mariadb-5.5.60/sql/sql_connect.cc:1268
        create_user = true
        thd = 0x7ff166803c80
#18 0x00007ff16316e2b0 in handle_one_connection (arg=0x7ff166803c80) at /usr/src/debug/mariadb-5.5.60/sql/sql_connect.cc:1184
        thd = 0x7ff166803c80
#19 0x00007ff1628d4e25 in start_thread (arg=0x7ff162c11700) at pthread_create.c:308
        __res = <optimized out>
        pd = 0x7ff162c11700
        now = <optimized out>
        unwind_buf = {cancel_jmp_buf = {{jmp_buf = {140674720667392, -1563738747668248512, 0, 140674720668096, 140674720667392, 36, 1562395469327910976, 1562396120022403136}, mask_was_saved = 0}}, priv = {
            pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
        not_first_call = <optimized out>
        pagesize_m1 = <optimized out>
        sp = <optimized out>
        freesize = <optimized out>
#20 0x00007ff1610d234d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113

More info in attachements.



 Comments   
Comment by Michal Schorm [ 2018-05-17 ]

The root cause seems to be NULL or undefined variable.

In frame #4, in sql/item.cc:2331 the variable 'f' is
(gdb) p f
$1 = (Field *) 0x0

In frame #5, in sql/item_subselect.cc:873, the variable 'result_field' is
(gdb) p result_field
$2 = (Field *) 0x0

In frame #6, in sql/item.cc:7588, the code is

7585	Item *Item_ref::get_tmp_table_item(THD *thd)
7586	{
7587	  if (!result_field)
7588	    return (*ref)->get_tmp_table_item(thd);
7589	
7590	  Item_field *item= new Item_field(result_field);

and the variable 'result_field' is
(gdb) p result_field
$3 = (Field *) 0x0

Comment by Alice Sherepa [ 2018-05-30 ]

It looks like it is the same problem, as MDEV-8525.
To reproduce it, please provide output of

SHOW CREATE TABLE syslog_events;
SHOW CREATE TABLE rest_measurement_registry;
SHOW CREATE TABLE site_configuration;
SHOW CREATE TABLE turbine_information;
SHOW CREATE TABLE alarm_events;

(here or on ftp://ftp.askmonty.org/private/))

Comment by Michal Schorm [ 2018-06-07 ]

Here, I provide the 5 results from the customer, you asked for:

Comment by Alice Sherepa [ 2018-06-07 ]

Reproducible with Myisam, not Innodb, on MariaDB 5.5

CREATE TABLE t2 (ser1 char(20)  NOT NULL, ids1 int NOT NULL, nm1 char(32)  NOT NULL);
INSERT INTO t2 VALUES ('char1',1,'char2'),('char2',2,'char2');
 
CREATE TABLE t3 (id2 int );
INSERT INTO t3 VALUES (1),(2);
 
CREATE TABLE t4 (serial varchar(32)  NOT NULL);
CREATE TABLE t5 (nm1 varchar(255), ls1 varchar(64), state enum('Active','Inactive','Event'));
 
SELECT * FROM
(SELECT nm1,
(SELECT GROUP_CONCAT(DISTINCT t5.nm1) FROM t5 WHERE t5.ls1 = ser1 AND STATE = 'Active') AS types,
(SELECT now() FROM t4 WHERE t4.serial = ser1) AS m1
   FROM t3 JOIN t2 ON ids1 = id2) AS t1
ORDER BY m1 ;

 75b4eb5cc969a1f5
Thread 1 (Thread 0x7f73848e3700 (LWP 18199)):
#0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=11) at ../sysdeps/unix/sysv/linux/pthread_kill.c:62
#1  0x00000000009e30ba in my_write_core (sig=sig@entry=11) at /home/alice/git/5.5/mysys/stacktrace.c:457
#2  0x000000000069d2fa in handle_fatal_signal (sig=11) at /home/alice/git/5.5/sql/signal_handler.cc:262
#3  <signal handler called>
#4  Item_field::Item_field (this=0x7f737dd49bd8, f=0x0) at /home/alice/git/5.5/sql/item.cc:2336
#5  0x000000000070baa8 in Item_subselect::get_tmp_table_item (this=0x7f737dd653f8, thd_arg=0x7f7381390000) at /home/alice/git/5.5/sql/item_subselect.cc:873
#6  0x00000000006bdb19 in Item_direct_view_ref::get_tmp_table_item (this=0x7f737dcf7380, thd=<optimized out>) at /home/alice/git/5.5/sql/item.h:3361
#7  0x00000000005ce1ba in change_refs_to_tmp_fields (all_fields=..., elements=3, res_all_fields=..., res_selected_fields=..., ref_pointer_array=<optimized out>, thd=<optimized out>) at /home/alice/git/5.5/sql/sql_select.cc:21836
#8  JOIN::exec (this=this@entry=0x7f737dcf5258) at /home/alice/git/5.5/sql/sql_select.cc:2509
#9  0x00000000005c89d5 in mysql_select (thd=thd@entry=0x7f7381390000, rref_pointer_array=rref_pointer_array@entry=0x7f7381393b08, tables=0x7f737dcf4c88, wild_num=1, fields=..., conds=<optimized out>, og_num=1, order=0x7f737dcf3ec0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x7f737dcf3fb8, unit=0x7f7381393188, select_lex=0x7f7381393868) at /home/alice/git/5.5/sql/sql_select.cc:3127
#10 0x00000000005c9362 in handle_select (thd=thd@entry=0x7f7381390000, lex=lex@entry=0x7f73813930d8, result=result@entry=0x7f737dcf3fb8, setup_tables_done_option=setup_tables_done_option@entry=0) at /home/alice/git/5.5/sql/sql_select.cc:323
#11 0x000000000057e23a in execute_sqlcom_select (thd=thd@entry=0x7f7381390000, all_tables=0x7f737dcf4c88) at /home/alice/git/5.5/sql/sql_parse.cc:4678
#12 0x00000000005895e5 in mysql_execute_command (thd=thd@entry=0x7f7381390000) at /home/alice/git/5.5/sql/sql_parse.cc:2224
#13 0x000000000058b369 in mysql_parse (thd=0x7f7381390000, rawbuf=<optimized out>, length=225, parser_state=0x7f73848e2660) at /home/alice/git/5.5/sql/sql_parse.cc:5923
#14 0x000000000058c9c7 in dispatch_command (command=<optimized out>, thd=0x7f7381390000, packet=<optimized out>, packet_length=<optimized out>) at /home/alice/git/5.5/sql/sql_parse.cc:1066
#15 0x000000000058d304 in do_command (thd=<optimized out>) at /home/alice/git/5.5/sql/sql_parse.cc:793
#16 0x000000000062ea73 in do_handle_one_connection (thd_arg=thd_arg@entry=0x7f7381390000) at /home/alice/git/5.5/sql/sql_connect.cc:1268
#17 0x000000000062ead2 in handle_one_connection (arg=arg@entry=0x7f7381390000) at /home/alice/git/5.5/sql/sql_connect.cc:1184
#18 0x00000000007c8e07 in pfs_spawn_thread (arg=0x7f7382441d60) at /home/alice/git/5.5/storage/perfschema/pfs.cc:1015
#19 0x00007f7383c956ba in start_thread (arg=0x7f73848e3700) at pthread_create.c:333
#20 0x00007f738313c41d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Comment by Michal Schorm [ 2018-06-15 ]

Hello,
is there any update regarding this issue?

Comment by Sergei Golubchik [ 2018-06-16 ]

No. There generally won't be any update until closer to the 5.5.61 release. Normally, if the schedule won't change, you can expect it to be fixed somewhere after July 9th, well in time to get into 5.5.61.

Comment by Oleksandr Byelkin [ 2018-10-12 ]

simplification of the test (get read of one more subquery)

CREATE TABLE t2 (ser1 char(20)  NOT NULL, ids1 int NOT NULL, nm1 char(32)  NOT NULL);
INSERT INTO t2 VALUES ('char1',1,'char2'),('char2',2,'char2');
 
CREATE TABLE t3 (id2 int );
INSERT INTO t3 VALUES (1),(2);
 
CREATE TABLE t5 (nm1 varchar(255), ls1 varchar(64), state enum('Active','Inactive','Event'));
 
SELECT * FROM
(SELECT nm1,
(SELECT max(t5.nm1) FROM t5 WHERE t5.ls1 = ser1 AND STATE = 'Active') AS types
FROM t3 JOIN t2 ON ids1 = id2) AS t1
ORDER BY nm1 ;
 
drop table t2,t3,t5;

Comment by Oleksandr Byelkin [ 2018-10-12 ]

There was call for creating tmp table field for the subquery, but only as part of creating temporary table for the derived. The question is why it was not called when the derived table was merged and temporary table for aggregation was created (now we have problem when are trying to switch to using that temporary table table).

Comment by Oleksandr Byelkin [ 2018-10-12 ]

Problem happens because Item_ref marked as a constant but subquery on which it pointer is not:

(gdb) p this->const_item()
$1 = true
(gdb) p (*ref)->const_item()
$2 = false
(gdb) 

Comment by Oleksandr Byelkin [ 2018-10-12 ]

Subselects used_tables() and const_item() is out of sync.

Comment by Oleksandr Byelkin [ 2018-10-12 ]

revision-id: 8009d85cc2e9245f6e8be06397914433e4b20007 (mariadb-5.5.61-30-g8009d85cc2e)
parent(s): acf8fc1ff8a7b2d49e25279670b04b8eb096ce0c
author: Oleksandr Byelkin
committer: Oleksandr Byelkin
timestamp: 2018-10-12 20:47:22 +0200
message:

MDEV-16207: Sig 11 on RHEL7 on Azure

The problem was that Item_subselect::const_item was not checked correctly and can differ from used_tables result.
Which lead to the situation when Item_direct_view_ref pointing on subselect was constant but the subquery return
FALSE on const_item() request (which was an error).

Now both methods report the same.

Comment by Oleksandr Byelkin [ 2018-10-15 ]

Above fix do not help because it still not fully sync (problem with upper tables become constant) and also the way we detect upper tables constantness is not correct IMHO.

Comment by Oleksandr Byelkin [ 2018-10-16 ]

It was not detection of constant upper table but actually constant tables of subquery as item environment so it is good (the name is bad).
still hunting difference in const_item and used_tables difference mening.

Comment by Oleksandr Byelkin [ 2018-10-24 ]

Current status is so:
st_select_lex::optimize_unflattened_subqueries was try to make subquery cacheable only by changing uncacheable flags in SELECT_LEX and SELECT_LEX_UNIT
left problem that there is subquery engines which always report unscacheable and do not read above flags (should be fixed)

Comment by Oleksandr Byelkin [ 2019-08-30 ]

yes, it is 5.5 only, so taking into complexity of fix, it is better to skipp it

Generated at Thu Feb 08 08:27:10 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.