Mantis Bugtracker
  

Viewing Issue Advanced Details Jump to Notes ] View Simple ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0004713 [Quercus] major always 08-16-11 08:40 06-21-12 13:38
Reporter jamesdlow View Status public  
Assigned To nam
Priority normal Resolution fixed Platform
Status closed   OS
Projection none   OS Version
ETA none Fixed in Version Product Version 4.0.14
  Product Build
Summary 0004713: Certain Valid MySQL statements fail
Description Certain mysql statements seem to fail in in Quercus when doing PDO.

A statement like:
update {table} set {column} = 'A string which we\'ve escaped but has a colon :'

This fails because there is a colon in the string after an escaped apostrophe. The strange thing is that it doesn't occur if there are two escape apostrophe's before the colon.

I've managed to track it down to: PDOStatement.parseQueryString where it is checking for colons within a statement. If I remove this check the MySQL query works.
      else if (quote == 0 && ch == ':') {
        parameterCount++;
        name = new StringBuilder();
        continue;
      }
Steps To Reproduce
Additional Information
Attached Files

- Relationships

- Notes
(0005924)
nam
06-21-12 13:38

php/1s1e

colons in quotes should work now:

$stmt = $pdo->prepare("SELECT * FROM test WHERE data = ':a'");
var_dump($stmt->execute());
var_dump($stmt->fetchAll());
 

- Issue History
Date Modified Username Field Change
08-16-11 08:40 jamesdlow New Issue
08-16-11 08:42 jamesdlow Issue Monitored: jamesdlow
06-21-12 13:37 nam Status new => assigned
06-21-12 13:37 nam Assigned To  => nam
06-21-12 13:38 nam Status assigned => closed
06-21-12 13:38 nam Note Added: 0005924
06-21-12 13:38 nam Resolution open => fixed


Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
30 total queries executed.
26 unique queries executed.
Powered by Mantis Bugtracker