Although #11 has closed, there are still bugs present.
There is simple test from repo, just some modified tests/InsertTest.php - copy method testInsertViaQueryBuilder() and change order of calling setValue/setParameter:
public function testInsertViaQueryBuilder2()
{
$qb = $this->connection->createQueryBuilder();
$qb
->insert('test_insert_table')
->setValue('payload', ':payload')
->setValue('id', ':id')
->setParameter('payload', 'Is this string a question?')
->setParameter('id', 11, \PDO::PARAM_INT)
->execute();
$this->assertEquals([
[
'payload' => 'Is this string a question?',
'id' => 11,
],
], $this->connection->fetchAll("SELECT payload, id from test_insert_table ORDER BY id"));
}
assertEquals also modified.
Test results:
There was 1 failure:
1) FOD\DBALClickHouse\Tests\InsertTest::testInsertViaQueryBuilder2
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
Array (
0 => Array (
- 'payload' => 'Is this string a question?'
- 'id' => 11
+ 'payload' => 'Is this string a question11'
+ 'id' => 15
)
)
It happened because there are consecutive replacement of question mark in query 4b7dbe2:
Although #11 has closed, there are still bugs present.
There is simple test from repo, just some modified
tests/InsertTest.php
- copy methodtestInsertViaQueryBuilder()
and change order of callingsetValue/setParameter
:assertEquals
also modified.Test results:
It happened because there are consecutive replacement of question mark in query 4b7dbe2:
and question mark in string value replaced with next parameter value. Real SQL executed:
Seriously, guys?