mirror of
https://github.com/postgres/postgres.git
synced 2025-07-30 11:03:19 +03:00
Test Case:
---------- exec sql begin declare section; short s ; unsigned short us; exec sql end declare section; exec sql create table test(s smallint, us smallint); exec sql commit; s = 1; us =32000; exec sql insert into test values( :s, :us ) ; <== error Error Message: "i4toi2: '-600309759' causes int2 underflow" Masaaki Sakaida
This commit is contained in:
@ -434,12 +434,20 @@ ECPGexecute(struct statement * stmt)
|
||||
switch (var->type)
|
||||
{
|
||||
case ECPGt_short:
|
||||
sprintf(buff, "%d", *(short *) var->value);
|
||||
tobeinserted = buff;
|
||||
break;
|
||||
|
||||
case ECPGt_int:
|
||||
sprintf(buff, "%d", *(int *) var->value);
|
||||
tobeinserted = buff;
|
||||
break;
|
||||
|
||||
case ECPGt_unsigned_short:
|
||||
sprintf(buff, "%d", *(unsigned short *) var->value);
|
||||
tobeinserted = buff;
|
||||
break;
|
||||
|
||||
case ECPGt_unsigned_int:
|
||||
sprintf(buff, "%d", *(unsigned int *) var->value);
|
||||
tobeinserted = buff;
|
||||
|
Reference in New Issue
Block a user