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

fix: errors with CREATE TABLE LIKE when the original table has indexes #48

Merged
merged 11 commits into from
Sep 9, 2024

Conversation

ddh-5230
Copy link
Contributor

@ddh-5230 ddh-5230 commented Sep 4, 2024

During the process of copying a table and creating an index, the parameters passed only included the index name without binding the index to the column names, resulting in a syntax error. The root cause is that when creating the index, the Exprs value was not assigned.
Currently, the column names are extracted from the SQL and assigned to Exprs, but it only supports single-column or multi-column indexes.

fixes #26
fixes #29

@GaoYusong
Copy link
Contributor

Cool! This also addresses #29.

@GaoYusong GaoYusong self-requested a review September 4, 2024 08:52
meta/table.go Outdated Show resolved Hide resolved
meta/identifier.go Outdated Show resolved Hide resolved
meta/table.go Outdated Show resolved Hide resolved
meta/table.go Outdated Show resolved Hide resolved
meta/table.go Outdated Show resolved Hide resolved
@GaoYusong
Copy link
Contributor

i've completed the review, let's fix the issues and merge it into the main branch!

meta/identifier.go Outdated Show resolved Hide resolved
meta/table.go Outdated Show resolved Hide resolved
meta/table.go Outdated Show resolved Hide resolved
meta/table.go Outdated Show resolved Hide resolved
@GaoYusong
Copy link
Contributor

there's an error in the CI, please address it

--- FAIL: TestUnbuildableIndex (0.58s)
    --- FAIL: TestUnbuildableIndex/Failing_index_builder_still_returning_correct_results (0.40s)
        --- FAIL: TestUnbuildableIndex/Failing_index_builder_still_returning_correct_results/SELECT_i_FROM_mytable2_WHERE_i_IN_(SELECT_i_FROM_mytable2)_ORDER_BY_i (0.14s)
panic: runtime error: index out of range [0] with length 0 [recovered]
	panic: runtime error: index out of range [0] with length 0 [recovered]
	panic: runtime error: index out of range [0] with length 0

meta/table.go Outdated Show resolved Hide resolved
meta/table.go Outdated Show resolved Hide resolved
meta/table.go Outdated Show resolved Hide resolved
meta/index.go Outdated Show resolved Hide resolved
meta/table.go Outdated Show resolved Hide resolved
meta/table.go Outdated Show resolved Hide resolved
meta/identifier.go Outdated Show resolved Hide resolved
meta/identifier.go Outdated Show resolved Hide resolved
Copy link
Contributor

@GaoYusong GaoYusong left a comment

Choose a reason for hiding this comment

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

LGTM! Congrats on your first PR! It’s a long journey to get it merged, but I hope the next one will go more quickly.

@GaoYusong GaoYusong merged commit ca1179a into main Sep 9, 2024
1 check passed
GaoYusong added a commit that referenced this pull request Sep 12, 2024
GaoYusong added a commit that referenced this pull request Sep 12, 2024
GaoYusong added a commit that referenced this pull request Sep 12, 2024
GaoYusong added a commit that referenced this pull request Sep 12, 2024
GaoYusong added a commit that referenced this pull request Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: show columns in indexes fix: errors with CREATE TABLE LIKE when the original table has indexes
2 participants