Merge fails with "syntax error" when a table's CHECK uses a jsonb operator and either side changed the schema
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 25/100
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Go
- Estrellas
- 2.2k
- Forks
- 93
- Merge medio
- 19 h 38 min
- PR fusionados (30 d)
- 132
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de dolthub/doltgresql
-
customer issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
dolthub/doltgresql#3969 ·
Los mantenedores suelen responder en 1 día
-
`CREATE TABLE ... TABLESPACE pg_default` fails: TABLESPACE is not yet supportedPosiblemente ocupada @draarivpatel-ui la tomó hace 1 día. Abiertocustomer issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
dolthub/doltgresql#3818 ·
Los mantenedores suelen responder en 1 día
-
customer issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
dolthub/doltgresql#3817 ·
Los mantenedores suelen responder en 1 día
-
Server crash (nil pointer in collationCompare) when filtering dolt_diff by a text primary keyAbiertocustomer issue
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
dolthub/doltgresql#3980 ·
Los mantenedores suelen responder en 1 día
-
customer issue
Dificultad 4/5 3-5 días Aptitud para principiantes 42/100
dolthub/doltgresql#3978 ·
Los mantenedores suelen responder en 1 día
Todos los issues de dolthub/doltgresql
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
kaiachain/kaia#1143 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
documentation factory:ready
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
-
good first issue spec
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
-
Go - Inconsistent Logs StabilityAbiertodocs
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
open-telemetry/opentelemetry.io#12846 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día