@@ -72,22 +72,25 @@ public String nodeString() {
7272 }
7373
7474 void serializeCaseInsensitivity (StreamOutput out ) throws IOException {
75- if (out .getTransportVersion ().before (TransportVersions .ESQL_REGEX_MATCH_WITH_CASE_INSENSITIVITY )) {
76- if (caseInsensitive ()) {
77- // The plan has been optimized to run a case-insensitive match, which the remote peer cannot be notified of. Simply avoiding
78- // the serialization of the boolean would result in wrong results.
79- throw new EsqlIllegalArgumentException (
80- name () + " with case insensitivity is not supported in peer node's version [{}]. Upgrade to version [{}] or newer." ,
81- out .getTransportVersion (),
82- TransportVersions .ESQL_REGEX_MATCH_WITH_CASE_INSENSITIVITY
83- );
84- } // else: write nothing, the remote peer can execute the case-sensitive query
85- } else {
75+ var transportVersion = out .getTransportVersion ();
76+ if (transportVersion .onOrAfter (TransportVersions .ESQL_REGEX_MATCH_WITH_CASE_INSENSITIVITY )
77+ || transportVersion .isPatchFrom (TransportVersions .ESQL_REGEX_MATCH_WITH_CASE_INSENSITIVITY_8_19 )) {
8678 out .writeBoolean (caseInsensitive ());
87- }
79+ } else if (caseInsensitive ()) {
80+ // The plan has been optimized to run a case-insensitive match, which the remote peer cannot be notified of. Simply avoiding
81+ // the serialization of the boolean would result in wrong results.
82+ throw new EsqlIllegalArgumentException (
83+ name () + " with case insensitivity is not supported in peer node's version [{}]. Upgrade to version [{}, {}] or newer." ,
84+ transportVersion ,
85+ TransportVersions .ESQL_REGEX_MATCH_WITH_CASE_INSENSITIVITY_8_19 ,
86+ TransportVersions .ESQL_REGEX_MATCH_WITH_CASE_INSENSITIVITY
87+ );
88+ } // else: write nothing, the remote peer can execute the case-sensitive query
8889 }
8990
9091 static boolean deserializeCaseInsensitivity (StreamInput in ) throws IOException {
91- return in .getTransportVersion ().onOrAfter (TransportVersions .ESQL_REGEX_MATCH_WITH_CASE_INSENSITIVITY ) && in .readBoolean ();
92+ var transportVersion = in .getTransportVersion ();
93+ return (transportVersion .onOrAfter (TransportVersions .ESQL_REGEX_MATCH_WITH_CASE_INSENSITIVITY )
94+ || transportVersion .isPatchFrom (TransportVersions .ESQL_REGEX_MATCH_WITH_CASE_INSENSITIVITY_8_19 )) && in .readBoolean ();
9295 }
9396}
0 commit comments