Below is the list of changes that have just been committed into a local
5.0 repository of alexi. When alexi 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.2150 06/06/05 15:24:20 aivanov@stripped +3 -0
Fixed BUG#19419 - VIEW: View that the column name is different
by master and slave is made.
sql/sql_parse.cc
1.546 06/06/05 15:24:16 aivanov@stripped +1 -1
mysql_execute_command(): In case of SQLCOM_CREATE_VIEW when
writing to binlog use table member 'query' instead of 'source'.
Otherwise if VIEW column names are defined explicitly they
are skipped in binlog and are replaced by names retrived by
the SELECT statement.
mysql-test/t/rpl_view.test
1.4 06/06/05 15:24:16 aivanov@stripped +17 -0
Added test case.
mysql-test/r/rpl_view.result
1.5 06/06/05 15:24:16 aivanov@stripped +13 -2
Fixed test case results.
# 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: aivanov
# Host: mysqld.localdomain
# Root: /home/alexi/bugs/mysql-5.0-19419-1
--- 1.545/sql/sql_parse.cc 2006-05-15 00:51:01 +04:00
+++ 1.546/sql/sql_parse.cc 2006-06-05 15:24:16 +04:00
@@ -4726,7 +4726,7 @@
append_identifier(thd, &buff, first_table->table_name,
first_table->table_name_length);
buff.append(STRING_WITH_LEN(" AS "));
- buff.append(first_table->source.str, first_table->source.length);
+ buff.append(first_table->query.str, first_table->query.length);
Query_log_event qinfo(thd, buff.ptr(), buff.length(), 0, FALSE);
mysql_bin_log.write(&qinfo);
--- 1.4/mysql-test/r/rpl_view.result 2006-05-12 20:58:47 +04:00
+++ 1.5/mysql-test/r/rpl_view.result 2006-06-05 15:24:16 +04:00
@@ -47,10 +47,21 @@
Log_name Pos Event_type Server_id End_log_pos Info
slave-bin.000001 # Query 1 # use `test`; create table t1 (a int)
slave-bin.000001 # Query 1 # use `test`; insert into t1 values (1)
-slave-bin.000001 # Query 1 # use `test`; CREATE ALGORITHM=UNDEFINED
DEFINER=root@localhost SQL SECURITY DEFINER VIEW v1 AS select a from t1
+slave-bin.000001 # Query 1 # use `test`; CREATE ALGORITHM=UNDEFINED
DEFINER=root@localhost SQL SECURITY DEFINER VIEW v1 AS select test.t1.a AS a from test.t1
slave-bin.000001 # Query 1 # use `test`; insert into v1 values (2)
slave-bin.000001 # Query 1 # use `test`; update v1 set a=3 where a=1
slave-bin.000001 # Query 1 # use `test`; delete from v1 where a=2
-slave-bin.000001 # Query 1 # use `test`; ALTER ALGORITHM=UNDEFINED DEFINER=root@localhost
SQL SECURITY DEFINER VIEW v1 AS select a as b from t1
+slave-bin.000001 # Query 1 # use `test`; ALTER ALGORITHM=UNDEFINED DEFINER=root@localhost
SQL SECURITY DEFINER VIEW v1 AS select test.t1.a AS b from test.t1
slave-bin.000001 # Query 1 # use `test`; drop view v1
slave-bin.000001 # Query 1 # use `test`; drop table t1
+create table t1 (a int, b int);
+create view v1 (a, b) as select a, sum(b) from t1 group by a;
+explain v1;
+Field Type Null Key Default Extra
+a int(11) YES NULL
+b decimal(32,0) YES NULL
+show create table v1;
+View Create View
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1`
AS select `t1`.`a` AS `a`,sum(`t1`.`b`) AS `b` from `t1` group by `t1`.`a`
+drop table t1;
+drop view v1;
--- 1.3/mysql-test/t/rpl_view.test 2005-09-15 00:11:56 +04:00
+++ 1.4/mysql-test/t/rpl_view.test 2006-06-05 15:24:16 +04:00
@@ -45,3 +45,20 @@
sync_slave_with_master;
--replace_column 2 # 5 #
show binlog events limit 1,100;
+
+#
+# BUG#19419: "VIEW: View that the column name is different by master and slave is made"
+#
+connection master;
+create table t1 (a int, b int);
+create view v1 (a, b) as select a, sum(b) from t1 group by a;
+
+sync_slave_with_master;
+explain v1;
+show create table v1;
+
+connection master;
+drop table t1;
+drop view v1;
+
+sync_slave_with_master;
| Thread |
|---|
| • bk commit into 5.0 tree (aivanov:1.2150) BUG#19419 | Alex Ivanov Notebook | 5 Jun |