@@ -47,7 +47,7 @@ main(void)
47
47
48
48
double d ;
49
49
long l1 , l2 ;
50
- int i ;
50
+ int i , min , max ;
51
51
52
52
ECPGdebug (1 , stderr );
53
53
/* exec sql whenever sqlerror do sqlprint ( ) ; */
@@ -144,17 +144,28 @@ if (sqlca.sqlcode < 0) sqlprint ( );}
144
144
PGTYPESnumeric_free (value2 );
145
145
PGTYPESnumeric_free (res );
146
146
147
+ /* check conversion of numeric to int */
148
+ value1 = PGTYPESnumeric_from_asc ("-2147483648" , NULL );
149
+ PGTYPESnumeric_to_int (value1 , & min );
150
+ printf ("min int = %d\n" , min );
151
+ PGTYPESnumeric_free (value1 );
152
+
153
+ value2 = PGTYPESnumeric_from_asc ("2147483647" , NULL );
154
+ PGTYPESnumeric_to_int (value2 , & max );
155
+ printf ("max int = %d\n" , max );
156
+ PGTYPESnumeric_free (value2 );
157
+
147
158
{ ECPGtrans (__LINE__ , NULL , "rollback" );
148
- #line 93 "num_test.pgc"
159
+ #line 104 "num_test.pgc"
149
160
150
161
if (sqlca .sqlcode < 0 ) sqlprint ( );}
151
- #line 93 "num_test.pgc"
162
+ #line 104 "num_test.pgc"
152
163
153
164
{ ECPGdisconnect (__LINE__ , "CURRENT" );
154
- #line 94 "num_test.pgc"
165
+ #line 105 "num_test.pgc"
155
166
156
167
if (sqlca .sqlcode < 0 ) sqlprint ( );}
157
- #line 94 "num_test.pgc"
168
+ #line 105 "num_test.pgc"
158
169
159
170
160
171
return 0 ;
0 commit comments