mirror of
https://github.com/postgres/postgres.git
synced 2025-04-22 23:02:54 +03:00
Added more SoC changes by Joachim Wieland <joe@mcknight.de>:
- SHOW statement puts result into a variable - COPY TO STDOUT works
This commit is contained in:
parent
67cdc61369
commit
72ba3cb50f
@ -2044,5 +2044,11 @@ Mo Jun 26 16:08:23 CEST 2006
|
|||||||
We Jul 5 12:17:28 CEST 2006
|
We Jul 5 12:17:28 CEST 2006
|
||||||
|
|
||||||
- Fixed remaining Coverity bugs.
|
- Fixed remaining Coverity bugs.
|
||||||
|
|
||||||
|
Fr Jul 28 11:00:51 CEST 2006
|
||||||
|
|
||||||
|
- Added more SoC changes by Joachim Wieland <joe@mcknight.de>:
|
||||||
|
- SHOW statement puts result into a variable
|
||||||
|
- COPY TO STDOUT works
|
||||||
- Set ecpg library version to 5.2.
|
- Set ecpg library version to 5.2.
|
||||||
- Set ecpg version to 4.2.1.
|
- Set ecpg version to 4.2.1.
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/execute.c,v 1.52 2006/07/14 05:28:28 tgl Exp $ */
|
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/execute.c,v 1.53 2006/07/28 09:08:01 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.
|
||||||
@ -1421,9 +1421,29 @@ ECPGexecute(struct statement * stmt)
|
|||||||
status = false;
|
status = false;
|
||||||
break;
|
break;
|
||||||
case PGRES_COPY_OUT:
|
case PGRES_COPY_OUT:
|
||||||
ECPGlog("ECPGexecute line %d: Got PGRES_COPY_OUT ... tossing.\n", stmt->lineno);
|
{
|
||||||
PQendcopy(stmt->connection->connection);
|
char *buffer;
|
||||||
break;
|
int res;
|
||||||
|
ECPGlog("ECPGexecute line %d: Got PGRES_COPY_OUT\n", stmt->lineno);
|
||||||
|
while ((res = PQgetCopyData(stmt->connection->connection,
|
||||||
|
&buffer, 0)) > 0)
|
||||||
|
{
|
||||||
|
printf("%s", buffer);
|
||||||
|
PQfreemem(buffer);
|
||||||
|
}
|
||||||
|
if (res == -1)
|
||||||
|
{
|
||||||
|
/* COPY done */
|
||||||
|
PQclear(results);
|
||||||
|
results = PQgetResult(stmt->connection->connection);
|
||||||
|
if (PQresultStatus(results) == PGRES_COMMAND_OK)
|
||||||
|
ECPGlog("ECPGexecute line %d: Got PGRES_COMMAND_OK after PGRES_COPY_OUT\n", stmt->lineno);
|
||||||
|
else
|
||||||
|
ECPGlog("ECPGexecute line %d: Got error after PGRES_COPY_OUT: %s", PQresultErrorMessage(results));
|
||||||
|
}
|
||||||
|
//PQendcopy(stmt->connection->connection);
|
||||||
|
break;
|
||||||
|
}
|
||||||
case PGRES_COPY_IN:
|
case PGRES_COPY_IN:
|
||||||
ECPGlog("ECPGexecute line %d: Got PGRES_COPY_IN ... tossing.\n", stmt->lineno);
|
ECPGlog("ECPGexecute line %d: Got PGRES_COPY_IN ... tossing.\n", stmt->lineno);
|
||||||
PQendcopy(stmt->connection->connection);
|
PQendcopy(stmt->connection->connection);
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/preproc.y,v 1.325 2006/06/26 14:12:02 meskes Exp $ */
|
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/preproc.y,v 1.326 2006/07/28 09:08:01 meskes Exp $ */
|
||||||
|
|
||||||
/* Copyright comment */
|
/* Copyright comment */
|
||||||
%{
|
%{
|
||||||
@ -1194,16 +1194,16 @@ ColId_or_Sconst: ColId { $$ = $1; }
|
|||||||
| StringConst { $$ = $1; }
|
| StringConst { $$ = $1; }
|
||||||
;
|
;
|
||||||
|
|
||||||
VariableShowStmt: SHOW var_name
|
VariableShowStmt: SHOW var_name ecpg_into
|
||||||
{ $$ = cat2_str(make_str("show"), $2); }
|
{ $$ = cat2_str(make_str("show"), $2); }
|
||||||
| SHOW TIME ZONE
|
| SHOW TIME ZONE ecpg_into
|
||||||
{ $$ = make_str("show time zone"); }
|
{ $$ = make_str("show time zone"); }
|
||||||
| SHOW TRANSACTION ISOLATION LEVEL
|
| SHOW TRANSACTION ISOLATION LEVEL ecpg_into
|
||||||
{ $$ = make_str("show transaction isolation level"); }
|
{ $$ = make_str("show transaction isolation level"); }
|
||||||
| SHOW SESSION AUTHORIZATION
|
| SHOW SESSION AUTHORIZATION ecpg_into
|
||||||
{ $$ = make_str("show session authorization"); }
|
{ $$ = make_str("show session authorization"); }
|
||||||
| SHOW ALL
|
| SHOW ALL
|
||||||
{ $$ = make_str("show all"); }
|
{ mmerror(PARSE_ERROR, ET_ERROR, "SHOW ALL not implemented"); }
|
||||||
;
|
;
|
||||||
|
|
||||||
VariableResetStmt: RESET var_name
|
VariableResetStmt: RESET var_name
|
||||||
|
Loading…
x
Reference in New Issue
Block a user