You've already forked mariadb-connector-c
mirror of
https://github.com/mariadb-corporation/mariadb-connector-c.git
synced 2025-08-07 02:42:49 +03:00
Merge branch '3.1' into 3.2
This commit is contained in:
@@ -448,6 +448,7 @@ IF(WITH_MYSQLCOMPAT)
|
|||||||
ENDIF()
|
ENDIF()
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
|
create_symlink(libmariadb${CMAKE_STATIC_LIBRARY_SUFFIX} mariadbclient ${INSTALL_LIBDIR})
|
||||||
|
|
||||||
SET_TARGET_PROPERTIES(libmariadb PROPERTIES VERSION
|
SET_TARGET_PROPERTIES(libmariadb PROPERTIES VERSION
|
||||||
${CPACK_PACKAGE_VERSION_MAJOR}
|
${CPACK_PACKAGE_VERSION_MAJOR}
|
||||||
@@ -460,10 +461,14 @@ ENDIF()
|
|||||||
INSTALL(TARGETS mariadbclient
|
INSTALL(TARGETS mariadbclient
|
||||||
COMPONENT Development
|
COMPONENT Development
|
||||||
DESTINATION ${INSTALL_LIBDIR})
|
DESTINATION ${INSTALL_LIBDIR})
|
||||||
INSTALL(TARGETS libmariadb
|
# in cmake 3.12+ we can use
|
||||||
COMPONENT SharedLibraries
|
#INSTALL(TARGETS libmariadb LIBRARY DESTINATION ${INSTALL_LIBDIR}
|
||||||
DESTINATION ${INSTALL_LIBDIR})
|
# COMPONENT SharedLibraries NAMELINK_COMPONENT Development)
|
||||||
|
# but as long as we build on CentOS 7 with its cmake 2.8.12.2 we have to use
|
||||||
|
INSTALL(TARGETS libmariadb LIBRARY DESTINATION ${INSTALL_LIBDIR}
|
||||||
|
COMPONENT SharedLibraries NAMELINK_SKIP)
|
||||||
|
INSTALL(TARGETS libmariadb LIBRARY DESTINATION ${INSTALL_LIBDIR}
|
||||||
|
COMPONENT Development NAMELINK_ONLY)
|
||||||
|
|
||||||
IF(MSVC)
|
IF(MSVC)
|
||||||
# On Windows, install PDB
|
# On Windows, install PDB
|
||||||
|
@@ -812,6 +812,16 @@ unsigned char* ma_stmt_execute_generate_simple_request(MYSQL_STMT *stmt, size_t
|
|||||||
size+= 9; /* max 8 bytes for size */
|
size+= 9; /* max 8 bytes for size */
|
||||||
size+= (size_t)ma_get_length(stmt, i, 0);
|
size+= (size_t)ma_get_length(stmt, i, 0);
|
||||||
break;
|
break;
|
||||||
|
case MYSQL_TYPE_TIME:
|
||||||
|
size+= MAX_TIME_STR_LEN;
|
||||||
|
break;
|
||||||
|
case MYSQL_TYPE_DATE:
|
||||||
|
size+= MAX_DATE_STR_LEN;
|
||||||
|
break;
|
||||||
|
case MYSQL_TYPE_DATETIME:
|
||||||
|
case MYSQL_TYPE_TIMESTAMP:
|
||||||
|
size+= MAX_DATETIME_STR_LEN;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
size+= mysql_ps_fetch_functions[stmt->params[i].buffer_type].pack_len;
|
size+= mysql_ps_fetch_functions[stmt->params[i].buffer_type].pack_len;
|
||||||
break;
|
break;
|
||||||
|
@@ -59,7 +59,7 @@ ENDIF()
|
|||||||
# Installation
|
# Installation
|
||||||
#
|
#
|
||||||
INSTALL(TARGETS mariadb_config
|
INSTALL(TARGETS mariadb_config
|
||||||
DESTINATION "bin"
|
DESTINATION "${INSTALL_BINDIR}"
|
||||||
COMPONENT Development)
|
COMPONENT Development)
|
||||||
|
|
||||||
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/libmariadb.pc
|
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/libmariadb.pc
|
||||||
|
@@ -26,7 +26,7 @@ INCLUDE_DIRECTORIES(${CC_SOURCE_DIR}/include
|
|||||||
${CC_SOURCE_DIR}/unittest/libmariadb)
|
${CC_SOURCE_DIR}/unittest/libmariadb)
|
||||||
ADD_DEFINITIONS(-DLIBMARIADB)
|
ADD_DEFINITIONS(-DLIBMARIADB)
|
||||||
|
|
||||||
SET(API_TESTS "conc336" "bulk1" "performance" "basic-t" "fetch" "charset" "logs" "cursor" "errors" "view" "ps" "ps_bugs" "sp" "result" "connection" "misc" "ps_new" "thread" "features-10_2" "bulk1")
|
SET(API_TESTS "conc336" "bulk1" "performance" "basic-t" "fetch" "charset" "logs" "cursor" "errors" "view" "ps" "ps_bugs" "sp" "result" "connection" "misc" "ps_new" "thread" "features-10_2")
|
||||||
IF(WITH_DYNCOL)
|
IF(WITH_DYNCOL)
|
||||||
SET(API_TESTS ${API_TESTS} "dyncol")
|
SET(API_TESTS ${API_TESTS} "dyncol")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
@@ -880,7 +880,7 @@ static int test_get_options(MYSQL *unused __attribute__((unused)))
|
|||||||
const char *attr_val[] = {"bar1", "bar2", "bar3"};
|
const char *attr_val[] = {"bar1", "bar2", "bar3"};
|
||||||
char **key, **val;
|
char **key, **val;
|
||||||
|
|
||||||
for (i=0; options_int[i]; i++)
|
for (i=0; i < (int)(sizeof(options_int)/sizeof(int)); i++)
|
||||||
{
|
{
|
||||||
mysql_options(mysql, options_int[i], &intval[0]);
|
mysql_options(mysql, options_int[i], &intval[0]);
|
||||||
intval[1]= 0;
|
intval[1]= 0;
|
||||||
|
@@ -293,7 +293,7 @@ static int test_frm_bug(MYSQL *mysql)
|
|||||||
rc= 0;
|
rc= 0;
|
||||||
while (mysql_fetch_row(result))
|
while (mysql_fetch_row(result))
|
||||||
rc++;
|
rc++;
|
||||||
FAIL_UNLESS(rc == 1, "rowcount != 0");
|
FAIL_UNLESS(rc == 1, "rowcount != 1");
|
||||||
|
|
||||||
mysql_data_seek(result, 0);
|
mysql_data_seek(result, 0);
|
||||||
|
|
||||||
|
@@ -139,9 +139,6 @@ static int test_prepare_insert_update(MYSQL *mysql)
|
|||||||
rc= mysql_query(mysql, "DROP TABLE IF EXISTS t1");
|
rc= mysql_query(mysql, "DROP TABLE IF EXISTS t1");
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
|
|
||||||
rc= mysql_query(mysql, "DROP TABLE IF EXISTS t1");
|
|
||||||
check_mysql_rc(rc, mysql);
|
|
||||||
|
|
||||||
for (cur_query= testcase; *cur_query; cur_query++)
|
for (cur_query= testcase; *cur_query; cur_query++)
|
||||||
{
|
{
|
||||||
char query[MAX_TEST_QUERY_LENGTH];
|
char query[MAX_TEST_QUERY_LENGTH];
|
||||||
@@ -183,7 +180,7 @@ static int test_prepare_insert_update(MYSQL *mysql)
|
|||||||
static int test_bind_date_conv(MYSQL *mysql, uint row_count)
|
static int test_bind_date_conv(MYSQL *mysql, uint row_count)
|
||||||
{
|
{
|
||||||
MYSQL_STMT *stmt= 0;
|
MYSQL_STMT *stmt= 0;
|
||||||
uint rc, i, count= row_count;
|
uint rc, i, count;
|
||||||
MYSQL_BIND my_bind[4];
|
MYSQL_BIND my_bind[4];
|
||||||
my_bool is_null[4]= {0,0,0,0};
|
my_bool is_null[4]= {0,0,0,0};
|
||||||
MYSQL_TIME tm[4];
|
MYSQL_TIME tm[4];
|
||||||
@@ -1020,7 +1017,7 @@ static int test_select_show(MYSQL *mysql)
|
|||||||
|
|
||||||
strcpy(query, "show columns from test_show");
|
strcpy(query, "show columns from test_show");
|
||||||
stmt= mysql_stmt_init(mysql);
|
stmt= mysql_stmt_init(mysql);
|
||||||
FAIL_IF(!stmt, mysql_error(mysql));
|
FAIL_IF(!stmt, mysql_stmt_error(stmt));
|
||||||
rc= mysql_stmt_prepare(stmt, SL(query));
|
rc= mysql_stmt_prepare(stmt, SL(query));
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
@@ -3004,7 +3001,7 @@ static int test_create_drop(MYSQL *mysql)
|
|||||||
check_stmt_rc(rc, stmt_drop);
|
check_stmt_rc(rc, stmt_drop);
|
||||||
|
|
||||||
rc= mysql_stmt_execute(stmt_create_select);
|
rc= mysql_stmt_execute(stmt_create_select);
|
||||||
check_stmt_rc(rc, stmt_create);
|
check_stmt_rc(rc, stmt_create_select);
|
||||||
|
|
||||||
rc= mysql_stmt_execute(stmt_select);
|
rc= mysql_stmt_execute(stmt_select);
|
||||||
check_stmt_rc(rc, stmt_select);
|
check_stmt_rc(rc, stmt_select);
|
||||||
|
@@ -449,7 +449,7 @@ static int test_bug11037(MYSQL *mysql)
|
|||||||
|
|
||||||
/* expected error */
|
/* expected error */
|
||||||
rc = mysql_stmt_fetch(stmt);
|
rc = mysql_stmt_fetch(stmt);
|
||||||
FAIL_UNLESS(rc==1, "Error expedted");
|
FAIL_UNLESS(rc==1, "Error expected");
|
||||||
|
|
||||||
rc= mysql_stmt_execute(stmt);
|
rc= mysql_stmt_execute(stmt);
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
@@ -543,7 +543,7 @@ static int test_bug12744(MYSQL *mysql)
|
|||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
|
|
||||||
rc= mysql_stmt_close(stmt);
|
rc= mysql_stmt_close(stmt);
|
||||||
check_mysql_rc(rc, mysql);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
@@ -726,7 +726,7 @@ static int test_bug15518(MYSQL *mysql)
|
|||||||
succeeds
|
succeeds
|
||||||
*/
|
*/
|
||||||
rc= mysql_stmt_prepare(stmt, "SHOW STATUS", 12);
|
rc= mysql_stmt_prepare(stmt, "SHOW STATUS", 12);
|
||||||
FAIL_UNLESS(!rc || mysql_stmt_errno(stmt) || mysql_errno(mysql), "Error expected");
|
FAIL_UNLESS(!rc || mysql_stmt_errno(stmt) || mysql_errno(mysql), "Error not expected");
|
||||||
|
|
||||||
rc= mysql_stmt_close(stmt);
|
rc= mysql_stmt_close(stmt);
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
@@ -789,7 +789,7 @@ static int test_bug15613(MYSQL *mysql)
|
|||||||
metadata= mysql_stmt_result_metadata(stmt);
|
metadata= mysql_stmt_result_metadata(stmt);
|
||||||
field= mysql_fetch_fields(metadata);
|
field= mysql_fetch_fields(metadata);
|
||||||
FAIL_UNLESS(field[0].length == 65535, "length != 65535");
|
FAIL_UNLESS(field[0].length == 65535, "length != 65535");
|
||||||
FAIL_UNLESS(field[1].length == 255, "length != 244");
|
FAIL_UNLESS(field[1].length == 255, "length != 255");
|
||||||
FAIL_UNLESS(field[2].length == 16777215, "length != 166777215");
|
FAIL_UNLESS(field[2].length == 16777215, "length != 166777215");
|
||||||
FAIL_UNLESS(field[3].length == 4294967295UL, "length != 4294967295UL");
|
FAIL_UNLESS(field[3].length == 4294967295UL, "length != 4294967295UL");
|
||||||
FAIL_UNLESS(field[4].length == 255, "length != 255");
|
FAIL_UNLESS(field[4].length == 255, "length != 255");
|
||||||
@@ -4322,7 +4322,7 @@ static int test_conc182(MYSQL *mysql)
|
|||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
rc= mysql_stmt_close(stmt);
|
rc= mysql_stmt_close(stmt);
|
||||||
check_mysql_rc(rc, mysql);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
rc= mysql_query(mysql, "SELECT row_count()");
|
rc= mysql_query(mysql, "SELECT row_count()");
|
||||||
result= mysql_store_result(mysql);
|
result= mysql_store_result(mysql);
|
||||||
@@ -4530,8 +4530,8 @@ static int test_conc205(MYSQL *mysql)
|
|||||||
FAIL_IF(length[2] != 4, "Wrong fetched int length");
|
FAIL_IF(length[2] != 4, "Wrong fetched int length");
|
||||||
|
|
||||||
FAIL_IF(strncmp(data, "data2", length[0] + 1) != 0, "Wrong string value");
|
FAIL_IF(strncmp(data, "data2", length[0] + 1) != 0, "Wrong string value");
|
||||||
FAIL_IF(smint_col != -25734, "Expected 21893");
|
FAIL_IF(smint_col != -25734, "Expected -25734");
|
||||||
FAIL_IF(int_col != -1857802040, "Expected 1718038908");
|
FAIL_IF(int_col != -1857802040, "Expected -1857802040");
|
||||||
|
|
||||||
rc= mysql_stmt_fetch(stmt);
|
rc= mysql_stmt_fetch(stmt);
|
||||||
FAIL_IF(rc != MYSQL_NO_DATA, "Expected MYSQL_NO_DATA");
|
FAIL_IF(rc != MYSQL_NO_DATA, "Expected MYSQL_NO_DATA");
|
||||||
@@ -4840,9 +4840,6 @@ static int test_codbc138(MYSQL *mysql)
|
|||||||
{0,0,0, 838,59,59, 0, 1, MYSQL_TIMESTAMP_TIME},
|
{0,0,0, 838,59,59, 0, 1, MYSQL_TIMESTAMP_TIME},
|
||||||
},
|
},
|
||||||
|
|
||||||
{"SELECT '00:60:00'",
|
|
||||||
{0,0,0, 0,0,0, 0,0, MYSQL_TIMESTAMP_ERROR},
|
|
||||||
},
|
|
||||||
{"SELECT '00:60:00'",
|
{"SELECT '00:60:00'",
|
||||||
{0,0,0, 0,0,0, 0,0, MYSQL_TIMESTAMP_ERROR},
|
{0,0,0, 0,0,0, 0,0, MYSQL_TIMESTAMP_ERROR},
|
||||||
},
|
},
|
||||||
@@ -4987,8 +4984,8 @@ static int test_conc_fraction(MYSQL *mysql)
|
|||||||
rc= mysql_stmt_execute(stmt);
|
rc= mysql_stmt_execute(stmt);
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
check_stmt_rc(rc, stmt);
|
|
||||||
rc = mysql_stmt_store_result(stmt);
|
rc = mysql_stmt_store_result(stmt);
|
||||||
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
memset(bind, 0, sizeof(MYSQL_BIND));
|
memset(bind, 0, sizeof(MYSQL_BIND));
|
||||||
bind[0].buffer_type= MYSQL_TYPE_DATETIME;
|
bind[0].buffer_type= MYSQL_TYPE_DATETIME;
|
||||||
@@ -5004,9 +5001,11 @@ static int test_conc_fraction(MYSQL *mysql)
|
|||||||
|
|
||||||
expected= i > 6 ? 123456 : frac * (unsigned int)powl(10, (6 - i));
|
expected= i > 6 ? 123456 : frac * (unsigned int)powl(10, (6 - i));
|
||||||
|
|
||||||
diag("tm.second_part=%ld expected=%ld", tm.second_part, expected);
|
if (tm.second_part != expected)
|
||||||
FAIL_IF(tm.second_part != expected, "expected fractional part to be 900000");
|
{
|
||||||
|
diag("Error: tm.second_part=%ld expected=%ld", tm.second_part, expected);
|
||||||
|
return FAIL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
mysql_stmt_close(stmt);
|
mysql_stmt_close(stmt);
|
||||||
return OK;
|
return OK;
|
||||||
|
@@ -120,7 +120,7 @@ static int test_multi_result(MYSQL *mysql)
|
|||||||
rc= mysql_stmt_fetch(stmt);
|
rc= mysql_stmt_fetch(stmt);
|
||||||
FAIL_IF(mysql_stmt_field_count(stmt) != 2, "expected 2 fields");
|
FAIL_IF(mysql_stmt_field_count(stmt) != 2, "expected 2 fields");
|
||||||
FAIL_IF(int_data[0] != 200 || int_data[1] != 300,
|
FAIL_IF(int_data[0] != 200 || int_data[1] != 300,
|
||||||
"expected 100 200 300");
|
"expected 200 300");
|
||||||
|
|
||||||
FAIL_IF(mysql_stmt_next_result(stmt) != 0, "expected more results");
|
FAIL_IF(mysql_stmt_next_result(stmt) != 0, "expected more results");
|
||||||
FAIL_IF(mysql_stmt_field_count(stmt) != 0, "expected 0 fields");
|
FAIL_IF(mysql_stmt_field_count(stmt) != 0, "expected 0 fields");
|
||||||
|
@@ -31,9 +31,8 @@ static int test_conc_173(MYSQL *unused __attribute__((unused)))
|
|||||||
{
|
{
|
||||||
MYSQL mysql;
|
MYSQL mysql;
|
||||||
int arg;
|
int arg;
|
||||||
int i=0;
|
|
||||||
|
|
||||||
for (;;)
|
for (int i = 0; i < 1000; i++)
|
||||||
{
|
{
|
||||||
mysql_init(&mysql);
|
mysql_init(&mysql);
|
||||||
mysql_options(&mysql, MYSQL_READ_DEFAULT_GROUP, "client");
|
mysql_options(&mysql, MYSQL_READ_DEFAULT_GROUP, "client");
|
||||||
|
Reference in New Issue
Block a user