[CP] sync bugfix.fix sanity json pl type coredump, fix treat expr in pl coredump

This commit is contained in:
obdev
2024-01-18 04:12:45 +00:00
committed by ob-robot
parent 19084ed6d5
commit e52f385a43
14 changed files with 160 additions and 73 deletions

View File

@ -301,6 +301,11 @@ public:
// @return Returns object_iterator
virtual JsonObjectIterator object_iterator() const;
// Get member count of json.
// scalar 1, array, object as child number
// @return json containner returns the capacity, json scalar return 1.
virtual uint64_t member_count() const = 0;
// getter
virtual bool get_boolean() const = 0;
virtual double get_double() const = 0;

View File

@ -194,6 +194,7 @@ public:
{
return field_type_;
}
int get_array_element(uint64_t index, ObIJsonBase *&value) const override;
int get_object_value(uint64_t index, ObIJsonBase *&value) const override;
int get_object_value(const ObString &key, ObIJsonBase *&value) const override;
@ -398,6 +399,12 @@ public:
// release resource
void destroy();
virtual uint64_t member_count() const override
{
return (json_type() == ObJsonNodeType::J_ARRAY || json_type() == ObJsonNodeType::J_OBJECT) ?
element_count() : 1;
}
private:
// used as stack
struct ObJBNodeMeta {

View File

@ -70,6 +70,7 @@ public:
int get_obtime(ObTime &t) const override;
OB_INLINE ObJsonInType get_internal_type() const override { return ObJsonInType::JSON_TREE; }
OB_INLINE uint64_t element_count() const override { return 1; }
virtual uint64_t member_count() const override { return element_count(); }
OB_INLINE ObObjType field_type() const override
{
return ObMaxType; // ObJsonOpaque override