WordPress.org

Make WordPress Core

Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#4958 closed defect (bug) (invalid)

MySQL error on upgrade

Reported by: Viper007Bond Owned by:
Milestone: Priority: high
Severity: normal Version: 2.3
Component: General Keywords:
Focuses: Cc:

Description

Updated from an SVN of a day or two ago to the very latest as of this post and the following error was outputted on the "all done" page.

WordPress database error: [Multiple primary key defined]
ALTER TABLE wp_term_relationships ADD PRIMARY KEY (object_id,term_taxonomy_id)

Attachments (3)

dump_indices.diff (627 bytes) - added by ryan 14 years ago.
Patch to add debug dump of indices
error.log (5.3 KB) - added by Viper007Bond 14 years ago.
Error log dump
index.log (5.6 KB) - added by ryan 14 years ago.

Download all attachments as: .zip

Change History (17)

#1 @Viper007Bond
14 years ago

  • Cc wptrac@… added

#2 @ryan
14 years ago

  • Priority changed from normal to high

#3 @ryan
14 years ago

I can't make it happen, but I've heard other reports. dbDelta is very picky about how things are formatted in the schema. Whitespace can knock it off.

#4 follow-up: @darkfate
14 years ago

  • Resolution set to worksforme
  • Status changed from new to closed

I never got this error, but if it's still happening, can you create separate queries for different versions of MySQL? It might just mean the difference between strict or not.

#5 @Nazgul
14 years ago

  • Milestone 2.3 deleted

#6 in reply to: ↑ 4 ; follow-up: @Viper007Bond
14 years ago

Replying to darkfate:

It might just mean the difference between strict or not.

I don't think I'm running strict. It's just a stock XAMPP install.

#7 in reply to: ↑ 6 @darkfate
14 years ago

Replying to Viper007Bond:

Replying to darkfate:

It might just mean the difference between strict or not.

I don't think I'm running strict. It's just a stock XAMPP install.

Well I believe MySQL 5.x is by default in strict mode. You're only suppose to have one primary key though. You could have object_id has the primary key and have term_taxonomy_id set as index 1.

@ryan
14 years ago

Patch to add debug dump of indices

#8 @ryan
14 years ago

Try applying that patch and forcing an upgrade by subtracting one from the db_version number via options.php or phpmyadmin. Let's see how those index strings are being constructed.

#9 @ryan
14 years ago

  • Resolution worksforme deleted
  • Status changed from closed to reopened

I'll reopen for now.

@Viper007Bond
14 years ago

Error log dump

#10 @Viper007Bond
14 years ago

Done and I got the MySQL error again while doing it.

@ryan
14 years ago

#11 @ryan
14 years ago

I attached my log. The difference seems to be in the term_relationships primary key. I have PRIMARY KEY (object_id,term_taxonomy_id). You have PRIMARY KEY (object_id). I think your term_relationships table was created prior to [5515]. Try altering your key.

#12 @Nazgul
14 years ago

  • Milestone set to 2.3

#13 @ryan
14 years ago

  • Resolution set to invalid
  • Status changed from reopened to closed

Resolving as invalid since this is due to an old schema set down by an alpha version of 2.3.

#14 @Nazgul
14 years ago

  • Milestone 2.3 deleted
Note: See TracTickets for help on using tickets.