Doctrine DBAL
  1. Doctrine DBAL
  2. DBAL-955

No exception thrown for query error

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 2.4.2
    • Fix Version/s: None
    • Component/s: Drivers
    • Security Level: All
    • Labels:
      None
    • Environment:
      SQL Server 2012

      Description

      Consider the following code:

      IF OBJECT_ID('tempdb..#TestTable') IS NOT NULL DROP TABLE #TestTable
      
      CREATE TABLE #TestTable
      ( 
      id INT  NOT NULL IDENTITY(1,1) PRIMARY KEY, 
      aDate DATETIME2(6) NULL
      )
      
      INSERT INTO #TestTable
      (
      aDate
      ) VALUES
      (
      '2014-07-30 08:54:23.000000'
      )
      
      SELECT *
      FROM #TestTable
      WHERE aDate > 2000

      Error:

      Msg 206, Level 16, State 2, Line 21
      Operand type clash: datetime2 is incompatible with smallint
      

      Problem: for this error no DBALexception is thrown

      By the way, this does work (but does not affect problem description):

      SELECT *
      FROM #TestTable
      WHERE aDate > '2000'
      

        Activity

        Hide
        Marco Pivetta added a comment -

        Flip your code example includes no DBAL code: could you also add the PHP wrapping around those SQL statements?

        Show
        Marco Pivetta added a comment - Flip your code example includes no DBAL code: could you also add the PHP wrapping around those SQL statements?

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Flip
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated: