| 270 | } |
| 271 | |
| 272 | IntVal StringFunctions::CharLength(FunctionContext* context, const StringVal& str) { |
| 273 | if (str.is_null) return IntVal::null(); |
| 274 | const FunctionContext::TypeDesc* t = context->GetArgType(0); |
| 275 | DCHECK_EQ(t->type, FunctionContext::TYPE_FIXED_BUFFER); |
| 276 | return StringValue::UnpaddedCharLength(reinterpret_cast<char*>(str.ptr), t->len); |
| 277 | } |
| 278 | |
| 279 | static int CountUtf8Chars(uint8_t* ptr, int len) { |
| 280 | if (ptr == nullptr) return 0; |
nothing calls this directly
no test coverage detected