mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-23 12:33:44 +08:00
*OceanBaseForOracle,参数化Bug修复
This commit is contained in:
@@ -12,6 +12,7 @@ namespace SqlSugar.OceanBaseForOracle
|
|||||||
{
|
{
|
||||||
public class OceanBaseForOracleProvider : AdoProvider
|
public class OceanBaseForOracleProvider : AdoProvider
|
||||||
{
|
{
|
||||||
|
public override string SqlParameterKeyWord { get { return ":"; } }
|
||||||
public OceanBaseForOracleProvider() { }
|
public OceanBaseForOracleProvider() { }
|
||||||
public override IDbConnection Connection
|
public override IDbConnection Connection
|
||||||
{
|
{
|
||||||
@@ -201,6 +202,13 @@ namespace SqlSugar.OceanBaseForOracle
|
|||||||
List<SugarParameter> orderParameters = new List<SugarParameter>();
|
List<SugarParameter> orderParameters = new List<SugarParameter>();
|
||||||
if (parameters.HasValue())
|
if (parameters.HasValue())
|
||||||
{
|
{
|
||||||
|
foreach (var p in parameters)
|
||||||
|
{
|
||||||
|
if (!p.ParameterName.StartsWith(this.SqlParameterKeyWord))
|
||||||
|
{
|
||||||
|
p.ParameterName = this.SqlParameterKeyWord + p.ParameterName;
|
||||||
|
}
|
||||||
|
}
|
||||||
//由于Odbc参数都为?,用顺序进行匹配,则进行参数排序
|
//由于Odbc参数都为?,用顺序进行匹配,则进行参数排序
|
||||||
string reg = string.Join('|', parameters.Select(m => m.ParameterName));
|
string reg = string.Join('|', parameters.Select(m => m.ParameterName));
|
||||||
//通过正则匹配,为顺序输出,相同也会重复匹配
|
//通过正则匹配,为顺序输出,相同也会重复匹配
|
||||||
@@ -226,7 +234,7 @@ namespace SqlSugar.OceanBaseForOracle
|
|||||||
{
|
{
|
||||||
sqlCommand.Transaction = (OdbcTransaction)this.Transaction;
|
sqlCommand.Transaction = (OdbcTransaction)this.Transaction;
|
||||||
}
|
}
|
||||||
if (parameters.HasValue())
|
if (orderParameters.HasValue())
|
||||||
{
|
{
|
||||||
OdbcParameter[] ipars = GetSqlParameter(orderParameters.ToArray());
|
OdbcParameter[] ipars = GetSqlParameter(orderParameters.ToArray());
|
||||||
sqlCommand.Parameters.AddRange(ipars);
|
sqlCommand.Parameters.AddRange(ipars);
|
||||||
|
Reference in New Issue
Block a user