(data []byte)
| 941 | } |
| 942 | |
| 943 | func (m *SqlSourcePb) MarshalTo(data []byte) (int, error) { |
| 944 | var i int |
| 945 | _ = i |
| 946 | var l int |
| 947 | _ = l |
| 948 | data[i] = 0x8 |
| 949 | i++ |
| 950 | if m.Final { |
| 951 | data[i] = 1 |
| 952 | } else { |
| 953 | data[i] = 0 |
| 954 | } |
| 955 | i++ |
| 956 | if m.AliasInner != nil { |
| 957 | data[i] = 0x12 |
| 958 | i++ |
| 959 | i = encodeVarintSql(data, i, uint64(len(*m.AliasInner))) |
| 960 | i += copy(data[i:], *m.AliasInner) |
| 961 | } |
| 962 | if len(m.Columns) > 0 { |
| 963 | for _, msg := range m.Columns { |
| 964 | data[i] = 0x1a |
| 965 | i++ |
| 966 | i = encodeVarintSql(data, i, uint64(msg.Size())) |
| 967 | n, err := msg.MarshalTo(data[i:]) |
| 968 | if err != nil { |
| 969 | return 0, err |
| 970 | } |
| 971 | i += n |
| 972 | } |
| 973 | } |
| 974 | if len(m.ColIndex) > 0 { |
| 975 | for _, msg := range m.ColIndex { |
| 976 | data[i] = 0x22 |
| 977 | i++ |
| 978 | i = encodeVarintSql(data, i, uint64(msg.Size())) |
| 979 | n, err := msg.MarshalTo(data[i:]) |
| 980 | if err != nil { |
| 981 | return 0, err |
| 982 | } |
| 983 | i += n |
| 984 | } |
| 985 | } |
| 986 | if len(m.JoinNodes) > 0 { |
| 987 | for _, msg := range m.JoinNodes { |
| 988 | data[i] = 0x2a |
| 989 | i++ |
| 990 | i = encodeVarintSql(data, i, uint64(msg.Size())) |
| 991 | n, err := msg.MarshalTo(data[i:]) |
| 992 | if err != nil { |
| 993 | return 0, err |
| 994 | } |
| 995 | i += n |
| 996 | } |
| 997 | } |
| 998 | if m.Source != nil { |
| 999 | data[i] = 0x32 |
| 1000 | i++ |
no test coverage detected