*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/catalog/indexing.c,v 1.22 1998/08/20 22:07:36 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/catalog/indexing.c,v 1.23 1998/08/30 23:25:55 momjian Exp $
*
*-------------------------------------------------------------------------
*/
{
IndexScanDesc sd;
RetrieveIndexResult indexRes;
- HeapTuple tuple;
+ HeapTuple tuple = NULL;
Buffer buffer;
sd = index_beginscan(idesc, false, num_keys, skey);
- tuple = (HeapTuple) NULL;
- do
+ while ((indexRes = index_getnext(sd, ForwardScanDirection)))
{
- indexRes = index_getnext(sd, ForwardScanDirection);
- if (indexRes)
- {
- ItemPointer iptr;
+ ItemPointer iptr;
- iptr = &indexRes->heap_iptr;
- tuple = heap_fetch(heapRelation, SnapshotNow, iptr, &buffer);
- pfree(indexRes);
- }
- else
+ iptr = &indexRes->heap_iptr;
+ tuple = heap_fetch(heapRelation, SnapshotNow, iptr, &buffer);
+ pfree(indexRes);
+ if (HeapTupleIsValid(tuple))
break;
- } while (!HeapTupleIsValid(tuple));
+ }
if (HeapTupleIsValid(tuple))
+ {
tuple = heap_copytuple(tuple);
-
- if (BufferIsValid(buffer))
ReleaseBuffer(buffer);
+ }
index_endscan(sd);
pfree(sd);
(bits16) 0x0,
(AttrNumber) 1,
(RegProcedure) F_OIDEQ,
- (Datum) procId);
+ ObjectIdGetDatum(procId));
idesc = index_openr(ProcedureOidIndex);
tuple = CatalogIndexFetchTuple(heapRelation, idesc, skey, 1);
(bits16) 0x0,
(AttrNumber) 1,
(RegProcedure) F_NAMEEQ,
- (Datum) procName);
+ PointerGetDatum(procName));
ScanKeyEntryInitialize(&skey[1],
(bits16) 0x0,
(bits16) 0x0,
(AttrNumber) 3,
(RegProcedure) F_OID8EQ,
- (Datum) argTypes);
+ PointerGetDatum(argTypes));
idesc = index_openr(ProcedureNameIndex);
tuple = CatalogIndexFetchTuple(heapRelation, idesc, skey, 3);
(bits16) 0x0,
(AttrNumber) 1,
(RegProcedure) F_TEXTEQ,
- (Datum) procSrc);
+ PointerGetDatum(procSrc));
idesc = index_openr(ProcedureSrcIndex);
tuple = CatalogIndexFetchTuple(heapRelation, idesc, skey, 1);
(bits16) 0x0,
(AttrNumber) 1,
(RegProcedure) F_OIDEQ,
- (Datum) typeId);
+ ObjectIdGetDatum(typeId));
idesc = index_openr(TypeOidIndex);
tuple = CatalogIndexFetchTuple(heapRelation, idesc, skey, 1);
(bits16) 0x0,
(AttrNumber) 1,
(RegProcedure) F_NAMEEQ,
- (Datum) typeName);
+ PointerGetDatum(typeName));
idesc = index_openr(TypeNameIndex);
tuple = CatalogIndexFetchTuple(heapRelation, idesc, skey, 1);
(bits16) 0x0,
(AttrNumber) 1,
(RegProcedure) F_OIDEQ,
- (Datum) relId);
+ ObjectIdGetDatum(relId));
idesc = index_openr(ClassOidIndex);
tuple = CatalogIndexFetchTuple(heapRelation, idesc, skey, 1);
/* A lexical scanner generated by flex */
/* Scanner skeleton version:
- * $Header: /cvsroot/pgsql/src/backend/parser/Attic/scan.c,v 1.24 1998/08/23 22:25:51 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/parser/Attic/scan.c,v 1.25 1998/08/30 23:25:56 momjian Exp $
*/
#define FLEX_SCANNER
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/parser/Attic/scan.c,v 1.24 1998/08/23 22:25:51 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/parser/Attic/scan.c,v 1.25 1998/08/30 23:25:56 momjian Exp $
*
*-------------------------------------------------------------------------
*/
if (isascii((unsigned char)yytext[i]) &&
isupper(yytext[i]))
yytext[i] = tolower(yytext[i]);
+ if (i >= NAMEDATALEN)
+ yytext[NAMEDATALEN-1] = '\0';
keyword = ScanKeywordLookup((char*)yytext);
if (keyword != NULL) {
YY_BREAK
case 34:
YY_RULE_SETUP
-#line 337 "scan.l"
+#line 339 "scan.l"
{
char* endptr;
YY_BREAK
case 35:
YY_RULE_SETUP
-#line 355 "scan.l"
+#line 357 "scan.l"
{
char* endptr;
YY_BREAK
case 36:
YY_RULE_SETUP
-#line 366 "scan.l"
+#line 368 "scan.l"
{
char* endptr;
YY_BREAK
case 37:
YY_RULE_SETUP
-#line 383 "scan.l"
+#line 385 "scan.l"
{
char* endptr;
YY_BREAK
case 38:
YY_RULE_SETUP
-#line 395 "scan.l"
+#line 397 "scan.l"
{
int i;
ScanKeyword *keyword;
if (isascii((unsigned char)yytext[i]) &&
isupper(yytext[i]))
yytext[i] = tolower(yytext[i]);
+ if (i >= NAMEDATALEN)
+ yytext[NAMEDATALEN-1] = '\0';
keyword = ScanKeywordLookup((char*)yytext);
if (keyword != NULL) {
YY_BREAK
case 39:
YY_RULE_SETUP
-#line 414 "scan.l"
+#line 418 "scan.l"
{ /* ignore */ }
YY_BREAK
case 40:
YY_RULE_SETUP
-#line 416 "scan.l"
+#line 420 "scan.l"
{ return (yytext[0]); }
YY_BREAK
case 41:
YY_RULE_SETUP
-#line 418 "scan.l"
+#line 422 "scan.l"
ECHO;
YY_BREAK
-#line 1307 "lex.yy.c"
+#line 1311 "lex.yy.c"
case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(xb):
case YY_STATE_EOF(xc):
return 0;
}
#endif
-#line 418 "scan.l"
+#line 422 "scan.l"
void yyerror(char message[])