You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
psql tab-completion shows "INVISIBLEINCREMENT" instead of separate "INVISIBLE" and "INCREMENT" options #1135
When using psql tab completion for ALTER TABLE <table> ALTER COLUMN <col> SET command, the completion shows INVISIBLEINCREMENT as a single option instead of separate INVISIBLE and INCREMENT options.
Example:
ivorysql=# alter table itest1 alter column a set
( COMPRESSION DATA TYPE EXPRESSION INVISIBLEINCREMENT MINVALUE NOT NULL STATISTICS
CACHE CYCLE DEFAULT GENERATED MAXVALUE NO START STORAGE
Expected behavior/code
The tab completion should display INVISIBLE and INCREMENT as two separate options:
ivorysql=# alter table itest1 alter column a set
( COMPRESSION DATA TYPE EXPRESSION INVISIBLE MINVALUE NOT NULL STATISTICS
CACHE CYCLE DEFAULT GENERATED INCREMENT MAXVALUE NO START STORAGE
Step to reproduce
Connect to IvorySQL using psql in Oracle mode
Create a table: CREATE TABLE itest1 (a int, b text);
Type: ALTER TABLE itest1 ALTER COLUMN a SET and press TAB
Observe that INVISIBLEINCREMENT appears as a single option
Additional context that can be helpful for identifying the problem
The bug is caused by a missing comma in src/bin/psql/tab-complete.in.c at line 2925.
Before (buggy):
COMPLETE_WITH("(", "COMPRESSION", "DATA TYPE", "DEFAULT", "EXPRESSION", "GENERATED", "NOT NULL", "STATISTICS", "STORAGE", "INVISIBLE"
/* a subset of ALTER SEQUENCE options */
"INCREMENT", "MINVALUE", "MAXVALUE", "START", "NO", "CACHE", "CYCLE");
After (fixed):
COMPLETE_WITH("(", "COMPRESSION", "DATA TYPE", "DEFAULT", "EXPRESSION", "GENERATED", "NOT NULL", "STATISTICS", "STORAGE", "INVISIBLE",
/* a subset of ALTER SEQUENCE options */
"INCREMENT", "MINVALUE", "MAXVALUE", "START", "NO", "CACHE", "CYCLE");
In C, adjacent string literals without a comma are automatically concatenated, so "INVISIBLE" "INCREMENT" becomes "INVISIBLEINCREMENT".
This bug was introduced in commit 510fd2a when adding invisible column support.
Activity