MDL-26842 fix invalid parameter mix discovered by the new test
authorPetr Skoda <commits@skodak.org>
Mon, 21 Mar 2011 16:19:36 +0000 (17:19 +0100)
committerPetr Skoda <commits@skodak.org>
Mon, 21 Mar 2011 16:19:36 +0000 (17:19 +0100)
lib/dml/mssql_native_moodle_database.php
lib/dml/sqlsrv_native_moodle_database.php

index be9fdb1..72e20ea 100644 (file)
@@ -1002,6 +1002,9 @@ class mssql_native_moodle_database extends moodle_database {
             $params = array();
         }
 
+        // convert params to ? types
+        list($select, $params, $type) = $this->fix_sql_params($select, $params);
+
     /// Get column metadata
         $columns = $this->get_columns($table);
         $column = $columns[$newfield];
index a319935..42547c4 100644 (file)
@@ -1073,6 +1073,9 @@ class sqlsrv_native_moodle_database extends moodle_database {
             $params = array ();
         }
 
+        // convert params to ? types
+        list($select, $params, $type) = $this->fix_sql_params($select, $params);
+
         /// Get column metadata
         $columns = $this->get_columns($table);
         $column = $columns[$newfield];