From ba229d799a0d3bd2499629bdd57212bcd7c98a38 Mon Sep 17 00:00:00 2001 From: Sergey Glukhov Date: Tue, 6 Apr 2010 12:26:59 +0500 Subject: Bug#52120 create view cause Assertion failed: 0, file .\item_subselect.cc, line 817 We should disable const subselect item evaluation because subselect transformation does not happen in view_prepare_mode and thus val_...() methods can not be called. mysql-test/r/ctype_ucs.result: test case mysql-test/r/view.result: test case mysql-test/t/ctype_ucs.test: test case mysql-test/t/view.test: test case sql/item.cc: disabled const subselect item evaluation in view prepare mode. sql/item_subselect.cc: added Item_subselect::safe_charset_converter which prevents const item evaluation in view prepare mode. sql/item_subselect.h: added Item_subselect::safe_charset_converter which prevents const item evaluation in view prepare mode. --- mysql-test/r/view.result | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'mysql-test/r/view.result') diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result index fa6f1939592..0aec44b70f1 100644 --- a/mysql-test/r/view.result +++ b/mysql-test/r/view.result @@ -3874,6 +3874,14 @@ CREATE VIEW v1 AS SELECT 1 FROM t1 WHERE ROW(1,1) >= ROW(1, (SELECT 1 FROM t1 WHERE f1 >= ANY ( SELECT '1' ))); DROP VIEW v1; DROP TABLE t1; +# +# Bug#52120 create view cause Assertion failed: 0, file .\item_subselect.cc, line 817 +# +CREATE TABLE t1 (a CHAR(1) CHARSET latin1, b CHAR(1) CHARSET utf8); +CREATE VIEW v1 AS SELECT 1 from t1 +WHERE t1.b <=> (SELECT a FROM t1 WHERE a < SOME(SELECT '1')); +DROP VIEW v1; +DROP TABLE t1; # ----------------------------------------------------------------- # -- End of 5.1 tests. # ----------------------------------------------------------------- -- cgit v1.2.1