A string literal was opened and never closed.
select * from t where name = 'O'Brien'- Why:
- A single quote inside a SQL string has to be doubled, not backslash-escaped. Written this way the literal ends at the quote in the middle of the name and the rest of the line becomes syntax.
- Fix:
- Double the quote: 'O''Brien'. Better still, bind it as a parameter and let the driver handle it.