]> git.phdru.name Git - sqlconvert.git/blobdiff - scripts/mysql2sql
Fix mysql2sql: args.pg
[sqlconvert.git] / scripts / mysql2sql
index f06234aeaf3ef48ede0765eb2a1e9f9f1a85ed43..e4f2e4bbf9fa0eb9c84c1759fcd41cc79b13cfb0 100755 (executable)
@@ -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'