@@ -1160,7 +1160,7 @@ protected void visitSetAssignment(Assignment assignment) {
1160
1160
final List <ColumnReference > columnReferences = assignable .getColumnReferences ();
1161
1161
final Expression assignedValue = assignment .getAssignedValue ();
1162
1162
if ( columnReferences .size () == 1 ) {
1163
- columnReferences .get ( 0 ). appendColumnForWrite ( this , null );
1163
+ appendColumn ( columnReferences .get ( 0 ) );
1164
1164
appendSql ( '=' );
1165
1165
final SqlTuple sqlTuple = getSqlTuple ( assignedValue );
1166
1166
if ( sqlTuple != null ) {
@@ -1175,7 +1175,7 @@ else if ( assignedValue instanceof SelectStatement ) {
1175
1175
char separator = OPEN_PARENTHESIS ;
1176
1176
for ( ColumnReference columnReference : columnReferences ) {
1177
1177
appendSql ( separator );
1178
- columnReference . appendColumnForWrite ( this , null );
1178
+ appendColumn ( columnReference );
1179
1179
separator = COMMA_SEPARATOR_CHAR ;
1180
1180
}
1181
1181
appendSql ( ")=" );
@@ -1184,7 +1184,7 @@ else if ( assignedValue instanceof SelectStatement ) {
1184
1184
else {
1185
1185
assert assignedValue instanceof SqlTupleContainer ;
1186
1186
final List <? extends Expression > expressions = ( (SqlTupleContainer ) assignedValue ).getSqlTuple ().getExpressions ();
1187
- columnReferences .get ( 0 ). appendColumnForWrite ( this , null );
1187
+ appendColumn ( columnReferences .get ( 0 ) );
1188
1188
appendSql ( '=' );
1189
1189
expressions .get ( 0 ).accept ( this );
1190
1190
for ( int i = 1 ; i < columnReferences .size (); i ++ ) {
@@ -1196,6 +1196,13 @@ else if ( assignedValue instanceof SelectStatement ) {
1196
1196
}
1197
1197
}
1198
1198
1199
+ protected void appendColumn (ColumnReference column ) {
1200
+ column .appendColumnForWrite (
1201
+ this ,
1202
+ affectedTableNames .size () > 1 ? determineColumnReferenceQualifier ( column ) : null
1203
+ );
1204
+ }
1205
+
1199
1206
protected void visitSetAssignmentEmulateJoin (Assignment assignment , UpdateStatement statement ) {
1200
1207
final Assignable assignable = assignment .getAssignable ();
1201
1208
if ( assignable instanceof SqmPathInterpretation <?> sqmPathInterpretation ) {
0 commit comments