PostgreSQL: a string restriction value with a backslash does not match the stored value
Maintainer thường phản hồi trong vòng 5 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 78/100
Hướng nghiên cứu
Start with prep_value in condition.py and read tests/integration/test_restriction_values.py::test_string_with_backslash to understand how string values and JSON path restrictions are tested. Extend the test to PostgreSQL, then check the 2.4 release notes. Done when PostgreSQL matches stored backslash values for attributes and JSON paths, the existing MySQL check still passes, and the change is documented.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
On PostgreSQL, a string value in a dict restriction that contains a backslash does not match the row that stores that value. This holds for attributes and for JSON paths compared with a string.
prep_value in condition.py doubles every backslash in a string value on PostgreSQL before quoting it, as earlier releases did. PostgreSQL has standard_conforming_strings on by default, so in a plain '...' literal a backslash is an ordinary character. The doubled literal then names a different string.
Item.insert1(dict(item_id=5, name="back\\slash")) # stored: back\slash
Item & {"name": "back\\slash"} # MySQL: 1 row; PostgreSQL: 0 rows
Item & {"data.label": "back\\slash"} # same, for a JSON path
tests/integration/test_restriction_values.py::test_string_with_backslash asserts the match on MySQL only.
2.3.x keeps the current behavior, so that a patch release does not change which rows a restriction selects.
Proposal for 2.4
- Stop doubling backslashes in plain string values on PostgreSQL. Render them the way list values already are: as an
E'...'literal with escaped backslashes, which reads the same whetherstandard_conforming_stringsis on or off. - Extend
test_string_with_backslashto PostgreSQL. - Note the change in the 2.4 release notes: a string restriction with a backslash now matches the stored value on PostgreSQL.
- Ngôn ngữ chính
- Python
- Star
- 198
- Fork
- 107
- Merge trung bình
- 4 ngày 7 giờ
- Pull request đã merge (30 ngày)
- 12
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
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 datajoint/datajoint-python
-
bug triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
datajoint/datajoint-python#1775 ·
Maintainer thường phản hồi trong vòng 5 ngày
-
MySQL: with use_tls=False, 2.3.6 needs the cryptography package to log in to MySQL 8Có thể đã có người làm @dimitri-yatsenko đã nhận 5 ngày trước. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
datajoint/datajoint-python#1750 ·
Maintainer thường phản hồi trong vòng 5 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
datajoint/datajoint-python#1747 ·
Maintainer thường phản hồi trong vòng 5 ngày
-
Reject constant defaults on primary-key attributesCó thể đã có người làm @godara-alt đã nhận 4 ngày trước. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
datajoint/datajoint-python#1712 ·
Maintainer thường phản hồi trong vòng 5 ngày
-
Decoding a <blob> value in an unknown format returns None instead of raising an errorCó thể đã có người làm @godara-alt đã nhận 9 ngày trước. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
datajoint/datajoint-python#1703 ·
Maintainer thường phản hồi trong vòng 5 ngày
Tất cả issue của datajoint/datajoint-python
Issue tương tự
-
[Bug]: test_remote_realpath_uses_argument_vector fails on Windows with Python 3.13+ (ntpath.isabs)Có thể đã có người làm @gouyu-hou đã nhận hôm nay. Đang mởtriage/confirmed
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
agentscope-ai/agentscope#4397 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
area/profiles area/sessions comp/desktop desktop/chat desktop/sessions P2 type/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
NousResearch/hermes-agent#161712 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[New Check]: postgresql_flexible_server_public_network_access_disabledCó thể đã có người làm @pouria-l đã nhận hôm nay. Đang mởfeature-request status/needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
prowler-cloud/prowler#13615 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
SACGF/variantgrid#2941 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
linkedin/Liger-Kernel#1730 ·
Maintainer thường phản hồi trong vòng 3 ngày