mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
MDL-67394 dml: improve thrown exception when Oracle can't parse query.
This commit is contained in:
parent
07238ca511
commit
42fcf7d5da
2 changed files with 5 additions and 2 deletions
|
@ -345,14 +345,16 @@ class oci_native_moodle_database extends moodle_database {
|
|||
|
||||
/**
|
||||
* Prepare the statement for execution
|
||||
* @throws dml_connection_exception
|
||||
*
|
||||
* @param string $sql
|
||||
* @return resource
|
||||
*
|
||||
* @throws dml_exception
|
||||
*/
|
||||
protected function parse_query($sql) {
|
||||
$stmt = oci_parse($this->oci, $sql);
|
||||
if ($stmt == false) {
|
||||
throw new dml_connection_exception('Can not parse sql query'); //TODO: maybe add better info
|
||||
throw new dml_exception('dmlparseexception', null, $this->get_last_error());
|
||||
}
|
||||
return $stmt;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue