Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb36e304

Browse files
author
Bryan Henderson
committed
Add comments describing interface to heap_getattr().
1 parent6cfb12e commitb36e304

File tree

1 file changed

+30
-21
lines changed

1 file changed

+30
-21
lines changed

‎src/backend/access/common/heaptuple.c

Lines changed: 30 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/access/common/heaptuple.c,v 1.17 1996/12/04 03:05:55 bryanh Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/access/common/heaptuple.c,v 1.18 1996/12/09 01:22:17 bryanh Exp $
1212
*
1313
* NOTES
1414
* The old interface functions have been converted to macros
@@ -658,52 +658,61 @@ fastgetattr(HeapTuple tup,
658658
}
659659

660660
/* ----------------
661-
*heap_getattr
661+
*heap_getattr
662662
*
663-
*returns an attribute from a heap tuple. uses
664-
* ----------------
665-
*/
663+
* Find a particular field in a row represented as a heap tuple.
664+
* We return a pointer into that heap tuple, which points to the
665+
* first byte of the value of the field in question.
666+
*
667+
* If the field in question has a NULL value, we return a null
668+
* pointer and return <*isnull> == true. Otherwise, we return
669+
* <*isnull> == false.
670+
*
671+
* <tup> is the pointer to the heap tuple. <attnum> is the attribute
672+
* number of the column (field) caller wants. <tupleDesc> is a
673+
* pointer to the structure describing the row and all its fields.
674+
* ---------------- */
666675
char*
667676
heap_getattr(HeapTupletup,
668-
Bufferb,
669-
intattnum,
670-
TupleDesctupleDesc,
671-
bool*isnull)
677+
Bufferb,
678+
intattnum,
679+
TupleDesctupleDesc,
680+
bool*isnull)
672681
{
673-
boollocalIsNull;
682+
boollocalIsNull;
674683

675684
/* ----------------
676-
*sanity checks
685+
*sanity checks
677686
* ----------------
678687
*/
679688
Assert(tup!=NULL);
680689

681690
if (!PointerIsValid(isnull))
682-
isnull=&localIsNull;
691+
isnull=&localIsNull;
683692

684693
if (attnum> (int)tup->t_natts) {
685-
*isnull= true;
686-
return ((char*)NULL);
694+
*isnull= true;
695+
return ((char*)NULL);
687696
}
688697

689698
/* ----------------
690-
*take care of user defined attributes
699+
*take care of user defined attributes
691700
* ----------------
692701
*/
693702
if (attnum>0) {
694-
char*datum;
695-
datum=fastgetattr(tup,attnum,tupleDesc,isnull);
696-
697-
return (datum);
703+
char*datum;
704+
datum=fastgetattr(tup,attnum,tupleDesc,isnull);
705+
706+
return (datum);
698707
}
699708

700709
/* ----------------
701-
*take care of system attributes
710+
*take care of system attributes
702711
* ----------------
703712
*/
704713
*isnull= false;
705714
return
706-
heap_getsysattr(tup,b,attnum);
715+
heap_getsysattr(tup,b,attnum);
707716
}
708717

709718
/* ----------------

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp