From 4e117116749ad47c1cfcc24cd2cb24c7271aad1c Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Wed, 5 Aug 2009 13:05:55 +0000 Subject: [PATCH] Fix Bug #48955 - Correctly extract column default value when exporting PostgreSQL tables. git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9928 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/docs/CHANGELOG.html | 1 + phpBB/includes/acp/acp_database.php | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index c373a5a8f7..17d192d88b 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -188,6 +188,7 @@
  • [Fix] Adjust build_url() to not prepend $phpbb_root_path if path returned from redirect() is an URL. This fixes redirect issues with some installations and bridges. (Bug #47535)
  • [Fix] Do not mark global announcements as read if all topics in a forum become read (Bug #15729).
  • [Fix] Fix general error while registration, through undefined variable $config in validate_referer (Bug #49035 - Patch by wjvriend)
  • +
  • [Fix] Correctly extract column default value when exporting PostgreSQL tables. (Bug #48955)
  • [Change] submit_post() now accepts force_approved_state key passed to $data to indicate new posts being approved (true) or unapproved (false).
  • [Change] Change the data format of the default file ACM to be more secure from tampering and have better performance.
  • [Change] Add index on log_time to the log table to prevent slowdown on boards with many log entries. (Bug #44665 - Patch by bantu)
  • diff --git a/phpBB/includes/acp/acp_database.php b/phpBB/includes/acp/acp_database.php index bf02a58dce..b25518e1c4 100644 --- a/phpBB/includes/acp/acp_database.php +++ b/phpBB/includes/acp/acp_database.php @@ -1157,16 +1157,17 @@ class postgres_extractor extends base_extractor AND (c.oid = d.adrelid) AND d.adnum = " . $row['attnum']; $def_res = $db->sql_query($sql_get_default); + $def_row = $db->sql_fetchrow($def_res); + $db->sql_freeresult($def_res); - if (!$def_res) + if (empty($def_row)) { unset($row['rowdefault']); } else { - $row['rowdefault'] = $db->sql_fetchfield('rowdefault', false, $def_res); + $row['rowdefault'] = $def_row['rowdefault']; } - $db->sql_freeresult($def_res); if ($row['type'] == 'bpchar') {