lukasz-antoniak commented on code in PR #1778:
URL:
https://github.com/apache/cassandra-gocql-driver/pull/1778#discussion_r1756307860
##########
cassandra_test.go:
##########
@@ -3288,3 +3288,46 @@ func TestQuery_NamedValues(t *testing.T) {
t.Fatal(err)
}
}
+
+func TestBatchKeyspaceField(t *testing.T) {
+ session := createSession(t)
+ defer session.Close()
+
+ if session.cfg.ProtoVersion < protoVersion5 {
+ t.Skip("keyspace for BATCH message is not supported in protocol
< 5")
+ }
+
+ err := createTable(session, "CREATE TABLE batch_keyspace(id int, value
text, PRIMARY KEY (id))")
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ ids := []int{1, 2}
+ texts := []string{"val1", "val2"}
+
+ b := session.NewBatch(LoggedBatch)
+ b.Query("INSERT INTO batch_keyspace(id, value) VALUES (?, ?)", ids[0],
texts[0])
Review Comment:
I see that my comment might not be understandable. You can simulate
hardcoding keyspace in CQL string itself. But, yeah it is not a very useful
test indeed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]