3
################## mysql-test\t\have_partitioning_basic.test ##################
5
# Variable Name: have_partitioning #
7
# Access Type: Static #
11
# Creation Date: 2008-02-07 #
12
# Author : Sharique Abdullah #
15
# Description:Test Cases of Dynamic System Variable have_partitioning #
16
# that checks the behavior of this variable in the following ways #
20
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
21
# server-system-variables.html #
23
###############################################################################
25
--echo '#---------------------BS_STVARS_014_01----------------------#'
26
####################################################################
27
# Displaying default value #
28
####################################################################
29
SELECT COUNT(@@GLOBAL.have_partitioning);
33
--echo '#---------------------BS_STVARS_014_02----------------------#'
34
####################################################################
35
# Check if Value can set #
36
####################################################################
38
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
39
SET @@GLOBAL.have_partitioning=1;
40
--echo Expected error 'Read only variable'
42
SELECT COUNT(@@GLOBAL.have_partitioning);
48
--echo '#---------------------BS_STVARS_014_03----------------------#'
49
#################################################################
50
# Check if the value in GLOBAL Table matches value in variable #
51
#################################################################
53
SELECT @@GLOBAL.have_partitioning = VARIABLE_VALUE
54
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
55
WHERE VARIABLE_NAME='have_partitioning';
58
SELECT COUNT(@@GLOBAL.have_partitioning);
61
SELECT COUNT(VARIABLE_VALUE)
62
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
63
WHERE VARIABLE_NAME='have_partitioning';
68
--echo '#---------------------BS_STVARS_014_04----------------------#'
69
################################################################################
70
# Check if accessing variable with and without GLOBAL point to same variable #
71
################################################################################
72
SELECT @@have_partitioning = @@GLOBAL.have_partitioning;
77
--echo '#---------------------BS_STVARS_014_05----------------------#'
78
################################################################################
79
# Check if have_partitioning can be accessed with and without @@ sign #
80
################################################################################
82
SELECT COUNT(@@have_partitioning);
85
--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
86
SELECT COUNT(@@local.have_partitioning);
87
--echo Expected error 'Variable is a GLOBAL variable'
89
--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
90
SELECT COUNT(@@SESSION.have_partitioning);
91
--echo Expected error 'Variable is a GLOBAL variable'
93
SELECT COUNT(@@GLOBAL.have_partitioning);
96
--Error ER_BAD_FIELD_ERROR
97
SELECT have_partitioning = @@SESSION.have_partitioning;
98
--echo Expected error 'Readonly variable'