DB IO Class: if not PK auto found, set to NULL to skip return

In case no primary key is set and the auto detect does not return a
primary key, set the primary key variable to 'NULL' string to trigger
skip in returning insert id flow.
This commit is contained in:
Clemens Schwaighofer
2017-11-02 16:05:06 +09:00
parent c39e48a709
commit 93f2cf9b73

View File

@@ -661,7 +661,7 @@
{ {
$this->pk_name_table[$table] = $this->db_functions->_db_primary_key($table, $schema); $this->pk_name_table[$table] = $this->db_functions->_db_primary_key($table, $schema);
} }
$this->pk_name = $this->pk_name_table[$table]; $this->pk_name = $this->pk_name_table[$table] ? $this->pk_name_table[$table] : 'NULL';
} }
if (!preg_match("/ returning /i", $this->query) && $this->pk_name) if (!preg_match("/ returning /i", $this->query) && $this->pk_name)
{ {