修复 ReSet 会导致前引用数据丢失的问题

This commit is contained in:
milimoe 2025-07-07 21:52:50 +08:00
parent a989b8b56d
commit 5c002a40a8
Signed by: milimoe
GPG Key ID: 9554D37E4B8991D0
2 changed files with 2 additions and 6 deletions

View File

@ -287,7 +287,6 @@ namespace Milimoe.FunGame.Server.Services.DataUtility
{ {
SelectCommand = command SelectCommand = command
}; };
_dataSet = new();
_affectedRows = adapter.Fill(_dataSet); _affectedRows = adapter.Fill(_dataSet);
if (localTransaction) Commit(); if (localTransaction) Commit();
@ -352,7 +351,6 @@ namespace Milimoe.FunGame.Server.Services.DataUtility
{ {
SelectCommand = command SelectCommand = command
}; };
_dataSet = new();
_affectedRows = await adapter.FillAsync(_dataSet); _affectedRows = await adapter.FillAsync(_dataSet);
if (localTransaction) Commit(); if (localTransaction) Commit();
@ -482,7 +480,7 @@ namespace Milimoe.FunGame.Server.Services.DataUtility
_result = SQLResult.NotFound; _result = SQLResult.NotFound;
_affectedRows = 0; _affectedRows = 0;
_lastInsertId = 0; _lastInsertId = 0;
DataSet.Clear(); _dataSet = new();
} }
} }
} }

View File

@ -285,7 +285,6 @@ namespace Milimoe.FunGame.Server.Services.DataUtility
ReSet(); ReSet();
using SqliteDataReader reader = command.ExecuteReader(); using SqliteDataReader reader = command.ExecuteReader();
_dataSet = new();
do do
{ {
DataTable table = new(); DataTable table = new();
@ -351,7 +350,6 @@ namespace Milimoe.FunGame.Server.Services.DataUtility
ReSet(); ReSet();
using SqliteDataReader reader = await command.ExecuteReaderAsync(); using SqliteDataReader reader = await command.ExecuteReaderAsync();
_dataSet = new();
do do
{ {
DataTable table = new(); DataTable table = new();
@ -486,7 +484,7 @@ namespace Milimoe.FunGame.Server.Services.DataUtility
_result = SQLResult.NotFound; _result = SQLResult.NotFound;
_affectedRows = 0; _affectedRows = 0;
_lastInsertId = 0; _lastInsertId = 0;
DataSet.Clear(); _dataSet = new();
} }
} }
} }