Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit ecc4b13

Browse files
committed
Remove duplicate include
Reported-by: Ashutosh Sharma <ashu.coek88@gmail.com> Discussion: https://www.postgresql.org/message-id/flat/CAE9k0PkORqHHGKY54-sFyDpP90yAf%2B05Auc4fs9EAn4J%2BuBeUQ%40mail.gmail.com
1 parent 16dfe25 commit ecc4b13

File tree

3 files changed

+57
-59
lines changed

3 files changed

+57
-59
lines changed

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

Lines changed: 33 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
#line 1 "define.pgc"
1010
#include <stdlib.h>
1111
#include <string.h>
12-
#include <stdlib.h>
1312
#include <stdio.h>
1413

1514

@@ -20,18 +19,18 @@
2019

2120

2221

23-
#line 6 "define.pgc"
22+
#line 5 "define.pgc"
2423

2524

2625
/* exec sql whenever sqlerror sqlprint ; */
27-
#line 8 "define.pgc"
26+
#line 7 "define.pgc"
2827

2928

3029

3130

3231

3332
/* exec sql type intarray is int [ 6 ] */
34-
#line 13 "define.pgc"
33+
#line 12 "define.pgc"
3534

3635
typedef int intarray[ 6];
3736

@@ -43,7 +42,7 @@ main(void)
4342

4443
typedef char string [ 8 ];
4544

46-
#line 22 "define.pgc"
45+
#line 21 "define.pgc"
4746

4847

4948

@@ -65,65 +64,65 @@ main(void)
6564

6665

6766

68-
#line 23 "define.pgc"
67+
#line 22 "define.pgc"
6968
intarray amount ;
7069

71-
#line 24 "define.pgc"
70+
#line 23 "define.pgc"
7271
char name [ 6 ] [ 8 ] ;
7372

74-
#line 37 "define.pgc"
73+
#line 36 "define.pgc"
7574
char letter [ 6 ] [ 1 ] ;
7675

7776
#if 0
7877

79-
#line 39 "define.pgc"
78+
#line 38 "define.pgc"
8079
int not_used ;
8180

8281
#endif
8382
/* exec sql end declare section */
84-
#line 46 "define.pgc"
83+
#line 45 "define.pgc"
8584

8685
int i,j;
8786

8887
ECPGdebug(1, stderr);
8988

9089
{ ECPGconnect(__LINE__, 0, "ecpg1_regression" , NULL, NULL , NULL, 0);
91-
#line 51 "define.pgc"
90+
#line 50 "define.pgc"
9291

9392
if (sqlca.sqlcode < 0) sqlprint();}
94-
#line 51 "define.pgc"
93+
#line 50 "define.pgc"
9594

9695

9796
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "create table test ( name char ( 8 ) , amount int , letter char ( 1 ) )", ECPGt_EOIT, ECPGt_EORT);
98-
#line 53 "define.pgc"
97+
#line 52 "define.pgc"
9998

10099
if (sqlca.sqlcode < 0) sqlprint();}
101-
#line 53 "define.pgc"
100+
#line 52 "define.pgc"
102101

103102
{ ECPGtrans(__LINE__, NULL, "commit");
104-
#line 54 "define.pgc"
103+
#line 53 "define.pgc"
105104

106105
if (sqlca.sqlcode < 0) sqlprint();}
107-
#line 54 "define.pgc"
106+
#line 53 "define.pgc"
108107

109108

110109
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into Test ( name , amount , letter ) values ( 'false' , 1 , 'f' )", ECPGt_EOIT, ECPGt_EORT);
111-
#line 56 "define.pgc"
110+
#line 55 "define.pgc"
112111

113112
if (sqlca.sqlcode < 0) sqlprint();}
114-
#line 56 "define.pgc"
113+
#line 55 "define.pgc"
115114

116115
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into test ( name , amount , letter ) values ( 'true' , 2 , 't' )", ECPGt_EOIT, ECPGt_EORT);
117-
#line 57 "define.pgc"
116+
#line 56 "define.pgc"
118117

119118
if (sqlca.sqlcode < 0) sqlprint();}
120-
#line 57 "define.pgc"
119+
#line 56 "define.pgc"
121120

122121
{ ECPGtrans(__LINE__, NULL, "commit");
123-
#line 58 "define.pgc"
122+
#line 57 "define.pgc"
124123

125124
if (sqlca.sqlcode < 0) sqlprint();}
126-
#line 58 "define.pgc"
125+
#line 57 "define.pgc"
127126

128127

129128
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "select * from test", ECPGt_EOIT,
@@ -133,10 +132,10 @@ if (sqlca.sqlcode < 0) sqlprint();}
133132
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
134133
ECPGt_char,(letter),(long)1,(long)6,(1)*sizeof(char),
135134
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
136-
#line 60 "define.pgc"
135+
#line 59 "define.pgc"
137136

