MDL-17129 dml/ddl: improved handling of dml exception in dml

This commit is contained in:
skodak
2008-11-06 18:55:54 +00:00
parent ba63f3775b
commit d21c50373a

View File

@@ -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;