You can subscribe to this list here.
2010 |
Jan
|
Feb
|
Mar
|
Apr
(4) |
May
(28) |
Jun
(12) |
Jul
(11) |
Aug
(12) |
Sep
(5) |
Oct
(19) |
Nov
(14) |
Dec
(12) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2011 |
Jan
(18) |
Feb
(30) |
Mar
(115) |
Apr
(89) |
May
(50) |
Jun
(44) |
Jul
(22) |
Aug
(13) |
Sep
(11) |
Oct
(30) |
Nov
(28) |
Dec
(39) |
2012 |
Jan
(38) |
Feb
(18) |
Mar
(43) |
Apr
(91) |
May
(108) |
Jun
(46) |
Jul
(37) |
Aug
(44) |
Sep
(33) |
Oct
(29) |
Nov
(36) |
Dec
(15) |
2013 |
Jan
(35) |
Feb
(611) |
Mar
(5) |
Apr
(55) |
May
(30) |
Jun
(28) |
Jul
(458) |
Aug
(34) |
Sep
(9) |
Oct
(39) |
Nov
(22) |
Dec
(32) |
2014 |
Jan
(16) |
Feb
(16) |
Mar
(42) |
Apr
(179) |
May
(7) |
Jun
(6) |
Jul
(9) |
Aug
|
Sep
(4) |
Oct
|
Nov
(3) |
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
(2) |
May
(4) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
1
|
2
(1) |
3
(3) |
4
(3) |
5
|
6
|
7
|
8
|
9
(1) |
10
(1) |
11
(3) |
12
(4) |
13
|
14
|
15
|
16
(1) |
17
|
18
|
19
(1) |
20
|
21
|
22
|
23
|
24
(7) |
25
(16) |
26
(2) |
27
|
28
|
29
|
30
(4) |
31
(3) |
|
|
|
|
From: Ashutosh B. <ash...@us...> - 2011-05-19 09:16:55
|
Project "Postgres-XC". The branch, master has been updated via 87a62879ab3492e3dd37d00478ffa857639e2b85 (commit) from b170fe2d7fc4bd175c72c2e4370fab223bac24d6 (commit) - Log ----------------------------------------------------------------- commit 87a62879ab3492e3dd37d00478ffa857639e2b85 Author: Ashutosh Bapat <ash...@en...> Date: Thu May 19 14:45:02 2011 +0530 While copying the message from datanode to a slot, copy it within the memory context of the slot. Fix some compiler warnings. diff --git a/src/backend/executor/execTuples.c b/src/backend/executor/execTuples.c index 5430e16..76c4ba3 100644 --- a/src/backend/executor/execTuples.c +++ b/src/backend/executor/execTuples.c @@ -1388,6 +1388,13 @@ ExecStoreDataRowTuple(char *msg, size_t len, int node, TupleTableSlot *slot, heap_freetuple(slot->tts_tuple); if (slot->tts_shouldFreeMin) heap_free_minimal_tuple(slot->tts_mintuple); + /* + * if msg == slot->tts_dataRow then we would + * free the dataRow in the slot loosing the contents in msg. It is safe + * to reset shouldFreeRow, since it will be overwritten just below. + */ + if (msg == slot->tts_dataRow) + slot->tts_shouldFreeRow = false; if (slot->tts_shouldFreeRow) pfree(slot->tts_dataRow); diff --git a/src/backend/pgxc/pool/execRemote.c b/src/backend/pgxc/pool/execRemote.c index 43d9606..75aca21 100644 --- a/src/backend/pgxc/pool/execRemote.c +++ b/src/backend/pgxc/pool/execRemote.c @@ -49,7 +49,7 @@ #define PRIMARY_NODE_WRITEAHEAD 1024 * 1024 static bool autocommit = true; -static is_ddl = false; +static bool is_ddl = false; static bool implicit_force_autocommit = false; static PGXCNodeHandle **write_node_list = NULL; static int write_node_count = 0; @@ -420,7 +420,6 @@ create_tuple_desc(char *msg_body, size_t len) char *typname; Oid oidtypeid; int32 typemode, typmod; - uint32 n32; attnum = (AttrNumber) i; @@ -1152,6 +1151,27 @@ BufferConnection(PGXCNodeHandle *conn) } /* + * copy the datarow from combiner to the given slot, in the slot's memory + * context + */ +static void +CopyDataRowTupleToSlot(RemoteQueryState *combiner, TupleTableSlot *slot) +{ + char *msg; + MemoryContext oldcontext; + oldcontext = MemoryContextSwitchTo(slot->tts_mcxt); + msg = (char *)palloc(combiner->currentRow.msglen); + memcpy(msg, combiner->currentRow.msg, combiner->currentRow.msglen); + ExecStoreDataRowTuple(msg, combiner->currentRow.msglen, + combiner->currentRow.msgnode, slot, true); + pfree(combiner->currentRow.msg); + combiner->currentRow.msg = NULL; + combiner->currentRow.msglen = 0; + combiner->currentRow.msgnode = 0; + MemoryContextSwitchTo(oldcontext); +} + +/* * Get next data row from the combiner's buffer into provided slot * Just clear slot and return false if buffer is empty, that means end of result * set is reached @@ -1164,12 +1184,7 @@ FetchTuple(RemoteQueryState *combiner, TupleTableSlot *slot) /* If we have message in the buffer, consume it */ if (combiner->currentRow.msg) { - ExecStoreDataRowTuple(combiner->currentRow.msg, - combiner->currentRow.msglen, - combiner->currentRow.msgnode, slot, true); - combiner->currentRow.msg = NULL; - combiner->currentRow.msglen = 0; - combiner->currentRow.msgnode = 0; + CopyDataRowTupleToSlot(combiner, slot); have_tuple = true; } @@ -1189,6 +1204,10 @@ FetchTuple(RemoteQueryState *combiner, TupleTableSlot *slot) * completed. Afterwards rows will be taken from the buffer bypassing * currentRow until buffer is empty, and only after that data are read * from a connection. + * PGXCTODO: the message should be allocated in the same memory context as + * that of the slot. Are we sure of that in the call to + * ExecStoreDataRowTuple below? If one fixes this memory issue, please + * consider using CopyDataRowTupleToSlot() for the same. */ if (list_length(combiner->rowBuffer) > 0) { @@ -1279,12 +1298,7 @@ FetchTuple(RemoteQueryState *combiner, TupleTableSlot *slot) /* If we have message in the buffer, consume it */ if (combiner->currentRow.msg) { - ExecStoreDataRowTuple(combiner->currentRow.msg, - combiner->currentRow.msglen, - combiner->currentRow.msgnode, slot, true); - combiner->currentRow.msg = NULL; - combiner->currentRow.msglen = 0; - combiner->currentRow.msgnode = 0; + CopyDataRowTupleToSlot(combiner, slot); have_tuple = true; } @@ -3762,7 +3776,7 @@ handle_results: natts = resultslot->tts_tupleDescriptor->natts; for (i = 0; i < natts; ++i) { - if (resultslot->tts_values[i] == NULL) + if (resultslot->tts_values[i] == (Datum) NULL) return NULL; } ----------------------------------------------------------------------- Summary of changes: src/backend/executor/execTuples.c | 7 +++++ src/backend/pgxc/pool/execRemote.c | 44 +++++++++++++++++++++++------------ 2 files changed, 36 insertions(+), 15 deletions(-) hooks/post-receive -- Postgres-XC |