Debian Codegraph @

mysql-test/suite/sys_vars/t/myisam_data_pointer_size_func.test

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