diff --git a/DBMS/DBMS.v11.suo b/DBMS/DBMS.v11.suo new file mode 100644 index 0000000..be023db Binary files /dev/null and b/DBMS/DBMS.v11.suo differ diff --git a/DBMS/DBMS/globalVariable.h b/DBMS/DBMS/globalVariable.h index 38d798d..69b52e0 100644 --- a/DBMS/DBMS/globalVariable.h +++ b/DBMS/DBMS/globalVariable.h @@ -20,5 +20,5 @@ typedef unsigned char BYTE; #define STRING_TYPE 4 #define VARCHAR_TYPE 5 #define BOOLEAN_TYPE 6 - + #endif \ No newline at end of file diff --git a/DBMS/DBMS/recordManage.cpp b/DBMS/DBMS/recordManage.cpp index 7d1281b..cbc9771 100644 --- a/DBMS/DBMS/recordManage.cpp +++ b/DBMS/DBMS/recordManage.cpp @@ -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); @@ -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) @@ -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; @@ -178,4 +192,5 @@ void DBStorage::printFreeList(char* tablename, int pageid, int recordlength) { offset = *temp; } cout << endl; -} \ No newline at end of file +} +>>>>>>> 92f1cb5c80bd9f38cbe7aac3327994734240182a diff --git a/DBMS/DBMS/studentManage/studentinfo b/DBMS/DBMS/studentManage/studentinfo index adca978..06e6f4e 100644 Binary files a/DBMS/DBMS/studentManage/studentinfo and b/DBMS/DBMS/studentManage/studentinfo differ diff --git "a/DBMS/DBMS/\345\261\257\345\261\257\345\261\257\345\261\257\345\261\257\345\261\257\345\261\257\345\261\257\345\261\257\345\261\257\345\261\257\345\261\257\345\261\257\345\261\257\345\261\257\345\261\257\345\261\257\345\261\257\350\232\211RC\357\243\265\357\243\265\357\243\265\357\243\265" "b/DBMS/DBMS/\345\261\257\345\261\257\345\261\257\345\261\257\345\261\257\345\261\257\345\261\257\345\261\257\345\261\257\345\261\257\345\261\257\345\261\257\345\261\257\345\261\257\345\261\257\345\261\257\345\261\257\345\261\257\350\232\211RC\357\243\265\357\243\265\357\243\265\357\243\265" deleted file mode 100644 index 0eedbe5..0000000 Binary files "a/DBMS/DBMS/\345\261\257\345\261\257\345\261\257\345\261\257\345\261\257\345\261\257\345\261\257\345\261\257\345\261\257\345\261\257\345\261\257\345\261\257\345\261\257\345\261\257\345\261\257\345\261\257\345\261\257\345\261\257\350\232\211RC\357\243\265\357\243\265\357\243\265\357\243\265" and /dev/null differ