mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
bugfix: Item_func_like::print() was losing ESCAPE clause
This commit is contained in:
@ -254,3 +254,11 @@ DROP TABLE t1;
|
|||||||
#
|
#
|
||||||
# End of 10.1 tests
|
# End of 10.1 tests
|
||||||
#
|
#
|
||||||
|
create view v1 as select 'foo!' like 'foo!!', 'foo!' like 'foo!!' escape '!';
|
||||||
|
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 ('foo!' like 'foo!!') AS `'foo!' like 'foo!!'`,('foo!' like 'foo!!' escape '!') AS `'foo!' like 'foo!!' escape '!'` koi8r koi8r_general_ci
|
||||||
|
select * from v1;
|
||||||
|
'foo!' like 'foo!!' 'foo!' like 'foo!!' escape '!'
|
||||||
|
0 1
|
||||||
|
drop view v1;
|
||||||
|
@ -185,3 +185,11 @@ DROP TABLE t1;
|
|||||||
--echo #
|
--echo #
|
||||||
--echo # End of 10.1 tests
|
--echo # End of 10.1 tests
|
||||||
--echo #
|
--echo #
|
||||||
|
|
||||||
|
#
|
||||||
|
# Item_func_line::print()
|
||||||
|
#
|
||||||
|
create view v1 as select 'foo!' like 'foo!!', 'foo!' like 'foo!!' escape '!';
|
||||||
|
show create view v1;
|
||||||
|
select * from v1;
|
||||||
|
drop view v1;
|
||||||
|
@ -5076,6 +5076,22 @@ bool Item_bool_func2::count_sargable_conds(void *arg)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Item_func_like::print(String *str, enum_query_type query_type)
|
||||||
|
{
|
||||||
|
str->append('(');
|
||||||
|
args[0]->print(str, query_type);
|
||||||
|
str->append(' ');
|
||||||
|
str->append(func_name());
|
||||||
|
str->append(' ');
|
||||||
|
args[1]->print(str, query_type);
|
||||||
|
if (escape_used_in_parsing)
|
||||||
|
{
|
||||||
|
str->append(STRING_WITH_LEN(" escape "));
|
||||||
|
escape_item->print(str, query_type);
|
||||||
|
}
|
||||||
|
str->append(')');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
longlong Item_func_like::val_int()
|
longlong Item_func_like::val_int()
|
||||||
{
|
{
|
||||||
|
@ -1868,10 +1868,7 @@ public:
|
|||||||
escape_used_in_parsing(escape_used), use_sampling(0) {}
|
escape_used_in_parsing(escape_used), use_sampling(0) {}
|
||||||
longlong val_int();
|
longlong val_int();
|
||||||
enum Functype functype() const { return LIKE_FUNC; }
|
enum Functype functype() const { return LIKE_FUNC; }
|
||||||
void print(String *str, enum_query_type query_type)
|
void print(String *str, enum_query_type query_type);
|
||||||
{
|
|
||||||
Item_func::print_op(str, query_type);
|
|
||||||
}
|
|
||||||
CHARSET_INFO *compare_collation() const
|
CHARSET_INFO *compare_collation() const
|
||||||
{ return cmp_collation.collation; }
|
{ return cmp_collation.collation; }
|
||||||
cond_result eq_cmp_result() const
|
cond_result eq_cmp_result() const
|
||||||
|
Reference in New Issue
Block a user