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

Server Crash on Execute of SQL Statement

Details

    Description

      Either of the following Windowing function constructs do not get an error but crash the server:

      – Case 1
      SUM( CASE WHEN
      SUM( CASE WHEN

      {test} THEN 1 ELSE 0 END ) OVER ( PARTITION BY {field} ) > 0
      AND
      SUM( CASE WHEN {test}

      THEN 1 ELSE 0 END ) OVER ( PARTITION BY

      {field} ) > 0
      THEN 1
      ELSE 0
      END
      )
      – Case 2
      SUM( IF( SUM( IF( {test}, 1 , 0 ) ) OVER ( PARTITION BY {field}

      ) > 0 AND SUM( IF(

      {test}

      , 1 , 0 ) ) OVER ( PARTITION BY

      {field}

      ) > 0,1, 0 ) )

      Attachments

        Issue Links

          Activity

            alice Alice Sherepa added a comment -

            Dave, thanks for the report. Reproducible on 10.2,10.3

            create table t1 (i int);
            insert into t1 values (5),(6),(0);
            select SUM( IF(SUM(IF(i,1,0)) OVER (PARTITION BY i) > 0 AND SUM( IF(i,1,0)) OVER (PARTITION BY i) > 0,1,0) ) from t1;
            

            also crash with OVER (order BY i)

            select SUM( IF(SUM(IF(i,1,0)) OVER (order BY i) > 0 AND SUM( IF(i,1,0)) OVER (order BY i) > 0,1,0) ) from t1;
            

            error log

            Version: '10.2.9-MariaDB-debug'  socket: '/tmp/mysql.sock'  port: 3322  Source distribution
            170911 11:49:49 [ERROR] mysqld got signal 11 ;
            This could be because you hit a bug. It is also possible that this binary
            or one of the libraries it was linked against is corrupt, improperly built,
            or misconfigured. This error can also be caused by malfunctioning hardware.
             
            To report this bug, see https://mariadb.com/kb/en/reporting-bugs
             
            We will try our best to scrape up some info that will hopefully help
            diagnose the problem, but since we have already crashed, 
            something is definitely wrong and this may fail.
             
            Server version: 10.2.9-MariaDB-debug
            key_buffer_size=134217728
            read_buffer_size=131072
            max_used_connections=1
            max_threads=153
            thread_count=7
            It is possible that mysqld could use up to 
            key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 467370 K  bytes of memory
            Hope that's ok; if not, decrease some variables in the equation.
             
            Thread pointer: 0x7f0310000a98
            Attempting backtrace. You can use the following information to find out
            where mysqld died. If you see no messages after this, something went
            terribly wrong...
            stack_bottom = 0x7f0380c83ec0 thread_stack 0x49000
            /data/bld/10.2/bin/mysqld(my_print_stacktrace+0x38)[0xd82cf54a15]
            /data/bld/10.2/bin/mysqld(handle_fatal_signal+0x3a3)[0xd82c7e125e]
            /lib/x86_64-linux-gnu/libpthread.so.0(+0x11390)[0x7f0384c5f390]
            /data/bld/10.2/bin/mysqld(_ZNK10Item_field11used_tablesEv+0x17)[0xd82c7fd9c9]
            /data/bld/10.2/bin/mysqld(_ZN16Item_window_func18update_used_tablesEv+0x15a)[0xd82c9cd572]
            /data/bld/10.2/bin/mysqld(_ZN27Used_tables_and_const_cache43used_tables_and_const_cache_update_and_joinEP4Item+0x29)[0xd82c512add]
            /data/bld/10.2/bin/mysqld(_ZN27Used_tables_and_const_cache43used_tables_and_const_cache_update_and_joinEjPP4Item+0x46)[0xd82c512b3a]
            /data/bld/10.2/bin/mysqld(_ZN9Item_func18update_used_tablesEv+0x48)[0xd82c513da0]
            /data/bld/10.2/bin/mysqld(_ZN27Used_tables_and_const_cache43used_tables_and_const_cache_update_and_joinEP4Item+0x29)[0xd82c512add]
            /data/bld/10.2/bin/mysqld(_ZN27Used_tables_and_const_cache43used_tables_and_const_cache_update_and_joinER4ListI4ItemE+0x57)[0xd82c833b67]
            /data/bld/10.2/bin/mysqld(_ZN9Item_cond18update_used_tablesEv+0x3e)[0xd82c837088]
            /data/bld/10.2/bin/mysqld(_ZN27Used_tables_and_const_cache43used_tables_and_const_cache_update_and_joinEP4Item+0x29)[0xd82c512add]
            /data/bld/10.2/bin/mysqld(_ZN27Used_tables_and_const_cache43used_tables_and_const_cache_update_and_joinEjPP4Item+0x46)[0xd82c512b3a]
            /data/bld/10.2/bin/mysqld(_ZN9Item_func18update_used_tablesEv+0x48)[0xd82c513da0]
            /data/bld/10.2/bin/mysqld(_ZN8Item_sum18update_used_tablesEv+0x8d)[0xd82c8ba8b9]
            /data/bld/10.2/bin/mysqld(_ZN8Item_sum14check_sum_funcEP3THDPP4Item+0x4a3)[0xd82c8b9d53]
            /data/bld/10.2/bin/mysqld(_ZN12Item_sum_num10fix_fieldsEP3THDPP4Item+0x253)[0xd82c8bc1f5]
            /data/bld/10.2/bin/mysqld(_Z12setup_fieldsP3THD20Bounds_checked_arrayIP4ItemER4ListIS2_E17enum_mark_columnsPS6_b+0x34c)[0xd82c50d0b3]
            /data/bld/10.2/bin/mysqld(_ZN4JOIN7prepareEP10TABLE_LISTjP4ItemjP8st_orderbS5_S3_S5_P13st_select_lexP18st_select_lex_unit+0x6a7)[0xd82c5b34c3]
            /data/bld/10.2/bin/mysqld(_Z12mysql_selectP3THDP10TABLE_LISTjR4ListI4ItemEPS4_jP8st_orderS9_S7_S9_yP13select_resultP18st_select_lex_unitP13st_select_lex+0x241)[0xd82c5bd86c]
            /data/bld/10.2/bin/mysqld(_Z13handle_selectP3THDP3LEXP13select_resultm+0x15f)[0xd82c5b21c9]
            /data/bld/10.2/bin/mysqld(+0x5b51b0)[0xd82c57e1b0]
            /data/bld/10.2/bin/mysqld(_Z21mysql_execute_commandP3THD+0x185c)[0xd82c573eb1]
            /data/bld/10.2/bin/mysqld(_Z11mysql_parseP3THDPcjP12Parser_statebb+0x2a2)[0xd82c581b29]
            /data/bld/10.2/bin/mysqld(_Z16dispatch_command19enum_server_commandP3THDPcjbb+0xfee)[0xd82c56f84b]
            /data/bld/10.2/bin/mysqld(_Z10do_commandP3THD+0x700)[0xd82c56e1be]
            /data/bld/10.2/bin/mysqld(_Z24do_handle_one_connectionP7CONNECT+0x1ca)[0xd82c6bab66]
            /data/bld/10.2/bin/mysqld(handle_one_connection+0x30)[0xd82c6ba8e6]
            /lib/x86_64-linux-gnu/libpthread.so.0(+0x76ba)[0x7f0384c556ba]
            /lib/x86_64-linux-gnu/libc.so.6(clone+0x6d)[0x7f03840ea3dd]
             
            Trying to get some variables.
            Some pointers may be invalid and cause the dump to abort.
            Query (0x7f0310047a90): select  SUM( IF(SUM(IF(i,1,0)) OVER (order BY i) > 0 AND SUM( IF(i,1,0)) OVER (order BY i) > 0,1,0) ) from t1
            Connection ID (thread ID): 8
            Status: NOT_KILLED
            

            stack trace

            Thread 1 (Thread 0x7fe62c1fc700 (LWP 29503)):
            #0  0x000000907605a9c9 in Item_field::used_tables (this=0x7fe5bc046a50) at /home/alice/git/10.2/sql/item.cc:2869
            #1  0x000000907622a4ea in Item_window_func::update_used_tables (this=0x7fe5bc016020) at /home/alice/git/10.2/sql/item_windowfunc.cc:58
            #2  0x0000009075d6fadd in Used_tables_and_const_cache::used_tables_and_const_cache_update_and_join (this=0x7fe5bc0161c8, item=0x7fe5bc016020) at /home/alice/git/10.2/sql/item.h:3986
            #3  0x0000009075d6fb3a in Used_tables_and_const_cache::used_tables_and_const_cache_update_and_join (this=0x7fe5bc0161c8, argc=2, argv=0x7fe5bc0161b0) at /home/alice/git/10.2/sql/item.h:3998
            #4  0x0000009075d70da0 in Item_func::update_used_tables (this=0x7fe5bc016120) at /home/alice/git/10.2/sql/item_func.h:135
            #5  0x0000009075d6fadd in Used_tables_and_const_cache::used_tables_and_const_cache_update_and_join (this=0x7fe5bc04a0e8, item=0x7fe5bc016120) at /home/alice/git/10.2/sql/item.h:3986
            #6  0x0000009076090b67 in Used_tables_and_const_cache::used_tables_and_const_cache_update_and_join (this=0x7fe5bc04a0e8, list=...) at /home/alice/git/10.2/sql/item.h:4011
            #7  0x0000009076094088 in Item_cond::update_used_tables (this=0x7fe5bc04a040) at /home/alice/git/10.2/sql/item_cmpfunc.h:2207
            #8  0x0000009075d6fadd in Used_tables_and_const_cache::used_tables_and_const_cache_update_and_join (this=0x7fe5bc04a2f8, item=0x7fe5bc04a040) at /home/alice/git/10.2/sql/item.h:3986
            #9  0x0000009075d6fb3a in Used_tables_and_const_cache::used_tables_and_const_cache_update_and_join (this=0x7fe5bc04a2f8, argc=3, argv=0x7fe5bc015b80) at /home/alice/git/10.2/sql/item.h:3998
            #10 0x0000009075d70da0 in Item_func::update_used_tables (this=0x7fe5bc04a250) at /home/alice/git/10.2/sql/item_func.h:135
            #11 0x00000090761178b9 in Item_sum::update_used_tables (this=0x7fe5bc04a350) at /home/alice/git/10.2/sql/item_sum.cc:527
            #12 0x0000009076116d53 in Item_sum::check_sum_func (this=0x7fe5bc04a350, thd=0x7fe5bc000a98, ref=0x7fe5bc015ae0) at /home/alice/git/10.2/sql/item_sum.cc:294
            #13 0x00000090761191f5 in Item_sum_num::fix_fields (this=0x7fe5bc04a350, thd=0x7fe5bc000a98, ref=0x7fe5bc015ae0) at /home/alice/git/10.2/sql/item_sum.cc:1117
            #14 0x0000009075d6a0b3 in setup_fields (thd=0x7fe5bc000a98, ref_pointer_array=..., fields=..., mark_used_columns=MARK_COLUMNS_READ, sum_func_list=0x7fe5bc04b270, allow_sum_func=true) at /home/alice/git/10.2/sql/sql_base.cc:7053
            #15 0x0000009075e104c3 in JOIN::prepare (this=0x7fe5bc04af20, tables_init=0x7fe5bc04a650, wild_num=0, conds_init=0x0, og_num=0, order_init=0x0, skip_order_by=false, group_init=0x0, having_init=0x0, proc_param_init=0x0, select_lex_arg=0x7fe5bc004d90, unit_arg=0x7fe5bc004638) at /home/alice/git/10.2/sql/sql_select.cc:806
            #16 0x0000009075e1a86c in mysql_select (thd=0x7fe5bc000a98, tables=0x7fe5bc04a650, wild_num=0, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x7fe5bc010450, unit=0x7fe5bc004638, select_lex=0x7fe5bc004d90) at /home/alice/git/10.2/sql/sql_select.cc:3656
            #17 0x0000009075e0f1c9 in handle_select (thd=0x7fe5bc000a98, lex=0x7fe5bc004570, result=0x7fe5bc010450, setup_tables_done_option=0) at /home/alice/git/10.2/sql/sql_select.cc:373
            #18 0x0000009075ddb1b0 in execute_sqlcom_select (thd=0x7fe5bc000a98, all_tables=0x7fe5bc04a650) at /home/alice/git/10.2/sql/sql_parse.cc:6446
            #19 0x0000009075dd0eb1 in mysql_execute_command (thd=0x7fe5bc000a98) at /home/alice/git/10.2/sql/sql_parse.cc:3460
            #20 0x0000009075ddeb29 in mysql_parse (thd=0x7fe5bc000a98, rawbuf=0x7fe5bc014f00 "select \nSUM( IF(SUM(IF(i,1,0)) OVER (PARTITION BY i) > 0 AND SUM( IF(i,1,0)) OVER (PARTITION BY i) > 0,1,0) ) from t1", length=117, parser_state=0x7fe62c1fb240, is_com_multi=false, is_next_command=false) at /home/alice/git/10.2/sql/sql_parse.cc:7886
            #21 0x0000009075dcc84b in dispatch_command (command=COM_QUERY, thd=0x7fe5bc000a98, packet=0x7fe5bc007e89 "select \nSUM( IF(SUM(IF(i,1,0)) OVER (PARTITION BY i) > 0 AND SUM( IF(i,1,0)) OVER (PARTITION BY i) > 0,1,0) ) from t1", packet_length=117, is_com_multi=false, is_next_command=false) at /home/alice/git/10.2/sql/sql_parse.cc:1812
            #22 0x0000009075dcb1be in do_command (thd=0x7fe5bc000a98) at /home/alice/git/10.2/sql/sql_parse.cc:1360
            #23 0x0000009075f17b66 in do_handle_one_connection (connect=0x9079ede398) at /home/alice/git/10.2/sql/sql_connect.cc:1354
            #24 0x0000009075f178e6 in handle_one_connection (arg=0x9079ede398) at /home/alice/git/10.2/sql/sql_connect.cc:1260
            #25 0x00007fe62f5cb6ba in start_thread (arg=0x7fe62c1fc700) at pthread_create.c:333
            #26 0x00007fe62ea603dd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109
            
            

            alice Alice Sherepa added a comment - Dave, thanks for the report. Reproducible on 10.2,10.3 create table t1 (i int ); insert into t1 values (5),(6),(0); select SUM ( IF ( SUM ( IF (i,1,0)) OVER (PARTITION BY i) > 0 AND SUM ( IF (i,1,0)) OVER (PARTITION BY i) > 0,1,0) ) from t1; also crash with OVER (order BY i) select SUM( IF(SUM(IF(i,1,0)) OVER (order BY i) > 0 AND SUM( IF(i,1,0)) OVER (order BY i) > 0,1,0) ) from t1; error log Version: '10.2.9-MariaDB-debug' socket: '/tmp/mysql.sock' port: 3322 Source distribution 170911 11:49:49 [ERROR] mysqld got signal 11 ; This could be because you hit a bug. It is also possible that this binary or one of the libraries it was linked against is corrupt, improperly built, or misconfigured. This error can also be caused by malfunctioning hardware.   To report this bug, see https://mariadb.com/kb/en/reporting-bugs   We will try our best to scrape up some info that will hopefully help diagnose the problem, but since we have already crashed, something is definitely wrong and this may fail.   Server version: 10.2.9-MariaDB-debug key_buffer_size=134217728 read_buffer_size=131072 max_used_connections=1 max_threads=153 thread_count=7 It is possible that mysqld could use up to key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 467370 K bytes of memory Hope that's ok; if not, decrease some variables in the equation.   Thread pointer: 0x7f0310000a98 Attempting backtrace. You can use the following information to find out where mysqld died. If you see no messages after this, something went terribly wrong... stack_bottom = 0x7f0380c83ec0 thread_stack 0x49000 /data/bld/10.2/bin/mysqld(my_print_stacktrace+0x38)[0xd82cf54a15] /data/bld/10.2/bin/mysqld(handle_fatal_signal+0x3a3)[0xd82c7e125e] /lib/x86_64-linux-gnu/libpthread.so.0(+0x11390)[0x7f0384c5f390] /data/bld/10.2/bin/mysqld(_ZNK10Item_field11used_tablesEv+0x17)[0xd82c7fd9c9] /data/bld/10.2/bin/mysqld(_ZN16Item_window_func18update_used_tablesEv+0x15a)[0xd82c9cd572] /data/bld/10.2/bin/mysqld(_ZN27Used_tables_and_const_cache43used_tables_and_const_cache_update_and_joinEP4Item+0x29)[0xd82c512add] /data/bld/10.2/bin/mysqld(_ZN27Used_tables_and_const_cache43used_tables_and_const_cache_update_and_joinEjPP4Item+0x46)[0xd82c512b3a] /data/bld/10.2/bin/mysqld(_ZN9Item_func18update_used_tablesEv+0x48)[0xd82c513da0] /data/bld/10.2/bin/mysqld(_ZN27Used_tables_and_const_cache43used_tables_and_const_cache_update_and_joinEP4Item+0x29)[0xd82c512add] /data/bld/10.2/bin/mysqld(_ZN27Used_tables_and_const_cache43used_tables_and_const_cache_update_and_joinER4ListI4ItemE+0x57)[0xd82c833b67] /data/bld/10.2/bin/mysqld(_ZN9Item_cond18update_used_tablesEv+0x3e)[0xd82c837088] /data/bld/10.2/bin/mysqld(_ZN27Used_tables_and_const_cache43used_tables_and_const_cache_update_and_joinEP4Item+0x29)[0xd82c512add] /data/bld/10.2/bin/mysqld(_ZN27Used_tables_and_const_cache43used_tables_and_const_cache_update_and_joinEjPP4Item+0x46)[0xd82c512b3a] /data/bld/10.2/bin/mysqld(_ZN9Item_func18update_used_tablesEv+0x48)[0xd82c513da0] /data/bld/10.2/bin/mysqld(_ZN8Item_sum18update_used_tablesEv+0x8d)[0xd82c8ba8b9] /data/bld/10.2/bin/mysqld(_ZN8Item_sum14check_sum_funcEP3THDPP4Item+0x4a3)[0xd82c8b9d53] /data/bld/10.2/bin/mysqld(_ZN12Item_sum_num10fix_fieldsEP3THDPP4Item+0x253)[0xd82c8bc1f5] /data/bld/10.2/bin/mysqld(_Z12setup_fieldsP3THD20Bounds_checked_arrayIP4ItemER4ListIS2_E17enum_mark_columnsPS6_b+0x34c)[0xd82c50d0b3] /data/bld/10.2/bin/mysqld(_ZN4JOIN7prepareEP10TABLE_LISTjP4ItemjP8st_orderbS5_S3_S5_P13st_select_lexP18st_select_lex_unit+0x6a7)[0xd82c5b34c3] /data/bld/10.2/bin/mysqld(_Z12mysql_selectP3THDP10TABLE_LISTjR4ListI4ItemEPS4_jP8st_orderS9_S7_S9_yP13select_resultP18st_select_lex_unitP13st_select_lex+0x241)[0xd82c5bd86c] /data/bld/10.2/bin/mysqld(_Z13handle_selectP3THDP3LEXP13select_resultm+0x15f)[0xd82c5b21c9] /data/bld/10.2/bin/mysqld(+0x5b51b0)[0xd82c57e1b0] /data/bld/10.2/bin/mysqld(_Z21mysql_execute_commandP3THD+0x185c)[0xd82c573eb1] /data/bld/10.2/bin/mysqld(_Z11mysql_parseP3THDPcjP12Parser_statebb+0x2a2)[0xd82c581b29] /data/bld/10.2/bin/mysqld(_Z16dispatch_command19enum_server_commandP3THDPcjbb+0xfee)[0xd82c56f84b] /data/bld/10.2/bin/mysqld(_Z10do_commandP3THD+0x700)[0xd82c56e1be] /data/bld/10.2/bin/mysqld(_Z24do_handle_one_connectionP7CONNECT+0x1ca)[0xd82c6bab66] /data/bld/10.2/bin/mysqld(handle_one_connection+0x30)[0xd82c6ba8e6] /lib/x86_64-linux-gnu/libpthread.so.0(+0x76ba)[0x7f0384c556ba] /lib/x86_64-linux-gnu/libc.so.6(clone+0x6d)[0x7f03840ea3dd]   Trying to get some variables. Some pointers may be invalid and cause the dump to abort. Query (0x7f0310047a90): select SUM( IF(SUM(IF(i,1,0)) OVER (order BY i) > 0 AND SUM( IF(i,1,0)) OVER (order BY i) > 0,1,0) ) from t1 Connection ID (thread ID): 8 Status: NOT_KILLED stack trace Thread 1 (Thread 0x7fe62c1fc700 (LWP 29503)): #0 0x000000907605a9c9 in Item_field::used_tables (this=0x7fe5bc046a50) at /home/alice/git/10.2/sql/item.cc:2869 #1 0x000000907622a4ea in Item_window_func::update_used_tables (this=0x7fe5bc016020) at /home/alice/git/10.2/sql/item_windowfunc.cc:58 #2 0x0000009075d6fadd in Used_tables_and_const_cache::used_tables_and_const_cache_update_and_join (this=0x7fe5bc0161c8, item=0x7fe5bc016020) at /home/alice/git/10.2/sql/item.h:3986 #3 0x0000009075d6fb3a in Used_tables_and_const_cache::used_tables_and_const_cache_update_and_join (this=0x7fe5bc0161c8, argc=2, argv=0x7fe5bc0161b0) at /home/alice/git/10.2/sql/item.h:3998 #4 0x0000009075d70da0 in Item_func::update_used_tables (this=0x7fe5bc016120) at /home/alice/git/10.2/sql/item_func.h:135 #5 0x0000009075d6fadd in Used_tables_and_const_cache::used_tables_and_const_cache_update_and_join (this=0x7fe5bc04a0e8, item=0x7fe5bc016120) at /home/alice/git/10.2/sql/item.h:3986 #6 0x0000009076090b67 in Used_tables_and_const_cache::used_tables_and_const_cache_update_and_join (this=0x7fe5bc04a0e8, list=...) at /home/alice/git/10.2/sql/item.h:4011 #7 0x0000009076094088 in Item_cond::update_used_tables (this=0x7fe5bc04a040) at /home/alice/git/10.2/sql/item_cmpfunc.h:2207 #8 0x0000009075d6fadd in Used_tables_and_const_cache::used_tables_and_const_cache_update_and_join (this=0x7fe5bc04a2f8, item=0x7fe5bc04a040) at /home/alice/git/10.2/sql/item.h:3986 #9 0x0000009075d6fb3a in Used_tables_and_const_cache::used_tables_and_const_cache_update_and_join (this=0x7fe5bc04a2f8, argc=3, argv=0x7fe5bc015b80) at /home/alice/git/10.2/sql/item.h:3998 #10 0x0000009075d70da0 in Item_func::update_used_tables (this=0x7fe5bc04a250) at /home/alice/git/10.2/sql/item_func.h:135 #11 0x00000090761178b9 in Item_sum::update_used_tables (this=0x7fe5bc04a350) at /home/alice/git/10.2/sql/item_sum.cc:527 #12 0x0000009076116d53 in Item_sum::check_sum_func (this=0x7fe5bc04a350, thd=0x7fe5bc000a98, ref=0x7fe5bc015ae0) at /home/alice/git/10.2/sql/item_sum.cc:294 #13 0x00000090761191f5 in Item_sum_num::fix_fields (this=0x7fe5bc04a350, thd=0x7fe5bc000a98, ref=0x7fe5bc015ae0) at /home/alice/git/10.2/sql/item_sum.cc:1117 #14 0x0000009075d6a0b3 in setup_fields (thd=0x7fe5bc000a98, ref_pointer_array=..., fields=..., mark_used_columns=MARK_COLUMNS_READ, sum_func_list=0x7fe5bc04b270, allow_sum_func=true) at /home/alice/git/10.2/sql/sql_base.cc:7053 #15 0x0000009075e104c3 in JOIN::prepare (this=0x7fe5bc04af20, tables_init=0x7fe5bc04a650, wild_num=0, conds_init=0x0, og_num=0, order_init=0x0, skip_order_by=false, group_init=0x0, having_init=0x0, proc_param_init=0x0, select_lex_arg=0x7fe5bc004d90, unit_arg=0x7fe5bc004638) at /home/alice/git/10.2/sql/sql_select.cc:806 #16 0x0000009075e1a86c in mysql_select (thd=0x7fe5bc000a98, tables=0x7fe5bc04a650, wild_num=0, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x7fe5bc010450, unit=0x7fe5bc004638, select_lex=0x7fe5bc004d90) at /home/alice/git/10.2/sql/sql_select.cc:3656 #17 0x0000009075e0f1c9 in handle_select (thd=0x7fe5bc000a98, lex=0x7fe5bc004570, result=0x7fe5bc010450, setup_tables_done_option=0) at /home/alice/git/10.2/sql/sql_select.cc:373 #18 0x0000009075ddb1b0 in execute_sqlcom_select (thd=0x7fe5bc000a98, all_tables=0x7fe5bc04a650) at /home/alice/git/10.2/sql/sql_parse.cc:6446 #19 0x0000009075dd0eb1 in mysql_execute_command (thd=0x7fe5bc000a98) at /home/alice/git/10.2/sql/sql_parse.cc:3460 #20 0x0000009075ddeb29 in mysql_parse (thd=0x7fe5bc000a98, rawbuf=0x7fe5bc014f00 "select \nSUM( IF(SUM(IF(i,1,0)) OVER (PARTITION BY i) > 0 AND SUM( IF(i,1,0)) OVER (PARTITION BY i) > 0,1,0) ) from t1", length=117, parser_state=0x7fe62c1fb240, is_com_multi=false, is_next_command=false) at /home/alice/git/10.2/sql/sql_parse.cc:7886 #21 0x0000009075dcc84b in dispatch_command (command=COM_QUERY, thd=0x7fe5bc000a98, packet=0x7fe5bc007e89 "select \nSUM( IF(SUM(IF(i,1,0)) OVER (PARTITION BY i) > 0 AND SUM( IF(i,1,0)) OVER (PARTITION BY i) > 0,1,0) ) from t1", packet_length=117, is_com_multi=false, is_next_command=false) at /home/alice/git/10.2/sql/sql_parse.cc:1812 #22 0x0000009075dcb1be in do_command (thd=0x7fe5bc000a98) at /home/alice/git/10.2/sql/sql_parse.cc:1360 #23 0x0000009075f17b66 in do_handle_one_connection (connect=0x9079ede398) at /home/alice/git/10.2/sql/sql_connect.cc:1354 #24 0x0000009075f178e6 in handle_one_connection (arg=0x9079ede398) at /home/alice/git/10.2/sql/sql_connect.cc:1260 #25 0x00007fe62f5cb6ba in start_thread (arg=0x7fe62c1fc700) at pthread_create.c:333 #26 0x00007fe62ea603dd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

            The test case uses an aggregate function with a window function as an argument. This sort of construct is illegal, as window function computation happens post aggregation. The patch will make such use cases return an error instead of hopelessly trying to evaluate.

            cvicentiu Vicențiu Ciorbaru added a comment - The test case uses an aggregate function with a window function as an argument. This sort of construct is illegal, as window function computation happens post aggregation. The patch will make such use cases return an error instead of hopelessly trying to evaluate.

            People

              cvicentiu Vicențiu Ciorbaru
              Emde Dave
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.