Skip to content

Commit aae6227

Browse files
committed
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
1 parent 99ce446 commit aae6227

File tree

5 files changed

+18
-16
lines changed

5 files changed

+18
-16
lines changed

src/interfaces/ecpg/test/expected/preproc-whenever_do_continue.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,11 @@ if (sqlca.sqlcode < 0) sqlprint();}
9898
#line 32 "whenever_do_continue.pgc"
9999

100100

101-
/* declare c cursor for select ename , sal , comm from emp order by ename asc */
101+
/* declare c cursor for select ename , sal , comm from emp order by ename collate \"C\" asc */
102102
#line 34 "whenever_do_continue.pgc"
103103

104104

105-
{ 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);
105+
{ 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);
106106
#line 36 "whenever_do_continue.pgc"
107107

108108
if (sqlca.sqlcode < 0) sqlprint();}

src/interfaces/ecpg/test/expected/preproc-whenever_do_continue.stderr

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
[NO_PID]: sqlca: code: 0, state: 00000
3333
[NO_PID]: ecpg_process_output on line 32: OK: INSERT 0 1
3434
[NO_PID]: sqlca: code: 0, state: 00000
35-
[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
35+
[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
3636
[NO_PID]: sqlca: code: 0, state: 00000
3737
[NO_PID]: ecpg_execute on line 36: using PQexec
3838
[NO_PID]: sqlca: code: 0, state: 00000
@@ -44,37 +44,37 @@
4444
[NO_PID]: sqlca: code: 0, state: 00000
4545
[NO_PID]: ecpg_process_output on line 46: correctly got 1 tuples with 3 fields
4646
[NO_PID]: sqlca: code: 0, state: 00000
47-
[NO_PID]: ecpg_get_data on line 46: RESULT: aryan offset: -1; array: no
47+
[NO_PID]: ecpg_get_data on line 46: RESULT: Ram offset: -1; array: no
4848
[NO_PID]: sqlca: code: 0, state: 00000
49-
[NO_PID]: ecpg_get_data on line 46: RESULT: 11110 offset: -1; array: no
49+
[NO_PID]: ecpg_get_data on line 46: RESULT: 111100 offset: -1; array: no
5050
[NO_PID]: sqlca: code: 0, state: 00000
51-
[NO_PID]: ecpg_get_data on line 46: RESULT: offset: -1; array: no
51+
[NO_PID]: ecpg_get_data on line 46: RESULT: 21 offset: -1; array: no
5252
[NO_PID]: sqlca: code: 0, state: 00000
53-
[NO_PID]: raising sqlcode -213 on line 46: null value without indicator on line 46
54-
[NO_PID]: sqlca: code: -213, state: 22002
5553
[NO_PID]: ecpg_execute on line 46: query: fetch c; with 0 parameter(s) on connection ecpg1_regression
5654
[NO_PID]: sqlca: code: 0, state: 00000
5755
[NO_PID]: ecpg_execute on line 46: using PQexec
5856
[NO_PID]: sqlca: code: 0, state: 00000
5957
[NO_PID]: ecpg_process_output on line 46: correctly got 1 tuples with 3 fields
6058
[NO_PID]: sqlca: code: 0, state: 00000
61-
[NO_PID]: ecpg_get_data on line 46: RESULT: josh offset: -1; array: no
59+
[NO_PID]: ecpg_get_data on line 46: RESULT: aryan offset: -1; array: no
6260
[NO_PID]: sqlca: code: 0, state: 00000
63-
[NO_PID]: ecpg_get_data on line 46: RESULT: 10000 offset: -1; array: no
61+
[NO_PID]: ecpg_get_data on line 46: RESULT: 11110 offset: -1; array: no
6462
[NO_PID]: sqlca: code: 0, state: 00000
65-
[NO_PID]: ecpg_get_data on line 46: RESULT: 10 offset: -1; array: no
63+
[NO_PID]: ecpg_get_data on line 46: RESULT: offset: -1; array: no
6664
[NO_PID]: sqlca: code: 0, state: 00000
65+
[NO_PID]: raising sqlcode -213 on line 46: null value without indicator on line 46
66+
[NO_PID]: sqlca: code: -213, state: 22002
6767
[NO_PID]: ecpg_execute on line 46: query: fetch c; with 0 parameter(s) on connection ecpg1_regression
6868
[NO_PID]: sqlca: code: 0, state: 00000
6969
[NO_PID]: ecpg_execute on line 46: using PQexec
7070
[NO_PID]: sqlca: code: 0, state: 00000
7171
[NO_PID]: ecpg_process_output on line 46: correctly got 1 tuples with 3 fields
7272
[NO_PID]: sqlca: code: 0, state: 00000
73-
[NO_PID]: ecpg_get_data on line 46: RESULT: Ram offset: -1; array: no
73+
[NO_PID]: ecpg_get_data on line 46: RESULT: josh offset: -1; array: no
7474
[NO_PID]: sqlca: code: 0, state: 00000
75-
[NO_PID]: ecpg_get_data on line 46: RESULT: 111100 offset: -1; array: no
75+
[NO_PID]: ecpg_get_data on line 46: RESULT: 10000 offset: -1; array: no
7676
[NO_PID]: sqlca: code: 0, state: 00000
77-
[NO_PID]: ecpg_get_data on line 46: RESULT: 21 offset: -1; array: no
77+
[NO_PID]: ecpg_get_data on line 46: RESULT: 10 offset: -1; array: no
7878
[NO_PID]: sqlca: code: 0, state: 00000
7979
[NO_PID]: ecpg_execute on line 46: query: fetch c; with 0 parameter(s) on connection ecpg1_regression
8080
[NO_PID]: sqlca: code: 0, state: 00000
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
josh 10000.00 10.00
21
Ram 111100.00 21.00
2+
josh 10000.00 10.00

src/interfaces/ecpg/test/preproc/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,5 @@
2222
/variable.c
2323
/whenever
2424
/whenever.c
25+
/whenever_do_continue
26+
/whenever_do_continue.c

src/interfaces/ecpg/test/preproc/whenever_do_continue.pgc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ int main(void)
3131
exec sql insert into emp values ('josh',10000,10);
3232
exec sql insert into emp values ('tom',20000,null);
3333

34-
exec sql declare c cursor for select ename, sal, comm from emp order by ename asc;
34+
exec sql declare c cursor for select ename, sal, comm from emp order by ename collate "C" asc;
3535

3636
exec sql open c;
3737

0 commit comments

Comments
 (0)