@@ -75,7 +75,7 @@ main(void)
75
75
76
76
double d ;
77
77
long l1 , l2 ;
78
- int i ;
78
+ int i , min , max ;
79
79
80
80
ECPGdebug (1 , stderr );
81
81
/* exec sql whenever sqlerror do sqlprint ( ) ; */
@@ -174,17 +174,28 @@ if (sqlca.sqlcode < 0) sqlprint ( );}
174
174
PGTYPESnumeric_free (value2 );
175
175
PGTYPESnumeric_free (res );
176
176
177
+ /* check conversion of numeric to int */
178
+ value1 = PGTYPESnumeric_from_asc ("-2147483648" , NULL );
179
+ PGTYPESnumeric_to_int (value1 , & min );
180
+ printf ("min int = %d\n" , min );
181
+ PGTYPESnumeric_free (value1 );
182
+
183
+ value2 = PGTYPESnumeric_from_asc ("2147483647" , NULL );
184
+ PGTYPESnumeric_to_int (value2 , & max );
185
+ printf ("max int = %d\n" , max );
186
+ PGTYPESnumeric_free (value2 );
187
+
177
188
{ ECPGtrans (__LINE__ , NULL , "rollback" );
178
- #line 90 "num_test.pgc"
189
+ #line 101 "num_test.pgc"
179
190
180
191
if (sqlca .sqlcode < 0 ) sqlprint ( );}
181
- #line 90 "num_test.pgc"
192
+ #line 101 "num_test.pgc"
182
193
183
194
{ ECPGdisconnect (__LINE__ , "CURRENT" );
184
- #line 91 "num_test.pgc"
195
+ #line 102 "num_test.pgc"
185
196
186
197
if (sqlca .sqlcode < 0 ) sqlprint ( );}
187
- #line 91 "num_test.pgc"
198
+ #line 102 "num_test.pgc"
188
199
189
200
190
201
return 0 ;
0 commit comments