File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -895,9 +895,15 @@ func (cc *clientConn) handleFieldList(sql string) (err error) {
895
895
return errors .Trace (err )
896
896
}
897
897
data := make ([]byte , 4 , 1024 )
898
- for _ , v := range columns {
898
+ for _ , column := range columns {
899
+ // Current we doesn't output defaultValue but reserve defaultValue length byte to make mariadb client happy.
900
+ // https://dev.mysql.com/doc/internals/en/com-query-response.html#column-definition
901
+ // TODO: fill the right DefaultValues.
902
+ column .DefaultValueLength = 0
903
+ column .DefaultValue = []byte {}
904
+
899
905
data = data [0 :4 ]
900
- data = v .Dump (data )
906
+ data = column .Dump (data )
901
907
if err := cc .writePacket (data ); err != nil {
902
908
return errors .Trace (err )
903
909
}
You can’t perform that action at this time.
0 commit comments