Skip to content

Commit 9b917d7

Browse files
committed
Merge branch 'master' into devel
2 parents 2f9d0f8 + f6ce6e6 commit 9b917d7

File tree

3 files changed

+68
-0
lines changed

3 files changed

+68
-0
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,6 @@ all.sh
6868
build9
6969
t/servroot/
7070
buildroot/
71+
build10
72+
go
73+
all

t/000_init.t

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,19 @@ repeat_each(1);
88
plan tests => repeat_each() * blocks();
99

1010
$ENV{TEST_NGINX_MYSQL_PORT} ||= 3306;
11+
$ENV{TEST_NGINX_POSTGRESQL_PORT} ||= 5432;
1112

1213
our $http_config = <<'_EOC_';
1314
upstream database {
1415
drizzle_server 127.0.0.1:$TEST_NGINX_MYSQL_PORT protocol=mysql
1516
dbname=ngx_test user=ngx_test password=ngx_test;
1617
}
18+
19+
upstream pg {
20+
postgres_server 127.0.0.1:$TEST_NGINX_POSTGRESQL_PORT
21+
dbname=ngx_test user=ngx_test password=ngx_test;
22+
}
23+
1724
_EOC_
1825

1926
worker_connections(128);
@@ -77,3 +84,60 @@ GET /init
7784
GET /init
7885
--- error_code: 200
7986
--- timeout: 10
87+
88+
89+
90+
=== TEST 5: cats - drop table - pg
91+
--- http_config eval: $::http_config
92+
--- config
93+
location = /init {
94+
postgres_pass pg;
95+
postgres_query "DROP TABLE IF EXISTS cats";
96+
}
97+
--- request
98+
GET /init
99+
--- error_code: 200
100+
--- timeout: 10
101+
102+
103+
104+
=== TEST 6: cats - create table - pg
105+
--- http_config eval: $::http_config
106+
--- config
107+
location = /init {
108+
postgres_pass pg;
109+
postgres_query "CREATE TABLE cats (id integer, name text)";
110+
}
111+
--- request
112+
GET /init
113+
--- error_code: 200
114+
--- timeout: 10
115+
116+
117+
118+
=== TEST 7: cats - insert value - pg
119+
--- http_config eval: $::http_config
120+
--- config
121+
location = /init {
122+
postgres_pass pg;
123+
postgres_query "INSERT INTO cats (id) VALUES (2)";
124+
}
125+
--- request
126+
GET /init
127+
--- error_code: 200
128+
--- timeout: 10
129+
130+
131+
132+
=== TEST 8: cats - insert value - pg
133+
--- http_config eval: $::http_config
134+
--- config
135+
location = /init {
136+
postgres_pass pg;
137+
postgres_query "INSERT INTO cats (id, name) VALUES (3, 'bob')";
138+
}
139+
--- request
140+
GET /init
141+
--- error_code: 200
142+
--- timeout: 10
143+

util/build.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ cd nginx-$version/
3131

3232
if [[ "$BUILD_CLEAN" -eq 1 || ! -f Makefile || "$root/config" -nt Makefile || "$root/util/build.sh" -nt Makefile ]]; then
3333
./configure --prefix=$root/work/nginx \
34+
--with-cc-opt="-O3" \
3435
--without-mail_pop3_module \
3536
--without-mail_imap_module \
3637
--without-mail_smtp_module \

0 commit comments

Comments
 (0)