Skip to content

Commit

Permalink
feat: support STATE_GTIDS session track information
Browse files Browse the repository at this point in the history
* Support parsing gtids from OK package

* Rename variable, added eslint check
  • Loading branch information
sanglt committed Jun 19, 2023
1 parent fefe036 commit 2b1520f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/packets/resultset_header.js
Expand Up @@ -50,6 +50,7 @@ class ResultSetHeader {
stateChanges = {
systemVariables: {},
schema: null,
gtids: [],
trackStateChange: null
};
}
Expand All @@ -72,6 +73,12 @@ class ResultSetHeader {
stateChanges.trackStateChange = packet.readLengthCodedString(
encoding
);
} else if (type === sessionInfoTypes.STATE_GTIDS) {
// TODO: find if the first length coded string means anything. Usually comes as empty
// eslint-disable-next-line no-unused-vars
const _unknownString = packet.readLengthCodedString(encoding);
const gtid = packet.readLengthCodedString(encoding);
stateChanges.gtids = gtid.split(',');
} else {
// unsupported session track type. For now just ignore
}
Expand Down

0 comments on commit 2b1520f

Please sign in to comment.