Even when running drupal through an account with DBA privileges. When running any SimpleTest tests, any database related tests will fail. Version 7.x-2.0 of SimpleTest was installed. Testing "SimpleTest setUp" will fail with something similar to:
An AJAX HTTP error occurred. HTTP Result Code: 500 Debugging information follows. Path: /vanilla/batch?id=147&op=do StatusText: Internal Server Error ResponseText: Additional uncaught exception thrown while handling exception.OriginalPDOException: SQLSTATE[HY000]: General error: 1031 OCIStmtExecute: ORA-01031: insufficient privileges ORA-06512: at "VANILLA.IDENTIFIER", line 161 ORA-01403: no data found (ext\pdo_oci\oci_statement.c:148) in db_create_table() (line 2685 of J:\Tools\ZendServer\Apache2\htdocs\vanilla\includes\database\database.inc).AdditionalPDOException: SELECT nt.* FROM {node_type} nt WHERE (disabled = :db_condition_placeholder_0) ORDER BY nt.type ASC e: SQLSTATE[HY000]: General error: 1031 OCIStmtExecute: ORA-01031: insufficient privileges ORA-06512: at "VANILLA.IDENTIFIER", line 161 ORA-01403: no data found (ext\pdo_oci\oci_statement.c:148) args: Array ( [:db_condition_placeholder_0] => 0 ) in _node_types_build() (line 703 of J:\Tools\ZendServer\Apache2\htdocs\vanilla\modules\node\node.module).Uncaught exception thrown in session handler.DatabaseTransactionNoActiveException: in DatabaseConnection->rollback() (line 1016 of J:\Tools\ZendServer\Apache2\htdocs\vanilla\includes\database\database.inc).
This is strange as the account has full privileges. Adding some debug code into the check_db_prefix code identifier.plb (raising an error in the exception code block around line 161) as in:
when no_data_found then
raise_application_error(-20001,'User '||v_db_prefix||' does not exist (check_db_prefix)') ;
Produces the error:
An AJAX HTTP error occurred. HTTP Result Code: 500 Debugging information follows. Path: /vanilla/batch?id=148&op=do StatusText: Internal Server Error ResponseText: Additional uncaught exception thrown while handling exception.OriginalPDOException: SQLSTATE[HY000]: General error: 20001 OCIStmtExecute: ORA-20001: User SIMPLETEST526407 does not exist (check_db_prefix) ORA-06512: at "VANILLA.IDENTIFIER", line 160 (ext\pdo_oci\oci_statement.c:148) in db_create_table() (line 2685 of J:\Tools\ZendServer\Apache2\htdocs\vanilla\includes\database\database.inc).AdditionalPDOException: SELECT nt.* FROM {node_type} nt WHERE (disabled = :db_condition_placeholder_0) ORDER BY nt.type ASC e: SQLSTATE[HY000]: General error: 20001 OCIStmtExecute: ORA-20001: User SIMPLETEST526407 does not exist (check_db_prefix) ORA-06512: at "VANILLA.IDENTIFIER", line 160 (ext\pdo_oci\oci_statement.c:148) args: Array ( [:db_condition_placeholder_0] => 0 ) in _node_types_build() (line 703 of J:\Tools\ZendServer\Apache2\htdocs\vanilla\modules\node\node.module).Uncaught exception thrown in session handler.DatabaseTransactionNoActiveException: in DatabaseConnection->rollback() (line 1016 of J:\Tools\ZendServer\Apache2\htdocs\vanilla\includes\database\database.inc).
So a table was being created in account SIMPLETEST526407. The issue is that SimpleTest unit tests generate a randomized table prefix to prevent test collisions. However in this driver, this has been interpreted as an alternate table owner and not a table prefix. This driver will never be compatible with this test suite, because it is impossible to predict which account should be created before running the test. And trying to grant privileges to a non-existant account will not work either.
If you have been able to run SimpleTest 7x-2.0 with this driver can you highlight what database configuration and module setup you have used?
Bob
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | oracle-simpletest-1626658-1.patch | 8.14 KB | twistor |
Comments
Comment #1
twistor commentedThis gets the tests running, but it needs to be cleaned up a bit.
Comment #2
Joe.U.Questionmark commentedGreat! I can't wait to see this added to the next release.
When can we expect this and the other outstanding fixes to make it into a recommended release?
Thanks!
Comment #3
aaaristo commentedI was able to run SimpleTests that comes with the drupal core 7.23 not sure which version of simpletests module those are by using such a user:
drop user drupal7 cascade;
grant connect, resource to drupal7 identified by drupal7 with admin option; -- actually granting privileges to a non existent user creates the user in oracle....
grant dba, create any trigger, drop any table, SELECT ANY table, SELECT ANY sequence, create user to drupal7;
grant execute on dbms_crypto to drupal7;
some privilege may seem redundant but since 11g you will need to give some privileges directly to the user because they are not inherited from the role,
in plsql execute immediate calls.