~jlukas79/+junk/mysql-server

« back to all changes in this revision

Viewing changes to mysql-test/t/myisam_data_pointer_size_func.test

manual merge 6.0-main --> 6.0-bka-review

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
############## mysql-test\t\myisam_data_pointer_size_func.test  ################
 
2
#                                                                              #
 
3
# Variable Name: myisam_data_pointer_size                                      #
 
4
# Scope: GLOBAL & SESSION                                                      #
 
5
# Access Type: Dynamic                                                         #
 
6
# Data Type: Numeric                                                           #
 
7
# Default Value: 1                                                             #
 
8
# Range: 1 - 65536                                                             #
 
9
#                                                                              #
 
10
#                                                                              #
 
11
# Creation Date: 2008-03-08                                                    #
 
12
# Author:  Rizwan Maredia                                                      #
 
13
#                                                                              #
 
14
# Description: Test Cases of Dynamic System Variable myisam_data_pointer_size  #
 
15
#              that checks the behavior of this variable                       #
 
16
#                                                                              #
 
17
# Reference: http://dev.mysql.com/doc/refman/5.1/en/                           #
 
18
#  server-system-variables.html                                                #
 
19
#                                                                              #
 
20
################################################################################
 
21
 
 
22
--echo '#--------------------FN_DYNVARS_093_01-------------------------#'
 
23
###############################################################################
 
24
# Check if setting myisam_data_pointer_size is changed in every new connection# 
 
25
###############################################################################
 
26
 
 
27
SET @@global.myisam_data_pointer_size = 2;
 
28
# con1 will be default connection from now on
 
29
--echo 'connect (con1,localhost,root,,,,)'
 
30
connect (con1,localhost,root,,,,);
 
31
--echo 'connection con1'
 
32
connection con1;
 
33
SELECT @@global.myisam_data_pointer_size;
 
34
SET @@global.myisam_data_pointer_size = 3;
 
35
--echo 'connect (con2,localhost,root,,,,)'
 
36
connect (con2,localhost,root,,,,);
 
37
--echo 'connection con2'
 
38
connection con2;
 
39
SELECT @@global.myisam_data_pointer_size;
 
40
disconnect con2;
 
41
 
 
42
 
 
43
--echo '#--------------------FN_DYNVARS_093_02-------------------------#'
 
44
#################################################################
 
45
# Begin the functionality Testing of myisam_data_pointer_size   #
 
46
#################################################################
 
47
 
 
48
--echo 'connection con1'
 
49
connection con1;
 
50
 
 
51
 
 
52
#===========================================================
 
53
# Checking myisam_data_pointer_size is 2
 
54
#===========================================================
 
55
 
 
56
# create sp to add 'count' records
 
57
--disable_warnings
 
58
DROP PROCEDURE IF EXISTS sp_addRec;
 
59
DROP TABLE IF EXISTS t1;
 
60
--enable_warnings
 
61
 
 
62
 
 
63
 
 
64
DELIMITER //;
 
65
 
 
66
CREATE PROCEDURE sp_addRec(IN count INT)
 
67
BEGIN
 
68
   WHILE (count>0) DO
 
69
      INSERT INTO t1 value(1);
 
70
      SET count = count -1;
 
71
   END WHILE;
 
72
END //
 
73
 
 
74
DELIMITER ;//
 
75
 
 
76
# setting 2 will allow data pointer to access files with size < 65536
 
77
SET @@global.myisam_data_pointer_size = 2;
 
78
 
 
79
CREATE TABLE t1(a INT);
 
80
 
 
81
CALL sp_addRec(65535);
 
82
 
 
83
--Error ER_RECORD_FILE_FULL
 
84
CALL sp_addRec(1);
 
85
 
 
86
SELECT count(*) from t1;
 
87
 
 
88
#=======================================================================
 
89
--echo '--Checking myisam_data_pointer_size with MAX_ROWS table option--'
 
90
#=======================================================================
 
91
 
 
92
# specifying MAX_ROWS table option renders pointer size useless
 
93
SET @@global.myisam_data_pointer_size = 2;
 
94
 
 
95
--disable_warnings
 
96
DROP TABLE IF EXISTS t1;
 
97
--enable_warnings
 
98
 
 
99
CREATE TABLE t1(a INT)MAX_ROWS=70000;
 
100
 
 
101
CALL sp_addRec(65536);
 
102
 
 
103
SELECT count(*) from t1;
 
104
 
 
105
DROP PROCEDURE  sp_addRec;
 
106
DROP TABLE t1;
 
107
SET @@global.myisam_data_pointer_size = DEFAULT;
 
108
 
 
109
################################################################
 
110
# End of functionality Testing for myisam_data_pointer_size    #
 
111
################################################################
 
112