[Commits] c841f96: Postmerge fix

Oleksandr Byelkin sanja at mariadb.com
Sat May 28 15:43:52 EEST 2016


revision-id: c841f961e670b490d106d0b29456a6879f9e29e8 (mariadb-10.2.0-52-gc841f96)
parent(s): 913a311ece7ebff8c7dbf45deecbe2fe72ad9a9e
committer: Oleksandr Byelkin
timestamp: 2016-05-28 14:43:52 +0200
message:

Postmerge fix

---
 mysql-test/r/cte_nonrecursive.result | 15 ++++++---------
 mysql-test/r/sp-error.result         |  3 +--
 mysql-test/r/view.result             |  8 ++++----
 mysql-test/t/sp-error.test           |  2 +-
 mysql-test/t/view.test               |  2 +-
 sql/sql_update.cc                    | 18 ++++++++----------
 6 files changed, 21 insertions(+), 27 deletions(-)

diff --git a/mysql-test/r/cte_nonrecursive.result b/mysql-test/r/cte_nonrecursive.result
index c1f2739..dbfcf4e 100644
--- a/mysql-test/r/cte_nonrecursive.result
+++ b/mysql-test/r/cte_nonrecursive.result
@@ -543,9 +543,8 @@ c	a
 explain
 select * from v1;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	PRIMARY	<derived2>	ALL	NULL	NULL	NULL	NULL	32	
-2	DERIVED	t2	ALL	NULL	NULL	NULL	NULL	4	
-2	DERIVED	t1	ALL	NULL	NULL	NULL	NULL	8	Using where; Using join buffer (flat, BNL join)
+1	SIMPLE	t2	ALL	NULL	NULL	NULL	NULL	4	
+1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	8	Using where; Using join buffer (flat, BNL join)
 # with claused in the specification of a materialized view
 create view v2 as 
 with t as (select a, count(*) from t1 where b >= 'c' group by a) 
@@ -560,9 +559,8 @@ c	a	count(*)
 explain
 select * from v2;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	PRIMARY	<derived2>	ALL	NULL	NULL	NULL	NULL	8	
-2	DERIVED	t2	ALL	NULL	NULL	NULL	NULL	4	Using where
-2	DERIVED	<derived3>	ref	key0	key0	5	test.t2.c	2	
+1	PRIMARY	t2	ALL	NULL	NULL	NULL	NULL	4	Using where
+1	PRIMARY	<derived3>	ref	key0	key0	5	test.t2.c	2	
 3	SUBQUERY	t1	ALL	NULL	NULL	NULL	NULL	8	Using where; Using temporary; Using filesort
 # with clause in the specification of a view that whose definition
 # table alias for a with table
@@ -593,9 +591,8 @@ c	d
 explain
 select * from v4;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	PRIMARY	<derived2>	ALL	NULL	NULL	NULL	NULL	64	
-2	DERIVED	t1	ALL	NULL	NULL	NULL	NULL	8	Using where
-2	DERIVED	t1	ALL	NULL	NULL	NULL	NULL	8	Using where; Using join buffer (flat, BNL join)
+1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	8	Using where
+1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	8	Using where; Using join buffer (flat, BNL join)
 drop view v1,v2,v3,v4;
 # currently any views containing with clause are not updatable
 create view v1(a) as 
diff --git a/mysql-test/r/sp-error.result b/mysql-test/r/sp-error.result
index 4ea4e9c..2a719ea 100644
--- a/mysql-test/r/sp-error.result
+++ b/mysql-test/r/sp-error.result
@@ -1235,9 +1235,8 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
 CREATE PROCEDURE bug20953()
 CREATE VIEW v AS SELECT i FROM t1 PROCEDURE ANALYSE();
 ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'PROCEDURE ANALYSE()' at line 2
-ERROR HY000: View's SELECT contains a 'PROCEDURE' clause
 CREATE PROCEDURE bug20953() CREATE VIEW v AS SELECT 1 FROM (SELECT 1) AS d1 into @w;
-ERROR HY000: View's SELECT contains a 'INTO' clause
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'into @w' at line 1
 CREATE PROCEDURE bug20953(i INT) CREATE VIEW v AS SELECT i;
 ERROR HY000: View's SELECT contains a variable or parameter
 CREATE PROCEDURE bug20953()
diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result
index 2ca921c..8e9bad9 100644
--- a/mysql-test/r/view.result
+++ b/mysql-test/r/view.result
@@ -1494,7 +1494,7 @@ a
 create view v2 (a,b) as select t1.b as a, t2.a as b from t1, t2;
 set updatable_views_with_limit=NO;
 update v2 set a= 10 where a=200 limit 1;
-ERROR HY000: The target table t1 of the UPDATE is not updatable
+ERROR HY000: The target table v2 of the UPDATE is not updatable
 set updatable_views_with_limit=DEFAULT;
 select * from v3;
 a	b
@@ -3211,7 +3211,7 @@ DROP TABLE t1;
 DROP VIEW IF EXISTS v1;
 SELECT * FROM (SELECT 1) AS t into @w;
 CREATE VIEW v1 AS SELECT * FROM (SELECT 1) AS t into @w;
