From: Reini U. <ru...@x-...> - 2007-10-11 05:14:23
|
Morgan Aldridge schrieb: > On Oct 9, 2007, at 12:54 PM, Morgan Aldridge wrote: > >> On Oct 9, 2007, at 10:30 AM, Reini Urban wrote: >> >>> Try to add the missing tables manually from schemas/mysql- >>> initialize.sql and >>> continue then with ?action=upgrade. >>> >>> CREATE TABLE session ( >>> sess_id CHAR(32) NOT NULL DEFAULT '', >>> sess_data BLOB NOT NULL, >>> sess_date INT UNSIGNED NOT NULL, >>> sess_ip CHAR(40) NOT NULL, >>> PRIMARY KEY (sess_id), >>> INDEX (sess_date) >>> ); >>> and so on. >>> >>> The error you get is a php problem, $session_tbl is empty and should >>> be "session". >> Interestingly enough, I actually already have a table named >> 'wwn_session' which MySQL's 'DESCRIBE TABLE' shows matches the format >> of the above 'CREATE TABLE' command. Looking at the config/config.ini >> file it appears the I do have 'DATABASE_PREFIX = wwn_' set. >> >> I checked config/config-dist.ini and the comments seem to imply that >> DATABASE_PREFIX is still the correct setting to modify. Is there an >> issue with the database prefix not being correctly applied in 1.3.14? > > In continuing my investigation, I noticed the following comment on > line 465 of lib/upgrade.php: > > // 1.3.8 added session.sess_ip > > Now, my 'wwn_session' table does (as it matches the format of the > 'CREATE TABLE' SQL query) have a sess_ip column. Does that mean my > installation (although unversioned) is probably 1.3.8 or later? > > Also discovered in lib/upgrade.php is that $session_tbl is > initialized on line 472 as follows: > > $session_tbl = $prefix . $DBParams['db_session_table']; > > But that's the only place it's initialized in the entire file and > that's inside the condition that one is running PhpWiki 1030.08 or > later. > > In the switch statement starting on line 248, specifically in the > 'session' case starting on line 249, $session_tbl doesn't seem to > have been initialized before being used on lines 253 & 263 while all > the other cases initialize their $<table>_tbl variables (e.g. > $pref_tbl, $member_tbl, etc.) in a similar manner as mentioned > previously. Here are examples of the $pref_tbl & $member_tbl > initialization statements: > > $pref_tbl = $prefix.'pref'; > > $member_tbl = $prefix.'member'; extract($this->dbi->_backend->_table_names); should have initialized $session_tbl. > This makes sense since the errors I'm getting include "Notice: > 'Undefined variable: session_tbl'" as well as a 'CREATE TABLE' SQL > query that contains no table name, as follows: > > --- > > lib/WikiDB/backend/PearDB.php:1059 Error: > wikidb_backend_peardb_mysql: fatal database error > > DB Error: syntax error > ( > CREATE TABLE ( > sess_id CHAR(32) NOT NULL DEFAULT '', > sess_data BLOB NOT NULL, > sess_date INT UNSIGNED NOT NULL, > sess_ip CHAR(15) NOT NULL, > PRIMARY KEY (sess_id), > INDEX (sess_date) > ) [nativecode=1064 ** You have an error in your SQL syntax; check the > manual that corresponds to your MySQL server version for the right > syntax to use near '( > sess_id CHAR(32) NOT NULL DEFAULT '', > sess_data BLOB NOT NULL, > ' at line 1]) > Notice: "Undefined variable: session_tbl" > > --- > > So, should the following be inserted between lines 250 & 251 of lib/ > upgrade.php? > > $session_tbl = $prefix.'session'; Just for you now, yes please. I remember that lib/upgrade.php had this kind of bug in 1.3.14 function CheckDatabaseUpdate() { - global $DBAuthParams; + global $DBAuthParams, $DBParams; Revision 1.60 2007/08/25 18:43:35 rurban add missing DBParams. Detected by Sacha Schär. -- Reini Urban http://phpwiki.org/ http://murbreak.at/ http://helsinki.at/ http://spacemovie.mur.at/ |