On 2024/09/30 07:03:06 Raffaele Gambelli wrote:
In RDBDocumentStoreDB:

public String getTableCreationStatement(String tableName, int schema) {
       return "create table " + tableName
               + " (ID varchar(512) not null primary key, MODIFIED bigint, HASBINARY 
smallint, DELETEDONCE smallint, MODCOUNT bigint, CMODCOUNT bigint, DSIZE bigint, "
               + (schema >= 1 ? "VERSION smallint, " : "")
               + (schema >= 2 ? "SDTYPE smallint, SDMAXREVTIME bigint, " : "")
               + "DATA varchar(16384), BDATA blob(" + 1024 * 1024 * 1024 + "))";

But using utf8mb4 that DATA becomes 16384 * 4 = 65536, in mariadb the varchar 
max is 65,532. The effective maximum length of a VARCHAR is subject to the 
maximum row size and the character set used

MySql behaves the same so I can't understand the suggestion in using utf8mb4 
given that create table statement, could you explain please?

Thanks
I believe I understand what's going on. See


https://github.com/apache/jackrabbit-oak/blob/0d87cec6b5beb0383069c5cdf9abf9914f3d7e60/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/rdb/RDBDocumentStoreDB.java#L407-L415

So for MySQL, we indeed user a smaller DATA column.

Potential fixes would be:

1. Make the DB detection code handle MariaDB as equivalent to MySQL, or
2. Create a new type in RDBDocumentStoreDB specifically for MariaDB.

If you're still interested in MariaDB support and want to give it a try,
please open a JIRA issue and optimally send a PR.

Best regards, Julian

Reply via email to