2024-08-30 18:42:57 (UTC+08:00)TiDB 10.11.209.124:3990[session.go:1754] [“parse SQL failed”] [conn=7790917293072170143] [error="[parser:1064]You have an error in your SQL syntax; check the manual that corresponds to your TiDB version for the right syntax to use line 1 column 47 near "@MySqlConnectorSleep;" "] [SQL=“SELECT SLEEP(0) INTO @MySqlConnectorSleep;”]
mysql> select 1 INTO @MySqlConnectorSleep;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your TiDB version for the right syntax to use line 1 column 40 near "@MySqlConnectorSleep"
mysql>
tidb 不支持 select into @variable.
mysql> select 1 into @a;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your TiDB version for the right syntax to use line 1 column 16 near “@a”
用 set 是可以的
mysql> set @MySqlConnectorSleep = sleep(0);
Query OK, 0 rows affected (0.00 sec)
mysql> select @MySqlConnectorSleep;
±---------------------------+
| @MySqlConnectorSleep |
±---------------------------+
| 0 |
±---------------------------+
1 row in set (0.00 sec)