[Oledb-dev] [patch] Re: Boolean columns corruption - cause found
Shachar Shemesh
psql at shemesh.biz
Sat May 6 09:56:02 UTC 2006
Victor Snezhko wrote:
>Patch attached.
>
>
>
>+void GetStatus_bool( const typeinfo *_this, ATLCOLUMNINFO *colinfo, PGresult *res,
>+ int field_num)
>+{
>+ typeinfo::StdStat( _this, colinfo, res, field_num );
>+ colinfo->ulColumnSize=sizeof(VARIANT_BOOL);
>+}
>
>
This makes no sense. If we need this for "bool" we're going to need this
for each and every other type that uses "StdStat" as well.
We need to either eliminate StdStat or do something more sane. A couple
of suggestions that come to mind:
1. Create "StdStat1", "StdStat2", "StdStat4" and "StdStat8".... It
seems... not clean.
2. Change the Width function (reading values) to also accept NULLs for
the "sess" and "res" fields. This will read to mean "maximal length
relevant type CAN return". Obviously there is no need to change the
"StdGw_" functions, and it is entirely possible that the rest will be
programed to just return "-1". This will allow StdStat to call the GW
function during initialization.
I'm not sure which one is best. I'm leaning, heavilly, towards "1", but
there is a chance that "2" can, in the future, provide a solution to our
bytea predicament somehow. In any case, I would like to rely on
"PQfsize" as little as possible, if we can.
Shachar
More information about the Oledb-devel
mailing list