1
############## mysql-test\t\myisam_data_pointer_size_func.test ################
3
# Variable Name: myisam_data_pointer_size #
4
# Scope: GLOBAL & SESSION #
5
# Access Type: Dynamic #
11
# Creation Date: 2008-03-08 #
12
# Author: Rizwan Maredia #
14
# Description: Test Cases of Dynamic System Variable myisam_data_pointer_size #
15
# that checks the behavior of this variable #
17
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
18
# server-system-variables.html #
20
################################################################################
22
--echo '#--------------------FN_DYNVARS_093_01-------------------------#'
23
###############################################################################
24
# Check if setting myisam_data_pointer_size is changed in every new connection#
25
###############################################################################
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'
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'
39
SELECT @@global.myisam_data_pointer_size;
43
--echo '#--------------------FN_DYNVARS_093_02-------------------------#'
44
#################################################################
45
# Begin the functionality Testing of myisam_data_pointer_size #
46
#################################################################
48
--echo 'connection con1'
52
#===========================================================
53
# Checking myisam_data_pointer_size is 2
54
#===========================================================
56
# create sp to add 'count' records
58
DROP PROCEDURE IF EXISTS sp_addRec;
59
DROP TABLE IF EXISTS t1;
66
CREATE PROCEDURE sp_addRec(IN count INT)
69
INSERT INTO t1 value(1);
76
# setting 2 will allow data pointer to access files with size < 65536
77
SET @@global.myisam_data_pointer_size = 2;
79
CREATE TABLE t1(a INT);
81
CALL sp_addRec(65535);
83
--Error ER_RECORD_FILE_FULL
86
SELECT count(*) from t1;
88
#=======================================================================
89
--echo '--Checking myisam_data_pointer_size with MAX_ROWS table option--'
90
#=======================================================================
92
# specifying MAX_ROWS table option renders pointer size useless
93
SET @@global.myisam_data_pointer_size = 2;
96
DROP TABLE IF EXISTS t1;
99
CREATE TABLE t1(a INT)MAX_ROWS=70000;
101
CALL sp_addRec(65536);
103
SELECT count(*) from t1;
105
DROP PROCEDURE sp_addRec;
107
SET @@global.myisam_data_pointer_size = DEFAULT;
109
################################################################
110
# End of functionality Testing for myisam_data_pointer_size #
111
################################################################