Skip to content

Table name contains space char causes syntax error #792

@victor-wiki

Description

@victor-wiki

I have a table named "Order Details", when copy data using MySqlBulkCopy, it throws:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Order Details CHARACTER SET utf8mb4 FIELDS TERMINATED BY ' ' ESCAPED BY '\\' LIN' at line 1.

I debugged to find the command text is:

LOAD DATA LOCAL INFILE ':SOURCE:2b58ba020ec74eeb89684c96bb6afd67' INTO TABLE Order Details CHARACTER SET utf8mb4 FIELDS TERMINATED BY '	' ESCAPED BY '\\' LINES TERMINATED BY '
' IGNORE 0 LINES (`OrderID`,`ProductID`,`UnitPrice`,`Quantity`,`Discount`) ;

So, it needs to handle the issue like handle column name above calling method QuoteIdentifier.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions