Skip to content

sql: throw duplicate column error for a view#12197

Merged
ImeevMA merged 1 commit intotarantool:masterfrom
NinaRodicova:ninarodicova/branch_for_fix_bug
Feb 19, 2026
Merged

sql: throw duplicate column error for a view#12197
ImeevMA merged 1 commit intotarantool:masterfrom
NinaRodicova:ninarodicova/branch_for_fix_bug

Conversation

@NinaRodicova
Copy link
Contributor

@NinaRodicova NinaRodicova commented Jan 13, 2026

sql: throw duplicate column error for a view

This patch fixes the bug: instruction
box.execute([[CREATE TABLE t (a INTEGER PRIMARY KEY, a INTEGER);]])
and instruction
box.execute([[CREATE VIEW v AS SELECT 1 AS a, 1 AS a;]])
had different behaviors.
Now box.execute([[CREATE VIEW v as VIEW AS SELECT 1 AS a, 1 AS a;]])
returns an error: Space field 'a' is duplicate.

Closes #4545

NO_DOC=bugfix

@NinaRodicova NinaRodicova force-pushed the ninarodicova/branch_for_fix_bug branch from e85da96 to d93b4e7 Compare January 20, 2026 06:29
NinaRodicova added a commit to NinaRodicova/tarantool that referenced this pull request Jan 24, 2026
This patch fixes the bug: No duplicate column error for a view tarantool#4545.
Now box.execute([[CREATE VIEW v as VIEW AS SELECT 1 AS a, 1 AS a;]])
returns an error: Space field 'a' is duplicate.
This patch results in
box.execute([[SELECT * FROM (SELECT 1 as a, 2 as a);]])
behaving as follows:
Earler:
- metadata:
 - name: a
   type: integer
 - name: a_1
  type: integer
 rows:
 - [1, 2]
Now:
- metadata:
 - name: a
   type: integer
 - name: a
  type: integer
 rows:
 - [1, 1]

Part of tarantool#12197

Closes tarantool#4545
@NinaRodicova NinaRodicova force-pushed the ninarodicova/branch_for_fix_bug branch 2 times, most recently from c39a1de to c239a8d Compare January 24, 2026 18:50
NinaRodicova added a commit to NinaRodicova/tarantool that referenced this pull request Jan 24, 2026
This patch fixes the bug: No duplicate column error for a view tarantool#4545.
Now box.execute([[CREATE VIEW v as VIEW AS SELECT 1 AS a, 1 AS a;]])
returns an error: Space field 'a' is duplicate.
This patch results in
box.execute([[SELECT * FROM (SELECT 1 as a, 2 as a);]])
behaving as follows:
Earler:
- metadata:
 - name: a
   type: integer
 - name: a_1
  type: integer
 rows:
 - [1, 2]
Now:
- metadata:
 - name: a
   type: integer
 - name: a
  type: integer
 rows:
 - [1, 1]

Part of tarantool#12197

Closes tarantool#4545
@ImeevMA ImeevMA self-requested a review January 28, 2026 10:14
@ImeevMA ImeevMA self-assigned this Jan 28, 2026
Copy link
Collaborator

@ImeevMA ImeevMA left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi! Thank you for the patch! I have a few comment, please fix them.

@NinaRodicova NinaRodicova changed the title Fix bug sql: throw duplicate column error for a view Jan 29, 2026
@NinaRodicova NinaRodicova force-pushed the ninarodicova/branch_for_fix_bug branch from c239a8d to ccfaf99 Compare February 1, 2026 18:03
@NinaRodicova NinaRodicova requested a review from ImeevMA February 3, 2026 08:51
@NinaRodicova NinaRodicova force-pushed the ninarodicova/branch_for_fix_bug branch from ccfaf99 to 305b8f0 Compare February 7, 2026 18:41
@coveralls
Copy link

coveralls commented Feb 7, 2026

Coverage Status

coverage: 87.659% (+0.006%) from 87.653%
when pulling 7c7d9df on NinaRodicova:ninarodicova/branch_for_fix_bug
into 4b359ef
on tarantool:master
.

