Doctrine DBAL
  1. Doctrine DBAL
  2. DBAL-158

Sqlite Platform doesn't set a proper mapping for "double precision" to act as float.

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.1
    • Fix Version/s: 2.1.5
    • Component/s: Platforms
    • Labels:
      None
    • Environment:
      Ubuntu Linux 11.04
      PHP 5.3.5

      Description

      I have a column in an entity, defined as "float" type.
      When I run my phpunit tests (which are defined to use sqlite, whereas my production and development environment uses mysql), I get the following exception:

      Doctrine\DBAL\DBALException: Unknown database type double precision requested, Doctrine\DBAL\Platforms\SqlitePlatform may not support it
      

      Looking at AbstractPlatform.php, line 1972, function "getFloatDeclarationSQL" returns 'DOUBLE PRECISION'.
      Where other platforms have in their "initializeDoctrineTypeMappings" method a mapping such as:

      'double precision' => 'float',
      

      , SqlitePlatform.php doesn't have such a mapping.

        Activity

        Hide
        Steven Rosato added a comment -

        I have encountered the same issue while using sqlite. I have made a simple fix in the platform class, as seen in the patch I provided which hopefully fixes the issue.

        Show
        Steven Rosato added a comment - I have encountered the same issue while using sqlite. I have made a simple fix in the platform class, as seen in the patch I provided which hopefully fixes the issue.
        Hide
        Benjamin Eberlei added a comment -

        Was fixed

        Show
        Benjamin Eberlei added a comment - Was fixed

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Doron Gutman
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: