Skip to content

Instantly share code, notes, and snippets.

#include <limits.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char **argv)
{
const char * arg = argv[1];
uint64_t in_host = strtoll(arg, NULL, 16);
void boost::context::detail::fiber_entry<boost::context::detail::fiber_record<boost::context::fiber, FiberStack&, Fiber::RoutineImpl<DB::AsyncTaskExecutor::Routine>>>(boost::context::detail::transfer_t);DB::AsyncTaskExecutor::Routine::operator()(std::__1::function<void ()>);DB::RemoteQueryExecutorReadContext::Task::run(std::__1::function<void (int, Poco::Timespan, DB::AsyncEventTimeoutType, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, unsigned int)>, std::__1::function<void ()>);DB::MultiplexedConnections::receivePacketUnlocked(std::__1::function<void (int, Poco::Timespan, DB::AsyncEventTimeoutType, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, unsigned int)>);DB::Connection::receivePacket();DB::Connection::receiveDataImpl(DB::NativeReader&);DB::NativeReader::read();DB::IDataType::createColumn(DB::ISerialization const&) const;DB::DataTypeNumberBase<unsigned long>::createColumn() const;operator new(unsigned long);mal
diff --git a/clickhouse_driver/client.py b/clickhouse_driver/client.py
index 3c4c097..5dbed7f 100644
--- a/clickhouse_driver/client.py
+++ b/clickhouse_driver/client.py
@@ -597,7 +597,7 @@ class Client(object):
if sample_block:
rv = self.send_data(sample_block, data,
types_check=types_check, columnar=columnar)
- self.receive_end_of_query()
+ self.receive_end_of_insert_query()
From cc882d3238775f951718ec29c781c9ecc7774e28 Mon Sep 17 00:00:00 2001
From: Azat Khuzhin <a3at.mail@gmail.com>
Date: Sun, 1 Oct 2023 21:35:42 +0200
Subject: [PATCH] Avoid reading the file multiple times while sending it to S3
AWS S3 client can read file multiple times, this is required for:
- calculate checksums
- calculate signature
By default checksum calculated before signature [1], but it can be
diff --git a/tests/queries/0_stateless/02845_threads_count_in_distributed_queries.sql.j2 b/tests/queries/0_stateless/02845_threads_count_in_distributed_queries.sql.j2
index 1784cc96c97..06a691dc7f4 100644
--- a/tests/queries/0_stateless/02845_threads_count_in_distributed_queries.sql.j2
+++ b/tests/queries/0_stateless/02845_threads_count_in_distributed_queries.sql.j2
@@ -18,7 +18,7 @@ select count() from remote('127.0.0.1:9000', view(
{% for n in range(379) -%}
SELECT * FROM system.one {{ "UNION ALL" if not loop.last }}
{% endfor -%}
- )) SETTINGS log_comment='check_concurrency_in_remote_queries1';
+ )) SETTINGS log_comment='check_concurrency_in_remote_queries1', prefer_localhost_replica=1;
@azat
azat / 02845_threads_count_in_distributed_queries.sql
Created September 27, 2023 09:48
02845_threads_count_in_distributed_queries.sql
SELECT
initial_query_id,
query_id,
peak_threads_usage,
Settings
FROM system.query_log
WHERE (log_comment = 'check_concurrency_in_remote_queries4') AND (type = 'QueryFinish')
Query id: 2381cef7-f23f-4577-a5cd-2b93c07158dc
//
// Created by tonyyxliu on 7/11/23.
//
// This is a test for the problem related to the unexpected delay of libevent
// timeout event callback trigger
//
// Compile this program in release mode and link it with two libraries: 'event' and 'glog'
//
#include <iostream>
@azat
azat / log
Last active July 17, 2023 11:09
readlink qemu linux-user handling
$ sudo arch-chroot ./ /qemu-x86_64-static /main
==> WARNING: ./ is not a mountpoint. This may have undesirable side effects.
readlink(/proc/self/exe) => /main (len: 5)
readlink(/proc/self) => 27679 (len: 5)
readlink(/proc/1/exe) => /main (len: 5)
realpath(/proc/self/exe) => /qemu-x86_64-static
AT_EXECFN = /main
$ sudo arch-chroot ./ /qemu-x86_64-static -strace /main
==> WARNING: ./ is not a mountpoint. This may have undesirable side effects.
#!/usr/bin/env python3
# https://gist.github.com/azat/fe1c087d2bc25f1b831281e1ff80ff9b
import argparse
# Overhead for sparsehash [1].
#
# [1]: https://tristanpenman.com/blog/posts/2017/10/11/sparsehash-internals/
SPARSEHASH_ELEMENT_OVERHEAD_64BIT = 2.66666667
SPARSEHASH_ELEMENT_OVERHEAD_32BIT = 2
$ git di
diff --git a/client.cpp b/client.cpp
index 294c8b7..cf347fe 100644
--- a/client.cpp
+++ b/client.cpp
@@ -32,7 +32,7 @@
#include <event2/util.h>
#include <event2/event.h>
-#include <sanitizer/lsan_interface.h>