[Biojava-dev] BioSQL delete fixes for MySQL

Simon Foote simon.foote at nrc-cnrc.gc.ca
Thu Dec 18 10:01:52 EST 2003


Hi Folks,

Just a heads up that there was a bug in the MySQLDBHelper code that was 
preventing it from correctly identifying the server version, such that 
the delete style was never set to MYSQL4.  Hence, it always used the 
generic delete style which seemed to never work consistently with my 
tests.  The minor version identifier for MySQL returns 0 for 4.0.* 
servers.  The needed number is the subminor # which you can't retrieve 
from the database metadata.  So instead of getting fancy to get that #, 
I just changed the code to check for a minor version >= 0 and not to 
check the subminor version.  I would assume anyone using MySQL4 would at 
least be using one of the higher versions since its upto 4.0.17 now.

I also changed the BioSQLSequenceDB.java for Delete_MYSQL4 to just 
delete the bioentry given the bioentry_id as  MySQL is using a cascading 
delete which is defined in the biosql-schema and is faster than deleting 
individual rows from each table.

And lastly, the select statement to get the bioentry_id to delete failed 
to take into account the biodatabase_id, so could conceivably delete a 
bioentry with the same accession, but in another biodatabase.  Just 
substituted the select statment used by get_sequence in the 
remove_sequence code.

Cheers and Happy Holidays,
Simon

-- 
Bioinformatics Programmer
Pathogen Genomics
Institute for Biological Sciences
National Research Council of Canada
[T] 613-990-0561  [F] 613-952-9092
simon.foote at nrc-cnrc.gc.ca



More information about the biojava-dev mailing list