Jira issue originally created by user flip101:
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
WHERE aDate > 2000
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):
WHERE aDate > '2000'
Comment created by @ocramius:
[~flip101] your code example includes no DBAL code: could you also add the PHP wrapping around those SQL statements?
Comment created by @deeky666:
@flip111 can you please provide more information on what's actually broken in DBAL? Maybe also provide steps for reproduction. Thanks!
Sorry i can not remember what i did exactly 1.5 years ago. I figure i just used a native query, since i didn't find it important enough to include php code it must just have been a one-liner. Also if it was not a native query i would have reported it on ORM, not DBAL. Did you try checking out 1.5 year old code and run the query? So i suggest doing the first queries (making tables) on the database directly. Then using this code http://doctrine-orm.readthedocs.org/projects/doctrine-dbal/en/latest/reference/data-retrieval-and-manipulation.html#data-retrieval to execute that last SELECT query. I think that should be enough to reproduce and to find out what is broken. So i know SQL Server gives an error but Doctrine does not throw an exception ... i forgot what doctrine does instead ... perhaps just return an empty result set.
@flip111 thanks for your feedback. I know this is old so no problem :) I will try to find out what's wrong.
@zeroedin-bill assigning this to you for now as I currently don't have a running SQL Server setup. Though this one has no priority... Just in case you are bored ;)