]> WPIA git - gigi.git/blobdiff - util/org/cacert/gigi/util/DatabaseManager.java
FIX: a bug that prevented a table from beeing truncated.
[gigi.git] / util / org / cacert / gigi / util / DatabaseManager.java
index 457e11ff27b0c42a3a92e89f42422eba917aedef..e5e0b1f056097459dd264fb014fe2ec167016965 100644 (file)
@@ -48,6 +48,7 @@ public class DatabaseManager {
 
     private static void addFile(Statement stmt, File f, boolean truncate) throws IOException, SQLException {
         String sql = readFile(f);
+        sql = sql.replaceAll("--[^\n]+\n", "\n");
         String[] stmts = sql.split(";");
         Pattern p = Pattern.compile("\\s*DROP TABLE IF EXISTS `([^`]+)`");
         for (String string : stmts) {