summaryrefslogtreecommitdiffstats
path: root/system/database/drivers/interbase
diff options
context:
space:
mode:
Diffstat (limited to 'system/database/drivers/interbase')
-rw-r--r--system/database/drivers/interbase/interbase_driver.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/system/database/drivers/interbase/interbase_driver.php b/system/database/drivers/interbase/interbase_driver.php
index fcefa6d97..4044c4529 100644
--- a/system/database/drivers/interbase/interbase_driver.php
+++ b/system/database/drivers/interbase/interbase_driver.php
@@ -309,7 +309,12 @@ class CI_DB_interbase_driver extends CI_DB {
*/
public function insert_id($generator_name, $inc_by=0)
{
- return ibase_gen_id('"'.$generator_name.'"', $inc_by);
+ //If a generator hasn't been used before it will return 0
+ if($id = ibase_gen_id('"'.$generator_name.'"', $inc_by) !== 0)
+ {
+ return $id;
+ }
+ return ibase_gen_id('"'.$generator_name.'"', 1);
}
// --------------------------------------------------------------------