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

sql没加虚拟表from dual审核错误 #655

Open
LiuHuAshen opened this issue Jun 12, 2024 · 1 comment
Open

sql没加虚拟表from dual审核错误 #655

LiuHuAshen opened this issue Jun 12, 2024 · 1 comment

Comments

@LiuHuAshen
Copy link

LiuHuAshen commented Jun 12, 2024

描述

INSERT INTO employees (id, first_name, last_name, salary) 
SELECT (select IFNULL(MAX(id), 0) from employees) + 1, 'John', 'Doe2', 50000.0 
WHERE NOT EXISTS (SELECT 1 FROM employees WHERE first_name='John3'); 

这个语句可以在navicate正常执行,但是
在archery,goinception审核不过,异常信息如下,
image
加上from dual后正常解析语句并审核了,这是为什么呢

INSERT INTO employees (id, first_name, last_name, salary) 
SELECT (select IFNULL(MAX(id), 0) from employees) + 1, 'John', 'Doe2', 50000.0 
from dual
WHERE NOT EXISTS (SELECT 1 FROM employees WHERE first_name='John3'); 
image

环境

  • 数据库: [mysql/mariadb]
  • 版本: [例如 5.7.21]
@LiuHuAshen LiuHuAshen changed the title sql上线时 sql Jun 12, 2024
@LiuHuAshen LiuHuAshen changed the title sql sql没加临时表from dual审核错误 Jun 12, 2024
@zmix999
Copy link
Contributor

zmix999 commented Jun 12, 2024

应该是parser解析问题,也可以看下我的fork的分支https://gitee.com/zhoujin826/goInception
image

@LiuHuAshen LiuHuAshen changed the title sql没加临时表from dual审核错误 sql没加虚拟表from dual审核错误 Jun 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants