smi2 / phpClickHouse

php ClickHouse wrapper
MIT License
741 stars 139 forks source link

Distributed queries response metadata #190

Closed luzrain closed 1 year ago

luzrain commented 1 year ago

Problem: If we use distributed queries to write, as example

DROP TABLE IF EXISTS test_table ON CLUSTER test_cluster

the answer will be contains metadata in table format which can't be parsed in ClickHouseDB\Statement::init() and as a result throws "Can`t find meta" exception.
This pr fixed it by adding JSON format for queries started from CREATE, DROP or ALTER.
This does not affect on non-distributed queries as the response to these queries contains nothing for those type of queries.

isublimity commented 1 year ago

Thx!