Skip to content

The bulk_load_custom in MySQL hook incorrectly parameterized duplicate_key_handling #62506

@RocFang

Description

@RocFang

Apache Airflow version

3.1.7

If "Other Airflow 3 version" selected, which one?

No response

What happened?

In this pr https://github.com/apache/airflow/pull/33328/changes

In this PR, duplicate_key_handling was changed from string concatenation to parameterization when used by cur.execute.

After this change, the sql keywords IGNORE or REPLICAE will be incorrectly enclosed in quotes, leading to invalid SQL queries.

I found there was an closed issue #42061 which is probably caused by this problem and there was already a pr #41078 to fix this but it was closed too.

Since the root cause is clear, perhaps the maintainers could consider re-approving this PR to fix this bug?
Thans very much.

What you think should happen instead?

No response

How to reproduce

Just the same as #42061

Operating System

The official 3.1.7 docker image, so it's debian 12.13

Versions of Apache Airflow Providers

apache-airflow-providers-mysql 6.4.2

Deployment

Official Apache Airflow Helm Chart

Deployment details

No response

Anything else?

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions