| 113 | } |
| 114 | |
| 115 | bool SQLBatchRequestResultSet::Next() { |
| 116 | index_++; |
| 117 | if (index_ < static_cast<int32_t>(response_->count()) && |
| 118 | position_ < byte_size_) { |
| 119 | if (non_common_schema_.empty()) { |
| 120 | return true; |
| 121 | } |
| 122 | // get row size |
| 123 | uint32_t row_size = 0; |
| 124 | cntl_->response_attachment().copy_to(&row_size, 4, position_ + 2); |
| 125 | DLOG(INFO) << "row size " << row_size << " position " << position_ |
| 126 | << " byte size " << byte_size_; |
| 127 | butil::IOBuf tmp; |
| 128 | cntl_->response_attachment().append_to(&tmp, row_size, position_); |
| 129 | position_ += row_size; |
| 130 | bool ok = non_common_row_view_->Reset(tmp); |
| 131 | if (!ok) { |
| 132 | LOG(WARNING) << "reset row buf failed"; |
| 133 | return false; |
| 134 | } |
| 135 | return true; |
| 136 | } |
| 137 | return false; |
| 138 | } |
| 139 | |
| 140 | bool SQLBatchRequestResultSet::Reset() { |
| 141 | index_ = -1; |