Corrected the issue of argv[0] being enclosed in double quotes
Merge branch 'nithin' into dheeraj
Merge branch 'nithin' into dheeraj
Merge branch 'nithin' into dheeraj
Changed type to integer in create.c
changed the catalog slotmaps in createcats as memcpy(latest implementation of bin->int) uses big-Endian and prev. impl. wasn't.
Merge branch 'nithin' into dheeraj
Extreme buggy version.
Fixed a lot of bugs and dependancy problems (like strncpy can't have src and dest same string).
Intentionally put a return 1 in create.c:39 as it doesn't create a file just before that(should have).
So no relation file is made.
changes. [1] In insertrec.c, call to getnextRid() 2nd argument was expecting slotnum, instead slotmap was given
[2] openrel.c wasn't handling already opened relations
[3] create.c the file creation flag O_CREAT is added, and removed return 1.
--- Current Issue: inf loop at insertrec.c:68 due to condition at :70. --- first occurance at prevRid = {1,9} and curRid={2,1} in relation attrcat.
inf. loop problem corrected by using do while.
recsPerPg is edited to 32 or MAXRECORD/recLength, whichever is smaller
main is running to print relcat and attrcat.
SUCCESSFULLY created a new relation.
IMP Bug Fix: in closerel() writerec is used to edit relcat entry. Now it is successfully editing and showing new numRecs after creating a relation and printing relcat.
g_cache_dirty[i] is removed as it represent the same as that of g_catcache[i].dirty.
An example in main.c which creates a new relation "person" and adds two tuples and then prints person, relcat, attrcat.
Major bug fix: create.c:25 OpenRel gives either NOTOK or relNum. So to check the presence of a relation we have to check != NOTOK. (It was ==OK, so fails when a valid relNum is returned).
Clean up and minor bug fixes in openrel.c
In delete, all argv index was incorrect, and corrected it.
In deleterec the bit shifting is made 32-slotnum
and cache_entry made dirty as the number of records is changed.
In destroy, cache_entry is made "not in use" So that it can't appear anywhere just because buffer entry is available(eg. we could print a destroyed relation as it's cache is active and buffer is good for 1 page)
OpenRel needs to set NULL to the last node of attrcache node.(Fixed)
in select, if the value is of type string, we need to remove Quotes(Fixed)
Needed to edit select, delete because the argument valuePtr is binary data, expected by findrec.
found when given integer values and corrected it.
Bug Fix in project.c: while iterating through required attributes, it follows source attribute list if just next pointer is used. [Fixed, by using indexing, attrArray[i] ]
One common functionality found, moved to helpers.c (getAttrCatalog)
In findrec, the order of comparison was given in reverse order [fixed].
Join is corrected.
An example is in main.c
Individual testing Complete.