#11464 closed defect (bug) (fixed)
MySQL 4.1.2 and automatic update...
Reported by: | nickbohle | Owned by: | |
---|---|---|---|
Milestone: | 2.9 | Priority: | high |
Severity: | blocker | Version: | 2.9 |
Component: | Upgrade/Install | Keywords: | has-patch needs-testing |
Focuses: | Cc: |
Description
Dear all,
I've just tried to update to WP 2.9 RC1 via the beta tester plug-in and the automatic update.
Everything worked like a charm (files downloaded, installled, etc.), until I had to upgrade my database.
Until?
// Make sure the server has MySQL 4.1.2 1054 if ( version_compare($this->db_version(), '4.1.2', '<') ) 1055 return new WP_Error('database_version',sprintf(__('<strong>ERROR</strong>: WordPress %s requires MySQL 4.1.2 or higher'), $wp_version));
I know! By using the beta tester plugin, I totally forgot about the database requirements. My fault. And I fixed by downgrading...
But what is the reaction of the average WP user when he updates WP to 2.9 via the automatic update, he starts the database update and then, his database upgrade will not work due to an old mysql version. Result: he will be stuck with no connection to the back-end.
So, my question:
Why is there no MySQL (and PHP) version check BEFORE the automatic updates starts. A warning about an outdated mysql verion would be more useful BEFORE I try to install WP 2.9
Attachments (10)
Change History (52)
#3
@
15 years ago
westi beat me to create the patch -- haven't tested, but I'm pretty certain that it'll work indeed.
#5
in reply to:
↑ 4
@
15 years ago
Replying to Denis-de-Bernardy:
while we're at it, we might as well check the php version too.
You mean like the patch does ;-)
#6
@
15 years ago
- Priority changed from normal to high
- Severity changed from normal to blocker
- Type changed from enhancement to defect (bug)
Updating the priority/severity on this - I think we should resolve this prior to release.
#7
@
15 years ago
Patch looks good. Just a few minor corrections to the text:
"The update cannot be installed because you do not have the correct PHP (4.3 or newer) and MySQL versions (4.1.2 or newer)"
#8
@
15 years ago
Thank you guys for the fast response!
I would suggest to split the testing for the correct PHP / MySQL version:
Test PHP --> if not okay:
"The update cannot be installed because you do not have the correct PHP version (4.3 or newer)"
if okay --> proceed
Test MySQL --> if not okay:
"The update cannot be installed because you do not have the correct MySQL version (4.1.2 or newer)"
if okay ---> proceed
This would point the user into the right direction.
And don't forget localization.
#9
@
15 years ago
Replying to westi:
Replying to Denis-de-Bernardy:
while we're at it, we might as well check the php version too.
You mean like the patch does ;-)
Exactly. I had stopped reading it upon seeing update-core.php was the file getting patched. :-)
#11
follow-up:
↓ 12
@
15 years ago
There's no need to provide them four version numbers (current and required for both PHP and MySQL). First, since you're checking both at once and throwing an error if either is not sufficient, then it might say "PHP (4.3.1 vs 4.3 or newer)", which is just confusing.
Second, how much of a point in the right direction does a user need? An end-user will be contacting their host anyway, saying they can't run WordPress and this is the error they're getting. A web developer or sys admin will know exactly what needs to be done. I find this similar to upload file size errors -- we don't bother telling them about post_max_size, max_upload_filesize, .htaccess, or php.ini for these reasons.
At the very least, perhaps we can make it more understandable by breaking it up and only displaying what the real error is.
#12
in reply to:
↑ 11
@
15 years ago
Replying to nacin:
At the very least, perhaps we can make it more understandable by breaking it up and only displaying what the real error is.
I second this. Let's just say:
Test PHP --> if not okay:
"The update cannot be installed because your web host is running an outdated PHP version"
if okay --> proceed
Test MySQL --> if not okay:
"The update cannot be installed because your web host is running an outdated MySQL version"
if okay ---> proceed
Regards,
Nick
#13
@
15 years ago
What you don't want is to test PHP, and find that PHP is too low, so they contact their host, then they come back, and find that their MySQL is too low.
#14
@
15 years ago
Splitting the test in two parts and showing the right error message(s) makes sense. Perhaps we should show both results when there's an error:
PHP version 4.3 or newer: PASS MySQL version 4.1.2 or newer: FAIL
#15
follow-up:
↓ 16
@
15 years ago
Patch attached that incorporates I think everyone's ideas here. Untested.
#16
in reply to:
↑ 15
@
15 years ago
Replying to nacin:
Patch attached that incorporates I think everyone's ideas here. Untested.
You are running version %2$s will return an insufficient number of arguments from sprintf. It should be %s instead.
#17
@
15 years ago
Artifact from when I had $wp_version in there. Then I realized that would only return the current version, so I stripped it. Forgot to update that part, obviously.
Patch replaced.
#19
@
15 years ago
- Keywords has-patch needs-testing added; MySQL version update removed
Many patches here, though we need testing.
I just added patch 8 which cleans up patch 7 a bit.
#23
@
15 years ago
Severe typo here:
$mysql_version = $wpdb->db_version;
needs to be
$mysql_version = $wpdb->db_version();
Just ran into it, when trying to update to latest nightly build as announced by ryan.
#26
@
15 years ago
Updating nightlies. Wait a few minutes and try again.
A good way to force the DB check for testing is to edit your wp-db.php and hack db_version() to return '4.1.0'.
#29
@
15 years ago
- Resolution set to fixed
- Status changed from new to closed
Thanks everyone. Resolving as fixed.
#30
@
15 years ago
- Resolution fixed deleted
- Status changed from closed to reopened
westi brought up an issue with translations. Since the strings will only be in the catalog for the new version of WP, these won't translate. We could do hard translations here, or we could live with it for now knowing that once 2.9 is out future upgrades will have the translations. To future proof those translations, we'd have to move the required versions out of the strings and sprintf them in.
#33
@
15 years ago
- Resolution set to fixed
- Status changed from reopened to closed
I guess we can reopen if there are further issues. Looks good.
#34
follow-up:
↓ 35
@
15 years ago
could r12343 potentially update the wp_db_version option in weird circumstances?
#35
in reply to:
↑ 34
;
follow-up:
↓ 36
@
15 years ago
Replying to Denis-de-Bernardy:
could r12343 potentially update the wp_db_version option in weird circumstances?
It's not including version.php in global scope. Is that what you mean?
#36
in reply to:
↑ 35
@
15 years ago
Replying to nacin:
Replying to Denis-de-Bernardy:
could r12343 potentially update the wp_db_version option in weird circumstances?
It's not including version.php in global scope. Is that what you mean?
Pretty much so, yes. Phrased like that, it makes much more sense, and my worries were unjustified. :-)
#37
@
15 years ago
- Resolution fixed deleted
- Status changed from closed to reopened
The include of version.php is not working on some of my testbeds. It gets the wrong path. I think to include something we have to copy it into place first.
#39
@
15 years ago
- Resolution set to fixed
- Status changed from reopened to closed
[12451] for 2.9.
I hard-coded the versions in update-core.php and removed the version.php include. We can fix it more elegantly in 3.0.
#40
@
15 years ago
I forgot to capture the error, but the include was missing the beginning of the path. It was relative to the web root instead of ABSPATH. WP_Filesystem::exists() has ways of determining the root for $from that a straight include doesn't have. To include version.php we'll probably have to copy it into place first, like we do with update-core.php. We can consider that for 3.0.
#42
@
15 years ago
t was relative to the web root instead of ABSPATH. WP_Filesystem::exists() has ways of determining the root for $from that a straight include doesn't have.
$from was a absolute directory, on the FTP Server. On Windows & PHP-Su environments, it would've been absolute to the filesystems root coindicentally.
Ie. If the FTP root is /home/dd32/ then the $from in that case is /public_html/dd32.id.au/wordpress/.....
I'm not sure there is something easy we can do here.
We could put a check into
wp-admin/includes/update-core.php
as that get copied across and does the core of the work but that check would need to be ignorable in the case that the user is using a replacement db class which has different requirements.I'm going to throw up a patch which adds a check and see what people think.