PostgreSQL Source Code: src/backend/executor/tqueue.c Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

21

24

25

26

27

28

29

31{

35

36

37

38

39

40

41

42

44{

46};

47

48

49

50

51

52

53static bool

55{

59 bool should_free;

60

61

64

65 if (should_free)

67

68

70 return false;

73 (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),

74 errmsg("could not send tuple to shared-memory queue")));

75

76 return true;

77}

78

79

80

81

82static void

84{

85

86}

87

88

89

90

91static void

93{

95

96 if (tqueue->queue != NULL)

98 tqueue->queue = NULL;

99}

100

101

102

103

104static void

106{

108

109

110 if (tqueue->queue != NULL)

113}

114

115

116

117

120{

122

124

130 self->queue = handle;

131

133}

134

135

136

137

140{

142

143 reader->queue = handle;

144

145 return reader;

146}

147

148

149

150

151

152

153

154void

156{

158}

159

160

161

162

163

164

165

166

167

168

169

170

171

172

173

174

177{

182

183 if (done != NULL)

184 *done = false;

185

186

188

189

191 {

192 if (done != NULL)

193 *done = true;

194 return NULL;

195 }

196

197

199 return NULL;

201

202

203

204

205

208

209 return tuple;

210}

int errcode(int sqlerrcode)

int errmsg(const char *fmt,...)

#define ereport(elevel,...)

MinimalTuple ExecFetchSlotMinimalTuple(TupleTableSlot *slot, bool *shouldFree)

Assert(PointerIsAligned(start, uint64))

MinimalTupleData * MinimalTuple

void pfree(void *pointer)

void * palloc0(Size size)

void shm_mq_detach(shm_mq_handle *mqh)

shm_mq_result shm_mq_receive(shm_mq_handle *mqh, Size *nbytesp, void **datap, bool nowait)

shm_mq_result shm_mq_send(shm_mq_handle *mqh, Size nbytes, const void *data, bool nowait, bool force_flush)

void(* rStartup)(DestReceiver *self, int operation, TupleDesc typeinfo)

void(* rShutdown)(DestReceiver *self)

bool(* receiveSlot)(TupleTableSlot *slot, DestReceiver *self)

void(* rDestroy)(DestReceiver *self)

struct TQueueDestReceiver TQueueDestReceiver

static void tqueueStartupReceiver(DestReceiver *self, int operation, TupleDesc typeinfo)

static void tqueueShutdownReceiver(DestReceiver *self)

MinimalTuple TupleQueueReaderNext(TupleQueueReader *reader, bool nowait, bool *done)

DestReceiver * CreateTupleQueueDestReceiver(shm_mq_handle *handle)

static bool tqueueReceiveSlot(TupleTableSlot *slot, DestReceiver *self)

TupleQueueReader * CreateTupleQueueReader(shm_mq_handle *handle)

void DestroyTupleQueueReader(TupleQueueReader *reader)

static void tqueueDestroyReceiver(DestReceiver *self)