Regex replace with empty string results in NULL characters in between
Ugh!  The plot thickens:

mysql&gt; SELECT REGEXP_REPLACE('abcd', 'c', '') = 'abd';
+-----------------------------------------+
| REGEXP_REPLACE('abcd', 'c', '') = 'abd' |
+-----------------------------------------+
|                                       1 |
+-----------------------------------------+

mysql&gt; SELECT HEX(REGEXP_REPLACE('abcd', 'c', '')), HEX('abd');
+--------------------------------------+------------+
| HEX(REGEXP_REPLACE('abcd', 'c', '')) | HEX('abd') |
+--------------------------------------+------------+
| 610062006400                         | 616264     |
+--------------------------------------+------------+

mysql&gt; SELECT LENGTH(REGEXP_REPLACE('abcd', 'c', '')), LENGTH('abd');
+-----------------------------------------+---------------+
| LENGTH(REGEXP_REPLACE('abcd', 'c', '')) | LENGTH('abd') |
+-----------------------------------------+---------------+
|                                       6 |             3 |
+-----------------------------------------+---------------+

mysql&gt; SELECT @@version;
+-----------+
| @@version |
+-----------+
| 8.0.15    |
+-----------+


Looks like there are NULs all over!  And looks like they are ignored--somewhat!

I filed http://bugs.mysql.com/94203

MariaDB 10.3.11 "does the right thing"  ( 1 / no NULs / 3,3 )