<commit_before>﻿
-- USE [ASPState]
-- GO

CREATE TABLE ASPStateTempSessions (
    SessionId           nvarchar(88)    NOT NULL PRIMARY KEY,
    Created             datetime        NOT NULL DEFAULT GETUTCDATE(),
    Expires             datetime        NOT NULL,
    LockDate            datetime        NOT NULL,
    LockDateLocal       datetime        NOT NULL,
    LockCookie          int             NOT NULL,
    Timeout             int             NOT NULL,
    Locked              bit             NOT NULL,
    SessionItemShort    VARBINARY(7000) NULL,
    SessionItemLong     varbinary(MAX)  NULL,
    Flags               int             NOT NULL DEFAULT 0,
) 

CREATE NONCLUSTERED INDEX Index_Expires ON ASPStateTempSessions(Expires)

CREATE TABLE ASPStateTempApplications (
    AppId               int             NOT NULL PRIMARY KEY,
    AppName             char(280)       NOT NULL,
) 

CREATE NONCLUSTERED INDEX Index_AppName ON ASPStateTempApplications(AppName)


GO   

CREATE PROCEDURE TempGetVersion
    @ver      char(10) OUTPUT
AS
    SELECT @ver = '2'
    RETURN 0
GO

/*****************************************************************************/

CREATE PROCEDURE GetHashCode
    @input varchar(280),
    @hash int OUTPUT
AS
    /* 
       This sproc is based on this C# hash function:

        int GetHashCode(string s)
        {
            int     hash = 5381;
            int     len = s.Length;

            for (int i = 0; i < len; i++) {
                int     c = Convert.ToInt32(s[i]);<commit_msg>Missing stored procedure in ASP.net session state SQL<commit_after>﻿
-- USE [ASPState]
-- GO

CREATE TABLE ASPStateTempSessions (
    SessionId           nvarchar(88)    NOT NULL PRIMARY KEY,
    Created             datetime        NOT NULL DEFAULT GETUTCDATE(),
    Expires             datetime        NOT NULL,
    LockDate            datetime        NOT NULL,
    LockDateLocal       datetime        NOT NULL,
    LockCookie          int             NOT NULL,
    Timeout             int             NOT NULL,
    Locked              bit             NOT NULL,
    SessionItemShort    VARBINARY(7000) NULL,
    SessionItemLong     varbinary(MAX)  NULL,
    Flags               int             NOT NULL DEFAULT 0,
) 

CREATE NONCLUSTERED INDEX Index_Expires ON ASPStateTempSessions(Expires)

CREATE TABLE ASPStateTempApplications (
    AppId               int             NOT NULL PRIMARY KEY,
    AppName             char(280)       NOT NULL,
) 

CREATE NONCLUSTERED INDEX Index_AppName ON ASPStateTempApplications(AppName)


GO   

CREATE PROCEDURE TempGetVersion
    @ver      char(10) OUTPUT
AS
    SELECT @ver = '2'
    RETURN 0
GO

CREATE PROCEDURE dbo.GetMajorVersion
	@@ver int OUTPUT
AS
BEGIN
	DECLARE @version		nchar(100)
	DECLARE @dot			int
	DECLARE @hyphen		 int
	DECLARE @SqlToExec	 nchar(4000)

	SELECT @@ver = 7
	SELECT @version = @@Version
	SELECT @hyphen = CHARINDEX(N' - ', @version)
	IF (NOT(@hyphen IS NULL) AND @hyphen > 0)
	BEGIN
		SELECT @hyphen = @hyphen + 3
		SELECT @dot	= CHARINDEX(N'.', @version, @hyphen)
		IF (NOT(@dot IS NULL) AND @dot > @hyphen)
		BEGIN
			SELECT @version = SUBSTRING(@version, @hyphen, @dot - @hyphen)
			SELECT @@ver	 = CONVERT(int, @version)
		END
	END
END
GO  

/*****************************************************************************/

CREATE PROCEDURE GetHashCode
    @input varchar(280),
    @hash int OUTPUT
AS
    /* 
       This sproc is based on this C# hash function:

        int GetHashCode(string s)
        {
            int     hash = 5381;
            int     len = s.Length;

            for (int i = 0; i < len; i++) {
                int     c = Convert.ToInt32(s[i]);
{'fraction_non_alphanumeric': 0.10781377620473727, 'fraction_numerical': 0.015790906615845358, 'mean_word_length': 1.8860958366064415, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5483992', 'n_tokens_mistral': 1163, 'n_tokens_neox': 1027, 'n_words': 337}