Loading...
 
Skip to main content

Bug Updating Imported DB on Upgrade

Status
Open
Subject
Bug Updating Imported DB on Upgrade
Version
12.x
Category
  • Error
Feature
Installer (profiles, upgrades and server-related issues)
Resolution status
New
Submitted by
mstovenour
Lastmod by
mstovenour
Rating
(0)
Description

When installing I use a unique database name, not 'tiki'. I imported my old database and ran the installer. At the "Install & Upgrade" screen I chose "Upgrade". I then received a blank page with the following message:

MySQL INFORMATION_SCHEMA not available. Your MySQL version is too old to perform this operation. (upgrade_20120429_fix_collation_tiki)

Looking into the code for 20120429_fix_collation_tiki.php and doing a bit of debugging I found the following line to be causing the error:

Copy to clipboard
if ( $results= $installer->fetchAll('SELECT DISTINCT(TABLE_NAME) FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = ?', $dbs_tiki)

A debug_print_backtrace and a few php print statements later, I determined that the $dbs_tiki variable was being set to 'tiki' when it should have been set to my database name.

I believe the following check-ins are the area of concern:
http://sourceforge.net/p/tikiwiki/code/48422/tree//trunk/installer/installlib.php?diff=48171Question
http://sourceforge.net/p/tikiwiki/code/45334/tree//trunk/lib/init/initlib.php?diff=44846Question

From what I can tell the $dbs_tiki value is predefined as 'tiki' by initlib.php and the calling sequence in installlib.php is not correctly setting the database name from local.php.

I made the following changes to get around the issue. I do not know if this meets all the requirements for this function so I can not confirm that these changes are sufficient to correctly fix the issue.

installer/installlib.php
Copy to clipboard
# diff -u tiki-12.0/installer/installlib.php tiki-12.0-fix/installer/installlib.php --- tiki-12.0/installer/installlib.php 2013-11-13 10:45:16.000000000 -0600 +++ tiki-12.0-fix/installer/installlib.php 2014-02-23 13:28:52.765490522 -0600 @@ -133,11 +133,13 @@ } global $dbs_tiki; - $local_php = TikiInit::getCredentialsFile(); - if (empty($dbs_tiki) && is_readable($local_php)) { - require($local_php); - unset($db_tiki, $host_tiki, $user_tiki, $pass_tiki); - } + if (empty($dbs_tiki) ) { + $local_php = TikiInit::getCredentialsFile(); + if (is_readable($local_php)) { + require($local_php); + unset($db_tiki, $host_tiki, $user_tiki, $pass_tiki); + } + } if ( function_exists($standalone) ) { $standalone($this);
Importance
10 high
Easy to solve?
8
Priority
80
Demonstrate Bug on Tiki 19+
Demonstrate Bug (older Tiki versions)
Ticket ID
5152
Created
Sunday 23 February, 2014 19:41:12 UTC
by mstovenour
LastModif
Sunday 23 February, 2014 19:41:12 UTC


Show PHP error messages