You've already forked linux-packaging-mono
Merge branch 'upstream'
Former-commit-id: 2b9005bf51acb0c39351085725dedc885cb6a839
This commit is contained in:
@ -1 +1 @@
|
|||||||
8f7913d9589d4661ea36bc57247b1c54f9c884d9
|
8422375f8c7d3090c1448b1e3991145993ac78ea
|
@ -1 +1 @@
|
|||||||
27f21cf351ea959556b90627b6b6848c4b2bd285
|
1607281d38b3c68181c426167578c83839def078
|
@ -1257,15 +1257,30 @@ int32_t SystemNative_CopyFile(intptr_t sourceFd, intptr_t destinationFd)
|
|||||||
int ret;
|
int ret;
|
||||||
struct stat_ sourceStat;
|
struct stat_ sourceStat;
|
||||||
bool copied = false;
|
bool copied = false;
|
||||||
#if HAVE_SENDFILE_4
|
|
||||||
// If sendfile is available (Linux), try to use it, as the whole copy
|
// First, stat the source file.
|
||||||
// can be performed in the kernel, without lots of unnecessary copying.
|
|
||||||
while ((ret = fstat_(inFd, &sourceStat)) < 0 && errno == EINTR);
|
while ((ret = fstat_(inFd, &sourceStat)) < 0 && errno == EINTR);
|
||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
|
{
|
||||||
|
// If we can't stat() it, then we likely don't have permission to read it.
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Copy permissions. This fchmod() needs to happen prior to writing anything into
|
||||||
|
// the file to avoid possibly leaking any private data.
|
||||||
|
while ((ret = fchmod(outFd, sourceStat.st_mode & (S_IRWXU | S_IRWXG | S_IRWXO))) < 0 && errno == EINTR);
|
||||||
|
#if !TARGET_ANDROID
|
||||||
|
// On Android, we are not allowed to modify permissions, but the copy should still succeed;
|
||||||
|
// see https://github.com/mono/mono/issues/17133 for details.
|
||||||
|
if (ret != 0)
|
||||||
{
|
{
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if HAVE_SENDFILE_4
|
||||||
|
// If sendfile is available (Linux), try to use it, as the whole copy
|
||||||
|
// can be performed in the kernel, without lots of unnecessary copying.
|
||||||
|
|
||||||
// On 32-bit, if you use 64-bit offsets, the last argument of `sendfile' will be a
|
// On 32-bit, if you use 64-bit offsets, the last argument of `sendfile' will be a
|
||||||
// `size_t' a 32-bit integer while the `st_size' field of the stat structure will be off64_t.
|
// `size_t' a 32-bit integer while the `st_size' field of the stat structure will be off64_t.
|
||||||
@ -1313,9 +1328,6 @@ int32_t SystemNative_CopyFile(intptr_t sourceFd, intptr_t destinationFd)
|
|||||||
// from the source file. First copy the file times.
|
// from the source file. First copy the file times.
|
||||||
// If futimes nor futimes are available on this platform, file times will
|
// If futimes nor futimes are available on this platform, file times will
|
||||||
// not be copied over.
|
// not be copied over.
|
||||||
while ((ret = fstat_(inFd, &sourceStat)) < 0 && errno == EINTR);
|
|
||||||
if (ret == 0)
|
|
||||||
{
|
|
||||||
#if HAVE_FUTIMENS
|
#if HAVE_FUTIMENS
|
||||||
// futimens is prefered because it has a higher resolution.
|
// futimens is prefered because it has a higher resolution.
|
||||||
struct timespec origTimes[2];
|
struct timespec origTimes[2];
|
||||||
@ -1332,18 +1344,14 @@ int32_t SystemNative_CopyFile(intptr_t sourceFd, intptr_t destinationFd)
|
|||||||
origTimes[1].tv_usec = ST_MTIME_NSEC(&sourceStat) / 1000;
|
origTimes[1].tv_usec = ST_MTIME_NSEC(&sourceStat) / 1000;
|
||||||
while ((ret = futimes(outFd, origTimes)) < 0 && errno == EINTR);
|
while ((ret = futimes(outFd, origTimes)) < 0 && errno == EINTR);
|
||||||
#endif
|
#endif
|
||||||
}
|
|
||||||
if (ret != 0)
|
|
||||||
{
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Then copy permissions.
|
#if !TARGET_ANDROID
|
||||||
while ((ret = fchmod(outFd, sourceStat.st_mode & (S_IRWXU | S_IRWXG | S_IRWXO))) < 0 && errno == EINTR);
|
// On Android, the copy should still succeed even if copying the file times didn't.
|
||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
{
|
{
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
#endif // HAVE_FCOPYFILE
|
#endif // HAVE_FCOPYFILE
|
||||||
|
@ -1 +1 @@
|
|||||||
40a20092f6a571ef9598fc7477ff948b5b60cc32
|
ed356e5ce8184cee9ce5336998ed241a0cc2e6eb
|
@ -231,6 +231,8 @@ namespace System.Data.SqlClient
|
|||||||
destination._sourceVersion = _sourceVersion;
|
destination._sourceVersion = _sourceVersion;
|
||||||
destination._sourceColumnNullMapping = _sourceColumnNullMapping;
|
destination._sourceColumnNullMapping = _sourceColumnNullMapping;
|
||||||
destination._isNullable = _isNullable;
|
destination._isNullable = _isNullable;
|
||||||
|
destination._parameterName = _parameterName;
|
||||||
|
destination._isNull = _isNull;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,107 @@
|
|||||||
|
// Licensed to the .NET Foundation under one or more agreements.
|
||||||
|
// The .NET Foundation licenses this file to you under the MIT license.
|
||||||
|
// See the LICENSE file in the project root for more information.
|
||||||
|
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using Xunit;
|
||||||
|
|
||||||
|
namespace System.Data.SqlClient.ManualTesting.Tests
|
||||||
|
{
|
||||||
|
public class SqlAdapterUpdateBatch
|
||||||
|
{
|
||||||
|
[CheckConnStrSetupFact]
|
||||||
|
public void SqlAdapterTest()
|
||||||
|
{
|
||||||
|
string tableName = "BatchDemoTable";
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var createTableQuery = "IF NOT EXISTS (SELECT * FROM sysobjects WHERE name='BatchDemoTable' AND xtype='U')" +
|
||||||
|
" CREATE TABLE [dbo].[" + tableName + "]([TransactionNumber][int] IDENTITY(1, 1) NOT NULL,[Level] [nvarchar] (50) NOT NULL," +
|
||||||
|
"[Message] [nvarchar] (500) NOT NULL,[EventTime] [datetime]NOT NULL,CONSTRAINT[PK_BatchDemoTable] " +
|
||||||
|
"PRIMARY KEY CLUSTERED([TransactionNumber] ASC)WITH(PAD_INDEX = OFF,STATISTICS_NORECOMPUTE = OFF, " +
|
||||||
|
"IGNORE_DUP_KEY = OFF,ALLOW_ROW_LOCKS = ON,ALLOW_PAGE_LOCKS = ON,FILLFACTOR = 90) ON[PRIMARY]) ON[PRIMARY]";
|
||||||
|
|
||||||
|
using (var connection = new SqlConnection(DataTestUtility.TcpConnStr))
|
||||||
|
using (var cmd = new SqlCommand(createTableQuery, connection))
|
||||||
|
{
|
||||||
|
connection.Open();
|
||||||
|
cmd.ExecuteNonQuery();
|
||||||
|
}
|
||||||
|
ExecuteNonQueries();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Console.WriteLine(ex.Message);
|
||||||
|
Console.WriteLine(ex.StackTrace);
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
var dropTableQuery = "DROP TABLE IF EXISTS " + tableName;
|
||||||
|
using (var connection = new SqlConnection(DataTestUtility.TcpConnStr))
|
||||||
|
using (var cmd = new SqlCommand(dropTableQuery, connection))
|
||||||
|
{
|
||||||
|
connection.Open();
|
||||||
|
cmd.ExecuteNonQuery();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public class EventInfo
|
||||||
|
{
|
||||||
|
public string Level { get; set; }
|
||||||
|
public string Message { get; set; }
|
||||||
|
public DateTime EventTime { get; set; }
|
||||||
|
|
||||||
|
public EventInfo()
|
||||||
|
{
|
||||||
|
EventTime = DateTime.Now;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void ExecuteNonQueries()
|
||||||
|
{
|
||||||
|
List<EventInfo> entities = new List<EventInfo>
|
||||||
|
{
|
||||||
|
new EventInfo {Level = "L1", Message = "Message 1"},
|
||||||
|
new EventInfo {Level = "L2", Message = "Message 2"},
|
||||||
|
new EventInfo {Level = "L3", Message = "Message 3"},
|
||||||
|
new EventInfo {Level = "L4", Message = "Message 4"},
|
||||||
|
};
|
||||||
|
|
||||||
|
var sql = "INSERT INTO BatchDemoTable(Level, Message, EventTime) VALUES(@Level, @Message, @EventTime)";
|
||||||
|
using (var connection = new SqlConnection(DataTestUtility.TcpConnStr))
|
||||||
|
using (var adapter = new SqlDataAdapter())
|
||||||
|
using (var cmd = new SqlCommand(sql, connection))
|
||||||
|
{
|
||||||
|
cmd.Parameters.Add(new SqlParameter("@Level", System.Data.SqlDbType.NVarChar, 50, "Level"));
|
||||||
|
cmd.Parameters.Add(new SqlParameter("@Message", SqlDbType.NVarChar, 500, "Message"));
|
||||||
|
cmd.Parameters.Add(new SqlParameter("@EventTime", SqlDbType.DateTime, 0, "EventTime"));
|
||||||
|
cmd.UpdatedRowSource = UpdateRowSource.None;
|
||||||
|
|
||||||
|
adapter.InsertCommand = cmd;
|
||||||
|
adapter.UpdateBatchSize = 2;
|
||||||
|
|
||||||
|
adapter.Update(ConvertToTable(entities));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private static DataTable ConvertToTable(List<EventInfo> entities)
|
||||||
|
{
|
||||||
|
var table = new DataTable(typeof(EventInfo).Name);
|
||||||
|
|
||||||
|
table.Columns.Add("Level", typeof(string));
|
||||||
|
table.Columns.Add("Message", typeof(string));
|
||||||
|
table.Columns.Add("EventTime", typeof(DateTime));
|
||||||
|
|
||||||
|
foreach (var entity in entities)
|
||||||
|
{
|
||||||
|
var row = table.NewRow();
|
||||||
|
row["Level"] = entity.Level;
|
||||||
|
row["Message"] = entity.Message;
|
||||||
|
row["EventTime"] = entity.EventTime;
|
||||||
|
table.Rows.Add(row);
|
||||||
|
}
|
||||||
|
return table;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -33,6 +33,7 @@
|
|||||||
<Compile Include="SQL\ParameterTest\DateTimeVariantTest.cs" />
|
<Compile Include="SQL\ParameterTest\DateTimeVariantTest.cs" />
|
||||||
<Compile Include="SQL\ParameterTest\OutputParameter.cs" />
|
<Compile Include="SQL\ParameterTest\OutputParameter.cs" />
|
||||||
<Compile Include="SQL\ParameterTest\ParametersTest.cs" />
|
<Compile Include="SQL\ParameterTest\ParametersTest.cs" />
|
||||||
|
<Compile Include="SQL\ParameterTest\SqlAdapterUpdateBatch.cs" />
|
||||||
<Compile Include="SQL\ParameterTest\SqlVariantParam.cs" />
|
<Compile Include="SQL\ParameterTest\SqlVariantParam.cs" />
|
||||||
<Compile Include="SQL\ParameterTest\SteAttribute.cs" />
|
<Compile Include="SQL\ParameterTest\SteAttribute.cs" />
|
||||||
<Compile Include="SQL\ParameterTest\SteParam.cs" />
|
<Compile Include="SQL\ParameterTest\SteParam.cs" />
|
||||||
|
@ -41,7 +41,7 @@ static partial class Consts
|
|||||||
// Use these assembly version constants to make code more maintainable.
|
// Use these assembly version constants to make code more maintainable.
|
||||||
//
|
//
|
||||||
|
|
||||||
public const string MonoVersion = "6.6.0.148";
|
public const string MonoVersion = "6.6.0.152";
|
||||||
public const string MonoCompany = "Mono development team";
|
public const string MonoCompany = "Mono development team";
|
||||||
public const string MonoProduct = "Mono Common Language Infrastructure";
|
public const string MonoProduct = "Mono Common Language Infrastructure";
|
||||||
public const string MonoCopyright = "(c) Various Mono authors";
|
public const string MonoCopyright = "(c) Various Mono authors";
|
||||||
|
@ -1 +1 @@
|
|||||||
d6873a6a44b22203212c3e27b6251f29330b876c
|
8cbfffc44bc2c1521fa9c01477735ee6ce7d54cc
|
@ -1 +1 @@
|
|||||||
9a2509d048a11aa654ef116188660d4105b85cfb
|
8870cf46c56544531aedebf91084549d99fe7e95
|
@ -1 +1 @@
|
|||||||
1977e3c1438869bf78c984b562e3b18d0e22c0d8
|
0021e8ec4371d5333d963f5c03e3d072839ff571
|
@ -1 +1 @@
|
|||||||
2cc3f9d0e5eca6ca7c3153298e0c31d881db1d9c
|
ee3235d2af5cd9092f327140fae870867ca1dc8c
|
@ -1 +1 @@
|
|||||||
cb882209764b14ee7b455c6de33db52b4ce0b86c
|
ea2a116e0c48838a4805f5d3c9071a1ef062ae72
|
@ -1 +1 @@
|
|||||||
87775866d1524d54375f9c8e42483c788116d21e
|
08591ef63807e12a11f7d8fcb2afe12e35913b2a
|
@ -1 +1 @@
|
|||||||
c260001f7211d72828c8a726f8ba8bf2a2920042
|
cacfcceab39d08330e0348dcd454339fbbf3e2f3
|
@ -1 +1 @@
|
|||||||
d6873a6a44b22203212c3e27b6251f29330b876c
|
8cbfffc44bc2c1521fa9c01477735ee6ce7d54cc
|
@ -1 +1 @@
|
|||||||
9a2509d048a11aa654ef116188660d4105b85cfb
|
8870cf46c56544531aedebf91084549d99fe7e95
|
@ -1 +1 @@
|
|||||||
1977e3c1438869bf78c984b562e3b18d0e22c0d8
|
0021e8ec4371d5333d963f5c03e3d072839ff571
|
@ -1 +1 @@
|
|||||||
2cc3f9d0e5eca6ca7c3153298e0c31d881db1d9c
|
ee3235d2af5cd9092f327140fae870867ca1dc8c
|
@ -1 +1 @@
|
|||||||
cb882209764b14ee7b455c6de33db52b4ce0b86c
|
ea2a116e0c48838a4805f5d3c9071a1ef062ae72
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user