https://bugs.documentfoundation.org/show_bug.cgi?id=156530

--- Comment #17 from Julien Nabet <serval2...@yahoo.fr> ---
(In reply to Lionel Elie Mamane from comment #16)
> (In reply to Lionel Elie Mamane from comment #14)
> 
> > So we need to "understand" whether that is really
> > an integer or the integer storage for a NUMERIC or DECIMAL, but I don't
> > immediately see how one determines that.
> 
> Hmm... Try something like that:
> 
>...
Ok I'll try this (rather tomorrow since it's getting a bit late for me)

> Additionally this code is fundamentally wrong, at least placed where it is.
> 
> 200      if (str.getLength() > pVar->sqllen)
> 201          str = str.copy(0, pVar->sqllen);
> 
> It is not linked to "believing we need an integer value", it is just a
> coincidence; an SQL_LONG takes four bytes AND IN THIS PARTICULAR EXAMPLE,
> four CHARACTERS OF THE STRING takes the integer value plus the dot, BUT
> THAT'S JUST A COINCIDENCE. This code should be only in the codepath of the
> cases SQL_VARYING, SQL_TEXT, SQL_BLOB, and NOT in the cases
> SQL_INT/LONG/FLOAT/etc.
> ...
I had noticed this too and had begun to change this. However, I had removed it
in my first attempt to reduce noise.
In the same way,
OString str = OUStringToOString(sInput , RTL_TEXTENCODING_UTF8 );
is only useful for SQL_VARYING and SQL_TEXT parts.
and finally just a nitpick, I thought about adding brackets for SQL_TEXT and 
SQL_BLOB (just wonder why only these don't have them).

Thank you for all the feedback! :-)

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to