Skip to content

Commit

Permalink
correct giant key
Browse files Browse the repository at this point in the history
  • Loading branch information
huahaiy committed Jan 20, 2023
1 parent ed3c2e8 commit 6a3343a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Change Log

## 0.8.3 (2023-01-20)
## 0.8.4 (2023-01-20)
### Fixed
- [Datalog] error when large `:db/fulltext` value is added then removed in the same transaction.

Expand Down
4 changes: 2 additions & 2 deletions src/datalevin/storage.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@
(if (b/giant? i)
(let [max-gt (max-gt store)]
(advance-max-gt store)
(vswap! giants assoc e max-gt)
(vswap! giants assoc [e aid v] max-gt)
(when ft?
(let [v (str v)]
(when-not (str/blank? v) (conj! ft-ds [:g [max-gt v]]))))
Expand All @@ -608,7 +608,7 @@
v (.-v d)
i (b/indexable e aid v vt)
gt (when (b/giant? i)
(or (@giants e)
(or (@giants [e aid v])
(lmdb/get-value (.-lmdb store) c/eav i :eav :id)))]
(when (:db/fulltext props)
(let [v (str v)]
Expand Down
16 changes: 9 additions & 7 deletions test/datalevin/search_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -366,13 +366,15 @@
start (System/currentTimeMillis)]
(d/transact! conn data)
(is (< (- (System/currentTimeMillis) start) 5000))
(is (= 1 (count (d/fulltext-datoms (d/db conn)
"GraphstatsR" {:top 1000}))))
(is (= (d/q '[:find (count ?e) .
:in $ ?q
:where [(fulltext $ ?q {:top 1000}) [[?e _ _]]]]
(d/db conn) "GraphstatsR")
1))
(is (= 1 (count (d/fulltext-datoms (d/db conn) "GraphstatsR"))))
(is (= (update (d/q '[:find [?i ?d]
:in $ ?q
:where
[(fulltext $ ?q) [[?e _ ?d]]]
[?e :id ?i]]
(d/db conn) "GraphstatsR")
1 count)
[6299 508]))
(d/transact! conn [{:id 6299
:description "This is a new description"}])
(is (= (d/q '[:find ?d .
Expand Down

0 comments on commit 6a3343a

Please sign in to comment.