mantis 9219: update SQLite to System.Data.Sqlite 2.0.2 (native 3.50.4.5). Must run prebuild. This needs testing :(

This commit is contained in:
UbitUmarov
2025-11-10 17:35:22 +00:00
parent dc4513ac33
commit 9612ea2491
23 changed files with 348 additions and 400 deletions

View File

@@ -30,11 +30,8 @@ using System.Collections.Generic;
using System.Data;
using System.Reflection;
using log4net;
#if CSharpSqlite
using Community.CsharpSqlite.Sqlite;
#else
using Mono.Data.Sqlite;
#endif
using System.Data.SQLite;
using OpenMetaverse;
using OpenMetaverse.StructuredData;
using OpenSim.Framework;
@@ -47,7 +44,7 @@ namespace OpenSim.Data.SQLite
private static readonly ILog m_log =
LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private SqliteConnection m_connection;
private SQLiteConnection m_connection;
private string m_connectionString;
private Dictionary<string, FieldInfo> m_FieldMap =
@@ -69,13 +66,13 @@ namespace OpenSim.Data.SQLite
public void Initialise(string connectionString)
{
DllmapConfigHelper.RegisterAssembly(typeof(SqliteConnection).Assembly);
DllmapConfigHelper.RegisterAssembly(typeof(SQLiteConnection).Assembly);
m_connectionString = connectionString;
m_log.Info("[PROFILES_DATA]: Sqlite - connecting: "+m_connectionString);
m_connection = new SqliteConnection(m_connectionString);
m_connection = new SQLiteConnection(m_connectionString);
m_connection.Open();
Migration m = new Migration(m_connection, Assembly, "UserProfiles");
@@ -94,7 +91,7 @@ namespace OpenSim.Data.SQLite
string query = "SELECT classifieduuid, name FROM classifieds WHERE creatoruuid = :Id";
IDataReader reader = null;
using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand())
using (SQLiteCommand cmd = (SQLiteCommand)m_connection.CreateCommand())
{
cmd.CommandText = query;
cmd.Parameters.AddWithValue(":Id", creatorId);
@@ -190,7 +187,7 @@ namespace OpenSim.Data.SQLite
ad.ExpirationDate = (int)epochexp.TotalSeconds;
try {
using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand())
using (SQLiteCommand cmd = (SQLiteCommand)m_connection.CreateCommand())
{
cmd.CommandText = query;
cmd.Parameters.AddWithValue(":ClassifiedId", ad.ClassifiedId.ToString());
@@ -230,7 +227,7 @@ namespace OpenSim.Data.SQLite
try
{
using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand())
using (SQLiteCommand cmd = (SQLiteCommand)m_connection.CreateCommand())
{
cmd.CommandText = query;
cmd.Parameters.AddWithValue(":ClassifiedId", recordId.ToString());
@@ -257,7 +254,7 @@ namespace OpenSim.Data.SQLite
try
{
using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand())
using (SQLiteCommand cmd = (SQLiteCommand)m_connection.CreateCommand())
{
cmd.CommandText = query;
cmd.Parameters.AddWithValue(":AdId", ad.ClassifiedId.ToString());
@@ -303,7 +300,7 @@ namespace OpenSim.Data.SQLite
try
{
using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand())
using (SQLiteCommand cmd = (SQLiteCommand)m_connection.CreateCommand())
{
cmd.CommandText = query;
cmd.Parameters.AddWithValue(":Id", avatarId.ToString());
@@ -340,7 +337,7 @@ namespace OpenSim.Data.SQLite
try
{
using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand())
using (SQLiteCommand cmd = (SQLiteCommand)m_connection.CreateCommand())
{
cmd.CommandText = query;
cmd.Parameters.AddWithValue(":CreatorId", avatarId.ToString());
@@ -416,7 +413,7 @@ namespace OpenSim.Data.SQLite
try
{
using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand())
using (SQLiteCommand cmd = (SQLiteCommand)m_connection.CreateCommand())
{
int top_pick;
int.TryParse(pick.TopPick.ToString(), out top_pick);
@@ -459,7 +456,7 @@ namespace OpenSim.Data.SQLite
try
{
using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand())
using (SQLiteCommand cmd = (SQLiteCommand)m_connection.CreateCommand())
{
cmd.CommandText = query;
cmd.Parameters.AddWithValue(":PickId", pickId.ToString());
@@ -487,7 +484,7 @@ namespace OpenSim.Data.SQLite
try
{
using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand())
using (SQLiteCommand cmd = (SQLiteCommand)m_connection.CreateCommand())
{
cmd.CommandText = query;
cmd.Parameters.AddWithValue(":Id", notes.UserId.ToString());
@@ -533,7 +530,7 @@ namespace OpenSim.Data.SQLite
try
{
using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand())
using (SQLiteCommand cmd = (SQLiteCommand)m_connection.CreateCommand())
{
cmd.CommandText = query;
@@ -562,7 +559,7 @@ namespace OpenSim.Data.SQLite
query += "SELECT * FROM userprofile WHERE ";
query += "useruuid = :Id";
using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand())
using (SQLiteCommand cmd = (SQLiteCommand)m_connection.CreateCommand())
{
cmd.CommandText = query;
cmd.Parameters.AddWithValue(":Id", props.UserId.ToString());
@@ -639,7 +636,7 @@ namespace OpenSim.Data.SQLite
query += ":profileFirstImage, ";
query += ":profileFirstText)";
using (SqliteCommand put = (SqliteCommand)m_connection.CreateCommand())
using (SQLiteCommand put = (SQLiteCommand)m_connection.CreateCommand())
{
put.CommandText = query;
put.Parameters.AddWithValue(":userId", props.UserId.ToString());
@@ -678,7 +675,7 @@ namespace OpenSim.Data.SQLite
try
{
using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand())
using (SQLiteCommand cmd = (SQLiteCommand)m_connection.CreateCommand())
{
cmd.CommandText = query;
cmd.Parameters.AddWithValue(":profileURL", props.WebUrl);
@@ -715,7 +712,7 @@ namespace OpenSim.Data.SQLite
try
{
using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand())
using (SQLiteCommand cmd = (SQLiteCommand)m_connection.CreateCommand())
{
cmd.CommandText = query;
cmd.Parameters.AddWithValue(":WantMask", up.WantToMask);
@@ -751,7 +748,7 @@ namespace OpenSim.Data.SQLite
try
{
using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand())
using (SQLiteCommand cmd = (SQLiteCommand)m_connection.CreateCommand())
{
cmd.CommandText = query;
cmd.Parameters.AddWithValue(":ImViaEmail", pref.IMViaEmail);
@@ -785,7 +782,7 @@ namespace OpenSim.Data.SQLite
try
{
using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand())
using (SQLiteCommand cmd = (SQLiteCommand)m_connection.CreateCommand())
{
cmd.CommandText = query;
cmd.Parameters.AddWithValue("?Id", pref.UserId.ToString());
@@ -803,7 +800,7 @@ namespace OpenSim.Data.SQLite
query = "INSERT INTO usersettings VALUES ";
query += "(:Id,'false','false', :Email)";
using (SqliteCommand put = (SqliteCommand)m_connection.CreateCommand())
using (SQLiteCommand put = (SQLiteCommand)m_connection.CreateCommand())
{
put.Parameters.AddWithValue(":Id", pref.UserId.ToString());
put.Parameters.AddWithValue(":Email", pref.EMail);
@@ -835,7 +832,7 @@ namespace OpenSim.Data.SQLite
try
{
using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand())
using (SQLiteCommand cmd = (SQLiteCommand)m_connection.CreateCommand())
{
cmd.CommandText = query;
cmd.Parameters.AddWithValue(":Id", props.UserId.ToString());
@@ -856,7 +853,7 @@ namespace OpenSim.Data.SQLite
query += ":DataKey,";
query += ":DataVal) ";
using (SqliteCommand put = (SqliteCommand)m_connection.CreateCommand())
using (SQLiteCommand put = (SQLiteCommand)m_connection.CreateCommand())
{
put.Parameters.AddWithValue(":Id", props.UserId.ToString());
put.Parameters.AddWithValue(":TagId", props.TagId.ToString());
@@ -891,7 +888,7 @@ namespace OpenSim.Data.SQLite
try
{
using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand())
using (SQLiteCommand cmd = (SQLiteCommand)m_connection.CreateCommand())
{
cmd.CommandText = query;
cmd.Parameters.AddWithValue(":UserId", props.UserId.ToString());
@@ -921,7 +918,7 @@ namespace OpenSim.Data.SQLite
try
{
using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand())
using (SQLiteCommand cmd = (SQLiteCommand)m_connection.CreateCommand())
{
cmd.CommandText = string.Format(query, "\"classifieds\"");
cmd.Parameters.AddWithValue(":Id", avatarId.ToString());
@@ -935,7 +932,7 @@ namespace OpenSim.Data.SQLite
}
}
using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand())
using (SQLiteCommand cmd = (SQLiteCommand)m_connection.CreateCommand())
{
cmd.CommandText = string.Format(query, "\"userpicks\"");
cmd.Parameters.AddWithValue(":Id", avatarId.ToString());
@@ -951,7 +948,7 @@ namespace OpenSim.Data.SQLite
query = "SELECT `profileImage`, `profileFirstImage` FROM `userprofile` WHERE `useruuid` = :Id";
using (SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand())
using (SQLiteCommand cmd = (SQLiteCommand)m_connection.CreateCommand())
{
cmd.CommandText = query;
cmd.Parameters.AddWithValue(":Id", avatarId.ToString());