Merge fails with "syntax error" when a table's CHECK uses a jsonb operator and either side changed the schema
Maintainer thường phản hồi trong vòng 1 ngày
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
- 25/100
Hướng nghiên cứu
Reproduce with the setup SQL in the issue against doltgresql: create the table with the jsonb CHECK, branch to src and dst, change the schema on src, change data on dst, then run dolt_merge. Find where the syntax error is raised during the merge, since the same history without a CHECK succeeds. Done when the merge completes for the ->>, -> and ? cases and the @> refusal is addressed or split out.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Doltgres version: 1.5.1
Setup:
CREATE TABLE objects (
id text PRIMARY KEY,
project_id text NOT NULL,
body jsonb NOT NULL,
CHECK (body->>'left' <> 'forbidden')
);
INSERT INTO objects VALUES ('r1', 'p1', '{"left": "a"}');
SELECT dolt_commit('-Am', 'base');
SELECT dolt_branch('dst');
SELECT dolt_branch('src');
On src, change the schema:
-- connected to src
ALTER TABLE objects ADD COLUMN extra text;
UPDATE objects SET extra = 'x' WHERE id = 'r1';
SELECT dolt_commit('-Am', 'add column');
On dst, change any data:
-- connected to dst
UPDATE objects SET project_id = 'p2' WHERE id = 'r1';
SELECT dolt_commit('-Am', 'edit');
SELECT dolt_merge('src');
Expected: the merge succeeds, because the two changes do not conflict.
Actual: ERROR: syntax error at position 18 near 'body' (SQLSTATE XX000). Nothing is merged.
Observations:
- The
->operator fails the same way. With?(CHECK (body ? 'left')), the message issyntax error at position 16 near ':v1'. - It also fails when the source drops a column, when the source adds the CHECK itself, and when only the destination added a column while the source changed data.
- These succeed: the same history with no CHECK, a function-form CHECK (
CHECK (jsonb_typeof(body) = 'object')), data-only changes on both sides, and a merge into a destination with no change since the merge base. - Separately, a CHECK using
@>cannot hold a row: the first INSERT fails withJSON contains is not yet supported. - The same refusal occurs inside an explicit transaction (
BEGINbeforedolt_merge), so it does not depend on autocommit.
- Ngôn ngữ chính
- Go
- Star
- 2.2k
- Fork
- 93
- Merge trung bình
- 19 giờ 38 phút
- Pull request đã merge (30 ngày)
- 132
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 dolthub/doltgresql
-
customer issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
dolthub/doltgresql#3969 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
`CREATE TABLE ... TABLESPACE pg_default` fails: TABLESPACE is not yet supportedCó thể đã có người làm @draarivpatel-ui đã nhận 1 ngày trước. Đang mởcustomer issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
dolthub/doltgresql#3818 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
customer issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
dolthub/doltgresql#3817 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Server crash (nil pointer in collationCompare) when filtering dolt_diff by a text primary keyĐang mởcustomer issue
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
dolthub/doltgresql#3980 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
customer issue
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 42/100
dolthub/doltgresql#3978 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của dolthub/doltgresql
Issue tương tự
-
good first issue spec
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
-
Go - Inconsistent Logs StabilityĐang mởdocs
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
open-telemetry/opentelemetry.io#12846 ·
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 72/100
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 62/100
hivecommons/hive#19912 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
kind/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày