Paste this into a new question or an answer at dba.stackexchange.com:
<!-- --> > set @str = ' ' > > <pre> > ✓ > </pre> <!-- --> > CREATE FUNCTION some_char_length( str CHAR(1)) > RETURNS int > LANGUAGE SQL > no SQL > > return char_length(str) > > <pre> > ✓ > </pre> <!-- --> > select some_char_length( ' ') > > <pre> > | some_char_length( ' ') | > | ---------------------: | > | 0 | > </pre> <!-- --> > select char_length(@str) > > <pre> > | char_length(@str) | > | ----------------: | > | 1 | > </pre> <!-- --> > select char_length(' ') > > <pre> > | char_length(' ') | > | ---------------: | > | 1 | > </pre> *db<>fiddle [here](https://dbfiddle.uk/?rdbms=mariadb_10.2&fiddle=8b22a5a31dc3e12d8806c845df889689)*
back to fiddle