MCPcopy Create free account
hub / github.com/4paradigm/OpenMLDB / GetString

Method GetString

src/sdk/batch_request_result_set_sql.cc:158–182  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

156}
157
158bool 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
184bool SQLBatchRequestResultSet::GetBool(uint32_t index, bool* val) {
185 if (val == NULL) {

Callers

nothing calls this directly

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected