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
8902aaaa
Commit
8902aaaa
authored
Jun 19, 2003
by
Michael Meskes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed fetch into char * and added missing prototype for an Informix function.
parent
4d9eede8
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
85 additions
and
86 deletions
+85
-86
src/interfaces/ecpg/ChangeLog
src/interfaces/ecpg/ChangeLog
+5
-0
src/interfaces/ecpg/compatlib/informix.c
src/interfaces/ecpg/compatlib/informix.c
+6
-0
src/interfaces/ecpg/ecpglib/data.c
src/interfaces/ecpg/ecpglib/data.c
+71
-59
src/interfaces/ecpg/pgtypeslib/Makefile
src/interfaces/ecpg/pgtypeslib/Makefile
+2
-2
src/interfaces/ecpg/preproc/preproc.y
src/interfaces/ecpg/preproc/preproc.y
+1
-25
No files found.
src/interfaces/ecpg/ChangeLog
View file @
8902aaaa
...
...
@@ -1496,6 +1496,11 @@ Sun Jun 15 11:18:58 CEST 2003
Tue Jun 17 08:45:14 CEST 2003
- Fixed several parsing bugs.
Thu Jun 19 10:08:26 CEST 2003
- Added missing rdayofweek function for Informix compatibility.
- Fixed fetch into char pointer.
- Set ecpg version to 3.0.0
- Set ecpg library to 4.0.0
- Set pgtypes library to 1.0.0
...
...
src/interfaces/ecpg/compatlib/informix.c
View file @
8902aaaa
...
...
@@ -343,6 +343,12 @@ rmdyjul (short mdy[3], Date *d)
return
0
;
}
int
rdayofweek
(
Date
d
)
{
return
(
PGTYPESdate_dayofweek
(
d
));
}
/* And the datetime stuff */
void
...
...
src/interfaces/ecpg/ecpglib/data.c
View file @
8902aaaa
/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/ecpglib/data.c,v 1.
5 2003/06/15 04:07:58 momjian
Exp $ */
/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/ecpglib/data.c,v 1.
6 2003/06/19 09:52:11 meskes
Exp $ */
#define POSTGRES_ECPG_INTERNAL
#include "postgres_fe.h"
...
...
@@ -299,26 +299,33 @@ ECPGget_data(const PGresult *results, int act_tuple, int act_field, int lineno,
case
ECPGt_char
:
case
ECPGt_unsigned_char
:
{
if
(
varcharsize
==
0
)
{
strncpy
((
char
*
)
((
long
)
var
+
offset
*
act_tuple
),
pval
,
strlen
(
pval
));
}
else
{
strncpy
((
char
*
)
((
long
)
var
+
offset
*
act_tuple
),
pval
,
varcharsize
);
if
(
varcharsize
&&
varcharsize
<
strlen
(
pval
))
if
(
varcharsize
<
strlen
(
pval
))
{
/* truncation */
switch
(
ind_type
)
{
case
ECPGt_short
:
case
ECPGt_unsigned_short
:
/* ((short *) ind)[act_tuple] = strlen(pval);*/
/* ((short *) ind)[act_tuple] = strlen(pval);*/
*
((
short
*
)
(
ind
+
ind_offset
*
act_tuple
))
=
strlen
(
pval
);
break
;
case
ECPGt_int
:
case
ECPGt_unsigned_int
:
/* ((int *) ind)[act_tuple] = strlen(pval);*/
/* ((int *) ind)[act_tuple] = strlen(pval);*/
*
((
int
*
)
(
ind
+
ind_offset
*
act_tuple
))
=
strlen
(
pval
);
break
;
case
ECPGt_long
:
case
ECPGt_unsigned_long
:
/* ((long *) ind)[act_tuple] = strlen(pval);*/
/* ((long *) ind)[act_tuple] = strlen(pval);*/
*
((
long
*
)
(
ind
+
ind_offset
*
act_tuple
))
=
strlen
(
pval
);
break
;
#ifdef HAVE_LONG_LONG_INT_64
...
...
@@ -333,6 +340,7 @@ ECPGget_data(const PGresult *results, int act_tuple, int act_field, int lineno,
sqlca
->
sqlwarn
[
0
]
=
sqlca
->
sqlwarn
[
1
]
=
'W'
;
}
}
}
break
;
case
ECPGt_varchar
:
...
...
@@ -342,28 +350,31 @@ ECPGget_data(const PGresult *results, int act_tuple, int act_field, int lineno,
variable
->
len
=
strlen
(
pval
);
if
(
varcharsize
==
0
)
{
strncpy
(
variable
->
arr
,
pval
,
variable
->
len
);
}
else
{
strncpy
(
variable
->
arr
,
pval
,
varcharsize
);
if
(
varcharsize
>
0
&&
variable
->
len
>
varcharsize
)
if
(
variable
->
len
>
varcharsize
)
{
/* truncation */
switch
(
ind_type
)
{
case
ECPGt_short
:
case
ECPGt_unsigned_short
:
/* ((short *) ind)[act_tuple] = variable->len;*/
/* ((short *) ind)[act_tuple] = variable->len;*/
*
((
short
*
)
(
ind
+
offset
*
act_tuple
))
=
variable
->
len
;
break
;
case
ECPGt_int
:
case
ECPGt_unsigned_int
:
/* ((int *) ind)[act_tuple] = variable->len;*/
/* ((int *) ind)[act_tuple] = variable->len;*/
*
((
int
*
)
(
ind
+
offset
*
act_tuple
))
=
variable
->
len
;
break
;
case
ECPGt_long
:
case
ECPGt_unsigned_long
:
/* ((long *) ind)[act_tuple] = variable->len;*/
/* ((long *) ind)[act_tuple] = variable->len;*/
*
((
long
*
)
(
ind
+
offset
*
act_tuple
))
=
variable
->
len
;
break
;
#ifdef HAVE_LONG_LONG_INT_64
...
...
@@ -380,6 +391,7 @@ ECPGget_data(const PGresult *results, int act_tuple, int act_field, int lineno,
variable
->
len
=
varcharsize
;
}
}
}
break
;
case
ECPGt_numeric
:
...
...
src/interfaces/ecpg/pgtypeslib/Makefile
View file @
8902aaaa
...
...
@@ -4,7 +4,7 @@
#
# Copyright (c) 1994, Regents of the University of California
#
# $Header: /cvsroot/pgsql/src/interfaces/ecpg/pgtypeslib/Makefile,v 1.
7 2003/05/10 02:05:50 momjian
Exp $
# $Header: /cvsroot/pgsql/src/interfaces/ecpg/pgtypeslib/Makefile,v 1.
8 2003/06/19 09:52:11 meskes
Exp $
#
#-------------------------------------------------------------------------
...
...
@@ -16,7 +16,7 @@ NAME= pgtypes
SO_MAJOR_VERSION
=
1
SO_MINOR_VERSION
=
0.0
override CPPFLAGS
:
= -I$(top_srcdir)/src/interfaces/ecpg/include -I$(top_srcdir)/src/include/utils $(CPPFLAGS)
override CPPFLAGS
:
= -I$(top_srcdir)/src/interfaces/ecpg/include -I$(top_srcdir)/src/include/utils $(CPPFLAGS)
-g
OBJS
=
numeric.o datetime.o common.o dt_common.o timestamp.o interval.o
\
$(
filter
rint.o,
$(LIBOBJS)
)
...
...
src/interfaces/ecpg/preproc/preproc.y
View file @
8902aaaa
/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/Attic/preproc.y,v 1.23
3 2003/06/17 07:28:22
meskes Exp $ */
/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/Attic/preproc.y,v 1.23
4 2003/06/19 09:52:11
meskes Exp $ */
/* Copyright comment */
%{
...
...
@@ -5048,30 +5048,6 @@ variable: opt_pointer ECPGColLabelCommon opt_array_bounds opt_initializer
$$ = cat_str(4, $1, mm_strdup($2), $3.str, $4);
break;
/*case ECPGt_numeric:
if (atoi(dimension) < 0)
type = ECPGmake_simple_type(actual_type[struct_level].type_enum, length);
else
type = ECPGmake_array_type(ECPGmake_simple_type(actual_type[struct_level].type_enum, length), dimension);
if (atoi(dimension) < 0)
$$ = cat_str(4, mm_strdup(actual_storage[struct_level]), make_str("Numeric"), mm_strdup($2), $4);
else
$$ = cat_str(5, mm_strdup(actual_storage[struct_level]), make_str("Numeric"), mm_strdup($2), mm_strdup(dim), $4);
break;
case ECPGt_interval:
if (atoi(dimension) < 0)
type = ECPGmake_simple_type(actual_type[struct_level].type_enum, length);
else
type = ECPGmake_array_type(ECPGmake_simple_type(actual_type[struct_level].type_enum, length), dimension);
if (atoi(dimension) < 0)
$$ = cat_str(4, mm_strdup(actual_storage[struct_level]), make_str("Interval"), mm_strdup($2), $4);
else
$$ = cat_str(5, mm_strdup(actual_storage[struct_level]), make_str("Interval"), mm_strdup($2), mm_strdup(dim), $4);
break;*/
default:
if (atoi(dimension) < 0)
type = ECPGmake_simple_type(actual_type[struct_level].type_enum, make_str("1"));
...
...
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