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
051a4f23
Commit
051a4f23
authored
Jan 11, 2002
by
Michael Meskes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added Christof's fixes.
parent
4e37786f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
5 deletions
+32
-5
src/interfaces/ecpg/ChangeLog
src/interfaces/ecpg/ChangeLog
+5
-0
src/interfaces/ecpg/lib/descriptor.c
src/interfaces/ecpg/lib/descriptor.c
+27
-5
No files found.
src/interfaces/ecpg/ChangeLog
View file @
051a4f23
...
...
@@ -1196,5 +1196,10 @@ Tue Jan 8 15:16:37 CET 2002
Thu Jan 10 11:12:14 CET 2002
- Include sqlca.h automatically.
Fri Jan 11 15:43:39 CET 2002
- clear sqlca on : [de]allocate descriptor & get descriptor and set
sqlca.sqlerrd[2] accordingly (Christof).
- Set ecpg version to 2.9.0.
- Set library version to 3.3.0.
src/interfaces/ecpg/lib/descriptor.c
View file @
051a4f23
/* dynamic SQL support routines
*
* $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/descriptor.c,v 1.2
0 2001/12/23 12:17:4
1 meskes Exp $
* $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/descriptor.c,v 1.2
1 2002/01/11 14:43:1
1 meskes Exp $
*/
#include "postgres_fe.h"
...
...
@@ -10,6 +10,7 @@
#include "ecpglib.h"
#include "ecpgerrno.h"
#include "extern.h"
#include "sqlca.h"
#include "sql3types.h"
struct
descriptor
*
all_descriptors
=
NULL
;
...
...
@@ -49,12 +50,15 @@ ECPGDynamicType_DDT(Oid type)
bool
ECPGget_desc_header
(
int
lineno
,
char
*
desc_name
,
int
*
count
)
{
PGresult
*
ECPGresult
=
ECPGresultByDescriptor
(
lineno
,
desc_name
)
;
PGresult
*
ECPGresult
;
ECPGinit_sqlca
();
ECPGresult
=
ECPGresultByDescriptor
(
lineno
,
desc_name
);
if
(
!
ECPGresult
)
return
false
;
*
count
=
PQnfields
(
ECPGresult
);
sqlca
.
sqlerrd
[
2
]
=
1
;
ECPGlog
(
"ECPGget_desc_header: found %d attributes.
\n
"
,
*
count
);
return
true
;
}
...
...
@@ -140,13 +144,15 @@ bool
ECPGget_desc
(
int
lineno
,
char
*
desc_name
,
int
index
,...)
{
va_list
args
;
PGresult
*
ECPGresult
=
ECPGresultByDescriptor
(
lineno
,
desc_name
)
;
PGresult
*
ECPGresult
;
enum
ECPGdtype
type
;
int
ntuples
,
act_tuple
;
struct
variable
data_var
;
va_start
(
args
,
index
);
ECPGinit_sqlca
();
ECPGresult
=
ECPGresultByDescriptor
(
lineno
,
desc_name
);
if
(
!
ECPGresult
)
return
(
false
);
...
...
@@ -359,7 +365,7 @@ ECPGget_desc(int lineno, char *desc_name, int index,...)
ECPGlog
(
"ECPGget_desc: INDICATOR[%d] = %d
\n
"
,
act_tuple
,
-
PQgetisnull
(
ECPGresult
,
act_tuple
,
index
));
}
}
sqlca
.
sqlerrd
[
2
]
=
ntuples
;
return
(
true
);
}
...
...
@@ -369,6 +375,7 @@ ECPGdeallocate_desc(int line, const char *name)
struct
descriptor
*
i
;
struct
descriptor
**
lastptr
=
&
all_descriptors
;
ECPGinit_sqlca
();
for
(
i
=
all_descriptors
;
i
;
lastptr
=
&
i
->
next
,
i
=
i
->
next
)
{
if
(
!
strcmp
(
name
,
i
->
name
))
...
...
@@ -387,11 +394,26 @@ ECPGdeallocate_desc(int line, const char *name)
bool
ECPGallocate_desc
(
int
line
,
const
char
*
name
)
{
struct
descriptor
*
new
=
(
struct
descriptor
*
)
ECPGalloc
(
sizeof
(
struct
descriptor
),
line
)
;
struct
descriptor
*
new
;
ECPGinit_sqlca
();
new
=
(
struct
descriptor
*
)
ECPGalloc
(
sizeof
(
struct
descriptor
),
line
);
if
(
!
new
)
return
false
;
new
->
next
=
all_descriptors
;
new
->
name
=
ECPGalloc
(
strlen
(
name
)
+
1
,
line
);
if
(
!
new
->
name
)
{
ECPGfree
(
new
);
return
false
;
}
new
->
result
=
PQmakeEmptyPGresult
(
NULL
,
0
);
if
(
!
new
->
result
)
{
ECPGfree
(
new
->
name
);
ECPGfree
(
new
);
ECPGraise
(
line
,
ECPG_OUT_OF_MEMORY
,
NULL
);
return
false
;
}
strcpy
(
new
->
name
,
name
);
all_descriptors
=
new
;
return
true
;
...
...
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