~ubuntu-branches/ubuntu/trusty/mariadb-5.5/trusty-proposed

« back to all changes in this revision

Viewing changes to mysql-test/suite/sys_vars/t/optimizer_switch_basic.test

  • Committer: Package Import Robot
  • Author(s): Otto Kekäläinen
  • Date: 2013-12-22 10:27:05 UTC
  • Revision ID: package-import@ubuntu.com-20131222102705-mndw7s12mz0szrcn
Tags: upstream-5.5.32
Import upstream version 5.5.32

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
#
 
3
# 2010-01-20 OBN Added check for I_S values after variable value changed
 
4
#
 
5
 
 
6
SET @start_global_value = @@global.optimizer_switch;
 
7
SELECT @start_global_value;
 
8
 
 
9
#
 
10
# exists as global and session
 
11
#
 
12
select @@global.optimizer_switch;
 
13
select @@session.optimizer_switch;
 
14
show global variables like 'optimizer_switch';
 
15
show session variables like 'optimizer_switch';
 
16
select * from information_schema.global_variables where variable_name='optimizer_switch';
 
17
select * from information_schema.session_variables where variable_name='optimizer_switch';
 
18
 
 
19
#
 
20
# show that it's writable
 
21
#
 
22
set global optimizer_switch=10;
 
23
set session optimizer_switch=5;
 
24
select @@global.optimizer_switch;
 
25
select @@session.optimizer_switch;
 
26
set global optimizer_switch="index_merge_sort_union=on";
 
27
set session optimizer_switch="index_merge=off";
 
28
select @@global.optimizer_switch;
 
29
select @@session.optimizer_switch;
 
30
show global variables like 'optimizer_switch';
 
31
show session variables like 'optimizer_switch';
 
32
select * from information_schema.global_variables where variable_name='optimizer_switch';
 
33
select * from information_schema.session_variables where variable_name='optimizer_switch';
 
34
set session optimizer_switch="default";
 
35
select @@session.optimizer_switch;
 
36
 
 
37
set optimizer_switch = replace(@@optimizer_switch, '=off', '=on');
 
38
select @@optimizer_switch;
 
39
 
 
40
#
 
41
# incorrect assignments
 
42
#
 
43
--error ER_WRONG_TYPE_FOR_VAR
 
44
set global optimizer_switch=1.1;
 
45
--error ER_WRONG_TYPE_FOR_VAR
 
46
set global optimizer_switch=1e1;
 
47
--error ER_WRONG_VALUE_FOR_VAR
 
48
set session optimizer_switch="index_merge";
 
49
--error ER_WRONG_VALUE_FOR_VAR
 
50
set session optimizer_switch="foobar";
 
51
 
 
52
SET @@global.optimizer_switch = @start_global_value;
 
53
SELECT @@global.optimizer_switch;