mirror of
https://github.com/moodle/moodle.git
synced 2025-07-25 08:11:39 +02:00
MDL-17129 dml/ddl: improved handling of dml exception in dml
This commit is contained in:
@@ -110,7 +110,13 @@ class mysql_sql_generator extends sql_generator {
|
||||
// ugly hack - mysql does not list temporary tables :-(
|
||||
// this polutes the db log with errors :-(
|
||||
// TODO: is there a better way?
|
||||
if ($this->mdb->execute("DESCRIBE {".$tablename."}") === false) {
|
||||
try {
|
||||
$result = $this->mdb->execute("DESCRIBE {".$tablename."}");
|
||||
} catch (Exception $e) {
|
||||
$result = false;
|
||||
}
|
||||
|
||||
if ($result === false) {
|
||||
$exists = false;
|
||||
} else {
|
||||
$exists = true;
|
||||
|
Reference in New Issue
Block a user