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
Conversion error when both GROUP/ORDER BY expressions and WHERE expressions contain literals [CORE5743] #6007
Comments
Commented by: @asfernandes I need reproducible test case, with metadata and data of JOURNAL_CAISSE. |
Commented by: Pierre Yager (pierrey) I just extracted the "JOURNAL_CAISSE" table, its domains and several rows of production data from my production database. The database is declared as this in database.conf : core_5743 = P:/Databases/Neptis30/Core5743.fdb Just create the database, run the script and try to prepare/run this query : select |
Modified by: Pierre Yager (pierrey)Attachment: core_5743.sql [ 13207 ] Attachment: Core5743.fdb [ 13208 ] |
Modified by: @asfernandesassignee: Adriano dos Santos Fernandes [ asfernandes ] |
Modified by: @asfernandesstatus: Open [ 1 ] => Resolved [ 5 ] resolution: Fixed [ 1 ] Fix Version: 3.0.4 [ 10863 ] |
Modified by: @dyemanovsummary: Query parsing failed => Conversion error when GROUP/ORDER BY expressions contain literals |
Modified by: @dyemanovsummary: Conversion error when GROUP/ORDER BY expressions contain literals => Conversion error when both GROUP/ORDER BY expressions and WHERE expressions contain literals |
Modified by: @pavel-zotovstatus: Resolved [ 5 ] => Resolved [ 5 ] QA Status: No test => Done successfully |
Modified by: @pavel-zotovstatus: Resolved [ 5 ] => Closed [ 6 ] |
Commented by: John Franck (bozzy) I have a similar case, but mine doesn't involve grouping. My table: CREATE TABLE TEST_TABLE And my query: select What I get: Engine Code : 335544334 This occurs with a numeric constant field and a condition on a character field. The same occurs if we swap field types, i.e. character constant field and condition on numeric field: select Note that if I remove the primary key constraint from the table, then both the queries will work. Also, like the original case, casting the constant to a specified type solves the problem. Removing the ORDER BY clause also again solves the problem. Please, can someone verify if this behaviour has the same root cause than the original case, and so if it's already solved in 3.0.4? |
Commented by: @dyemanov It's the same. Either GROUP BY or ORDER BY is necessary. |
Submitted by: Pierre Yager (pierrey)
Is duplicated by CORE5749
Attachments:
core_5743.sql
Core5743.fdb
This query was known to work in Firebird 3.0.2 :
select
2 as TYPE_MVT,
TYPE_REGLEMENT,
DEVISE,
null as BANQUE
sum(QUANTITE) as NOMBRE,
sum(VALEUR) as MONTANT
from JOURNAL_CAISSE
where (TYPE_MOUVEMENT in (2, 3)) and (ANNULE is false)
and (periode = ?)
group by 1,2,3,4
Now,, in Firebird 3.0.3 I get :
Overflow occurred during data type conversion.
conversion error from string "2".
I have to cast "2" as Integer to make it work again.
select
cast(2 as Integer) as TYPE_MVT,
TYPE_REGLEMENT,
DEVISE,
null as BANQUE
sum(QUANTITE) as NOMBRE,
sum(VALEUR) as MONTANT
from JOURNAL_CAISSE
where (TYPE_MOUVEMENT in (2, 3)) and (ANNULE is false)
and (periode = ?)
group by 1,2,3,4
Commits: 90c072f c249b62
The text was updated successfully, but these errors were encountered: