cool-team-official / cool-admin-midway

🔥 cool-admin(midway版)一个很酷的后台权限管理框架,Ai编码、流程编排、模块化、插件化、CRUD极速开发,永久开源免费,基于midway.js 3.x、typescript、typeorm、mysql、jwt、vue3、vite、element-ui等构建
https://cool-js.com
MIT License
2.65k stars 588 forks source link

使用导出(cl-export-btn)按钮时报错 #92

Open sealili opened 2 years ago

sealili commented 2 years ago

页面使用:

报错如下: query: SELECT BaseSysLogEntity.id AS BaseSysLogEntity_id, BaseSysLogEntity.createTime AS BaseSysLogEntity_createTime, BaseSysLogEntity.updateTime AS BaseSysLogEntity_updateTim e FROM base_sys_log BaseSysLogEntity WHERE BaseSysLogEntity.id = ? -- PARAMETERS: [138] query: select count() as count from () a query failed: select count() as count from () a error: Error: 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 ') a' at line 1 at Packet.asError (D:\code\cool\cool-admin-api\node_modules\mysql2\lib\packets\packet.js:728:17) at Query.execute (D:\code\cool\cool-admin-api\node_modules\mysql2\lib\commands\command.js:29:26) at PoolConnection.handlePacket (D:\code\cool\cool-admin-api\node_modules\mysql2\lib\connection.js:456:32) at PacketParser.onPacket (D:\code\cool\cool-admin-api\node_modules\mysql2\lib\connection.js:85:12) at PacketParser.executeStart (D:\code\cool\cool-admin-api\node_modules\mysql2\lib\packet_parser.js:75:16) at Socket. (D:\code\cool\cool-admin-api\node_modules\mysql2\lib\connection.js:92:25) at Socket.emit (node:events:527:28) at Socket.emit (node:domain:475:12) at addChunk (node:internal/streams/readable:324:12) at readableAddChunk (node:internal/streams/readable:297:9) { code: 'ER_PARSE_ERROR', errno: 1064, sqlState: '42000', sqlMessage: "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 ') a' at line 1", sql: 'select count() as count from () a' } 2022-09-13 10:59:45,228 ERROR 133352 QueryFailedError: 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 ') a' at line 1 at QueryFailedError.TypeORMError [as constructor] (D:\code\cool\cool-admin-api\src\error\TypeORMError.ts:7:9) at new QueryFailedError (D:\code\cool\cool-admin-api\src\error\QueryFailedError.ts:9:9) at Query.onResult (D:\code\cool\cool-admin-api\src\driver\mysql\MysqlQueryRunner.ts:196:37) at Query.execute (D:\code\cool\cool-admin-api\node_modules\mysql2\lib\commands\command.js:36:14) at PoolConnection.handlePacket (D:\code\cool\cool-admin-api\node_modules\mysql2\lib\connection.js:456:32) at PacketParser.onPacket (D:\code\cool\cool-admin-api\node_modules\mysql2\lib\connection.js:85:12) at PacketParser.executeStart (D:\code\cool\cool-admin-api\node_modules\mysql2\lib\packet_parser.js:75:16) at Socket. (D:\code\cool\cool-admin-api\node_modules\mysql2\lib\connection.js:92:25) at Socket.emit (node:events:527:28) at Socket.emit (node:domain:475:12) { query: 'select count() as count from () a', parameters: [], driverError: Error: 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 ') a' at line 1 at Packet.asError (D:\code\cool\cool-admin-api\node_modules\mysql2\lib\packets\packet.js:728:17) at Query.execute (D:\code\cool\cool-admin-api\node_modules\mysql2\lib\commands\command.js:29:26) at PoolConnection.handlePacket (D:\code\cool\cool-admin-api\node_modules\mysql2\lib\connection.js:456:32) at PacketParser.onPacket (D:\code\cool\cool-admin-api\node_modules\mysql2\lib\connection.js:85:12) at PacketParser.executeStart (D:\code\cool\cool-admin-api\node_modules\mysql2\lib\packet_parser.js:75:16) at Socket. (D:\code\cool\cool-admin-api\node_modules\mysql2\lib\connection.js:92:25) at Socket.emit (node:events:527:28) at Socket.emit (node:domain:475:12) at addChunk (node:internal/streams/readable:324:12) at readableAddChunk (node:internal/streams/readable:297:9) { code: 'ER_PARSE_ERROR', errno: 1064, sqlState: '42000', sqlMessage: "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 ') a' at line 1", sql: 'select count() as count from () a' }, code: 'ER_PARSE_ERROR', errno: 1064, sqlState: '42000', sqlMessage: "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 ') a' at line 1", sql: 'select count() as count from () a' }

zenghi commented 1 year ago

请问解决了吗?我也遇到这个问题