You've already forked mariadb-connector-c
mirror of
https://github.com/mariadb-corporation/mariadb-connector-c.git
synced 2025-08-01 06:27:04 +03:00
Merge branch '3.1' into 3.3
This commit is contained in:
@ -1106,6 +1106,7 @@ static void convert_to_datetime(MYSQL_TIME *t, unsigned char **row, uint len, en
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static const uint32_t sec_part_digits[]= {1000000, 100000, 10000, 1000, 100, 10, 1};
|
||||||
|
|
||||||
/* {{{ ps_fetch_datetime */
|
/* {{{ ps_fetch_datetime */
|
||||||
static
|
static
|
||||||
@ -1151,7 +1152,7 @@ void ps_fetch_datetime(MYSQL_BIND *r_param, const MYSQL_FIELD * field,
|
|||||||
{
|
{
|
||||||
uint8_t decimals= (field->decimals == AUTO_SEC_PART_DIGITS) ? SEC_PART_DIGITS : field->decimals;
|
uint8_t decimals= (field->decimals == AUTO_SEC_PART_DIGITS) ? SEC_PART_DIGITS : field->decimals;
|
||||||
length= sprintf(dtbuffer, "%s%02u:%02u:%02u.%0*u", (tm.neg ? "-" : ""), tm.hour, tm.minute, tm.second,
|
length= sprintf(dtbuffer, "%s%02u:%02u:%02u.%0*u", (tm.neg ? "-" : ""), tm.hour, tm.minute, tm.second,
|
||||||
decimals, (uint32_t)(tm.second_part / pow(10, 6 - decimals)));
|
decimals, (uint32_t)(tm.second_part / sec_part_digits[decimals]));
|
||||||
} else
|
} else
|
||||||
length= sprintf(dtbuffer, "%s%02u:%02u:%02u", (tm.neg ? "-" : ""), tm.hour, tm.minute, tm.second);
|
length= sprintf(dtbuffer, "%s%02u:%02u:%02u", (tm.neg ? "-" : ""), tm.hour, tm.minute, tm.second);
|
||||||
break;
|
break;
|
||||||
@ -1162,7 +1163,7 @@ void ps_fetch_datetime(MYSQL_BIND *r_param, const MYSQL_FIELD * field,
|
|||||||
{
|
{
|
||||||
uint8_t decimals= (field->decimals == AUTO_SEC_PART_DIGITS) ? SEC_PART_DIGITS : field->decimals;
|
uint8_t decimals= (field->decimals == AUTO_SEC_PART_DIGITS) ? SEC_PART_DIGITS : field->decimals;
|
||||||
length= sprintf(dtbuffer, "%04u-%02u-%02u %02u:%02u:%02u.%0*u", tm.year, tm.month, tm.day, tm.hour, tm.minute, tm.second,
|
length= sprintf(dtbuffer, "%04u-%02u-%02u %02u:%02u:%02u.%0*u", tm.year, tm.month, tm.day, tm.hour, tm.minute, tm.second,
|
||||||
decimals, (uint32_t)(tm.second_part / pow(10, 6 - decimals)));
|
decimals, (uint32_t)(tm.second_part / sec_part_digits[decimals]));
|
||||||
} else
|
} else
|
||||||
length= sprintf(dtbuffer, "%04u-%02u-%02u %02u:%02u:%02u", tm.year, tm.month, tm.day, tm.hour, tm.minute, tm.second);
|
length= sprintf(dtbuffer, "%04u-%02u-%02u %02u:%02u:%02u", tm.year, tm.month, tm.day, tm.hour, tm.minute, tm.second);
|
||||||
break;
|
break;
|
||||||
|
@ -404,6 +404,7 @@ mthd_my_send_cmd(MYSQL *mysql,enum enum_server_command command, const char *arg,
|
|||||||
(socket) is still available */
|
(socket) is still available */
|
||||||
if (command != COM_QUIT && mysql->options.reconnect && ma_pvio_is_alive(mysql->net.pvio))
|
if (command != COM_QUIT && mysql->options.reconnect && ma_pvio_is_alive(mysql->net.pvio))
|
||||||
{
|
{
|
||||||
|
ma_pvio_close(mysql->net.pvio);
|
||||||
mysql->net.pvio= NULL;
|
mysql->net.pvio= NULL;
|
||||||
mysql->net.error= 1;
|
mysql->net.error= 1;
|
||||||
}
|
}
|
||||||
@ -2446,17 +2447,15 @@ void my_set_error(MYSQL *mysql,
|
|||||||
|
|
||||||
void mysql_close_slow_part(MYSQL *mysql)
|
void mysql_close_slow_part(MYSQL *mysql)
|
||||||
{
|
{
|
||||||
if (mysql->net.pvio)
|
free_old_query(mysql);
|
||||||
{
|
mysql->status=MYSQL_STATUS_READY; /* Force command */
|
||||||
free_old_query(mysql);
|
mysql->options.reconnect=0;
|
||||||
mysql->status=MYSQL_STATUS_READY; /* Force command */
|
if (mysql->net.pvio && mysql->net.buff)
|
||||||
mysql->options.reconnect=0;
|
ma_simple_command(mysql, COM_QUIT,NullS,0,1,0);
|
||||||
if (mysql->net.pvio && mysql->net.buff)
|
end_server(mysql);
|
||||||
ma_simple_command(mysql, COM_QUIT,NullS,0,1,0);
|
|
||||||
end_server(mysql);
|
|
||||||
}
|
|
||||||
/* there is an ongoing async operation */
|
/* there is an ongoing async operation */
|
||||||
else if (mysql->options.extension && mysql->options.extension->async_context)
|
if (mysql->options.extension && mysql->options.extension->async_context)
|
||||||
{
|
{
|
||||||
if (mysql->options.extension->async_context->pending_gai_res)
|
if (mysql->options.extension->async_context->pending_gai_res)
|
||||||
{
|
{
|
||||||
|
@ -2332,7 +2332,8 @@ static int test_conc505(MYSQL *my __attribute__((unused)))
|
|||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(HAVE_GNUTLS) || defined(HAVE_OPENSSL)
|
#if defined(HAVE_GNUTLS) && GNUTLS_VERSION_NUMBER >= 0x030700 || defined(HAVE_OPENSSL)
|
||||||
|
#define HAVE_test_conc748
|
||||||
static int test_conc748(MYSQL *my __attribute__((unused)))
|
static int test_conc748(MYSQL *my __attribute__((unused)))
|
||||||
{
|
{
|
||||||
MYSQL *mysql;
|
MYSQL *mysql;
|
||||||
@ -2416,7 +2417,7 @@ static int test_conc589(MYSQL *my)
|
|||||||
|
|
||||||
struct my_tests_st my_tests[] = {
|
struct my_tests_st my_tests[] = {
|
||||||
{"test_conc589", test_conc589, TEST_CONNECTION_DEFAULT, 0, NULL, NULL},
|
{"test_conc589", test_conc589, TEST_CONNECTION_DEFAULT, 0, NULL, NULL},
|
||||||
#if defined(HAVE_GNUTLS) || defined(HAVE_OPENSSL)
|
#ifdef HAVE_test_conc748
|
||||||
{"test_conc748", test_conc748, TEST_CONNECTION_NONE, 0, NULL, NULL},
|
{"test_conc748", test_conc748, TEST_CONNECTION_NONE, 0, NULL, NULL},
|
||||||
#endif
|
#endif
|
||||||
{"test_conc505", test_conc505, TEST_CONNECTION_NONE, 0, NULL, NULL},
|
{"test_conc505", test_conc505, TEST_CONNECTION_NONE, 0, NULL, NULL},
|
||||||
|
Reference in New Issue
Block a user