Skip to content

Commit 72de05b

Browse files
dbussinkfrouiouisystay
authored
Partially revert the binary encoding logic for safer upgrade (#18200)
Signed-off-by: Dirkjan Bussink <[email protected]> Signed-off-by: Florent Poinsard <[email protected]> Signed-off-by: Andres Taylor <[email protected]> Co-authored-by: Florent Poinsard <[email protected]> Co-authored-by: Andres Taylor <[email protected]>
1 parent 02a4b14 commit 72de05b

File tree

17 files changed

+216
-233
lines changed

17 files changed

+216
-233
lines changed

changelog/22.0/22.0.0/summary.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
### Table of Contents
44

55
- **[Major Changes](#major-changes)**
6-
- **[Upgrade Path from v21](#upgrade-from-v21)**
76
- **[Deprecations](#deprecations)**
87
- [Metrics](#deprecated-metrics)
98
- [CLI Flags](#deprecated-cli-flags)
@@ -46,15 +45,6 @@
4645

4746
## <a id="major-changes"/>Major Changes</a>
4847

49-
### <a id="upgrade-from-v21"/>Upgrade Path from v21</a>
50-
51-
For end-users using prepared statements along with JSON type values, upgrading to v22.0.0 is slightly different from previous versions.
52-
53-
Pull Request [#16988](https://github.com/vitessio/vitess/pull/16988) causes an issue ([#18143](https://github.com/vitessio/vitess/issues/18143))
54-
when upgrading VTTablet to v22.0.0 first while using prepared statements and JSON type values.
55-
56-
If you are in this category, it is recommended to upgrade VTGate first, followed by VTTablet.
57-
5848
### <a id="deprecations"/>Deprecations</a>
5949

6050
#### <a id="deprecated-metrics"/>Metrics</a>

go/sqltypes/value.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -508,8 +508,6 @@ func (v Value) EncodeSQL(b BinWriter) {
508508
switch {
509509
case v.Type() == Null:
510510
b.Write(NullBytes)
511-
case v.IsBinary():
512-
encodeBinarySQL(v.val, b)
513511
case v.IsQuoted():
514512
encodeBytesSQL(v.val, b)
515513
case v.Type() == Bit:
@@ -525,8 +523,6 @@ func (v Value) EncodeSQLStringBuilder(b *strings.Builder) {
525523
switch {
526524
case v.Type() == Null:
527525
b.Write(NullBytes)
528-
case v.IsBinary():
529-
encodeBinarySQLStringBuilder(v.val, b)
530526
case v.IsQuoted():
531527
encodeBytesSQLStringBuilder(v.val, b)
532528
case v.Type() == Bit:
@@ -553,8 +549,6 @@ func (v Value) EncodeSQLBytes2(b *bytes2.Buffer) {
553549
switch {
554550
case v.Type() == Null:
555551
b.Write(NullBytes)
556-
case v.IsBinary():
557-
encodeBinarySQLBytes2(v.val, b)
558552
case v.IsQuoted():
559553
encodeBytesSQLBytes2(v.val, b)
560554
case v.Type() == Bit:

go/sqltypes/value_test.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import (
2222
"testing"
2323

2424
"github.com/stretchr/testify/assert"
25-
2625
"github.com/stretchr/testify/require"
2726

2827
"vitess.io/vitess/go/bytes2"
@@ -380,7 +379,7 @@ func TestEncode(t *testing.T) {
380379
outSQL: "'\\0\\'\"\\b\\n\\r\\t\\Z\\\\'",
381380
}, {
382381
in: TestValue(VarBinary, "\x00'\"\b\n\r\t\x1A\\"),
383-
outSQL: "_binary'\\0\\'\"\\b\\n\\r\\t\\Z\\\\'",
382+
outSQL: "'\\0\\'\"\\b\\n\\r\\t\\Z\\\\'",
384383
}, {
385384
in: TestValue(Bit, "a"),
386385
outSQL: "b'01100001'",
@@ -635,7 +634,7 @@ func TestEncodeSQLStringBuilder(t *testing.T) {
635634
outSQL: "(1, 'foo')",
636635
}, {
637636
in: TestValue(VarBinary, "foo"),
638-
outSQL: "_binary'foo'",
637+
outSQL: "'foo'",
639638
}}
640639
for _, tcase := range testcases {
641640
var buf strings.Builder

go/test/endtoend/transaction/twopc/twopc_test.go

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1551,10 +1551,10 @@ func TestVindexes(t *testing.T) {
15511551
},
15521552
logExpected: map[string][]string{
15531553
"ks.redo_statement:80-": {
1554-
"insert:[VARCHAR(\"dtid-3\") INT64(1) BLOB(\"delete from lookup where col = 4 and id = 6 and keyspace_id = _binary'`\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0' limit 10001\")]",
1555-
"insert:[VARCHAR(\"dtid-3\") INT64(2) BLOB(\"insert into lookup(col, id, keyspace_id) values (9, 6, _binary'`\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0')\")]",
1556-
"delete:[VARCHAR(\"dtid-3\") INT64(1) BLOB(\"delete from lookup where col = 4 and id = 6 and keyspace_id = _binary'`\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0' limit 10001\")]",
1557-
"delete:[VARCHAR(\"dtid-3\") INT64(2) BLOB(\"insert into lookup(col, id, keyspace_id) values (9, 6, _binary'`\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0')\")]",
1554+
"insert:[VARCHAR(\"dtid-3\") INT64(1) BLOB(\"delete from lookup where col = 4 and id = 6 and keyspace_id = '`\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0' limit 10001\")]",
1555+
"insert:[VARCHAR(\"dtid-3\") INT64(2) BLOB(\"insert into lookup(col, id, keyspace_id) values (9, 6, '`\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0')\")]",
1556+
"delete:[VARCHAR(\"dtid-3\") INT64(1) BLOB(\"delete from lookup where col = 4 and id = 6 and keyspace_id = '`\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0' limit 10001\")]",
1557+
"delete:[VARCHAR(\"dtid-3\") INT64(2) BLOB(\"insert into lookup(col, id, keyspace_id) values (9, 6, '`\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0')\")]",
15581558
},
15591559
"ks.twopc_lookup:40-80": {
15601560
"update:[INT64(6) INT64(9) INT64(9)]",
@@ -1579,10 +1579,10 @@ func TestVindexes(t *testing.T) {
15791579
},
15801580
logExpected: map[string][]string{
15811581
"ks.redo_statement:80-": {
1582-
"insert:[VARCHAR(\"dtid-3\") INT64(1) BLOB(\"delete from lookup_unique where col_unique = 9 and keyspace_id = _binary'`\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0' limit 10001\")]",
1583-
"insert:[VARCHAR(\"dtid-3\") INT64(2) BLOB(\"insert into lookup_unique(col_unique, keyspace_id) values (20, _binary'`\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0')\")]",
1584-
"delete:[VARCHAR(\"dtid-3\") INT64(1) BLOB(\"delete from lookup_unique where col_unique = 9 and keyspace_id = _binary'`\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0' limit 10001\")]",
1585-
"delete:[VARCHAR(\"dtid-3\") INT64(2) BLOB(\"insert into lookup_unique(col_unique, keyspace_id) values (20, _binary'`\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0')\")]",
1582+
"insert:[VARCHAR(\"dtid-3\") INT64(1) BLOB(\"delete from lookup_unique where col_unique = 9 and keyspace_id = '`\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0' limit 10001\")]",
1583+
"insert:[VARCHAR(\"dtid-3\") INT64(2) BLOB(\"insert into lookup_unique(col_unique, keyspace_id) values (20, '`\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0')\")]",
1584+
"delete:[VARCHAR(\"dtid-3\") INT64(1) BLOB(\"delete from lookup_unique where col_unique = 9 and keyspace_id = '`\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0' limit 10001\")]",
1585+
"delete:[VARCHAR(\"dtid-3\") INT64(2) BLOB(\"insert into lookup_unique(col_unique, keyspace_id) values (20, '`\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0')\")]",
15861586
},
15871587
"ks.twopc_lookup:40-80": {
15881588
"update:[INT64(6) INT64(4) INT64(20)]",
@@ -1607,10 +1607,10 @@ func TestVindexes(t *testing.T) {
16071607
},
16081608
logExpected: map[string][]string{
16091609
"ks.redo_statement:80-": {
1610-
"insert:[VARCHAR(\"dtid-3\") INT64(1) BLOB(\"delete from lookup where col = 4 and id = 6 and keyspace_id = _binary'`\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0' limit 10001\")]",
1611-
"insert:[VARCHAR(\"dtid-3\") INT64(2) BLOB(\"delete from lookup_unique where col_unique = 9 and keyspace_id = _binary'`\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0' limit 10001\")]",
1612-
"delete:[VARCHAR(\"dtid-3\") INT64(1) BLOB(\"delete from lookup where col = 4 and id = 6 and keyspace_id = _binary'`\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0' limit 10001\")]",
1613-
"delete:[VARCHAR(\"dtid-3\") INT64(2) BLOB(\"delete from lookup_unique where col_unique = 9 and keyspace_id = _binary'`\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0' limit 10001\")]",
1610+
"insert:[VARCHAR(\"dtid-3\") INT64(1) BLOB(\"delete from lookup where col = 4 and id = 6 and keyspace_id = '`\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0' limit 10001\")]",
1611+
"insert:[VARCHAR(\"dtid-3\") INT64(2) BLOB(\"delete from lookup_unique where col_unique = 9 and keyspace_id = '`\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0' limit 10001\")]",
1612+
"delete:[VARCHAR(\"dtid-3\") INT64(1) BLOB(\"delete from lookup where col = 4 and id = 6 and keyspace_id = '`\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0' limit 10001\")]",
1613+
"delete:[VARCHAR(\"dtid-3\") INT64(2) BLOB(\"delete from lookup_unique where col_unique = 9 and keyspace_id = '`\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0' limit 10001\")]",
16141614
},
16151615
"ks.twopc_lookup:40-80": {
16161616
"delete:[INT64(6) INT64(4) INT64(9)]",
@@ -1637,8 +1637,8 @@ func TestVindexes(t *testing.T) {
16371637
},
16381638
logExpected: map[string][]string{
16391639
"ks.redo_statement:80-": {
1640-
"insert:[VARCHAR(\"dtid-3\") INT64(1) BLOB(\"insert into lookup(col, id, keyspace_id) values (4, 20, _binary'(\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0')\")]",
1641-
"delete:[VARCHAR(\"dtid-3\") INT64(1) BLOB(\"insert into lookup(col, id, keyspace_id) values (4, 20, _binary'(\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0')\")]",
1640+
"insert:[VARCHAR(\"dtid-3\") INT64(1) BLOB(\"insert into lookup(col, id, keyspace_id) values (4, 20, '(\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0')\")]",
1641+
"delete:[VARCHAR(\"dtid-3\") INT64(1) BLOB(\"insert into lookup(col, id, keyspace_id) values (4, 20, '(\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0')\")]",
16421642
},
16431643
"ks.lookup:80-": {
16441644
"insert:[INT64(4) INT64(20) VARBINARY(\"(\\x00\\x00\\x00\\x00\\x00\\x00\\x00\")]",
@@ -1667,17 +1667,17 @@ func TestVindexes(t *testing.T) {
16671667
},
16681668
logExpected: map[string][]string{
16691669
"ks.redo_statement:80-": {
1670-
"insert:[VARCHAR(\"dtid-3\") INT64(1) BLOB(\"insert into lookup(col, id, keyspace_id) values (4, 20, _binary'(\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0')\")]",
1671-
"insert:[VARCHAR(\"dtid-3\") INT64(2) BLOB(\"delete from lookup where col = 4 and id = 6 and keyspace_id = _binary'`\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0' limit 10001\")]",
1672-
"insert:[VARCHAR(\"dtid-3\") INT64(3) BLOB(\"insert into lookup(col, id, keyspace_id) values (9, 6, _binary'`\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0')\")]",
1673-
"insert:[VARCHAR(\"dtid-3\") INT64(4) BLOB(\"delete from lookup where col = 4 and id = 9 and keyspace_id = _binary'\\x90\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0' limit 10001\")]",
1674-
"insert:[VARCHAR(\"dtid-3\") INT64(5) BLOB(\"delete from lookup_unique where col_unique = 4 and keyspace_id = _binary'\\x90\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0' limit 10001\")]",
1670+
"insert:[VARCHAR(\"dtid-3\") INT64(1) BLOB(\"insert into lookup(col, id, keyspace_id) values (4, 20, '(\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0')\")]",
1671+
"insert:[VARCHAR(\"dtid-3\") INT64(2) BLOB(\"delete from lookup where col = 4 and id = 6 and keyspace_id = '`\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0' limit 10001\")]",
1672+
"insert:[VARCHAR(\"dtid-3\") INT64(3) BLOB(\"insert into lookup(col, id, keyspace_id) values (9, 6, '`\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0')\")]",
1673+
"insert:[VARCHAR(\"dtid-3\") INT64(4) BLOB(\"delete from lookup where col = 4 and id = 9 and keyspace_id = '\\x90\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0' limit 10001\")]",
1674+
"insert:[VARCHAR(\"dtid-3\") INT64(5) BLOB(\"delete from lookup_unique where col_unique = 4 and keyspace_id = '\\x90\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0' limit 10001\")]",
16751675
"insert:[VARCHAR(\"dtid-3\") INT64(6) BLOB(\"delete from twopc_lookup where id = 9 limit 10001 /* INT64 */\")]",
1676-
"delete:[VARCHAR(\"dtid-3\") INT64(1) BLOB(\"insert into lookup(col, id, keyspace_id) values (4, 20, _binary'(\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0')\")]",
1677-
"delete:[VARCHAR(\"dtid-3\") INT64(2) BLOB(\"delete from lookup where col = 4 and id = 6 and keyspace_id = _binary'`\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0' limit 10001\")]",
1678-
"delete:[VARCHAR(\"dtid-3\") INT64(3) BLOB(\"insert into lookup(col, id, keyspace_id) values (9, 6, _binary'`\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0')\")]",
1679-
"delete:[VARCHAR(\"dtid-3\") INT64(4) BLOB(\"delete from lookup where col = 4 and id = 9 and keyspace_id = _binary'\\x90\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0' limit 10001\")]",
1680-
"delete:[VARCHAR(\"dtid-3\") INT64(5) BLOB(\"delete from lookup_unique where col_unique = 4 and keyspace_id = _binary'\\x90\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0' limit 10001\")]",
1676+
"delete:[VARCHAR(\"dtid-3\") INT64(1) BLOB(\"insert into lookup(col, id, keyspace_id) values (4, 20, '(\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0')\")]",
1677+
"delete:[VARCHAR(\"dtid-3\") INT64(2) BLOB(\"delete from lookup where col = 4 and id = 6 and keyspace_id = '`\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0' limit 10001\")]",
1678+
"delete:[VARCHAR(\"dtid-3\") INT64(3) BLOB(\"insert into lookup(col, id, keyspace_id) values (9, 6, '`\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0')\")]",
1679+
"delete:[VARCHAR(\"dtid-3\") INT64(4) BLOB(\"delete from lookup where col = 4 and id = 9 and keyspace_id = '\\x90\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0' limit 10001\")]",
1680+
"delete:[VARCHAR(\"dtid-3\") INT64(5) BLOB(\"delete from lookup_unique where col_unique = 4 and keyspace_id = '\\x90\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0\\\\0' limit 10001\")]",
16811681
"delete:[VARCHAR(\"dtid-3\") INT64(6) BLOB(\"delete from twopc_lookup where id = 9 limit 10001 /* INT64 */\")]",
16821682
},
16831683
"ks.redo_statement:40-80": {

go/test/endtoend/vtgate/queries/vexplain/vexplain_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ func TestVtGateVExplain(t *testing.T) {
7575
"vexplain queries/all will actually run queries")
7676

7777
binaryPrefix := ""
78-
if utils.BinaryIsAtLeastAtVersion(22, "vtgate") {
78+
if utils.BinaryIsAtLeastAtVersion(23, "vtgate") {
7979
binaryPrefix = "_binary"
8080
}
8181

go/vt/sqlparser/encodable_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ func TestEncodable(t *testing.T) {
4444
sqltypes.NewInt64(2),
4545
sqltypes.NewVarBinary("bar(`b`)"),
4646
}},
47-
out: "(1, _binary'foo(\\'a\\')'), (2, _binary'bar(`b`)')",
47+
out: "(1, 'foo(\\'a\\')'), (2, 'bar(`b`)')",
4848
}, {
4949
// Single column.
5050
in: &TupleEqualityList{

go/vt/vtgate/evalengine/translate_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ func TestTranslateSimplification(t *testing.T) {
8989
{"coalesce(NULL, 2, NULL, 4)", ok("coalesce(null, 2, null, 4)"), ok("2")},
9090
{"coalesce(NULL, NULL)", ok("coalesce(null, null)"), ok("null")},
9191
{"coalesce(NULL)", ok("coalesce(null)"), ok("null")},
92-
{"weight_string('foobar')", ok(`weight_string('foobar')`), ok("_binary'\x1c\xe5\x1d\xdd\x1d\xdd\x1c`\x1cG\x1e3'")},
93-
{"weight_string('foobar' as char(12))", ok(`weight_string('foobar' as char(12))`), ok("_binary'\x1c\xe5\x1d\xdd\x1d\xdd\x1c`\x1cG\x1e3'")},
92+
{"weight_string('foobar')", ok(`weight_string('foobar')`), ok("'\x1c\xe5\x1d\xdd\x1d\xdd\x1c`\x1cG\x1e3'")},
93+
{"weight_string('foobar' as char(12))", ok(`weight_string('foobar' as char(12))`), ok("'\x1c\xe5\x1d\xdd\x1d\xdd\x1c`\x1cG\x1e3'")},
9494
{"case when 1 = 1 then 2 else 3 end", ok("case when 1 = 1 then 2 else 3"), ok("2")},
9595
{"case when null then 2 when 12 = 4 then 'ohnoes' else 42 end", ok(`case when null then 2 when 12 = 4 then 'ohnoes' else 42`), ok(`'42'`)},
9696
{"convert('a', char(2) character set utf8mb4)", ok(`convert('a', CHAR(2) character set utf8mb4_0900_ai_ci)`), ok(`'a'`)},

go/vt/vtgate/planbuilder/testdata/dml_cases.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3010,7 +3010,7 @@
30103010
"Query": "delete from `user` where `name` = _binary 'abc'",
30113011
"Table": "user",
30123012
"Values": [
3013-
"_binary'abc'"
3013+
"'abc'"
30143014
],
30153015
"Vindex": "name_user_map"
30163016
},

go/vt/vtgate/planbuilder/testdata/select_cases.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1144,7 +1144,7 @@
11441144
"Query": "select * from `user` where id = 0x04",
11451145
"Table": "`user`",
11461146
"Values": [
1147-
"_binary'\u0004'"
1147+
"'\u0004'"
11481148
],
11491149
"Vindex": "user_index"
11501150
},

go/vt/vttablet/endtoend/twopc/prepare_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ func TestCommitPreparedFailNonRetryable(t *testing.T) {
6464

6565
qr, err := client2.Execute("select dtid, state, message from _vt.redo_state where dtid = 'bb'", nil)
6666
require.NoError(t, err)
67-
require.Equal(t, `[[VARBINARY("bb") INT64(0) TEXT("Lock wait timeout exceeded; try restarting transaction (errno 1205) (sqlstate HY000) during query: delete from _vt.redo_state where dtid = _binary'bb'")]]`, fmt.Sprintf("%v", qr.Rows))
67+
require.Equal(t, `[[VARBINARY("bb") INT64(0) TEXT("Lock wait timeout exceeded; try restarting transaction (errno 1205) (sqlstate HY000) during query: delete from _vt.redo_state where dtid = 'bb'")]]`, fmt.Sprintf("%v", qr.Rows))
6868
}
6969

7070
// TestCommitPreparedFailRetryable tests the case where the commit_prepared fails when the query is killed.
@@ -81,7 +81,7 @@ func TestCommitPreparedFailRetryable(t *testing.T) {
8181
require.NoError(t, err)
8282

8383
client2 := framework.NewClient()
84-
_, err = client2.BeginExecute(`select * from _vt.redo_state where dtid = _binary'aa' for update`, nil, nil)
84+
_, err = client2.BeginExecute(`select * from _vt.redo_state where dtid = 'aa' for update`, nil, nil)
8585
require.NoError(t, err)
8686

8787
ch := make(chan any)
@@ -103,7 +103,7 @@ func TestCommitPreparedFailRetryable(t *testing.T) {
103103
client2.Release()
104104
<-ch
105105

106-
qr, err := client2.Execute("select dtid, state, message from _vt.redo_state where dtid = _binary'aa'", nil)
106+
qr, err := client2.Execute("select dtid, state, message from _vt.redo_state where dtid = 'aa'", nil)
107107
require.NoError(t, err)
108-
require.Equal(t, `[[VARBINARY("aa") INT64(1) TEXT("Query execution was interrupted (errno 1317) (sqlstate 70100) during query: delete from _vt.redo_state where dtid = _binary'aa'")]]`, fmt.Sprintf("%v", qr.Rows))
108+
require.Equal(t, `[[VARBINARY("aa") INT64(1) TEXT("Query execution was interrupted (errno 1317) (sqlstate 70100) during query: delete from _vt.redo_state where dtid = 'aa'")]]`, fmt.Sprintf("%v", qr.Rows))
109109
}

0 commit comments

Comments
 (0)