diff --git a/DBEngine.cpp b/DBEngine.cpp index b0eb5d2..ede10e5 100755 --- a/DBEngine.cpp +++ b/DBEngine.cpp @@ -113,7 +113,7 @@ Relation& DBEngine::getTableFromName(string n){ } Relation DBEngine::selection(string attName, string s, Relation r){ - equality(attName, s, r); + return equality(attName, s, r); } //assumes that all attribute titles are unique diff --git a/Parser.cpp b/Parser.cpp index 1568341..15873ea 100644 --- a/Parser.cpp +++ b/Parser.cpp @@ -507,6 +507,13 @@ vector deleteCMD(vector input, DBEngine &engine) else cout<<"Syntax error!"< input, DBEngine &engine) +{ + PRelation pr(input[0]); + + input.erase(input.begin()); +} + void par_line(vector input, DBEngine &engine) //calls par_command() or par_query() depending on first item from token list { /* @@ -533,7 +540,7 @@ void par_line(vector input, DBEngine &engine) //calls par_command() or p } - if ( input[0] == "CREATE") + else if ( input[0] == "CREATE") { cout<<"\nPassing the following arguments to dbEngine: \nCommand: "< input, DBEngine &engine) //calls par_command() or p } - if ( input[0] == "DELETE") + else if ( input[0] == "DELETE") { cout<<"\nPassing the following arguments to dbEngine: \nCommand: "< input, DBEngine &engine) //calls par_command() or p } - if ( input[0] == "UPDATE") + else if ( input[0] == "UPDATE") { cout<<"\nPassing the following arguments to dbEngine: \nCommand: "< input, DBEngine &engine) //calls par_command() or p } - if ( input[0] == "SHOW") + else if ( input[0] == "SHOW") { cout<<"\nPassing the following arguments to dbEngine: \nCommand: "<