From 069d8ca6c289ecf7b3803f528bffd4b9034ca8a1 Mon Sep 17 00:00:00 2001 From: Mikhail Sukharev Date: Sun, 5 Nov 2023 23:06:48 +0600 Subject: [PATCH] Warning for attempting to work through the text protocol --- src/pool/mod.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/pool/mod.rs b/src/pool/mod.rs index 5ba2b47..5d0dc12 100644 --- a/src/pool/mod.rs +++ b/src/pool/mod.rs @@ -7,7 +7,7 @@ use std::{ }; use futures_util::future::BoxFuture; -use log::error; +use log::{error, warn}; use crate::{ errors::Result, @@ -149,6 +149,15 @@ impl Pool { Err(err) => error!("{}", err), } + for host in &hosts { + if host.port() == Some(8124) { + warn!( + "The attempt to establish a connection through the text protocol. clickhouse-rs is for using the binary protocol." + ); + break; + } + } + let inner = Arc::new(Inner { new: crossbeam::queue::ArrayQueue::new(1), idle: crossbeam::queue::ArrayQueue::new(max),