I am trying to use 'encode' (and decode) in mariadb/mysql to pass an encrypted string. However when I do, myDBR displays an error:
"Incorrect string value: '\x8Ep\x06U\x0C\xE8...' for column ``.``.`vEncoded` at row 1"
which might be the encoded string not being parsed properly in php/myDBR (or might be something else unrelated!).
You can replicate this with:
CREATE DEFINER=`myuser`@`localhost` PROCEDURE `sp_DBR_test_encode`(inLogin varchar(100))
DECLARE vDecoded varchar(75) DEFAULT sha2("qwerty", 256); DECLARE vEncoded varchar(75) DEFAULT '';
SELECT vDecoded, ENCODE(vDecoded, "!myd6r") AS strEncoded, DECODE(ENCODE(vDecoded, "!myd6r"), "!myd6r") AS strDecoded; SET vEncoded = ENCODE(vDecoded, "!myd6r");
This might be a mariadb/mysql character set setting issue, but I've tried a few things (change the server/system character set) that might have helped and it made no difference, so I'm also wondering if it is a utf8 to utf8mb4 issue in myDBR.