Below is the list of changes that have just been committed into a local
5.1 repository of tomas. When tomas 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
1.2092 06/02/08 18:08:18 tomas@stripped +5 -0
Bug #17206 Update through VIEW is not working
mysql-test/t/ndb_view.test
1.1 06/02/08 18:08:10 tomas@stripped +29 -0
New BitKeeper file ``mysql-test/t/ndb_view.test''
mysql-test/t/ndb_view.test
1.0 06/02/08 18:08:10 tomas@stripped +0 -0
BitKeeper file /home/tomas/mysql-5.1-new/mysql-test/t/ndb_view.test
mysql-test/r/ndb_view.result
1.1 06/02/08 18:08:09 tomas@stripped +24 -0
New BitKeeper file ``mysql-test/r/ndb_view.result''
sql/sql_view.cc
1.84 06/02/08 18:08:09 tomas@stripped +2 -0
Bug #17206 Update through VIEW is not working
sql/sql_partition.cc
1.31 06/02/08 18:08:09 tomas@stripped +2 -0
Bug #17206 Update through VIEW is not working
sql/sql_base.cc
1.299 06/02/08 18:08:09 tomas@stripped +27 -5
Bug #17206 Update through VIEW is not working
mysql-test/r/ndb_view.result
1.0 06/02/08 18:08:09 tomas@stripped +0 -0
BitKeeper file /home/tomas/mysql-5.1-new/mysql-test/r/ndb_view.result
# 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: tomas
# Host: poseidon.ndb.mysql.com
# Root: /home/tomas/mysql-5.1-new
--- 1.298/sql/sql_base.cc 2006-01-19 03:56:00 +01:00
+++ 1.299/sql/sql_base.cc 2006-02-08 18:08:09 +01:00
@@ -3858,13 +3858,31 @@
register_tree_change, actual_table);
}
+ if (fld)
+ {
#ifndef NO_EMBEDDED_ACCESS_CHECKS
- /* Check if there are sufficient access rights to the found field. */
- if (fld && check_privileges &&
- check_column_grant_in_table_ref(thd, *actual_table, name, length))
- fld= WRONG_GRANT;
+ /* Check if there are sufficient access rights to the found field. */
+ if (check_privileges &&
+ check_column_grant_in_table_ref(thd, *actual_table, name, length))
+ fld= WRONG_GRANT;
+ else
#endif
-
+ if (thd->set_query_id)
+ {
+ Field *field_to_set= NULL;
+ if (fld == view_ref_found)
+ {
+ Item *it= (*ref)->real_item();
+ if (it->type() == Item::FIELD_ITEM)
+ field_to_set= ((Item_field*)it)->field;
+ }
+ else
+ field_to_set= fld;
+ if (field_to_set)
+
field_to_set->table->file->ha_set_bit_in_rw_set(field_to_set->fieldnr,
+
(bool)(thd->set_query_id-1));
+ }
+ }
DBUG_RETURN(fld);
}
@@ -5044,6 +5062,7 @@
DBUG_ENTER("setup_fields");
thd->set_query_id=set_query_id;
+ DBUG_PRINT("info", ("thd->set_query_id: %d", thd->set_query_id));
if (allow_sum_func)
thd->lex->allow_sum_func|= 1 <<
thd->lex->current_select->nest_level;
thd->where= THD::DEFAULT_WHERE;
@@ -5070,6 +5089,7 @@
{
thd->lex->allow_sum_func= save_allow_sum_func;
thd->set_query_id= save_set_query_id;
+ DBUG_PRINT("info", ("thd->set_query_id: %d", thd->set_query_id));
DBUG_RETURN(TRUE); /* purecov: inspected */
}
if (ref)
@@ -5081,6 +5101,7 @@
}
thd->lex->allow_sum_func= save_allow_sum_func;
thd->set_query_id= save_set_query_id;
+ DBUG_PRINT("info", ("thd->set_query_id: %d", thd->set_query_id));
DBUG_RETURN(test(thd->net.report_error));
}
@@ -5527,6 +5548,7 @@
arena= 0; // For easier test
thd->set_query_id=1;
+ DBUG_PRINT("info", ("thd->set_query_id: %d", thd->set_query_id));
select_lex->cond_count= 0;
for (table= tables; table; table= table->next_local)
--- 1.83/sql/sql_view.cc 2005-12-31 05:54:44 +01:00
+++ 1.84/sql/sql_view.cc 2006-02-08 18:08:09 +01:00
@@ -1338,6 +1338,7 @@
*/
bool save_set_query_id= thd->set_query_id;
thd->set_query_id= 0;
+ DBUG_PRINT("info", ("thd->set_query_id: %d", thd->set_query_id));
for (Field_translator *fld= trans; fld < end_of_trans; fld++)
{
if (!fld->item->fixed && fld->item->fix_fields(thd,
&fld->item))
@@ -1347,6 +1348,7 @@
}
}
thd->set_query_id= save_set_query_id;
+ DBUG_PRINT("info", ("thd->set_query_id: %d", thd->set_query_id));
}
/* Loop over all keys to see if a unique-not-null key is used */
for (;key_info != key_info_end ; key_info++)
--- 1.30/sql/sql_partition.cc 2006-02-07 16:31:10 +01:00
+++ 1.31/sql/sql_partition.cc 2006-02-08 18:08:09 +01:00
@@ -1984,6 +1984,7 @@
DBUG_RETURN(FALSE);
}
thd->set_query_id= 0;
+ DBUG_PRINT("info", ("thd->set_query_id: %d", thd->set_query_id));
/*
Set-up the TABLE_LIST object to be a list with a single table
Set the object to zero to create NULL pointers and set alias
@@ -2120,6 +2121,7 @@
result= FALSE;
end:
thd->set_query_id= save_set_query_id;
+ DBUG_PRINT("info", ("thd->set_query_id: %d", thd->set_query_id));
DBUG_RETURN(result);
}
--- New file ---
+++ mysql-test/r/ndb_view.result 06/02/08 18:08:09
DROP TABLE IF EXISTS t1,t2,t3;
DROP VIEW IF EXISTS v1,v2,v3;
create table t1 (a int, b int, c int, d int) engine=ndb;
insert into t1 values (1,2,3,4),(5,6,7,8);
create view v1 as select t1.c as a, t1.a as b, t1.d as c, t1.a+t1.b+t1.c as d from t1;
select * from v1 order by a,b,c;
a b c d
3 1 4 6
7 5 8 18
update v1 set a=a+100 where b=1;
select * from v1 order by a,b,c;
a b c d
7 5 8 18
103 1 4 106
drop view v1;
create view v1 as select t1.c as a from t1;
insert into v1 values (200);
select * from t1 order by a,b,c,d;
a b c d
NULL NULL 200 NULL
1 2 103 4
5 6 7 8
drop view v1;
drop table t1;
--- New file ---
+++ mysql-test/t/ndb_view.test 06/02/08 18:08:10
-- source include/have_ndb.inc
-- source include/not_embedded.inc
--disable_warnings
DROP TABLE IF EXISTS t1,t2,t3;
DROP VIEW IF EXISTS v1,v2,v3;
--enable_warnings
#
# simple operations via view
#
create table t1 (a int, b int, c int, d int) engine=ndb;
insert into t1 values (1,2,3,4),(5,6,7,8);
create view v1 as select t1.c as a, t1.a as b, t1.d as c, t1.a+t1.b+t1.c as d from t1;
select * from v1 order by a,b,c;
update v1 set a=a+100 where b=1;
select * from v1 order by a,b,c;
drop view v1;
create view v1 as select t1.c as a from t1;
insert into v1 values (200);
select * from t1 order by a,b,c,d;
drop view v1;
drop table t1;
| Thread |
|---|
| • bk commit into 5.1 tree (tomas:1.2092) BUG#17206 | tomas | 8 Feb |