提交 453fb837 编写于 作者: B BohuTANG

ISSUES-14235 change string.rfind to stringstarts_with

上级 49095e81
......@@ -103,17 +103,17 @@ namespace MySQLReplication
= header.event_size - EVENT_HEADER_LENGTH - 4 - 4 - 1 - 2 - 2 - status_len - schema_len - 1 - CHECKSUM_CRC32_SIGNATURE_LENGTH;
query.resize(len);
payload.readStrict(reinterpret_cast<char *>(query.data()), len);
if (query.rfind("BEGIN", 0) == 0 || query.rfind("COMMIT") == 0)
if (query.starts_with("BEGIN") || query.starts_with("COMMIT"))
{
typ = QUERY_EVENT_MULTI_TXN_FLAG;
}
else if (query.rfind("XA", 0) == 0)
else if (query.starts_with("XA"))
{
if (query.rfind("XA ROLLBACK", 0) == 0)
if (query.starts_with("XA ROLLBACK"))
throw ReplicationError("ParseQueryEvent: Unsupported query event:" + query, ErrorCodes::UNKNOWN_EXCEPTION);
typ = QUERY_EVENT_XA;
}
else if (query.rfind("SAVEPOINT", 0) == 0)
else if (query.starts_with("SAVEPOINT"))
{
throw ReplicationError("ParseQueryEvent: Unsupported query event:" + query, ErrorCodes::UNKNOWN_EXCEPTION);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册