mulch-environment / mulch

mulch environment for structural biology
0 stars 0 forks source link

Code/apostrophe bug #5

Closed helenginn closed 1 year ago

helenginn commented 1 year ago
int main(int argc, char **argv)
{
    mulch::Collection *c = new mulch::Collection();

    c->addModel(Atomic, "3dpw.pdb");
    c->addModel(Atomic, "3dpz.pdb");

    c->persist();
    return 0;
}
this returns the following output followed by a seg fault:
1
New instance for Atomistic model type

3dpw.pdb
Adding data to CollectionHasDataset
In CollectionHasDataset::setCollection
1
New instance for Atomistic model type

3dpz.pdb
Adding data to CollectionHasDataset
In CollectionHasDataset::setCollection
/usr/local/share/mulch
Database is empty 
Read and execute SQL commands from folder: /usr/local/share/mulch/template.sql
Beginning updating Database... 

Finish updating dependecies.

Starting updating Database
INSERT INTO Collection (fixed) VALUES (true);
1
Which table are you currently updating the dependecies?
collection_id

Which table are you currently updating the dependecies?
collection_id
Beginning updating Database... 

Beginning updating Database... 

Beginning updating Database... 

Beginning updating Database... 

Updating dependencies for RepresentationType->AtomicModelInfo 

Beginning updating Database... 

Beginning updating Database... 

Finish updating dependecies.

Starting updating Database
INSERT INTO TLSParametersInfo DEFAULT VALUES;
1
Which table are you currently updating the dependecies?
tlsparameters_id

Which table are you currently updating the dependecies?
tlsparameters_id
Finish updating dependecies.

Starting updating Database
INSERT INTO AtomicModelInfo DEFAULT VALUES;
1
Which table are you currently updating the dependecies?
atomic_model_id
UPDATE AtomicModelInfo SET pdb_code = '3dpw.pdb' WHERE atomic_model_id = (1);
Which table are you currently updating the dependecies?
atomic_model_id
Finish updating dependecies.

Starting updating Database
INSERT INTO RepresentationType DEFAULT VALUES;
1
Which table are you currently updating the dependecies?
representation_type_id
UPDATE RepresentationType SET atomic_model_id = 1 WHERE representation_type_id = 1;
UPDATE RepresentationType SET atomic_model_id = 1 WHERE representation_type_id = 1;
Which table are you currently updating the dependecies?
representation_type_id
Beginning updating Database... 

Beginning updating Database... 

Finish updating dependecies.

Starting updating Database
INSERT INTO CrystallographicInfo DEFAULT VALUES;
1
Which table are you currently updating the dependecies?
crystallographic_info_id

Which table are you currently updating the dependecies?
crystallographic_info_id
Beginning updating Database... 

Finish updating dependecies.

Starting updating Database
INSERT INTO NMRInfo DEFAULT VALUES;
1
Which table are you currently updating the dependecies?
nmr_info_id
UPDATE NMRInfo SET comments = ''No comments yet''WHERE nmr_info_id = (1);
libc++abi.dylib: terminating with uncaught exception of type std::invalid_argument: mulch exception: near "No": syntax error
Abort trap: 6

(a) shouldn't be inserting anything into NMRInfo should it? I didn't want to add Data (b) The comments should be with single apostrophes rather than double quotes for SQL. (c) can we begin with an empty comment string? i.e. SET comments = '' WHERE ...