Added SQLSTATE macro closing bug #3961.
EXECUTE can return NOT FOUND so it should be checked here too.
- Fixed segfault in ecpg when using an array element.
- Free all memory in auto-prepare mode.
+Thu, 14 Feb 2008 13:11:34 +0100
+
+ - Added SQLSTATE macro closing bug #3961.
+ - EXECUTE can return NOT FOUND so it should be checked here too.
+ - Changed regression test accordingly.
+
+Fri, 15 Feb 2008 12:01:13 +0100
+
+ - Changed the way symbols are defined in C in INFORMIX mode.
#include <ecpg_informix.h>
-typedef timestamp dtime_t;
-typedef interval intrvl_t;
+/* brought in by ecpg_informix.h nowadays
+ * typedef timestamp dtime_t;
+ * typedef interval intrvl_t; */
#endif /* ndef _ECPG_DATETIME_H */
#include <ecpg_informix.h>
-typedef decimal dec_t;
+/* brought in by ecpg_informix.h nowadays
+ * typedef decimal dec_t; */
#endif /* ndef _ECPG_DECIMAL_H */
extern int intoasc(interval *, char *);
extern int dtcvfmtasc(char *, char *, timestamp *);
+/* we also define Informix datatypes here */
+typedef timestamp dtime_t;
+typedef interval intrvl_t;
+typedef decimal dec_t;
+
#ifdef __cplusplus
}
#endif
/* define this for simplicity as well as compatibility */
-#define SQLCODE sqlca.sqlcode
+#define SQLCODE sqlca.sqlcode
+#define SQLSTATE sqlca.sqlstate
/* dynamic SQL */
static void parse_include (void);
static bool ecpg_isspace(char ch);
static bool isdefine(void);
-static bool isinformixdefine(void);
char *token_start;
int state_before;
<C>{identifier} {
const ScanKeyword *keyword;
- /* Informix uses SQL defines only in SQL space */
- /* however, some defines have to be taken care of for compatibility */
- if ((!INFORMIX_MODE || !isinformixdefine()) && !isdefine())
+<<<<<<< pgc.l
+ if (!INFORMIX_MODE && !isdefine())
+=======
+ if (!isdefine())
+>>>>>>> 1.162
{
keyword = ScanCKeywordLookup(yytext);
if (keyword != NULL)
return false;
}
-static bool isinformixdefine(void)
-{
- const char *new = NULL;
-
- if (strcmp(yytext, "dec_t") == 0)
- new = "decimal";
- else if (strcmp(yytext, "intrvl_t") == 0)
- new = "interval";
- else if (strcmp(yytext, "dtime_t") == 0)
- new = "timestamp";
-
- if (new)
- {
- struct _yy_buffer *yb;
-
- yb = mm_alloc(sizeof(struct _yy_buffer));
-
- yb->buffer = YY_CURRENT_BUFFER;
- yb->lineno = yylineno;
- yb->filename = mm_strdup(input_filename);
- yb->next = yy_buffer;
- yy_buffer = yb;
-
- yy_scan_string(new);
- return true;
- }
-
- return false;
-}
-
/*
* Called before any actual parsing is done
*/
| DropUserStmt { output_statement($1, 0, ECPGst_normal); }
| DropdbStmt { output_statement($1, 0, ECPGst_normal); }
| ExplainStmt { output_statement($1, 0, ECPGst_normal); }
- | ExecuteStmt { output_statement($1, 0, ECPGst_execute); }
+ | ExecuteStmt { output_statement($1, 1, ECPGst_execute); }
| FetchStmt { output_statement($1, 1, ECPGst_normal); }
| GrantStmt { output_statement($1, 0, ECPGst_normal); }
| GrantRoleStmt { output_statement($1, 0, ECPGst_normal); }