[Biopython-dev] [Bug 2394] New: INSERT INTO seqfeature_qualifier_value ...

bugzilla-daemon at portal.open-bio.org bugzilla-daemon at portal.open-bio.org
Thu Nov 8 11:47:10 EST 2007


http://bugzilla.open-bio.org/show_bug.cgi?id=2394

           Summary: INSERT INTO seqfeature_qualifier_value ...
           Product: Biopython
           Version: 1.44
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: BioSQL
        AssignedTo: biopython-dev at biopython.org
        ReportedBy: biopython-bugzilla at maubp.freeserve.co.uk


Reported on the mailing list by Eric Gibert, as pointed out by Hilmar Lapp any
SQL statement which relies on the field order not changing is fragile.  My
patch to follow...

Eric wrote:

In my BioSQL database, the table  'seqfeature_qualifier_value' as the following
schema:

seqfeature_id        int(11)
term_id                 int(11)
value                     varchar(255)
rank                       int(11)

note that first we have 'value' then we have 'rank'.

But the  'INSERT INTO seqfeature_qualifier_value' statement found in 
BioSQL/Loader.py line 453 is:


                    qualifier_value =
qualifiers[qualifier_key][qual_value_rank]
                    sql = r"INSERT INTO seqfeature_qualifier_value VALUES" \
                          r" (%s, %s, %s, %s)"
                    self.adaptor.execute(sql, (seqfeature_id,
                                               qualifier_key_id,
                                               qual_value_rank + 1,
                                               qualifier_value))


thus I need to invert the last two elements of the list. As I said, I do not
know if my BioSQL schema is correct or not.
If my schema is correct then my correction is obvious:
                     self.adaptor.execute(sql, (seqfeature_id,
                                               qualifier_key_id,
                                               qualifier_value,        # EG
invert the two last params
                                               qual_value_rank + 1
                                               ))


-- 
Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.


More information about the Biopython-dev mailing list