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
153affd0
Commit
153affd0
authored
Feb 11, 2007
by
Michael Meskes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed multibyte handling as reported by <harada.toshi@oss.ntt.co.jp>.
parent
b8188e1e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
22 deletions
+34
-22
src/interfaces/ecpg/ChangeLog
src/interfaces/ecpg/ChangeLog
+4
-0
src/interfaces/ecpg/ecpglib/execute.c
src/interfaces/ecpg/ecpglib/execute.c
+30
-22
No files found.
src/interfaces/ecpg/ChangeLog
View file @
153affd0
...
@@ -2165,5 +2165,9 @@ Fr 2. Feb 09:53:48 CET 2007
...
@@ -2165,5 +2165,9 @@ Fr 2. Feb 09:53:48 CET 2007
- Cleaned up va_list handling. Hopefully this now works on all archs.
- Cleaned up va_list handling. Hopefully this now works on all archs.
- Applied Magnus Hagander's patch to take away some compiler warnings.
- Applied Magnus Hagander's patch to take away some compiler warnings.
Su 11. Feb 16:09:31 CET 2007
- Fixed multibyte handling as reported by <harada.toshi@oss.ntt.co.jp>.
- Set ecpg library version to 5.3.
- Set ecpg library version to 5.3.
- Set ecpg version to 4.3.1.
- Set ecpg version to 4.3.1.
src/interfaces/ecpg/ecpglib/execute.c
View file @
153affd0
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/execute.c,v 1.6
3 2007/02/02 08:58:23
meskes Exp $ */
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/execute.c,v 1.6
4 2007/02/11 15:18:17
meskes Exp $ */
/*
/*
* The aim is to get a simpler inteface to the database routines.
* The aim is to get a simpler inteface to the database routines.
...
@@ -38,9 +38,11 @@
...
@@ -38,9 +38,11 @@
static
char
*
static
char
*
quote_postgres
(
char
*
arg
,
bool
quote
,
int
lineno
)
quote_postgres
(
char
*
arg
,
bool
quote
,
int
lineno
)
{
{
char
*
res
;
char
*
res
;
int
i
,
int
error
;
ri
=
0
;
size_t
length
;
size_t
escaped_len
;
size_t
buffer_len
;
/*
/*
* if quote is false we just need to store things in a descriptor they
* if quote is false we just need to store things in a descriptor they
...
@@ -50,29 +52,35 @@ quote_postgres(char *arg, bool quote, int lineno)
...
@@ -50,29 +52,35 @@ quote_postgres(char *arg, bool quote, int lineno)
return
res
=
ECPGstrdup
(
arg
,
lineno
);
return
res
=
ECPGstrdup
(
arg
,
lineno
);
else
else
{
{
res
=
(
char
*
)
ECPGalloc
(
2
*
strlen
(
arg
)
+
3
,
lineno
);
length
=
strlen
(
arg
);
buffer_len
=
2
*
length
+
1
;
res
=
(
char
*
)
ECPGalloc
(
buffer_len
+
3
,
lineno
);
if
(
!
res
)
if
(
!
res
)
return
(
res
);
return
(
res
);
/*
error
=
0
;
* We don't know if the target database is using
escaped_len
=
PQescapeString
(
res
+
1
,
arg
,
buffer_len
);
* standard_conforming_strings, so we always use E'' strings.
if
(
error
)
*/
if
(
strchr
(
arg
,
'\\'
)
!=
NULL
)
res
[
ri
++
]
=
ESCAPE_STRING_SYNTAX
;
res
[
ri
++
]
=
'\''
;
for
(
i
=
0
;
arg
[
i
];
i
++
,
ri
++
)
{
{
if
(
SQL_STR_DOUBLE
(
arg
[
i
],
true
))
ECPGfree
(
res
);
res
[
ri
++
]
=
arg
[
i
];
return
NULL
;
res
[
ri
]
=
arg
[
i
];
}
if
(
length
==
escaped_len
)
{
res
[
0
]
=
res
[
escaped_len
+
1
]
=
'\''
;
res
[
escaped_len
+
2
]
=
'\0'
;
}
else
{
/*
* We don't know if the target database is using
* standard_conforming_strings, so we always use E'' strings.
*/
memmove
(
res
+
2
,
res
+
1
,
escaped_len
);
res
[
0
]
=
ESCAPE_STRING_SYNTAX
;
res
[
1
]
=
res
[
escaped_len
+
2
]
=
'\''
;
res
[
escaped_len
+
3
]
=
'\0'
;
}
}
res
[
ri
++
]
=
'\''
;
res
[
ri
]
=
'\0'
;
ECPGfree
(
arg
);
ECPGfree
(
arg
);
return
res
;
return
res
;
}
}
...
...
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