| 156 | } |
| 157 | |
| 158 | bool SQLBatchRequestResultSet::GetString(uint32_t index, std::string* str) { |
| 159 | if (str == NULL) { |
| 160 | LOG(WARNING) << "input ptr is null pointer"; |
| 161 | return false; |
| 162 | } |
| 163 | if (!IsValidColumnIdx(index)) { |
| 164 | LOG(WARNING) << "column idx out of bound " << index; |
| 165 | return false; |
| 166 | } |
| 167 | size_t mapped_index = column_remap_[index]; |
| 168 | butil::IOBuf tmp; |
| 169 | int32_t ret = -1; |
| 170 | if (IsCommonColumnIdx(index)) { |
| 171 | ret = common_row_view_->GetString(mapped_index, &tmp); |
| 172 | } else { |
| 173 | ret = non_common_row_view_->GetString(mapped_index, &tmp); |
| 174 | } |
| 175 | if (ret == 0) { |
| 176 | DLOG(INFO) << "get str size " << tmp.size(); |
| 177 | tmp.append_to(str, tmp.size(), 0); |
| 178 | return true; |
| 179 | } |
| 180 | DLOG(INFO) << "fail to get string with ret " << ret; |
| 181 | return false; |
| 182 | } |
| 183 | |
| 184 | bool SQLBatchRequestResultSet::GetBool(uint32_t index, bool* val) { |
| 185 | if (val == NULL) { |