From 2966c1e422866f48b68e109ac9e27d52be77fb60 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Sat, 11 Aug 2018 06:24:36 +0400 Subject: [PATCH] Fixing size_t to uint conversion failure on Windows Since MDEV-15091, the "lengh" parameter to str_to_time() and str_to_datetime() is of type size_t rather than uint. Fixing Time(), Temporal_with_date() and Datetime() constructors accordingly. --- sql/sql_type.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sql/sql_type.h b/sql/sql_type.h index b81692d72fd..3465708f768 100644 --- a/sql/sql_type.h +++ b/sql/sql_type.h @@ -700,7 +700,7 @@ public: make_from_item(&warn, item, opt); } Time(int *warn, const MYSQL_TIME *from, long curdays); - Time(int *warn, const char *str, uint len, CHARSET_INFO *cs, + Time(int *warn, const char *str, size_t len, CHARSET_INFO *cs, const Options opt) { MYSQL_TIME_STATUS status; @@ -856,7 +856,7 @@ protected: if (nr.to_datetime(this, flags, warn)) time_type= MYSQL_TIMESTAMP_NONE; } - Temporal_with_date(int *warn, const char *str, uint len, CHARSET_INFO *cs, + Temporal_with_date(int *warn, const char *str, size_t len, CHARSET_INFO *cs, sql_mode_t flags) { DBUG_ASSERT((flags & TIME_TIME_ONLY) == 0); @@ -1022,7 +1022,7 @@ public: { set_zero_time(this, MYSQL_TIMESTAMP_DATETIME); } - Datetime(int *warn, const char *str, uint len, CHARSET_INFO *cs, + Datetime(int *warn, const char *str, size_t len, CHARSET_INFO *cs, sql_mode_t flags) :Temporal_with_date(warn, str, len, cs, flags) {