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

Moved AutoIncrementGetter to an internal interface #6544

Merged
merged 1 commit into from
Aug 21, 2023

Conversation

Hydrocharged
Copy link
Contributor

Fixes #6543.
Companion to dolthub/go-mysql-server#1956.

The AutoIncrementGetter was moved from the editor to the table years ago, however the GMS interface remained. We had an internal reliance on the interface, even though GMS does not use it at all, so the interface has been moved to be an internal interface only. This fixes the panic as seen in the issue.

@Hydrocharged Hydrocharged requested review from fulghum and removed request for zachmu August 21, 2023 13:14
Copy link
Contributor

@fulghum fulghum left a comment

Choose a reason for hiding this comment

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

LGTM!

@@ -807,7 +807,11 @@ func (t *WritableDoltTable) GetNextAutoIncrementValue(ctx *sql.Context, potentia
return 0, err
}

return ed.(sql.AutoIncrementGetter).GetNextAutoIncrementValue(ctx, potentialVal)
if multiTableEditor, ok := ed.(fulltext.MultiTableEditor); ok {
return multiTableEditor.PrimaryEditor().(writer.AutoIncrementGetter).GetNextAutoIncrementValue(ctx, potentialVal)
Copy link
Member

Choose a reason for hiding this comment

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

Can we make these an interface that embeds auto increment getter rather than having these typecasts

@Hydrocharged Hydrocharged merged commit e25d676 into main Aug 21, 2023
19 checks passed
@Hydrocharged Hydrocharged deleted the daylon/ft-autoincrement branch August 21, 2023 17:36
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.

Fulltext and autoincrement together causes Panic
3 participants