Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added DBMS/DBMS.v11.suo
Binary file not shown.
2 changes: 1 addition & 1 deletion DBMS/DBMS/globalVariable.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ typedef unsigned char BYTE;
#define STRING_TYPE 4
#define VARCHAR_TYPE 5
#define BOOLEAN_TYPE 6

#endif
17 changes: 16 additions & 1 deletion DBMS/DBMS/recordManage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,17 @@ void DBStorage::insertData(char* tablename, recordEntry record) {
}
}
}
<<<<<<< HEAD
char* firstOffset = dataUtility::getbyte(pageInfo->data, pageInfo->header.firstFreeOffset+record.length-sizeof(int), sizeof(int));
int firstFreeOffset = *(int*)firstOffset;
delete firstOffset;
if (firstFreeOffset == 0) {
pageInfo->header.firstFreeOffset += record.length;
} else {
pageInfo->header.firstFreeOffset = firstFreeOffset;
char* secondOffset = dataUtility::getbyte(pageInfo->data, firstFreeOffset+record.length-sizeof(int), sizeof(int));
record.offset = *(int*)secondOffset;
=======
cout << pageInfo->header.firstFreeOffset << endl;
char* data = new char[record.length];
data = record.getRecord(&record);
Expand All @@ -119,6 +130,7 @@ void DBStorage::insertData(char* tablename, recordEntry record) {
pageInfo->header.firstFreeOffset += record.length;
} else {
pageInfo->header.firstFreeOffset = *temp;
>>>>>>> 92f1cb5c80bd9f38cbe7aac3327994734240182a
}
pageInfo->header.freeCount -= record.length;
if (pageInfo->header.freeCount < record.length)
Expand All @@ -130,6 +142,8 @@ void DBStorage::insertData(char* tablename, recordEntry record) {
//cout << "************************End Insert Data**********************" << endl;
}

<<<<<<< HEAD
=======
void DBStorage::deleteData(char* tablename, int pageid, int offset, int recordlength) {
if (offset > PAGE_SIZE)
return;
Expand Down Expand Up @@ -178,4 +192,5 @@ void DBStorage::printFreeList(char* tablename, int pageid, int recordlength) {
offset = *temp;
}
cout << endl;
}
}
>>>>>>> 92f1cb5c80bd9f38cbe7aac3327994734240182a
Binary file modified DBMS/DBMS/studentManage/studentinfo
Binary file not shown.
Binary file not shown.