On 6/2/15, Igor Tandetnik <igor at tandetnik.org> wrote:
> On 6/2/2015 2:28 AM, Hick Gunter wrote:
>> Sqlite3_column_bytes will convert numeric values to strings and return the
>> length of that "string representation" (excluding the terminating \0), not
>> the byte size required to store the numeric value itself.
>
> So will length() SQL function, I'm pretty sure.

Yes, both length() and sqlite3_column_bytes() will convert numbers to
strings before computing the length.  However, they are not
equivalent.

The length() SQL function returns the number of *characters*.  The
sqlite3_column_bytes() C function returns the number of *bytes*.

-- 
D. Richard Hipp
drh at sqlite.org

Reply via email to