[
https://issues.jboss.org/browse/TEIID-2553?page=com.atlassian.jira.plugin...
]
Steven Hawkins updated TEIID-2553:
----------------------------------
Fix Version/s: 8.4.1
8.5
Priority: Critical (was: Major)
Steps to Reproduce: Execute an INSERT statement against a view with a trigger
action to handle the insert that has a column with a default value, but omit that column
from the INSERT. (was: Execute an INSERT statement for a table that has a column with a
default value, but omit that column from the INSERT.)
Affects Version/s: 8.2
(was: 8.3)
(was: 8.4)
Workaround Description: Expand the insert to include the default values.
Workaround: Workaround Exists
Note this is regression from TEIID-2222
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