From 8a89be3c24dc54286d948fe9e44e95a082d74b5a Mon Sep 17 00:00:00 2001 From: stronk7 Date: Wed, 14 Oct 2009 14:14:00 +0000 Subject: [PATCH] MDL-17969 mssql driver: Fix boolean values in text columns --- lib/dml/mssql_native_moodle_database.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/dml/mssql_native_moodle_database.php b/lib/dml/mssql_native_moodle_database.php index 69ab678cebb..5a6004a3d18 100644 --- a/lib/dml/mssql_native_moodle_database.php +++ b/lib/dml/mssql_native_moodle_database.php @@ -520,8 +520,9 @@ class mssql_native_moodle_database extends moodle_database { private function normalise_value($column, $value) { if (is_bool($value)) { /// Always, convert boolean to int $value = (int)$value; + } // And continue processing because text columns with numeric info need special handling below - } else if ($column->meta_type == 'B') { // BLOBs need to be properly "packed", but can be inserted directly if so. + if ($column->meta_type == 'B') { // BLOBs need to be properly "packed", but can be inserted directly if so. if (!is_null($value)) { // If value not null, unpack it to unquoted hexadecimal byte-string format $value = unpack('H*hex', $value); // we leave it as array, so emulate_bound_params() can detect it } // easily and "bind" the param ok.