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
dd4d1062
Commit
dd4d1062
authored
Dec 28, 2014
by
Marco Pivetta
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'hotfix/#759-DDC-1095-sql-anywhere-index-introspection-fk-fixes' into 2.5
parents
afabadcf
6e5af692
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
0 deletions
+31
-0
SQLAnywherePlatform.php
lib/Doctrine/DBAL/Platforms/SQLAnywherePlatform.php
+1
-0
SchemaManagerFunctionalTestCase.php
...BAL/Functional/Schema/SchemaManagerFunctionalTestCase.php
+30
-0
No files found.
lib/Doctrine/DBAL/Platforms/SQLAnywherePlatform.php
View file @
dd4d1062
...
@@ -891,6 +891,7 @@ class SQLAnywherePlatform extends AbstractPlatform
...
@@ -891,6 +891,7 @@ class SQLAnywherePlatform extends AbstractPlatform
ON idx.table_id = tbl.table_id
ON idx.table_id = tbl.table_id
WHERE tbl.table_name = '
$table
'
WHERE tbl.table_name = '
$table
'
AND tbl.creator = USER_ID(
$user
)
AND tbl.creator = USER_ID(
$user
)
AND idx.index_category != 2 -- exclude indexes implicitly created by foreign key constraints
ORDER BY idx.index_id ASC, idxcol.sequence ASC"
;
ORDER BY idx.index_id ASC, idxcol.sequence ASC"
;
}
}
...
...
tests/Doctrine/Tests/DBAL/Functional/Schema/SchemaManagerFunctionalTestCase.php
View file @
dd4d1062
...
@@ -995,4 +995,34 @@ class SchemaManagerFunctionalTestCase extends \Doctrine\Tests\DbalFunctionalTest
...
@@ -995,4 +995,34 @@ class SchemaManagerFunctionalTestCase extends \Doctrine\Tests\DbalFunctionalTest
array
(
'0'
,
'0'
,
'foo'
,
'foo'
),
array
(
'0'
,
'0'
,
'foo'
,
'foo'
),
);
);
}
}
/**
* @group DBAL-1095
*/
public
function
testDoesNotListIndexesImplicitlyCreatedByForeignKeys
()
{
if
(
!
$this
->
_sm
->
getDatabasePlatform
()
->
supportsForeignKeyConstraints
())
{
$this
->
markTestSkipped
(
'This test is only supported on platforms that have foreign keys.'
);
}
$primaryTable
=
new
Table
(
'test_list_index_implicit_primary'
);
$primaryTable
->
addColumn
(
'id'
,
'integer'
);
$primaryTable
->
setPrimaryKey
(
array
(
'id'
));
$foreignTable
=
new
Table
(
'test_list_index_implicit_foreign'
);
$foreignTable
->
addColumn
(
'fk1'
,
'integer'
);
$foreignTable
->
addColumn
(
'fk2'
,
'integer'
);
$foreignTable
->
addIndex
(
array
(
'fk1'
),
'explicit_fk1_idx'
);
$foreignTable
->
addForeignKeyConstraint
(
'test_list_index_implicit_primary'
,
array
(
'fk1'
),
array
(
'id'
));
$foreignTable
->
addForeignKeyConstraint
(
'test_list_index_implicit_primary'
,
array
(
'fk2'
),
array
(
'id'
));
$this
->
_sm
->
dropAndCreateTable
(
$primaryTable
);
$this
->
_sm
->
dropAndCreateTable
(
$foreignTable
);
$indexes
=
$this
->
_sm
->
listTableIndexes
(
'test_list_index_implicit_foreign'
);
$this
->
assertCount
(
2
,
$indexes
);
$this
->
assertArrayHasKey
(
'explicit_fk1_idx'
,
$indexes
);
$this
->
assertArrayHasKey
(
'idx_6d88c7b4fdc58d6c'
,
$indexes
);
}
}
}
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