Skip to content
Merged
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
2 changes: 1 addition & 1 deletion DBMS/DBMS/globalVariable.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ typedef unsigned char BYTE;
#define DB_PGSIZE 8192 // size of page
#define DB_PGSIZE_USRT 4096 //DB_PGSIZE/(sizeof (USRT))
#define DB_MAX_BUFFER_SIZE 1000 // the size of maximum buffer page
#define TABLE_MAX_FILE_SIZE 100
#define TABLE_MAX_FILE_SIZE 3000
#define TABLE_NUM_SCALE 100
#define COLUMN_NUM_SCALE 10000
#define ID_NUM_SCALE 10200 //(COLUMN_NUM_SCALE+2*TABLE_NUM_SCALE)
Expand Down
Binary file modified DBMS/DBMS/orderDB/_sysFile
Binary file not shown.
Binary file removed DBMS/DBMS/orderDB/book
Binary file not shown.
Binary file removed DBMS/DBMS/orderDB/orders
Binary file not shown.
Binary file removed DBMS/DBMS/orderDB/publisher
Binary file not shown.
6 changes: 2 additions & 4 deletions DBMS/DBMS/systemManage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,10 +248,8 @@ void SysManager::printTable(string tableName){
SysObject* table = findTable(tableName);
if(table == NULL)
return;
vector<SysColumn*> radix;
for(auto col : table->vecCols){
radix.push_back(findColumn(col));
}
vector<SysColumn*> radix = getTableAttr(tableName);

cout << "===================== table: " << tableName << " ======================" << endl;
int i = 1;
for(auto col : radix){
Expand Down
Binary file modified DBMS/DBMS/test/_sysFile
Binary file not shown.
10 changes: 7 additions & 3 deletions DBMS/DBMS/wq_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -796,12 +796,16 @@ bool parser::checkOneColumnValue(SysColumn syscolumn, string data) {

if (syscolumn.xtype == INT_TYPE) {
for (int i = 0; i < data.length(); i++) {
if (!isDig(data[i]))
if (!isDig(data[i])) {
cout << "insert error : You should input the integer." << endl;
return false;
}
}
} else if (syscolumn.xtype == VARCHAR_TYPE) {
if (data.length() > syscolumn.length)
return false;
if (data.length() > syscolumn.length) {
cout << "insert error : You should input the shorter string." << endl;
return false;
}
}
return true;
}
Expand Down
4 changes: 3 additions & 1 deletion doc/problems.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,6 @@ fopen最后一行读取两次http://blog.163.com/chen_dawn/blog/static/112506320

where 语句:
左边是attr,右边是value
左边是table1,右边是table2
左边是table1,右边是table2
------------------------------------
insert 数据没有判断重复数据【id 唯一没有做到】
Binary file added originInsertData/orderDB/_sysFile
Binary file not shown.
Binary file added originInsertData/orderDB/book
Binary file not shown.
Binary file added originInsertData/orderDB/customer
Binary file not shown.
Binary file added originInsertData/orderDB/orders
Binary file not shown.
Binary file added originInsertData/orderDB/publisher
Binary file not shown.