comphist / cora

A web-based, token-level annotation tool for non-standard language data
http://www.linguistics.rub.de/comphist/resources/cora/
MIT License
10 stars 6 forks source link

Insufficient permissions for PHP database tests #27

Closed mbollmann closed 7 years ago

mbollmann commented 9 years ago

Originally reported by: Marcel Bollmann (Bitbucket: mbollmann, GitHub: mbollmann)


PHPUnit tests using DB_fixture.php do not work due to insufficient permissions on the coratest.* tables:

PHPUnit_Extensions_Database_Operation_Exception: COMPOSITE[TRUNCATE] operation failed on query: 
                TRUNCATE `tag_suggestion`
             using args: Array
(
)
 [SQLSTATE[42000]: Syntax error or access violation: 1142 DROP command denied to user 'cora'@'localhost' for table 'tag_suggestion']

I believe this is a result of PHPUnit trying to recreate the provided XML dataset tests/DB_fixture.php:39 in the database, since

  1. it uses getConnection() for that, which returns a connection with the cora user; and
  2. the exception happens at the parent::setUp() call for each and every test case that uses DB_fixture.php.

I believe this went unnoticed for a very long time because we used to grant "all" privileges to cora for coratest.*, and these permissions were still stored on all development machines after the change was made.


mbollmann commented 9 years ago

Original comment by Marcel Bollmann (Bitbucket: mbollmann, GitHub: mbollmann):


Restore coratest privileges (fix #24)