Skip to content

Commit

Permalink
Fix issue#34287:Add judgment logic,determine whether the number of pa…
Browse files Browse the repository at this point in the history
…rameters is greater than the number of inserted fields
  • Loading branch information
raojf committed Jan 9, 2025
1 parent 466ba41 commit ed693c1
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,11 @@ private Collection<MySQLPacket> createParameterColumnDefinition41Packets(final S
Collection<MySQLPacket> result = new ArrayList<>(parameterMarkerSegments.size());
Collection<Integer> paramColumnDefinitionFlags = new ArrayList<>(parameterMarkerSegments.size());
for (int index = 0; index < parameterMarkerSegments.size(); index++) {
ShardingSphereColumn column = columnsOfParameterMarkers.isEmpty() ? null : columnsOfParameterMarkers.get(index);
ShardingSphereColumn column = null;
// Determine whether the number of parameters is greater than the number of inserted fields
if (!columnsOfParameterMarkers.isEmpty() && index < columnsOfParameterMarkers.size()) {
column = columnsOfParameterMarkers.get(index);
}
if (null != column) {
int columnDefinitionFlag = calculateColumnDefinitionFlag(column);
result.add(createMySQLColumnDefinition41Packet(characterSet, columnDefinitionFlag, MySQLBinaryColumnType.valueOfJDBCType(column.getDataType())));
Expand Down

0 comments on commit ed693c1

Please sign in to comment.