Navigation Menu

Skip to content

Commit

Permalink
Add a test for update
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Jan 18, 2015
1 parent 7a4a81d commit 43303e5
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 0 deletions.
30 changes: 30 additions & 0 deletions expected/text/single/update.out
@@ -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;
27 changes: 27 additions & 0 deletions sql/text/single/update.sql
@@ -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;

0 comments on commit 43303e5

Please sign in to comment.