pudo / dataset

Easy-to-use data handling for SQL data stores with support for implicit table creation, bulk loading, and transactions.
https://dataset.readthedocs.org/
MIT License
4.78k stars 298 forks source link

MySQLdb._exceptions.OperationalError: (1170, "BLOB/TEXT column 'email' used in key specification without a key length") #304

Closed kmkmjhyiiiu closed 4 years ago

kmkmjhyiiiu commented 4 years ago

Hi,

got this error

MySQLdb._exceptions.OperationalError: (1170, "BLOB/TEXT column 'email' used in key specification without a key length")

code

query = dict(email=email, password=password, total_storage=total_storage,
                     used_storage=used_storage, free_storage=free_storage,
                     is_full=is_full)
        return self.pool.upsert(query, ['email'])

pool is the table

is this happening because of mysql version? sorry i don't have strong knowledge of databaset stuff rn :) thanks a lot.

pudo commented 4 years ago

I haven't seen this, either. Is it possible you inserted the password as a binary object, not a string?

pudo commented 4 years ago

I'm closing this because of lack of feedback, reasonably sure that what happened is that the password hash digest function return the hashed password as a bytes object, which then couldn't be usefull inserted into the database.