1
############# mysql-test\t\sql_notes_func.test ############################
3
# Variable Name: sql_notes #
5
# Access Type: Dynamic #
7
# Default Value: 1 TRUE #
8
# Values: 1 TRUE, 0 FALSE #
11
# Creation Date: 2008-02-25 #
12
# Author: Sharique Abdullah #
14
# Description: Test Cases of Dynamic System Variable "sql_notes" #
15
# that checks behavior of this variable in the following ways#
16
# * Functionality based on different values #
18
# Reference: http://dev.mysql.com/doc/refman/5.1/en/set-option.html #
20
###########################################################################
22
# Due to suppressed warnings the pc-protocol is disabled
31
SET @default_sql_notes = @@sql_notes;
33
--echo '#--------------------FN_DYNVARS_162_01-------------------------#'
38
SET SESSION sql_notes = ON;
40
--echo creating a temporary table
41
CREATE TEMPORARY TABLE t1(a varchar(20), b varchar(20));
42
--echo conditionally dropping the table twice so that a note generates
44
DROP TABLE IF EXISTS t1;
46
SELECT @@warning_count;
50
#This line generates A Note warning
52
DROP TABLE IF EXISTS t1;
54
SELECT @@warning_count;
57
--echo '#--------------------FN_DYNVARS_162_02-------------------------#'
62
SET SESSION sql_notes = OFF;
64
--echo creating a temporary table
65
CREATE TEMPORARY TABLE t1(a varchar(20), b varchar(20));
66
--echo conditionally dropping the table twice so that a note generates
68
DROP TABLE IF EXISTS t1;
70
SELECT @@warning_count;
74
#This line generates A Note warning
76
DROP TABLE IF EXISTS t1;
78
SELECT @@warning_count;
81
--echo '#------------------FN_DYNVARS_162_03---------------------------#'
83
# Session data integrity check & GLOBAL Value check
86
--echo ** Connecting con_int1 using root **
87
connect (con_int1,localhost,root,,);
89
--echo ** Connection con_int1 **
91
SELECT @@SESSION.sql_notes;
92
--echo 1 / TRUE Expected
94
SET SESSION sql_notes = FALSE;
96
--echo ** Connecting con_int2 using root **
97
connect (con_int2,localhost,root,,);
99
--echo ** Connection con_int2 **
101
SELECT @@SESSION.sql_notes;
102
--echo 1 / TRUE Expected
104
SET SESSION sql_notes = TRUE;
106
--echo ** Connection con_int2 **
108
SELECT @@SESSION.sql_notes;
109
--echo 1 / TRUE Expected
111
--echo ** Connection con_int1 **
113
SELECT @@SESSION.sql_notes;
114
--echo 0 / FALSE Expected
116
--echo ** Connection default **
118
--echo Disconnecting Connections con_int1, con_int2
127
SET SESSION sql_notes = @default_sql_notes;
130
DROP TABLE IF EXISTS t1;