New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HHH-18033 Fix LimitHandler detect wrong statement end if sql contains quoted semicolon #8270
Conversation
@gavinking Please review. |
* License: GNU Lesser General Public License (LGPL), version 2.1 or later | ||
* See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html | ||
*/ | ||
package org.hibernate.community.dialect; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be in a test package?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are other tests already exist in this package, I think it's better to keep it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, well. That doesn't seem quite right to me.
@beikov is there a good reason the tests for the community dialects are in the same package as the dialect classes? Shouldn't they be somewhere like org.hibernate.community.dialect.test
or whatever?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having tests in the same package as the Dialect under test allows to test package-private methods, which I suppose was the original reason for doing this. When we moved the classes to the community dialects module, we didn't change the package for tests apparently. Either is fine IMO, though if you want to change it, I think I'd prefer the package you are proposing.
...ty-dialects/src/main/java/org/hibernate/community/dialect/pagination/IngresLimitHandler.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks fine, just a couple of minor comments.
I wonder if, since we're messing with this, we should also recognize line-ending comments of form |
I don't think people will pass such sql to |
Probably not, but they definitely might if it's a named query, especially one declared in XML. |
Same as spaces, we should strip comments before reaching here, and it should be handled in another PR. |
Thinking this through, it's probably impossible to distinguish a line-ending comment from a quoted string literal containing the character sequence So forget this suggestion. |
957c6ad
to
5bcaf53
Compare
9ff5b0c
to
b9e23eb
Compare
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, great, thanks. Looks good now.
Appreciate your patience with my pickiness.
hibernate-core/src/test/java/org/hibernate/orm/test/dialect/AbstractLimitHandlerTest.java
Outdated
Show resolved
Hide resolved
… quoted semicolon
https://hibernate.atlassian.net/browse/HHH-18033