Skip to content

Commit

Permalink
improve error message for join in with query
Browse files Browse the repository at this point in the history
  • Loading branch information
ujjwalguptaofficial committed Nov 26, 2024
1 parent ed7e545 commit 7d9b871
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/worker/executors/select/join.ts
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ class Join {
// check on info & with info
if (qry.with !== table2.table) {
err = new LogHelper(ERROR_TYPE.InvalidJoinQuery,
`on value should contains value of with`
`The 'on' condition must reference a column from the table specified in 'with'. Found '${qry.on}', but '${qry.with}' was provided in 'with'.`
);
}

Expand Down
4 changes: 2 additions & 2 deletions test/cases/select/join.js
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ describe('Test join', function () {
}).catch(function (err) {

var error = {
"message": "on value should contains value of with",
"message": "The 'on' condition must reference a column from the table specified in 'with'. Found 'Orders.customerId=Customers.customerId', but 'invalid_table' was provided in 'with'.",
"type": "invalid_join_query"
}
expect(err).to.eql(error);
Expand Down Expand Up @@ -915,4 +915,4 @@ describe('Test join', function () {
}).catch(done);
})

});
});

0 comments on commit 7d9b871

Please sign in to comment.