diff --git a/lib/modules/Sql.pmod/testsuite.in b/lib/modules/Sql.pmod/testsuite.in
index f7308ffd7ad8dcd244db1caeb99ef61f5ef62644..d47d5d57c83c87fc39ed03d12ab5f370e26b5051 100644
--- a/lib/modules/Sql.pmod/testsuite.in
+++ b/lib/modules/Sql.pmod/testsuite.in
@@ -1,7 +1,9 @@
 START_MARKER
 
 test_do([[
-  add_constant( "db", Sql.Sql("mysql://localhost") );
+  catch {
+    add_constant( "db", Sql.Sql("mysql://localhost") );
+  };
 ]])
 
 ifefun(db,[[