1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

merge from 5.5 main

This commit is contained in:
Bjorn Munch
2011-08-22 13:32:11 +02:00
56 changed files with 1554 additions and 186 deletions

View File

@ -0,0 +1,18 @@
CREATE TABLE bug59733(a INT AUTO_INCREMENT PRIMARY KEY,b CHAR(1))ENGINE=InnoDB;
INSERT INTO bug59733 VALUES(0,'x');
INSERT INTO bug59733 SELECT 0,b FROM bug59733;
INSERT INTO bug59733 SELECT 0,b FROM bug59733;
INSERT INTO bug59733 SELECT 0,b FROM bug59733;
INSERT INTO bug59733 SELECT 0,b FROM bug59733;
INSERT INTO bug59733 SELECT 0,b FROM bug59733;
INSERT INTO bug59733 SELECT 0,b FROM bug59733;
INSERT INTO bug59733 SELECT 0,b FROM bug59733;
INSERT INTO bug59733 SELECT 0,b FROM bug59733;
INSERT INTO bug59733 SELECT 0,b FROM bug59733;
INSERT INTO bug59733 SELECT 0,b FROM bug59733;
INSERT INTO bug59733 SELECT 0,b FROM bug59733;
CREATE INDEX b ON bug59733 (b);
DELETE FROM bug59733 WHERE (a%100)=0;
DROP INDEX b ON bug59733;
CREATE INDEX b ON bug59733 (b);
DROP TABLE bug59733;

View File

@ -0,0 +1,81 @@
set names utf8;
CREATE TABLE corrupt_bit_test_ā(
a INT AUTO_INCREMENT PRIMARY KEY,
b CHAR(100),
c INT,
z INT,
INDEX(b))
ENGINE=InnoDB;
INSERT INTO corrupt_bit_test_ā VALUES(0,'x',1, 1);
CREATE UNIQUE INDEX idxā ON corrupt_bit_test_ā(c, b);
CREATE UNIQUE INDEX idxē ON corrupt_bit_test_ā(z, b);
SELECT * FROM corrupt_bit_test_ā;
a b c z
1 x 1 1
select @@unique_checks;
@@unique_checks
0
select @@innodb_change_buffering_debug;
@@innodb_change_buffering_debug
1
INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+1,z+1 FROM corrupt_bit_test_ā;
INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+10,z+10 FROM corrupt_bit_test_ā;
INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+20,z+20 FROM corrupt_bit_test_ā;
INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+50,z+50 FROM corrupt_bit_test_ā;
INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+100,z+100 FROM corrupt_bit_test_ā;
INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+200,z+200 FROM corrupt_bit_test_ā;
INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+400,z+400 FROM corrupt_bit_test_ā;
INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+800,z+800 FROM corrupt_bit_test_ā;
INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+1600,z+1600 FROM corrupt_bit_test_ā;
INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+4000,z+4000 FROM corrupt_bit_test_ā;
select count(*) from corrupt_bit_test_ā;
count(*)
1024
CREATE INDEX idx3 ON corrupt_bit_test_ā(b, c);
INSERT INTO corrupt_bit_test_ā VALUES(13000,'x',1,1);
CREATE INDEX idx4 ON corrupt_bit_test_ā(b, z);
check table corrupt_bit_test_ā;
Table Op Msg_type Msg_text
test.corrupt_bit_test_ā check Warning InnoDB: The B-tree of index "idxā" is corrupted.
test.corrupt_bit_test_ā check Warning InnoDB: The B-tree of index "idxē" is corrupted.
test.corrupt_bit_test_ā check error Corrupt
select c from corrupt_bit_test_ā;
ERROR HY000: Incorrect key file for table 'corrupt_bit_test_ā'; try to repair it
select z from corrupt_bit_test_ā;
ERROR HY000: Incorrect key file for table 'corrupt_bit_test_ā'; try to repair it
show warnings;
Level Code Message
Warning 179 InnoDB: Index "idxē" for table "test"."corrupt_bit_test_ā" is marked as corrupted
Error 1034 Incorrect key file for table 'corrupt_bit_test_ā'; try to repair it
insert into corrupt_bit_test_ā values (10001, "a", 20001, 20001);
select * from corrupt_bit_test_ā use index(primary) where a = 10001;
a b c z
10001 a 20001 20001
begin;
insert into corrupt_bit_test_ā values (10002, "a", 20002, 20002);
delete from corrupt_bit_test_ā where a = 10001;
insert into corrupt_bit_test_ā values (10001, "a", 20001, 20001);
rollback;
drop index idxā on corrupt_bit_test_ā;
check table corrupt_bit_test_ā;
Table Op Msg_type Msg_text
test.corrupt_bit_test_ā check Warning InnoDB: Index "idxē" is marked as corrupted
test.corrupt_bit_test_ā check error Corrupt
set names utf8;
select z from corrupt_bit_test_ā;
ERROR HY000: Incorrect key file for table 'corrupt_bit_test_ā'; try to repair it
drop index idxē on corrupt_bit_test_ā;
select z from corrupt_bit_test_ā limit 10;
z
20001
1
1
2
11
12
21
22
31
32
drop table corrupt_bit_test_ā;
SET GLOBAL innodb_change_buffering_debug = 0;

