Skip to content

Commit 71c817d

Browse files
authored
Merge branch 'master' into revisit-importTable-in-consensus-commit
2 parents 0393656 + af08d73 commit 71c817d

25 files changed

+333
-14
lines changed

.github/workflows/ci.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1967,7 +1967,7 @@ jobs:
19671967

19681968
- name: Upload Gradle test reports
19691969
if: always()
1970-
uses: actions/upload-artifact@v4
1970+
uses: actions/upload-artifact@v5
19711971
with:
19721972
name: tidb_6_5_integration_test_reports_${{ matrix.mode.label }}
19731973
path: core/build/reports/tests/integrationTestJdbc
@@ -2042,7 +2042,7 @@ jobs:
20422042

20432043
- name: Upload Gradle test reports
20442044
if: always()
2045-
uses: actions/upload-artifact@v4
2045+
uses: actions/upload-artifact@v5
20462046
with:
20472047
name: tidb_7_5_integration_test_reports_${{ matrix.mode.label }}
20482048
path: core/build/reports/tests/integrationTestJdbc
@@ -2117,7 +2117,7 @@ jobs:
21172117

21182118
- name: Upload Gradle test reports
21192119
if: always()
2120-
uses: actions/upload-artifact@v4
2120+
uses: actions/upload-artifact@v5
21212121
with:
21222122
name: tidb_8_5_integration_test_reports_${{ matrix.mode.label }}
21232123
path: core/build/reports/tests/integrationTestJdbc

build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
plugins {
22
id "com.diffplug.spotless" version "6.13.0"
3-
id "org.jreleaser" version "1.20.0"
3+
id "org.jreleaser" version "1.21.0"
44
}
55

