Skip to content

Commit 9650ac8

Browse files
committed
Added custom gtid binlog event
Removed old CI config files Added changeset
1 parent 3dc811f commit 9650ac8

File tree

8 files changed

+26
-35
lines changed

8 files changed

+26
-35
lines changed

.changeset/brave-hairs-tan.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'powersync-mysql-zongji': minor
3+
---
4+
5+
Initial release of the powersync-mysql-zongji fork
6+
- Added custom gtid binlog event

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,4 @@ jobs:
5858
run: pnpm install
5959

6060
- name: Test
61-
run: npm test
61+
run: pnpm test

.travis.yml

Lines changed: 0 additions & 15 deletions
This file was deleted.

lib/binlog_event.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,21 @@ function Format() {
5353
}
5454
util.inherits(Format, BinlogEvent);
5555

56+
/* A GTID Log event
57+
* Attributes:
58+
* flags: This number contains flags related to the GTID, such as whether the transaction was the last one in a group or if it was a standalone transaction
59+
* serverId: The Server UUID (SID), which is a 16-byte Buffer
60+
* transactionRange: The Global Transaction ID number, which is a 64-bit unsigned integer
61+
*/
62+
63+
function GtidLog(parser) {
64+
BinlogEvent.apply(this, arguments);
65+
this.flags = parser.parseUnsignedNumber(1);
66+
this.serverId = parser.parseBuffer(16);
67+
this.transactionRange = Common.parseUInt64(parser);
68+
}
69+
util.inherits(GtidLog, BinlogEvent);
70+
5671
/* A COMMIT event
5772
* Attributes:
5873
* xid: Transaction ID for 2PC
@@ -295,3 +310,4 @@ exports.IntVar = IntVar;
295310
exports.Xid = Xid;
296311
exports.TableMap = TableMap;
297312
exports.Unknown = Unknown;
313+
exports.GtidLog = GtidLog;

lib/code_map.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ const EventClass = {
4747
ROTATE_EVENT: events.Rotate,
4848
FORMAT_DESCRIPTION_EVENT: events.Format,
4949
XID_EVENT: events.Xid,
50+
GTID_LOG_EVENT: events.GtidLog,
5051

5152
TABLE_MAP_EVENT: events.TableMap,
5253
DELETE_ROWS_EVENT_V1: rowsEvents.DeleteRows,

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
},
99
"scripts": {
1010
"release": "pnpm changeset publish",
11-
"test": "tap -- --disable-coverage --allow-incomplete-coverage --allow-empty-coverage --jobs=1 --sequential test/suites.js",
11+
"test": "tap run -- --disable-coverage --allow-incomplete-coverage --jobs=1 --sequential test/suites.js",
1212
"format": "prettier --write ."
1313
},
1414
"repository": {

pnpm-workspace.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
packages:
2-
- 'lib/*'
2+
- './'
33
# exclude packages that are inside test directories
44
- '!test/*'

test/travis/runner.sh

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)