File tree 3 files changed +16
-1
lines changed
3 files changed +16
-1
lines changed Original file line number Diff line number Diff line change 14
14
- Enh #786 : Refactor ` AbstractSchema::getDataType() ` (@Tigrov )
15
15
- Enh #784 : Specify result type of ` ConstraintSchemaInterface::getTableIndexes() ` method to ` IndexConstraint[] ` (@vjik )
16
16
- Enh #784 : Remove unused code in ` AbstractSchema::getTableIndexes() ` (@vjik )
17
+ - Bug #788 : Fix casting integer to string in ` AbstractCommand::getRawSql() ` (@Tigrov )
17
18
18
19
## 1.2.0 November 12, 2023
19
20
Original file line number Diff line number Diff line change @@ -351,7 +351,7 @@ public function getRawSql(): string
351
351
$ value = $ param ->getValue ();
352
352
353
353
$ params [$ name ] = match ($ param ->getType ()) {
354
- DataType::INTEGER => (string )$ value ,
354
+ DataType::INTEGER => (string )( int ) $ value ,
355
355
DataType::STRING , DataType::LOB => match (true ) {
356
356
$ value instanceof Expression => (string )$ value ,
357
357
is_resource ($ value ) => $ name ,
Original file line number Diff line number Diff line change 4
4
5
5
namespace Yiisoft \Db \Tests \Provider ;
6
6
7
+ use Yiisoft \Db \Command \DataType ;
8
+ use Yiisoft \Db \Command \Param ;
7
9
use Yiisoft \Db \Expression \Expression ;
8
10
use Yiisoft \Db \Query \Query ;
9
11
use Yiisoft \Db \Schema \SchemaInterface ;
@@ -553,6 +555,18 @@ public static function rawSql(): array
553
555
static ::$ driverName ,
554
556
),
555
557
],
558
+ [
559
+ <<<SQL
560
+ SELECT * FROM [[customer]] WHERE [[id]] = :id
561
+ SQL ,
562
+ ['id ' => new Param ('1 OR 1=1 ' , DataType::INTEGER )],
563
+ DbHelper::replaceQuotes (
564
+ <<<SQL
565
+ SELECT * FROM [[customer]] WHERE [[id]] = 1
566
+ SQL ,
567
+ static ::$ driverName ,
568
+ ),
569
+ ],
556
570
[
557
571
<<<SQL
558
572
SELECT * FROM [[customer]] WHERE [[id]] = :id
You can’t perform that action at this time.
0 commit comments