Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
문제 분석
이 에러는
mariadb
를 사용하는prod
환경에서 로그인 후 인재풀 페이지에 접속 했을 때 보고 되었다.에러 메시지를 살펴보면,
PoolRepository
클래스의matchWith
메서드 내에 구현된 쿼리를 실행하는 과정에서 예외가 발생했다 (JDBC exception executing SQL
). 예외의 유형은SQLSyntaxErrorException
으로 사용된 SQL 문법이 유효하지 않음을 의미한다. 메서드 내에 구현된 쿼리는 아래와 같이QueryDSL
문법을 사용했으며mariadb
환경에서random
이라는 함수를 인식하지 못하는 것으로 보인다.해결방안
예외가 발생한 코드
.orderBy(NumberExpression.random().asc())
의 의도는 레코드를 랜덤으로 정렬하여 조회하기 위함이었다. 따라서orderBy()
안의 들어가는argument
를 의도한 범위 내에서 유효하게 바꿔주어야 한다. 이미 비슷한 사례가 보고되었다.querydsl/querydsl#1881