Loading mysql-test/r/func_str.result +5 −5 Original line number Diff line number Diff line Loading @@ -1059,27 +1059,27 @@ EXPLAIN EXTENDED SELECT s FROM t1 WHERE TRIM(s) > 'ab'; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where Warnings: Note 1003 select test.t1.s AS `s` from test.t1 where (trim(test.t1.s) > _latin1'ab') Note 1003 select `test`.`t1`.`s` AS `s` from `test`.`t1` where (trim(`test`.`t1`.`s`) > _latin1'ab') EXPLAIN EXTENDED SELECT s FROM t1 WHERE TRIM('y' FROM s) > 'ab'; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where Warnings: Note 1003 select test.t1.s AS `s` from test.t1 where (trim(both _latin1'y' from test.t1.s) > _latin1'ab') Note 1003 select `test`.`t1`.`s` AS `s` from `test`.`t1` where (trim(both _latin1'y' from `test`.`t1`.`s`) > _latin1'ab') EXPLAIN EXTENDED SELECT s FROM t1 WHERE TRIM(LEADING 'y' FROM s) > 'ab'; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where Warnings: Note 1003 select test.t1.s AS `s` from test.t1 where (trim(leading _latin1'y' from test.t1.s) > _latin1'ab') Note 1003 select `test`.`t1`.`s` AS `s` from `test`.`t1` where (trim(leading _latin1'y' from `test`.`t1`.`s`) > _latin1'ab') EXPLAIN EXTENDED SELECT s FROM t1 WHERE TRIM(TRAILING 'y' FROM s) > 'ab'; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where Warnings: Note 1003 select test.t1.s AS `s` from test.t1 where (trim(trailing _latin1'y' from test.t1.s) > _latin1'ab') Note 1003 select `test`.`t1`.`s` AS `s` from `test`.`t1` where (trim(trailing _latin1'y' from `test`.`t1`.`s`) > _latin1'ab') EXPLAIN EXTENDED SELECT s FROM t1 WHERE TRIM(BOTH 'y' FROM s) > 'ab'; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where Warnings: Note 1003 select test.t1.s AS `s` from test.t1 where (trim(both _latin1'y' from test.t1.s) > _latin1'ab') Note 1003 select `test`.`t1`.`s` AS `s` from `test`.`t1` where (trim(both _latin1'y' from `test`.`t1`.`s`) > _latin1'ab') DROP TABLE t1; End of 4.1 tests create table t1 (d decimal default null); Loading mysql-test/r/view.result +33 −0 Original line number Diff line number Diff line Loading @@ -2774,3 +2774,36 @@ Field Type Null Key Default Extra COALESCE(i,j) int(11) YES NULL DROP VIEW v1; DROP TABLE t1,t2; CREATE TABLE t1 (s varchar(10)); INSERT INTO t1 VALUES ('yadda'), ('yady'); SELECT TRIM(BOTH 'y' FROM s) FROM t1; TRIM(BOTH 'y' FROM s) adda ad CREATE VIEW v1 AS SELECT TRIM(BOTH 'y' FROM s) FROM t1; SELECT * FROM v1; TRIM(BOTH 'y' FROM s) adda ad DROP VIEW v1; SELECT TRIM(LEADING 'y' FROM s) FROM t1; TRIM(LEADING 'y' FROM s) adda ady CREATE VIEW v1 AS SELECT TRIM(LEADING 'y' FROM s) FROM t1; SELECT * FROM v1; TRIM(LEADING 'y' FROM s) adda ady DROP VIEW v1; SELECT TRIM(TRAILING 'y' FROM s) FROM t1; TRIM(TRAILING 'y' FROM s) yadda yad CREATE VIEW v1 AS SELECT TRIM(TRAILING 'y' FROM s) FROM t1; SELECT * FROM v1; TRIM(TRAILING 'y' FROM s) yadda yad DROP VIEW v1; DROP TABLE t1; mysql-test/t/view.test +24 −0 Original line number Diff line number Diff line Loading @@ -2643,3 +2643,27 @@ DESCRIBE t2; DROP VIEW v1; DROP TABLE t1,t2; # # Bug #17526: views with TRIM functions # CREATE TABLE t1 (s varchar(10)); INSERT INTO t1 VALUES ('yadda'), ('yady'); SELECT TRIM(BOTH 'y' FROM s) FROM t1; CREATE VIEW v1 AS SELECT TRIM(BOTH 'y' FROM s) FROM t1; SELECT * FROM v1; DROP VIEW v1; SELECT TRIM(LEADING 'y' FROM s) FROM t1; CREATE VIEW v1 AS SELECT TRIM(LEADING 'y' FROM s) FROM t1; SELECT * FROM v1; DROP VIEW v1; SELECT TRIM(TRAILING 'y' FROM s) FROM t1; CREATE VIEW v1 AS SELECT TRIM(TRAILING 'y' FROM s) FROM t1; SELECT * FROM v1; DROP VIEW v1; DROP TABLE t1; sql/item_strfunc.cc +1 −1 Original line number Diff line number Diff line Loading @@ -1515,7 +1515,7 @@ void Item_func_trim::print(String *str) str->append(mode_name()); str->append(' '); args[1]->print(str); str->append(" from ",6); str->append(STRING_WITH_LEN(" from ")); args[0]->print(str); str->append(')'); } Loading Loading
mysql-test/r/func_str.result +5 −5 Original line number Diff line number Diff line Loading @@ -1059,27 +1059,27 @@ EXPLAIN EXTENDED SELECT s FROM t1 WHERE TRIM(s) > 'ab'; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where Warnings: Note 1003 select test.t1.s AS `s` from test.t1 where (trim(test.t1.s) > _latin1'ab') Note 1003 select `test`.`t1`.`s` AS `s` from `test`.`t1` where (trim(`test`.`t1`.`s`) > _latin1'ab') EXPLAIN EXTENDED SELECT s FROM t1 WHERE TRIM('y' FROM s) > 'ab'; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where Warnings: Note 1003 select test.t1.s AS `s` from test.t1 where (trim(both _latin1'y' from test.t1.s) > _latin1'ab') Note 1003 select `test`.`t1`.`s` AS `s` from `test`.`t1` where (trim(both _latin1'y' from `test`.`t1`.`s`) > _latin1'ab') EXPLAIN EXTENDED SELECT s FROM t1 WHERE TRIM(LEADING 'y' FROM s) > 'ab'; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where Warnings: Note 1003 select test.t1.s AS `s` from test.t1 where (trim(leading _latin1'y' from test.t1.s) > _latin1'ab') Note 1003 select `test`.`t1`.`s` AS `s` from `test`.`t1` where (trim(leading _latin1'y' from `test`.`t1`.`s`) > _latin1'ab') EXPLAIN EXTENDED SELECT s FROM t1 WHERE TRIM(TRAILING 'y' FROM s) > 'ab'; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where Warnings: Note 1003 select test.t1.s AS `s` from test.t1 where (trim(trailing _latin1'y' from test.t1.s) > _latin1'ab') Note 1003 select `test`.`t1`.`s` AS `s` from `test`.`t1` where (trim(trailing _latin1'y' from `test`.`t1`.`s`) > _latin1'ab') EXPLAIN EXTENDED SELECT s FROM t1 WHERE TRIM(BOTH 'y' FROM s) > 'ab'; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where Warnings: Note 1003 select test.t1.s AS `s` from test.t1 where (trim(both _latin1'y' from test.t1.s) > _latin1'ab') Note 1003 select `test`.`t1`.`s` AS `s` from `test`.`t1` where (trim(both _latin1'y' from `test`.`t1`.`s`) > _latin1'ab') DROP TABLE t1; End of 4.1 tests create table t1 (d decimal default null); Loading
mysql-test/r/view.result +33 −0 Original line number Diff line number Diff line Loading @@ -2774,3 +2774,36 @@ Field Type Null Key Default Extra COALESCE(i,j) int(11) YES NULL DROP VIEW v1; DROP TABLE t1,t2; CREATE TABLE t1 (s varchar(10)); INSERT INTO t1 VALUES ('yadda'), ('yady'); SELECT TRIM(BOTH 'y' FROM s) FROM t1; TRIM(BOTH 'y' FROM s) adda ad CREATE VIEW v1 AS SELECT TRIM(BOTH 'y' FROM s) FROM t1; SELECT * FROM v1; TRIM(BOTH 'y' FROM s) adda ad DROP VIEW v1; SELECT TRIM(LEADING 'y' FROM s) FROM t1; TRIM(LEADING 'y' FROM s) adda ady CREATE VIEW v1 AS SELECT TRIM(LEADING 'y' FROM s) FROM t1; SELECT * FROM v1; TRIM(LEADING 'y' FROM s) adda ady DROP VIEW v1; SELECT TRIM(TRAILING 'y' FROM s) FROM t1; TRIM(TRAILING 'y' FROM s) yadda yad CREATE VIEW v1 AS SELECT TRIM(TRAILING 'y' FROM s) FROM t1; SELECT * FROM v1; TRIM(TRAILING 'y' FROM s) yadda yad DROP VIEW v1; DROP TABLE t1;
mysql-test/t/view.test +24 −0 Original line number Diff line number Diff line Loading @@ -2643,3 +2643,27 @@ DESCRIBE t2; DROP VIEW v1; DROP TABLE t1,t2; # # Bug #17526: views with TRIM functions # CREATE TABLE t1 (s varchar(10)); INSERT INTO t1 VALUES ('yadda'), ('yady'); SELECT TRIM(BOTH 'y' FROM s) FROM t1; CREATE VIEW v1 AS SELECT TRIM(BOTH 'y' FROM s) FROM t1; SELECT * FROM v1; DROP VIEW v1; SELECT TRIM(LEADING 'y' FROM s) FROM t1; CREATE VIEW v1 AS SELECT TRIM(LEADING 'y' FROM s) FROM t1; SELECT * FROM v1; DROP VIEW v1; SELECT TRIM(TRAILING 'y' FROM s) FROM t1; CREATE VIEW v1 AS SELECT TRIM(TRAILING 'y' FROM s) FROM t1; SELECT * FROM v1; DROP VIEW v1; DROP TABLE t1;
sql/item_strfunc.cc +1 −1 Original line number Diff line number Diff line Loading @@ -1515,7 +1515,7 @@ void Item_func_trim::print(String *str) str->append(mode_name()); str->append(' '); args[1]->print(str); str->append(" from ",6); str->append(STRING_WITH_LEN(" from ")); args[0]->print(str); str->append(')'); } Loading