3 Feb 17:49
Issues with DBI/SQL abstraction layer
Hi,
I have a (severe?) issue with the SQL abstraction layer. I am using
mysql as backend and unfortunatly no clue about other rdbms - therefore
I need some feedback if the issue is mysql only or not.
Problem:
I am searching a certificate by its subject, the subject I am looking
for contains a backshlash character.
my $issuer_dn = "OU=Trustcenter,O=Snakeoil\, Inc.,C=US";
CTX('dbi_backend')->first(
TABLE => 'CERTIFICATE',
COLUMNS => [ 'IDENTIFIER' ],
DYNAMIC => {
'SUBJECT' => $issuer_dn,
'PKI_REALM' => $pki_realm
});
I get an empty result, which I tracked down to:
According OpenXPKI::Server::DBI::SQL, Line 979 the query uses a "like"
statement on the condition. In mysql the backslash is an escape
character when used in like statements:
http://dev.mysql.com/doc/refman/5.0/en/string-comparison-functions.html
Workaround: I ended up now in adding slashes to this special query,
which does the job, but I expect that can make some headache one day in
any other query, too. Besides I do not now what happens on other RDBMS.
(Continue reading)
RSS Feed