pallets-eco / flask-session

Server side session extension for Flask
https://flask-session.readthedocs.io
BSD 3-Clause "New" or "Revised" License
507 stars 238 forks source link

Varchar prefix may cause problems when using MySQL with unicode. #13

Closed Junzki closed 1 year ago

Junzki commented 9 years ago

The character limit depends on the character set. For example if you use latin1 then the largest column you can index is varchar(767), but if you use utf8 then the limit is varchar(255).

In sessions.py, the attribute session_id of class SqlAlchemySessionInterface is set to 256, however, when my database collection is set to utf8, it may cause a problen like this:

 1071, 'Specified key was too long; max key length is 767 bytes'  

And I change it to 255, the problem is solved.

christopherpickering commented 2 years ago

@Junzki looks like this was fixed in a different pr.