Topic: The server replaces field type at grouping in representation
Some days ago already tried to ask this question, but, seemingly, in vain formulated it with an emphasis towards application. Meanwhile, feet grow to the server.
So, we create, the table:
CREATE TABLE A ( ID D_INTEGER NOT NULL/* D_INTEGER = INTEGER */; FLAG D_BOOLEAN/* D_BOOLEAN = INTEGER CHECK (VALUE BETWEEN 0 and 1) */ )
On its basis we create simple representation:
CREATE OR ALTER VIEW VIEW_SIMPLE (ID, FLAG) AS select id, flag from a;
We look types of fields (I look in IBExpert) and we see D_INTEGER and D_BOOLEAN. Now we create similar representation, but with grouping (for simplification we do not use even aggregate functions though with them the result is similar):
CREATE OR ALTER VIEW VIEW_GROUP (ID, FLAG) AS select id, flag from a group by 1,2;
On an output it is received fields of typeful type RDB$24155, RDB$24156. But why?
I could understand, if types have been replaced for fields to which aggregates of type SUM are applied, but in this case the value range of fields cannot change!