parameterized query with lookup ref returns different result to inlined lookup ref
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Bắt đầu bằng cách chạy bản tái hiện Clojure được cung cấp trên Datascript 0.18.8 và so sánh lookup ref được nội tuyến với dạng tham số hóa. Theo dõi các đường đi đánh giá query cho cả hai trường hợp; hoàn tất khi một lookup ref không hợp lệ có ngữ nghĩa nhất quán và hành vi này được bao phủ bởi một regression test.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
There's a bunch of similarly looking issues from the past but none seem to be this particular case. A bad lookup ref inside the query throws an exception but the same query returns an empty set when the lookup ref is passed in as a parameter. Since the resulting query is identical I'd expect the semantics to be identical too.
% clj -Sdeps '{:deps {datascript {:mvn/version "0.18.8"}}}'
Downloading: datascript/datascript/0.18.8/datascript-0.18.8.pom from https://repo.clojars.org/
Downloading: datascript/datascript/0.18.8/datascript-0.18.8.jar from https://repo.clojars.org/
Clojure 1.9.0
user=> (require '[datascript.core :as db])
nil
user=> (def s {:id {:db/unique :db.unique/identity}})
#'user/s
user=> (def c (db/create-conn s))
#'user/c
user=> (db/transact c [{:id :a}])
#object[datascript.core$transact$reify__3612 0x7f2c995b {:status :ready, :val #datascript.db.TxReport{:db-before #datascript/DB {:schema {:id #:db{:unique :db.unique/identity}}, :datoms []}, :db-after #datascript/DB {:schema {:id #:db{:unique :db.unique/identity}}, :datoms [[1 :id :a 536870913]]}, :tx-data [#datascript/Datom [1 :id :a 536870913 true]], :tempids #:db{:current-tx 536870913}, :tx-meta nil}}]
user=> (db/q '[:find ?id :where [[:id :b] :id ?id]] @c)
ExceptionInfo Nothing found for entity id [:id :b] clojure.core/ex-info (core.clj:4739)
user=> (db/q '[:find ?id :in $ ?idsel :where [?idsel :id ?id]] @c [:id :b])
#{}
- Ngôn ngữ chính
- Clojure
- Star
- 5.8k
- Fork
- 318
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của tonsky/datascript
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 42/100
tonsky/datascript#498 · 1 bình luận ·
-
Datascript MCP Server Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 10/100
tonsky/datascript#489 ·
-
Stack overflow when transacting :db.type/tupleAttrs with a :db.type/ref attr through :db.fn/call Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
tonsky/datascript#483 · 2 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
tonsky/datascript#470 · 1 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
tonsky/datascript#441 · 1 bình luận · 3 reaction ·
Tất cả issue của tonsky/datascript
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
-
.Team/Metabot Priority:P3
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
needs triage
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
scalar-labs/scalar-jepsen#222 · 1 bình luận ·