From 9eb78f40fd3130cd776c82f92975611ec9282b94 Mon Sep 17 00:00:00 2001 From: Clemens Schwaighofer Date: Fri, 31 Mar 2017 15:28:36 +0900 Subject: [PATCH] Warning in DB IO if we couldn't get any return PK --- www/libs/Class.DB.IO.inc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/www/libs/Class.DB.IO.inc b/www/libs/Class.DB.IO.inc index ed7ee688..575c569d 100644 --- a/www/libs/Class.DB.IO.inc +++ b/www/libs/Class.DB.IO.inc @@ -344,6 +344,7 @@ $this->error_string['30'] = 'Query call in a possible endless loop. Was called more than '.$this->MAX_QUERY_CALL.' times'; $this->error_string['31'] = 'Could not fetch PK after query insert'; $this->error_string['32'] = 'Multiple PK return as array'; + $this->error_string['33'] = 'returning PK was not found'; $this->error_string['40'] = 'Query async call failed.'; $this->error_string['41'] = 'Connection is busy with a different query. Cannot execute.'; $this->error_string['42'] = 'Cannot check for async query, none has been started yet.'; @@ -779,6 +780,13 @@ $this->insert_id = $this->insert_id[0][$this->pk_name]; } } + elseif (count($this->insert_id) == 0) + { + // failed to get insert id + $this->insert_id = ''; + $this->warning_id = 33; + $this->_db_error($this->cursor, '[db_exec]'); + } } // this warning handling is only for pgsql // we returned an array of PKs instread of a single one