View Issue Details

IDProjectCategoryView StatusLast Update
0000143Pgpool-IIBugpublic2015-08-20 10:31
ReporterrobeAssigned Tonagata 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version 
Target VersionFixed in Version 
Summary0000143: pgpool2 3.3.7 test/timestamp fails to compile
Descriptionrenner@off-master-01-ber ~/tmp/pgpool-II-3.3.7/test/timestamp $ make
make -C ../../parser
make[1]: Entering directory `/home/renner/tmp/pgpool-II-3.3.7/parser'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/renner/tmp/pgpool-II-3.3.7/parser'
make -C ../.. strlcpy.o
make[1]: Entering directory `/home/renner/tmp/pgpool-II-3.3.7'
make[1]: Leaving directory `/home/renner/tmp/pgpool-II-3.3.7'
make -C ../.. pool_timestamp.o
make[1]: Entering directory `/home/renner/tmp/pgpool-II-3.3.7'
make[1]: Leaving directory `/home/renner/tmp/pgpool-II-3.3.7'
cc -Wall -O0 -g -I../.. -I/usr/include/postgresql -c -o main.o main.c
cc main.o ../../strlcpy.o ../../pool_timestamp.o ../../parser/libsql-parser.a -o timestamp-test
../../pool_timestamp.o: In function `relcache_lookup':
/home/renner/tmp/pgpool-II-3.3.7/pool_timestamp.c:162: undefined reference to `pool_has_to_regclass'
collect2: error: ld returned 1 exit status
make: *** [timestamp-test] Error 1
renner@off-master-01-ber ~/tmp/pgpool-II-3.3.7/test/timestamp $
TagsNo tags attached.

Activities

nagata

2015-08-14 15:00

developer   ~0000550

Thanks for your reporting.

We haven't maintain test/timestamp for a long time. The compilation error
is resolved by defining pool_has_to_regclass() function, which
was added as last year. However, I get segfault when running this.
I'll try to fix this and incorporate this into the regression test suites.

robe

2015-08-14 18:33

reporter   ~0000551

Thanks, I figured as much.

I stumbled over this while trying to package pgpool2-3.3.7 with the existian debian rules file which calls the tests during build.

They should either work or be removed altogether, broken tests help no one ;)

nagata

2015-08-20 10:30

developer   ~0000556

Fixed. Patch attached.

This is already committed.
http://git.postgresql.org/gitweb/?p=pgpool2.git;a=commitdiff;h=a038baee30523bf807f32635696c571ecfca7f55#patch1

nagata

2015-08-20 10:30

developer  

test_timestamp.patch (951 bytes)
diff --git a/test/timestamp/main.c b/test/timestamp/main.c
index c821ccd..2bb20f2 100644
--- a/test/timestamp/main.c
+++ b/test/timestamp/main.c
@@ -50,6 +50,16 @@ bool pool_has_pgpool_regclass(void)
 	return false;
 }
 
+bool pool_has_to_regclass(void)
+{
+	return false;
+}
+
+char *remove_quotes_and_schema_from_relname(char *table)
+{
+	return table; 
+}
+
 POOL_RELCACHE *
 pool_create_relcache(int cachesize, char *sql, func_ptr register_func, func_ptr unregister_func, bool issessionlocal)
 {
@@ -89,6 +99,7 @@ main(int argc, char **argv)
 	POOL_CONNECTION_POOL	backend;
 	POOL_CONNECTION_POOL_SLOT slot;
 	POOL_SENT_MESSAGE	msg;
+	POOL_QUERY_CONTEXT	ctx;
 	backend.slots[0] = &slot;
 	slot.sp = &sp;
 
@@ -110,6 +121,7 @@ main(int argc, char **argv)
 		foreach(l, tree)
 		{
 			msg.num_tsparams = 0;
+			msg.query_context = &ctx;
 			Node *node = (Node *) lfirst(l);
 			query = rewrite_timestamp(&backend, node, false, &msg);
 			if (query)
test_timestamp.patch (951 bytes)

Issue History

Date Modified Username Field Change
2015-08-13 22:35 robe New Issue
2015-08-14 13:40 nagata Assigned To => nagata
2015-08-14 13:40 nagata Status new => assigned
2015-08-14 15:00 nagata Note Added: 0000550
2015-08-14 18:33 robe Note Added: 0000551
2015-08-20 10:30 nagata Note Added: 0000556
2015-08-20 10:30 nagata File Added: test_timestamp.patch
2015-08-20 10:31 nagata Status assigned => resolved
2015-08-20 10:31 nagata Resolution open => fixed