teiid SVN: r3255 - branches/7.4.x/build/kits/jboss-container/teiid-docs/licenses.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2011-06-18 08:20:53 -0400 (Sat, 18 Jun 2011)
New Revision: 3255
Added:
branches/7.4.x/build/kits/jboss-container/teiid-docs/licenses/MPL-1.0.html
Log:
TEIID-1448 adding the ability to stream docs for xquery processing
Added: branches/7.4.x/build/kits/jboss-container/teiid-docs/licenses/MPL-1.0.html
===================================================================
--- branches/7.4.x/build/kits/jboss-container/teiid-docs/licenses/MPL-1.0.html (rev 0)
+++ branches/7.4.x/build/kits/jboss-container/teiid-docs/licenses/MPL-1.0.html 2011-06-18 12:20:53 UTC (rev 3255)
@@ -0,0 +1,421 @@
+<html><head>
+<meta http-equiv="content-type" content="text/html; charset=UTF-8"><title>Mozilla Public License version 1.0</title>
+</head><body link="#0000ee" text="#000000" vlink="#551a8b" alink="#ff0000" bgcolor="#ffffff">
+
+<p align="CENTER">
+ <font size="+2"><b>MOZILLA PUBLIC LICENSE</b></font><br>
+ <b>Version 1.0</b>
+</p>
+
+<p></p><hr width="20%"><p>
+
+</p><p><b>1. Definitions.</b>
+</p><ul>
+
+ <b>1.1. ``Contributor''</b> means each entity that creates or contributes
+ to the creation of Modifications.
+
+ <p><b>1.2. ``Contributor Version''</b> means the combination of the
+ Original Code, prior Modifications used by a Contributor, and the
+ Modifications made by that particular Contributor.
+
+ </p><p><b>1.3. ``Covered Code''</b> means the Original Code or Modifications
+ or the combination of the Original Code and Modifications, in each case
+ including portions thereof<b>.</b>
+
+ </p><p><b>1.4. ``Electronic Distribution Mechanism''</b> means a mechanism
+ generally accepted in the software development community for the
+ electronic transfer of data.
+
+ </p><p><b>1.5. ``Executable''</b> means Covered Code in any form other than
+ Source Code.
+
+ </p><p><b>1.6. ``Initial Developer''</b> means the individual or entity
+ identified as the Initial Developer in the Source Code notice required by
+ <b>Exhibit A</b>.
+
+ </p><p><b>1.7. ``Larger Work''</b> means a work which combines Covered Code
+ or portions thereof with code not governed by the terms of this License.
+
+ </p><p><b>1.8. ``License''</b> means this document.
+
+ </p><p><b>1.9. ``Modifications''</b> means any addition to or deletion from
+ the substance or structure of either the Original Code or any previous
+ Modifications. When Covered Code is released as a series of files, a
+ Modification is:
+
+ </p><ul>
+
+ <p><b>A.</b> Any addition to or deletion from the contents of a file
+ containing Original Code or previous Modifications.
+
+ </p><p><b>B.</b> Any new file that contains any part of the Original
+ Code or previous Modifications.
+
+ </p></ul>
+
+ <p><b>1.10. ``Original Code''</b> means Source Code of computer software
+ code which is described in the Source Code notice required by <b>Exhibit
+ A</b> as Original Code, and which, at the time of its release under this
+ License is not already Covered Code governed by this License.
+
+ </p><p><b>1.11. ``Source Code''</b> means the preferred form of the Covered
+ Code for making modifications to it, including all modules it contains,
+ plus any associated interface definition files, scripts used to control
+ compilation and installation of an Executable, or a list of source code
+ differential comparisons against either the Original Code or another well
+ known, available Covered Code of the Contributor's choice. The Source
+ Code can be in a compressed or archival form, provided the appropriate
+ decompression or de-archiving software is widely available for no charge.
+
+ </p><p><b>1.12. ``You''</b> means an individual or a legal entity exercising
+ rights under, and complying with all of the terms of, this License or a
+ future version of this License issued under Section 6.1. For legal
+ entities, ``You'' includes any entity which controls, is controlled by,
+ or is under common control with You. For purposes of this definition,
+ ``control'' means (a) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or otherwise,
+ or (b) ownership of fifty percent (50%) or more of the outstanding shares
+ or beneficial ownership of such entity.
+
+</p></ul>
+<b>2. Source Code License.</b>
+<ul>
+
+ <b>2.1. The Initial Developer Grant.</b>
+
+ <br>The Initial Developer hereby grants You a world-wide, royalty-free,
+ non-exclusive license, subject to third party intellectual property
+ claims:
+
+ <ul>
+
+ <p><b>(a)</b> to use, reproduce, modify, display, perform, sublicense
+ and distribute the Original Code (or portions thereof) with or
+ without Modifications, or as part of a Larger Work; and
+
+ </p><p><b>(b)</b> under patents now or hereafter owned or controlled by
+ Initial Developer, to make, have made, use and sell (``Utilize'') the
+ Original Code (or portions thereof), but solely to the extent that
+ any such patent is reasonably necessary to enable You to Utilize the
+ Original Code (or portions thereof) and not to any greater extent
+ that may be necessary to Utilize further Modifications or
+ combinations.
+ </p></ul>
+
+ <p><b>2.2. Contributor Grant.</b>
+
+ <br>Each Contributor hereby grants You a world-wide, royalty-free,
+ non-exclusive license, subject to third party intellectual property
+ claims:
+
+ </p><ul>
+
+ <p><b>(a)</b> to use, reproduce, modify, display, perform, sublicense and
+ distribute the Modifications created by such Contributor (or portions
+ thereof) either on an unmodified basis, with other Modifications, as
+ Covered Code or as part of a Larger Work; and
+
+ </p><p><b>(b)</b> under patents now or hereafter owned or controlled by
+ Contributor, to Utilize the Contributor Version (or portions thereof),
+ but solely to the extent that any such patent is reasonably necessary to
+ enable You to Utilize the Contributor Version (or portions thereof), and
+ not to any greater extent that may be necessary to Utilize further
+ Modifications or combinations.
+
+ </p></ul>
+
+</ul>
+<b>3. Distribution Obligations.</b>
+<ul>
+
+ <b>3.1. Application of License.</b>
+
+ <br>The Modifications which You create or to which You contribute are
+ governed by the terms of this License, including without limitation
+ Section <b>2.2</b>. The Source Code version of Covered Code may be
+ distributed only under the terms of this License or a future version of
+ this License released under Section <b>6.1</b>, and You must include a
+ copy of this License with every copy of the Source Code You
+ distribute. You may not offer or impose any terms on any Source Code
+ version that alters or restricts the applicable version of this License
+ or the recipients' rights hereunder. However, You may include an
+ additional document offering the additional rights described in Section
+ <b>3.5</b>.
+
+ <p><b>3.2. Availability of Source Code.</b>
+
+ <br>Any Modification which You create or to which You contribute must be
+ made available in Source Code form under the terms of this License either
+ on the same media as an Executable version or via an accepted Electronic
+ Distribution Mechanism to anyone to whom you made an Executable version
+ available; and if made available via Electronic Distribution Mechanism,
+ must remain available for at least twelve (12) months after the date it
+ initially became available, or at least six (6) months after a subsequent
+ version of that particular Modification has been made available to such
+ recipients. You are responsible for ensuring that the Source Code version
+ remains available even if the Electronic Distribution Mechanism is
+ maintained by a third party.
+
+ </p><p><b>3.3. Description of Modifications.</b>
+
+ <br>You must cause all Covered Code to which you contribute to contain a
+ file documenting the changes You made to create that Covered Code and the
+ date of any change. You must include a prominent statement that the
+ Modification is derived, directly or indirectly, from Original Code
+ provided by the Initial Developer and including the name of the Initial
+ Developer in (a) the Source Code, and (b) in any notice in an Executable
+ version or related documentation in which You describe the origin or
+ ownership of the Covered Code.
+
+ </p><p><b>3.4. Intellectual Property Matters</b>
+ </p><ul>
+
+ <p><b>(a) Third Party Claims</b>.
+
+ <br>If You have knowledge that a party claims an intellectual
+ property right in particular functionality or code (or its
+ utilization under this License), you must include a text file with
+ the source code distribution titled ``LEGAL'' which describes the
+ claim and the party making the claim in sufficient detail that a
+ recipient will know whom to contact. If you obtain such knowledge
+ after You make Your Modification available as described in Section
+ <b>3.2</b>, You shall promptly modify the LEGAL file in all copies
+ You make available thereafter and shall take other steps (such as
+ notifying appropriate mailing lists or newsgroups) reasonably
+ calculated to inform those who received the Covered Code that new
+ knowledge has been obtained.
+
+ </p><p><b>(b) Contributor APIs</b>.
+
+ <br>If Your Modification is an application programming interface and
+ You own or control patents which are reasonably necessary to
+ implement that API, you must also include this information in the
+ LEGAL file.
+
+ </p></ul>
+
+ <p><b>3.5. Required Notices.</b>
+
+ <br>You must duplicate the notice in <b>Exhibit A</b> in each file of the
+ Source Code, and this License in any documentation for the Source Code,
+ where You describe recipients' rights relating to Covered Code. If You
+ created one or more Modification(s), You may add your name as a
+ Contributor to the notice described in <b>Exhibit A</b>. If it is not
+ possible to put such notice in a particular Source Code file due to its
+ structure, then you must include such notice in a location (such as a
+ relevant directory file) where a user would be likely to look for such a
+ notice. You may choose to offer, and to charge a fee for, warranty,
+ support, indemnity or liability obligations to one or more recipients of
+ Covered Code. However, You may do so only on Your own behalf, and not on
+ behalf of the Initial Developer or any Contributor. You must make it
+ absolutely clear than any such warranty, support, indemnity or liability
+ obligation is offered by You alone, and You hereby agree to indemnify the
+ Initial Developer and every Contributor for any liability incurred by the
+ Initial Developer or such Contributor as a result of warranty, support,
+ indemnity or liability terms You offer.
+
+ </p><p><b>3.6. Distribution of Executable Versions.</b>
+
+ <br>You may distribute Covered Code in Executable form only if the
+ requirements of Section <b>3.1-3.5</b> have been met for that Covered
+ Code, and if You include a notice stating that the Source Code version of
+ the Covered Code is available under the terms of this License, including
+ a description of how and where You have fulfilled the obligations of
+ Section <b>3.2</b>. The notice must be conspicuously included in any
+ notice in an Executable version, related documentation or collateral in
+ which You describe recipients' rights relating to the Covered Code. You
+ may distribute the Executable version of Covered Code under a license of
+ Your choice, which may contain terms different from this License,
+ provided that You are in compliance with the terms of this License and
+ that the license for the Executable version does not attempt to limit or
+ alter the recipient's rights in the Source Code version from the rights
+ set forth in this License. If You distribute the Executable version under
+ a different license You must make it absolutely clear that any terms
+ which differ from this License are offered by You alone, not by the
+ Initial Developer or any Contributor. You hereby agree to indemnify the
+ Initial Developer and every Contributor for any liability incurred by the
+ Initial Developer or such Contributor as a result of any such terms You
+ offer.
+
+ </p><p><b>3.7. Larger Works.</b>
+
+ <br>You may create a Larger Work by combining Covered Code with other
+ code not governed by the terms of this License and distribute the Larger
+ Work as a single product. In such a case, You must make sure the
+ requirements of this License are fulfilled for the Covered Code.
+
+</p></ul>
+<b>4. Inability to Comply Due to Statute or Regulation.</b>
+<ul>
+
+ <p>If it is impossible for You to comply with any of the terms of this
+ License with respect to some or all of the Covered Code due to statute or
+ regulation then You must: (a) comply with the terms of this License to
+ the maximum extent possible; and (b) describe the limitations and the
+ code they affect. Such description must be included in the LEGAL file
+ described in Section <b>3.4</b> and must be included with all
+ distributions of the Source Code. Except to the extent prohibited by
+ statute or regulation, such description must be sufficiently detailed for
+ a recipient of ordinary skill
+ to be able to understand it.
+
+</p></ul>
+<b>5. Application of this License.</b>
+<ul>
+
+ This License applies to code to which the Initial Developer has attached
+ the notice in <b>Exhibit A</b>, and to related Covered Code.
+
+</ul>
+<b>6. Versions of the License.</b>
+<ul>
+
+ <b>6.1. New Versions</b>.
+
+ <br>Netscape Communications Corporation (``Netscape'') may publish
+ revised and/or new versions of the License from time to time. Each
+ version will be given a distinguishing version number.
+
+ <p><b>6.2. Effect of New Versions</b>.
+
+ <br>Once Covered Code has been published under a particular version of
+ the License, You may always continue to use it under the terms of that
+ version. You may also choose to use such Covered Code under the terms of
+ any subsequent version of the License published by Netscape. No one other
+ than Netscape has the right to modify the terms applicable to Covered
+ Code created under this License.
+
+ </p><p><b>6.3. Derivative Works</b>.
+
+ <br>If you create or use a modified version of this License (which you
+ may only do in order to apply it to code which is not already Covered
+ Code governed by this License), you must (a) rename Your license so that
+ the phrases ``Mozilla'', ``MOZILLAPL'', ``MOZPL'', ``Netscape'', ``NPL''
+ or any confusingly similar phrase do not appear anywhere in your license
+ and (b) otherwise make it clear that your version of the license contains
+ terms which differ from the Mozilla Public License and Netscape Public
+ License. (Filling in the name of the Initial Developer, Original Code or
+ Contributor in the notice described in <b>Exhibit A</b> shall not of
+ themselves be deemed to be modifications of this License.)
+
+</p></ul>
+<b>7. DISCLAIMER OF WARRANTY.</b>
+<ul>
+
+ COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN ``AS IS'' BASIS,
+ WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF DEFECTS,
+ MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE
+ RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE IS WITH
+ YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE
+ INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY
+ NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY
+ CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED CODE
+ IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
+
+</ul>
+<b>8. TERMINATION.</b>
+<ul>
+
+ This License and the rights granted hereunder will terminate
+ automatically if You fail to comply with terms herein and fail to cure
+ such breach within 30 days of becoming aware of the breach. All
+ sublicenses to the Covered Code which are properly granted shall survive
+ any termination of this License. Provisions which, by their nature, must
+ remain in effect beyond the termination of this License shall survive.
+
+</ul>
+<b>9. LIMITATION OF LIABILITY.</b>
+<ul>
+
+ UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING
+ NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL THE INITIAL DEVELOPER, ANY
+ OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE, OR ANY SUPPLIER OF
+ ANY OF SUCH PARTIES, BE LIABLE TO YOU OR ANY OTHER PERSON FOR ANY
+ INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER
+ INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK
+ STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER
+ COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED
+ OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL
+ NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH
+ PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH
+ LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION
+ OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THAT EXCLUSION AND LIMITATION
+ MAY NOT APPLY TO YOU.
+
+</ul>
+<b>10. U.S. GOVERNMENT END USERS.</b>
+<ul>
+
+ The Covered Code is a ``commercial item,'' as that term is defined in 48
+ C.F.R. 2.101 (Oct. 1995), consisting of ``commercial computer software''
+ and ``commercial computer software documentation,'' as such terms are
+ used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212
+ and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all
+ U.S. Government End Users acquire Covered Code with only those rights set
+ forth herein.
+
+</ul>
+<b>11. MISCELLANEOUS.</b>
+<ul>
+
+ This License represents the complete agreement concerning subject matter
+ hereof. If any provision of this License is held to be unenforceable,
+ such provision shall be reformed only to the extent necessary to make it
+ enforceable. This License shall be governed by California law provisions
+ (except to the extent applicable law, if any, provides otherwise),
+ excluding its conflict-of-law provisions. With respect to disputes in
+ which at least one party is a citizen of, or an entity chartered or
+ registered to do business in, the United States of America: (a) unless
+ otherwise agreed in writing, all disputes relating to this License
+ (excepting any dispute relating to intellectual property rights) shall be
+ subject to final and binding arbitration, with the losing party paying
+ all costs of arbitration; (b) any arbitration relating to this Agreement
+ shall be held in Santa Clara County, California, under the auspices of
+ JAMS/EndDispute; and (c) any litigation relating to this Agreement shall
+ be subject to the jurisdiction of the Federal Courts of the Northern
+ District of California, with venue lying in Santa Clara County,
+ California, with the losing party responsible for costs, including
+ without limitation, court costs and reasonable attorneys fees and
+ expenses. The application of the United Nations Convention on Contracts
+ for the International Sale of Goods is expressly excluded. Any law or
+ regulation which provides that the language of a contract shall be
+ construed against the drafter shall not apply to this License.
+
+</ul>
+<b>12. RESPONSIBILITY FOR CLAIMS.</b>
+<ul>
+
+ Except in cases where another Contributor has failed to comply with
+ Section <b>3.4</b>, You are responsible for damages arising, directly or
+ indirectly, out of Your utilization of rights under this License, based
+ on the number of copies of Covered Code you made available, the revenues
+ you received from utilizing such rights, and other relevant factors. You
+ agree to work with affected parties to distribute responsibility on an
+ equitable basis.
+
+</ul>
+<b>EXHIBIT A.</b>
+<ul>
+
+ ``The contents of this file are subject to the Mozilla Public License
+ Version 1.0 (the "License"); you may not use this file except in
+ compliance with the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+ <p>Software distributed under the License is distributed on an "AS IS"
+ basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+ License for the specific language governing rights and limitations under
+ the License.
+
+ </p><p>The Original Code is ______________________________________.
+
+ </p><p>The Initial Developer of the Original Code is
+ ________________________. Portions created by ______________________ are
+ Copyright (C) ______ _______________________. All Rights Reserved.
+
+ </p><p>Contributor(s): ______________________________________.''
+
+</p></ul>
+</body></html>
\ No newline at end of file
Property changes on: branches/7.4.x/build/kits/jboss-container/teiid-docs/licenses/MPL-1.0.html
___________________________________________________________________
Added: svn:mime-type
+ text/plain
13 years, 6 months
teiid SVN: r3254 - branches/7.4.x/runtime/src/main/java/org/teiid/odbc.
by teiid-commits@lists.jboss.org
Author: mdrillin
Date: 2011-06-17 18:13:44 -0400 (Fri, 17 Jun 2011)
New Revision: 3254
Modified:
branches/7.4.x/runtime/src/main/java/org/teiid/odbc/ODBCServerRemoteImpl.java
Log:
TEIID-1631 : ODBC SQLDescribeCol was not working when used with Prepare Statement
Modified: branches/7.4.x/runtime/src/main/java/org/teiid/odbc/ODBCServerRemoteImpl.java
===================================================================
--- branches/7.4.x/runtime/src/main/java/org/teiid/odbc/ODBCServerRemoteImpl.java 2011-06-17 22:10:42 UTC (rev 3253)
+++ branches/7.4.x/runtime/src/main/java/org/teiid/odbc/ODBCServerRemoteImpl.java 2011-06-17 22:13:44 UTC (rev 3254)
@@ -477,7 +477,12 @@
}
else {
try {
+ // The response is a ParameterDescription message describing the parameters needed by the statement,
this.client.sendParameterDescription(query.stmt.getParameterMetaData(), query.paramType);
+
+ // followed by a RowDescription message describing the rows that will be returned when the statement
+ // is eventually executed (or a NoData message if the statement will not return rows).
+ this.client.sendResultSetDescription(query.stmt.getMetaData(), query.stmt);
} catch (SQLException e) {
errorOccurred(e);
}
13 years, 6 months
teiid SVN: r3253 - in branches/7.4.x: test-integration/common/src/test/resources/TestODBCSchema and 1 other directory.
by teiid-commits@lists.jboss.org
Author: mdrillin
Date: 2011-06-17 18:10:42 -0400 (Fri, 17 Jun 2011)
New Revision: 3253
Modified:
branches/7.4.x/runtime/src/main/java/org/teiid/deployers/PgCatalogMetadataStore.java
branches/7.4.x/test-integration/common/src/test/resources/TestODBCSchema/test_PG_ATTRIBUTE.expected
Log:
TEIID-1623 - Resolves issue with ODBC precision and scale data for numeric and string types.
Modified: branches/7.4.x/runtime/src/main/java/org/teiid/deployers/PgCatalogMetadataStore.java
===================================================================
--- branches/7.4.x/runtime/src/main/java/org/teiid/deployers/PgCatalogMetadataStore.java 2011-06-16 15:20:10 UTC (rev 3252)
+++ branches/7.4.x/runtime/src/main/java/org/teiid/deployers/PgCatalogMetadataStore.java 2011-06-17 22:10:42 UTC (rev 3253)
@@ -160,7 +160,8 @@
"pt.oid as atttypid," + //$NON-NLS-1$
"pt.typlen as attlen, " + //$NON-NLS-1$
"convert(t1.Position, short) as attnum, " + //$NON-NLS-1$
- "t1.Length as atttypmod, " + //$NON-NLS-1$
+ "(CASE WHEN (t1.DataType = 'bigdecimal' OR t1.DataType = 'biginteger' OR t1.DataType = 'float' OR t1.DataType='double') THEN (4+(65536*t1.Precision)+t1.Scale) " + //$NON-NLS-1$
+ "ELSE (4+t1.Length) END) as atttypmod, " + //$NON-NLS-1$
"CASE WHEN (t1.NullType = 'No Nulls') THEN true ELSE false END as attnotnull, " + //$NON-NLS-1$
"false as attisdropped, " + //$NON-NLS-1$
"false as atthasdef " + //$NON-NLS-1$
Modified: branches/7.4.x/test-integration/common/src/test/resources/TestODBCSchema/test_PG_ATTRIBUTE.expected
===================================================================
--- branches/7.4.x/test-integration/common/src/test/resources/TestODBCSchema/test_PG_ATTRIBUTE.expected 2011-06-16 15:20:10 UTC (rev 3252)
+++ branches/7.4.x/test-integration/common/src/test/resources/TestODBCSchema/test_PG_ATTRIBUTE.expected 2011-06-17 22:10:42 UTC (rev 3253)
@@ -1,257 +1,257 @@
integer integer string integer short short integer boolean boolean boolean
oid attrelid attname atttypid attlen attnum atttypmod attnotnull attisdropped atthasdef
-1 1 PART_ID 1043 -1 1 4 true false false
-2 1 PART_NAME 1043 -1 2 255 false false false
-3 1 PART_COLOR 1043 -1 3 30 false false false
-4 1 PART_WEIGHT 1043 -1 4 255 false false false
-5 2 SHIPPER_ID 21 2 1 0 true false false
-6 2 SHIPPER_NAME 1043 -1 2 30 false false false
-7 3 STATUS_ID 21 2 1 0 true false false
-8 3 STATUS_NAME 1043 -1 2 30 false false false
-9 4 SUPPLIER_ID 1043 -1 1 10 true false false
-10 4 PART_ID 1043 -1 2 4 true false false
-11 4 QUANTITY 21 2 3 0 false false false
-12 4 SHIPPER_ID 21 2 4 0 false false false
-13 5 SUPPLIER_ID 1043 -1 1 10 true false false
-14 5 SUPPLIER_NAME 1043 -1 2 30 false false false
-15 5 SUPPLIER_STATUS 21 2 3 0 false false false
-16 5 SUPPLIER_CITY 1043 -1 4 30 false false false
-17 5 SUPPLIER_STATE 1043 -1 5 2 false false false
-18 6 VDBName 1043 -1 1 255 true false false
-19 6 SchemaName 1043 -1 2 255 true false false
-20 6 Name 1043 -1 3 255 true false false
-21 6 TargetSchemaName 1043 -1 4 255 false false false
-22 6 TargetName 1043 -1 5 4000 false false false
-23 6 Valid 16 1 6 0 false false false
-24 6 LoadState 1043 -1 7 255 false false false
-25 6 Updated 1114 8 8 0 false false false
-26 6 Cardinality 23 4 9 10 false false false
-27 7 resourcePath 1043 -1 1 255 false false false
-28 7 contents 14939 -1 2 0 false false false
-29 8 VDBName 1043 -1 1 255 true false false
-30 8 SchemaName 1043 -1 2 255 false false false
-31 8 TableName 1043 -1 3 255 true false false
-32 8 Name 1043 -1 4 255 true false false
-33 8 Position 23 4 5 10 true false false
-34 8 NameInSource 1043 -1 6 255 false false false
-35 8 DataType 1043 -1 7 100 true false false
-36 8 Scale 23 4 8 10 true false false
-37 8 Length 23 4 9 10 true false false
-38 8 IsLengthFixed 16 1 10 1 true false false
-39 8 SupportsSelect 16 1 11 1 true false false
-40 8 SupportsUpdates 16 1 12 1 true false false
-41 8 IsCaseSensitive 16 1 13 1 true false false
-42 8 IsSigned 16 1 14 1 true false false
-43 8 IsCurrency 16 1 15 1 true false false
-44 8 IsAutoIncremented 16 1 16 1 true false false
-45 8 NullType 1043 -1 17 20 true false false
-46 8 MinRange 1043 -1 18 50 false false false
-47 8 MaxRange 1043 -1 19 50 false false false
-48 8 DistinctCount 23 4 20 10 false false false
-49 8 NullCount 23 4 21 10 false false false
-50 8 SearchType 1043 -1 22 20 true false false
-51 8 Format 1043 -1 23 255 false false false
-52 8 DefaultValue 1043 -1 24 255 false false false
-53 8 JavaClass 1043 -1 25 500 true false false
-54 8 Precision 23 4 26 10 true false false
-55 8 CharOctetLength 23 4 27 10 false false false
-56 8 Radix 23 4 28 10 true false false
-57 8 UID 1043 -1 29 50 true false false
-58 8 Description 1043 -1 30 255 false false false
-59 8 OID 23 4 31 10 true false false
-60 9 Name 1043 -1 1 100 true false false
-61 9 IsStandard 16 1 2 1 false false false
-62 9 IsPhysical 16 1 3 1 false false false
-63 9 TypeName 1043 -1 4 100 true false false
-64 9 JavaClass 1043 -1 5 500 true false false
-65 9 Scale 23 4 6 10 false false false
-66 9 TypeLength 23 4 7 10 true false false
-67 9 NullType 1043 -1 8 20 true false false
-68 9 IsSigned 16 1 9 1 true false false
-69 9 IsAutoIncremented 16 1 10 1 true false false
-70 9 IsCaseSensitive 16 1 11 1 true false false
-71 9 Precision 23 4 12 10 true false false
-72 9 Radix 23 4 13 10 false false false
-73 9 SearchType 1043 -1 14 20 true false false
-74 9 UID 1043 -1 15 50 true false false
-75 9 RuntimeType 1043 -1 16 64 false false false
-76 9 BaseType 1043 -1 17 64 false false false
-77 9 Description 1043 -1 18 255 false false false
-78 9 OID 23 4 19 10 true false false
-79 10 VDBName 1043 -1 1 255 true false false
-80 10 SchemaName 1043 -1 2 255 false false false
-81 10 TableName 1043 -1 3 2048 true false false
-82 10 Name 1043 -1 4 255 true false false
-83 10 KeyName 1043 -1 5 255 false false false
-84 10 KeyType 1043 -1 6 20 true false false
-85 10 RefKeyUID 1043 -1 7 50 false false false
-86 10 UID 1043 -1 8 50 true false false
-87 10 Position 23 4 9 10 false false false
-88 10 OID 23 4 10 10 true false false
-89 11 VDBName 1043 -1 1 255 true false false
-90 11 SchemaName 1043 -1 2 255 false false false
-91 11 TableName 1043 -1 3 2048 true false false
-92 11 Name 1043 -1 4 255 true false false
-93 11 Description 1043 -1 5 255 false false false
-94 11 NameInSource 1043 -1 6 255 false false false
-95 11 Type 1043 -1 7 20 true false false
-96 11 IsIndexed 16 1 8 1 true false false
-97 11 RefKeyUID 1043 -1 9 50 false false false
-98 11 UID 1043 -1 10 50 true false false
-99 11 OID 23 4 11 10 true false false
-100 12 VDBName 1043 -1 1 255 true false false
-101 12 SchemaName 1043 -1 2 255 false false false
-102 12 ProcedureName 1043 -1 3 255 true false false
-103 12 Name 1043 -1 4 255 true false false
-104 12 DataType 1043 -1 5 25 true false false
-105 12 Position 23 4 6 10 true false false
-106 12 Type 1043 -1 7 100 true false false
-107 12 Optional 16 1 8 1 true false false
-108 12 Precision 23 4 9 10 true false false
-109 12 TypeLength 23 4 10 10 true false false
-110 12 Scale 23 4 11 10 true false false
-111 12 Radix 23 4 12 10 true false false
-112 12 NullType 1043 -1 13 10 true false false
-113 12 UID 1043 -1 14 50 false false false
-114 12 Description 1043 -1 15 255 false false false
-115 12 OID 23 4 16 10 true false false
-116 13 VDBName 1043 -1 1 255 true false false
-117 13 SchemaName 1043 -1 2 255 false false false
-118 13 Name 1043 -1 3 255 true false false
-119 13 NameInSource 1043 -1 4 255 false false false
-120 13 ReturnsResults 16 1 5 1 true false false
-121 13 UID 1043 -1 6 50 true false false
-122 13 Description 1043 -1 7 255 false false false
-123 13 OID 23 4 8 10 true false false
-124 14 Name 1043 -1 1 255 true false false
-125 14 Value 1043 -1 2 255 true false false
-126 14 UID 1043 -1 3 50 true false false
-127 14 OID 23 4 4 10 true false false
-128 14 ClobValue 14939 -1 5 2097152 false false false
-129 15 PKTABLE_CAT 1043 -1 1 255 false false false
-130 15 PKTABLE_SCHEM 1043 -1 2 255 false false false
-131 15 PKTABLE_NAME 1043 -1 3 255 false false false
-132 15 PKCOLUMN_NAME 1043 -1 4 255 false false false
-133 15 FKTABLE_CAT 1043 -1 5 255 false false false
-134 15 FKTABLE_SCHEM 1043 -1 6 255 false false false
-135 15 FKTABLE_NAME 1043 -1 7 255 false false false
-136 15 FKCOLUMN_NAME 1043 -1 8 255 false false false
-137 15 KEY_SEQ 21 2 9 5 false false false
-138 15 UPDATE_RULE 23 4 10 10 false false false
-139 15 DELETE_RULE 23 4 11 10 false false false
-140 15 FK_NAME 1043 -1 12 255 false false false
-141 15 PK_NAME 1043 -1 13 255 false false false
-142 15 DEFERRABILITY 23 4 14 10 false false false
-143 16 VDBName 1043 -1 1 255 false false false
-144 16 Name 1043 -1 2 255 false false false
-145 16 IsPhysical 16 1 3 1 true false false
-146 16 UID 1043 -1 4 50 true false false
-147 16 Description 1043 -1 5 255 false false false
-148 16 PrimaryMetamodelURI 1043 -1 6 255 true false false
-149 16 OID 23 4 7 10 true false false
-150 17 VDBName 1043 -1 1 255 false false false
-151 17 SchemaName 1043 -1 2 255 false false false
-152 17 Name 1043 -1 3 255 true false false
-153 17 Type 1043 -1 4 20 true false false
-154 17 NameInSource 1043 -1 5 255 false false false
-155 17 IsPhysical 16 1 6 1 true false false
-156 17 SupportsUpdates 16 1 7 1 true false false
-157 17 UID 1043 -1 8 50 true false false
-158 17 Cardinality 23 4 9 10 true false false
-159 17 Description 1043 -1 10 255 false false false
-160 17 IsSystem 16 1 11 1 false false false
-161 17 IsMaterialized 16 1 12 0 true false false
-162 17 OID 23 4 13 10 true false false
-163 18 Name 1043 -1 1 255 true false false
-164 18 Version 1043 -1 2 50 true false false
-165 19 oid 23 4 1 0 false false false
-166 19 nspname 1043 -1 2 0 false false false
-167 20 oid 23 4 1 0 false false false
-168 20 relname 1043 -1 2 0 false false false
-169 20 relnamespace 23 4 3 0 false false false
-170 20 relkind 1042 1 4 0 false false false
-171 20 relam 23 4 5 0 false false false
-172 20 reltuples 700 4 6 0 false false false
-173 20 relpages 23 4 7 0 false false false
-174 20 relhasrules 16 1 8 0 false false false
-175 20 relhasoids 16 1 9 0 false false false
-176 21 oid 23 4 1 0 false false false
-177 21 attrelid 23 4 2 0 false false false
-178 21 attname 1043 -1 3 0 false false false
-179 21 atttypid 23 4 4 0 false false false
-180 21 attlen 21 2 5 0 false false false
-181 21 attnum 21 2 6 0 false false false
-182 21 atttypmod 23 4 7 0 false false false
-183 21 attnotnull 16 1 8 0 false false false
-184 21 attisdropped 16 1 9 0 false false false
-185 21 atthasdef 16 1 10 0 false false false
-186 22 oid 23 4 1 0 false false false
-187 22 typname 1043 -1 2 0 false false false
-188 22 typnamespace 23 4 3 0 false false false
-189 22 typlen 21 2 4 0 false false false
-190 22 typtype 1042 1 5 0 false false false
-191 22 typbasetype 23 4 6 0 false false false
-192 22 typtypmod 23 4 7 0 false false false
-193 22 typrelid 23 4 8 0 false false false
-194 22 typelem 23 4 9 0 false false false
-195 23 oid 23 4 1 0 false false false
-196 23 indexrelid 23 4 2 0 false false false
-197 23 indrelid 23 4 3 0 false false false
-198 23 indisclustered 16 1 4 0 false false false
-199 23 indisunique 16 1 5 0 false false false
-200 23 indisprimary 16 1 6 0 false false false
-201 23 indexprs 1043 -1 7 0 false false false
-202 23 indkey 1043 -1 8 0 false false false
-203 24 oid 23 4 1 0 false false false
-204 24 amname 1043 -1 2 0 false false false
-205 25 oid 23 4 1 0 false false false
-206 25 proname 1043 -1 2 0 false false false
-207 25 proretset 16 1 3 0 false false false
-208 25 prorettype 23 4 4 0 false false false
-209 25 pronargs 21 2 5 0 false false false
-210 25 proargtypes <null> <null> 6 0 false false false
-211 25 proargnames <null> <null> 7 0 false false false
-212 25 proargmodes <null> <null> 8 0 false false false
-213 25 proallargtypes <null> <null> 9 0 false false false
-214 25 pronamespace 23 4 10 0 false false false
-215 26 oid 23 4 1 0 false false false
-216 26 tgconstrrelid 23 4 2 0 false false false
-217 26 tgfoid 23 4 3 0 false false false
-218 26 tgargs 23 4 4 0 false false false
-219 26 tgnargs 23 4 5 0 false false false
-220 26 tgdeferrable 16 1 6 0 false false false
-221 26 tginitdeferred 16 1 7 0 false false false
-222 26 tgconstrname 1043 -1 8 0 false false false
-223 26 tgrelid 23 4 9 0 false false false
-224 27 adrelid 23 4 1 0 false false false
-225 27 adnum 23 4 2 0 false false false
-226 27 adbin 1043 -1 3 0 false false false
-227 27 adsrc 1043 -1 4 0 false false false
-228 28 oid 23 4 1 0 false false false
-229 28 datname 1043 -1 2 0 false false false
-230 28 encoding 23 4 3 0 false false false
-231 28 datlastsysoid 23 4 4 0 false false false
-232 28 datallowconn 1042 1 5 0 false false false
-233 28 datconfig <null> <null> 6 0 false false false
-234 28 datacl <null> <null> 7 0 false false false
-235 28 datdba 23 4 8 0 false false false
-236 28 dattablespace 23 4 9 0 false false false
-237 29 oid 23 4 1 0 false false false
-238 29 usename 1043 -1 2 0 false false false
-239 29 usecreatedb 16 1 3 0 false false false
-240 29 usesuper 16 1 4 0 false false false
-241 30 attrelid 23 4 1 0 false false false
-242 30 attnum 21 2 2 0 false false false
-243 30 attname 1043 -1 3 0 false false false
-244 30 relname 1043 -1 4 0 false false false
-245 30 nspname 1043 -1 5 0 false false false
-246 30 autoinc 16 1 6 0 false false false
-247 30 typoid 23 4 7 0 false false false
-248 31 oid 23 4 1 0 false false false
-249 31 typname 1043 -1 2 0 false false false
-250 31 name 1043 -1 3 0 false false false
-251 31 uid 1043 -1 4 0 false false false
-252 31 typlen 21 2 5 0 false false false
+1 1 PART_ID 1043 -1 1 8 true false false
+2 1 PART_NAME 1043 -1 2 259 false false false
+3 1 PART_COLOR 1043 -1 3 34 false false false
+4 1 PART_WEIGHT 1043 -1 4 259 false false false
+5 2 SHIPPER_ID 21 2 1 4 true false false
+6 2 SHIPPER_NAME 1043 -1 2 34 false false false
+7 3 STATUS_ID 21 2 1 4 true false false
+8 3 STATUS_NAME 1043 -1 2 34 false false false
+9 4 SUPPLIER_ID 1043 -1 1 14 true false false
+10 4 PART_ID 1043 -1 2 8 true false false
+11 4 QUANTITY 21 2 3 4 false false false
+12 4 SHIPPER_ID 21 2 4 4 false false false
+13 5 SUPPLIER_ID 1043 -1 1 14 true false false
+14 5 SUPPLIER_NAME 1043 -1 2 34 false false false
+15 5 SUPPLIER_STATUS 21 2 3 4 false false false
+16 5 SUPPLIER_CITY 1043 -1 4 34 false false false
+17 5 SUPPLIER_STATE 1043 -1 5 6 false false false
+18 6 VDBName 1043 -1 1 259 true false false
+19 6 SchemaName 1043 -1 2 259 true false false
+20 6 Name 1043 -1 3 259 true false false
+21 6 TargetSchemaName 1043 -1 4 259 false false false
+22 6 TargetName 1043 -1 5 4004 false false false
+23 6 Valid 16 1 6 4 false false false
+24 6 LoadState 1043 -1 7 259 false false false
+25 6 Updated 1114 8 8 4 false false false
+26 6 Cardinality 23 4 9 14 false false false
+27 7 resourcePath 1043 -1 1 259 false false false
+28 7 contents 14939 -1 2 4 false false false
+29 8 VDBName 1043 -1 1 259 true false false
+30 8 SchemaName 1043 -1 2 259 false false false
+31 8 TableName 1043 -1 3 259 true false false
+32 8 Name 1043 -1 4 259 true false false
+33 8 Position 23 4 5 14 true false false
+34 8 NameInSource 1043 -1 6 259 false false false
+35 8 DataType 1043 -1 7 104 true false false
+36 8 Scale 23 4 8 14 true false false
+37 8 Length 23 4 9 14 true false false
+38 8 IsLengthFixed 16 1 10 5 true false false
+39 8 SupportsSelect 16 1 11 5 true false false
+40 8 SupportsUpdates 16 1 12 5 true false false
+41 8 IsCaseSensitive 16 1 13 5 true false false
+42 8 IsSigned 16 1 14 5 true false false
+43 8 IsCurrency 16 1 15 5 true false false
+44 8 IsAutoIncremented 16 1 16 5 true false false
+45 8 NullType 1043 -1 17 24 true false false
+46 8 MinRange 1043 -1 18 54 false false false
+47 8 MaxRange 1043 -1 19 54 false false false
+48 8 DistinctCount 23 4 20 14 false false false
+49 8 NullCount 23 4 21 14 false false false
+50 8 SearchType 1043 -1 22 24 true false false
+51 8 Format 1043 -1 23 259 false false false
+52 8 DefaultValue 1043 -1 24 259 false false false
+53 8 JavaClass 1043 -1 25 504 true false false
+54 8 Precision 23 4 26 14 true false false
+55 8 CharOctetLength 23 4 27 14 false false false
+56 8 Radix 23 4 28 14 true false false
+57 8 UID 1043 -1 29 54 true false false
+58 8 Description 1043 -1 30 259 false false false
+59 8 OID 23 4 31 14 true false false
+60 9 Name 1043 -1 1 104 true false false
+61 9 IsStandard 16 1 2 5 false false false
+62 9 IsPhysical 16 1 3 5 false false false
+63 9 TypeName 1043 -1 4 104 true false false
+64 9 JavaClass 1043 -1 5 504 true false false
+65 9 Scale 23 4 6 14 false false false
+66 9 TypeLength 23 4 7 14 true false false
+67 9 NullType 1043 -1 8 24 true false false
+68 9 IsSigned 16 1 9 5 true false false
+69 9 IsAutoIncremented 16 1 10 5 true false false
+70 9 IsCaseSensitive 16 1 11 5 true false false
+71 9 Precision 23 4 12 14 true false false
+72 9 Radix 23 4 13 14 false false false
+73 9 SearchType 1043 -1 14 24 true false false
+74 9 UID 1043 -1 15 54 true false false
+75 9 RuntimeType 1043 -1 16 68 false false false
+76 9 BaseType 1043 -1 17 68 false false false
+77 9 Description 1043 -1 18 259 false false false
+78 9 OID 23 4 19 14 true false false
+79 10 VDBName 1043 -1 1 259 true false false
+80 10 SchemaName 1043 -1 2 259 false false false
+81 10 TableName 1043 -1 3 2052 true false false
+82 10 Name 1043 -1 4 259 true false false
+83 10 KeyName 1043 -1 5 259 false false false
+84 10 KeyType 1043 -1 6 24 true false false
+85 10 RefKeyUID 1043 -1 7 54 false false false
+86 10 UID 1043 -1 8 54 true false false
+87 10 Position 23 4 9 14 false false false
+88 10 OID 23 4 10 14 true false false
+89 11 VDBName 1043 -1 1 259 true false false
+90 11 SchemaName 1043 -1 2 259 false false false
+91 11 TableName 1043 -1 3 2052 true false false
+92 11 Name 1043 -1 4 259 true false false
+93 11 Description 1043 -1 5 259 false false false
+94 11 NameInSource 1043 -1 6 259 false false false
+95 11 Type 1043 -1 7 24 true false false
+96 11 IsIndexed 16 1 8 5 true false false
+97 11 RefKeyUID 1043 -1 9 54 false false false
+98 11 UID 1043 -1 10 54 true false false
+99 11 OID 23 4 11 14 true false false
+100 12 VDBName 1043 -1 1 259 true false false
+101 12 SchemaName 1043 -1 2 259 false false false
+102 12 ProcedureName 1043 -1 3 259 true false false
+103 12 Name 1043 -1 4 259 true false false
+104 12 DataType 1043 -1 5 29 true false false
+105 12 Position 23 4 6 14 true false false
+106 12 Type 1043 -1 7 104 true false false
+107 12 Optional 16 1 8 5 true false false
+108 12 Precision 23 4 9 14 true false false
+109 12 TypeLength 23 4 10 14 true false false
+110 12 Scale 23 4 11 14 true false false
+111 12 Radix 23 4 12 14 true false false
+112 12 NullType 1043 -1 13 14 true false false
+113 12 UID 1043 -1 14 54 false false false
+114 12 Description 1043 -1 15 259 false false false
+115 12 OID 23 4 16 14 true false false
+116 13 VDBName 1043 -1 1 259 true false false
+117 13 SchemaName 1043 -1 2 259 false false false
+118 13 Name 1043 -1 3 259 true false false
+119 13 NameInSource 1043 -1 4 259 false false false
+120 13 ReturnsResults 16 1 5 5 true false false
+121 13 UID 1043 -1 6 54 true false false
+122 13 Description 1043 -1 7 259 false false false
+123 13 OID 23 4 8 14 true false false
+124 14 Name 1043 -1 1 259 true false false
+125 14 Value 1043 -1 2 259 true false false
+126 14 UID 1043 -1 3 54 true false false
+127 14 OID 23 4 4 14 true false false
+128 14 ClobValue 14939 -1 5 2097156 false false false
+129 15 PKTABLE_CAT 1043 -1 1 259 false false false
+130 15 PKTABLE_SCHEM 1043 -1 2 259 false false false
+131 15 PKTABLE_NAME 1043 -1 3 259 false false false
+132 15 PKCOLUMN_NAME 1043 -1 4 259 false false false
+133 15 FKTABLE_CAT 1043 -1 5 259 false false false
+134 15 FKTABLE_SCHEM 1043 -1 6 259 false false false
+135 15 FKTABLE_NAME 1043 -1 7 259 false false false
+136 15 FKCOLUMN_NAME 1043 -1 8 259 false false false
+137 15 KEY_SEQ 21 2 9 9 false false false
+138 15 UPDATE_RULE 23 4 10 14 false false false
+139 15 DELETE_RULE 23 4 11 14 false false false
+140 15 FK_NAME 1043 -1 12 259 false false false
+141 15 PK_NAME 1043 -1 13 259 false false false
+142 15 DEFERRABILITY 23 4 14 14 false false false
+143 16 VDBName 1043 -1 1 259 false false false
+144 16 Name 1043 -1 2 259 false false false
+145 16 IsPhysical 16 1 3 5 true false false
+146 16 UID 1043 -1 4 54 true false false
+147 16 Description 1043 -1 5 259 false false false
+148 16 PrimaryMetamodelURI 1043 -1 6 259 true false false
+149 16 OID 23 4 7 14 true false false
+150 17 VDBName 1043 -1 1 259 false false false
+151 17 SchemaName 1043 -1 2 259 false false false
+152 17 Name 1043 -1 3 259 true false false
+153 17 Type 1043 -1 4 24 true false false
+154 17 NameInSource 1043 -1 5 259 false false false
+155 17 IsPhysical 16 1 6 5 true false false
+156 17 SupportsUpdates 16 1 7 5 true false false
+157 17 UID 1043 -1 8 54 true false false
+158 17 Cardinality 23 4 9 14 true false false
+159 17 Description 1043 -1 10 259 false false false
+160 17 IsSystem 16 1 11 5 false false false
+161 17 IsMaterialized 16 1 12 4 true false false
+162 17 OID 23 4 13 14 true false false
+163 18 Name 1043 -1 1 259 true false false
+164 18 Version 1043 -1 2 54 true false false
+165 19 oid 23 4 1 4 false false false
+166 19 nspname 1043 -1 2 4 false false false
+167 20 oid 23 4 1 4 false false false
+168 20 relname 1043 -1 2 4 false false false
+169 20 relnamespace 23 4 3 4 false false false
+170 20 relkind 1042 1 4 4 false false false
+171 20 relam 23 4 5 4 false false false
+172 20 reltuples 700 4 6 4 false false false
+173 20 relpages 23 4 7 4 false false false
+174 20 relhasrules 16 1 8 4 false false false
+175 20 relhasoids 16 1 9 4 false false false
+176 21 oid 23 4 1 4 false false false
+177 21 attrelid 23 4 2 4 false false false
+178 21 attname 1043 -1 3 4 false false false
+179 21 atttypid 23 4 4 4 false false false
+180 21 attlen 21 2 5 4 false false false
+181 21 attnum 21 2 6 4 false false false
+182 21 atttypmod 23 4 7 4 false false false
+183 21 attnotnull 16 1 8 4 false false false
+184 21 attisdropped 16 1 9 4 false false false
+185 21 atthasdef 16 1 10 4 false false false
+186 22 oid 23 4 1 4 false false false
+187 22 typname 1043 -1 2 4 false false false
+188 22 typnamespace 23 4 3 4 false false false
+189 22 typlen 21 2 4 4 false false false
+190 22 typtype 1042 1 5 4 false false false
+191 22 typbasetype 23 4 6 4 false false false
+192 22 typtypmod 23 4 7 4 false false false
+193 22 typrelid 23 4 8 4 false false false
+194 22 typelem 23 4 9 4 false false false
+195 23 oid 23 4 1 4 false false false
+196 23 indexrelid 23 4 2 4 false false false
+197 23 indrelid 23 4 3 4 false false false
+198 23 indisclustered 16 1 4 4 false false false
+199 23 indisunique 16 1 5 4 false false false
+200 23 indisprimary 16 1 6 4 false false false
+201 23 indexprs 1043 -1 7 4 false false false
+202 23 indkey 1043 -1 8 4 false false false
+203 24 oid 23 4 1 4 false false false
+204 24 amname 1043 -1 2 4 false false false
+205 25 oid 23 4 1 4 false false false
+206 25 proname 1043 -1 2 4 false false false
+207 25 proretset 16 1 3 4 false false false
+208 25 prorettype 23 4 4 4 false false false
+209 25 pronargs 21 2 5 4 false false false
+210 25 proargtypes <null> <null> 6 4 false false false
+211 25 proargnames <null> <null> 7 4 false false false
+212 25 proargmodes <null> <null> 8 4 false false false
+213 25 proallargtypes <null> <null> 9 4 false false false
+214 25 pronamespace 23 4 10 4 false false false
+215 26 oid 23 4 1 4 false false false
+216 26 tgconstrrelid 23 4 2 4 false false false
+217 26 tgfoid 23 4 3 4 false false false
+218 26 tgargs 23 4 4 4 false false false
+219 26 tgnargs 23 4 5 4 false false false
+220 26 tgdeferrable 16 1 6 4 false false false
+221 26 tginitdeferred 16 1 7 4 false false false
+222 26 tgconstrname 1043 -1 8 4 false false false
+223 26 tgrelid 23 4 9 4 false false false
+224 27 adrelid 23 4 1 4 false false false
+225 27 adnum 23 4 2 4 false false false
+226 27 adbin 1043 -1 3 4 false false false
+227 27 adsrc 1043 -1 4 4 false false false
+228 28 oid 23 4 1 4 false false false
+229 28 datname 1043 -1 2 4 false false false
+230 28 encoding 23 4 3 4 false false false
+231 28 datlastsysoid 23 4 4 4 false false false
+232 28 datallowconn 1042 1 5 4 false false false
+233 28 datconfig <null> <null> 6 4 false false false
+234 28 datacl <null> <null> 7 4 false false false
+235 28 datdba 23 4 8 4 false false false
+236 28 dattablespace 23 4 9 4 false false false
+237 29 oid 23 4 1 4 false false false
+238 29 usename 1043 -1 2 4 false false false
+239 29 usecreatedb 16 1 3 4 false false false
+240 29 usesuper 16 1 4 4 false false false
+241 30 attrelid 23 4 1 4 false false false
+242 30 attnum 21 2 2 4 false false false
+243 30 attname 1043 -1 3 4 false false false
+244 30 relname 1043 -1 4 4 false false false
+245 30 nspname 1043 -1 5 4 false false false
+246 30 autoinc 16 1 6 4 false false false
+247 30 typoid 23 4 7 4 false false false
+248 31 oid 23 4 1 4 false false false
+249 31 typname 1043 -1 2 4 false false false
+250 31 name 1043 -1 3 4 false false false
+251 31 uid 1043 -1 4 4 false false false
+252 31 typlen 21 2 5 4 false false false
Row Count : 252
getColumnName getColumnType getCatalogName getColumnClassName getColumnLabel getColumnTypeName getSchemaName getTableName getColumnDisplaySize getPrecision getScale isAutoIncrement isCaseSensitive isCurrency isDefinitelyWritable isNullable isReadOnly isSearchable isSigned isWritable
oid 4 PartsSupplier java.lang.Integer oid integer pg_catalog pg_attribute 11 10 0 false false false false 2 true true false false
13 years, 6 months
teiid SVN: r3252 - in trunk/metadata/src/test: resources and 1 other directories.
by teiid-commits@lists.jboss.org
Author: van.halbert
Date: 2011-06-16 11:20:10 -0400 (Thu, 16 Jun 2011)
New Revision: 3252
Added:
trunk/metadata/src/test/resources/other/
trunk/metadata/src/test/resources/other/test.vdb
Removed:
trunk/metadata/src/test/resources/test.vdb
Modified:
trunk/metadata/src/test/java/org/teiid/metadata/index/TestStagingTable.java
Log:
TEIID 1639 moved the test.vdb to the other directory to solve the case-sensitivity issue
Modified: trunk/metadata/src/test/java/org/teiid/metadata/index/TestStagingTable.java
===================================================================
--- trunk/metadata/src/test/java/org/teiid/metadata/index/TestStagingTable.java 2011-06-16 15:12:56 UTC (rev 3251)
+++ trunk/metadata/src/test/java/org/teiid/metadata/index/TestStagingTable.java 2011-06-16 15:20:10 UTC (rev 3252)
@@ -32,7 +32,7 @@
public class TestStagingTable {
@Test public void testStagingTables() throws Exception {
- TransformationMetadata tm = VDBMetadataFactory.getVDBMetadata(UnitTestUtil.getTestDataPath() + "/test.vdb");
+ TransformationMetadata tm = VDBMetadataFactory.getVDBMetadata(UnitTestUtil.getTestDataPath() + "/other/test.vdb");
assertEquals(1, tm.getXMLTempGroups(tm.getGroupID("doc.newxmldocument")).size());
}
Added: trunk/metadata/src/test/resources/other/test.vdb
===================================================================
(Binary files differ)
Property changes on: trunk/metadata/src/test/resources/other/test.vdb
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Deleted: trunk/metadata/src/test/resources/test.vdb
===================================================================
(Binary files differ)
13 years, 6 months
teiid SVN: r3251 - in branches/7.4.x/metadata/src/test: resources and 1 other directories.
by teiid-commits@lists.jboss.org
Author: van.halbert
Date: 2011-06-16 11:12:56 -0400 (Thu, 16 Jun 2011)
New Revision: 3251
Added:
branches/7.4.x/metadata/src/test/resources/other/
branches/7.4.x/metadata/src/test/resources/other/test.vdb
Removed:
branches/7.4.x/metadata/src/test/resources/test.vdb
Modified:
branches/7.4.x/metadata/src/test/java/org/teiid/metadata/index/TestStagingTable.java
Log:
TEIID 1639 moved the test.vdb to the other directory to solve the case-sensitivity issue
Modified: branches/7.4.x/metadata/src/test/java/org/teiid/metadata/index/TestStagingTable.java
===================================================================
--- branches/7.4.x/metadata/src/test/java/org/teiid/metadata/index/TestStagingTable.java 2011-06-16 15:01:12 UTC (rev 3250)
+++ branches/7.4.x/metadata/src/test/java/org/teiid/metadata/index/TestStagingTable.java 2011-06-16 15:12:56 UTC (rev 3251)
@@ -32,7 +32,7 @@
public class TestStagingTable {
@Test public void testStagingTables() throws Exception {
- TransformationMetadata tm = VDBMetadataFactory.getVDBMetadata(UnitTestUtil.getTestDataPath() + "/test.vdb");
+ TransformationMetadata tm = VDBMetadataFactory.getVDBMetadata(UnitTestUtil.getTestDataPath() + "/other/test.vdb");
assertEquals(1, tm.getXMLTempGroups(tm.getGroupID("doc.newxmldocument")).size());
}
Added: branches/7.4.x/metadata/src/test/resources/other/test.vdb
===================================================================
(Binary files differ)
Property changes on: branches/7.4.x/metadata/src/test/resources/other/test.vdb
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Deleted: branches/7.4.x/metadata/src/test/resources/test.vdb
===================================================================
(Binary files differ)
13 years, 6 months
teiid SVN: r3249 - in branches/7.4.x: documentation/reference/src/main/docbook/en-US/content and 11 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2011-06-13 13:35:41 -0400 (Mon, 13 Jun 2011)
New Revision: 3249
Added:
branches/7.4.x/metadata/DATATYPES.INDEX
Modified:
branches/7.4.x/build/kits/jboss-container/teiid-releasenotes.html
branches/7.4.x/documentation/reference/src/main/docbook/en-US/content/system_schema.xml
branches/7.4.x/engine/src/main/java/org/teiid/dqp/internal/process/DataTierManagerImpl.java
branches/7.4.x/engine/src/main/resources/org/teiid/query/i18n.properties
branches/7.4.x/engine/src/test/java/org/teiid/query/unittest/RealMetadataFactory.java
branches/7.4.x/metadata/src/main/resources/System.vdb
branches/7.4.x/test-integration/common/src/test/java/org/teiid/jdbc/AbstractMMQueryTestCase.java
branches/7.4.x/test-integration/common/src/test/java/org/teiid/jdbc/AbstractQueryTest.java
branches/7.4.x/test-integration/common/src/test/java/org/teiid/jdbc/TestVDBMerge.java
branches/7.4.x/test-integration/common/src/test/java/org/teiid/systemmodel/TestMetadataUpdates.java
branches/7.4.x/test-integration/common/src/test/java/org/teiid/systemmodel/TestSystemVirtualModel.java
branches/7.4.x/test-integration/common/src/test/java/org/teiid/systemmodel/TestVirtualDocWithVirtualProc.java
branches/7.4.x/test-integration/common/src/test/resources/TestMMDatabaseMetaData/testGetProcedureColumns.expected
branches/7.4.x/test-integration/common/src/test/resources/TestMMDatabaseMetaData/testGetProcedures.expected
branches/7.4.x/test-integration/common/src/test/resources/TestMMDatabaseMetaData/testGetProceduresWithEscape.expected
branches/7.4.x/test-integration/common/src/test/resources/TestPartsDatabaseMetadata/testProcedureColumns.expected
branches/7.4.x/test-integration/common/src/test/resources/TestPartsDatabaseMetadata/testProcedures.expected
branches/7.4.x/test-integration/common/src/test/resources/TestSystemVirtualModel/testProcedureParams.expected
branches/7.4.x/test-integration/common/src/test/resources/TestSystemVirtualModel/testProcedures.expected
branches/7.4.x/test-integration/db/src/test/java/org/teiid/dynamicvdb/TestVDBLessExecution.java
Log:
TEIID-1632 added system procedures for logging
Modified: branches/7.4.x/build/kits/jboss-container/teiid-releasenotes.html
===================================================================
--- branches/7.4.x/build/kits/jboss-container/teiid-releasenotes.html 2011-06-13 17:03:50 UTC (rev 3248)
+++ branches/7.4.x/build/kits/jboss-container/teiid-releasenotes.html 2011-06-13 17:35:41 UTC (rev 3249)
@@ -60,7 +60,8 @@
<LI><B>ODBC SSL</B> - added support for SSL encrypted ODBC connections.
<LI><B>Reauthentication Statement</B> - SET SESSION AUTHORIZATION can now be used to perform a reauthentication via JDBC or ODBC.
<LI><B>Pluggable Authorization</B> - an alternative PolicyDecider can be defined in the teiid-jboss-beans.xml file to customize authorization decisions.
- <LI><B>Streaming XQuery</B> - in situations where document projection applies if the XMLQUERY/XMLTABLE path expressions meet certian conditions, then the incoming document will not only be projected, but the independent subtrees will be processed without loading the entire document. This allows for nearly arbitrarily large XML documents to be processed. See the Reference for more.
+ <LI><B>Streaming XQuery</B> - in situations where document projection applies if the XMLQUERY/XMLTABLE path expressions meet certain conditions, then the incoming document will not only be projected, but the independent subtrees will be processed without loading the entire document. This allows for nearly arbitrarily large XML documents to be processed. See the Reference for more.
+ <LI><B>Logging Procedures</B> - added SYSADMIN.isLoggable and SYSADMIN.logMsg to aid in debugging procedure logic.
</UL>
<h2><a name="Compatibility">Compatibility Issues</a></h2>
Modified: branches/7.4.x/documentation/reference/src/main/docbook/en-US/content/system_schema.xml
===================================================================
--- branches/7.4.x/documentation/reference/src/main/docbook/en-US/content/system_schema.xml 2011-06-13 17:03:50 UTC (rev 3248)
+++ branches/7.4.x/documentation/reference/src/main/docbook/en-US/content/system_schema.xml 2011-06-13 17:35:41 UTC (rev 3249)
@@ -1807,6 +1807,32 @@
<para><synopsis>SYS.getXMLSchemas(document in string) returns schema string</synopsis></para>
</section>
<section>
+ <title>SYSADMIN.logMsg</title>
+ <para>Log a message to the underlying logging system.</para>
+ <para><synopsis>SYSADMIN.logMsg(logged RETURN boolean, level IN string, context IN string, msg IN object)</synopsis></para>
+ <para>Returns true if the message was logged. level can be one of the log4j levels: OFF, FATAL, ERROR, WARN, INFO, DEBUG, TRACE. level defaults to 'DEBUG' and context defaults to 'org.teiid.PROCESSOR'</para>
+ <example lang="sql">
+ <title>Example logMsg</title>
+ <programlisting>CALL SYSADMIN.logMsg(msg=>'some debug', context=>'org.something')</programlisting>
+ <para>This will log the message 'some debug' at the default level DEBUG to the context org.something.</para>
+ </example>
+ </section>
+ <section>
+ <title>SYSADMIN.isLoggable</title>
+ <para>Tests if logging is enabled at the given level and context.</para>
+ <para><synopsis>SYSADMIN.isLoggable(loggable RETURN boolean, level IN string, context IN string)</synopsis></para>
+ <para>Returns true if logging is enabled. level can be one of the log4j levels: OFF, FATAL, ERROR, WARN, INFO, DEBUG, TRACE. level defaults to 'DEBUG' and context defaults to 'org.teiid.PROCESSOR'</para>
+ <example lang="sql">
+ <title>Example isLoggable</title>
+ <programlisting>IF ((CALL SYSADMIN.isLoggable(context=>'org.something'))
+BEGIN
+ DECLARE STRING msg;
+ // logic to build the message ...
+ CALL SYSADMIN.logMsg(msg=>msg, context=>'org.something')
+END</programlisting>
+ </example>
+ </section>
+ <section>
<title>SYSADMIN.refreshMatView</title>
<para>Returns integer RowsUpdated. -1 indicates a load is in progress, otherwise the cardinality of the table is returned. See the Caching Guide for more.</para>
<para><synopsis>SYSADMIN.refreshMatView(RowsUpdated return integer, ViewName in string, Invalidate in boolean)</synopsis></para>
Modified: branches/7.4.x/engine/src/main/java/org/teiid/dqp/internal/process/DataTierManagerImpl.java
===================================================================
--- branches/7.4.x/engine/src/main/java/org/teiid/dqp/internal/process/DataTierManagerImpl.java 2011-06-13 17:03:50 UTC (rev 3248)
+++ branches/7.4.x/engine/src/main/java/org/teiid/dqp/internal/process/DataTierManagerImpl.java 2011-06-13 17:35:41 UTC (rev 3249)
@@ -33,6 +33,7 @@
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
+import java.util.TreeMap;
import javax.sql.rowset.serial.SerialClob;
@@ -60,6 +61,8 @@
import org.teiid.dqp.message.RequestID;
import org.teiid.dqp.service.BufferService;
import org.teiid.events.EventDistributor;
+import org.teiid.logging.LogManager;
+import org.teiid.logging.MessageLevel;
import org.teiid.metadata.AbstractMetadataRecord;
import org.teiid.metadata.Column;
import org.teiid.metadata.ColumnStats;
@@ -120,13 +123,34 @@
private enum SystemAdminProcs {
SETTABLESTATS,
SETCOLUMNSTATS,
- SETPROPERTY
+ SETPROPERTY,
+ LOGMSG,
+ ISLOGGABLE
}
private enum SystemProcs {
GETXMLSCHEMAS
}
+ private static final TreeMap<String, Integer> levelMap = new TreeMap<String, Integer>(String.CASE_INSENSITIVE_ORDER);
+ static {
+ levelMap.put("OFF", MessageLevel.NONE); //$NON-NLS-1$
+ levelMap.put("FATAL", MessageLevel.CRITICAL); //$NON-NLS-1$
+ levelMap.put("ERROR", MessageLevel.ERROR); //$NON-NLS-1$
+ levelMap.put("WARN", MessageLevel.WARNING); //$NON-NLS-1$
+ levelMap.put("INFO", MessageLevel.INFO); //$NON-NLS-1$
+ levelMap.put("DEBUG", MessageLevel.DETAIL); //$NON-NLS-1$
+ levelMap.put("TRACE", MessageLevel.TRACE); //$NON-NLS-1$
+ }
+
+ public static int getLevel(String level) throws TeiidProcessingException {
+ Integer intLevel = levelMap.get(level);
+ if (intLevel == null) {
+ throw new TeiidProcessingException(QueryPlugin.Util.getString("FunctionMethods.unknown_level", level, levelMap.keySet())); //$NON-NLS-1$
+ }
+ return intLevel;
+ }
+
// Resources
private DQPCore requestMgr;
private BufferService bufferService;
@@ -361,6 +385,26 @@
if (StringUtil.startsWithIgnoreCase(proc.getProcedureCallableName(), CoreConstants.SYSTEM_ADMIN_MODEL)) {
final SystemAdminProcs sysProc = SystemAdminProcs.valueOf(proc.getProcedureCallableName().substring(CoreConstants.SYSTEM_ADMIN_MODEL.length() + 1).toUpperCase());
switch (sysProc) {
+ case LOGMSG:
+ case ISLOGGABLE:
+ String level = (String)((Constant)proc.getParameter(2).getExpression()).getValue();
+ String logContext = (String)((Constant)proc.getParameter(3).getExpression()).getValue();
+ Object message = null;
+ if (sysProc == SystemAdminProcs.LOGMSG) {
+ message = ((Constant)proc.getParameter(4).getExpression()).getValue();
+ }
+ int msgLevel = getLevel(level);
+ boolean logged = false;
+ if (LogManager.isMessageToBeRecorded(logContext, msgLevel)) {
+ if (message != null) {
+ LogManager.log(msgLevel, logContext, message);
+ }
+ logged = true;
+ }
+ if (proc.returnParameters()) {
+ rows.add(Arrays.asList(logged));
+ }
+ return new CollectionTupleSource(rows.iterator());
case SETPROPERTY:
try {
String uuid = (String)((Constant)proc.getParameter(2).getExpression()).getValue();
@@ -385,10 +429,12 @@
if (eventDistributor != null) {
eventDistributor.setProperty(vdbName, vdbVersion, uuid, key, strVal);
}
- if (result == null) {
- rows.add(Arrays.asList((Clob)null));
- } else {
- rows.add(Arrays.asList(new ClobType(new SerialClob(result.toCharArray()))));
+ if (proc.returnParameters()) {
+ if (result == null) {
+ rows.add(Arrays.asList((Clob)null));
+ } else {
+ rows.add(Arrays.asList(new ClobType(new SerialClob(result.toCharArray()))));
+ }
}
return new CollectionTupleSource(rows.iterator());
} catch (SQLException e) {
Modified: branches/7.4.x/engine/src/main/resources/org/teiid/query/i18n.properties
===================================================================
--- branches/7.4.x/engine/src/main/resources/org/teiid/query/i18n.properties 2011-06-13 17:03:50 UTC (rev 3248)
+++ branches/7.4.x/engine/src/main/resources/org/teiid/query/i18n.properties 2011-06-13 17:35:41 UTC (rev 3249)
@@ -913,6 +913,7 @@
MultiSource.out_procedure=The multisource plan must execute a procedure returning parameter values exactly 1: {0}
FunctionMethods.not_array_value=Expected a java.sql.Array, or java array type, but got: {0}
+FunctionMethods.unknown_level=Unknown log level: {0}, expected one of {1}
FunctionMethods.array_index=Array index out of range: {0}
ArrayTableNode.conversion_error=Could not convert value for column: {0}
Modified: branches/7.4.x/engine/src/test/java/org/teiid/query/unittest/RealMetadataFactory.java
===================================================================
--- branches/7.4.x/engine/src/test/java/org/teiid/query/unittest/RealMetadataFactory.java 2011-06-13 17:03:50 UTC (rev 3248)
+++ branches/7.4.x/engine/src/test/java/org/teiid/query/unittest/RealMetadataFactory.java 2011-06-13 17:35:41 UTC (rev 3249)
@@ -1104,14 +1104,14 @@
sq15.setResultSet(rs18);
QueryNode sq16n1 = new QueryNode("CREATE VIRTUAL PROCEDURE BEGIN INSERT INTO pm1.g1 ( e1, e2 ) VALUES( 1, 2 ); END"); //$NON-NLS-1$ //$NON-NLS-2$
- Procedure sq16 = createVirtualProcedure("sq16", pm1, null, sq16n1); //$NON-NLS-1$
+ createVirtualProcedure("sq16", pm1, null, sq16n1); //$NON-NLS-1$
ColumnSet<Procedure> rs19 = createResultSet("pm1.rs19", new String[] { "xml" }, new String[] { DataTypeManager.DefaultDataTypes.STRING }); //$NON-NLS-1$ //$NON-NLS-2$
QueryNode sq17n1 = new QueryNode("CREATE VIRTUAL PROCEDURE BEGIN SELECT * FROM xmltest.doc1; END"); //$NON-NLS-1$ //$NON-NLS-2$
Procedure sq17 = createVirtualProcedure("sq17", pm1, null, sq17n1); //$NON-NLS-1$
sq17.setResultSet(rs19);
- Procedure sp3 = createStoredProcedure("sp3", pm1, null); //$NON-NLS-1$ //$NON-NLS-2$
+ createStoredProcedure("sp3", pm1, null); //$NON-NLS-1$ //$NON-NLS-2$
ColumnSet<Procedure> rs20 = createResultSet("pm1.rs20", new String[] { "xml" }, new String[] { DataTypeManager.DefaultDataTypes.STRING }); //$NON-NLS-1$ //$NON-NLS-2$
QueryNode sq18n1 = new QueryNode("CREATE VIRTUAL PROCEDURE BEGIN SELECT * FROM xmltest.doc1; END"); //$NON-NLS-1$ //$NON-NLS-2$
@@ -1130,7 +1130,7 @@
sp4.setResultSet(rs22);
// no params or result set at all
- Procedure sp5 = createStoredProcedure("sp5", pm1, new ArrayList<ProcedureParameter>()); //$NON-NLS-1$ //$NON-NLS-2$
+ createStoredProcedure("sp5", pm1, new ArrayList<ProcedureParameter>()); //$NON-NLS-1$ //$NON-NLS-2$
//virtual stored procedures
ColumnSet<Procedure> vsprs1 = vsprs1(); //$NON-NLS-1$ //$NON-NLS-2$
Added: branches/7.4.x/metadata/DATATYPES.INDEX
===================================================================
(Binary files differ)
Property changes on: branches/7.4.x/metadata/DATATYPES.INDEX
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Modified: branches/7.4.x/metadata/src/main/resources/System.vdb
===================================================================
(Binary files differ)
Modified: branches/7.4.x/test-integration/common/src/test/java/org/teiid/jdbc/AbstractMMQueryTestCase.java
===================================================================
--- branches/7.4.x/test-integration/common/src/test/java/org/teiid/jdbc/AbstractMMQueryTestCase.java 2011-06-13 17:03:50 UTC (rev 3248)
+++ branches/7.4.x/test-integration/common/src/test/java/org/teiid/jdbc/AbstractMMQueryTestCase.java 2011-06-13 17:35:41 UTC (rev 3249)
@@ -80,7 +80,7 @@
}
- protected void helpTest(String query, String[] expected, String vdb, String props, String urlProperties) {
+ protected void helpTest(String query, String[] expected, String vdb, String props, String urlProperties) throws SQLException {
getConnection(vdb, props, urlProperties);
executeAndAssertResults(query, expected);
closeConnection();
Modified: branches/7.4.x/test-integration/common/src/test/java/org/teiid/jdbc/AbstractQueryTest.java
===================================================================
--- branches/7.4.x/test-integration/common/src/test/java/org/teiid/jdbc/AbstractQueryTest.java 2011-06-13 17:03:50 UTC (rev 3248)
+++ branches/7.4.x/test-integration/common/src/test/java/org/teiid/jdbc/AbstractQueryTest.java 2011-06-13 17:35:41 UTC (rev 3249)
@@ -86,11 +86,11 @@
return this.internalConnection;
}
- public boolean execute(String sql) {
+ public boolean execute(String sql) throws SQLException {
return execute(sql, new Object[] {});
}
- public boolean execute(String sql, Object[] params) {
+ public boolean execute(String sql, Object[] params) throws SQLException {
closeResultSet();
closeStatement();
this.updateCount = -1;
@@ -122,7 +122,7 @@
} catch (SQLException e) {
this.internalException = e;
if (!exceptionExpected()) {
- throw new RuntimeException(e);
+ throw e;
}
}
return false;
@@ -465,7 +465,7 @@
}
- protected void executeAndAssertResults(String query, String[] expected) {
+ protected void executeAndAssertResults(String query, String[] expected) throws SQLException {
execute(query);
if (expected != null) {
assertResults(expected);
Modified: branches/7.4.x/test-integration/common/src/test/java/org/teiid/jdbc/TestVDBMerge.java
===================================================================
--- branches/7.4.x/test-integration/common/src/test/java/org/teiid/jdbc/TestVDBMerge.java 2011-06-13 17:03:50 UTC (rev 3248)
+++ branches/7.4.x/test-integration/common/src/test/java/org/teiid/jdbc/TestVDBMerge.java 2011-06-13 17:35:41 UTC (rev 3249)
@@ -1,5 +1,7 @@
package org.teiid.jdbc;
+import java.sql.SQLException;
+
import org.junit.Test;
import org.teiid.core.util.UnitTestUtil;
@@ -66,7 +68,7 @@
executeTest("select * from tables where schemaname ='PartsSupplier'", expected); //$NON-NLS-1$
}
- private void executeTest(String sql, String[] expected){
+ private void executeTest(String sql, String[] expected) throws SQLException{
execute(sql);
if (expected != null) {
assertResults(expected);
Modified: branches/7.4.x/test-integration/common/src/test/java/org/teiid/systemmodel/TestMetadataUpdates.java
===================================================================
--- branches/7.4.x/test-integration/common/src/test/java/org/teiid/systemmodel/TestMetadataUpdates.java 2011-06-13 17:03:50 UTC (rev 3248)
+++ branches/7.4.x/test-integration/common/src/test/java/org/teiid/systemmodel/TestMetadataUpdates.java 2011-06-13 17:35:41 UTC (rev 3249)
@@ -67,7 +67,7 @@
public String answer(InvocationOnMock invocation) throws Throwable {
Procedure t = (Procedure)invocation.getArguments()[2];
if (t.getName().equals("proc")) {
- return "create virtual procedure begin select '2011'; end";
+ return "create virtual procedure begin select '2011'; if ((call isLoggable())) call logMsg(msg=>'hello'); end";
}
return null;
}
Modified: branches/7.4.x/test-integration/common/src/test/java/org/teiid/systemmodel/TestSystemVirtualModel.java
===================================================================
--- branches/7.4.x/test-integration/common/src/test/java/org/teiid/systemmodel/TestSystemVirtualModel.java 2011-06-13 17:03:50 UTC (rev 3248)
+++ branches/7.4.x/test-integration/common/src/test/java/org/teiid/systemmodel/TestSystemVirtualModel.java 2011-06-13 17:35:41 UTC (rev 3249)
@@ -83,7 +83,7 @@
checkResult("testProcedures", "select* from SYS.Procedures order by Name"); //$NON-NLS-1$ //$NON-NLS-2$
}
- @Test public void testProperties() {
+ @Test public void testProperties() throws Exception {
String[] expected = { "Name[string] Value[string] UID[string] OID[integer] ClobValue[clob]",
"pg_type:oid 30 mmuid:ffa4ac73-b549-470e-931f-dc36330cb8c4 1 30",
"pg_type:oid 1009 mmuid:d9f36bdc-7b25-4af0-b9f5-a96aac6d3094 2 1009",
@@ -94,7 +94,7 @@
executeAndAssertResults("select* from SYS.Properties", expected); //$NON-NLS-1$
}
- @Test public void testVirtualDatabase() {
+ @Test public void testVirtualDatabase() throws Exception {
String[] expected = { "Name[string] Version[string] ", "PartsSupplier 1", //$NON-NLS-1$ //$NON-NLS-2$
@@ -116,7 +116,7 @@
checkResult("testColumns", "select* from SYS.Columns order by Name"); //$NON-NLS-1$ //$NON-NLS-2$
}
- @Test public void testTableType() {
+ @Test public void testTableType() throws Exception {
String[] expected = { "Type[string] ", "Table", }; //$NON-NLS-1$ //$NON-NLS-2$
executeAndAssertResults(
@@ -128,7 +128,7 @@
checkResult("testTableIsSystem", "select Name from SYS.Tables where IsSystem = 'false' order by Name"); //$NON-NLS-1$ //$NON-NLS-2$
}
- @Test public void testDefect12064() {
+ @Test public void testDefect12064() throws Exception {
String[] expected = {
"KeyName[string] RefKeyUID[string] ", //$NON-NLS-1$
"PK_PARTS null", //$NON-NLS-1$
@@ -174,4 +174,12 @@
oidCount = getRowCount();
assertEquals(uidCount, oidCount);
}
+
+ @Test public void testLogMsg() throws Exception {
+ execute("call logMsg(level=>'DEBUG', context=>'org.teiid.foo', msg=>'hello world')"); //$NON-NLS-1$
+ }
+
+ @Test(expected=SQLException.class) public void testLogMsg1() throws Exception {
+ execute("call logMsg(level=>'foo', context=>'org.teiid.foo', msg=>'hello world')"); //$NON-NLS-1$
+ }
}
Modified: branches/7.4.x/test-integration/common/src/test/java/org/teiid/systemmodel/TestVirtualDocWithVirtualProc.java
===================================================================
--- branches/7.4.x/test-integration/common/src/test/java/org/teiid/systemmodel/TestVirtualDocWithVirtualProc.java 2011-06-13 17:03:50 UTC (rev 3248)
+++ branches/7.4.x/test-integration/common/src/test/java/org/teiid/systemmodel/TestVirtualDocWithVirtualProc.java 2011-06-13 17:35:41 UTC (rev 3249)
@@ -55,7 +55,7 @@
closeConnection();
}
- @Test public void testDefect15241() {
+ @Test public void testDefect15241() throws Exception {
String sql = "SELECT SchemaName, Name, Description FROM SYS.Tables WHERE Name = 'yyyTestDocument'"; //$NON-NLS-1$
@@ -67,7 +67,7 @@
executeAndAssertResults(sql, expected);
}
- @Test public void testDefect15241a() {
+ @Test public void testDefect15241a() throws Exception {
String sql = "SELECT TableName, Name, Description FROM SYS.Columns WHERE Name = 'IntKey'"; //$NON-NLS-1$
String[] expected ={
"TableName[string] Name[string] Description[string]", //$NON-NLS-1$
@@ -83,7 +83,7 @@
executeAndAssertResults(sql, expected);
}
- @Test public void testDefect15241b() {
+ @Test public void testDefect15241b() throws Exception {
String sql = "SELECT p.Name, p.Value, UID FROM SYS.Properties p"; //$NON-NLS-1$
String[] expected ={
Modified: branches/7.4.x/test-integration/common/src/test/resources/TestMMDatabaseMetaData/testGetProcedureColumns.expected
===================================================================
--- branches/7.4.x/test-integration/common/src/test/resources/TestMMDatabaseMetaData/testGetProcedureColumns.expected 2011-06-13 17:03:50 UTC (rev 3248)
+++ branches/7.4.x/test-integration/common/src/test/resources/TestMMDatabaseMetaData/testGetProcedureColumns.expected 2011-06-13 17:35:41 UTC (rev 3249)
@@ -43,6 +43,13 @@
QT_Ora9DS SP sp_rows_between ObjectValue 3 2000 object 2147483647 2048 0 10 1 <null> <null> <null> <null> <null> 17 YES sp_rows_between
QT_Ora9DS SYS getXMLSchemas document 1 12 string 4000 4000 0 10 0 <null> <null> <null> <null> <null> 1 NO getXMLSchemas
QT_Ora9DS SYS getXMLSchemas schema 3 2009 xml 2147483647 2147483647 0 10 1 <null> <null> <null> <null> <null> 1 YES getXMLSchemas
+QT_Ora9DS SYSADMIN isLoggable level 1 12 string 4000 4000 0 10 0 <null> <null> <null> <null> <null> 2 NO isLoggable
+QT_Ora9DS SYSADMIN isLoggable context 1 12 string 4000 4000 0 10 0 <null> <null> <null> <null> <null> 3 NO isLoggable
+QT_Ora9DS SYSADMIN isLoggable loggable 5 -7 boolean 1 1 0 10 0 <null> <null> <null> <null> <null> 1 NO isLoggable
+QT_Ora9DS SYSADMIN logMsg level 1 12 string 4000 4000 0 10 0 <null> <null> <null> <null> <null> 2 NO logMsg
+QT_Ora9DS SYSADMIN logMsg context 1 12 string 4000 4000 0 10 0 <null> <null> <null> <null> <null> 3 NO logMsg
+QT_Ora9DS SYSADMIN logMsg msg 1 2000 object 2147483647 2147483647 0 10 0 <null> <null> <null> <null> <null> 4 NO logMsg
+QT_Ora9DS SYSADMIN logMsg logged 5 -7 boolean 1 1 0 10 0 <null> <null> <null> <null> <null> 1 NO logMsg
QT_Ora9DS SYSADMIN refreshMatView ViewName 1 12 string 4000 4000 0 10 0 <null> <null> <null> <null> <null> 1 NO refreshMatView
QT_Ora9DS SYSADMIN refreshMatView Invalidate 1 -7 boolean 1 1 0 10 0 <null> <null> <null> <null> <null> 2 NO refreshMatView
QT_Ora9DS SYSADMIN refreshMatView RowsUpdated 5 4 integer 10 10 0 10 0 <null> <null> <null> <null> <null> 3 NO refreshMatView
@@ -61,7 +68,7 @@
QT_Ora9DS SYSADMIN setProperty OldValue 5 2005 clob 2147483647 2097152 0 10 0 <null> <null> <null> <null> <null> 1 NO setProperty
QT_Ora9DS SYSADMIN setTableStats tableName 1 12 string 4000 4000 0 10 0 <null> <null> <null> <null> <null> 1 NO setTableStats
QT_Ora9DS SYSADMIN setTableStats cardinality 1 4 integer 10 10 0 10 0 <null> <null> <null> <null> <null> 2 NO setTableStats
-Row Count : 61
+Row Count : 68
getColumnName getColumnType getCatalogName getColumnClassName getColumnLabel getColumnTypeName getSchemaName getTableName getColumnDisplaySize getPrecision getScale isAutoIncrement isCaseSensitive isCurrency isDefinitelyWritable isNullable isReadOnly isSearchable isSigned isWritable
VDBName 12 QT_Ora9DS java.lang.String PROCEDURE_CAT string SYS ProcedureParams 255 255 0 false false false false 0 true true false false
SchemaName 12 QT_Ora9DS java.lang.String PROCEDURE_SCHEM string SYS ProcedureParams 255 255 0 false true false true 1 false true true true
Modified: branches/7.4.x/test-integration/common/src/test/resources/TestMMDatabaseMetaData/testGetProcedures.expected
===================================================================
--- branches/7.4.x/test-integration/common/src/test/resources/TestMMDatabaseMetaData/testGetProcedures.expected 2011-06-13 17:03:50 UTC (rev 3248)
+++ branches/7.4.x/test-integration/common/src/test/resources/TestMMDatabaseMetaData/testGetProcedures.expected 2011-06-13 17:35:41 UTC (rev 3249)
@@ -5,12 +5,14 @@
QT_Ora9DS SP sp_count_rows_between <null> <null> <null> <null> 1 sp_count_rows_between
QT_Ora9DS SP sp_rows_between <null> <null> <null> <null> 2 sp_rows_between
QT_Ora9DS SYS getXMLSchemas <null> <null> <null> <null> 2 getXMLSchemas
+QT_Ora9DS SYSADMIN isLoggable <null> <null> <null> <null> 1 isLoggable
+QT_Ora9DS SYSADMIN logMsg <null> <null> <null> <null> 1 logMsg
QT_Ora9DS SYSADMIN refreshMatView <null> <null> <null> <null> 1 refreshMatView
QT_Ora9DS SYSADMIN refreshMatViewRow <null> <null> <null> <null> 1 refreshMatViewRow
QT_Ora9DS SYSADMIN setColumnStats <null> <null> <null> <null> 1 setColumnStats
QT_Ora9DS SYSADMIN setProperty <null> <null> <null> <null> 1 setProperty
QT_Ora9DS SYSADMIN setTableStats <null> <null> <null> <null> 1 setTableStats
-Row Count : 10
+Row Count : 12
getColumnName getColumnType getCatalogName getColumnClassName getColumnLabel getColumnTypeName getSchemaName getTableName getColumnDisplaySize getPrecision getScale isAutoIncrement isCaseSensitive isCurrency isDefinitelyWritable isNullable isReadOnly isSearchable isSigned isWritable
VDBName 12 QT_Ora9DS java.lang.String PROCEDURE_CAT string SYS Procedures 255 255 0 false false false false 0 true true false false
SchemaName 12 QT_Ora9DS java.lang.String PROCEDURE_SCHEM string SYS Procedures 255 255 0 false true false true 1 false true true true
Modified: branches/7.4.x/test-integration/common/src/test/resources/TestMMDatabaseMetaData/testGetProceduresWithEscape.expected
===================================================================
--- branches/7.4.x/test-integration/common/src/test/resources/TestMMDatabaseMetaData/testGetProceduresWithEscape.expected 2011-06-13 17:03:50 UTC (rev 3248)
+++ branches/7.4.x/test-integration/common/src/test/resources/TestMMDatabaseMetaData/testGetProceduresWithEscape.expected 2011-06-13 17:35:41 UTC (rev 3249)
@@ -5,12 +5,14 @@
QT_Ora9DS SP sp_count_rows_between <null> <null> <null> <null> 1 sp_count_rows_between
QT_Ora9DS SP sp_rows_between <null> <null> <null> <null> 2 sp_rows_between
QT_Ora9DS SYS getXMLSchemas <null> <null> <null> <null> 2 getXMLSchemas
+QT_Ora9DS SYSADMIN isLoggable <null> <null> <null> <null> 1 isLoggable
+QT_Ora9DS SYSADMIN logMsg <null> <null> <null> <null> 1 logMsg
QT_Ora9DS SYSADMIN refreshMatView <null> <null> <null> <null> 1 refreshMatView
QT_Ora9DS SYSADMIN refreshMatViewRow <null> <null> <null> <null> 1 refreshMatViewRow
QT_Ora9DS SYSADMIN setColumnStats <null> <null> <null> <null> 1 setColumnStats
QT_Ora9DS SYSADMIN setProperty <null> <null> <null> <null> 1 setProperty
QT_Ora9DS SYSADMIN setTableStats <null> <null> <null> <null> 1 setTableStats
-Row Count : 10
+Row Count : 12
getColumnName getColumnType getCatalogName getColumnClassName getColumnLabel getColumnTypeName getSchemaName getTableName getColumnDisplaySize getPrecision getScale isAutoIncrement isCaseSensitive isCurrency isDefinitelyWritable isNullable isReadOnly isSearchable isSigned isWritable
VDBName 12 QT_Ora9DS java.lang.String PROCEDURE_CAT string SYS Procedures 255 255 0 false false false false 0 true true false false
SchemaName 12 QT_Ora9DS java.lang.String PROCEDURE_SCHEM string SYS Procedures 255 255 0 false true false true 1 false true true true
Modified: branches/7.4.x/test-integration/common/src/test/resources/TestPartsDatabaseMetadata/testProcedureColumns.expected
===================================================================
--- branches/7.4.x/test-integration/common/src/test/resources/TestPartsDatabaseMetadata/testProcedureColumns.expected 2011-06-13 17:03:50 UTC (rev 3248)
+++ branches/7.4.x/test-integration/common/src/test/resources/TestPartsDatabaseMetadata/testProcedureColumns.expected 2011-06-13 17:35:41 UTC (rev 3249)
@@ -2,6 +2,13 @@
VDBName SchemaName ProcedureName Name COLUMN_TYPE DATA_TYPE DataType PRECISION LENGTH SCALE Radix NULLABLE Description COLUMN_DEF SQL_DATA_TYPE SQL_DATETIME_SUB CHAR_OCTET_LENGTH Position IS_NULLABLE ProcedureName
PartsSupplier SYS getXMLSchemas document 1 12 string 4000 4000 0 10 0 <null> <null> <null> <null> <null> 1 NO getXMLSchemas
PartsSupplier SYS getXMLSchemas schema 3 2009 xml 2147483647 2147483647 0 10 1 <null> <null> <null> <null> <null> 1 YES getXMLSchemas
+PartsSupplier SYSADMIN isLoggable level 1 12 string 4000 4000 0 10 0 <null> <null> <null> <null> <null> 2 NO isLoggable
+PartsSupplier SYSADMIN isLoggable context 1 12 string 4000 4000 0 10 0 <null> <null> <null> <null> <null> 3 NO isLoggable
+PartsSupplier SYSADMIN isLoggable loggable 5 -7 boolean 1 1 0 10 0 <null> <null> <null> <null> <null> 1 NO isLoggable
+PartsSupplier SYSADMIN logMsg level 1 12 string 4000 4000 0 10 0 <null> <null> <null> <null> <null> 2 NO logMsg
+PartsSupplier SYSADMIN logMsg context 1 12 string 4000 4000 0 10 0 <null> <null> <null> <null> <null> 3 NO logMsg
+PartsSupplier SYSADMIN logMsg msg 1 2000 object 2147483647 2147483647 0 10 0 <null> <null> <null> <null> <null> 4 NO logMsg
+PartsSupplier SYSADMIN logMsg logged 5 -7 boolean 1 1 0 10 0 <null> <null> <null> <null> <null> 1 NO logMsg
PartsSupplier SYSADMIN refreshMatView ViewName 1 12 string 4000 4000 0 10 0 <null> <null> <null> <null> <null> 1 NO refreshMatView
PartsSupplier SYSADMIN refreshMatView Invalidate 1 -7 boolean 1 1 0 10 0 <null> <null> <null> <null> <null> 2 NO refreshMatView
PartsSupplier SYSADMIN refreshMatView RowsUpdated 5 4 integer 10 10 0 10 0 <null> <null> <null> <null> <null> 3 NO refreshMatView
@@ -20,7 +27,7 @@
PartsSupplier SYSADMIN setProperty OldValue 5 2005 clob 2147483647 2097152 0 10 0 <null> <null> <null> <null> <null> 1 NO setProperty
PartsSupplier SYSADMIN setTableStats tableName 1 12 string 4000 4000 0 10 0 <null> <null> <null> <null> <null> 1 NO setTableStats
PartsSupplier SYSADMIN setTableStats cardinality 1 4 integer 10 10 0 10 0 <null> <null> <null> <null> <null> 2 NO setTableStats
-Row Count : 20
+Row Count : 27
getColumnName getColumnType getCatalogName getColumnClassName getColumnLabel getColumnTypeName getSchemaName getTableName getColumnDisplaySize getPrecision getScale isAutoIncrement isCaseSensitive isCurrency isDefinitelyWritable isNullable isReadOnly isSearchable isSigned isWritable
VDBName 12 PartsSupplier java.lang.String PROCEDURE_CAT string SYS ProcedureParams 255 255 0 false false false false 0 true true false false
SchemaName 12 PartsSupplier java.lang.String PROCEDURE_SCHEM string SYS ProcedureParams 255 255 0 false true false true 1 false true true true
Modified: branches/7.4.x/test-integration/common/src/test/resources/TestPartsDatabaseMetadata/testProcedures.expected
===================================================================
--- branches/7.4.x/test-integration/common/src/test/resources/TestPartsDatabaseMetadata/testProcedures.expected 2011-06-13 17:03:50 UTC (rev 3248)
+++ branches/7.4.x/test-integration/common/src/test/resources/TestPartsDatabaseMetadata/testProcedures.expected 2011-06-13 17:35:41 UTC (rev 3249)
@@ -1,12 +1,14 @@
string string string string string string string short string
VDBName SchemaName Name RESERVED_1 RESERVED_2 RESERVED_3 Description PROCEDURE_TYPE Name
PartsSupplier SYS getXMLSchemas <null> <null> <null> <null> 2 getXMLSchemas
+PartsSupplier SYSADMIN isLoggable <null> <null> <null> <null> 1 isLoggable
+PartsSupplier SYSADMIN logMsg <null> <null> <null> <null> 1 logMsg
PartsSupplier SYSADMIN refreshMatView <null> <null> <null> <null> 1 refreshMatView
PartsSupplier SYSADMIN refreshMatViewRow <null> <null> <null> <null> 1 refreshMatViewRow
PartsSupplier SYSADMIN setColumnStats <null> <null> <null> <null> 1 setColumnStats
PartsSupplier SYSADMIN setProperty <null> <null> <null> <null> 1 setProperty
PartsSupplier SYSADMIN setTableStats <null> <null> <null> <null> 1 setTableStats
-Row Count : 6
+Row Count : 8
getColumnName getColumnType getCatalogName getColumnClassName getColumnLabel getColumnTypeName getSchemaName getTableName getColumnDisplaySize getPrecision getScale isAutoIncrement isCaseSensitive isCurrency isDefinitelyWritable isNullable isReadOnly isSearchable isSigned isWritable
VDBName 12 PartsSupplier java.lang.String PROCEDURE_CAT string SYS Procedures 255 255 0 false false false false 0 true true false false
SchemaName 12 PartsSupplier java.lang.String PROCEDURE_SCHEM string SYS Procedures 255 255 0 false true false true 1 false true true true
Modified: branches/7.4.x/test-integration/common/src/test/resources/TestSystemVirtualModel/testProcedureParams.expected
===================================================================
--- branches/7.4.x/test-integration/common/src/test/resources/TestSystemVirtualModel/testProcedureParams.expected 2011-06-13 17:03:50 UTC (rev 3248)
+++ branches/7.4.x/test-integration/common/src/test/resources/TestSystemVirtualModel/testProcedureParams.expected 2011-06-13 17:35:41 UTC (rev 3249)
@@ -1,26 +1,33 @@
string string string string string integer string boolean integer integer integer integer string string string integer
VDBName SchemaName ProcedureName Name DataType Position Type Optional Precision TypeLength Scale Radix NullType UID Description OID
-PartsSupplier SYSADMIN refreshMatView Invalidate boolean 2 In false 0 0 0 10 No Nulls mmuuid:5736cfd3-750f-42d8-b083-102061e11c60 <null> 5
-PartsSupplier SYSADMIN refreshMatViewRow Key object 2 In false 0 0 0 10 No Nulls mmuuid:7af5a63b-1b91-4d1e-912e-846a7e84c579 <null> 2
-PartsSupplier SYSADMIN setProperty Name string 3 In false 0 0 0 10 No Nulls mmuuid:ea92812c-1516-4c75-b5d3-c531fdbd8475 <null> 15
-PartsSupplier SYSADMIN setProperty OldValue clob 1 ReturnValue false 0 2097152 0 10 No Nulls mmuuid:48034d50-dd11-4653-aeae-b0d8d3d55656 <null> 13
-PartsSupplier SYSADMIN refreshMatViewRow RowsUpdated integer 3 ReturnValue false 0 0 0 10 No Nulls mmuuid:05a6a9be-c014-4d06-bcac-746cee4f118b <null> 3
-PartsSupplier SYSADMIN refreshMatView RowsUpdated integer 3 ReturnValue false 0 0 0 10 No Nulls mmuuid:d07a6a75-aa12-4dac-8eab-b2acdbaaffd8 <null> 6
-PartsSupplier SYSADMIN setProperty UID string 2 In false 0 50 0 10 No Nulls mmuuid:d377510e-2ec5-445e-bdf0-59c7c0380962 <null> 14
-PartsSupplier SYSADMIN setProperty Value clob 4 In false 0 2097152 0 10 Nullable mmuuid:ac5beeb8-2d0d-48ff-a533-4237d53b67e8 <null> 16
-PartsSupplier SYSADMIN refreshMatViewRow ViewName string 1 In false 0 0 0 10 No Nulls mmuuid:ba635c44-a052-496d-9c35-ca010c0ebebe <null> 1
-PartsSupplier SYSADMIN refreshMatView ViewName string 1 In false 0 0 0 10 No Nulls mmuuid:e0c28e00-d987-48e4-8c60-5f637f10bf33 <null> 4
-PartsSupplier SYSADMIN setTableStats cardinality integer 2 In false 0 0 0 10 No Nulls mmuuid:0aba7849-7fd3-4bc6-a3d3-dfe433bc67a4 <null> 18
-PartsSupplier SYSADMIN setColumnStats columnName string 2 In false 0 0 0 10 No Nulls mmuuid:76553706-632f-4e60-8489-9d0361f58541 <null> 8
-PartsSupplier SYSADMIN setColumnStats distinctCount integer 3 In false 0 0 0 10 Nullable mmuuid:2c61976e-abb5-4c74-bdae-278681b82aa3 <null> 9
-PartsSupplier SYS getXMLSchemas document string 1 In false 0 0 0 10 No Nulls mmuuid:85b88af5-f0b8-401f-b35a-ccee56155492 <null> 19
-PartsSupplier SYSADMIN setColumnStats max string 5 In false 0 0 0 10 Nullable mmuuid:8f42e701-3609-413d-8c10-77e32cd816f2 <null> 11
-PartsSupplier SYSADMIN setColumnStats min string 6 In false 0 0 0 10 Nullable mmuuid:4511ea3f-f2d2-4abf-b363-afb5186bc2d2 <null> 12
-PartsSupplier SYSADMIN setColumnStats nullCount integer 4 In false 0 0 0 10 Nullable mmuuid:44b8c83c-9fcd-4bd2-a730-76e401205536 <null> 10
-PartsSupplier SYS getXMLSchemas schema xml 1 ResultSet false 0 0 0 10 Nullable mmuuid:003980bb-38bb-41ad-b8c2-c87ca47aa554 <null> 20
-PartsSupplier SYSADMIN setColumnStats tableName string 1 In false 0 0 0 10 No Nulls mmuuid:4dcab018-ca4a-467b-96cc-7f28734c840e <null> 7
-PartsSupplier SYSADMIN setTableStats tableName string 1 In false 0 0 0 10 No Nulls mmuuid:28d8ad4a-e091-4934-afd9-7d27310bd370 <null> 17
-Row Count : 20
+PartsSupplier SYSADMIN refreshMatView Invalidate boolean 2 In false 0 0 0 10 No Nulls mmuuid:5736cfd3-750f-42d8-b083-102061e11c60 <null> 12
+PartsSupplier SYSADMIN refreshMatViewRow Key object 2 In false 0 0 0 10 No Nulls mmuuid:7af5a63b-1b91-4d1e-912e-846a7e84c579 <null> 9
+PartsSupplier SYSADMIN setProperty Name string 3 In false 0 0 0 10 No Nulls mmuuid:ea92812c-1516-4c75-b5d3-c531fdbd8475 <null> 22
+PartsSupplier SYSADMIN setProperty OldValue clob 1 ReturnValue false 0 2097152 0 10 No Nulls mmuuid:48034d50-dd11-4653-aeae-b0d8d3d55656 <null> 20
+PartsSupplier SYSADMIN refreshMatViewRow RowsUpdated integer 3 ReturnValue false 0 0 0 10 No Nulls mmuuid:05a6a9be-c014-4d06-bcac-746cee4f118b <null> 10
+PartsSupplier SYSADMIN refreshMatView RowsUpdated integer 3 ReturnValue false 0 0 0 10 No Nulls mmuuid:d07a6a75-aa12-4dac-8eab-b2acdbaaffd8 <null> 13
+PartsSupplier SYSADMIN setProperty UID string 2 In false 0 50 0 10 No Nulls mmuuid:d377510e-2ec5-445e-bdf0-59c7c0380962 <null> 21
+PartsSupplier SYSADMIN setProperty Value clob 4 In false 0 2097152 0 10 Nullable mmuuid:ac5beeb8-2d0d-48ff-a533-4237d53b67e8 <null> 23
+PartsSupplier SYSADMIN refreshMatViewRow ViewName string 1 In false 0 0 0 10 No Nulls mmuuid:ba635c44-a052-496d-9c35-ca010c0ebebe <null> 8
+PartsSupplier SYSADMIN refreshMatView ViewName string 1 In false 0 0 0 10 No Nulls mmuuid:e0c28e00-d987-48e4-8c60-5f637f10bf33 <null> 11
+PartsSupplier SYSADMIN setTableStats cardinality integer 2 In false 0 0 0 10 No Nulls mmuuid:0aba7849-7fd3-4bc6-a3d3-dfe433bc67a4 <null> 25
+PartsSupplier SYSADMIN setColumnStats columnName string 2 In false 0 0 0 10 No Nulls mmuuid:76553706-632f-4e60-8489-9d0361f58541 <null> 15
+PartsSupplier SYSADMIN isLoggable context string 3 In false 0 0 0 10 No Nulls mmuuid:d62e3ceb-8e58-4c22-96b7-d76ee923e180 <null> 3
+PartsSupplier SYSADMIN logMsg context string 3 In false 0 0 0 10 No Nulls mmuuid:c3f22b88-7f80-4ae3-8e60-6953722b8c38 <null> 6
+PartsSupplier SYSADMIN setColumnStats distinctCount integer 3 In false 0 0 0 10 Nullable mmuuid:2c61976e-abb5-4c74-bdae-278681b82aa3 <null> 16
+PartsSupplier SYS getXMLSchemas document string 1 In false 0 0 0 10 No Nulls mmuuid:85b88af5-f0b8-401f-b35a-ccee56155492 <null> 26
+PartsSupplier SYSADMIN isLoggable level string 2 In false 0 0 0 10 No Nulls mmuuid:995ab23a-3fd8-4ce0-aedd-6dcf99a65be1 <null> 2
+PartsSupplier SYSADMIN logMsg level string 2 In false 0 0 0 10 No Nulls mmuuid:ce0fd267-0038-49d5-ab1c-d8166d556b72 <null> 5
+PartsSupplier SYSADMIN isLoggable loggable boolean 1 ReturnValue false 0 0 0 10 No Nulls mmuuid:589773e4-2f8c-4972-ac0d-d694e317f154 <null> 1
+PartsSupplier SYSADMIN logMsg logged boolean 1 ReturnValue false 0 0 0 10 No Nulls mmuuid:3086a5d9-ae1a-4c99-a649-ad9b8d3db8da <null> 4
+PartsSupplier SYSADMIN setColumnStats max string 5 In false 0 0 0 10 Nullable mmuuid:8f42e701-3609-413d-8c10-77e32cd816f2 <null> 18
+PartsSupplier SYSADMIN setColumnStats min string 6 In false 0 0 0 10 Nullable mmuuid:4511ea3f-f2d2-4abf-b363-afb5186bc2d2 <null> 19
+PartsSupplier SYSADMIN logMsg msg object 4 In false 0 0 0 10 No Nulls mmuuid:81b921cc-9417-4655-898b-3d587ad3af16 <null> 7
+PartsSupplier SYSADMIN setColumnStats nullCount integer 4 In false 0 0 0 10 Nullable mmuuid:44b8c83c-9fcd-4bd2-a730-76e401205536 <null> 17
+PartsSupplier SYS getXMLSchemas schema xml 1 ResultSet false 0 0 0 10 Nullable mmuuid:003980bb-38bb-41ad-b8c2-c87ca47aa554 <null> 27
+PartsSupplier SYSADMIN setColumnStats tableName string 1 In false 0 0 0 10 No Nulls mmuuid:4dcab018-ca4a-467b-96cc-7f28734c840e <null> 14
+PartsSupplier SYSADMIN setTableStats tableName string 1 In false 0 0 0 10 No Nulls mmuuid:28d8ad4a-e091-4934-afd9-7d27310bd370 <null> 24
+Row Count : 27
getColumnName getColumnType getCatalogName getColumnClassName getColumnLabel getColumnTypeName getSchemaName getTableName getColumnDisplaySize getPrecision getScale isAutoIncrement isCaseSensitive isCurrency isDefinitelyWritable isNullable isReadOnly isSearchable isSigned isWritable
VDBName 12 PartsSupplier java.lang.String VDBName string SYS ProcedureParams 255 255 0 false false false false 0 true true false false
SchemaName 12 PartsSupplier java.lang.String SchemaName string SYS ProcedureParams 255 255 0 false true false true 1 false true true true
Modified: branches/7.4.x/test-integration/common/src/test/resources/TestSystemVirtualModel/testProcedures.expected
===================================================================
--- branches/7.4.x/test-integration/common/src/test/resources/TestSystemVirtualModel/testProcedures.expected 2011-06-13 17:03:50 UTC (rev 3248)
+++ branches/7.4.x/test-integration/common/src/test/resources/TestSystemVirtualModel/testProcedures.expected 2011-06-13 17:35:41 UTC (rev 3249)
@@ -1,12 +1,14 @@
string string string string boolean string string integer
VDBName SchemaName Name NameInSource ReturnsResults UID Description OID
-PartsSupplier SYS getXMLSchemas <null> true mmuuid:68497bd9-30f5-461b-bf13-6b26aeb2fc4f <null> 6
-PartsSupplier SYSADMIN refreshMatView <null> false mmuuid:52178344-dca8-4c76-8549-00a4515c7044 <null> 2
-PartsSupplier SYSADMIN refreshMatViewRow <null> false mmuuid:1674912b-af56-465a-a1b9-d1de8b761f10 <null> 1
-PartsSupplier SYSADMIN setColumnStats <null> false mmuuid:49c367be-918f-43be-8b9e-99e275179859 <null> 3
-PartsSupplier SYSADMIN setProperty <null> false mmuuid:8db9b08e-3d6e-415a-9ceb-3fef726f424c <null> 4
-PartsSupplier SYSADMIN setTableStats <null> false mmuuid:6d167c35-04d1-41f6-83ff-888c39423823 <null> 5
-Row Count : 6
+PartsSupplier SYS getXMLSchemas <null> true mmuuid:68497bd9-30f5-461b-bf13-6b26aeb2fc4f <null> 8
+PartsSupplier SYSADMIN isLoggable <null> false mmuuid:36769e93-4cc3-417b-853e-5ee5e6653d01 <null> 1
+PartsSupplier SYSADMIN logMsg <null> false mmuuid:9a754e95-853b-40b2-a085-56d57f45953d <null> 2
+PartsSupplier SYSADMIN refreshMatView <null> false mmuuid:52178344-dca8-4c76-8549-00a4515c7044 <null> 4
+PartsSupplier SYSADMIN refreshMatViewRow <null> false mmuuid:1674912b-af56-465a-a1b9-d1de8b761f10 <null> 3
+PartsSupplier SYSADMIN setColumnStats <null> false mmuuid:49c367be-918f-43be-8b9e-99e275179859 <null> 5
+PartsSupplier SYSADMIN setProperty <null> false mmuuid:8db9b08e-3d6e-415a-9ceb-3fef726f424c <null> 6
+PartsSupplier SYSADMIN setTableStats <null> false mmuuid:6d167c35-04d1-41f6-83ff-888c39423823 <null> 7
+Row Count : 8
getColumnName getColumnType getCatalogName getColumnClassName getColumnLabel getColumnTypeName getSchemaName getTableName getColumnDisplaySize getPrecision getScale isAutoIncrement isCaseSensitive isCurrency isDefinitelyWritable isNullable isReadOnly isSearchable isSigned isWritable
VDBName 12 PartsSupplier java.lang.String VDBName string SYS Procedures 255 255 0 false false false false 0 true true false false
SchemaName 12 PartsSupplier java.lang.String SchemaName string SYS Procedures 255 255 0 false true false true 1 false true true true
Modified: branches/7.4.x/test-integration/db/src/test/java/org/teiid/dynamicvdb/TestVDBLessExecution.java
===================================================================
--- branches/7.4.x/test-integration/db/src/test/java/org/teiid/dynamicvdb/TestVDBLessExecution.java 2011-06-13 17:03:50 UTC (rev 3248)
+++ branches/7.4.x/test-integration/db/src/test/java/org/teiid/dynamicvdb/TestVDBLessExecution.java 2011-06-13 17:35:41 UTC (rev 3249)
@@ -40,7 +40,7 @@
private static final String DQP_PROP_FILE = UnitTestUtil.getTestDataPath() + "/vdbless/dqp.properties;user=test"; //$NON-NLS-1$
private static final String VDB = "VDBLess"; //$NON-NLS-1$
- @Test public void testExecution() {
+ @Test public void testExecution() throws Exception {
getConnection(VDB, DQP_PROP_FILE);
executeAndAssertResults("select * from Example", new String[] { //$NON-NLS-1$
"TRADEID[string] NOTIONAL[integer]", //$NON-NLS-1$
@@ -51,7 +51,7 @@
closeConnection();
}
- @Test public void testIntegrationExecution() {
+ @Test public void testIntegrationExecution() throws Exception {
getConnection(VDB, DQP_PROP_FILE);
executeAndAssertResults("select * from Example, Smalla where notional = intkey", new String[] { //$NON-NLS-1$
"TRADEID[string] NOTIONAL[integer] INTKEY[integer] STRINGKEY[string] INTNUM[integer] STRINGNUM[string] FLOATNUM[float] LONGNUM[long] DOUBLENUM[double] BYTENUM[short] DATEVALUE[date] TIMEVALUE[time] TIMESTAMPVALUE[timestamp] BOOLEANVALUE[short] CHARVALUE[string] SHORTVALUE[short] BIGINTEGERVALUE[long] BIGDECIMALVALUE[bigdecimal] OBJECTVALUE[string]", //$NON-NLS-1$
@@ -64,7 +64,7 @@
/**
* We have no results to assert here since derby does not provide procedure resultset columns in their metadata.
*/
- @Test public void testProcedureExecution() {
+ @Test public void testProcedureExecution() throws Exception {
getConnection(VDB, DQP_PROP_FILE);
execute("exec Derby.SQLUDTS(null, null, null, null, null)"); //$NON-NLS-1$
closeConnection();
13 years, 6 months
teiid SVN: r3248 - in branches/7.4.x/engine/src: test/java/org/teiid/query/resolver and 1 other directory.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2011-06-13 13:03:50 -0400 (Mon, 13 Jun 2011)
New Revision: 3248
Modified:
branches/7.4.x/engine/src/main/java/org/teiid/query/resolver/command/UpdateProcedureResolver.java
branches/7.4.x/engine/src/test/java/org/teiid/query/resolver/TestProcedureResolving.java
Log:
TEIID-1635 fix for resolving error
Modified: branches/7.4.x/engine/src/main/java/org/teiid/query/resolver/command/UpdateProcedureResolver.java
===================================================================
--- branches/7.4.x/engine/src/main/java/org/teiid/query/resolver/command/UpdateProcedureResolver.java 2011-06-13 16:05:57 UTC (rev 3247)
+++ branches/7.4.x/engine/src/main/java/org/teiid/query/resolver/command/UpdateProcedureResolver.java 2011-06-13 17:03:50 UTC (rev 3248)
@@ -194,7 +194,7 @@
switch (param.getParameterType()) {
case ParameterInfo.OUT:
case ParameterInfo.RETURN_VALUE:
- if (!isAssignable(metadata, param)) {
+ if (param.getExpression() != null && !isAssignable(metadata, param)) {
throw new QueryResolverException(QueryPlugin.Util.getString("UpdateProcedureResolver.only_variables", param.getExpression())); //$NON-NLS-1$
}
sp.setCallableStatement(true);
Modified: branches/7.4.x/engine/src/test/java/org/teiid/query/resolver/TestProcedureResolving.java
===================================================================
--- branches/7.4.x/engine/src/test/java/org/teiid/query/resolver/TestProcedureResolving.java 2011-06-13 16:05:57 UTC (rev 3247)
+++ branches/7.4.x/engine/src/test/java/org/teiid/query/resolver/TestProcedureResolving.java 2011-06-13 17:03:50 UTC (rev 3248)
@@ -173,13 +173,13 @@
AssignmentStatement assStmt = (AssignmentStatement)block.getStatements().get(1);
assertEquals(ProcedureReservedWords.VARIABLES, assStmt.getVariable().getGroupSymbol().getCanonicalName());
- assertEquals(ProcedureReservedWords.VARIABLES, ((ElementSymbol)assStmt.getValue()).getGroupSymbol().getCanonicalName());
+ assertEquals(ProcedureReservedWords.VARIABLES, ((ElementSymbol)assStmt.getExpression()).getGroupSymbol().getCanonicalName());
Block inner = ((LoopStatement)block.getStatements().get(2)).getBlock();
assStmt = (AssignmentStatement)inner.getStatements().get(0);
- ElementSymbol value = ElementCollectorVisitor.getElements(assStmt.getValue(), false).iterator().next();
+ ElementSymbol value = ElementCollectorVisitor.getElements(assStmt.getExpression(), false).iterator().next();
assertEquals("LOOPCURSOR", value.getGroupSymbol().getCanonicalName()); //$NON-NLS-1$
}
@@ -1038,6 +1038,16 @@
TestResolver.helpResolve(procedure, RealMetadataFactory.example1Cached());
}
+ // addresses Cases 5474.
+ @Test public void testProcWithReturn() throws Exception {
+ String procedure = "CREATE VIRTUAL PROCEDURE "; //$NON-NLS-1$
+ procedure = procedure + "BEGIN\n"; //$NON-NLS-1$
+ procedure = procedure + "call sptest9(1);\n"; //$NON-NLS-1$
+ procedure = procedure + "END\n"; //$NON-NLS-1$
+
+ TestResolver.helpResolve(procedure, RealMetadataFactory.exampleBQTCached());
+ }
+
@Test public void testIssue174102() throws Exception {
String procedure = "CREATE VIRTUAL PROCEDURE \n"; //$NON-NLS-1$
procedure = procedure + "BEGIN\n"; //$NON-NLS-1$
13 years, 6 months
teiid SVN: r3247 - branches/7.1.1.CP2/connectors/sandbox.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2011-06-13 12:05:57 -0400 (Mon, 13 Jun 2011)
New Revision: 3247
Removed:
branches/7.1.1.CP2/connectors/sandbox/translator-teradata/
Modified:
branches/7.1.1.CP2/connectors/sandbox/pom.xml
Log:
SOA-3103: removing the sandbox translator
Modified: branches/7.1.1.CP2/connectors/sandbox/pom.xml
===================================================================
--- branches/7.1.1.CP2/connectors/sandbox/pom.xml 2011-06-13 16:01:18 UTC (rev 3246)
+++ branches/7.1.1.CP2/connectors/sandbox/pom.xml 2011-06-13 16:05:57 UTC (rev 3247)
@@ -13,6 +13,5 @@
<description>Experimental connectors in progress</description>
<modules>
<module>translator-yahoo</module>
- <module>translator-teradata</module>
</modules>
</project>
13 years, 6 months
teiid SVN: r3246 - in branches/7.1.1.CP2/connectors: translator-jdbc/src/main/java/org/teiid/translator/jdbc/teradata and 2 other directories.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2011-06-13 12:01:18 -0400 (Mon, 13 Jun 2011)
New Revision: 3246
Added:
branches/7.1.1.CP2/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/teradata/TeradataSQLConversionVisitor.java
branches/7.1.1.CP2/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/teradata/
branches/7.1.1.CP2/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/teradata/TestTeradataTranslator.java
Modified:
branches/7.1.1.CP2/connectors/sandbox/translator-teradata/
branches/7.1.1.CP2/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/teradata/TeradataExecutionFactory.java
Log:
SOA-3103
Property changes on: branches/7.1.1.CP2/connectors/sandbox/translator-teradata
___________________________________________________________________
Added: svn:ignore
+ .settings
.project
.classpath
target
Modified: branches/7.1.1.CP2/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/teradata/TeradataExecutionFactory.java
===================================================================
--- branches/7.1.1.CP2/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/teradata/TeradataExecutionFactory.java 2011-06-13 14:52:40 UTC (rev 3245)
+++ branches/7.1.1.CP2/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/teradata/TeradataExecutionFactory.java 2011-06-13 16:01:18 UTC (rev 3246)
@@ -22,60 +22,449 @@
package org.teiid.translator.jdbc.teradata;
+import java.sql.Date;
+import java.sql.Time;
+import java.sql.Timestamp;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.List;
+import org.teiid.language.ColumnReference;
+import org.teiid.language.Expression;
+import org.teiid.language.Function;
+import org.teiid.language.LanguageFactory;
+import org.teiid.language.Literal;
+import org.teiid.translator.SourceSystemFunctions;
import org.teiid.translator.Translator;
+import org.teiid.translator.TranslatorException;
+import org.teiid.translator.TypeFacility;
+import org.teiid.translator.jdbc.AliasModifier;
+import org.teiid.translator.jdbc.ConvertModifier;
+import org.teiid.translator.jdbc.FunctionModifier;
import org.teiid.translator.jdbc.JDBCExecutionFactory;
+import org.teiid.translator.jdbc.SQLConversionVisitor;
/**
- * for Teradata database Release V2R5.1
+ * Teradata database Release 12
*/
@Translator(name="teradata", description="A translator for Teradata Database")
public class TeradataExecutionFactory extends JDBCExecutionFactory {
+ public static String TERADATA = "teradata"; //$NON-NLS-1$
+ protected ConvertModifier convert = new ConvertModifier();
+
public TeradataExecutionFactory() {
setSupportsOuterJoins(false);
}
+ @Override
+ public void start() throws TranslatorException {
+ super.start();
+ convert.addTypeMapping("byteint", FunctionModifier.BYTE, FunctionModifier.SHORT, FunctionModifier.BOOLEAN); //$NON-NLS-1$
+ convert.addTypeMapping("double precision", FunctionModifier.DOUBLE); //$NON-NLS-1$
+ convert.addTypeMapping("numeric(18,0)", FunctionModifier.BIGINTEGER); //$NON-NLS-1$
+ convert.addTypeMapping("char(1)", FunctionModifier.CHAR); //$NON-NLS-1$
+
+ convert.addConvert(FunctionModifier.TIMESTAMP, FunctionModifier.TIME, new CastModifier("TIME")); //$NON-NLS-1$
+ convert.addConvert(FunctionModifier.TIMESTAMP, FunctionModifier.DATE, new CastModifier("DATE")); //$NON-NLS-1$
+ convert.addConvert(FunctionModifier.TIME, FunctionModifier.TIMESTAMP, new CastModifier("TIMESTAMP")); //$NON-NLS-1$
+ convert.addConvert(FunctionModifier.DATE, FunctionModifier.TIMESTAMP, new CastModifier("TIMESTAMP")); //$NON-NLS-1$
+
+ convert.addConvert(FunctionModifier.STRING, FunctionModifier.INTEGER, new CastModifier("integer")); //$NON-NLS-1$
+ convert.addConvert(FunctionModifier.STRING, FunctionModifier.BIGDECIMAL, new CastModifier("decimal(37,5)"));//$NON-NLS-1$
+ convert.addConvert(FunctionModifier.STRING, FunctionModifier.BIGINTEGER, new CastModifier("numeric(18,0)"));//$NON-NLS-1$
+ convert.addConvert(FunctionModifier.STRING, FunctionModifier.FLOAT, new CastModifier("float"));//$NON-NLS-1$
+ convert.addConvert(FunctionModifier.STRING, FunctionModifier.BOOLEAN, new CastModifier("byteint"));//$NON-NLS-1$
+ convert.addConvert(FunctionModifier.STRING, FunctionModifier.LONG, new CastModifier("numeric(18,0)"));//$NON-NLS-1$
+ convert.addConvert(FunctionModifier.STRING, FunctionModifier.SHORT, new CastModifier("smallint"));//$NON-NLS-1$
+ convert.addConvert(FunctionModifier.STRING, FunctionModifier.DOUBLE, new CastModifier("double precision"));//$NON-NLS-1$
+ convert.addConvert(FunctionModifier.STRING, FunctionModifier.BYTE, new CastModifier("byteint")); //$NON-NLS-1$
+
+ convert.addConvert(FunctionModifier.TIMESTAMP, FunctionModifier.STRING, new FunctionModifier() {
+ @Override
+ public List<?> translate(Function function) {
+ return Arrays.asList("cast(cast(", function.getParameters().get(0), " AS FORMAT 'Y4-MM-DDBHH:MI:SSDS(6)') AS VARCHAR(26))"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ });
+ convert.addConvert(FunctionModifier.TIME, FunctionModifier.STRING, new FunctionModifier() {
+ @Override
+ public List<?> translate(Function function) {
+ return Arrays.asList("cast(cast(", function.getParameters().get(0), " AS FORMAT 'HH:MI:SS') AS VARCHAR(9))"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ });
+ convert.addConvert(FunctionModifier.DATE, FunctionModifier.STRING, new FunctionModifier() {
+ @Override
+ public List<?> translate(Function function) {
+ return Arrays.asList("cast(cast(", function.getParameters().get(0), " AS FORMAT 'YYYY-MM-DD') AS VARCHAR(11))"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ });
+
+ convert.addTypeMapping("varchar(4000)", FunctionModifier.STRING); //$NON-NLS-1$
+ convert.addNumericBooleanConversions();
+
+ registerFunctionModifier(SourceSystemFunctions.CONVERT, convert);
+ registerFunctionModifier(SourceSystemFunctions.SUBSTRING, new SubstrModifier(this.convert));
+ registerFunctionModifier(SourceSystemFunctions.RAND, new AliasModifier("random")); //$NON-NLS-1$
+ registerFunctionModifier(SourceSystemFunctions.LOG, new AliasModifier("LN")); //$NON-NLS-1$
+ registerFunctionModifier(SourceSystemFunctions.LCASE, new StringOnlyModifier("LOWER", this.convert)); //$NON-NLS-1$
+ registerFunctionModifier(SourceSystemFunctions.UCASE, new StringOnlyModifier("UPPER", this.convert)); //$NON-NLS-1$
+ registerFunctionModifier(SourceSystemFunctions.LENGTH, new FunctionModifier() {
+ @Override
+ public List<?> translate(Function function) {
+ ArrayList target = new ArrayList();
+ target.add("character_length("); //$NON-NLS-1$
+ target.addAll(expressionToString(function.getParameters().get(0), convert));
+ target.add(")"); //$NON-NLS-1$
+ return target;
+ }
+ });
+ registerFunctionModifier(SourceSystemFunctions.CURDATE, new AliasModifier("CURRENT_DATE")); //$NON-NLS-1$
+ registerFunctionModifier(SourceSystemFunctions.CURTIME, new AliasModifier("CURRENT_TIME")); //$NON-NLS-1$
+ registerFunctionModifier(SourceSystemFunctions.YEAR, new ExtractModifier("YEAR")); //$NON-NLS-1$
+ registerFunctionModifier(SourceSystemFunctions.MONTH, new ExtractModifier("MONTH")); //$NON-NLS-1$
+ registerFunctionModifier(SourceSystemFunctions.DAYOFMONTH, new ExtractModifier("DAY")); //$NON-NLS-1$
+ registerFunctionModifier(SourceSystemFunctions.HOUR, new ExtractModifier("HOUR")); //$NON-NLS-1$
+ registerFunctionModifier(SourceSystemFunctions.MINUTE, new ExtractModifier("MINUTE")); //$NON-NLS-1$
+ registerFunctionModifier(SourceSystemFunctions.SECOND, new ExtractModifier("SECOND")); //$NON-NLS-1$
+ registerFunctionModifier(SourceSystemFunctions.LOCATE, new LocateModifier(this.convert));
+ registerFunctionModifier(SourceSystemFunctions.LEFT, new LeftOrRightFunctionModifier(getLanguageFactory(), this.convert));
+ registerFunctionModifier(SourceSystemFunctions.RIGHT, new LeftOrRightFunctionModifier(getLanguageFactory(), this.convert));
+ registerFunctionModifier(SourceSystemFunctions.COT, new FunctionModifier() {
+ @Override
+ public List<?> translate(Function function) {
+ function.setName(SourceSystemFunctions.TAN);
+ return Arrays.asList(getLanguageFactory().createFunction(SourceSystemFunctions.DIVIDE_OP, new Expression[] {new Literal(1, TypeFacility.RUNTIME_TYPES.INTEGER), function}, TypeFacility.RUNTIME_TYPES.DOUBLE));
+ }
+ });
+ registerFunctionModifier(SourceSystemFunctions.LTRIM, new FunctionModifier() {
+ @Override
+ public List<?> translate(Function function) {
+ ArrayList target = new ArrayList();
+ target.add("TRIM(LEADING FROM ");//$NON-NLS-1$
+ target.addAll(expressionToString(function.getParameters().get(0), convert));
+ target.add(")"); //$NON-NLS-1$
+ return target;
+ }
+ });
+ registerFunctionModifier(SourceSystemFunctions.RTRIM, new FunctionModifier() {
+ @Override
+ public List<?> translate(Function function) {
+ ArrayList target = new ArrayList();
+ target.add("TRIM(TRAILING FROM ");//$NON-NLS-1$
+ target.addAll(expressionToString(function.getParameters().get(0), convert));
+ target.add(")"); //$NON-NLS-1$
+ return target;
+ }
+ });
+ registerFunctionModifier(SourceSystemFunctions.MOD, new FunctionModifier() {
+ @Override
+ public List<?> translate(Function function) {
+ return Arrays.asList(function.getParameters().get(0), " MOD ", function.getParameters().get(1)); //$NON-NLS-1$
+ }
+ });
+
+ /* Push down support only available from 7.4
+ addPushDownFunction(TERADATA, "COSH", FLOAT, FLOAT); //$NON-NLS-1$
+ addPushDownFunction(TERADATA, "TANH", FLOAT, FLOAT); //$NON-NLS-1$
+ addPushDownFunction(TERADATA, "ACOSH", FLOAT, FLOAT); //$NON-NLS-1$
+ addPushDownFunction(TERADATA, "ASINH", FLOAT, FLOAT); //$NON-NLS-1$
+ addPushDownFunction(TERADATA, "ATANH", FLOAT, FLOAT); //$NON-NLS-1$
+ addPushDownFunction(TERADATA, "CHAR2HEXINT", STRING, STRING); //$NON-NLS-1$
+ addPushDownFunction(TERADATA, "INDEX", INTEGER, STRING, STRING); //$NON-NLS-1$
+ addPushDownFunction(TERADATA, "BYTES", INTEGER, STRING); //$NON-NLS-1$
+ addPushDownFunction(TERADATA, "OCTET_LENGTH", INTEGER, STRING); //$NON-NLS-1$
+ addPushDownFunction(TERADATA, "HASHAMP", INTEGER, STRING); //$NON-NLS-1$
+ addPushDownFunction(TERADATA, "HASHBAKAMP", INTEGER, STRING); //$NON-NLS-1$
+ addPushDownFunction(TERADATA, "HASHBUCKET", INTEGER, STRING); //$NON-NLS-1$
+ addPushDownFunction(TERADATA, "HASHROW", INTEGER, STRING); //$NON-NLS-1$
+ addPushDownFunction(TERADATA, "NULLIFZERO", BIG_DECIMAL, BIG_DECIMAL); //$NON-NLS-1$
+ addPushDownFunction(TERADATA, "ZEROIFNULL", BIG_DECIMAL, BIG_DECIMAL); //$NON-NLS-1$
+ */
+ }
+
+ @Override
+ public SQLConversionVisitor getSQLConversionVisitor() {
+ return new TeradataSQLConversionVisitor(this);
+ }
+
+
@Override
public List getSupportedFunctions() {
- List supportedFunctions = new ArrayList();
+ List<String> supportedFunctions = new ArrayList<String>();
supportedFunctions.addAll(super.getSupportedFunctions());
- supportedFunctions.add("ABS"); //$NON-NLS-1$
- supportedFunctions.add("ACOS"); //$NON-NLS-1$
- supportedFunctions.add("ASIN"); //$NON-NLS-1$
- supportedFunctions.add("ATAN"); //$NON-NLS-1$
- supportedFunctions.add("ATAN2"); //$NON-NLS-1$
- supportedFunctions.add("COS"); //$NON-NLS-1$
- supportedFunctions.add("EXP"); //$NON-NLS-1$
-// supportedFunctions.add("LOG"); //$NON-NLS-1$ // "LN"
-// supportedFunctions.add("LOG10"); //$NON-NLS-1$ // "LOG"
- supportedFunctions.add("MOD"); //$NON-NLS-1$
- supportedFunctions.add("SIN"); //$NON-NLS-1$
- supportedFunctions.add("SQRT"); //$NON-NLS-1$
- supportedFunctions.add("TAN"); //$NON-NLS-1$
- supportedFunctions.add("||"); //$NON-NLS-1$
-// supportedFunctions.add("CONCAT"); //$NON-NLS-1$ // "||"
-// supportedFunctions.add("LCASE"); //$NON-NLS-1$ // "LOWER"
-// supportedFunctions.add("LOCATE"); //$NON-NLS-1$ //"POSITION", "INDEX" ?
- supportedFunctions.add("LOWER"); //$NON-NLS-1$
- supportedFunctions.add("SUBSTRING"); //$NON-NLS-1$
-// supportedFunctions.add("UCASE"); //$NON-NLS-1$ // "UPPER"
- supportedFunctions.add("UPPER"); //$NON-NLS-1$
- supportedFunctions.add("HOUR"); //$NON-NLS-1$
- supportedFunctions.add("MONTH"); //$NON-NLS-1$
- supportedFunctions.add("YEAR"); //$NON-NLS-1$
- supportedFunctions.add("DAY"); //$NON-NLS-1$
- supportedFunctions.add("MINUTE"); //$NON-NLS-1$
- supportedFunctions.add("SECOND"); //$NON-NLS-1$
- supportedFunctions.add("CAST"); //$NON-NLS-1$
- //supportedFunctions.add("CONVERT"); //$NON-NLS-1$ "CAST"
+ supportedFunctions.add(SourceSystemFunctions.ABS);
+ supportedFunctions.add(SourceSystemFunctions.ACOS);
+ supportedFunctions.add(SourceSystemFunctions.ASIN);
+ supportedFunctions.add(SourceSystemFunctions.ATAN);
+ supportedFunctions.add(SourceSystemFunctions.ATAN2);
+ supportedFunctions.add(SourceSystemFunctions.COALESCE);
+ supportedFunctions.add(SourceSystemFunctions.COS);
+ supportedFunctions.add(SourceSystemFunctions.COT);
+ supportedFunctions.add(SourceSystemFunctions.CONVERT);
+ supportedFunctions.add(SourceSystemFunctions.CURDATE);
+ supportedFunctions.add(SourceSystemFunctions.CURTIME);
+ supportedFunctions.add(SourceSystemFunctions.DAYOFMONTH);
+ supportedFunctions.add(SourceSystemFunctions.EXP);
+ supportedFunctions.add(SourceSystemFunctions.HOUR);
+ supportedFunctions.add(SourceSystemFunctions.LEFT);
+ supportedFunctions.add(SourceSystemFunctions.LOCATE);
+ supportedFunctions.add(SourceSystemFunctions.LOG);
+ supportedFunctions.add(SourceSystemFunctions.LCASE);
+ supportedFunctions.add(SourceSystemFunctions.LTRIM);
+ supportedFunctions.add(SourceSystemFunctions.LENGTH);
+ supportedFunctions.add(SourceSystemFunctions.MINUTE);
+ supportedFunctions.add(SourceSystemFunctions.MOD);
+ supportedFunctions.add(SourceSystemFunctions.MONTH);
+ supportedFunctions.add(SourceSystemFunctions.NULLIF);
+ supportedFunctions.add(SourceSystemFunctions.RAND);
+ supportedFunctions.add(SourceSystemFunctions.RIGHT);
+ supportedFunctions.add(SourceSystemFunctions.RTRIM);
+ supportedFunctions.add(SourceSystemFunctions.SECOND);
+ supportedFunctions.add(SourceSystemFunctions.SIN);
+ supportedFunctions.add(SourceSystemFunctions.SQRT);
+ supportedFunctions.add(SourceSystemFunctions.SUBSTRING);
+ supportedFunctions.add(SourceSystemFunctions.TAN);
+ supportedFunctions.add(SourceSystemFunctions.UCASE);
+ supportedFunctions.add(SourceSystemFunctions.YEAR);
return supportedFunctions;
}
+ @Override
+ public String translateLiteralDate(Date dateValue) {
+ return "cast('" + formatDateValue(dateValue) + "' AS DATE FORMAT 'yyyy-mm-dd')"; //$NON-NLS-1$//$NON-NLS-2$
+ }
+
+ @Override
+ public String translateLiteralTime(Time timeValue) {
+ return "cast('" + formatDateValue(timeValue) + "' AS TIME(0) FORMAT 'hh:mi:ss')"; //$NON-NLS-1$//$NON-NLS-2$
+ }
+
+ @Override
+ public String translateLiteralTimestamp(Timestamp timestampValue) {
+ return "cast('" + formatDateValue(timestampValue) + "' AS TIMESTAMP(6))"; //$NON-NLS-1$//$NON-NLS-2$
+ }
+
+ // Teradata also supports MINUS & ALL set operators
+ // more aggregates available
+
+ @Override
+ public boolean supportsScalarSubqueries() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsUnions() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsIntersect() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsExcept() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsInlineViews() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsAggregatesEnhancedNumeric() {
+ return true;
+ }
+
+ /* only in 7.4
+ @Override
+ public boolean supportsCommonTableExpressions() {
+ return false;
+ }
+ */
+
+ @Override
+ public NullOrder getDefaultNullOrder() {
+ return NullOrder.FIRST;
+ }
+
+ @Override
+ public boolean supportsSetQueryOrderBy() {
+ return false;
+ }
+
+ public static class LocateModifier extends FunctionModifier {
+ ConvertModifier convertModifier;
+
+ public LocateModifier(ConvertModifier convertModifier) {
+ this.convertModifier = convertModifier;
+ }
+
+ @Override
+ public List<?> translate(Function function) {
+ ArrayList target = new ArrayList();
+ Expression expr1 = function.getParameters().get(0);
+ Expression expr2 = function.getParameters().get(1);
+ if (function.getParameters().size() > 2) {
+ Expression expr3 = function.getParameters().get(2);
+ target.add("position("); //$NON-NLS-1$
+ target.addAll(expressionToString(expr1, this.convertModifier));
+ target.add( " in "); //$NON-NLS-1$
+ target.add("substr("); //$NON-NLS-1$
+ target.addAll(expressionToString(expr2, this.convertModifier));
+ target.add(","); //$NON-NLS-1$
+ target.add(expr3);
+ target.add("))"); //$NON-NLS-1$
+ }
+ else {
+ target.add("position("); //$NON-NLS-1$
+ target.addAll(expressionToString(expr1, this.convertModifier));
+ target.add( " in "); //$NON-NLS-1$
+ target.addAll(expressionToString(expr2, this.convertModifier));
+ target.add(")"); //$NON-NLS-1$
+ }
+ return target;
+ }
+ }
+
+ private static List<?> expressionToString(Expression expr, ConvertModifier modifier) {
+ Class tgtType = expr.getType();
+ if (tgtType.equals(String.class) && ((expr instanceof Literal) || expr instanceof ColumnReference)) {
+ return Arrays.asList(expr);
+ }
+ else if (tgtType.equals(String.class) && (expr instanceof Function)) {
+
+ Function func = (Function)expr;
+ while(true) {
+ Expression arg1 = func.getParameters().get(0);
+ if ((arg1 instanceof Function) && ((Function)arg1).getName().equals("convert")) { //$NON-NLS-1$
+ func = (Function)arg1;
+ }
+ else {
+ break;
+ }
+ }
+ Expression arg1 = func.getParameters().get(0);
+ if (arg1 instanceof ColumnReference) {
+ ColumnReference ref = (ColumnReference)func.getParameters().get(0);
+ if(Number.class.isAssignableFrom(ref.getType())) {
+ ArrayList target = new ArrayList();
+ target.add("cast("); //$NON-NLS-1$
+ target.add(func.getParameters().get(0));
+ target.add(" AS varchar(100))"); //$NON-NLS-1$
+ return target;
+ }
+ else if (String.class.isAssignableFrom(ref.getType())) {
+ return Arrays.asList(ref);
+ }
+ }
+ return modifier.translate(func);
+ }
+ return Arrays.asList("cast(" , expr, " AS varchar(100))"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ public static class ExtractModifier extends FunctionModifier {
+ private String type;
+ public ExtractModifier(String type) {
+ this.type = type;
+ }
+ @Override
+ public List<?> translate(Function function) {
+ return Arrays.asList("extract(",this.type," from ",function.getParameters().get(0) ,")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ }
+ }
+
+ public static class CastModifier extends FunctionModifier {
+ private String target;
+ public CastModifier(String target) {
+ this.target = target;
+ }
+ @Override
+ public List<?> translate(Function function) {
+ return Arrays.asList("cast(", function.getParameters().get(0), " AS "+this.target+")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ }
+ }
+
+ public static class StringOnlyModifier extends FunctionModifier {
+ String funcName;
+ ConvertModifier convertModifier;
+ public StringOnlyModifier(String name, ConvertModifier converModifier) {
+ this.funcName = name;
+ this.convertModifier = converModifier;
+ }
+ @Override
+ public List<?> translate(Function function) {
+ Expression expr = function.getParameters().get(0);
+ ArrayList target = new ArrayList();
+ target.add(this.funcName);
+ target.add("("); //$NON-NLS-1$
+ target.addAll(expressionToString(expr, this.convertModifier));
+ target.add(")"); //$NON-NLS-1$
+ return target;
+ }
+ }
+
+ public static class SubstrModifier extends FunctionModifier {
+ ConvertModifier convertModifier;
+ public SubstrModifier(ConvertModifier converModifier) {
+ this.convertModifier = converModifier;
+ }
+ @Override
+ public List<?> translate(Function function) {
+ Expression expr = function.getParameters().get(0);
+ ArrayList target = new ArrayList();
+ target.add("substr("); //$NON-NLS-1$
+ target.addAll(expressionToString(expr, this.convertModifier));
+ target.add(","); //$NON-NLS-1$
+ target.add(function.getParameters().get(1));
+ if (function.getParameters().size() > 2 ) {
+ target.add(","); //$NON-NLS-1$
+ target.add(function.getParameters().get(2));
+ }
+ target.add(")"); //$NON-NLS-1$
+ return target;
+ }
+ }
+
+ public static class LeftOrRightFunctionModifier extends FunctionModifier {
+ private LanguageFactory langFactory;
+ ConvertModifier convertModifier;
+
+ public LeftOrRightFunctionModifier(LanguageFactory langFactory, ConvertModifier converModifier) {
+ this.langFactory = langFactory;
+ this.convertModifier = converModifier;
+ }
+
+ @Override
+ public List<?> translate(Function function) {
+ List<Expression> args = function.getParameters();
+ ArrayList target = new ArrayList();
+ if (function.getName().equalsIgnoreCase("left")) { //$NON-NLS-1$
+ //substr(string, 1, length)
+ target.add("substr("); //$NON-NLS-1$
+ target.addAll(expressionToString(args.get(0), this.convertModifier));
+ target.add(","); //$NON-NLS-1$
+ target.add(langFactory.createLiteral(Integer.valueOf(1), TypeFacility.RUNTIME_TYPES.INTEGER));
+ target.add(","); //$NON-NLS-1$
+ target.add(args.get(1));
+ target.add(")"); //$NON-NLS-1$
+ } else if (function.getName().equalsIgnoreCase("right")) { //$NON-NLS-1$
+ //substr(case_size, character_length(case_size) -4)
+ target.add("substr("); //$NON-NLS-1$
+ target.addAll(expressionToString(args.get(0), this.convertModifier));
+
+ target.add(",(character_length("); //$NON-NLS-1$
+ target.addAll(expressionToString(args.get(0), this.convertModifier));
+ target.add(")-"); //$NON-NLS-1$
+ target.add(args.get(1));
+ target.add("+1))"); //$NON-NLS-1$ // offset for 1 based index
+ }
+ return target;
+ }
+ }
}
Added: branches/7.1.1.CP2/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/teradata/TeradataSQLConversionVisitor.java
===================================================================
--- branches/7.1.1.CP2/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/teradata/TeradataSQLConversionVisitor.java (rev 0)
+++ branches/7.1.1.CP2/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/teradata/TeradataSQLConversionVisitor.java 2011-06-13 16:01:18 UTC (rev 3246)
@@ -0,0 +1,72 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+package org.teiid.translator.jdbc.teradata;
+
+import java.util.List;
+
+import org.teiid.language.AndOr;
+import org.teiid.language.Comparison;
+import org.teiid.language.Condition;
+import org.teiid.language.Expression;
+import org.teiid.language.In;
+import org.teiid.language.LanguageFactory;
+import org.teiid.language.AndOr.Operator;
+import org.teiid.translator.jdbc.SQLConversionVisitor;
+
+public class TeradataSQLConversionVisitor extends SQLConversionVisitor {
+
+ public TeradataSQLConversionVisitor(TeradataExecutionFactory ef) {
+ super(ef);
+ }
+
+ @Override
+ public void visit(In obj) {
+ List<Expression> exprs = obj.getRightExpressions();
+
+ Class expectedType = obj.getLeftExpression().getType();
+
+ boolean decompose = false;
+ for (Expression expr:exprs) {
+ if (!(expr.getType().equals(expectedType)) || (!(expr.getType().isAssignableFrom(Number.class)) && !expr.getType().isAssignableFrom(String.class))) {
+ decompose = true;
+ }
+ }
+
+ if (decompose) {
+ Comparison.Operator opCode = obj.isNegated()?Comparison.Operator.NE:Comparison.Operator.EQ;
+ if (exprs.size() > 1) {
+ Condition left = LanguageFactory.INSTANCE.createCompareCriteria(opCode, obj.getLeftExpression(), exprs.get(0));
+ for (int i = 1; i < exprs.size(); i++) {
+ AndOr replace = LanguageFactory.INSTANCE.createAndOr(obj.isNegated()?Operator.AND:Operator.OR, left, LanguageFactory.INSTANCE.createCompareCriteria(opCode, obj.getLeftExpression(), exprs.get(i)));
+ left = replace;
+ }
+ super.visit((AndOr)left);
+ }
+ else {
+ super.visit(LanguageFactory.INSTANCE.createCompareCriteria(opCode, obj.getLeftExpression(), exprs.get(0)));
+ }
+ }
+ else {
+ super.visit(obj);
+ }
+ }
+}
Property changes on: branches/7.1.1.CP2/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/teradata/TeradataSQLConversionVisitor.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: branches/7.1.1.CP2/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/teradata/TestTeradataTranslator.java
===================================================================
--- branches/7.1.1.CP2/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/teradata/TestTeradataTranslator.java (rev 0)
+++ branches/7.1.1.CP2/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/teradata/TestTeradataTranslator.java 2011-06-13 16:01:18 UTC (rev 3246)
@@ -0,0 +1,207 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+package org.teiid.translator.jdbc.teradata;
+
+import static org.junit.Assert.assertEquals;
+
+import java.sql.Date;
+import java.sql.Timestamp;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.teiid.language.Expression;
+import org.teiid.language.Function;
+import org.teiid.language.In;
+import org.teiid.language.LanguageFactory;
+import org.teiid.query.unittest.TimestampUtil;
+import org.teiid.translator.TranslatorException;
+import org.teiid.translator.TypeFacility;
+import org.teiid.translator.jdbc.SQLConversionVisitor;
+import org.teiid.translator.jdbc.TranslationHelper;
+
+@SuppressWarnings("nls")
+public class TestTeradataTranslator {
+
+ private static TeradataExecutionFactory TRANSLATOR;
+ private static final LanguageFactory LANG_FACTORY = new LanguageFactory();
+
+ @BeforeClass
+ public static void setUp() throws TranslatorException {
+ TRANSLATOR = new TeradataExecutionFactory();
+ TRANSLATOR.setUseBindVariables(false);
+ TRANSLATOR.start();
+ }
+
+ public void helpTest(Expression srcExpression, String tgtType, String expectedExpression) throws Exception {
+ Function func = LANG_FACTORY.createFunction("convert",
+ Arrays.asList( srcExpression,LANG_FACTORY.createLiteral(tgtType, String.class)),TypeFacility.getDataTypeClass(tgtType));
+
+ assertEquals("Error converting from " + srcExpression.getType() + " to " + tgtType,
+ expectedExpression, helpGetString(func));
+ }
+
+ public String helpGetString(Expression expr) throws Exception {
+ SQLConversionVisitor sqlVisitor = TRANSLATOR.getSQLConversionVisitor();
+ sqlVisitor.append(expr);
+
+ return sqlVisitor.toString();
+ }
+
+ @Test public void testSubstring1() throws Exception {
+ String input = "SELECT dayofmonth(datevalue) FROM BQT1.SMALLA";
+ String output = "SELECT extract(DAY from SmallA.DateValue) FROM SmallA";
+
+ TranslationHelper.helpTestVisitor(TranslationHelper.BQT_VDB, input, output, TRANSLATOR);
+ }
+
+ @Test public void testTimestampToTime() throws Exception {
+ helpTest(LANG_FACTORY.createLiteral(TimestampUtil.createTimestamp(111, 4, 5, 9, 16, 34, 220000000), Timestamp.class), "time", "cast(cast('2011-05-05 09:16:34.22' AS TIMESTAMP(6)) AS TIME)");
+ }
+
+ @Test public void testIntegerToString() throws Exception {
+ String input = "SELECT lcase(bigdecimalvalue) FROM BQT1.SMALLA";
+ String output = "SELECT LOWER(cast(SmallA.BigDecimalValue AS varchar(100))) FROM SmallA";
+ TranslationHelper.helpTestVisitor(TranslationHelper.BQT_VDB, input, output, TRANSLATOR);
+ }
+
+ @Test public void testSubString() throws Exception {
+ String input = "SELECT intkey FROM BQT1.SmallA WHERE SUBSTRING(BQT1.SmallA.IntKey, 1) = '1' ORDER BY intkey";
+ String output = "SELECT SmallA.IntKey FROM SmallA WHERE substr(cast(SmallA.IntKey AS varchar(100)),1) = '1' ORDER BY SmallA.IntKey";
+ TranslationHelper.helpTestVisitor(TranslationHelper.BQT_VDB, input, output, TRANSLATOR);
+ }
+
+ @Test public void testSubString2() throws Exception {
+ String input = "SELECT intkey FROM BQT1.SmallA WHERE SUBSTRING(BQT1.SmallA.IntKey, 1, 2) = '1' ORDER BY intkey";
+ String output = "SELECT SmallA.IntKey FROM SmallA WHERE substr(cast(SmallA.IntKey AS varchar(100)),1,2) = '1' ORDER BY SmallA.IntKey";
+ TranslationHelper.helpTestVisitor(TranslationHelper.BQT_VDB, input, output, TRANSLATOR);
+ }
+
+ @Test public void testDateToString() throws Exception {
+ String input = "SELECT intkey, UPPER(timevalue) AS UPPER FROM BQT1.SmallA ORDER BY intkey";
+ String output = "SELECT SmallA.IntKey, UPPER(cast(cast(SmallA.TimeValue AS FORMAT 'HH:MI:SS') AS VARCHAR(9))) AS UPPER FROM SmallA ORDER BY SmallA.IntKey";
+ TranslationHelper.helpTestVisitor(TranslationHelper.BQT_VDB, input, output, TRANSLATOR);
+ }
+
+ @Test public void testLocate() throws Exception {
+ String input = "SELECT INTKEY, BIGDECIMALVALUE FROM BQT1.SmallA WHERE LOCATE('-', BIGDECIMALVALUE) = 1 ORDER BY intkey";
+ String output = "SELECT SmallA.IntKey, SmallA.BigDecimalValue FROM SmallA WHERE position('-' in cast(SmallA.BigDecimalValue AS varchar(100))) = 1 ORDER BY SmallA.IntKey";
+ TranslationHelper.helpTestVisitor(TranslationHelper.BQT_VDB, input, output, TRANSLATOR);
+ }
+
+
+ @Test public void testByteToString() throws Exception {
+ helpTest(LANG_FACTORY.createLiteral(new Byte((byte)1), Byte.class), "string", "cast(1 AS varchar(4000))");
+ }
+
+ @Test public void testByte2ToString() throws Exception {
+ helpTest(LANG_FACTORY.createLiteral(new Byte((byte)-1), Byte.class), "string", "cast(-1 AS varchar(4000))");
+ }
+
+ @Test public void testDoubleToString() throws Exception {
+ helpTest(LANG_FACTORY.createLiteral(new Double(1.0), Double.class), "string", "cast(1.0 AS varchar(4000))");
+ }
+
+ @Test public void testStringToDouble() throws Exception {
+ helpTest(LANG_FACTORY.createLiteral("1.0", String.class), "double", "cast('1.0' AS double precision)");
+ }
+
+ @Test public void testInDecompose() throws Exception {
+ Expression left = LANG_FACTORY.createLiteral("1", String.class);
+ List<Expression> right = new ArrayList<Expression>();
+ right.add(LANG_FACTORY.createLiteral("2", String.class));
+ right.add(LANG_FACTORY.createLiteral("3", String.class));
+
+ In expr = LANG_FACTORY.createIn(left,right, false);
+
+ assertEquals("'1' IN ('2', '3')", helpGetString(expr));
+ }
+
+ @Test public void testSingleInDecompose() throws Exception {
+ Expression left = LANG_FACTORY.createLiteral("1", String.class);
+ List<Expression> right = new ArrayList<Expression>();
+ right.add(LANG_FACTORY.createLiteral("2", String.class));
+
+ In expr = LANG_FACTORY.createIn(left,right, false);
+
+ assertEquals("'1' IN ('2')", helpGetString(expr));
+ }
+
+ @Test public void testInDecomposeNonLiterals() throws Exception {
+ Expression left = LANG_FACTORY.createLiteral("1", String.class);
+ List<Expression> right = new ArrayList<Expression>();
+ right.add(LANG_FACTORY.createFunction("func", new Expression[] {}, Date.class));
+ right.add(LANG_FACTORY.createLiteral("3", String.class));
+
+ In expr = LANG_FACTORY.createIn(left,right, false);
+
+ assertEquals("'1' = func() OR '1' = '3'", helpGetString(expr));
+ }
+
+ @Test public void testNegatedInDecomposeNonLiterals() throws Exception {
+ Expression left = LANG_FACTORY.createLiteral("1", String.class);
+ List<Expression> right = new ArrayList<Expression>();
+ right.add(LANG_FACTORY.createFunction("func", new Expression[] {}, Date.class));
+ right.add(LANG_FACTORY.createLiteral("3", String.class));
+
+ In expr = LANG_FACTORY.createIn(left,right, true);
+
+ assertEquals("'1' <> func() AND '1' <> '3'", helpGetString(expr));
+ }
+
+ @Test public void testsingleInDecomposeNonLiterals() throws Exception {
+ Expression left = LANG_FACTORY.createLiteral("1", String.class);
+ List<Expression> right = new ArrayList<Expression>();
+ right.add(LANG_FACTORY.createFunction("func", new Expression[] {}, Date.class));
+
+ In expr = LANG_FACTORY.createIn(left,right, false);
+
+ assertEquals("'1' = func()", helpGetString(expr));
+ }
+
+ /* only 7.4
+ @Test public void testNullComapreNull() throws Exception {
+ String input = "SELECT INTKEY, STRINGKEY, DOUBLENUM FROM bqt1.smalla WHERE NULL <> NULL";
+ String out = "SELECT SmallA.IntKey, SmallA.StringKey, SmallA.DoubleNum FROM SmallA WHERE 1 = 0";
+ TranslationHelper.helpTestVisitor(TranslationHelper.BQT_VDB, null, input, out, TRANSLATOR);
+ }
+ @Test public void testPushDownFunction() throws Exception {
+ String input = "SELECT teradata.HASHBAKAMP(STRINGKEY) DOUBLENUM FROM bqt1.smalla";
+ String out = "SELECT HASHBAKAMP(SmallA.StringKey) AS DOUBLENUM FROM SmallA";
+ TranslationHelper.helpTestVisitor(TranslationHelper.BQT_VDB, null, input, out, TRANSLATOR);
+ }
+ */
+
+ @Test public void testRightFunction() throws Exception {
+ String input = "SELECT INTKEY, FLOATNUM FROM BQT1.SmallA WHERE right(FLOATNUM, 2) <> 0 ORDER BY INTKEY";
+ String out = "SELECT SmallA.IntKey, SmallA.FloatNum FROM SmallA WHERE substr(cast(SmallA.FloatNum AS varchar(100)),(character_length(cast(SmallA.FloatNum AS varchar(100)))-2+1)) <> '0' ORDER BY SmallA.IntKey";
+ TranslationHelper.helpTestVisitor(TranslationHelper.BQT_VDB, null, input, out, TRANSLATOR);
+ }
+
+ @Test public void testLocateFunction() throws Exception {
+ String input = "SELECT INTKEY, STRINGKEY, SHORTVALUE FROM BQT1.SmallA WHERE (LOCATE(0, STRINGKEY) = 2) OR (LOCATE(2, SHORTVALUE, 4) = 6) ORDER BY intkey";
+ String out = "SELECT SmallA.IntKey, SmallA.StringKey, SmallA.ShortValue FROM SmallA WHERE position('0' in SmallA.StringKey) = 2 OR position('2' in substr(cast(SmallA.ShortValue AS varchar(100)),4)) = 6 ORDER BY SmallA.IntKey";
+ TranslationHelper.helpTestVisitor(TranslationHelper.BQT_VDB, null, input, out, TRANSLATOR);
+ }
+}
Property changes on: branches/7.1.1.CP2/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/teradata/TestTeradataTranslator.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
13 years, 6 months
teiid SVN: r3245 - in branches/7.4.x/runtime/src: test/java/org/teiid/deployers and 1 other directory.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2011-06-13 10:52:40 -0400 (Mon, 13 Jun 2011)
New Revision: 3245
Modified:
branches/7.4.x/runtime/src/main/java/org/teiid/deployers/CompositeVDB.java
branches/7.4.x/runtime/src/test/java/org/teiid/deployers/TestCompositeVDB.java
Log:
TEIID-1618 fix for removeChild causing subsequent npe
Modified: branches/7.4.x/runtime/src/main/java/org/teiid/deployers/CompositeVDB.java
===================================================================
--- branches/7.4.x/runtime/src/main/java/org/teiid/deployers/CompositeVDB.java 2011-06-10 19:34:01 UTC (rev 3244)
+++ branches/7.4.x/runtime/src/main/java/org/teiid/deployers/CompositeVDB.java 2011-06-13 14:52:40 UTC (rev 3245)
@@ -146,17 +146,19 @@
newMergedVDB.setConnectionType(this.vdb.getConnectionType());
ConnectorManagerRepository mergedRepo = new ConnectorManagerRepository();
mergedRepo.getConnectorManagers().putAll(this.cmr.getConnectorManagers());
- for (CompositeVDB child:this.children.values()) {
-
- // add models
- for (Model m:child.getVDB().getModels()) {
- newMergedVDB.addModel((ModelMetaData)m);
+ if (this.children != null) {
+ for (CompositeVDB child:this.children.values()) {
+
+ // add models
+ for (Model m:child.getVDB().getModels()) {
+ newMergedVDB.addModel((ModelMetaData)m);
+ }
+
+ for (DataPolicy p:child.getVDB().getDataPolicies()) {
+ newMergedVDB.addDataPolicy((DataPolicyMetadata)p);
+ }
+ mergedRepo.getConnectorManagers().putAll(child.cmr.getConnectorManagers());
}
-
- for (DataPolicy p:child.getVDB().getDataPolicies()) {
- newMergedVDB.addDataPolicy((DataPolicyMetadata)p);
- }
- mergedRepo.getConnectorManagers().putAll(child.cmr.getConnectorManagers());
}
newMergedVDB.addAttchment(ConnectorManagerRepository.class, mergedRepo);
return newMergedVDB;
Modified: branches/7.4.x/runtime/src/test/java/org/teiid/deployers/TestCompositeVDB.java
===================================================================
--- branches/7.4.x/runtime/src/test/java/org/teiid/deployers/TestCompositeVDB.java 2011-06-10 19:34:01 UTC (rev 3244)
+++ branches/7.4.x/runtime/src/test/java/org/teiid/deployers/TestCompositeVDB.java 2011-06-13 14:52:40 UTC (rev 3245)
@@ -21,6 +21,8 @@
*/
package org.teiid.deployers;
+import static org.junit.Assert.*;
+
import java.util.ArrayList;
import java.util.List;
@@ -40,12 +42,20 @@
import org.teiid.query.sql.lang.Command;
import org.teiid.query.unittest.RealMetadataFactory;
import org.teiid.translator.ExecutionFactory;
+import org.teiid.vdb.runtime.VDBKey;
@SuppressWarnings("nls")
public class TestCompositeVDB {
public static TransformationMetadata createTransformationMetadata(MetadataStore metadataStore, String vdbName) throws Exception {
- VDBMetaData vdbMetaData = new VDBMetaData();
+ CompositeVDB cvdb = createCompositeVDB(metadataStore, vdbName);
+ VDBMetaData vdb = cvdb.getVDB();
+ return vdb.getAttachment(TransformationMetadata.class);
+ }
+
+ private static CompositeVDB createCompositeVDB(MetadataStore metadataStore,
+ String vdbName) {
+ VDBMetaData vdbMetaData = new VDBMetaData();
vdbMetaData.setName(vdbName); //$NON-NLS-1$
vdbMetaData.setVersion(1);
for (Schema schema : metadataStore.getSchemas().values()) {
@@ -59,8 +69,7 @@
cmr.addConnectorManager("source2", getConnectorManager("bqt2", "FakeTranslator2", "FakeConnection2", getFuncsTwo()));
CompositeVDB cvdb = new CompositeVDB(vdbMetaData, metaGroup, null, null, RealMetadataFactory.SFM.getSystemFunctions(),cmr);
- VDBMetaData vdb = cvdb.getVDB();
- return vdb.getAttachment(TransformationMetadata.class);
+ return cvdb;
}
private static ConnectorManager getConnectorManager(String modelName, String translatorName, String connectionName, List<FunctionMethod> funcs) {
@@ -103,7 +112,7 @@
private void helpResolve(String sql) throws Exception {
- TransformationMetadata metadata = createTransformationMetadata(RealMetadataFactory.exampleBQTStore(), "bqt");
+ TransformationMetadata metadata = createTransformationMetadata(RealMetadataFactory.exampleBQTCached().getMetadataStore(), "bqt");
Command command = QueryParser.getQueryParser().parseCommand(sql);
QueryResolver.resolveCommand(command, metadata);
}
@@ -138,4 +147,10 @@
helpResolve("SELECT duplicate_func(BQT1.SmallA.INTKEY) FROM BQT1.SmallA");
}
+ @Test public void testRemoveChild() throws Exception {
+ CompositeVDB vdb = createCompositeVDB(RealMetadataFactory.exampleBQTStore(), "bqt");
+ vdb.removeChild(new VDBKey("foo", 1));
+ assertNotNull(vdb.getVDB());
+ }
+
}
13 years, 6 months