Opened 9 years ago
Closed 4 months ago
#40418 closed defect (bug) (fixed)
ID columns in multisite database tables should be unsigned
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 6.9 | Priority: | normal |
| Severity: | normal | Version: | 3.0 |
| Component: | Upgrade/Install | Keywords: | has-patch needs-refresh commit |
| Focuses: | multisite | Cc: |
Description
See #8751 for ye'olde single-site effort to normalize the respective object ID columns.
All multisite ID columns are bigint(20), but none of them are unsigned which has 2 unintended consequences:
- Negative numbers can be stored as values instead of being set to
0 - Maximum int of
9223372036854775807instead of intended18446744073709551615
Changes are necessary to every multisite database table, as they all touch site or network IDs.
Patch imminent
Attachments (2)
Change History (17)
#1
@
9 years ago
- Component changed from General to Database
- Focuses multisite added
- Keywords 2nd-opinion has-patch needs-testing added
- Severity changed from normal to major
- Version set to 3.0
This ticket was mentioned in Slack in #core-multisite by jjj. View the logs.
9 years ago
#4
@
9 years ago
- Summary changed from ID columns in multisite database tables are all unsigned to ID columns in multisite database tables should be unsigned
#5
@
9 years ago
A few questions came up in Slack about this patch, so I'll answer them as best I can here:
- These
ALTERs will take some time, because indices need to be rebuilt - MySQL will invisibly perform table locks & copies for signature changes
- MySQL will perform string to integer conversions on really large numbers, so places where values would be higher than
PHP_INT_MAXcould be turned into strings in PHP, and MySQL will save them correctly - My research on
signedvsunsignedleads me to believe there is no performance benefit for WordPress with this change, as the range of available index values has not changed (it's only shifted out of negative numbers and into higher ones)
#6
@
9 years ago
If you're curious about how I even discovered this in the first place, wonder over here but maybe come back quickly. :)
#7
@
7 years ago
- Keywords needs-refresh added
- Owner set to flixos90
- Status changed from new to assigned
This ticket needs to merged before 5.0.0 now that blogmeta (#37923) is in core.
The patch needs to refreshed a little before merge. I have assigned to @flixos90 to own, as he merged blog meta. Will to review and support on this.
This ticket was mentioned in Slack in #core-multisite by spacedmonkey. View the logs.
7 years ago
This ticket was mentioned in Slack in #core-multisite by spacedmonkey. View the logs.
7 years ago
This ticket was mentioned in Slack in #core-multisite by flixos90. View the logs.
7 years ago
This ticket was mentioned in Slack in #core-multisite by spacedmonkey. View the logs.
7 years ago
#12
@
4 months ago
- Component changed from Database to Upgrade/Install
- Keywords commit added; 2nd-opinion needs-testing removed
- Milestone changed from Awaiting Review to 6.9
- Owner changed from flixos90 to johnjamesjacoby
- Severity changed from major to normal
Refreshed patch for 6.9, now including the wp_blogmeta table per @spacedmonkey's comment.
Moving this to the 6.9 milestone and adding the commit keyword.
40418.patch
$ms_global_tablesinwp_get_db_schema()with theunsigneddata typesALTERStopre_schema_upgrade()for existing installationsRelated to work from #38203.