summaryrefslogtreecommitdiff
path: root/mysql-test/suite/sys_vars
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/suite/sys_vars')
-rw-r--r--mysql-test/suite/sys_vars/r/all_vars.result1
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_use_stacktrace_basic.result48
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_use_stacktrace_basic.test56
3 files changed, 104 insertions, 1 deletions
diff --git a/mysql-test/suite/sys_vars/r/all_vars.result b/mysql-test/suite/sys_vars/r/all_vars.result
index 435b8a68ee8..1bd4e394f6a 100644
--- a/mysql-test/suite/sys_vars/r/all_vars.result
+++ b/mysql-test/suite/sys_vars/r/all_vars.result
@@ -10,6 +10,5 @@ there should be *no* long test name listed below:
select distinct variable_name as `there should be *no* variables listed below:` from t2
left join t1 on variable_name=test_name where test_name is null;
there should be *no* variables listed below:
-innodb_use_stacktrace
drop table t1;
drop table t2;
diff --git a/mysql-test/suite/sys_vars/r/innodb_use_stacktrace_basic.result b/mysql-test/suite/sys_vars/r/innodb_use_stacktrace_basic.result
new file mode 100644
index 00000000000..5db1880219d
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/innodb_use_stacktrace_basic.result
@@ -0,0 +1,48 @@
+SELECT COUNT(@@GLOBAL.innodb_use_stacktrace);
+COUNT(@@GLOBAL.innodb_use_stacktrace)
+1
+1 Expected
+SET @@GLOBAL.innodb_use_stacktrace=1;
+ERROR HY000: Variable 'innodb_use_stacktrace' is a read only variable
+Expected error 'Read only variable'
+SELECT COUNT(@@GLOBAL.innodb_use_stacktrace);
+COUNT(@@GLOBAL.innodb_use_stacktrace)
+1
+1 Expected
+SELECT IF(@@GLOBAL.innodb_use_stacktrace, 'ON', 'OFF') = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_use_stacktrace';
+IF(@@GLOBAL.innodb_use_stacktrace, 'ON', 'OFF') = VARIABLE_VALUE
+1
+1 Expected
+SELECT COUNT(@@GLOBAL.innodb_use_stacktrace);
+COUNT(@@GLOBAL.innodb_use_stacktrace)
+1
+1 Expected
+SELECT COUNT(VARIABLE_VALUE)
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_use_stacktrace';
+COUNT(VARIABLE_VALUE)
+1
+1 Expected
+SELECT @@innodb_use_stacktrace = @@GLOBAL.innodb_use_stacktrace;
+@@innodb_use_stacktrace = @@GLOBAL.innodb_use_stacktrace
+1
+1 Expected
+SELECT COUNT(@@innodb_use_stacktrace);
+COUNT(@@innodb_use_stacktrace)
+1
+1 Expected
+SELECT COUNT(@@local.innodb_use_stacktrace);
+ERROR HY000: Variable 'innodb_use_stacktrace' is a GLOBAL variable
+Expected error 'Variable is a GLOBAL variable'
+SELECT COUNT(@@SESSION.innodb_use_stacktrace);
+ERROR HY000: Variable 'innodb_use_stacktrace' is a GLOBAL variable
+Expected error 'Variable is a GLOBAL variable'
+SELECT COUNT(@@GLOBAL.innodb_use_stacktrace);
+COUNT(@@GLOBAL.innodb_use_stacktrace)
+1
+1 Expected
+SELECT innodb_use_stacktrace = @@SESSION.innodb_use_stacktrace;
+ERROR 42S22: Unknown column 'innodb_use_stacktrace' in 'field list'
+Expected error 'Readonly variable'
diff --git a/mysql-test/suite/sys_vars/t/innodb_use_stacktrace_basic.test b/mysql-test/suite/sys_vars/t/innodb_use_stacktrace_basic.test
new file mode 100644
index 00000000000..b7da1dae3d4
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_use_stacktrace_basic.test
@@ -0,0 +1,56 @@
+--source include/have_xtradb.inc
+
+SELECT COUNT(@@GLOBAL.innodb_use_stacktrace);
+--echo 1 Expected
+
+####################################################################
+# Check if Value can set #
+####################################################################
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@GLOBAL.innodb_use_stacktrace=1;
+--echo Expected error 'Read only variable'
+
+SELECT COUNT(@@GLOBAL.innodb_use_stacktrace);
+--echo 1 Expected
+
+#################################################################
+# Check if the value in GLOBAL Table matches value in variable #
+#################################################################
+
+SELECT IF(@@GLOBAL.innodb_use_stacktrace, 'ON', 'OFF') = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_use_stacktrace';
+--echo 1 Expected
+
+SELECT COUNT(@@GLOBAL.innodb_use_stacktrace);
+--echo 1 Expected
+
+SELECT COUNT(VARIABLE_VALUE)
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_use_stacktrace';
+--echo 1 Expected
+
+################################################################################
+# Check if accessing variable with and without GLOBAL point to same variable #
+################################################################################
+SELECT @@innodb_use_stacktrace = @@GLOBAL.innodb_use_stacktrace;
+--echo 1 Expected
+
+SELECT COUNT(@@innodb_use_stacktrace);
+--echo 1 Expected
+
+--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT COUNT(@@local.innodb_use_stacktrace);
+--echo Expected error 'Variable is a GLOBAL variable'
+
+--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT COUNT(@@SESSION.innodb_use_stacktrace);
+--echo Expected error 'Variable is a GLOBAL variable'
+
+SELECT COUNT(@@GLOBAL.innodb_use_stacktrace);
+--echo 1 Expected
+
+--Error ER_BAD_FIELD_ERROR
+SELECT innodb_use_stacktrace = @@SESSION.innodb_use_stacktrace;
+--echo Expected error 'Readonly variable'