This is exactly the same as commit
60904f86 ("BUG/MINOR: pattern: do
not index too large strings using the tree") but for pat_idx_tree_pfx()
this time: we need to limit the length of indexed prefixes with trees
to 4095 bytes, the other ones need to use the list.
This needs to be backported to all versions.
/* Process the key len */
len = pat->len;
+ /* If the string is longer than what ebtrees may index (32767 bits) we
+ * cannot use trees.
+ */
+ if (len >= 4095)
+ return pat_idx_list_str(expr, pat, err);
+
/* node memory allocation */
node = calloc(1, sizeof(*node) + len + 1);
if (!node) {