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
e9c99321
Unverified
Commit
e9c99321
authored
Nov 15, 2017
by
belgattitude
Committed by
Luís Cobucci
Nov 19, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improves readability of escape sequences
parent
45ea287c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
1 deletion
+17
-1
MySqlSchemaManagerTest.php
...e/Tests/DBAL/Functional/Schema/MySqlSchemaManagerTest.php
+17
-1
No files found.
tests/Doctrine/Tests/DBAL/Functional/Schema/MySqlSchemaManagerTest.php
View file @
e9c99321
...
...
@@ -451,13 +451,29 @@ class MySqlSchemaManagerTest extends SchemaManagerFunctionalTestCase
* Ensure default values (un-)escaping is properly done by mysql platforms.
* The test is voluntarily relying on schema introspection due to current
* doctrine limitations. Once #2850 is landed, this test can be removed.
* @see https://dev.mysql.com/doc/refman/5.7/en/string-literals.html
*/
public
function
testEnsureDefaultsAreUnescapedFromSchemaIntrospection
()
:
void
{
$platform
=
$this
->
_sm
->
getDatabasePlatform
();
$this
->
_conn
->
query
(
'DROP TABLE IF EXISTS test_column_defaults_with_create'
);
$default
=
"a
\\
0b
\\
'c
\"
d
\t
e
\\
Zf
\\\\
g''h"
;
// https://dev.mysql.com/doc/refman/5.7/en/string-literals.html
$escapeSequences
=
[
"
\\
0"
,
// An ASCII NUL (X'00') character
"
\\
'"
,
"''"
,
// Single quote
'\\"'
,
'""'
,
// Double quote
'\\b'
,
// A backspace character
'\\n'
,
// A new-line character
'\\r'
,
// A carriage return character
'\\t'
,
// A tab character
'\\Z'
,
// ASCII 26 (Control+Z)
'\\\\'
,
// A backslash (\) character
'\\%'
,
// A percent (%) character
'\\_'
,
// An underscore (_) character
];
$default
=
implode
(
'+'
,
$escapeSequences
);
$sql
=
"CREATE TABLE test_column_defaults_with_create(
col1 VARCHAR(255) NULL DEFAULT
{
$platform
->
quoteStringLiteral
(
$default
)
}
)"
;
...
...
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