mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-02 14:15:46 +00:00
LWT batches conditions can't span multiple tables.
This was detected in batch_statement::validate() called in ::prepare().
But ::cas_result_set_metadata() was built in the constructor,
causing a bitset assert/crash in a reported scenario.
This patch moves validate() to the constructor before building metadata.
Closes #6332
Tested with https://github.com/scylladb/scylla-dtest/pull/1465
[avi: adjust spelling of exception message to 4.0 spelling]
Signed-off-by: Alejo Sanchez <alejo.sanchez@scylladb.com>
(cherry picked from commit d1521e6721)
25 lines
519 B
Plaintext
25 lines
519 B
Plaintext
CREATE KEYSPACE k WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1};
|
|
{
|
|
"status" : "ok"
|
|
}
|
|
USE k;
|
|
{
|
|
"status" : "ok"
|
|
}
|
|
CREATE TABLE t1 (userid int PRIMARY KEY);
|
|
{
|
|
"status" : "ok"
|
|
}
|
|
CREATE TABLE t2 (userid int PRIMARY KEY);
|
|
{
|
|
"status" : "ok"
|
|
}
|
|
BEGIN BATCH
|
|
INSERT INTO t1 (userid) VALUES (1) IF NOT EXISTS
|
|
INSERT INTO t2 (userid) VALUES (1) IF NOT EXISTS
|
|
APPLY BATCH;
|
|
{
|
|
"message" : "exceptions::invalid_request_exception (Batch with conditions cannot span multiple tables)",
|
|
"status" : "error"
|
|
}
|