Bug 51607 - DBDPrepareSQL ( ap_dbd_prepare ) does not work correctly with SQL Statements which has % characters in functions like DATE_FORMAT.
DBDPrepareSQL ( ap_dbd_prepare ) does not work correctly with SQL Statements ...
Status: NEEDINFO
Product: Apache httpd-2
Classification: Unclassified
Component: mod_dbd
2.3.12-beta
PC Linux
: P2 normal (vote)
: ---
Assigned To: Apache HTTPD Bugs Mailing List
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2011-08-03 16:18 UTC by Firat Sarlar
Modified: 2012-05-01 14:39 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Firat Sarlar 2011-08-03 16:18:31 UTC
An SQL statemnet like 
"SELECT ID, DATE_FORMAT(  post_date, '%d.%M.%Y %W %H:%i ') AS p_d , post_title, post_content FROM posts;"

With mysql driver.

is not correctly prepared.

This may result of escaping % chars.

Also this bug may be releated to apr_dbd_mysql_driver.
Comment 1 Daniel Gruno 2012-05-01 05:36:46 UTC
From what I can tell, this is simply a matter of internal mechanics using the % sign as an indicator of a variable (%s being most noteworthy). Have you tried using %% instead to denote a percentage sign? Please try so, and if successful, do reply back, so I can perhaps put a note about it in the docs, so we can avoid future bug reports like this.
Comment 2 Firat Sarlar 2012-05-01 14:39:44 UTC
I can not try double % for now - I don't have test env. anymore- but I'm quite sure I have tried many things to avoid errors .