Aborts a transaction, with a specific error message. * The transaction is always aborted with -EXECABORT so that the client knows * the server exited the multi state, but the actual reason for the abort is * included too. * Note: 'error' may or may not end with \r\n. see addReplyErrorFormat. */
| 148 | * included too. |
| 149 | * Note: 'error' may or may not end with \r\n. see addReplyErrorFormat. */ |
| 150 | void execCommandAbort(client *c, sds error) { |
| 151 | discardTransaction(c); |
| 152 | |
| 153 | if (error[0] == '-') error++; |
| 154 | addReplyErrorFormat(c, "-EXECABORT Transaction discarded because of: %s", error); |
| 155 | |
| 156 | /* Send EXEC to clients waiting data from MONITOR. We did send a MULTI |
| 157 | * already, and didn't send any of the queued commands, now we'll just send |
| 158 | * EXEC so it is clear that the transaction is over. */ |
| 159 | replicationFeedMonitors(c,g_pserver->monitors,c->db->id,c->argv,c->argc); |
| 160 | } |
| 161 | |
| 162 | void execCommand(client *c) { |
| 163 | int j; |
no test coverage detected