Class DB IO, fix for trailing ; with RETURNING
If an INSERT query has no RETURNING but ; at the end, the RETURNING was added after the ; The ; is now stripped before adding RETURNING
This commit is contained in:
@@ -663,6 +663,8 @@
|
||||
}
|
||||
if (!preg_match("/ returning /i", $this->query) && $this->pk_name && $this->pk_name != 'NULL')
|
||||
{
|
||||
// check if this query has a ; at the end and remove it
|
||||
$this->query = preg_replace("/(;\s*)$/", '', $this->query);
|
||||
$this->query .= " RETURNING ".$this->pk_name;
|
||||
$this->returning_id = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user