Last modified: 2014-11-04 23:14:43 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T35638, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 33638 - Math table doesn't have a PK
Math table doesn't have a PK
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
Math (Other open bugs)
unspecified
All All
: Normal minor (vote)
: ---
Assigned To: physikerwelt
: easy
Depends on:
Blocks: 15441 71975
  Show dependency treegraph
 
Reported: 2012-01-10 12:39 UTC by Sam Reed (reedy)
Modified: 2014-11-04 23:14 UTC (History)
7 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Sam Reed (reedy) 2012-01-10 12:39:46 UTC
Might want to be tidied up, see bug 15441
Comment 1 Sam Reed (reedy) 2012-01-10 14:34:56 UTC
But it has a unique index on math_inputhash

So effectively works the same...

RESOLVED WFM?
Comment 2 Tim Landscheidt 2012-01-10 16:38:53 UTC
I think having an explicit primary key on a table has merits for someone working directly on the database without having to look at the code.

  Hmmm.  Glancing at includes/installer/DatabaseUpdater.php & Co., is there really no option to "promote" an index?  Dropping and creating would certainly work, but would generate unnecessary load.
Comment 3 Sam Reed (reedy) 2012-01-10 16:39:53 UTC
(In reply to comment #2)
> I think having an explicit primary key on a table has merits for someone
> working directly on the database without having to look at the code.
> 
>   Hmmm.  Glancing at includes/installer/DatabaseUpdater.php & Co., is there
> really no option to "promote" an index?  Dropping and creating would certainly
> work, but would generate unnecessary load.

Does MySQL etc have the support to do that?

ALTER TABLE MODIFY INDEX or something?
Comment 4 Sam Reed (reedy) 2012-01-10 16:49:40 UTC
(In reply to comment #2)
> I think having an explicit primary key on a table has merits for someone
> working directly on the database without having to look at the code.
> 
>   Hmmm.  Glancing at includes/installer/DatabaseUpdater.php & Co., is there
> really no option to "promote" an index?  Dropping and creating would certainly
> work, but would generate unnecessary load.

And if we decide (and find a "cheap" way) on a way, there are numerous others that should probably be updated similarly see bug 15441
Comment 5 Vishnu Nk 2014-01-02 13:41:10 UTC
DatabaseUpdater.php
This file is not sufficient I think.There has to be some other way.
Can anyone help me for fixing this?
Comment 6 Sam Reed (reedy) 2014-01-02 15:13:08 UTC
(In reply to comment #5)
> DatabaseUpdater.php
> This file is not sufficient I think.There has to be some other way.
> Can anyone help me for fixing this?

What? That's how you need to do it; this is pretty simple to fix.

Math already has a database update hook in place:
$wgHooks['LoadExtensionSchemaUpdates'][] = 'MathHooks::onLoadExtensionSchemaUpdates';

So then you only need to create a .sql file with the addition of the primary key, add it to git, and in the same revision edit Math.hooks.php and add a line to make the new sql file be processed to add the new column.

Then also update the other base sql files to add the new column when creating the table initially
Comment 7 physikerwelt 2014-11-02 23:03:18 UTC
Fixed in https://gerrit.wikimedia.org/r/#/c/134326/
I don't think that we need to update exisiting Math tables

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links