refs #5595 remove OkPackets from logIn and logOut
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Alexandre Riera 2023-05-04 09:55:36 +02:00
parent ad3c6dcee2
commit b3100d2653
2 changed files with 7 additions and 1 deletions

View File

@ -197,7 +197,7 @@ module.exports = function(Self) {
* Shortcut to VnMySQL.executeP()
*/
rawSql(query, params, options, cb) {
const userId = options.userId;
const userId = options?.userId;
if (userId) {
params.unshift(userId);
return this.dataSource.connector.executeP(

View File

@ -17,6 +17,12 @@ class VnMySQL extends MySQL {
executeP(query, params, options = {}, cb) {
return new Promise((resolve, reject) => {
this.execute(query, params, options, (error, response) => {
if(options?.userId)
{
response.shift(); // Remove OkPacket from logIn
response.pop(); // Remove OkPacket from logOut
response = response[response.length - 1] // Keep only query response
}
if (cb)
cb(error, response);
if (error)