Browse Source
branches/zip: Fix an issue that a local variable defined
branches/zip: Fix an issue that a local variable defined
in innodb_file_format_check_validate() is being referenced across function in innodb_file_format_check_update(). In addition, fix "set global innodb_file_format_check = DEFAULT" call. Bug #47167: "set global innodb_file_format_check" cannot set value by User-Defined Variable." rb://169 approved by Sunny Bains and Marko.pull/73/head
4 changed files with 114 additions and 29 deletions
-
72handler/ha_innodb.cc
-
24mysql-test/innodb_bug47167.result
-
45mysql-test/innodb_bug47167.test
-
2mysql-test/innodb_file_format.result
@ -0,0 +1,24 @@ |
|||
set @old_innodb_file_format_check=@@innodb_file_format_check; |
|||
select @old_innodb_file_format_check; |
|||
@old_innodb_file_format_check |
|||
Antelope |
|||
set global innodb_file_format_check = Barracuda; |
|||
select @@innodb_file_format_check; |
|||
@@innodb_file_format_check |
|||
Barracuda |
|||
set global innodb_file_format_check = DEFAULT; |
|||
select @@innodb_file_format_check; |
|||
@@innodb_file_format_check |
|||
Barracuda |
|||
set global innodb_file_format_check = @old_innodb_file_format_check; |
|||
select @@innodb_file_format_check; |
|||
@@innodb_file_format_check |
|||
Antelope |
|||
set global innodb_file_format_check = cheetah; |
|||
ERROR HY000: Incorrect arguments to SET |
|||
set global innodb_file_format_check = Bear; |
|||
ERROR HY000: Incorrect arguments to SET |
|||
set global innodb_file_format_check = on; |
|||
ERROR HY000: Incorrect arguments to SET |
|||
set global innodb_file_format_check = off; |
|||
ERROR HY000: Incorrect arguments to SET |
|||
@ -0,0 +1,45 @@ |
|||
# This is the unit test for bug *47167. |
|||
# It tests setting the global variable |
|||
# "innodb_file_format_check" with a |
|||
# user-Defined Variable. |
|||
|
|||
--source include/have_innodb.inc |
|||
|
|||
# Save the value (Antelope) in 'innodb_file_format_check' to |
|||
# 'old_innodb_file_format_check' |
|||
set @old_innodb_file_format_check=@@innodb_file_format_check; |
|||
|
|||
# @old_innodb_file_format_check shall have the value of 'Antelope' |
|||
select @old_innodb_file_format_check; |
|||
|
|||
# Reset the value in 'innodb_file_format_check' to 'Barracuda' |
|||
set global innodb_file_format_check = Barracuda; |
|||
|
|||
select @@innodb_file_format_check; |
|||
|
|||
# Set 'innodb_file_format_check' to its default value, which |
|||
# is the latest file format supported in the current release. |
|||
set global innodb_file_format_check = DEFAULT; |
|||
|
|||
select @@innodb_file_format_check; |
|||
|
|||
# Put the saved value back to 'innodb_file_format_check' |
|||
set global innodb_file_format_check = @old_innodb_file_format_check; |
|||
|
|||
# Check whether 'innodb_file_format_check' get its original value. |
|||
select @@innodb_file_format_check; |
|||
|
|||
# Following are negative tests, all should fail. |
|||
--disable_warnings |
|||
--error ER_WRONG_ARGUMENTS |
|||
set global innodb_file_format_check = cheetah; |
|||
|
|||
--error ER_WRONG_ARGUMENTS |
|||
set global innodb_file_format_check = Bear; |
|||
|
|||
--error ER_WRONG_ARGUMENTS |
|||
set global innodb_file_format_check = on; |
|||
|
|||
--error ER_WRONG_ARGUMENTS |
|||
set global innodb_file_format_check = off; |
|||
--enable_warnings |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue