• Sergei Morozov's avatar
    Removed ServerInfoAwareConnection#requiresQueryForServerVersion() as implementation detail · 8d015895
    Sergei Morozov authored
    Testing the implementations of this method requires partial mocking of the implementing class which makes it impossible to make them `final` (#3590).
    
    Additionally, this API breaks the encapsulation of the driver layer: instead of exposing the fact of whether the connection will perform a query to detect the server version, the driver should just instantiate a platform corresponding to a connection.
    
    The rationale behind introducing this method (#487) is really questionable:
    
    > This is also required for drivers that cannot return the database server version without an additional query (performance reasons).
    
    1. There's no evidence that an underlying driver that exposes the server version via its API doesn't make a request of any kind to the server.
    2. For an application that works with any realistic database, a query like `SELECT VERSION()` wouldn't be a performance bottleneck.
    3. Even if it was, it's always possible to specify the platform version upfront. Otherwise, the current logic of falling back to a default platform may cause undefined behavior of the application (we don't test the compatibility of the lowest level of the DBAL platform with all supported server versions). Remember, “If it doesn’t work, it doesn’t matter how fast it doesn’t work.”
    
    In addition to the above, the only driver that doesn't support the platform version detection via the underlying driver API is `sqsql` which is barely supported.
    8d015895
Name
Last commit
Last update
..
Cache Loading commit data...
Driver Loading commit data...
Events Loading commit data...
Exception Loading commit data...
Functional Loading commit data...
Logging Loading commit data...
Performance Loading commit data...
Platforms Loading commit data...
Portability Loading commit data...
Query Loading commit data...
Schema Loading commit data...
Tools Loading commit data...
Types Loading commit data...
ConfigurationTest.php Loading commit data...
ConnectionTest.php Loading commit data...
DBALExceptionTest.php Loading commit data...
DriverManagerTest.php Loading commit data...
SQLParserUtilsTest.php Loading commit data...
StatementTest.php Loading commit data...
UtilTest.php Loading commit data...