[Digikam-devel] [digikam] [Bug 324323] Hang on opening Geolocation pane on photos with XMP GPS tags.
    Alexander Meshcheryakov 
    alexander.s.m at gmail.com
       
    Sat Aug 31 18:21:01 BST 2013
    
    
  
https://bugs.kde.org/show_bug.cgi?id=324323
Alexander Meshcheryakov <alexander.s.m at gmail.com> changed:
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |alexander.s.m at gmail.com
--- Comment #2 from Alexander Meshcheryakov <alexander.s.m at gmail.com> ---
To prevent accidental hangs of digiKam I've added following trigger to my MySQL
DB
CREATE TRIGGER `ImagePositions_BINS` BEFORE INSERT ON ImagePositions FOR EACH
ROW
-- Edit trigger body code below this line. Do not edit lines above this one
BEGIN
    DECLARE msg varchar(255);
    IF (NEW.latitudeNumber>90 OR NEW.latitudeNumber<-90) THEN
        SET msg = concat('Latitude out of bounds (', cast(NEW.latitudeNumber AS
CHAR), ')');
        SIGNAL sqlstate '45000' SET message_text = msg;
    END IF;
    IF (NEW.longitudeNumber>180 OR NEW.longitudeNumber<-180) THEN
        SET msg = concat('Longitude out of bounds (', cast(NEW.longitudeNumber
AS CHAR), ')');
        SIGNAL sqlstate '45000' SET message_text = msg;
    END IF;
END
And similar trigger for BEFORE UPDATE.
Unfortunately, MariaDB does not support CHECK CONSTRAINT unlike SQLite.
I suppose checks for valid coords should be added to standart DB schema.
-- 
You are receiving this mail because:
You are the assignee for the bug.
    
    
More information about the Digikam-devel
mailing list