Mailing List
Home
Forum Home
MySQL General - General MySQL discussion
MaxDB - Everything about MaxDB, formerly known as SAP DB
MySQL++ - Programming with the C++ API to MySQL
MySQL on Win32 - Runing MySQL on Windows 9x/Me/NT/2000/XP
ODBC - ODBC with the MySQL Connector/ODBC driver
Java Help - Mostly related to the MySQL Connector/J driver
Perl - Perl support for MySQL with DBI and DBD::mysql
GUI - MySQL GUI Tools
Announcement
Subjects
mysql openssl Question
mysql:it 's a db not a dbms how it 's possible?!
Does the binary log enabling affect the MySQL performances?
Strange behavior, Table Level Permission
FULLTEXT query format question
Preventing Duplicate Entries
Comparing and writing out BLOBS
Executing MySQL Commands From Within C Program
Can 't access mysql after kernel upgrade
Mysql 4 0 Oracle Stored Procedure Trigger Conversion
Downgrade Mysql from 4 to 3 23
MySQL Cluster Software
mysql test 4 1 fails with the gis test
ERROR 2002: Can 't connect to local MySQL server through socket
Getting Identity after INSERT
Update one field with more fields from another table
ERROR 1045: Access denied for user: 'root@localhost ' (Using
password: NO)
mysql have same function mthod as Oracle decode()
 
Escape characters handled differently between mysql and DBD: mysql ???

Escape characters handled differently between mysql and DBD: mysql ???

2005-01-13       - By Garry Williams

 Back
On Wed, Jan 12, 2005 at 16:01:26 -0500, David Jacopille wrote:
> I've used INSERT to load the following string exactly as shown with the
> double backslashes:
>
> (.+)\\.[0-9A-Z]+(\\.pdf)$
>
> When issuing a SELECT statement directly in mysql from a terminal window I
> get exactly the regular expression I want and would expect:
>
> (.+)\.[0-9A-Z]+(\.pdf)$
>
> When issuing the same select statement in a Perl script using DBI and
> DBD::mysql I get the double backslash plus an extra bonus escape character
> for the $.
>
> (.+)\\.[0-9A-Z]+(\\.pdf)\$

I cannot reproduce this:

   mysql> create table foo (string varchar(255));
   Query OK, 0 rows affected (0.03 sec)

   mysql> insert into foo (string) values('(.+)\\.[0-9A-Z]+(\\.pdf)$');
   Query OK, 1 row affected (0.00 sec)

   mysql> select * from foo;
   +-- ---- ---- ---- ---- --+
   | string                  |
   +-- ---- ---- ---- ---- --+
   | (.+)\.[0-9A-Z]+(\.pdf)$ |
   +-- ---- ---- ---- ---- --+
   1 row in set (0.03 sec)

   mysql> Bye
   $ perl -MDBI -wle '$dbh=DBI->connect("dbi:mysql:test:localhost");($s)=$dbh-
>selectrow_array("select * from foo");print $s'
   (.+)\.[0-9A-Z]+(\.pdf)$
   $ mysql --version
   mysql  Ver 12.22 Distrib 4.0.20, for mandrake-linux-gnu (i586)
   $ mysqld --version
   mysqld  Ver 4.0.20 for mandrake-linux-gnu on i586 (Source distribution)
   $ perl -MDBI -le 'print $DBI::VERSION'
   1.43
   $ perl -MDBD::mysql -le 'print $DBD::mysql::VERSION'
   2.0419
   $

--
Garry Williams, Zvolve Systems, Inc., +1 770 813-4934
                               Cell: +1 404 353-2983

--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe:    http://lists.mysql.com/perl?unsub=mysql@(protected)