Commit Graph

85266 Commits

Author SHA1 Message Date
Azat Khuzhin
bf4df5c6bb Fix SIGSEGV for build under gcc-11 (due to auto deduction)
During building with gcc-11 you will got SIGSEGV for building
InterpretersMySQLDDLQuery (and some others), and it is due to endless
recursion:

    (gdb) bt 5
    0  0x00000000010978f2 in structural_comptypes (t1=0x7fde028c7dc8, t2=0x7fde028d1e70, strict=0) at ../../src/gcc/cp/typeck.c:1274
    1  0x00000000011c3f9d in comp_template_parms (parms1=<optimized out>, parms2=<optimized out>) at ../../src/gcc/cp/pt.c:3369
    2  0x0000000001097bd9 in structural_comptypes (t1=0x7fde028c7dc8, t2=0x7fde028d1e70, strict=<optimized out>) at ../../src/gcc/cp/typeck.c:1361
    3  0x00000000011c3f9d in comp_template_parms (parms1=<optimized out>, parms2=<optimized out>) at ../../src/gcc/cp/pt.c:3369
    4  0x0000000001097bd9 in structural_comptypes (t1=0x7fde028c7dc8, t2=0x7fde028d1e70, strict=<optimized out>) at ../../src/gcc/cp/typeck.c:1361
    (gdb) bt -X
    1397454 0x0000000001097bd9 in structural_comptypes (t1=0x7fde028d1540, t2=0x7fde028d27e0, strict=<optimized out>) at ../../src/gcc/cp/typeck.c:1361
    1397455 0x0000000000f2d8b5 in cp_tree_equal (t1=<optimized out>, t2=<optimized out>) at ../../src/gcc/cp/tree.c:4144
    1397456 0x00000000010909cb in template_args_equal (ot=0x7fde028cf578, nt=0x7fde028cfc58, partial_order=<optimized out>) at ../../src/gcc/cp/pt.c:9256
    1397457 0x0000000001090422 in template_args_equal (partial_order=false, nt=0x7fde028cfc58, ot=0x7fde028cf578) at ../../src/gcc/cp/pt.c:9295
    1397458 comp_template_args (oldargs=0x7fde028cf550, newargs=0x7fde028cfc30, oldarg_ptr=0x0, newarg_ptr=0x0, partial_order=false) at ../../src/gcc/cp/pt.c:9285
    1397459 0x00000000010a08f4 in spec_hasher::equal (e1=0x7fde028c95d0, e2=0x7ffd1194e8c0) at ../../src/gcc/cp/pt.c:1726
    1397460 0x0000000001085965 in hash_table<spec_hasher, false, xcallocator>::find_with_hash (this=0x7fde36b7f450, comparable=@0x7ffd1194e8b8: 0x7ffd1194e8c0, hash=<optimized out>) at ../../src/gcc/hash-table.h:936
    1397461 0x0000000001079698 in lookup_template_class_1 (d1=<optimized out>, arglist=0x7fde028cfc30, in_decl=0x0, context=<optimized out>, entering_scope=<optimized out>, complain=3) at ../../src/gcc/cp/pt.c:9896
    1397462 0x000000000109f8ef in lookup_template_class (complain=3, entering_scope=1, context=0x7fde27558e40, in_decl=0x0, arglist=0x7fde028cfc08, d1=0x7fde269bcd20) at ../../src/gcc/cp/pt.c:10251
    1397463 tsubst_aggr_type (t=0x7fde269bcd20, args=<optimized out>, complain=3, in_decl=0x0, entering_scope=1) at ../../src/gcc/cp/pt.c:13646
    1397464 0x000000000108f797 in tsubst (t=0x7fde269bcdc8, args=0x7fde028cf7a8, complain=3, in_decl=<optimized out>) at ../../src/gcc/cp/pt.c:16108
    1397465 0x0000000000e61bf2 in rewrite_template_parm (level=1, complain=3, tsubst_args=0x7fde028cf7a8, index=5, olddecl=0x7fde269b5600) at ../../src/gcc/cp/pt.c:28556
    1397466 rewrite_tparm_list(tree_node*, unsigned int, unsigned int, tree_node*, unsigned int, int) [clone .constprop.0] (oldelt=0x7fde269bd190, index=5, targs=0x7fde028cf7a8, targs_index=4, complain=3, level=1) at ../../src/gcc/cp/pt.c:28640
    1397467 0x00000000009f3748 in build_deduction_guide (type=type@entry=0x7fde26e13dc8, ctor=0x7fde269ac300, outer_args=outer_args@entry=0x0, complain=complain@entry=3) at ../../src/gcc/cp/pt.c:28769
    1397468 0x00000000009f444f in ctor_deduction_guides_for (complain=3, tmpl=<optimized out>) at ../../src/gcc/cp/cp-tree.h:842
    1397469 deduction_guides_for (tmpl=<optimized out>, any_dguides_p=<optimized out>, complain=3) at ../../src/gcc/cp/pt.c:29282
    1397470 0x00000000008507a8 in do_class_deduction (complain=3, flags=1, init=<optimized out>, tmpl=0x7fde26e0f980, ptype=0x7fde028c7b28) at ../../src/gcc/cp/pt.c:29402
    1397471 do_auto_deduction (type=0x7fde028c7b28, init=<optimized out>, auto_node=<optimized out>, complain=3, context=<optimized out>, outer_targs=<optimized out>, flags=1) at ../../src/gcc/cp/pt.c:29572
    1397472 0x00000000007c9569 in finish_compound_literal (type=<optimized out>, compound_literal=0x7fde028c95b8, complain=3, fcl_context=fcl_functional) at ../../src/gcc/cp/semantics.c:3060
    1397473 0x0000000001123a79 in cp_parser_functional_cast (parser=0x7fde27558da8, type=0x7fde028c7b28) at ../../src/gcc/cp/parser.c:30670
    1397474 0x0000000000fd7873 in cp_parser_postfix_expression (parser=0x7fde27558da8, address_p=<optimized out>, cast_p=<optimized out>, member_access_only_p=<optimized out>, decltype_p=false, pidk_return=0x0) at ../../src/gcc/cp/parser.c:7437
    1397475 0x0000000000fd4ddf in cp_parser_binary_expression (parser=0x7fde27558da8, cast_p=<optimized out>, no_toplevel_fold_p=false, decltype_p=<optimized out>, prec=PREC_NOT_OPERATOR, pidk=<optimized out>) at ../../src/gcc/cp/parser.c:9842
    1397476 0x0000000000fd4595 in cp_parser_assignment_expression (parser=0x7fde27558da8, pidk=<optimized out>, cast_p=<optimized out>, decltype_p=<optimized out>) at ../../src/gcc/cp/parser.c:10146
    1397477 0x0000000000fd3b90 in cp_parser_constant_expression (parser=0x7fde27558da8, allow_non_constant_p=2, non_constant_p=0x7ffd1194f1d7, strict_p=<optimized out>) at ../../src/gcc/cp/parser.c:10449
    1397478 0x0000000000fcfdd5 in cp_parser_initializer_clause (non_constant_p=<optimized out>, parser=0x7fde27558da8) at ../../src/gcc/cp/parser.c:24253
    1397479 cp_parser_initializer (parser=0x7fde27558da8, is_direct_init=<optimized out>, non_constant_p=<optimized out>, subexpression_p=<optimized out>) at ../../src/gcc/cp/parser.c:24193
    1397480 0x000000000062e5d8 in cp_parser_decomposition_declaration (init_loc=0x7ffd1194f1d8, maybe_range_for_decl=0x7ffd1194f498, decl_specifiers=0x7ffd1194f1f0, parser=0x7fde27558da8) at ../../src/gcc/cp/parser.c:14734
    1397481 cp_parser_simple_declaration (parser=0x7fde27558da8, function_definition_allowed_p=<optimized out>, maybe_range_for_decl=0x7ffd1194f498) at ../../src/gcc/cp/parser.c:14393
    1397482 0x000000000109b870 in cp_parser_init_statement (parser=0x7fde27558da8, decl=0x7ffd1194f498) at ../../src/gcc/cp/parser.c:13420
    1397483 0x00000000010996f0 in cp_parser_for (unroll=0, ivdep=false, parser=0x7fde27558da8) at ../../src/gcc/cp/parser.c:12708
    1397484 cp_parser_iteration_statement (parser=0x7fde27558da8, if_p=0x0, ivdep=<optimized out>, unroll=<optimized out>) at ../../src/gcc/cp/parser.c:13343
    1397485 0x0000000000fe5c46 in cp_parser_statement (parser=0x7fde27558da8, in_statement_expr=0x0, in_compound=<optimized out>, if_p=0x0, chain=0x0, loc_after_labels=0x0) at ../../src/gcc/cp/parser.c:11718
    1397486 0x0000000000fe15ac in cp_parser_statement_seq_opt (in_statement_expr=<optimized out>, parser=<optimized out>) at ../../src/gcc/cp/parser.c:12201
    1397487 cp_parser_compound_statement (parser=0x7fde27558da8, in_statement_expr=0x0, bcs_flags=<optimized out>, function_body=<optimized out>) at ../../src/gcc/cp/parser.c:12150

