diff options
| author | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2010-02-03 11:16:18 +0000 |
|---|---|---|
| committer | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2010-02-03 11:16:18 +0000 |
| commit | 7c0f11cd8445b977038b59e07c732fb36b876569 (patch) | |
| tree | 31c607e1e45ed525aef598ab6e4457cefdaf5a83 /roundcubemail/program/include/rcube_mdb2.php | |
| parent | 01eb79ca73e6fde48bc1cca354ca12b14326db22 (diff) | |
- Fix inconsistency when not using default table names (#1486467)
git-svn-id: https://svn.roundcube.net/trunk@3246 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/include/rcube_mdb2.php')
| -rw-r--r-- | roundcubemail/program/include/rcube_mdb2.php | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/roundcubemail/program/include/rcube_mdb2.php b/roundcubemail/program/include/rcube_mdb2.php index e8dd7e0a7..aca44c963 100644 --- a/roundcubemail/program/include/rcube_mdb2.php +++ b/roundcubemail/program/include/rcube_mdb2.php @@ -331,10 +331,15 @@ class rcube_mdb2 if (!$this->db_handle || $this->db_mode=='r') return FALSE; - // find sequence name - if ($table && $this->db_provider == 'pgsql') - $table = get_sequence_name($table); - + if ($table) { + if ($this->db_provider == 'pgsql') + // find sequence name + $table = get_sequence_name($table); + else + // resolve table name + $table = get_table_name($table); + } + $id = $this->db_handle->lastInsertID($table); return $this->db_handle->isError($id) ? null : $id; |
