SQL: [Test] Fix JdbcPreparedStatement date test

Use `ORDER BY` to ensure order of the rows since more
than are returned in the testDate().

Follows: #56492
(cherry picked from commit 0053a1cb515b4db160d7b0bed5cf3f13c1050687)
This commit is contained in:
Marios Trivyzas 2020-05-12 17:03:18 +02:00 committed by Marios Trivyzas
parent 0c61bc63e4
commit 4240b97d0e
No known key found for this signature in database
GPG Key ID: 98004DCEA1252F3D
1 changed files with 3 additions and 1 deletions

View File

@ -140,7 +140,9 @@ public class PreparedStatementTestCase extends JdbcIntegrationTestCase {
setupIndexForDateTimeTests(randomMillis);
try (Connection connection = esJdbc()) {
try (PreparedStatement statement = connection.prepareStatement("SELECT id, birth_date FROM emps WHERE birth_date::date = ?")) {
try (PreparedStatement statement = connection.prepareStatement("SELECT id, birth_date FROM emps WHERE birth_date::date = ? " +
"ORDER BY id")) {
statement.setDate(1, new Date(asDate(randomMillis, UTC).getTime()));
try (ResultSet results = statement.executeQuery()) {
for (int i = 1; i <= 3; i++) {