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
c4a13c7e
Commit
c4a13c7e
authored
Nov 26, 2008
by
Michael Meskes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
When creating a varchar struct name braces must be discarded.
parent
f900afff
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
5 deletions
+14
-5
src/interfaces/ecpg/ChangeLog
src/interfaces/ecpg/ChangeLog
+4
-0
src/interfaces/ecpg/preproc/type.c
src/interfaces/ecpg/preproc/type.c
+10
-5
No files found.
src/interfaces/ecpg/ChangeLog
View file @
c4a13c7e
...
...
@@ -2390,6 +2390,10 @@ Tue, 14 Oct 2008 11:25:51 +0200
Sat, 25 Oct 2008 16:34:28 +0200
- Free allocated memory even if the next alloc failed with ENOMEM.
Wed, 26 Nov 2008 14:09:08 +0100
- When creating a varchar struct name braces must be discarded.
- Set pgtypes library version to 3.1.
- Set compat library version to 3.1.
- Set ecpg library version to 6.2.
...
...
src/interfaces/ecpg/preproc/type.c
View file @
c4a13c7e
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/type.c,v 1.
79 2008/05/16 15:20:04 petere
Exp $ */
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/type.c,v 1.
80 2008/11/26 13:18:22 meskes
Exp $ */
#include "postgres_fe.h"
...
...
@@ -327,8 +327,9 @@ ECPGdump_a_simple(FILE *o, const char *name, enum ECPGttype type,
fprintf
(
o
,
"
\n\t
ECPGt_descriptor, %s, 0L, 0L, 0L, "
,
name
);
else
{
char
*
variable
=
(
char
*
)
mm_alloc
(
strlen
(
name
)
+
((
prefix
==
NULL
)
?
0
:
strlen
(
prefix
))
+
4
);
char
*
offset
=
(
char
*
)
mm_alloc
(
strlen
(
name
)
+
strlen
(
"sizeof(struct varchar_)"
)
+
1
+
strlen
(
varcharsize
)
+
sizeof
(
int
)
*
CHAR_BIT
*
10
/
3
);
char
*
variable
=
(
char
*
)
mm_alloc
(
strlen
(
name
)
+
((
prefix
==
NULL
)
?
0
:
strlen
(
prefix
))
+
4
);
char
*
offset
=
(
char
*
)
mm_alloc
(
strlen
(
name
)
+
strlen
(
"sizeof(struct varchar_)"
)
+
1
+
strlen
(
varcharsize
)
+
sizeof
(
int
)
*
CHAR_BIT
*
10
/
3
);
char
*
var_name
;
switch
(
type
)
{
...
...
@@ -350,10 +351,14 @@ ECPGdump_a_simple(FILE *o, const char *name, enum ECPGttype type,
else
sprintf
(
variable
,
"&(%s%s)"
,
prefix
?
prefix
:
""
,
name
);
/* remove trailing [] is name is array element */
var_name
=
strdup
(
name
);
*
(
strchrnul
(
var_name
,
'['
))
=
'\0'
;
if
(
lineno
)
sprintf
(
offset
,
"sizeof(struct varchar_%s_%d)"
,
name
,
lineno
);
sprintf
(
offset
,
"sizeof(struct varchar_%s_%d)"
,
var_
name
,
lineno
);
else
sprintf
(
offset
,
"sizeof(struct varchar_%s)"
,
name
);
sprintf
(
offset
,
"sizeof(struct varchar_%s)"
,
var_name
);
free
(
var_name
);
break
;
case
ECPGt_char
:
case
ECPGt_unsigned_char
:
...
...
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