Prevent execution of empty SQL strings during database import (#2664)

Co-authored-by: Naoki Takezoe <takezoe@gmail.com>
This commit is contained in:
solsticesurfer
2021-02-21 02:10:06 -06:00
committed by GitHub
parent bd455b9a0a
commit a6612e8522

View File

@@ -83,7 +83,9 @@ object JDBCUtil {
}
if (c == ';' && !stringLiteral) {
val sql = new String(out.toByteArray, "UTF-8")
conn.update(sql.trim)
if (sql != null && !sql.isEmpty()) {
conn.update(sql.trim)
}
out = new ByteArrayOutputStream()
} else {
out.write(c)