]> WPIA git - gigi.git/commitdiff
FIX: a bug that prevented a table from beeing truncated.
authorFelix Dörre <felix@dogcraft.de>
Thu, 28 Aug 2014 19:48:25 +0000 (21:48 +0200)
committerFelix Dörre <felix@dogcraft.de>
Thu, 28 Aug 2014 19:48:25 +0000 (21:48 +0200)
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) {