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

LP:987165 - Problem LOCK/FLUSH : Table was locked with a READ lock and can't be updated

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Resolution: Not a Bug
    • None
    • None
    • None

    Description

      I have a problem with LOCK/FLUSH.

      I have a script in python to make backup for some tables. This script works follow :

      1.- USE name_of_db;
      2.- LOCK TABLES table_name READ;
      3.- FLUSH TABLES table_name ;
      4.- And I copy files for this table (index and data) in a backup folder.
      5.- UNLOCK TABLES;

      Whith MariaDB 5.2 works fine but in MariaDB 5.5 don't works. After FLUSH TABLES table_name I have this error :

      ERROR 1099 (HY000): Table 'table_name' was locked with a READ lock and can't be updated

      Check this example :

      ~$ mysql -u root
      Welcome to the MariaDB monitor. Commands end with ; or \g.
      Your MariaDB connection id is 235
      Server version: 5.5.23-MariaDB-mariadb1~squeeze mariadb.org binary distribution

      This software comes with ABSOLUTELY NO WARRANTY. This is free software,
      and you are welcome to modify and redistribute it under the GPL v2 license

      Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

      MariaDB [(none)]> USE test ;
      Reading table information for completion of table and column names
      You can turn off this feature to get a quicker startup with -A

      Database changed
      MariaDB [test]> LOCK TABLES testblob READ ;
      Query OK, 0 rows affected (0.00 sec)

      MariaDB [test]> FLUSH TABLES testblob ;
      ERROR 1099 (HY000): Table 'testblob' was locked with a READ lock and can't be updated
      MariaDB [test]> UNLOCK TABLES ;
      Query OK, 0 rows affected (0.00 sec)

      MariaDB [test]> Bye

      ~$ dpkg -l | grep mariadb-server
      ii mariadb-server-5.5 5.5.23-mariadb1~squeeze MariaDB database server binaries
      ii mariadb-server-core-5.5 5.5.23-mariadb1~squeeze MariaDB database core server files

      ~$ uname -a
      Linux servername1 2.6.32-5-686-bigmem #1 SMP Mon Mar 26 06:12:49 UTC 2012 i686 GNU/Linux

      ~$lsb_release -a

      No LSB modules are available.
      Distributor ID: Debian
      Description: Debian GNU/Linux 6.0.4 (squeeze)
      Release: 6.0.4
      Codename: squeeze

      How can I do to make my backup?

      Thank you

      Attachments

        Activity

          People

            Unassigned Unassigned
            del del (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 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.