WordPress.org

Support

Support » Plugins and Hacks » [Plugin: WP-DB-Backup] Duplicate INSERT commands for auto draft records

[Plugin: WP-DB-Backup] Duplicate INSERT commands for auto draft records

  • Our wp_posts table contains two auto-draft records. In the SQL dump that Wp-Db-Backup produces, two insert commands are generated to include these two records into the restored database:

    INSERT INTO wp_posts VALUES (12146, 1, ‘2011-03-01 06:28:37’, ‘0000-00-00 00:00:00’, ”, ‘自动草稿’, ”, ‘auto-draft’, ‘open’, ‘open’, ”, ”, ”, ”, ‘2011-03-01 06:28:37’, ‘0000-00-00 00:00:00’, ”, 0, ‘http://www.yihanyingcihui.net/?p=12146’, 0, ‘post’, ”, 0);
    INSERT INTO wp_posts VALUES (12147, 1, ‘2011-03-01 19:27:11’, ‘0000-00-00 00:00:00’, ”, ‘Auto Draft’, ”, ‘auto-draft’, ‘open’, ‘open’, ”, ”, ”, ”, ‘2011-03-01 19:27:11’, ‘0000-00-00 00:00:00’, ”, 0, ‘http://www.yihanyingcihui.net/?p=12147’, 0, ‘post’, ”, 0);

    In the SQL dump, at the end of the section to restore data contents to wp_posts, these exact two commands generated again, with the exact same post_id values. Of course, post_id is the primary key for the table, and the second attempt at inserting the same key errors out.

    The solution probably might be to filter out the auto-draft records from getting included into the SQL dump. But then will the problem pop up some other way? If I come up with a solution I’ll try to post it here.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Created a ticket at the WordPress Plugins Repository.

    Plugin Author Austin Matzko

    @filosofo

    Has this happened in more than one backup file? I could imagine something like this might happen if an auto-draft were created while the backup file was being generated, but that would be rare.

    I duplicated the problem today. The same two records have two sets of INSERT statements. The auto-draft records have a post_date of March 1st. (See the INSERT commands above.)

    I spent most of Friday working on this, and thought I had a fix, but it was unsuccessful. It’s one of the strangest problems I’ve seen in a while.

    Plugin Author Austin Matzko

    @filosofo

    It’s the same 2 entries in different backup files? That is strange.

    Any chance you could send me a copy of the backup to

    austin -at- pressedcode -dot- com?

    On its way.

    Maybe I should mention that this WordPress site is not being used as an ordinary blog. We’re using it as tri-lingual dictionary. Dictionary entries are imported into posts, using a custom importer. That doesn’t explain why I’m getting duplicate INSERTs, but maybe that will take away some of the mystery of the auto-draft records.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Plugin: WP-DB-Backup] Duplicate INSERT commands for auto draft records’ is closed to new replies.