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

Commitc252a17

Browse files
committed
Rename frontend keyword arrays to avoid conflict with backend.
ecpg and pg_dump each contain keyword arrays with structure similarto the backend's keyword array. Up to now, we actually named thosearrays the same as the backend's and relied on parser/keywords.hto declare them. This seems a tad too cute, though, and it breaksnow that we need to PGDLLIMPORT-decorate the backend symbols.Rename to avoid the problem. Per buildfarm.(It strikes me that maybe we should get rid of the separate keywords.cfiles altogether, and just define these arrays in the modules that usethem, but that's a rather more invasive change.)
1 parenta52e6fe commitc252a17

File tree

4 files changed

+17
-9
lines changed

4 files changed

+17
-9
lines changed

‎src/bin/pg_dump/dumputils.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@
2222
#include"parser/keywords.h"
2323

2424

25+
/* Globals from keywords.c */
26+
externconstScanKeywordFEScanKeywords[];
27+
externconstintNumFEScanKeywords;
28+
2529
/* Globals exported by this file */
2630
intquote_all_identifiers=0;
2731
constchar*progname=NULL;
@@ -150,8 +154,8 @@ fmtId(const char *rawid)
150154
* that's fine, since we already know we have all-lower-case.
151155
*/
152156
constScanKeyword*keyword=ScanKeywordLookup(rawid,
153-
ScanKeywords,
154-
NumScanKeywords);
157+
FEScanKeywords,
158+
NumFEScanKeywords);
155159

156160
if (keyword!=NULL&&keyword->category!=UNRESERVED_KEYWORD)
157161
need_quotes= true;

‎src/bin/pg_dump/keywords.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
*/
2424
#definePG_KEYWORD(a,b,c) {a,0,c},
2525

26-
constScanKeywordScanKeywords[]= {
26+
constScanKeywordFEScanKeywords[]= {
2727
#include"parser/kwlist.h"
2828
};
2929

30-
constintNumScanKeywords=lengthof(ScanKeywords);
30+
constintNumFEScanKeywords=lengthof(FEScanKeywords);

‎src/interfaces/ecpg/preproc/ecpg_keywords.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,17 @@
1616
#include"extern.h"
1717
#include"preproc.h"
1818

19+
/* Globals from keywords.c */
20+
externconstScanKeywordSQLScanKeywords[];
21+
externconstintNumSQLScanKeywords;
22+
1923
/*
2024
* List of (keyword-name, keyword-token-value) pairs.
2125
*
2226
* !!WARNING!!: This list must be sorted, because binary
2327
* search is used to locate entries.
2428
*/
25-
staticconstScanKeywordScanECPGKeywords[]= {
29+
staticconstScanKeywordECPGScanKeywords[]= {
2630
/* name, value, category */
2731

2832
/*
@@ -87,12 +91,12 @@ ScanECPGKeywordLookup(const char *text)
8791
constScanKeyword*res;
8892

8993
/* First check SQL symbols defined by the backend. */
90-
res=ScanKeywordLookup(text,ScanKeywords,NumScanKeywords);
94+
res=ScanKeywordLookup(text,SQLScanKeywords,NumSQLScanKeywords);
9195
if (res)
9296
returnres;
9397

9498
/* Try ECPG-specific keywords. */
95-
res=ScanKeywordLookup(text,ScanECPGKeywords,lengthof(ScanECPGKeywords));
99+
res=ScanKeywordLookup(text,ECPGScanKeywords,lengthof(ECPGScanKeywords));
96100
if (res)
97101
returnres;
98102

‎src/interfaces/ecpg/preproc/keywords.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
#definePG_KEYWORD(a,b,c) {a,b,c},
2323

2424

25-
constScanKeywordScanKeywords[]= {
25+
constScanKeywordSQLScanKeywords[]= {
2626
#include"parser/kwlist.h"
2727
};
2828

29-
constintNumScanKeywords=lengthof(ScanKeywords);
29+
constintNumSQLScanKeywords=lengthof(SQLScanKeywords);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp