[SOLVED] Fixes for Postgres in News in 1.1.1 bork older MySQL installations
Posted: Sat Sep 01, 2007 4:44 am
I did the 1.1 to 1.1.1 upgrade by uploading a new copy and overwriting and updated files. The only problem I found was that my news disappeared.
I enabled debug and found that the SQL syntax error was complaining about the ...LIMIT OFFSET right at the end of the query in action.default.php (line 228 or so) and function.admin_articlestab.php (around line 95),
I changed my copies to...
//$query1 .= " LIMIT $pagelimit OFFSET $startelement"; <<<- POSTGRESQL SYNTAX
$query1 .= " LIMIT $startelement , $pagelimit "; <<<- Older MYSQL SYNTAX
I must admit my MySQL is hosted and I've been meaning to talk to them to upgrade the bits as it is running MySQL v3.23.58 proto 10 but http://dev.mysql.com/doc/refman/4.1/en/select.html seems to say that LIMIT OFFSET is valid but hey I guess it isn't.
Now what I was thinking was that could I create a config.php option e.g.,
$config['sql_variant'] = 'legacy-mysql';
or some such setting and then use that where we find subtle quirks in SQL and database access but how do
I access config options from within the .php files ?
Would people mind if we have these little switches to support legacy installations ?
I enabled debug and found that the SQL syntax error was complaining about the ...LIMIT OFFSET right at the end of the query in action.default.php (line 228 or so) and function.admin_articlestab.php (around line 95),
I changed my copies to...
//$query1 .= " LIMIT $pagelimit OFFSET $startelement"; <<<- POSTGRESQL SYNTAX
$query1 .= " LIMIT $startelement , $pagelimit "; <<<- Older MYSQL SYNTAX
I must admit my MySQL is hosted and I've been meaning to talk to them to upgrade the bits as it is running MySQL v3.23.58 proto 10 but http://dev.mysql.com/doc/refman/4.1/en/select.html seems to say that LIMIT OFFSET is valid but hey I guess it isn't.
Now what I was thinking was that could I create a config.php option e.g.,
$config['sql_variant'] = 'legacy-mysql';
or some such setting and then use that where we find subtle quirks in SQL and database access but how do
I access config options from within the .php files ?
Would people mind if we have these little switches to support legacy installations ?