Reduce the default character limit for VARCHAR columns in MySQL (#16680)

Resolves #13920

Resolves #16678

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
Signed-off-by: Ciprian Pascu <contact@ciprianpascu.ro>
This commit is contained in:
Jacob Laursen 2024-04-27 10:25:46 +02:00 committed by Ciprian Pascu
parent 6cbafb73d3
commit dc06f38754
2 changed files with 7 additions and 2 deletions

View File

@ -56,8 +56,10 @@ public class JdbcMariadbDAO extends JdbcBaseDAO {
*/
private void initSqlTypes() {
logger.debug("JDBC::initSqlTypes: Initialize the type array");
// MariaDB using utf-8 max = 16383, using 16383-128 = 16255
sqlTypes.put("IMAGEITEM", "VARCHAR(16255)");
sqlTypes.put("STRINGITEM", "VARCHAR(16255)"); // MariaDB using utf-8 max = 16383, using 16383-128 = 16255
sqlTypes.put("STRINGITEM", "VARCHAR(16255)");
}
/**

View File

@ -60,7 +60,10 @@ public class JdbcMysqlDAO extends JdbcBaseDAO {
*/
private void initSqlTypes() {
logger.debug("JDBC::initSqlTypes: Initialize the type array");
sqlTypes.put("STRINGITEM", "VARCHAR(21717)");// mysql using utf-8 max 65535/3 = 21845, using 21845-128 = 21717
// MySQL using utf8mb4 max 65535/4 = 16383, using 16383-128 = 16255
sqlTypes.put("IMAGEITEM", "VARCHAR(16255)");
sqlTypes.put("STRINGITEM", "VARCHAR(16255)");
}
/**