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

erge branch '3.1' into 3.3

This commit is contained in:
Georg Richter
2022-08-01 12:26:27 +02:00
6 changed files with 7 additions and 10 deletions

View File

@@ -53,7 +53,7 @@ const char *client_errors[]=
/* 2023 */ "", /* 2023 */ "",
/* 2024 */ "", /* 2024 */ "",
/* 2025 */ "", /* 2025 */ "",
/* 2026 */ "SSL connection error: %-.100s", /* 2026 */ "TLS/SSL error: %-.100s",
/* 2027 */ "Received malformed packet", /* 2027 */ "Received malformed packet",
/* 2028 */ "", /* 2028 */ "",
/* 2029 */ "", /* 2029 */ "",

View File

@@ -889,7 +889,7 @@ static void ma_tls_set_error(MYSQL *mysql, void *ssl, int ssl_errno)
alert_name= gnutls_alert_get_name(alert_desc); alert_name= gnutls_alert_get_name(alert_desc);
snprintf(ssl_error, MAX_SSL_ERR_LEN, "fatal alert received: %s", snprintf(ssl_error, MAX_SSL_ERR_LEN, "fatal alert received: %s",
alert_name); alert_name);
pvio->set_error(mysql, CR_SSL_CONNECTION_ERROR, SQLSTATE_UNKNOWN, ssl_error); pvio->set_error(mysql, CR_SSL_CONNECTION_ERROR, SQLSTATE_UNKNOWN, 0, ssl_error);
return; return;
} }

View File

@@ -52,7 +52,7 @@ void ma_schannel_set_sec_error(MARIADB_PVIO* pvio, DWORD ErrorNo)
void ma_schannel_set_win_error(MARIADB_PVIO *pvio, DWORD ErrorNo) void ma_schannel_set_win_error(MARIADB_PVIO *pvio, DWORD ErrorNo)
{ {
char buffer[256]; char buffer[256];
ma_format_win32_error(buffer, sizeof(buffer), ErrorNo, "SSL connection error: "); ma_format_win32_error(buffer, sizeof(buffer), ErrorNo, "TLS/SSL error: ");
pvio->set_error(pvio->mysql, CR_SSL_CONNECTION_ERROR, SQLSTATE_UNKNOWN, buffer); pvio->set_error(pvio->mysql, CR_SSL_CONNECTION_ERROR, SQLSTATE_UNKNOWN, buffer);
return; return;
} }
@@ -526,8 +526,7 @@ my_bool ma_schannel_verify_certs(MARIADB_TLS *ctls, BOOL verify_server_name)
end: end:
if (!ret) if (!ret)
{ {
pvio->set_error(mysql, CR_SSL_CONNECTION_ERROR, SQLSTATE_UNKNOWN, pvio->set_error(mysql, CR_SSL_CONNECTION_ERROR, SQLSTATE_UNKNOWN, 0, errmsg);
"SSL connection error: %s", errmsg);
} }
if (pServerCert) if (pServerCert)
CertFreeCertificateContext(pServerCert); CertFreeCertificateContext(pServerCert);

View File

@@ -225,7 +225,7 @@ static int ma_tls_set_client_certs(MARIADB_TLS *ctls,const CERT_CONTEXT **cert_c
*cert_ctx = schannel_create_cert_context(certfile, keyfile, errmsg, sizeof(errmsg)); *cert_ctx = schannel_create_cert_context(certfile, keyfile, errmsg, sizeof(errmsg));
if (!*cert_ctx) if (!*cert_ctx)
{ {
pvio->set_error(pvio->mysql, CR_SSL_CONNECTION_ERROR, SQLSTATE_UNKNOWN, "SSL connection error: %s", errmsg); pvio->set_error(pvio->mysql, CR_SSL_CONNECTION_ERROR, SQLSTATE_UNKNOWN, 0, errmsg);
return 1; return 1;
} }

View File

@@ -1,5 +1,5 @@
/************************************************************************************ /************************************************************************************
Copyright (C) 2017, 2021, MariaDB Corporation AB Copyright (C) 2017, 2022, MariaDB Corporation AB
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public modify it under the terms of the GNU Library General Public

View File

@@ -421,11 +421,9 @@ static int test_bug10736(MYSQL *mysql)
for (i= 0; i < 3; i++) for (i= 0; i < 3; i++)
{ {
int row_no= 0;
rc= mysql_stmt_execute(stmt); rc= mysql_stmt_execute(stmt);
check_stmt_rc(rc, stmt); check_stmt_rc(rc, stmt);
while ((rc= mysql_stmt_fetch(stmt)) == 0) while ((rc= mysql_stmt_fetch(stmt)) == 0);
++row_no;
FAIL_UNLESS(rc == MYSQL_NO_DATA, "rc != MYSQL_NO_DATA"); FAIL_UNLESS(rc == MYSQL_NO_DATA, "rc != MYSQL_NO_DATA");
} }
rc= mysql_stmt_close(stmt); rc= mysql_stmt_close(stmt);