summaryrefslogtreecommitdiff
path: root/src/backend/parser/kwlookup.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/parser/kwlookup.c')
-rw-r--r--src/backend/parser/kwlookup.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/backend/parser/kwlookup.c b/src/backend/parser/kwlookup.c
index 7321a57c15..58c8cdd78f 100644
--- a/src/backend/parser/kwlookup.c
+++ b/src/backend/parser/kwlookup.c
@@ -6,15 +6,12 @@
* NB - this file is also used by ECPG and several frontend programs in
* src/bin/ including pg_dump and psql
*
- * Note that this file expects that the ScanKeywords array is defined
- * and that LastScanKeyword points to its element one past the last.
- *
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/parser/kwlookup.c,v 2.2 2009/03/08 16:53:30 alvherre Exp $
+ * $PostgreSQL: pgsql/src/backend/parser/kwlookup.c,v 2.3 2009/07/14 20:24:10 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -39,7 +36,9 @@
* receive a different case-normalization mapping.
*/
const ScanKeyword *
-ScanKeywordLookup(const char *text)
+ScanKeywordLookup(const char *text,
+ const ScanKeyword *keywords,
+ int num_keywords)
{
int len,
i;
@@ -69,8 +68,8 @@ ScanKeywordLookup(const char *text)
/*
* Now do a binary search using plain strcmp() comparison.
*/
- low = &ScanKeywords[0];
- high = LastScanKeyword - 1;
+ low = keywords;
+ high = keywords + (num_keywords - 1);
while (low <= high)
{
const ScanKeyword *middle;