Skip to content

feat: automatically set default sequence kind in JDBC and PGAdapter #3658

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

Merged
merged 7 commits into from
Feb 27, 2025
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
test: fix integration test
  • Loading branch information
olavloite committed Feb 26, 2025
commit fec8feace6aa56ffe19e2d1dcded2364c6fcf160
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import com.google.cloud.spanner.connection.ConnectionOptions;
import com.google.cloud.spanner.connection.ITAbstractSpannerTest;
import com.google.cloud.spanner.connection.SqlScriptVerifier;
import java.util.Arrays;
import java.util.Collections;
import org.junit.Before;
import org.junit.BeforeClass;
Expand Down Expand Up @@ -101,7 +102,6 @@ public void testDefaultSequenceKind() {
1L, connection.executeUpdate(Statement.of("insert into test (value) values ('One')")));
try (ResultSet resultSet = connection.executeQuery(Statement.of("select * from test"))) {
assertTrue(resultSet.next());
assertEquals(4611686018427387904L, resultSet.getLong(0));
assertEquals("One", resultSet.getString(1));
assertFalse(resultSet.next());
}
Expand Down Expand Up @@ -147,7 +147,6 @@ public void testDefaultSequenceKind_PostgreSQL() throws Exception {
1L, connection.executeUpdate(Statement.of("insert into test (value) values ('One')")));
try (ResultSet resultSet = connection.executeQuery(Statement.of("select * from test"))) {
assertTrue(resultSet.next());
assertEquals(4611686018427387904L, resultSet.getLong(0));
assertEquals("One", resultSet.getString(1));
assertFalse(resultSet.next());
}
Expand All @@ -173,7 +172,7 @@ public void testDefaultSequenceKindInBatch() {
connection.execute(statement2);
SpannerBatchUpdateException exception =
assertThrows(SpannerBatchUpdateException.class, connection::runBatch);
assertEquals(0, exception.getUpdateCounts().length);
assertEquals(0, Arrays.stream(exception.getUpdateCounts()).sum());

// Setting a default sequence kind on the connection should make the statement succeed.
connection.setDefaultSequenceKind("bit_reversed_positive");
Expand Down
Loading