Commit 8b1f145c authored by Sergei Golubchik's avatar Sergei Golubchik

cleanup

Item_func_format::print() was redundant
and other changes
parent 3af191b7
...@@ -7,7 +7,7 @@ IF(GIT_EXECUTABLE AND EXISTS "${CMAKE_SOURCE_DIR}/.git") ...@@ -7,7 +7,7 @@ IF(GIT_EXECUTABLE AND EXISTS "${CMAKE_SOURCE_DIR}/.git")
IF(git_config_get_result EQUAL 128 OR cmake_update_submodules MATCHES no) IF(git_config_get_result EQUAL 128 OR cmake_update_submodules MATCHES no)
SET(update_result 0) SET(update_result 0)
ELSEIF (cmake_update_submodules MATCHES force) ELSEIF (cmake_update_submodules MATCHES force)
MESSAGE("-- Updating submodules (forced)") MESSAGE(STATUS "Updating submodules (forced)")
EXECUTE_PROCESS(COMMAND "${GIT_EXECUTABLE}" submodule update --init --force EXECUTE_PROCESS(COMMAND "${GIT_EXECUTABLE}" submodule update --init --force
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
RESULT_VARIABLE update_result) RESULT_VARIABLE update_result)
...@@ -16,7 +16,7 @@ IF(GIT_EXECUTABLE AND EXISTS "${CMAKE_SOURCE_DIR}/.git") ...@@ -16,7 +16,7 @@ IF(GIT_EXECUTABLE AND EXISTS "${CMAKE_SOURCE_DIR}/.git")
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
RESULT_VARIABLE update_result) RESULT_VARIABLE update_result)
ELSE() ELSE()
MESSAGE("-- Updating submodules") MESSAGE(STATUS "Updating submodules")
EXECUTE_PROCESS(COMMAND "${GIT_EXECUTABLE}" submodule update --init EXECUTE_PROCESS(COMMAND "${GIT_EXECUTABLE}" submodule update --init
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
RESULT_VARIABLE update_result) RESULT_VARIABLE update_result)
......
...@@ -223,5 +223,21 @@ SELECT * FROM non_existent; ...@@ -223,5 +223,21 @@ SELECT * FROM non_existent;
ERROR 42S02: Table 'test.non_existent' doesn't exist ERROR 42S02: Table 'test.non_existent' doesn't exist
SET lc_time_names=@old_50915_lc_time_names; SET lc_time_names=@old_50915_lc_time_names;
# #
# End of 5.6 tests # End of 10.0 tests
#
#
# End of 10.1 tests
#
create view v1 as select
format(123456789,2) as b,
format(123456789,2,'rm_CH') as b1;
select * from v1;
b b1
123,456,789.00 123'456'789,00
show create view v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select format(123456789,2) AS `b`,format(123456789,2,'rm_CH') AS `b1` utf8 utf8_general_ci
drop view v1;
#
# End of 10.2 tests
# #
...@@ -134,7 +134,22 @@ SELECT * FROM non_existent; ...@@ -134,7 +134,22 @@ SELECT * FROM non_existent;
SET lc_time_names=@old_50915_lc_time_names; SET lc_time_names=@old_50915_lc_time_names;
--echo #
--echo # End of 10.0 tests
--echo #
--echo #
--echo # End of 10.1 tests
--echo #
# Item::print
create view v1 as select
format(123456789,2) as b,
format(123456789,2,'rm_CH') as b1;
select * from v1;
show create view v1;
drop view v1;
--echo # --echo #
--echo # End of 5.6 tests --echo # End of 10.2 tests
--echo # --echo #
...@@ -2707,20 +2707,6 @@ String *Item_func_format::val_str_ascii(String *str) ...@@ -2707,20 +2707,6 @@ String *Item_func_format::val_str_ascii(String *str)
} }
void Item_func_format::print(String *str, enum_query_type query_type)
{
str->append(STRING_WITH_LEN("format("));
args[0]->print(str, query_type);
str->append(',');
args[1]->print(str, query_type);
if(arg_count > 2)
{
str->append(',');
args[2]->print(str,query_type);
}
str->append(')');
}
void Item_func_elt::fix_length_and_dec() void Item_func_elt::fix_length_and_dec()
{ {
uint32 char_length= 0; uint32 char_length= 0;
......
...@@ -93,7 +93,7 @@ class Item_str_ascii_func :public Item_str_func ...@@ -93,7 +93,7 @@ class Item_str_ascii_func :public Item_str_func
{ {
return val_str_from_val_str_ascii(str, &ascii_buf); return val_str_from_val_str_ascii(str, &ascii_buf);
} }
virtual String *val_str_ascii(String *)= 0; String *val_str_ascii(String *)= 0;
}; };
...@@ -490,7 +490,7 @@ class Item_func_trim :public Item_str_func ...@@ -490,7 +490,7 @@ class Item_func_trim :public Item_str_func
String *val_str(String *); String *val_str(String *);
void fix_length_and_dec(); void fix_length_and_dec();
const char *func_name() const { return "trim"; } const char *func_name() const { return "trim"; }
virtual void print(String *str, enum_query_type query_type); void print(String *str, enum_query_type query_type);
virtual const char *mode_name() const { return "both"; } virtual const char *mode_name() const { return "both"; }
Item *get_copy(THD *thd, MEM_ROOT *mem_root) Item *get_copy(THD *thd, MEM_ROOT *mem_root)
{ return get_item_copy<Item_func_trim>(thd, mem_root, this); } { return get_item_copy<Item_func_trim>(thd, mem_root, this); }
...@@ -853,7 +853,6 @@ class Item_func_format :public Item_str_ascii_func ...@@ -853,7 +853,6 @@ class Item_func_format :public Item_str_ascii_func
String *val_str_ascii(String *); String *val_str_ascii(String *);
void fix_length_and_dec(); void fix_length_and_dec();
const char *func_name() const { return "format"; } const char *func_name() const { return "format"; }
virtual void print(String *str, enum_query_type query_type);
Item *get_copy(THD *thd, MEM_ROOT *mem_root) Item *get_copy(THD *thd, MEM_ROOT *mem_root)
{ return get_item_copy<Item_func_format>(thd, mem_root, this); } { return get_item_copy<Item_func_format>(thd, mem_root, this); }
}; };
...@@ -914,7 +913,6 @@ class Item_func_binlog_gtid_pos :public Item_str_func ...@@ -914,7 +913,6 @@ class Item_func_binlog_gtid_pos :public Item_str_func
const char *func_name() const { return "binlog_gtid_pos"; } const char *func_name() const { return "binlog_gtid_pos"; }
bool check_vcol_func_processor(void *arg) bool check_vcol_func_processor(void *arg)
{ {
return mark_unsupported_function(func_name(), "()", arg, VCOL_IMPOSSIBLE); return mark_unsupported_function(func_name(), "()", arg, VCOL_IMPOSSIBLE);
} }
Item *get_copy(THD *thd, MEM_ROOT *mem_root) Item *get_copy(THD *thd, MEM_ROOT *mem_root)
...@@ -1070,7 +1068,7 @@ class Item_func_binary :public Item_str_func ...@@ -1070,7 +1068,7 @@ class Item_func_binary :public Item_str_func
collation.set(&my_charset_bin); collation.set(&my_charset_bin);
max_length=args[0]->max_length; max_length=args[0]->max_length;
} }
virtual void print(String *str, enum_query_type query_type); void print(String *str, enum_query_type query_type);
const char *func_name() const { return "cast_as_binary"; } const char *func_name() const { return "cast_as_binary"; }
bool need_parentheses_in_default() { return true; } bool need_parentheses_in_default() { return true; }
Item *get_copy(THD *thd, MEM_ROOT *mem_root) Item *get_copy(THD *thd, MEM_ROOT *mem_root)
...@@ -1214,7 +1212,7 @@ class Item_func_conv_charset :public Item_str_func ...@@ -1214,7 +1212,7 @@ class Item_func_conv_charset :public Item_str_func
} }
void fix_length_and_dec(); void fix_length_and_dec();
const char *func_name() const { return "convert"; } const char *func_name() const { return "convert"; }
virtual void print(String *str, enum_query_type query_type); void print(String *str, enum_query_type query_type);
Item *get_copy(THD *thd, MEM_ROOT *mem_root) Item *get_copy(THD *thd, MEM_ROOT *mem_root)
{ return get_item_copy<Item_func_conv_charset>(thd, mem_root, this); } { return get_item_copy<Item_func_conv_charset>(thd, mem_root, this); }
}; };
...@@ -1230,7 +1228,7 @@ class Item_func_set_collation :public Item_str_func ...@@ -1230,7 +1228,7 @@ class Item_func_set_collation :public Item_str_func
const char *func_name() const { return "collate"; } const char *func_name() const { return "collate"; }
enum precedence precedence() const { return COLLATE_PRECEDENCE; } enum precedence precedence() const { return COLLATE_PRECEDENCE; }
enum Functype functype() const { return COLLATE_FUNC; } enum Functype functype() const { return COLLATE_FUNC; }
virtual void print(String *str, enum_query_type query_type); void print(String *str, enum_query_type query_type);
Item_field *field_for_view_update() Item_field *field_for_view_update()
{ {
/* this function is transparent for view updating */ /* this function is transparent for view updating */
...@@ -1412,8 +1410,8 @@ class Item_func_dyncol_create: public Item_str_func ...@@ -1412,8 +1410,8 @@ class Item_func_dyncol_create: public Item_str_func
void fix_length_and_dec(); void fix_length_and_dec();
const char *func_name() const{ return "column_create"; } const char *func_name() const{ return "column_create"; }
String *val_str(String *); String *val_str(String *);
virtual void print(String *str, enum_query_type query_type); void print(String *str, enum_query_type query_type);
virtual enum Functype functype() const { return DYNCOL_FUNC; } enum Functype functype() const { return DYNCOL_FUNC; }
Item *get_copy(THD *thd, MEM_ROOT *mem_root) Item *get_copy(THD *thd, MEM_ROOT *mem_root)
{ return get_item_copy<Item_func_dyncol_create>(thd, mem_root, this); } { return get_item_copy<Item_func_dyncol_create>(thd, mem_root, this); }
}; };
...@@ -1427,7 +1425,7 @@ class Item_func_dyncol_add: public Item_func_dyncol_create ...@@ -1427,7 +1425,7 @@ class Item_func_dyncol_add: public Item_func_dyncol_create
{} {}
const char *func_name() const{ return "column_add"; } const char *func_name() const{ return "column_add"; }
String *val_str(String *); String *val_str(String *);
virtual void print(String *str, enum_query_type query_type); void print(String *str, enum_query_type query_type);
Item *get_copy(THD *thd, MEM_ROOT *mem_root) Item *get_copy(THD *thd, MEM_ROOT *mem_root)
{ return get_item_copy<Item_func_dyncol_add>(thd, mem_root, this); } { return get_item_copy<Item_func_dyncol_add>(thd, mem_root, this); }
}; };
......
...@@ -199,7 +199,6 @@ class Item_func_monthname :public Item_str_func ...@@ -199,7 +199,6 @@ class Item_func_monthname :public Item_str_func
} }
bool check_vcol_func_processor(void *arg) bool check_vcol_func_processor(void *arg)
{ {
return mark_unsupported_function(func_name(), "()", arg, VCOL_SESSION_FUNC); return mark_unsupported_function(func_name(), "()", arg, VCOL_SESSION_FUNC);
} }
Item *get_copy(THD *thd, MEM_ROOT *mem_root) Item *get_copy(THD *thd, MEM_ROOT *mem_root)
...@@ -693,8 +692,7 @@ class Item_func_curdate :public Item_datefunc ...@@ -693,8 +692,7 @@ class Item_func_curdate :public Item_datefunc
virtual void store_now_in_TIME(THD *thd, MYSQL_TIME *now_time)=0; virtual void store_now_in_TIME(THD *thd, MYSQL_TIME *now_time)=0;
bool check_vcol_func_processor(void *arg) bool check_vcol_func_processor(void *arg)
{ {
return mark_unsupported_function(func_name(), "()", arg, return mark_unsupported_function(func_name(), "()", arg, VCOL_TIME_FUNC);
VCOL_TIME_FUNC);
} }
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment