[PATCH][RESUBMIT] mysql_db_quote + UTF8 flagged strings

[PATCH][RESUBMIT] mysql_db_quote + UTF8 flagged strings

am 25.08.2004 12:47:27 von cubic

--------------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"

ZGlmZiAtcnUgREJELW15c3FsLTIuOTAwMy9kYmRpbXAuYyBEQkQtbXlzcWwt Mi45MDAzLW15
L2RiZGltcC5jCi0tLSBEQkQtbXlzcWwtMi45MDAzL2RiZGltcC5jCTIwMDMt MTAtMTcgMjE6
MjA6NTAuMDAwMDAwMDAwICswNDAwCisrKyBEQkQtbXlzcWwtMi45MDAzLW15 L2RiZGltcC5j
CTIwMDQtMDUtMDMgMjE6MTI6NDEuMDAwMDAwMDAwICswNDAwCkBAIC0yNDQ5 LDYgKzI0NDks
MTAgQEAKIAkqc3B0cisrID0gJ1wwJzsgIC8qICBOZXZlciBodXJ0cyBOVUwg dGVybWluYXRp
bmcgYSBQZXJsCiAJCQkgICoJIHN0cmluZyAuLi4KIAkJCSAgKi8KKyNpZiAo KFBFUkxfUkVW
SVNJT04gPj0gNSkgJiYgKFBFUkxfVkVSU0lPTiA+PSA4KSkKKwlpZihTdlVU Rjgoc3RyKSkK
KwkgICAgU3ZVVEY4X29uKHJlc3VsdCk7CisjZW5kaWYKICAgICB9CiAgICAg cmV0dXJuIHJl
c3VsdDsKIH0K

--------------010008020703000809000806
Content-Type: text/plain; charset=us-ascii

--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules@m .gmane.org
--------------010008020703000809000806--