From: Ruslan U. Zakirov Date: August 25 2004 10:47am Subject: [PATCH][RESUBMIT] mysql_db_quote + UTF8 flagged strings List-Archive: http://lists.mysql.com/perl/3139 Message-Id: <412C6E3F.6020706@acronis.ru> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------010008020703000809000806" --------------010008020703000809000806 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Hello. I didn't get any feedback on patch, but it is still major problem for users of UTF8 strings cause we have to workaround DBD::mysql behavior. Attached patch fix problems for users of perl5.8.x when somebody try quote strings with UTF8 flag enabled: $new_str = $dbh->quote( $utf_str ); # new_str lost UTF flag. DBD::mysql doesn't preserve UTF8 flag. This is wrong because in future if you try to join quoted string with another UTF string then quoted part would be corrupted. This patch fix DBD::mysql quote sub which should copy UTF8 flag if it is was set on src str. Best regards. Ruslan. PS. May be PERL_VERSION check should be changed to right values, I don't know when exactly UTF8 flag was introduced. --------------010008020703000809000806 Content-Type: application/aegis-patch; name="mysql_quote_utf_fix.patch" Content-Transfer-Encoding: base64 Content-Disposition: inline; filename="mysql_quote_utf_fix.patch" ZGlmZiAtcnUgREJELW15c3FsLTIuOTAwMy9kYmRpbXAuYyBEQkQtbXlzcWwtMi45MDAzLW15 L2RiZGltcC5jCi0tLSBEQkQtbXlzcWwtMi45MDAzL2RiZGltcC5jCTIwMDMtMTAtMTcgMjE6 MjA6NTAuMDAwMDAwMDAwICswNDAwCisrKyBEQkQtbXlzcWwtMi45MDAzLW15L2RiZGltcC5j CTIwMDQtMDUtMDMgMjE6MTI6NDEuMDAwMDAwMDAwICswNDAwCkBAIC0yNDQ5LDYgKzI0NDks MTAgQEAKIAkqc3B0cisrID0gJ1wwJzsgIC8qICBOZXZlciBodXJ0cyBOVUwgdGVybWluYXRp bmcgYSBQZXJsCiAJCQkgICoJIHN0cmluZyAuLi4KIAkJCSAgKi8KKyNpZiAoKFBFUkxfUkVW SVNJT04gPj0gNSkgJiYgKFBFUkxfVkVSU0lPTiA+PSA4KSkKKwlpZihTdlVURjgoc3RyKSkK KwkgICAgU3ZVVEY4X29uKHJlc3VsdCk7CisjZW5kaWYKICAgICB9CiAgICAgcmV0dXJuIHJl c3VsdDsKIH0K --------------010008020703000809000806--