diff options
author | Marek Safar <marek.safar@gmail.com> | 2018-03-13 19:10:59 +0300 |
---|---|---|
committer | Marek Safar <marek.safar@gmail.com> | 2018-03-14 09:44:47 +0300 |
commit | 40924c47ba00d9064d8b320f28ebe62b9fa2ee01 (patch) | |
tree | 7911784e2172f8f2cc0bd091a702fdb7933dc503 /mcs/class/Mono.Data.Sqlite | |
parent | a856f8d8e4817005ac4cf00ac260fae3b0dbe663 (diff) |
[Mono.Data.Sqlite] Throw better exception for missing mobile support
Diffstat (limited to 'mcs/class/Mono.Data.Sqlite')
-rw-r--r-- | mcs/class/Mono.Data.Sqlite/Mono.Data.Sqlite_2.0/SQLite3.cs | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/mcs/class/Mono.Data.Sqlite/Mono.Data.Sqlite_2.0/SQLite3.cs b/mcs/class/Mono.Data.Sqlite/Mono.Data.Sqlite_2.0/SQLite3.cs index 6b2ee13e03a..df1f227cd53 100644 --- a/mcs/class/Mono.Data.Sqlite/Mono.Data.Sqlite_2.0/SQLite3.cs +++ b/mcs/class/Mono.Data.Sqlite/Mono.Data.Sqlite_2.0/SQLite3.cs @@ -929,29 +929,25 @@ namespace Mono.Data.Sqlite return UnsafeNativeMethods.sqlite3_aggregate_context(context, 1);
}
-#if MONOTOUCH
- internal override void SetPassword(byte[] passwordBytes)
- {
- throw new NotImplementedException ();
- }
-
- internal override void ChangePassword(byte[] newPasswordBytes)
- {
- throw new NotImplementedException ();
- }
-#else
internal override void SetPassword(byte[] passwordBytes)
{
+#if MOBILE
+ throw new PlatformNotSupportedException();
+#else
int n = UnsafeNativeMethods.sqlite3_key(_sql, passwordBytes, passwordBytes.Length);
if (n > 0) throw new SqliteException(n, SQLiteLastError());
+#endif
}
internal override void ChangePassword(byte[] newPasswordBytes)
{
+#if MOBILE
+ throw new PlatformNotSupportedException();
+#else
int n = UnsafeNativeMethods.sqlite3_rekey(_sql, newPasswordBytes, (newPasswordBytes == null) ? 0 : newPasswordBytes.Length);
if (n > 0) throw new SqliteException(n, SQLiteLastError());
- }
#endif
+ }
#if MONOTOUCH
SQLiteUpdateCallback update_callback;
|