43668 was re-triages yesterday and assigned to Igor as lead. I just
changed 43669 to Server:Types also and set it to be re-triaged. This is
a problem for the server folks to solve since the server gets the wrong
answer on InnoDB and MyISAM if there is no index. It needs to be able to
handle '02'. Thanks for looking into this.
Lars-Erik Bjørk wrote:
> Hi all!
> Does anyone know how the server decided witch technique to use to get
> the max() min() values from the engine? (select max(c1) from t1)
> I have looked briefly at bugs
> * #43668 Falcon returns wrong MAX() value with year(2) type
> * #43669 Falcon returns diff. no of digits than other engines with MIN()
> for YEAR values
> I have concluded that bug#43668 is a server bug. MyISAM and InnoDB
> implements a handler function called ::index_last that finds the last
> value in the index directly, and therefore the engines only return one
> row to the server. Falcon does not implement this, and does not use the
> index and returns all the rows to the server. The server then makes the
> wrong decision on which YEAR-value that is the biggest. I have confirmed
> this by testing for the other engines without having an index on the
> YEAR field, in which case we also get the wrong result. (f. ex 99 > 01).
> Bug#43669 is less important. Falcon returns different number of digits
> when asked for the min() value. F. ex InnoDB and MyISAM returns '2',
> whereas Falcon returns '02'. The same case is happening here, the index
> is used by the other engines, but not by Falcon. If we don't use an
> index for the other engines either, they also return the "wrong" number
> of digits.
> The strange thing here is that Falcon seems to implement the handler
> functions used by the other engines, i.e ::index_first, so I am not sure
> why the index is not used here.
> Does anyone know how the server asks Falcon which technique to use? Is
> there some flag returned by Falcon for this? Does the same flag cover
> both max() and min()?