[fpc-devel] Implementing TFmtBCDField - ftFmtBCD and SQLite
lacak at zoznam.sk
Fri Apr 1 15:26:26 CEST 2011
> No, map to ftfmtbcd, as it should. That will work fine as long as the
> values are within the sqlite-range.
ok. in reading phase no problem
(ATM we read using sqlite3_column_text (so SQLite converts all storage
classes (integer,real, blob) to string) and then converting to TBCD ... ok
> (Well, show me the bug: as it is now, he won't get an exception? Just
> map to ftmbcd)
yes now no exception it is ok as is
> the user will only get an invalid value when he stores a
> value outside the sqlite-precision scope. Exactly what he would expect
> when he uses sqlite.
I can live with this, but do not forget, that ATM there is not
implemented writting of ftFmtBCD parameters in Procedure
TSQLite3Cursor.bindparams(AParams : TParams);
So writting never occurs!
So there we must add at least ftFmtBCD case, (behind ftbcd)
But If we add this code (excuse me, I must offer it) ;-):
//it is only pseudo code
if P.AsFMTBCD.Precision > 15 then //we are out-of-range
length(str1), at freebindstring));
Then all cases will be covered and no additional work around are needed.
P.S.: P.AsFMTBCD: http://bugs.freepascal.org/view.php?id=18809
More information about the fpc-devel