Imported Upstream version 5.0.0.42

Former-commit-id: fd56571888259555122d8a0f58c68838229cea2b
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2017-04-10 11:41:01 +00:00
parent 1190d13a04
commit 6bdd276d05
19939 changed files with 3099680 additions and 93811 deletions

View File

@@ -1,8 +1,6 @@
Assembly/AssemblyInfo.cs
../../build/common/Consts.cs
../../build/common/Locale.cs
../../build/common/MonoTODOAttribute.cs
Mono.Data.Sqlite_2.0/MonoPInvokeCallbackAttribute.cs
../System/Mono.Util/MonoPInvokeCallbackAttribute.cs
Mono.Data.Sqlite_2.0/SQLite3.cs
Mono.Data.Sqlite_2.0/SQLite3_UTF16.cs
Mono.Data.Sqlite_2.0/SQLiteBase.cs

View File

@@ -1,36 +0,0 @@
//
// MonoPInvokeCallbackAttribute.cs: necessary for AOT ports of Mono
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if MONOTOUCH
using System;
namespace MonoTouch {
[AttributeUsage (AttributeTargets.Method)]
sealed class MonoPInvokeCallbackAttribute : Attribute {
public MonoPInvokeCallbackAttribute (Type t) {}
}
}
#endif

View File

