Skip to content

Commit

Permalink
Фикс sqlite
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan Borzenkov committed Dec 6, 2011
1 parent a9408ae commit 7d4d662
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions lib/DbSimple/Sqlite.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,8 @@ protected function _performQuery($queryMain)
$this->_expandPlaceholders($queryMain, false);
$error_msg = '';
$p = $this->link->query($queryMain[0], SQLITE_ASSOC, $error_msg);
if (!$p)
return $this->_setDbError($p->lastError(), $error_msg, $queryMain[0]);
if ($error_msg)
return $this->_setDbError($p->lastError(), $error_msg, $queryMain[0]);
if (!$p || $error_msg)
return $this->_setDbError($queryMain[0]);
if (preg_match('/^\s* INSERT \s+/six', $queryMain[0]))
return $this->link->lastInsertRowid();
if ($p->numFields()==0)
Expand Down Expand Up @@ -128,6 +126,11 @@ protected function _performTransformQuery(&$queryMain, $how)
return false;
}

protected function _setDbError($query)
{
return $this->_setLastError($this->link->lastError(), sqlite_error_string($this->link->lastError()), $query);
}

protected function _performNewBlob($id=null)
{
}
Expand Down

0 comments on commit 7d4d662

Please sign in to comment.