-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix bug in locating fields when a JOIN clause is present #102
Conversation
@@ -169,6 +169,9 @@ pub struct TableSchema { | |||
} | |||
|
|||
impl TableSchema { | |||
/// Check if the `name` of the [FieldName] exist on this [TableSchema] | |||
/// | |||
/// Warning: It ignores the `table_name` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm; the relevance of this comment isn't entirely clear to me. Could you elaborate on this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will rework the field resolution because is broken now but is unrelated to the fix for this PR.
self.columns.iter().find(|x| x.col_name == name) | ||
/// Check if the `col_name` exist on this [TableSchema] | ||
/// | ||
/// Warning: It ignores the `table_name` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same re. relevance.
Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com> Signed-off-by: Mario Montoya <mamcx@elmalabarista.com>
Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com> Signed-off-by: Mario Montoya <mamcx@elmalabarista.com>
Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com> Signed-off-by: Mario Montoya <mamcx@elmalabarista.com>
Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com> Signed-off-by: Mario Montoya <mamcx@elmalabarista.com>
Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com> Signed-off-by: Mario Montoya <mamcx@elmalabarista.com>
Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com> Signed-off-by: Mario Montoya <mamcx@elmalabarista.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM + tested by Alessandro
* Fix bug in locating fields when a JOIN clause is present * Update crates/lib/src/relation.rs Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com> Signed-off-by: Mario Montoya <mamcx@elmalabarista.com> * Update crates/lib/src/relation.rs Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com> Signed-off-by: Mario Montoya <mamcx@elmalabarista.com> * Update crates/core/src/subscription/subscription.rs Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com> Signed-off-by: Mario Montoya <mamcx@elmalabarista.com> * Update crates/core/src/subscription/subscription.rs Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com> Signed-off-by: Mario Montoya <mamcx@elmalabarista.com> * Update crates/core/src/subscription/subscription.rs Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com> Signed-off-by: Mario Montoya <mamcx@elmalabarista.com> * Update crates/core/src/subscription/query.rs Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com> Signed-off-by: Mario Montoya <mamcx@elmalabarista.com> * Small doc nits * Fix test --------- Signed-off-by: Mario Montoya <mamcx@elmalabarista.com> Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com>
* Fix bug in locating fields when a JOIN clause is present * Update crates/lib/src/relation.rs Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com> Signed-off-by: Mario Montoya <mamcx@elmalabarista.com> * Update crates/lib/src/relation.rs Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com> Signed-off-by: Mario Montoya <mamcx@elmalabarista.com> * Update crates/core/src/subscription/subscription.rs Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com> Signed-off-by: Mario Montoya <mamcx@elmalabarista.com> * Update crates/core/src/subscription/subscription.rs Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com> Signed-off-by: Mario Montoya <mamcx@elmalabarista.com> * Update crates/core/src/subscription/subscription.rs Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com> Signed-off-by: Mario Montoya <mamcx@elmalabarista.com> * Update crates/core/src/subscription/query.rs Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com> Signed-off-by: Mario Montoya <mamcx@elmalabarista.com> * Small doc nits * Fix test --------- Signed-off-by: Mario Montoya <mamcx@elmalabarista.com> Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com>
* Fix bug in locating fields when a JOIN clause is present * Update crates/lib/src/relation.rs Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com> Signed-off-by: Mario Montoya <mamcx@elmalabarista.com> * Update crates/lib/src/relation.rs Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com> Signed-off-by: Mario Montoya <mamcx@elmalabarista.com> * Update crates/core/src/subscription/subscription.rs Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com> Signed-off-by: Mario Montoya <mamcx@elmalabarista.com> * Update crates/core/src/subscription/subscription.rs Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com> Signed-off-by: Mario Montoya <mamcx@elmalabarista.com> * Update crates/core/src/subscription/subscription.rs Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com> Signed-off-by: Mario Montoya <mamcx@elmalabarista.com> * Update crates/core/src/subscription/query.rs Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com> Signed-off-by: Mario Montoya <mamcx@elmalabarista.com> * Small doc nits * Fix test --------- Signed-off-by: Mario Montoya <mamcx@elmalabarista.com> Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com>
Description of Changes
When a
JOIN
clause is presented before was constructed a new table name likeTableA | TableB
, this cause locating fields forTableA
orTableB
fails.Also making more robust use of the hidden field
OP_TYPE_FIELD_NAME
, not assuming the location of it in the header.Adding
tracing
for theSQL
compilation step to see whichSQL
are running and more details in panics for subscription related to this PR.API
If the API is breaking, please state below what will break