Opened 5 months ago

Closed 7 days ago

Last modified 7 days ago

#23066 closed defect (bug) (invalid)

WordPress 3.5 Duplicate Entry

Reported by: chriscct7 Owned by:
Priority: normal Milestone:
Component: Unit Tests Version: 3.5
Severity: normal Keywords: has-patch
Cc: chriscct7@…, pippin@…, ratilal.sunny@…

Description

WordPress 3.5 MU when running PHP 5.2.17/5.3.x/5.4.x seems to have some duplicate install code.
Detected by Travis-CI.

Example build where error is present:
https://travis-ci.org/chriscct7/Easy-Digital-Downloads/jobs/3855494
3/4 of the way down you'll find the following:

Installing network…
Installing sites…
WordPress database error Duplicate entry '1' for key 'PRIMARY' for query INSERT INTO `wp_terms` (`term_id`,`name`,`slug`,`term_group`) VALUES (1,'Uncategorized','uncategorized',0) made by wp_install, wp_install_defaults
WordPress database error Duplicate entry '1-category' for key 'term_id_taxonomy' for query INSERT INTO `wp_term_taxonomy` (`term_id`,`taxonomy`,`description`,`parent`,`count`) VALUES (1,'category','',0,1) made by wp_install, wp_install_defaults

Attachments (9)

3400b823567ecd4cdefdf59866bb245a8fc3121b.patch.txt (3.0 KB) - added by chriscct7 6 weeks ago.
First .patch
3400b823567ecd4cdefdf59866bb245a8fc3121b.diff.2.txt (2.7 KB) - added by chriscct7 6 weeks ago.
First .diff
patch2.diff.txt (652 bytes) - added by sunnyratilal 6 weeks ago.
Add a check if multisite was called or not
second_try.patch (3.7 KB) - added by chriscct7 6 weeks ago.
Second Try
second_try.diff (2.8 KB) - added by chriscct7 6 weeks ago.
Second Try Diff
third_try.diff (349 bytes) - added by chriscct7 6 weeks ago.
Third Try Diff
third_try.patch (1.3 KB) - added by chriscct7 6 weeks ago.
Third Try Patch
fourth_try.diff (2.8 KB) - added by chriscct7 6 weeks ago.
Fourth Try Diff
fourth_try.patch (4.4 KB) - added by chriscct7 6 weeks ago.
Fourth Try Patch

Download all attachments as: .zip

Change History (28)

  • Cc chriscct7@… added
  • Cc pippin@… added
  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

The problem here seems to be that a multisite switch is not occurring before the test suite installs additional sites. But, for this and other reasons, the test suite no longer installs any sites beyond the first one.

I've seen this happen as well after upgrading to 3.5, though I don't recall if the error was exactly the same.

  • Cc ratilal.sunny@… added
  • Resolution invalid deleted
  • Status changed from closed to reopened

I've fixed this bug: on MS install, the Unit Tests were calling the install script twice. I've amended the script and you can find it my repo: https://github.com/sunnyratilal/WordPress-Tests

  • Keywords dev-feedback added
  • Component changed from Upgrade/Install to Unit Tests
  • Keywords has-patch added

comment:8 follow-up: ↓ 17   chriscct76 weeks ago

@nacin Still working on figuring out how to get the .patch and .diff files, but in the meantime, the commit is: https://github.com/sunnyratilal/WordPress-Tests/commit/3400b823567ecd4cdefdf59866bb245a8fc3121b

  • Milestone set to Awaiting Review

comment:10 follow-up: ↓ 13   chriscct76 weeks ago

Okay they are up. FYI not sure if a Trac limitation but raw .diff/.patch files are locking up the Trac server so I postfixed the files with .txt

If I seeing ti wrong. Aren't you now always set it as a multisite installation?

Oh yeah, whoops, will get that fixed up. Thanks.

Add a check if multisite was called or not

comment:13 in reply to: ↑ 10 ; follow-up: ↓ 14   SergeyBiryukov6 weeks ago

Replying to chriscct7:

FYI not sure if a Trac limitation but raw .diff/.patch files are locking up the Trac server so I postfixed the files with .txt

Generally, patches should be uploaded with .diff or .patch extension for proper highlighting.

See also http://scribu.net/wordpress/svn-patches-from-git.html.

comment:14 in reply to: ↑ 13 ; follow-up: ↓ 16   chriscct76 weeks ago

Replying to SergeyBiryukov:

Yeah I did try that, but Trac literally locked the Database for 30 seconds every time I did that.

Replying to chriscct7:

FYI not sure if a Trac limitation but raw .diff/.patch files are locking up the Trac server so I postfixed the files with .txt

Generally, patches should be uploaded with .diff or .patch extension for proper highlighting.

See also http://scribu.net/wordpress/svn-patches-from-git.html.

Second Try

Second Try Diff

Third Try Diff

Third Try Patch

Fourth Try Diff

Fourth Try Patch

Ok someone should check me on this. Merged the diff from 3 commits by using a starter and ender tag. Made patch/diff by using git bash:

Diff:

$ git diff Starter Ender -- > fourth_try.diff

Patch:

$ git checkout Ender

$ git format-patch Starter --stdout > fourth_try.patch

Starter is commit:
https://github.com/chriscct7/WordPress-Tests/commit/3400b823567ecd4cdefdf59866bb245a8fc3121b

Ender is commit:
https://github.com/chriscct7/WordPress-Tests/commit/f4e566e388e0b218dc1abf1cdd1de48370816967

comment:16 in reply to: ↑ 14   SergeyBiryukov6 weeks ago

Replying to chriscct7:

Yeah I did try that, but Trac literally locked the Database for 30 seconds every time I did that.

Probably unrelated. I just got "OperationalError: database is locked" when submitting a comment.

fourth_try.diff looks proper, however still doesn't apply. Your copy of the repo appears to be out of date. bin/install.php was moved to includes/install.php in [1100/tests], and there are other changes in the file as well.

comment:17 in reply to: ↑ 8   rmccue6 weeks ago

Replying to chriscct7:

@nacin Still working on figuring out how to get the .patch and .diff files, but in the meantime, the commit is: https://github.com/sunnyratilal/WordPress-Tests/commit/3400b823567ecd4cdefdf59866bb245a8fc3121b

Just FYI, you can append .diff to the URL to get a diff for it. The only thing that then needs to be changed is to remove a/ and b/ from each path.

  • Resolution set to invalid
  • Status changed from reopened to closed
  • Keywords dev-feedback removed
  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.