Uploaded image for project: 'Doctrine DBAL'
  1. Doctrine DBAL
  2. DBAL-49

PDOSqlsrv's constructor breaks when using non "local" server host


    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.0-BETA4
    • Fix Version/s: 2.0.0-RC1-RC3
    • Component/s: Drivers
    • Labels:
    • Environment:
      Windows 7, Apache 2.1, PHP 5.3.3, Microsoft SQL Server 2008 Enterprise Edition



      Currently, the _constructPdoDsn() for the PDOSqlsrv driver works fine only if the host provided is: local or localhost.
      If using an IP address, this breaks. Reason is because _constructPdoDsn() applies ( and ) around the host.

              $dsn = 'sqlsrv:server=(';
              if (isset($params['host'])) {
                  $dsn .= $params['host'];
              $dsn .= ')';

      This is fine for when $params['host'] = 'local'; because I believe local is a name pipe (I think) and to properly use it you need to add the brackets around it

      However if $params['host'] = ''; this breaks!


      Get rid of the forced brackets

              $dsn = 'sqlsrv:server=';
              if (isset($params['host'])) {
                  $dsn .= $params['host'];

      That way, when supplying local as a host, you have to enter (local) (which makes more sense as that's how you would do it normally in other applications).


        aarondm Aaron DM created issue -
        beberlei Benjamin Eberlei added a comment -

        This is fixed in master.

        beberlei Benjamin Eberlei added a comment - This is fixed in master.
        beberlei Benjamin Eberlei made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Assignee Benjamin Eberlei [ beberlei ] Juozas Kaziukenas [ juokaz ]
        Fix Version/s 2.0.0-RC1 [ 10094 ]
        Resolution Fixed [ 1 ]
        beberlei Benjamin Eberlei made changes -
        Workflow jira [ 11892 ] jira-feedback2 [ 17664 ]
        beberlei Benjamin Eberlei made changes -
        Workflow jira-feedback2 [ 17664 ] jira-feedback3 [ 20019 ]

        This list may be incomplete, as errors occurred whilst retrieving source from linked applications:

        • Request to http://www.doctrine-project.org/fisheye/ failed: Error in remote call to 'FishEye 0 (http://www.doctrine-project.org/fisheye/)' (http://www.doctrine-project.org/fisheye) [AbstractRestCommand{path='/rest-service-fe/search-v1/crossRepositoryQuery', params={expand=changesets[0:20].revisions[0:29],reviews, query=DBAL-49}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)


          • Assignee:
            juokaz Juozas Kaziukenas
            aarondm Aaron DM
          • Votes:
            0 Vote for this issue
            0 Start watching this issue


            • Created: