X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=scripts%2Fmysql2sql;h=e4f2e4bbf9fa0eb9c84c1759fcd41cc79b13cfb0;hb=de3d7d28c48e20deb385c7b7a21b404cd42ce31d;hp=f06234aeaf3ef48ede0765eb2a1e9f9f1a85ed43;hpb=9412933a68ffdcb20dacb9ff927d4eb285fded2e;p=sqlconvert.git diff --git a/scripts/mysql2sql b/scripts/mysql2sql index f06234a..e4f2e4b 100755 --- a/scripts/mysql2sql +++ b/scripts/mysql2sql @@ -56,9 +56,9 @@ def main(infile, encoding, outfile, output_encoding, use_pbar, quoting_style): got_directive = is_directive_statement(statement) if got_directive: continue - process_statement(statement, quoting_style) - print_tokens(statement, outfile=outfile, - encoding=output_encoding) + for statement in process_statement(statement, quoting_style): + print_tokens(statement, outfile=outfile, + encoding=output_encoding) tokens = grouper.close() if tokens: for token in tokens: @@ -90,7 +90,7 @@ if __name__ == '__main__': parser.add_argument('output_file', nargs='?', help='output file name') args = parser.parse_args() - if int(args.mysql) + int(args.postgres) + int(args.sqlite) > 1: + if int(args.mysql) + int(args.pg) + int(args.sqlite) > 1: print("Error: options -m/-p/-s are mutually incompatible, " "use only one of them", file=sys.stderr) @@ -143,7 +143,7 @@ if __name__ == '__main__': if args.mysql: quoting_style = 'mysql' - elif args.postgres: + elif args.pg: quoting_style = 'postgres' else: quoting_style = 'sqlite'