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 $ */
22
33#define POSTGRES_ECPG_INTERNAL
44#include "postgres_fe.h"
@@ -397,22 +397,24 @@ ECPGget_data(const PGresult *results, int act_tuple, int act_field, int lineno,
397397 {
398398 /* Informix wants its own NULL value here instead of an error */
399399 ECPGset_informix_null (ECPGt_numeric , & nres );
400- return (true);
401400 }
402401 else
403402 {
404403 ECPGraise (lineno , ECPG_NUMERIC_FORMAT , ECPG_SQLSTATE_DATATYPE_MISMATCH , pval );
405404 return (false);
406405 }
407406 }
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
413408 {
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+ }
416418 }
417419 }
418420 else
@@ -439,22 +441,24 @@ ECPGget_data(const PGresult *results, int act_tuple, int act_field, int lineno,
439441 {
440442 /* Informix wants its own NULL value here instead of an error */
441443 ECPGset_informix_null (ECPGt_interval , & ires );
442- return (true);
443444 }
444445 else
445446 {
446447 ECPGraise (lineno , ECPG_INTERVAL_FORMAT , ECPG_SQLSTATE_DATATYPE_MISMATCH , pval );
447448 return (false);
448449 }
449450 }
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
455452 {
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+ }
458462 }
459463 }
460464 else
@@ -477,23 +481,24 @@ ECPGget_data(const PGresult *results, int act_tuple, int act_field, int lineno,
477481 {
478482 /* Informix wants its own NULL value here instead of an error */
479483 ECPGset_informix_null (ECPGt_date , & ddres );
480- return (true);
481484 }
482485 else
483486 {
484487 ECPGraise (lineno , ECPG_DATE_FORMAT , ECPG_SQLSTATE_DATATYPE_MISMATCH , pval );
485488 return (false);
486489 }
487490 }
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
494492 {
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+ }
497502 }
498503
499504 * ((date * ) (var + offset * act_tuple )) = ddres ;
@@ -515,22 +520,24 @@ ECPGget_data(const PGresult *results, int act_tuple, int act_field, int lineno,
515520 {
516521 /* Informix wants its own NULL value here instead of an error */
517522 ECPGset_informix_null (ECPGt_timestamp , & tres );
518- return (true);
519523 }
520524 else
521525 {
522526 ECPGraise (lineno , ECPG_TIMESTAMP_FORMAT , ECPG_SQLSTATE_DATATYPE_MISMATCH , pval );
523527 return (false);
524528 }
525529 }
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
531531 {
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+ }
534541 }
535542
536543 * ((timestamp * ) (var + offset * act_tuple )) = tres ;
0 commit comments