1
0
mirror of https://github.com/mariadb-corporation/mariadb-connector-c.git synced 2025-08-07 02:42:49 +03:00

Fix for mariadb_stmt_execute:

If compressed protocol is in use, mariadb_stmt_execute_direct will be emulated by mysql_stmt_prepare and mysql_stmt_execute.
This commit is contained in:
Georg Richter
2018-04-12 08:49:26 +02:00
parent 679b5b5cb7
commit 748e6fb915
2 changed files with 15 additions and 1 deletions

View File

@@ -2308,7 +2308,7 @@ int STDCALL mariadb_stmt_execute_direct(MYSQL_STMT *stmt,
MYSQL *mysql= stmt->mysql;
my_bool emulate_cmd= !(!(stmt->mysql->server_capabilities & CLIENT_MYSQL) &&
(stmt->mysql->extension->mariadb_server_capabilities &
(MARIADB_CLIENT_STMT_BULK_OPERATIONS >> 32)));
(MARIADB_CLIENT_STMT_BULK_OPERATIONS >> 32))) || mysql->net.compress;
if (!mysql)
{

View File

@@ -4638,7 +4638,21 @@ static int test_mdev14165(MYSQL *mysql)
return OK;
}
static int test_compress(MYSQL *mysql)
{
MYSQL_STMT *stmt= mysql_stmt_init(mysql);
int rc;
rc= mariadb_stmt_execute_direct(stmt, SL("SELECT 1 FROM DUAL"));
check_stmt_rc(rc, stmt);
mysql_stmt_close(stmt);
return OK;
}
struct my_tests_st my_tests[] = {
{"test_compress", test_compress, TEST_CONNECTION_NEW, CLIENT_COMPRESS, NULL, NULL},
{"test_conc208", test_conc208, TEST_CONNECTION_DEFAULT, 0, NULL, NULL},
{"test_mdev14165", test_mdev14165, TEST_CONNECTION_DEFAULT, 0, NULL, NULL},
{"test_conc208", test_conc208, TEST_CONNECTION_DEFAULT, 0, NULL, NULL},