Skip to content
New issue

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

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

Already on GitHub? # to your account

[ 问题咨询 ] mysql的查询改写逻辑是什么? #739

Closed
phantomsoul opened this issue May 14, 2020 · 5 comments
Closed

[ 问题咨询 ] mysql的查询改写逻辑是什么? #739

phantomsoul opened this issue May 14, 2020 · 5 comments
Labels
duplicate This issue or pull request already exists

Comments

@phantomsoul
Copy link

在提交 issue 前,请查阅以下资源,请先进行搜索来保证没有类似的 issue。
文档 | FAQ

重现步骤

select `id` as `site_id`, `nick_name` from `kbd_site_info` where `nick_name` like '%丸子%' order by `created_at` desc limit 10
执行结果有数据
select `id` as `site_id`, `nick_name` from `kbd_site_info` where `nick_name` like '%丸子%' order by `created_at` desc limit 10 offset 0
执行结果没数据
select `id` as `site_id`, `nick_name` from `kbd_site_info` where `nick_name` like '%丸子%' order by `created_at` desc limit 10 offset 1
执行结果只有一条数据

期待结果和实际结果

期待结果:
根据正常SQL语法的到数据
实际结果:
无法获取数据

截图

微信截图_20200514095218
微信截图_20200514095234
微信截图_20200514095202

错误日志

版本信息

应用版本/分支:

部署方式:Docker、手工部署

@hhyo
Copy link
Owner

hhyo commented May 14, 2020

#143 #647

@hhyo hhyo added the duplicate This issue or pull request already exists label May 14, 2020
@hhyo hhyo changed the title [ bug ] [ 问题咨询 ] mysql的查询改写逻辑是什么? May 14, 2020
@phantomsoul
Copy link
Author

phantomsoul commented May 15, 2020

limit关键字和offet关键字功能是不是写反了,我用Navicat执行第二条语句是有结果返回的。
select id as site_id, nick_name from kbd_site_info where nick_name like '%丸子%' order by created_at desc limit 10 offset 0

@hhyo
Copy link
Owner

hhyo commented May 15, 2020

简单地说,平台目前不允许offset查询,都会被改写成limit x

@phantomsoul
Copy link
Author

好的

mxlxm added a commit to mxlxm/Archery that referenced this issue Aug 29, 2021
@mxlxm mxlxm mentioned this issue Aug 29, 2021
hhyo added a commit that referenced this issue Sep 16, 2021
* support offset
fix #847,#739,#647.

* update limit ut

Co-authored-by: 小圈圈 <rtttte@qq.com>
@cdz620
Copy link

cdz620 commented Oct 26, 2022

简单地说,平台目前不允许offset查询,都会被改写成limit x

@hhyo
不支持offset查询是出于什么考虑?是不是有踩过什么坑可以分享一下吗,目前我司在用的时候,有打算开放这个功能

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants