From: stronk7 Date: Wed, 14 Oct 2009 17:27:13 +0000 (+0000) Subject: MDL-17491 oci driver: exception when binding strings into int/float X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=f95cc12575ce73d27d6e232001ad90ca3f874540;p=moodle.git MDL-17491 oci driver: exception when binding strings into int/float colums. PHP casting was causing unexpected behaviour. Grrr. --- diff --git a/lib/dml/oci_native_moodle_database.php b/lib/dml/oci_native_moodle_database.php index 9753cd5267..ebf64a5a02 100644 --- a/lib/dml/oci_native_moodle_database.php +++ b/lib/dml/oci_native_moodle_database.php @@ -826,12 +826,12 @@ class oci_native_moodle_database extends moodle_database { switch ($type) { case 'I': case 'R': - case 'N': - $params[$key] = (int)$value; + // TODO: Optimise oci_bind_by_name($stmt, $key, $params[$key]); break; + case 'N': case 'F': - $params[$key] = (float)$value; + // TODO: Optimise oci_bind_by_name($stmt, $key, $params[$key]); break; @@ -844,6 +844,7 @@ class oci_native_moodle_database extends moodle_database { // TODO: Shouldn't arrive here ever! BIG Clobs already bound above. Exception! } default: // Bind as CHAR (applying dirty hack) + // TODO: Optimise oci_bind_by_name($stmt, $key, $this->oracle_dirty_hack($tablename, $key, $params[$key])); } }