Fixing github issues

This commit is contained in:
Alexander Huddleston 2015-09-30 17:21:28 -05:00
parent e3ef70bf15
commit 296a8d7b96
2 changed files with 13 additions and 18 deletions

View file

@ -581,7 +581,7 @@ tuple<vector<string>, Relation> expression(vector<string> input, DBEngine &engin
vector<string> showCMD(vector<string> input, DBEngine &engine) vector<string> showCMD(vector<string> input, DBEngine &engine)
{ {
if(engine.isRelation(input[0])) if(engine.isRelation(input[0]) && (input[1] != "+" && input[1] != "-" && input[1] != "*"))
{ {
engine.getTableFromName(input[0]).display(); engine.getTableFromName(input[0]).display();
input.erase(input.begin()); input.erase(input.begin());
@ -954,6 +954,7 @@ vector<string> updateCMD(vector<string> input, DBEngine &engine)
} }
// send update command to DBEngine // send update command to DBEngine
} }
@ -967,36 +968,30 @@ vector<string> deleteCMD(vector<string> input, DBEngine &engine)
input.erase(input.begin()); input.erase(input.begin());
input.erase(input.begin()); input.erase(input.begin());
PRelation r(input[0]); Relation rcond = engine.getTableFromName(input[0]);
Relation rfinal = engine.getTableFromName(input[0]);
input.erase(input.begin());
vector<string> s;
if(input[0] == "WHERE") if(input[0] == "WHERE")
{ {
input.erase(input.begin());
if(input[0] == "(") if(input[0] == "(")
{ {
//PCondition c; input.erase(input.begin());
PComparison c;
POperand oops1;
POperand oops2;
POp op;
while(input[0] != ")") while(input[0] != ")")
{ {
oops1.setPOperand(input[0]); s.push_back(input[0]);
input.erase(input.begin()); input.erase(input.begin());
oops2.setPOperand(input[0]);
input.erase(input.begin());
op.setPOp(input[0]);
input.erase(input.begin());
c.setPComparison(oops1.getPOperand(), op.getPOp(), oops2.getPOperand());
} }
} }
} }
rcond = condition();
// send delete command to DBEngine // send delete command to DBEngine
} }
else cout<<"Syntax error!"<<endl; else cout<<"Syntax error!"<<endl;
} }

BIN
test

Binary file not shown.