We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dcc8175 commit d55874aCopy full SHA for d55874a
cratedb_sqlparse_js/cratedb_sqlparse/parser.js
@@ -223,7 +223,14 @@ export function sqlparse(query, raise_exception = false) {
223
let statements = []
224
for (const statementContext of statementsContext) {
225
let stmt = new Statement(statementContext)
226
- findSuitableError(stmt, errorListener.errors)
+
227
+ if (statementsContext.length === 1 && errorListener.errors) {
228
+ stmt.exception = errorListener.errors.pop();
229
230
+ } else {
231
+ findSuitableError(stmt, errorListener.errors)
232
+ }
233
234
statements.push(stmt)
235
}
236
0 commit comments