File tree Expand file tree Collapse file tree 2 files changed +4
-6
lines changed
src/Microsoft.Data.SqlClient
netcore/src/Microsoft/Data/SqlClient
netfx/src/Microsoft/Data/SqlClient Expand file tree Collapse file tree 2 files changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -577,7 +577,7 @@ internal byte ScaleInternal
577577 }
578578 }
579579
580- private bool ShouldSerializeScale ( ) => _scale != 0 ; // V1.0 compat, ignore _hasScale
580+ private bool ShouldSerializeScale ( ) => _scale != 0 || ( GetMetaTypeOnly ( ) . IsVarTime && HasFlag ( SqlParameterFlags . HasScale ) ) ;
581581
582582 /// <include file='../../../../../../../doc/snippets/Microsoft.Data.SqlClient/SqlParameter.xml' path='docs/members[@name="SqlParameter"]/SqlDbType/*' />
583583 [
@@ -1445,8 +1445,7 @@ internal byte GetActualScale()
14451445 return ScaleInternal ;
14461446 }
14471447
1448- // issue: how could a user specify 0 as the actual scale?
1449- if ( GetMetaTypeOnly ( ) . IsVarTime )
1448+ if ( GetMetaTypeOnly ( ) . IsVarTime && ! HasFlag ( SqlParameterFlags . HasScale ) )
14501449 {
14511450 return TdsEnums . DEFAULT_VARTIME_SCALE ;
14521451 }
Original file line number Diff line number Diff line change @@ -560,7 +560,7 @@ internal byte ScaleInternal
560560 }
561561 }
562562
563- private bool ShouldSerializeScale ( ) => _scale != 0 ; // V1.0 compat, ignore _hasScale
563+ private bool ShouldSerializeScale ( ) => _scale != 0 || ( GetMetaTypeOnly ( ) . IsVarTime && HasFlag ( SqlParameterFlags . HasScale ) ) ;
564564
565565 /// <include file='../../../../../../../doc/snippets/Microsoft.Data.SqlClient/SqlParameter.xml' path='docs/members[@name="SqlParameter"]/SqlDbType/*' />
566566 [
@@ -1437,8 +1437,7 @@ internal byte GetActualScale()
14371437 return ScaleInternal ;
14381438 }
14391439
1440- // issue: how could a user specify 0 as the actual scale?
1441- if ( GetMetaTypeOnly ( ) . IsVarTime )
1440+ if ( GetMetaTypeOnly ( ) . IsVarTime && ! HasFlag ( SqlParameterFlags . HasScale ) )
14421441 {
14431442 return TdsEnums . DEFAULT_VARTIME_SCALE ;
14441443 }
You can’t perform that action at this time.
0 commit comments