PostgreSQL: a string restriction value with a backslash does not match the stored value
維護者通常 5 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 新手友好度
- 78/100
研究方向
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.
由索引模型根據 Issue 內容生成。
描述
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.
- 主要語言
- Python
- 星號
- 198
- 分支
- 107
- 平均合併
- 4 天 7 小時
- 30 天內合併 PR
- 12
環境準備
- 提供 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
datajoint/datajoint-python 的其他 Issue
-
bug triage
難度 2/5 1-3 小時 新手友好度 76/100
datajoint/datajoint-python#1775 ·
維護者通常 5 天內回覆
-
MySQL: with use_tls=False, 2.3.6 needs the cryptography package to log in to MySQL 8可能已有人在做 @dimitri-yatsenko 於 5 天前認領。 未關閉bug
難度 2/5 1-3 小時 新手友好度 74/100
datajoint/datajoint-python#1750 ·
維護者通常 5 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 78/100
datajoint/datajoint-python#1747 ·
維護者通常 5 天內回覆
-
Reject constant defaults on primary-key attributes可能已有人在做 @godara-alt 於 4 天前認領。 未關閉bug
難度 2/5 1-3 小時 新手友好度 84/100
datajoint/datajoint-python#1712 ·
維護者通常 5 天內回覆
-
Decoding a <blob> value in an unknown format returns None instead of raising an error可能已有人在做 @godara-alt 於 9 天前認領。 未關閉bug
難度 2/5 1-3 小時 新手友好度 78/100
datajoint/datajoint-python#1703 ·
維護者通常 5 天內回覆
查看 datajoint/datajoint-python 的全部 Issue
相似的 Issue
-
[Bug]: test_remote_realpath_uses_argument_vector fails on Windows with Python 3.13+ (ntpath.isabs)可能已有人在做 @gouyu-hou 今天認領。 未關閉triage/confirmed
難度 1/5 1 小時以內 新手友好度 90/100
agentscope-ai/agentscope#4397 ·
維護者通常 2 天內回覆
-
area/profiles area/sessions comp/desktop desktop/chat desktop/sessions P2 type/bug
難度 2/5 1-3 小時 新手友好度 75/100
NousResearch/hermes-agent#161712 ·
維護者通常 1 天內回覆
-
[New Check]: postgresql_flexible_server_public_network_access_disabled可能已有人在做 @pouria-l 今天認領。 未關閉feature-request status/needs-triage
難度 2/5 1-3 小時 新手友好度 78/100
prowler-cloud/prowler#13615 · 1 則留言 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 78/100
SACGF/variantgrid#2941 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 82/100
linkedin/Liger-Kernel#1730 ·
維護者通常 3 天內回覆