query, report https://gist.github.com/alesapin/c91d9ffd65471c4d8b595219a26a601a.
Full report
https://clickhouse-test-reports.s3.yandex.net/19412/cc2788af881c96701076b366259bc99525d926b1/fuzzer_asan/report.html#fail1
to ISO 8601:1988
                  If set The week that contains the first
                        'first-day-of-week' is week 1.
      WeekModeFlag::NEWYEAR_DAY (3) If not set no meaning
                  If set The week that contains the January 1 is week 1.
                            Week is in range 1-53.
                            And ignore WeekModeFlag::YEAR, WeekModeFlag::FIRST_WEEKDAY
        ISO 8601:1988 means that if the week containing January 1 has
        four or more days in the new year, then it is week 1;
        Otherwise it is the last week of the previous year, and the
        next week is week 1.
    */
    inline YearWeek toYearWeek(DayNum d, UInt8 week_mode) const
    {
        bool newyear_day_mode = week_mode & static_cast<UInt8>(WeekModeFlag::NEWYEAR_DAY);
        week_mode = check_week_mode(week_mode);
        bool monday_first_mode = week_mode & static_cast<UInt8>(WeekModeFlag::MONDAY_FIRST);
        bool week_year_mode = week_mode & static_cast<UInt8>(WeekModeFlag::YEAR);
        bool first_weekday_mode = week_mode & static_cast<UInt8>(WeekModeFlag::FIRST_WEEKDAY);
        
        if (newyear_day_mode)
        {
            return toYearWeekOfNewyearMode(d, monday_first_mode);
        }
        YearWeek yw(toYear(d), 0);
        UInt16 days = 0;
        UInt16 daynr = makeDayNum(yw.first, toMonth(d), toDayOfMonth(d));
        UInt16 first_daynr = makeDayNum(yw.first, 1, 1);