From fed51b80fb434bebfe240b4d11ccffed945b7c7e Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Sat, 17 Feb 2018 19:16:56 +0400 Subject: [PATCH] Adding "const" qualifier to the MYSQL_TIME parameter of Item_temporal_literal constructors --- sql/item.h | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/sql/item.h b/sql/item.h index 951f7a19207..e045a2a30bf 100644 --- a/sql/item.h +++ b/sql/item.h @@ -4163,13 +4163,14 @@ public: Constructor for Item_date_literal. @param ltime DATE value. */ - Item_temporal_literal(THD *thd, MYSQL_TIME *ltime): Item_basic_constant(thd) + Item_temporal_literal(THD *thd, const MYSQL_TIME *ltime) + :Item_basic_constant(thd) { collation.set(&my_charset_numeric, DERIVATION_NUMERIC, MY_REPERTOIRE_ASCII); decimals= 0; cached_time= *ltime; } - Item_temporal_literal(THD *thd, MYSQL_TIME *ltime, uint dec_arg): + Item_temporal_literal(THD *thd, const MYSQL_TIME *ltime, uint dec_arg): Item_basic_constant(thd) { collation.set(&my_charset_numeric, DERIVATION_NUMERIC, MY_REPERTOIRE_ASCII); @@ -4205,7 +4206,7 @@ public: class Item_date_literal: public Item_temporal_literal { public: - Item_date_literal(THD *thd, MYSQL_TIME *ltime) + Item_date_literal(THD *thd, const MYSQL_TIME *ltime) :Item_temporal_literal(thd, ltime) { max_length= MAX_DATE_WIDTH; @@ -4234,7 +4235,7 @@ public: class Item_time_literal: public Item_temporal_literal { public: - Item_time_literal(THD *thd, MYSQL_TIME *ltime, uint dec_arg): + Item_time_literal(THD *thd, const MYSQL_TIME *ltime, uint dec_arg): Item_temporal_literal(thd, ltime, dec_arg) { max_length= MIN_TIME_WIDTH + (decimals ? decimals + 1 : 0); @@ -4255,7 +4256,7 @@ public: class Item_datetime_literal: public Item_temporal_literal { public: - Item_datetime_literal(THD *thd, MYSQL_TIME *ltime, uint dec_arg): + Item_datetime_literal(THD *thd, const MYSQL_TIME *ltime, uint dec_arg): Item_temporal_literal(thd, ltime, dec_arg) { max_length= MAX_DATETIME_WIDTH + (decimals ? decimals + 1 : 0); @@ -4301,7 +4302,7 @@ class Item_date_literal_for_invalid_dates: public Item_date_literal in sql_mode=TRADITIONAL. */ public: - Item_date_literal_for_invalid_dates(THD *thd, MYSQL_TIME *ltime) + Item_date_literal_for_invalid_dates(THD *thd, const MYSQL_TIME *ltime) :Item_date_literal(thd, ltime) { } bool get_date(MYSQL_TIME *ltime, ulonglong fuzzy_date) { @@ -4319,7 +4320,7 @@ class Item_datetime_literal_for_invalid_dates: public Item_datetime_literal { public: Item_datetime_literal_for_invalid_dates(THD *thd, - MYSQL_TIME *ltime, uint dec_arg) + const MYSQL_TIME *ltime, uint dec_arg) :Item_datetime_literal(thd, ltime, dec_arg) { } bool get_date(MYSQL_TIME *ltime, ulonglong fuzzy_date) {