Fixed github issues.
This commit is contained in:
parent
015190f5e5
commit
2d2e056731
7 changed files with 76 additions and 109 deletions
20
DBEngine.cpp
20
DBEngine.cpp
|
@ -215,27 +215,14 @@ Relation DBEngine::setDiff(Relation r1, Relation r2){
|
||||||
Relation new_r = r1;
|
Relation new_r = r1;
|
||||||
new_r.setTableName("TEMP");
|
new_r.setTableName("TEMP");
|
||||||
vector<string> temp;
|
vector<string> temp;
|
||||||
<<<<<<< HEAD
|
|
||||||
//bool duplicate = false;
|
//bool duplicate = false;
|
||||||
|
|
||||||
int size = 0;
|
int size = 0;
|
||||||
|
|
||||||
|
|
||||||
for(int x = 0; x < r2.getAttributes().size(); ++x)
|
|
||||||
{
|
|
||||||
|
|
||||||
for (int i = 0; i < r2.getAttributes()[x].getSize(); ++i)
|
|
||||||
{
|
|
||||||
|
|
||||||
=======
|
|
||||||
|
|
||||||
int size = 0;
|
|
||||||
|
|
||||||
for(int x = 0; x < r2.getAttributes().size(); ++x)
|
for(int x = 0; x < r2.getAttributes().size(); ++x)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < r2.getAttributes()[x].getSize(); ++i)
|
for (int i = 0; i < r2.getAttributes()[x].getSize(); ++i)
|
||||||
{
|
{
|
||||||
>>>>>>> e3ef70bf1536697f14395063975a6376b7df6f61
|
|
||||||
temp = r2.getTuple(i);
|
temp = r2.getTuple(i);
|
||||||
|
|
||||||
for(int y = 0; y < new_r.getAttributes().size(); ++y)
|
for(int y = 0; y < new_r.getAttributes().size(); ++y)
|
||||||
|
@ -258,11 +245,7 @@ Relation DBEngine::setDiff(Relation r1, Relation r2){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
<<<<<<< HEAD
|
|
||||||
}
|
}
|
||||||
=======
|
|
||||||
}
|
|
||||||
>>>>>>> e3ef70bf1536697f14395063975a6376b7df6f61
|
|
||||||
return new_r;
|
return new_r;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -301,8 +284,6 @@ Relation DBEngine::crossProduct(Relation r1, Relation r2){
|
||||||
|
|
||||||
|
|
||||||
return new_r;
|
return new_r;
|
||||||
<<<<<<< HEAD
|
|
||||||
=======
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//UPDATE Senator
|
//UPDATE Senator
|
||||||
|
@ -311,5 +292,4 @@ Relation DBEngine::crossProduct(Relation r1, Relation r2){
|
||||||
|
|
||||||
Relation DBEngine::update(Relation r, string attNameSet, string attSet, string attNameWhere, string attWhere){
|
Relation DBEngine::update(Relation r, string attNameSet, string attSet, string attNameWhere, string attWhere){
|
||||||
return r;
|
return r;
|
||||||
>>>>>>> e3ef70bf1536697f14395063975a6376b7df6f61
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,11 +30,7 @@ public:
|
||||||
Relation rename(vector<string> newnames, Relation &r);
|
Relation rename(vector<string> newnames, Relation &r);
|
||||||
Relation setUnion(Relation r1, Relation r2);
|
Relation setUnion(Relation r1, Relation r2);
|
||||||
Relation setDiff(Relation r1, Relation r2);
|
Relation setDiff(Relation r1, Relation r2);
|
||||||
<<<<<<< HEAD
|
|
||||||
Relation crossProduct(Relation r1, Relation r2);
|
|
||||||
=======
|
|
||||||
Relation crossProduct(Relation r1, Relation r2);
|
Relation crossProduct(Relation r1, Relation r2);
|
||||||
Relation update(Relation r, string attNameSet, string attSet, string attNameWhere, string attWhere);
|
Relation update(Relation r, string attNameSet, string attSet, string attNameWhere, string attWhere);
|
||||||
//Relation deleteCmd();
|
//Relation deleteCmd();
|
||||||
>>>>>>> e3ef70bf1536697f14395063975a6376b7df6f61
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -989,7 +989,7 @@ vector<string> deleteCMD(vector<string> input, DBEngine &engine)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rcond = condition();
|
//rcond = condition();
|
||||||
// send delete command to DBEngine
|
// send delete command to DBEngine
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
BIN
test
BIN
test
Binary file not shown.
11
test.cpp
11
test.cpp
|
@ -1,21 +1,13 @@
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include "Parser.h"
|
#include "Parser.h"
|
||||||
<<<<<<< HEAD
|
|
||||||
//#include "Condition.h"
|
//#include "Condition.h"
|
||||||
#include "DBEngine.h"
|
#include "DBEngine.h"
|
||||||
#include "user.h"
|
//#include "user.h"
|
||||||
=======
|
|
||||||
#include "Condition.h"
|
|
||||||
#include "DBEngine.h"
|
|
||||||
>>>>>>> e3ef70bf1536697f14395063975a6376b7df6f61
|
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
int main () {
|
int main () {
|
||||||
<<<<<<< HEAD
|
|
||||||
|
|
||||||
=======
|
|
||||||
DBEngine engine;
|
DBEngine engine;
|
||||||
|
|
||||||
Attribute att1("Breakfast", "VARCHAR(20)", true);
|
Attribute att1("Breakfast", "VARCHAR(20)", true);
|
||||||
|
@ -52,5 +44,4 @@ int main () {
|
||||||
cout << "Enter DBMS Commands: ";
|
cout << "Enter DBMS Commands: ";
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
>>>>>>> e3ef70bf1536697f14395063975a6376b7df6f61
|
|
||||||
}
|
}
|
||||||
|
|
60
user.cpp
60
user.cpp
|
@ -2,36 +2,36 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include "user.h"
|
#include "user.h"
|
||||||
|
|
||||||
User::User(){
|
// User::User(){
|
||||||
name = "";
|
// name = "";
|
||||||
password = "";
|
// password = "";
|
||||||
phone_number = "";
|
// phone_number = "";
|
||||||
fax_number = "";
|
// fax_number = "";
|
||||||
postal_address = "";
|
// postal_address = "";
|
||||||
is_admin = false;
|
// is_admin = false;
|
||||||
}
|
// }
|
||||||
|
|
||||||
User::User(string n, string pass, string phone, string fax, string postal, bool admin){
|
// User::User(string n, string pass, string phone, string fax, string postal, bool admin){
|
||||||
name = n;
|
// name = n;
|
||||||
password = pass;
|
// password = pass;
|
||||||
phone_number = phone;
|
// phone_number = phone;
|
||||||
fax_number = fax;
|
// fax_number = fax;
|
||||||
postal_address = postal;
|
// postal_address = postal;
|
||||||
is_admin = admin;
|
// is_admin = admin;
|
||||||
}
|
// }
|
||||||
|
|
||||||
string User::getName() {return name;}
|
// string User::getName() {return name;}
|
||||||
string User::getPassword() {return password;}
|
// string User::getPassword() {return password;}
|
||||||
string User::getPhoneNumber() {return phone_number;}
|
// string User::getPhoneNumber() {return phone_number;}
|
||||||
string User::getFaxNumber() {return fax_number;}
|
// string User::getFaxNumber() {return fax_number;}
|
||||||
string User::getPostalAddress() {return postal_address;}
|
// string User::getPostalAddress() {return postal_address;}
|
||||||
bool User::confirmAdmin() {return is_admin;}
|
// bool User::confirmAdmin() {return is_admin;}
|
||||||
bool User::checkLogin() {return is_logged_in;}
|
// bool User::checkLogin() {return is_logged_in;}
|
||||||
vector<string> User::getGroups(){return groups;}
|
// vector<string> User::getGroups(){return groups;}
|
||||||
vector<string> User::getMessages(){return messages;}
|
// vector<string> User::getMessages(){return messages;}
|
||||||
|
|
||||||
void User::setName(string new_name) {name = new_name;}
|
// void User::setName(string new_name) {name = new_name;}
|
||||||
void User::setPassword(string new_password) {password = new_password;}
|
// void User::setPassword(string new_password) {password = new_password;}
|
||||||
void User::setPhone(string new_phone) {phone_number = new_phone;}
|
// void User::setPhone(string new_phone) {phone_number = new_phone;}
|
||||||
void User::setFax(string new_fax) {fax_number = new_fax;}
|
// void User::setFax(string new_fax) {fax_number = new_fax;}
|
||||||
void User::setPostal(string new_postal) {postal_address = new_postal;}
|
// void User::setPostal(string new_postal) {postal_address = new_postal;}
|
||||||
|
|
70
user.h
70
user.h
|
@ -2,43 +2,43 @@
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
class User {
|
// class User {
|
||||||
string name;
|
// string name;
|
||||||
string password;
|
// string password;
|
||||||
string phone_number;
|
// string phone_number;
|
||||||
string fax_number;
|
// string fax_number;
|
||||||
string postal_address;
|
// string postal_address;
|
||||||
vector<string> groups;
|
// vector<string> groups;
|
||||||
vector<string> messages;
|
// vector<string> messages;
|
||||||
|
|
||||||
bool is_admin;
|
// bool is_admin;
|
||||||
bool is_logged_in;
|
// bool is_logged_in;
|
||||||
|
|
||||||
public:
|
// public:
|
||||||
User();
|
// User();
|
||||||
User(string n, string pass, string phone, string fax, string postal, bool admin);
|
// User(string n, string pass, string phone, string fax, string postal, bool admin);
|
||||||
string getName();
|
// string getName();
|
||||||
string getPassword();
|
// string getPassword();
|
||||||
string getPhoneNumber();
|
// string getPhoneNumber();
|
||||||
string getFaxNumber();
|
// string getFaxNumber();
|
||||||
string getPostalAddress();
|
// string getPostalAddress();
|
||||||
vector<string> getGroups();
|
// vector<string> getGroups();
|
||||||
vector<string> getMessages();
|
// vector<string> getMessages();
|
||||||
bool confirmAdmin();
|
// bool confirmAdmin();
|
||||||
bool checkLogin();
|
// bool checkLogin();
|
||||||
void setName(string new_name);
|
// void setName(string new_name);
|
||||||
void setPassword(string new_name);
|
// void setPassword(string new_name);
|
||||||
void setPhone(string new_phone);
|
// void setPhone(string new_phone);
|
||||||
void setFax(string new_fax);
|
// void setFax(string new_fax);
|
||||||
void setPostal(string new_postal);
|
// void setPostal(string new_postal);
|
||||||
};
|
// };
|
||||||
|
|
||||||
class Message {
|
// class Message {
|
||||||
string timestamp;
|
// string timestamp;
|
||||||
string text;
|
// string text;
|
||||||
|
|
||||||
public:
|
// public:
|
||||||
Message();
|
// Message();
|
||||||
Message(string time, string t);
|
// Message(string time, string t);
|
||||||
};
|
// };
|
||||||
|
|
||||||
|
|
Reference in a new issue