From ab4e386a8069e3228536f1044f23bbf09f85204b Mon Sep 17 00:00:00 2001 From: Tom Lane <tgl@sss.pgh.pa.us> Date: Wed, 6 May 2009 03:22:15 +0000 Subject: [PATCH] Fix ecpg tests for change that disallowed Unicode literals unless standard_conforming_strings is on. --- .../ecpg/test/expected/preproc-strings.c | 8 +++-- .../ecpg/test/expected/preproc-strings.stderr | 34 +++++++++++-------- src/interfaces/ecpg/test/preproc/strings.pgc | 2 ++ 3 files changed, 28 insertions(+), 16 deletions(-) diff --git a/src/interfaces/ecpg/test/expected/preproc-strings.c b/src/interfaces/ecpg/test/expected/preproc-strings.c index aa0bf6e877d..b72d9eeadd0 100644 --- a/src/interfaces/ecpg/test/expected/preproc-strings.c +++ b/src/interfaces/ecpg/test/expected/preproc-strings.c @@ -37,6 +37,10 @@ int main(void) #line 13 "strings.pgc" + { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "set standard_conforming_strings to on", ECPGt_EOIT, ECPGt_EORT);} +#line 15 "strings.pgc" + + { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "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$", ECPGt_EOIT, ECPGt_char,&(s1),(long)0,(long)1,(1)*sizeof(char), ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, @@ -50,13 +54,13 @@ int main(void) ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_char,&(s6),(long)0,(long)1,(1)*sizeof(char), ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);} -#line 21 "strings.pgc" +#line 23 "strings.pgc" printf("%s %s %s %s %s %s\n", s1, s2, s3, s4, s5, s6); { ECPGdisconnect(__LINE__, "CURRENT");} -#line 25 "strings.pgc" +#line 27 "strings.pgc" exit (0); } diff --git a/src/interfaces/ecpg/test/expected/preproc-strings.stderr b/src/interfaces/ecpg/test/expected/preproc-strings.stderr index 7ae7510f55c..e9a6ebf1732 100644 --- a/src/interfaces/ecpg/test/expected/preproc-strings.stderr +++ b/src/interfaces/ecpg/test/expected/preproc-strings.stderr @@ -2,35 +2,41 @@ [NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT> [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ecpg_execute on line 15: query: 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$; with 0 parameter(s) on connection regress1 +[NO_PID]: ecpg_execute on line 15: query: set standard_conforming_strings to on; with 0 parameter(s) on connection regress1 [NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: ecpg_execute on line 15: using PQexec [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ecpg_execute on line 15: correctly got 1 tuples with 6 fields +[NO_PID]: ecpg_execute on line 15: OK: SET [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ecpg_store_result on line 15: allocating memory for 1 tuples +[NO_PID]: ecpg_execute on line 17: query: 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$; with 0 parameter(s) on connection regress1 [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ecpg_get_data on line 15: RESULT: abcdef offset: -1; array: yes +[NO_PID]: ecpg_execute on line 17: using PQexec [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ecpg_store_result on line 15: allocating memory for 1 tuples +[NO_PID]: ecpg_execute on line 17: correctly got 1 tuples with 6 fields [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ecpg_get_data on line 15: RESULT: abcdef offset: -1; array: yes +[NO_PID]: ecpg_store_result on line 17: allocating memory for 1 tuples [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ecpg_store_result on line 15: allocating memory for 1 tuples +[NO_PID]: ecpg_get_data on line 17: RESULT: abcdef offset: -1; array: yes [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ecpg_get_data on line 15: RESULT: abcdef offset: -1; array: yes +[NO_PID]: ecpg_store_result on line 17: allocating memory for 1 tuples [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ecpg_store_result on line 15: allocating memory for 1 tuples +[NO_PID]: ecpg_get_data on line 17: RESULT: abcdef offset: -1; array: yes [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ecpg_get_data on line 15: RESULT: data offset: -1; array: yes +[NO_PID]: ecpg_store_result on line 17: allocating memory for 1 tuples [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ecpg_store_result on line 15: allocating memory for 1 tuples +[NO_PID]: ecpg_get_data on line 17: RESULT: abcdef offset: -1; array: yes [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ecpg_get_data on line 15: RESULT: data offset: -1; array: yes +[NO_PID]: ecpg_store_result on line 17: allocating memory for 1 tuples [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ecpg_store_result on line 15: allocating memory for 1 tuples +[NO_PID]: ecpg_get_data on line 17: RESULT: data offset: -1; array: yes [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ecpg_get_data on line 15: RESULT: abc$def offset: -1; array: yes +[NO_PID]: ecpg_store_result on line 17: allocating memory for 1 tuples +[NO_PID]: sqlca: code: 0, state: 00000 +[NO_PID]: ecpg_get_data on line 17: RESULT: data offset: -1; array: yes +[NO_PID]: sqlca: code: 0, state: 00000 +[NO_PID]: ecpg_store_result on line 17: allocating memory for 1 tuples +[NO_PID]: sqlca: code: 0, state: 00000 +[NO_PID]: ecpg_get_data on line 17: RESULT: abc$def offset: -1; array: yes [NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: ecpg_finish: connection regress1 closed [NO_PID]: sqlca: code: 0, state: 00000 diff --git a/src/interfaces/ecpg/test/preproc/strings.pgc b/src/interfaces/ecpg/test/preproc/strings.pgc index 1a8c0d707df..cfea7aa034e 100644 --- a/src/interfaces/ecpg/test/preproc/strings.pgc +++ b/src/interfaces/ecpg/test/preproc/strings.pgc @@ -12,6 +12,8 @@ int main(void) exec sql connect to REGRESSDB1; + exec sql set standard_conforming_strings to on; + exec sql select 'abcdef', N'abcdef' AS foo, E'abc\bdef' AS "foo", -- GitLab