leondz / cavat

Automatically exported from code.google.com/p/cavat
3 stars 1 forks source link

Can't write to / create default db #65

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
If prefix is (e.g.) timebank, we can't create a timebank database:

cavat> corpus import timebank from /home/leon/timebank/data/timeml/
['corpus', 'import', 'timebank', 'from', '/home/leon/timebank/data/timeml/']
- action: corpus
- database: timebank
- directory: /home/leon/timebank/data/timeml/
- import_: import
===============================================================
Reading from /home/leon/timebank/data/timeml/
Writing to DB timebank
===============================================================
! (1044, "Access denied for user 'timebank'@'localhost' to database 'timebank'")
! Could not switch to database timebank_timebank
cavat> 

This is because the regex for db perms expects something after the prefix, but 
cavat tries to create a database named "dbprefix" instead of 
"dbprefix_dbsuffix" if dbprefix == dbsuffix.

Possible solution: stop special handling of the case "dbprefix == dbsuffix", so 
that if dbprefix is "timebank", corpus import timebank from /path/ creates a db 
called timebank_timebank.

Original issue reported on code.google.com by leo...@gmail.com on 21 Sep 2010 at 3:08