mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-02-04 11:24:10 +01:00
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:
parent
6cbafb73d3
commit
dc06f38754
@ -56,8 +56,10 @@ public class JdbcMariadbDAO extends JdbcBaseDAO {
|
|||||||
*/
|
*/
|
||||||
private void initSqlTypes() {
|
private void initSqlTypes() {
|
||||||
logger.debug("JDBC::initSqlTypes: Initialize the type array");
|
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("IMAGEITEM", "VARCHAR(16255)");
|
||||||
sqlTypes.put("STRINGITEM", "VARCHAR(16255)"); // MariaDB using utf-8 max = 16383, using 16383-128 = 16255
|
sqlTypes.put("STRINGITEM", "VARCHAR(16255)");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -60,7 +60,10 @@ public class JdbcMysqlDAO extends JdbcBaseDAO {
|
|||||||
*/
|
*/
|
||||||
private void initSqlTypes() {
|
private void initSqlTypes() {
|
||||||
logger.debug("JDBC::initSqlTypes: Initialize the type array");
|
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)");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user