Bookworm-project / BookwormDB

Tools for text tokenization and encoding
MIT License
84 stars 12 forks source link

Integrity check on database names. #84

Open bmschmidt opened 8 years ago

bmschmidt commented 8 years ago

Currently an error can be thrown like this:

 File "/usr/lib/python2.7/dist-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
    raise errorclass, errorvalue
_mysql_exceptions.ProgrammingError: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-bookworm' at line 1")

The cause is a bookworm with a name like metadata-bookworm. Dashes are not allowed in bookworm names. There should be code upon loading a bookworm.cnf file that makes sure the name matches the regex ^[\w\d_]+$. (Or is it ^\w[\w\d_]+$?)