diff options
Diffstat (limited to 'src/interfaces/ecpg/test/preproc')
-rw-r--r-- | src/interfaces/ecpg/test/preproc/Makefile | 1 | ||||
-rw-r--r-- | src/interfaces/ecpg/test/preproc/strings.pgc | 27 |
2 files changed, 28 insertions, 0 deletions
diff --git a/src/interfaces/ecpg/test/preproc/Makefile b/src/interfaces/ecpg/test/preproc/Makefile index 6928a1f3fe3..94b6779a417 100644 --- a/src/interfaces/ecpg/test/preproc/Makefile +++ b/src/interfaces/ecpg/test/preproc/Makefile @@ -9,6 +9,7 @@ TESTS = array_of_struct array_of_struct.c \ comment comment.c \ define define.c \ init init.c \ + strings strings.c \ type type.c \ variable variable.c \ whenever whenever.c diff --git a/src/interfaces/ecpg/test/preproc/strings.pgc b/src/interfaces/ecpg/test/preproc/strings.pgc new file mode 100644 index 00000000000..1a8c0d707df --- /dev/null +++ b/src/interfaces/ecpg/test/preproc/strings.pgc @@ -0,0 +1,27 @@ +#include <stdlib.h> + +exec sql include ../regression; + +exec sql begin declare section; +char *s1, *s2, *s3, *s4, *s5, *s6; +exec sql end declare section; + +int main(void) +{ + ECPGdebug(1, stderr); + + exec sql connect to REGRESSDB1; + + exec sql select 'abcdef', + N'abcdef' AS foo, + E'abc\bdef' AS "foo", + U&'d\0061t\0061' AS U&"foo", + U&'d!+000061t!+000061' uescape '!', + $foo$abc$def$foo$ + into :s1, :s2, :s3, :s4, :s5, :s6; + + printf("%s %s %s %s %s %s\n", s1, s2, s3, s4, s5, s6); + + exec sql disconnect; + exit (0); +} |