Commit Graph

51 Commits

Author SHA1 Message Date
Nikolay Degterinsky
469cd60e76 Merge remote-tracking branch 'upstream/master' into evillique-patch-1 2023-03-15 01:07:35 +00:00
Robert Schulze
740aeaba1f
Apply some CTAD 2023-03-02 13:36:47 +00:00
Nikolay Degterinsky
86744585fd
Disable path check in SQLite storage for clickhouse-local 2023-03-01 06:30:07 +01:00
Antonio Andelic
12569da984 Merge branch 'master' into add-support-for-settings-alias 2023-02-05 16:08:57 +00:00
Alexander Tokmakov
a584ad0eb1 forbid runtime strings 2023-01-26 10:52:47 +01:00
kssenii
f412c76eba Fix data race in init sqlite db 2023-01-09 14:15:48 +01:00
Azat Khuzhin
4e76629aaf Fixes for -Wshorten-64-to-32
- lots of static_cast
- add safe_cast
- types adjustments
  - config
  - IStorage::read/watch
  - ...
- some TODO's (to convert types in future)

P.S. That was quite a journey...

v2: fixes after rebase
v3: fix conflicts after #42308 merged
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-10-21 13:25:19 +02:00
Robert Schulze
fd86829824
Consolidate config_core.h into config.h
Less duplication, less confusion ...
2022-09-28 13:31:57 +00:00
Barum Rho
a61827fb78 Convert SQLite int8 column to ClickHouse int64
SQLite int8 column uses 64 bit integers.
2022-08-25 16:15:50 -04:00
Alexander Tokmakov
f4883f1f7e add some TSA aanotations 2022-06-27 22:48:27 +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
Amos Bird
4a5e4274f0
base should not depend on Common 2022-04-29 10:26:35 +08:00
Kseniia Sumarokova
ba6032a353
Update src/Databases/SQLite/SQLiteUtils.cpp
Co-authored-by: Vladimir C <vdimir@clickhouse.com>
2022-02-26 01:31:04 +01:00
kssenii
40075d4c6b Fix 2022-02-25 15:04:14 +01:00
Azat Khuzhin
cf93732de9 DatabaseSQLite: fix fmt error in DatabaseSQLite::checkSQLiteTable()
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-02-01 14:30:03 +03:00
Azat Khuzhin
bedf208cbd Use fmt::runtime() for LOG_* for non constexpr
Here is oneliner:

    $ gg 'LOG_\(DEBUG\|TRACE\|INFO\|TEST\|WARNING\|ERROR\|FATAL\)([^,]*, [a-zA-Z]' -- :*.cpp :*.h | cut -d: -f1 | sort -u | xargs -r sed -E -i 's#(LOG_[A-Z]*)\(([^,]*), ([A-Za-z][^,)]*)#\1(\2, fmt::runtime(\3)#'

Note, that I tried to do this with coccinelle (tool for semantic
patchin), but it cannot parse C++:

    $ cat fmt.cocci
    @@
    expression log;
    expression var;
    @@

    -LOG_DEBUG(log, var)
    +LOG_DEBUG(log, fmt::runtime(var))

I've also tried to use some macros/templates magic to do this implicitly
in logger_useful.h, but I failed to do so, and apparently it is not
possible for now.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>

v2: manual fixes
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-02-01 14:30:03 +03:00
Raúl Marín
b2cfa70541 Reduce dependencies on ASTFunction.h
481 -> 230
2021-11-26 18:21:54 +01:00
SuperDJY
dd2972b8c3
return fake create query when executing show create table on system's tables. (#31391)
* clarify that cannot show create table of system's tables

* clarify that cannot show create table of system's tables in the document

* bypass test style-check for required `database=currentDatabase()` because `show create table` do not have condition

* rename supportsShowCreateTable to isSystemStorage

* build fake create query for show create table of system's tables

* fix tests for show create table on system's table:

1. only build fake create query when cannot get real query
2. only test rocksdb when it's enabled.

* fix test for show create table system.tables

* fix test for ASTCreateQuery set table and database

