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

TO_DATE: NULL value for format string causes assertion failure

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Fixed
    • N/A
    • 12.3.1
    • Server
    • None
    • Not for Release Notes

    Description

      SELECT TO_DATE('2026-01-01', NULL) AS x;
      

      bb-12.3-MDEV-19683-to_date f45636ea81a5a02444833e993e47c262ed52f384

      mariadbd: /data/bld/preview-12.3/bb-12.3-MDEV-19683-to_date-asan/sql/protocol.cc:640: void Protocol::end_statement(): Assertion `0' failed.
      260109  9:34:26 [ERROR] /share8t/bld/preview-12.3/bb-12.3-MDEV-19683-to_date-asan/sql/mariadbd got signal 6 ;
       
      #8  0x00007fea88445395 in __assert_fail_base (fmt=0x7fea885b9a90 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x564fe7b23020 "0", file=file@entry=0x564fe7b224c0 "/data/bld/preview-12.3/bb-12.3-MDEV-19683-to_date-asan/sql/protocol.cc", line=line@entry=640, function=function@entry=0x564fe7b22f00 "void Protocol::end_statement()") at ./assert/assert.c:92
      #9  0x00007fea88453eb2 in __GI___assert_fail (assertion=0x564fe7b23020 "0", file=0x564fe7b224c0 "/data/bld/preview-12.3/bb-12.3-MDEV-19683-to_date-asan/sql/protocol.cc", line=640, function=0x564fe7b22f00 "void Protocol::end_statement()") at ./assert/assert.c:101
      #10 0x0000564fe541b601 in Protocol::end_statement (this=0x62c0000c08f8) at /data/bld/preview-12.3/bb-12.3-MDEV-19683-to_date-asan/sql/protocol.cc:640
      #11 0x0000564fe573563f in dispatch_command (command=COM_QUERY, thd=0x62c0000c0218, packet=0x6290002b2219 "SELECT TO_DATE('2026-01-01', NULL) AS x", packet_length=39, blocking=true) at /data/bld/preview-12.3/bb-12.3-MDEV-19683-to_date-asan/sql/sql_parse.cc:2427
      #12 0x0000564fe572ed42 in do_command (thd=0x62c0000c0218, blocking=true) at /data/bld/preview-12.3/bb-12.3-MDEV-19683-to_date-asan/sql/sql_parse.cc:1417
      #13 0x0000564fe5c382fd in do_handle_one_connection (connect=0x608000014038, put_in_cache=true) at /data/bld/preview-12.3/bb-12.3-MDEV-19683-to_date-asan/sql/sql_connect.cc:1503
      #14 0x0000564fe5c37e5c in handle_one_connection (arg=0x608000003fb8) at /data/bld/preview-12.3/bb-12.3-MDEV-19683-to_date-asan/sql/sql_connect.cc:1415
      #15 0x0000564fe69c6264 in pfs_spawn_thread (arg=0x617000005f18) at /data/bld/preview-12.3/bb-12.3-MDEV-19683-to_date-asan/storage/perfschema/pfs.cc:2198
      #16 0x00007fea884a81c4 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
      #17 0x00007fea8852885c in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
      

      In Oracle PL/SQL it is a valid query returning NULL.

      Attachments

        Issue Links

          Activity

            People

              monty Michael Widenius
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              2 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.