Fix bug in postgresql db layer for LIMIT ALL clauses (reported by JRSweets)

git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9412 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Meik Sievertsen 2009-03-30 10:44:18 +00:00
parent e6ed42ed4d
commit 1fae177b9a
3 changed files with 9 additions and 4 deletions

View file

@ -131,6 +131,7 @@
<li>[Fix] Cursor Jumps on New Topic in IE (Bug #42455 - Patch by TerraFrost)</li>
<li>[Fix] Add indicator to be used in code if session was created (user visits the site for the first time).</li>
<li>[Fix] Correctly count topic views for guests visiting the website the first time by entering the topic directly (Bug #43445)</li>
<li>[Fix] Fix bug in postgresql db layer for LIMIT ALL clauses (reported by JRSweets)</li>
<li>[Change] Allow download of conflicting file for later reference in automatic updater</li>
<li>[Change] Default difference view is now 'inline' instead of 'side by side'</li>
<li>[Change] Added new option for merging differences to conflicting files in automatic updater</li>

View file

@ -26,7 +26,7 @@ include_once($phpbb_root_path . 'includes/db/dbal.' . $phpEx);
class dbal_postgres extends dbal
{
var $last_query_text = '';
/**
* Connect to server
*/
@ -55,7 +55,7 @@ class dbal_postgres extends dbal
{
$connect_string .= "host=$sqlserver ";
}
if ($port)
{
$connect_string .= "port=$port ";
@ -224,7 +224,7 @@ class dbal_postgres extends dbal
// if $total is set to 0 we do not want to limit the number of rows
if ($total == 0)
{
$total = -1;
$total = 'ALL';
}
$query .= "\n LIMIT $total OFFSET $offset";

View file

@ -947,7 +947,11 @@ function change_database_data(&$no_updates, $version)
FROM ' . ACL_OPTIONS_TABLE . "
WHERE auth_option = '" . $db->sql_escape($option) . "'
ORDER BY auth_option_id DESC";
$result = $db->sql_query_limit($sql, 0, 1);
// sql_query_limit not possible here, due to bug in postgresql layer
$result = $db->sql_query($sql);
// Skip first row, this is our original auth option we want to preserve
$row = $db->sql_fetchrow($result);
while ($row = $db->sql_fetchrow($result))
{