From: Tom Lane Date: Fri, 25 Aug 2017 18:17:33 +0000 (-0400) Subject: Fix locale dependency in new ecpg test case. X-Git-Tag: REL_11_BETA1~1730 X-Git-Url: http://git.postgresql.org/gitweb/?a=commitdiff_plain;h=aae62278e167623bfac9fd50d1242d8e72208b0c;p=postgresql.git Fix locale dependency in new ecpg test case. Force sorting in "C" locale so that the output ordering doesn't vary, per buildfarm. In passing, add missing .gitignore entries. Discussion: https://postgr.es/m/0975f4bb-5dee-c33c-b719-3ce44026d397@chrullrich.net --- diff --git a/src/interfaces/ecpg/test/expected/preproc-whenever_do_continue.c b/src/interfaces/ecpg/test/expected/preproc-whenever_do_continue.c index 2e95581cdff..a367af00f37 100644 --- a/src/interfaces/ecpg/test/expected/preproc-whenever_do_continue.c +++ b/src/interfaces/ecpg/test/expected/preproc-whenever_do_continue.c @@ -98,11 +98,11 @@ if (sqlca.sqlcode < 0) sqlprint();} #line 32 "whenever_do_continue.pgc" - /* declare c cursor for select ename , sal , comm from emp order by ename asc */ + /* declare c cursor for select ename , sal , comm from emp order by ename collate \"C\" asc */ #line 34 "whenever_do_continue.pgc" - { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare c cursor for select ename , sal , comm from emp order by ename asc", ECPGt_EOIT, ECPGt_EORT); + { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare c cursor for select ename , sal , comm from emp order by ename collate \"C\" asc", ECPGt_EOIT, ECPGt_EORT); #line 36 "whenever_do_continue.pgc" if (sqlca.sqlcode < 0) sqlprint();} diff --git a/src/interfaces/ecpg/test/expected/preproc-whenever_do_continue.stderr b/src/interfaces/ecpg/test/expected/preproc-whenever_do_continue.stderr index b33329bc0c0..46bc4a56002 100644 --- a/src/interfaces/ecpg/test/expected/preproc-whenever_do_continue.stderr +++ b/src/interfaces/ecpg/test/expected/preproc-whenever_do_continue.stderr @@ -32,7 +32,7 @@ [NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: ecpg_process_output on line 32: OK: INSERT 0 1 [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ecpg_execute on line 36: query: declare c cursor for select ename , sal , comm from emp order by ename asc; with 0 parameter(s) on connection ecpg1_regression +[NO_PID]: ecpg_execute on line 36: query: declare c cursor for select ename , sal , comm from emp order by ename collate "C" asc; with 0 parameter(s) on connection ecpg1_regression [NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: ecpg_execute on line 36: using PQexec [NO_PID]: sqlca: code: 0, state: 00000 @@ -44,37 +44,37 @@ [NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: ecpg_process_output on line 46: correctly got 1 tuples with 3 fields [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ecpg_get_data on line 46: RESULT: aryan offset: -1; array: no +[NO_PID]: ecpg_get_data on line 46: RESULT: Ram offset: -1; array: no [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ecpg_get_data on line 46: RESULT: 11110 offset: -1; array: no +[NO_PID]: ecpg_get_data on line 46: RESULT: 111100 offset: -1; array: no [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ecpg_get_data on line 46: RESULT: offset: -1; array: no +[NO_PID]: ecpg_get_data on line 46: RESULT: 21 offset: -1; array: no [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: raising sqlcode -213 on line 46: null value without indicator on line 46 -[NO_PID]: sqlca: code: -213, state: 22002 [NO_PID]: ecpg_execute on line 46: query: fetch c; with 0 parameter(s) on connection ecpg1_regression [NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: ecpg_execute on line 46: using PQexec [NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: ecpg_process_output on line 46: correctly got 1 tuples with 3 fields [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ecpg_get_data on line 46: RESULT: josh offset: -1; array: no +[NO_PID]: ecpg_get_data on line 46: RESULT: aryan offset: -1; array: no [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ecpg_get_data on line 46: RESULT: 10000 offset: -1; array: no +[NO_PID]: ecpg_get_data on line 46: RESULT: 11110 offset: -1; array: no [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ecpg_get_data on line 46: RESULT: 10 offset: -1; array: no +[NO_PID]: ecpg_get_data on line 46: RESULT: offset: -1; array: no [NO_PID]: sqlca: code: 0, state: 00000 +[NO_PID]: raising sqlcode -213 on line 46: null value without indicator on line 46 +[NO_PID]: sqlca: code: -213, state: 22002 [NO_PID]: ecpg_execute on line 46: query: fetch c; with 0 parameter(s) on connection ecpg1_regression [NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: ecpg_execute on line 46: using PQexec [NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: ecpg_process_output on line 46: correctly got 1 tuples with 3 fields [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ecpg_get_data on line 46: RESULT: Ram offset: -1; array: no +[NO_PID]: ecpg_get_data on line 46: RESULT: josh offset: -1; array: no [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ecpg_get_data on line 46: RESULT: 111100 offset: -1; array: no +[NO_PID]: ecpg_get_data on line 46: RESULT: 10000 offset: -1; array: no [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ecpg_get_data on line 46: RESULT: 21 offset: -1; array: no +[NO_PID]: ecpg_get_data on line 46: RESULT: 10 offset: -1; array: no [NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: ecpg_execute on line 46: query: fetch c; with 0 parameter(s) on connection ecpg1_regression [NO_PID]: sqlca: code: 0, state: 00000 diff --git a/src/interfaces/ecpg/test/expected/preproc-whenever_do_continue.stdout b/src/interfaces/ecpg/test/expected/preproc-whenever_do_continue.stdout index 75fb6ce2702..d6ac5a02806 100644 --- a/src/interfaces/ecpg/test/expected/preproc-whenever_do_continue.stdout +++ b/src/interfaces/ecpg/test/expected/preproc-whenever_do_continue.stdout @@ -1,2 +1,2 @@ -josh 10000.00 10.00 Ram 111100.00 21.00 +josh 10000.00 10.00 diff --git a/src/interfaces/ecpg/test/preproc/.gitignore b/src/interfaces/ecpg/test/preproc/.gitignore index ffca98e8c0a..fd63e645a3e 100644 --- a/src/interfaces/ecpg/test/preproc/.gitignore +++ b/src/interfaces/ecpg/test/preproc/.gitignore @@ -22,3 +22,5 @@ /variable.c /whenever /whenever.c +/whenever_do_continue +/whenever_do_continue.c diff --git a/src/interfaces/ecpg/test/preproc/whenever_do_continue.pgc b/src/interfaces/ecpg/test/preproc/whenever_do_continue.pgc index 8ceda699277..2a925a3c54f 100644 --- a/src/interfaces/ecpg/test/preproc/whenever_do_continue.pgc +++ b/src/interfaces/ecpg/test/preproc/whenever_do_continue.pgc @@ -31,7 +31,7 @@ int main(void) exec sql insert into emp values ('josh',10000,10); exec sql insert into emp values ('tom',20000,null); - exec sql declare c cursor for select ename, sal, comm from emp order by ename asc; + exec sql declare c cursor for select ename, sal, comm from emp order by ename collate "C" asc; exec sql open c;