Failure During TiDB Lightning Import

This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: tidb lightning导入时失败

| username: TiDBer_CkS2lbTx

When using lightning to import, it prompts a syntax error with double quotes.

However, this database creation statement can be executed directly in TiDB without any errors. Is it a configuration issue with lightning?

| username: TiDBer_0p0BD6le | Original post link

How did you export the data? Normally, the database should use backticks, but why are there double quotes when you export it?

| username: TiDBer_CkS2lbTx | Original post link

The default is already present in the data exported by dumpling.

| username: hey-hoho | Original post link

Please provide the contents of the lightning configuration file and the directory contents exported by dumpling.

| username: zhaokede | Original post link

Was the SQL in the second image exported or written by yourself?

| username: TiDBer_CkS2lbTx | Original post link

The issue has been resolved. Lightning also needs to set sql-mode=ANSI_QUOTES.

| username: zhaokede | Original post link

Got it. Is this enabled by default, or do we need to adjust the SQL mode ourselves?

| username: TiDBer_CkS2lbTx | Original post link

Need to add manually.

| username: 健康的腰间盘 | Original post link

The post has been bookmarked.

| username: hacker_77powerful | Original post link

Got it!

| username: TiDBer_QYr0vohO | Original post link


| username: tony5413 | Original post link

Got it. When ANSI_QUOTES is not set, backticks (`) are typically used to quote identifiers (such as table names, column names, etc.), while double quotes (“) are used to quote string literals. However, when ANSI_QUOTES is set, the content within double quotes (”) is no longer considered a string but is treated as an identifier.

| username: xingzhenxiang | Original post link

I usually set this to empty.