Loading mysql-test/r/sp.result +19 −0 Original line number Diff line number Diff line Loading @@ -5057,4 +5057,23 @@ concat('data was: /', var1, '/') data was: /1/ drop table t3| drop procedure bug15217| drop procedure if exists bug19862| CREATE TABLE t11 (a INT)| CREATE TABLE t12 (a INT)| CREATE FUNCTION bug19862(x INT) RETURNS INT BEGIN INSERT INTO t11 VALUES (x); RETURN x+1; END| INSERT INTO t12 VALUES (1), (2)| SELECT bug19862(a) FROM t12 ORDER BY 1| bug19862(a) 2 3 SELECT * FROM t11| a 1 2 DROP TABLE t11, t12| DROP FUNCTION bug19862| drop table t1,t2; mysql-test/r/udf.result +6 −0 Original line number Diff line number Diff line Loading @@ -93,6 +93,12 @@ NULL 0R FR DROP TABLE bug19904; create table t1(f1 int); insert into t1 values(1),(2); explain select myfunc_int(f1) from t1 order by 1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using temporary; Using filesort drop table t1; End of 5.0 tests. DROP FUNCTION metaphon; DROP FUNCTION myfunc_double; Loading mysql-test/t/sp.test +18 −0 Original line number Diff line number Diff line Loading @@ -5962,6 +5962,24 @@ call bug15217()| drop table t3| drop procedure bug15217| # # BUG#19862: Sort with filesort by function evaluates function twice # --disable_warnings drop procedure if exists bug19862| --enable_warnings CREATE TABLE t11 (a INT)| CREATE TABLE t12 (a INT)| CREATE FUNCTION bug19862(x INT) RETURNS INT BEGIN INSERT INTO t11 VALUES (x); RETURN x+1; END| INSERT INTO t12 VALUES (1), (2)| SELECT bug19862(a) FROM t12 ORDER BY 1| SELECT * FROM t11| DROP TABLE t11, t12| DROP FUNCTION bug19862| # # BUG#NNNN: New bug synopsis # Loading mysql-test/t/udf.test +7 −0 Original line number Diff line number Diff line Loading @@ -109,6 +109,13 @@ SELECT myfunc_double(n) AS f FROM bug19904; SELECT metaphon(v) AS f FROM bug19904; DROP TABLE bug19904; # # Bug#19862: Sort with filesort by function evaluates function twice # create table t1(f1 int); insert into t1 values(1),(2); explain select myfunc_int(f1) from t1 order by 1; drop table t1; --echo End of 5.0 tests. # Loading sql/item.h +1 −0 Original line number Diff line number Diff line Loading @@ -752,6 +752,7 @@ class Item { virtual bool find_item_in_field_list_processor(byte *arg) { return 0; } virtual bool change_context_processor(byte *context) { return 0; } virtual bool reset_query_id_processor(byte *query_id) { return 0; } virtual bool func_type_checker_processor(byte *arg) { return 0; } virtual Item *equal_fields_propagator(byte * arg) { return this; } virtual Item *set_no_const_sub(byte *arg) { return this; } Loading Loading
mysql-test/r/sp.result +19 −0 Original line number Diff line number Diff line Loading @@ -5057,4 +5057,23 @@ concat('data was: /', var1, '/') data was: /1/ drop table t3| drop procedure bug15217| drop procedure if exists bug19862| CREATE TABLE t11 (a INT)| CREATE TABLE t12 (a INT)| CREATE FUNCTION bug19862(x INT) RETURNS INT BEGIN INSERT INTO t11 VALUES (x); RETURN x+1; END| INSERT INTO t12 VALUES (1), (2)| SELECT bug19862(a) FROM t12 ORDER BY 1| bug19862(a) 2 3 SELECT * FROM t11| a 1 2 DROP TABLE t11, t12| DROP FUNCTION bug19862| drop table t1,t2;
mysql-test/r/udf.result +6 −0 Original line number Diff line number Diff line Loading @@ -93,6 +93,12 @@ NULL 0R FR DROP TABLE bug19904; create table t1(f1 int); insert into t1 values(1),(2); explain select myfunc_int(f1) from t1 order by 1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using temporary; Using filesort drop table t1; End of 5.0 tests. DROP FUNCTION metaphon; DROP FUNCTION myfunc_double; Loading
mysql-test/t/sp.test +18 −0 Original line number Diff line number Diff line Loading @@ -5962,6 +5962,24 @@ call bug15217()| drop table t3| drop procedure bug15217| # # BUG#19862: Sort with filesort by function evaluates function twice # --disable_warnings drop procedure if exists bug19862| --enable_warnings CREATE TABLE t11 (a INT)| CREATE TABLE t12 (a INT)| CREATE FUNCTION bug19862(x INT) RETURNS INT BEGIN INSERT INTO t11 VALUES (x); RETURN x+1; END| INSERT INTO t12 VALUES (1), (2)| SELECT bug19862(a) FROM t12 ORDER BY 1| SELECT * FROM t11| DROP TABLE t11, t12| DROP FUNCTION bug19862| # # BUG#NNNN: New bug synopsis # Loading
mysql-test/t/udf.test +7 −0 Original line number Diff line number Diff line Loading @@ -109,6 +109,13 @@ SELECT myfunc_double(n) AS f FROM bug19904; SELECT metaphon(v) AS f FROM bug19904; DROP TABLE bug19904; # # Bug#19862: Sort with filesort by function evaluates function twice # create table t1(f1 int); insert into t1 values(1),(2); explain select myfunc_int(f1) from t1 order by 1; drop table t1; --echo End of 5.0 tests. # Loading
sql/item.h +1 −0 Original line number Diff line number Diff line Loading @@ -752,6 +752,7 @@ class Item { virtual bool find_item_in_field_list_processor(byte *arg) { return 0; } virtual bool change_context_processor(byte *context) { return 0; } virtual bool reset_query_id_processor(byte *query_id) { return 0; } virtual bool func_type_checker_processor(byte *arg) { return 0; } virtual Item *equal_fields_propagator(byte * arg) { return this; } virtual Item *set_no_const_sub(byte *arg) { return this; } Loading