像这样的查询基本上会解密每个 where 条件的用户名,还是只解密一次并将其应用于每个条件?
SELECT *
FROM TableA
WHERE (
CONCAT_WS(
' ',
AES_DECRYPT(TableA.FirstName, "fnkey"),
AES_DECRYPT(TableA.LastName, "lnkey")
) LIKE '%RAY%'
OR
CONCAT_WS(
' ',
AES_DECRYPT(TableA.LastName, "lnkey"),
AES_DECRYPT(TableA.FirstName, "fnkey")
) LIKE '%RAY%'
);