提交 dfb12a98 编写于 作者: M Michael Meskes

Removed multibyte stuff since client does not know about encoding in the...

Removed multibyte stuff since client does not know about encoding in the backendFixed quoting bug reported by Sascha Demetrio (sd@b-comp.de).
上级 4f82ab4c
...@@ -989,5 +989,11 @@ Wed Oct 25 08:53:07 CEST 2000 ...@@ -989,5 +989,11 @@ Wed Oct 25 08:53:07 CEST 2000
Wed Oct 25 21:22:17 CEST 2000 Wed Oct 25 21:22:17 CEST 2000
- Synced gram.y and preproc.y. - Synced gram.y and preproc.y.
Son Oct 29 11:26:06 CET 2000
- Removed multibyte stuff since client does not know about encoding
in the backend.
- Fixed quoting bug reported by Sascha Demetrio (sd@b-comp.de).
- Set ecpg version to 2.8.0. - Set ecpg version to 2.8.0.
- Set library version to 3.2.0. - Set library version to 3.2.0.
...@@ -102,6 +102,7 @@ quote_postgres(char *arg, int lineno) ...@@ -102,6 +102,7 @@ quote_postgres(char *arg, int lineno)
return (res); return (res);
res[ri++] = '\''; res[ri++] = '\'';
for (i = 0; arg[i]; i++, ri++) for (i = 0; arg[i]; i++, ri++)
{ {
switch (arg[i]) switch (arg[i])
...@@ -118,6 +119,7 @@ quote_postgres(char *arg, int lineno) ...@@ -118,6 +119,7 @@ quote_postgres(char *arg, int lineno)
res[ri] = arg[i]; res[ri] = arg[i];
} }
res[ri++] = '\''; res[ri++] = '\'';
res[ri] = '\0'; res[ri] = '\0';
...@@ -247,10 +249,17 @@ next_insert(char *text) ...@@ -247,10 +249,17 @@ next_insert(char *text)
char *ptr = text; char *ptr = text;
bool string = false; bool string = false;
printf("%s\n", text);
for (; *ptr != '\0' && (*ptr != '?' || string); ptr++) for (; *ptr != '\0' && (*ptr != '?' || string); ptr++)
if (*ptr == '\'' && *(ptr - 1) != '\\') {
if (*ptr == '\\') /* escape character */
ptr++;
else
if (*ptr == '\'' )
string = string ? false : true; string = string ? false : true;
}
printf("%s\n", ptr);
return (*ptr == '\0') ? NULL : ptr; return (*ptr == '\0') ? NULL : ptr;
} }
...@@ -704,7 +713,6 @@ ECPGexecute(struct statement * stmt) ...@@ -704,7 +713,6 @@ ECPGexecute(struct statement * stmt)
strcpy(newcopy, copiedquery); strcpy(newcopy, copiedquery);
if ((p = next_insert(newcopy + hostvarl)) == NULL) if ((p = next_insert(newcopy + hostvarl)) == NULL)
{ {
/* /*
* We have an argument but we dont have the matched up string * We have an argument but we dont have the matched up string
* in the string * in the string
...@@ -995,7 +1003,7 @@ ECPGdo(int lineno, const char *connection_name, char *query,...) ...@@ -995,7 +1003,7 @@ ECPGdo(int lineno, const char *connection_name, char *query,...)
* *
* Copyright (c) 2000, Christof Petig <christof.petig@wtal.de> * Copyright (c) 2000, Christof Petig <christof.petig@wtal.de>
* *
* $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/execute.c,v 1.12 2000/10/02 16:15:53 momjian Exp $ * $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/execute.c,v 1.13 2000/10/29 09:44:58 meskes Exp $
*/ */
PGconn *ECPG_internal_get_connection(char *name); PGconn *ECPG_internal_get_connection(char *name);
......
...@@ -11,10 +11,6 @@ ...@@ -11,10 +11,6 @@
#include "extern.h" #include "extern.h"
#ifdef MULTIBYTE
#include "mb/pg_wchar.h"
#endif
/* /*
* Variables containing simple states. * Variables containing simple states.
*/ */
...@@ -838,11 +834,7 @@ VariableSetStmt: SET ColId TO var_value ...@@ -838,11 +834,7 @@ VariableSetStmt: SET ColId TO var_value
} }
| SET NAMES opt_encoding | SET NAMES opt_encoding
{ {
#ifdef MULTIBYTE
$$ = cat2_str(make_str("set names"), $3); $$ = cat2_str(make_str("set names"), $3);
#else
mmerror(ET_ERROR, "SET NAMES is not supported.");
#endif
} }
; ;
...@@ -2252,16 +2244,10 @@ createdb_opt_location: LOCATION '=' StringConst { $$ = cat2_str(make_str("locat ...@@ -2252,16 +2244,10 @@ createdb_opt_location: LOCATION '=' StringConst { $$ = cat2_str(make_str("locat
createdb_opt_encoding: ENCODING '=' PosIntStringConst createdb_opt_encoding: ENCODING '=' PosIntStringConst
{ {
#ifndef MULTIBYTE
mmerror(ET_ERROR, "Multi-byte support is not enabled.");
#endif
$$ = cat2_str(make_str("encoding ="), $3); $$ = cat2_str(make_str("encoding ="), $3);
} }
| ENCODING '=' DEFAULT | ENCODING '=' DEFAULT
{ {
#ifndef MULTIBYTE
mmerror(ET_ERROR, "Multi-byte support is not enabled.");
#endif
$$ = make_str("encoding = default"); $$ = make_str("encoding = default");
} }
| /*EMPTY*/ { $$ = NULL; } | /*EMPTY*/ { $$ = NULL; }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册