Skip to content

Commit

Permalink
Merge branch 'master' into crossdb
Browse files Browse the repository at this point in the history
  • Loading branch information
vharseko authored Feb 3, 2025
2 parents 7d820fd + 2050033 commit 0895655
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion opendj-server-legacy/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@
<scope>test</scope>
</dependency>

<!-- JDBC drivers -->
<!-- test JDBC drivers -->
<dependency>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,19 @@ String getTableDialect() {
return "h char(128),k bytea,v bytea,primary key(h,k)";
}

boolean isExistsTable(TreeName treeName) {
try(final ResultSet rs = con.getMetaData().getTables(null, null, tree2table.get(treeName), new String[]{"TABLE"})) {
while (rs.next()) {
if (tree2table.get(treeName).equals(rs.getString("TABLE_NAME"))){
return true;
}
}
} catch (Exception e) {
throw new StorageRuntimeException(e);
}
return false;
}

@Override
public void openTree(TreeName treeName, boolean createOnDemand) {
if (createOnDemand && !isExistsTable(treeName)) {
Expand Down

0 comments on commit 0895655

Please sign in to comment.