You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Which version are you using?
The npm package and version of every component involved in the bug report.
@nanosql/core 2.3.7
Describe the bug
If two tables are joined, the filtering on the join result is inconsistent and wrong.
Take two tables:
Table t1
id: string
value1: string
Table t2
id: string
value2: string
Insert some data.
Table t1:
id
value1
1
v1
2
v2
Table t2:
id
value2
1
v3
2
v4
Perform a join with filtering:
nSQL("t1").query("select",["t1.id","t1.value1","t2.value2"]).join({type: "inner",with: {table: "t2"},on: [["t1.id","=","t2.id"]]})// Uncomment the tests below one by one to see the behavior.// Test 1. This works correctly, limits the output to 1 row.//.where(["value1", "=", "v1"])// This doesn't work, returns nothing, why? It's the same as above// but with filter on the other table.//.where(["value2", "=", "v3"])// Doesn't work, returns nothing, although it's the same as first,// just with the table name prefix.//.where(["t1.value1", "=", "v1"])// Doesn't work, returns nothing.//.where(["t2.value2", "=", "v3"]).exec()
Expected behavior
The where function on the result of join should correctly filter the data in any of the joined tables. The column names should be prefixed with table alias for disambiguation.
Which version are you using?
The npm package and version of every component involved in the bug report.
@nanosql/core 2.3.7
Describe the bug
If two tables are joined, the filtering on the join result is inconsistent and wrong.
Take two tables:
Table t1
id: string
value1: string
Table t2
id: string
value2: string
Insert some data.
Table t1:
Table t2:
Perform a join with filtering:
Expected behavior
The
where
function on the result of join should correctly filter the data in any of the joined tables. The column names should be prefixed with table alias for disambiguation.Example
https://codepen.io/defr0zen/pen/wvGEQBZ
The text was updated successfully, but these errors were encountered: