File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed
main/java/org/hibernate/engine/jdbc/internal
test/java/org/hibernate/orm/test/sql/hand/query Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -69,8 +69,16 @@ public String perform() {
69
69
70
70
while ( tokens .hasMoreTokens () ) {
71
71
token = tokens .nextToken ();
72
- lcToken = token .toLowerCase (Locale .ROOT );
73
72
73
+ if ( "-" .equals (token ) && result .toString ().endsWith ("-" ) ) {
74
+ do {
75
+ result .append ( token );
76
+ token = tokens .nextToken ();
77
+ }
78
+ while ( !"\n " .equals ( token ) && tokens .hasMoreTokens () );
79
+ }
80
+
81
+ lcToken = token .toLowerCase (Locale .ROOT );
74
82
switch (lcToken ) {
75
83
76
84
case "'" :
Original file line number Diff line number Diff line change @@ -836,6 +836,12 @@ public void testAddJoinForManyToMany(SessionFactoryScope scope) {
836
836
);
837
837
}
838
838
839
+ @ Test @ JiraKey ( "HHH-15102" )
840
+ @ SkipForDialect (dialectClass = MySQLDialect .class , matchSubTypes = true )
841
+ public void testCommentInSQLQuery (SessionFactoryScope scope ) {
842
+ scope .inTransaction ( s -> s .createNativeQuery ( "select sum(1) --count(*), effectively\n from ORGANIZATION" ).getSingleResult () );
843
+ }
844
+
839
845
@ Test
840
846
public void testTextTypeInSQLQuery (SessionFactoryScope scope ) {
841
847
String description = buildLongString ( 15000 , 'a' );
You can’t perform that action at this time.
0 commit comments