mirror of
https://github.com/dg/dibi.git
synced 2025-08-15 10:34:06 +02:00
strict comparison
This commit is contained in:
@@ -94,7 +94,7 @@ class FirebirdDriver implements Dibi\Driver
|
|||||||
$res = ibase_query($resource, $sql);
|
$res = ibase_query($resource, $sql);
|
||||||
|
|
||||||
if ($res === false) {
|
if ($res === false) {
|
||||||
if (ibase_errcode() == self::ERROR_EXCEPTION_THROWN) {
|
if (ibase_errcode() === self::ERROR_EXCEPTION_THROWN) {
|
||||||
preg_match('/exception (\d+) (\w+) (.*)/i', ibase_errmsg(), $match);
|
preg_match('/exception (\d+) (\w+) (.*)/i', ibase_errmsg(), $match);
|
||||||
throw new Dibi\ProcedureException($match[3], $match[1], $match[2], $sql);
|
throw new Dibi\ProcedureException($match[3], $match[1], $match[2], $sql);
|
||||||
|
|
||||||
|
@@ -67,7 +67,7 @@ class FirebirdResult implements Dibi\ResultDriver
|
|||||||
: @ibase_fetch_row($this->resultSet, IBASE_TEXT); // intentionally @
|
: @ibase_fetch_row($this->resultSet, IBASE_TEXT); // intentionally @
|
||||||
|
|
||||||
if (ibase_errcode()) {
|
if (ibase_errcode()) {
|
||||||
if (ibase_errcode() == FirebirdDriver::ERROR_EXCEPTION_THROWN) {
|
if (ibase_errcode() === FirebirdDriver::ERROR_EXCEPTION_THROWN) {
|
||||||
preg_match('/exception (\d+) (\w+) (.*)/is', ibase_errmsg(), $match);
|
preg_match('/exception (\d+) (\w+) (.*)/is', ibase_errmsg(), $match);
|
||||||
throw new Dibi\ProcedureException($match[3], $match[1], $match[2]);
|
throw new Dibi\ProcedureException($match[3], $match[1], $match[2]);
|
||||||
|
|
||||||
|
@@ -64,7 +64,7 @@ class SqliteReflector implements Dibi\Reflector
|
|||||||
'fullname' => "$table.$column",
|
'fullname' => "$table.$column",
|
||||||
'nativetype' => strtoupper($type[0]),
|
'nativetype' => strtoupper($type[0]),
|
||||||
'size' => isset($type[1]) ? (int) $type[1] : null,
|
'size' => isset($type[1]) ? (int) $type[1] : null,
|
||||||
'nullable' => $row['notnull'] == '0',
|
'nullable' => $row['notnull'] === 0,
|
||||||
'default' => $row['dflt_value'],
|
'default' => $row['dflt_value'],
|
||||||
'autoincrement' => $row['pk'] && $type[0] === 'INTEGER',
|
'autoincrement' => $row['pk'] && $type[0] === 'INTEGER',
|
||||||
'vendor' => $row,
|
'vendor' => $row,
|
||||||
@@ -98,7 +98,7 @@ class SqliteReflector implements Dibi\Reflector
|
|||||||
$column = $indexes[$index]['columns'][0];
|
$column = $indexes[$index]['columns'][0];
|
||||||
$primary = false;
|
$primary = false;
|
||||||
foreach ($columns as $info) {
|
foreach ($columns as $info) {
|
||||||
if ($column == $info['name']) {
|
if ($column === $info['name']) {
|
||||||
$primary = $info['vendor']['pk'];
|
$primary = $info['vendor']['pk'];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@@ -627,7 +627,7 @@ XX
|
|||||||
if ($matches[8]) { // SQL identifier substitution
|
if ($matches[8]) { // SQL identifier substitution
|
||||||
$m = substr($matches[8], 0, -1);
|
$m = substr($matches[8], 0, -1);
|
||||||
$m = $this->connection->getSubstitutes()->$m;
|
$m = $this->connection->getSubstitutes()->$m;
|
||||||
return $matches[9] == ''
|
return $matches[9] === ''
|
||||||
? $this->formatValue($m, null)
|
? $this->formatValue($m, null)
|
||||||
: $m . $matches[9]; // value or identifier
|
: $m . $matches[9]; // value or identifier
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user