[DBAL-124] OCI8 Adapter (convertPositionalToNamedPlaceholders) Statemachine doesn't consider comments and strings Created: 20/May/11 Updated: 28/Jun/11
|Reporter:||Carsten Hetzel||Assignee:||Benjamin Eberlei|
SQL statements may contain question marks in strings, inline comments or comment blocks. The current implementation of the method "convertPositionalToNamedPlaceholders()" doesn't consider these implications and falsely replaces them by named bind variables.
Replacement code with example:
|Comment by Benjamin Eberlei [ 19/Jun/11 ]|
This algorithmus is painfully slow. There has to be something better, why do you need to foreach the loop inside the for?
|Comment by Carsten Hetzel [ 28/Jun/11 ]|
Ok, sent you a PM but I'll put my response here, too:
"Painfully slow" at what circumstances? Benchmarks?
This was meant as an example implementation to show the problems of the current implementation - there's always room for improvement.
And never forget: Premature optimization is the root of all evil! ;-p
You want speed - try this one:
ATTENTION: Each "break 2;" means, you have an invalid statement! Do, whatever the statement class is supposed to do in this case!