PDA

View Full Version : Bug report! reviewpost installation code flaw


bcddd214
April 21st, 2007, 06:46 PM
Reviewpost with MySQL

When trying to do a fresh install of review post, there is no feature to look to see if the database table exist or a redirect to step 3 when the installation fails!

There is an existing database that we are having to drop the tables one by one in order to re attempt the fresh installation.

This is a complete pain in the butt.

Step 3: MySQL error reported: [CREATE TABLE rpa_admlog (id int(10) NOT NULL auto_increment,adminuser varchar(50) NOT NULL default '',description varchar(255) NOT NULL default '',datestamp int(20) NOT NULL default '0',ip varchar(35) NOT NULL default '',PRIMARY KEY (id)) TYPE=MyISAM]
Result: Table 'rpa_admlog' already exists
Database: colorme_root

Step 3: MySQL error reported: [CREATE TABLE rpa_favorites (id smallint(4) NOT NULL auto_increment, userid int(8) NOT NULL default '0', product int(11) NOT NULL default '0', PRIMARY KEY (id), KEY parent (product)) TYPE=MyISAM]
Result: Table 'rpa_favorites' already exists
Database: colorme_root

Step 3: MySQL error reported: [CREATE TABLE rpa_laston (cat smallint(4) NOT NULL default '0', userid mediumint(9) NOT NULL default '0', laston int(11) unsigned default NULL, PRIMARY KEY (cat,userid)) TYPE=MyISAM]
Result: Table 'rpa_laston' already exists
Database: colorme_root

Step 3: MySQL error reported: [CREATE TABLE rpa_categories (id smallint(4) NOT NULL auto_increment,catname varchar(255) NOT NULL default '',description varchar(255) default NULL,catorder tinyint(4) NOT NULL default '0',thumbs varchar(4) NOT NULL default 'yes',parent int(5) NOT NULL default '0',header varchar(200) default NULL,footer varchar(200) default NULL,headtags varchar(200) default NULL,private varchar(5) NOT NULL default 'no',ugnoview VARCHAR(255) NULL,ugnoupload VARCHAR(255) NULL,ugnopost VARCHAR(255) NULL,ugnoanno VARCHAR(255) NULL,children TEXT default NULL,lastpost INT(11) UNSIGNED,lastproduct INT(11) UNSIGNED,products INT(11) UNSIGNED default '0',posts INT(11) UNSIGNED default '0',moderators TEXT default NULL,password VARCHAR(24),template int(3) NOT NULL default '0',extra1 VARCHAR(64) NULL,extra2 VARCHAR(64) NULL,extra3 VARCHAR(64) NULL,extra4 VARCHAR(64) NULL,extra5 VARCHAR(64) NULL,extra6 VARCHAR(64) NULL, thumbnail int(15) NOT NULL default '0', intro VARCHAR(3) default 'no' NOT NULL, introtitle VARCHAR(128) DEFAULT NULL, introcopy TEXT DEFAULT NULL, theme VARCHAR(32) NOT NULL, sortorder INT(2) NOT NULL DEFAULT '1', frames VARCHAR(32) DEFAULT NULL, numextra INT(3) NOT NULL DEFAULT '0', revextra INT(3) NOT NULL DEFAULT '0', PRIMARY KEY (id),KEY parent(parent)) TYPE=MyISAM]
Result: Table 'rpa_categories' already exists
Database: colorme_root


So, I delete the table one by one, the installation hangs, and we are back to square one.

The fact that I have to drop tons of valiable data is bad enough.
If not for some fancy sql tricks, our 54 gigs of data would be lost.

How do I get around the build database portion of your install script?

Brad

Chuck S
April 21st, 2007, 08:02 PM
The errors your telling me simply state you have already ran the install and the tables exist that is not really a big issue

If your install script hangs I would suggest your server's PHP is crapping out and having issues trying to populate the zipcode database. Try altering your install.php file and remove this code and rerun install


// Upload the zipcode data (if present)
$query = @file("zipData1.sql");

for ( $x=0; $x < count($query); $x++) {
$iquery = $query[$x];
$iquery = str_replace( ";", "", $iquery );
$setup = mysql_query($iquery, $link);
if ( !$setup ) print "<b>Error: ".mysql_error()."</b><br />";
}

$query = @file("zipData2.sql");

for ( $x=0; $x < count($query); $x++) {
$iquery = $query[$x];
$iquery = str_replace( ";", "", $iquery );
$setup = mysql_query($iquery, $link);
if ( !$setup ) print "<b>Error: ".mysql_error()."</b><br />";
}

$query = @file("zipData3.sql");

for ( $x=0; $x < count($query); $x++) {
$iquery = $query[$x];
$iquery = str_replace( ";", "", $iquery );
$setup = mysql_query($iquery, $link);
if ( !$setup ) print "<b>Error: ".mysql_error()."</b><br />";
}

$query = @file("zipData4.sql");

for ( $x=0; $x < count($query); $x++) {
$iquery = $query[$x];
$iquery = str_replace( ";", "", $iquery );
$setup = mysql_query($iquery, $link);
if ( !$setup ) print "<b>Error: ".mysql_error()."</b><br />";
}