From b1ff4ca81a5940126b095258f385b2c27abcdb71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Mar=C3=ADn?= Date: Fri, 6 Aug 2021 18:03:27 +0200 Subject: [PATCH] Fix 01176_mysql_client_interactive and work with mariadb client --- src/Formats/FormatFactory.cpp | 4 ++++ .../0_stateless/01176_mysql_client_interactive.expect | 5 ++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Formats/FormatFactory.cpp b/src/Formats/FormatFactory.cpp index d2d6d92dea3..0132a37113a 100644 --- a/src/Formats/FormatFactory.cpp +++ b/src/Formats/FormatFactory.cpp @@ -314,6 +314,10 @@ OutputFormatPtr FormatFactory::getOutputFormatParallelIfPossible( auto format_settings = _format_settings ? *_format_settings : getFormatSettings(context); + /// If we're handling MySQL protocol connection right now then MySQLWire is only allowed output format. + if (format_settings.mysql_wire.sequence_id && (name != "MySQLWire")) + throw Exception(ErrorCodes::UNSUPPORTED_METHOD, "MySQL protocol does not support custom output formats"); + const Settings & settings = context->getSettingsRef(); if (settings.output_format_parallel_formatting && getCreators(name).supports_parallel_formatting diff --git a/tests/queries/0_stateless/01176_mysql_client_interactive.expect b/tests/queries/0_stateless/01176_mysql_client_interactive.expect index 2337b7d01fe..6f0cea48e76 100755 --- a/tests/queries/0_stateless/01176_mysql_client_interactive.expect +++ b/tests/queries/0_stateless/01176_mysql_client_interactive.expect @@ -12,7 +12,7 @@ expect_after { set basedir [file dirname $argv0] spawn bash -c "source $basedir/../shell_config.sh ; \$MYSQL_CLIENT_BINARY \$MYSQL_CLIENT_OPT" -expect "mysql> " +expect -nocase -re "mysql.*> " send -- "USE system;\r" expect "Database changed" @@ -41,8 +41,7 @@ expect "+---------------+-------------+" expect "| 10 | 45 |" expect "+---------------+-------------+" expect "1 row in set" -expect "Read 10 rows, 80.00 B" -expect "mysql> " +expect -nocase -re "mysql.*> " send -- "quit;\r" expect eof