I tested it on the CVS head source.
C:\> ver
Microsoft Windows XP [Version 5.1.2600]
$ uname -a
MINGW32_NT-5.1 BEAR 1.0.11(0.46/3/2) 2004-04-30 18:55 i686 unknown
$ pwd
/home/uniware/pgsql/src/interfaces/ecpg/test/sql
$ make
gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Winline -Wdeclaration-after-
statement -Wendif-labels -fno-strict-aliasing -g -I./../../include -I../../../.
./../src/interfaces/libpq -I../../include -I../../../../../src/include -L../../.
./../../src/port -Wl,--allow-multiple-definition -L../../ecpglib -L../../pgtyp
eslib -L../../../libpq
func.c -lpgport -lws2_32 -lshfolder -lpgtypes -lecpg -lp
q -o func
func.pgc: In function `main':
func.pgc:18: error: missing terminating " character
func.pgc:22: error: `BEGIN' undeclared (first use in this function)
func.pgc:22: error: (Each undeclared identifier is reported only once
func.pgc:22: error: for each function it appears in.)
func.pgc:22: error: syntax error before "RAISE"
func.pgc:22:16: warning: character constant too long for its type
func.pgc:24: error: `RETURN' undeclared (first use in this function)
func.pgc:26: error: `END' undeclared (first use in this function)
func.pgc:26: error: `$test$' undeclared (first use in this function)
func.pgc:26: error: syntax error before "language"
func.pgc:26: error: missing terminating " character
make: *** [func] Error 1
A quick look at C file func.c found that:
49 #line 16 "func.pgc" 50 ^M 51 ^M 52 { ECPGdo(__LINE__, 0, 1, NULL, "create function My_Table_Check ()
ret
urns trigger as $test$^M\ 53 BEGIN^M\ 54 RAISE WARNING 'Notice: TG_NAME=%, TG WHEN=%', TG_NAME,
TG_WHEN;^M\ 55 RETURN NEW;^M\ 56 END; $test$ language plpgsql", ECPGt_EOIT, ECPGt_EORT); 57 #line 24
"func.pgc" 58 59 if (sqlca.sqlwarn[0] == 'W') sqlprint(); 60 #line 24 "func.pgc" 61 62 if (sqlca.sqlcode
<0) sqlprint();} 63 #line 24 "func.pgc"
There are "^M"s followed by "\". It seems that the "^M"s are generated by
the lexer/grammer.
Any one knows the actual cause?
--
With regards,
William ZHANG