@@ -706,7 +706,7 @@ namespace Mono.Data.Sqlite
}
#if MONOTOUCH
[MonoTouch.MonoPInvokeCallback(typeof(SQLiteCallback))]
[Mono.Util.MonoPInvokeCallback(typeof(SQLiteCallback))]
internal static void scalar_callback(IntPtr context, int nArgs, IntPtr argsptr)
{
var handle = GCHandle.FromIntPtr (UnsafeNativeMethods.sqlite3_user_data(context));
@@ -714,7 +714,7 @@ namespace Mono.Data.Sqlite
func.Func(context, nArgs, argsptr);
}
[MonoTouch.MonoPInvokeCallback(typeof(SQLiteCallback))]
[Mono.Util.MonoPInvokeCallback(typeof(SQLiteCallback))]
internal static void step_callback(IntPtr context, int nArgs, IntPtr argsptr)
{
var handle = GCHandle.FromIntPtr(UnsafeNativeMethods.sqlite3_user_data(context));
@@ -722,7 +722,7 @@ namespace Mono.Data.Sqlite
func.FuncStep(context, nArgs, argsptr);
}
[MonoTouch.MonoPInvokeCallback(typeof(SQLiteFinalCallback))]
[Mono.Util.MonoPInvokeCallback(typeof(SQLiteFinalCallback))]
internal static void final_callback(IntPtr context)
{
var handle = GCHandle.FromIntPtr(UnsafeNativeMethods.sqlite3_user_data(context));
@@ -730,7 +730,7 @@ namespace Mono.Data.Sqlite
func.FuncFinal(context);
}
[MonoTouch.MonoPInvokeCallback(typeof(SQLiteFinalCallback))]
[Mono.Util.MonoPInvokeCallback(typeof(SQLiteFinalCallback))]
internal static void destroy_callback(IntPtr context)
{
GCHandle.FromIntPtr(context).Free();
@@ -958,7 +958,7 @@ namespace Mono.Data.Sqlite
SQLiteCommitCallback commit_callback;
SQLiteRollbackCallback rollback_callback;
[MonoTouch.MonoPInvokeCallback (typeof (SQLiteUpdateCallback))]
[Mono.Util.MonoPInvokeCallback (typeof (SQLiteUpdateCallback))]
static void update (IntPtr puser, int type, IntPtr database, IntPtr table, Int64 rowid)
{
SQLite3 instance = GCHandle.FromIntPtr (puser).Target as SQLite3;
@@ -974,7 +974,7 @@ namespace Mono.Data.Sqlite
UnsafeNativeMethods.sqlite3_update_hook (_sql, update, GCHandle.ToIntPtr (gch));
}
[MonoTouch.MonoPInvokeCallback (typeof (SQLiteCommitCallback))]
[Mono.Util.MonoPInvokeCallback (typeof (SQLiteCommitCallback))]
static int commit (IntPtr puser)
{
SQLite3 instance = GCHandle.FromIntPtr (puser).Target as SQLite3;
@@ -990,7 +990,7 @@ namespace Mono.Data.Sqlite
UnsafeNativeMethods.sqlite3_commit_hook (_sql, commit, GCHandle.ToIntPtr (gch));
}
[MonoTouch.MonoPInvokeCallback (typeof (SQLiteRollbackCallback))]
[Mono.Util.MonoPInvokeCallback (typeof (SQLiteRollbackCallback))]
static void rollback (IntPtr puser)
{
SQLite3 instance = GCHandle.FromIntPtr (puser).Target as SQLite3;

View File

@@ -555,8 +555,8 @@ namespace Mono.Data.Sqlite
return GetSchemaTable(true, false);
}
static bool hasColumnMetadataSupport = true;
static bool hasColumnMetadataSupport = true;
internal DataTable GetSchemaTable(bool wantUniqueInfo, bool wantDefaultValue)
{
CheckClosed();
@@ -565,7 +565,9 @@ namespace Mono.Data.Sqlite
DataTable tblIndexes = null;
DataTable tblIndexColumns;
DataRow row;
#if !MONOTOUCH
string temp;
#endif
string strCatalog = "";
string strTable = "";
string strColumn = "";
@@ -622,34 +624,34 @@ namespace Mono.Data.Sqlite
row[SchemaTableColumn.DataType] = GetFieldType(n);
row[SchemaTableOptionalColumn.IsHidden] = false;
// HACK: Prevent exploding if Sqlite was built without the SQLITE_ENABLE_COLUMN_METADATA option.
//
// This code depends on sqlite3_column_origin_name, which only exists if Sqlite was built with
// the SQLITE_ENABLE_COLUMN_METADATA option. This is not the case on iOS, MacOS or (most?)
// Androids, so we exclude it from the MONOTOUCH build, and degrade on other systems by simply
// omitting the metadata from the result.
//
// TODO: we could implement better fallbacks as proposed in
// https://bugzilla.xamarin.com/show_bug.cgi?id=2128
//
#if !MONOTOUCH
if (hasColumnMetadataSupport) {
try {
strColumn = _command.Connection._sql.ColumnOriginalName(_activeStatement, n);
if (String.IsNullOrEmpty(strColumn) == false) row[SchemaTableColumn.BaseColumnName] = strColumn;
row[SchemaTableColumn.IsExpression] = String.IsNullOrEmpty(strColumn);
row[SchemaTableColumn.IsAliased] = (String.Compare(GetName(n), strColumn, true, CultureInfo.InvariantCulture) != 0);
temp = _command.Connection._sql.ColumnTableName(_activeStatement, n);
if (String.IsNullOrEmpty(temp) == false) row[SchemaTableColumn.BaseTableName] = temp;
temp = _command.Connection._sql.ColumnDatabaseName(_activeStatement, n);
if (String.IsNullOrEmpty(temp) == false) row[SchemaTableOptionalColumn.BaseCatalogName] = temp;
} catch (EntryPointNotFoundException) {
hasColumnMetadataSupport = false;
}
}
// HACK: Prevent exploding if Sqlite was built without the SQLITE_ENABLE_COLUMN_METADATA option.
//
// This code depends on sqlite3_column_origin_name, which only exists if Sqlite was built with
// the SQLITE_ENABLE_COLUMN_METADATA option. This is not the case on iOS, MacOS or (most?)
// Androids, so we exclude it from the MONOTOUCH build, and degrade on other systems by simply
// omitting the metadata from the result.
//
// TODO: we could implement better fallbacks as proposed in
// https://bugzilla.xamarin.com/show_bug.cgi?id=2128
//
#if !MONOTOUCH
if (hasColumnMetadataSupport) {
try {
strColumn = _command.Connection._sql.ColumnOriginalName(_activeStatement, n);
if (String.IsNullOrEmpty(strColumn) == false) row[SchemaTableColumn.BaseColumnName] = strColumn;
row[SchemaTableColumn.IsExpression] = String.IsNullOrEmpty(strColumn);
row[SchemaTableColumn.IsAliased] = (String.Compare(GetName(n), strColumn, true, CultureInfo.InvariantCulture) != 0);
temp = _command.Connection._sql.ColumnTableName(_activeStatement, n);
if (String.IsNullOrEmpty(temp) == false) row[SchemaTableColumn.BaseTableName] = temp;
temp = _command.Connection._sql.ColumnDatabaseName(_activeStatement, n);
if (String.IsNullOrEmpty(temp) == false) row[SchemaTableOptionalColumn.BaseCatalogName] = temp;
} catch (EntryPointNotFoundException) {
hasColumnMetadataSupport = false;
}
}
#endif
string dataType = null;

View File

@@ -528,7 +528,7 @@ namespace Mono.Data.Sqlite
}
#if MONOTOUCH
[MonoTouch.MonoPInvokeCallback (typeof (SQLiteCollation))]
[Mono.Util.MonoPInvokeCallback (typeof (SQLiteCollation))]
internal static int collation_callback (IntPtr puser, int len1, IntPtr pv1, int len2, IntPtr pv2)
{
var handle = GCHandle.FromIntPtr (puser);
@@ -536,7 +536,7 @@ namespace Mono.Data.Sqlite
return func._CompareFunc (IntPtr.Zero, len1, pv1, len2, pv2);
}
[MonoTouch.MonoPInvokeCallback (typeof (SQLiteCollation))]
[Mono.Util.MonoPInvokeCallback (typeof (SQLiteCollation))]
internal static int collation_callback16 (IntPtr puser, int len1, IntPtr pv1, int len2, IntPtr pv2)
{
var handle = GCHandle.FromIntPtr (puser);

View File

@@ -9,7 +9,6 @@
// Copyright 2015 Xamarin Inc.
//
#if MONOTOUCH
using System;
using System.Data;
using System.IO;
@@ -96,13 +95,14 @@ namespace MonoTests.Mono.Data.Sqlite {
}
}
} catch (SqliteException ex) {
#if MONOTOUCH
// Expected Exception from iOS 8.2 (broken) to 9.0 (fixed)
if (BCL.Tests.TestRuntime.CheckSystemVersion (8,2) && !BCL.Tests.TestRuntime.CheckSystemVersion (9,0))
Assert.That (ex.Message.Contains ("no such column: com.Name"));
else
throw new AssertionException ("Unexpected Sqlite Error", ex); // This should not happen
throw;
#endif
}
}
}
}
#endif