- Code: Select all
CREATE DEFINER=`root`@`localhost` PROCEDURE `p_deleteTunnel`(IN `geoDataID` INT, IN `altitude` INT)
LANGUAGE SQL
NOT DETERMINISTIC
MODIFIES SQL DATA
SQL SECURITY DEFINER
COMMENT 'Experimental procedure to undo tunnels in terrain'
BEGIN
IF true THEN
UPDATE geo_patch gp SET gp.IsServerOnly = 1 WHERE gp.GeoDataID = geoDataID AND gp.IsServerOnly = 0;
SET @terID = 0;
SET @newAltitude = 0;
SELECT gp.TerID, gp.Altitude FROM geo_patch gp WHERE gp.GeoDataID = geoDataID AND ChangeIndex = 1 GROUP BY Altitude LIMIT 1 INTO @terID, @newAltitude;
IF altitude > 0 THEN
SET @newAltitude = altitude;
END IF;
SET @result = f_addGeoPatch(1, 0, @terID, 1, geoDataID, @newAltitude, 3, 128, 60000, 42);
END IF;
END
Once I get the new trigger working that calls this procedure I'll post it as well. Let me know how this proc works for you guys.