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

Running mysqldump backup twice returns error: Table 'mysql.proc' doesn't exist

    XMLWordPrintable

Details

    • 10.0.28

    Description

      Before doing anything, I recreated a fresh datadir with the following commands:

      sudo systemctl stop mariadb
      sudo rm -fr /var/lib/mysql/*
      sudo mysql_install_db --user=mysql
      sudo systemctl start mariadb
      

      And then I took a backup with the following command:

      mysqldump -u root --all-databases --events --routines --triggers --add-drop-database --single-transaction > /tmp/backupTest.sql
      

      And now watch what happens if I try to load this backup twice:

      $ mysql -u root --execute="show tables;" mysql
      +---------------------------+
      | Tables_in_mysql           |
      +---------------------------+
      | column_stats              |
      | columns_priv              |
      | db                        |
      | event                     |
      | func                      |
      | general_log               |
      | gtid_slave_pos            |
      | help_category             |
      | help_keyword              |
      | help_relation             |
      | help_topic                |
      | host                      |
      | index_stats               |
      | innodb_index_stats        |
      | innodb_table_stats        |
      | plugin                    |
      | proc                      |
      | procs_priv                |
      | proxies_priv              |
      | roles_mapping             |
      | servers                   |
      | slow_log                  |
      | table_stats               |
      | tables_priv               |
      | time_zone                 |
      | time_zone_leap_second     |
      | time_zone_name            |
      | time_zone_transition      |
      | time_zone_transition_type |
      | user                      |
      +---------------------------+
      $ mysql -u root < /tmp/backupTest.sql
      $ mysql -u root --execute="show tables;" mysql
      +---------------------------+
      | Tables_in_mysql           |
      +---------------------------+
      | column_stats              |
      | columns_priv              |
      | db                        |
      | event                     |
      | func                      |
      | general_log               |
      | gtid_slave_pos            |
      | help_category             |
      | help_keyword              |
      | help_relation             |
      | help_topic                |
      | host                      |
      | index_stats               |
      | innodb_index_stats        |
      | innodb_table_stats        |
      | plugin                    |
      | proc                      |
      | procs_priv                |
      | proxies_priv              |
      | roles_mapping             |
      | servers                   |
      | slow_log                  |
      | table_stats               |
      | tables_priv               |
      | time_zone                 |
      | time_zone_leap_second     |
      | time_zone_name            |
      | time_zone_transition      |
      | time_zone_transition_type |
      | user                      |
      +---------------------------+
      $ mysql -u root < /tmp/backupTest.sql
      ERROR 1146 (42S02) at line 22: Table 'mysql.proc' doesn't exist
      $ mysql -u root --execute="show tables;" mysql
      

      The error message above says that the error occurs at line 22. The statement at this line is:

      $ sed -n '22p' /tmp/backupTest.sql
      /*!40000 DROP DATABASE IF EXISTS `mysql`*/;
      

      Why does the MariaDB think the mysql.proc table doesn't exist at this point?

      Why does the backup work the first time, but not the second time?

      The backup works when I run it a third time.

      $ mysql -u root < /tmp/backupTest.sql
      $ mysql -u root < /tmp/backupTest.sql
      ERROR 1146 (42S02) at line 22: Table 'mysql.proc' doesn't exist
      $ mysql -u root < /tmp/backupTest.sql
      

      Attachments

        Issue Links

          Activity

            People

              holyfoot Alexey Botchkov
              GeoffMontee Geoff Montee (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              5 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.