X-Git-Url: https://git.phdru.name/?p=sqlconvert.git;a=blobdiff_plain;f=scripts%2Fmysql2sql;fp=scripts%2Fmysql2sql;h=112130ea398c707878d6e78e16088a8e6a3628ba;hp=98c5f10e6eeee216120facaa3b53250ab47decdb;hb=aff066ceefb79333878baaf7c16e0a2206d26c5d;hpb=7a5382ceebb5f853de1bed5fc574122006922479 diff --git a/scripts/mysql2sql b/scripts/mysql2sql index 98c5f10..112130e 100755 --- a/scripts/mysql2sql +++ b/scripts/mysql2sql @@ -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: