(data []byte)
| 1115 | } |
| 1116 | |
| 1117 | func (m *ProjectionPb) MarshalTo(data []byte) (int, error) { |
| 1118 | var i int |
| 1119 | _ = i |
| 1120 | var l int |
| 1121 | _ = l |
| 1122 | data[i] = 0x8 |
| 1123 | i++ |
| 1124 | if m.Distinct { |
| 1125 | data[i] = 1 |
| 1126 | } else { |
| 1127 | data[i] = 0 |
| 1128 | } |
| 1129 | i++ |
| 1130 | data[i] = 0x10 |
| 1131 | i++ |
| 1132 | if m.Final { |
| 1133 | data[i] = 1 |
| 1134 | } else { |
| 1135 | data[i] = 0 |
| 1136 | } |
| 1137 | i++ |
| 1138 | if len(m.ColNames) > 0 { |
| 1139 | for _, s := range m.ColNames { |
| 1140 | data[i] = 0x1a |
| 1141 | i++ |
| 1142 | l = len(s) |
| 1143 | for l >= 1<<7 { |
| 1144 | data[i] = uint8(uint64(l)&0x7f | 0x80) |
| 1145 | l >>= 7 |
| 1146 | i++ |
| 1147 | } |
| 1148 | data[i] = uint8(l) |
| 1149 | i++ |
| 1150 | i += copy(data[i:], s) |
| 1151 | } |
| 1152 | } |
| 1153 | if len(m.Columns) > 0 { |
| 1154 | for _, msg := range m.Columns { |
| 1155 | data[i] = 0x22 |
| 1156 | i++ |
| 1157 | i = encodeVarintSql(data, i, uint64(msg.Size())) |
| 1158 | n, err := msg.MarshalTo(data[i:]) |
| 1159 | if err != nil { |
| 1160 | return 0, err |
| 1161 | } |
| 1162 | i += n |
| 1163 | } |
| 1164 | } |
| 1165 | if m.XXX_unrecognized != nil { |
| 1166 | i += copy(data[i:], m.XXX_unrecognized) |
| 1167 | } |
| 1168 | return i, nil |
| 1169 | } |
| 1170 | |
| 1171 | func (m *ResultColumnPb) Marshal() (data []byte, err error) { |
| 1172 | size := m.Size() |
no test coverage detected