[ https://issues.apache.org/jira/browse/RANGER-4104?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17692773#comment-17692773 ]
Andrew Luo commented on RANGER-4104: ------------------------------------ [~kirbyzhou] I commented on that issue. I think there are multiple issues here. Upgrading EclipseLink will be useful but it doesn't solve this problem. I can open a separate ticket/PR for that. The specific problem I wanted to fix is that the java.util.Date object is converted to a query string in the wrong format (this doesn't cause an error per se but the feature does not work as it scans the wrong part of the table and also does not use the index) and this causes MySQL (before 8.0.16). So in older versions it will do a string comparison which cannot use indexes, in 8.0.17 it will fail (see https://bugs.mysql.com/bug.php?id=93513) > XXAuthSessionDao.getRecentAuthFailureCountByLoginId produces incorrect SQL > code > ------------------------------------------------------------------------------- > > Key: RANGER-4104 > URL: https://issues.apache.org/jira/browse/RANGER-4104 > Project: Ranger > Issue Type: Bug > Components: admin > Affects Versions: 3.0.0, 2.4.0 > Reporter: Andrew Luo > Priority: Major > Attachments: > 0001-Fix-type-of-authWindowStartTime-parameter-in-XXAuthS.patch > > > XXAuthSessionDao.getRecentAuthFailureCountByLoginId produces incorrect SQL > code due to an error in how the authWindowStartTime Date parameter is bound. > It is currently bound with setParameter("authWindowStartTime", > authWindowStartTime) however, [JPA 2.2 Specification Section > 11.1.53|https://download.oracle.com/otn-pub/jcp/persistence-2_2-mrel-spec/JavaPersistence.pdf] > says that it should be bound by specifying an additional parameter > TemporalType.DATE. -- This message was sent by Atlassian Jira (v8.20.10#820010)