138137
if (sqlca.sqlcode < 0) sqlprint();}
139-
#line 60 "define.pgc"
138+
#line 59 "define.pgc"
140139

141140

142141
for (i=0, j=sqlca.sqlerrd[2]; i<j; i++)
@@ -146,39 +145,39 @@ if (sqlca.sqlcode < 0) sqlprint();}
146145

147146

148147

149-
#line 65 "define.pgc"
148+
#line 64 "define.pgc"
150149
string n ;
151150

152-
#line 66 "define.pgc"
151+
#line 65 "define.pgc"
153152
char l = letter [ i ] [ 0 ] ;
154153

155-
#line 67 "define.pgc"
154+
#line 66 "define.pgc"
156155
int a = amount [ i ] ;
157156
/* exec sql end declare section */
158-
#line 68 "define.pgc"
157+
#line 67 "define.pgc"
159158

160159

161160
strncpy(n, name[i], 8);
162161
printf("name[%d]=%8.8s\tamount[%d]=%d\tletter[%d]=%c\n", i, n, i, a, i, l);
163162
}
164163

165164
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "drop table test", ECPGt_EOIT, ECPGt_EORT);
166-
#line 74 "define.pgc"
165+
#line 73 "define.pgc"
167166

168167
if (sqlca.sqlcode < 0) sqlprint();}
169-
#line 74 "define.pgc"
168+
#line 73 "define.pgc"
170169

171170
{ ECPGtrans(__LINE__, NULL, "commit");
172-
#line 75 "define.pgc"
171+
#line 74 "define.pgc"
173172

174173
if (sqlca.sqlcode < 0) sqlprint();}
175-
#line 75 "define.pgc"
174+
#line 74 "define.pgc"
176175

177176
{ ECPGdisconnect(__LINE__, "CURRENT");
178-
#line 76 "define.pgc"
177+
#line 75 "define.pgc"
179178

180179
if (sqlca.sqlcode < 0) sqlprint();}
181-
#line 76 "define.pgc"
180+
#line 75 "define.pgc"
182181

183182

