else if (strnicmp(cmdbuffer, "COMMIT", 6) == 0)
CC_on_commit(self);
else if (strnicmp(cmdbuffer, "ROLLBACK", 8) == 0)
- CC_on_abort(self, NO_TRANS);
+ {
+ /*
+ The method of ROLLBACK an original form ....
+ ROLLBACK [ WORK | TRANSACTION ] TO [ SAVEPOINT ] savepoint_name
+ */
+ if (PG_VERSION_LT(self, 8.0) || !(contains_token(query, " TO ")))
+ CC_on_abort(self, NO_TRANS);
+ }
else if (strnicmp(cmdbuffer, "END", 3) == 0)
CC_on_commit(self);
else if (strnicmp(cmdbuffer, "ABORT", 5) == 0)
else if (strnicmp(cmdbuffer, "COMMIT", 6) == 0)
CC_on_commit(self);
else if (strnicmp(cmdbuffer, "ROLLBACK", 8) == 0)
- CC_on_abort(self, NO_TRANS);
+ {
+ /*
+ The method of ROLLBACK an original form ....
+ ROLLBACK [ WORK | TRANSACTION ] TO [ SAVEPOINT ] savepoint_name
+ */
+ if (PG_VERSION_LT(self, 8.0) || !(contains_token(query, " TO ")))
+ CC_on_abort(self, NO_TRANS);
+ }
else if (strnicmp(cmdbuffer, "END", 3) == 0)
CC_on_commit(self);
else if (strnicmp(cmdbuffer, "ABORT", 5) == 0)
#endif
-void remove_newlines(char *string);
-char *strncpy_null(char *dst, const char *src, int len);
-char *trim(char *string);
-char *make_string(const char *s, int len, char *buf, size_t bufsize);
-char *make_lstring_ifneeded(ConnectionClass *, const char *s, int len, BOOL);
-char *my_strcat(char *buf, const char *fmt, const char *s, int len);
-char *schema_strcat(char *buf, const char *fmt, const char *s, int len,
+void remove_newlines(char *string);
+char *strncpy_null(char *dst, const char *src, int len);
+char *trim(char *string);
+char *make_string(const char *s, int len, char *buf, size_t bufsize);
+char *make_lstring_ifneeded(ConnectionClass *, const char *s, int len, BOOL);
+char *my_strcat(char *buf, const char *fmt, const char *s, int len);
+char *schema_strcat(char *buf, const char *fmt, const char *s, int len,
const char *, int, ConnectionClass *conn);
-char *my_strcat1(char *buf, const char *fmt, const char *s1, const char *s, int len);
-char *schema_strcat1(char *buf, const char *fmt, const char *s1,
+char *my_strcat1(char *buf, const char *fmt, const char *s1, const char *s, int len);
+char *schema_strcat1(char *buf, const char *fmt, const char *s1,
const char *s, int len,
const char *, int, ConnectionClass *conn);
/* #define GET_SCHEMA_NAME(nspname) (stricmp(nspname, "public") ? nspname : "") */
#define STRCPY_TRUNCATED (-1)
#define STRCPY_NULL (-2)
-int my_strcpy(char *dst, int dst_len, const char *src, int src_len);
-\r
-/* Define a type for defining a constant string expression */\r
-#define CSTR static const char * const\r
+int my_strcpy(char *dst, int dst_len, const char *src, int src_len);
+int contains_token(char *data, char *token);
+
+/* Define a type for defining a constant string expression */
+#define CSTR static const char * const
#endif