Below is the list of changes that have just been committed into a local
5.1 repository of dlenev. When dlenev 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, 2007-01-24 19:26:06+03:00, dlenev@stripped +3 -0
Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into mockturtle.local:/home/dlenev/src/mysql-5.1-merge
MERGE: 1.2390.7.10
mysql-test/t/disabled.def@stripped, 2007-01-24 19:26:02+03:00, dlenev@stripped +0 -0
Auto merged
MERGE: 1.224.2.2
mysql-test/t/ps.test@stripped, 2007-01-24 19:26:02+03:00, dlenev@stripped +0 -0
Auto merged
MERGE: 1.100.1.1
sql/sql_view.cc@stripped, 2007-01-24 19:26:02+03:00, dlenev@stripped +0 -0
Auto merged
MERGE: 1.116.1.3
# 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: dlenev
# Host: mockturtle.local
# Root: /home/dlenev/src/mysql-5.1-merge/RESYNC
--- 1.118/sql/sql_view.cc 2007-01-24 19:26:12 +03:00
+++ 1.119/sql/sql_view.cc 2007-01-24 19:26:12 +03:00
@@ -1144,13 +1144,17 @@ bool mysql_make_view(THD *thd, File_pars
/*
Prepare a security context to check underlying objects of the view
*/
- Security_context *save_security_ctx= thd->security_ctx;
if (!(table->view_sctx= (Security_context *)
thd->stmt_arena->alloc(sizeof(Security_context))))
goto err;
/* Assign the context to the tables referenced in the view */
- for (tbl= view_tables; tbl; tbl= tbl->next_global)
- tbl->security_ctx= table->view_sctx;
+ if (view_tables)
+ {
+ DBUG_ASSERT(view_tables_tail);
+ for (tbl= view_tables; tbl != view_tables_tail->next_global;
+ tbl= tbl->next_global)
+ tbl->security_ctx= table->view_sctx;
+ }
/* assign security context to SELECT name resolution contexts of view */
for(SELECT_LEX *sl= lex->all_selects_list;
sl;
--- 1.227/mysql-test/t/disabled.def 2007-01-24 19:26:12 +03:00
+++ 1.228/mysql-test/t/disabled.def 2007-01-24 19:26:12 +03:00
@@ -11,7 +11,7 @@
##############################################################################
user_limits : Bug#23921 random failure of user_limits.test
-im_daemon_life_cycle : Bug#24415 see note: [19 Dec 23:17] Trudy Pelzer
+# im_daemon_life_cycle : Bug#24415 see note: [19 Dec 23:17] Trudy Pelzer
im_options : Bug#20294 2006-07-24 stewart Instance manager test im_options fails randomly
concurrent_innodb : BUG#21579 2006-08-11 mleich innodb_concurrent random failures with varying differences
ndb_autodiscover : BUG#18952 2006-02-16 jmiller Needs to be fixed w.r.t binlog
--- 1.103/mysql-test/t/ps.test 2007-01-24 19:26:12 +03:00
+++ 1.104/mysql-test/t/ps.test 2007-01-24 19:26:12 +03:00
@@ -1574,6 +1574,7 @@ execute sq;
deallocate prepare no_index;
deallocate prepare sq;
+
#
# Bug 25027: query with a single-row non-correlated subquery
# and IS NULL predicate
@@ -1596,6 +1597,36 @@ EXECUTE stmt USING @arg;
DEALLOCATE PREPARE stmt;
DROP TABLE t1,t2;
+
+
+#
+# BUG#24491 "using alias from source table in insert ... on duplicate key"
+#
+--disable_warnings
+drop tables if exists t1;
+--enable_warnings
+create table t1 (id int primary key auto_increment, value varchar(10));
+insert into t1 (id, value) values (1, 'FIRST'), (2, 'SECOND'), (3, 'THIRD');
+# Let us prepare INSERT ... SELECT ... ON DUPLICATE KEY UPDATE statement
+# which in its ON DUPLICATE KEY clause erroneously tries to assign value
+# to a column which is mentioned only in SELECT part.
+prepare stmt from "insert into t1 (id, value) select * from (select 4 as i, 'FOURTH' as v) as y on duplicate key update v = 'DUP'";
+# Both first and second attempts to execute it should fail
+--error ER_BAD_FIELD_ERROR
+execute stmt;
+--error ER_BAD_FIELD_ERROR
+execute stmt;
+deallocate prepare stmt;
+# And now the same test for more complex case which is more close
+# to the one that was reported originally.
+prepare stmt from "insert into t1 (id, value) select * from (select 4 as id, 'FOURTH' as value) as y on duplicate key update y.value = 'DUP'";
+--error ER_BAD_FIELD_ERROR
+execute stmt;
+--error ER_BAD_FIELD_ERROR
+execute stmt;
+deallocate prepare stmt;
+drop tables t1;
+
--echo End of 5.0 tests.
| Thread |
|---|
| • bk commit into 5.1 tree (dlenev:1.2404) | dlenev | 24 Jan |