Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package mariadb-connector-c for 
openSUSE:Factory checked in at 2023-03-09 17:44:39
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/mariadb-connector-c (Old)
 and      /work/SRC/openSUSE:Factory/.mariadb-connector-c.new.31432 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "mariadb-connector-c"

Thu Mar  9 17:44:39 2023 rev:41 rq:1070070 version:3.3.4

Changes:
--------
--- /work/SRC/openSUSE:Factory/mariadb-connector-c/mariadb-connector-c.changes  
2022-12-07 17:35:17.336645554 +0100
+++ 
/work/SRC/openSUSE:Factory/.mariadb-connector-c.new.31432/mariadb-connector-c.changes
       2023-03-09 17:44:41.314572126 +0100
@@ -1,0 +2,6 @@
+Tue Mar  7 20:49:44 UTC 2023 - Dirk Müller <dmuel...@suse.com>
+
+- update to 3.3.4:
+  https://mariadb.com/kb/en/mariadb-connector-c-3-3-4-release-notes/ 
+
+-------------------------------------------------------------------

Old:
----
  mariadb-connector-c-3.3.3-src.tar.gz
  mariadb-connector-c-3.3.3-src.tar.gz.asc

New:
----
  mariadb-connector-c-3.3.4-src.tar.gz
  mariadb-connector-c-3.3.4-src.tar.gz.asc

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ mariadb-connector-c.spec ++++++
--- /var/tmp/diff_new_pack.sETawd/_old  2023-03-09 17:44:41.870575086 +0100
+++ /var/tmp/diff_new_pack.sETawd/_new  2023-03-09 17:44:41.874575106 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package mariadb-connector-c
 #
-# Copyright (c) 2022 SUSE LLC
+# Copyright (c) 2023 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -25,7 +25,7 @@
 %endif
 %bcond_with sqlite3
 Name:           mariadb-connector-c
-Version:        3.3.3
+Version:        3.3.4
 Release:        0
 Summary:        MariaDB connector in C
 License:        LGPL-2.1-or-later

++++++ mariadb-connector-c-3.3.3-src.tar.gz -> 
mariadb-connector-c-3.3.4-src.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mariadb-connector-c-3.3.3-src/CMakeLists.txt 
new/mariadb-connector-c-3.3.4-src/CMakeLists.txt
--- old/mariadb-connector-c-3.3.3-src/CMakeLists.txt    2022-11-07 
09:09:29.000000000 +0100
+++ new/mariadb-connector-c-3.3.4-src/CMakeLists.txt    2023-01-16 
12:12:46.000000000 +0100
@@ -36,7 +36,7 @@
 
 SET(CPACK_PACKAGE_VERSION_MAJOR 3)
 SET(CPACK_PACKAGE_VERSION_MINOR 3)
