[Mono-bugs] [Bug 591443] New: Cloning a DataColumn with Expression result in a DataColumn in an invalid state

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Fri Mar 26 10:14:48 EDT 2010



           Summary: Cloning a DataColumn with Expression result in a
                    DataColumn in an invalid state
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 2.6.x
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Critical
          Priority: P5 - None
         Component: Sys.Data
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: Dominique.Normand at cegedim.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---

User-Agent:       Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_2; en-us)
AppleWebKit/531.22.7 (KHTML, like Gecko) Version/4.0.5 Safari/531.22.7

Cloning a DataColumn that has an Expression will result in a DataColumn that
has an Expression set but for which the CompiledExpression is null. This causes
an exception when trying to read a row value for that column

Reproducible: Always

Steps to Reproduce:
1. Create a DataTable + DataColumn with an expression 
2. Clone the DataTable
3. Add a row to the cloned DataTable
4. Try to read the column value of that row
Actual Results:  
A null exception is thrown

Expected Results:  
We should get back the result of the expression for that row/column

The problem comes from the clone copying the _expression field but not the
I think the Expression should be parsed and compiled on demand in the
CompiledExpression property instead of in the Expression property. This would
fix the problem and also allow column #1 expression to depend on column #2.
Today, you cannot add an expression that depends on a column that doesn't
exists yet. This is a problem with the Deserialization.
The downside would be that invalid expression wouldn't be detected until the
row value is accessed, but if the row value is never accessed, then the
expression will never be parsed & compiled which might be good.

Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.

More information about the mono-bugs mailing list