[
https://issues.jboss.org/browse/TEIID-2553?page=com.atlassian.jira.plugin...
]
Bobby Diaz updated TEIID-2553:
------------------------------
Description:
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);
}
}
was:
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);
}
}
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.3, 8.4
Reporter: Bobby Diaz
Assignee: Steven Hawkins
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