Hi Folks,
after some sleepless nights about trailing blanks, memory-e...
a) in IscStatement.cpp:
void IscStatement::setValue(Value *value, XSQLVAR *var)
{
if ((var->sqltype & 1) && *var->sqlind == -1)
value->setNull();
else
switch (var->sqltype & ~1)
{
case SQL_TEXT:
{
char *data = (char*) var->sqldata;
// OKok... I thought it wolud be a good idea to do "data [var->sqllen-1 ] = 0; " but this had some horrible effects.. so let's return to the
good old times ...
data [var->sqllen-1 ] = 0;
value->setString (data, false);
}
break;
// BUT ! Let's treat the VARCHARS like this:
case SQL_VARYING:
{
int length = var->sqllen-2;
char *data = var->sqldata + 2;
value->setString (length, data, false);
}
break;
// I could not see that varchars really use the first two bytes to describe their length :-(
// If we do this, we also should send the real text-length i.e.:
b) sqlda.cpp
int Sqlda::getPrecision(...)
// insert the following behind line 335:
case SQL_TEXT:
return var->sqllen-1;
case SQL_VARYING:
return var->sqllen-2;
// do the same after line 279 in getDisplaySize.
c) some minor bug: IscTablesResultSet
IscTablesResultSet::getTables(...)
// change line 68 to this: ( replace the first %s with = )
sql += expandPattern (" where rdb$relation_name = '%s'\n", tableNamePattern);
d) and a mistype in TimeStamp.cpp line 53:
TimeStamp::operator =(DateTime value)
// just remove the brackets ...
date = value.date / 24/60/60;
I hope this will help ....
-----
Now to something completly different:
Does someone also use VisualFoxpro ?
Bernhard Schulte
|