mybatis plus 分页查询第一页会追加两个limit,查询其余页正常

为何不可1995 发布于 07/11 16:50
阅读 192
收藏 0
### Error querying database.  Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LIMIT 0,2' at line 5
### The error may exist in com/zsw/tzg/user/mapper/UserMapper.java (best guess)
### The error may involve defaultParameterMap
### The error occurred while setting parameters
### SQL: SELECT  id,open_id,union_id,nick_name,gender,avatar_url,mobile,password,salt,last_login_time,create_time,status,user_from  FROM tzg_user_t           ORDER BY create_time DESC LIMIT ?,? LIMIT ?,?
### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LIMIT 0,2' at line 5
; bad SQL grammar []; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LIMIT 0,2' at line 5] with root cause

@青苗 求助

加载中
0
青苗
青苗

1、是否使用其它分页方式同时使用 MP 分页或者配置了 2次插件

2、是否手动设置了分页 limit 在 sql 中

为何不可1995
为何不可1995
Registered plugin: 'AbstractSqlParserHandler(sqlParserList=null, sqlParserFilter=null) Registered plugin: 'AbstractSqlParserHandler(sqlParserList=null, sqlParserFilter=null)' 看样子加载了两次但找不到第二个引用的地方:joy:
为何不可1995
为何不可1995
但是是只有查询第一页时才会这样,其它页查询正常:astonished:
返回顶部
顶部