diff options
| author | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2008-05-12 13:23:12 +0000 |
|---|---|---|
| committer | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2008-05-12 13:23:12 +0000 |
| commit | be74de3dbc73e5e97fff5ab98edc33e489629a6d (patch) | |
| tree | 0d5e47c298f11e5b3ff5372fab9e3ac22337ab66 | |
| parent | 84b533cc6e53e842df3fe1ffec89ed45dc0685fa (diff) | |
- fixed problem with postgresql sequences (after MDB2 drivers update)
git-svn-id: https://svn.roundcube.net/trunk@1378 208e9e7b-5314-0410-a742-e7e81cd9613c
| -rw-r--r-- | roundcubemail/program/include/main.inc | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/roundcubemail/program/include/main.inc b/roundcubemail/program/include/main.inc index b436f8295..596079124 100644 --- a/roundcubemail/program/include/main.inc +++ b/roundcubemail/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; } |
