Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import into ... from select does not comply with the current SQL mode #58443

Open
gengliqi opened this issue Dec 20, 2024 · 0 comments
Open

Import into ... from select does not comply with the current SQL mode #58443

gengliqi opened this issue Dec 20, 2024 · 0 comments
Labels

Comments

@gengliqi
Copy link
Contributor

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

mysql> create table t(a double);
Query OK, 0 rows affected (0.08 sec)

mysql> create table s(x varchar(20));
Query OK, 0 rows affected (0.08 sec)

mysql> insert into s values('1e309abc');
Query OK, 1 row affected (0.01 sec)

mysql> alter table s set tiflash replica 1;
Query OK, 0 rows affected (0.11 sec)

mysql> set tidb_enforce_mpp=1;
Query OK, 0 rows affected (0.00 sec)

mysql> set sql_mode='';
Query OK, 0 rows affected (0.00 sec)

mysql> insert into t select cast(x as double) from s;
Query OK, 1 row affected (0.09 sec)
Records: 1  Duplicates: 0  Warnings: 0

mysql> truncate t;
Query OK, 0 rows affected (0.08 sec)

mysql> import into t from select cast(x as double) from s;
ERROR 1105 (HY000): other error for mpp stream: Code: 0, e.displayText() = DB::TiFlashException: Overflow error: Truncated incorrect DOUBLE value, e.what() = DB::TiFlashException,
mysql> explain import into t from select cast(x as double) from s;
+------------------------------+----------+--------------+---------------+-----------------------------------------+
| id                           | estRows  | task         | access object | operator info                           |
+------------------------------+----------+--------------+---------------+-----------------------------------------+
| ImportInto_2                 | N/A      | root         |               | N/A                                     |
| └─TableReader_14             | 10000.00 | root         |               | MppVersion: 2, data:ExchangeSender_13   |
|   └─ExchangeSender_13        | 10000.00 | mpp[tiflash] |               | ExchangeType: PassThrough               |
|     └─Projection_6           | 10000.00 | mpp[tiflash] |               | cast(test.s.x, double BINARY)->Column#4 |
|       └─TableFullScan_12     | 10000.00 | mpp[tiflash] | table:s       | keep order:false, stats:pseudo          |
+------------------------------+----------+--------------+---------------+-----------------------------------------+
5 rows in set (0.00 sec)

2. What did you expect to see? (Required)

The sql import into ... from select should use non-strict sql mode and run successfully.

3. What did you see instead (Required)

Run failed

4. What is your TiDB version? (Required)

v8.1.1

@gengliqi gengliqi added the type/bug The issue is confirmed as a bug. label Dec 20, 2024
@gengliqi gengliqi changed the title Import into ... from select does not respect sql_mode in current session Import into ... from select does not comply with the current SQL mode Dec 20, 2024
@jebter jebter added severity/major component/ddl This issue is related to DDL of TiDB. labels Dec 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants