报错如下:
query: SELECT BaseSysLogEntity.id AS BaseSysLogEntity_id, BaseSysLogEntity.createTime AS BaseSysLogEntity_createTime, BaseSysLogEntity.updateTime AS BaseSysLogEntity_updateTim e FROM base_sys_logBaseSysLogEntity 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'
}
页面使用:
报错如下: query: SELECT (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'
}
BaseSysLogEntity
.id
ASBaseSysLogEntity_id
,BaseSysLogEntity
.createTime
ASBaseSysLogEntity_createTime
,BaseSysLogEntity
.updateTime
ASBaseSysLogEntity_updateTim e
FROMbase_sys_log
BaseSysLogEntity
WHEREBaseSysLogEntity
.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.