From: Morgan A. <mak...@ma...> - 2007-10-09 14:19:49
|
I've inherited a PhpWiki installation running on Mac OS X 10.4.10 (Tiger) Server with its default installation of PHP 4.4.7 & MySQL 4.1.22. Unfortunately, the previous owner either checked it from a version control repository or stripped out all documentation regarding the version number, so I don't know exactly which version it's running. Judging by features and dates I'm guessing it's definitely a 1.3.x release, probably 1.3.9 or later. However, I dropped the config file & pages directory into 1.3.14 and I get the following error when trying to run ?action=upgrade: --- check for necessary database updates - SQL db version: we want 1030.14 db version: we have 0 Backend type: mysql check for table session ...MISSING ... Fatal Error: 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" Notice: "Undefined variable: session_tbl" --- Is this likely a 1.3.9 or 1.3.7 installation and I need to redo the config.ini and manually modify the MySQL database? Any suggestions as to how to get this upgraded to 1.3.14 would be greatly appreciated. Sincerely, Morgan Aldridge -- mo...@ma... http://www.makkintosshu.com/ |
From: Reini U. <ru...@x-...> - 2007-10-09 14:30:32
|
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". 2007/10/9, Morgan Aldridge <mak...@ma...>: > I've inherited a PhpWiki installation running on Mac OS X 10.4.10 > (Tiger) Server with its default installation of PHP 4.4.7 & MySQL > 4.1.22. > > Unfortunately, the previous owner either checked it from a version > control repository or stripped out all documentation regarding the > version number, so I don't know exactly which version it's running. > Judging by features and dates I'm guessing it's definitely a 1.3.x > release, probably 1.3.9 or later. no, it is more likely 1.3.7 or earlier. > However, I dropped the config file & pages directory into 1.3.14 and > I get the following error when trying to run ?action=upgrade: > > --- > > check for necessary database updates - SQL > db version: we want 1030.14 > db version: we have 0 > Backend type: mysql > > check for table session ...MISSING ... > Fatal Error: > 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" > > Notice: "Undefined variable: session_tbl" > > --- > > Is this likely a 1.3.9 or 1.3.7 installation and I need to redo the > config.ini and manually modify the MySQL database? > > Any suggestions as to how to get this upgraded to 1.3.14 would be > greatly appreciated. > > Sincerely, > > Morgan Aldridge > -- > mo...@ma... > http://www.makkintosshu.com/ > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > Phpwiki-talk mailing list > Php...@li... > https://lists.sourceforge.net/lists/listinfo/phpwiki-talk > -- Reini Urban http://phpwiki.org/ http://murbreak.at/ http://spacemovie.mur.at/ http://helsinki.at/ |
From: Morgan A. <mak...@ma...> - 2007-10-09 16:54:25
|
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? Morgan Aldridge -- mo...@ma... http://www.makkintosshu.com/ |
From: Morgan A. <mak...@ma...> - 2007-10-10 12:12:11
|
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'; 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'; Morgan Aldridge -- mo...@ma... http://www.makkintosshu.com/ |
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/ |
From: Morgan A. <mak...@ma...> - 2007-10-11 12:51:47
|
On Oct 11, 2007, at 1:11 AM, Reini Urban wrote: > 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=E4r. I was starting to feel that I was barking up the wrong tree since it =20 should've found the table I already had, so thanks for that fix! =20 After applying that change I now get a bit further and have the =20 following errors: --- check for table session ...OK check for table pref ...OK check for table member ...OK Rebuild entire database to upgrade relation links ... Fatal Error: lib/WikiDB/backend/PearDB.php:1059 Error: =20 wikidb_backend_peardb_mysql: fatal database error DB Error: no such field (INSERT INTO wwn_link (linkfrom, linkto, relation) VALUES (2, 3, 0) =20 [nativecode=3D1054 ** Unknown column 'relation' in 'field list']) --- Okay, so now my wwn_link table is missing the 'relation' column. Upon =20= further inspection, the wwn_pref table is missing the 'passwd' & =20 'groupname' columns and the wwn_rating & wwn_accesslog tables are =20 missing (but they appear to be optional, judging by comments in =20 schemas/mysql-initialize.sql). I've not seen notes in the UPGRADING document regarding changes to =20 the link & pref tables. Should I be able to just add the column and =20 it'll handle it correctly? Also, does this give any hints as to what version I've got running? Interestingly, I've got numerous tables without the 'wwn_' prefix =20 (pages, link, pref, etc.) as well, but the data seems to also be in =20 the 'wwn_' prefixed tables, so I think someone must've just left the =20 old tables in there during a previous upgrade. Thanks in advance for any additional assistance or suggestions you =20 can provide. Sincerely, Morgan Aldridge -- mo...@ma... http://www.makkintosshu.com/ |