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

Commitd3e131e

Browse files
author
Michael Meskes
committed
- Changed some whitespacing in connect statement.
- Made some chars const as proposed by Stefan Huehner <stefan@huehner.org>.- Synced parser and keyword lists.- Copied two token parsing from backend parser to ecpg parser.- Also added a test case for this.
1 parente6e7818 commitd3e131e

File tree

68 files changed

+778
-317
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+778
-317
lines changed

‎src/interfaces/ecpg/ChangeLog

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2096,78 +2096,85 @@ Mo Aug 14 10:39:59 CEST 2006
20962096
- Fixed a nasty buffer underrun that only occured when using Informix
20972097
no_indicator NULL setting on timestamps and intervals.
20982098

2099-
Fr18.Aug 17:32:54 CEST 2006
2099+
Fr Aug 18 17:32:54 CEST 2006
21002100

21012101
- Changed lexer to no longer use the default rule.
21022102
- Synced parser and keyword list.
21032103
- Fixed parsing of CONNECT statement so it accepts a C string again.
21042104
- Fixed a buffer overrun that was masked on Linux systems.
21052105

2106-
Sa19.Aug 14:11:32 CEST 2006
2106+
Sa Aug 19 14:11:32 CEST 2006
21072107

21082108
- More SoC stuff.
21092109

2110-
Tu22.Aug 13:54:08 CEST 2006
2110+
Tu Aug 22 13:54:08 CEST 2006
21112111

21122112
- Descriptor values were quoted twice.
21132113

2114-
We23.Aug 09:32:14 CEST 2006
2114+
We Aug 23 09:32:14 CEST 2006
21152115

21162116
- Replaced double-quote-fix with a hopefully better version.
21172117
- Use initializer string length as size for character strings.
21182118
- Added ecpg_config.h file that is created via configure.
21192119

2120-
Th24.Aug 11:53:29 CEST 2006
2120+
Th Aug 24 11:53:29 CEST 2006
21212121

21222122
- Fixed of by one variable size.
21232123
- Synced parser.
21242124

2125-
Su27.Aug 17:54:36 CEST 2006
2125+
Su Aug 27 17:54:36 CEST 2006
21262126

21272127
- Enabled single-quoted connection targets.
21282128
- Fixed a memory leak/segfault in unsuccessful connection.
21292129

2130-
Tu29.Aug 14:21:31 CEST 2006
2130+
Tu Aug 29 14:21:31 CEST 2006
21312131

21322132
- Fixed parser and library to allow empty database names.
21332133
- Streamlined connection name parsing.
21342134

2135-
Su3.Sep 14:21:29 CEST 2006
2135+
Su Sep 3 14:21:29 CEST 2006
21362136

21372137
- Synced parser.
21382138
- Added another regression test and fixed tcp test.
21392139

2140-
Tu5.Sep 11:49:08 CEST 2006
2140+
Tu Sep 5 11:49:08 CEST 2006
21412141

21422142
- Synced parser.
21432143
- Fixed ecpglib trying to read one character after end-of-string.
21442144
- Fixed port number setting in regression suite.
21452145
- Added some interval checks to regression suite.
21462146
- Started to cleanup complex tests.
21472147

2148-
Th14.Sep 09:47:03 CEST 2006
2148+
Th Sep 14 09:47:03 CEST 2006
21492149

21502150
- Completely removed complex tests.
21512151
- Added missing constuctor/destructor for interval and date.
21522152

2153-
We8.Nov 10:53:42 CET 2006
2153+
We Nov 8 10:53:42 CET 2006
21542154

21552155
- Applied patch by Peter Harris to free auto_mem struct in ECPGconnect.
21562156
- Set ecpg library version to 5.2.
21572157
- Set ecpg version to 4.2.1.
21582158

2159-
Th25.Jan 17:17:01 CET 2007
2159+
Th Jan 25 17:17:01 CET 2007
21602160

21612161
- Removed compiler warning due to unneeded unsigned declaration.
21622162
- Removed regression test that triggers those libc precision bugs on some archs.
21632163

