From: skodak Date: Thu, 6 Nov 2008 18:55:54 +0000 (+0000) Subject: MDL-17129 dml/ddl: improved handling of dml exception in dml X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=d21c50373af7fbbb75a3c082364ea70654c74dab;p=moodle.git MDL-17129 dml/ddl: improved handling of dml exception in dml --- diff --git a/lib/ddl/mysql_sql_generator.php b/lib/ddl/mysql_sql_generator.php index 8fb79a3659..d7a3e36dbf 100644 --- a/lib/ddl/mysql_sql_generator.php +++ b/lib/ddl/mysql_sql_generator.php @@ -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;