if ($CFG->dbtype == 'mysql') {
+
+ /* Drop the index, because with index on, you can't change it to longblob */
+
if ($dropindex){ //drop index if index is varchar, text etc type
$SQL = 'ALTER TABLE '.$CFG->prefix.$dbtablename.' DROP INDEX '.$dropindex.';';
+ $SQL1 = 'ALTER TABLE '.$CFG->prefix.$dbtablename.' DROP INDEX '.$CFG->prefix.$dropindex.';'; // see bug 5205
if ($debug) {
$db->debug=999;
}
- execute_sql($SQL, $debug);
+ execute_sql($SQL, false); // see bug 5205
+ execute_sql($SQL1, false); // see bug 5205
+
if ($debug) {
$db->debug=0;
}
- } else if ($dropprimary) { //drop primary key
+ } else if ($dropprimary) { // drop primary key
$SQL = 'ALTER TABLE '.$CFG->prefix.$dbtablename.' DROP PRIMARY KEY;';
if ($debug) {
$db->debug=999;
}
}
- /*********************************
- * Change column encoding 2 phase*
- *********************************/
+ /* Change to longblob, serves 2 purposes:
+ 1. column loses encoding, so when we finally change it to unicode,
+ mysql does not do a double convertion
+ 2. longblobs puts no limit (ok, not really but it's large enough)
+ to handle most of the problems such as in bug 5194
+ */
+
$SQL = 'ALTER TABLE '.$CFG->prefix.$dbtablename;
$SQL.= ' CHANGE '.$fieldname.' '.$fieldname.' LONGBLOB';
}
-
-
-
-
$patterns[]='/RECORDID/'; //for preg_replace
$patterns[]='/\{\$CFG\-\>prefix\}/i'; //same here
// code to drop the prefix in tables
if ($oldversion < 2006042100) {
- $result = execute_sql("ALTER TABLE {$CFG->prefix}backup_files DROP INDEX backup_files_uk");
- $result = execute_sql("ALTER TABLE {$CFG->prefix}backup_ids DROP INDEX backup_ids_uk");
+ // see bug 5205, silent drops, so should not panic anyone
+ $result = execute_sql("ALTER TABLE {$CFG->prefix}backup_files DROP INDEX backup_files_uk", false);
+ $result = execute_sql("ALTER TABLE {$CFG->prefix}backup_files DROP INDEX {$CFG->prefix}backup_files_uk", false);
+ $result = execute_sql("ALTER TABLE {$CFG->prefix}backup_ids DROP INDEX backup_ids_uk", false);
+ $result = execute_sql("ALTER TABLE {$CFG->prefix}backup_ids DROP INDEX {$CFG->prefix}backup_ids_uk", false);
$result = execute_sql("ALTER TABLE {$CFG->prefix}backup_files ADD UNIQUE INDEX backup_files_uk(backup_code,file_type(10),path(255))");
$result = execute_sql("ALTER TABLE {$CFG->prefix}backup_ids ADD UNIQUE INDEX backup_ids_uk(backup_code,table_name(30),old_id)");
}
// This is compared against the values stored in the database to determine
// whether upgrades should be performed (see lib/db/*.php)
- $version = 2006041900; // YYYYMMDD = date
+ $version = 2006042400; // YYYYMMDD = date
// XY = increments within a single day
$release = '1.6 Beta 3'; // Human-friendly version name