Commit Graph

8 Commits

Author SHA1 Message Date
Robert Schulze
777b5bc15b
Don't let storages inherit from boost::noncopyable
... IStorage has deleted copy ctor / assignment already
2022-05-03 09:07:08 +02:00
Robert Schulze
330212e0f4
Remove inherited create() method + disallow copying
The original motivation for this commit was that shared_ptr_helper used
std::shared_ptr<>() which does two heap allocations instead of
make_shared<>() which does a single allocation. Turned out that
1. the affected code (--> Storages/) is not on a hot path (rendering the
performance argument moot ...)
2. yet copying Storage objects is potentially dangerous and was
   previously allowed.

Hence, this change

- removes shared_ptr_helper and as a result all inherited create() methods,

- instead, Storage objects are now created using make_shared<>() by the
  caller (for that to work, many constructors had to be made public), and

- all Storage classes were marked as noncopyable using boost::noncopyable.

In sum, we are (likely) not making things faster but the code becomes
cleaner and harder to misuse.
2022-05-02 08:46:52 +02:00
Alexey Milovidov
fe6b7c77c7 Rename "common" to "base" 2021-10-02 10:13:14 +03:00
Maksim Kita
67e9b85951 Merge ext into common 2021-06-16 23:28:41 +03:00
Ivan
495c6e03aa
Replace all Context references with std::weak_ptr (#22297)
* Replace all Context references with std::weak_ptr

* Fix shared context captured by value

* Fix build

* Fix Context with named sessions

* Fix copy context

* Fix gcc build

* Merge with master and fix build

* Fix gcc-9 build
2021-04-11 02:33:54 +03:00
bharatnc
70d00abe4f try and fix gcc-9 build.
This tries to fix the failing gcc-9 unbundled build:

https://clickhouse-builds.s3.yandex.net/13880/e437d85b927a47da69b8bdc4dde95917c2261cbe/clickhouse_build_check/build_log_753740668_1598037713.txt
2020-08-24 23:31:21 +03:00
Alexey Milovidov
b504b9a917 Fix conflict + minor modification. 2020-08-24 23:29:56 +03:00
bharatnc
b85bcc5b8b add time_zones tables
This table adds a new table called the `time_zones` table:

```
:) select * from system.time_zones limit 10;

SELECT *
FROM system.time_zones
LIMIT 10

┌─time_zone──────────┐
│ Africa/Abidjan     │
│ Africa/Accra       │
│ Africa/Addis_Ababa │
│ Africa/Algiers     │
│ Africa/Asmara      │
│ Africa/Asmera      │
│ Africa/Bamako      │
│ Africa/Bangui      │
│ Africa/Banjul      │
│ Africa/Bissau      │
└────────────────────┘

10 rows in set. Elapsed: 0.012 sec.
```

The available timezones are parsed from under
`ClickHouse/contrib/cctz/testdata/zoneinfo` through a script
and the table content is constructed from the
StorageSystemTimeZones.generated.cpp`.

I was able to test this locally and was able to get a list of time
zones as shown above.
2020-08-24 23:26:00 +03:00