Interesting frame is 1397471, from which we can extract location:

    (gdb) p line_table[0].info_ordinary.maps[line_table[0].info_ordinary.cache]
    $54 = {
      <line_map> = {
        start_location = 1396581280
      },
      members of line_map_ordinary:
      reason = LC_RENAME,
      sysp = 0 '\000',
      m_column_and_range_bits = 8,
      m_range_bits = 0,
      to_file = 0x3eb4bb0 "/ch/src/Interpreters/MySQL/InterpretersMySQLDDLQuery.cpp",
      to_line = 46,
      included_from = 0
    }

By replicating SOURCE_LINE() macro from gcc-11 (libcpp/include/line-map.h):

    /* Converts a map and a location_t to source line.  */
    inline linenum_type
    SOURCE_LINE (const line_map_ordinary *ord_map, location_t loc)
    {
      return ((loc - ord_map->start_location)
          >> ord_map->m_column_and_range_bits) + ord_map->to_line;
    }

We got line 154:

    (gdb) p ((input_location-1396581280) >> 8) + 46
    $61 = 154

And this is:

    auto [column_name_and_type, declare_column_ast] = std::tuple{columns_name_and_type.begin(), columns_definition->children.begin()};

After rewriting it, everything works correctly.

Also here is a reproducer for gcc-11 (and no failures for gcc-12, but
gcc-12 has other issues, like [1] and one more for hash table):

    # cat /tmp/test.cpp
    #include <tuple>

    auto multi()
    {
            return std::tuple{1, 1};
    }
    double foo()
    {
            auto [a, b] = multi();
            return a - b;
    }

    # g++-11 -std=gnu++20 -c -o /dev/null -isystem /ch/contrib/libcxx/include -nostdinc++ /tmp/test.cpp
    g++-11: internal compiler error: Segmentation fault signal terminated program cc1plus
    Please submit a full bug report,
    with preprocessed source if appropriate.
    See <file:///usr/share/doc/gcc-11/README.Bugs> for instructions.
    # g++-12 -std=gnu++20 -c -o /dev/null -isystem /ch/contrib/libcxx/include -nostdinc++ /tmp/test.cpp

  [1]: https://reviews.llvm.org/D122598

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-03-28 22:21:45 +03:00
Azat Khuzhin
53eb49a2e2 avro: create symlink in binary dir (over source dir)
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-03-27 14:11:11 +03:00
Azat Khuzhin
13f2b2c0a3 Use proper type for RadixSortTraits in RowRefs.cpp
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-03-27 11:32:51 +03:00
Azat Khuzhin
6151e9b059 Avoid using std::result_of (deprecated in c++ > 17)
Fixes: #34906
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-03-27 11:19:56 +03:00
Azat Khuzhin
806a4bcdee Add build with GCC
v2: Add gcc build to "ClickHouse special build check (actions)"
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-03-26 23:42:46 +03:00
Azat Khuzhin
6a3986f41b Fix redundant-move in ReadWriteBufferFromHTTP.h 2022-03-26 23:42:46 +03:00
Azat Khuzhin
d518614524 Fix multi-line comment in threadPoolCallbackRunner.cpp 2022-03-26 23:42:46 +03:00
Azat Khuzhin
55e9f60448 Fix building of SerializationObject
gcc11 reports:

    ld.lld: error: undefined symbol: void DB::readEscapedStringInto<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, DB::ReadBuffer&)
    >>> referenced by SerializationObject.cpp:201 (./src/DataTypes/Serializations/SerializationObject.cpp:201)
    >>>               SerializationObject.cpp.o:(void DB::SerializationObject<DB::JSONDataParser<DB::SimdJSONParser> >::deserializeTextImpl<DB::SerializationObject<DB::JSONDataParser<DB::SimdJSONParser> >::deserializeTextEscaped(DB::IColumn&, DB::ReadBuffer&, DB::FormatSettings const&) const::'lambda'(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&)>(DB::IColumn&, DB::SerializationObject<DB::JSONDataParser<DB::SimdJSONParser> >::deserializeTextEscaped(DB::IColumn&, DB::ReadBuffer&, DB::FormatSettings const&) const::'lambda'(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&)&&) const) in archive src/libdbms.a
    collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-03-26 23:42:46 +03:00