View File

@ -0,0 +1,53 @@
#
# Bug #59733 Possible deadlock when buffered changes are to be discarded
# in buf_page_create
#
-- source include/have_innodb.inc
-- disable_query_log
# The flag innodb_change_buffering_debug is only available in debug builds.
# It instructs InnoDB to try to evict pages from the buffer pool when
# change buffering is possible, so that the change buffer will be used
# whenever possible.
-- error 0,ER_UNKNOWN_SYSTEM_VARIABLE
SET @innodb_change_buffering_debug_orig = @@innodb_change_buffering_debug;
-- error 0,ER_UNKNOWN_SYSTEM_VARIABLE
SET GLOBAL innodb_change_buffering_debug = 1;
-- enable_query_log
CREATE TABLE bug59733(a INT AUTO_INCREMENT PRIMARY KEY,b CHAR(1))ENGINE=InnoDB;
# Create enough rows for the table, so that the insert buffer will be
# used. There must be multiple index pages, because changes to the
# root page are never buffered.
INSERT INTO bug59733 VALUES(0,'x');
INSERT INTO bug59733 SELECT 0,b FROM bug59733;
INSERT INTO bug59733 SELECT 0,b FROM bug59733;
INSERT INTO bug59733 SELECT 0,b FROM bug59733;
INSERT INTO bug59733 SELECT 0,b FROM bug59733;
INSERT INTO bug59733 SELECT 0,b FROM bug59733;
INSERT INTO bug59733 SELECT 0,b FROM bug59733;
INSERT INTO bug59733 SELECT 0,b FROM bug59733;
INSERT INTO bug59733 SELECT 0,b FROM bug59733;
INSERT INTO bug59733 SELECT 0,b FROM bug59733;
INSERT INTO bug59733 SELECT 0,b FROM bug59733;
INSERT INTO bug59733 SELECT 0,b FROM bug59733;
# Create the secondary index for which changes will be buffered.
CREATE INDEX b ON bug59733 (b);
# This should be buffered, if innodb_change_buffering_debug = 1 is in effect.
DELETE FROM bug59733 WHERE (a%100)=0;
# Drop the index in order to get free pages with orphaned buffered changes.
DROP INDEX b ON bug59733;
# Create the index and attempt to reuse pages for which buffered changes exist.
CREATE INDEX b ON bug59733 (b);
DROP TABLE bug59733;
-- disable_query_log
-- error 0, ER_UNKNOWN_SYSTEM_VARIABLE
SET GLOBAL innodb_change_buffering_debug = @innodb_change_buffering_debug_orig;

View File

@ -0,0 +1,120 @@
#
# Test for persistent corrupt bit for corrupted index and table
#
-- source include/have_innodb.inc
# This test needs debug server
--source include/have_debug.inc
-- disable_query_log
# This test setup is extracted from bug56680.test:
# The flag innodb_change_buffering_debug is only available in debug builds.
# It instructs InnoDB to try to evict pages from the buffer pool when
# change buffering is possible, so that the change buffer will be used
# whenever possible.
-- error 0,ER_UNKNOWN_SYSTEM_VARIABLE
SET @innodb_change_buffering_debug_orig = @@innodb_change_buffering_debug;
-- error 0,ER_UNKNOWN_SYSTEM_VARIABLE
SET GLOBAL innodb_change_buffering_debug = 1;
# Turn off Unique Check to create corrupted index with dup key
SET UNIQUE_CHECKS=0;
-- enable_query_log
set names utf8;
CREATE TABLE corrupt_bit_test_ā(
a INT AUTO_INCREMENT PRIMARY KEY,
b CHAR(100),
c INT,
z INT,
INDEX(b))
ENGINE=InnoDB;
INSERT INTO corrupt_bit_test_ā VALUES(0,'x',1, 1);
# This is the first unique index we intend to corrupt
CREATE UNIQUE INDEX idxā ON corrupt_bit_test_ā(c, b);
# This is the second unique index we intend to corrupt
CREATE UNIQUE INDEX idxē ON corrupt_bit_test_ā(z, b);
SELECT * FROM corrupt_bit_test_ā;
select @@unique_checks;
select @@innodb_change_buffering_debug;
# Create enough rows for the table, so that the insert buffer will be
# used for modifying the secondary index page. There must be multiple
# index pages, because changes to the root page are never buffered.
INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+1,z+1 FROM corrupt_bit_test_ā;
INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+10,z+10 FROM corrupt_bit_test_ā;
INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+20,z+20 FROM corrupt_bit_test_ā;
INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+50,z+50 FROM corrupt_bit_test_ā;
INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+100,z+100 FROM corrupt_bit_test_ā;
INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+200,z+200 FROM corrupt_bit_test_ā;
INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+400,z+400 FROM corrupt_bit_test_ā;
INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+800,z+800 FROM corrupt_bit_test_ā;
INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+1600,z+1600 FROM corrupt_bit_test_ā;
INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+4000,z+4000 FROM corrupt_bit_test_ā;
select count(*) from corrupt_bit_test_ā;
CREATE INDEX idx3 ON corrupt_bit_test_ā(b, c);
# Create a dup key error on index "idxē" and "idxā" by inserting a dup value
INSERT INTO corrupt_bit_test_ā VALUES(13000,'x',1,1);
# creating an index should succeed even if other secondary indexes are corrupted
CREATE INDEX idx4 ON corrupt_bit_test_ā(b, z);
# Check table will find the unique indexes corrupted
# with dup key
check table corrupt_bit_test_ā;
# This selection intend to use the corrupted index. Expect to fail
-- error ER_NOT_KEYFILE
select c from corrupt_bit_test_ā;
-- error ER_NOT_KEYFILE
select z from corrupt_bit_test_ā;
show warnings;
# Since corrupted index is a secondary index, we only disable such
# index and allow other DML to proceed
insert into corrupt_bit_test_ā values (10001, "a", 20001, 20001);
# This does not use the corrupted index, expect to succeed
select * from corrupt_bit_test_ā use index(primary) where a = 10001;
# Some more DMLs
begin;
insert into corrupt_bit_test_ā values (10002, "a", 20002, 20002);
delete from corrupt_bit_test_ā where a = 10001;
insert into corrupt_bit_test_ā values (10001, "a", 20001, 20001);
rollback;
# Drop one corrupted index before reboot
drop index idxā on corrupt_bit_test_ā;
check table corrupt_bit_test_ā;
set names utf8;
-- error ER_NOT_KEYFILE
select z from corrupt_bit_test_ā;
# Drop the corrupted index
drop index idxē on corrupt_bit_test_ā;
# Now select back to normal
select z from corrupt_bit_test_ā limit 10;
# Drop table
drop table corrupt_bit_test_ā;
-- error 0, ER_UNKNOWN_SYSTEM_VARIABLE
SET GLOBAL innodb_change_buffering_debug = 0;

View File

@ -11,7 +11,5 @@ There should be *no* long test name listed below:
select variable_name as `There should be *no* variables listed below:` from t2
left join t1 on variable_name=test_name where test_name is null;
There should be *no* variables listed below:
INNODB_LARGE_PREFIX
INNODB_LARGE_PREFIX
drop table t1;
drop table t2;

View File

@ -1,13 +1,29 @@
SET @start_global_value = @@global.innodb_file_per_table;
SELECT @start_global_value;
@start_global_value
0
'#---------------------BS_STVARS_028_01----------------------#'
SELECT COUNT(@@GLOBAL.innodb_file_per_table);
COUNT(@@GLOBAL.innodb_file_per_table)
1
1 Expected
'#---------------------BS_STVARS_028_02----------------------#'
SELECT COUNT(@@GLOBAL.innodb_file_per_table);
COUNT(@@GLOBAL.innodb_file_per_table)
SET @@global.innodb_file_per_table = 0;
SELECT @@global.innodb_file_per_table;
@@global.innodb_file_per_table
0
SET @@global.innodb_file_per_table ='On' ;
SELECT @@global.innodb_file_per_table;
@@global.innodb_file_per_table
1
SET @@global.innodb_file_per_table ='Off' ;
SELECT @@global.innodb_file_per_table;
@@global.innodb_file_per_table
0
SET @@global.innodb_file_per_table = 1;
SELECT @@global.innodb_file_per_table;
@@global.innodb_file_per_table
1
1 Expected
'#---------------------BS_STVARS_028_03----------------------#'
SELECT IF(@@GLOBAL.innodb_file_per_table,'ON','OFF') = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
@ -47,4 +63,7 @@ COUNT(@@GLOBAL.innodb_file_per_table)
1 Expected
SELECT innodb_file_per_table = @@SESSION.innodb_file_per_table;
ERROR 42S22: Unknown column 'innodb_file_per_table' in 'field list'
Expected error 'Readonly variable'
SET @@global.innodb_file_per_table = @start_global_value;
SELECT @@global.innodb_file_per_table;
@@global.innodb_file_per_table
0

View File

@ -0,0 +1,53 @@
'#---------------------BS_STVARS_031_01----------------------#'
SELECT COUNT(@@GLOBAL.innodb_force_load_corrupted);
COUNT(@@GLOBAL.innodb_force_load_corrupted)
1
1 Expected
'#---------------------BS_STVARS_031_02----------------------#'
SET @@GLOBAL.innodb_force_load_corrupted=1;
ERROR HY000: Variable 'innodb_force_load_corrupted' is a read only variable
Expected error 'Read only variable'
SELECT COUNT(@@GLOBAL.innodb_force_load_corrupted);
COUNT(@@GLOBAL.innodb_force_load_corrupted)
1
1 Expected
'#---------------------BS_STVARS_031_03----------------------#'
SELECT IF(@@GLOBAL.innodb_force_load_corrupted, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='innodb_force_load_corrupted';
IF(@@GLOBAL.innodb_force_load_corrupted, "ON", "OFF") = VARIABLE_VALUE
1
1 Expected
SELECT COUNT(@@GLOBAL.innodb_force_load_corrupted);
COUNT(@@GLOBAL.innodb_force_load_corrupted)
1
1 Expected
SELECT COUNT(VARIABLE_VALUE)
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='innodb_force_load_corrupted';
COUNT(VARIABLE_VALUE)
1
1 Expected
'#---------------------BS_STVARS_031_04----------------------#'
SELECT @@innodb_force_load_corrupted = @@GLOBAL.innodb_force_load_corrupted;
@@innodb_force_load_corrupted = @@GLOBAL.innodb_force_load_corrupted
1
1 Expected
'#---------------------BS_STVARS_031_05----------------------#'
SELECT COUNT(@@innodb_force_load_corrupted);
COUNT(@@innodb_force_load_corrupted)
1
1 Expected
SELECT COUNT(@@local.innodb_force_load_corrupted);
ERROR HY000: Variable 'innodb_force_load_corrupted' is a GLOBAL variable
Expected error 'Variable is a GLOBAL variable'
SELECT COUNT(@@SESSION.innodb_force_load_corrupted);
ERROR HY000: Variable 'innodb_force_load_corrupted' is a GLOBAL variable
Expected error 'Variable is a GLOBAL variable'
SELECT COUNT(@@GLOBAL.innodb_force_load_corrupted);
COUNT(@@GLOBAL.innodb_force_load_corrupted)
1
1 Expected
SELECT innodb_force_load_corrupted = @@SESSION.innodb_force_load_corrupted;
ERROR 42S22: Unknown column 'innodb_force_load_corrupted' in 'field list'
Expected error 'Readonly variable'

View File

@ -0,0 +1,92 @@
SET @start_global_value = @@global.innodb_large_prefix;
SELECT @start_global_value;
@start_global_value
0
Valid values are 'ON' and 'OFF'
select @@global.innodb_large_prefix in (0, 1);
@@global.innodb_large_prefix in (0, 1)
1
select @@global.innodb_large_prefix;
@@global.innodb_large_prefix
0
select @@session.innodb_large_prefix;
ERROR HY000: Variable 'innodb_large_prefix' is a GLOBAL variable
show global variables like 'innodb_large_prefix';
Variable_name Value
innodb_large_prefix OFF
show session variables like 'innodb_large_prefix';
Variable_name Value
innodb_large_prefix OFF
select * from information_schema.global_variables where variable_name='innodb_large_prefix';
VARIABLE_NAME VARIABLE_VALUE
INNODB_LARGE_PREFIX OFF
select * from information_schema.session_variables where variable_name='innodb_large_prefix';
VARIABLE_NAME VARIABLE_VALUE
INNODB_LARGE_PREFIX OFF
set global innodb_large_prefix='OFF';
select @@global.innodb_large_prefix;
@@global.innodb_large_prefix
0
select * from information_schema.global_variables where variable_name='innodb_large_prefix';
VARIABLE_NAME VARIABLE_VALUE
INNODB_LARGE_PREFIX OFF
select * from information_schema.session_variables where variable_name='innodb_large_prefix';
VARIABLE_NAME VARIABLE_VALUE
INNODB_LARGE_PREFIX OFF
set @@global.innodb_large_prefix=1;
select @@global.innodb_large_prefix;
@@global.innodb_large_prefix
1
select * from information_schema.global_variables where variable_name='innodb_large_prefix';
VARIABLE_NAME VARIABLE_VALUE
INNODB_LARGE_PREFIX ON
select * from information_schema.session_variables where variable_name='innodb_large_prefix';
VARIABLE_NAME VARIABLE_VALUE
INNODB_LARGE_PREFIX ON
set global innodb_large_prefix=0;
select @@global.innodb_large_prefix;
@@global.innodb_large_prefix
0
select * from information_schema.global_variables where variable_name='innodb_large_prefix';
VARIABLE_NAME VARIABLE_VALUE
INNODB_LARGE_PREFIX OFF
select * from information_schema.session_variables where variable_name='innodb_large_prefix';
VARIABLE_NAME VARIABLE_VALUE
INNODB_LARGE_PREFIX OFF
set @@global.innodb_large_prefix='ON';
select @@global.innodb_large_prefix;
@@global.innodb_large_prefix
1
select * from information_schema.global_variables where variable_name='innodb_large_prefix';
VARIABLE_NAME VARIABLE_VALUE
INNODB_LARGE_PREFIX ON
select * from information_schema.session_variables where variable_name='innodb_large_prefix';
VARIABLE_NAME VARIABLE_VALUE
INNODB_LARGE_PREFIX ON
set session innodb_large_prefix='OFF';
ERROR HY000: Variable 'innodb_large_prefix' is a GLOBAL variable and should be set with SET GLOBAL
set @@session.innodb_large_prefix='ON';
ERROR HY000: Variable 'innodb_large_prefix' is a GLOBAL variable and should be set with SET GLOBAL
set global innodb_large_prefix=1.1;
ERROR 42000: Incorrect argument type to variable 'innodb_large_prefix'
set global innodb_large_prefix=1e1;
ERROR 42000: Incorrect argument type to variable 'innodb_large_prefix'
set global innodb_large_prefix=2;
ERROR 42000: Variable 'innodb_large_prefix' can't be set to the value of '2'
NOTE: The following should fail with ER_WRONG_VALUE_FOR_VAR (BUG#50643)
set global innodb_large_prefix=-3;
select @@global.innodb_large_prefix;
@@global.innodb_large_prefix
1
select * from information_schema.global_variables where variable_name='innodb_large_prefix';
VARIABLE_NAME VARIABLE_VALUE
INNODB_LARGE_PREFIX ON
select * from information_schema.session_variables where variable_name='innodb_large_prefix';
VARIABLE_NAME VARIABLE_VALUE
INNODB_LARGE_PREFIX ON
set global innodb_large_prefix='AUTO';
ERROR 42000: Variable 'innodb_large_prefix' can't be set to the value of 'AUTO'
SET @@global.innodb_large_prefix = @start_global_value;
SELECT @@global.innodb_large_prefix;
@@global.innodb_large_prefix
0

View File

@ -1,13 +1,21 @@
SET @start_global_value=@@global.innodb_lock_wait_timeout;
SELECT @start_global_value;
@start_global_value
50
'#---------------------BS_STVARS_032_01----------------------#'
SELECT COUNT(@@GLOBAL.innodb_lock_wait_timeout);
COUNT(@@GLOBAL.innodb_lock_wait_timeout)
1
1 Expected
'#---------------------BS_STVARS_032_02----------------------#'
SELECT COUNT(@@GLOBAL.innodb_lock_wait_timeout);
COUNT(@@GLOBAL.innodb_lock_wait_timeout)
1
1 Expected
SET global innodb_lock_wait_timeout=60;
SELECT @@global.innodb_lock_wait_timeout;
@@global.innodb_lock_wait_timeout
60
SET session innodb_lock_wait_timeout=60;
SELECT @@session.innodb_lock_wait_timeout;
@@session.innodb_lock_wait_timeout
60
'#---------------------BS_STVARS_032_03----------------------#'
SELECT @@GLOBAL.innodb_lock_wait_timeout = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
@ -47,4 +55,7 @@ COUNT(@@GLOBAL.innodb_lock_wait_timeout)
1 Expected
SELECT innodb_lock_wait_timeout = @@SESSION.innodb_lock_wait_timeout;
ERROR 42S22: Unknown column 'innodb_lock_wait_timeout' in 'field list'
Expected error 'Readonly variable'
SET @@global.innodb_lock_wait_timeout = @start_global_value;
SELECT @@global.innodb_lock_wait_timeout;
@@global.innodb_lock_wait_timeout
50

View File

@ -1,8 +1,7 @@
################# mysql-test\t\innodb_autoinc_lock_mode_basic.test ############
# #
# Variable Name: innodb_autoinc_lock_mode #
# Scope: GLOBAL #
# Access Type: Dynamic #
# Access Type: Static #
# Data Type: Numeric #
# Default Value: 1 #
# Range: 0,1,2 #

View File

@ -3,9 +3,9 @@
# Variable Name: innodb_fast_shutdown #
# Scope: GLOBAL #
# Access Type: Dynamic #
# Data Type: boolean #
# Data Type: numeric #
# Default Value: 1 #
# Valid Values: 0,1 #
# Valid Values: 0,1,2 #
# #
# #
# Creation Date: 2008-02-20 #

View File

@ -4,7 +4,7 @@
# #
# Variable Name: innodb_file_per_table #
# Scope: Global #
# Access Type: Static #
# Access Type: Dynamic #
# Data Type: boolean #
# #
# #
@ -24,6 +24,10 @@
--source include/have_innodb.inc
SET @start_global_value = @@global.innodb_file_per_table;
SELECT @start_global_value;
--echo '#---------------------BS_STVARS_028_01----------------------#'
####################################################################
# Displaying default value #
@ -37,11 +41,17 @@ SELECT COUNT(@@GLOBAL.innodb_file_per_table);
# Check if Value can set #
####################################################################
SELECT COUNT(@@GLOBAL.innodb_file_per_table);
--echo 1 Expected
SET @@global.innodb_file_per_table = 0;
SELECT @@global.innodb_file_per_table;
SET @@global.innodb_file_per_table ='On' ;
SELECT @@global.innodb_file_per_table;
SET @@global.innodb_file_per_table ='Off' ;
SELECT @@global.innodb_file_per_table;
SET @@global.innodb_file_per_table = 1;
SELECT @@global.innodb_file_per_table;
--echo '#---------------------BS_STVARS_028_03----------------------#'
#################################################################
@ -93,6 +103,10 @@ SELECT COUNT(@@GLOBAL.innodb_file_per_table);
--Error ER_BAD_FIELD_ERROR
SELECT innodb_file_per_table = @@SESSION.innodb_file_per_table;
--echo Expected error 'Readonly variable'
#
# Cleanup
#
SET @@global.innodb_file_per_table = @start_global_value;
SELECT @@global.innodb_file_per_table;

View File

@ -0,0 +1,102 @@
################## mysql-test\t\innodb_force_load_corrupted_basic.test #####
# #
# Variable Name: innodb_force_load_corrupted #
# Scope: Global #
# Access Type: Static #
# Data Type: boolean #
# #
# #
# Creation Date: 2008-02-07 #
# Author : Sharique Abdullah #
# #
# #
# Description:Test Cases of Dynamic System Variable innodb_force_load_corrupted#
# that checks the behavior of this variable in the following ways #
# * Value Check #
# * Scope Check #
# #
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
# server-system-variables.html #
# #
###############################################################################
--source include/have_innodb.inc
--echo '#---------------------BS_STVARS_031_01----------------------#'
####################################################################
# Displaying default value #
####################################################################
SELECT COUNT(@@GLOBAL.innodb_force_load_corrupted);
--echo 1 Expected
--echo '#---------------------BS_STVARS_031_02----------------------#'
####################################################################
# Check if Value can set #
####################################################################
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SET @@GLOBAL.innodb_force_load_corrupted=1;
--echo Expected error 'Read only variable'
SELECT COUNT(@@GLOBAL.innodb_force_load_corrupted);
--echo 1 Expected
--echo '#---------------------BS_STVARS_031_03----------------------#'
#################################################################
# Check if the value in GLOBAL Table matches value in variable #
#################################################################
SELECT IF(@@GLOBAL.innodb_force_load_corrupted, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='innodb_force_load_corrupted';
--echo 1 Expected
SELECT COUNT(@@GLOBAL.innodb_force_load_corrupted);
--echo 1 Expected
SELECT COUNT(VARIABLE_VALUE)
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='innodb_force_load_corrupted';
--echo 1 Expected
--echo '#---------------------BS_STVARS_031_04----------------------#'
################################################################################
# Check if accessing variable with and without GLOBAL point to same variable #
################################################################################
SELECT @@innodb_force_load_corrupted = @@GLOBAL.innodb_force_load_corrupted;
--echo 1 Expected
--echo '#---------------------BS_STVARS_031_05----------------------#'
################################################################################
# Check if innodb_force_load_corrupted can be accessed with and without @@ sign #
################################################################################
SELECT COUNT(@@innodb_force_load_corrupted);
--echo 1 Expected
--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT COUNT(@@local.innodb_force_load_corrupted);
--echo Expected error 'Variable is a GLOBAL variable'
--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT COUNT(@@SESSION.innodb_force_load_corrupted);
--echo Expected error 'Variable is a GLOBAL variable'
SELECT COUNT(@@GLOBAL.innodb_force_load_corrupted);
--echo 1 Expected
--Error ER_BAD_FIELD_ERROR
SELECT innodb_force_load_corrupted = @@SESSION.innodb_force_load_corrupted;
--echo Expected error 'Readonly variable'

View File

@ -54,5 +54,9 @@ select * from information_schema.global_variables where variable_name='innodb_io
set global innodb_io_capacity=100;
select @@global.innodb_io_capacity;
#
# cleanup
#
SET @@global.innodb_io_capacity = @start_global_value;
SELECT @@global.innodb_io_capacity;

View File

@ -0,0 +1,70 @@
# 2010-01-25 - Added
#
--source include/have_innodb.inc
SET @start_global_value = @@global.innodb_large_prefix;
SELECT @start_global_value;
#
# exists as global only
#
--echo Valid values are 'ON' and 'OFF'
select @@global.innodb_large_prefix in (0, 1);
select @@global.innodb_large_prefix;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
select @@session.innodb_large_prefix;
show global variables like 'innodb_large_prefix';
show session variables like 'innodb_large_prefix';
select * from information_schema.global_variables where variable_name='innodb_large_prefix';
select * from information_schema.session_variables where variable_name='innodb_large_prefix';
#
# show that it's writable
#
set global innodb_large_prefix='OFF';
select @@global.innodb_large_prefix;
select * from information_schema.global_variables where variable_name='innodb_large_prefix';
select * from information_schema.session_variables where variable_name='innodb_large_prefix';
set @@global.innodb_large_prefix=1;
select @@global.innodb_large_prefix;
select * from information_schema.global_variables where variable_name='innodb_large_prefix';
select * from information_schema.session_variables where variable_name='innodb_large_prefix';
set global innodb_large_prefix=0;
select @@global.innodb_large_prefix;
select * from information_schema.global_variables where variable_name='innodb_large_prefix';
select * from information_schema.session_variables where variable_name='innodb_large_prefix';
set @@global.innodb_large_prefix='ON';
select @@global.innodb_large_prefix;
select * from information_schema.global_variables where variable_name='innodb_large_prefix';
select * from information_schema.session_variables where variable_name='innodb_large_prefix';
--error ER_GLOBAL_VARIABLE
set session innodb_large_prefix='OFF';
--error ER_GLOBAL_VARIABLE
set @@session.innodb_large_prefix='ON';
#
# incorrect types
#
--error ER_WRONG_TYPE_FOR_VAR
set global innodb_large_prefix=1.1;
--error ER_WRONG_TYPE_FOR_VAR
set global innodb_large_prefix=1e1;
--error ER_WRONG_VALUE_FOR_VAR
set global innodb_large_prefix=2;
--echo NOTE: The following should fail with ER_WRONG_VALUE_FOR_VAR (BUG#50643)
set global innodb_large_prefix=-3;
select @@global.innodb_large_prefix;
select * from information_schema.global_variables where variable_name='innodb_large_prefix';
select * from information_schema.session_variables where variable_name='innodb_large_prefix';
--error ER_WRONG_VALUE_FOR_VAR
set global innodb_large_prefix='AUTO';
#
# Cleanup
#
SET @@global.innodb_large_prefix = @start_global_value;
SELECT @@global.innodb_large_prefix;

View File

@ -3,13 +3,13 @@
################## mysql-test\t\innodb_lock_wait_timeout_basic.test ###########
# #
# Variable Name: innodb_lock_wait_timeout #
# Scope: Global #
# Access Type: Static #
# Scope: Global , Session #
# Access Type: Dynamic #
# Data Type: numeric #
# #
# #
# Creation Date: 2008-02-07 #
# Author : Sharique Abdullah #
# Author : Sharique Abdullah #
# #
# #
# Description:Test Cases of Dynamic System Variable innodb_lock_wait_timeout #
@ -24,6 +24,9 @@
--source include/have_innodb.inc
SET @start_global_value=@@global.innodb_lock_wait_timeout;
SELECT @start_global_value;
--echo '#---------------------BS_STVARS_032_01----------------------#'
####################################################################
# Displaying default value #
@ -37,11 +40,10 @@ SELECT COUNT(@@GLOBAL.innodb_lock_wait_timeout);
# Check if Value can set #
####################################################################
SELECT COUNT(@@GLOBAL.innodb_lock_wait_timeout);
--echo 1 Expected
SET global innodb_lock_wait_timeout=60;
SELECT @@global.innodb_lock_wait_timeout;
SET session innodb_lock_wait_timeout=60;
SELECT @@session.innodb_lock_wait_timeout;
--echo '#---------------------BS_STVARS_032_03----------------------#'
#################################################################
@ -89,6 +91,10 @@ SELECT COUNT(@@GLOBAL.innodb_lock_wait_timeout);
--Error ER_BAD_FIELD_ERROR
SELECT innodb_lock_wait_timeout = @@SESSION.innodb_lock_wait_timeout;
--echo Expected error 'Readonly variable'
#
# Cleanup
#
SET @@global.innodb_lock_wait_timeout = @start_global_value;
SELECT @@global.innodb_lock_wait_timeout;

View File

@ -4,8 +4,8 @@
# Scope: GLOBAL #
# Access Type: Dynamic #
# Data Type: Numeric #
# Default Value: 90 #
# Range: 0-1000 #
# Default Value: 75 #
# Range: 0-99 #
# #
# #
# Creation Date: 2008-02-07 #