Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit72ba3cb

Browse files
author
Michael Meskes
committed
Added more SoC changes by Joachim Wieland <joe@mcknight.de>:
- SHOW statement puts result into a variable- COPY TO STDOUT works
1 parent67cdc61 commit72ba3cb

File tree

3 files changed

+36
-10
lines changed

3 files changed

+36
-10
lines changed

‎src/interfaces/ecpg/ChangeLog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2044,5 +2044,11 @@ Mo Jun 26 16:08:23 CEST 2006
20442044
We Jul 5 12:17:28 CEST 2006
20452045

20462046
- Fixed remaining Coverity bugs.
2047+
2048+
Fr Jul 28 11:00:51 CEST 2006
2049+
2050+
- Added more SoC changes by Joachim Wieland <joe@mcknight.de>:
2051+
- SHOW statement puts result into a variable
2052+
- COPY TO STDOUT works
20472053
- Set ecpg library version to 5.2.
20482054
- Set ecpg version to 4.2.1.

‎src/interfaces/ecpg/ecpglib/execute.c

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/execute.c,v 1.52 2006/07/14 05:28:28 tgl Exp $ */
1+
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/execute.c,v 1.53 2006/07/28 09:08:01 meskes Exp $ */
22

33
/*
44
* The aim is to get a simpler inteface to the database routines.
@@ -1421,9 +1421,29 @@ ECPGexecute(struct statement * stmt)
14211421
status= false;
14221422
break;
14231423
casePGRES_COPY_OUT:
1424-
ECPGlog("ECPGexecute line %d: Got PGRES_COPY_OUT ... tossing.\n",stmt->lineno);
1425-
PQendcopy(stmt->connection->connection);
1426-
break;
1424+
{
1425+
char*buffer;
1426+
intres;
1427+
ECPGlog("ECPGexecute line %d: Got PGRES_COPY_OUT\n",stmt->lineno);
1428+
while ((res=PQgetCopyData(stmt->connection->connection,
1429+
&buffer,0))>0)
1430+
{
1431+
printf("%s",buffer);
1432+
PQfreemem(buffer);
1433+
}
1434+
if (res==-1)
1435+
{
1436+
/* COPY done */
1437+
PQclear(results);
1438+
results=PQgetResult(stmt->connection->connection);
1439+
if (PQresultStatus(results)==PGRES_COMMAND_OK)
1440+
ECPGlog("ECPGexecute line %d: Got PGRES_COMMAND_OK after PGRES_COPY_OUT\n",stmt->lineno);
1441+
else
1442+
ECPGlog("ECPGexecute line %d: Got error after PGRES_COPY_OUT: %s",PQresultErrorMessage(results));
1443+
}
1444+
//PQendcopy(stmt->connection->connection);
1445+
break;
1446+
}
14271447
casePGRES_COPY_IN:
14281448
ECPGlog("ECPGexecute line %d: Got PGRES_COPY_IN ... tossing.\n",stmt->lineno);
14291449
PQendcopy(stmt->connection->connection);

‎src/interfaces/ecpg/preproc/preproc.y

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/preproc.y,v 1.325 2006/06/26 14:12:02 meskes Exp $*/
1+
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/preproc.y,v 1.326 2006/07/28 09:08:01 meskes Exp $*/
22

33
/* Copyright comment*/
44
%{
@@ -1194,16 +1194,16 @@ ColId_or_Sconst: ColId{ $$ = $1; }
11941194
|StringConst{$$ =$1; }
11951195
;
11961196

1197-
VariableShowStmt:SHOWvar_name
1197+
VariableShowStmt:SHOWvar_nameecpg_into
11981198
{$$ = cat2_str(make_str("show"),$2); }
1199-
|SHOWTIMEZONE
1199+
|SHOWTIMEZONEecpg_into
12001200
{$$ = make_str("show time zone"); }
1201-
|SHOWTRANSACTIONISOLATIONLEVEL
1201+
|SHOWTRANSACTIONISOLATIONLEVELecpg_into
12021202
{$$ = make_str("show transaction isolation level"); }
1203-
|SHOWSESSIONAUTHORIZATION
1203+
|SHOWSESSIONAUTHORIZATIONecpg_into
12041204
{$$ = make_str("show session authorization"); }
12051205
|SHOWALL
1206-
{$$ = make_str("show all"); }
1206+
{mmerror(PARSE_ERROR, ET_ERROR,"SHOW ALL not implemented"); }
12071207
;
12081208

12091209
VariableResetStmt:RESETvar_name

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp