1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
|
############## mysql-test\t\character_set_server_func.test ###################
# #
# Variable Name: character_set_server #
# Scope: GLOBAL | SESSION #
# Access Type: Dynamic #
# Data Type: string #
# Default Value: utf8 (session), latin1 (global) #
# Range: NA #
# #
# #
# Creation Date: 2008-03-08 #
# Author: Rizwan #
# #
# Description: Test Cases of Dynamic System Variable character_set_server #
# that checks the behavior of this variable #
# #
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
# server-system-variables.html #
# #
###############################################################################
--echo '#--------------------FN_DYNVARS_009_01-------------------------#'
######################################################################
# Check if setting character_set_server is changed in new connection #
######################################################################
#save
SET @global_character_set_server = @@global.character_set_server;
SET @session_character_set_server = @@session.character_set_server;
SET @@global.character_set_server = utf8;
connect (con1,localhost,root,,,,);
connection con1;
SELECT @@global.character_set_server;
SELECT @@session.character_set_server;
disconnect con1;
--echo '#--------------------FN_DYNVARS_009_02-------------------------#'
#############################################################
# Begin the functionality Testing of character_set_server #
#############################################################
connection default;
#The server character set and collation are used as default values if the database
#character set and collation are not specified in CREATE DATABASE statements.
#==============================================================================
--echo '--global character_set_server should not effects current connection--'
#==============================================================================
--source include/default_charset.inc
select @@character_set_database=@@character_set_connection;
SET @@global.character_set_server = utf8;
CREATE DATABASE db1;
USE db1;
SHOW CREATE DATABASE db1;
DROP DATABASE db1;
select @@character_set_database;
#==============================================================================
--echo '---session character_set_server should effects current connection---'
#==============================================================================
SET @@session.character_set_server = utf8;
CREATE DATABASE db1;
USE db1;
SHOW CREATE DATABASE db1;
DROP DATABASE db1;
select @@character_set_database;
#==============================================================================
--echo '----test with new connection----'
#==============================================================================
connect (con1,localhost,root,,,,);
connection con1;
SELECT @@session.character_set_server;
--echo '----------character set not specified---------'
CREATE DATABASE db1;
USE db1;
SHOW CREATE DATABASE db1;
DROP DATABASE db1;
SELECT @@character_set_database;
--echo '----------ascii character set specified----------'
CREATE DATABASE db1 character set ascii;
USE db1;
SHOW CREATE DATABASE db1;
DROP DATABASE db1;
select @@character_set_database;
disconnect con1;
#restore
connection default;
SET @@global.character_set_server = @global_character_set_server;
SET @@session.character_set_server = @session_character_set_server;
############################################################
# End of functionality Testing for character_set_server #
############################################################
|