https://bugzilla.wikimedia.org/show_bug.cgi?id=15441

--- Comment #11 from Sam Reed (reedy) <[email protected]> 2012-01-13 17:02:36 
UTC ---
(In reply to comment #10)
> 
> This is an according example output:
> ALTER TABLE `x` 
> ADD PRIMARY KEY (`field`), 
> DROP INDEX `field`;

On that note, someone was going to log a bug about that.

When we do them as individual statements (ie alter table drop, then alter table
add), we actually are creating more overhead as mysql rebuilds the table twice.

It's done for SQLite comparability, but the "overhead" of having a file each is
probably worth it

(In reply to comment #8)
> (In reply to comment #5)
> > Obviously fixing the ones with no PK or unique key is more easily done
> 
> ISTM that you are a little bit optimistic here. If the data do not really
> comply to a key (say there is a bug in the application which did not respect 
> an
> implicit key, and the key was not checked by the database because the
> constraint was not declared), then the addition of the constraint will fail.

The generic fallback is then to just add a PK of an int per row, which MySQL
has already done internally anyway (or something along those lines)

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to