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
5fe8b795
Unverified
Commit
5fe8b795
authored
Jan 02, 2019
by
Leo Feyer
Committed by
Sergei Morozov
Jan 06, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cast the index length to int in the MySqlSchemaManager class
parent
f1926101
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
1 deletion
+14
-1
MySqlSchemaManager.php
lib/Doctrine/DBAL/Schema/MySqlSchemaManager.php
+1
-1
MySqlSchemaManagerTest.php
...e/Tests/DBAL/Functional/Schema/MySqlSchemaManagerTest.php
+13
-0
No files found.
lib/Doctrine/DBAL/Schema/MySqlSchemaManager.php
View file @
5fe8b795
...
...
@@ -68,7 +68,7 @@ class MySqlSchemaManager extends AbstractSchemaManager
}
elseif
(
strpos
(
$v
[
'index_type'
],
'SPATIAL'
)
!==
false
)
{
$v
[
'flags'
]
=
[
'SPATIAL'
];
}
$v
[
'length'
]
=
$v
[
'sub_part'
]
??
null
;
$v
[
'length'
]
=
isset
(
$v
[
'sub_part'
])
?
(
int
)
$v
[
'sub_part'
]
:
null
;
$tableIndexes
[
$k
]
=
$v
;
}
...
...
tests/Doctrine/Tests/DBAL/Functional/Schema/MySqlSchemaManagerTest.php
View file @
5fe8b795
...
...
@@ -107,6 +107,19 @@ class MySqlSchemaManagerTest extends SchemaManagerFunctionalTestCase
self
::
assertTrue
(
$indexes
[
's_index'
]
->
hasFlag
(
'spatial'
));
}
public
function
testIndexWithLength
()
:
void
{
$table
=
new
Table
(
'index_length'
);
$table
->
addColumn
(
'text'
,
'string'
,
[
'length'
=>
255
]);
$table
->
addIndex
([
'text'
],
'text_index'
,
[],
[
'lengths'
=>
[
128
]]);
$this
->
schemaManager
->
dropAndCreateTable
(
$table
);
$indexes
=
$this
->
schemaManager
->
listTableIndexes
(
'index_length'
);
self
::
assertArrayHasKey
(
'text_index'
,
$indexes
);
self
::
assertSame
([
128
],
$indexes
[
'text_index'
]
->
getOption
(
'lengths'
));
}
/**
* @group DBAL-400
*/
...
...
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