1
- /* $Header: /cvsroot/pgsql/src/interfaces/ecpg/ecpglib/data.c,v 1.18 2003/09/18 13:12:23 meskes Exp $ */
1
+ /* $Header: /cvsroot/pgsql/src/interfaces/ecpg/ecpglib/data.c,v 1.19 2003/09/19 14:06:21 meskes Exp $ */
2
2
3
3
#define POSTGRES_ECPG_INTERNAL
4
4
#include "postgres_fe.h"
@@ -397,22 +397,24 @@ ECPGget_data(const PGresult *results, int act_tuple, int act_field, int lineno,
397
397
{
398
398
/* Informix wants its own NULL value here instead of an error */
399
399
ECPGset_informix_null (ECPGt_numeric , & nres );
400
- return (true);
401
400
}
402
401
else
403
402
{
404
403
ECPGraise (lineno , ECPG_NUMERIC_FORMAT , ECPG_SQLSTATE_DATATYPE_MISMATCH , pval );
405
404
return (false);
406
405
}
407
406
}
408
- if (isarray && * scan_length == '"' )
409
- scan_length ++ ;
410
-
411
- if ((isarray && * scan_length != ',' && * scan_length != '}' )
412
- || (!isarray && * scan_length != '\0' && * scan_length != ' ' )) /* Garbage left */
407
+ else
413
408
{
414
- ECPGraise (lineno , ECPG_NUMERIC_FORMAT , ECPG_SQLSTATE_DATATYPE_MISMATCH , pval );
415
- return (false);
409
+ if (isarray && * scan_length == '"' )
410
+ scan_length ++ ;
411
+
412
+ if ((isarray && * scan_length != ',' && * scan_length != '}' )
413
+ || (!isarray && * scan_length != '\0' && * scan_length != ' ' )) /* Garbage left */
414
+ {
415
+ ECPGraise (lineno , ECPG_NUMERIC_FORMAT , ECPG_SQLSTATE_DATATYPE_MISMATCH , pval );
416
+ return (false);
417
+ }
416
418
}
417
419
}
418
420
else
@@ -439,22 +441,24 @@ ECPGget_data(const PGresult *results, int act_tuple, int act_field, int lineno,
439
441
{
440
442
/* Informix wants its own NULL value here instead of an error */
441
443
ECPGset_informix_null (ECPGt_interval , & ires );
442
- return (true);
443
444
}
444
445
else
445
446
{
446
447
ECPGraise (lineno , ECPG_INTERVAL_FORMAT , ECPG_SQLSTATE_DATATYPE_MISMATCH , pval );
447
448
return (false);
448
449
}
449
450
}
450
- if (isarray && * scan_length == '"' )
451
- scan_length ++ ;
452
-
453
- if ((isarray && * scan_length != ',' && * scan_length != '}' )
454
- || (!isarray && * scan_length != '\0' && * scan_length != ' ' )) /* Garbage left */
451
+ else
455
452
{
456
- ECPGraise (lineno , ECPG_INTERVAL_FORMAT , ECPG_SQLSTATE_DATATYPE_MISMATCH , pval );
457
- return (false);
453
+ if (isarray && * scan_length == '"' )
454
+ scan_length ++ ;
455
+
456
+ if ((isarray && * scan_length != ',' && * scan_length != '}' )
457
+ || (!isarray && * scan_length != '\0' && * scan_length != ' ' )) /* Garbage left */
458
+ {
459
+ ECPGraise (lineno , ECPG_INTERVAL_FORMAT , ECPG_SQLSTATE_DATATYPE_MISMATCH , pval );
460
+ return (false);
461
+ }
458
462
}
459
463
}
460
464
else
@@ -477,23 +481,24 @@ ECPGget_data(const PGresult *results, int act_tuple, int act_field, int lineno,
477
481
{
478
482
/* Informix wants its own NULL value here instead of an error */
479
483
ECPGset_informix_null (ECPGt_date , & ddres );
480
- return (true);
481
484
}
482
485
else
483
486
{
484
487
ECPGraise (lineno , ECPG_DATE_FORMAT , ECPG_SQLSTATE_DATATYPE_MISMATCH , pval );
485
488
return (false);
486
489
}
487
490
}
488
-
489
- if (isarray && * scan_length == '"' )
490
- scan_length ++ ;
491
-
492
- if ((isarray && * scan_length != ',' && * scan_length != '}' )
493
- || (!isarray && * scan_length != '\0' && * scan_length != ' ' )) /* Garbage left */
491
+ else
494
492
{
495
- ECPGraise (lineno , ECPG_DATE_FORMAT , ECPG_SQLSTATE_DATATYPE_MISMATCH , pval );
496
- return (false);
493
+ if (isarray && * scan_length == '"' )
494
+ scan_length ++ ;
495
+
496
+ if ((isarray && * scan_length != ',' && * scan_length != '}' )
497
+ || (!isarray && * scan_length != '\0' && * scan_length != ' ' )) /* Garbage left */
498
+ {
499
+ ECPGraise (lineno , ECPG_DATE_FORMAT , ECPG_SQLSTATE_DATATYPE_MISMATCH , pval );
500
+ return (false);
501
+ }
497
502
}
498
503
499
504
* ((date * ) (var + offset * act_tuple )) = ddres ;
@@ -515,22 +520,24 @@ ECPGget_data(const PGresult *results, int act_tuple, int act_field, int lineno,
515
520
{
516
521
/* Informix wants its own NULL value here instead of an error */
517
522
ECPGset_informix_null (ECPGt_timestamp , & tres );
518
- return (true);
519
523
}
520
524
else
521
525
{
522
526
ECPGraise (lineno , ECPG_TIMESTAMP_FORMAT , ECPG_SQLSTATE_DATATYPE_MISMATCH , pval );
523
527
return (false);
524
528
}
525
529
}
526
- if (isarray && * scan_length == '"' )
527
- scan_length ++ ;
528
-
529
- if ((isarray && * scan_length != ',' && * scan_length != '}' )
530
- || (!isarray && * scan_length != '\0' && * scan_length != ' ' )) /* Garbage left */
530
+ else
531
531
{
532
- ECPGraise (lineno , ECPG_TIMESTAMP_FORMAT , ECPG_SQLSTATE_DATATYPE_MISMATCH , pval );
533
- return (false);
532
+ if (isarray && * scan_length == '"' )
533
+ scan_length ++ ;
534
+
535
+ if ((isarray && * scan_length != ',' && * scan_length != '}' )
536
+ || (!isarray && * scan_length != '\0' && * scan_length != ' ' )) /* Garbage left */
537
+ {
538
+ ECPGraise (lineno , ECPG_TIMESTAMP_FORMAT , ECPG_SQLSTATE_DATATYPE_MISMATCH , pval );
539
+ return (false);
540
+ }
534
541
}
535
542
536
543
* ((timestamp * ) (var + offset * act_tuple )) = tres ;
0 commit comments