On 30.09.2024 09:03, 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
> ...

uft8mb4 is simply proper UTF-8; so each ASCII character will take
exactly one byte, and other character 2..4. So it's not as simple as that...

Best regards, Julian


Reply via email to