summaryrefslogtreecommitdiff
path: root/mysql-test/suite/sys_vars/t/myisam_data_pointer_size_func.test
blob: 48016056886ddf52f57225b562d8748df21950d2 (plain)
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
103
104
105
106
############## mysql-test\t\myisam_data_pointer_size_func.test  ################
#                                                                              #
# Variable Name: myisam_data_pointer_size                                      #
# Scope: GLOBAL & SESSION                                                      #
# Access Type: Dynamic                                                         #
# Data Type: Numeric                                                           #
# Default Value: 1                                                             #
# Range: 1 - 65536                                                             #
#                                                                              #
#                                                                              #
# Creation Date: 2008-03-08                                                    #
# Author:  Rizwan Maredia                                                      #
#                                                                              #
# Description: Test Cases of Dynamic System Variable myisam_data_pointer_size  #
#              that checks the behavior of this variable                       #
#                                                                              #
# Reference:                                                                   #
#  http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html         #
#                                                                              #
################################################################################

call mtr.add_suppression("The table 't1' is full");

--echo '#--------------------FN_DYNVARS_093_01-------------------------#'
###############################################################################
# Check if setting myisam_data_pointer_size is changed in every new connection#
###############################################################################

SET @start_value= @@global.myisam_data_pointer_size;
SET @@global.myisam_data_pointer_size = 2;
# con1 will be default connection from now on
connect (con1,localhost,root,,,,);
connection con1;
SELECT @@global.myisam_data_pointer_size;
SET @@global.myisam_data_pointer_size = 3;
connect (con2,localhost,root,,,,);
connection con2;
SELECT @@global.myisam_data_pointer_size;
disconnect con2;


--echo '#--------------------FN_DYNVARS_093_02-------------------------#'
#################################################################
# Begin the functionality Testing of myisam_data_pointer_size   #
#################################################################

connection con1;

#===========================================================
# Checking myisam_data_pointer_size is 2
#===========================================================

# create sp to add 'count' records
--disable_warnings
DROP PROCEDURE IF EXISTS sp_addRec;
DROP TABLE IF EXISTS t1;
--enable_warnings

DELIMITER //;
CREATE PROCEDURE sp_addRec(IN count INT)
BEGIN
   WHILE (count>0) DO
      INSERT INTO t1 value(1);
      SET count = count -1;
   END WHILE;
END //
DELIMITER ;//

# setting 2 will allow data pointer to access files with size < 65536
SET @@global.myisam_data_pointer_size = 2;

CREATE TABLE t1(a INT);

CALL sp_addRec(65535);

--Error ER_RECORD_FILE_FULL
CALL sp_addRec(1);

SELECT count(*) from t1;

#=======================================================================
--echo '--Checking myisam_data_pointer_size with MAX_ROWS table option--'
#=======================================================================

# specifying MAX_ROWS table option renders pointer size useless
SET @@global.myisam_data_pointer_size = 2;

--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings

CREATE TABLE t1(a INT)MAX_ROWS=70000;

CALL sp_addRec(65536);

SELECT count(*) from t1;

DROP PROCEDURE  sp_addRec;
DROP TABLE t1;

connection default;
SET @@global.myisam_data_pointer_size= @start_value;
################################################################
# End of functionality Testing for myisam_data_pointer_size    #
################################################################