From 2e8d6e2371cbcb5f333a7ca9ea15ca63b7c8039f Mon Sep 17 00:00:00 2001 From: Eric Sheng Date: Fri, 1 Dec 2023 07:05:53 -0800 Subject: [PATCH] Fix geo-partition append test to use correct partitions (#110) --- yugabyte/src/yugabyte/ysql/append.clj | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/yugabyte/src/yugabyte/ysql/append.clj b/yugabyte/src/yugabyte/ysql/append.clj index b6bdc0ee4..ea4ba1fea 100644 --- a/yugabyte/src/yugabyte/ysql/append.clj +++ b/yugabyte/src/yugabyte/ysql/append.clj @@ -67,7 +67,7 @@ (defn geo-row-update [geo-partitioning v] (if (= geo-partitioning :geo) - (str ", geo_partition = '" (mod v 2) "a'") + (str "and geo_partition = '" (+' (mod v 2) 1) "a'") "")) (defn read-primary @@ -92,12 +92,12 @@ (Thread/sleep (rand-int 2000))) nil) r (c/execute! conn [(str "update " table - " set " col " = CONCAT(" col ", ',', ?)" (geo-row-update geo-partitioning v) " " - "where k = ?") v row])] + " set " col " = CONCAT(" col ", ',', ?)" + " where k = ? " (geo-row-update geo-partitioning row)) v row])] (when (= [0] r) ; No rows updated (if (= geo-partitioning :geo) - (insert-primary-geo conn table geo-partitioning col row v (str (mod v 2) "a")) + (insert-primary-geo conn table geo-partitioning col row v (str (+' (mod row 2) 1) "a")) (insert-primary conn table col row v))) v)) (defn read-secondary