-SET(CPACK_PACKAGE_VERSION_PATCH 3)
+SET(CPACK_PACKAGE_VERSION_PATCH 4)
 SET(CPACK_PACKAGE_VERSION 
"${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
 MATH(EXPR MARIADB_PACKAGE_VERSION_ID "${CPACK_PACKAGE_VERSION_MAJOR} * 10000 +
                             ${CPACK_PACKAGE_VERSION_MINOR} * 100   +
@@ -172,7 +172,7 @@
 ELSE()
   SET(MARIADB_CLIENT_VERSION_MAJOR "10")
   SET(MARIADB_CLIENT_VERSION_MINOR "8")
-  SET(MARIADB_CLIENT_VERSION_PATCH "4")
+  SET(MARIADB_CLIENT_VERSION_PATCH "7")
   SET(MARIADB_CLIENT_VERSION_EXTRA "")
 ENDIF()
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mariadb-connector-c-3.3.3-src/include/errmsg.h 
new/mariadb-connector-c-3.3.4-src/include/errmsg.h
--- old/mariadb-connector-c-3.3.3-src/include/errmsg.h  2022-11-07 
09:09:29.000000000 +0100
+++ new/mariadb-connector-c-3.3.4-src/include/errmsg.h  2023-01-16 
12:12:46.000000000 +0100
@@ -31,16 +31,14 @@
 }
 #endif
 
-
-
 #define CR_MIN_ERROR           2000    /* For easier client code */
 #define CR_MAX_ERROR           2999
 #define CER_MIN_ERROR           5000
 #define CER_MAX_ERROR           5999
-#define CER(X) mariadb_client_errors[(X)-CER_MIN_ERROR]
-#define ER(X) client_errors[(X)-CR_MIN_ERROR]
 #define CLIENT_ERRMAP          2       /* Errormap used by ma_error() */
 
+#define ER_UNKNOWN_ERROR_CODE "Unknown or undefined error code (%d)"
+
 #define CR_UNKNOWN_ERROR       2000
 #define CR_SOCKET_CREATE_ERROR 2001
 #define CR_CONNECTION_ERROR    2002
@@ -108,9 +106,19 @@
 #define CR_ERR_NET_READ 5013
 #define CR_ERR_NET_WRITE 5014
 #define CR_ERR_NET_UNCOMPRESS 5015
+#define CR_ERR_STMT_PARAM_CALLBACK 5016
 
 /* Always last, if you add new error codes please update the
    value for CR_MARIADB_LAST_ERROR */
-#define CR_MARIADB_LAST_ERROR CR_ERR_NET_UNCOMPRESS
+#define CR_MARIADB_LAST_ERROR CR_ERR_STMT_PARAM_CALLBACK
 
 #endif
+
+#define IS_MYSQL_ERROR(code) ((code) > CR_MIN_ERROR && (code) < 
CR_MYSQL_LAST_ERROR)
+#define IS_MARIADB_ERROR(code) ((code) > CER_MIN_ERROR && (code) < 
CR_MARIADB_LAST_ERROR)
+
+#define ER(code) IS_MYSQL_ERROR((code)) ? client_errors[(code) - CR_MIN_ERROR] 
: \
+                 IS_MARIADB_ERROR((code)) ?  mariadb_client_errors[(code) - 
CER_MIN_ERROR] : \
+                 "Unknown or undefined error code" 
+#define CER(code) ER((code))
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mariadb-connector-c-3.3.3-src/include/mariadb_stmt.h 
new/mariadb-connector-c-3.3.4-src/include/mariadb_stmt.h
--- old/mariadb-connector-c-3.3.3-src/include/mariadb_stmt.h    2022-11-07 
09:09:29.000000000 +0100
+++ new/mariadb-connector-c-3.3.4-src/include/mariadb_stmt.h    2023-01-16 
12:12:46.000000000 +0100
@@ -34,14 +34,8 @@
     ((stmt)->mysql->extension->mariadb_server_capabilities & \
     (MARIADB_CLIENT_STMT_BULK_OPERATIONS >> 32))))
 
