-
-
Notifications
You must be signed in to change notification settings - Fork 141
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(tianmu):the data is wrong when altering table after deleting.(#1199)
Because the records which was deleted is not filtered in fill_row().
- Loading branch information
1 parent
bdbf8d9
commit 6b924d7
Showing
4 changed files
with
76 additions
and
3 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,28 @@ | ||
DROP DATABASE IF EXISTS alter_delete; | ||
CREATE DATABASE alter_delete; | ||
USE alter_delete; | ||
CREATE TABLE ttt1(id INT,name VARCHAR(5)); | ||
INSERT INTO ttt1 VALUES(0,"XXX"),(1,'AAA'),(2,'BBB'); | ||
SELECT * FROM ttt1; | ||
id name | ||
0 XXX | ||
1 AAA | ||
2 BBB | ||
DELETE FROM ttt1 WHERE id=1; | ||
SELECT * FROM ttt1; | ||
id name | ||
0 XXX | ||
2 BBB | ||
ALTER TABLE ttt1 CONVERT TO CHARACTER SET utf8; | ||
SELECT * FROM ttt1; | ||
id name | ||
0 XXX | ||
2 BBB | ||
SHOW CREATE TABLE ttt1; | ||
Table Create Table | ||
ttt1 CREATE TABLE `ttt1` ( | ||
`id` int(11) DEFAULT NULL, | ||
`name` varchar(5) DEFAULT NULL | ||
) ENGINE=TIANMU DEFAULT CHARSET=utf8 | ||
DROP TABLE ttt1; | ||
DROP DATABASE alter_delete; |
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 @@ | ||
--source include/have_tianmu.inc | ||
|
||
--disable_warnings | ||
DROP DATABASE IF EXISTS alter_delete; | ||
--enable_warnings | ||
|
||
CREATE DATABASE alter_delete; | ||
|
||
USE alter_delete; | ||
|
||
CREATE TABLE ttt1(id INT,name VARCHAR(5)); | ||
|
||
INSERT INTO ttt1 VALUES(0,"XXX"),(1,'AAA'),(2,'BBB'); | ||
|
||
SELECT * FROM ttt1; | ||
|
||
DELETE FROM ttt1 WHERE id=1; | ||
|
||
SELECT * FROM ttt1; | ||
|
||
ALTER TABLE ttt1 CONVERT TO CHARACTER SET utf8; | ||
|
||
SELECT * FROM ttt1; | ||
|
||
SHOW CREATE TABLE ttt1; | ||
|
||
DROP TABLE ttt1; | ||
|
||
DROP DATABASE alter_delete; |
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