Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/Util/Database/PicoDatabaseConverter.php
Original file line number Diff line number Diff line change
Expand Up @@ -505,11 +505,11 @@ public function convertToPhpType($value, $sqlType, $dialect) // NOSONAR
}
// For SQLite and SQL Server, return as integer 0/1
if (stripos($dialect, 'sqlite') !== false || stripos($dialect, 'sqlserver') !== false) {
return $value === true ? 1 : 0;
return ($value === true || $value === '1' || $value === 1) ? 1 : 0;
}
return $value ? "TRUE" : "FALSE";
return ($value === true || $value === '1' || $value === 1) ? "TRUE" : "FALSE";
case 'bit':
return $value ? 1 : 0;
return ($value === true || $value === '1' || $value === 1) ? 1 : 0;
case 'float':
case 'real':
case 'double':
Expand Down Expand Up @@ -589,7 +589,7 @@ public function convertPhpValueToSqlLiteral($value, $phpType) // NOSONAR

case 'bool':
case 'boolean':
return $value ? '1' : '0';
return ($value === true || $value === '1' || $value === 1) ? '1' : '0';

case 'array':
// Convert array to JSON string and escape
Expand Down