Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:mroonga/mroonga
- Loading branch information
Showing
6 changed files
with
248 additions
and
4 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
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
50 changes: 50 additions & 0 deletions
50
test/sql/suite/groonga_wrapper/r/transaction_rollback_delete_delete.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,50 @@ | ||
| DROP TABLE IF EXISTS diaries; | ||
| CREATE TABLE diaries ( | ||
| id INT PRIMARY KEY AUTO_INCREMENT, | ||
| title TEXT, | ||
| body TEXT, | ||
| FULLTEXT INDEX title_index (title), | ||
| FULLTEXT INDEX body_index (body) | ||
| ) COMMENT = 'ENGINE "InnoDB"' 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`), | ||
| FULLTEXT KEY `title_index` (`title`), | ||
| FULLTEXT KEY `body_index` (`body`) | ||
| ) ENGINE=groonga DEFAULT CHARSET=utf8 COMMENT='ENGINE "InnoDB"' | ||
| INSERT INTO diaries (title, body) VALUES ("survey", "will start groonga!"); | ||
| INSERT INTO diaries (title, body) VALUES ("groonga (1)", "starting groonga..."); | ||
| INSERT INTO diaries (title, body) VALUES ("groonga (2)", "started groonga."); | ||
| SELECT * FROM diaries | ||
| WHERE MATCH(title) AGAINST("survey") AND | ||
| MATCH(body) AGAINST("groonga"); | ||
| id title body | ||
| 1 survey will start groonga! | ||
| START TRANSACTION; | ||
| DELETE FROM diaries WHERE id = 1; | ||
| ROLLBACK; | ||
| SELECT * FROM diaries; | ||
| id title body | ||
| 1 survey will start groonga! | ||
| 2 groonga (1) starting groonga... | ||
| 3 groonga (2) started groonga. | ||
| SELECT * FROM diaries | ||
| WHERE MATCH(title) AGAINST("survey") AND | ||
| MATCH(body) AGAINST("groonga"); | ||
| id title body | ||
| DELETE FROM diaries WHERE id = 1; | ||
| Warnings: | ||
| Warning 1026 failed to get record ID for deleting from groonga: key=<> | ||
| SELECT * FROM diaries; | ||
| id title body | ||
| 2 groonga (1) starting groonga... | ||
| 3 groonga (2) started groonga. | ||
| SELECT * FROM diaries | ||
| WHERE MATCH(title) AGAINST("survey") AND | ||
| MATCH(body) AGAINST("groonga"); | ||
| id title body | ||
| DROP TABLE diaries; |
47 changes: 47 additions & 0 deletions
47
test/sql/suite/groonga_wrapper/r/transaction_rollback_delete_update.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,47 @@ | ||
| DROP TABLE IF EXISTS diaries; | ||
| CREATE TABLE diaries ( | ||
| id INT PRIMARY KEY AUTO_INCREMENT, | ||
| title TEXT, | ||
| body TEXT, | ||
| FULLTEXT INDEX title_index (title), | ||
| FULLTEXT INDEX body_index (body) | ||
| ) COMMENT = 'ENGINE "InnoDB"' 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`), | ||
| FULLTEXT KEY `title_index` (`title`), | ||
| FULLTEXT KEY `body_index` (`body`) | ||
| ) ENGINE=groonga DEFAULT CHARSET=utf8 COMMENT='ENGINE "InnoDB"' | ||
| INSERT INTO diaries (title, body) VALUES ("survey", "will start groonga!"); | ||
| INSERT INTO diaries (title, body) VALUES ("groonga (1)", "starting groonga..."); | ||
| INSERT INTO diaries (title, body) VALUES ("groonga (2)", "started groonga."); | ||
| SELECT * FROM diaries | ||
| WHERE MATCH(title) AGAINST("survey"); | ||
| id title body | ||
| 1 survey will start groonga! | ||
| START TRANSACTION; | ||
| DELETE FROM diaries WHERE id = 1; | ||
| ROLLBACK; | ||
| SELECT * FROM diaries; | ||
| id title body | ||
| 1 survey will start groonga! | ||
| 2 groonga (1) starting groonga... | ||
| 3 groonga (2) started groonga. | ||
| SELECT * FROM diaries | ||
| WHERE MATCH(title) AGAINST("survey"); | ||
| id title body | ||
| UPDATE diaries SET title = "survey day!" WHERE id = 1; | ||
| SELECT * FROM diaries; | ||
| id title body | ||
| 1 survey day! will start groonga! | ||
| 2 groonga (1) starting groonga... | ||
| 3 groonga (2) started groonga. | ||
| SELECT * FROM diaries | ||
| WHERE MATCH(title) AGAINST("survey"); | ||
| id title body | ||
| 1 survey day! will start groonga! | ||
| DROP TABLE diaries; |
58 changes: 58 additions & 0 deletions
58
test/sql/suite/groonga_wrapper/t/transaction_rollback_delete_delete.test
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,58 @@ | ||
| # Copyright(C) 2011 Kouhei Sutou <kou@clear-code.com> | ||
| # | ||
| # This library is free software; you can redistribute it and/or | ||
| # modify it under the terms of the GNU Lesser General Public | ||
| # License as published by the Free Software Foundation; either | ||
| # version 2.1 of the License, or (at your option) any later version. | ||
| # | ||
| # This library is distributed in the hope that it will be useful, | ||
| # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| # Lesser General Public License for more details. | ||
| # | ||
| # You should have received a copy of the GNU Lesser General Public | ||
| # License along with this library; if not, write to the Free Software | ||
| # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
|
|
||
| --source include/have_groonga.inc | ||
|
|
||
| --disable_warnings | ||
| DROP TABLE IF EXISTS diaries; | ||
| --enable_warnings | ||
|
|
||
| CREATE TABLE diaries ( | ||
| id INT PRIMARY KEY AUTO_INCREMENT, | ||
| title TEXT, | ||
| body TEXT, | ||
| FULLTEXT INDEX title_index (title), | ||
| FULLTEXT INDEX body_index (body) | ||
| ) COMMENT = 'ENGINE "InnoDB"' DEFAULT CHARSET UTF8; | ||
| SHOW CREATE TABLE diaries; | ||
|
|
||
| INSERT INTO diaries (title, body) VALUES ("survey", "will start groonga!"); | ||
| INSERT INTO diaries (title, body) VALUES ("groonga (1)", "starting groonga..."); | ||
| INSERT INTO diaries (title, body) VALUES ("groonga (2)", "started groonga."); | ||
|
|
||
| SELECT * FROM diaries | ||
| WHERE MATCH(title) AGAINST("survey") AND | ||
| MATCH(body) AGAINST("groonga"); | ||
|
|
||
| START TRANSACTION; | ||
| DELETE FROM diaries WHERE id = 1; | ||
| ROLLBACK; | ||
|
|
||
| SELECT * FROM diaries; | ||
| SELECT * FROM diaries | ||
| WHERE MATCH(title) AGAINST("survey") AND | ||
| MATCH(body) AGAINST("groonga"); | ||
|
|
||
| DELETE FROM diaries WHERE id = 1; | ||
|
|
||
| SELECT * FROM diaries; | ||
| SELECT * FROM diaries | ||
| WHERE MATCH(title) AGAINST("survey") AND | ||
| MATCH(body) AGAINST("groonga"); | ||
|
|
||
| DROP TABLE diaries; | ||
|
|
||
| --source include/have_groonga_deinit.inc |
55 changes: 55 additions & 0 deletions
55
test/sql/suite/groonga_wrapper/t/transaction_rollback_delete_update.test
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,55 @@ | ||
| # Copyright(C) 2011 Kouhei Sutou <kou@clear-code.com> | ||
| # | ||
| # This library is free software; you can redistribute it and/or | ||
| # modify it under the terms of the GNU Lesser General Public | ||
| # License as published by the Free Software Foundation; either | ||
| # version 2.1 of the License, or (at your option) any later version. | ||
| # | ||
| # This library is distributed in the hope that it will be useful, | ||
| # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| # Lesser General Public License for more details. | ||
| # | ||
| # You should have received a copy of the GNU Lesser General Public | ||
| # License along with this library; if not, write to the Free Software | ||
| # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
|
|
||
| --source include/have_groonga.inc | ||
|
|
||
| --disable_warnings | ||
| DROP TABLE IF EXISTS diaries; | ||
| --enable_warnings | ||
|
|
||
| CREATE TABLE diaries ( | ||
| id INT PRIMARY KEY AUTO_INCREMENT, | ||
| title TEXT, | ||
| body TEXT, | ||
| FULLTEXT INDEX title_index (title), | ||
| FULLTEXT INDEX body_index (body) | ||
| ) COMMENT = 'ENGINE "InnoDB"' DEFAULT CHARSET UTF8; | ||
| SHOW CREATE TABLE diaries; | ||
|
|
||
| INSERT INTO diaries (title, body) VALUES ("survey", "will start groonga!"); | ||
| INSERT INTO diaries (title, body) VALUES ("groonga (1)", "starting groonga..."); | ||
| INSERT INTO diaries (title, body) VALUES ("groonga (2)", "started groonga."); | ||
|
|
||
| SELECT * FROM diaries | ||
| WHERE MATCH(title) AGAINST("survey"); | ||
|
|
||
| START TRANSACTION; | ||
| DELETE FROM diaries WHERE id = 1; | ||
| ROLLBACK; | ||
|
|
||
| SELECT * FROM diaries; | ||
| SELECT * FROM diaries | ||
| WHERE MATCH(title) AGAINST("survey"); | ||
|
|
||
| UPDATE diaries SET title = "survey day!" WHERE id = 1; | ||
|
|
||
| SELECT * FROM diaries; | ||
| SELECT * FROM diaries | ||
| WHERE MATCH(title) AGAINST("survey"); | ||
|
|
||
| DROP TABLE diaries; | ||
|
|
||
| --source include/have_groonga_deinit.inc |