[PATCH] mysql_db_quote + UTF8 flagged strings

[PATCH] mysql_db_quote + UTF8 flagged strings

am 03.05.2004 19:55:24 von cubic

--------------030702060107050207090609
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Hello.
Attached patch fix problems for users of perl5.8.x and strings with UTF8
flag enabled.

In general case current code shouldn't give user big problems(it just
doesn't copy UTF8 flag on new string), but perl(5.8.{0..4}) has small
bug in 'sassign' op code and perl doesn't drop magic from strings in
next code:

$utf_str = $dbh->quote( $utf_str );

under some conditions(I can't figure them out) $utf_str can be currupted
in future use.

This patch works as workaround for perl bug and also fix logic of mysql
quote sub which should copy UTF8 flag if it is set on src str.

Best regards. Ruslan.

PS. PERL_VERSION check should be changed to right values, I don't know
when UTF8 flag was introduced.


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

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