Since SQLite doesn't have a boolean type, and doesn't enforce types, make
sure booleans get stored as integers, to prevent undesirable behavior,
such as false values being stored as empty strings.
Change-Id: I2a96065826412fa25f98ec298d806e73ebe155ba
function addQuotes( $s ) {
if ( $s instanceof Blob ) {
return "x'" . bin2hex( $s->fetch() ) . "'";
+ } elseif ( is_bool( $s ) ) {
+ return (int)$s;
} elseif ( strpos( $s, "\0" ) !== false ) {
// SQLite doesn't support \0 in strings, so use the hex representation as a workaround.
// This is a known limitation of SQLite's mprintf function which PDO should work around,