Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
doctrine-dbal
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tomáš Trávníček
doctrine-dbal
Commits
ecbfc68d
Commit
ecbfc68d
authored
Sep 22, 2016
by
Marius Meißner
Committed by
Steve Müller
Jan 14, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DBAL-#2517: Fixed ORA-01427 when listing columns
parent
a526d0df
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
7 deletions
+24
-7
OraclePlatform.php
lib/Doctrine/DBAL/Platforms/OraclePlatform.php
+6
-4
OracleSchemaManagerTest.php
.../Tests/DBAL/Functional/Schema/OracleSchemaManagerTest.php
+15
-0
OraclePlatformTest.php
tests/Doctrine/Tests/DBAL/Platforms/OraclePlatformTest.php
+3
-3
No files found.
lib/Doctrine/DBAL/Platforms/OraclePlatform.php
View file @
ecbfc68d
...
...
@@ -655,25 +655,27 @@ LEFT JOIN user_cons_columns r_cols
$tabColumnsTableName
=
"user_tab_columns"
;
$colCommentsTableName
=
"user_col_comments"
;
$ownerCondition
=
''
;
$tabColumnsOwnerCondition
=
''
;
$colCommentsOwnerCondition
=
''
;
if
(
null
!==
$database
&&
'/'
!==
$database
)
{
$database
=
$this
->
normalizeIdentifier
(
$database
);
$database
=
$this
->
quoteStringLiteral
(
$database
->
getName
());
$tabColumnsTableName
=
"all_tab_columns"
;
$colCommentsTableName
=
"all_col_comments"
;
$ownerCondition
=
"AND c.owner = "
.
$database
;
$tabColumnsOwnerCondition
=
"AND c.owner = "
.
$database
;
$colCommentsOwnerCondition
=
"AND d.OWNER = c.OWNER"
;
}
return
"SELECT c.*,
(
SELECT d.comments
FROM
$colCommentsTableName
d
WHERE d.TABLE_NAME = c.TABLE_NAME
WHERE d.TABLE_NAME = c.TABLE_NAME
"
.
$colCommentsOwnerCondition
.
"
AND d.COLUMN_NAME = c.COLUMN_NAME
) AS comments
FROM
$tabColumnsTableName
c
WHERE c.table_name = "
.
$table
.
"
$
o
wnerCondition
WHERE c.table_name = "
.
$table
.
"
$
tabColumnsO
wnerCondition
ORDER BY c.column_name"
;
}
...
...
tests/Doctrine/Tests/DBAL/Functional/Schema/OracleSchemaManagerTest.php
View file @
ecbfc68d
...
...
@@ -3,6 +3,8 @@
namespace
Doctrine\Tests\DBAL\Functional\Schema
;
use
Doctrine\DBAL\Schema
;
use
Doctrine\DBAL\Schema\Table
;
use
Doctrine\DBAL\Types\Type
;
use
Doctrine\Tests\TestUtil
;
require_once
__DIR__
.
'/../../../TestInit.php'
;
...
...
@@ -218,4 +220,17 @@ class OracleSchemaManagerTest extends SchemaManagerFunctionalTestCase
$onlineForeignTable
->
getForeignKey
(
'"Primary_Table_Fk"'
)
->
getQuotedForeignColumns
(
$platform
)
);
}
public
function
testListTableColumnsSameTableNamesInDifferentSchemas
()
{
$table
=
$this
->
createListTableColumns
();
$this
->
_sm
->
dropAndCreateTable
(
$table
);
$otherTable
=
new
Table
(
$table
->
getName
());
$otherTable
->
addColumn
(
'id'
,
Type
::
STRING
);
TestUtil
::
getTempConnection
()
->
getSchemaManager
()
->
dropAndCreateTable
(
$otherTable
);
$columns
=
$this
->
_sm
->
listTableColumns
(
$table
->
getName
(),
$this
->
_conn
->
getUsername
());
$this
->
assertCount
(
7
,
$columns
);
}
}
tests/Doctrine/Tests/DBAL/Platforms/OraclePlatformTest.php
View file @
ecbfc68d
...
...
@@ -727,7 +727,7 @@ EOD;
(
SELECT d.comments
FROM user_col_comments d
WHERE d.TABLE_NAME = c.TABLE_NAME
WHERE d.TABLE_NAME = c.TABLE_NAME
AND d.COLUMN_NAME = c.COLUMN_NAME
) AS comments
FROM user_tab_columns c
...
...
@@ -740,7 +740,7 @@ EOD;
(
SELECT d.comments
FROM user_col_comments d
WHERE d.TABLE_NAME = c.TABLE_NAME
WHERE d.TABLE_NAME = c.TABLE_NAME
AND d.COLUMN_NAME = c.COLUMN_NAME
) AS comments
FROM user_tab_columns c
...
...
@@ -753,7 +753,7 @@ EOD;
(
SELECT d.comments
FROM all_col_comments d
WHERE d.TABLE_NAME = c.TABLE_NAME
WHERE d.TABLE_NAME = c.TABLE_NAME
AND d.OWNER = c.OWNER
AND d.COLUMN_NAME = c.COLUMN_NAME
) AS comments
FROM all_tab_columns c
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment