Below is the list of changes that have just been committed into a local
6.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, 2008-04-19 00:55:06+04:00, dlenev@stripped +5 -0
Fix for bug #35517 "Foreign keys: no @@foreign_key_all_engines".
Value specified via --foreign_key_all_engines option was not
available through SHOW VARIABLES statement, I_S.GLOBAL_VARIABLES
and @@foreign_key_all_engines syntax.
Publish this value as global read-only variable.
mysql-test/r/foreign_key.result@stripped, 2008-04-19 00:55:00+04:00, dlenev@stripped +12 -0
Added test for bug #35517 "Foreign keys: no @@foreign_key_all_engines".
mysql-test/r/foreign_key_all_engines.result@stripped, 2008-04-19 00:55:01+04:00, dlenev@stripped +20 -0
Added test for bug #35517 "Foreign keys: no @@foreign_key_all_engines".
mysql-test/t/foreign_key.test@stripped, 2008-04-19 00:55:01+04:00, dlenev@stripped +12 -0
Added test for bug #35517 "Foreign keys: no @@foreign_key_all_engines".
mysql-test/t/foreign_key_all_engines.test@stripped, 2008-04-19 00:55:01+04:00, dlenev@stripped +20 -0
Added test for bug #35517 "Foreign keys: no @@foreign_key_all_engines".
sql/set_var.cc@stripped, 2008-04-19 00:55:01+04:00, dlenev@stripped +3 -0
Published value of internal opt_fk_all_engines variable as global
read-only variable using sys_var_bool_ptr_readonly class.
diff -Nrup a/mysql-test/r/foreign_key.result b/mysql-test/r/foreign_key.result
--- a/mysql-test/r/foreign_key.result 2008-02-22 10:54:05 +03:00
+++ b/mysql-test/r/foreign_key.result 2008-04-19 00:55:00 +04:00
@@ -90,3 +90,15 @@ alter table t1 change column d2 d3 int r
alter table t1 change column e2 e3 int references t2 (a) match full on delete set null;
alter table t1 change column f2 f3 int references t2 (a) references t3 (a);
drop table t1;
+show variables like 'foreign_key_all_engines';
+Variable_name Value
+foreign_key_all_engines OFF
+select * from information_schema.global_variables where variable_name='foreign_key_all_engines';
+VARIABLE_NAME VARIABLE_VALUE
+FOREIGN_KEY_ALL_ENGINES OFF
+select @@foreign_key_all_engines;
+@@foreign_key_all_engines
+0
+select @@global.foreign_key_all_engines;
+@@global.foreign_key_all_engines
+0
diff -Nrup a/mysql-test/r/foreign_key_all_engines.result b/mysql-test/r/foreign_key_all_engines.result
--- a/mysql-test/r/foreign_key_all_engines.result 2008-04-18 15:49:29 +04:00
+++ b/mysql-test/r/foreign_key_all_engines.result 2008-04-19 00:55:01 +04:00
@@ -278,3 +278,23 @@ ERROR 42000: Foreign key error: Constrai
create table t1 (fk1 int, foreign key (fk1) references t2 (a, b));
ERROR 42000: Foreign key error: Constraint 'fk_t1_1_1164': Parent column count (2) not equal to child column count (1)
drop table t2;
+show variables like 'foreign_key_all_engines';
+Variable_name Value
+foreign_key_all_engines ON
+select * from information_schema.global_variables where variable_name='foreign_key_all_engines';
+VARIABLE_NAME VARIABLE_VALUE
+FOREIGN_KEY_ALL_ENGINES ON
+select @@foreign_key_all_engines;
+@@foreign_key_all_engines
+1
+select @@global.foreign_key_all_engines;
+@@global.foreign_key_all_engines
+1
+select @@session.foreign_key_all_engines;
+ERROR HY000: Variable 'foreign_key_all_engines' is a GLOBAL variable
+set foreign_key_all_engines= 0;
+ERROR HY000: Variable 'foreign_key_all_engines' is a read only variable
+set @@foreign_key_all_engines= 0;
+ERROR HY000: Variable 'foreign_key_all_engines' is a read only variable
+set @@session.foreign_key_all_engines= 0;
+ERROR HY000: Variable 'foreign_key_all_engines' is a read only variable
diff -Nrup a/mysql-test/t/foreign_key.test b/mysql-test/t/foreign_key.test
--- a/mysql-test/t/foreign_key.test 2008-02-22 10:54:05 +03:00
+++ b/mysql-test/t/foreign_key.test 2008-04-19 00:55:01 +04:00
@@ -153,3 +153,15 @@ alter table t1 change column e2 e3 int r
alter table t1 change column f2 f3 int references t2 (a) references t3 (a);
drop table t1;
+
+
+#
+# Additional test for bug #35517 "Foreign keys: no @@foreign_key_all_engines"
+# This variable should be available as global read-only variable through
+# SHOW VARIABLES statement, I_S.GLOBAL_VARIABLES and @@foreign_key_all_engines
+# syntax. See foreign_key_all_engines.test for the main test.
+#
+show variables like 'foreign_key_all_engines';
+select * from information_schema.global_variables where variable_name='foreign_key_all_engines';
+select @@foreign_key_all_engines;
+select @@global.foreign_key_all_engines;
diff -Nrup a/mysql-test/t/foreign_key_all_engines.test b/mysql-test/t/foreign_key_all_engines.test
--- a/mysql-test/t/foreign_key_all_engines.test 2008-04-18 15:49:29 +04:00
+++ b/mysql-test/t/foreign_key_all_engines.test 2008-04-19 00:55:01 +04:00
@@ -196,3 +196,23 @@ create table t1 (fk1 int references t2 (
--error ER_FK_PARENT_COLUMN_COUNT
create table t1 (fk1 int, foreign key (fk1) references t2 (a, b));
drop table t2;
+
+
+#
+# Test for bug #35517 "Foreign keys: no @@foreign_key_all_engines"
+# This variable should be available as global read-only variable
+# through SHOW VARIABLES statement, I_S.GLOBAL_VARIABLES and
+# @@foreign_key_all_engines syntax.
+#
+show variables like 'foreign_key_all_engines';
+select * from information_schema.global_variables where variable_name='foreign_key_all_engines';
+select @@foreign_key_all_engines;
+select @@global.foreign_key_all_engines;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.foreign_key_all_engines;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set foreign_key_all_engines= 0;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set @@foreign_key_all_engines= 0;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set @@session.foreign_key_all_engines= 0;
diff -Nrup a/sql/set_var.cc b/sql/set_var.cc
--- a/sql/set_var.cc 2008-03-12 13:54:18 +03:00
+++ b/sql/set_var.cc 2008-04-19 00:55:01 +04:00
@@ -233,6 +233,9 @@ static sys_var_long_ptr sys_expire_logs_
&expire_logs_days);
static sys_var_bool_ptr sys_flush(&vars, "flush", &myisam_flush);
static sys_var_long_ptr sys_flush_time(&vars, "flush_time", &flush_time);
+static sys_var_bool_ptr_readonly sys_fk_all_engines(&vars,
+ "foreign_key_all_engines",
+ &opt_fk_all_engines);
static sys_var_str sys_ft_boolean_syntax(&vars, "ft_boolean_syntax",
sys_check_ftb_syntax,
sys_update_ftb_syntax,