lib*dll.def
*~
lib*.pc
+tags
# Local excludes in root directory
/GNUmakefile
/cscope*
/.gitignore
/tmp_install/
+.tags
* copy the initial datum since it might get changed inside the
* collection function
*/
- fcinfo.arg[0] = datumCopy(peraggstate->initCollectValue,
- peraggstate->collecttypeByVal,
- peraggstate->collecttypeLen);
fcinfo.argnull[0] = peraggstate->initCollectValueIsNull;
+ fcinfo.arg[0] = (Datum) NULL;
+ if (!fcinfo.argnull[0])
+ {
+ fcinfo.arg[0] = datumCopy(peraggstate->initCollectValue,
+ peraggstate->collecttypeByVal,
+ peraggstate->collecttypeLen);
+ }
value = FunctionCallInvoke(&fcinfo);
isnull = fcinfo.isnull;
}
#include "postgres.h"
#include <poll.h>
+#ifdef __sun
+#include <sys/filio.h>
+#endif
+
#include <sys/time.h>
#include <sys/types.h>
#include <sys/ioctl.h>
*-------------------------------------------------------------------------
*/
+#ifdef __sun
+#define _XOPEN_SOURCE 500
+#define uint uint32_t
+#endif
+
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/uio.h>
int64 total_size = 0;
int64 size = 0;
Datum datum = (Datum) 0;
+ bool isnull = true;
#ifdef XCP
EState *estate;
MemoryContextSwitchTo(oldcontext);
result = ExecRemoteQuery(pstate);
- while (!TupIsNull(result))
+ while (result != NULL && !TupIsNull(result))
{
- bool isnull;
datum = slot_getattr(result, 1, &isnull);
- size = DatumGetInt64(datum);
- total_size += size;
result = ExecRemoteQuery(pstate);
+
+ /* For single node, don't assume the type of datum. It can be bool also. */
+ if (numnodes == 1)
+ continue;
+ /* We should not cast a null into an int */
+ if (isnull)
+ {
+ ereport(ERROR,
+ (errcode(ERRCODE_INTERNAL_ERROR),
+ errmsg("Expected Int64 but got null instead "
+ "while executing query '%s'",
+ query)));
+ break;
+ }
+
+ size = DatumGetInt64(datum);
+ total_size += size;
}
ExecEndRemoteQuery(pstate);
#else
#endif
if (numnodes == 1)
+ {
+ if (isnull)
+ ereport(ERROR,
+ (errcode(ERRCODE_INTERNAL_ERROR),
+ errmsg("Expected datum but got null instead "
+ "while executing query '%s'",
+ query)));
PG_RETURN_DATUM(datum);
+ }
else
PG_RETURN_INT64(total_size);
}
state->mergenext = (int *) palloc0(combiner->conn_count * sizeof(int));
state->mergelast = (int *) palloc0(combiner->conn_count * sizeof(int));
state->mergeavailslots = (int *) palloc0(combiner->conn_count * sizeof(int));
- state->mergeavailmem = (long *) palloc0(combiner->conn_count * sizeof(long));
+ state->mergeavailmem = (int64 *) palloc0(combiner->conn_count * sizeof(int64));
state->tp_runs = (int *) palloc0(combiner->conn_count * sizeof(int));
state->tp_dummy = (int *) palloc0(combiner->conn_count * sizeof(int));
include $(top_builddir)/src/Makefile.global
subdir = src/gtm/gtm_ctl
-OBJS=gtm_ctl.o
+OBJS=gtm_ctl.o
OTHERS=../common/libgtm.a ../libpq/libpqcomm.a ../client/libgtmclient.a ../path/libgtmpath.a
-LDFLAGS=-L$(top_builddir)/common -L$(top_builddir)/libpq
-
-
-LIBS=-lpthread
gtm_ctl:$(OBJS)
$(CC) $(CFLAGS) $(LDFLAGS) $(LIBS) $^ $(OTHERS) -o gtm_ctl
OBJS=main.o gtm_thread.o gtm_txn.o gtm_seq.o gtm_snap.o gtm_standby.o gtm_opt.o gtm_backup.o
-OTHERS= ../libpq/libpqcomm.a ../path/libgtmpath.a ../recovery/libgtmrecovery.a ../client/libgtmclient.a ../common/libgtm.a ../../port/libpgport.a
-
-LDFLAGS=-L$(top_builddir)/common -L$(top_builddir)/libpq
-
-LIBS=-lpthread
+OTHERS= ../libpq/libpqcomm.a ../path/libgtmpath.a ../recovery/libgtmrecovery.a ../client/libgtmclient.a ../common/libgtm.a ../../port/libpgport.a
gtm:$(OBJS)
$(CC) $(CFLAGS) $(LDFLAGS) $(LIBS) $^ $(OTHERS) -o gtm
OTHERS= ../libpq/libpqcomm.a ../path/libgtmpath.a ../client/libgtmclient.a ../common/libgtm.a
-LDFLAGS=-L$(top_builddir)/common -L$(top_builddir)/libpq
-
-LIBS=-lpthread
-
gtm_proxy:$(OBJS)
$(CC) $(CFLAGS) $(LDFLAGS) $(LIBS) $^ $(OTHERS) ../../port/libpgport_srv.a -o gtm_proxy
#include <sys/param.h> /* for MAXHOSTNAMELEN on most */
#include <sys/socket.h>
#ifdef HAVE_SYS_UCRED_H
+#ifdef __sun
+#include <procfs.h>
+#endif
#include <sys/ucred.h>
#endif
#ifndef MAXHOSTNAMELEN
#include <ucred.h>
#endif
#ifdef HAVE_SYS_UCRED_H
+#ifdef __sun
+#include <procfs.h>
+#endif
#include <sys/ucred.h>
#endif
int8:out:x86_64-w64-mingw32=int8-exp-three-digits.out
int8:out:i.86-w64-mingw32=int8-exp-three-digits.out
int8:out:i.86-pc-win32vc=int8-exp-three-digits.out
+aggregates:out:i386-pc-solaris2.11=aggregates-float-sunos.out