// this segfaults only after 65,000 characters instead of 9,000
$sql =
preg_replace("/
$q([^
$q{
$escapeChar}]*|(
$qe)*)*
$q/s", '',
$sql);
} // get a version of the SQL statement with all quoted
// values and delimited identifiers stripped out
// remove "foo\"bar"
$sql =
preg_replace("/\"(\\\\\"|[^\"])*\"/Us", '',
$sql);
// get the character for delimited id quotes,
// this is usually " but in MySQL is `
$d =
$this->_adapter->
quoteIdentifier('a'
);
$d =
$d[0
];
// get the value used as an escaped delimited id quote,
// e.g. \" or "" or \`
$de =
$this->_adapter->
quoteIdentifier($d);
$de =
substr($de, 1, 2
);
$de =
preg_quote($de);
// Note: $de and $d where never used..., now they are:
$sql =
preg_replace("/
$d(
$de|\\\\{2}|[^
$d])*
$d/Us", '',
$sql);
return $sql;
}