PostgreSQL Source Code  git master
sql-declare.c File Reference
#include <ecpglib.h>
#include <ecpgerrno.h>
#include <sqlca.h>
#include <locale.h>
#include <string.h>
#include <stdlib.h>
Include dependency graph for sql-declare.c:

Go to the source code of this file.

Data Structures

struct  sqlca_t
 

Macros

#define ECPGdebug(X, Y)   ECPGdebug((X)+100,(Y))
 
#define POSTGRES_SQLCA_H
 
#define PGDLLIMPORT
 
#define SQLERRMC_LEN   150
 
#define sqlca   (*ECPGget_sqlca())
 
#define ARRAY_SZIE   20
 

Functions

struct sqlca_tECPGget_sqlca (void)
 
void execute_test (void)
 
void commitTable (void)
 
void reset (void)
 
void printResult (char *tc_name, int loop)
 
int main (void)
 

Variables

int f1 [ARRAY_SZIE]
 
int f2 [ARRAY_SZIE]
 
char f3 [ARRAY_SZIE][20]
 

Macro Definition Documentation

◆ ARRAY_SZIE

#define ARRAY_SZIE   20

Definition at line 100 of file sql-declare.c.

Referenced by execute_test().

◆ ECPGdebug

#define ECPGdebug (   X,
 
)    ECPGdebug((X)+100,(Y))

Definition at line 7 of file sql-declare.c.

Referenced by main().

◆ PGDLLIMPORT

#define PGDLLIMPORT

Definition at line 27 of file sql-declare.c.

◆ POSTGRES_SQLCA_H

#define POSTGRES_SQLCA_H

Definition at line 21 of file sql-declare.c.

◆ sqlca

#define sqlca   (*ECPGget_sqlca())

Definition at line 78 of file sql-declare.c.

Referenced by commitTable(), execute_test(), and main().

◆ SQLERRMC_LEN

#define SQLERRMC_LEN   150

Definition at line 31 of file sql-declare.c.

Function Documentation

◆ commitTable()

void commitTable ( void  )

Definition at line 543 of file sql-declare.c.

References ECPGtrans(), sqlca, and sqlprint().

Referenced by main().

544 {
545  { ECPGtrans(__LINE__, "con1", "commit");
546 #line 182 "declare.pgc"
547 
548 if (sqlca.sqlcode < 0) sqlprint();}
549 #line 182 "declare.pgc"
550 
551  { ECPGtrans(__LINE__, "con2", "commit");
552 #line 183 "declare.pgc"
553 
554 if (sqlca.sqlcode < 0) sqlprint();}
555 #line 183 "declare.pgc"
556 
557 }
#define sqlca
Definition: sql-declare.c:78
void sqlprint(void)
Definition: error.c:335
bool ECPGtrans(int lineno, const char *connection_name, const char *transaction)
Definition: misc.c:198

◆ ECPGget_sqlca()

struct sqlca_t* ECPGget_sqlca ( void  )

Definition at line 141 of file misc.c.

142 {
143 #ifdef ENABLE_THREAD_SAFETY
144  struct sqlca_t *sqlca;
145 
146  pthread_once(&sqlca_key_once, ecpg_sqlca_key_init);
147 
148  sqlca = pthread_getspecific(sqlca_key);
149  if (sqlca == NULL)
150  {
151  sqlca = malloc(sizeof(struct sqlca_t));
152  if (sqlca == NULL)
153  return NULL;
154  ecpg_init_sqlca(sqlca);
155  pthread_setspecific(sqlca_key, sqlca);
156  }
157  return sqlca;
158 #else
159  return &sqlca;
160 #endif
161 }
void ecpg_init_sqlca(struct sqlca_t *sqlca)
Definition: misc.c:98
#define malloc(a)
Definition: header.h:50
Definition: sqlca.h:19
void * pthread_getspecific(pthread_key_t key)
Definition: pthread-win32.c:29
static struct sqlca_t sqlca
Definition: misc.c:62
void pthread_setspecific(pthread_key_t key, void *val)
Definition: pthread-win32.c:24

◆ execute_test()

void execute_test ( void  )

Definition at line 216 of file sql-declare.c.

