]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-17491 oci driver: exception when binding strings into int/float
authorstronk7 <stronk7>
Wed, 14 Oct 2009 17:27:13 +0000 (17:27 +0000)
committerstronk7 <stronk7>
Wed, 14 Oct 2009 17:27:13 +0000 (17:27 +0000)
colums. PHP casting was causing unexpected behaviour. Grrr.

lib/dml/oci_native_moodle_database.php

index 9753cd52674e4f49987e62bf92a0fde053b81a90..ebf64a5a020662e871148beb01453e4ca13635c2 100644 (file)
@@ -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]));
                 }
             }