mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-17 11:21:39 -10:00
Compare commits
8
Commits
xcode8
...
mono-1-2-3-50
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e27148fde8 | ||
|
|
dda60383b0 | ||
|
|
6decc63a3c | ||
|
|
3df4993df5 | ||
|
|
37022f5885 | ||
|
|
e514b0a1bb | ||
|
|
eed7280ca6 | ||
|
|
3de497ad5e |
No files matched your search
@@ -1,3 +1,8 @@
|
||||
2007-03-21 Nagappan A <[email protected]>
|
||||
|
||||
* Tds70.cs (BuildParameters, FormatParameter): Include @ before
|
||||
parameter name, if doesnot exist.
|
||||
|
||||
2006-07-18 Dean Brettle <[email protected]>
|
||||
|
||||
* Tds70.cs : Fixed bug in FormatParameter() which caused
|
||||
|
||||
@@ -78,14 +78,17 @@ namespace Mono.Data.Tds.Protocol {
|
||||
|
||||
StringBuilder result = new StringBuilder ();
|
||||
foreach (TdsMetaParameter p in Parameters) {
|
||||
string includeAt = "@";
|
||||
if (p.ParameterName [0] == '@')
|
||||
includeAt = "";
|
||||
if (p.Direction != TdsParameterDirection.ReturnValue) {
|
||||
if (result.Length > 0)
|
||||
result.Append (", ");
|
||||
if (result.Length > 0)
|
||||
result.Append (", ");
|
||||
if (p.Direction == TdsParameterDirection.InputOutput)
|
||||
result.Append (String.Format("{0}={0} output", p.ParameterName));
|
||||
result.Append (String.Format("{0}{1}={1} output", includeAt, p.ParameterName));
|
||||
else
|
||||
result.Append (FormatParameter (p));
|
||||
}
|
||||
result.Append (FormatParameter (p));
|
||||
}
|
||||
}
|
||||
return result.ToString ();
|
||||
}
|
||||
@@ -133,7 +136,7 @@ namespace Mono.Data.Tds.Protocol {
|
||||
if( p.Direction == TdsParameterDirection.InputOutput )
|
||||
set.Append (String.Format ("set {0}\n", FormatParameter(p)));
|
||||
else
|
||||
set.Append (String.Format ("set {0}=NULL\n", p.ParameterName));
|
||||
set.Append (String.Format ("set {0}=NULL\n", p.ParameterName));
|
||||
}
|
||||
|
||||
count += 1;
|
||||
@@ -430,8 +433,11 @@ namespace Mono.Data.Tds.Protocol {
|
||||
|
||||
private string FormatParameter (TdsMetaParameter parameter)
|
||||
{
|
||||
string includeAt = "@";
|
||||
if (parameter.ParameterName [0] == '@')
|
||||
includeAt = "";
|
||||
if (parameter.Direction == TdsParameterDirection.Output)
|
||||
return String.Format ("{0}={0} output", parameter.ParameterName);
|
||||
return String.Format ("{0}{1}={1} output", includeAt, parameter.ParameterName);
|
||||
|
||||
if (parameter.Value == null || parameter.Value == DBNull.Value)
|
||||
return parameter.ParameterName + "=NULL";
|
||||
@@ -490,7 +496,7 @@ namespace Mono.Data.Tds.Protocol {
|
||||
break;
|
||||
}
|
||||
|
||||
return parameter.ParameterName + "=" + value;
|
||||
return includeAt + parameter.ParameterName + "=" + value;
|
||||
}
|
||||
|
||||
public override string Prepare (string commandText, TdsMetaParameterCollection parameters)
|
||||
|
||||
@@ -1,3 +1,13 @@
|
||||
2007-03-21 Nagappan A <[email protected]>
|
||||
|
||||
* TdsMetaParameter.cs (Prepare): Include @ before parameter name,
|
||||
if doesnot exist.
|
||||
|
||||
2007-03-16 Andreia Gaita <[email protected]>
|
||||
|
||||
* TdsMetaParameter.cs: Add Validate() method. For now, validate
|
||||
size/value. Add isVariableSizeType.
|
||||
|
||||
2006-01-05 Senganal T <[email protected]>
|
||||
|
||||
* TdsMetaParameter.cs: Test for DbNull when updating the scale
|
||||
|
||||
@@ -46,6 +46,7 @@ namespace Mono.Data.Tds {
|
||||
bool isSizeSet = false;
|
||||
bool isNullable;
|
||||
object value;
|
||||
bool isVariableSizeType;
|
||||
|
||||
#endregion // Fields
|
||||
|
||||
@@ -126,6 +127,12 @@ namespace Mono.Data.Tds {
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsVariableSizeType
|
||||
{
|
||||
get { return isVariableSizeType; }
|
||||
set { isVariableSizeType = value; }
|
||||
}
|
||||
|
||||
#endregion // Properties
|
||||
|
||||
#region Methods
|
||||
@@ -145,7 +152,10 @@ namespace Mono.Data.Tds {
|
||||
}
|
||||
}
|
||||
|
||||
StringBuilder result = new StringBuilder (String.Format ("{0} {1}", ParameterName, typeName));
|
||||
string includeAt = "@";
|
||||
if (ParameterName [0] == '@')
|
||||
includeAt = "";
|
||||
StringBuilder result = new StringBuilder (String.Format ("{0}{1} {2}", includeAt, ParameterName, typeName));
|
||||
switch (typeName) {
|
||||
case "decimal":
|
||||
case "numeric":
|
||||
@@ -270,6 +280,19 @@ namespace Mono.Data.Tds {
|
||||
}
|
||||
}
|
||||
|
||||
public void Validate (int index)
|
||||
{
|
||||
if ((this.direction == TdsParameterDirection.InputOutput || this.direction == TdsParameterDirection.Output) &&
|
||||
this.isVariableSizeType && (Value == DBNull.Value || Value == null) && Size == 0
|
||||
)
|
||||
{
|
||||
throw new InvalidOperationException (String.Format ("{0}[{1}]: the Size property should " +
|
||||
"not be of size 0",
|
||||
this.typeName,
|
||||
index));
|
||||
}
|
||||
}
|
||||
|
||||
#endregion // Methods
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,9 @@
|
||||
2007-03-16 Andreia Gaita <[email protected]>
|
||||
|
||||
* SqlParameter.cs: Move isVariableSizeType flag to TdsMetaParameter
|
||||
so that the TdsMetaParameter can validate itself for valid size / values.
|
||||
* SqlCommand.cs (Execute): Call Validate on TdsMetaParameter.
|
||||
|
||||
2007-03-14 Nagappan A <[email protected]>
|
||||
|
||||
* SqlCommand.cs (CommandType): Exception type thrown in 2.0
|
||||
|
||||
@@ -362,27 +362,9 @@ namespace System.Data.SqlClient {
|
||||
Connection.Tds.RecordsAffected = -1;
|
||||
TdsMetaParameterCollection parms = Parameters.MetaParameters;
|
||||
foreach (TdsMetaParameter param in parms) {
|
||||
bool flag = false;
|
||||
string type = "";
|
||||
if (param.Size == 0) {
|
||||
switch (param.TypeName) {
|
||||
case "nvarchar":
|
||||
type = "String";
|
||||
flag = true;
|
||||
break;
|
||||
case "varbinary":
|
||||
type = "Byte[]";
|
||||
flag = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (flag == true)
|
||||
throw new InvalidOperationException (String.Format ("{0}[{1}]: the Size property should " +
|
||||
"not be of size 0",
|
||||
type,
|
||||
index));
|
||||
index++;
|
||||
param.Validate (index++);
|
||||
}
|
||||
|
||||
if (preparedStatement == null) {
|
||||
bool schemaOnly = ((behavior & CommandBehavior.SchemaOnly) > 0);
|
||||
bool keyInfo = ((behavior & CommandBehavior.KeyInfo) > 0);
|
||||
|
||||
@@ -61,7 +61,6 @@ namespace System.Data.SqlClient {
|
||||
DbType dbType;
|
||||
ParameterDirection direction = ParameterDirection.Input;
|
||||
bool isNullable;
|
||||
bool isVariableSizeType = false;
|
||||
bool isTypeSet = false;
|
||||
int offset;
|
||||
SqlDbType sqlDbType;
|
||||
@@ -171,7 +170,7 @@ namespace System.Data.SqlClient {
|
||||
if (!isTypeSet)
|
||||
throw new Exception ("all parameters to have an explicity set type");
|
||||
|
||||
if (isVariableSizeType) {
|
||||
if (MetaParameter.IsVariableSizeType) {
|
||||
if (SqlDbType == SqlDbType.Decimal && Precision == 0)
|
||||
throw new Exception ("Parameter of type 'Decimal' have an explicitly set Precision and Scale");
|
||||
else if (Size == 0)
|
||||
@@ -489,17 +488,17 @@ namespace System.Data.SqlClient {
|
||||
case DbType.AnsiString:
|
||||
MetaParameter.TypeName = "varchar";
|
||||
sqlDbType = SqlDbType.VarChar;
|
||||
isVariableSizeType = true;
|
||||
MetaParameter.IsVariableSizeType = true;
|
||||
break;
|
||||
case DbType.AnsiStringFixedLength:
|
||||
MetaParameter.TypeName = "char";
|
||||
sqlDbType = SqlDbType.Char;
|
||||
isVariableSizeType = true;
|
||||
MetaParameter.IsVariableSizeType = true;
|
||||
break;
|
||||
case DbType.Binary:
|
||||
MetaParameter.TypeName = "varbinary";
|
||||
sqlDbType = SqlDbType.VarBinary;
|
||||
isVariableSizeType = true;
|
||||
MetaParameter.IsVariableSizeType = true;
|
||||
break;
|
||||
case DbType.Boolean:
|
||||
MetaParameter.TypeName = "bit";
|
||||
@@ -553,12 +552,12 @@ namespace System.Data.SqlClient {
|
||||
case DbType.String:
|
||||
MetaParameter.TypeName = "nvarchar";
|
||||
sqlDbType = SqlDbType.NVarChar;
|
||||
isVariableSizeType = true;
|
||||
MetaParameter.IsVariableSizeType = true;
|
||||
break;
|
||||
case DbType.StringFixedLength:
|
||||
MetaParameter.TypeName = "nchar";
|
||||
sqlDbType = SqlDbType.NChar;
|
||||
isVariableSizeType = true;
|
||||
MetaParameter.IsVariableSizeType = true;
|
||||
break;
|
||||
case DbType.Time:
|
||||
MetaParameter.TypeName = "datetime";
|
||||
@@ -664,7 +663,7 @@ namespace System.Data.SqlClient {
|
||||
case SqlDbType.Binary:
|
||||
MetaParameter.TypeName = "binary";
|
||||
dbType = DbType.Binary;
|
||||
isVariableSizeType = true;
|
||||
MetaParameter.IsVariableSizeType = true;
|
||||
break;
|
||||
case SqlDbType.Timestamp:
|
||||
MetaParameter.TypeName = "timestamp";
|
||||
@@ -673,7 +672,7 @@ namespace System.Data.SqlClient {
|
||||
case SqlDbType.VarBinary:
|
||||
MetaParameter.TypeName = "varbinary";
|
||||
dbType = DbType.Binary;
|
||||
isVariableSizeType = true;
|
||||
MetaParameter.IsVariableSizeType = true;
|
||||
break;
|
||||
case SqlDbType.Bit:
|
||||
MetaParameter.TypeName = "bit";
|
||||
@@ -682,7 +681,7 @@ namespace System.Data.SqlClient {
|
||||
case SqlDbType.Char:
|
||||
MetaParameter.TypeName = "char";
|
||||
dbType = DbType.AnsiStringFixedLength;
|
||||
isVariableSizeType = true;
|
||||
MetaParameter.IsVariableSizeType = true;
|
||||
break;
|
||||
case SqlDbType.DateTime:
|
||||
MetaParameter.TypeName = "datetime";
|
||||
@@ -703,7 +702,7 @@ namespace System.Data.SqlClient {
|
||||
case SqlDbType.Image:
|
||||
MetaParameter.TypeName = "image";
|
||||
dbType = DbType.Binary;
|
||||
isVariableSizeType = true;
|
||||
MetaParameter.IsVariableSizeType = true;
|
||||
break;
|
||||
case SqlDbType.Int:
|
||||
MetaParameter.TypeName = "int";
|
||||
@@ -720,17 +719,17 @@ namespace System.Data.SqlClient {
|
||||
case SqlDbType.NChar:
|
||||
MetaParameter.TypeName = "nchar";
|
||||
dbType = DbType.StringFixedLength;
|
||||
isVariableSizeType = true;
|
||||
MetaParameter.IsVariableSizeType = true;
|
||||
break;
|
||||
case SqlDbType.NText:
|
||||
MetaParameter.TypeName = "ntext";
|
||||
dbType = DbType.String;
|
||||
isVariableSizeType = true;
|
||||
MetaParameter.IsVariableSizeType = true;
|
||||
break;
|
||||
case SqlDbType.NVarChar:
|
||||
MetaParameter.TypeName = "nvarchar";
|
||||
dbType = DbType.String;
|
||||
isVariableSizeType = true;
|
||||
MetaParameter.IsVariableSizeType = true;
|
||||
break;
|
||||
case SqlDbType.Real:
|
||||
MetaParameter.TypeName = "real";
|
||||
@@ -743,12 +742,12 @@ namespace System.Data.SqlClient {
|
||||
case SqlDbType.Text:
|
||||
MetaParameter.TypeName = "text";
|
||||
dbType = DbType.AnsiString;
|
||||
isVariableSizeType = true;
|
||||
MetaParameter.IsVariableSizeType = true;
|
||||
break;
|
||||
case SqlDbType.VarChar:
|
||||
MetaParameter.TypeName = "varchar";
|
||||
dbType = DbType.AnsiString;
|
||||
isVariableSizeType = true;
|
||||
MetaParameter.IsVariableSizeType = true;
|
||||
break;
|
||||
case SqlDbType.TinyInt:
|
||||
MetaParameter.TypeName = "tinyint";
|
||||
|
||||
@@ -229,8 +229,9 @@ namespace System.Web.Configuration
|
||||
}
|
||||
|
||||
string tempDir = dir;
|
||||
if (tempDir == HttpRuntime.AppDomainAppVirtualPath ||
|
||||
tempDir + "/" == HttpRuntime.AppDomainAppVirtualPath) {
|
||||
if (tempDir.Length > 1)
|
||||
tempDir = tempDir.Substring (0, tempDir.Length - 1);
|
||||
if (tempDir == HttpRuntime.AppDomainAppVirtualPath) {
|
||||
tempDir = "";
|
||||
realpath = HttpRuntime.AppDomainAppPath;
|
||||
}
|
||||
|
||||
@@ -135,7 +135,12 @@ namespace System.Web.UI
|
||||
return baseVDir;
|
||||
}
|
||||
|
||||
set { baseVDir = value; }
|
||||
set {
|
||||
if (VirtualPathUtility.IsRooted (value))
|
||||
baseVDir = VirtualPathUtility.ToAbsolute (value);
|
||||
else
|
||||
baseVDir = value;
|
||||
}
|
||||
}
|
||||
|
||||
#if NET_2_0
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
2007-03-20 Marek Habersack <[email protected]>
|
||||
|
||||
* HttpRequest.cs: implement AppRelativeCurrentExecutionFilePath.
|
||||
|
||||
2007-03-15 Marek Habersack <[email protected]>
|
||||
|
||||
* XmlSiteMapProvider.cs: handle cases with no default for the
|
||||
|
||||
@@ -329,6 +329,14 @@ namespace System.Web {
|
||||
}
|
||||
}
|
||||
|
||||
#if NET_2_0
|
||||
public string AppRelativeCurrentExecutionFilePath {
|
||||
get {
|
||||
return VirtualPathUtility.ToAppRelative (CurrentExecutionFilePath);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
public string FilePath {
|
||||
get {
|
||||
if (worker_request == null)
|
||||
|
||||
@@ -1786,10 +1786,12 @@ ves_icall_MonoType_GetElementType (MonoReflectionType *type)
|
||||
|
||||
MONO_ARCH_SAVE_REGS;
|
||||
|
||||
// GetElementType should only return a type for:
|
||||
// GelElementType should only return a type for:
|
||||
// Array Pointer PassedByRef
|
||||
if (type->type->byref)
|
||||
return mono_type_get_object (mono_object_domain (type), &class->byval_arg);
|
||||
if (class->enumtype && class->enum_basetype) /* types that are modifierd typebuilkders may not have enum_basetype set */
|
||||
return mono_type_get_object (mono_object_domain (type), class->enum_basetype);
|
||||
else if (class->element_class && MONO_CLASS_IS_ARRAY (class))
|
||||
return mono_type_get_object (mono_object_domain (type), &class->element_class->byval_arg);
|
||||
else if (class->element_class && type->type->type == MONO_TYPE_PTR)
|
||||
|
||||
Reference in new issue
Block a user