summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJeremy Harris <jgh146exb@wizmail.org>2017-12-24 16:42:04 +0000
committerJeremy Harris <jgh146exb@wizmail.org>2017-12-24 20:58:53 +0000
commitbbfb5dcd8ece2bbf04cc7323b7cc03581d91d7bd (patch)
treeeece7f86de2cef233662768aaa71904212901d93 /test
parent0972d4d7f8213f61a2181c65a94ffd97eaf381b9 (diff)
Lookups: fix pgsql multiple-row, single-column return
Report & fix from James <list@xdrv.co.uk>; additional tidying and testcase by JGH Broken-by: acec9514b1
Diffstat (limited to 'test')
-rw-r--r--test/scripts/2620-Postgresql/26204
-rw-r--r--test/stderr/262024
-rw-r--r--test/stdout/26206
3 files changed, 34 insertions, 0 deletions
diff --git a/test/scripts/2620-Postgresql/2620 b/test/scripts/2620-Postgresql/2620
index 62ee31354..ba3a3bcc8 100644
--- a/test/scripts/2620-Postgresql/2620
+++ b/test/scripts/2620-Postgresql/2620
@@ -13,6 +13,7 @@ system 'createdb -h localhost -p PORT_N test';
system 'psql -h localhost -p PORT_N -d test \
-c "CREATE TABLE them ( name text, id text );" \
-c "INSERT INTO them VALUES ( \'Philip Hazel\', \'ph10\' );" \
+ -c "INSERT INTO them VALUES ( \'Aristotle\', \'aaaa\' );" \
-c "INSERT INTO them VALUES ( \'\', \'nothing\' );" \
-c "INSERT INTO them VALUES ( \'\"stquot\', \'quote2\' );" \
-c "INSERT INTO them VALUES ( \'before\' || CHR(13) || CHR(10) || \'after\', \'newline\' );" \
@@ -37,6 +38,9 @@ ${lookup pgsql {servers=x:localhost; select name from them where id='ph10';}}
${lookup pgsql {servers=localhost::PORT_N:x; select name from them where id='ph10';}}
${lookup pgsql {servers=localhost::PORT_N/test/CALLER/:x; select name from them where id='ph10';}}
${lookup pgsql {servers=(DIR/pgsql/.s.PGSQL.PORT_N)/test/CALLER/:x; select name from them where id='ph10';}}
+x
+${lookup pgsql {SELECT name FROM them WHERE id IN ('ph10', 'aaaa');}}
+${lookup pgsql {SELECT * FROM them WHERE id IN ('ph10', 'aaaa');}}
****
exim -d -bh 10.0.0.0
mail from:<a@b>
diff --git a/test/stderr/2620 b/test/stderr/2620
index adc0c64a6..b0bed6209 100644
--- a/test/stderr/2620
+++ b/test/stderr/2620
@@ -159,6 +159,30 @@ database lookup required for servers=(TESTSUITE/pgsql/.s.PGSQL.1223)/test/CALLER
PostgreSQL query: servers=(TESTSUITE/pgsql/.s.PGSQL.1223)/test/CALLER/:x; select name from them where id='ph10';
PGSQL new connection: socket=TESTSUITE/pgsql/.s.PGSQL.1223 database=test user=CALLER
lookup yielded: Philip Hazel
+search_open: pgsql "NULL"
+ cached open
+search_find: file="NULL"
+ key="SELECT name FROM them WHERE id IN ('ph10', 'aaaa');" partial=-1 affix=NULL starflags=0
+LRU list:
+internal_search_find: file="NULL"
+ type=pgsql key="SELECT name FROM them WHERE id IN ('ph10', 'aaaa');"
+database lookup required for SELECT name FROM them WHERE id IN ('ph10', 'aaaa');
+PostgreSQL query: SELECT name FROM them WHERE id IN ('ph10', 'aaaa');
+PGSQL using cached connection for localhost:1223/test/CALLER
+lookup yielded: Philip Hazel
+Aristotle
+search_open: pgsql "NULL"
+ cached open
+search_find: file="NULL"
+ key="SELECT * FROM them WHERE id IN ('ph10', 'aaaa');" partial=-1 affix=NULL starflags=0
+LRU list:
+internal_search_find: file="NULL"
+ type=pgsql key="SELECT * FROM them WHERE id IN ('ph10', 'aaaa');"
+database lookup required for SELECT * FROM them WHERE id IN ('ph10', 'aaaa');
+PostgreSQL query: SELECT * FROM them WHERE id IN ('ph10', 'aaaa');
+PGSQL using cached connection for localhost:1223/test/CALLER
+lookup yielded: name="Philip Hazel" id=ph10
+name=Aristotle id=aaaa
search_tidyup called
close PGSQL connection: (TESTSUITE/pgsql/.s.PGSQL.1223)/test/CALLER
close PGSQL connection: localhost:1223/test/CALLER
diff --git a/test/stdout/2620 b/test/stdout/2620
index c76e65085..668eca73a 100644
--- a/test/stdout/2620
+++ b/test/stdout/2620
@@ -28,6 +28,7 @@ INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
+INSERT 0 1
> Philip Hazel
> Philip Hazel
>
@@ -43,6 +44,11 @@ after" id=newline
> Philip Hazel
> Philip Hazel
> Philip Hazel
+> x
+> Philip Hazel
+Aristotle
+> name="Philip Hazel" id=ph10
+name=Aristotle id=aaaa
>
**** SMTP testing session as if from host 10.0.0.0