@@ -2743,7 +2743,7 @@ public static function provideCases(): iterable
2743
2743
'pdoPgsqlResult ' => 0.125 ,
2744
2744
'pgsqlResult ' => 0.125 ,
2745
2745
'mssqlResult ' => 0.125 ,
2746
- 'stringify ' => self ::STRINGIFY_DEFAULT ,
2746
+ 'stringify ' => self ::STRINGIFY_PG_FLOAT ,
2747
2747
];
2748
2748
2749
2749
yield 'MAX(t.col_decimal) ' => [
@@ -4170,6 +4170,38 @@ public static function provideCases(): iterable
4170
4170
'stringify ' => self ::STRINGIFY_DEFAULT ,
4171
4171
];
4172
4172
4173
+ yield 'COALESCE(0, 0) ' => [
4174
+ 'data ' => self ::dataDefault (),
4175
+ 'select ' => 'SELECT COALESCE(0, 0) FROM %s t ' ,
4176
+ 'mysql ' => self ::int (),
4177
+ 'sqlite ' => self ::int (),
4178
+ 'pdo_pgsql ' => self ::int (),
4179
+ 'pgsql ' => self ::int (),
4180
+ 'mssql ' => self ::mixed (),
4181
+ 'mysqlResult ' => 0 ,
4182
+ 'sqliteResult ' => 0 ,
4183
+ 'pdoPgsqlResult ' => 0 ,
4184
+ 'pgsqlResult ' => 0 ,
4185
+ 'mssqlResult ' => 0 ,
4186
+ 'stringify ' => self ::STRINGIFY_DEFAULT ,
4187
+ ];
4188
+
4189
+ yield 'COALESCE(1.0, 1.0) ' => [
4190
+ 'data ' => self ::dataDefault (),
4191
+ 'select ' => 'SELECT COALESCE(1.0, 1.0) FROM %s t ' ,
4192
+ 'mysql ' => self ::numericString (),
4193
+ 'sqlite ' => self ::float (),
4194
+ 'pdo_pgsql ' => self ::numericString (),
4195
+ 'pgsql ' => self ::numericString (),
4196
+ 'mssql ' => self ::mixed (),
4197
+ 'mysqlResult ' => '1.0 ' ,
4198
+ 'sqliteResult ' => 1.0 ,
4199
+ 'pdoPgsqlResult ' => '1.0 ' ,
4200
+ 'pgsqlResult ' => '1.0 ' ,
4201
+ 'mssqlResult ' => '1.0 ' ,
4202
+ 'stringify ' => self ::STRINGIFY_DEFAULT ,
4203
+ ];
4204
+
4173
4205
yield 'COALESCE(1e0, 1.0) ' => [
4174
4206
'data ' => self ::dataDefault (),
4175
4207
'select ' => 'SELECT COALESCE(1e0, 1.0) FROM %s t ' ,
@@ -4255,15 +4287,17 @@ public static function provideCases(): iterable
4255
4287
'select ' => 'SELECT COALESCE(t.col_float_nullable, 0) FROM %s t ' ,
4256
4288
'mysql ' => self ::float (),
4257
4289
'sqlite ' => TypeCombinator::union (self ::float (), self ::int ()),
4258
- 'pdo_pgsql ' => TypeCombinator::union (self ::float (), self ::int ()),
4290
+ 'pdo_pgsql ' => PHP_VERSION_ID < 80400
4291
+ ? TypeCombinator::union (self ::numericString (), self ::int ())
4292
+ : TypeCombinator::union (self ::float (), self ::int ()),
4259
4293
'pgsql ' => TypeCombinator::union (self ::float (), self ::int ()),
4260
4294
'mssql ' => self ::mixed (),
4261
4295
'mysqlResult ' => 0.0 ,
4262
4296
'sqliteResult ' => 0 ,
4263
- 'pdoPgsqlResult ' => 0.0 ,
4297
+ 'pdoPgsqlResult ' => PHP_VERSION_ID < 80400 ? ' 0 ' : 0.0 ,
4264
4298
'pgsqlResult ' => 0.0 ,
4265
4299
'mssqlResult ' => 0.0 ,
4266
- 'stringify ' => self ::STRINGIFY_PG_FLOAT ,
4300
+ 'stringify ' => self ::STRINGIFY_DEFAULT ,
4267
4301
];
4268
4302
4269
4303
yield 'COALESCE(t.col_float_nullable, 0.0) ' => [
@@ -4303,63 +4337,71 @@ public static function provideCases(): iterable
4303
4337
'select ' => 'SELECT COALESCE(t.col_int_nullable, t.col_decimal_nullable, t.col_float_nullable, 0) FROM %s t ' ,
4304
4338
'mysql ' => self ::float (),
4305
4339
'sqlite ' => TypeCombinator::union (self ::float (), self ::int ()),
4306
- 'pdo_pgsql ' => TypeCombinator::union (self ::numericString (), self ::int (), self ::float ()),
4340
+ 'pdo_pgsql ' => PHP_VERSION_ID < 80400
4341
+ ? TypeCombinator::union (self ::numericString (), self ::int ())
4342
+ : TypeCombinator::union (self ::numericString (), self ::int (), self ::float ()),
4307
4343
'pgsql ' => TypeCombinator::union (self ::numericString (), self ::int (), self ::float ()),
4308
4344
'mssql ' => self ::mixed (),
4309
4345
'mysqlResult ' => 0.0 ,
4310
4346
'sqliteResult ' => 0 ,
4311
- 'pdoPgsqlResult ' => 0.0 ,
4347
+ 'pdoPgsqlResult ' => PHP_VERSION_ID < 80400 ? ' 0 ' : 0.0 ,
4312
4348
'pgsqlResult ' => 0.0 ,
4313
4349
'mssqlResult ' => 0.0 ,
4314
- 'stringify ' => self ::STRINGIFY_PG_FLOAT ,
4350
+ 'stringify ' => self ::STRINGIFY_DEFAULT ,
4315
4351
];
4316
4352
4317
4353
yield 'COALESCE(t.col_int_nullable, t.col_decimal_nullable, t.col_float_nullable, 0.0) ' => [
4318
4354
'data ' => self ::dataDefault (),
4319
4355
'select ' => 'SELECT COALESCE(t.col_int_nullable, t.col_decimal_nullable, t.col_float_nullable, 0.0) FROM %s t ' ,
4320
4356
'mysql ' => self ::float (),
4321
4357
'sqlite ' => TypeCombinator::union (self ::float (), self ::int ()),
4322
- 'pdo_pgsql ' => TypeCombinator::union (self ::numericString (), self ::int (), self ::float ()),
4358
+ 'pdo_pgsql ' => PHP_VERSION_ID < 80400
4359
+ ? TypeCombinator::union (self ::numericString (), self ::int ())
4360
+ : TypeCombinator::union (self ::numericString (), self ::int (), self ::float ()),
4323
4361
'pgsql ' => TypeCombinator::union (self ::numericString (), self ::int (), self ::float ()),
4324
4362
'mssql ' => self ::mixed (),
4325
4363
'mysqlResult ' => 0.0 ,
4326
4364
'sqliteResult ' => 0.0 ,
4327
- 'pdoPgsqlResult ' => 0.0 ,
4365
+ 'pdoPgsqlResult ' => PHP_VERSION_ID < 80400 ? ' 0 ' : 0.0 ,
4328
4366
'pgsqlResult ' => 0.0 ,
4329
4367
'mssqlResult ' => 0.0 ,
4330
- 'stringify ' => self ::STRINGIFY_PG_FLOAT ,
4368
+ 'stringify ' => self ::STRINGIFY_DEFAULT ,
4331
4369
];
4332
4370
4333
4371
yield 'COALESCE(t.col_int_nullable, t.col_decimal_nullable, t.col_float_nullable, 0e0) ' => [
4334
4372
'data ' => self ::dataDefault (),
4335
4373
'select ' => 'SELECT COALESCE(t.col_int_nullable, t.col_decimal_nullable, t.col_float_nullable, 0e0) FROM %s t ' ,
4336
4374
'mysql ' => self ::float (),
4337
4375
'sqlite ' => TypeCombinator::union (self ::float (), self ::int ()),
4338
- 'pdo_pgsql ' => TypeCombinator::union (self ::numericString (), self ::int (), self ::float ()),
4376
+ 'pdo_pgsql ' => PHP_VERSION_ID < 80400
4377
+ ? TypeCombinator::union (self ::numericString (), self ::int ())
4378
+ : TypeCombinator::union (self ::numericString (), self ::int (), self ::float ()),
4339
4379
'pgsql ' => TypeCombinator::union (self ::numericString (), self ::int (), self ::float ()),
4340
4380
'mssql ' => self ::mixed (),
4341
4381
'mysqlResult ' => 0.0 ,
4342
4382
'sqliteResult ' => 0.0 ,
4343
- 'pdoPgsqlResult ' => 0.0 ,
4383
+ 'pdoPgsqlResult ' => PHP_VERSION_ID < 80400 ? ' 0 ' : 0.0 ,
4344
4384
'pgsqlResult ' => 0.0 ,
4345
4385
'mssqlResult ' => 0.0 ,
4346
- 'stringify ' => self ::STRINGIFY_PG_FLOAT ,
4386
+ 'stringify ' => self ::STRINGIFY_DEFAULT ,
4347
4387
];
4348
4388
4349
4389
yield "COALESCE(t.col_int_nullable, t.col_decimal_nullable, t.col_float_nullable, '0') " => [
4350
4390
'data ' => self ::dataDefault (),
4351
4391
'select ' => 'SELECT COALESCE(t.col_int_nullable, t.col_decimal_nullable, t.col_float_nullable, \'0 \') FROM %s t ' ,
4352
4392
'mysql ' => self ::numericString (),
4353
4393
'sqlite ' => TypeCombinator::union (self ::float (), self ::int (), self ::numericString ()),
4354
- 'pdo_pgsql ' => TypeCombinator::union (self ::numericString (), self ::int (), self ::float ()),
4394
+ 'pdo_pgsql ' => PHP_VERSION_ID < 80400
4395
+ ? TypeCombinator::union (self ::numericString (), self ::int ())
4396
+ : TypeCombinator::union (self ::numericString (), self ::int (), self ::float ()),
4355
4397
'pgsql ' => TypeCombinator::union (self ::numericString (), self ::int (), self ::float ()),
4356
4398
'mssql ' => self ::mixed (),
4357
4399
'mysqlResult ' => '0 ' ,
4358
4400
'sqliteResult ' => '0 ' ,
4359
- 'pdoPgsqlResult ' => 0.0 ,
4401
+ 'pdoPgsqlResult ' => PHP_VERSION_ID < 80400 ? ' 0 ' : 0.0 ,
4360
4402
'pgsqlResult ' => 0.0 ,
4361
4403
'mssqlResult ' => 0.0 ,
4362
- 'stringify ' => self ::STRINGIFY_PG_FLOAT ,
4404
+ 'stringify ' => self ::STRINGIFY_DEFAULT ,
4363
4405
];
4364
4406
4365
4407
yield 'COALESCE(t.col_int_nullable, t.col_decimal_nullable, t.col_float_nullable, t.col_string) ' => [
0 commit comments