Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
df974272
Commit
df974272
authored
Sep 19, 2003
by
Michael Meskes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed superfluous return statement in get_data.
parent
68901574
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
55 additions
and
67 deletions
+55
-67
src/interfaces/ecpg/compatlib/informix.c
src/interfaces/ecpg/compatlib/informix.c
+5
-15
src/interfaces/ecpg/ecpglib/data.c
src/interfaces/ecpg/ecpglib/data.c
+41
-34
src/interfaces/ecpg/include/datetime.h
src/interfaces/ecpg/include/datetime.h
+2
-7
src/interfaces/ecpg/include/decimal.h
src/interfaces/ecpg/include/decimal.h
+1
-3
src/interfaces/ecpg/include/ecpg_informix.h
src/interfaces/ecpg/include/ecpg_informix.h
+2
-5
src/interfaces/ecpg/include/pgtypes_date.h
src/interfaces/ecpg/include/pgtypes_date.h
+1
-1
src/interfaces/ecpg/preproc/preproc.y
src/interfaces/ecpg/preproc/preproc.y
+3
-2
No files found.
src/interfaces/ecpg/compatlib/informix.c
View file @
df974272
...
...
@@ -161,11 +161,9 @@ deccvasc(char *cp, int len, decimal * np)
int
ret
=
0
;
numeric
*
result
;
rsetnull
(
CDECIMALTYPE
,
(
char
*
)
np
);
if
(
risnull
(
CSTRINGTYPE
,
cp
))
{
rsetnull
(
CDECIMALTYPE
,
(
char
*
)
np
);
return
0
;
}
if
(
!
str
)
ret
=
-
1201
;
...
...
@@ -206,11 +204,9 @@ deccvdbl(double dbl, decimal * np)
numeric
*
nres
=
PGTYPESnumeric_new
();
int
result
=
1
;
rsetnull
(
CDECIMALTYPE
,
(
char
*
)
np
);
if
(
risnull
(
CDOUBLETYPE
,
(
char
*
)
&
dbl
))
{
rsetnull
(
CDECIMALTYPE
,
(
char
*
)
np
);
return
0
;
}
if
(
nres
==
NULL
)
return
-
1211
;
...
...
@@ -229,11 +225,9 @@ deccvint(int in, decimal * np)
numeric
*
nres
=
PGTYPESnumeric_new
();
int
result
=
1
;
rsetnull
(
CDECIMALTYPE
,
(
char
*
)
np
);
if
(
risnull
(
CINTTYPE
,
(
char
*
)
&
in
))
{
rsetnull
(
CDECIMALTYPE
,
(
char
*
)
np
);
return
0
;
}
if
(
nres
==
NULL
)
return
-
1211
;
...
...
@@ -252,11 +246,9 @@ deccvlong(long lng, decimal * np)
numeric
*
nres
=
PGTYPESnumeric_new
();
int
result
=
1
;
rsetnull
(
CDECIMALTYPE
,
(
char
*
)
np
);
if
(
risnull
(
CLONGTYPE
,
(
char
*
)
&
lng
))
{
rsetnull
(
CDECIMALTYPE
,
(
char
*
)
np
);
return
0
;
}
if
(
nres
==
NULL
)
return
-
1211
;
...
...
@@ -338,11 +330,9 @@ dectoasc(decimal * np, char *cp, int len, int right)
if
(
nres
==
NULL
)
return
-
1211
;
rsetnull
(
CSTRINGTYPE
,
(
char
*
)
cp
);
if
(
risnull
(
CDECIMALTYPE
,
(
char
*
)
np
))
{
rsetnull
(
CSTRINGTYPE
,
(
char
*
)
cp
);
return
0
;
}
if
(
PGTYPESnumeric_from_decimal
(
np
,
nres
)
!=
0
)
return
-
1211
;
...
...
src/interfaces/ecpg/ecpglib/data.c
View file @
df974272
/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/ecpglib/data.c,v 1.1
8 2003/09/18 13:12:23
meskes Exp $ */
/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/ecpglib/data.c,v 1.1
9 2003/09/19 14:06:21
meskes Exp $ */
#define POSTGRES_ECPG_INTERNAL
#include "postgres_fe.h"
...
...
@@ -397,7 +397,6 @@ ECPGget_data(const PGresult *results, int act_tuple, int act_field, int lineno,
{
/* Informix wants its own NULL value here instead of an error */
ECPGset_informix_null
(
ECPGt_numeric
,
&
nres
);
return
(
true
);
}
else
{
...
...
@@ -405,14 +404,17 @@ ECPGget_data(const PGresult *results, int act_tuple, int act_field, int lineno,
return
(
false
);
}
}
if
(
isarray
&&
*
scan_length
==
'"'
)
scan_length
++
;
if
((
isarray
&&
*
scan_length
!=
','
&&
*
scan_length
!=
'}'
)
||
(
!
isarray
&&
*
scan_length
!=
'\0'
&&
*
scan_length
!=
' '
))
/* Garbage left */
else
{
ECPGraise
(
lineno
,
ECPG_NUMERIC_FORMAT
,
ECPG_SQLSTATE_DATATYPE_MISMATCH
,
pval
);
return
(
false
);
if
(
isarray
&&
*
scan_length
==
'"'
)
scan_length
++
;
if
((
isarray
&&
*
scan_length
!=
','
&&
*
scan_length
!=
'}'
)
||
(
!
isarray
&&
*
scan_length
!=
'\0'
&&
*
scan_length
!=
' '
))
/* Garbage left */
{
ECPGraise
(
lineno
,
ECPG_NUMERIC_FORMAT
,
ECPG_SQLSTATE_DATATYPE_MISMATCH
,
pval
);
return
(
false
);
}
}
}
else
...
...
@@ -439,7 +441,6 @@ ECPGget_data(const PGresult *results, int act_tuple, int act_field, int lineno,
{
/* Informix wants its own NULL value here instead of an error */
ECPGset_informix_null
(
ECPGt_interval
,
&
ires
);
return
(
true
);
}
else
{
...
...
@@ -447,14 +448,17 @@ ECPGget_data(const PGresult *results, int act_tuple, int act_field, int lineno,
return
(
false
);
}
}
if
(
isarray
&&
*
scan_length
==
'"'
)
scan_length
++
;
if
((
isarray
&&
*
scan_length
!=
','
&&
*
scan_length
!=
'}'
)
||
(
!
isarray
&&
*
scan_length
!=
'\0'
&&
*
scan_length
!=
' '
))
/* Garbage left */
else
{
ECPGraise
(
lineno
,
ECPG_INTERVAL_FORMAT
,
ECPG_SQLSTATE_DATATYPE_MISMATCH
,
pval
);
return
(
false
);
if
(
isarray
&&
*
scan_length
==
'"'
)
scan_length
++
;
if
((
isarray
&&
*
scan_length
!=
','
&&
*
scan_length
!=
'}'
)
||
(
!
isarray
&&
*
scan_length
!=
'\0'
&&
*
scan_length
!=
' '
))
/* Garbage left */
{
ECPGraise
(
lineno
,
ECPG_INTERVAL_FORMAT
,
ECPG_SQLSTATE_DATATYPE_MISMATCH
,
pval
);
return
(
false
);
}
}
}
else
...
...
@@ -477,7 +481,6 @@ ECPGget_data(const PGresult *results, int act_tuple, int act_field, int lineno,
{
/* Informix wants its own NULL value here instead of an error */
ECPGset_informix_null
(
ECPGt_date
,
&
ddres
);
return
(
true
);
}
else
{
...
...
@@ -485,15 +488,17 @@ ECPGget_data(const PGresult *results, int act_tuple, int act_field, int lineno,
return
(
false
);
}
}
if
(
isarray
&&
*
scan_length
==
'"'
)
scan_length
++
;
if
((
isarray
&&
*
scan_length
!=
','
&&
*
scan_length
!=
'}'
)
||
(
!
isarray
&&
*
scan_length
!=
'\0'
&&
*
scan_length
!=
' '
))
/* Garbage left */
else
{
ECPGraise
(
lineno
,
ECPG_DATE_FORMAT
,
ECPG_SQLSTATE_DATATYPE_MISMATCH
,
pval
);
return
(
false
);
if
(
isarray
&&
*
scan_length
==
'"'
)
scan_length
++
;
if
((
isarray
&&
*
scan_length
!=
','
&&
*
scan_length
!=
'}'
)
||
(
!
isarray
&&
*
scan_length
!=
'\0'
&&
*
scan_length
!=
' '
))
/* Garbage left */
{
ECPGraise
(
lineno
,
ECPG_DATE_FORMAT
,
ECPG_SQLSTATE_DATATYPE_MISMATCH
,
pval
);
return
(
false
);
}
}
*
((
date
*
)
(
var
+
offset
*
act_tuple
))
=
ddres
;
...
...
@@ -515,7 +520,6 @@ ECPGget_data(const PGresult *results, int act_tuple, int act_field, int lineno,
{
/* Informix wants its own NULL value here instead of an error */
ECPGset_informix_null
(
ECPGt_timestamp
,
&
tres
);
return
(
true
);
}
else
{
...
...
@@ -523,14 +527,17 @@ ECPGget_data(const PGresult *results, int act_tuple, int act_field, int lineno,
return
(
false
);
}
}
if
(
isarray
&&
*
scan_length
==
'"'
)
scan_length
++
;
if
((
isarray
&&
*
scan_length
!=
','
&&
*
scan_length
!=
'}'
)
||
(
!
isarray
&&
*
scan_length
!=
'\0'
&&
*
scan_length
!=
' '
))
/* Garbage left */
else
{
ECPGraise
(
lineno
,
ECPG_TIMESTAMP_FORMAT
,
ECPG_SQLSTATE_DATATYPE_MISMATCH
,
pval
);
return
(
false
);
if
(
isarray
&&
*
scan_length
==
'"'
)
scan_length
++
;
if
((
isarray
&&
*
scan_length
!=
','
&&
*
scan_length
!=
'}'
)
||
(
!
isarray
&&
*
scan_length
!=
'\0'
&&
*
scan_length
!=
' '
))
/* Garbage left */
{
ECPGraise
(
lineno
,
ECPG_TIMESTAMP_FORMAT
,
ECPG_SQLSTATE_DATATYPE_MISMATCH
,
pval
);
return
(
false
);
}
}
*
((
timestamp
*
)
(
var
+
offset
*
act_tuple
))
=
tres
;
...
...
src/interfaces/ecpg/include/datetime.h
View file @
df974272
#include <pgtypes_timestamp.h>
#include <pgtypes_interval.h>
#ifndef dtime_t
#define dtime_t timestamp
#endif
/* dtime_t */
#ifndef intrvl_t
#define intrvl_t interval
#endif
/* intrvl_t */
typedef
timestamp
dtime_t
;
typedef
interval
intrvl_t
;
extern
void
dtcurrent
(
dtime_t
*
);
extern
int
dtcvasc
(
char
*
,
dtime_t
*
);
...
...
src/interfaces/ecpg/include/decimal.h
View file @
df974272
#include <pgtypes_numeric.h>
#ifndef dec_t
#define dec_t decimal
#endif
/* dec_t */
typedef
decimal
dec_t
;
int
decadd
(
dec_t
*
,
dec_t
*
,
dec_t
*
);
int
deccmp
(
dec_t
*
,
dec_t
*
);
...
...
src/interfaces/ecpg/include/ecpg_informix.h
View file @
df974272
...
...
@@ -5,15 +5,12 @@
#include <decimal.h>
#include <datetime.h>
#include <ecpglib.h>
#include <pgtypes_date.h>
#define SQLNOTFOUND 100
#ifndef date
#define date long
#endif
/* ! date */
extern
int
rdatestr
(
date
,
char
*
);
extern
void
rtoday
(
date
*
);
extern
void
rtoday
(
date
*
);
extern
int
rjulmdy
(
date
,
short
*
);
extern
int
rdefmtdate
(
date
*
,
char
*
,
char
*
);
extern
int
rfmtdate
(
date
,
char
*
,
char
*
);
...
...
src/interfaces/ecpg/include/pgtypes_date.h
View file @
df974272
...
...
@@ -3,7 +3,7 @@
#include <pgtypes_timestamp.h>
#define date long
typedef
long
date
;
extern
date
PGTYPESdate_from_asc
(
char
*
,
char
**
);
extern
char
*
PGTYPESdate_to_asc
(
date
);
...
...
src/interfaces/ecpg/preproc/preproc.y
View file @
df974272
/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/Attic/preproc.y,v 1.25
5 2003/09/18 13:12:23
meskes Exp $ */
/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/Attic/preproc.y,v 1.25
6 2003/09/19 14:06:21
meskes Exp $ */
/* Copyright comment */
%{
...
...
@@ -209,7 +209,6 @@ adjust_informix(struct arguments *list)
original_var = ptr->variable->name;
sprintf(temp, "%d))", ecpg_informix_var);
/* create call to "ECPG_informix_set_var(<counter>, <pointer>. <linen number>)" */
if (atoi(ptr->variable->type->size) > 1)
{
ptr->variable = new_variable(cat_str(4, make_str("("), mm_strdup(ECPGtype_name(ptr->variable->type->type)), make_str(" *)(ECPG_informix_get_var("), mm_strdup(temp)), ECPGmake_simple_type(ptr->variable->type->type, ptr->variable->type->size), 0);
...
...
@@ -220,6 +219,8 @@ adjust_informix(struct arguments *list)
ptr->variable = new_variable(cat_str(4, make_str("*("), mm_strdup(ECPGtype_name(ptr->variable->type->type)), make_str(" *)(ECPG_informix_get_var("), mm_strdup(temp)), ECPGmake_simple_type(ptr->variable->type->type, ptr->variable->type->size), 0);
sprintf(temp, "%d, &(", ecpg_informix_var++);
}
/* create call to "ECPG_informix_set_var(<counter>, <pointer>. <linen number>)" */
result = cat_str(5, result, make_str("ECPG_informix_set_var("), mm_strdup(temp), mm_strdup(original_var), make_str("), __LINE__);\n"));
/* now the indicator if there is one */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment