mirror of
https://github.com/MariaDB/server.git
synced 2026-01-06 05:22:24 +03:00
WL#4681: Took the system variable tests out of the main test suite, put them into "sys_vars", updated some reult files and tests.
This commit is contained in:
106
mysql-test/suite/sys_vars/t/myisam_stats_method_func.test
Normal file
106
mysql-test/suite/sys_vars/t/myisam_stats_method_func.test
Normal file
@@ -0,0 +1,106 @@
|
||||
############## mysql-test\t\myisam_stats_method_func.test ####################
|
||||
# #
|
||||
# Variable Name: myisam_stats_method #
|
||||
# Scope: GLOBAL | SESSION #
|
||||
# Access Type: Dynamic #
|
||||
# Data Type: enumeration #
|
||||
# Default Value: nulls_equal #
|
||||
# Valid Values: nulls_equal, nulls_unequal #
|
||||
# #
|
||||
# #
|
||||
# Creation Date: 2008-03-08 #
|
||||
# Author: Rizwan #
|
||||
# #
|
||||
# Description: Test Cases of Dynamic System Variable myisam_stats_method #
|
||||
# that checks the behavior of this variable #
|
||||
# #
|
||||
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
|
||||
# server-system-variables.html #
|
||||
# #
|
||||
###############################################################################
|
||||
|
||||
--echo '#--------------------FN_DYNVARS_097_01-------------------------#'
|
||||
#####################################################################
|
||||
# Check if Setting myisam_stats_method is changed in new connection #
|
||||
#####################################################################
|
||||
|
||||
SET @@global.myisam_stats_method = nulls_equal;
|
||||
--echo 'connect (con1,localhost,root,,,,)'
|
||||
connect (con1,localhost,root,,,,);
|
||||
--echo 'connection con1'
|
||||
connection con1;
|
||||
SELECT @@global.myisam_stats_method;
|
||||
SELECT @@session.myisam_stats_method;
|
||||
disconnect con1;
|
||||
|
||||
--echo '#--------------------FN_DYNVARS_097_02-------------------------#'
|
||||
###########################################################
|
||||
# Begin the functionality Testing of myisam_stats_method #
|
||||
###########################################################
|
||||
|
||||
--echo 'connection default'
|
||||
connection default;
|
||||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1;
|
||||
--enable_warnings
|
||||
|
||||
CREATE TABLE t1 (a int, key (a));
|
||||
INSERT INTO t1 VALUES (0),(1),(2),(3),(4);
|
||||
INSERT INTO t1 SELECT NULL FROM t1;
|
||||
|
||||
#=======================================
|
||||
--echo 'default: NULLs considered unequal'
|
||||
#=======================================
|
||||
SET myisam_stats_method=nulls_unequal;
|
||||
|
||||
ANALYZE TABLE t1;
|
||||
SHOW INDEX FROM t1;
|
||||
INSERT INTO t1 VALUES (11);
|
||||
DELETE FROM t1 WHERE a=11;
|
||||
CHECK TABLE t1;
|
||||
SHOW INDEX FROM t1;
|
||||
|
||||
|
||||
#=====================================
|
||||
--echo 'Set nulls to be equal'
|
||||
#=====================================
|
||||
SET myisam_stats_method=nulls_equal;
|
||||
|
||||
INSERT INTO t1 VALUES (11);
|
||||
DELETE FROM t1 WHERE a=11;
|
||||
ANALYZE TABLE t1;
|
||||
SHOW INDEX FROM t1;
|
||||
INSERT INTO t1 VALUES (11);
|
||||
DELETE FROM t1 WHERE a=11;
|
||||
CHECK TABLE t1;
|
||||
SHOW INDEX FROM t1;
|
||||
|
||||
#=====================================
|
||||
--echo 'Set nulls to be ignored'
|
||||
#=====================================
|
||||
|
||||
SET myisam_stats_method=nulls_ignored;
|
||||
SHOW variables LIKE 'myisam_stats_method';
|
||||
drop TABLE t1;
|
||||
|
||||
CREATE TABLE t1 (
|
||||
a char(3), b char(4), c char(5), d char(6),
|
||||
key(a,b,c,d)
|
||||
);
|
||||
INSERT INTO t1 VALUES ('bcd','def1', NULL, 'zz');
|
||||
INSERT INTO t1 VALUES ('bcd','def2', NULL, 'zz');
|
||||
INSERT INTO t1 VALUES ('bce','def1', 'yuu', NULL);
|
||||
INSERT INTO t1 VALUES ('bce','def2', NULL, 'quux');
|
||||
ANALYZE TABLE t1;
|
||||
SHOW INDEX FROM t1;
|
||||
DELETE FROM t1;
|
||||
ANALYZE TABLE t1;
|
||||
SHOW INDEX FROM t1;
|
||||
|
||||
SET myisam_stats_method=DEFAULT;
|
||||
DROP TABLE t1;
|
||||
|
||||
########################################################
|
||||
# End of functionality Testing for myisam_stats_method #
|
||||
########################################################
|
||||
Reference in New Issue
Block a user