* change to LOGICAL_ERROR when cannot get in_memory metadata

Co-authored-by: tavplubix <tavplubix@gmail.com>

* implement common getCreateQueryFromStorage

Co-authored-by: tavplubix <tavplubix@gmail.com>
2021-11-19 13:25:55 +03:00
Nikolay Degterinsky
7b5954b736 Merge branch 'master' into query_parameters 2021-11-11 11:43:00 +00:00
Alexey Milovidov
993f3faefd Miscellaneous 2021-10-31 18:11:46 +03:00
Alexey Milovidov
8b4a6a2416 Remove cruft 2021-10-28 02:10:39 +03:00
Nikolay Degterinsky
d76976e272 Merge branch 'master' into query_parameters 2021-10-18 17:34:20 +03:00
Vasily Nemkov
67ff0f5dba Refactoring: moved comment out of ASTStorage to ASTCreateQuery 2021-10-09 12:25:27 +03:00
Nikolay Degterinsky
e03bf0c526 Merge branch 'master' into query_parameters 2021-10-04 17:23:17 +03:00
Anton Popov
362e84a336
Merge pull request #29429 from Enmk/Governance/database_comment
Implemented creating databases with comments
2021-10-04 15:12:33 +03:00
Alexey Milovidov
fe6b7c77c7 Rename "common" to "base" 2021-10-02 10:13:14 +03:00
Vasily Nemkov
2f16806cd0 Implemented creating databases with comments 2021-10-01 11:51:26 +03:00
Nikolay Degterinsky
6adfdd2f79 Fix style 2021-09-15 19:36:55 +03:00
Nikolay Degterinsky
22f59e1714 Add support for table and database query parameters 2021-09-07 01:19:02 +03:00
Vitaly Baranov
2ac97c7fc3 Make IDatabase::getTablesIterator() const. 2021-08-23 23:41:45 +03:00
kssenii
f3129b80f9 Fix sqlite attach 2021-07-26 07:20:41 +00:00
kssenii
dd519f9434 Fix 2021-07-15 19:02:31 +03:00
kssenii
f20ea87bfb Merge branch 'master' of https://github.com/ClickHouse/ClickHouse into add-sqlite-database-path-check 2021-07-14 20:49:05 +00:00
Kseniia Sumarokova
ef0ebaf55c
Update SQLiteUtils.cpp 2021-07-14 20:20:41 +03:00
kssenii
d62cbbb8a5 Unification 2021-07-14 13:16:30 +00:00
kssenii
b393603b57 Fix build 2021-07-13 22:25:26 +00:00
Nikita Mikhaylov
601d04f55d ignore 2021-07-13 22:16:27 +00:00
kssenii
da09ce3f20 Remove unused 2021-07-13 19:51:02 +00:00
kssenii
a90df59b92 Better 2021-07-13 19:46:06 +00:00
kssenii
9688efde96 Merge branch 'add-sqlite-database-path-check' of github.com:kssenii/ClickHouse into add-sqlite-database-path-check 2021-07-13 12:40:43 +00:00
kssenii
f86817d57c Check inclusion inside user_files 2021-07-13 12:38:37 +00:00
Kseniia Sumarokova
c615084ba7
Update DatabaseSQLite.cpp 2021-07-13 14:40:07 +03:00
kssenii
48ffd3b81d Add check for sqlite database path 2021-07-13 09:40:46 +00:00
kssenii
976f4dffda Add table function sqlite, fix type conversions 2021-07-12 21:09:23 +00:00
kssenii
10611ef92a Normal exceptions 2021-07-10 11:00:59 +00:00
kssenii
18c2abaaf9 Fix database engine attach, more tests 2021-07-10 10:31:21 +00:00
kssenii
78094a82ab Better 2021-07-10 08:05:23 +00:00
kssenii
1bf9a9f29f Add .cmake 2021-07-09 10:27:53 +00:00
Arslan G
bf4171e0ea Some review fixes 2021-06-01 23:52:12 +03:00
Arslan G
fbc5734302 Clean up code and fix tests 2021-05-28 20:00:26 +03:00