Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
MDEV-15352 AUTO_INCREMENT breaks after updating a column value to a n…
…egative number
- Loading branch information
Showing
11 changed files
with
624 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| DELIMITER $$; | ||
| CREATE PROCEDURE autoinc_mdev15353_one(engine VARCHAR(64), t VARCHAR(64)) | ||
| BEGIN | ||
| DECLARE query TEXT DEFAULT 'CREATE TABLE t1 (' | ||
| ' id TTT NOT NULL AUTO_INCREMENT,' | ||
| ' name CHAR(30) NOT NULL,' | ||
| ' PRIMARY KEY (id)) ENGINE=EEE'; | ||
| EXECUTE IMMEDIATE REPLACE(REPLACE(query,'TTT', t), 'EEE', engine); | ||
| SHOW CREATE TABLE t1; | ||
| INSERT INTO t1 (name) VALUES ('dog'); | ||
| SELECT * FROM t1; | ||
| UPDATE t1 SET id=-1 WHERE id=1; | ||
| SELECT * FROM t1; | ||
| INSERT INTO t1 (name) VALUES ('cat'); | ||
| SELECT * FROM t1; | ||
| DROP TABLE t1; | ||
| END; | ||
| $$ | ||
| DELIMITER ;$$ | ||
|
|
||
| CALL autoinc_mdev15353_one(@engine, 'tinyint'); | ||
| CALL autoinc_mdev15353_one(@engine, 'smallint'); | ||
| CALL autoinc_mdev15353_one(@engine, 'mediumint'); | ||
| CALL autoinc_mdev15353_one(@engine, 'int'); | ||
| CALL autoinc_mdev15353_one(@engine, 'bigint'); | ||
| CALL autoinc_mdev15353_one(@engine, 'float'); | ||
| CALL autoinc_mdev15353_one(@engine, 'double'); | ||
|
|
||
| DROP PROCEDURE autoinc_mdev15353_one; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.