summaryrefslogtreecommitdiff
path: root/program/include
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2008-05-12 13:23:12 +0000
committeralecpl <alec@alec.pl>2008-05-12 13:23:12 +0000
commit54dd42c31897ae3649a0bdecaa8d65be3cf65a4e (patch)
tree56e7dca98219d0587552e75afb5d503209acb311 /program/include
parente5deaae52880e7ddb7efab0b190e5f5c750f55c4 (diff)
- fixed problem with postgresql sequences (after MDB2 drivers update)
Diffstat (limited to 'program/include')
-rw-r--r--program/include/main.inc17
1 files changed, 13 insertions, 4 deletions
diff --git a/program/include/main.inc b/program/include/main.inc
index b436f8295..596079124 100644
--- a/program/include/main.inc
+++ b/program/include/main.inc
@@ -69,14 +69,23 @@ function get_table_name($table)
*/
function get_sequence_name($sequence)
{
- global $CONFIG;
-
// return table name if configured
$config_key = 'db_sequence_'.$sequence;
+ $opt = rcmail::get_instance()->config->get($config_key);
- if (strlen($CONFIG[$config_key]))
- return $CONFIG[$config_key];
+ if (!empty($opt))
+ {
+ $db = &rcmail::get_instance()->db;
+ if($db->db_provider=='pgsql') // just for sure
+ {
+ $db->db_handle->setOption('disable_smart_seqname', true);
+ $db->db_handle->setOption('seqname_format', '%s');
+ }
+
+ return $CONFIG[$opt];
+ }
+
return $sequence;
}