Ignore:
Timestamp:
Jan 25, 2017, 2:56:04 PM (5 years ago)
Author:
Nicklas Nordborg
Message:

References #2049: Project-specific annotations

We need a different query in MySQL to make sure project-specific annotations are correctly referenced. There are several other similar queries in use. This was the only one that happened to fail in the TestAnnotation test. I think we need to manually try to test that the other queries are working as well. If they don't it would be good to design test cases that trigger them to be executed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.10-stable/config/dist/mysql-queries.xml

    r7259 r7282  
    8787  </query>
    8888
     89  <query id="PS_FIND_OVERRIDE_ID_FOR_PROJECT_ANNOTATION" type="SQL">
     90    <sql>
     91      UPDATE [Annotations]
     92      SET [override_id] = COALESCE(
     93        (SELECT [tmp].[id] FROM
     94          (SELECT [id] FROM [Annotations]
     95          WHERE [annotationset_id] = :annotationSetId
     96          AND [annotationtype_id] = :annotationTypeId
     97          AND [source] = 0 AND [project_id] = 0) [tmp]
     98        )
     99        , 0)
     100      WHERE id = :annotationId
     101    </sql>
     102    <description>
     103      Updates the "override_id" column on a newly created project-specific
     104      (PRIMARY) annotation to point to the existing default annotation id
     105      or 0 if no default annotation exists. To make this query work in MySQL
     106      we need a double inner subselect to force a temporary table for the
     107      single value we are after.
     108    </description>
     109  </query>
    89110
    90111</predefined-queries>
Note: See TracChangeset for help on using the changeset viewer.