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

Table function: DROP FUNCTION doesn't work as expected

    XMLWordPrintable

Details

    Description

      This task is a part of dj 's GSoC project.

      Consider this testcase:
      First, let's create a table function:

      MariaDB [test]> delimiter |
      MariaDB [test]> CREATE FUNCTION f21(param1 VARCHAR(11))
          -> RETURNS TABLE return_table(name VARCHAR(11)) 
          -> deterministic
          -> BEGIN
          -> insert into return_table values('foo');
          -> END|
      Query OK, 0 rows affected (0.01 sec)
      MariaDB [test]> DELIMITER ;

      Then use it:

      MariaDB [test]> select name from f21('aaa');
      +------+
      | name |
      +------+
      | foo  |
      +------+
      1 row in set (0.45 sec)

      Then drop it:

      MariaDB [test]> drop function f21;
      Query OK, 0 rows affected (0.04 sec)

      And then try using it again:

      MariaDB [test]> select name from f21('aaa');
      +------+
      | name |
      +------+
      | foo  |
      +------+
      1 row in set (0.26 sec)

      Oops. Why is the function still here?

      Btw, if I restart the server, I get:

      MariaDB [test]> select name from f21('aaa');
      ERROR 1146 (42S02): Table 'test.f21' doesn't exist

      Apparently the stored function is sitting in some in-memory cache.

      Attachments

        Issue Links

          Activity

            People

              psergei Sergei Petrunia
              psergei Sergei Petrunia
              Votes:
              0 Vote for this issue
              Watchers:
              1 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.