diff --git a/core/src/main/java/lucee/runtime/db/HSQLDBHandler.java b/core/src/main/java/lucee/runtime/db/HSQLDBHandler.java index 18b2b1772ba..3938e70d234 100644 --- a/core/src/main/java/lucee/runtime/db/HSQLDBHandler.java +++ b/core/src/main/java/lucee/runtime/db/HSQLDBHandler.java @@ -340,7 +340,8 @@ public QueryImpl execute(PageContext pc, final SQL sql, int maxrows, int fetchsi } catch (ParseException e) { - throw new DatabaseException(e.getMessage(), null, sql, null); + throw (IllegalQoQException) (new IllegalQoQException("QoQ: error executing sql statement on query, " + e.getMessage(), null, sql, null).initCause(e)); + //throw new DatabaseException(e.getMessage(), e, sql, null); } } diff --git a/test/_testRunner.cfc b/test/_testRunner.cfc index 617879c9d36..2b420b8ee7b 100644 --- a/test/_testRunner.cfc +++ b/test/_testRunner.cfc @@ -224,7 +224,7 @@ component { */ } if ( !isNull( specStat.error.sql ) && !isEmpty( trim(specStat.error.sql) ) ){ - systemOutput( TAB & "SQL: " & specStat.error.Detail, true ); + systemOutput( TAB & "SQL: [" & specStat.error.sql & "]", true ); } if ( !isNull( specStat.error.StackTrace ) && !isEmpty( specStat.error.StackTrace ) ){ systemOutput( TAB & specStat.error.type, true ); @@ -233,7 +233,7 @@ component { systemOutput( NL ); } - // systemOutput(NL & serialize(specStat.error), true); + //systemOutput(NL & serializeJson(specStat.error), true); } // if !isNull } diff --git a/test/tickets/LDEV4867.cfc b/test/tickets/LDEV4867.cfc index 467e5a629f0..80432c8532a 100644 --- a/test/tickets/LDEV4867.cfc +++ b/test/tickets/LDEV4867.cfc @@ -17,44 +17,60 @@ component extends="org.lucee.cfml.test.LuceeTestCase" labels="query" { }; function run( testResults , testBox ) { - describe( title='LDEV-4867' , body=function(){ + describe( title='LDEV-4867', body=function(){ - it( title='test query parsing, removing comments' , body=function() { + it( title='test query parsing, removing comments', body=function() { doTest( ["-- foo", "/* bar */", "SELECT engine from qry where id = :id "] ,[ "-- foo" , "/* bar */" ] ); }); - it( title='test query parsing, with a ? in a comment' , body=function() { + it( title='test query parsing, mixed nested comments', body=function() { + doTest( ["/* bar -- foo */", "SELECT engine from qry where id = :id ", "/* bar -- foo */"] + ,[ "/* bar -- foo */" ] + ); + doTest( ["--foo /* bar */", "SELECT engine from qry where id = :id ", "--foo /* bar */"] + ,[ "--foo /* bar */" ] + ); + }); + + it( title='test query parsing, nested comment blocks', skip=true, body=function() { + // Nested comments aren't generally supported anyway.... + doTest( ["/* bar /* #LF# -- foo #LF# */ */", "SELECT engine from qry where id = :id "] + ,[ "/* bar /* #LF# -- foo #LF# */ */" ] + ); + }); + + it( title='test query parsing, with a ? in a comment', body=function() { doTest( [ "-- foo", "/* bar? */", "SELECT engine"," from qry", "where id = :id" ] ,[ "-- foo", "/* bar? */" ] ); }); - it( title='test query parsing, with a ? in a /* */ comment' , body=function() { + it( title='test query parsing, with a ? in a /* */ comment', body=function() { doTest( [ "-- foo", "/* bar? */", "SELECT engine"," from qry", "where id = :id" ], [ "-- foo", "/* bar? */" ] ); }); - it( title='test query parsing, with a ? and : in a comment' , body=function() { + it( title='test query parsing, with a ? and : in a comment', body=function() { doTest( [ "-- foo ? :do", "/* bar? :*/", "SELECT engine"," from qry", "where id = :id" ], [ "-- foo ? :do", "/* bar? :*/" ] ); }); - it( title='test query parsing, with a ? in a comment' , body=function() { + it( title='test query parsing, with a ? in a comment', body=function() { doTest( [ "-- foo ? :do", "/* bar? :*/", "SELECT engine"," from qry", "where id = :id" ], [ "-- foo ? :do", "/* bar? :*/" ] ); }); - it( title='test query parsing, with a ? in a trailing line comment' , body=function() { + it( title='test query parsing, with a ? in a trailing line comment', body=function() { doTest( [ "SELECT engine"," from qry", "where id = :id", "-- foo ? :do" ], [ "-- foo ? :do" ] ); }); - it( title='test query parsing, with a ? in a trailing comment block' , body=function() { + it( title='test query parsing, with a ? in a trailing comment block', body=function() { doTest( [ "SELECT engine"," from qry", "where id = :id", "/* foo ? :do */" ], [ "/* foo ? :do */" ] );