-#define SET_CLIENT_STMT_ERROR(a, b, c, d) \
-do { \
-  (a)->last_errno= (b);\
-  strncpy((a)->sqlstate, (c), SQLSTATE_LENGTH);\
-  (a)->sqlstate[SQLSTATE_LENGTH]= 0;\
-  strncpy((a)->last_error, (d) ? (d) : ER((b)), MYSQL_ERRMSG_SIZE);\
-  (a)->last_error[MYSQL_ERRMSG_SIZE - 1]= 0;\
-} while (0)
+#define SET_CLIENT_STMT_ERROR(a, b, c, d, ...) \
+  stmt_set_error((a),(b),(c),(d), ##__VA_ARGS__)
 
 #define CLEAR_CLIENT_STMT_ERROR(a) \
 do { \
@@ -223,6 +217,11 @@
 unsigned long net_field_length(unsigned char **packet);
 int ma_simple_command(MYSQL *mysql,enum enum_server_command command, const 
char *arg,
                       size_t length, my_bool skipp_check, void *opt_arg);
+void stmt_set_error(MYSQL_STMT *stmt,
+                  unsigned int error_nr,
+                  const char *sqlstate,
+                  const char *format,
+                  ...);
 /*
  *  function prototypes
  */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mariadb-connector-c-3.3.3-src/libmariadb/ma_errmsg.c 
new/mariadb-connector-c-3.3.4-src/libmariadb/ma_errmsg.c
--- old/mariadb-connector-c-3.3.3-src/libmariadb/ma_errmsg.c    2022-11-07 
09:09:29.000000000 +0100
+++ new/mariadb-connector-c-3.3.4-src/libmariadb/ma_errmsg.c    2023-01-16 
12:12:46.000000000 +0100
@@ -85,10 +85,10 @@
 /* 2055 */  "Lost connection to server at '%s', system error: %d",
 /* 2056 */  "Server closed statement due to a prior %s function call",
 /* 2057 */  "The number of parameters in bound buffers differs from number of 
columns in resultset",
-/* 2059 */  "Can't connect twice. Already connected",
-/* 2058 */  "Plugin %s could not be loaded: %s",
-/* 2059 */  "An attribute with same name already exists",
-/* 2060 */  "Plugin doesn't support this function",
+/* 2058 */  "Can't connect twice. Already connected",
+/* 2059 */  "Plugin %s could not be loaded: %s",
+/* 2060 */  "An attribute with same name already exists",
+/* 2061 */  "Plugin doesn't support this function",
             ""
 };
 
@@ -110,6 +110,7 @@
   /* 5013 */ "Read error: %s (%d)",
   /* 5014 */ "Write error: %s (%d)",
   /* 5015 */ "Error while uncompressing packet",
+  /* 5016 */ "Error while retrieving parameter from callback function",
   ""
 };
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/mariadb-connector-c-3.3.3-src/libmariadb/mariadb_lib.c 
new/mariadb-connector-c-3.3.4-src/libmariadb/mariadb_lib.c
--- old/mariadb-connector-c-3.3.3-src/libmariadb/mariadb_lib.c  2022-11-07 
09:09:29.000000000 +0100
+++ new/mariadb-connector-c-3.3.4-src/libmariadb/mariadb_lib.c  2023-01-16 
12:12:46.000000000 +0100
@@ -1727,6 +1727,14 @@
   if (ma_pvio_connect(pvio, &cinfo) != 0)
   {
     ma_pvio_close(pvio);
+    if (mysql->options.extension && mysql->options.extension->async_context &&
+        mysql->options.extension->async_context->pvio)
+    {
+      /* pvio delegated to mysql->net.pvio by ma_net_init().
+       * invalidate the pvio pointer in the async context */
+      mysql->options.extension->async_context->pvio = NULL;
+    }
+
     if (is_multi)
     {
       connect_attempts++;
@@ -2139,7 +2147,7 @@
     {
       MYSQL_STMT *stmt= (MYSQL_STMT *)li_stmt->data;
       stmt->mysql= NULL;
-      SET_CLIENT_STMT_ERROR(stmt, CR_STMT_CLOSED, SQLSTATE_UNKNOWN, 
function_name);
+      SET_CLIENT_STMT_ERROR(stmt, CR_STMT_CLOSED, SQLSTATE_UNKNOWN, 0, 
function_name);
     }
     mysql->stmts= NULL;
   }
@@ -2339,18 +2347,20 @@
 
   const char *errmsg;
 
+  mysql->net.last_errno= error_nr;
+  ma_strmake(mysql->net.sqlstate, sqlstate, SQLSTATE_LENGTH);
+
   if (!format)
   {
-    if (error_nr >= CR_MIN_ERROR && error_nr <= CR_MYSQL_LAST_ERROR)
+    if (IS_MYSQL_ERROR(error_nr) || IS_MARIADB_ERROR(error_nr))
       errmsg= ER(error_nr);
-    else if (error_nr >= CER_MIN_ERROR && error_nr <= CR_MARIADB_LAST_ERROR)
-      errmsg= CER(error_nr);
-    else
-      errmsg= ER(CR_UNKNOWN_ERROR);
+    else {
+      snprintf(mysql->net.last_error, MYSQL_ERRMSG_SIZE - 1,
+               ER_UNKNOWN_ERROR_CODE, error_nr);
+      return;
+    }
   }
 
-  mysql->net.last_errno= error_nr;
-  ma_strmake(mysql->net.sqlstate, sqlstate, SQLSTATE_LENGTH);
   va_start(ap, format);
   vsnprintf(mysql->net.last_error, MYSQL_ERRMSG_SIZE - 1,
             format ? format : errmsg, ap);
@@ -3911,11 +3921,15 @@
     *((char **)arg)= mysql->options.ssl_cipher;
     break;
   case MYSQL_OPT_SSL_CRL:
-    *((char **)arg)= mysql->options.extension ? mysql->options.ssl_cipher : 
NULL;
+    *((char **)arg)= mysql->options.extension ? 
mysql->options.extension->ssl_crl : NULL;
     break;
   case MYSQL_OPT_SSL_CRLPATH:
     *((char **)arg)= mysql->options.extension ? 
mysql->options.extension->ssl_crlpath : NULL;
     break;
+  case MARIADB_OPT_TLS_VERSION:
+  case MYSQL_OPT_TLS_VERSION:
+    *((char **)arg)= mysql->options.extension ? 
mysql->options.extension->tls_version : NULL;
+    break;
   case MYSQL_OPT_CONNECT_ATTRS:
     /* mysql_get_optionsv(mysql, MYSQL_OPT_CONNECT_ATTRS, keys, vals, 
elements) */
     {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/mariadb-connector-c-3.3.3-src/libmariadb/mariadb_stmt.c 
new/mariadb-connector-c-3.3.4-src/libmariadb/mariadb_stmt.c
--- old/mariadb-connector-c-3.3.3-src/libmariadb/mariadb_stmt.c 2022-11-07 
09:09:29.000000000 +0100
+++ new/mariadb-connector-c-3.3.4-src/libmariadb/mariadb_stmt.c 2023-01-16 
12:12:46.000000000 +0100
@@ -91,18 +91,35 @@
                   ...)
 {
   va_list ap;
-  const char *error= NULL;
 
-  if (error_nr >= CR_MIN_ERROR && error_nr <= CR_MYSQL_LAST_ERROR)
-    error= ER(error_nr);
-  else if (error_nr >= CER_MIN_ERROR && error_nr <= CR_MARIADB_LAST_ERROR)
-    error= CER(error_nr);
+  const char *errmsg;
 
   stmt->last_errno= error_nr;
   ma_strmake(stmt->sqlstate, sqlstate, SQLSTATE_LENGTH);
+
+  if (!format)
+  {
+    if (IS_MYSQL_ERROR(error_nr) || IS_MARIADB_ERROR(error_nr))
+      errmsg= ER(error_nr);
+    else {
+      snprintf(stmt->last_error, MYSQL_ERRMSG_SIZE - 1,
+               ER_UNKNOWN_ERROR_CODE, error_nr);
+      return;
+    }
+  }
+
+  /* Fix for CONC-627: If this is a server error message, we don't
+     need to substitute and possible variadic arguments will be
+     ignored */
+  if (!IS_MYSQL_ERROR(error_nr) && !IS_MARIADB_ERROR(error_nr))
+  {
+    strncpy(stmt->last_error, format, MYSQL_ERRMSG_SIZE - 1);
+    return;
+  }
+
   va_start(ap, format);
-  vsnprintf(stmt->last_error, MYSQL_ERRMSG_SIZE,
-            format ? format : error ? error : "", ap);
+  vsnprintf(stmt->last_error, MYSQL_ERRMSG_SIZE - 1,
+            format ? format : errmsg, ap);
   va_end(ap);
   return;
 }
@@ -718,6 +735,7 @@
   size_t length= 1024;
   size_t free_bytes= 0;
   size_t null_byte_offset= 0;
+  uchar *tmp_start;
   uint i;
 
   uchar *start= NULL, *p;
@@ -746,8 +764,9 @@
     {
       size_t offset= p - start;
       length+= offset + null_count + 20;
-      if (!(start= (uchar *)realloc(start, length)))
+      if (!(tmp_start= (uchar *)realloc(start, length)))
         goto mem_error;
+      start= tmp_start;
       p= start + offset;
     }
 
@@ -769,8 +788,9 @@
       {
         size_t offset= p - start;
         length= offset + stmt->param_count * 2 + 20;
-        if (!(start= (uchar *)realloc(start, length)))
+        if (!(tmp_start= (uchar *)realloc(start, length)))
           goto mem_error;
+        start= tmp_start;
         p= start + offset;
       }
       for (i = 0; i < stmt->param_count; i++)
@@ -839,8 +859,9 @@
       {
         size_t offset= p - start;
         length= MAX(2 * length, offset + size + 20);
-        if (!(start= (uchar *)realloc(start, length)))
+        if (!(tmp_start= (uchar *)realloc(start, length)))
           goto mem_error;
+        start= tmp_start;
         p= start + offset;
       }
       if (((stmt->params[i].is_null && *stmt->params[i].is_null) ||
@@ -913,6 +934,7 @@
   size_t length= 1024;
   size_t free_bytes= 0;
   ushort flags= 0;
+  uchar *tmp_start;
   uint i, j;
 
   uchar *start= NULL, *p;
@@ -933,7 +955,10 @@
 
   /* preallocate length bytes */
   if (!(start= p= (uchar *)malloc(length)))
-    goto mem_error;
+  {
+    SET_CLIENT_STMT_ERROR(stmt, CR_OUT_OF_MEMORY, SQLSTATE_UNKNOWN, 0);
+    goto error;
+  }
 
   int4store(p, stmt->stmt_id);
   p += STMT_ID_LENGTH;
@@ -964,8 +989,12 @@
       {
         size_t offset= p - start;
         length= offset + stmt->param_count * 2 + 20;
-        if (!(start= (uchar *)realloc(start, length)))
-          goto mem_error;
+        if (!(tmp_start= (uchar *)realloc(start, length)))
+        {
+          SET_CLIENT_STMT_ERROR(stmt, CR_OUT_OF_MEMORY, SQLSTATE_UNKNOWN, 0);
+          goto error;
+        }
+        start= tmp_start;
         p= start + offset;
       }
       for (i = 0; i < stmt->param_count; i++)
@@ -983,7 +1012,13 @@
       /* If callback for parameters was specified, we need to
          update bind information for new row */
       if (stmt->param_callback)
-        stmt->param_callback(stmt->user_data, stmt->params, j);
+      {
+        if (stmt->param_callback(stmt->user_data, stmt->params, j))
+        {
+          SET_CLIENT_STMT_ERROR(stmt, CR_ERR_STMT_PARAM_CALLBACK, 
SQLSTATE_UNKNOWN, 0);
+          goto error;
+        }
+      }
 
       if (mysql_stmt_skip_paramset(stmt, j))
         continue;
@@ -1050,8 +1085,12 @@
         {
           size_t offset= p - start;
           length= MAX(2 * length, offset + size + 20);
-          if (!(start= (uchar *)realloc(start, length)))
-            goto mem_error;
+          if (!(tmp_start= (uchar *)realloc(start, length)))
+          {
+            SET_CLIENT_STMT_ERROR(stmt, CR_OUT_OF_MEMORY, SQLSTATE_UNKNOWN, 0);
+            goto error;
+          }
+          start= tmp_start;
           p= start + offset;
         }
 
@@ -1067,8 +1106,7 @@
   stmt->send_types_to_server= 0;
   *request_len = (size_t)(p - start);
   return start;
-mem_error:
-  SET_CLIENT_STMT_ERROR(stmt, CR_OUT_OF_MEMORY, SQLSTATE_UNKNOWN, 0);
+error:
   free(start);
   *request_len= 0;
   return NULL;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/mariadb-connector-c-3.3.3-src/unittest/libmariadb/async.c 
new/mariadb-connector-c-3.3.4-src/unittest/libmariadb/async.c
--- old/mariadb-connector-c-3.3.3-src/unittest/libmariadb/async.c       
2022-11-07 09:09:29.000000000 +0100
+++ new/mariadb-connector-c-3.3.4-src/unittest/libmariadb/async.c       
2023-01-16 12:12:46.000000000 +0100
@@ -248,12 +248,62 @@
   return OK;
 }
 
+static int test_conc622(MYSQL *my __attribute__((unused)))
+{
+  int rc;
+  MYSQL mysql, *ret;
+  int status;
+  uint default_timeout;
+  int i;
+  const char *invalid_host= "1.0.0.0";
+
+  if (skip_async)
+    return SKIP;
+
+  for (i=0; i < 5; i++)
+  {
+    mysql_init(&mysql);
+    rc= mysql_options(&mysql, MYSQL_OPT_NONBLOCK, 0);
+    check_mysql_rc(rc, (MYSQL *)&mysql);
+
+    /* set timeouts to 300 microseconds */
+    default_timeout= 3;
+    mysql_options(&mysql, MYSQL_OPT_READ_TIMEOUT, &default_timeout);
+    mysql_options(&mysql, MYSQL_OPT_CONNECT_TIMEOUT, &default_timeout);
+    mysql_options(&mysql, MYSQL_OPT_WRITE_TIMEOUT, &default_timeout);
+    mysql_options(&mysql, MYSQL_READ_DEFAULT_GROUP, "myapp");
+
+    /* Returns 0 when done, else flag for what to wait for when need to block. 
*/
+    status= mysql_real_connect_start(&ret, &mysql, invalid_host, username, 
password, schema, port, socketname, 0);
+    while (status)
+    {
+      status= wait_for_mysql(&mysql, status);
+      status= mysql_real_connect_cont(&ret, &mysql, status);
+    }
+    if (!ret)
+    {
+      status= mysql_close_start(&mysql);
+      while (status)
+      {
+        status= wait_for_mysql(&mysql, status);
+        status= mysql_close_cont(&mysql, status);
+      }
+    } else {
+      diag("Expected error when connecting to host '%s'", invalid_host);
+      diag("Connected to %s", mysql_get_server_info(&mysql));
+      return FAIL;
+    }
+  }
+  return OK;
+}
+
 
 struct my_tests_st my_tests[] = {
   {"test_async", test_async, TEST_CONNECTION_DEFAULT, 0,  NULL,  NULL},
   {"async1", async1, TEST_CONNECTION_DEFAULT, 0,  NULL,  NULL},
   {"test_conc131", test_conc131, TEST_CONNECTION_NONE, 0,  NULL,  NULL},
   {"test_conc129", test_conc129, TEST_CONNECTION_NONE, 0,  NULL,  NULL},
+  {"test_conc622", test_conc622, TEST_CONNECTION_NONE, 0,  NULL,  NULL},
   {NULL, NULL, 0, 0, NULL, NULL}
 };
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/mariadb-connector-c-3.3.3-src/unittest/libmariadb/basic-t.c 
new/mariadb-connector-c-3.3.4-src/unittest/libmariadb/basic-t.c
--- old/mariadb-connector-c-3.3.3-src/unittest/libmariadb/basic-t.c     
2022-11-07 09:09:29.000000000 +0100
+++ new/mariadb-connector-c-3.3.4-src/unittest/libmariadb/basic-t.c     
2023-01-16 12:12:46.000000000 +0100
@@ -806,7 +806,48 @@
   return OK;
 }
 
+static int test_conc624(MYSQL *mysql)
+{
+  MYSQL_STMT *stmt= mysql_stmt_init(mysql);
+  char errmsg[MYSQL_ERRMSG_SIZE];
+
+  SET_CLIENT_STMT_ERROR(stmt, 9000, SQLSTATE_UNKNOWN, 0);
+  snprintf(errmsg, MYSQL_ERRMSG_SIZE, ER_UNKNOWN_ERROR_CODE, 9000);
+  diag("stmt_error: %s", mysql_stmt_error(stmt));
+  FAIL_IF(strcmp(mysql_stmt_error(stmt), errmsg), "expected undefined error 
9000");
+
+  SET_CLIENT_STMT_ERROR(stmt, 0, SQLSTATE_UNKNOWN, 0);
+  snprintf(errmsg, MYSQL_ERRMSG_SIZE, ER_UNKNOWN_ERROR_CODE, 0);
+  FAIL_IF(strcmp(mysql_stmt_error(stmt), errmsg), "expected undefined error 
0");
+
+  SET_CLIENT_STMT_ERROR(stmt, 4999, SQLSTATE_UNKNOWN, 0);
+  snprintf(errmsg, MYSQL_ERRMSG_SIZE, ER_UNKNOWN_ERROR_CODE, 4999);
+  FAIL_IF(strcmp(mysql_stmt_error(stmt), errmsg), "expected undefined error 
4999");
+
+  my_set_error(mysql, 4999, SQLSTATE_UNKNOWN, 0);
+  snprintf(errmsg, MYSQL_ERRMSG_SIZE, ER_UNKNOWN_ERROR_CODE, 4999);
+  FAIL_IF(strcmp(mysql_error(mysql), errmsg), "expected undefined error 4999");
+
+  my_set_error(mysql, 0, SQLSTATE_UNKNOWN, 0);
+  snprintf(errmsg, MYSQL_ERRMSG_SIZE, ER_UNKNOWN_ERROR_CODE, 0);
+  FAIL_IF(strcmp(mysql_error(mysql), errmsg), "expected undefined error 0");
+
+  my_set_error(mysql, 9000, SQLSTATE_UNKNOWN, 0);
+  snprintf(errmsg, MYSQL_ERRMSG_SIZE, ER_UNKNOWN_ERROR_CODE, 9000);
+  FAIL_IF(strcmp(mysql_error(mysql), errmsg), "expected undefined error 9000");
+
+  /* test if  SET_CLIENT_STMT_ERROR works with variadic arguments */
+  SET_CLIENT_STMT_ERROR(stmt, CR_STMT_CLOSED, SQLSTATE_UNKNOWN, 0, "foobar");
+  snprintf(errmsg, MYSQL_ERRMSG_SIZE, ER(CR_STMT_CLOSED), "foobar");
+  FAIL_IF(strcmp(mysql_stmt_error(stmt), errmsg), "error when passing variadic 
arguments to prepared stmt error function");
+
+  mysql_stmt_close(stmt);
+
+  return OK;
+}
+
 struct my_tests_st my_tests[] = {
+  {"test_conc624", test_conc624, TEST_CONNECTION_DEFAULT, 0, NULL, NULL},
   {"test_conc75", test_conc75, TEST_CONNECTION_DEFAULT, 0,  NULL,  NULL},
   {"test_conc74", test_conc74, TEST_CONNECTION_DEFAULT, 0,  NULL,  NULL},
   {"test_conc71", test_conc71, TEST_CONNECTION_DEFAULT, 0,  NULL,  NULL},
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/mariadb-connector-c-3.3.3-src/unittest/libmariadb/charset.c 
new/mariadb-connector-c-3.3.4-src/unittest/libmariadb/charset.c
--- old/mariadb-connector-c-3.3.3-src/unittest/libmariadb/charset.c     
2022-11-07 09:09:29.000000000 +0100
+++ new/mariadb-connector-c-3.3.4-src/unittest/libmariadb/charset.c     
2023-01-16 12:12:46.000000000 +0100
@@ -829,11 +829,16 @@
   res= mysql_store_result(mysql);
   while ((row = mysql_fetch_row(res)))
   {
-    int id= atoi(row[0]);
-    if (!mariadb_get_charset_by_nr(id))
+    int id;
+
+    if (row[0])
     {
-      diag("%04d %s %s", id, row[1], row[2]);
-      found++;
+      id= atoi(row[0]);
+      if (!mariadb_get_charset_by_nr(id))
+      {
+        diag("%04d %s %s", id, row[1], row[2]);
+        found++;
+      }
     }
   }
   mysql_free_result(res);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/mariadb-connector-c-3.3.3-src/unittest/libmariadb/connection.c 
new/mariadb-connector-c-3.3.4-src/unittest/libmariadb/connection.c
--- old/mariadb-connector-c-3.3.3-src/unittest/libmariadb/connection.c  
2022-11-07 09:09:29.000000000 +0100
+++ new/mariadb-connector-c-3.3.4-src/unittest/libmariadb/connection.c  
2023-01-16 12:12:46.000000000 +0100
@@ -1667,6 +1667,7 @@
 
   if (rc)
   {
+    diag("Error: %s", mysql_error(my));
     diag("caching_sha256_password not supported");
     return SKIP; 
   }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/mariadb-connector-c-3.3.3-src/unittest/libmariadb/my_test.h 
new/mariadb-connector-c-3.3.4-src/unittest/libmariadb/my_test.h
--- old/mariadb-connector-c-3.3.3-src/unittest/libmariadb/my_test.h     
2022-11-07 09:09:29.000000000 +0100
+++ new/mariadb-connector-c-3.3.4-src/unittest/libmariadb/my_test.h     
2023-01-16 12:12:46.000000000 +0100
@@ -32,6 +32,7 @@
 #include <stdlib.h>
 #include <ma_server_error.h>
 #include <mysql/client_plugin.h>
+#include <errmsg.h>
 
 #ifndef WIN32
 #include <pthread.h>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/mariadb-connector-c-3.3.3-src/unittest/libmariadb/ps_bugs.c 
new/mariadb-connector-c-3.3.4-src/unittest/libmariadb/ps_bugs.c
--- old/mariadb-connector-c-3.3.3-src/unittest/libmariadb/ps_bugs.c     
2022-11-07 09:09:29.000000000 +0100
+++ new/mariadb-connector-c-3.3.4-src/unittest/libmariadb/ps_bugs.c     
2023-01-16 12:12:46.000000000 +0100
@@ -5587,7 +5587,79 @@
   return OK;
 }
 
+my_bool conc623_param_callback(void *data __attribute((unused)),
+                               MYSQL_BIND *bind __attribute((unused)),
+                               unsigned int row_nr __attribute((unused)))
+{
+  return 1;
+}
+
+static int test_conc623(MYSQL *mysql)
+{
+  int rc;
+  unsigned int paramcount= 1;
+  unsigned int array_size= 2;
+  MYSQL_BIND bind;
+
+  MYSQL_STMT *stmt= mysql_stmt_init(mysql);
+
+  rc= mysql_query(mysql, "CREATE OR REPLACE TEMPORARY TABLE t1 (a int)");
+
+  rc= mysql_stmt_attr_set(stmt, STMT_ATTR_CB_USER_DATA, mysql);
+  check_stmt_rc(rc, stmt);
+
+  rc= mysql_stmt_attr_set(stmt, STMT_ATTR_ARRAY_SIZE, &array_size);
+  check_stmt_rc(rc, stmt);
+
+  rc= mysql_stmt_attr_set(stmt, STMT_ATTR_PREBIND_PARAMS, &paramcount);
+  check_stmt_rc(rc, stmt);
+
+  rc= mysql_stmt_attr_set(stmt, STMT_ATTR_CB_PARAM, conc623_param_callback);
+  check_stmt_rc(rc, stmt);
+
+  bind.buffer_type= MYSQL_TYPE_LONG;
+  rc= mysql_stmt_bind_param(stmt, &bind);
+  check_stmt_rc(rc, stmt);
+
+  rc= mysql_stmt_prepare(stmt, SL("INSERT INTO t1 VALUES (?)"));
+  check_stmt_rc(rc, stmt);
+
+  rc= mysql_stmt_execute(stmt);
+  if (!rc)
+  {
+    diag("Error expected from callback function");
+    mysql_stmt_close(stmt);
+    return FAIL;
+  }
+
+  diag("Error (expected) %s", mysql_stmt_error(stmt));
+  mysql_stmt_close(stmt);
+  return OK;
+}
+
+static int test_conc627(MYSQL *mysql)
+{
+  MYSQL_STMT *stmt= mysql_stmt_init(mysql);
+  int rc;
+
+  rc= mysql_stmt_prepare(stmt, SL("show grants for mysqltest_8"));
+  check_stmt_rc(rc, stmt);
+
+  rc= mysql_stmt_execute(stmt);
+  check_stmt_rc(rc, stmt);
+
+  mysql_stmt_store_result(stmt);
+  FAIL_IF(!mysql_stmt_errno(stmt), "Expected error");
+  FAIL_IF(strcmp(mysql_error(mysql), mysql_stmt_error(stmt)), "Error messages 
differ");
+
+  mysql_stmt_close(stmt);
+
+  return OK;
+}
+
 struct my_tests_st my_tests[] = {
+  {"test_conc623", test_conc623, TEST_CONNECTION_DEFAULT, 0, NULL, NULL},
+  {"test_conc627", test_conc627, TEST_CONNECTION_DEFAULT, 0, NULL, NULL},
   {"test_mdev19838", test_mdev19838, TEST_CONNECTION_DEFAULT, 0, NULL, NULL},
   {"test_conc525", test_conc525, TEST_CONNECTION_DEFAULT, 0, NULL, NULL},
   {"test_conc566", test_conc566, TEST_CONNECTION_DEFAULT, 0, NULL, NULL},

Reply via email to