Skip to content

Commit

Permalink
Fix geo-partition append test to use correct partitions
Browse files Browse the repository at this point in the history
  • Loading branch information
es1024 committed Nov 29, 2023
1 parent b25fff1 commit 6ead3c1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions yugabyte/src/yugabyte/ysql/append.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 6ead3c1

Please sign in to comment.