Kouhei Sutou
null+****@clear*****
Sun Jan 18 23:06:29 JST 2015
Kouhei Sutou 2015-01-18 23:06:29 +0900 (Sun, 18 Jan 2015) New Revision: 43303e5c56542c8bce0672263920ba6b2cf239d0 https://github.com/pgroonga/pgroonga/commit/43303e5c56542c8bce0672263920ba6b2cf239d0 Message: Add a test for update Added files: expected/text/single/update.out sql/text/single/update.sql Added: expected/text/single/update.out (+30 -0) 100644 =================================================================== --- /dev/null +++ expected/text/single/update.out 2015-01-18 23:06:29 +0900 (63011d9) @@ -0,0 +1,30 @@ +CREATE TABLE memos ( + id integer, + content text +); +INSERT INTO memos VALUES (1, 'PostgreSQL is a RDBMS.'); +INSERT INTO memos VALUES (2, 'Groonga is fast full text search engine.'); +INSERT INTO memos VALUES (3, 'PGroonga is a PostgreSQL extension that uses Groonga.'); +CREATE INDEX grnindex ON memos USING pgroonga (content); +UPDATE memos SET content = 'Mroonga is a MySQL plugin that uses Groonga.' + WHERE id = 3; +SET enable_seqscan = off; +SET enable_indexscan = on; +SET enable_bitmapscan = off; +SELECT id, content + FROM memos + WHERE content %% 'PostgreSQL'; + id | content +----+------------------------ + 1 | PostgreSQL is a RDBMS. +(1 row) + +SELECT id, content + FROM memos + WHERE content %% 'MySQL'; + id | content +----+---------------------------------------------- + 3 | Mroonga is a MySQL plugin that uses Groonga. +(1 row) + +DROP TABLE memos; Added: sql/text/single/update.sql (+27 -0) 100644 =================================================================== --- /dev/null +++ sql/text/single/update.sql 2015-01-18 23:06:29 +0900 (eb355e4) @@ -0,0 +1,27 @@ +CREATE TABLE memos ( + id integer, + content text +); + +INSERT INTO memos VALUES (1, 'PostgreSQL is a RDBMS.'); +INSERT INTO memos VALUES (2, 'Groonga is fast full text search engine.'); +INSERT INTO memos VALUES (3, 'PGroonga is a PostgreSQL extension that uses Groonga.'); + +CREATE INDEX grnindex ON memos USING pgroonga (content); + +UPDATE memos SET content = 'Mroonga is a MySQL plugin that uses Groonga.' + WHERE id = 3; + +SET enable_seqscan = off; +SET enable_indexscan = on; +SET enable_bitmapscan = off; + +SELECT id, content + FROM memos + WHERE content %% 'PostgreSQL'; + +SELECT id, content + FROM memos + WHERE content %% 'MySQL'; + +DROP TABLE memos; -------------- next part -------------- HTML����������������������������...Download