From: nishi Date: Thu, 27 Jun 2024 02:15:06 +0000 (+0000) Subject: revive delete_table X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=196a77022851119c92635425769a9b35a422305b;p=dataworks.git revive delete_table git-svn-id: file:///raid/svn-main/nishi-dataworks/trunk@442 d4a5a174-5a4a-5b4b-b672-37683c10d7d5 --- diff --git a/Library/exec.c b/Library/exec.c index 5a8ef5f..d07b919 100644 --- a/Library/exec.c +++ b/Library/exec.c @@ -152,6 +152,19 @@ struct Node* parser_process(struct dataworks_db* db, struct Node* node, bool dol } used = true; } else if(__dw_strcaseequ(node->ident, "insert")) { + } else if(__dw_strcaseequ(node->ident, "delete_table")) { + if(name == NULL) { + name = __dw_strdup(r->string); + } else { + newnode->errnum = DW_ERR_EXEC_TOO_MANY_ARGUMENTS; + __dw_free_node(r); + int j; + for(j = 0; fields[j] != NULL; j++) free(fields[j]); + free(fields); + free(fieldtypes); + if(name != NULL) free(name); + return newnode; + } } else { int j; for(i = 0; fields[i] != NULL; i++) free(fields[i]); @@ -171,6 +184,12 @@ struct Node* parser_process(struct dataworks_db* db, struct Node* node, bool dol } else { newnode->errnum = DW_ERR_EXEC_INSUFFICIENT_ARGUMENTS; } + } else if(__dw_strcaseequ(node->ident, "delete_table")) { + if(name != NULL) { + newnode->errnum = dataworks_database_delete_table(db, name); + } else { + newnode->errnum = DW_ERR_EXEC_INSUFFICIENT_ARGUMENTS; + } } else if(__dw_strcaseequ(node->ident, "print")) { printf("\n"); } else if(__dw_strcaseequ(node->ident, "use")) {