OSDN Git Service

Add the regression test of pg_bigm with standard_conforming_strings disabled.
authorMasaoFujii <masao.fujii@gmail.com>
Tue, 24 Sep 2013 13:35:48 +0000 (22:35 +0900)
committerMasaoFujii <masao.fujii@gmail.com>
Tue, 24 Sep 2013 13:35:48 +0000 (22:35 +0900)
Beena Emerson

expected/pg_bigm.out
sql/pg_bigm.sql

index 7f08386..0dc63d2 100644 (file)
@@ -9,6 +9,7 @@ SHOW pg_bigm.last_update;
 SET pg_bigm.last_update = '2013.09.18';
 ERROR:  parameter "pg_bigm.last_update" cannot be changed
 SET standard_conforming_strings = on;
+SET escape_string_warning = off;
 -- tests for likequery
 SELECT likequery (NULL);
  likequery 
@@ -422,6 +423,40 @@ SELECT doc FROM test_bigm WHERE doc LIKE 'pg\___gm%';
  pg_bigmは検索性能を200%向上させました。
 (6 rows)
 
+-- tests with standard_conforming_strings disabled
+SET standard_conforming_strings = off;
+SELECT likequery('\\_%');
+ likequery 
+-----------
+ %\\\_\%%
+(1 row)
+
+SELECT show_bigm('\\_%');
+       show_bigm       
+-----------------------
+ {" \\","% ","\\_",_%}
+(1 row)
+
+SELECT doc FROM test_bigm WHERE doc LIKE likequery ('\\');
+                              doc                               
+----------------------------------------------------------------
+ \dx displays list of installed extensions
+ \w FILE outputs the current query buffer to the file specified
+(2 rows)
+
+SELECT doc FROM test_bigm WHERE doc LIKE likequery ('\\dx');
+                    doc                    
+-------------------------------------------
+ \dx displays list of installed extensions
+(1 row)
+
+SELECT doc FROM test_bigm WHERE doc LIKE likequery ('200%');
+                              doc                              
+---------------------------------------------------------------
+ pg_bigm has improved the full text search performance by 200%
+ pg_bigmは検索性能を200%向上させました。
+(2 rows)
+
 -- tests for drop of pg_bigm
 DROP EXTENSION pg_bigm CASCADE;
 NOTICE:  drop cascades to index test_bigm_idx
index af580b5..c0f5f08 100644 (file)
@@ -6,6 +6,7 @@ SHOW pg_bigm.last_update;
 SET pg_bigm.last_update = '2013.09.18';
 
 SET standard_conforming_strings = on;
+SET escape_string_warning = off;
 
 -- tests for likequery
 SELECT likequery (NULL);
@@ -97,6 +98,14 @@ SELECT doc FROM test_bigm WHERE doc LIKE '%\%';
 EXPLAIN (COSTS off) SELECT doc FROM test_bigm WHERE doc LIKE 'pg\___gm%';
 SELECT doc FROM test_bigm WHERE doc LIKE 'pg\___gm%';
 
+-- tests with standard_conforming_strings disabled
+SET standard_conforming_strings = off;
+SELECT likequery('\\_%');
+SELECT show_bigm('\\_%');
+SELECT doc FROM test_bigm WHERE doc LIKE likequery ('\\');
+SELECT doc FROM test_bigm WHERE doc LIKE likequery ('\\dx');
+SELECT doc FROM test_bigm WHERE doc LIKE likequery ('200%');
+
 -- tests for drop of pg_bigm
 DROP EXTENSION pg_bigm CASCADE;
 SELECT likequery('test');