SQLite Forum

HEX function returns empty string on null input, normal?
Login
Like I said before:

hex() documentation says "interprets its argument as a BLOB"

substr() documentation says "... input string X ..." and goes on to define the difference between passing a string (utf codepoints are counted) and a BLOB (bytes are counted)

none of the other string functions says anything about interpreting any argument as anything.

This may be different to the mySQl HEX() function, but the documentation refers to the CONV() function which explicitly states a NULL return for a NULL input.

Workarounds have been suggested, and I reckon a change is unlikely, as it might break backwards compatibility, so any further discussion is moot.