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

goInception 是否能支持MySQL 8.0 中的 with 语法呢 #652

Open
callmedba opened this issue May 29, 2024 · 10 comments
Open

goInception 是否能支持MySQL 8.0 中的 with 语法呢 #652

callmedba opened this issue May 29, 2024 · 10 comments

Comments

@callmedba
Copy link

callmedba commented May 29, 2024

描述您想要的功能:

MySQL8中支持了with语法,tidb最新版本中也支持了该语法。

goInception 目前是否能支持 with 语法审核呢 ? 谢谢

示例sql:

with x as (select * from movies) select id,movie from x;

可参考文档,资料,引用等:

使用 goInception v1.3.0-90-gb3de05e2e7 对该示例sql进行测试,错误日志为:

level=error msg="con:21 解析失败! line 1 column 4 near \"with x as (select * from movies) select id,movie from x\" " file=session_inception.go func=executeInc line=220
@zmix999
Copy link

zmix999 commented May 29, 2024

得等主分支修复了,可以看下我fork的分支,https://gitee.com/zhoujin826/goInception

@callmedba
Copy link
Author

callmedba commented May 29, 2024

得等主分支修复了,可以看下我fork的分支,https://gitee.com/zhoujin826/goInception

大佬 ,我从gitee上下载了最新版本 v1.3.0-159-gd625352

验证示例sql:

with x as (select * from movies) select id,movie from x;

结果是:

error_level返回 2
error_message 返回 " Table 'pms.x' doesn't exist.Column 'id' not existed.Column 'movie' not existed. "

日志如下:

ime="2024/05/29 16:07:27.823" level=info msg="con:6 new connection 127.0.0.1:36078" file=server.go func=onConn line=319
time="2024/05/29 16:07:27.824" level=info msg="[GENERAL_LOG] con:6 user:root@127.0.0.1 sql:SET AUTOCOMMIT = 0" file=session.go func=logQuery line=1613
time="2024/05/29 16:07:27.932" level=info msg="s.innodbLargePrefix: false " file=session_inception.go func=mysqlServerVersion line=1920
time="2024/05/29 16:07:28.044" level=info msg="[GENERAL_LOG] con:6 user:root@127.0.0.1 sql:/*--user=xxx;--password=xxx;--host=xxx;--check=1;--port=3306;*/ inception_magic_start; use pms; select * from movies; with x as (select * from movies) select id,movie from x; inception_magic_commit;" file=session.go func=logQuery line=1613
time="2024/05/29 16:07:28.045" level=info msg="con:6 close connection" file=server.go func=func1 line=321

请问这个goInception如果要使用MySQL CET语法,是需要打开哪个配置项吗 ? 谢谢

@zmix999
Copy link

zmix999 commented May 29, 2024

提示的不是很明显了,查询的表有这些列吗

@zmix999
Copy link

zmix999 commented May 30, 2024

image

@callmedba
Copy link
Author

image

id和movie列在表里是有的 ,有点奇怪

@callmedba
Copy link
Author

callmedba commented May 30, 2024

./goInception -V
Release Version: v1.3.0-159-gd625352
Git Commit Hash: d625352d2ca160cba45a4b4128757ccfc57071bf
Git Branch: master
UTC Build Time: 2024-05-28 13:38:05
GoVersion: go version go1.22.2 linux/amd64

配置文件和社区一致的, v1.3.0-159-gd625352 这个版本是对的吗 ? 谢谢

@callmedba
Copy link
Author

image

请问下这个截图里是使用的哪个goInception小版本,我试试看

@zmix999
Copy link

zmix999 commented May 30, 2024

image
image
image
检查自己的配置吧,错误提示很明显

@woshiyanghai
Copy link

我使用goInception-linux-v1.3.0-164-g16a8b6f.tar.gz 这个版本,还是无法使用with语法?请问这个支持了么

@zmix999
Copy link

zmix999 commented Jun 21, 2024

我使用goInception-linux-v1.3.0-164-g16a8b6f.tar.gz 这个版本,还是无法使用with语法?请问这个支持了么
报什么错

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

3 participants