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

Assertion `file < 0' failed in select_to_file::~select_to_file upon SELECT INTO OUTFILE from INFORMATION_SCHEMA.TABLES

    XMLWordPrintable

Details

    • Not for Release Notes

    Description

      Debug build assert at sql/sql_class.cc:3525. Optimized build create a 0 byte file.

      CREATE TABLE t1(i INT);
      SELECT TABLE_NAME INTO OUTFILE 'foo.txt' FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test';
      

      Leads to

      MDEV-31342 CS 13.1.0 26843b29076c4dfcd39472e5a1f320c4998773e4 (Debug, Clang 18.1.3-11) Build 16/09/2026

      mariadbd: /test/mtest/MDEV-31342/13.1_dbg/sql/sql_class.cc:3525: virtual select_to_file::~select_to_file(): Assertion `file < 0' failed.
      

      MDEV-31342 CS 13.1.0 26843b29076c4dfcd39472e5a1f320c4998773e4 (Debug, Clang 18.1.3-11) Build 16/09/2026

      Core was generated by `/test/mtest/MDEV-31342/MD160926-mariadb-13.1.0-linux-x86_64-dbg/bin/mariadbd --'.
      Program terminated with signal SIGABRT, Aborted.
      #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
       
      [Current thread is 1 (LWP 877241)]
      (gdb) bt
      #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
      #1  __pthread_kill_internal (signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:78
      #2  __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6)at ./nptl/pthread_kill.c:89
      #3  0x000074246a04527e in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
      #4  0x000074246a0288ff in __GI_abort () at ./stdlib/abort.c:79
      #5  0x000074246a02881b in __assert_fail_base (fmt=0x74246a1d1208 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x5c826e9fb53f "file < 0", file=file@entry=0x5c826e9fab58 "/test/mtest/MDEV-31342/13.1_dbg/sql/sql_class.cc", line=line@entry=3525, function=function@entry=0x5c826e9fb548 "virtual select_to_file::~select_to_file()") at ./assert/assert.c:96
      #6  0x000074246a03b517 in __assert_fail (assertion=0x5c826e9fb53f "file < 0", file=0x5c826e9fab58 "/test/mtest/MDEV-31342/13.1_dbg/sql/sql_class.cc", line=3525, function=0x5c826e9fb548 "virtual select_to_file::~select_to_file()")at ./assert/assert.c:105
      #7  0x00005c826d7fec5a in select_to_file::~select_to_file (this=0x6c233001ac10)at /test/mtest/MDEV-31342/13.1_dbg/sql/sql_class.cc:3525
      #8  0x00005c826d7fece0 in select_export::~select_export (this=0x6c233001ac10)at /test/mtest/MDEV-31342/13.1_dbg/sql/sql_class.cc:3536
      #9  0x00005c826d7fed49 in select_export::~select_export (this=0x6c233001ac10)at /test/mtest/MDEV-31342/13.1_dbg/sql/sql_class.cc:3534
      #10 0x00005c826d802914 in THD::end_statement (this=0x6c2330000d60)at /test/mtest/MDEV-31342/13.1_dbg/sql/sql_class.cc:4475
      #11 0x00005c826d89b967 in mysql_parse (thd=0x6c2330000d60, rawbuf=0x6c233001a430 "SELECT TABLE_NAME INTO OUTFILE 'foo.txt' FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'", length=97, parser_state=0x742468197a80)at /test/mtest/MDEV-31342/13.1_dbg/sql/sql_parse.cc:7980
      #12 0x00005c826d898b3d in dispatch_command (command=COM_QUERY, thd=0x6c2330000d60, packet=0x6c233000b661 "", packet_length=97, blocking=true) at /test/mtest/MDEV-31342/13.1_dbg/sql/sql_parse.cc:1903
      #13 0x00005c826d89c3c3 in do_command (thd=0x6c2330000d60, blocking=true)at /test/mtest/MDEV-31342/13.1_dbg/sql/sql_parse.cc:1437
      #14 0x00005c826da9d5a9 in do_handle_one_connection (connect=0x5c82a47b7360, put_in_cache=true)at /test/mtest/MDEV-31342/13.1_dbg/sql/sql_connect.cc:1510
      #15 0x00005c826da9d34e in handle_one_connection (arg=0x5c82a485aee0)at /test/mtest/MDEV-31342/13.1_dbg/sql/sql_connect.cc:1422
      #16 0x000074246a09cb84 in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:447
      #17 0x000074246a129ecc in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
      

      Attachments

        Issue Links

          Activity

            People

              janlindstrom Jan Lindström
              ramesh Ramesh Sivaraman
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - 0d
                  0d
                  Remaining:
                  Remaining Estimate - 0d
                  0d
                  Logged:
                  Time Spent - 0.5h
                  0.5h

                  Git Integration

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