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. */
| 145 | * included too. |
| 146 | * Note: 'error' may or may not end with \r\n. see addReplyErrorFormat. */ |
| 147 | void execCommandAbort(client *c, sds error) { |
| 148 | discardTransaction(c); |
| 149 | |
| 150 | if (error[0] == '-') error++; |
| 151 | addReplyErrorFormat(c, "-EXECABORT Transaction discarded because of: %s", error); |
| 152 | |
| 153 | /* Send EXEC to clients waiting data from MONITOR. We did send a MULTI |
| 154 | * already, and didn't send any of the queued commands, now we'll just send |
| 155 | * EXEC so it is clear that the transaction is over. */ |
| 156 | replicationFeedMonitors(c,server.monitors,c->db->id,c->argv,c->argc); |
| 157 | } |
| 158 | |
| 159 | void execCommand(client *c) { |
| 160 | int j; |
no test coverage detected