Doctrine DBAL
  1. Doctrine DBAL
  2. DBAL-860

MsSQL-Server DateTime microseconds issue

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.1
    • Fix Version/s: 2.2
    • Component/s: Platforms
    • Security Level: All
    • Labels:
      None
    • Environment:
      WindowsXP/Windows2008 R2 / PHP 5.3 / MsSQL-Server 2005 / MsSQL-PDO_PHP-Driver

      Description

      The string for the function getDateTimeFormatString() in the MsSqlPlatform class is 'wrong'.
      The Microsoft-SQL-Server just uses 3 digits for microseconds and not 6.
      So the string 'Y-m-d H:i:s.u' fails and the server states: [SQL Server]Fehler beim Konvertieren einer Zeichenfolge in einen datetime-Wert (Error when converting a string to a datetime-value) .

      So this string works, but does not regard the microseconds for those how rely on them: 'Y-m-d H:i:s.000'

      See also:
      [...] The MS datetime column is documented to have an accuracy of only about .3 seconds anyway [...]
      http://bytes.com/topic/sql-server/answers/80150-inserting-datetime-milliseconds-sql-server

      http://msdn.microsoft.com/en-gb/library/ms186819.aspx (Section: Remarks)

        Activity

        Martin Weise created issue -
        Benjamin Eberlei made changes -
        Field Original Value New Value
        Assignee Benjamin Eberlei [ beberlei ] Juozas Kaziukenas [ juokaz ]
        Benjamin Eberlei made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 2.2 [ 10157 ]
        Resolution Fixed [ 1 ]
        Benjamin Eberlei made changes -
        Workflow jira [ 12379 ] jira-feedback [ 14761 ]
        Benjamin Eberlei made changes -
        Workflow jira-feedback [ 14761 ] jira-feedback2 [ 16625 ]
        Benjamin Eberlei made changes -
        Workflow jira-feedback2 [ 16625 ] jira-feedback3 [ 18878 ]
        Steve Müller made changes -
        Project Doctrine 2 - ORM [ 10032 ] Doctrine DBAL [ 10040 ]
        Key DDC-1028 DBAL-860
        Affects Version/s 2.0.1 [ 10115 ]
        Affects Version/s 2.0.1 [ 10114 ]
        Fix Version/s 2.2 [ 10142 ]
        Fix Version/s 2.2 [ 10157 ]
        Component/s Platforms [ 10056 ]
        Component/s ORM [ 10012 ]

          People

          • Assignee:
            Juozas Kaziukenas
            Reporter:
            Martin Weise
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: