Changeset: 49830fe6d82f for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/49830fe6d82f
Modified Files:
sql/backends/monet5/sql_scenario.c
Branch: default
Log Message:
Add upcoming-error field to &4 responses
If this field is 't', it means that this
&4 response and the error that will follow
immediately after it are both responses to the
same SQL statement.
Note: as far as I know, all current client libraries
just ignore the additional field so it's safe to send it.
See #7988
diffs (14 lines):
diff --git a/sql/backends/monet5/sql_scenario.c
b/sql/backends/monet5/sql_scenario.c
--- a/sql/backends/monet5/sql_scenario.c
+++ b/sql/backends/monet5/sql_scenario.c
@@ -1782,7 +1782,9 @@ SQLengine_(Client c)
bool post_autocommit = be->mvc->session->auto_commit;
if (pre_autocommit != post_autocommit && be->out != NULL) {
/* Notify client of change in auto commit mode */
- int n = mnstr_printf(be->out, "&4 %s\n",
post_autocommit ? "t" : "f");
+ char autocommit_flag = post_autocommit ? 't' : 'f';
+ char error_message_follows_flag = (msg != NULL) ? 't' :
'f';
+ int n = mnstr_printf(be->out, "&4 %c %c\n",
autocommit_flag, error_message_follows_flag);
if (n < 0 && msg == NULL)
msg = createException(SQL, "SQLparser",
SQLSTATE(HY002) "Error while sending autocommit notification: %s\n",
mnstr_peek_error(be->out));
}
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]