Azat Khuzhin
be4fea335c Fix non-existing include dir (rapidjson)
gcc reports:

    Mar 21 16:10:33 cc1plus: error: ../src/ch_contrib::rapidjson: No such file or directory [-Werror=missing-include-dirs]

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-03-26 23:42:46 +03:00
Azat Khuzhin
a847b71611 Fix SubcolumnsTree declaration
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-03-26 23:42:46 +03:00
Azat Khuzhin
6da2c48b7a Add missing __builtin_unreachable for switch/case for gcc
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-03-26 23:42:21 +03:00
Alexey Milovidov
619e11bcf6
Merge pull request #34906 from Algunenano/libcxx14
Switch to libcxx / libcxxabi from LLVM 14
2022-03-26 19:12:30 +03:00
Raúl Marín
e4558b1568 Update submodules libc++ to LLVM 14 2022-03-26 11:12:22 +01:00
alesapin
14e84ff6ef
Merge pull request #34802 from ClickHouse/overcommit-doc
Add documentation for memory overcommit
2022-03-25 20:50:44 +01:00
Alexey Milovidov
e426a9a2f1
Merge pull request #35541 from amosbird/betterbracketedpaste
Pasting improvement of clickhouse-client
2022-03-25 22:15:40 +03:00
alesapin
296ab350d6
Merge pull request #35622 from ClickHouse/remove_old_ci_db
Push only to the new CI DB
2022-03-25 19:07:50 +01:00
alesapin
2712368f78 Push only to the new CI DB 2022-03-25 17:44:53 +01:00
Antonio Andelic
e27a68ef8c
Merge pull request #35576 from ClickHouse/fix-casewithexpression-type-deduction
Fix `caseWithExpression` return type deduction
2022-03-25 16:01:31 +01:00
Vladimir C
cfb12aff6f
Merge pull request #35460 from helifu/master 2022-03-25 15:55:17 +01:00
tavplubix
ce99b95230
Merge pull request #35594 from ClickHouse/fix_stupid_bug
Fix stupid bug in ATTACH TABLE
2022-03-25 14:38:27 +03:00
Antonio Andelic
e76074ef7f Merge branch 'master' into fix-casewithexpression-type-deduction 2022-03-25 11:12:38 +00:00
alesapin
058b641d13
Update docs/en/operations/settings/memory-overcommit.md 2022-03-25 11:32:23 +01:00
alesapin
083f810940
Merge pull request #35533 from ClickHouse/simplify_strip
Simplify strip for new packages
2022-03-25 11:05:50 +01:00
Antonio Andelic
f6439efcad
Merge pull request #35459 from ClickHouse/case-insensitive-column-matching
Support for case insensitive column matching for ORC/Arrow/Parquet files
2022-03-25 08:09:29 +01:00
mergify[bot]
6267ba4445
Merge branch 'master' into fix_stupid_bug 2022-03-25 01:30:48 +00:00
Alexey Milovidov
3f37a03e62
Merge pull request #35595 from ClickHouse/blinkov-patch-23
[docs] remove Metrika counter
2022-03-25 04:18:06 +03:00
Alexey Milovidov
bf7a6a9e85
Merge pull request #35601 from kitaisreal/functions-cast-ip-address-add-into-changelog
Functions cast into IPv4, IPV6 update changelog
2022-03-25 03:06:17 +03:00
Kruglov Pavel
2f2d3cdbca
Merge pull request #35578 from ClickHouse/Avogar-patch-3
Increase fiber stack size a bit in attempt to fix stack overflow in tests with address sanitizer
2022-03-25 00:33:05 +01:00
Nikita Mikhaylov
64f79f0c69
Added an ability to specify cluster secret in replicated database (#35333) 2022-03-25 00:14:26 +01:00
Mikhail f. Shiryaev
572b15a63c
Fix paths and some cmake typos 2022-03-24 23:11:19 +01:00
Maksim Kita
7b03617341
Merge pull request #35539 from kitaisreal/parse-ipv6-long-fix
Fix parsing of IPv6 addresses longer than 39 characters
2022-03-24 22:28:51 +01:00
Maksim Kita
f133531bc0 Functions cast into IPv4, IPV6 add backward incompatible section into changelog 2022-03-24 22:19:30 +01:00
Kruglov Pavel
aedea58741
Mark test as long 2022-03-24 22:10:20 +01:00
tavplubix
805220e658
Merge pull request #35574 from ClickHouse/tavplubix-patch-2
Fix test `test_s3_zero_copy_replication`
2022-03-24 23:50:46 +03:00
Ivan Blinkov
123ea5117f
Update base.js 2022-03-24 22:55:26 +03:00
Kseniia Sumarokova
36a741d4ca
Merge pull request #35569 from bigo-sg/update_hive_doc
Update doc of hive
2022-03-24 20:53:54 +01:00
alesapin
137dd93ee0
Merge pull request #35583 from ClickHouse/docker-labels
Docker labels
2022-03-24 20:50:29 +01:00
Ivan Blinkov
a2c4073ca1
[docs] remove Metrika counter 2022-03-24 22:48:24 +03:00
avogar
c63bc05292 Add test 2022-03-24 19:32:14 +00:00
Alexander Tokmakov
7c0bdbfa93 fix stupid bug 2022-03-24 20:24:05 +01:00
Mikhail f. Shiryaev
a60737e67e
Merge pull request #35585 from ClickHouse/docs-release-fix
Pin jinja2 to 3.0.3 to have working jinja2.contextfilter
2022-03-24 19:25:53 +01:00
mergify[bot]
3b0669bf13
Merge branch 'master' into libcxx14 2022-03-24 18:18:04 +00:00
Mikhail f. Shiryaev
87a8e4195f
Merge pull request #35589 from ClickHouse/version-string
Fix version string update, fix #35518
2022-03-24 19:10:03 +01:00
mergify[bot]
0b95348215
Merge branch 'master' into libcxx14 2022-03-24 17:39:01 +00:00
tavplubix
d910357e69
Update test.py 2022-03-24 20:25:16 +03:00
Dmitry Novik
6470684880
Update docs/en/operations/settings/memory-overcommit.md
Co-authored-by: alesapin <alesapin@clickhouse.com>
2022-03-24 18:20:50 +01:00
Dmitry Novik
1b1a624df0
Update docs/en/operations/settings/memory-overcommit.md
Co-authored-by: alesapin <alesapin@clickhouse.com>
2022-03-24 18:20:23 +01:00
Mikhail f. Shiryaev
d90627e82f
Fix version string update, fix #35518 2022-03-24 17:50:31 +01:00
Dmitry Novik
9488c5b2fd
Update docs/en/operations/settings/memory-overcommit.md
Co-authored-by: alesapin <alesapin@clickhouse.com>
2022-03-24 17:48:11 +01:00
Dmitry Novik
581bcea1f0
Update docs/en/operations/settings/settings.md
Co-authored-by: alesapin <alesapin@clickhouse.com>
2022-03-24 17:47:59 +01:00