X-Git-Url: https://git.tokkee.org/?p=sysdb.git;a=blobdiff_plain;f=src%2Fcore%2Fplugin.c;h=235b8c7721ba97d08dc1b165c6ac0812ed7c6292;hp=6b1560336b311a659c35566333d78a147d8d39c2;hb=6f4b7e7407964b05477416d1c1c4291421a5859a;hpb=089035fbe3345ebaaae1155a9301f43d1aef879c diff --git a/src/core/plugin.c b/src/core/plugin.c index 6b15603..235b8c7 100644 --- a/src/core/plugin.c +++ b/src/core/plugin.c @@ -1433,6 +1433,17 @@ sdb_plugin_query(sdb_ast_node_t *ast, sdb_strbuf_t *buf, sdb_strbuf_t *errbuf) if (! ast) return 0; + if ((ast->type != SDB_AST_TYPE_FETCH) + && (ast->type != SDB_AST_TYPE_LIST) + && (ast->type != SDB_AST_TYPE_LOOKUP) + && (ast->type != SDB_AST_TYPE_TIMESERIES)) { + sdb_log(SDB_LOG_ERR, "core: Cannot execute query of type %s", + SDB_AST_TYPE_TO_STRING(ast)); + sdb_strbuf_sprintf(errbuf, "Cannot execute query of type %s", + SDB_AST_TYPE_TO_STRING(ast)); + return -1; + } + if (n != 1) { char *msg = (n > 0) ? "Cannot execute query: multiple readers not supported"