Skip to content
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

test: large decimal #493

Merged
merged 1 commit into from
Feb 19, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import integration.IntegrationTest;
import org.junit.jupiter.api.Test;

import java.math.BigDecimal;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
Expand All @@ -21,4 +22,15 @@ void shouldHaveCorrectInfo() throws SQLException {
assertEquals(38, resultSet.getMetaData().getPrecision(1));
}
}

@Test
void shouldHandleLargeDecimals() throws SQLException {
String sql = "SELECT 12345678901234567890123456789.123456789::decimal(38, 9);";
try (Connection connection = createConnection(null);
Statement statement = connection.createStatement();
ResultSet resultSet = statement.executeQuery(sql)) {
resultSet.next();
assertEquals(new BigDecimal("12345678901234567890123456789.123456789"), resultSet.getBigDecimal(1));
}
}
}
Loading