Skip to content

Commit 8e50933

Browse files
authored
Server version should be specified as a string
If the server version is specified without quotes like this: ```yml server_version: 5.6 ``` The resulting compiled container will contain the value ```php ->createConnection( ... 'serverVersion' => 5.5999999999999996447286321199499070644378662109375, ... ) ``` This is a result of floating-point representation issues. Quoting the value will avoid that and will deliver the string `'5.6'` to the `version_compare` function, as it's expecting.
1 parent 29701f1 commit 8e50933

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

reference/configuration/doctrine.rst

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ The following block shows all possible configuration keys:
312312
charset: UTF8
313313
logging: '%kernel.debug%'
314314
platform_service: MyOwnDatabasePlatformService
315-
server_version: 5.6
315+
server_version: '5.6'
316316
mapping_types:
317317
enum: string
318318
types:
@@ -362,6 +362,13 @@ The following block shows all possible configuration keys:
362362
your database server version (use ``postgres -V`` or ``psql -V`` command
363363
to find your PostgreSQL version and ``mysql -V`` to get your MySQL
364364
version).
365+
366+
If the server version is specified without quotes (i.e. ``5.6``), then the
367+
resulting compiled container will contain the value ``5.5999999999999996447286321199499070644378662109375``.
368+
369+
This is a result of floating-point representation issues. Quoting the
370+
value will avoid that and will deliver the string ``'5.6'`` to the
371+
``version_compare`` function, as it's expecting.
365372

366373
If you don't define this option and you haven't created your database
367374
yet, you may get ``PDOException`` errors because Doctrine will try to

0 commit comments

Comments
 (0)