We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 841f067 + dff2d00 commit a47ed0bCopy full SHA for a47ed0b
sql/types/conversion.go
@@ -642,7 +642,7 @@ func GeneralizeTypes(a, b sql.Type) sql.Type {
642
if b == Null {
643
return a
644
}
645
-
+
646
if a == b {
647
648
@@ -722,9 +722,14 @@ func GeneralizeTypes(a, b sql.Type) sql.Type {
722
723
724
if IsText(a) && IsText(b) {
725
- return a
+ sta := a.(sql.StringType)
726
+ stb := b.(sql.StringType)
727
+ if sta.Length() > stb.Length() {
728
+ return a
729
+ }
730
+ return b
731
732
733
// TODO: decide if we want to make this VarChar to match MySQL, match VarChar length to max of two types
734
return LongText
735
0 commit comments