From 7d8f881a493c858366ccb9d27e7f727fd77da439 Mon Sep 17 00:00:00 2001 From: Petr Skoda Date: Thu, 2 Sep 2010 10:24:40 +0000 Subject: [PATCH] MDL-23997 using strings instead of integers in binding emulation - this should be compatible both with int and nvarchar sql types --- lib/dml/sqlsrv_native_moodle_database.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/dml/sqlsrv_native_moodle_database.php b/lib/dml/sqlsrv_native_moodle_database.php index 5f2abf3f342..7258bf0f993 100644 --- a/lib/dml/sqlsrv_native_moodle_database.php +++ b/lib/dml/sqlsrv_native_moodle_database.php @@ -700,7 +700,7 @@ class sqlsrv_native_moodle_database extends moodle_database { $return .= 'NULL'; } else if (is_number($param)) { // we can not use is_numeric() because it eats leading zeros from strings like 0045646 - $return .= $param; + $return .= "'$param'"; // this is a hack for MDL-23997, we intentionally use string because it is compatible with both nvarchar and int types } else if (is_float($param)) { $return .= $param; } else {