Identifier.pls is missing single quotes on constant identifier_max_length.
Correct line should be:
identifier_max_length constant number:= '<?php print ORACLE_IDENTIFIER_MAX_LENGTH; ?>';
There is an assumption in identifier.plb that the drupal account has database admin privileges; if there is no user that matches the prefix, then it will try and grant connect and resource to the user. The prefix should only be interpreted as an account if it is not null, and it contains an '.'. A better rewrite for function check_db_prefix should be:
function check_db_prefix(p_db_prefix varchar2)
return varchar2
as pragma autonomous_transaction;
v_db_prefix varchar2(30):= upper(get_for(p_db_prefix));
begin
if(v_db_prefix is not null and instrc(p_db_prefix,'.') > 0) then
select username
into v_db_prefix
from all_users
where username= v_db_prefix;
end if ;
return v_db_prefix;
exception
when no_data_found then
raise_application_error(-20001,'User '||v_db_prefix||' does not exist') ;
/* execute immediate 'grant connect, resource to "'||v_db_prefix||'" identified by "'||v_db_prefix||'"';
* return v_db_prefix;
*/
end;
Full corrected versions of identifier.pls and identifier.plb are included as attachments.
Comment | File | Size | Author |
---|---|---|---|
#1 | 1603154-fix-identifier-package.patch | 1.53 KB | brianV |
identifier.zip | 2.28 KB | BobA |
Comments
Comment #0.0
BobA CreditAttribution: BobA commentedwebsite misinterpreting string constant.
Comment #0.1
BobA CreditAttribution: BobA commentedminor text change
Comment #0.2
brianV CreditAttribution: brianV commentedfix code formatting
Comment #1
brianV CreditAttribution: brianV commentedPatch attached which implements the above fix.
Comment #2
aaaristo CreditAttribution: aaaristo commentedbrian:
1. ORACLE_IDENTIFIER_MAX_LENGTH is a number so it does not need single quotes, better: you SHOULD not use single quotes.
2. p_db_prefix SHOULD not contain a dot '.' so i cannot see how these helps
3. i don't want to raise any exception is clearly stated in the INSTALL.oracle.txt that if you whant to use db_prefixes you SHOULD grant
dba privileges or equivalent to create accounts to the drupal oracle account. This is because in the Drupal philosophy things MUST
work as much as they can out of the box. If somebody whants a different behavior it will code it yourself, but this will not be released
with this driver.
Comment #3
brianV CreditAttribution: brianV commentedMoving to code needs work because I think this bears more conversation.
Also posting the following on behalf of BobA as he's a coworker and doesn't have his d.org password handy at the moment:
Comment #3.0
brianV CreditAttribution: brianV commentedfix some linespace issues.