Use VARCHAR for string fields up to 65535 characters maximum length.

[GB.DB.MYSQL]
* BUG: Use VARCHAR for string fields up to 65535 characters maximum length.
This commit is contained in:
Benoît Minisini 2022-08-07 20:36:35 +02:00
parent bd52d1aff3
commit fda74fceaf

View file

@ -1952,7 +1952,7 @@ static int table_create(DB_DATABASE *db, const char *table, DB_FIELD *fields, ch
case GB_T_DATE: type = "DATETIME"; break; case GB_T_DATE: type = "DATETIME"; break;
case GB_T_STRING: case GB_T_STRING:
if (fp->length <= 0 || fp->length > 255) //mysql supports upto 255 as varchar if (fp->length <= 0 || fp->length > 65535)
type = "MEDIUMTEXT"; type = "MEDIUMTEXT";
else else
{ {