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

Function main

src/interfaces/ecpg/test/expected/sql-indicators.c:94–189  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

92
93
94int main()
95{
96 /* exec sql begin declare section */
97
98
99
100#line 9 "indicators.pgc"
101 int intvar = 5 ;
102
103#line 10 "indicators.pgc"
104 int nullind = - 1 ;
105/* exec sql end declare section */
106#line 11 "indicators.pgc"
107
108
109 ECPGdebug(1,stderr);
110
111 { ECPGconnect(__LINE__, 0, "ecpg1_regression" , NULL, NULL , NULL, 0); }
112#line 15 "indicators.pgc"
113
114 { ECPGsetcommit(__LINE__, "off", NULL);}
115#line 16 "indicators.pgc"
116
117
118 { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "create table indicator_test ( \"id\" int primary key , \"str\" text not null , val int null )", ECPGt_EOIT, ECPGt_EORT);}
119#line 21 "indicators.pgc"
120
121 { ECPGtrans(__LINE__, NULL, "commit work");}
122#line 22 "indicators.pgc"
123
124
125 { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into indicator_test ( id , str , val ) values ( 1 , 'Hello' , 0 )", ECPGt_EOIT, ECPGt_EORT);}
126#line 24 "indicators.pgc"
127
128
129 /* use indicator in insert */
130 { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into indicator_test ( id , str , val ) values ( 2 , 'Hi there' , $1 )",
131 ECPGt_int,&(intvar),(long)1,(long)1,sizeof(int),
132 ECPGt_int,&(nullind),(long)1,(long)1,sizeof(int), ECPGt_EOIT, ECPGt_EORT);}
133#line 27 "indicators.pgc"
134
135 nullind = 0;
136 { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into indicator_test ( id , str , val ) values ( 3 , 'Good evening' , $1 )",
137 ECPGt_int,&(intvar),(long)1,(long)1,sizeof(int),
138 ECPGt_int,&(nullind),(long)1,(long)1,sizeof(int), ECPGt_EOIT, ECPGt_EORT);}
139#line 29 "indicators.pgc"
140
141 { ECPGtrans(__LINE__, NULL, "commit work");}
142#line 30 "indicators.pgc"
143
144
145 /* use indicators to get information about selects */
146 { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "select val from indicator_test where id = 1", ECPGt_EOIT,
147 ECPGt_int,&(intvar),(long)1,(long)1,sizeof(int),
148 ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);}
149#line 33 "indicators.pgc"
150
151 { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "select val from indicator_test where id = 2", ECPGt_EOIT,

Callers

nothing calls this directly

Calls 6

ECPGdebugFunction · 0.85
ECPGconnectFunction · 0.85
ECPGsetcommitFunction · 0.85
ECPGdoFunction · 0.85
ECPGtransFunction · 0.85
ECPGdisconnectFunction · 0.85

Tested by

no test coverage detected