Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-5491 CREATE OR REPLACE TABLE
  3. MDEV-5601

Strange error on CREATE OR REPLACE .. SELECT under lock

    XMLWordPrintable

    Details

    • Type: Technical task
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: 10.0.8
    • Component/s: None
    • Labels:
      None

      Description

      The following set of commands ends with the error "ERROR 1100 (HY000): Table 't1' was not locked with LOCK TABLES" which is untrue and hence confusing:

      MariaDB [test]> create table t1 (i int);
      Query OK, 0 rows affected (0.68 sec)
       
      MariaDB [test]> lock table t1 write;
      Query OK, 0 rows affected (0.00 sec)
       
      MariaDB [test]> create or replace table t1 as select * from t1;
      ERROR 1100 (HY000): Table 't1' was not locked with LOCK TABLES

      Test case:

      drop table if exists t1;
      create table t1 (i int);
      lock table t1 write;
      create or replace table t1 as select * from t1;

      revision-id: monty@askmonty.org-20140202093802-a6jtuy6ni29biigz
      revno: 3968
      branch-nick: mariadb-monty

        Attachments

          Activity

            People

            • Assignee:
              monty Michael Widenius
              Reporter:
              elenst Elena Stepanova
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: