Hello together,

While porting my TPC-C implementation from Oracle, I discovered the
attached problem with the EXEC SQL COMMIT RELEASE statement.

Bye,
Roland

============================================================================
                        POSTGRESQL BUG REPORT TEMPLATE
============================================================================


Your name               :       Roland Karch
Your email address      :       [EMAIL PROTECTED]


System Configuration
---------------------
  Architecture (example: Intel Pentium)         : Intel Pentium

  Operating System (example: Linux 2.0.26 ELF)  : Linux 2.4.19

  PostgreSQL version (example: PostgreSQL-7.3):   PostgreSQL-7.3

  Compiler used (example:  gcc 2.95.2)          : gcc 2.95.4


Please enter a FULL description of your problem:
------------------------------------------------
The Embedded SQL parser ecpg produces corrupt code for the statement
COMMIT RELEASE;
It results in the error code -220 - no such connection.





Please describe a way to repeat the problem.   Please try to provide a
concise reproducible example, if at all possible: 
----------------------------------------------------------------------
Source code tst.pc:

---
EXEC SQL INCLUDE sqlca;

int
main(int argc, char** argv) {
        EXEC SQL CONNECT TO test USER test IDENTIFIED BY test;
        EXEC SQL COMMIT RELEASE;
        EXEC SQL DISCONNECT;
}
---

This results in this C file (excerpt):

---
int
main(int argc, char** argv) {
        { ECPGconnect(__LINE__, "test" , "test" , "test" , NULL, 0); }
#line 5 "tst.pc"

        ECPGtrans(__LINE__, NULL, "commit");
#line 6 "tst.pc"
ECPGdisconnect(__LINE__, "");
#line 6 "tst.pc"

        { ECPGdisconnect(__LINE__, "CURRENT");}
#line 7 "tst.pc"

}





If you know how this problem might be fixed, list the solution below:
---------------------------------------------------------------------
Maybe the following patch helps - unfortunately, I wasn't able to get bison to
run with your makefile in my environment, so it is totally untested:

--- postgresql-7.3/src/interfaces/ecpg/preproc/preproc.y.orig   Fri Nov  1 23:52:33 
2002
+++ postgresql-7.3/src/interfaces/ecpg/preproc/preproc.y        Mon Dec  9 17:41:30 
+2002
@@ -4709,7 +4709,9 @@
                        fprintf(yyout, "ECPGtrans(__LINE__, %s, \"%s\");",
                                        connection ? connection : "NULL", $1);
                        whenever_action(0);
-                       fprintf(yyout, "ECPGdisconnect(__LINE__, \"\");");
+                       fprintf(yyout, "ECPGdisconnect(__LINE__, \"%s\");",
+                                       connection ?
+                                               connection : "\"CURRENT\"");
                        whenever_action(0);
                        free($1);
                }
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL PROTECTED] so that your
message can get through to the mailing list cleanly

Reply via email to