| Author |
Message |
jimithing1980
Joined: 08 Mar 2010 Posts: 8
|
Posted: Mon Mar 08, 2010 11:31 pm Post subject: Exception when loading a function into Source Control |
|
|
I'm receiving the following Stack Trace when loading a function into Source Control using version 0.3:
| Quote: |
Failed to update:
#oEc.#8Jf: Failed to parse file C:\Documents and Settings\Jason.M\Local Settings\Application Data\Red Gate\SQL Source Control 0\WorkingBases\64c806c3-9830-434b-9d93-b60c32841002\Functions\dbo.GetGreatCirckeDistanceKilometers.sql ---> #Eyg.#Ryg: Failed to parse file C:\Documents and Settings\Jason.M\Local Settings\Application Data\Red Gate\SQL Source Control 0\WorkingBases\64c806c3-9830-434b-9d93-b60c32841002\Functions\dbo.GetGreatCirckeDistanceKilometers.sql ---> line 42:22: unexpected char: 0xD
--- End of inner exception stack trace ---
at #oEc.#7Jf.#t.#B3.#sKf()
at #oEc.#7Jf.#gKf(Action action)
--- End of inner exception stack trace ---
Server stack trace:
at RedGate.SQLSourceControl.Engine.Cancellables.CancellableOperation.#t.#izb.#j5f()
at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
at System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(RuntimeMethodHandle md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
at System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(IMessage msg, IMessageSink replySink)
Exception rethrown at [0]:
at RedGate.SQLSourceControl.CommonUI.Forms.ErrorDialog.DoWithObviousExceptionsThrowAll(Action action)
at #JLc.#PLc.#CTc(ICancellableOperation`1 operation, Object token) |
The Function I'm loading is below:
| Code: |
ALTER function [dbo].[GetGreatCirckeDistanceKilometers]
(
@Latitude1 float,
@Longitude1 float,
@Latitude2 float,
@Longitude2 float
)
returns float
as
/*
FUNCTION: GetGreatCirckeDistanceKilometers
Computes the Great Circle distance in kilometers
between two points on the Earth using the
Haversine formula distance calculation.
Input Parameters:
@Longitude1 - Longitude in degrees of point 1
@Latitude1 - Latitude in degrees of point 1
@Longitude2 - Longitude in degrees of point 2
@Latitude2 - Latitude in degrees of point 2
*/
begin
declare @radius float
declare @lon1 float
declare @lon2 float
declare @lat1 float
declare @lat2 float
declare @a float
declare @distance float
-- Sets average radius of Earth in Kilometers
set @radius = 6376.5E
-- Sets average radius of Earth in Miles
--set @radius = 3956.0E
-- Convert degrees to radians
set @lon1 = radians( @Longitude1 )
set @lon2 = radians( @Longitude2 )
set @lat1 = radians( @Latitude1 )
set @lat2 = radians( @Latitude2 )
set @a = sqrt(square(sin((@lat2-@lat1)/2.0E)) +
(cos(@lat1) * cos(@lat2) * square(sin((@lon2-@lon1)/2.0E))) )
set @distance =
@radius * ( 2.0E *asin(case when 1.0E < @a then 1.0E else @a end ))
return @distance
end |
|
|
| Back to top |
|
 |
sherr
Joined: 19 Mar 2009 Posts: 122 Location: Cambridge
|
Posted: Tue Mar 09, 2010 12:02 pm Post subject: Exception when loading a function into Source Control |
|
|
| Thank you so much for including the stack track and the code for the function. We were able to replicate your issue. We are looking into a fix for this now. Our internal reference number is SOC-800. |
|
| Back to top |
|
 |
jimithing1980
Joined: 08 Mar 2010 Posts: 8
|
Posted: Tue Mar 09, 2010 5:45 pm Post subject: Exception when loading a function into Source Control |
|
|
| I have already fixed it for now by removing the E in the float variables. I had to do it in a couple places (on the server, in source control, and in a temp directory) but that seems to be the bug. |
|
| Back to top |
|
 |
sherr
Joined: 19 Mar 2009 Posts: 122 Location: Cambridge
|
Posted: Tue Mar 09, 2010 6:00 pm Post subject: Exception when loading a function into Source Control |
|
|
| Thanks for letting us know how you fixed it. The 3 places you mentioned make sense. I'll add this workaround to your issue and we'll see if there's a way we could prevent it from having this problem in the first place. |
|
| Back to top |
|
 |
|
|
All times are GMT + 1 Hour
|
| Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group