| 194 | } |
| 195 | |
| 196 | bool RowBuilder::SetNULL(uint32_t index) { |
| 197 | const ::fedb::common::ColumnDesc& column = schema_.Get(index); |
| 198 | if (column.not_null()) return false; |
| 199 | int8_t* ptr = buf_ + HEADER_LENGTH + (index >> 3); |
| 200 | *(reinterpret_cast<uint8_t*>(ptr)) |= 1 << (index & 0x07); |
| 201 | if (column.data_type() == ::fedb::type::kVarchar || |
| 202 | column.data_type() == fedb::type::kString) { |
| 203 | uint32_t str_pos = offset_vec_[index]; |
| 204 | SetStrOffset(str_pos + 1); |
| 205 | } |
| 206 | return true; |
| 207 | } |
| 208 | |
| 209 | void RowBuilder::SetStrOffset(uint32_t str_pos) { |
| 210 | if (str_pos >= str_field_cnt_) { |