X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=sqlconvert%2Fprocess_mysql.py;h=ad4d422b4c13fa0ca2f1821009038b0e512c9214;hb=7c6cbe51aaef47343ecd26f5979fdaa942579eb0;hp=e99ea79edc2816c57787f0578589a38bacea6173;hpb=843981ca5ac41be09212f3aa427500580a6e9f5c;p=sqlconvert.git diff --git a/sqlconvert/process_mysql.py b/sqlconvert/process_mysql.py index e99ea79..ad4d422 100644 --- a/sqlconvert/process_mysql.py +++ b/sqlconvert/process_mysql.py @@ -29,7 +29,7 @@ def is_directive_statement(statement): def remove_directive_tokens(statement): - """Remove /\*! directives \*/ from the first-level""" + """Remove /\*! directives \*/ from the first-level""" # noqa: W605: \* new_tokens = [] for token in statement.tokens: if _is_directive_token(token): @@ -147,10 +147,10 @@ def process_statement(statement, dbname='sqlite'): remove_directive_tokens(statement) escape_strings(statement, dbname) try: - is_insert = get_DML_type(statement) == 'INSERT' + dml_type = get_DML_type(statement) except ValueError: - is_insert = False - if is_insert: + dml_type = 'UNKNOWN' + if dml_type == 'INSERT': for statement in split_ext_insert(statement): yield statement else: