]> git.phdru.name Git - sqlconvert.git/blobdiff - scripts/mysql2sql
Do not test statements in StatementGrouper
[sqlconvert.git] / scripts / mysql2sql
index 98c5f10e6eeee216120facaa3b53250ab47decdb..112130ea398c707878d6e78e16088a8e6a3628ba 100755 (executable)
@@ -48,18 +48,17 @@ def main(infile, encoding, outfile, output_encoding, use_pbar):
                 cur_pos += len(line)
             pbar.display(cur_pos)
         grouper.process_line(line)
-        if grouper.statements:
-            for statement in grouper.get_statements():
-                if got_directive and is_newline_statement(statement):
-                    # Condense a sequence of newlines after a /*! directive */;
-                    got_directive = False
-                    continue
-                got_directive = is_directive_statement(statement)
-                if got_directive:
-                    continue
-                process_statement(statement)
-                print_tokens(statement, outfile=outfile,
-                             encoding=output_encoding)
+        for statement in grouper.get_statements():
+            if got_directive and is_newline_statement(statement):
+                # Condense a sequence of newlines after a /*! directive */;
+                got_directive = False
+                continue
+            got_directive = is_directive_statement(statement)
+            if got_directive:
+                continue
+            process_statement(statement)
+            print_tokens(statement, outfile=outfile,
+                         encoding=output_encoding)
     tokens = grouper.close()
     if tokens:
         for token in tokens: