diff options
author | Senganal T <senga@mono-cvs.ximian.com> | 2006-02-11 14:08:14 +0300 |
---|---|---|
committer | Senganal T <senga@mono-cvs.ximian.com> | 2006-02-11 14:08:14 +0300 |
commit | b3c23ed2150f499aa2cda370176a60a1f1cd794b (patch) | |
tree | c89149bb396578eb6416108bea555f386cd97789 /mcs/class/System.Data/Mono.Data.SqlExpressions | |
parent | 5f6b7974bfe61ba88067072f8046799fab8ef1c2 (diff) |
Fixes for the failing testcases in System.Data .. Backporting r56531,r56336 ..
svn path=/branches/mono-1-1-13/mcs/; revision=56790
Diffstat (limited to 'mcs/class/System.Data/Mono.Data.SqlExpressions')
3 files changed, 21 insertions, 1 deletions
diff --git a/mcs/class/System.Data/Mono.Data.SqlExpressions/ChangeLog b/mcs/class/System.Data/Mono.Data.SqlExpressions/ChangeLog index c0f8596dc88..f5a7e31b601 100644 --- a/mcs/class/System.Data/Mono.Data.SqlExpressions/ChangeLog +++ b/mcs/class/System.Data/Mono.Data.SqlExpressions/ChangeLog @@ -1,3 +1,13 @@ +2006-02-03 Senganal T <tsenganal@novell.com> + + * ColumnReference.cs : + - GetReferencedRow () + - GetReferencedRows() : Verify the column before getting the values. + Validate the ColumnReference even when the table has no rows. + * Function.cs : Modified Eval() + - A tmp fix to check for null. Expression.Eval needs to be modified all + around to return DBNull.Value. + 2006-01-18 Boris Kirzner <borisk@mainsoft.com> * ColumnReference.cs: added column and relation lazy evaluation and caching. diff --git a/mcs/class/System.Data/Mono.Data.SqlExpressions/ColumnReference.cs b/mcs/class/System.Data/Mono.Data.SqlExpressions/ColumnReference.cs index 4e89b437069..bba36746dff 100644 --- a/mcs/class/System.Data/Mono.Data.SqlExpressions/ColumnReference.cs +++ b/mcs/class/System.Data/Mono.Data.SqlExpressions/ColumnReference.cs @@ -131,7 +131,6 @@ namespace Mono.Data.SqlExpressions { table = GetRelation (row).ChildTable; break; } - _cachedColumn = table.Columns [columnName]; if (_cachedColumn == null) throw new EvaluateException (String.Format ("Cannot find column [{0}].", columnName)); @@ -144,6 +143,9 @@ namespace Mono.Data.SqlExpressions { public DataRow GetReferencedRow (DataRow row) { + // Verify the column reference is valid + GetColumn (row); + switch (refTable) { case ReferencedTable.Self: default: @@ -159,6 +161,9 @@ namespace Mono.Data.SqlExpressions { public DataRow[] GetReferencedRows (DataRow row) { + // Verify the column reference is valid + GetColumn (row); + switch (refTable) { case ReferencedTable.Self: default: diff --git a/mcs/class/System.Data/Mono.Data.SqlExpressions/Functions.cs b/mcs/class/System.Data/Mono.Data.SqlExpressions/Functions.cs index 63b21155b6d..7e91144b01b 100644 --- a/mcs/class/System.Data/Mono.Data.SqlExpressions/Functions.cs +++ b/mcs/class/System.Data/Mono.Data.SqlExpressions/Functions.cs @@ -148,6 +148,11 @@ namespace Mono.Data.SqlExpressions { { object val = expr.Eval (row); + // TMPFIX :Eval shud never really return a null.. DBNull.Value but not null + // needs to be done for all expressions .. for now ,just check for null + if (val == null) + return DBNull.Value; + if (val == DBNull.Value || val.GetType () == targetType) return val; |