You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
first, as the \x00 is interpreted by php engine (in mysql it just translates to literal string \, x, 0, 0), needed to use different approach, \0 or char(0) both output null byte, but that's also char * string terminator in C, which results error that pattern separator is missing:
mysql>select preg_replace(concat('/[', char(0), '-', 0x08, 0x0b, '-', 0x1f, 0x7f, ']/'), 'a', concat('C',char(0x10),'kammkala'));
ERROR:
No ending delimiter found
mysql>select preg_replace(concat('/[', '\0', '-', 0x08, 0x0b, '-', 0x1f, 0x7f, ']/'), 'a', concat('C',char(0x10),'kammkala'));
ERROR:
No ending delimiter found
mysql>
so as workaround to my problem, i'm using mysql native replace function.
so i wanted to implement strip control chars from input, like php-equivalent:
https://github.com/glensc/php-filename-normalizer/blob/d772aaad6b2a157787ae17320de5db4d3715df72/src/Normalizer.php#L30
first, as the
\x00
is interpreted by php engine (in mysql it just translates to literal string\
,x
,0
,0
), needed to use different approach,\0
orchar(0)
both output null byte, but that's alsochar *
string terminator in C, which results error that pattern separator is missing:so as workaround to my problem, i'm using mysql native
replace
function.the UDF function should be able to accept
\0
in input.The text was updated successfully, but these errors were encountered: