(ctx context.Context, iprot thrift.TProtocol)
| 4143 | return p.StatementName |
| 4144 | } |
| 4145 | func (p *TSPrepareReq) Read(ctx context.Context, iprot thrift.TProtocol) error { |
| 4146 | if _, err := iprot.ReadStructBegin(ctx); err != nil { |
| 4147 | return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| 4148 | } |
| 4149 | |
| 4150 | var issetSessionId bool = false; |
| 4151 | var issetSql bool = false; |
| 4152 | var issetStatementName bool = false; |
| 4153 | |
| 4154 | for { |
| 4155 | _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) |
| 4156 | if err != nil { |
| 4157 | return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| 4158 | } |
| 4159 | if fieldTypeId == thrift.STOP { break; } |
| 4160 | switch fieldId { |
| 4161 | case 1: |
| 4162 | if fieldTypeId == thrift.I64 { |
| 4163 | if err := p.ReadField1(ctx, iprot); err != nil { |
| 4164 | return err |
| 4165 | } |
| 4166 | issetSessionId = true |
| 4167 | } else { |
| 4168 | if err := iprot.Skip(ctx, fieldTypeId); err != nil { |
| 4169 | return err |
| 4170 | } |
| 4171 | } |
| 4172 | case 2: |
| 4173 | if fieldTypeId == thrift.STRING { |
| 4174 | if err := p.ReadField2(ctx, iprot); err != nil { |
| 4175 | return err |
| 4176 | } |
| 4177 | issetSql = true |
| 4178 | } else { |
| 4179 | if err := iprot.Skip(ctx, fieldTypeId); err != nil { |
| 4180 | return err |
| 4181 | } |
| 4182 | } |
| 4183 | case 3: |
| 4184 | if fieldTypeId == thrift.STRING { |
| 4185 | if err := p.ReadField3(ctx, iprot); err != nil { |
| 4186 | return err |
| 4187 | } |
| 4188 | issetStatementName = true |
| 4189 | } else { |
| 4190 | if err := iprot.Skip(ctx, fieldTypeId); err != nil { |
| 4191 | return err |
| 4192 | } |
| 4193 | } |
| 4194 | default: |
| 4195 | if err := iprot.Skip(ctx, fieldTypeId); err != nil { |
| 4196 | return err |
| 4197 | } |
| 4198 | } |
| 4199 | if err := iprot.ReadFieldEnd(ctx); err != nil { |
| 4200 | return err |
| 4201 | } |
| 4202 | } |
no test coverage detected