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

UBSAN signed integer overflow: X + Y cannot be represented in type 'long long int' in get_part_iter_for_interval_via_walking

    XMLWordPrintable

Details

    Description

      --source include/have_partition.inc
       
      CREATE TABLE t(c BIGINT)PARTITION BY HASH (c) PARTITIONS 1;
      SELECT * FROM t WHERE c BETWEEN 0 AND 18446744073709551615;
      

      Leads to

      10.5.25 33e4fbf04578c40c02306b65083c6d9a90ca8b2b (Optimized, UBASAN)

      Version: '10.5.25-MariaDB'  socket: '/test/UBASAN_MD070524-mariadb-10.5.25-linux-x86_64-opt/socket.sock'  port: 11785  MariaDB Server
      /test/10.5_opt_san/sql/sql_partition.cc:8460:4: runtime error: signed integer overflow: 1 + 9223372036854775807 cannot be represented in type 'long long int'
          #0 0x556edd4fe292 in get_part_iter_for_interval_via_walking /test/10.5_opt_san/sql/sql_partition.cc:8460
          #1 0x556edd2f287d in find_used_partitions /test/10.5_opt_san/sql/opt_range.cc:4545
          #2 0x556edd2f8731 in prune_partitions(THD*, TABLE*, Item*) /test/10.5_opt_san/sql/opt_range.cc:4061
          #3 0x556edb57cc9e in JOIN::optimize_inner() /test/10.5_opt_san/sql/sql_select.cc:2260
          #4 0x556edb591c5f in JOIN::optimize() /test/10.5_opt_san/sql/sql_select.cc:1740
          #5 0x556edb5a13ce in mysql_select(THD*, TABLE_LIST*, List<Item>&, Item*, unsigned int, st_order*, st_order*, Item*, st_order*, unsigned long long, select_result*, st_select_lex_unit*, st_select_lex*) /test/10.5_opt_san/sql/sql_select.cc:4868
          #6 0x556edb5a6eb3 in handle_select(THD*, LEX*, select_result*, unsigned long) /test/10.5_opt_san/sql/sql_select.cc:449
          #7 0x556edb243bd1 in execute_sqlcom_select /test/10.5_opt_san/sql/sql_parse.cc:6424
          #8 0x556edb29b6f4 in mysql_execute_command(THD*) /test/10.5_opt_san/sql/sql_parse.cc:4029
          #9 0x556edb2108cd in mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool) /test/10.5_opt_san/sql/sql_parse.cc:8203
          #10 0x556edb26fb87 in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool) /test/10.5_opt_san/sql/sql_parse.cc:1891
          #11 0x556edb27bcd2 in do_command(THD*) /test/10.5_opt_san/sql/sql_parse.cc:1375
          #12 0x556edba9fc28 in do_handle_one_connection(CONNECT*, bool) /test/10.5_opt_san/sql/sql_connect.cc:1415
          #13 0x556edbaa229c in handle_one_connection /test/10.5_opt_san/sql/sql_connect.cc:1317
          #14 0x149fbede9608 in start_thread /build/glibc-SzIz7B/glibc-2.31/nptl/pthread_create.c:477
          #15 0x149fbe05e132 in __clone (/lib/x86_64-linux-gnu/libc.so.6+0x11f132)
      

      Attachments

        Activity

          People

            sanja Oleksandr Byelkin
            ramesh Ramesh Sivaraman
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

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