I'm using MariaDB MEMORY engine. I defined max_heap_table_size in my.cnf, restarted the database service. Now, I run the migration and get:
django.db.utils.ProgrammingError: Storage engine MEMORY doesn't support BLOB/TEXT columns
My erroneous model is:
class Department(models.Model):
name = models.CharField(max_length=100)
tag = models.CharField(max_length=10)
dtype = models.PositiveSmallIntegerField()
info = models.CharField(max_length=64000)
Though, max VARCHAR is 65535.What is the problem?
As the docs state here,
65.535are actually bytes, which leads to a maximum of 21.844 characters if usingUTF-8.Since the
max_lengthof aCharFieldin a Django model specifies the length in characters rather than in bytes, I assume this is what causes the error.