DDC-3173: [GH-1062] Doctrine new config parameter on oracle dbal/mapping: Owner #3930

Open
opened 2026-01-22 14:31:41 +01:00 by admin · 0 comments
Owner

Originally created by @doctrinebot on GitHub (Jun 17, 2014).

Originally assigned to: @Ocramius on GitHub.

Jira issue originally created by user @doctrinebot:

This issue is created automatically through a Github pull request on behalf of cirovargas:

Url: https://github.com/doctrine/doctrine2/pull/1062

Message:

When i can access a database with a user and map other user schema, example:

I connect to the server using USER1 credentials and need to use USER2 schema

Ccctually this is not suported:

Sugestions:

set a new config parameter with owner to put on front query like select * from OWNER.TABLE

and on the mapping update query mappings with these:

swap this:

doctrine\dbal\lib\Doctrine\DBAL\Platforms\OraclePlatform.php
public function getListSequencesSQL($database)
  322      {
  323:         return "SELECT sequence*name, min_value, increment_by FROM sys.all*sequences ".
  324                 "WHERE SEQUENCE_OWNER = '".strtoupper($database)."'";
  325      }
  ...
  387      public function getListViewsSQL($database)
  388      {
  389:         return 'SELECT view*name, text FROM sys.user*views';
  390      }

FOR THIS

public function getListSequencesSQL($database,$owner)
{
    return "SELECT sequence*name, min_value, increment_by FROM sys.all*sequences ".
           "WHERE SEQUENCE_OWNER = '".$owner."'";
}


/****
 * {@inheritDoc}
 */
public function getListSequencesSQL($database,$owner)
{
    return "SELECT sequence*name, min_value, increment_by FROM sys.all*sequences ".
           "WHERE SEQUENCE_OWNER = '".$owner."'";
}

Worked fine for me on tests.

Tnks

Originally created by @doctrinebot on GitHub (Jun 17, 2014). Originally assigned to: @Ocramius on GitHub. Jira issue originally created by user @doctrinebot: This issue is created automatically through a Github pull request on behalf of cirovargas: Url: https://github.com/doctrine/doctrine2/pull/1062 Message: When i can access a database with a user and map other user schema, example: I connect to the server using USER1 credentials and need to use USER2 schema Ccctually this is not suported: Sugestions: set a new config parameter with owner to put on front query like select \* from OWNER.TABLE and on the mapping update query mappings with these: swap this: ``` doctrine\dbal\lib\Doctrine\DBAL\Platforms\OraclePlatform.php public function getListSequencesSQL($database) 322 { 323: return "SELECT sequence*name, min_value, increment_by FROM sys.all*sequences ". 324 "WHERE SEQUENCE_OWNER = '".strtoupper($database)."'"; 325 } ... 387 public function getListViewsSQL($database) 388 { 389: return 'SELECT view*name, text FROM sys.user*views'; 390 } ``` FOR THIS ``` public function getListSequencesSQL($database,$owner) { return "SELECT sequence*name, min_value, increment_by FROM sys.all*sequences ". "WHERE SEQUENCE_OWNER = '".$owner."'"; } /**** * {@inheritDoc} */ public function getListSequencesSQL($database,$owner) { return "SELECT sequence*name, min_value, increment_by FROM sys.all*sequences ". "WHERE SEQUENCE_OWNER = '".$owner."'"; } ``` Worked fine for me on tests. Tnks
admin added the Bug label 2026-01-22 14:31:41 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#3930