Below is the list of changes that have just been committed into a local
5.0 repository of evgen. When evgen does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2006-09-29 01:01:52+04:00, evgen@stripped +4 -0
Merge epotemkin@stripped:/home/bk/mysql-5.0-opt
into moonbone.local:/work/5505-bug-5.0-opt-mysql
MERGE: 1.2271.8.1
mysql-test/r/view.result@stripped, 2006-09-29 01:01:51+04:00, evgen@stripped +0 -0
Manual merge
MERGE: 1.174.2.1
mysql-test/t/view.test@stripped, 2006-09-29 01:01:51+04:00, evgen@stripped +0 -1
Manual merge
MERGE: 1.161.2.1
sql/share/errmsg.txt@stripped, 2006-09-29 01:01:07+04:00, evgen@stripped +0 -0
Auto merged
MERGE: 1.70.1.1
sql/sql_base.cc@stripped, 2006-09-29 01:01:07+04:00, evgen@stripped +0 -0
Auto merged
MERGE: 1.350.1.2
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: evgen
# Host: moonbone.local
# Root: /work/5505-bug-5.0-opt-mysql/RESYNC
--- 1.352/sql/sql_base.cc 2006-09-29 01:01:56 +04:00
+++ 1.353/sql/sql_base.cc 2006-09-29 01:01:56 +04:00
@@ -902,8 +902,11 @@
*/
if (update->view)
{
+ /* Issue the ER_NON_INSERTABLE_TABLE error for an INSERT */
if (update->view == duplicate->view)
- my_error(ER_NON_UPDATABLE_TABLE, MYF(0), update->alias, operation);
+ my_error(!strncmp(operation, "INSERT", 6) ?
+ ER_NON_INSERTABLE_TABLE : ER_NON_UPDATABLE_TABLE, MYF(0),
+ update->alias, operation);
else
my_error(ER_VIEW_PREVENT_UPDATE, MYF(0),
(duplicate->view ? duplicate->alias : update->alias),
--- 1.71/sql/share/errmsg.txt 2006-09-29 01:01:56 +04:00
+++ 1.72/sql/share/errmsg.txt 2006-09-29 01:01:56 +04:00
@@ -5631,3 +5631,6 @@
eng "host name"
ER_WRONG_STRING_LENGTH
eng "String '%-.70s' is too long for %s (should be no longer than %d)"
+ER_NON_INSERTABLE_TABLE
+ eng "The target table %-.100s of the %s is not insertable-into"
+
--- 1.177/mysql-test/r/view.result 2006-09-29 01:01:56 +04:00
+++ 1.178/mysql-test/r/view.result 2006-09-29 01:01:56 +04:00
@@ -472,11 +472,11 @@
create view v4 (x,y,z) as select c+1, b, a from t1;
create algorithm=temptable view v5 (x,y,z) as select c, b, a from t1;
insert into v3 values (-60,4,30);
-ERROR HY000: The target table v3 of the INSERT is not updatable
+ERROR HY000: The target table v3 of the INSERT is not insertable-into
insert into v4 values (-60,4,30);
-ERROR HY000: The target table v4 of the INSERT is not updatable
+ERROR HY000: The target table v4 of the INSERT is not insertable-into
insert into v5 values (-60,4,30);
-ERROR HY000: The target table v5 of the INSERT is not updatable
+ERROR HY000: The target table v5 of the INSERT is not insertable-into
insert into v1 values (-60,4,30);
insert into v1 (z,y,x) values (50,6,-100);
insert into v2 values (5,40);
@@ -499,11 +499,11 @@
create view v4 (x,y,z) as select c+1, b, a from t1;
create algorithm=temptable view v5 (x,y,z) as select c, b, a from t1;
insert into v3 select c, b, a from t2;
-ERROR HY000: The target table v3 of the INSERT is not updatable
+ERROR HY000: The target table v3 of the INSERT is not insertable-into
insert into v4 select c, b, a from t2;
-ERROR HY000: The target table v4 of the INSERT is not updatable
+ERROR HY000: The target table v4 of the INSERT is not insertable-into
insert into v5 select c, b, a from t2;
-ERROR HY000: The target table v5 of the INSERT is not updatable
+ERROR HY000: The target table v5 of the INSERT is not insertable-into
insert into v1 select c, b, a from t2;
insert into v1 (z,y,x) select a+20,b+2,-100 from t2;
insert into v2 select b+1, a+10 from t2;
@@ -1352,14 +1352,14 @@
create table t1 (s1 smallint);
create view v1 as select * from t1 where 20 < (select (s1) from t1);
insert into v1 values (30);
-ERROR HY000: The target table v1 of the INSERT is not updatable
+ERROR HY000: The target table v1 of the INSERT is not insertable-into
create view v2 as select * from t1;
create view v3 as select * from t1 where 20 < (select (s1) from v2);
insert into v3 values (30);
-ERROR HY000: The target table v3 of the INSERT is not updatable
+ERROR HY000: The target table v3 of the INSERT is not insertable-into
create view v4 as select * from v2 where 20 < (select (s1) from t1);
insert into v4 values (30);
-ERROR HY000: The target table v4 of the INSERT is not updatable
+ERROR HY000: The target table v4 of the INSERT is not insertable-into
drop view v4, v3, v2, v1;
drop table t1;
create table t1 (a int);
@@ -2911,7 +2911,7 @@
RETURN 0;
END |
SELECT f2();
-ERROR HY000: The target table v2 of the INSERT is not updatable
+ERROR HY000: The target table v2 of the INSERT is not insertable-into
DROP FUNCTION f1;
DROP FUNCTION f2;
DROP VIEW v1, v2;
@@ -2935,6 +2935,13 @@
2 SUBQUERY t1 ALL NULL NULL NULL NULL 3
DROP VIEW v1;
DROP TABLE t1;
+create table t1 (s1 int);
+create view v1 as select s1 as a, s1 as b from t1;
+insert into v1 values (1,1);
+ERROR HY000: The target table v1 of the INSERT is not insertable-into
+update v1 set a = 5;
+drop view v1;
+drop table t1;
CREATE TABLE t1(pk int PRIMARY KEY);
CREATE TABLE t2(pk int PRIMARY KEY, fk int, ver int, org int);
CREATE ALGORITHM=MERGE VIEW v1 AS
--- 1.164/mysql-test/t/view.test 2006-09-29 01:01:56 +04:00
+++ 1.165/mysql-test/t/view.test 2006-09-29 01:01:56 +04:00
@@ -347,13 +347,13 @@
create view v4 (x,y,z) as select c+1, b, a from t1;
create algorithm=temptable view v5 (x,y,z) as select c, b, a from t1;
# try insert to VIEW with fields duplicate
--- error 1288
+-- error 1470
insert into v3 values (-60,4,30);
# try insert to VIEW with expression in SELECT list
--- error 1288
+-- error 1470
insert into v4 values (-60,4,30);
# try insert to VIEW using temporary table algorithm
--- error 1288
+-- error 1470
insert into v5 values (-60,4,30);
insert into v1 values (-60,4,30);
insert into v1 (z,y,x) values (50,6,-100);
@@ -375,13 +375,13 @@
create view v4 (x,y,z) as select c+1, b, a from t1;
create algorithm=temptable view v5 (x,y,z) as select c, b, a from t1;
# try insert to VIEW with fields duplicate
--- error 1288
+-- error 1470
insert into v3 select c, b, a from t2;
# try insert to VIEW with expression in SELECT list
--- error 1288
+-- error 1470
insert into v4 select c, b, a from t2;
# try insert to VIEW using temporary table algorithm
--- error 1288
+-- error 1470
insert into v5 select c, b, a from t2;
insert into v1 select c, b, a from t2;
insert into v1 (z,y,x) select a+20,b+2,-100 from t2;
@@ -1249,14 +1249,14 @@
#
create table t1 (s1 smallint);
create view v1 as select * from t1 where 20 < (select (s1) from t1);
--- error 1288
+-- error 1470
insert into v1 values (30);
create view v2 as select * from t1;
create view v3 as select * from t1 where 20 < (select (s1) from v2);
--- error 1288
+-- error 1470
insert into v3 values (30);
create view v4 as select * from v2 where 20 < (select (s1) from t1);
--- error 1288
+-- error 1470
insert into v4 values (30);
drop view v4, v3, v2, v1;
drop table t1;
@@ -2825,7 +2825,7 @@
END |
delimiter ;|
---error ER_NON_UPDATABLE_TABLE
+--error ER_NON_INSERTABLE_TABLE
SELECT f2();
DROP FUNCTION f1;
@@ -2850,6 +2850,17 @@
DROP VIEW v1;
DROP TABLE t1;
+
+#
+# Bug #5505: Wrong error message on INSERT into a view
+#
+create table t1 (s1 int);
+create view v1 as select s1 as a, s1 as b from t1;
+--error 1470
+insert into v1 values (1,1);
+update v1 set a = 5;
+drop view v1;
+drop table t1;
#
# Bug #21646: view qith a subquery in ON expression
| Thread |
|---|
| • bk commit into 5.0 tree (evgen:1.2291) | eugene | 28 Sep |