Skip to content

Commit 3acb7d1

Browse files
committed
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
1 parent 0343024 commit 3acb7d1

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/interfaces/ecpg/lib/ecpglib.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,12 +434,20 @@ ECPGexecute(struct statement * stmt)
434434
switch (var->type)
435435
{
436436
case ECPGt_short:
437+
sprintf(buff, "%d", *(short *) var->value);
438+
tobeinserted = buff;
439+
break;
440+
437441
case ECPGt_int:
438442
sprintf(buff, "%d", *(int *) var->value);
439443
tobeinserted = buff;
440444
break;
441445

442446
case ECPGt_unsigned_short:
447+
sprintf(buff, "%d", *(unsigned short *) var->value);
448+
tobeinserted = buff;
449+
break;
450+
443451
case ECPGt_unsigned_int:
444452
sprintf(buff, "%d", *(unsigned int *) var->value);
445453
tobeinserted = buff;

0 commit comments

Comments
 (0)