Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,16 @@ public String perform() {

while ( tokens.hasMoreTokens() ) {
token = tokens.nextToken();
lcToken = token.toLowerCase(Locale.ROOT);

if ( "-".equals(token) && result.toString().endsWith("-") ) {
do {
result.append( token );
token = tokens.nextToken();
}
while ( !"\n".equals( token ) && tokens.hasMoreTokens() );
}

lcToken = token.toLowerCase(Locale.ROOT);
switch (lcToken) {

case "'":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -836,6 +836,12 @@ public void testAddJoinForManyToMany(SessionFactoryScope scope) {
);
}

@Test @JiraKey( "HHH-15102" )
@SkipForDialect(dialectClass = MySQLDialect.class, matchSubTypes = true)
public void testCommentInSQLQuery(SessionFactoryScope scope) {
scope.inTransaction( s -> s.createNativeQuery( "select sum(1) --count(*), effectively\nfrom ORGANIZATION" ).getSingleResult() );
}

@Test
public void testTextTypeInSQLQuery(SessionFactoryScope scope) {
String description = buildLongString( 15000, 'a' );
Expand Down
Loading