The SQL statement concat does not take effect when executed by dumpling

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

Original topic: dumpling执行sql语句concat不生效

| username: TiDBer_mGBoAnW9

[Dumpling Export Environment] Production / Testing / Poc
[TiDB Version]
[Reproduction Path] What operations were performed when the issue occurred
[Encountered Issue: Issue Phenomenon and Impact]
[Resource Configuration]
[Attachments: Screenshots / Logs / Monitoring]



Using Dumpling to export data with concatenated strings using concat does not work. Does anyone know the reason?

| username: 像风一样的男子 | Original post link

There is a space in the middle of the date, so the concatenated command has a space, which is equivalent to a second parameter.

| username: TiDBer_mGBoAnW9 | Original post link

There are no spaces.

| username: tidb菜鸟一只 | Original post link

There is indeed a problem. It seems that the field name inside the quotes has been converted into a string. If you want to use it temporarily, you can create a view like this:

CREATE VIEW v_sbtest1 AS 
SELECT id, CONCAT("'", a.`k`, "'") AS k, c 
FROM `sbtest`.`sbtest1` a;
| username: TiDBer_mGBoAnW9 | Original post link

I tried it, but it still doesn’t work.

| username: tidb菜鸟一只 | Original post link

Won’t the view become like this?

| username: TiDBer_mGBoAnW9 | Original post link

Still ran it directly.