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
d0681ed8
Commit
d0681ed8
authored
Oct 20, 2016
by
Sergei Morozov
Committed by
Marco Pivetta
Feb 04, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[DBAL-2546] Added regression test for #433
parent
33a61180
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
0 deletions
+46
-0
StatementTest.php
tests/Doctrine/Tests/DBAL/Functional/StatementTest.php
+46
-0
No files found.
tests/Doctrine/Tests/DBAL/Functional/StatementTest.php
View file @
d0681ed8
...
...
@@ -3,6 +3,7 @@
namespace
Doctrine\Tests\DBAL\Functional
;
use
Doctrine\DBAL\Schema\Table
;
use
Doctrine\DBAL\Types\Type
;
class
StatementTest
extends
\Doctrine\Tests\DbalFunctionalTestCase
{
...
...
@@ -86,4 +87,49 @@ class StatementTest extends \Doctrine\Tests\DbalFunctionalTestCase
array
(
'param2'
,
'A bit longer value'
),
),
$stmt
->
fetchAll
(
\PDO
::
FETCH_NUM
));
}
public
function
testFetchLongBlob
()
{
// make sure memory limit is large enough to not cause false positives,
// but is still not enough to store a LONGBLOB of the max possible size
$this
->
iniSet
(
'memory_limit'
,
'4G'
);
$sm
=
$this
->
_conn
->
getSchemaManager
();
$table
=
new
Table
(
'stmt_test_long_blob'
);
$table
->
addColumn
(
'contents'
,
'blob'
,
array
(
'length'
=>
0xFFFFFFFF
,
));
$sm
->
createTable
(
$table
);
$contents
=
base64_decode
(
<<<EOF
H4sICJRACVgCA2RvY3RyaW5lLmljbwDtVNtLFHEU/ia1i9fVzVWxvJSrZmoXS6pd0zK7QhdNc03z
lrpppq1pWqJCFERZkUFEDybYBQqJhB6iUOqhh+whgl4qkF6MfGh+s87O7GVmO6OlBfUfdIZvznxn
fpzznW9gAI4unQ50XwirH2AAkEygEuIwU58ODnPBzXGv14sEq4BrwzKKL4sY++SGTz6PodcutN5x
IPvsFCa+K9CXMfS/cOL5OxesN0Wceygho0WAXVLwcUJBdDVDaqOAij4Rrz640XlXQmAxQ16PHU63
iqdvXbg4JOHLpILBUSdM7XZEVDDcfuZEbI2ASaYguUGAroSh97GMngcSeFFFerMdI+/dyGy1o+GW
Ax5FxfAbFwoviajuc+DCIwn+RTwGRmRIThXxdQJyu+z4/NUDYz2DKCsILuERWsoQfoQhqpLhyhMZ
XfcknBmU0NLvQArpTm0SsI5mqKqKuFoGc8cUcjrtqLohom1AgtujQnapmJJU+BbwCLIwhJXyiKlh
MB4TkFgvIK3JjrRmAefJm+77Eiqvi+SvCq/qJahQyWuVuEpcIa7QLh7Kbsourb9b66/pZdAd1voz
fCNfwsp46OnZQPojSX9UFcNy+mYJNDeJPHtJfqeR/nSaPTzmwlXar5dQ1adpd+B//I9/hi0xuCPQ
Nkvb5um37Wtc+auQXZsVxEVYD5hnCilxTaYYjsuxLlsxXUitzd2hs3GWHLM5UOM7Fy8t3xiat4fb
sneNxmNb/POO1pRXc7vnF2nc13Rq0cFWiyXkuHmzxuOtzUYfC7fEmK/3mx4QZd5u4E7XJWz6+dey
Za4tXHUiPyB8Vm781oaT+3fN6Y/eUFDfPkcNWetNxb+tlxEZsPqPdZMOzS4rxwJ8CDC+ABj1+Tu0
d+N0hqezcjblboJ3Bj8ARJilHX4FAAA=
EOF
);
$this
->
_conn
->
insert
(
'stmt_test_long_blob'
,
array
(
'contents'
=>
$contents
,
),
array
(
\PDO
::
PARAM_LOB
));
$stmt
=
$this
->
_conn
->
prepare
(
'SELECT contents FROM stmt_test_long_blob'
);
$stmt
->
execute
();
$stream
=
Type
::
getType
(
'blob'
)
->
convertToPHPValue
(
$stmt
->
fetchColumn
(),
$this
->
_conn
->
getDatabasePlatform
()
);
$this
->
assertSame
(
$contents
,
stream_get_contents
(
$stream
));
}
}
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