GP-763 corrected DB issue where locked buffers may not be released and corrected flawed DB iterator change-over

This commit is contained in:
ghidra1 2022-01-04 19:35:28 -05:00
parent 47e1809c08
commit 2e7053e0af
3 changed files with 109 additions and 75 deletions

View file

@ -914,10 +914,10 @@ public class DBHandle {
*/
public synchronized Table createTable(String name, Schema schema, int[] indexedColumns)
throws IOException {
if (tables.containsKey(name)) {
throw new IOException("Table already exists");
}
checkTransaction();
Table table = new Table(this, masterTable.createTableRecord(name, schema, -1));
tables.put(name, table);
if (indexedColumns != null) {
@ -964,6 +964,7 @@ public class DBHandle {
if (table == null) {
return;
}
checkTransaction();
int[] indexedColumns = table.getIndexedColumns();
for (int indexedColumn : indexedColumns) {
table.removeIndex(indexedColumn);