@@ -169,6 +169,34 @@ public function testBindParamProcessesStream(): void
169
169
$ this ->assertBlobContains ('test ' );
170
170
}
171
171
172
+ public function testBlobBindingDoesNotOverwritePrevious (): void
173
+ {
174
+ $ table = new Table ('blob_table ' );
175
+ $ table ->addColumn ('id ' , 'integer ' );
176
+ $ table ->addColumn ('blobcolumn1 ' , 'blob ' , ['notnull ' => false ]);
177
+ $ table ->addColumn ('blobcolumn2 ' , 'blob ' , ['notnull ' => false ]);
178
+ $ table ->setPrimaryKey (['id ' ]);
179
+ $ this ->dropAndCreateTable ($ table );
180
+
181
+ $ params = ['test1 ' , 'test2 ' ];
182
+ $ this ->connection ->executeStatement (
183
+ 'INSERT INTO blob_table(id, blobcolumn1, blobcolumn2) VALUES (1, ?, ?) ' ,
184
+ $ params ,
185
+ [ParameterType::LARGE_OBJECT , ParameterType::LARGE_OBJECT ],
186
+ );
187
+
188
+ $ blobs = $ this ->connection ->fetchNumeric ('SELECT blobcolumn1, blobcolumn2 FROM blob_table ' );
189
+ self ::assertIsArray ($ blobs );
190
+
191
+ $ actual = [];
192
+ foreach ($ blobs as $ blob ) {
193
+ $ blob = Type::getType ('blob ' )->convertToPHPValue ($ blob , $ this ->connection ->getDatabasePlatform ());
194
+ $ actual [] = stream_get_contents ($ blob );
195
+ }
196
+
197
+ self ::assertEquals (['test1 ' , 'test2 ' ], $ actual );
198
+ }
199
+
172
200
private function assertBlobContains (string $ text ): void
173
201
{
174
202
[, $ blobValue ] = $ this ->fetchRow ();
0 commit comments