Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix geo-partition append test to use correct partitions #110

Merged
merged 1 commit into from
Dec 1, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading