Skip to content

Commit

Permalink
YugaByte append test: experiment with using unique instead of pkeys
Browse files Browse the repository at this point in the history
  • Loading branch information
aphyr committed Aug 2, 2019
1 parent 23dbb5e commit 65580e1
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions yugabyte/src/yugabyte/ysql/append.clj
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@
; on conflict, in postgres, needs fully qualified
; column names.
[(str "insert into " table " (k, v) values (?, ?) "
"on conflict (k) do update set "
; I think on conflict here breaks *some* of the
; time, but not always, when we use a unique
; constraint instead of primary key.
; "on conflict (k) do update set "
"on conflict on constraint append_k_key do update set "
"v = CONCAT(" table ".v, ',', ?)")
k (str v) (str v)])
v))])
Expand All @@ -46,9 +50,9 @@

(setup-cluster! [this test c conn-wrapper]
(c/execute! c (j/create-table-ddl table
[[:k :int]
[:v :text]
["PRIMARY KEY" "(k)"]])))
[[:k :int "unique"]
[:v :text]])))
;["PRIMARY KEY" "(k)"]])))

(invoke-op! [this test op c conn-wrapper]
(let [txn (:value op)
Expand Down

0 comments on commit 65580e1

Please sign in to comment.