fixed polardbx panda index

This commit is contained in:
jianghang.loujh
2025-08-05 14:14:01 +08:00
parent 5607444bad
commit 1e37fe2dee
3 changed files with 31 additions and 3 deletions

View File

@@ -188,8 +188,9 @@ public class LogBuffer {
* <tt>newLimit</tt> do not hold
*/
public final LogBuffer limit(int newLimit) {
if (origin + newLimit > buffer.length || newLimit < 0) throw new IllegalArgumentException("capacity excceed: "
+ (origin + newLimit));
if (origin + newLimit > buffer.length || newLimit < 0) {
throw new IllegalArgumentException("capacity excceed: " + (origin + newLimit));
}
limit = newLimit;
return this;

View File

@@ -187,6 +187,15 @@ public abstract class LogEvent {
/* New MySQL/Sun events are to be added right above this comment */
public static final int MYSQL_EVENTS_END = 49;
// PolarDB-X 2.5.0
// CONSENSUS EVENTS START
public static final int CONSENSUS_LOG_EVENT = 101;
public static final int PREVIOUS_CONSENSUS_INDEX_LOG_EVENT = 102;
public static final int CONSENSUS_CLUSTER_INFO_EVENT = 103;
public static final int CONSENSUS_EMPTY_EVENT = 104;
public static final int GCN_LOG_EVENT = 105;
// CONSENSUS EVENTS END
public static final int MARIA_EVENTS_BEGIN = 160;
/* New Maria event numbers start from here */
public static final int ANNOTATE_ROWS_EVENT = 160;
@@ -229,7 +238,7 @@ public abstract class LogEvent {
public static final int DELETE_ROWS_COMPRESSED_EVENT = 171;
/** end marker */
public static final int ENUM_END_EVENT = 171;
public static final int ENUM_END_EVENT = 172;
/**
* 1 byte length, 1 byte format Length is total length in bytes, including 2
@@ -404,6 +413,16 @@ public abstract class LogEvent {
return "Xa_prepare";
case TRANSACTION_PAYLOAD_EVENT :
return "transaction_payload";
case CONSENSUS_LOG_EVENT:
return "Consensus_log";
case PREVIOUS_CONSENSUS_INDEX_LOG_EVENT:
return "Previous_consensus_index";
case CONSENSUS_CLUSTER_INFO_EVENT:
return "Consensus_cluster_info";
case CONSENSUS_EMPTY_EVENT:
return "Consensus_empty";
case GCN_LOG_EVENT:
return "Gcn_log";
default:
return "Unknown type:" + type;
}

View File

@@ -670,6 +670,8 @@ public class QueryLogEvent extends LogEvent {
public static final int Q_LIZARD_PREPARE_GCN = 201;
public static final int Q_OPT_INDEX_FORMAT_PANDA_ENABLED = 255;
private final void unpackVariables(LogBuffer buffer, final int end) throws IOException {
int code = -1;
try {
@@ -828,6 +830,10 @@ public class QueryLogEvent extends LogEvent {
// prepareGCN = buffer.getLong64();
buffer.forward(8);
break;
case Q_OPT_INDEX_FORMAT_PANDA_ENABLED:
// *start++ = thd->variables.opt_index_format_panda_enabled;
buffer.forward(1);
break;
default:
/*
* That's why you must write status vars in growing
@@ -888,6 +894,8 @@ public class QueryLogEvent extends LogEvent {
return "Q_OPT_FLASHBACK_AREA";
case Q_OPT_INDEX_FORMAT_GPP_ENABLED:
return "Q_OPT_INDEX_FORMAT_GPP_ENABLED";
case Q_OPT_INDEX_FORMAT_PANDA_ENABLED:
return "Q_OPT_INDEX_FORMAT_PANDA_ENABLED";
case Q_HRNOW:
// or Q_WSREP_SKIP_READONLY_CHECKS
return "Q_HRNOW";