[JBoss JIRA] (TEIID-2138) PG DSN for for ODBC metadata query LIKE issues
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-2138?page=com.atlassian.jira.plugin... ]
Steven Hawkins commented on TEIID-2138:
---------------------------------------
Based upon https://community.jboss.org/message/784457 also added one more change to 8.3 so that the system property change is not needed out of the box. If a like is specified using an E'' string literal pattern and no escape is specified we'll assume \ - since E escaping is not generally documented and considered specific to pg support this is not considered a breaking change.
> PG DSN for for ODBC metadata query LIKE issues
> ----------------------------------------------
>
> Key: TEIID-2138
> URL: https://issues.jboss.org/browse/TEIID-2138
> Project: Teiid
> Issue Type: Quality Risk
> Components: ODBC, Query Engine
> Affects Versions: 7.7
> Reporter: Johnathon Lee
> Assignee: Steven Hawkins
> Fix For: 8.2
>
>
> Various clients (Cognos, Excel, DBVisualizer) exhibit different results when querying metadata.
> For instance:
> Querying ModeShape on a fresh 5.3 deploy.
> {code}
> select relname from pg_catalog.pg_class c, pg_catalog.pg_namespace n where relname like E'ddl\\_alterable' and n.oid = relnamespace
> {code}
> 0 Records
> {code}
> select relname from pg_catalog.pg_class c, pg_catalog.pg_namespace n where relname like E'ddl_alterable' and n.oid = relnamespace
> {code}
> 1 Record: ddl_alterable
> {code}
> select relname from pg_catalog.pg_class c, pg_catalog.pg_namespace n where relname like E'ddl\_alterab__' and n.oid = relnamespace
> {code}
> 1 Record: ddl_alterable
> Looking at [1] per [2]. It seems proper escaping of the E'literal' syntax is not always being performed. The Third example above shows that a wildcard is being escaped and happens to match to a literal value it expects.
> [1]
> PostgreSQL also accepts "escape" string constants, which are an extension to the SQL standard. An escape string constant is specified by writing the letter E (upper or lower case) just before the opening single quote, e.g. E'foo'. (When continuing an escape string constant across lines, write E only before the first opening quote.) Within an escape string, a backslash character (\) begins a C-like backslash escape sequence, in which the combination of backslash and following character(s) represents a special byte value. \b is a backspace, \f is a form feed, \n is a newline, \r is a carriage return, \t is a tab. Also supported are \digits, where digits represents an octal byte value, and \xhexdigits, where hexdigits represents a hexadecimal byte value. (It is your responsibility that the byte sequences you create are valid characters in the server character set encoding.) Any other character following a backslash is taken literally. Thus, to include a backslash character, write two backslashes (\\). Also, a single quote can be included in an escape string by writing \', in addition to the normal way of ''.
> [2] http://www.postgresql.org/docs/8.3/interactive/sql-syntax-lexical.html#SQ...
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years, 11 months
[JBoss JIRA] (TEIID-2354) Inherent insert using WHERE partitioning is incomplete
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-2354?page=com.atlassian.jira.plugin... ]
Steven Hawkins resolved TEIID-2354.
-----------------------------------
Resolution: Done
Corrected the rewrite logic to only removed unmapped columns for insert. Also corrected the update counts returned for multi-branch inherent update/delete - which was instead providing a set of updates instead of a single result.
> Inherent insert using WHERE partitioning is incomplete
> ------------------------------------------------------
>
> Key: TEIID-2354
> URL: https://issues.jboss.org/browse/TEIID-2354
> Project: Teiid
> Issue Type: Bug
> Components: Query Engine
> Affects Versions: 7.7
> Reporter: Steven Hawkins
> Assignee: Steven Hawkins
> Fix For: 8.3
>
>
> Using a metadata structure such as:
> create foreign table b (custid integer, field1 varchar) options updatable true)
> create view c options (updatable true) as select * from b where custid = 1 union all select * from b where custid = 2;
> will fail to process INSERT into c (custid, field1) values (1, 'foo')
> because a null value will be inserted into be for the custid field. The logic is treating the WHERE partitioning as if it were projected literals from the SELECT cause inappropriately.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years, 11 months
[JBoss JIRA] (TEIID-2354) Inherent insert using WHERE partitioning is incomplete
by Steven Hawkins (JIRA)
Steven Hawkins created TEIID-2354:
-------------------------------------
Summary: Inherent insert using WHERE partitioning is incomplete
Key: TEIID-2354
URL: https://issues.jboss.org/browse/TEIID-2354
Project: Teiid
Issue Type: Bug
Components: Query Engine
Affects Versions: 7.7
Reporter: Steven Hawkins
Assignee: Steven Hawkins
Fix For: 8.3
Using a metadata structure such as:
create foreign table b (custid integer, field1 varchar) options updatable true)
create view c options (updatable true) as select * from b where custid = 1 union all select * from b where custid = 2;
will fail to process INSERT into c (custid, field1) values (1, 'foo')
because a null value will be inserted into be for the custid field. The logic is treating the WHERE partitioning as if it were projected literals from the SELECT cause inappropriately.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years, 11 months
[JBoss JIRA] (TEIID-2353) Resolving order is not respected by the metadatavalidator
by Steven Hawkins (JIRA)
Steven Hawkins created TEIID-2353:
-------------------------------------
Summary: Resolving order is not respected by the metadatavalidator
Key: TEIID-2353
URL: https://issues.jboss.org/browse/TEIID-2353
Project: Teiid
Issue Type: Bug
Components: Query Engine
Affects Versions: 8.0
Reporter: Steven Hawkins
Assignee: Steven Hawkins
Fix For: 8.3
When resolving a DDL based schema that uses view definitions that omit columns, the statement order of the schema matters to ensure that the views are properly resolved. Currently we'll resolve based upon name order, which can lead to erroneous validation exceptions.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years, 11 months
[JBoss JIRA] (TEIID-2349) Cannot execute Two-Phase Commit using Multi-Source Model Dynamic VDB
by RH Bugzilla Integration (JIRA)
[ https://issues.jboss.org/browse/TEIID-2349?page=com.atlassian.jira.plugin... ]
RH Bugzilla Integration commented on TEIID-2349:
------------------------------------------------
Van Halbert <vhalbert(a)redhat.com> changed the Status of [bug 895304|https://bugzilla.redhat.com/show_bug.cgi?id=895304] from ASSIGNED to MODIFIED
> Cannot execute Two-Phase Commit using Multi-Source Model Dynamic VDB
> --------------------------------------------------------------------
>
> Key: TEIID-2349
> URL: https://issues.jboss.org/browse/TEIID-2349
> Project: Teiid
> Issue Type: Bug
> Components: Server
> Affects Versions: 7.7.1
> Reporter: Van Halbert
> Assignee: Steven Hawkins
> Fix For: 8.1, 7.7.4
>
>
> Description of problem:
> 2nd connection to Multi-Source Model Dynamic VDB is not Two-Phase Commit.
> How reproducible:
> Always
> Steps to Reproduce:
> Execute a update query via Multi-Source Model Dynamic VDB.
> ex)
> vdb - maseter-vdb.xml
> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
> <vdb name="MASTER-VDB" version="1">
> <description>A Dynamic VDB</description>
> <property name="UseConnectorMetadata" value="true" />
> <model visible="true" type="PHYSICAL" name="VDB1">
> <property name="supports-multi-source-bindings" value="true" />
> <source name="db02" translator-name="postgresql" connection-jndi-name="java:/PostgresXADS02" />
> <source name="db01" translator-name="postgresql" connection-jndi-name="java:/PostgresXADS01" />
> </model>
> </vdb>
>
> Additional info:
> Set the multisourceUpdate flag as first query plan creating.
> org.teiid.dqp.internal.process.multisource.MultiSourcePlanToProcessConverter.java
> 90: @Override
> 91: public synchronized RelationalPlan convert(PlanNode planNode)
> 92: throws QueryPlannerException, TeiidComponentException {
> 93: RelationalPlan result = null;
> 94: try {
> 95: result = super.convert(planNode);
> 96: return result;
> 97: } finally {
> 98: if (result != null && update && multiSource) {
> -> 99: result.setMultisourceUpdate(true);
> 100: }
> 101: update = false;
> 102: multiSource = false;
> 103: }
> 104: }
> If multisourceUpdate is true, transactionService is started by teiid engine. But, second connects does not set the multisourceUpdate flag. Therefore, teiid engine does not start transactionService.
> org.teiid.dqp.internal.process.Request.java
> 338: private void createProcessor() throws TeiidComponentException {
> --- snip ---
> 349: if(RequestMessage.TXN_WRAP_ON.equals(requestMsg.getTxnAutoWrapMode())){
> 350: startAutoWrapTxn = true;
> 351: } else if (RequestMessage.TXN_WRAP_DETECT.equals(requestMsg.getTxnAutoWrapMode())){
> 352: boolean transactionalRead = requestMsg.getTransactionIsolation() == Connection.TRANSACTION_REPEATABLE_READ
> 353: || requestMsg.getTransactionIsolation() == Connection.TRANSACTION_SERIALIZABLE;
> -> 354: startAutoWrapTxn = processPlan.requiresTransaction(transactionalRead);
> 355: }
> 356:
> 357: if (startAutoWrapTxn) {
> 358: try {
> -> 359: transactionService.begin(tc);
> 360: } catch (XATransactionException err) {
> 361: throw new TeiidComponentException(err);
> 362: }
> 363: }
> 364: }
> org.teiid.query.processor.relational.RelationalPlan.java
> 254: @Override
> 255: public boolean requiresTransaction(boolean transactionalReads) {
> 256: if (multisourceUpdate) {
> -> 257: return true;
> 258: }
> 259: if (this.with != null) {
> 260: if (transactionalReads) {
> 261: return true;
> 262: }
> 263: for (WithQueryCommand withCommand : this.with) {
> 264: if (withCommand.getCommand().getProcessorPlan().requiresTransaction(transactionalReads)) {
> 265: return true;
> 266: }
> 267: }
> 268: }
> 279: return requiresTransaction(transactionalReads, root);
> 270: }
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years, 11 months
[JBoss JIRA] (TEIID-2350) NPE during call generated REST service from browser
by Ramesh Reddy (JIRA)
[ https://issues.jboss.org/browse/TEIID-2350?page=com.atlassian.jira.plugin... ]
Ramesh Reddy resolved TEIID-2350.
---------------------------------
Resolution: Done
The real issue was when security is used it was not building valid URL, thus connection was null. Corrected the code.
I really wanted to make this deployment WAR to happen each time server starts, such that deployment is transient and deployment order can be controlled. However there is bug in the AS7 code now, undeploy of WAR during shutdown is not cleaning up the content directory correctly. So, I had leave this in persistent mode. When AS7 fixes this in future releases, we will move this to non-persistent.
> NPE during call generated REST service from browser
> ---------------------------------------------------
>
> Key: TEIID-2350
> URL: https://issues.jboss.org/browse/TEIID-2350
> Project: Teiid
> Issue Type: Bug
> Components: Server
> Affects Versions: 8.2
> Environment: Windows 7, JBoss AS 7.1.1 Final
> Reporter: Vadim Melnikov
> Assignee: Ramesh Reddy
> Fix For: 8.3
>
>
> See also discussion at https://community.jboss.org/thread/219690
> Teiid 8.2
> Example from https://docs.jboss.org/author/display/teiid82final/REST+Service+Through+VDB
>
> {code:xml}
> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
> <vdb name="sample" version="1">
>
> <property name="UseConnectorMetadata" value="true" />
> <property name="{http://teiid.org/rest}auto-generate" value="true"/>
> <property name="{http://teiid.org/rest}security-type" value="HttpBasic"/>
> <property name="{http://teiid.org/rest}security-domain" value="teiid-security"/>
> <property name="{http://teiid.org/rest}security-role" value="example-role"/>
> <property name="{http://teiid.org/rest}passthrough-auth" value="true"/>
>
> <model name="PM1">
> <source name="text-connector" translator-name="loopback" />
> <metadata type="DDL"><![CDATA[
> CREATE FOREIGN TABLE G1 (e1 string, e2 integer);
> CREATE FOREIGN TABLE G2 (e1 string, e2 integer);
> ]]> </metadata>
> </model>
> <model name="View" type ="VIRTUAL">
> <metadata type="DDL"><![CDATA[
> SET NAMESPACE 'http://teiid.org/rest' AS REST;
> CREATE VIRTUAL PROCEDURE g1Table(IN p1 integer) RETURNS TABLE (xml_out xml) OPTIONS (UPDATECOUNT 0, "REST:METHOD" 'GET', "REST:URI" 'g1/{p1}')
> AS
> BEGIN
> SELECT XMLELEMENT(NAME "rows", XMLATTRIBUTES (g1Table.p1 as p1), XMLAGG(XMLELEMENT(NAME "row", XMLFOREST(e1, e2)))) AS xml_out FROM PM1.G1;
> END
> ]]> </metadata>
> </model>
>
> </vdb>
> {code}
>
> Open URL: http://localhost:8080/sample_1/view/g1/1
> Error log was generated:
>
> org.jboss.resteasy.spi.UnhandledException: java.lang.NullPointerException
> org.jboss.resteasy.core.SynchronousDispatcher.handleApplicationException(SynchronousDispatcher.java:340)
> org.jboss.resteasy.core.SynchronousDispatcher.handleException(SynchronousDispatcher.java:214)
> org.jboss.resteasy.core.SynchronousDispatcher.handleInvokerException(SynchronousDispatcher.java:190)
> org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:540)
> org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:502)
> org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:119)
> org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208)
> org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55)
> org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
> root cause
> java.lang.NullPointerException
> org.teiid.jboss.rest.TeiidRSProvider.execute(TeiidRSProvider.java:64)
> org.teiid.jboss.rest.View.g1Tableapplication_xml(Unknown Source)
> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> java.lang.reflect.Method.invoke(Method.java:597)
> org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:155)
> org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:257)
> org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:222)
> org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:211)
> org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:525)
> org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:502)
> org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:119)
> org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208)
> org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55)
> org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
>
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years, 11 months
[JBoss JIRA] (TEIID-2352) START USER COMMAND and END USER COMMAND are not shown with loglevel=DEBUG
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-2352?page=com.atlassian.jira.plugin... ]
Steven Hawkins resolved TEIID-2352.
-----------------------------------
Fix Version/s: 8.3
Resolution: Done
The issue was introduced by TEIID-1985. The fix was slightly different than the suggested, since we still do want to restrict plan logging to only if trace is enabled.
The first commit is all that is needed by a backport. The second commit goes further to refine the log level of the plan event and when the plan is shown in the log if just using the default tostring.
> START USER COMMAND and END USER COMMAND are not shown with loglevel=DEBUG
> -------------------------------------------------------------------------
>
> Key: TEIID-2352
> URL: https://issues.jboss.org/browse/TEIID-2352
> Project: Teiid
> Issue Type: Feature Request
> Components: Server
> Affects Versions: 7.7.1
> Reporter: Hisanobu Okuda
> Assignee: Steven Hawkins
> Fix For: 8.3
>
>
> With loglevel=DEBUG, START USER COMMAND and END USER COMMAND log messages are not shown.
> With loglevel=TRACE, they are shown:-
> {code}
> 2013-01-17 13:45:58,205 DEBUG [org.teiid.COMMAND_LOG] (New I/O server worker #1-1:) START USER COMMAND:startTime=2013-01-17 13:45:58.205 requestID=GQ2RlqzuDfet.0 txID=null sessionID=GQ2RlqzuDfet applicationName=JDBC principal=user@teiid-security vdbName=PREVIEW_31af68bd-5f4d-4e77-b13c-94823d02dcf8_test_project vdbVersion=1 sql=select * from "v2"."data2View"
> ...
> 2013-01-17 13:50:23,968 DEBUG [org.teiid.COMMAND_LOG] (Worker2_QueryProcessorQueue9:) END USER COMMAND: endTime=2013-01-17 13:50:23.968 requestID=GQ2RlqzuDfet.0 txID=null sessionID=GQ2RlqzuDfet principal=user@teiid-security vdbName=PREVIEW_31af68bd-5f4d-4e77-b13c-94823d02dcf8_test_project vdbV
> ersion=1 finalRowCount=2
> {code}
> But shown as "DEBUG".
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years, 11 months