[teiid-issues] [JBoss JIRA] (TEIID-2553) Partial insert statements being submitted with incorrect default values

Steven Hawkins (JIRA) jira-events at lists.jboss.org
Fri Jun 14 12:39:54 EDT 2013


     [ https://issues.jboss.org/browse/TEIID-2553?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Steven Hawkins resolved TEIID-2553.
-----------------------------------

    Resolution: Done


Moved the clone ahead of getting the default.
                
> Partial insert statements being submitted with incorrect default values
> -----------------------------------------------------------------------
>
>                 Key: TEIID-2553
>                 URL: https://issues.jboss.org/browse/TEIID-2553
>             Project: Teiid
>          Issue Type: Bug
>          Components: Query Engine
>    Affects Versions: 8.2
>            Reporter: Bobby Diaz
>            Assignee: Steven Hawkins
>            Priority: Critical
>             Fix For: 8.4.1, 8.5
>
>
> InsertResolver is causing incorrect default values to be returned by the ResolverUtil due to the wrong element symbol being sent to the ResolverUtil.getDefault() method.  In the code below, taken from InsertResolver.getVariableValues(), I believe the first two rows inside the if statement should be reversed so that next.clone() is used to determine the default value rather than the varSymbol whose type has been changed to BOOLEAN.
> Collection<ElementSymbol> insertElmnts = ResolverUtil.resolveElementsInGroup(insert.getGroup(), metadata);
> insertElmnts.removeAll(insert.getVariables());
> Iterator<ElementSymbol> defaultIter = insertElmnts.iterator();
> while(defaultIter.hasNext()) {
>     ElementSymbol next = defaultIter.next();
>     ElementSymbol varSymbol = next.clone();
>     varSymbol.getGroupSymbol().setName(ProcedureReservedWords.CHANGING);
>     varSymbol.setType(DataTypeManager.DefaultDataClasses.BOOLEAN);
>     result.put(varSymbol, new Constant(Boolean.FALSE));
>     if (!changingOnly) {
>         Expression value = ResolverUtil.getDefault(varSymbol, metadata);
>         varSymbol = next.clone();
>         varSymbol.getGroupSymbol().setName(SQLConstants.Reserved.NEW);
>         result.put(varSymbol, value);
>     }
> }

--
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


More information about the teiid-issues mailing list