]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-17129 dml/ddl: improved handling of dml exception in dml
authorskodak <skodak>
Thu, 6 Nov 2008 18:55:54 +0000 (18:55 +0000)
committerskodak <skodak>
Thu, 6 Nov 2008 18:55:54 +0000 (18:55 +0000)
lib/ddl/mysql_sql_generator.php

index 8fb79a365935ad6a249eb7fdb59138e68d9939d7..d7a3e36dbfcf2861a5decf14f751a775b1fbe4e4 100644 (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;