2164-
Fr2.Feb 09:53:48 CET 2007
2164+
Fr Feb 2 09:53:48 CET 2007
21652165

21662166
- Cleaned up va_list handling. Hopefully this now works on all archs.
21672167
- Applied Magnus Hagander's patch to take away some compiler warnings.
21682168

2169-
Su11.Feb 16:09:31 CET 2007
2169+
Su Feb 11 16:09:31 CET 2007
21702170

21712171
- Fixed multibyte handling as reported by <harada.toshi@oss.ntt.co.jp>.
21722172
- Set ecpg library version to 5.3.
2173+
2174+
Th Mar 15 08:27:53 CET 2007
2175+
2176+
- Made some chars const as proposed by Stefan Huehner <stefan@huehner.org>.
2177+
- Synced parser and keyword lists.
2178+
- Copied two token parsing from backend parser to ecpg parser.
2179+
- Also added a test case for this.
21732180
- Set ecpg version to 4.3.1.

‎src/interfaces/ecpg/ecpglib/connect.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/connect.c,v 1.39 2007/01/12 10:00:12 meskes Exp $ */
1+
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/connect.c,v 1.40 2007/03/17 19:25:22 meskes Exp $ */
22

33
#definePOSTGRES_ECPG_INTERNAL
44
#include"postgres_fe.h"
@@ -473,7 +473,7 @@ ECPGconnect(int lineno, int c, const char *name, const char *user, const char *p
473473
if (PQstatus(this->connection)==CONNECTION_BAD)
474474
{
475475
constchar*errmsg=PQerrorMessage(this->connection);
476-
char*db=realname ?realname :"<DEFAULT>";
476+
constchar*db=realname ?realname :"<DEFAULT>";
477477

478478
ECPGlog("connect: could not open database %s on %s port %s %s%s%s%s in line %d\n\t%s\n",
479479
db,

‎src/interfaces/ecpg/pgtypeslib/timestamp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ dttofmtasc_replace(timestamp * ts, date dDate, int dow, struct tm * tm,
542542
*/
543543
case'g':
544544
{
545-
char*fmt="%g";/* Keep compiler quiet about
545+
constchar*fmt="%g";/* Keep compiler quiet about
546546
* 2-digit year */
547547

548548
tm->tm_mon-=1;
@@ -744,7 +744,7 @@ dttofmtasc_replace(timestamp * ts, date dDate, int dow, struct tm * tm,
744744
*/
745745
case'x':
746746
{
747-
char*fmt="%x";/* Keep compiler quiet about
747+
constchar*fmt="%x";/* Keep compiler quiet about
748748
* 2-digit year */
749749

750750
tm->tm_mon-=1;

‎src/interfaces/ecpg/preproc/Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
# Copyright (c) 1998-2007, PostgreSQL Global Development Group
66
#
7-
# $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/Makefile,v 1.123 2007/01/05 22:20:00 momjian Exp $
7+
# $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/Makefile,v 1.124 2007/03/17 19:25:23 meskes Exp $
88
#
99
#-------------------------------------------------------------------------
1010

@@ -27,7 +27,7 @@ override CFLAGS += -Wno-error
2727
endif
2828
overrideCFLAGS +=$(PTHREAD_CFLAGS)
2929

30-
OBJS=preproc.o type.o ecpg.o ecpg_keywords.o output.o\
30+
OBJS=preproc.o type.o ecpg.o ecpg_keywords.o output.oparser.o\
3131
keywords.o c_keywords.o ../ecpglib/typename.o descriptor.o variable.o\
3232
$(WIN32RES)
3333

@@ -59,6 +59,8 @@ endif
5959

6060
c_keywords.oecpg_keywords.okeywords.opreproc.o: preproc.h
6161

62+
parser.c:$(top_srcdir)/src/backend/parser/parser.c
63+
rm -f$@&&$(LN_S)$<.
6264

6365
distprep:$(srcdir)/preproc.c$(srcdir)/preproc.h$(srcdir)/pgc.c
6466

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg.c,v 1.97 2007/02/01 19:10:29 momjian Exp $ */
1+
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg.c,v 1.98 2007/03/17 19:25:23 meskes Exp $ */
22

33
/* New main for ecpg, the PostgreSQL embedded SQL precompiler. */
44
/* (C) Michael Meskes <meskes@postgresql.org> Feb 5th, 1998 */
@@ -442,7 +442,7 @@ main(int argc, char *const argv[])
442442
output_line_number();
443443

444444
/* and parse the source */
445-
yyparse();
445+
base_yyparse();
446446

447447
/* check if all cursors were indeed opened */
448448
for (ptr=cur;ptr!=NULL;)

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* lexical token lookup for reserved words in postgres embedded SQL
55
*
66
* IDENTIFICATION
7-
* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg_keywords.c,v 1.32 2005/12/02 15:03:57 meskes Exp $
7+
* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg_keywords.c,v 1.33 2007/03/17 19:25:23 meskes Exp $
88
*
99
*-------------------------------------------------------------------------
1010
*/
@@ -50,7 +50,6 @@ static ScanKeyword ScanKeywords[] = {
5050
{"key_member",SQL_KEY_MEMBER},
5151
{"length",SQL_LENGTH},
5252
{"long",SQL_LONG},
53-
{"name",SQL_NAME},
5453
{"nullable",SQL_NULLABLE},
5554
{"octet_length",SQL_OCTET_LENGTH},
5655
{"open",SQL_OPEN},
@@ -70,7 +69,6 @@ static ScanKeyword ScanKeywords[] = {
7069
{"stop",SQL_STOP},
7170
{"struct",SQL_STRUCT},
7271
{"unsigned",SQL_UNSIGNED},
73-
{"value",SQL_VALUE},
7472
{"var",SQL_VAR},
7573
{"whenever",SQL_WHENEVER},
7674
};

‎src/interfaces/ecpg/preproc/extern.h

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/extern.h,v 1.64 2007/01/11 15:47:33 meskes Exp $ */
1+
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/extern.h,v 1.65 2007/03/17 19:25:23 meskes Exp $ */
22

33
#ifndef_ECPG_PREPROC_EXTERN_H
44
#define_ECPG_PREPROC_EXTERN_H
@@ -60,9 +60,9 @@ extern void output_line_number(void);
6060
externvoidoutput_statement(char*,int,char*);
6161
externvoidoutput_simple_statement(char*);
6262
externchar*hashline_number(void);
63-
externintyyparse(void);
64-
externintyylex(void);
65-
externvoidyyerror(char*);
63+
externintbase_yyparse(void);
64+
externintbase_yylex(void);
65+
externvoidbase_yyerror(constchar*);
6666
externvoid*mm_alloc(size_t),*mm_realloc(void*,size_t);
6767
externchar*mm_strdup(constchar*);
6868
externvoidmmerror(int,enumerrortype,char*,...);
@@ -90,6 +90,10 @@ extern void remove_typedefs(int);
9090
externvoidremove_variables(int);
9191
externstructvariable*new_variable(constchar*,structECPGtype*,int);
9292
externScanKeyword*ScanKeywordLookup(char*text);
93+
externvoidscanner_init(constchar*);
94+
externvoidparser_init(void);
95+
externvoidscanner_finish(void);
96+
intfiltered_base_yylex(void);
9397

9498
/* return codes */
9599

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

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/keywords.c,v 1.77 2007/01/05 22:20:00 momjian Exp $
11+
* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/keywords.c,v 1.78 2007/03/17 19:25:23 meskes Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -64,6 +64,7 @@ static ScanKeyword ScanKeywords[] = {
6464
{"cache",CACHE},
6565
{"called",CALLED},
6666
{"cascade",CASCADE},
67+
{"cascaded",CASCADED},
6768
{"case",CASE},
6869
{"cast",CAST},
6970
{"chain",CHAIN},
@@ -82,12 +83,15 @@ static ScanKeyword ScanKeywords[] = {
8283
{"commit",COMMIT},
8384
{"committed",COMMITTED},
8485
{"concurrently",CONCURRENTLY},
86+
{"concurrently",CONCURRENTLY},
8587
{"connection",CONNECTION},
8688
{"constraint",CONSTRAINT},
8789
{"constraints",CONSTRAINTS},
90+
{"content",CONTENT_P},
8891
{"conversion",CONVERSION_P},
8992
{"convert",CONVERT},
9093
{"copy",COPY},
94+
{"cost",COST},
9195
{"create",CREATE},
9296
{"createdb",CREATEDB},
9397
{"createrole",CREATEROLE},
@@ -118,6 +122,7 @@ static ScanKeyword ScanKeywords[] = {
118122
{"disable",DISABLE_P},
119123
{"distinct",DISTINCT},
120124
{"do",DO},
125+
{"document",DOCUMENT_P},
121126
{"domain",DOMAIN_P},
122127
{"double",DOUBLE_P},
123128
{"drop",DROP},
@@ -137,6 +142,7 @@ static ScanKeyword ScanKeywords[] = {
137142
{"external",EXTERNAL},
138143
{"extract",EXTRACT},
139144
{"false",FALSE_P},
145+
{"family",FAMILY},
140146
{"fetch",FETCH},
141147
{"first",FIRST_P},
142148
{"float",FLOAT_P},
@@ -212,6 +218,7 @@ static ScanKeyword ScanKeywords[] = {
212218
{"mode",MODE},
213219
{"month",MONTH_P},
214220
{"move",MOVE},
221+
{"name",NAME_P},
215222
{"names",NAMES},
216223
{"national",NATIONAL},
217224
{"natural",NATURAL},
@@ -233,6 +240,7 @@ static ScanKeyword ScanKeywords[] = {
233240
{"nowait",NOWAIT},
234241
{"null",NULL_P},
235242
{"nullif",NULLIF},
243+
{"nulls",NULLS_P},
236244
{"numeric",NUMERIC},
237245
{"object",OBJECT_P},
238246
{"of",OF},
@@ -306,13 +314,15 @@ static ScanKeyword ScanKeywords[] = {
306314
{"smallint",SMALLINT},
307315
{"some",SOME},
308316
{"stable",STABLE},
317+
{"standalone",STANDALONE_P},
309318
{"start",START},
310319
{"statement",STATEMENT},
311320
{"statistics",STATISTICS},
312321
{"stdin",STDIN},
313322
{"stdout",STDOUT},
314323
{"storage",STORAGE},
315324
{"strict",STRICT_P},
325+
{"strip",STRIP_P},
316326
{"substring",SUBSTRING},
317327
{"superuser",SUPERUSER_P},
318328
{"symmetric",SYMMETRIC},
@@ -349,19 +359,32 @@ static ScanKeyword ScanKeywords[] = {
349359
{"vacuum",VACUUM},
350360
{"valid",VALID},
351361
{"validator",VALIDATOR},
362+
{"value",VALUE_P},
352363
{"values",VALUES},
353364
{"varchar",VARCHAR},
354365
{"varying",VARYING},
355366
{"verbose",VERBOSE},
367+
{"version",VERSION_P},
356368
{"view",VIEW},
357369
{"volatile",VOLATILE},
358370
{"when",WHEN},
359371
{"where",WHERE},
372+
{"whitespace",WHITESPACE_P},
360373
{"with",WITH},
361374
{"without",WITHOUT},
362375
{"work",WORK},
363376
{"write",WRITE},
377+
{"xml",XML_P},
378+
{"xmlattributes",XMLATTRIBUTES},
379+
{"xmlconcat",XMLCONCAT},
380+
{"xmlelement",XMLELEMENT},
381+
{"xmlforest",XMLFOREST},
382+
{"xmlparse",XMLPARSE},
383+
{"xmlpi",XMLPI},
384+
{"xmlroot",XMLROOT},
385+
{"xmlserialize",XMLSERIALIZE},
364386
{"year",YEAR_P},
387+
{"yes",YES_P},
365388
{"zone",ZONE},
366389
};
367390

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
The parse.h file has to be in this directory to comply with the backend's source tree.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#include"extern.h"
2+
#include"preproc.h"
3+

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp