From 76b6daf2b2f51965aad7b442aa6b9f7b6195fabd Mon Sep 17 00:00:00 2001 From: stronk7 Date: Thu, 27 Aug 2009 14:01:28 +0000 Subject: [PATCH] NOBUG. Add 2 missing fix_sql_params() calls in insert/update_record_raw() causing named and qm parameters to be mixed in the same query. Curiously, due to the ordered nature of the qms it wasn't breaking, but was incorrect. --- lib/dml/mysqli_native_moodle_database.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/dml/mysqli_native_moodle_database.php b/lib/dml/mysqli_native_moodle_database.php index 9a4c26742d..1722d8358b 100644 --- a/lib/dml/mysqli_native_moodle_database.php +++ b/lib/dml/mysqli_native_moodle_database.php @@ -655,6 +655,8 @@ class mysqli_native_moodle_database extends moodle_database { $qms = implode(',', $qms); $sql = "INSERT INTO {$this->prefix}$table ($fields) VALUES($qms)"; + + list($sql, $params, $type) = $this->fix_sql_params($sql, $params); $rawsql = $this->emulate_bound_params($sql, $params); $this->query_start($sql, $params, SQL_QUERY_INSERT); @@ -775,6 +777,8 @@ class mysqli_native_moodle_database extends moodle_database { $sets = implode(',', $sets); $sql = "UPDATE {$this->prefix}$table SET $sets WHERE id=?"; + + list($sql, $params, $type) = $this->fix_sql_params($sql, $params); $rawsql = $this->emulate_bound_params($sql, $params); $this->query_start($sql, $params, SQL_QUERY_UPDATE); -- 2.39.5