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
Query issue conversion error from string #7916
Comments
I see the same error on v4.0.2, as well as on v3.0.11. Moreover, I'd say it could never work any different way, unless Condition |
The original query was working up until 4.0.2, This attempt at a repro doesn't. Another method to work around the issue is to use a single predicate rather than the two separate ones:
|
I would argue that the condition |
Yes, you're right here, my answer wasn't fully correct. I need to investigate this further, maybe some improvement could be possible. As for your original query, I suppose the v4.0.2 optimizer could not detect that expression |
We have a query that was working fine up until FB 4.0.2. Recently applied patch 4.0.4 and now the query fails with "conversion error from string 'xxx'". I have made a small repro case below except this also exhibits the odd behavior on 4.0.2. Work-arounds follow.
If you run the above you'll get conversion error from string "TEST". Seems to be related to the primary key index causing the parser to prioritize the focus on the 2nd predicate of the 3rd join which is casting the field to SMALLINT.
and stf.staffid = cast(trim(sess.sess_user) as smallint)
Interestingly, by commenting out the 2nd join, the query works fine:
And also, preventing usage of the index (stf.staffid+0) also allows the query to work as expected:
The text was updated successfully, but these errors were encountered: