ecpg generates illegal code, patch included - Mailing list pgsql-bugs

From Christof Petig
Subject ecpg generates illegal code, patch included
Date
Msg-id 37B1373D.AFDC6F07@wtal.de
Whole thread Raw
List pgsql-bugs
Hello,

under admittedly strange conditions:
- connecting to default database
- disconnecting via 'exec sql commit work release'
ecpg generates wrong code.

The included patch cures this.

Best regards
    Christof

--- /home/christof/pgsql-cvs/pgsql/src/interfaces/ecpg/preproc/preproc.y    Mon Aug  2 11:14:41 1999
+++ preproc.y    Wed Aug 11 08:22:01 1999
@@ -4992,9 +4992,9 @@
         if (strncmp($1, "begin", 5) == 0)
                         yyerror("RELEASE does not make sense when beginning a transaction");

-        fprintf(yyout, "ECPGtrans(__LINE__, %s, \"%s\");", connection, $1);
+        fprintf(yyout, "ECPGtrans(__LINE__, %s, \"%s\");", connection ? connection : "NULL", $1);
         whenever_action(0);
-        fprintf(yyout, "ECPGdisconnect(\"\");");
+        fprintf(yyout, "ECPGdisconnect(__LINE__, \"\");");
         whenever_action(0);
         free($1);
     }

pgsql-bugs by date:

Previous
From: Michael Richards
Date:
Subject: View oddness...
Next
From: Christof Petig
Date:
Subject: int2 unique index malfunction (btree corrupt)