Пример #1
0
        pdo_query("ALTER TABLE test ADD INDEX (name)");
    }
    // Add the testtimethreshold
    if (!pdo_query("SELECT testtimestdthreshold FROM project LIMIT 1")) {
        pdo_query("ALTER TABLE project ADD testtimestdthreshold float(3,1) default '1.0'");
    }
    // Add an option to show the testtime or not
    if (!pdo_query("SELECT showtesttime FROM project LIMIT 1")) {
        pdo_query("ALTER TABLE project ADD showtesttime tinyint(4) default '0'");
    }
    return;
}
if (isset($_GET['upgrade-1-2'])) {
    // Replace the field 'output' in the table test from 'text' to 'mediumtext'
    $result = pdo_query("SELECT output FROM test LIMIT 1");
    $type = pdo_field_type($result, 0);
    if ($type == "blob" || $type == "text") {
        $result = pdo_query("ALTER TABLE test CHANGE output output MEDIUMTEXT");
    }
    // Change the file from blob to longblob
    $result = pdo_query("SELECT file FROM coveragefile LIMIT 1");
    $length = mysql_field_len($result, 0);
    if ($length == 65535) {
        $result = pdo_query("ALTER TABLE coveragefile CHANGE file file LONGBLOB");
    }
    // Compress the notes
    if (!pdo_query("SELECT crc32 FROM note LIMIT 1")) {
        CompressNotes();
    }
    // Change the dates for the groups from 0000-00-00 to 1000-01-01
    // This is for mySQL
Пример #2
0
 function mysql_field_type($result = NULL, $field_offset = NULL)
 {
     return pdo_field_type(func_get_args());
 }