Skip to content

Comments

Sync upstream#1408

Closed
azat wants to merge 10 commits intojbeder:masterfrom
ClickHouse:sync-upstream
Closed

Sync upstream#1408
azat wants to merge 10 commits intojbeder:masterfrom
ClickHouse:sync-upstream

Conversation

@azat
Copy link

@azat azat commented Feb 19, 2026

This is for ClickHouse/ClickHouse#75031

Which has been fixed in #1406

BoloniniD and others added 10 commits April 20, 2021 09:49
A patch to allow yaml-cpp to compile with gcc and libcxx
Support for YAML Merge keys ( <<: [*dict1, *dict2] ) is added. The merge
key is a specific scalar with value << (and tag !!merge) that implies
that during node construction, the map (or sequence of maps) are merged
into the current map. The priority rules are that each key from maps
within the value associated with  << are added iff the key is not yet
present in the current map (and first map gets higher priority). Test
cases have been added accordingly.
…the node)

The problem is that const_map_to.get(*j->first) compares only the
shared_ptr's, while we need to compare the key itself.

v2: remove const iterator
v3: fix use-after-free due to const reference
Consider the following YAML:

    trait1: &t1
      foo: 1

    trait2: &t2
      foo: 2

    merged:
      <<: *t1
      <<: *t2

yq reports:

    $ yq .merged.foo < /tmp/yaml
    2

while the order that yaml-cpp returns is different, since it will
firstly handle 1, and will not replace it with 2:

    $ util/parse < /tmp/yaml
    trait1:
      ? &1 foo
      : &2 1
    trait2:
      foo: 2
    merged:
      *1 : *2

(Don't mix up "*2" with "2", it is trait1)
* merge-operator:
  Fix order for merging iterator
  Fix merge operator support (that can be visible by iterating through the node)
  Fix merge-key handling in case the dictionary contains a sub-dictionary
  Adding support for handling YAML Merge Key (jbeder#41)
Update lib and apply PR for YAML Merge Key
@azat
Copy link
Author

azat commented Feb 19, 2026

2|azat:.../yaml-cpp/.cmake (sync-upstream)$ ninja test
[00:00][  0%][0/2] Re-checking globbed directories...
[00:00][  0%][0/2] Running tests...
Test project /src/oss/yaml-cpp/.cmake
    Start 1: yaml-cpp::test
1/1 Test #1: yaml-cpp::test ...................   Passed    1.21 sec

100% tests passed, 0 tests failed out of 1

Total Test time (real) =   1.22 sec

@azat azat closed this Feb 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants