Fix for bug244.
authorSteve Singer <ssinger@ca.afilias.info>
Wed, 9 Nov 2011 14:13:37 +0000 (09:13 -0500)
committerChristopher Browne <cbbrowne@ca.afilias.info>
Thu, 24 Nov 2011 17:47:00 +0000 (12:47 -0500)
Require a set id on create set.
Otherwise it will create set -1 which casues problems later on.

src/slonik/slonik.c

index bd36560cdf1889970e43aa791672d3af38b72bd3..388bc62cc477c48042dcd576603a357224fdd853 100644 (file)
@@ -541,7 +541,13 @@ script_check_stmts(SlonikScript * script, SlonikStmt * hdr)
                                {
                                        SlonikStmt_create_set *stmt =
                                        (SlonikStmt_create_set *) hdr;
-
+                                       if (stmt->set_id < 0)
+                                       {
+                                               printf("%s:%d: Error: "
+                                                          "set id must be specified\n",
+                                                          hdr->stmt_filename, hdr->stmt_lno);
+                                               errors++;
+                                       }
                                        if (script_check_adminfo(hdr, stmt->set_origin) < 0)
                                                errors++;
                                }