2 // Copyright (c) 2006 Mainsoft Co.
4 // Permission is hereby granted, free of charge, to any person obtaining
5 // a copy of this software and associated documentation files (the
6 // "Software"), to deal in the Software without restriction, including
7 // without limitation the rights to use, copy, modify, merge, publish,
8 // distribute, sublicense, and/or sell copies of the Software, and to
9 // permit persons to whom the Software is furnished to do so, subject to
10 // the following conditions:
12 // The above copyright notice and this permission notice shall be
13 // included in all copies or substantial portions of the Software.
15 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27 using System.Data.OracleClient;
29 using MonoTests.System.Data.Utils;
32 using NUnit.Framework;
33 namespace MonoTests.System.Data.OracleClient
36 public class OracleDataAdapter_FillSchema_DsSt : ADONetTesterClass
38 private Exception exp;
39 private string connectionString;
41 public static void Main()
43 OracleDataAdapter_FillSchema_DsSt tc = new OracleDataAdapter_FillSchema_DsSt();
44 Exception l_exp = null;
47 // Every Test must begin with BeginTest
48 tc.BeginTest("OracleDataAdapter_FillSchema_DsSt");
50 } catch(Exception ex) {
53 // Every Test must End with EndTest
61 connectionString = ConnectedDataProvider.ConnectionString;
66 TestLongSqlExpression();
69 //Test case for bug #4708
70 [Test(Description="Test case for bug #4708")]
72 public void TestLongSqlExpression()
74 BeginCase("Long SQL string cause java.lang.StackOverflowError (Test case for bug #4708)");
76 StringBuilder querySb = new StringBuilder();
77 querySb.Append("SELECT ");
78 querySb.Append("c.CustomerID as ci1, c.CustomerID as ci2, c.CustomerID as ci3, c.CustomerID as ci4, ");
79 querySb.Append("c.CompanyName as cn1, c.CompanyName as cn2, c.CompanyName as cn3, c.CompanyName as cn4, ");
80 querySb.Append("c.ContactName as cntn1, c.ContactName as cntn2, c.ContactName as cntn3, c.ContactName as cntn4, ");
81 querySb.Append("c.ContactTitle as ct1, c.ContactTitle as ct2, c.ContactTitle as ct3, c.ContactTitle as ct4, ");
82 querySb.Append("c.Address as ad1, c.Address as ad2, c.Address as ad3, c.Address as ad4, ");
83 querySb.Append("c.City as ct1, c.City as ct2, c.City as ct3, c.City as ct4, ");
84 querySb.Append("c.Region as rg1, c.Region as rg2, c.Region as rg3, c.Region as rg4, ");
85 querySb.Append("c.PostalCode as pc1, c.PostalCode as pc2, c.PostalCode as pc3, c.PostalCode as pc4, ");
86 querySb.Append("c.Country as co1, c.Country as co2, c.Country as co3, c.Country as co4, ");
87 querySb.Append("c.Phone as ph1, c.Phone as ph2, c.Phone as ph3, c.Phone as ph4, ");
88 querySb.Append("c.Fax as fx1, c.Fax as fx2, c.Fax as fx3, c.Fax as fx4 ");
89 querySb.Append("FROM Customers c");
90 OracleDataAdapter adapter = null;
91 DataSet schemaDs = new DataSet();
94 using(adapter = new OracleDataAdapter(querySb.ToString(), this.connectionString))
96 adapter.MissingSchemaAction = MissingSchemaAction.AddWithKey;
97 adapter.FillSchema(schemaDs, SchemaType.Source);
98 Compare(schemaDs.Tables.Count, 1);