We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
from
In a select with multiple from, index hint is simply placed after the last one which produces incorrect SQL.
fn main() { let sql = Query::select() .column(Asterisk) .from(Alias::new("a")) .force_index(IndexName::new("idx_a"), IndexHintScope::All) .from(Alias::new("b")) .force_index(IndexName::new("idx_b"), IndexHintScope::All) .to_string(MysqlQueryBuilder); println!("{sql}"); }
Correct SQL would be
SELECT * FROM `a` FORCE INDEX (`idx_a`), `b` FORCE INDEX (`idx_b`)
Actual generated SQL:
SELECT * FROM `a`, `b` FORCE INDEX (`idx_a`) FORCE INDEX (`idx_b`)
Which results in an error: Key 'idx_a' doesn't exist in table 'b'
Key 'idx_a' doesn't exist in table 'b'
Always
sea-query 0.30.7
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Description
In a select with multiple
from
, index hint is simply placed after the last one which produces incorrect SQL.Steps to Reproduce
Expected Behavior
Correct SQL would be
Actual Behavior
Actual generated SQL:
Which results in an error:
Key 'idx_a' doesn't exist in table 'b'
Reproduces How Often
Always
Versions
sea-query 0.30.7
The text was updated successfully, but these errors were encountered: