Skip to content

Commit 2b1520f

Browse files
authored
feat: support STATE_GTIDS session track information
* Support parsing gtids from OK package * Rename variable, added eslint check
1 parent fefe036 commit 2b1520f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/packets/resultset_header.js

+7
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ class ResultSetHeader {
5050
stateChanges = {
5151
systemVariables: {},
5252
schema: null,
53+
gtids: [],
5354
trackStateChange: null
5455
};
5556
}
@@ -72,6 +73,12 @@ class ResultSetHeader {
7273
stateChanges.trackStateChange = packet.readLengthCodedString(
7374
encoding
7475
);
76+
} else if (type === sessionInfoTypes.STATE_GTIDS) {
77+
// TODO: find if the first length coded string means anything. Usually comes as empty
78+
// eslint-disable-next-line no-unused-vars
79+
const _unknownString = packet.readLengthCodedString(encoding);
80+
const gtid = packet.readLengthCodedString(encoding);
81+
stateChanges.gtids = gtid.split(',');
7582
} else {
7683
// unsupported session track type. For now just ignore
7784
}

0 commit comments

Comments
 (0)