YAFLogo

logan
  • logan
  • 100% (Exalted)
  • YAF Leader Topic Starter
15 years ago
Getting error on fresh install from SVN. 3071

Stack Trace: 


[Exception: FILE:
mssql/functions.sql

ERROR:
Cannot assign a default value to a local variable.
Cannot assign a default value to a local variable.
Must declare the scalar variable "@dependency".
Must declare the scalar variable "@dependency".
Must declare the scalar variable "@haschildren".
Must declare the scalar variable "@dependency".
Must declare the scalar variable "@haschildren".
Must declare the scalar variable "@haschildren".
Must declare the scalar variable "@dependency".

STATEMENT:
create function [dbo].[yaf_forum_save_parentschecker](@ForumID int, @ParentID int) returns int as

begin
-- Checks if the forum is already referenced as a parent 
    declare @dependency int = 0
    declare @haschildren int = 0
    declare @frmtmp int
    declare @prntmp int
    select @dependency=ForumID from [dbo].[yaf_Forum] where ParentID=@ForumID AND ForumID = @ParentID;
    if @dependency > 0
    begin
    return @ParentID
    end

    if exists(select 1 from [dbo].[yaf_Forum] where ParentID=@ForumID)
        begin        
        declare c cursor for
        select ForumID,ParentID from [dbo].[yaf_Forum]
        where ParentID = @ForumID
        
        open c
        
        fetch next from c into @frmtmp,@prntmp
        while @@FETCH_STATUS = 0
        begin
        if @frmtmp > 0 AND @frmtmp IS NOT NULL
         begin        
            set @haschildren= [dbo].[yaf_forum_save_parentschecker](@frmtmp,@ParentID)            
            if  @prntmp = @ParentID
            begin
            set @dependency= @ParentID
            end    
            else if @haschildren > 0
            begin
            set @dependency= @haschildren
            end        
        end
        fetch next from c into @frmtmp,@prntmp
        end
        close c
        deallocate c    
    end
    return @dependency
end]
   YAF.Classes.Data.DB.system_initialize_executescripts(String script, String scriptFile, Boolean useTransactions) in C:\111111111svn\yafsrc\YAF.Classes\YAF.Classes.Data\DB.cs:8601
   YAF.Install._default.ExecuteScript(String scriptFile, Boolean useTransactions) in c:\111111111svn\yafsrc\YetAnotherForum.NET\install\default.aspx.cs:1365
   YAF.Install._default.UpgradeDatabase(Boolean fullText) in c:\111111111svn\yafsrc\YetAnotherForum.NET\install\default.aspx.cs:999
   YAF.Install._default.Wizard_NextButtonClick(Object sender, WizardNavigationEventArgs e) in c:\111111111svn\yafsrc\YetAnotherForum.NET\install\default.aspx.cs:619
   System.Web.UI.WebControls.Wizard.OnNextButtonClick(WizardNavigationEventArgs e) +108
   System.Web.UI.WebControls.Wizard.OnBubbleEvent(Object source, EventArgs e) +418
   System.Web.UI.WebControls.WizardChildTable.OnBubbleEvent(Object source, EventArgs args) +19
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
   System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +118
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +166
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565

 


test
Sponsor
bbobb
  • bbobb
  • 100% (Exalted)
  • YAF Developer
15 years ago
Strange, which MS SQL Server version do you use? :shock:

Fixed and commited! Thanks.

logan
  • logan
  • 100% (Exalted)
  • YAF Leader Topic Starter
15 years ago
This was on the VS Dev server using SQLExpress.

Fix went through with no errors. Thank You


test