diff --git a/mysql-test/suite/tianmu/r/issue226.result b/mysql-test/suite/tianmu/r/issue226.result new file mode 100644 index 0000000000..f821b98486 --- /dev/null +++ b/mysql-test/suite/tianmu/r/issue226.result @@ -0,0 +1,13 @@ +use test; +CREATE TABLE t1 (f1 VARCHAR(255) CHARACTER SET utf8) ENGINE=TIANMU; +CREATE TABLE t2 AS SELECT LEFT(f1,171) AS f2 FROM t1 UNION SELECT LEFT(f1,171) AS f2 FROM t1; +INSERT INTO t2 VALUES ('a'); +INSERT INTO t2 VALUES ('b'); +INSERT INTO t2 VALUES ('c'); +SELECT * FROM t2; +f2 +a +b +c +DROP TABLE t1; +DROP TABLE t2; diff --git a/mysql-test/suite/tianmu/t/issue226.test b/mysql-test/suite/tianmu/t/issue226.test new file mode 100644 index 0000000000..ab0c0b9174 --- /dev/null +++ b/mysql-test/suite/tianmu/t/issue226.test @@ -0,0 +1,9 @@ +use test; +CREATE TABLE t1 (f1 VARCHAR(255) CHARACTER SET utf8) ENGINE=TIANMU; +CREATE TABLE t2 AS SELECT LEFT(f1,171) AS f2 FROM t1 UNION SELECT LEFT(f1,171) AS f2 FROM t1; +INSERT INTO t2 VALUES ('a'); +INSERT INTO t2 VALUES ('b'); +INSERT INTO t2 VALUES ('c'); +SELECT * FROM t2; +DROP TABLE t1; +DROP TABLE t2; diff --git a/storage/tianmu/core/engine_execute.cpp b/storage/tianmu/core/engine_execute.cpp index 02a41ab0c7..2665831df6 100644 --- a/storage/tianmu/core/engine_execute.cpp +++ b/storage/tianmu/core/engine_execute.cpp @@ -598,7 +598,7 @@ int st_select_lex_unit::optimize_for_tianmu() { if (!join->is_optimized()) { // saved_error = join->prepare(fake_select_lex->table_list.first, 0, 0, - // global_parameters->order_list.elements, + // global_parameters->order_list.elements, // global_parameters->order_list.first, NULL, NULL, fake_select_lex, // this); //STONEDB UPGRADE if(!is_prepared()) {