An awful lot of the database updates lacked support for the 'mysqli' database type. This was because some of the updates checked for 'mysql' dbtype but not 'mysqli'.
The only thing i did was change lines like this:
if ($GLOBALS['db_type'] == 'mysql') {
to this:
if ($GLOBALS['db_type'] == 'mysql' || $GLOBALS['db_type'] == 'mysqli') {
I made these changes in update.php and in database/updates.inc
I tested this against my own drupal install (for my production site), not just a test site. It successfully got my site from 4.6.5 up to 4.7.4
| Comment | File | Size | Author |
|---|---|---|---|
| improved_mysqli_update_support.patch | 9.11 KB | eddified |
Comments
Comment #1
killes@www.drop.org commentedI believe that all the places where this patch adds mysqli support were from before we actually supported mysqli. Can simebody confirm?
Comment #2
eddified commentedThat does not seem to be the case. I still have my old (4.6.5) drupal install saved away in case I ever need it, and it has includes/database.mysqli.inc in it, and that file has the following data in it in a comment:
2005-12-07 15:41:17 dries
Notice the date on that is in 2005. I installed my 4.6.5 drupal server in January 2006, and i grabbed the latest stable release, which at that time was 4.6.5. Whether mysqli support was "officially" supported or not seems irrelevant since my old install can attest to the fact that it WAS, in fact, supported.
So now the question is whether the updates themselves were supposed to have run against my database. Maybe the updates referred to in my patch really were only meant for old table structures that existed before mysqli support came along. If that is the case, then those updates shouldn't have been needed to run against my db. The fact is, though, that they WERE run against my database by the drupal update.php script, and no errors occurred during them (once my patch was in place)... which seems to indicate that they were in fact needed.
In any case, the code in the patch, (if reviewed and deemed sound), will be useful to have for other users trying to upgrade from 4.6.5, whether mysqli was 'officially' supported at that time or not. If there are any more 4.x or 4.7.x releases, I think the patch should go in the next one :P
Just my two cents (or was that more like three?)
Comment #3
killes@www.drop.org commentedI've checked again and indeed, we do not officially support mysqli for Drupal 4.6. The database.mysqli.inc file was added after the 4.6 release and only went into the 4.7 releases. So it is definitly not critical.
Then again, applying the patch wouldn't hurt. I defer this decision to Dries and move it to 5.x
Comment #4
Steven commentedMessing with old, unmaintained code is usually not very productive.
Comment #5
moshe weitzman commentedbased on steven's comment. feel free to reopen and argue otherwise.