Skip to content

Commit 2fd1079

Browse files
authored
Prepare values in hash condition (#339)
1 parent 53e38e9 commit 2fd1079

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/Provider/QueryBuilderProvider.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,10 @@ public static function buildCondition(): array
9090
['like', new Expression('CONCAT(col1, col2)'), 'b'], 'CONCAT(col1, col2) LIKE :qp0 ESCAPE \'!\'', [':qp0' => new Param('%b%', DataType::STRING)],
9191
];
9292

93+
$buildCondition['and-subquery'][1] = <<<SQL
94+
([[expired]]='0') AND ((SELECT count(*) > 1 FROM [[queue]]))
95+
SQL;
96+
9397
return $buildCondition;
9498
}
9599

@@ -119,6 +123,10 @@ public static function insert(): array
119123
INSERT INTO "customer" ("id") VALUES (DEFAULT)
120124
SQL;
121125

126+
$insert['carry passed params (query)'][3] = <<<SQL
127+
INSERT INTO "customer" ("email", "name", "address", "is_active", "related_id") SELECT "email", "name", "address", "is_active", "related_id" FROM "customer" WHERE ("email"=:qp1) AND ("name"=:qp2) AND ("address"=:qp3) AND ("is_active"='0') AND ("related_id" IS NULL) AND ("col"=CONCAT(:phFoo, :phBar))
128+
SQL;
129+
122130
return $insert;
123131
}
124132

@@ -430,4 +438,11 @@ public static function caseExpressionBuilder(): array
430438

431439
return $data;
432440
}
441+
442+
public static function delete(): array
443+
{
444+
$values = parent::delete();
445+
$values['base'][2] = 'DELETE FROM "user" WHERE ("is_enabled"=\'0\') AND ("power"=WRONG_POWER())';
446+
return $values;
447+
}
433448
}

0 commit comments

Comments
 (0)