[bug] Check for uninitialized query state after submit, and error out
@@ -1086,6 +1086,11 @@ public:
py::gil_scoped_release release;
query_->submit();
}
+
+ if (query_->query_status() == Query::Status::UNINITIALIZED) {
+ TPY_ERROR_LOC("Unexpected state: Query::Submit returned uninitialized");
+ }
+
update_read_elem_num();
return;
@@ -1214,6 +1219,10 @@ public:
query_->submit();
}
+ if (query_->query_status() == Query::Status::UNINITIALIZED) {
+ TPY_ERROR_LOC("Unexpected state: Query::Submit returned uninitialized");
+ }
+
if (g_stats) {
auto now = std::chrono::high_resolution_clock::now();
g_stats.get()->counters["py.core_read_query_initial_submit_time"] +=
@@ -1361,15 +1370,19 @@ public:
void submit_write() {}
void submit() {
- if (array_->query_type() == TILEDB_READ)
+ if (array_->query_type() == TILEDB_READ) {
submit_read();
- else if (array_->query_type() == TILEDB_WRITE)
+ } else if (array_->query_type() == TILEDB_WRITE) {
submit_write();
- else if (array_->query_type() == TILEDB_DELETE)
+ } else if (array_->query_type() == TILEDB_DELETE) {
query_->submit();
- else
+ if (query_->query_status() == Query::Status::UNINITIALIZED) {
+ TPY_ERROR_LOC("Unexpected state: Query::Submit returned uninitialized");
+ }
+ } else {
TPY_ERROR_LOC("Unknown query type!")
}
+ }
py::dict results() {
py::dict results;
