Details

    • Q2/2025 Development

    Description

      GLOBAL TEMPORARY TABLE is a feature found in Oracle, MSSQL, PostgreSQL etc.

      Syntax in Oracle:

      CREATE GLOBAL TEMPORARY TABLE tmp_table
      { (create_definition, ...)
        | [SELECT * FROM tbl_NAME WHERE conditions ] }
      ON COMMIT [DELETE | PRESERVE] ROWS
      

      The purpose of this syntax is to create temporary table where each user can have
      their own data, which is destroyed at the end of the session.
      Any user with access right to this table can access and use it.

      One suggested way to implement this in MariaDB is to have "CREATE GLOBAL TEMPORARY t1" create a 'template' for future temporary tables with name t1.
      Internally in MariaDB we would only create a .frm file for the table.
      On first access to the table, MariaDB would internally execute
      "CREATE TEMPORARY TABLE t1 LIKE t1" on the engine used when "CREATE GLOBAL ..." was created. Any future usage of t1 would use the temporary table t1.
      "DROP TABLE t1" would drop the internal temporary table.
      To drop the global one, one would have to use "DROP GLOBAL TEMPORARY TABLE".

      Before starting implementing this, please check with SQL Standard, Oracle, MSSQL and PostgreSQL that the above implementation would work as GLOBAL TEMPORARY tables are expected to work

      Attachments

        Issue Links

          Activity

            People

              nikitamalyavin Nikita Malyavin
              monty Michael Widenius
              Votes:
              0 Vote for this issue
              Watchers:
              10 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.