Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitabfa8ae

Browse files
author
Michael Meskes
committed
Fixed some Informix compat functions so they handle NULL resp. indicators better.
1 parent4afcba0 commitabfa8ae

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

‎src/interfaces/ecpg/ChangeLog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1563,6 +1563,12 @@ Tue Jul 8 12:34:00 CEST 2003
15631563

15641564
- Made Informix decimal-ascii conversion honor Informix NULLs.
15651565
- Informix variable handling didn't cope well with arrays.
1566+
1567+
Wed Jul 9 11:45:02 CEST 2003
1568+
1569+
- Made all Informix functions honor Informix NULLs.
1570+
- Extended compatibility functions for INFORMIX handling of DECLARE
1571+
statement to work with indicators.
15661572
- Set ecpg version to 3.0.0
15671573
- Set ecpg library to 4.0.0
15681574
- Set pgtypes library to 1.0.0

‎src/interfaces/ecpg/compatlib/informix.c

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@ deccall3(Decimal *arg1, Decimal *arg2, Decimal *result, int (*ptr)(Numeric *, Nu
5555
Numeric*a1,*a2,*nres;
5656
inti;
5757

58+
if (risnull(CDECIMALTYPE, (char*)arg1)||risnull(CDECIMALTYPE, (char*)arg2))
59+
{
60+
rsetnull(CDECIMALTYPE, (char*)result);
61+
return0;
62+
}
63+
5864
if ((a1=PGTYPESnumeric_new())==NULL)
5965
return-1211;
6066

@@ -191,6 +197,12 @@ deccvdbl(double dbl, Decimal *np)
191197
Numeric*nres=PGTYPESnumeric_new();
192198
intresult=1;
193199

200+
if (risnull(CDOUBLETYPE, (char*)&dbl))
201+
{
202+
rsetnull(CDECIMALTYPE, (char*)np);
203+
return0;
204+
}
205+
194206
if (nres==NULL)
195207
return-1211;
196208

@@ -208,6 +220,12 @@ deccvint(int in, Decimal *np)
208220
Numeric*nres=PGTYPESnumeric_new();
209221
intresult=1;
210222

223+
if (risnull(CINTTYPE, (char*)&in))
224+
{
225+
rsetnull(CDECIMALTYPE, (char*)np);
226+
return0;
227+
}
228+
211229
if (nres==NULL)
212230
return-1211;
213231

@@ -225,6 +243,12 @@ deccvlong(long lng, Decimal *np)
225243
Numeric*nres=PGTYPESnumeric_new();
226244
intresult=1;
227245

246+
if (risnull(CLONGTYPE, (char*)&lng))
247+
{
248+
rsetnull(CDECIMALTYPE, (char*)np);
249+
return0;
250+
}
251+
228252
if (nres==NULL)
229253
return-1211;
230254

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp