From: Michael Meskes Date: Sat, 17 Mar 2018 16:24:32 +0000 (+0100) Subject: Fix closing of incorrectly named cursor. X-Git-Tag: REL_11_BETA1~575 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e400840b1d92cb6a654c30a6aca68ba31eb8afbb;p=postgresql Fix closing of incorrectly named cursor. Patch by "Shinoda, Noriyoshi" --- diff --git a/src/interfaces/ecpg/test/compat_oracle/char_array.pgc b/src/interfaces/ecpg/test/compat_oracle/char_array.pgc index 5b5d0bb37b..8c33b18b7c 100644 --- a/src/interfaces/ecpg/test/compat_oracle/char_array.pgc +++ b/src/interfaces/ecpg/test/compat_oracle/char_array.pgc @@ -51,7 +51,7 @@ int main() { printf("\"%s\": \"%s\" %d\n", bigstr, shortstr, shstr_ind); } - EXEC SQL close cstr; + EXEC SQL CLOSE C; EXEC SQL DROP TABLE strdbase; printf("\nGOOD-BYE!!\n\n"); diff --git a/src/interfaces/ecpg/test/expected/compat_oracle-char_array.c b/src/interfaces/ecpg/test/expected/compat_oracle-char_array.c index a72736f673..c2ef09e354 100644 --- a/src/interfaces/ecpg/test/expected/compat_oracle-char_array.c +++ b/src/interfaces/ecpg/test/expected/compat_oracle-char_array.c @@ -178,7 +178,7 @@ if (sqlca.sqlcode < 0) sqlprint();} printf("\"%s\": \"%s\" %d\n", bigstr, shortstr, shstr_ind); } - { ECPGdo(__LINE__, 3, 1, NULL, 0, ECPGst_normal, "close cstr", ECPGt_EOIT, ECPGt_EORT); + { ECPGdo(__LINE__, 3, 1, NULL, 0, ECPGst_normal, "close C", ECPGt_EOIT, ECPGt_EORT); #line 54 "char_array.pgc" if (sqlca.sqlwarn[0] == 'W') warn ( ); @@ -186,7 +186,7 @@ if (sqlca.sqlwarn[0] == 'W') warn ( ); if (sqlca.sqlcode < 0) sqlprint();} #line 54 "char_array.pgc" - + { ECPGdo(__LINE__, 3, 1, NULL, 0, ECPGst_normal, "drop table strdbase", ECPGt_EOIT, ECPGt_EORT); #line 55 "char_array.pgc" diff --git a/src/interfaces/ecpg/test/expected/compat_oracle-char_array.stderr b/src/interfaces/ecpg/test/expected/compat_oracle-char_array.stderr index 01766b6341..40d9f7ddb0 100644 --- a/src/interfaces/ecpg/test/expected/compat_oracle-char_array.stderr +++ b/src/interfaces/ecpg/test/expected/compat_oracle-char_array.stderr @@ -121,24 +121,18 @@ Warning: At least one column was truncated [NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: raising sqlcode 100 on line 50: no data found on line 50 [NO_PID]: sqlca: code: 100, state: 02000 -[NO_PID]: ecpg_execute on line 54: query: close cstr; with 0 parameter(s) on connection ecpg1_regression +[NO_PID]: ecpg_execute on line 54: query: close C; with 0 parameter(s) on connection ecpg1_regression [NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: ecpg_execute on line 54: using PQexec [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ecpg_check_PQresult on line 54: bad response - ERROR: cursor "cstr" does not exist +[NO_PID]: ecpg_process_output on line 54: OK: CLOSE CURSOR [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: raising sqlstate 34000 (sqlcode -400): cursor "cstr" does not exist on line 54 -[NO_PID]: sqlca: code: -400, state: 34000 -SQL error: cursor "cstr" does not exist on line 54 [NO_PID]: ecpg_execute on line 55: query: drop table strdbase; with 0 parameter(s) on connection ecpg1_regression [NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: ecpg_execute on line 55: using PQexec [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ecpg_check_PQresult on line 55: bad response - ERROR: current transaction is aborted, commands ignored until end of transaction block +[NO_PID]: ecpg_process_output on line 55: OK: DROP TABLE [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: raising sqlstate 25P02 (sqlcode -400): current transaction is aborted, commands ignored until end of transaction block on line 55 -[NO_PID]: sqlca: code: -400, state: 25P02 -SQL error: current transaction is aborted, commands ignored until end of transaction block on line 55 [NO_PID]: ECPGtrans on line 59: action "commit work"; connection "ecpg1_regression" [NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: ecpg_finish: connection ecpg1_regression closed