Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from naoa/inplace-alter-table-column
support Inplace alter table for add/drop column Patch by Naoya Murakami. Thanks!!!
- Loading branch information
Showing
12 changed files
with
565 additions
and
1 deletion.
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
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
26 changes: 26 additions & 0 deletions
26
mysql-test/mroonga/storage/alter_table/add_column/order/r/add_column_after.result
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,26 @@ | ||
| DROP TABLE IF EXISTS diaries; | ||
| CREATE TABLE diaries ( | ||
| id INT PRIMARY KEY AUTO_INCREMENT, | ||
| body TEXT | ||
| ) DEFAULT CHARSET UTF8; | ||
| SHOW CREATE TABLE diaries; | ||
| Table Create Table | ||
| diaries CREATE TABLE `diaries` ( | ||
| `id` int(11) NOT NULL AUTO_INCREMENT, | ||
| `body` text, | ||
| PRIMARY KEY (`id`) | ||
| ) ENGINE=mroonga DEFAULT CHARSET=utf8 | ||
| ALTER TABLE diaries ADD title TEXT AFTER id; | ||
| SHOW CREATE TABLE diaries; | ||
| Table Create Table | ||
| diaries CREATE TABLE `diaries` ( | ||
| `id` int(11) NOT NULL AUTO_INCREMENT, | ||
| `title` text, | ||
| `body` text, | ||
| PRIMARY KEY (`id`) | ||
| ) ENGINE=mroonga DEFAULT CHARSET=utf8 | ||
| INSERT INTO diaries (title, body) values ("groonga (1)", "starting groonga."); | ||
| SELECT * FROM diaries; | ||
| id title body | ||
| 1 groonga (1) starting groonga. | ||
| DROP TABLE diaries; |
26 changes: 26 additions & 0 deletions
26
mysql-test/mroonga/storage/alter_table/add_column/order/r/add_column_first.result
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,26 @@ | ||
| DROP TABLE IF EXISTS diaries; | ||
| CREATE TABLE diaries ( | ||
| id INT PRIMARY KEY AUTO_INCREMENT, | ||
| body TEXT | ||
| ) DEFAULT CHARSET UTF8; | ||
| SHOW CREATE TABLE diaries; | ||
| Table Create Table | ||
| diaries CREATE TABLE `diaries` ( | ||
| `id` int(11) NOT NULL AUTO_INCREMENT, | ||
| `body` text, | ||
| PRIMARY KEY (`id`) | ||
| ) ENGINE=mroonga DEFAULT CHARSET=utf8 | ||
| ALTER TABLE diaries ADD title TEXT FIRST; | ||
| SHOW CREATE TABLE diaries; | ||
| Table Create Table | ||
| diaries CREATE TABLE `diaries` ( | ||
| `title` text, | ||
| `id` int(11) NOT NULL AUTO_INCREMENT, | ||
| `body` text, | ||
| PRIMARY KEY (`id`) | ||
| ) ENGINE=mroonga DEFAULT CHARSET=utf8 | ||
| INSERT INTO diaries (title, body) values ("groonga (1)", "starting groonga."); | ||
| SELECT * FROM diaries; | ||
| title id body | ||
| groonga (1) 1 starting groonga. | ||
| DROP TABLE diaries; |
33 changes: 33 additions & 0 deletions
33
mysql-test/mroonga/storage/alter_table/add_column/order/r/modify_after.result
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,33 @@ | ||
| DROP TABLE IF EXISTS diaries; | ||
| CREATE TABLE diaries ( | ||
| id INT PRIMARY KEY AUTO_INCREMENT, | ||
| title TEXT, | ||
| body TEXT | ||
| ) DEFAULT CHARSET UTF8; | ||
| SHOW CREATE TABLE diaries; | ||
| Table Create Table | ||
| diaries CREATE TABLE `diaries` ( | ||
| `id` int(11) NOT NULL AUTO_INCREMENT, | ||
| `title` text, | ||
| `body` text, | ||
| PRIMARY KEY (`id`) | ||
| ) ENGINE=mroonga DEFAULT CHARSET=utf8 | ||
| INSERT INTO diaries (title, body) values ("groonga (1)", "starting groonga."); | ||
| SELECT * FROM diaries; | ||
| id title body | ||
| 1 groonga (1) starting groonga. | ||
| ALTER TABLE diaries MODIFY body TEXT AFTER id; | ||
| SHOW CREATE TABLE diaries; | ||
| Table Create Table | ||
| diaries CREATE TABLE `diaries` ( | ||
| `id` int(11) NOT NULL AUTO_INCREMENT, | ||
| `body` text, | ||
| `title` text, | ||
| PRIMARY KEY (`id`) | ||
| ) ENGINE=mroonga AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 | ||
| INSERT INTO diaries (title, body) values ("groonga (2)", "started groonga."); | ||
| SELECT * FROM diaries; | ||
| id body title | ||
| 1 starting groonga. groonga (1) | ||
| 2 started groonga. groonga (2) | ||
| DROP TABLE diaries; |
33 changes: 33 additions & 0 deletions
33
mysql-test/mroonga/storage/alter_table/add_column/order/r/modify_first.result
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,33 @@ | ||
| DROP TABLE IF EXISTS diaries; | ||
| CREATE TABLE diaries ( | ||
| id INT PRIMARY KEY AUTO_INCREMENT, | ||
| title TEXT, | ||
| body TEXT | ||
| ) DEFAULT CHARSET UTF8; | ||
| SHOW CREATE TABLE diaries; | ||
| Table Create Table | ||
| diaries CREATE TABLE `diaries` ( | ||
| `id` int(11) NOT NULL AUTO_INCREMENT, | ||
| `title` text, | ||
| `body` text, | ||
| PRIMARY KEY (`id`) | ||
| ) ENGINE=mroonga DEFAULT CHARSET=utf8 | ||
| INSERT INTO diaries (title, body) values ("groonga (1)", "starting groonga."); | ||
| SELECT * FROM diaries; | ||
| id title body | ||
| 1 groonga (1) starting groonga. | ||
| ALTER TABLE diaries MODIFY body TEXT FIRST; | ||
| SHOW CREATE TABLE diaries; | ||
| Table Create Table | ||
| diaries CREATE TABLE `diaries` ( | ||
| `body` text, | ||
| `id` int(11) NOT NULL AUTO_INCREMENT, | ||
| `title` text, | ||
| PRIMARY KEY (`id`) | ||
| ) ENGINE=mroonga AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 | ||
| INSERT INTO diaries (title, body) values ("groonga (2)", "started groonga."); | ||
| SELECT * FROM diaries; | ||
| body id title | ||
| starting groonga. 1 groonga (1) | ||
| started groonga. 2 groonga (2) | ||
| DROP TABLE diaries; |
Oops, something went wrong.