Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[YSQL] Unexpected error " unexpected varattno 5 in expression to be mapped" after columns are dropped in table and a new partition is added #22393

Open
1 task done
ajcaldera1 opened this issue May 14, 2024 · 0 comments
Assignees
Labels
area/ysql Yugabyte SQL (YSQL) kind/bug This issue is a bug priority/medium Medium priority issue status/awaiting-triage Issue awaiting triage

Comments

@ajcaldera1
Copy link
Contributor

ajcaldera1 commented May 14, 2024

Jira Link: DB-11292

Description

Given the following schema:

create table part_column_drop (
  useless_1 int,
  id int,
  useless_2 int,
  d int,
  b int,
  useless_3 int
) partition by range (id);

If I apply the following script to it that drops the 'useless_x' columns and adds a secondary partial index, and then add partition to the table, I get a "unexpected varattno 5 in expression to be mapped" error.

Script:

alter table part_column_drop drop column useless_1;
alter table part_column_drop drop column useless_2;
alter table part_column_drop drop column useless_3;
create index part_column_drop_b_pred on part_column_drop(b) where b = 1;
create table part_column_drop_1_10 partition of part_column_drop for values from (1) to (10);

Output:

create table part_column_drop (
  useless_1 int,
  id int,
  useless_2 int,
  d int,
  b int,
  useless_3 int
) partition by range (id);
CREATE TABLE
alter table part_column_drop drop column useless_1;
ALTER TABLE
alter table part_column_drop drop column useless_2;
ALTER TABLE
alter table part_column_drop drop column useless_3;
ALTER TABLE
create index part_column_drop_b_pred on part_column_drop(b) where b = 1;
CREATE INDEX
create table part_column_drop_1_10 partition of part_column_drop for values from (1) to (10);
ysqlsh:z.sql:20: ERROR:  unexpected varattno 5 in expression to be mapped

Issue Type

kind/bug

Warning: Please confirm that this issue does not contain any sensitive information

  • I confirm this issue does not contain any sensitive information.
@ajcaldera1 ajcaldera1 added area/ysql Yugabyte SQL (YSQL) status/awaiting-triage Issue awaiting triage labels May 14, 2024
@ajcaldera1 ajcaldera1 added this to To do in DDL improvements via automation May 14, 2024
@ajcaldera1 ajcaldera1 added this to Backlog in YSQL via automation May 14, 2024
@yugabyte-ci yugabyte-ci added kind/bug This issue is a bug priority/medium Medium priority issue labels May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ysql Yugabyte SQL (YSQL) kind/bug This issue is a bug priority/medium Medium priority issue status/awaiting-triage Issue awaiting triage
Projects
YSQL
  
Backlog
Development

No branches or pull requests

4 participants