|
74 | 74 | import java.util.Collections;
|
75 | 75 | import java.util.LinkedList;
|
76 | 76 | import java.util.List;
|
77 |
| -import java.util.Locale; |
78 | 77 | import java.util.concurrent.Callable;
|
79 | 78 | import java.util.concurrent.CopyOnWriteArrayList;
|
80 | 79 | import java.util.concurrent.CountDownLatch;
|
@@ -177,6 +176,7 @@ public X509Certificate[] getAcceptedIssuers() {
|
177 | 176 |
|
178 | 177 |
|
179 | 178 | private Boolean isMariaDB;
|
| 179 | + private int mariaDbSlaveCapability = 4; |
180 | 180 |
|
181 | 181 | /**
|
182 | 182 | * Alias for BinaryLogClient("localhost", 3306, <no schema> = null, username, password).
|
@@ -537,6 +537,23 @@ public boolean isUseSendAnnotateRowsEvent() {
|
537 | 537 | public void setUseSendAnnotateRowsEvent(boolean useSendAnnotateRowsEvent) {
|
538 | 538 | this.useSendAnnotateRowsEvent = useSendAnnotateRowsEvent;
|
539 | 539 | }
|
| 540 | + |
| 541 | + /** |
| 542 | + * @return the configured MariaDB slave compatibility level, defaults to 4. |
| 543 | + */ |
| 544 | + public int getMariaDbSlaveCapability() { |
| 545 | + return mariaDbSlaveCapability; |
| 546 | + } |
| 547 | + |
| 548 | + /** |
| 549 | + * Set the client's MariaDB slave compatibility level. This only applies when connecting to MariaDB. |
| 550 | + * |
| 551 | + * @param mariaDbSlaveCapability the expected compatibility level |
| 552 | + */ |
| 553 | + public void setMariaDbSlaveCapability(int mariaDbSlaveCapability) { |
| 554 | + this.mariaDbSlaveCapability = mariaDbSlaveCapability; |
| 555 | + } |
| 556 | + |
540 | 557 | /**
|
541 | 558 | * Connect to the replication stream. Note that this method blocks until disconnected.
|
542 | 559 | * @throws AuthenticationException if authentication fails
|
@@ -792,7 +809,7 @@ protected void requestBinaryLogStreamMaria(long serverId) throws IOException {
|
792 | 809 | /*
|
793 | 810 | https://jira.mariadb.org/browse/MDEV-225
|
794 | 811 | */
|
795 |
| - channel.write(new QueryCommand("SET @mariadb_slave_capability=4")); |
| 812 | + channel.write(new QueryCommand("SET @mariadb_slave_capability=" + mariaDbSlaveCapability)); |
796 | 813 | checkError(channel.read());
|
797 | 814 |
|
798 | 815 | synchronized (gtidSetAccessLock) {
|
|
0 commit comments