Changeset 1867

Show
Ignore:
Timestamp:
04/15/06 15:23:54 (10 months ago)
Author:
demian
Message:

made sql parsing mysql 3.23 compatible, fixes #801

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/0.6-bugfix/CHANGELOG.txt

    r1866 r1867  
    55+-----------------------+ 
    66BUGFIXES 
     715-05-06    At long last, thanks to matt from IRC, Seagull will install properly 
     8            on MySQL 3.23 
    7912-04-06    List of stylesheets now correctly drawn from configured default theme, 
    810            not session. 
  • branches/0.6-bugfix/lib/SGL/Sql.php

    r1703 r1867  
    7777        $conf = $c->getAll(); 
    7878 
     79        $isMysql323 = false; 
     80        if ($conf['db']['type'] == 'mysql_SGL' || $conf['db']['type'] == 'mysql') { 
     81            $aEnvData = unserialize(file_get_contents(SGL_VAR_DIR . '/env.php')); 
     82            if (ereg('3.23', $aEnvData['db_info']['version'])) { 
     83                $isMysql323 = true; 
     84            } 
     85        } 
     86 
    7987        // Iterate through each line in the file. 
    8088        while (!feof($fp)) { 
     
    100108                $line = SGL_Sql::rewriteWithAutoIncrement($line, $nextId); 
    101109            } 
    102  
    103110            $sql .= $line; 
    104111 
     
    107114            } 
    108115 
    109             // replace ; for MaxDB and Oracle 
    110             if (($conf['db']['type'] == 'oci8_SGL') || ($conf['db']['type'] == 'odbc'))
     116            // strip semi-colons for MaxDB, Oracle and mysql 3.23 
     117            if ($conf['db']['type'] == 'oci8_SGL' || $conf['db']['type'] == 'odbc' || $isMysql323)
    111118                $sql = preg_replace("/;\s*$/", '', $sql); 
    112119            }