From bfc2d5d3d0f3bcf4aa102103cd0b14e40fa42659 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Canna=C3=B2?= Date: Sat, 17 Mar 2018 15:59:14 +0100 Subject: [PATCH] Set default schema to "default" #1419 --- lib/MySQL_Session.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/MySQL_Session.cpp b/lib/MySQL_Session.cpp index a327017b26..757bdaa71f 100644 --- a/lib/MySQL_Session.cpp +++ b/lib/MySQL_Session.cpp @@ -3268,6 +3268,14 @@ void MySQL_Session::handler___status_CONNECTING_CLIENT___STATE_SERVER_HANDSHAKE( l_free(pkt->size,pkt->ptr); //if (client_myds->encrypted==false) { if (client_myds->myconn->userinfo->schemaname==NULL) { +#ifdef PROXYSQLCLICKHOUSE + if (session_type == PROXYSQL_SESSION_CLICKHOUSE) { + if (strlen(default_schema) == 0) { + free(default_schema); + default_schema = strdup((char *)"default"); + } + } +#endif /* PROXYSQLCLICKHOUSE */ client_myds->myconn->userinfo->set_schemaname(default_schema,strlen(default_schema)); } int free_users=0;