Below is the list of changes that have just been committed into a local
5.1 repository of bell. When bell 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.2358 06/04/24 13:32:07 bell@stripped +6 -0
Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-5.0
into sanja.is.com.ua:/home/bell/mysql/bk/work-merge-5.1
sql/share/errmsg.txt
1.94 06/04/24 13:32:03 bell@stripped +2 -2
merge
sql/sql_view.cc
1.88 06/04/24 13:29:05 bell@stripped +0 -0
Auto merged
sql/item_func.cc
1.285 06/04/24 13:29:04 bell@stripped +0 -0
Auto merged
mysql-test/t/view.test
1.144 06/04/24 13:29:04 bell@stripped +0 -0
Auto merged
mysql-test/r/view.result
1.156 06/04/24 13:29:04 bell@stripped +0 -0
Auto merged
configure.in
1.340 06/04/24 13:29:04 bell@stripped +0 -0
Auto merged
# 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: bell
# Host: sanja.is.com.ua
# Root: /home/bell/mysql/bk/work-merge-5.1/RESYNC
--- 1.339/configure.in 2006-04-20 04:05:35 +03:00
+++ 1.340/configure.in 2006-04-24 13:29:04 +03:00
@@ -775,6 +775,9 @@
if test "$TARGET_LINUX" = "true"; then
AC_MSG_CHECKING([for atomic operations])
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+
atom_ops=
AC_TRY_RUN([
#include <asm/atomic.h>
@@ -809,6 +812,8 @@
if test -z "$atom_ops"; then atom_ops="no"; fi
AC_MSG_RESULT($atom_ops)
+
+ AC_LANG_RESTORE
AC_ARG_WITH(pstack,
[ --with-pstack Use the pstack backtrace library],
--- 1.284/sql/item_func.cc 2006-04-23 03:00:03 +03:00
+++ 1.285/sql/item_func.cc 2006-04-24 13:29:04 +03:00
@@ -2489,11 +2489,8 @@
{
DBUG_ASSERT(fixed == 1);
ulonglong value= (ulonglong) args[0]->val_int();
- if (args[0]->null_value)
- {
- null_value=1; /* purecov: inspected */
+ if ((null_value= args[0]->null_value))
return 0; /* purecov: inspected */
- }
return (longlong) my_count_bits(value);
}
--- 1.93/sql/share/errmsg.txt 2006-04-21 15:57:41 +03:00
+++ 1.94/sql/share/errmsg.txt 2006-04-24 13:32:03 +03:00
@@ -5836,3 +5836,5 @@
swe "Felaktigt partitionsnamn"
ER_MAX_PREPARED_STMT_COUNT_REACHED 42000
eng "Can't create more than max_prepared_stmt_count statements (current value: %lu)"
+ER_VIEW_RECURSIVE
+ eng "`%-.64s`.`%-.64s` contain view recursion"
--- 1.155/mysql-test/r/view.result 2006-04-11 00:25:18 +03:00
+++ 1.156/mysql-test/r/view.result 2006-04-24 13:29:04 +03:00
@@ -2600,3 +2600,26 @@
5 2005-01-04
DROP VIEW v1;
DROP TABLE t1;
+create table t1 (a int);
+create view v1 as select * from t1;
+create view v2 as select * from v1;
+drop table t1;
+rename table v2 to t1;
+select * from v1;
+ERROR HY000: `test`.`v1` contain view recursion
+drop view t1, v1;
+create table t1 (a int);
+create function f1() returns int
+begin
+declare mx int;
+select max(a) from t1 into mx;
+return mx;
+end//
+create view v1 as select f1() as a;
+create view v2 as select * from v1;
+drop table t1;
+rename table v2 to t1;
+select * from v1;
+ERROR HY000: Recursive stored functions and triggers are not allowed.
+drop function f1;
+drop view t1, v1;
--- 1.143/mysql-test/t/view.test 2006-04-11 00:25:19 +03:00
+++ 1.144/mysql-test/t/view.test 2006-04-24 13:29:04 +03:00
@@ -2459,3 +2459,34 @@
DROP VIEW v1;
DROP TABLE t1;
+
+#
+# BUG#14308: Recursive view definitions
+#
+# using view only
+create table t1 (a int);
+create view v1 as select * from t1;
+create view v2 as select * from v1;
+drop table t1;
+rename table v2 to t1;
+-- error ER_VIEW_RECURSIVE
+select * from v1;
+drop view t1, v1;
+# using SP function
+create table t1 (a int);
+delimiter //;
+create function f1() returns int
+begin
+ declare mx int;
+ select max(a) from t1 into mx;
+ return mx;
+end//
+delimiter ;//
+create view v1 as select f1() as a;
+create view v2 as select * from v1;
+drop table t1;
+rename table v2 to t1;
+-- error ER_SP_NO_RECURSION
+select * from v1;
+drop function f1;
+drop view t1, v1;
--- 1.87/sql/sql_view.cc 2006-03-30 18:07:58 +03:00
+++ 1.88/sql/sql_view.cc 2006-04-24 13:29:05 +03:00
@@ -773,6 +773,7 @@
SELECT_LEX *end, *view_select;
LEX *old_lex, *lex;
Query_arena *arena, backup;
+ TABLE_LIST *top_view= table->top_table();
int res;
bool result;
DBUG_ENTER("mysql_make_view");
@@ -800,6 +801,24 @@
DBUG_RETURN(0);
}
+ /* check loop via view definition */
+ for (TABLE_LIST *precedent= table->referencing_view;
+ precedent;
+ precedent= precedent->referencing_view)
+ {
+ if (precedent->view_name.length == table->table_name_length &&
+ precedent->view_db.length == table->db_length &&
+ my_strcasecmp(system_charset_info,
+ precedent->view_name.str, table->table_name) == 0 &&
+ my_strcasecmp(system_charset_info,
+ precedent->view_db.str, table->db) == 0)
+ {
+ my_error(ER_VIEW_RECURSIVE, MYF(0),
+ top_view->view_db.str, top_view->view_name.str);
+ DBUG_RETURN(TRUE);
+ }
+ }
+
/*
For now we assume that tables will not be changed during PS life (it
will be TRUE as far as we make new table cache).
@@ -898,7 +917,6 @@
}
if (!res && !thd->is_fatal_error)
{
- TABLE_LIST *top_view= table->top_table();
TABLE_LIST *view_tables= lex->query_tables;
TABLE_LIST *view_tables_tail= 0;
TABLE_LIST *tbl;
| Thread |
|---|
| • bk commit into 5.1 tree (bell:1.2358) | sanja | 24 Apr |