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

Temporary tables don't support AUTO_INCREMENT #7972

Closed
arvidfm opened this issue Jun 7, 2024 · 1 comment · Fixed by #7990
Closed

Temporary tables don't support AUTO_INCREMENT #7972

arvidfm opened this issue Jun 7, 2024 · 1 comment · Fixed by #7990
Assignees
Labels
bug Something isn't working correctness We don't return the same result as MySQL customer issue

Comments

@arvidfm
Copy link

arvidfm commented Jun 7, 2024

If you create a temporary table with an AUTO_INCREMENT column, attempting to insert into it will yield the following error: ERROR 1105 (HY000): table ... does not support AUTO_INCREMENT columns. It works with MySQL on the other hand.

A simple workaround is to just use a normal table and drop it, but it would be nice to have this to simplify cleanup when using temporary tables during migrations.

MWE that fails with Dolt but works with Percona Server 8.3:

DROP TABLE IF EXISTS a_test;

CREATE TEMPORARY TABLE a_test(
    id INT PRIMARY KEY AUTO_INCREMENT
);

INSERT INTO a_test () VALUES (), (), (), ();

DROP TABLE a_test;
@timsehn timsehn added bug Something isn't working correctness We don't return the same result as MySQL labels Jun 7, 2024
@jycor jycor self-assigned this Jun 10, 2024
@jycor
Copy link
Contributor

jycor commented Jun 10, 2024

Hey @arvidfm , thanks for reporting this issue!
Issue has been fixed. Expect a release with the fix soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctness We don't return the same result as MySQL customer issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants