summaryrefslogtreecommitdiff
path: root/libmysqld
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2019-02-06 18:01:29 -0800
committerIgor Babaev <igor@askmonty.org>2019-02-06 18:01:29 -0800
commit3f9040085a0de4976f55bc7e4a2fa5fa8d923100 (patch)
treecefa82212b688d12a7ca180f7a0a8f32715e2a79 /libmysqld
parent16327fc2e76e9215059894b461e8aca7f989da00 (diff)
parente80bcd7f64fc8ff6f46c1fc0d01e9c0b0fd03064 (diff)
downloadmariadb-git-3f9040085a0de4976f55bc7e4a2fa5fa8d923100.tar.gz
Merge branch '10.4' into bb-10.4-mdev17096
Diffstat (limited to 'libmysqld')
-rw-r--r--libmysqld/CMakeLists.txt4
-rw-r--r--libmysqld/examples/CMakeLists.txt2
-rw-r--r--libmysqld/lib_sql.cc9
-rw-r--r--libmysqld/libmysql.c7
4 files changed, 9 insertions, 13 deletions
diff --git a/libmysqld/CMakeLists.txt b/libmysqld/CMakeLists.txt
index 5936c4e43e3..782d28afb70 100644
--- a/libmysqld/CMakeLists.txt
+++ b/libmysqld/CMakeLists.txt
@@ -1,4 +1,5 @@
# Copyright (c) 2006, 2011, Oracle and/or its affiliates.
+# Copyright (c) 2009, 2018, MariaDB Corporation
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -118,7 +119,7 @@ SET(SQL_EMBEDDED_SOURCES emb_qcache.cc libmysqld.c lib_sql.cc
../sql/ha_sequence.cc ../sql/ha_sequence.h
../sql/temporary_tables.cc
../sql/session_tracker.cc
- ../sql/proxy_protocol.cc
+ ../sql/proxy_protocol.cc ../sql/backup.cc
../sql/sql_tvc.cc ../sql/sql_tvc.h
../sql/opt_split.cc
../sql/item_vers.cc
@@ -453,4 +454,3 @@ IF(NOT DISABLE_SHARED)
ENDIF()
ENDIF()
ENDIF()
-
diff --git a/libmysqld/examples/CMakeLists.txt b/libmysqld/examples/CMakeLists.txt
index d47638ad2f9..1eb07a2adf8 100644
--- a/libmysqld/examples/CMakeLists.txt
+++ b/libmysqld/examples/CMakeLists.txt
@@ -34,7 +34,7 @@ ENDIF(UNIX)
MYSQL_ADD_EXECUTABLE(mysqltest_embedded ../../client/mysqltest.cc
COMPONENT Test)
-TARGET_LINK_LIBRARIES(mysqltest_embedded mysqlserver pcre pcreposix)
+TARGET_LINK_LIBRARIES(mysqltest_embedded mysqlserver pcreposix pcre)
IF(CMAKE_GENERATOR MATCHES "Xcode")
# It does not seem possible to tell Xcode the resulting target might need
diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc
index 715f1dde5b5..305f6346c9e 100644
--- a/libmysqld/lib_sql.cc
+++ b/libmysqld/lib_sql.cc
@@ -432,11 +432,9 @@ int emb_unbuffered_fetch(MYSQL *mysql, char **row)
static void emb_free_embedded_thd(MYSQL *mysql)
{
THD *thd= (THD*)mysql->thd;
- mysql_mutex_lock(&LOCK_thread_count);
+ server_threads.erase(thd);
thd->clear_data_list();
thd->store_globals();
- thd->unlink();
- mysql_mutex_unlock(&LOCK_thread_count);
delete thd;
my_pthread_setspecific_ptr(THR_THD, 0);
mysql->thd=0;
@@ -711,10 +709,7 @@ void *create_embedded_thd(int client_flag)
thd->first_data= 0;
thd->data_tail= &thd->first_data;
bzero((char*) &thd->net, sizeof(thd->net));
-
- mysql_mutex_lock(&LOCK_thread_count);
- threads.append(thd);
- mysql_mutex_unlock(&LOCK_thread_count);
+ server_threads.insert(thd);
thd->mysys_var= 0;
thd->reset_globals();
return thd;
diff --git a/libmysqld/libmysql.c b/libmysqld/libmysql.c
index b3ef96698ff..cd170b42b42 100644
--- a/libmysqld/libmysql.c
+++ b/libmysqld/libmysql.c
@@ -3215,7 +3215,8 @@ static void fetch_string_with_conversion(MYSQL_BIND *param, char *value, size_t
{
MYSQL_TIME *tm= (MYSQL_TIME *)buffer;
MYSQL_TIME_STATUS status;
- str_to_time(value, length, tm, 0, &status);
+ str_to_datetime_or_date_or_time(value, length, tm, 0, &status,
+ TIME_MAX_HOUR, UINT_MAX32);
err= status.warnings;
*param->error= MY_TEST(err);
break;
@@ -3226,7 +3227,7 @@ static void fetch_string_with_conversion(MYSQL_BIND *param, char *value, size_t
{
MYSQL_TIME *tm= (MYSQL_TIME *)buffer;
MYSQL_TIME_STATUS status;
- (void) str_to_datetime(value, length, tm, 0, &status);
+ (void) str_to_datetime_or_date(value, length, tm, 0, &status);
err= status.warnings;
*param->error= MY_TEST(err) && (param->buffer_type == MYSQL_TYPE_DATE &&
tm->time_type != MYSQL_TIMESTAMP_DATE);
@@ -3350,7 +3351,7 @@ static void fetch_long_with_conversion(MYSQL_BIND *param, MYSQL_FIELD *field,
case MYSQL_TYPE_DATETIME:
{
int error;
- value= number_to_datetime(value, 0, (MYSQL_TIME *) buffer, 0, &error);
+ value= number_to_datetime_or_date(value, 0, (MYSQL_TIME *) buffer, 0, &error);
*param->error= MY_TEST(error);
break;
}