Debian Codegraph @

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

raw
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: #
18 # http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html #
19 # #
20 ################################################################################
21
22 call mtr.add_suppression("The table 't1' is full");
23
24 --echo '#--------------------FN_DYNVARS_093_01-------------------------#'
25 ###############################################################################
26 # Check if setting myisam_data_pointer_size is changed in every new connection#
27 ###############################################################################
28
29 SET @start_value= @@global.myisam_data_pointer_size;
30 SET @@global.myisam_data_pointer_size = 2;
31 # con1 will be default connection from now on
32 connect (con1,localhost,root,,,,);
33 connection con1;
34 SELECT @@global.myisam_data_pointer_size;
35 SET @@global.myisam_data_pointer_size = 3;
36 connect (con2,localhost,root,,,,);
37 connection con2;
38 SELECT @@global.myisam_data_pointer_size;
39 disconnect con2;
40
41
42 --echo '#--------------------FN_DYNVARS_093_02-------------------------#'
43 #################################################################
44 # Begin the functionality Testing of myisam_data_pointer_size #
45 #################################################################
46
47 connection con1;
48
49 #===========================================================
50 # Checking myisam_data_pointer_size is 2
51 #===========================================================
52
53 # create sp to add 'count' records
54 --disable_warnings
55 DROP PROCEDURE IF EXISTS sp_addRec;
56 DROP TABLE IF EXISTS t1;
57 --enable_warnings
58
59 DELIMITER //;
60 CREATE PROCEDURE sp_addRec(IN count INT)
61 BEGIN
62 WHILE (count>0) DO
63 INSERT INTO t1 value(1);
64 SET count = count -1;
65 END WHILE;
66 END //
67 DELIMITER ;//
68
69 # setting 2 will allow data pointer to access files with size < 65536
70 SET @@global.myisam_data_pointer_size = 2;
71
72 CREATE TABLE t1(a INT);
73
74 CALL sp_addRec(65535);
75
76 --Error ER_RECORD_FILE_FULL
77 CALL sp_addRec(1);
78
79 SELECT count(*) from t1;
80
81 #=======================================================================
82 --echo '--Checking myisam_data_pointer_size with MAX_ROWS table option--'
83 #=======================================================================
84
85 # specifying MAX_ROWS table option renders pointer size useless
86 SET @@global.myisam_data_pointer_size = 2;
87
88 --disable_warnings
89 DROP TABLE IF EXISTS t1;
90 --enable_warnings
91
92 CREATE TABLE t1(a INT)MAX_ROWS=70000;
93
94 CALL sp_addRec(65536);
95
96 SELECT count(*) from t1;
97
98 DROP PROCEDURE sp_addRec;
99 DROP TABLE t1;
100
101 connection default;
102 SET @@global.myisam_data_pointer_size= @start_value;
103 ################################################################
104 # End of functionality Testing for myisam_data_pointer_size #
105 ################################################################
106