-ERROR HY000: View's SELECT contains a 'INTO' clause
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'into @w' at line 1
 # Previously the following would fail.
 SELECT * FROM (SELECT 1) AS t into @w;
 drop view if exists view_24532_a;
@@ -4096,7 +4096,7 @@ ERROR HY000: The target table v1 of the INSERT is not insertable-into
 DELETE from v1;
 ERROR HY000: The target table v1 of the DELETE is not updatable
 UPDATE v3 SET b= 10;
-ERROR HY000: The target table v2 of the UPDATE is not updatable
+ERROR HY000: The target table v3 of the UPDATE is not updatable
 REPLACE v3 SET b= 10;
 ERROR HY000: The target table v3 of the INSERT is not insertable-into
 INSERT into v3(b) values (20);
@@ -6139,7 +6139,7 @@ s1
 insert into v1(s2) values (-300);
 ERROR HY000: The target table v1 of the INSERT is not insertable-into
 update v1 set s2=s2+1;
-ERROR HY000: The target table x of the UPDATE is not updatable
+ERROR HY000: The target table v1 of the UPDATE is not updatable
 drop view v1;
 CREATE VIEW v1 AS SELECT * FROM (SELECT s1 FROM t1 WHERE s1
 < 100) AS x;
diff --git a/mysql-test/t/sp-error.test b/mysql-test/t/sp-error.test
index 7fc8c43..15cd0ec 100644
--- a/mysql-test/t/sp-error.test
+++ b/mysql-test/t/sp-error.test
@@ -1794,7 +1794,7 @@ CREATE PROCEDURE bug20953() CREATE VIEW v AS SELECT 1 INTO OUTFILE "file";
 --error ER_PARSE_ERROR
 CREATE PROCEDURE bug20953()
   CREATE VIEW v AS SELECT i FROM t1 PROCEDURE ANALYSE();
---error ER_VIEW_SELECT_CLAUSE
+--error ER_PARSE_ERROR
 CREATE PROCEDURE bug20953() CREATE VIEW v AS SELECT 1 FROM (SELECT 1) AS d1 into @w;
 --error ER_VIEW_SELECT_VARIABLE
 CREATE PROCEDURE bug20953(i INT) CREATE VIEW v AS SELECT i;
diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test
index ef3fde3..2e413c0 100644
--- a/mysql-test/t/view.test
+++ b/mysql-test/t/view.test
@@ -3177,7 +3177,7 @@ DROP VIEW IF EXISTS v1;
 let $query = SELECT * FROM (SELECT 1) AS t into @w;
 
 eval $query;
---error ER_VIEW_SELECT_CLAUSE
+--error ER_PARSE_ERROR
 eval CREATE VIEW v1 AS $query;
 --echo # Previously the following would fail.
 eval $query;
diff --git a/sql/sql_update.cc b/sql/sql_update.cc
index 6c60350..76454d7 100644
--- a/sql/sql_update.cc
+++ b/sql/sql_update.cc
@@ -1234,10 +1234,8 @@ bool unsafe_key_update(List<TABLE_LIST> leaves, table_map tables_for_update)
           {
             // Partitioned key is updated
             my_error(ER_MULTI_UPDATE_KEY_CONFLICT, MYF(0),
-                     tl->belong_to_view ? tl->belong_to_view->alias
-                                        : tl->alias,
-                     tl2->belong_to_view ? tl2->belong_to_view->alias
-                                         : tl2->alias);
+                     tl->top_table()->alias,
+                     tl2->top_table()->alias);
             return true;
           }
 
@@ -1255,10 +1253,8 @@ bool unsafe_key_update(List<TABLE_LIST> leaves, table_map tables_for_update)
               {
                 // Clustered primary key is updated
                 my_error(ER_MULTI_UPDATE_KEY_CONFLICT, MYF(0),
-                         tl->belong_to_view ? tl->belong_to_view->alias
-                         : tl->alias,
-                         tl2->belong_to_view ? tl2->belong_to_view->alias
-                         : tl2->alias);
+                         tl->top_table()->alias,
+                         tl2->top_table()->alias);
                 return true;
               }
             }
@@ -1459,11 +1455,13 @@ int mysql_multi_update_prepare(THD *thd)
     {
       if (!tl->single_table_updatable() || check_key_in_view(thd, tl))
       {
-        my_error(ER_NON_UPDATABLE_TABLE, MYF(0), tl->alias, "UPDATE");
+        my_error(ER_NON_UPDATABLE_TABLE, MYF(0),
+                 tl->top_table()->alias, "UPDATE");
         DBUG_RETURN(TRUE);
       }
 
-      DBUG_PRINT("info",("setting table `%s` for update", tl->alias));
+      DBUG_PRINT("info",("setting table `%s` for update",
+                         tl->top_table()->alias));
       /*
         If table will be updated we should not downgrade lock for it and
         leave it as is.


More information about the commits mailing list