@@ -195,6 +195,24 @@ public static function provideCases(): iterable
195195 },
196196 ];
197197
198+ yield ' 1.00 ' => [
199+ 'data ' => self ::dataDefault (),
200+ 'select ' => 'SELECT 1.00 FROM %s t ' ,
201+ 'mysql ' => new ConstantStringType ('1.00 ' ),
202+ 'sqlite ' => new ConstantFloatType (1.0 ),
203+ 'pdo_pgsql ' => new ConstantStringType ('1.00 ' ),
204+ 'pgsql ' => new ConstantStringType ('1.00 ' ),
205+ 'mssql ' => new MixedType (),
206+ 'mysqlResult ' => '1.00 ' ,
207+ 'sqliteResult ' => 1.0 ,
208+ 'pdoPgsqlResult ' => '1.00 ' ,
209+ 'pgsqlResult ' => '1.00 ' ,
210+ 'mssqlResult ' => '1.00 ' ,
211+ 'shouldStringify ' => static function (string $ driver , int $ php , string $ configName ): bool {
212+ return self ::defaultStringification ($ driver , $ php , $ configName );
213+ },
214+ ];
215+
198216 yield ' 0.1 ' => [
199217 'data ' => self ::dataDefault (),
200218 'select ' => 'SELECT 0.1 FROM %s t ' ,
@@ -213,6 +231,42 @@ public static function provideCases(): iterable
213231 },
214232 ];
215233
234+ yield ' 0.10 ' => [
235+ 'data ' => self ::dataDefault (),
236+ 'select ' => 'SELECT 0.10 FROM %s t ' ,
237+ 'mysql ' => new ConstantStringType ('0.10 ' ),
238+ 'sqlite ' => new ConstantFloatType (0.1 ),
239+ 'pdo_pgsql ' => new ConstantStringType ('0.10 ' ),
240+ 'pgsql ' => new ConstantStringType ('0.10 ' ),
241+ 'mssql ' => new MixedType (),
242+ 'mysqlResult ' => '0.10 ' ,
243+ 'sqliteResult ' => 0.1 ,
244+ 'pdoPgsqlResult ' => '0.10 ' ,
245+ 'pgsqlResult ' => '0.10 ' ,
246+ 'mssqlResult ' => '.10 ' ,
247+ 'shouldStringify ' => static function (string $ driver , int $ php , string $ configName ): bool {
248+ return self ::defaultStringification ($ driver , $ php , $ configName );
249+ },
250+ ];
251+
252+ yield '0.125e0 ' => [
253+ 'data ' => self ::dataDefault (),
254+ 'select ' => 'SELECT 0.125e0 FROM %s t ' ,
255+ 'mysql ' => new ConstantFloatType (0.125 ),
256+ 'sqlite ' => new ConstantFloatType (0.125 ),
257+ 'pdo_pgsql ' => new ConstantStringType ('0.125 ' ),
258+ 'pgsql ' => new ConstantStringType ('0.125 ' ),
259+ 'mssql ' => new MixedType (),
260+ 'mysqlResult ' => 0.125 ,
261+ 'sqliteResult ' => 0.125 ,
262+ 'pdoPgsqlResult ' => '0.125 ' ,
263+ 'pgsqlResult ' => '0.125 ' ,
264+ 'mssqlResult ' => 0.125 ,
265+ 'shouldStringify ' => static function (string $ driver , int $ php , string $ configName ): bool {
266+ return self ::defaultStringification ($ driver , $ php , $ configName );
267+ },
268+ ];
269+
216270 yield ' 1e0 ' => [
217271 'data ' => self ::dataDefault (),
218272 'select ' => 'SELECT 1e0 FROM %s t ' ,
@@ -1221,42 +1275,6 @@ public static function provideCases(): iterable
12211275 },
12221276 ];
12231277
1224- yield '0.1 ' => [
1225- 'data ' => self ::dataDefault (),
1226- 'select ' => 'SELECT 0.1 FROM %s t ' ,
1227- 'mysql ' => new ConstantStringType ('0.1 ' ),
1228- 'sqlite ' => new ConstantFloatType (0.1 ),
1229- 'pdo_pgsql ' => new ConstantStringType ('0.1 ' ),
1230- 'pgsql ' => new ConstantStringType ('0.1 ' ),
1231- 'mssql ' => new MixedType (),
1232- 'mysqlResult ' => '0.1 ' ,
1233- 'sqliteResult ' => 0.1 ,
1234- 'pdoPgsqlResult ' => '0.1 ' ,
1235- 'pgsqlResult ' => '0.1 ' ,
1236- 'mssqlResult ' => '.1 ' ,
1237- 'shouldStringify ' => static function (string $ driver , int $ php , string $ configName ): bool {
1238- return self ::defaultStringification ($ driver , $ php , $ configName );
1239- },
1240- ];
1241-
1242- yield '0.125e0 ' => [
1243- 'data ' => self ::dataDefault (),
1244- 'select ' => 'SELECT 0.125e0 FROM %s t ' ,
1245- 'mysql ' => new ConstantFloatType (0.125 ),
1246- 'sqlite ' => new ConstantFloatType (0.125 ),
1247- 'pdo_pgsql ' => new ConstantStringType ('0.125 ' ),
1248- 'pgsql ' => new ConstantStringType ('0.125 ' ),
1249- 'mssql ' => new MixedType (),
1250- 'mysqlResult ' => 0.125 ,
1251- 'sqliteResult ' => 0.125 ,
1252- 'pdoPgsqlResult ' => '0.125 ' ,
1253- 'pgsqlResult ' => '0.125 ' ,
1254- 'mssqlResult ' => 0.125 ,
1255- 'shouldStringify ' => static function (string $ driver , int $ php , string $ configName ): bool {
1256- return self ::defaultStringification ($ driver , $ php , $ configName );
1257- },
1258- ];
1259-
12601278 yield "'' " => [
12611279 'data ' => self ::dataDefault (),
12621280 'select ' => 'SELECT \'\' FROM %s t ' ,
@@ -3978,10 +3996,14 @@ private static function stringifyType(Type $type): Type
39783996 return $ traverse ($ type );
39793997 }
39803998
3981- if ($ type instanceof IntegerType || $ type instanceof FloatType ) {
3999+ if ($ type instanceof IntegerType) {
39824000 return $ type ->toString ();
39834001 }
39844002
4003+ if ($ type instanceof FloatType) {
4004+ return self ::numericString ();
4005+ }
4006+
39854007 if ($ type instanceof BooleanType) {
39864008 return $ type ->toInteger ()->toString ();
39874009 }
0 commit comments