diff --git a/lib/modules/Sql.pmod/testsuite.in b/lib/modules/Sql.pmod/testsuite.in
index 92448bebbb1cfc2a985c97c9de8bb6daeb2976f1..589ce015431ceace433eb56af5af2b8729394618 100644
--- a/lib/modules/Sql.pmod/testsuite.in
+++ b/lib/modules/Sql.pmod/testsuite.in
@@ -1,5 +1,17 @@
 START_MARKER
 
+test_any([[
+  Sql.Sql sql = Sql.Sql("null://");
+  return sql->query("INSERT INTO foo (foo, bar) VALUES (%s, %s) WHERE bar = %d",
+                    0, "blah", 0)[0]->query;
+]], "INSERT INTO foo (foo, bar) VALUES (NULL, :arg0) WHERE bar = 0")
+
+test_any([[
+  Sql.Sql sql = Sql.Sql("null://");
+  return sql->query("INSERT INTO foo (foo, bar) VALUES (%s, %s) WHERE bar = %d",
+                    0, "blah", 0)[0]->formatted_query;
+]], "INSERT INTO foo (foo, bar) VALUES (NULL, 'quote(\"blah\")') WHERE bar = 0")
+
 test_do([[
   catch {
     add_constant( "db", Sql.Sql("mysql://localhost") );