merge -r 53670:53671
authorKonstantin Triger <kostat@mono-cvs.ximian.com>
Wed, 30 Nov 2005 10:20:31 +0000 (10:20 -0000)
committerKonstantin Triger <kostat@mono-cvs.ximian.com>
Wed, 30 Nov 2005 10:20:31 +0000 (10:20 -0000)
svn path=/branches/mainsoft/gh1.7/mcs/; revision=53672

mcs/class/System.Data/Mono.Data.SqlExpressions/ChangeLog
mcs/class/System.Data/Mono.Data.SqlExpressions/Parser.jay
mcs/class/System.Data/Test/System.Data/ChangeLog
mcs/class/System.Data/Test/System.Data/DataColumnTest.cs

index 232d86167bb4462ad7821c4bcbb37048e73cdaa4..3912e25c33aa24a5a8b16d6142a36732a1631a03 100644 (file)
@@ -1,3 +1,7 @@
+2005-11-30 Konstantin Triger <kostat@mainsoft.com>
+
+       * Parser.jay: use Convert.ToInt32() instead of cast to throw OverflowException.
+
 2005-10-26 Konstantin Triger <kostat@mainsoft.com>
 
        * In.cs: Fix the enumerator initialization problem.
index b988eae294ad5ab5483cb5125515b6ded9fd9cc7..6f7370ec169b8d471abd1a0428384adf2792a146 100644 (file)
@@ -257,7 +257,7 @@ CalcFunction
        {
                long arg1 = (long) $5;
                long arg2 = (long) $7;
-               $$ = new SubstringFunction ((IExpression)$3, (int) arg1, (int) arg2);
+               $$ = new SubstringFunction ((IExpression)$3, Convert.ToInt32(arg1), Convert.ToInt32(arg2));
        }
        | ISNULL PAROPEN ColumnValue COMMA Expr PARCLOSE
        {
index e265bba3db6a84f3ae749a1d7d02cd7401c43e25..b42898b780ac42838459effb6de73d8984e806df 100644 (file)
@@ -1,3 +1,7 @@
+2005-11-30 Konstantin Triger <kostat@mainsoft.com>
+
+       * DataColumnTest.cs: Added ExpressionSubstringlimits.
+
 2005-11-11 Senganal T <tsenganal@novell.com>
 
        * DataSetTest2.cs : Added a testcase for bug#76517 
index f288f77e0791eccf36cbffe95cc6ef188da1478a..968fb861c28c0496022b0c627d40f74893550a9c 100644 (file)
@@ -303,6 +303,16 @@ namespace MonoTests.System.Data
                        AssertEquals("DC28: Value from DataRow.Item", v, DBNull.Value);
                }
 
+               [Test]
+               [ExpectedException (typeof (OverflowException))]
+               public void ExpressionSubstringlimits() {
+                       DataTable t = new DataTable();
+                       t.Columns.Add("aaa");
+                       t.Rows.Add(new object[]{"xxx"});
+                       DataColumn c = t.Columns.Add("bbb");
+                       c.Expression= "SUBSTRING(aaa, 6000000000000000, 2)";
+               }
+
                [Test]
                [Category ("NotWorking")]
                 public void ExpressionFunctions ()