SQLite Forum

HEX function returns empty string on null input, normal?
Login
Is this by design?

```
.null NULL_VALUE
select null;
┌────────────┐
│    null    │
├────────────┤
│ NULL_VALUE │
└────────────┘
select hex(null);
┌───────────┐
│ hex(null) │
├───────────┤
│           │
└───────────┘
select typeof(hex(null));
┌───────────────────┐
│ typeof(hex(null)) │
├───────────────────┤
│ text              │
└───────────────────┘
select hex('')=hex(null);
┌───────────────────┐
│ hex('')=hex(null) │
├───────────────────┤
│ 1                 │
└───────────────────┘
```

I would expect null output on null input.
Instead it returns an empty string.