mirror of
https://github.com/scylladb/scylladb.git
synced 2026-06-05 22:43:15 +00:00
This patch adds yet another test for Alternator's unimplemented feature of adding a GSI to an already existing table (issue #5022), but this test is for a very specific corner case - tables which contain string attributes with an empty value - the corner case described in issue #9424: DynamoDB used to forbid any string attributes from being set to an empty string, but this changed in May 2020, and since then empty strings are allowed - but NOT as keys. So although it is legal to set a string attribute to an empty string, if this table has a GSI whose key is that specific attribute, the update command is refused. We already had a test for this - test_gsi_empty_value. However, the case in this patch is the case where a GSI is added to a table *after* the table already has data. In this case (as this test demonstrates), we are supposed to drop the items which have the empty string key from the GSI. Even when #5022 (the ability to add GSIs to existing tables) will be done, this test will continue to fail. The unique problem of this test is that Scylla's materialized views *do* allow empty strings as clustering keys (right now) and even partition keys (after #9375 will be solved), while we don't want them to enter the GSI. We will probably need to add to the view's filter, which right now contains (as required) "x IS NOT NULL" also the filter "x != ''" (when x's type is a string or binary) so that items with empty-string keys will be dropped. Refs #5022 Refs #9375 Refs #9424 Signed-off-by: Nadav Har'El <nyh@scylladb.com> Message-Id: <20211003170636.477582-1-nyh@scylladb.com>