184183
return 0;

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

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,53 +2,53 @@
22
[NO_PID]: sqlca: code: 0, state: 00000
33
[NO_PID]: ECPGconnect: opening database ecpg1_regression on <DEFAULT> port <DEFAULT>
44
[NO_PID]: sqlca: code: 0, state: 00000
5-
[NO_PID]: ecpg_execute on line 53: query: create table test ( name char ( 8 ) , amount int , letter char ( 1 ) ); with 0 parameter(s) on connection ecpg1_regression
5+
[NO_PID]: ecpg_execute on line 52: query: create table test ( name char ( 8 ) , amount int , letter char ( 1 ) ); with 0 parameter(s) on connection ecpg1_regression
66
[NO_PID]: sqlca: code: 0, state: 00000
7-
[NO_PID]: ecpg_execute on line 53: using PQexec
7+
[NO_PID]: ecpg_execute on line 52: using PQexec
88
[NO_PID]: sqlca: code: 0, state: 00000
9-
[NO_PID]: ecpg_process_output on line 53: OK: CREATE TABLE
9+
[NO_PID]: ecpg_process_output on line 52: OK: CREATE TABLE
1010
[NO_PID]: sqlca: code: 0, state: 00000
11-
[NO_PID]: ECPGtrans on line 54: action "commit"; connection "ecpg1_regression"
11+
[NO_PID]: ECPGtrans on line 53: action "commit"; connection "ecpg1_regression"
1212
[NO_PID]: sqlca: code: 0, state: 00000
13-
[NO_PID]: ecpg_execute on line 56: query: insert into Test ( name , amount , letter ) values ( 'false' , 1 , 'f' ); with 0 parameter(s) on connection ecpg1_regression
13+
[NO_PID]: ecpg_execute on line 55: query: insert into Test ( name , amount , letter ) values ( 'false' , 1 , 'f' ); with 0 parameter(s) on connection ecpg1_regression
1414
[NO_PID]: sqlca: code: 0, state: 00000
15-
[NO_PID]: ecpg_execute on line 56: using PQexec
15+
[NO_PID]: ecpg_execute on line 55: using PQexec
1616
[NO_PID]: sqlca: code: 0, state: 00000
17-
[NO_PID]: ecpg_process_output on line 56: OK: INSERT 0 1
17+
[NO_PID]: ecpg_process_output on line 55: OK: INSERT 0 1
1818
[NO_PID]: sqlca: code: 0, state: 00000
19-
[NO_PID]: ecpg_execute on line 57: query: insert into test ( name , amount , letter ) values ( 'true' , 2 , 't' ); with 0 parameter(s) on connection ecpg1_regression
19+
[NO_PID]: ecpg_execute on line 56: query: insert into test ( name , amount , letter ) values ( 'true' , 2 , 't' ); with 0 parameter(s) on connection ecpg1_regression
2020
[NO_PID]: sqlca: code: 0, state: 00000
21-
[NO_PID]: ecpg_execute on line 57: using PQexec
21+
[NO_PID]: ecpg_execute on line 56: using PQexec
2222
[NO_PID]: sqlca: code: 0, state: 00000
23-
[NO_PID]: ecpg_process_output on line 57: OK: INSERT 0 1
23+
[NO_PID]: ecpg_process_output on line 56: OK: INSERT 0 1
2424
[NO_PID]: sqlca: code: 0, state: 00000
25-
[NO_PID]: ECPGtrans on line 58: action "commit"; connection "ecpg1_regression"
25+
[NO_PID]: ECPGtrans on line 57: action "commit"; connection "ecpg1_regression"
2626
[NO_PID]: sqlca: code: 0, state: 00000
27-
[NO_PID]: ecpg_execute on line 60: query: select * from test; with 0 parameter(s) on connection ecpg1_regression
27+
[NO_PID]: ecpg_execute on line 59: query: select * from test; with 0 parameter(s) on connection ecpg1_regression
2828
[NO_PID]: sqlca: code: 0, state: 00000
29-
[NO_PID]: ecpg_execute on line 60: using PQexec
29+
[NO_PID]: ecpg_execute on line 59: using PQexec
3030
[NO_PID]: sqlca: code: 0, state: 00000
31-
[NO_PID]: ecpg_process_output on line 60: correctly got 2 tuples with 3 fields
31+
[NO_PID]: ecpg_process_output on line 59: correctly got 2 tuples with 3 fields
3232
[NO_PID]: sqlca: code: 0, state: 00000
33-
[NO_PID]: ecpg_get_data on line 60: RESULT: false offset: -1; array: no
33+
[NO_PID]: ecpg_get_data on line 59: RESULT: false offset: -1; array: no
3434
[NO_PID]: sqlca: code: 0, state: 00000
35-
[NO_PID]: ecpg_get_data on line 60: RESULT: true offset: -1; array: no
35+
[NO_PID]: ecpg_get_data on line 59: RESULT: true offset: -1; array: no
3636
[NO_PID]: sqlca: code: 0, state: 00000
37-
[NO_PID]: ecpg_get_data on line 60: RESULT: 1 offset: -1; array: no
37+
[NO_PID]: ecpg_get_data on line 59: RESULT: 1 offset: -1; array: no
3838
[NO_PID]: sqlca: code: 0, state: 00000
39-
[NO_PID]: ecpg_get_data on line 60: RESULT: 2 offset: -1; array: no
39+
[NO_PID]: ecpg_get_data on line 59: RESULT: 2 offset: -1; array: no
4040
[NO_PID]: sqlca: code: 0, state: 00000
41-
[NO_PID]: ecpg_get_data on line 60: RESULT: f offset: -1; array: no
41+
[NO_PID]: ecpg_get_data on line 59: RESULT: f offset: -1; array: no
4242
[NO_PID]: sqlca: code: 0, state: 00000
43-
[NO_PID]: ecpg_get_data on line 60: RESULT: t offset: -1; array: no
43+
[NO_PID]: ecpg_get_data on line 59: RESULT: t offset: -1; array: no
4444
[NO_PID]: sqlca: code: 0, state: 00000
45-
[NO_PID]: ecpg_execute on line 74: query: drop table test; with 0 parameter(s) on connection ecpg1_regression
45+
[NO_PID]: ecpg_execute on line 73: query: drop table test; with 0 parameter(s) on connection ecpg1_regression
4646
[NO_PID]: sqlca: code: 0, state: 00000
47-
[NO_PID]: ecpg_execute on line 74: using PQexec
47+
[NO_PID]: ecpg_execute on line 73: using PQexec
4848
[NO_PID]: sqlca: code: 0, state: 00000
49-
[NO_PID]: ecpg_process_output on line 74: OK: DROP TABLE
49+
[NO_PID]: ecpg_process_output on line 73: OK: DROP TABLE
5050
[NO_PID]: sqlca: code: 0, state: 00000
51-
[NO_PID]: ECPGtrans on line 75: action "commit"; connection "ecpg1_regression"
51+
[NO_PID]: ECPGtrans on line 74: action "commit"; connection "ecpg1_regression"
5252
[NO_PID]: sqlca: code: 0, state: 00000
5353
[NO_PID]: ecpg_finish: connection ecpg1_regression closed
5454
[NO_PID]: sqlca: code: 0, state: 00000

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#include <stdlib.h>
22
#include <string.h>
3-
#include <stdlib.h>
43
#include <stdio.h>
54

65
exec sql include ../regression;

0 commit comments

Comments
 (0)