We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b2d723a commit 03ef43cCopy full SHA for 03ef43c
replication/event_test.go
@@ -140,3 +140,22 @@ func TestIntVarEvent(t *testing.T) {
140
require.Equal(t, INSERT_ID, ev.Type)
141
require.Equal(t, uint64(23), ev.Value)
142
}
143
+
144
+func TestDecodeSid(t *testing.T) {
145
+ testcases := []struct {
146
+ input []byte
147
+ gtidFormat GtidFormat
148
+ uuidCount uint64
149
+ }{
150
+ {[]byte{1, 2, 0, 0, 0, 0, 0, 1}, GtidFormatTagged, 2},
151
+ {[]byte{1, 1, 0, 0, 0, 0, 0, 1}, GtidFormatTagged, 1},
152
+ {[]byte{1, 0, 0, 0, 0, 0, 0, 1}, GtidFormatTagged, 0},
153
+ {[]byte{1, 0, 0, 0, 0, 0, 0, 0}, GtidFormatClassic, 1},
154
+ }
155
156
+ for _, tc := range testcases {
157
+ format, uuidCount := decodeSid(tc.input)
158
+ assert.Equal(t, tc.gtidFormat, format)
159
+ assert.Equal(t, tc.uuidCount, uuidCount)
160
161
+}
0 commit comments