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

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

23

31

32

33

34

35

36

39{

46

48

49

50

51

54

55

56

57

60

62 {

63

66 }

67

68

70

71

72

73

74

76 {

80 bool isNull;

87

88

91

92

93 if (erm->rti != erm->prti)

94 {

95 Oid tableoid;

96

98 aerm->toidAttNo,

99 &isNull);

100

101 if (isNull)

104

106 if (tableoid != erm->relid)

107 {

108

109 erm->ermActive = false;

111 continue;

112 }

113 }

114 erm->ermActive = true;

115

116

118 aerm->ctidAttNo,

119 &isNull);

120

121 if (isNull)

123

124

126 {

129

131

135 errmsg("cannot lock rows in foreign table \"%s\"",

137

140 datum,

144 {

145

147 }

148

149

150

151

152

155

156 continue;

157 }

158

159

161 switch (erm->markType)

162 {

165 break;

168 break;

171 break;

174 break;

175 default:

176 elog(ERROR, "unsupported rowmark type");

178 break;

179 }

180

184

187 lockmode, erm->waitPolicy,

189 &tmfd);

190

191 switch (test)

192 {

194

196

198

199

200

201

202

203

204

205

206

207

208

209

210

211

213

215

216

217

218

219

222 break;

223

228 errmsg("could not serialize access due to concurrent update")));

229 elog(ERROR, "unexpected table_tuple_lock status: %u",

231 break;

232

237 errmsg("could not serialize access due to concurrent update")));

238

240

242 elog(ERROR, "attempted to lock invisible tuple");

243 break;

244

245 default:

246 elog(ERROR, "unrecognized table_tuple_lock status: %u",

248 }

249

250

251 erm->curCtid = tid;

252 }

253

254

255

256

258 {

259

261

262

263

264

265

267

268

269

270

273 {

274

276 }

277 }

278

279

280 return slot;

281}

282

283

284

285

286

287

288

289

292{

297

298

300

301

302

303

306 lrstate->ps.state = estate;

308

309

310

311

312

313

314

315

316

317

318

320

321

322

323

325

326

327 lrstate->ps.resultopsset = true;

329 &lrstate->ps.resultopsfixed);

330

331

332

333

334

336

337

338

339

340

341

345 {

350

351

353 continue;

354

355

356

357

358

361 continue;

362

363

366

367

368

369

370

371

372

375 else

377 }

378

379

382

384}

385

386

387

388

389

390

391

392

393void

400

401

402void

404{

406

407

408

409

410

413}

bool bms_is_member(int x, const Bitmapset *a)

#define Assert(condition)

#define OidIsValid(objectId)

int errcode(int sqlerrcode)

#define ereport(elevel,...)

void ExecReScan(PlanState *node)

ExecRowMark * ExecFindRowMark(EState *estate, Index rti, bool missing_ok)

ExecAuxRowMark * ExecBuildAuxRowMark(ExecRowMark *erm, List *targetlist)

TupleTableSlot * EvalPlanQualSlot(EPQState *epqstate, Relation relation, Index rti)

void EvalPlanQualBegin(EPQState *epqstate)

void EvalPlanQualInit(EPQState *epqstate, EState *parentestate, Plan *subplan, List *auxrowmarks, int epqParam, List *resultRelations)

void EvalPlanQualEnd(EPQState *epqstate)

TupleTableSlot * EvalPlanQualNext(EPQState *epqstate)

void ExecEndNode(PlanState *node)

PlanState * ExecInitNode(Plan *node, EState *estate, int eflags)

void ExecInitResultTypeTL(PlanState *planstate)

const TupleTableSlotOps * ExecGetResultSlotOps(PlanState *planstate, bool *isfixed)

#define outerPlanState(node)

static RangeTblEntry * exec_rt_fetch(Index rti, EState *estate)

static TupleTableSlot * ExecProcNode(PlanState *node)

#define EvalPlanQualSetSlot(epqstate, slot)

static Datum ExecGetJunkAttribute(TupleTableSlot *slot, AttrNumber attno, bool *isNull)

FdwRoutine * GetFdwRoutineForRelation(Relation relation, bool makecopy)

static void ItemPointerSetInvalid(ItemPointerData *pointer)

ItemPointerData * ItemPointer

List * lappend(List *list, void *datum)

@ LockTupleNoKeyExclusive

#define CHECK_FOR_INTERRUPTS()

void ExecReScanLockRows(LockRowsState *node)

static TupleTableSlot * ExecLockRows(PlanState *pstate)

LockRowsState * ExecInitLockRows(LockRows *node, EState *estate, int eflags)

void ExecEndLockRows(LockRowsState *node)

#define castNode(_type_, nodeptr)

#define lfirst_node(type, lc)

static ListCell * lnext(const List *l, const ListCell *c)

#define ERRCODE_T_R_SERIALIZATION_FAILURE

#define RowMarkRequiresRowShareLock(marktype)

@ ROW_MARK_NOKEYEXCLUSIVE

static Oid DatumGetObjectId(Datum X)

static Pointer DatumGetPointer(Datum X)

#define RelationGetRelationName(relation)

Bitmapset * es_unpruned_relids

RefetchForeignRow_function RefetchForeignRow

static TM_Result table_tuple_lock(Relation rel, ItemPointer tid, Snapshot snapshot, TupleTableSlot *slot, CommandId cid, LockTupleMode mode, LockWaitPolicy wait_policy, uint8 flags, TM_FailureData *tmfd)

#define TUPLE_LOCK_FLAG_FIND_LAST_VERSION

#define TUPLE_LOCK_FLAG_LOCK_UPDATE_IN_PROGRESS

static TupleTableSlot * ExecClearTuple(TupleTableSlot *slot)

#define IsolationUsesXactSnapshot()