SQL queries to MariaDB may result in the following error
Error in result_fetch(res@ptr, n = n) : embedded nul in string
This one occurs when the text column contains embedded nul in \0.
As a workaround, this column can be cast to BINARY as follows
CASE(col1 as BINARY)