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

Assertion `error == ER_FOREIGN_SERVER_EXISTS' failed on CREATE OR REPLACE SERVER

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 12.2, 12.3, 11.8
    • 12.2, 11.8
    • None

    Description

      CREATE SERVER srv FOREIGN DATA WRAPPER mysql OPTIONS (SOCKET '0',DATABASE '0',USER '0',PASSWORD'');
      DROP DATABASE mysql;
      CREATE OR REPLACE SERVER srv FOREIGN DATA WRAPPER foo OPTIONS (HOST '0',PORT '0');
      

      Leads to:

      CS 12.2.0 fd15fd2765b53d0c070dd01d86fb231024b8f284 (Debug, Clang 21.1.3-20250923) Build 10/11/2025

      mariadbd: /test/12.2_dbg/sql/sql_servers.cc:1253: int create_server(THD *, LEX_SERVER_OPTIONS *): Assertion `error == ER_FOREIGN_SERVER_EXISTS' failed.
      

      CS 12.2.0 fd15fd2765b53d0c070dd01d86fb231024b8f284 (Debug, Clang 21.1.3-20250923) Build 10/11/2025

      Core was generated by `/test/MD101125-mariadb-12.2.0-linux-x86_64-dbg/bin/mariadbd --no-defaults --max'.
      Program terminated with signal SIGABRT, Aborted.
      Download failed: Invalid argument.  Continuing without source file ./nptl/./nptl/pthread_kill.c.
      #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
       
      [Current thread is 1 (LWP 3630441)]
      (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  0x00007b69e364526e in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
      #4  0x00007b69e36288ff in __GI_abort () at ./stdlib/abort.c:79
      #5  0x00007b69e362881b in __assert_fail_base (fmt=0x7b69e37d01e8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x58393eb67569 "error == ER_FOREIGN_SERVER_EXISTS", file=file@entry=0x58393ebf5d75 "/test/12.2_dbg/sql/sql_servers.cc", line=line@entry=1253, function=function@entry=0x58393ec82ab8 "int create_server(THD *, LEX_SERVER_OPTIONS *)") at ./assert/assert.c:94
      #6  0x00007b69e363b507 in __assert_fail (assertion=0x58393eb67569 "error == ER_FOREIGN_SERVER_EXISTS", file=0x58393ebf5d75 "/test/12.2_dbg/sql/sql_servers.cc", line=1253, function=0x58393ec82ab8 "int create_server(THD *, LEX_SERVER_OPTIONS *)")at ./assert/assert.c:103
      #7  0x000058393fad7716 in create_server (thd=0x7b6914000d58, server_options=0x7b6914006918) at /test/12.2_dbg/sql/sql_servers.cc:1253
      #8  0x000058393f8f8616 in mysql_execute_command (thd=0x7b6914000d58, is_called_from_prepared_stmt=false) at /test/12.2_dbg/sql/sql_parse.cc:5790
      #9  0x000058393f8e9cf8 in mysql_parse (thd=0x7b6914000d58, rawbuf=0x7b6914019ee0 "CREATE OR REPLACE SERVER srv FOREIGN DATA WRAPPER foo OPTIONS (HOST '0',PORT '0')", length=81, parser_state=0x7b69b37fda00)at /test/12.2_dbg/sql/sql_parse.cc:7888
      #10 0x000058393f8e74d9 in dispatch_command (command=COM_QUERY, thd=0x7b6914000d58, packet=0x7b691400b239 "CREATE OR REPLACE SERVER srv FOREIGN DATA WRAPPER foo OPTIONS (HOST '0',PORT '0')", packet_length=81, blocking=true)at /test/12.2_dbg/sql/sql_parse.cc:1878
      #11 0x000058393f8ea77a in do_command (thd=0x7b6914000d58, blocking=true)at /test/12.2_dbg/sql/sql_parse.cc:1417
      #12 0x000058393faddafe in do_handle_one_connection (connect=0x583943355088, put_in_cache=true) at /test/12.2_dbg/sql/sql_connect.cc:1503
      #13 0x000058393fadd8e1 in handle_one_connection (arg=0x583943294868)at /test/12.2_dbg/sql/sql_connect.cc:1415
      #14 0x00007b69e369ca94 in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:447
      #15 0x00007b69e3729c3c in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
      

      Bug Detection Matrix

          Rel    o/d  Build   Commit                                    UniqueID observed             
      CS  10.6   dbg  101125  759e3523e3d832b174cf0a612704da38b2557b40  No bug found                  
      CS  10.6   opt  101125  759e3523e3d832b174cf0a612704da38b2557b40  No bug found                  
      CS  10.11  dbg  101125  536cd151f0370216d9ba4c15f40c7037060972a5  No bug found                  
      CS  10.11  opt  101125  536cd151f0370216d9ba4c15f40c7037060972a5  No bug found                  
      CS  11.4   dbg  101125  a1bb5c94fda453baa99e57e3927eaa7cd3c8bafe  No bug found                  
      CS  11.4   opt  101125  a1bb5c94fda453baa99e57e3927eaa7cd3c8bafe  No bug found                  
      CS  11.8   dbg  101125  e0428264d0095472c015eb58c46be68ca1a320ee  error == ER_FOREIGN_SERVER_EXISTS|SIGABRT|create_server|mysql_execute_command|mysql_parse|dispatch_command
      CS  11.8   opt  101125  e0428264d0095472c015eb58c46be68ca1a320ee  No bug found                  
      CS  12.1   dbg  101125  ba00960fdaee67a4efff6866e31f446bf486a1c2  error == ER_FOREIGN_SERVER_EXISTS|SIGABRT|create_server|mysql_execute_command|mysql_parse|dispatch_command
      CS  12.1   opt  101125  ba00960fdaee67a4efff6866e31f446bf486a1c2  No bug found                  
      CS  12.2   dbg  101125  fd15fd2765b53d0c070dd01d86fb231024b8f284  error == ER_FOREIGN_SERVER_EXISTS|SIGABRT|create_server|mysql_execute_command|mysql_parse|dispatch_command
      CS  12.2   opt  101125  fd15fd2765b53d0c070dd01d86fb231024b8f284  No bug found                  
      CS  12.3   dbg  091225  e85bc659188be021897e8578aec42becfbb58c27  error == ER_FOREIGN_SERVER_EXISTS|SIGABRT|create_server|mysql_execute_command|mysql_parse|dispatch_command
      CS  12.3   opt  091225  e85bc659188be021897e8578aec42becfbb58c27  No bug found                  
      ES  10.6   dbg  101125  f0d4d34fb0314b03fddb71fb9dbde372744a8c13  No bug found                  
      ES  10.6   opt  101125  f0d4d34fb0314b03fddb71fb9dbde372744a8c13  No bug found                  
      ES  11.4   dbg  101125  b81ec4b57a5ddce88b8e2b2d16b64625ffdaa0e6  No bug found                  
      ES  11.4   opt  101125  b81ec4b57a5ddce88b8e2b2d16b64625ffdaa0e6  No bug found                  
      ES  11.8   dbg  101125  db36e8fb3bcdae26dd0acdcb2b52f7f4eb014df6  No bug found                  
      ES  11.8   opt  101125  db36e8fb3bcdae26dd0acdcb2b52f7f4eb014df6  No bug found                  
      MS  5.5    dbg  070123  bac287c315b1792e7ae33f91add6a60292f9bae8  No bug found                  
      MS  5.5    opt  070123  bac287c315b1792e7ae33f91add6a60292f9bae8  No bug found                  
      MS  5.6    dbg  070123  dab95781a1244104d6b87020ac2fc4d190ba2946  No bug found                  
      MS  5.6    opt  070123  dab95781a1244104d6b87020ac2fc4d190ba2946  No bug found                  
      MS  5.7    dbg  070525  f7680e98b6bbe3500399fbad465d08a6b75d7a5c  INNODB_ERROR|Table `mysql`.`innodb_table_stats` not found
      MS  5.7    opt  070525  f7680e98b6bbe3500399fbad465d08a6b75d7a5c  INNODB_ERROR|Table `mysql`.`innodb_table_stats` not found
      MS  8.0    dbg  060224  49ef33f7edadef3ae04665e73d1babd40179a4f1  No bug found                  
      MS  8.0    opt  060224  49ef33f7edadef3ae04665e73d1babd40179a4f1  No bug found                  
      MS  9.1    dbg  211024  61a3a1d8ef15512396b4c2af46e922a19bf2b174  No bug found                  
      MS  9.1    opt  211024  61a3a1d8ef15512396b4c2af46e922a19bf2b174  No bug found                  
      

      When using CREATE SERVER instead of CREATE OR REPLACE SERVER there is no assert:

      CS 12.2.0 fd15fd2765b53d0c070dd01d86fb231024b8f284 (Debug, Clang 21.1.3-20250923) Build 10/11/2025

      12.2.0-dbg>CREATE SERVER srv FOREIGN DATA WRAPPER foo OPTIONS (HOST '0',PORT '0');
      ERROR 1476 (HY000): Cannot create foreign server 'srv' as it already exists
      

      ES 11.8 is not affected.

      Attachments

        Issue Links

          Activity

            People

              serg Sergei Golubchik
              Roel Roel Van de Paar
              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.