References ARRAY_SZIE, ECPG_NOT_FOUND, ECPGdeallocate(), ECPGdo(), ECPGprepare(), ECPGprepared_statement(), ECPGst_execute, ECPGst_normal, ECPGt_char, ECPGt_char_variable, ECPGt_EOIT, ECPGt_EORT, ECPGt_int, ECPGt_NO_INDICATOR, f1, f2, f3, i, printResult(), reset(), sqlca, and sqlprint().

Referenced by main().

217 {
218  /* exec sql begin declare section */
219 
220 
221 
222 #line 63 "declare.pgc"
223  int i ;
224 
225 #line 64 "declare.pgc"
226  char * selectString = "SELECT f1,f2,f3 FROM source" ;
227 /* exec sql end declare section */
228 #line 65 "declare.pgc"
229 
230 
231  /*
232  * testcase1. using DECLARE STATEMENT without using AT clause,
233  * using PREPARE and CURSOR statement without using AT clause
234  */
235  reset();
236 
237  /* declare \"stmt_1\" as an SQL identifier */
238 #line 73 "declare.pgc"
239 
240  { ECPGprepare(__LINE__, NULL, 0, "stmt_1", selectString);
241 #line 74 "declare.pgc"
242 
243 if (sqlca.sqlcode < 0) sqlprint();}
244 #line 74 "declare.pgc"
245 
246  /* declare cur_1 cursor for $1 */
247 #line 75 "declare.pgc"
248 
249  { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare cur_1 cursor for $1",
250  ECPGt_char_variable,(ECPGprepared_statement(NULL, "stmt_1", __LINE__)),(long)1,(long)1,(1)*sizeof(char),
251  ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
252 #line 76 "declare.pgc"
253 
254 if (sqlca.sqlcode < 0) sqlprint();}
255 #line 76 "declare.pgc"
256 
257 
258  /* exec sql whenever not found break ; */
259 #line 78 "declare.pgc"
260 
261  i = 0;
262  while (1)
263  {
264  { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "fetch cur_1", ECPGt_EOIT,
265  ECPGt_int,&(f1[i]),(long)1,(long)1,sizeof(int),
266  ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
267  ECPGt_int,&(f2[i]),(long)1,(long)1,sizeof(int),
268  ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
269  ECPGt_char,(f3[i]),(long)20,(long)1,(20)*sizeof(char),
270  ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
271 #line 82 "declare.pgc"
272 
273 if (sqlca.sqlcode == ECPG_NOT_FOUND) break;
274 #line 82 "declare.pgc"
275 
276 if (sqlca.sqlcode < 0) sqlprint();}
277 #line 82 "declare.pgc"
278 
279  i++;
280  }
281  { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "close cur_1", ECPGt_EOIT, ECPGt_EORT);
282 #line 85 "declare.pgc"
283 
284 if (sqlca.sqlcode < 0) sqlprint();}
285 #line 85 "declare.pgc"
286 
287  { ECPGdeallocate(__LINE__, 0, NULL, "stmt_1");
288 #line 86 "declare.pgc"
289 
290 if (sqlca.sqlcode < 0) sqlprint();}
291 #line 86 "declare.pgc"
292 
293  /* exec sql whenever not found continue ; */
294 #line 87 "declare.pgc"
295 
296 
297  printResult("testcase1", 2);
298 
299 
300  /*
301  * testcase2. using DECLARE STATEMENT at con1,
302  * using PREPARE and CURSOR statement without using AT clause
303  */
304  reset();
305 
306  /* declare \"stmt_2\" as an SQL identifier */
307 #line 98 "declare.pgc"
308 
309  { ECPGprepare(__LINE__, "con1", 0, "stmt_2", selectString);
310 #line 99 "declare.pgc"
311 
312 if (sqlca.sqlcode < 0) sqlprint();}
313 #line 99 "declare.pgc"
314 
315  /* declare cur_2 cursor for $1 */
316 #line 100 "declare.pgc"
317 
318  { ECPGdo(__LINE__, 0, 1, "con1", 0, ECPGst_normal, "declare cur_2 cursor for $1",
319  ECPGt_char_variable,(ECPGprepared_statement("con1", "stmt_2", __LINE__)),(long)1,(long)1,(1)*sizeof(char),
320  ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
321 #line 101 "declare.pgc"
322 
323 if (sqlca.sqlcode < 0) sqlprint();}
324 #line 101 "declare.pgc"
325 
326 
327  /* exec sql whenever not found break ; */
328 #line 103 "declare.pgc"
329 
330  i = 0;
331  while (1)
332  {
333  { ECPGdo(__LINE__, 0, 1, "con1", 0, ECPGst_normal, "fetch cur_2", ECPGt_EOIT,
334  ECPGt_int,&(f1[i]),(long)1,(long)1,sizeof(int),
335  ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
336  ECPGt_int,&(f2[i]),(long)1,(long)1,sizeof(int),
337  ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
338  ECPGt_char,(f3[i]),(long)20,(long)1,(20)*sizeof(char),
339  ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
340 #line 107 "declare.pgc"
341 
342 if (sqlca.sqlcode == ECPG_NOT_FOUND) break;
343 #line 107 "declare.pgc"
344 
345 if (sqlca.sqlcode < 0) sqlprint();}
346 #line 107 "declare.pgc"
347 
348  i++;
349  }
350  { ECPGdo(__LINE__, 0, 1, "con1", 0, ECPGst_normal, "close cur_2", ECPGt_EOIT, ECPGt_EORT);
351 #line 110 "declare.pgc"
352 
353 if (sqlca.sqlcode < 0) sqlprint();}
354 #line 110 "declare.pgc"
355 
356  { ECPGdeallocate(__LINE__, 0, NULL, "stmt_2");
357 #line 111 "declare.pgc"
358 
359 if (sqlca.sqlcode < 0) sqlprint();}
360 #line 111 "declare.pgc"
361 
362  /* exec sql whenever not found continue ; */
363 #line 112 "declare.pgc"
364 
365 
366  printResult("testcase2", 2);
367 
368  /*
369  * testcase3. using DECLARE STATEMENT at con1,
370  * using PREPARE and CURSOR statement at con2
371  */
372  reset();
373 
374  /* declare \"stmt_3\" as an SQL identifier */
375 #line 122 "declare.pgc"
376 
377  { ECPGprepare(__LINE__, "con1", 0, "stmt_3", selectString);
378 #line 123 "declare.pgc"
379 
380 if (sqlca.sqlcode < 0) sqlprint();}
381 #line 123 "declare.pgc"
382 
383  /* declare cur_3 cursor for $1 */
384 #line 124 "declare.pgc"
385 
386  { ECPGdo(__LINE__, 0, 1, "con1", 0, ECPGst_normal, "declare cur_3 cursor for $1",
387  ECPGt_char_variable,(ECPGprepared_statement("con1", "stmt_3", __LINE__)),(long)1,(long)1,(1)*sizeof(char),
388  ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
389 #line 125 "declare.pgc"
390 
391 if (sqlca.sqlcode < 0) sqlprint();}
392 #line 125 "declare.pgc"
393 
394 
395  /* exec sql whenever not found break ; */
396 #line 127 "declare.pgc"
397 
398  i = 0;
399  while (1)
400  {
401  { ECPGdo(__LINE__, 0, 1, "con1", 0, ECPGst_normal, "fetch cur_3", ECPGt_EOIT,
402  ECPGt_int,&(f1[i]),(long)1,(long)1,sizeof(int),
403  ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
404  ECPGt_int,&(f2[i]),(long)1,(long)1,sizeof(int),
405  ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
406  ECPGt_char,(f3[i]),(long)20,(long)1,(20)*sizeof(char),
407  ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
408 #line 131 "declare.pgc"
409 
410 if (sqlca.sqlcode == ECPG_NOT_FOUND) break;
411 #line 131 "declare.pgc"
412 
413 if (sqlca.sqlcode < 0) sqlprint();}
414 #line 131 "declare.pgc"
415 
416  i++;
417  }
418  { ECPGdo(__LINE__, 0, 1, "con1", 0, ECPGst_normal, "close cur_3", ECPGt_EOIT, ECPGt_EORT);
419 #line 134 "declare.pgc"
420 
421 if (sqlca.sqlcode < 0) sqlprint();}
422 #line 134 "declare.pgc"
423 
424  { ECPGdeallocate(__LINE__, 0, "con2", "stmt_3");
425 #line 135 "declare.pgc"
426 
427 if (sqlca.sqlcode < 0) sqlprint();}
428 #line 135 "declare.pgc"
429 
430  /* exec sql whenever not found continue ; */
431 #line 136 "declare.pgc"
432 
433 
434  printResult("testcase3", 2);
435 
436 
437  /*
438  * testcase4. using DECLARE STATEMENT without using AT clause,
439  * using PREPARE and CURSOR statement at con2
440  */
441  reset();
442 
443  /* declare \"stmt_4\" as an SQL identifier */
444 #line 147 "declare.pgc"
445 
446  { ECPGprepare(__LINE__, "con2", 0, "stmt_4", selectString);
447 #line 148 "declare.pgc"
448 
449 if (sqlca.sqlcode < 0) sqlprint();}
450 #line 148 "declare.pgc"
451 
452  /* declare cur_4 cursor for $1 */
453 #line 149 "declare.pgc"
454 
455  { ECPGdo(__LINE__, 0, 1, "con2", 0, ECPGst_normal, "declare cur_4 cursor for $1",
456  ECPGt_char_variable,(ECPGprepared_statement("con2", "stmt_4", __LINE__)),(long)1,(long)1,(1)*sizeof(char),
457  ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
458 #line 150 "declare.pgc"
459 
460 if (sqlca.sqlcode < 0) sqlprint();}
461 #line 150 "declare.pgc"
462 
463 
464  /* exec sql whenever not found break ; */
465 #line 152 "declare.pgc"
466 
467  i = 0;
468  while (1)
469  {
470  { ECPGdo(__LINE__, 0, 1, "con2", 0, ECPGst_normal, "fetch cur_4", ECPGt_EOIT,
471  ECPGt_int,&(f1[i]),(long)1,(long)1,sizeof(int),
472  ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
473  ECPGt_int,&(f2[i]),(long)1,(long)1,sizeof(int),
474  ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
475  ECPGt_char,(f3[i]),(long)20,(long)1,(20)*sizeof(char),
476  ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
477 #line 156 "declare.pgc"
478 
479 if (sqlca.sqlcode == ECPG_NOT_FOUND) break;
480 #line 156 "declare.pgc"
481 
482 if (sqlca.sqlcode < 0) sqlprint();}
483 #line 156 "declare.pgc"
484 
485  i++;
486  }
487  { ECPGdo(__LINE__, 0, 1, "con2", 0, ECPGst_normal, "close cur_4", ECPGt_EOIT, ECPGt_EORT);
488 #line 159 "declare.pgc"
489 
490 if (sqlca.sqlcode < 0) sqlprint();}
491 #line 159 "declare.pgc"
492 
493  { ECPGdeallocate(__LINE__, 0, "con2", "stmt_4");
494 #line 160 "declare.pgc"
495 
496 if (sqlca.sqlcode < 0) sqlprint();}
497 #line 160 "declare.pgc"
498 
499  /* exec sql whenever not found continue ; */
500 #line 161 "declare.pgc"
501 
502 
503  printResult("testcase4", 2);
504 
505  /*
506  * testcase5. using DECLARE STATEMENT without using AT clause,
507  * using PREPARE and EXECUTE statement without using AT clause
508  */
509  reset();
510 
511  /* declare \"stmt_5\" as an SQL identifier */
512 #line 171 "declare.pgc"
513 
514  { ECPGprepare(__LINE__, NULL, 0, "stmt_5", selectString);
515 #line 172 "declare.pgc"
516 
517 if (sqlca.sqlcode < 0) sqlprint();}
518 #line 172 "declare.pgc"
519 
520  { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_execute, "stmt_5", ECPGt_EOIT,
521  ECPGt_int,(f1),(long)1,(long)ARRAY_SZIE,sizeof(int),
522  ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
523  ECPGt_int,(f2),(long)1,(long)ARRAY_SZIE,sizeof(int),
524  ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
525  ECPGt_char,(f3),(long)20,(long)ARRAY_SZIE,(20)*sizeof(char),
526  ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
527 #line 173 "declare.pgc"
528 
529 if (sqlca.sqlcode < 0) sqlprint();}
530 #line 173 "declare.pgc"
531 
532 
533  { ECPGdeallocate(__LINE__, 0, NULL, "stmt_5");
534 #line 175 "declare.pgc"
535 
536 if (sqlca.sqlcode < 0) sqlprint();}
537 #line 175 "declare.pgc"
538 
539 
540  printResult("testcase5", 2);
541 }
bool ECPGdo(const int lineno, const int compat, const int force_indicator, const char *connection_name, const bool questionmarks, const int st, const char *query,...)
Definition: execute.c:2287
void reset(void)
Definition: sql-declare.c:562
bool ECPGprepare(int lineno, const char *connection_name, const bool questionmarks, const char *name, const char *variable)
Definition: prepare.c:217
int f1[ARRAY_SZIE]
Definition: sql-declare.c:113
#define sqlca
Definition: sql-declare.c:78
void printResult(char *tc_name, int loop)
Definition: sql-declare.c:569
#define ECPG_NOT_FOUND
Definition: ecpgerrno.h:10
bool ECPGdeallocate(int lineno, int c, const char *connection_name, const char *name)
Definition: prepare.c:315
void sqlprint(void)
Definition: error.c:335
#define ARRAY_SZIE
Definition: sql-declare.c:100
char * ECPGprepared_statement(const char *connection_name, const char *name, int lineno)
Definition: prepare.c:368
int f2[ARRAY_SZIE]
Definition: sql-declare.c:116
int i
char f3[ARRAY_SZIE][20]
Definition: sql-declare.c:119

◆ main()

int main ( void  )

Definition at line 124 of file sql-declare.c.

References commitTable(), ECPGconnect(), ECPGdebug, ECPGdisconnect(), ECPGdo(), ECPGst_normal, ECPGt_EOIT, ECPGt_EORT, execute_test(), setlocale, sqlca, and sqlprint().

125 {
126  setlocale(LC_ALL, "C");
127 
128  ECPGdebug(1, stderr);
129 
130  { ECPGconnect(__LINE__, 0, "ecpg1_regression" , NULL, NULL , "con1", 0);
131 #line 29 "declare.pgc"
132 
133 if (sqlca.sqlcode < 0) sqlprint();}
134 #line 29 "declare.pgc"
135 
136  { ECPGconnect(__LINE__, 0, "ecpg2_regression" , NULL, NULL , "con2", 0);
137 #line 30 "declare.pgc"
138 
139 if (sqlca.sqlcode < 0) sqlprint();}
140 #line 30 "declare.pgc"
141 
142 
143  { ECPGdo(__LINE__, 0, 1, "con1", 0, ECPGst_normal, "create table source ( f1 integer , f2 integer , f3 varchar ( 20 ) )", ECPGt_EOIT, ECPGt_EORT);
144 #line 32 "declare.pgc"
145 
146 if (sqlca.sqlcode < 0) sqlprint();}
147 #line 32 "declare.pgc"
148 
149  { ECPGdo(__LINE__, 0, 1, "con2", 0, ECPGst_normal, "create table source ( f1 integer , f2 integer , f3 varchar ( 20 ) )", ECPGt_EOIT, ECPGt_EORT);
150 #line 33 "declare.pgc"
151 
152 if (sqlca.sqlcode < 0) sqlprint();}
153 #line 33 "declare.pgc"
154 
155 
156  { ECPGdo(__LINE__, 0, 1, "con1", 0, ECPGst_normal, "insert into source values ( 1 , 10 , 'db on con1' )", ECPGt_EOIT, ECPGt_EORT);
157 #line 35 "declare.pgc"
158 
159 if (sqlca.sqlcode < 0) sqlprint();}
160 #line 35 "declare.pgc"
161 
162  { ECPGdo(__LINE__, 0, 1, "con1", 0, ECPGst_normal, "insert into source values ( 2 , 20 , 'db on con1' )", ECPGt_EOIT, ECPGt_EORT);
163 #line 36 "declare.pgc"
164 
165 if (sqlca.sqlcode < 0) sqlprint();}
166 #line 36 "declare.pgc"
167 
168 
169  { ECPGdo(__LINE__, 0, 1, "con2", 0, ECPGst_normal, "insert into source values ( 1 , 10 , 'db on con2' )", ECPGt_EOIT, ECPGt_EORT);
170 #line 38 "declare.pgc"
171 
172 if (sqlca.sqlcode < 0) sqlprint();}
173 #line 38 "declare.pgc"
174 
175  { ECPGdo(__LINE__, 0, 1, "con2", 0, ECPGst_normal, "insert into source values ( 2 , 20 , 'db on con2' )", ECPGt_EOIT, ECPGt_EORT);
176 #line 39 "declare.pgc"
177 
178 if (sqlca.sqlcode < 0) sqlprint();}
179 #line 39 "declare.pgc"
180 
181 
182  commitTable();
183 
184  execute_test();
185 
186  { ECPGdo(__LINE__, 0, 1, "con1", 0, ECPGst_normal, "drop table if exists source", ECPGt_EOIT, ECPGt_EORT);
187 #line 45 "declare.pgc"
188 
189 if (sqlca.sqlcode < 0) sqlprint();}
190 #line 45 "declare.pgc"
191 
192  { ECPGdo(__LINE__, 0, 1, "con2", 0, ECPGst_normal, "drop table if exists source", ECPGt_EOIT, ECPGt_EORT);
193 #line 46 "declare.pgc"
194 
195 if (sqlca.sqlcode < 0) sqlprint();}
196 #line 46 "declare.pgc"
197 
198 
199  commitTable();
200 
201  { ECPGdisconnect(__LINE__, "ALL");
202 #line 50 "declare.pgc"
203 
204 if (sqlca.sqlcode < 0) sqlprint();}
205 #line 50 "declare.pgc"
206 
207 
208  return 0;
209 }
bool ECPGdisconnect(int lineno, const char *connection_name)
Definition: connect.c:659
#define setlocale(a, b)
Definition: win32_port.h:436
bool ECPGdo(const int lineno, const int compat, const int force_indicator, const char *connection_name, const bool questionmarks, const int st, const char *query,...)
Definition: execute.c:2287
void commitTable(void)
Definition: sql-declare.c:543
#define sqlca
Definition: sql-declare.c:78
bool ECPGconnect(int lineno, int c, const char *name, const char *user, const char *passwd, const char *connection_name, int autocommit)
Definition: connect.c:271
#define ECPGdebug(X, Y)
Definition: sql-declare.c:7
void sqlprint(void)
Definition: error.c:335
void execute_test(void)
Definition: sql-declare.c:216

◆ printResult()

void printResult ( char *  tc_name,
int  loop 
)

Definition at line 569 of file sql-declare.c.

References f1, f2, f3, i, and printf.

Referenced by execute_test().

570 {
571  int i;
572 
573  if (tc_name)
574  printf("****%s test results:****\n", tc_name);
575 
576  for (i = 0; i < loop; i++)
577  printf("f1=%d, f2=%d, f3=%s\n", f1[i], f2[i], f3[i]);
578 
579  printf("\n");
580 }
#define printf(...)
Definition: port.h:222
int f1[ARRAY_SZIE]
Definition: sql-declare.c:113
int f2[ARRAY_SZIE]
Definition: sql-declare.c:116
int i
char f3[ARRAY_SZIE][20]
Definition: sql-declare.c:119

◆ reset()

void reset ( void  )

Definition at line 562 of file sql-declare.c.

References f1, f2, and f3.

Referenced by execute_test().

563 {
564  memset(f1, 0, sizeof(f1));
565  memset(f2, 0, sizeof(f2));
566  memset(f3, 0, sizeof(f3));
567 }
int f1[ARRAY_SZIE]
Definition: sql-declare.c:113
int f2[ARRAY_SZIE]
Definition: sql-declare.c:116
char f3[ARRAY_SZIE][20]
Definition: sql-declare.c:119

Variable Documentation

◆ f1

◆ f2

int f2[ARRAY_SZIE]

Definition at line 116 of file sql-declare.c.

Referenced by cmpcmdflag(), execute_test(), float8_qsort_cmp(), printResult(), and reset().

◆ f3

char f3[ARRAY_SZIE][20]

Definition at line 119 of file sql-declare.c.

Referenced by execute_test(), printResult(), and reset().