Giter Site home page Giter Site logo

dbms's Issues

Find 관련 버그들

1. memcpy

ret_value = (char*)malloc(VALUE_SIZE * sizeof(char));
memcpy(ret_value, leafPage->records[mid].value);
return ret_value;

memcpy는 3개의 인자가 필요하나 2개밖에 존재하지 않습니다. 사실 memcpy를 쓰지 않고 다음과 같이 바로 return하는 것이 더 낫습니다. 이렇게 하면 추가적인 free를 한번 더 할 필요가 없습니다. 지금의 코드는 free를 따로 하지 않았기 때문에 find query가 들어올 때마다 메모리가 낭비됩니다.

return leafPage->records[mid].value;

2. 잘못된 if 조건

isBetween의 리턴값이 -1일 때 line 77에서 걸리므로 line 81은 절대 실행되지 않습니다.

if(isBetween(internalPage, key, mid)){
load_page(internalPage->internalRecords[mid]->offset, internalPage);
break;
} else if(isBetween(internalPage, key, mid) == -1){
right = mid + 1;

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.