Line 138 | Line 138 |
---|
$query = preg_replace('/^INSERT INTO/', 'INSERT OR ROLLBACK INTO', $query); }
|
$query = preg_replace('/^INSERT INTO/', 'INSERT OR ROLLBACK INTO', $query); }
|
if (($this->query_result = @$this->dbo->query($query)) === false)
| try { $this->query_result = @$this->dbo->query($query); } catch (\Error $e) { // Do nothing as SQL driver will report the error }
if ($this->query_result === false)
|
{ // Try to recover a lost database connection if ($this->dbo && !@$this->dbo->lastErrorMsg())
| { // Try to recover a lost database connection if ($this->dbo && !@$this->dbo->lastErrorMsg())
|
Line 233 | Line 242 |
---|
$query_id = $this->query_result; }
|
$query_id = $this->query_result; }
|
if ($cache && !is_object($query_id) && $cache->sql_exists($query_id))
| $safe_query_id = $this->clean_query_id($query_id); if ($cache && $cache->sql_exists($safe_query_id))
|
{
|
{
|
return $cache->sql_fetchrow($query_id);
| return $cache->sql_fetchrow($safe_query_id);
|
}
return is_object($query_id) ? @$query_id->fetchArray(SQLITE3_ASSOC) : false; }
/**
|
}
return is_object($query_id) ? @$query_id->fetchArray(SQLITE3_ASSOC) : false; }
/**
|
* {@inheritDoc}
| * {@inheritdoc}
|
*/
|
*/
|
public function sql_nextid()
| public function sql_last_inserted_id()
|
{ return ($this->db_connect_id) ? $this->dbo->lastInsertRowID() : false; }
| { return ($this->db_connect_id) ? $this->dbo->lastInsertRowID() : false; }
|
Line 261 | Line 271 |
---|
$query_id = $this->query_result; }
|
$query_id = $this->query_result; }
|
if ($cache && !is_object($query_id) && $cache->sql_exists($query_id))
| $safe_query_id = $this->clean_query_id($query_id); if ($cache && $cache->sql_exists($safe_query_id))
|
{
|
{
|
return $cache->sql_freeresult($query_id);
| return $cache->sql_freeresult($safe_query_id);
|
}
if ($query_id)
| }
if ($query_id)
|
Line 390 | Line 401 |
---|
{ $html_table = false;
|
{ $html_table = false;
|
if ($result = $this->dbo->query("EXPLAIN QUERY PLAN $explain_query"))
| if ($result = @$this->dbo->query("EXPLAIN QUERY PLAN $explain_query"))
|
{ while ($row = $result->fetchArray(SQLITE3_ASSOC)) {
| { while ($row = $result->fetchArray(SQLITE3_ASSOC)) {
|
Line 426 | Line 437 |
---|
break; }
|
break; }
|
| }
/** * {@inheritDoc} */ function sql_quote($msg) { return '\'' . $msg . '\'';
|
} }
| } }
|