Skip to content

Commit 9599d97

Browse files
committed
Merge remote-tracking branch 'upstream/main' into mhamza/pool-reuse
Signed-off-by: Mohamed Hamza <[email protected]>
2 parents 0958e29 + 55564ca commit 9599d97

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

go/test/endtoend/preparestmt/stmt_methods_test.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,23 @@ func TestBinaryColumn(t *testing.T) {
444444
require.NoError(t, err)
445445
}
446446

447+
// TestInsertTest inserts a row with empty json array.
448+
func TestInsertTest(t *testing.T) {
449+
dbo := Connect(t, "interpolateParams=false")
450+
defer dbo.Close()
451+
452+
stmt, err := dbo.Prepare(`insert into vt_prepare_stmt_test(id, keyspace_id, json_col) values( null, ?, ?)`)
453+
require.NoError(t, err)
454+
455+
res, err := stmt.Exec(1, "[]")
456+
require.NoError(t, err)
457+
458+
ra, err := res.RowsAffected()
459+
require.NoError(t, err)
460+
461+
assert.Equal(t, int64(1), ra)
462+
}
463+
447464
// TestSpecializedPlan tests the specialized plan generation for the query.
448465
func TestSpecializedPlan(t *testing.T) {
449466
dbInfo.KeyspaceName = sks

go/test/endtoend/vtgate/queries/dml/insert_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,8 @@ func TestInsertJson(t *testing.T) {
517517
utils.Exec(t, mcmp.VtConn, `insert into uks.j_utbl(id, jdoc) select * from sks.j_tbl`)
518518
utils.AssertMatches(t, mcmp.VtConn, `select * from uks.j_utbl order by id`,
519519
`[[INT64(1) JSON("{}")] [INT64(2) JSON("{\"a\": 1, \"b\": 2}")] [INT64(3) JSON("{\"k\": \"a\"}")] [INT64(4) JSON("{\"date\": 1629849600, \"keywordSourceId\": 930701976723823, \"keywordSourceVersionId\": 210825230433}")]]`)
520+
521+
mcmp.Exec(`insert into j_tbl(id, jdoc) values (10, '{}'), (20, "[]")`)
520522
}
521523

522524
func TestInsertIgnoreNullAndInsertNull(t *testing.T) {

test/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@
197197
"Manual": false,
198198
"Shard": "12",
199199
"RetryMax": 1,
200-
"Tags": []
200+
"Tags": ["upgrade_downgrade_query_serving_queries"]
201201
},
202202
"mysql_server": {
203203
"File": "unused.go",

0 commit comments

Comments
 (0)