66
ext {
@@ -29,11 +29,11 @@ subprojects {
2929
cassandraDriverVersion = '3.11.5'
3030
azureCosmosVersion = '4.75.0'
3131
jooqVersion = '3.14.16'
32-
awssdkVersion = '2.36.2'
32+
awssdkVersion = '2.37.3'
3333
commonsDbcp2Version = '2.13.0'
3434
mysqlDriverVersion = '8.4.0'
3535
postgresqlDriverVersion = '42.7.8'
36-
oracleDriverVersion = '23.9.0.25.07'
36+
oracleDriverVersion = '23.26.0.0.0'
3737
sqlserverDriverVersion = '12.8.2.jre8'
3838
sqliteDriverVersion = '3.50.3.0'
3939
yugabyteDriverVersion = '42.7.3-yb-4'
@@ -42,7 +42,7 @@ subprojects {
4242
alloyDbJdbcConnectorVersion = '1.2.7'
4343
picocliVersion = '4.7.7'
4444
commonsTextVersion = '1.14.0'
45-
junitVersion = '5.14.0'
45+
junitVersion = '5.14.1'
4646
commonsLangVersion = '3.19.0'
4747
assertjVersion = '3.27.6'
4848
mockitoVersion = '4.11.0'

core/src/integration-test/java/com/scalar/db/storage/cassandra/CassandraAdminTestUtils.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@ public void corruptMetadata(String namespace, String table) {
5757
// Do nothing
5858
}
5959

60+
@Override
61+
public void deleteMetadata(String namespace, String table) throws Exception {
62+
// Do nothing
63+
}
64+
6065
@Override
6166
public void dropNamespace(String namespace) {
6267
String dropKeyspaceQuery =

core/src/integration-test/java/com/scalar/db/storage/cosmos/CosmosAdminTestUtils.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,15 @@ public void corruptMetadata(String namespace, String table) {
8686
container.upsertItem(corruptedMetadata);
8787
}
8888

89+
@Override
90+
public void deleteMetadata(String namespace, String table) {
91+
String fullTableName = getFullTableName(namespace, table);
92+
CosmosContainer container =
93+
client.getDatabase(metadataDatabase).getContainer(CosmosAdmin.TABLE_METADATA_CONTAINER);
94+
container.deleteItem(
95+
fullTableName, new PartitionKey(fullTableName), new CosmosItemRequestOptions());
96+
}
97+
8998
/**
9099
* Retrieve the stored procedure for the given table
91100
*

core/src/integration-test/java/com/scalar/db/storage/dynamo/DynamoAdminCaseSensitivityIntegrationTest.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ protected AdminTestUtils getAdminTestUtils(String testName) {
2929
return new DynamoAdminTestUtils(getProperties(testName));
3030
}
3131

32+
@Override
33+
@Disabled("DynamoDB does not have a concept of namespaces")
34+
public void
35+
dropNamespace_ForNamespaceWithNonScalarDBManagedTables_ShouldThrowIllegalArgumentException() {}
36+
3237
@Override
3338
@Disabled("DynamoDB does not support dropping columns")
3439
public void dropColumnFromTable_DropColumnForEachExistingDataType_ShouldDropColumnsCorrectly() {}

core/src/integration-test/java/com/scalar/db/storage/dynamo/DynamoAdminIntegrationTest.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ protected AdminTestUtils getAdminTestUtils(String testName) {
2828
return new DynamoAdminTestUtils(getProperties(testName));
2929
}
3030

31+
@Override
32+
@Disabled("DynamoDB does not have a concept of namespaces")
33+
public void
34+
dropNamespace_ForNamespaceWithNonScalarDBManagedTables_ShouldThrowIllegalArgumentException() {}
35+
3136
@Override
3237
@Disabled("DynamoDB does not support dropping columns")
3338
public void dropColumnFromTable_DropColumnForEachExistingDataType_ShouldDropColumnsCorrectly() {}

core/src/integration-test/java/com/scalar/db/storage/dynamo/DynamoAdminTestUtils.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,20 @@ public void corruptMetadata(String namespace, String table) {
171171
.build());
172172
}
173173

174+
@Override
175+
public void deleteMetadata(String namespace, String table) {
176+
String fullTableName =
177+
getFullTableName(Namespace.of(namespacePrefix, namespace).prefixed(), table);
178+
Map<String, AttributeValue> keyToDelete = new HashMap<>();
179+
keyToDelete.put("table", AttributeValue.builder().s(fullTableName).build());
180+
181+
client.deleteItem(
182+
DeleteItemRequest.builder()
183+
.tableName(getFullTableName(metadataNamespace, DynamoAdmin.METADATA_TABLE))
184+
.key(keyToDelete)
185+
.build());
186+
}
187+
174188
@Override
175189
public void dropTable(String nonPrefixedNamespace, String table) {
176190
String namespace = Namespace.of(namespacePrefix, nonPrefixedNamespace).prefixed();

core/src/integration-test/java/com/scalar/db/storage/jdbc/JdbcAdminCaseSensitivityIntegrationTest.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,12 @@ private boolean isWideningColumnTypeConversionNotFullySupported() {
8989
return JdbcTestUtils.isOracle(rdbEngine) || JdbcTestUtils.isSqlite(rdbEngine);
9090
}
9191

92+
@Test
93+
@Override
94+
@DisabledIf("isSqlite")
95+
public void
96+
dropNamespace_ForNamespaceWithNonScalarDBManagedTables_ShouldThrowIllegalArgumentException() {}
97+
9298
@Test
9399
@Override
94100
@DisabledIf("isDb2")

core/src/integration-test/java/com/scalar/db/storage/jdbc/JdbcAdminIntegrationTest.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,12 @@ private boolean isWideningColumnTypeConversionNotFullySupported() {
9090
return JdbcTestUtils.isOracle(rdbEngine) || JdbcTestUtils.isSqlite(rdbEngine);
9191
}
9292

93+
@Test
94+
@Override
95+
@DisabledIf("isSqlite")
96+
public void
97+
dropNamespace_ForNamespaceWithNonScalarDBManagedTables_ShouldThrowIllegalArgumentException() {}
98+
9399
@Test
94100
@Override
95101
@DisabledIf("isDb2")

core/src/integration-test/java/com/scalar/db/storage/jdbc/JdbcAdminTestUtils.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,22 @@ public void corruptMetadata(String namespace, String table) throws Exception {
6464
execute(insertCorruptedMetadataStatement);
6565
}
6666

67+
@Override
68+
public void deleteMetadata(String namespace, String table) throws Exception {
69+
String deleteMetadataStatement =
70+
"DELETE FROM "
71+
+ rdbEngine.encloseFullTableName(metadataSchema, JdbcAdmin.METADATA_TABLE)
72+
+ " WHERE "
73+
+ rdbEngine.enclose(JdbcAdmin.METADATA_COL_FULL_TABLE_NAME)
74+
+ " = ?";
75+
try (Connection connection = dataSource.getConnection();
76+
PreparedStatement preparedStatement =
77+
connection.prepareStatement(deleteMetadataStatement)) {
78+
preparedStatement.setString(1, getFullTableName(namespace, table));
79+
preparedStatement.executeUpdate();
80+
}
81+
}
82+
6783
private void execute(String sql) throws SQLException {
6884
try (Connection connection = dataSource.getConnection()) {
6985
JdbcAdmin.execute(connection, sql);

0 commit comments

Comments
 (0)