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

MariaDB hangs on query with many logical condition

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 5.3.12, 10.0.21, 10.1, 10.0, 5.5
    • Fix Version/s: 10.0.22, 10.1.8, 5.5.46
    • Component/s: Optimizer
    • Labels:
      None
    • Environment:
      10.0.21-MariaDB, Centos6
    • Sprint:
      10.1.8-3

      Description

      MariaDB process hangs with 100% CPU usage, while executing simple query with many logical conditions. Same query on MySQL 5.6.23 tooks only fraction of second to complete.

      To reproduce problem restore table from "testtable.sql" file and execute test.sql query.

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            elenst Elena Stepanova added a comment -

            Thanks for the report and the test case.

            Stack trace from running 5.5 e40bc659335f7f8b69427ed2d215c34c045a5ed7
            #0  Item::call_bool_func_processor (this=0x7f3c28937bb0, org_item=0x7f3c1c3b1e30 "\350ǚ(<\177") at 5.5/sql/item.h:1242
            #1  0x000000000059f09a in Item::walk (this=0x7f3c28937bb0, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, arg=0x7f3c1c3b1e30 "\350ǚ(<\177") at 5.5/sql/item.h:1162
            #2  0x0000000000844082 in Item_func::walk (this=0x7f3c28937cb8, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b1e30 "\350ǚ(<\177") at 5.5/sql/item_func.cc:300
            #3  0x0000000000826dd3 in Item_cond::walk (this=0x7f3c28937f38, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, arg=0x7f3c1c3b1e30 "\350ǚ(<\177") at 5.5/sql/item_cmpfunc.cc:4452
            #4  0x0000000000844082 in Item_func::walk (this=0x7f3c289ac700, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b1e30 "\350ǚ(<\177") at 5.5/sql/item_func.cc:300
            #5  0x0000000000844082 in Item_func::walk (this=0x7f3c289ac7e8, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b1e30 "\350ǚ(<\177") at 5.5/sql/item_func.cc:300
            #6  0x0000000000611457 in Item_func::no_rows_in_result (this=0x7f3c289ac7e8) at 5.5/sql/item_func.h:383
            #7  0x000000000061104d in Item::call_bool_func_processor (this=0x7f3c289ac7e8, org_item=0x7f3c1c3b1f60 "\340Ԛ(<\177") at 5.5/sql/item.h:1242
            #8  0x00000000008440e6 in Item_func::walk (this=0x7f3c289ac7e8, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b1f60 "\340Ԛ(<\177") at 5.5/sql/item_func.cc:304
            #9  0x0000000000844082 in Item_func::walk (this=0x7f3c289ad4e0, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b1f60 "\340Ԛ(<\177") at 5.5/sql/item_func.cc:300
            #10 0x0000000000611457 in Item_func::no_rows_in_result (this=0x7f3c289ad4e0) at 5.5/sql/item_func.h:383
            #11 0x000000000061104d in Item::call_bool_func_processor (this=0x7f3c289ad4e0, org_item=0x7f3c1c3b2090 "P\362\232(<\177") at 5.5/sql/item.h:1242
            #12 0x00000000008440e6 in Item_func::walk (this=0x7f3c289ad4e0, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b2090 "P\362\232(<\177") at 5.5/sql/item_func.cc:304
            #13 0x0000000000844082 in Item_func::walk (this=0x7f3c289af250, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b2090 "P\362\232(<\177") at 5.5/sql/item_func.cc:300
            #14 0x0000000000611457 in Item_func::no_rows_in_result (this=0x7f3c289af250) at 5.5/sql/item_func.h:383
            #15 0x000000000061104d in Item::call_bool_func_processor (this=0x7f3c289af250, org_item=0x7f3c1c3b21c0 "(\377\232(<\177") at 5.5/sql/item.h:1242
            #16 0x00000000008440e6 in Item_func::walk (this=0x7f3c289af250, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b21c0 "(\377\232(<\177") at 5.5/sql/item_func.cc:304
            #17 0x0000000000844082 in Item_func::walk (this=0x7f3c289aff28, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b21c0 "(\377\232(<\177") at 5.5/sql/item_func.cc:300
            #18 0x0000000000611457 in Item_func::no_rows_in_result (this=0x7f3c289aff28) at 5.5/sql/item_func.h:383
            #19 0x000000000061104d in Item::call_bool_func_processor (this=0x7f3c289aff28, org_item=0x7f3c1c3b2340 "p\251\253(<\177") at 5.5/sql/item.h:1242
            #20 0x00000000008440e6 in Item_func::walk (this=0x7f3c289aff28, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b2340 "p\251\253(<\177") at 5.5/sql/item_func.cc:304
            #21 0x0000000000844082 in Item_func::walk (this=0x7f3c289b0c20, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b2340 "p\251\253(<\177") at 5.5/sql/item_func.cc:300
            #22 0x0000000000844082 in Item_func::walk (this=0x7f3c28aba970, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b2340 "p\251\253(<\177") at 5.5/sql/item_func.cc:300
            #23 0x0000000000611457 in Item_func::no_rows_in_result (this=0x7f3c28aba970) at 5.5/sql/item_func.h:383
            #24 0x000000000061104d in Item::call_bool_func_processor (this=0x7f3c28aba970, org_item=0x7f3c1c3b2470 "h\266\253(<\177") at 5.5/sql/item.h:1242
            #25 0x00000000008440e6 in Item_func::walk (this=0x7f3c28aba970, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b2470 "h\266\253(<\177") at 5.5/sql/item_func.cc:304
            #26 0x0000000000844082 in Item_func::walk (this=0x7f3c28abb668, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b2470 "h\266\253(<\177") at 5.5/sql/item_func.cc:300
            #27 0x0000000000611457 in Item_func::no_rows_in_result (this=0x7f3c28abb668) at 5.5/sql/item_func.h:383
            #28 0x000000000061104d in Item::call_bool_func_processor (this=0x7f3c28abb668, org_item=0x7f3c1c3b25f0 "XЫ(<\177") at 5.5/sql/item.h:1242
            #29 0x00000000008440e6 in Item_func::walk (this=0x7f3c28abb668, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b25f0 "XЫ(<\177") at 5.5/sql/item_func.cc:304
            #30 0x0000000000844082 in Item_func::walk (this=0x7f3c28abc360, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b25f0 "XЫ(<\177") at 5.5/sql/item_func.cc:300
            #31 0x0000000000844082 in Item_func::walk (this=0x7f3c28abd058, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b25f0 "XЫ(<\177") at 5.5/sql/item_func.cc:300
            #32 0x0000000000611457 in Item_func::no_rows_in_result (this=0x7f3c28abd058) at 5.5/sql/item_func.h:383
            #33 0x000000000061104d in Item::call_bool_func_processor (this=0x7f3c28abd058, org_item=0x7f3c1c3b2720 "Pݫ(<\177") at 5.5/sql/item.h:1242
            #34 0x00000000008440e6 in Item_func::walk (this=0x7f3c28abd058, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b2720 "Pݫ(<\177") at 5.5/sql/item_func.cc:304
            #35 0x0000000000844082 in Item_func::walk (this=0x7f3c28abdd50, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b2720 "Pݫ(<\177") at 5.5/sql/item_func.cc:300
            #36 0x0000000000611457 in Item_func::no_rows_in_result (this=0x7f3c28abdd50) at 5.5/sql/item_func.h:383
            #37 0x000000000061104d in Item::call_bool_func_processor (this=0x7f3c28abdd50, org_item=0x7f3c1c3b28a0 "\300\a\254(<\177") at 5.5/sql/item.h:1242
            #38 0x00000000008440e6 in Item_func::walk (this=0x7f3c28abdd50, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b28a0 "\300\a\254(<\177") at 5.5/sql/item_func.cc:304
            #39 0x0000000000844082 in Item_func::walk (this=0x7f3c28abfac8, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b28a0 "\300\a\254(<\177") at 5.5/sql/item_func.cc:300
            #40 0x0000000000844082 in Item_func::walk (this=0x7f3c28ac07c0, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b28a0 "\300\a\254(<\177") at 5.5/sql/item_func.cc:300
            #41 0x0000000000611457 in Item_func::no_rows_in_result (this=0x7f3c28ac07c0) at 5.5/sql/item_func.h:383
            #42 0x000000000061104d in Item::call_bool_func_processor (this=0x7f3c28ac07c0, org_item=0x7f3c1c3b29d0 "\270\024\254(<\177") at 5.5/sql/item.h:1242
            #43 0x00000000008440e6 in Item_func::walk (this=0x7f3c28ac07c0, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b29d0 "\270\024\254(<\177") at 5.5/sql/item_func.cc:304
            #44 0x0000000000844082 in Item_func::walk (this=0x7f3c28ac14b8, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b29d0 "\270\024\254(<\177") at 5.5/sql/item_func.cc:300
            #45 0x0000000000611457 in Item_func::no_rows_in_result (this=0x7f3c28ac14b8) at 5.5/sql/item_func.h:383
            #46 0x000000000061104d in Item::call_bool_func_processor (this=0x7f3c28ac14b8, org_item=0x7f3c1c3b2b50 "\250.\254(<\177") at 5.5/sql/item.h:1242
            #47 0x00000000008440e6 in Item_func::walk (this=0x7f3c28ac14b8, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b2b50 "\250.\254(<\177") at 5.5/sql/item_func.cc:304
            #48 0x0000000000844082 in Item_func::walk (this=0x7f3c28ac21b0, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b2b50 "\250.\254(<\177") at 5.5/sql/item_func.cc:300
            #49 0x0000000000844082 in Item_func::walk (this=0x7f3c28ac2ea8, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b2b50 "\250.\254(<\177") at 5.5/sql/item_func.cc:300
            #50 0x0000000000611457 in Item_func::no_rows_in_result (this=0x7f3c28ac2ea8) at 5.5/sql/item_func.h:383
            #51 0x000000000061104d in Item::call_bool_func_processor (this=0x7f3c28ac2ea8, org_item=0x7f3c1c3b2c80 " ,z(<\177") at 5.5/sql/item.h:1242
            #52 0x00000000008440e6 in Item_func::walk (this=0x7f3c28ac2ea8, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b2c80 " ,z(<\177") at 5.5/sql/item_func.cc:304
            #53 0x0000000000844082 in Item_func::walk (this=0x7f3c287a2c20, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b2c80 " ,z(<\177") at 5.5/sql/item_func.cc:300
            #54 0x0000000000611457 in Item_func::no_rows_in_result (this=0x7f3c287a2c20) at 5.5/sql/item_func.h:383
            #55 0x000000000061104d in Item::call_bool_func_processor (this=0x7f3c287a2c20, org_item=0x7f3c1c3b2db0 "\030\071z(<\177") at 5.5/sql/item.h:1242
            #56 0x00000000008440e6 in Item_func::walk (this=0x7f3c287a2c20, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b2db0 "\030\071z(<\177") at 5.5/sql/item_func.cc:304
            #57 0x0000000000844082 in Item_func::walk (this=0x7f3c287a3918, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b2db0 "\030\071z(<\177") at 5.5/sql/item_func.cc:300
            #58 0x0000000000611457 in Item_func::no_rows_in_result (this=0x7f3c287a3918) at 5.5/sql/item_func.h:383
            #59 0x000000000061104d in Item::call_bool_func_processor (this=0x7f3c287a3918, org_item=0x7f3c1c3b2f80 "xpz(<\177") at 5.5/sql/item.h:1242
            #60 0x00000000008440e6 in Item_func::walk (this=0x7f3c287a3918, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b2f80 "xpz(<\177") at 5.5/sql/item_func.cc:304
            #61 0x0000000000844082 in Item_func::walk (this=0x7f3c287a4610, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b2f80 "xpz(<\177") at 5.5/sql/item_func.cc:300
            #62 0x0000000000844082 in Item_func::walk (this=0x7f3c287a5308, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b2f80 "xpz(<\177") at 5.5/sql/item_func.cc:300
            #63 0x0000000000844082 in Item_func::walk (this=0x7f3c287a7078, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b2f80 "xpz(<\177") at 5.5/sql/item_func.cc:300
            #64 0x0000000000611457 in Item_func::no_rows_in_result (this=0x7f3c287a7078) at 5.5/sql/item_func.h:383
            #65 0x000000000061104d in Item::call_bool_func_processor (this=0x7f3c287a7078, org_item=0x7f3c1c3b3410 "") at 5.5/sql/item.h:1242
            #66 0x00000000008440e6 in Item_func::walk (this=0x7f3c287a7078, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b3410 "") at 5.5/sql/item_func.cc:304
            #67 0x0000000000844082 in Item_func::walk (this=0x7f3c287a7d70, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b3410 "") at 5.5/sql/item_func.cc:300
            #68 0x0000000000844082 in Item_func::walk (this=0x7f3c287a8a68, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b3410 "") at 5.5/sql/item_func.cc:300
            #69 0x0000000000844082 in Item_func::walk (this=0x7f3c287a9760, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b3410 "") at 5.5/sql/item_func.cc:300
            #70 0x0000000000844082 in Item_func::walk (this=0x7f3c287aa458, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b3410 "") at 5.5/sql/item_func.cc:300
            #71 0x0000000000844082 in Item_func::walk (this=0x7f3c287c31e0, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b3410 "") at 5.5/sql/item_func.cc:300
            #72 0x0000000000844082 in Item_func::walk (this=0x7f3c287c3ec8, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b3410 "") at 5.5/sql/item_func.cc:300
            #73 0x0000000000844082 in Item_func::walk (this=0x7f3c287c4bc0, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b3410 "") at 5.5/sql/item_func.cc:300
            #74 0x0000000000844082 in Item_func::walk (this=0x7f3c288e38e8, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b3410 "") at 5.5/sql/item_func.cc:300
            #75 0x000000000088e6cc in Item_sum::walk (this=0x7f3c288e39b8, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b3410 "") at 5.5/sql/item_sum.cc:517
            #76 0x00000000005e7680 in Item_ref::walk (this=0x7f3c2892dd28, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, arg=0x7f3c1c3b3410 "") at 5.5/sql/item.h:3039
            #77 0x0000000000844082 in Item_func::walk (this=0x7f3c288e3d48, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b3410 "") at 5.5/sql/item_func.cc:300
            #78 0x0000000000844082 in Item_func::walk (this=0x7f3c288e4000, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b3410 "") at 5.5/sql/item_func.cc:300
            #79 0x0000000000611457 in Item_func::no_rows_in_result (this=0x7f3c288e4000) at 5.5/sql/item_func.h:383
            #80 0x0000000000690dbc in end_send_group (join=0x7f3c2892d7d8, join_tab=0x7f3c28950a70, end_of_records=true) at 5.5/sql/sql_select.cc:18140
            #81 0x000000000068dcaa in sub_select (join=0x7f3c2892d7d8, join_tab=0x7f3c28950750, end_of_records=true) at 5.5/sql/sql_select.cc:16881
            #82 0x000000000068d78a in do_select (join=0x7f3c2892d7d8, fields=0x7f3c2892dba8, table=0x0, procedure=0x0) at 5.5/sql/sql_select.cc:16592
            #83 0x000000000066c0d8 in JOIN::exec (this=0x7f3c2892d7d8) at 5.5/sql/sql_select.cc:2871
            #84 0x000000000066c8e3 in mysql_select (thd=0x7f3c28786060, rref_pointer_array=0x7f3c28789ce0, tables=0x7f3c288e4128, wild_num=0, fields=..., conds=0x7f3c2892d298, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x7f3c2892d7b8, unit=0x7f3c28789390, select_lex=0x7f3c28789a70) at 5.5/sql/sql_select.cc:3092
            #85 0x00000000006632f1 in handle_select (thd=0x7f3c28786060, lex=0x7f3c287892e0, result=0x7f3c2892d7b8, setup_tables_done_option=0) at 5.5/sql/sql_select.cc:319
            #86 0x000000000063c57c in execute_sqlcom_select (thd=0x7f3c28786060, all_tables=0x7f3c288e4128) at 5.5/sql/sql_parse.cc:4689
            #87 0x000000000063575e in mysql_execute_command (thd=0x7f3c28786060) at 5.5/sql/sql_parse.cc:2234
            #88 0x000000000063f062 in mysql_parse (thd=0x7f3c28786060, rawbuf=0x7f3c2da85078 "SELECT \n\nCOUNT(*) as `N`, \n\nROUND( \n\n\t( \n\n\t\tSUM( \n\n\t\t\t( \n\n\t\t\t\t( \n\n\t\t\t\t\tIF( 57813X541X17271 IS NOT NULL AND 57813X541X17271 != '' AND 57813X541X17271 != '99', 57813X541X17271, 0 ) + \n\n\t\t\t\t\tIF( 57813X54"..., length=9363, parser_state=0x7f3c1c3b4670) at 5.5/sql/sql_parse.cc:5909
            #89 0x0000000000632ca5 in dispatch_command (command=COM_QUERY, thd=0x7f3c28786060, packet=0x7f3c289c5061 "", packet_length=9363) at 5.5/sql/sql_parse.cc:1079
            #90 0x0000000000631e31 in do_command (thd=0x7f3c28786060) at 5.5/sql/sql_parse.cc:793
            #91 0x0000000000734f49 in do_handle_one_connection (thd_arg=0x7f3c28786060) at 5.5/sql/sql_connect.cc:1269
            #92 0x0000000000734cc3 in handle_one_connection (arg=0x7f3c28786060) at 5.5/sql/sql_connect.cc:1185
            #93 0x00007f3c438e7b50 in start_thread (arg=<optimized out>) at pthread_create.c:304
            #94 0x00007f3c41b9d95d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
            
            EXPLAIN
            id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
            1	SIMPLE	testdb	ref	57813X540X1723	57813X540X1723	303	const	1	100.00	Using where
            

            Reproducible on 5.3.12, so it's not a fresh regression.

            Show
            elenst Elena Stepanova added a comment - Thanks for the report and the test case. Stack trace from running 5.5 e40bc659335f7f8b69427ed2d215c34c045a5ed7 #0 Item::call_bool_func_processor (this=0x7f3c28937bb0, org_item=0x7f3c1c3b1e30 "\350ǚ(<\177") at 5.5/sql/item.h:1242 #1 0x000000000059f09a in Item::walk (this=0x7f3c28937bb0, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, arg=0x7f3c1c3b1e30 "\350ǚ(<\177") at 5.5/sql/item.h:1162 #2 0x0000000000844082 in Item_func::walk (this=0x7f3c28937cb8, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b1e30 "\350ǚ(<\177") at 5.5/sql/item_func.cc:300 #3 0x0000000000826dd3 in Item_cond::walk (this=0x7f3c28937f38, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, arg=0x7f3c1c3b1e30 "\350ǚ(<\177") at 5.5/sql/item_cmpfunc.cc:4452 #4 0x0000000000844082 in Item_func::walk (this=0x7f3c289ac700, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b1e30 "\350ǚ(<\177") at 5.5/sql/item_func.cc:300 #5 0x0000000000844082 in Item_func::walk (this=0x7f3c289ac7e8, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b1e30 "\350ǚ(<\177") at 5.5/sql/item_func.cc:300 #6 0x0000000000611457 in Item_func::no_rows_in_result (this=0x7f3c289ac7e8) at 5.5/sql/item_func.h:383 #7 0x000000000061104d in Item::call_bool_func_processor (this=0x7f3c289ac7e8, org_item=0x7f3c1c3b1f60 "\340Ԛ(<\177") at 5.5/sql/item.h:1242 #8 0x00000000008440e6 in Item_func::walk (this=0x7f3c289ac7e8, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b1f60 "\340Ԛ(<\177") at 5.5/sql/item_func.cc:304 #9 0x0000000000844082 in Item_func::walk (this=0x7f3c289ad4e0, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b1f60 "\340Ԛ(<\177") at 5.5/sql/item_func.cc:300 #10 0x0000000000611457 in Item_func::no_rows_in_result (this=0x7f3c289ad4e0) at 5.5/sql/item_func.h:383 #11 0x000000000061104d in Item::call_bool_func_processor (this=0x7f3c289ad4e0, org_item=0x7f3c1c3b2090 "P\362\232(<\177") at 5.5/sql/item.h:1242 #12 0x00000000008440e6 in Item_func::walk (this=0x7f3c289ad4e0, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b2090 "P\362\232(<\177") at 5.5/sql/item_func.cc:304 #13 0x0000000000844082 in Item_func::walk (this=0x7f3c289af250, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b2090 "P\362\232(<\177") at 5.5/sql/item_func.cc:300 #14 0x0000000000611457 in Item_func::no_rows_in_result (this=0x7f3c289af250) at 5.5/sql/item_func.h:383 #15 0x000000000061104d in Item::call_bool_func_processor (this=0x7f3c289af250, org_item=0x7f3c1c3b21c0 "(\377\232(<\177") at 5.5/sql/item.h:1242 #16 0x00000000008440e6 in Item_func::walk (this=0x7f3c289af250, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b21c0 "(\377\232(<\177") at 5.5/sql/item_func.cc:304 #17 0x0000000000844082 in Item_func::walk (this=0x7f3c289aff28, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b21c0 "(\377\232(<\177") at 5.5/sql/item_func.cc:300 #18 0x0000000000611457 in Item_func::no_rows_in_result (this=0x7f3c289aff28) at 5.5/sql/item_func.h:383 #19 0x000000000061104d in Item::call_bool_func_processor (this=0x7f3c289aff28, org_item=0x7f3c1c3b2340 "p\251\253(<\177") at 5.5/sql/item.h:1242 #20 0x00000000008440e6 in Item_func::walk (this=0x7f3c289aff28, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b2340 "p\251\253(<\177") at 5.5/sql/item_func.cc:304 #21 0x0000000000844082 in Item_func::walk (this=0x7f3c289b0c20, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b2340 "p\251\253(<\177") at 5.5/sql/item_func.cc:300 #22 0x0000000000844082 in Item_func::walk (this=0x7f3c28aba970, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b2340 "p\251\253(<\177") at 5.5/sql/item_func.cc:300 #23 0x0000000000611457 in Item_func::no_rows_in_result (this=0x7f3c28aba970) at 5.5/sql/item_func.h:383 #24 0x000000000061104d in Item::call_bool_func_processor (this=0x7f3c28aba970, org_item=0x7f3c1c3b2470 "h\266\253(<\177") at 5.5/sql/item.h:1242 #25 0x00000000008440e6 in Item_func::walk (this=0x7f3c28aba970, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b2470 "h\266\253(<\177") at 5.5/sql/item_func.cc:304 #26 0x0000000000844082 in Item_func::walk (this=0x7f3c28abb668, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b2470 "h\266\253(<\177") at 5.5/sql/item_func.cc:300 #27 0x0000000000611457 in Item_func::no_rows_in_result (this=0x7f3c28abb668) at 5.5/sql/item_func.h:383 #28 0x000000000061104d in Item::call_bool_func_processor (this=0x7f3c28abb668, org_item=0x7f3c1c3b25f0 "XЫ(<\177") at 5.5/sql/item.h:1242 #29 0x00000000008440e6 in Item_func::walk (this=0x7f3c28abb668, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b25f0 "XЫ(<\177") at 5.5/sql/item_func.cc:304 #30 0x0000000000844082 in Item_func::walk (this=0x7f3c28abc360, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b25f0 "XЫ(<\177") at 5.5/sql/item_func.cc:300 #31 0x0000000000844082 in Item_func::walk (this=0x7f3c28abd058, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b25f0 "XЫ(<\177") at 5.5/sql/item_func.cc:300 #32 0x0000000000611457 in Item_func::no_rows_in_result (this=0x7f3c28abd058) at 5.5/sql/item_func.h:383 #33 0x000000000061104d in Item::call_bool_func_processor (this=0x7f3c28abd058, org_item=0x7f3c1c3b2720 "Pݫ(<\177") at 5.5/sql/item.h:1242 #34 0x00000000008440e6 in Item_func::walk (this=0x7f3c28abd058, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b2720 "Pݫ(<\177") at 5.5/sql/item_func.cc:304 #35 0x0000000000844082 in Item_func::walk (this=0x7f3c28abdd50, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b2720 "Pݫ(<\177") at 5.5/sql/item_func.cc:300 #36 0x0000000000611457 in Item_func::no_rows_in_result (this=0x7f3c28abdd50) at 5.5/sql/item_func.h:383 #37 0x000000000061104d in Item::call_bool_func_processor (this=0x7f3c28abdd50, org_item=0x7f3c1c3b28a0 "\300\a\254(<\177") at 5.5/sql/item.h:1242 #38 0x00000000008440e6 in Item_func::walk (this=0x7f3c28abdd50, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b28a0 "\300\a\254(<\177") at 5.5/sql/item_func.cc:304 #39 0x0000000000844082 in Item_func::walk (this=0x7f3c28abfac8, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b28a0 "\300\a\254(<\177") at 5.5/sql/item_func.cc:300 #40 0x0000000000844082 in Item_func::walk (this=0x7f3c28ac07c0, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b28a0 "\300\a\254(<\177") at 5.5/sql/item_func.cc:300 #41 0x0000000000611457 in Item_func::no_rows_in_result (this=0x7f3c28ac07c0) at 5.5/sql/item_func.h:383 #42 0x000000000061104d in Item::call_bool_func_processor (this=0x7f3c28ac07c0, org_item=0x7f3c1c3b29d0 "\270\024\254(<\177") at 5.5/sql/item.h:1242 #43 0x00000000008440e6 in Item_func::walk (this=0x7f3c28ac07c0, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b29d0 "\270\024\254(<\177") at 5.5/sql/item_func.cc:304 #44 0x0000000000844082 in Item_func::walk (this=0x7f3c28ac14b8, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b29d0 "\270\024\254(<\177") at 5.5/sql/item_func.cc:300 #45 0x0000000000611457 in Item_func::no_rows_in_result (this=0x7f3c28ac14b8) at 5.5/sql/item_func.h:383 #46 0x000000000061104d in Item::call_bool_func_processor (this=0x7f3c28ac14b8, org_item=0x7f3c1c3b2b50 "\250.\254(<\177") at 5.5/sql/item.h:1242 #47 0x00000000008440e6 in Item_func::walk (this=0x7f3c28ac14b8, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b2b50 "\250.\254(<\177") at 5.5/sql/item_func.cc:304 #48 0x0000000000844082 in Item_func::walk (this=0x7f3c28ac21b0, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b2b50 "\250.\254(<\177") at 5.5/sql/item_func.cc:300 #49 0x0000000000844082 in Item_func::walk (this=0x7f3c28ac2ea8, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b2b50 "\250.\254(<\177") at 5.5/sql/item_func.cc:300 #50 0x0000000000611457 in Item_func::no_rows_in_result (this=0x7f3c28ac2ea8) at 5.5/sql/item_func.h:383 #51 0x000000000061104d in Item::call_bool_func_processor (this=0x7f3c28ac2ea8, org_item=0x7f3c1c3b2c80 " ,z(<\177") at 5.5/sql/item.h:1242 #52 0x00000000008440e6 in Item_func::walk (this=0x7f3c28ac2ea8, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b2c80 " ,z(<\177") at 5.5/sql/item_func.cc:304 #53 0x0000000000844082 in Item_func::walk (this=0x7f3c287a2c20, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b2c80 " ,z(<\177") at 5.5/sql/item_func.cc:300 #54 0x0000000000611457 in Item_func::no_rows_in_result (this=0x7f3c287a2c20) at 5.5/sql/item_func.h:383 #55 0x000000000061104d in Item::call_bool_func_processor (this=0x7f3c287a2c20, org_item=0x7f3c1c3b2db0 "\030\071z(<\177") at 5.5/sql/item.h:1242 #56 0x00000000008440e6 in Item_func::walk (this=0x7f3c287a2c20, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b2db0 "\030\071z(<\177") at 5.5/sql/item_func.cc:304 #57 0x0000000000844082 in Item_func::walk (this=0x7f3c287a3918, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b2db0 "\030\071z(<\177") at 5.5/sql/item_func.cc:300 #58 0x0000000000611457 in Item_func::no_rows_in_result (this=0x7f3c287a3918) at 5.5/sql/item_func.h:383 #59 0x000000000061104d in Item::call_bool_func_processor (this=0x7f3c287a3918, org_item=0x7f3c1c3b2f80 "xpz(<\177") at 5.5/sql/item.h:1242 #60 0x00000000008440e6 in Item_func::walk (this=0x7f3c287a3918, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b2f80 "xpz(<\177") at 5.5/sql/item_func.cc:304 #61 0x0000000000844082 in Item_func::walk (this=0x7f3c287a4610, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b2f80 "xpz(<\177") at 5.5/sql/item_func.cc:300 #62 0x0000000000844082 in Item_func::walk (this=0x7f3c287a5308, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b2f80 "xpz(<\177") at 5.5/sql/item_func.cc:300 #63 0x0000000000844082 in Item_func::walk (this=0x7f3c287a7078, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b2f80 "xpz(<\177") at 5.5/sql/item_func.cc:300 #64 0x0000000000611457 in Item_func::no_rows_in_result (this=0x7f3c287a7078) at 5.5/sql/item_func.h:383 #65 0x000000000061104d in Item::call_bool_func_processor (this=0x7f3c287a7078, org_item=0x7f3c1c3b3410 "") at 5.5/sql/item.h:1242 #66 0x00000000008440e6 in Item_func::walk (this=0x7f3c287a7078, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b3410 "") at 5.5/sql/item_func.cc:304 #67 0x0000000000844082 in Item_func::walk (this=0x7f3c287a7d70, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b3410 "") at 5.5/sql/item_func.cc:300 #68 0x0000000000844082 in Item_func::walk (this=0x7f3c287a8a68, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b3410 "") at 5.5/sql/item_func.cc:300 #69 0x0000000000844082 in Item_func::walk (this=0x7f3c287a9760, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b3410 "") at 5.5/sql/item_func.cc:300 #70 0x0000000000844082 in Item_func::walk (this=0x7f3c287aa458, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b3410 "") at 5.5/sql/item_func.cc:300 #71 0x0000000000844082 in Item_func::walk (this=0x7f3c287c31e0, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b3410 "") at 5.5/sql/item_func.cc:300 #72 0x0000000000844082 in Item_func::walk (this=0x7f3c287c3ec8, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b3410 "") at 5.5/sql/item_func.cc:300 #73 0x0000000000844082 in Item_func::walk (this=0x7f3c287c4bc0, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b3410 "") at 5.5/sql/item_func.cc:300 #74 0x0000000000844082 in Item_func::walk (this=0x7f3c288e38e8, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b3410 "") at 5.5/sql/item_func.cc:300 #75 0x000000000088e6cc in Item_sum::walk (this=0x7f3c288e39b8, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b3410 "") at 5.5/sql/item_sum.cc:517 #76 0x00000000005e7680 in Item_ref::walk (this=0x7f3c2892dd28, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, arg=0x7f3c1c3b3410 "") at 5.5/sql/item.h:3039 #77 0x0000000000844082 in Item_func::walk (this=0x7f3c288e3d48, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b3410 "") at 5.5/sql/item_func.cc:300 #78 0x0000000000844082 in Item_func::walk (this=0x7f3c288e4000, processor=(bool (Item::*)(Item * const, uchar *)) 0x610fd0 <Item::call_bool_func_processor(unsigned char*)>, walk_subquery=false, argument=0x7f3c1c3b3410 "") at 5.5/sql/item_func.cc:300 #79 0x0000000000611457 in Item_func::no_rows_in_result (this=0x7f3c288e4000) at 5.5/sql/item_func.h:383 #80 0x0000000000690dbc in end_send_group (join=0x7f3c2892d7d8, join_tab=0x7f3c28950a70, end_of_records=true) at 5.5/sql/sql_select.cc:18140 #81 0x000000000068dcaa in sub_select (join=0x7f3c2892d7d8, join_tab=0x7f3c28950750, end_of_records=true) at 5.5/sql/sql_select.cc:16881 #82 0x000000000068d78a in do_select (join=0x7f3c2892d7d8, fields=0x7f3c2892dba8, table=0x0, procedure=0x0) at 5.5/sql/sql_select.cc:16592 #83 0x000000000066c0d8 in JOIN::exec (this=0x7f3c2892d7d8) at 5.5/sql/sql_select.cc:2871 #84 0x000000000066c8e3 in mysql_select (thd=0x7f3c28786060, rref_pointer_array=0x7f3c28789ce0, tables=0x7f3c288e4128, wild_num=0, fields=..., conds=0x7f3c2892d298, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x7f3c2892d7b8, unit=0x7f3c28789390, select_lex=0x7f3c28789a70) at 5.5/sql/sql_select.cc:3092 #85 0x00000000006632f1 in handle_select (thd=0x7f3c28786060, lex=0x7f3c287892e0, result=0x7f3c2892d7b8, setup_tables_done_option=0) at 5.5/sql/sql_select.cc:319 #86 0x000000000063c57c in execute_sqlcom_select (thd=0x7f3c28786060, all_tables=0x7f3c288e4128) at 5.5/sql/sql_parse.cc:4689 #87 0x000000000063575e in mysql_execute_command (thd=0x7f3c28786060) at 5.5/sql/sql_parse.cc:2234 #88 0x000000000063f062 in mysql_parse (thd=0x7f3c28786060, rawbuf=0x7f3c2da85078 "SELECT \n\nCOUNT(*) as `N`, \n\nROUND( \n\n\t( \n\n\t\tSUM( \n\n\t\t\t( \n\n\t\t\t\t( \n\n\t\t\t\t\tIF( 57813X541X17271 IS NOT NULL AND 57813X541X17271 != '' AND 57813X541X17271 != '99', 57813X541X17271, 0 ) + \n\n\t\t\t\t\tIF( 57813X54"..., length=9363, parser_state=0x7f3c1c3b4670) at 5.5/sql/sql_parse.cc:5909 #89 0x0000000000632ca5 in dispatch_command (command=COM_QUERY, thd=0x7f3c28786060, packet=0x7f3c289c5061 "", packet_length=9363) at 5.5/sql/sql_parse.cc:1079 #90 0x0000000000631e31 in do_command (thd=0x7f3c28786060) at 5.5/sql/sql_parse.cc:793 #91 0x0000000000734f49 in do_handle_one_connection (thd_arg=0x7f3c28786060) at 5.5/sql/sql_connect.cc:1269 #92 0x0000000000734cc3 in handle_one_connection (arg=0x7f3c28786060) at 5.5/sql/sql_connect.cc:1185 #93 0x00007f3c438e7b50 in start_thread (arg=<optimized out>) at pthread_create.c:304 #94 0x00007f3c41b9d95d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112 EXPLAIN id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE testdb ref 57813X540X1723 57813X540X1723 303 const 1 100.00 Using where Reproducible on 5.3.12, so it's not a fresh regression.
            Hide
            psergey Sergei Petrunia added a comment -

            Oleksandr Byelkin, can you take a look at this? History shows that you've added some Item_XX::no_rows_in_result functions in the past so I guess you're familiar with this...

            Show
            psergey Sergei Petrunia added a comment - Oleksandr Byelkin , can you take a look at this? History shows that you've added some Item_XX::no_rows_in_result functions in the past so I guess you're familiar with this...
            Hide
            sanja Oleksandr Byelkin added a comment - - edited
            CREATE TABLE `t1` (
              `id` int(11) NOT NULL AUTO_INCREMENT,
              `submitdate` datetime DEFAULT NULL,
              `lastpage` int(11) DEFAULT NULL,
              `startlanguage` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
              `token` varchar(36) COLLATE utf8_unicode_ci DEFAULT NULL,
              `datestamp` datetime NOT NULL,
              `startdate` datetime NOT NULL,
              `ipaddr` text COLLATE utf8_unicode_ci,
              `refurl` text COLLATE utf8_unicode_ci,
              `57813X540X1723` text COLLATE utf8_unicode_ci,
              `57813X540X1724` text COLLATE utf8_unicode_ci,
              `57813X540X1725` text COLLATE utf8_unicode_ci,
              `57813X540X1726` double DEFAULT NULL,
              `57813X540X1909` double DEFAULT NULL,
              `57813X541X17271` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
              `57813X541X17272` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
              `57813X541X17273` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
              `57813X541X17274` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
              `57813X541X17275` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
              `57813X541X17276` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
              `57813X541X17281` text COLLATE utf8_unicode_ci,
              `57813X541X17282` text COLLATE utf8_unicode_ci,
              `57813X541X17283` text COLLATE utf8_unicode_ci,
              `57813X541X17284` text COLLATE utf8_unicode_ci,
              `57813X541X17285` text COLLATE utf8_unicode_ci,
              `57813X541X17286` text COLLATE utf8_unicode_ci,
              `57813X542X18131` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
              `57813X542X18132` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
              `57813X542X18133` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
              `57813X542X18134` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
              `57813X542X18135` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
              `57813X542X18136` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
              `57813X542X18137` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
              `57813X542X18138` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
              `57813X542X18139` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
              `57813X542X18141` text COLLATE utf8_unicode_ci,
              `57813X542X18142` text COLLATE utf8_unicode_ci,
              `57813X542X18143` text COLLATE utf8_unicode_ci,
              `57813X542X18144` text COLLATE utf8_unicode_ci,
              `57813X542X18145` text COLLATE utf8_unicode_ci,
              `57813X542X18146` text COLLATE utf8_unicode_ci,
              `57813X542X18147` text COLLATE utf8_unicode_ci,
              `57813X542X18148` text COLLATE utf8_unicode_ci,
              `57813X542X18149` text COLLATE utf8_unicode_ci,
              `57813X543X18451` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
              `57813X543X18452` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
              `57813X543X18453` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
              `57813X543X18454` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
              `57813X543X18455` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
              `57813X543X18456` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
              `57813X543X18461` text COLLATE utf8_unicode_ci,
              `57813X543X18462` text COLLATE utf8_unicode_ci,
              `57813X543X18463` text COLLATE utf8_unicode_ci,
              `57813X543X18464` text COLLATE utf8_unicode_ci,
              `57813X543X18465` text COLLATE utf8_unicode_ci,
              `57813X543X18466` text COLLATE utf8_unicode_ci,
              `57813X544X18711` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
              `57813X544X18712` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
              `57813X544X18713` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
              `57813X544X18714` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
              `57813X544X18715` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
              `57813X544X18716` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
              `57813X544X18717` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
              `57813X544X18718` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
              `57813X544X18721` text COLLATE utf8_unicode_ci,
              `57813X544X18722` text COLLATE utf8_unicode_ci,
              `57813X544X18723` text COLLATE utf8_unicode_ci,
              `57813X544X18724` text COLLATE utf8_unicode_ci,
              `57813X544X18725` text COLLATE utf8_unicode_ci,
              `57813X544X18726` text COLLATE utf8_unicode_ci,
              `57813X544X18727` text COLLATE utf8_unicode_ci,
              `57813X544X18728` text COLLATE utf8_unicode_ci,
              `57813X546X1902` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
              `57813X546X1903` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
              `57813X546X1904` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
              `57813X545X1901` varchar(1) COLLATE utf8_unicode_ci DEFAULT NULL,
              PRIMARY KEY (`id`),
              KEY `lime_survey_57813_idx` (`token`),
              KEY `57813X540X1723` (`57813X540X1723`(100)),
              KEY `57813X540X1724` (`57813X540X1724`(100)),
              KEY `57813X540X1726` (`57813X540X1726`),
              KEY `57813X540X1725` (`57813X540X1725`(100)),
              KEY `57813X546X1902` (`57813X546X1902`),
              KEY `57813X546X1903` (`57813X546X1903`),
              KEY `57813X546X1904` (`57813X546X1904`)
            ) ;
            
            
            SELECT 
            
            COUNT(*) as `N`, 
            
            ROUND( 
            
            	( 
            
            		SUM( 
            
            			( 
            
            				( 
            
            					IF( 57813X541X17271 IS NOT NULL AND 57813X541X17271 != '' AND 57813X541X17271 != '99', 57813X541X17271, 0 ) + 
            
            					IF( 57813X541X17272 IS NOT NULL AND 57813X541X17272 != '' AND 57813X541X17272 != '99', 57813X541X17272, 0 ) + 
            
            					IF( 57813X541X17273 IS NOT NULL AND 57813X541X17273 != '' AND 57813X541X17273 != '99', 57813X541X17273, 0 ) + 
            
            					IF( 57813X541X17274 IS NOT NULL AND 57813X541X17274 != '' AND 57813X541X17274 != '99', 57813X541X17274, 0 ) + 
            
            					IF( 57813X541X17275 IS NOT NULL AND 57813X541X17275 != '' AND 57813X541X17275 != '99', 57813X541X17275, 0 ) +
            
            					IF( 57813X541X17276 IS NOT NULL AND 57813X541X17276 != '' AND 57813X541X17276 != '99', 57813X541X17276, 0 ) + 
            
            					IF( 57813X542X18131 IS NOT NULL AND 57813X542X18131 != '' AND 57813X542X18131 != '99', 57813X542X18131, 0 ) + 
            
            					IF( 57813X542X18132 IS NOT NULL AND 57813X542X18132 != '' AND 57813X542X18132 != '99', 57813X542X18132, 0 ) + 
            
            					IF( 57813X542X18133 IS NOT NULL AND 57813X542X18133 != '' AND 57813X542X18133 != '99', 57813X542X18133, 0 ) + 
            
            					IF( 57813X542X18134 IS NOT NULL AND 57813X542X18134 != '' AND 57813X542X18134 != '99', 57813X542X18134, 0 ) + 
            
            					IF( 57813X542X18135 IS NOT NULL AND 57813X542X18135 != '' AND 57813X542X18135 != '99', 57813X542X18135, 0 ) + 
            
            					IF( 57813X542X18136 IS NOT NULL AND 57813X542X18136 != '' AND 57813X542X18136 != '99', 57813X542X18136, 0 ) + 
            
            					IF( 57813X542X18137 IS NOT NULL AND 57813X542X18137 != '' AND 57813X542X18137 != '99', 57813X542X18137, 0 ) + 
            
            					IF( 57813X542X18138 IS NOT NULL AND 57813X542X18138 != '' AND 57813X542X18138 != '99', 57813X542X18138, 0 ) + 
            
            					IF( 57813X542X18139 IS NOT NULL AND 57813X542X18139 != '' AND 57813X542X18139 != '99', 57813X542X18139, 0 ) + 
            
            					IF( 57813X543X18451 IS NOT NULL AND 57813X543X18451 != '' AND 57813X543X18451 != '99', 57813X543X18451, 0 ) + 
            
            					IF( 57813X543X18452 IS NOT NULL AND 57813X543X18452 != '' AND 57813X543X18452 != '99', 57813X543X18452, 0 ) + 
            
            					IF( 57813X543X18453 IS NOT NULL AND 57813X543X18453 != '' AND 57813X543X18453 != '99', 57813X543X18453, 0 ) + 
            
            					IF( 57813X543X18454 IS NOT NULL AND 57813X543X18454 != '' AND 57813X543X18454 != '99', 57813X543X18454, 0 ) + 
            
            					IF( 57813X543X18455 IS NOT NULL AND 57813X543X18455 != '' AND 57813X543X18455 != '99', 57813X543X18455, 0 ) + 
            
            					IF( 57813X543X18456 IS NOT NULL AND 57813X543X18456 != '' AND 57813X543X18456 != '99', 57813X543X18456, 0 ) + 
            
            					IF( 57813X544X18711 IS NOT NULL AND 57813X544X18711 != '' AND 57813X544X18711 != '99', 57813X544X18711, 0 ) + 
            
            					IF( 57813X544X18712 IS NOT NULL AND 57813X544X18712 != '' AND 57813X544X18712 != '99', 57813X544X18712, 0 ) + 
            
            					IF( 57813X544X18713 IS NOT NULL AND 57813X544X18713 != '' AND 57813X544X18713 != '99', 57813X544X18713, 0 ) + 
            
            					IF( 57813X544X18714 IS NOT NULL AND 57813X544X18714 != '' AND 57813X544X18714 != '99', 57813X544X18714, 0 ) + 
            
            					IF( 57813X544X18715 IS NOT NULL AND 57813X544X18715 != '' AND 57813X544X18715 != '99', 57813X544X18715, 0 ) + 
            
            					IF( 57813X544X18716 IS NOT NULL AND 57813X544X18716 != '' AND 57813X544X18716 != '99', 57813X544X18716, 0 ) + 
            
            					IF( 57813X544X18717 IS NOT NULL AND 57813X544X18717 != '' AND 57813X544X18717 != '99', 57813X544X18717, 0 ) + 
            
            					IF( 57813X544X18718 IS NOT NULL AND 57813X544X18718 != '' AND 57813X544X18718 != '99', 57813X544X18718, 0 ) 
            
            				) 
            
            				/ 
            
            				(
            
            					IF( 57813X541X17271 IS NOT NULL AND 57813X541X17271 != '' AND 57813X541X17271 != '99', 1, 0 ) + 
            
            					IF( 57813X541X17272 IS NOT NULL AND 57813X541X17272 != '' AND 57813X541X17272 != '99', 1, 0 ) + 
            
            					IF( 57813X541X17273 IS NOT NULL AND 57813X541X17273 != '' AND 57813X541X17273 != '99', 1, 0 ) + 
            
            					IF( 57813X541X17274 IS NOT NULL AND 57813X541X17274 != '' AND 57813X541X17274 != '99', 1, 0 ) + 
            
            					IF( 57813X541X17275 IS NOT NULL AND 57813X541X17275 != '' AND 57813X541X17275 != '99', 1, 0 ) + 
            
            					IF( 57813X541X17276 IS NOT NULL AND 57813X541X17276 != '' AND 57813X541X17276 != '99', 1, 0 ) + 
            
            					IF( 57813X542X18131 IS NOT NULL AND 57813X542X18131 != '' AND 57813X542X18131 != '99', 1, 0 ) + 
            
            					IF( 57813X542X18132 IS NOT NULL AND 57813X542X18132 != '' AND 57813X542X18132 != '99', 1, 0 ) + 
            
            					IF( 57813X542X18133 IS NOT NULL AND 57813X542X18133 != '' AND 57813X542X18133 != '99', 1, 0 ) + 
            
            					IF( 57813X542X18134 IS NOT NULL AND 57813X542X18134 != '' AND 57813X542X18134 != '99', 1, 0 ) + 
            
            					IF( 57813X542X18135 IS NOT NULL AND 57813X542X18135 != '' AND 57813X542X18135 != '99', 1, 0 ) + 
            
            					IF( 57813X542X18136 IS NOT NULL AND 57813X542X18136 != '' AND 57813X542X18136 != '99', 1, 0 ) + 
            
            					IF( 57813X542X18137 IS NOT NULL AND 57813X542X18137 != '' AND 57813X542X18137 != '99', 1, 0 ) + 
            
            					IF( 57813X542X18138 IS NOT NULL AND 57813X542X18138 != '' AND 57813X542X18138 != '99', 1, 0 ) + 
            
            					IF( 57813X542X18139 IS NOT NULL AND 57813X542X18139 != '' AND 57813X542X18139 != '99', 1, 0 ) + 
            
            					IF( 57813X543X18451 IS NOT NULL AND 57813X543X18451 != '' AND 57813X543X18451 != '99', 1, 0 ) + 
            
            					IF( 57813X543X18452 IS NOT NULL AND 57813X543X18452 != '' AND 57813X543X18452 != '99', 1, 0 ) + 
            
            					IF( 57813X543X18453 IS NOT NULL AND 57813X543X18453 != '' AND 57813X543X18453 != '99', 1, 0 ) + 
            
            					IF( 57813X543X18454 IS NOT NULL AND 57813X543X18454 != '' AND 57813X543X18454 != '99', 1, 0 ) + 
            
            					IF( 57813X543X18455 IS NOT NULL AND 57813X543X18455 != '' AND 57813X543X18455 != '99', 1, 0 ) + 
            
            					IF( 57813X543X18456 IS NOT NULL AND 57813X543X18456 != '' AND 57813X543X18456 != '99', 1, 0 ) + 
            
            					IF( 57813X544X18711 IS NOT NULL AND 57813X544X18711 != '' AND 57813X544X18711 != '99', 1, 0 ) + 
            
            					IF( 57813X544X18712 IS NOT NULL AND 57813X544X18712 != '' AND 57813X544X18712 != '99', 1, 0 ) + 
            
            					IF( 57813X544X18713 IS NOT NULL AND 57813X544X18713 != '' AND 57813X544X18713 != '99', 1, 0 ) + 
            
            					IF( 57813X544X18714 IS NOT NULL AND 57813X544X18714 != '' AND 57813X544X18714 != '99', 1, 0 ) + 
            
            					IF( 57813X544X18715 IS NOT NULL AND 57813X544X18715 != '' AND 57813X544X18715 != '99', 1, 0 ) + 
            
            					IF( 57813X544X18716 IS NOT NULL AND 57813X544X18716 != '' AND 57813X544X18716 != '99', 1, 0 ) + 
            
            					IF( 57813X544X18717 IS NOT NULL AND 57813X544X18717 != '' AND 57813X544X18717 != '99', 1, 0 ) + 
            
            					IF( 57813X544X18718 IS NOT NULL AND 57813X544X18718 != '' AND 57813X544X18718 != '99', 1, 0 ) 
            
            				) 
            
            			) 
            
            		) 
            
            		/ COUNT(*) ), 4) as `AVG`
            
            		FROM `t1` 
            
            		WHERE `submitdate` IS NOT NULL 
            
            			AND ( 
            
            				( 57813X541X17271 IS NOT NULL AND 57813X541X17271 != '' AND 57813X541X17271 != '99' ) OR 
            
            				( 57813X541X17272 IS NOT NULL AND 57813X541X17272 != '' AND 57813X541X17272 != '99' ) OR 
            
            				( 57813X541X17273 IS NOT NULL AND 57813X541X17273 != '' AND 57813X541X17273 != '99' ) OR 
            
            				( 57813X541X17274 IS NOT NULL AND 57813X541X17274 != '' AND 57813X541X17274 != '99' ) OR 
            
            				( 57813X541X17275 IS NOT NULL AND 57813X541X17275 != '' AND 57813X541X17275 != '99' ) OR 
            
            				( 57813X541X17276 IS NOT NULL AND 57813X541X17276 != '' AND 57813X541X17276 != '99' ) OR 
            
            				( 57813X542X18131 IS NOT NULL AND 57813X542X18131 != '' AND 57813X542X18131 != '99' ) OR 
            
            				( 57813X542X18132 IS NOT NULL AND 57813X542X18132 != '' AND 57813X542X18132 != '99' ) OR 
            
            				( 57813X542X18133 IS NOT NULL AND 57813X542X18133 != '' AND 57813X542X18133 != '99' ) OR 
            
            				( 57813X542X18134 IS NOT NULL AND 57813X542X18134 != '' AND 57813X542X18134 != '99' ) OR 
            
            				( 57813X542X18135 IS NOT NULL AND 57813X542X18135 != '' AND 57813X542X18135 != '99' ) OR 
            
            				( 57813X542X18136 IS NOT NULL AND 57813X542X18136 != '' AND 57813X542X18136 != '99' ) OR 
            
            				( 57813X542X18137 IS NOT NULL AND 57813X542X18137 != '' AND 57813X542X18137 != '99' ) OR 
            
            				( 57813X542X18138 IS NOT NULL AND 57813X542X18138 != '' AND 57813X542X18138 != '99' ) OR 
            
            				( 57813X542X18139 IS NOT NULL AND 57813X542X18139 != '' AND 57813X542X18139 != '99' ) OR 
            
            				( 57813X543X18451 IS NOT NULL AND 57813X543X18451 != '' AND 57813X543X18451 != '99' ) OR 
            
            				( 57813X543X18452 IS NOT NULL AND 57813X543X18452 != '' AND 57813X543X18452 != '99' ) OR 
            
            				( 57813X543X18453 IS NOT NULL AND 57813X543X18453 != '' AND 57813X543X18453 != '99' ) OR 
            
            				( 57813X543X18454 IS NOT NULL AND 57813X543X18454 != '' AND 57813X543X18454 != '99' ) OR 
            
            				( 57813X543X18455 IS NOT NULL AND 57813X543X18455 != '' AND 57813X543X18455 != '99' ) OR 
            
            				( 57813X543X18456 IS NOT NULL AND 57813X543X18456 != '' AND 57813X543X18456 != '99' ) OR 
            
            				( 57813X544X18711 IS NOT NULL AND 57813X544X18711 != '' AND 57813X544X18711 != '99' ) OR 
            
            				( 57813X544X18712 IS NOT NULL AND 57813X544X18712 != '' AND 57813X544X18712 != '99' ) OR 
            
            				( 57813X544X18713 IS NOT NULL AND 57813X544X18713 != '' AND 57813X544X18713 != '99' ) OR 
            
            				( 57813X544X18714 IS NOT NULL AND 57813X544X18714 != '' AND 57813X544X18714 != '99' ) OR 
            
            				( 57813X544X18715 IS NOT NULL AND 57813X544X18715 != '' AND 57813X544X18715 != '99' ) OR 
            
            				( 57813X544X18716 IS NOT NULL AND 57813X544X18716 != '' AND 57813X544X18716 != '99' ) OR 
            
            				( 57813X544X18717 IS NOT NULL AND 57813X544X18717 != '' AND 57813X544X18717 != '99' ) OR 
            
            				( 57813X544X18718 IS NOT NULL AND 57813X544X18718 != '' AND 57813X544X18718 != '99' ) ) 
            
            				AND 57813X540X1723 = 'Test' ;
            
            drop table t1;
            
            Show
            sanja Oleksandr Byelkin added a comment - - edited CREATE TABLE `t1` ( `id` int (11) NOT NULL AUTO_INCREMENT, `submitdate` datetime DEFAULT NULL, `lastpage` int (11) DEFAULT NULL, `startlanguage` varchar(20) COLLATE utf8_unicode_ci NOT NULL, `token` varchar(36) COLLATE utf8_unicode_ci DEFAULT NULL, `datestamp` datetime NOT NULL, `startdate` datetime NOT NULL, `ipaddr` text COLLATE utf8_unicode_ci, `refurl` text COLLATE utf8_unicode_ci, `57813X540X1723` text COLLATE utf8_unicode_ci, `57813X540X1724` text COLLATE utf8_unicode_ci, `57813X540X1725` text COLLATE utf8_unicode_ci, `57813X540X1726` double DEFAULT NULL, `57813X540X1909` double DEFAULT NULL, `57813X541X17271` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, `57813X541X17272` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, `57813X541X17273` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, `57813X541X17274` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, `57813X541X17275` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, `57813X541X17276` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, `57813X541X17281` text COLLATE utf8_unicode_ci, `57813X541X17282` text COLLATE utf8_unicode_ci, `57813X541X17283` text COLLATE utf8_unicode_ci, `57813X541X17284` text COLLATE utf8_unicode_ci, `57813X541X17285` text COLLATE utf8_unicode_ci, `57813X541X17286` text COLLATE utf8_unicode_ci, `57813X542X18131` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, `57813X542X18132` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, `57813X542X18133` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, `57813X542X18134` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, `57813X542X18135` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, `57813X542X18136` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, `57813X542X18137` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, `57813X542X18138` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, `57813X542X18139` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, `57813X542X18141` text COLLATE utf8_unicode_ci, `57813X542X18142` text COLLATE utf8_unicode_ci, `57813X542X18143` text COLLATE utf8_unicode_ci, `57813X542X18144` text COLLATE utf8_unicode_ci, `57813X542X18145` text COLLATE utf8_unicode_ci, `57813X542X18146` text COLLATE utf8_unicode_ci, `57813X542X18147` text COLLATE utf8_unicode_ci, `57813X542X18148` text COLLATE utf8_unicode_ci, `57813X542X18149` text COLLATE utf8_unicode_ci, `57813X543X18451` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, `57813X543X18452` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, `57813X543X18453` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, `57813X543X18454` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, `57813X543X18455` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, `57813X543X18456` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, `57813X543X18461` text COLLATE utf8_unicode_ci, `57813X543X18462` text COLLATE utf8_unicode_ci, `57813X543X18463` text COLLATE utf8_unicode_ci, `57813X543X18464` text COLLATE utf8_unicode_ci, `57813X543X18465` text COLLATE utf8_unicode_ci, `57813X543X18466` text COLLATE utf8_unicode_ci, `57813X544X18711` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, `57813X544X18712` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, `57813X544X18713` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, `57813X544X18714` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, `57813X544X18715` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, `57813X544X18716` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, `57813X544X18717` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, `57813X544X18718` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, `57813X544X18721` text COLLATE utf8_unicode_ci, `57813X544X18722` text COLLATE utf8_unicode_ci, `57813X544X18723` text COLLATE utf8_unicode_ci, `57813X544X18724` text COLLATE utf8_unicode_ci, `57813X544X18725` text COLLATE utf8_unicode_ci, `57813X544X18726` text COLLATE utf8_unicode_ci, `57813X544X18727` text COLLATE utf8_unicode_ci, `57813X544X18728` text COLLATE utf8_unicode_ci, `57813X546X1902` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, `57813X546X1903` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, `57813X546X1904` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, `57813X545X1901` varchar(1) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), KEY `lime_survey_57813_idx` (`token`), KEY `57813X540X1723` (`57813X540X1723`(100)), KEY `57813X540X1724` (`57813X540X1724`(100)), KEY `57813X540X1726` (`57813X540X1726`), KEY `57813X540X1725` (`57813X540X1725`(100)), KEY `57813X546X1902` (`57813X546X1902`), KEY `57813X546X1903` (`57813X546X1903`), KEY `57813X546X1904` (`57813X546X1904`) ) ; SELECT COUNT(*) as `N`, ROUND( ( SUM( ( ( IF( 57813X541X17271 IS NOT NULL AND 57813X541X17271 != '' AND 57813X541X17271 != '99', 57813X541X17271, 0 ) + IF( 57813X541X17272 IS NOT NULL AND 57813X541X17272 != '' AND 57813X541X17272 != '99', 57813X541X17272, 0 ) + IF( 57813X541X17273 IS NOT NULL AND 57813X541X17273 != '' AND 57813X541X17273 != '99', 57813X541X17273, 0 ) + IF( 57813X541X17274 IS NOT NULL AND 57813X541X17274 != '' AND 57813X541X17274 != '99', 57813X541X17274, 0 ) + IF( 57813X541X17275 IS NOT NULL AND 57813X541X17275 != '' AND 57813X541X17275 != '99', 57813X541X17275, 0 ) + IF( 57813X541X17276 IS NOT NULL AND 57813X541X17276 != '' AND 57813X541X17276 != '99', 57813X541X17276, 0 ) + IF( 57813X542X18131 IS NOT NULL AND 57813X542X18131 != '' AND 57813X542X18131 != '99', 57813X542X18131, 0 ) + IF( 57813X542X18132 IS NOT NULL AND 57813X542X18132 != '' AND 57813X542X18132 != '99', 57813X542X18132, 0 ) + IF( 57813X542X18133 IS NOT NULL AND 57813X542X18133 != '' AND 57813X542X18133 != '99', 57813X542X18133, 0 ) + IF( 57813X542X18134 IS NOT NULL AND 57813X542X18134 != '' AND 57813X542X18134 != '99', 57813X542X18134, 0 ) + IF( 57813X542X18135 IS NOT NULL AND 57813X542X18135 != '' AND 57813X542X18135 != '99', 57813X542X18135, 0 ) + IF( 57813X542X18136 IS NOT NULL AND 57813X542X18136 != '' AND 57813X542X18136 != '99', 57813X542X18136, 0 ) + IF( 57813X542X18137 IS NOT NULL AND 57813X542X18137 != '' AND 57813X542X18137 != '99', 57813X542X18137, 0 ) + IF( 57813X542X18138 IS NOT NULL AND 57813X542X18138 != '' AND 57813X542X18138 != '99', 57813X542X18138, 0 ) + IF( 57813X542X18139 IS NOT NULL AND 57813X542X18139 != '' AND 57813X542X18139 != '99', 57813X542X18139, 0 ) + IF( 57813X543X18451 IS NOT NULL AND 57813X543X18451 != '' AND 57813X543X18451 != '99', 57813X543X18451, 0 ) + IF( 57813X543X18452 IS NOT NULL AND 57813X543X18452 != '' AND 57813X543X18452 != '99', 57813X543X18452, 0 ) + IF( 57813X543X18453 IS NOT NULL AND 57813X543X18453 != '' AND 57813X543X18453 != '99', 57813X543X18453, 0 ) + IF( 57813X543X18454 IS NOT NULL AND 57813X543X18454 != '' AND 57813X543X18454 != '99', 57813X543X18454, 0 ) + IF( 57813X543X18455 IS NOT NULL AND 57813X543X18455 != '' AND 57813X543X18455 != '99', 57813X543X18455, 0 ) + IF( 57813X543X18456 IS NOT NULL AND 57813X543X18456 != '' AND 57813X543X18456 != '99', 57813X543X18456, 0 ) + IF( 57813X544X18711 IS NOT NULL AND 57813X544X18711 != '' AND 57813X544X18711 != '99', 57813X544X18711, 0 ) + IF( 57813X544X18712 IS NOT NULL AND 57813X544X18712 != '' AND 57813X544X18712 != '99', 57813X544X18712, 0 ) + IF( 57813X544X18713 IS NOT NULL AND 57813X544X18713 != '' AND 57813X544X18713 != '99', 57813X544X18713, 0 ) + IF( 57813X544X18714 IS NOT NULL AND 57813X544X18714 != '' AND 57813X544X18714 != '99', 57813X544X18714, 0 ) + IF( 57813X544X18715 IS NOT NULL AND 57813X544X18715 != '' AND 57813X544X18715 != '99', 57813X544X18715, 0 ) + IF( 57813X544X18716 IS NOT NULL AND 57813X544X18716 != '' AND 57813X544X18716 != '99', 57813X544X18716, 0 ) + IF( 57813X544X18717 IS NOT NULL AND 57813X544X18717 != '' AND 57813X544X18717 != '99', 57813X544X18717, 0 ) + IF( 57813X544X18718 IS NOT NULL AND 57813X544X18718 != '' AND 57813X544X18718 != '99', 57813X544X18718, 0 ) ) / ( IF( 57813X541X17271 IS NOT NULL AND 57813X541X17271 != '' AND 57813X541X17271 != '99', 1, 0 ) + IF( 57813X541X17272 IS NOT NULL AND 57813X541X17272 != '' AND 57813X541X17272 != '99', 1, 0 ) + IF( 57813X541X17273 IS NOT NULL AND 57813X541X17273 != '' AND 57813X541X17273 != '99', 1, 0 ) + IF( 57813X541X17274 IS NOT NULL AND 57813X541X17274 != '' AND 57813X541X17274 != '99', 1, 0 ) + IF( 57813X541X17275 IS NOT NULL AND 57813X541X17275 != '' AND 57813X541X17275 != '99', 1, 0 ) + IF( 57813X541X17276 IS NOT NULL AND 57813X541X17276 != '' AND 57813X541X17276 != '99', 1, 0 ) + IF( 57813X542X18131 IS NOT NULL AND 57813X542X18131 != '' AND 57813X542X18131 != '99', 1, 0 ) + IF( 57813X542X18132 IS NOT NULL AND 57813X542X18132 != '' AND 57813X542X18132 != '99', 1, 0 ) + IF( 57813X542X18133 IS NOT NULL AND 57813X542X18133 != '' AND 57813X542X18133 != '99', 1, 0 ) + IF( 57813X542X18134 IS NOT NULL AND 57813X542X18134 != '' AND 57813X542X18134 != '99', 1, 0 ) + IF( 57813X542X18135 IS NOT NULL AND 57813X542X18135 != '' AND 57813X542X18135 != '99', 1, 0 ) + IF( 57813X542X18136 IS NOT NULL AND 57813X542X18136 != '' AND 57813X542X18136 != '99', 1, 0 ) + IF( 57813X542X18137 IS NOT NULL AND 57813X542X18137 != '' AND 57813X542X18137 != '99', 1, 0 ) + IF( 57813X542X18138 IS NOT NULL AND 57813X542X18138 != '' AND 57813X542X18138 != '99', 1, 0 ) + IF( 57813X542X18139 IS NOT NULL AND 57813X542X18139 != '' AND 57813X542X18139 != '99', 1, 0 ) + IF( 57813X543X18451 IS NOT NULL AND 57813X543X18451 != '' AND 57813X543X18451 != '99', 1, 0 ) + IF( 57813X543X18452 IS NOT NULL AND 57813X543X18452 != '' AND 57813X543X18452 != '99', 1, 0 ) + IF( 57813X543X18453 IS NOT NULL AND 57813X543X18453 != '' AND 57813X543X18453 != '99', 1, 0 ) + IF( 57813X543X18454 IS NOT NULL AND 57813X543X18454 != '' AND 57813X543X18454 != '99', 1, 0 ) + IF( 57813X543X18455 IS NOT NULL AND 57813X543X18455 != '' AND 57813X543X18455 != '99', 1, 0 ) + IF( 57813X543X18456 IS NOT NULL AND 57813X543X18456 != '' AND 57813X543X18456 != '99', 1, 0 ) + IF( 57813X544X18711 IS NOT NULL AND 57813X544X18711 != '' AND 57813X544X18711 != '99', 1, 0 ) + IF( 57813X544X18712 IS NOT NULL AND 57813X544X18712 != '' AND 57813X544X18712 != '99', 1, 0 ) + IF( 57813X544X18713 IS NOT NULL AND 57813X544X18713 != '' AND 57813X544X18713 != '99', 1, 0 ) + IF( 57813X544X18714 IS NOT NULL AND 57813X544X18714 != '' AND 57813X544X18714 != '99', 1, 0 ) + IF( 57813X544X18715 IS NOT NULL AND 57813X544X18715 != '' AND 57813X544X18715 != '99', 1, 0 ) + IF( 57813X544X18716 IS NOT NULL AND 57813X544X18716 != '' AND 57813X544X18716 != '99', 1, 0 ) + IF( 57813X544X18717 IS NOT NULL AND 57813X544X18717 != '' AND 57813X544X18717 != '99', 1, 0 ) + IF( 57813X544X18718 IS NOT NULL AND 57813X544X18718 != '' AND 57813X544X18718 != '99', 1, 0 ) ) ) ) / COUNT(*) ), 4) as `AVG` FROM `t1` WHERE `submitdate` IS NOT NULL AND ( ( 57813X541X17271 IS NOT NULL AND 57813X541X17271 != '' AND 57813X541X17271 != '99' ) OR ( 57813X541X17272 IS NOT NULL AND 57813X541X17272 != '' AND 57813X541X17272 != '99' ) OR ( 57813X541X17273 IS NOT NULL AND 57813X541X17273 != '' AND 57813X541X17273 != '99' ) OR ( 57813X541X17274 IS NOT NULL AND 57813X541X17274 != '' AND 57813X541X17274 != '99' ) OR ( 57813X541X17275 IS NOT NULL AND 57813X541X17275 != '' AND 57813X541X17275 != '99' ) OR ( 57813X541X17276 IS NOT NULL AND 57813X541X17276 != '' AND 57813X541X17276 != '99' ) OR ( 57813X542X18131 IS NOT NULL AND 57813X542X18131 != '' AND 57813X542X18131 != '99' ) OR ( 57813X542X18132 IS NOT NULL AND 57813X542X18132 != '' AND 57813X542X18132 != '99' ) OR ( 57813X542X18133 IS NOT NULL AND 57813X542X18133 != '' AND 57813X542X18133 != '99' ) OR ( 57813X542X18134 IS NOT NULL AND 57813X542X18134 != '' AND 57813X542X18134 != '99' ) OR ( 57813X542X18135 IS NOT NULL AND 57813X542X18135 != '' AND 57813X542X18135 != '99' ) OR ( 57813X542X18136 IS NOT NULL AND 57813X542X18136 != '' AND 57813X542X18136 != '99' ) OR ( 57813X542X18137 IS NOT NULL AND 57813X542X18137 != '' AND 57813X542X18137 != '99' ) OR ( 57813X542X18138 IS NOT NULL AND 57813X542X18138 != '' AND 57813X542X18138 != '99' ) OR ( 57813X542X18139 IS NOT NULL AND 57813X542X18139 != '' AND 57813X542X18139 != '99' ) OR ( 57813X543X18451 IS NOT NULL AND 57813X543X18451 != '' AND 57813X543X18451 != '99' ) OR ( 57813X543X18452 IS NOT NULL AND 57813X543X18452 != '' AND 57813X543X18452 != '99' ) OR ( 57813X543X18453 IS NOT NULL AND 57813X543X18453 != '' AND 57813X543X18453 != '99' ) OR ( 57813X543X18454 IS NOT NULL AND 57813X543X18454 != '' AND 57813X543X18454 != '99' ) OR ( 57813X543X18455 IS NOT NULL AND 57813X543X18455 != '' AND 57813X543X18455 != '99' ) OR ( 57813X543X18456 IS NOT NULL AND 57813X543X18456 != '' AND 57813X543X18456 != '99' ) OR ( 57813X544X18711 IS NOT NULL AND 57813X544X18711 != '' AND 57813X544X18711 != '99' ) OR ( 57813X544X18712 IS NOT NULL AND 57813X544X18712 != '' AND 57813X544X18712 != '99' ) OR ( 57813X544X18713 IS NOT NULL AND 57813X544X18713 != '' AND 57813X544X18713 != '99' ) OR ( 57813X544X18714 IS NOT NULL AND 57813X544X18714 != '' AND 57813X544X18714 != '99' ) OR ( 57813X544X18715 IS NOT NULL AND 57813X544X18715 != '' AND 57813X544X18715 != '99' ) OR ( 57813X544X18716 IS NOT NULL AND 57813X544X18716 != '' AND 57813X544X18716 != '99' ) OR ( 57813X544X18717 IS NOT NULL AND 57813X544X18717 != '' AND 57813X544X18717 != '99' ) OR ( 57813X544X18718 IS NOT NULL AND 57813X544X18718 != '' AND 57813X544X18718 != '99' ) ) AND 57813X540X1723 = 'Test' ; drop table t1;
            Hide
            sanja Oleksandr Byelkin added a comment -

            It crashes at the end.

            Show
            sanja Oleksandr Byelkin added a comment - It crashes at the end.
            Hide
            sanja Oleksandr Byelkin added a comment -

            revision-id: b44cb288886b527cf6ccc7cf918dad2f3065f6fd (mariadb-5.5.45-4-gb44cb28)
            parent(s): 5cc149febaad181cac65903a62dfe507ae4b6f76
            committer: Oleksandr Byelkin
            timestamp: 2015-09-24 19:13:04 +0200
            message:

            MDEV-8624: MariaDB hangs on query with many logical condition

            Made no_rows_in_result()/restore_to_before_no_rows_in_result() not looking
            annecessary deep with walk() method.

            Show
            sanja Oleksandr Byelkin added a comment - revision-id: b44cb288886b527cf6ccc7cf918dad2f3065f6fd (mariadb-5.5.45-4-gb44cb28) parent(s): 5cc149febaad181cac65903a62dfe507ae4b6f76 committer: Oleksandr Byelkin timestamp: 2015-09-24 19:13:04 +0200 message: MDEV-8624 : MariaDB hangs on query with many logical condition Made no_rows_in_result()/restore_to_before_no_rows_in_result() not looking annecessary deep with walk() method. —
            Hide
            sanja Oleksandr Byelkin added a comment -

            To make it clear the problem appeared when there was more then 1 function in the expression, then no_rows_in_result() of function call WALK, and the WALK call no_rows_in_result() of all argument and the function again. So having deep and wide tree makes huge number of calls.

            Show
            sanja Oleksandr Byelkin added a comment - To make it clear the problem appeared when there was more then 1 function in the expression, then no_rows_in_result() of function call WALK, and the WALK call no_rows_in_result() of all argument and the function again. So having deep and wide tree makes huge number of calls.
            Hide
            psergey Sergei Petrunia added a comment -

            Ok to push.

            Show
            psergey Sergei Petrunia added a comment - Ok to push.

              People

              • Assignee:
                sanja Oleksandr Byelkin
                Reporter:
                adminiv Vytautas Bertašius
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Agile