MDL-14990 implemented query loggin in new native DML drivers

This commit is contained in:
skodak 2009-06-13 15:59:55 +00:00
parent b68bff82c9
commit b4154c2d64
9 changed files with 105 additions and 36 deletions

View file

@ -659,9 +659,10 @@ class mysqli_native_moodle_database extends moodle_database {
$this->query_start($sql, $params, SQL_QUERY_INSERT);
$result = $this->mysqli->query($rawsql);
$id = @$this->mysqli->insert_id; // must be called before query_end() which may insert log into db
$this->query_end($result);
if (!$id = $this->mysqli->insert_id) {
if (!$id) {
throw new dml_write_exception('unknown error fetching inserted id');
}