citusdata / citusdata/citus

wrongly raised syntax error with INSERT ... VALUES(DEFAULT)

Open
#4,019 0 comments 0 reactions 0 assignees View on GitHub
bug sqlancer
Dominant language
C
Stars
12.8k
Forks
794
Avg merge
2d 14h
Merged PRs (30d)
31

Description

```
CREATE TABLE t0(c0 int);
SELECT create_reference_table('t0');
INSERT INTO t0(c0) OVERRIDING SYSTEM VALUE VALUES(DEFAULT);
ERROR: syntax error at or near "DEFAULT"
```
While the INSERT command above runs on local tables, it raises an error in reference tables. The error occurs when the INSERT command is made with no DEFAULT value defined, and there is a preceding "OVERRIDING SYSTEM VALUE". This causes the command sent to worker nodes to have wrong syntax. I have attached log outputs of the commands sent to workers both in the case where "OVERRIDING SYSTEM VALUES" is omitted and included, for comparison.
The expected behavior mimicking a local table would be to add an empty row in this case, since no DEFAULT value was defined while creating the table.

[defaultbug output.txt](https://github.com/citusdata/citus/files/4902837/defaultbug.output.txt)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.