@NinaRodicova NinaRodicova force-pushed the ninarodicova/branch_for_fix_bug branch 2 times, most recently from ae3116d to f39c72a Compare February 11, 2026 14:34
@NinaRodicova NinaRodicova requested a review from a team as a code owner February 11, 2026 14:34
Copy link
Collaborator

@ImeevMA ImeevMA left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the fixes! I just have a few minor comments.

@NinaRodicova NinaRodicova force-pushed the ninarodicova/branch_for_fix_bug branch from f39c72a to 0e438b7 Compare February 12, 2026 19:04
@NinaRodicova NinaRodicova requested a review from ImeevMA February 17, 2026 07:19
@NinaRodicova NinaRodicova force-pushed the ninarodicova/branch_for_fix_bug branch 2 times, most recently from 4370021 to 02ca0c5 Compare February 17, 2026 18:13
Copy link
Collaborator

@ImeevMA ImeevMA left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the fixes!

@ImeevMA
Copy link
Collaborator

ImeevMA commented Feb 18, 2026

Please note that this fix actually allows to reproduce another bug:

tarantool> box.execute([[SELECT * FROM (SELECT 1 AS a, 2 AS a);]])
---
- metadata:
  - name: a
    type: integer
  - name: a
    type: integer
  rows:
  - [1, 1]
...

This bug will be fixed in #12263

@ImeevMA ImeevMA requested a review from Gerold103 February 18, 2026 05:21
This patch fixes the bug: instruction
box.execute([[CREATE TABLE t (a INTEGER PRIMARY KEY, a INTEGER);]])
and instruction
box.execute([[CREATE VIEW v AS SELECT 1 AS a, 1 AS a;]])
have different behaviors.
Now box.execute([[CREATE VIEW v as VIEW AS SELECT 1 AS a, 1 AS a;]])
returns an error: Space field 'a' is duplicate.

Closes tarantool#4545

NO_DOC=bugfix
@NinaRodicova NinaRodicova force-pushed the ninarodicova/branch_for_fix_bug branch from 02ca0c5 to 7c7d9df Compare February 18, 2026 06:29
Copy link
Collaborator

@Gerold103 Gerold103 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh nice, it is always lovely to see so much code removed.

@ImeevMA ImeevMA added full-ci Enables all tests for a pull request and removed full-ci Enables all tests for a pull request labels Feb 19, 2026
@ImeevMA ImeevMA added backport/3.2 Automatically create a 3.2 backport PR backport/3.3 Automatically create a 3.3 backport PR backport/3.5 Automatically create a 3.5 backport PR backport/3.6 Automatically create a 3.6 backport PR labels Feb 19, 2026
@ImeevMA ImeevMA merged commit c704f81 into tarantool:master Feb 19, 2026
151 of 153 checks passed
@TarantoolBot
Copy link
Collaborator

Backport failed for release/3.2, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin release/3.2
git worktree add -d .worktree/backport/release/3.2/12197 origin/release/3.2
cd .worktree/backport/release/3.2/12197
git switch --create backport/release/3.2/12197
git cherry-pick -x c704f81c24a683ef5559ac042cd36703f9fefe7c

@TarantoolBot
Copy link
Collaborator

Backport failed for release/3.3, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin release/3.3
git worktree add -d .worktree/backport/release/3.3/12197 origin/release/3.3
cd .worktree/backport/release/3.3/12197
git switch --create backport/release/3.3/12197
git cherry-pick -x c704f81c24a683ef5559ac042cd36703f9fefe7c

@TarantoolBot
Copy link
Collaborator

Backport failed for release/3.5, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin release/3.5
git worktree add -d .worktree/backport/release/3.5/12197 origin/release/3.5
cd .worktree/backport/release/3.5/12197
git switch --create backport/release/3.5/12197
git cherry-pick -x c704f81c24a683ef5559ac042cd36703f9fefe7c

@TarantoolBot
Copy link
Collaborator

Successfully created backport PR for release/3.6:

@TarantoolBot
Copy link
Collaborator

Backport summary

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport/3.2 Automatically create a 3.2 backport PR backport/3.3 Automatically create a 3.3 backport PR backport/3.5 Automatically create a 3.5 backport PR backport/3.6 Automatically create a 3.6 backport PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No duplicate column error for a view

6 participants