summaryrefslogtreecommitdiff
path: root/it_dbi.class
diff options
context:
space:
mode:
authorChristian Schneider2021-01-25 16:15:29 +0100
committerChristian Schneider2021-01-25 16:15:29 +0100
commitedfc5b21d8df6a4209172b9288405d4c5aff4059 (patch)
tree7b1297bc3386f0f85cc5427ebed8a9b126f2e949 /it_dbi.class
parenta39d9275bf2fb694560eef64d0afebecf141bc28 (diff)
downloaditools-edfc5b21d8df6a4209172b9288405d4c5aff4059.tar.gz
itools-edfc5b21d8df6a4209172b9288405d4c5aff4059.tar.bz2
itools-edfc5b21d8df6a4209172b9288405d4c5aff4059.zip
Fix generating errors on SQL syntax errors, add tests for it
Diffstat (limited to 'it_dbi.class')
-rw-r--r--it_dbi.class6
1 files changed, 3 insertions, 3 deletions
diff --git a/it_dbi.class b/it_dbi.class
index 2b6f475..d8dfa1b 100644
--- a/it_dbi.class
+++ b/it_dbi.class
@@ -579,8 +579,8 @@ function query($query, $p = array())
if (!($result = $this->_query($query, $p)))
{
- if ($result === false)
- return $result;
+ if ($result === null)
+ return false;
$this->_fatal("query(\"$query\") failed");
}
else if (it::match('^(CREATE|ALTER|DROP) ', $query, array('utf8' => false)))
@@ -1106,7 +1106,7 @@ function _query($query, $p)
{
$errno = mysqli_errno($this->_link);
if (($p['safety'] < 2) && ($errno == 1062)) # Duplicate entry
- return false;
+ return null;
if ($errno == 2006) # mysql server has gone away: retry
{