diff --git a/unittest/libmariadb/ps_bugs.c b/unittest/libmariadb/ps_bugs.c
index efe3d44..1e51202 100644
--- a/unittest/libmariadb/ps_bugs.c
+++ b/unittest/libmariadb/ps_bugs.c
@@ -5741,7 +5741,165 @@ end:
   return ret;
 }
 
+/* Using a single result set. */
+static int test_conc_josep(MYSQL *mysql)
+{
+  int            rc;
+  MYSQL_STMT    *stmt1;
+  MYSQL_STMT    *stmt2;
+  MYSQL_BIND     bind;
+  unsigned long  buffer_char_len;
+  char           buffer_char[10];
+  my_bool        is_null;
+  my_bool        is_error;
+
+  memset(&bind, 0, sizeof(MYSQL_BIND));
+
+  /* Setup data */
+  rc = mysql_query(mysql, "CREATE TEMPORARY TABLE conc_josep(col CHAR(10))");
+  check_mysql_rc(rc, mysql);
+
+  rc = mysql_query(mysql, "INSERT INTO conc_josep VALUES('test1_1')");
+  check_mysql_rc(rc, mysql);
+
+  rc = mysql_query(mysql, "INSERT INTO conc_josep VALUES('test2_2')");
+  check_mysql_rc(rc, mysql);
+  /* End setup data */
+
+  stmt1 = mysql_stmt_init(mysql);
+  FAIL_IF(stmt1 == NULL, "mysql_stmt_init(stmt1)");
+
+#define SELECT_QUERY "SELECT * FROM conc_josep"
+  rc = mysql_stmt_prepare(stmt1, (const char *)SELECT_QUERY, sizeof(SELECT_QUERY) - 1);
+  check_stmt_rc(rc, stmt1);
+
+  stmt2 = mysql_stmt_init(mysql);
+  FAIL_IF(stmt2 == NULL, "mysql_stmt_init(stmt2)");
+
+  rc = mysql_stmt_prepare(stmt2, (const char *)SELECT_QUERY, sizeof(SELECT_QUERY) - 1);
+  check_stmt_rc(rc, stmt2);
+
+  //bind
+  bind.buffer_type   = MYSQL_TYPE_STRING;
+  bind.buffer        = buffer_char;
+  bind.buffer_length = sizeof(buffer_char);
+  bind.length        = &buffer_char_len;
+  bind.is_null       = &is_null;
+  bind.error         = &is_error;
+
+  rc = mysql_stmt_bind_result(stmt1, &bind);
+  check_stmt_rc(rc, stmt1);
+
+  rc = mysql_stmt_execute(stmt1);
+  check_stmt_rc(rc, stmt1);
+
+  rc = mysql_stmt_fetch(stmt1);
+  check_stmt_rc(rc, stmt1);
+  FAIL_IF(strcmp(buffer_char, "test1_1") != 0, "Unexpected data received");
+  FAIL_IF(buffer_char_len != (sizeof("test1_1") - 1), "Unexpected data length received");
+
+  /* Let's close stmt2 which has not started reading results. */
+  /* This should close the current cursor regardless of the stmt used. */
+  rc = mysql_stmt_close(stmt2);
+  check_stmt_rc(rc, stmt2);
+
+  /* At this point the mariadb client has lost synchonism with the physical mysql protocol so anything can
+  * happen: hangs, crashes, etc. In this example mysql_stmt_fetch will return an incorrect MYSQL_NO_DATA value.
+  * Instead it should return somethine in the lines of "not a cursor open to fetch from" */
+
+  rc = mysql_stmt_fetch(stmt1);
+  FAIL_IF(rc != 1, mysql_stmt_error(stmt1));
+
+  rc = mysql_stmt_close(stmt1);
+  check_stmt_rc(rc, stmt1);
+
+  return OK;
+}
+
+/* Using multiple result sets. */
+static int test_conc_josep2(MYSQL *mysql)
+{
+  int            rc;
+  MYSQL_STMT    *stmt1;
+  MYSQL_STMT    *stmt2;
+  MYSQL_BIND     bind;
+  unsigned long  buffer_char_len;
+  char           buffer_char[1];
+  my_bool        is_null;
+  my_bool        is_error;
+
+  memset(&bind, 0, sizeof(MYSQL_BIND));
+
+  /* Setup data */
+  rc = mysql_query(mysql, "CREATE TEMPORARY TABLE conc_josep(col CHAR(10))");
+  check_mysql_rc(rc, mysql);
+
+  rc= mysql_query(mysql, "DROP PROCEDURE IF EXISTS sp_conc_josep2");
+  check_mysql_rc(rc, mysql);
+
+  rc = mysql_query(mysql, "CREATE PROCEDURE sp_conc_josep2()"
+                          "BEGIN"
+                          "    SELECT 'a';"
+                          "    SELECT 'b';"
+                          "END");
+  check_mysql_rc(rc, mysql);
+  /* End setup data */
+
+  stmt1 = mysql_stmt_init(mysql);
+  FAIL_IF(stmt1 == NULL, "mysql_stmt_init(stmt1)");
+
+#define CALL_PROC_QUERY "call sp_conc_josep2()"
+  rc = mysql_stmt_prepare(stmt1, (const char *)CALL_PROC_QUERY, sizeof(CALL_PROC_QUERY) - 1);
+  check_stmt_rc(rc, stmt1);
+
+  stmt2 = mysql_stmt_init(mysql);
+  FAIL_IF(stmt2 == NULL, "mysql_stmt_init(stmt2)");
+
+#define SELECT_QUERY "SELECT * FROM conc_josep"
+  rc = mysql_stmt_prepare(stmt2, (const char *)SELECT_QUERY, sizeof(SELECT_QUERY) - 1);
+  check_stmt_rc(rc, stmt2);
+
+  /* Execute STORED PROC */
+  rc = mysql_stmt_execute(stmt1);
+  check_stmt_rc(rc, stmt1);
+
+  //bind STORE PROC columns
+  bind.buffer_type   = MYSQL_TYPE_STRING;
+  bind.buffer        = buffer_char;
+  bind.buffer_length = sizeof(buffer_char);
+  bind.length        = &buffer_char_len;
+  bind.is_null       = &is_null;
+  bind.error         = &is_error;
+
+  rc = mysql_stmt_bind_result(stmt1, &bind);
+  check_stmt_rc(rc, stmt1);
+
+  rc = mysql_stmt_fetch(stmt1);
+  check_stmt_rc(rc, stmt1);
+  FAIL_IF(strcmp(buffer_char, "a") != 0, "Unexpected data received");
+  FAIL_IF(buffer_char_len != (sizeof("a") - 1), "Unexpected data length received");
+
+  /* Let's close stmt2 which has not started reading results. */
+  /* This should close the current cursor regardless of the stmt used. */
+  rc = mysql_stmt_close(stmt2);
+  check_stmt_rc(rc, stmt2);
+
+  /* At this point the mariadb client has lost synchonism with the physical mysql protocol so anything can
+  * happen: hangs, crashes, etc. In this example mysql_stmt_fetch will return an incorrect MYSQL_NO_DATA value.
+  * Instead it should return somethine in the lines of "not a cursor open to fetch from" */
+
+  rc = mysql_stmt_fetch(stmt1);
+  FAIL_IF(rc != 1, mysql_stmt_error(stmt1));
+
+  rc = mysql_stmt_close(stmt1);
+  check_stmt_rc(rc, stmt1);
+
+  return OK;
+}
+
 struct my_tests_st my_tests[] = {
+  {"test_conc_josep", test_conc_josep, TEST_CONNECTION_DEFAULT, 0, NULL, NULL},
+  {"test_conc_josep2", test_conc_josep2, TEST_CONNECTION_DEFAULT, 0, NULL, NULL},
   {"test_conc633", test_conc633, TEST_CONNECTION_DEFAULT, 0, NULL, NULL},
   {"test_conc623", test_conc623, TEST_CONNECTION_DEFAULT, 0, NULL, NULL},
   {"test_conc627", test_conc627, TEST_CONNECTION_DEFAULT, 0, NULL, NULL},
