Conversation
| } | ||
| case Exp::Type::SqlColumnName: | ||
| { | ||
| NativeSqlBuilder sqlSnippet; |
There was a problem hiding this comment.
i can also just append the resolved path here?
bc6d03f to
596e534
Compare
| } | ||
| } | ||
|
|
||
| TEST_F(ECSqlStatementTestFixture, ValuesClauseTest) { |
There was a problem hiding this comment.
Here is some test we should add in this PR
SELECT column1, column2 FROM (VALUES(1,2)) UNION SELECT column1, column2 FROM (VALUES(3,4));SELECT * FROM (SELECT column1 a, column2 b FROM (VALUES(1,2)))SELECT * FROM (VALUES(1,2)) a, (VALUES(2,3)) bSELECT * FROM (VALUES(1,2)) a, (VALUES(2,3)) b WHERE a.Column2=2SELECT * FROM (VALUES(?,?),(?,?)) abind parameter and test
There was a problem hiding this comment.
report this as issue for future work
I also noted that following, but column1_1 or column2_1 cannot be accessed in WHERE clause instead we have to use b.column1 and b.column2 to access it.
iModelConsole> SELECT * FROM (VALUES(1,2)) a, (VALUES(2,3)) b;
column1 |column2 |column1_1 |column2_1
---------------------------------------------------------------------------
1 |2 |2 |3
There was a problem hiding this comment.
This should be fixed in this PR.
There is no type checking e.g. Normally if a user uses a different type for the same column in different rows and its constant literal then we should fail if the type is different.
iModelConsole> .metadata SELECT * FROM (VALUES('dd',2),('333',4)) a;
Column metadata
===============
Index Name/PropertyPath DisplayLabel System Type Root class Root class alias
------------------------------------------------------------------------------------------------------------------------------------------------------------------
0 column1 column1 no String generated
1 column2 column2 no Long generated
There was a problem hiding this comment.
There is no type checking e.g. Normally if a user uses a different type for the same column in different rows and its constant literal then we should fail if the type is different.
I checked this in SQLite playground and SELECT * FROM (VALUES('dd',2),('333',4)) a; query passes on 4 different playgrounds.
SQLite uses dynamic typing and a concept called type affinity. This means that even if you declare a column to be of a certain type (e.g., INTEGER), SQLite will not strictly enforce it. You can insert different types (e.g., string, float, blob) into that column without errors.
khanaffan
left a comment
There was a problem hiding this comment.
I added few mandory work that include add test and validate type of constant literal provided as values if more than one row is specified.
#897