X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=scripts%2Fmysql2sql;h=112130ea398c707878d6e78e16088a8e6a3628ba;hb=26ca2f53d8fe333bb2448ea412e82be415cb3fd2;hp=3bb03028d9d334b192fd27904e043fbdd74b4124;hpb=ad12dfd9c03a4f6bbd03d22238b6399ab09962ed;p=sqlconvert.git diff --git a/scripts/mysql2sql b/scripts/mysql2sql index 3bb0302..112130e 100755 --- a/scripts/mysql2sql +++ b/scripts/mysql2sql @@ -48,19 +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): - # Replace a sequence of newlines after a /*! directive */; - # with one newline - #outfile.write(u'\n') - 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: