Skip to content

Commit 962a448

Browse files
Revert changes in GXDataCommon.cs made by mistake.
1 parent 398e175 commit 962a448

1 file changed

Lines changed: 11 additions & 39 deletions

File tree

dotnet/src/dotnetframework/GxClasses/Data/GXDataCommon.cs

Lines changed: 11 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,7 @@ public enum GXType
6868
Geopoint=26,
6969
Geoline=27,
7070
Geopolygon=28,
71-
DateAsChar=29,
72-
Embedding = 30
71+
DateAsChar=29
7372
}
7473

7574
public interface IGxDataRecord
@@ -142,9 +141,6 @@ IDataReader GetDataReader(IGxConnectionManager connManager, IGxConnection connec
142141
void SetCursorDef(CursorDef cursorDef);
143142
string ConcatOp(int pos);
144143
string AfterCreateCommand(string stmt, GxParameterCollection parmBinds);
145-
#if NETCORE
146-
GxEmbedding GetEmbedding(IGxDbCommand gxDbCommand, IDataReader dR, int v, string model, int dimensions);
147-
#endif
148144
int MaxNumberOfValuesInList { get; }
149145
}
150146

@@ -426,9 +422,9 @@ public virtual void SetParameter(IDbDataParameter parameter, Object value)
426422
}
427423
protected object CheckDataLength(object value, IDbDataParameter parameter)
428424
{
429-
if (m_avoidDataTruncationError && (parameter.DbType == DbType.String || parameter.DbType == DbType.StringFixedLength) && value is string)
425+
if (m_avoidDataTruncationError)
430426
{
431-
string svalue = value as string;
427+
string svalue = value.ToString();
432428
if (svalue != null && svalue.Length > parameter.Size)
433429
{
434430
return svalue.Substring(0, parameter.Size);
@@ -626,15 +622,8 @@ public virtual Guid GetGuid(IGxDbCommand cmd, IDataRecord DR, int i)
626622
public virtual IGeographicNative GetGeospatial(IGxDbCommand cmd, IDataRecord DR, int i)
627623
{
628624
throw (new GxNotImplementedException());
629-
}
630-
#if NETCORE
631-
public virtual GxEmbedding GetEmbedding(IGxDbCommand cmd, IDataReader DR, int i, string model, int dimensions)
632-
{
633-
throw (new GxNotImplementedException());
634-
}
635-
#endif
636-
637-
public virtual decimal GetDecimal(IGxDbCommand cmd, IDataRecord DR, int i)
625+
}
626+
public virtual decimal GetDecimal(IGxDbCommand cmd, IDataRecord DR, int i)
638627
{
639628
if ( !cmd.HasMoreRows || DR == null || DR.IsDBNull( i))
640629
return 0;
@@ -840,7 +829,7 @@ public virtual IDbCommand GetCommand(IGxConnection con, string stmt, GxParameter
840829
}
841830
catch (Exception ex)
842831
{
843-
GXLogging.Error(log, "Set Binary parameter length in cached command error", ex.Message, ex);
832+
GXLogging.Error(log, "Set Binary parameter length in cached command error", ex);
844833
}
845834
}
846835
}
@@ -1170,10 +1159,6 @@ public virtual string AfterCreateCommand(string stmt, GxParameterCollection parm
11701159
return stmt;
11711160
}
11721161

1173-
internal virtual DateTime NormalizeDbmsDateTime(DateTime d)
1174-
{
1175-
return d;
1176-
}
11771162
}
11781163

11791164
public class DbDataAdapterElem
@@ -1611,8 +1596,6 @@ public class GxSqlServer : GxDataRecord
16111596
private const int MILLISECONDS_BETWEEN_RETRY_ATTEMPTS = 500;
16121597
private const string MULTIPLE_DATAREADERS = "MultipleActiveResultSets";
16131598
#if NETCORE
1614-
private const string TRUST_SERVER_CERTIFICATE = "TrustServerCertificate";
1615-
private const bool TRUST_CERT_DEFAULT = true;
16161599
private const string INTEGRATED_SECURITY = "Integrated Security";
16171600
private const string INTEGRATED_SECURITY_NO = "no";
16181601
#endif
@@ -1980,7 +1963,7 @@ public override void GetValues(IDataReader reader, ref object[] values)
19801963
}
19811964
catch (Exception ex)
19821965
{
1983-
GXLogging.Error(log, "GetValues error", ex.Message, ex);
1966+
GXLogging.Error(log, "GetValues error", ex);
19841967
}
19851968
}
19861969
static internal decimal ReadSQLDecimal(SqlDataReader sqlReader, int idx) {
@@ -2079,14 +2062,6 @@ protected override string BuildConnectionString(string datasourceName, string us
20792062
connectionString.AppendFormat(";Password={0}", userPassword);
20802063
}
20812064
extra = ResolveConnectionStringAuthentication(extra, additionalConnectionString);
2082-
2083-
string tSrvCertificate = GetParameterValue(extra, TRUST_SERVER_CERTIFICATE);
2084-
if (string.IsNullOrEmpty(tSrvCertificate))
2085-
{
2086-
//TODO:Remove Temporary compatibility setting to bypass certificate validation
2087-
connectionString.AppendFormat(";{0}={1}", TRUST_SERVER_CERTIFICATE, TRUST_CERT_DEFAULT);
2088-
}
2089-
20902065
#else
20912066
if (userId!=null)
20922067
{
@@ -2289,7 +2264,7 @@ public bool Read()
22892264
}
22902265
catch (Exception ex)
22912266
{
2292-
GXLogging.Error(log, "ReadError", ex.Message, ex);
2267+
GXLogging.Error(log, "ReadError", ex);
22932268
throw (new GxADODataException(ex));
22942269
}
22952270
}
@@ -2562,7 +2537,7 @@ public object this[int i]
25622537
}
25632538
public int GetValues(object[] values)
25642539
{
2565-
return reader.GetValues(values);
2540+
throw (new GxNotImplementedException());
25662541
}
25672542
public int GetOrdinal(string name)
25682543
{
@@ -3190,7 +3165,7 @@ public void unprepare(int cursorId )
31903165
}
31913166
catch (Exception e)
31923167
{
3193-
GXLogging.Error(log, "GxCommand.unprepare Error ", e.Message, e);
3168+
GXLogging.Error(log, "GxCommand.unprepare Error ", e);
31943169
}
31953170
}
31963171
public void UnprepareClear()
@@ -3352,7 +3327,7 @@ public void LoadBlock()
33523327
{
33533328
if (reader != null) reader.Close();
33543329
GXLogging.Error(log, "stmt:" + this.stmt);
3355-
GXLogging.Error(log, "LoadBlock error ", e.Message, e);
3330+
GXLogging.Error(log, "LoadBlock error ", e);
33563331

33573332
Dispose();
33583333
hasnext = false;
@@ -4284,7 +4259,6 @@ public abstract class GxAbstractConnectionWrapper : IDbConnection
42844259
protected IDbTransaction m_transaction;
42854260
protected GxConnectionCache m_connectionCache;
42864261
protected IsolationLevel m_isolationLevel;
4287-
const string DISTANCE_FUNCTION = "DISTANCE";
42884262

42894263
protected GxAbstractConnectionWrapper(IDbConnection conn, IsolationLevel isolationLevel) :this(conn)
42904264
{
@@ -4364,8 +4338,6 @@ public ConnectionState State
43644338
get { return InternalConnection.State; }
43654339
}
43664340

4367-
internal virtual string DistanceFunction { get { return DISTANCE_FUNCTION; } }
4368-
43694341
public virtual void Open()
43704342
{
43714343
InternalConnection.Open();

0 commit comments

Comments
 (0)