MCPcopy Create free account
hub / github.com/apache/cloudberry / main

Function main

src/interfaces/ecpg/test/expected/sql-parser.c:26–126  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24
25
26int main() {
27 /* exec sql begin declare section */
28
29
30#line 10 "parser.pgc"
31 int item [ 3 ] , ind [ 3 ] , i ;
32/* exec sql end declare section */
33#line 11 "parser.pgc"
34
35
36 ECPGdebug(1, stderr);
37 { ECPGconnect(__LINE__, 0, "ecpg1_regression" , NULL, NULL , NULL, 0); }
38#line 14 "parser.pgc"
39
40
41 { ECPGsetcommit(__LINE__, "on", NULL);}
42#line 16 "parser.pgc"
43
44 /* exec sql whenever sql_warning sqlprint ; */
45#line 17 "parser.pgc"
46
47 /* exec sql whenever sqlerror sqlprint ; */
48#line 18 "parser.pgc"
49
50
51 { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "create table T ( Item1 int , Item2 int )", ECPGt_EOIT, ECPGt_EORT);
52#line 20 "parser.pgc"
53
54if (sqlca.sqlwarn[0] == 'W') sqlprint();
55#line 20 "parser.pgc"
56
57if (sqlca.sqlcode < 0) sqlprint();}
58#line 20 "parser.pgc"
59
60
61 { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into t select 1 , nullif ( y - 1 , 0 ) from generate_series ( 1 , 3 ) with ordinality as series ( x , y )", ECPGt_EOIT, ECPGt_EORT);
62#line 24 "parser.pgc"
63
64if (sqlca.sqlwarn[0] == 'W') sqlprint();
65#line 24 "parser.pgc"
66
67if (sqlca.sqlcode < 0) sqlprint();}
68#line 24 "parser.pgc"
69
70
71 { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "select Item2 from T order by Item2 nulls last", ECPGt_EOIT,
72 ECPGt_int,(item),(long)1,(long)3,sizeof(int),
73 ECPGt_int,(ind),(long)1,(long)3,sizeof(int), ECPGt_EORT);
74#line 26 "parser.pgc"
75
76if (sqlca.sqlwarn[0] == 'W') sqlprint();
77#line 26 "parser.pgc"
78
79if (sqlca.sqlcode < 0) sqlprint();}
80#line 26 "parser.pgc"
81
82
83 for (i=0; i<3; i++)

Callers

nothing calls this directly

Calls 6

ECPGdebugFunction · 0.85
ECPGconnectFunction · 0.85
ECPGsetcommitFunction · 0.85
ECPGdoFunction · 0.85
sqlprintFunction · 0.85
ECPGdisconnectFunction · 0.85

Tested by

no test coverage detected